query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
pg. 872 : "If we then normalize the scores and repeat k times the process will converge"
private boolean convergence(List<Page> pages) { double aveHubDelta = 100; double aveAuthDelta = 100; if (pages == null) { return true; } // get current values from pages double[] currHubVals = new double[pages.size()]; double[] currAuthVals = new double[pages.size()]; for (int i = 0; i < pages.size(); i++) { Page currPage = pages.get(i); currHubVals[i] = currPage.hub; currHubVals[i] = currPage.authority; } if (prevHubVals == null || prevAuthVals == null) { prevHubVals = currHubVals; prevAuthVals = currAuthVals; return false; } // compare to past values aveHubDelta = getAveDelta(currHubVals, prevHubVals); aveAuthDelta = getAveDelta(currAuthVals, prevAuthVals); if (aveHubDelta + aveAuthDelta < DELTA_TOLERANCE || (Math.abs(prevAveHubDelta - aveHubDelta) < 0.01 && Math.abs(prevAveAuthDelta - aveAuthDelta) < 0.01)) { return true; } else { prevHubVals = currHubVals; prevAuthVals = currAuthVals; prevAveHubDelta = aveHubDelta; prevAveAuthDelta = aveAuthDelta; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected float computeModelScoreOnTraining() {\n/* 508 */ float s = computeModelScoreOnTraining(0, this.samples.size() - 1, 0);\n/* 509 */ s /= this.samples.size();\n/* 510 */ return s;\n/* */ }", "private static void runAll() throws InterruptedException {\r\n\t\tSystem.out.println(RankEvaluator.printTitle() + \"\\tAvgP\\tTrain Time\\tTest Time\");\r\n\t\t\r\n\t\t// Prefetching user/item similarity:\r\n\t\tif (userSimilarityPrefetch) {\r\n\t\t\tuserSimilarity = calculateUserSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tuserSimilarity = new SparseMatrix(userCount+1, userCount+1);\r\n\t\t}\r\n\t\t\r\n\t\tif (itemSimilarityPrefetch) {\r\n\t\t\titemSimilarity = calculateItemSimilarity(MATRIX_FACTORIZATION, ARC_COS, 0);\r\n\t\t}\r\n\t\telse {\r\n\t\t\titemSimilarity = new SparseMatrix(itemCount+1, itemCount+1);\r\n\t\t}\r\n\t\t\r\n\t\t// Regularized SVD\r\n\t\tint[] svdRank = {1, 5, 10};\r\n\t\t\r\n\t\tfor (int r : svdRank) {\r\n\t\t\tdouble learningRate = 0.005;\r\n\t\t\tdouble regularizer = 0.1;\r\n\t\t\tint maxIter = 100;\r\n\t\t\t\r\n\t\t\tbaseline = new RegularizedSVD(userCount, itemCount, maxValue, minValue,\r\n\t\t\t\tr, learningRate, regularizer, 0, maxIter, false);\r\n\t\t\tSystem.out.println(\"SVD\\tFro\\t\" + r + \"\\t\" + testRecommender(\"SVD\", baseline));\r\n\t\t}\r\n\t\t\r\n\t\t// Rank-based SVD\r\n\t\tint[] rsvdRank = {1, 5, 10};\r\n\t\tfor (int r : rsvdRank) {\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOGISTIC_LOSS, r, 6000, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOG_LOSS_MULT, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.LOG_LOSS_ADD, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_LOSS_MULT, r, 370, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_LOSS_ADD, r, 25, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.HINGE_LOSS_MULT, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.HINGE_LOSS_ADD, r, 1700, true);\r\n\t\t\trunRankBasedSVD(RankEvaluator.EXP_REGRESSION, r, 40, true);\r\n\t\t}\r\n\t\t\r\n\t\t// Paired Global LLORMA\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 1, 1500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 5, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 5, 10, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 1, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 5, 2000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_MULT, 10, 10, 1000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 1, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 5, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 5, 10, 900, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 1, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 5, 3000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOG_LOSS_ADD, 10, 10, 2000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 1, 450, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 5, 250, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 5, 10, 110, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 1, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 5, 400, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_MULT, 10, 10, 200, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 1, 20, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 5, 13, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 5, 10, 7, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 1, 40, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 5, 25, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_LOSS_ADD, 10, 10, 15, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 1, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 5, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 5, 10, 300, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 1, 2000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 5, 1000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_MULT, 10, 10, 500, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 1, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 5, 1200, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 5, 10, 500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 1, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 5, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.HINGE_LOSS_ADD, 10, 10, 1000, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 1, 60, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 5, 40, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 5, 10, 20, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 1, 120, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 5, 80, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.EXP_REGRESSION, 10, 10, 40, true);\r\n\t\t\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 1, 4500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 5, 3500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 5, 10, 2500, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 1, 9000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 5, 7000, true);\r\n\t\trunPairedGlobalLLORMA(RankEvaluator.LOGISTIC_LOSS, 10, 10, 5000, true);\r\n\t}", "public void doValidation(int currentRound)\n {\n getData(currentRound);\n// System.out.println(\"training unterminated ones\");\n kMeans.setItems(trainingData.get(0));\n kMeans.k=k1;\n kMeans.init();\n List<Cluster> unterminatedClusters=kMeans.doCluster();\n for (int i=0;i<unterminatedClusters.size();i++)\n {\n unterminatedClusters.get(i).label=0;\n }\n \n// System.out.println(\"training terminated ones\");\n kMeans.setItems(trainingData.get(1));\n kMeans.k=k2;\n kMeans.init();\n List<Cluster> terminatedClusters=kMeans.doCluster();\n for (int i=0;i<terminatedClusters.size();i++)\n {\n terminatedClusters.get(i).label=1;\n }\n \n List<Cluster> clusters=new ArrayList<Cluster>();\n clusters.addAll(unterminatedClusters);\n clusters.addAll(terminatedClusters);\n kMeans.setClusters(clusters);\n int[] corrects=new int[2];\n int[] counts=new int[2];\n for (int i=0;i<2;i++)\n {\n corrects[i]=0;\n counts[i]=0;\n }\n for (Item item:testData)\n {\n int label=kMeans.getNearestCluster(item).label;\n counts[label]++;\n if (label==item.type)\n {\n corrects[item.type]++;\n }\n }\n correctness+=corrects[1]*1.0/counts[1];\n correctCount+=corrects[1];\n// for (int i=0;i<2;i++)\n// System.out.println(\"for type \"+i+\": \" +corrects[i]+\" correct out of \"+counts[i]+\" in total (\"+corrects[i]*1.0/counts[i]+\")\");\n }", "public int predict(int[] testData) {\n /*\n * kNN algorithm:\n * \n * This algorithm compare the distance of every training data to the test data using \n * the euclidean distance algorithm, and find a specfic amount of training data \n * that are closest to the test data (the value of k determine that amount). \n * \n * After that, the algorithm compare those data, and determine whether more of those\n * data are labeled with 0, or 1. And use that to give the guess\n * \n * To determine k: sqrt(amount of training data)\n */\n\n /*\n * Problem:\n * Since results and distances will be stored in different arrays, but in the same order,\n * sorting distances will mess up the label, which mess up the predictions\n * \n * Solution:\n * Instead of sorting distances, use a search algorithm, search for the smallest distance, and then\n * the second smallest number, and so on. Get the index of that number, use the index to \n * find the result, and store it in a new ArrayList for evaluation\n */\n\n // Step 1 : Determine k \n double k = Math.sqrt(this.trainingData.size());\n k = 3.0;\n\n // Step 2: Calculate distances\n // Create an ArrayList to hold all the distances calculated\n ArrayList<Double> distances = new ArrayList<Double>();\n // Create another ArrayList to store the results\n ArrayList<Integer> results = new ArrayList<Integer>();\n for (int[] i : this.trainingData) {\n // Create a temp array with the last item (result) eliminated\n int[] temp = Arrays.copyOf(i, i.length - 1);\n double distance = this.eucDistance(temp, testData);\n // Add both the result and the distance into associated arraylists\n results.add(i[i.length - 1]);\n distances.add(distance);\n }\n\n // Step 3: Search for the amount of highest points according to k\n ArrayList<Integer> closestResultLst = new ArrayList<Integer>();\n for (int i = 0; i < k; i++) {\n double smallestDistance = Collections.min(distances);\n int indexOfSmallestDistance = distances.indexOf(smallestDistance);\n int resultOfSmallestDistance = results.get(indexOfSmallestDistance);\n closestResultLst.add(resultOfSmallestDistance);\n // Set the smallest distance to null, so it won't be searched again\n distances.set(indexOfSmallestDistance, 10.0);\n }\n\n // Step 4: Determine which one should be the result by looking at the majority of the numbers\n int yes = 0, no = 0;\n for (int i : closestResultLst) {\n if (i == 1) {\n yes++;\n } else if (i == 0) {\n no++;\n }\n }\n\n // Step 5: Return the result\n // test code\n // System.out.println(yes);\n // System.out.println(no);\n if (yes >= no) {\n return 1;\n } else {\n return 0;\n }\n }", "private void processIterationResults(Map<String, List<MutablePair<String, Double>>> continuousChoices,\n\t\t\tMap<String, Pair<String, Double>> iterationChoices, Map<String, List<String>> clusters,\n\t\t\tList<Mention> copyContext) {\n\t\tfor (Map.Entry<String, Pair<String, Double>> iterationChoice : iterationChoices.entrySet()) {\n\t\t\tfinal String key = iterationChoice.getKey();\n\t\t\tList<MutablePair<String, Double>> continuousPairs = continuousChoices.get(key);\n\t\t\tif (continuousPairs == null) {\n\t\t\t\tcontinuousPairs = Lists.newArrayList();\n\t\t\t\tcontinuousChoices.put(key, continuousPairs);\n\t\t\t}\n\n\t\t\tboolean found = false;\n\t\t\tfinal Pair<String, Double> iterationChoicePair = iterationChoice.getValue();\n\t\t\tfor (MutablePair<String, Double> continuousPair : continuousPairs) {\n\t\t\t\tif (continuousPair.getKey().equals(iterationChoicePair.getKey())) {\n\t\t\t\t\t// Same entity = 'Collision' - so modify/update score accordingly\n\t\t\t\t\tfound = true;\n\t\t\t\t\t// It's the same pair, so let's combine them!\n\t\t\t\t\tfinal Double currentValue = continuousPair.getValue();\n\t\t\t\t\tfinal Double newValue = computeNewValue(this.context.size() - clusters.size(), currentValue,\n\t\t\t\t\t\t\titerationChoicePair.getValue());\n\t\t\t\t\tcontinuousPair.setValue(newValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!found) {\n\t\t\t\t// TODO: Check if logic really holds as rn I'm not sure whether there really is\n\t\t\t\t// exactly one pair here if it doesn't exist yet\n\t\t\t\t//\n\t\t\t\t// Not a collision, so just add it\n\t\t\t\tcontinuousPairs.add(new MutablePair<String, Double>(iterationChoicePair.getLeft(),\n\t\t\t\t\t\tinitVal(iterationChoicePair.getRight())));\n\t\t\t}\n\t\t}\n\n\t\tDouble minValue = Double.MAX_VALUE;\n\t\tPair<String, Double> minPair = null;\n\t\tString minKey = null;\n\t\t// Find the entity-score pair for the worst surface form\n\t\tfor (Map.Entry<String, Pair<String, Double>> e : iterationChoices.entrySet()) {\n\t\t\tfinal Pair<String, Double> currentPair = e.getValue();\n\t\t\tfinal Double currentValue = currentPair.getRight();\n\t\t\tif (currentValue <= minValue) {\n\t\t\t\tminKey = e.getKey();\n\t\t\t\tminPair = currentPair;\n\t\t\t\tminValue = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Remove surface form with worst result (as it likely is noise)\n\t\tclusters.remove(minKey);\n\t\tMentionUtils.removeStringMention(minKey, copyContext);\n\n\t}", "public void testAltScoring() throws Exception {\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n // alt1: 0 0 200\n \n String[] alt1rankData = {\n \"1,team1,1,200\",\n \"2,team2,1,200\", // tie-breaker causes rank 2\n };\n \n scoreboardTest (2, runsData, alt1rankData, alt1);\n // alt2: 30 5 0\n String[] alt2rankData = {\n \"1,team1,1,45\", // 1 no@30 each + 3 min * 5\n \"2,team2,1,150\", // 5*30\n };\n \n scoreboardTest (2, runsData, alt2rankData, alt2);\n \n // alt3: 0 10 0\n String[] alt3rankData = {\n \"1,team1,1,30\", // 3 min * 10\n \"2,team2,1,300\", // 30 min * 10\n };\n \n scoreboardTest (2, runsData, alt3rankData, alt3);\n \n // alt4: 5 0 20\n String[] alt4rankData = {\n \"1,team2,1,20\", // base yes\n \"2,team1,1,25\", // base yes + 1 no\n };\n \n scoreboardTest (2, runsData, alt4rankData, alt4);\n\n }", "protected float computeModelScoreOnValidation() {\n/* 549 */ float score = computeModelScoreOnValidation(0, this.validationSamples.size() - 1);\n/* 550 */ return score / this.validationSamples.size();\n/* */ }", "void calculateScore(){\r\n playerScore = 0;\r\n for(int i = 1; i<=10; i++) {\r\n scoreQuestion(i);\r\n }\r\n }", "public void evaluateUniformDistribution(String label) {\r\n // subtract one point for each card of same suit next to a card one away in rank\r\n // subtract two points for each run of two\r\n // three points for each run of three, etc.\r\n // add no points for two adjacent cards of same suit but not of sequential rank\r\n // add one point for two adjacent cards of different suit and same rank\r\n // add two points for two adjacent cards of different suit and sequential rank\r\n // add five points for two adjacent cards of different suit and different rank\r\n int score = 0;\r\n Card c = cards.get(0);\r\n Card d = null;\r\n boolean run = false;\r\n int runCount = 0;\r\n int diff = 0;\r\n for (int i = 1; i < cards.size(); i++) {\r\n d = cards.get(i);\r\n diff = c.getRank() - d.getRank();\r\n if (c.getSuit() == d.getSuit()) {\r\n // same suit\r\n if (diff == 1) { // sequential rank\r\n run = true;\r\n score -= (1 + (runCount*2));\r\n runCount++;\r\n }\r\n } else {\r\n // different suit\r\n if (diff == 0) { // same rank\r\n score++;\r\n } else if (diff == 1) { // sequential rank\r\n score += 2;\r\n } else {\r\n score += 5;\r\n }\r\n }\r\n c = d;\r\n }\r\n System.out.println(label + \" score: \" + score);\r\n }", "private double validate(int k) {\n\t\tArrayList<Product> allData = trainData;\n\t\tshuffle(allData);\n\t\tArrayList<Double> accurs = new ArrayList<Double>();\n\t\tif (k < 1 || k > allData.size()) return -1;\n\t\tint foldLength = allData.size() / k;\n\t\tfor (int i = 0; i < k; i++) {\n\t\t\tArrayList<Product> fold = new ArrayList<Product>();\n\t\t\tArrayList<Product> rest = new ArrayList<Product>();\n\t\t\tfold.addAll(allData.subList(i * foldLength, (i + 1) * foldLength));\n\t\t\trest.addAll(allData.subList(0, i * foldLength));\n\t\t\trest.addAll(allData.subList((i + 1) * foldLength, allData.size()));\n\t\t\tdouble[] predict = classify(fold, rest);\n\t\t\tdouble[] real = getLabels(fold);\n\t\t\taccurs.add(getAccuracyBinary(predict, real));\n\t\t}\n\t\tdouble accur = 0;\n\t\tfor (int i = 0; i < accurs.size(); i++) {\n\t\t\taccur += accurs.get(i);\n\t\t}\n\t\taccur /= accurs.size();\n\t\treturn accur;\n\t}", "public void normalize() {\r\n\t\tfor (int i = 0; i<no_goods; i++) {\t\t\t\r\n\t\t\tfor (IntegerArray r : prob[i].keySet()) {\t\t\t\t\r\n\t\t\t\tdouble[] p = prob[i].get(r);\r\n\t\t\t\tint s = sum[i].get(r);\r\n\t\t\t\t\r\n\t\t\t\tfor (int j = 0; j<p.length; j++)\r\n\t\t\t\t\tp[j] /= s;\r\n\t\t\t}\r\n\r\n\t\t\t// compute the marginal distribution for this good\r\n\t\t\tfor (int j = 0; j<no_bins; j++)\r\n\t\t\t\tmarg_prob[i][j] /= marg_sum;\r\n\t\t}\r\n\t\t\r\n\t\tready = true;\r\n\t}", "private void baseAlgorithm() {\n\t\tlong start = System.nanoTime();\n\t\tinitCentroids();\n\t\tint counter = 0;\n\t\twhile (counter < 1000\n\t\t\t\t&& (lastCentroids == null || !SeriesComparator.equalClustering(lastCentroids, centroids))) {\n\t\t\tresetClusters();\n\t\t\tassignPoints();\n\t\t\tlastCentroids = new ArrayList<Point2D>(centroids);\n\t\t\tcalculateNewMean();\n\t\t\tbasicIterations++;\n\t\t\tcounter++;\n\t\t}\n\t\tconvertToClustering();\n\t\tbasicRuntime = System.nanoTime() - start;\n\t}", "private void normalize(double[] scores, boolean wantSmall) {\n\n // Yes\n double randomLowValue = 0.00001;\n\n if (wantSmall) {\n double min = Double.MAX_VALUE;\n for (double score : scores) {\n if (score < min) min = score;\n }\n\n for (int i = 0; i < scores.length; i++) {\n scores[i] = min / Math.max(scores[i], randomLowValue);\n }\n\n } else {\n double max = Double.MIN_VALUE;\n for (double score : scores) {\n if (score > max) max = score;\n }\n\n if (max == 0) max = randomLowValue;\n for (int i = 0; i < scores.length; i++) {\n scores[i] = scores[i] / max;\n }\n }\n }", "public void calcScore(int score) {\r\n\t\tif (initFinish)\r\n\t\t\tthis.score += score * this.multy;\r\n\t\t// TODO delete\r\n//\t\tSystem.out.println(\"score: \" + this.score + \"multy: \" + this.multy);\r\n\t}", "public void scoresForGameModes() {\r\n \tCalculateScore myScore = new CalculateScore();\r\n \tthis.score = myScore.giveScore();\r\n \tif (gamemode == 1) {\r\n \t\treturn;\r\n \t}\r\n \tif (gamemode ==2 ) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() - set.size()));\r\n \t}\r\n \tif (gamemode ==3) {\r\n \t\tthis.score = this.score - (10 * (currentGraph.getCNumber() -set.size()));\r\n \t}\r\n }", "protected abstract void calcScores();", "public static void normalize()\n {\n int sum;\n\n for(int i=0;i<12;i++)\n {\n for(int j=0;j<12;j++) {\n sum = sumAll(i,j);\n if (sum != 0)\n for (int n = 0; n < 12; n++)\n weights[i][j][n] /= sum;\n }\n }\n }", "public void resetScore(){\n Set<String> keys = CalcScore.keySet();\n for(String key: keys){\n CalcScore.replace(key,0.0);\n }\n\n\n\n }", "private void updatePrecisionAndRecallAndAp(List<ScoreRetrieval> results, List<QuerieDocRelevance> queryRelevance){\n List<Double> precisionQuerieAP = new ArrayList<>();\n List<Double> precisionQuerieAPRankedTop = new ArrayList<>();\n int tp=0;\n int fp=0;\n int fn=0;\n int cont=0;\n int rankMax=10;\n \n //results.stream().map(ScoreRetrieval::getDocId).filter( docId -> querieRelevance.contains(docId)).mapToInt(List::size).sum();\n \n for(ScoreRetrieval result : results){\n if(queryRelevance.stream().filter(o -> o.getDocID()==result.getDocId()).findFirst().isPresent()){ \n tp++;\n precisionQuerieAP.add(tp/(double)(tp+fp));\n if(cont<rankMax){\n precisionQuerieAPRankedTop.add(tp/(double)(tp+fp));\n }\n }else{\n fp++;\n }\n cont++;\n }\n if(precisionQuerieAP.isEmpty()){\n apRes.add(0.0);\n }else{\n apRes.add(precisionQuerieAP.stream().mapToDouble(d->d).sum()/precisionQuerieAP.size());\n }\n if(precisionQuerieAPRankedTop.isEmpty()){\n apResRankedTopLimited.add(0.0);\n }else{\n apResRankedTopLimited.add(precisionQuerieAPRankedTop.stream().mapToDouble(d->d).sum()/precisionQuerieAPRankedTop.size());\n }\n \n \n for(QuerieDocRelevance querieRel : queryRelevance){\n if(!(results.stream().filter(q -> q.getDocId()==querieRel.getDocID()).findFirst().isPresent())){\n fn++; \n }\n }\n \n precision.add(tp/(double)(tp+fp));\n recall.add(tp/(double)(tp+fn));\n }", "@SuppressWarnings(\"MethodMayBeStatic\")\r\n public Counter<int[]> kBestSequences(SequenceModel ts, int k) {\r\n\r\n // Set up tag options\r\n int length = ts.length();\r\n int leftWindow = ts.leftWindow();\r\n int rightWindow = ts.rightWindow();\r\n\r\n if (rightWindow != 0) {\r\n throw new IllegalArgumentException(\"KBestSequenceFinder only works with rightWindow == 0 not \" + rightWindow);\r\n }\r\n\r\n int padLength = length + leftWindow + rightWindow;\r\n\r\n int[][] tags = new int[padLength][];\r\n int[] tagNum = new int[padLength];\r\n for (int pos = 0; pos < padLength; pos++) {\r\n tags[pos] = ts.getPossibleValues(pos);\r\n tagNum[pos] = tags[pos].length;\r\n }\r\n\r\n int[] tempTags = new int[padLength];\r\n\r\n // Set up product space sizes\r\n int[] productSizes = new int[padLength];\r\n\r\n int curProduct = 1;\r\n for (int i = 0; i < leftWindow; i++) {\r\n curProduct *= tagNum[i];\r\n }\r\n for (int pos = leftWindow; pos < padLength; pos++) {\r\n if (pos > leftWindow + rightWindow) {\r\n curProduct /= tagNum[pos - leftWindow - rightWindow - 1]; // shift off\r\n }\r\n curProduct *= tagNum[pos]; // shift on\r\n productSizes[pos - rightWindow] = curProduct;\r\n }\r\n\r\n double[][] windowScore = new double[padLength][];\r\n\r\n // Score all of each window's options\r\n for (int pos = leftWindow; pos < leftWindow + length; pos++) {\r\n windowScore[pos] = new double[productSizes[pos]];\r\n Arrays.fill(tempTags, tags[0][0]);\r\n\r\n for (int product = 0; product < productSizes[pos]; product++) {\r\n int p = product;\r\n int shift = 1;\r\n for (int curPos = pos; curPos >= pos - leftWindow; curPos--) {\r\n tempTags[curPos] = tags[curPos][p % tagNum[curPos]];\r\n p /= tagNum[curPos];\r\n if (curPos > pos) {\r\n shift *= tagNum[curPos];\r\n }\r\n }\r\n if (tempTags[pos] == tags[pos][0]) {\r\n // get all tags at once\r\n double[] scores = ts.scoresOf(tempTags, pos);\r\n // fill in the relevant windowScores\r\n for (int t = 0; t < tagNum[pos]; t++) {\r\n windowScore[pos][product + t * shift] = scores[t];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Set up score and backtrace arrays\r\n double[][][] score = new double[padLength][][];\r\n int[][][][] trace = new int[padLength][][][];\r\n int[][] numWaysToMake = new int[padLength][];\r\n for (int pos = 0; pos < padLength; pos++) {\r\n\r\n score[pos] = new double[productSizes[pos]][];\r\n trace[pos] = new int[productSizes[pos]][][]; // the 2 is for backtrace, and which of the k best for that backtrace\r\n\r\n numWaysToMake[pos] = new int[productSizes[pos]];\r\n Arrays.fill(numWaysToMake[pos], 1);\r\n for (int product = 0; product < productSizes[pos]; product++) {\r\n if (pos > leftWindow) {\r\n // loop over possible predecessor types\r\n int sharedProduct = product / tagNum[pos];\r\n int factor = productSizes[pos] / tagNum[pos];\r\n\r\n numWaysToMake[pos][product] = 0;\r\n for (int newTagNum = 0; newTagNum < tagNum[pos - leftWindow - 1] && numWaysToMake[pos][product] < k; newTagNum++) {\r\n int predProduct = newTagNum * factor + sharedProduct;\r\n numWaysToMake[pos][product] += numWaysToMake[pos-1][predProduct];\r\n }\r\n if (numWaysToMake[pos][product] > k) { numWaysToMake[pos][product] = k; }\r\n }\r\n\r\n score[pos][product] = new double[numWaysToMake[pos][product]];\r\n Arrays.fill(score[pos][product], Double.NEGATIVE_INFINITY);\r\n trace[pos][product] = new int[numWaysToMake[pos][product]][];\r\n Arrays.fill(trace[pos][product], new int[]{-1,-1});\r\n }\r\n }\r\n\r\n // Do forward Viterbi algorithm\r\n // this is the hottest loop, so cache loop control variables hoping for a little speed....\r\n\r\n // loop over the classification spot\r\n for (int pos = leftWindow, posMax = length + leftWindow; pos < posMax; pos++) {\r\n // loop over window product types\r\n for (int product = 0, productMax = productSizes[pos]; product < productMax; product++) {\r\n // check for initial spot\r\n double[] scorePos = score[pos][product];\r\n int[][] tracePos = trace[pos][product];\r\n if (pos == leftWindow) {\r\n // no predecessor type\r\n scorePos[0] = windowScore[pos][product];\r\n } else {\r\n // loop over possible predecessor types/k-best\r\n\r\n int sharedProduct = product / tagNum[pos + rightWindow];\r\n int factor = productSizes[pos] / tagNum[pos + rightWindow];\r\n for (int newTagNum = 0, maxTagNum = tagNum[pos - leftWindow - 1]; newTagNum < maxTagNum; newTagNum++) {\r\n int predProduct = newTagNum * factor + sharedProduct;\r\n double[] scorePosPrev = score[pos-1][predProduct];\r\n for (int k1 = 0; k1 < scorePosPrev.length; k1++) {\r\n double predScore = scorePosPrev[k1] + windowScore[pos][product];\r\n if (predScore > scorePos[0]) { // new value higher then lowest value we should keep\r\n int k2 = Arrays.binarySearch(scorePos, predScore);\r\n k2 = k2 < 0 ? -k2 - 2 : k2 - 1;\r\n // open a spot at k2 by shifting off the lowest value\r\n System.arraycopy(scorePos, 1, scorePos, 0, k2);\r\n System.arraycopy(tracePos, 1, tracePos, 0, k2);\r\n\r\n scorePos[k2] = predScore;\r\n tracePos[k2]= new int[] {predProduct, k1};\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Project the actual tag sequence\r\n int[] whichDerivation = new int[k];\r\n int[] bestCurrentProducts = new int[k];\r\n double[] bestFinalScores = new double[k];\r\n Arrays.fill(bestFinalScores, Double.NEGATIVE_INFINITY);\r\n\r\n // just the last guy\r\n for (int product = 0; product < productSizes[padLength - 1]; product++) {\r\n double[] scorePos = score[padLength - 1][product];\r\n for (int k1 = scorePos.length - 1;\r\n k1 >= 0 && scorePos[k1] > bestFinalScores[0];\r\n k1--) {\r\n int k2 = Arrays.binarySearch(bestFinalScores, scorePos[k1]);\r\n k2 = k2 < 0 ? -k2 - 2 : k2 - 1;\r\n // open a spot at k2 by shifting off the lowest value\r\n System.arraycopy(bestFinalScores, 1, bestFinalScores, 0, k2);\r\n System.arraycopy(whichDerivation, 1, whichDerivation, 0, k2);\r\n System.arraycopy(bestCurrentProducts, 1, bestCurrentProducts, 0, k2);\r\n\r\n bestCurrentProducts[k2] = product;\r\n whichDerivation[k2] = k1;\r\n bestFinalScores[k2] = scorePos[k1];\r\n }\r\n }\r\n ClassicCounter<int[]> kBestWithScores = new ClassicCounter<int[]>();\r\n for (int k1 = k - 1; k1 >= 0 && bestFinalScores[k1] > Double.NEGATIVE_INFINITY; k1--) {\r\n int lastProduct = bestCurrentProducts[k1];\r\n for (int last = padLength - 1; last >= length - 1 && last >= 0; last--) {\r\n tempTags[last] = tags[last][lastProduct % tagNum[last]];\r\n lastProduct /= tagNum[last];\r\n }\r\n\r\n for (int pos = leftWindow + length - 2; pos >= leftWindow; pos--) {\r\n int bestNextProduct = bestCurrentProducts[k1];\r\n bestCurrentProducts[k1] = trace[pos + 1][bestNextProduct][whichDerivation[k1]][0];\r\n whichDerivation[k1] = trace[pos + 1][bestNextProduct][whichDerivation[k1]][1];\r\n tempTags[pos - leftWindow] =\r\n tags[pos - leftWindow][bestCurrentProducts[k1]\r\n / (productSizes[pos] / tagNum[pos - leftWindow])];\r\n }\r\n kBestWithScores.setCount(Arrays.copyOf(tempTags, tempTags.length), bestFinalScores[k1]);\r\n }\r\n\r\n return kBestWithScores;\r\n }", "public Score(){\n\t\tscore = 0;\n\t\tincrement = 0; //how many points for eating a kibble. Changed to zero here because adjustScoreIncrement's extra points begin at 1 anyway\n\t}", "int tryScale(){\n int numAccepted = 0;\n \n for(int c=0; c<numCandScaleTuning; c++){\n DoubleMatrix1D y = nextCandidate();\n if(checkCandidate(y))//accept\n numAccepted++;\n }\n \n return numAccepted;\n }", "public void updateScores(double attempt) {\r\n \tif(previousScore == 0){\r\n \t\tpreviousScore = currentScore;\r\n \t}else{\r\n \t\tbeforePreviousScore = previousScore;\r\n \t\tpreviousScore = currentScore;\r\n \t}\r\n this.currentScore = 100*(attempt \r\n\t\t\t\t- (benchmark - (maximumMark - benchmark)/NUMBEROFLEVEL))\r\n\t\t\t\t/(((maximumMark - benchmark)/NUMBEROFLEVEL)*2);\r\n }", "public void calculateScore() {\n for (Sequence seq: currentSeq) {\n double wordWeight = Retriever.getWeight(seq);\n String token = seq.getToken();\n int size = seq.getRight() - seq.getLeft() + 1;\n int titleCount = getCount(token.toLowerCase(), title.toLowerCase());\n if (titleCount != 0) {\n setMatch(size);\n setTitleContains(true);\n }\n int lowerCount = getCount(token.toLowerCase(), lowerContent);\n if (lowerCount == 0) {\n// scoreInfo += \"Token: \" + token + \" Original=0 Lower=0 WordWeight=\" + wordWeight + \" wordTotal=0\\n\";\n continue;\n }\n int originalCount = getCount(token, content);\n lowerCount = lowerCount - originalCount;\n if (lowerCount != 0 || originalCount != 0) {\n setMatch(size);\n }\n double originalScore = formula(wordWeight, originalCount);\n double lowerScore = formula(wordWeight, lowerCount);\n final double weight = 1.5;\n double addedScore = weight * originalScore + lowerScore;\n// scoreInfo += \"Token: \" + token + \" Original=\" + originalScore + \" Lower=\" + lowerScore +\n// \" WordWeight=\" + wordWeight + \" wordTotal=\" + addedScore + \"\\n\";\n dependencyScore += addedScore;\n }\n currentSeq.clear();\n }", "public static void crossValidation() {\n\t\t\n\t\t//---------------------分为k折-----------------------------\n\t\t//初始化为k fold\n\t\tfor(int i=0;i<FOLD;i++) {\n\t\t\tArrayList<Point> tmp = new ArrayList<Point>();\n\t\t\tallData.add(tmp);\n\t\t}\n\t\t//选一个 删一个\n\t\tList<Integer> chosen = new ArrayList<Integer>();\n\t\tfor(int i=0;i<dataSet.size();i++) {\n\t\t\tchosen.add(i);\n\t\t}\n\t\t\n\t\t/*//按照原有比例采样\n\t\tfor(int i=0;i<FOLD;i++) { \n\t\t\tint choose = 0;\n\t\t\twhile( choose < ROW/FOLD && i != FOLD-1) {\n\t\t\t\tint p = pData.size() / FOLD; //采样的小类样本的个数\n\t\t\t\tint rand = new Random().nextInt(dataSet.size());\n\t\t\t\tif( choose < p) {\n\t\t\t\t\tif( chosen.contains(rand) && dataSet.get(rand).getLabel() == 0) {\n\t\t\t\t\t\tchosen.remove(new Integer(rand));\n\t\t\t\t\t\tchoose ++;\n\t\t\t\t\t\tallData.get(i).add(dataSet.get(rand));\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif( chosen.contains(rand) && dataSet.get(rand).getLabel() != 0) {\n\t\t\t\t\t\tchosen.remove(new Integer(rand));\n\t\t\t\t\t\tchoose ++;\n\t\t\t\t\t\tallData.get(i).add(dataSet.get(rand));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//最后一折全部添加\n\t\t\tif( i == FOLD-1) {\n\t\t\t\tfor (Integer o : chosen) {\n\t\t\t\t\tallData.get(i).add(dataSet.get(o));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}*/\n\t\tfor(int i=0;i<FOLD;i++) { \n\t\t\tint choose = 0;\n\t\t\twhile( choose < ROW/FOLD && i != FOLD-1) {\n\t\t\t\tint rand = new Random().nextInt(dataSet.size());\n\t\t\t\tif( chosen.contains(rand)) {\n\t\t\t\t\tchosen.remove(new Integer(rand));\n\t\t\t\t\tchoose ++;\n\t\t\t\t\tallData.get(i).add(dataSet.get(rand));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//最后一折全部添加\n\t\t\tif( i == FOLD-1) {\n\t\t\t\tfor (Integer o : chosen) {\n\t\t\t\t\tallData.get(i).add(dataSet.get(o));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\t//------------------取一折为测试,其余为训练集-----------------------------\n\t\tfor(int fold=0;fold<FOLD;fold++) {\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\t\n\t\t\tList<Point> trainData = new ArrayList<Point>();\n\t\t\tList<Point> testData = new ArrayList<Point>();\n\t\t\tList<Point> positiveTrainData = new ArrayList<Point>();\n\t\t\tList<Point> positiveTestData = new ArrayList<Point>();\n\t\t\t\n\t\t\ttestData.addAll(allData.get(fold));\n\t\t\tfor (List<Point> ps : allData) {\n\t\t\t\tif( ps != allData.get(fold))\n\t\t\t\t\ttrainData.addAll(ps);\n\t\t\t}\n\t\t\t//select the minority class instances\n\t\t\tfor (Point point : trainData) {\n\t\t\t\tif(point.getLabel() == 0)\n\t\t\t\t\tpositiveTrainData.add(point);\n\t\t\t}\n\t\t\tSystem.out.print(\"train data :\"+trainData.size() + \"\\t\");\n\t\t\tSystem.out.println(\"train positive :\"+positiveTrainData.size());\n\t\t\tfor (Point point : testData) {\n\t\t\t\tif(point.getLabel() == 0)\n\t\t\t\t\tpositiveTestData.add(point);\n\t\t\t}\n\t\t\tSystem.out.print(\"test data :\"+testData.size() + \"\\t\");\n\t\t\tSystem.out.println(\"test positive :\"+positiveTestData.size());\n\t\t\t\n\t\t\tborderline(positiveTrainData,trainData);\n\t\t\t\n\t\t\t//generate new dataset\n\t\t\tString trainFileName = NAME + \"BLTrain\"+fold+\".arff\";\n\t\t\tString testFileName = NAME + \"BLTest\"+fold+\".arff\";\n\t\t\t//TODO dataSet is a bug\n\t\t\tGenerate.generate(trainData,pointSet,COL,fileName,trainFileName);\n\t\t\tGenerate.generate(testData,new ArrayList<Point>(),COL,fileName,testFileName);\n\t\t\tpointSet.clear();\n\t\t\tlong endGenerating = System.currentTimeMillis();\n\t\t\tSystem.out.println(\"产生数据所用时间为:\"+ (endGenerating-start)*1.0/1000 + \"s\");\n\t\t\t\n\t\t\t\n\t\t/*\t//不进行任何处理\n\t\t\ttrainFileName = NAME + \"TrainWS\"+\".arff\";\n\t\t\ttestFileName = NAME + \"TestWS\"+\".arff\";\n\t\t\tGenerate.generate(dataSet,new ArrayList<Point>(),COL,fileName,trainFileName);\n\t\t\tGenerate.generate(testSet,new ArrayList<Point>(),COL,fileName,testFileName);\n//\t\t\tpointSet.clear();\n\t*/\t\t\n\t\t\t\n\t\t\t\n\t\t\tclassify(trainFileName,testFileName);\n\t\t\tlong endClassifying = System.currentTimeMillis();\n\t\t\tSystem.out.println(\"产生数据所用时间为:\"+ (endClassifying-start)*1.0/1000 + \"s\");\n\t\t}\n\t}", "@Test(timeout = 4000)\n public void test069() throws Throwable {\n TestInstances testInstances0 = new TestInstances();\n Instances instances0 = testInstances0.generate((String) null);\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[4];\n evaluation0.updateNumericScores(doubleArray0, doubleArray0, (-1.0));\n assertEquals(Double.NEGATIVE_INFINITY, evaluation0.meanPriorAbsoluteError(), 0.01);\n }", "public void give_score(int n){\n final_score=0.25*(n-m.get_m()+1)+0.2*(n-h.get_h()+1)+0.25*(n-l.get_l()+1)+0.3*(n-a.get_a()+1);\r\n }", "@Override\r\n\tpublic int runn(int k) {\n\t\treturn 0;\r\n\t}", "public void normalize(List<RankList> samples) {\n/* 667 */ for (RankList sample : samples) nml.normalize(sample);\n/* */ \n/* */ }", "public void scoring(){\n for (int i=0; i< players.size(); i++){\n Player p = players.get(i);\n p.setScore(10*p.getTricksWon());\n if(p.getTricksWon() < p.getBid() || p.getTricksWon() > p.getBid()){\n int diff = Math.abs(p.getTricksWon() - p.getBid());\n p.setScore(p.getScore() - (10*diff));\n }\n if(p.getTricksWon() == p.getBid()){\n p.setScore(p.getScore() + 20);\n }\n }\n }", "public void resetScore();", "public void updateScore(){\r\n if (this.isArtist || winners.contains(this)) {\r\n this.score += pointsGainedLastRound;\r\n }\r\n pointsGainedLastRound = 0;\r\n placeLastRound = 0;\r\n }", "void computePrecisionAndRecall(int paraLikeThreshold, int paraK, int paraN, double paraMax, double paraBelta,\n\t\t\tdouble paraGama) {\n\n\t\t// System.out.println(\"the uTrRateInds is: \");\n\t\t// SimpleTool.printMatrix(dataModel.uTrRateInds);\n\t\t// System.out.println(\"the uTrRatings is : \");\n\t\t// SimpleTool.printMatrix(dataModel.uTrRatings);\n\t\t// System.out.println(\"the iTrRateInds is: \");\n\t\t// SimpleTool.printMatrix(dataModel.iTrRateInds);\n\t\t// System.out.println(\"the iTrRatings is : \");\n\t\t// SimpleTool.printMatrix(dataModel.iTrRatings);\n\t\t// System.out.println(\"the uTeRateInds is : \");\n\t\t// SimpleTool.printMatrix(dataModel.uTeRateInds);\n\t\t// System.out.println(Arrays.toString(dataModel.uTeDgr));\n\n\t\tint tempSucRecLen = 0;\n\t\tint tempRecLen = 0;\n\t\tint tempLikeLen = 0;\n\t\tint tempCount = 0;\n\t\tdouble tempNDCG = 0;\n\t\tfor (int i = 0; i < dataModel.userNum; i++) {\n\t\t\t// System.out.println(\"the user is \" + i + \" , the length is \" +\n\t\t\t// dataModel.uTeRateInds[i].length);\n\t\t\tint[] tempRecLists = recommendListForOneUser(i, paraLikeThreshold, paraK, paraN, paraBelta, paraGama);\n\t\t\t// System.out.println(\"the reclist is \" + Arrays.toString(tempRecLists));\n\t\t\tint[] tempLikeLists = likeListForOneUser(i, paraLikeThreshold);\n\t\t\t// System.out.println(\"the likelist is \" + Arrays.toString(tempLikeLists));\n\t\t\tint[] tempInterSection = SetOperator.interSection(tempRecLists, tempLikeLists);\n\n\t\t\t// System.out.println(\"User \" + i + \" recommend lists: \");\n\t\t\t// SimpleTool.printIntArray(tempRecLists);\n\t\t\tif (tempInterSection != null) {\n\t\t\t\ttempSucRecLen = tempInterSection.length;\n\t\t\t\ttempRecLen = tempRecLists.length;\n\t\t\t\ttempLikeLen = tempLikeLists.length;\n\t\t\t\tif (tempRecLen > 1e-6) {\n\t\t\t\t\tprecision += (tempSucRecLen + 0.0) / tempRecLen;\n\t\t\t\t\ttempNDCG = computeNDCG(i, tempRecLists, paraMax);\n\t\t\t\t\tNDCG += tempNDCG;\n\t\t\t\t} // Of if\n\t\t\t\tif (tempLikeLen > 1e-6) {\n\t\t\t\t\trecall += (tempSucRecLen + 0.0) / tempLikeLen;\n\t\t\t\t} // Of if\n\t\t\t} else {\n\t\t\t\ttempCount++;\n\t\t\t\tcontinue;// Of if\n\t\t\t}\n\n\t\t} // Of for i\n\t\t\t// System.out.println(\"the count is: \" + tempCount);\n\t\tprecision = precision / (dataModel.userNum - tempCount);\n\t\trecall = recall / (dataModel.userNum - tempCount);\n\t\tNDCG = NDCG / (dataModel.userNum - tempCount);\n\t}", "public void train() {\n\t\tfor (Instance ins : arrTrainInstances) {\n\t\t\tif (ins.scorePmi_E1E2 > largestPMI)\n\t\t\t\tlargestPMI = ins.scorePmi_E1E2;\n\t\t}\n\t\tSystem.out.println(\"Largest PMI: \" + largestPMI);\n\n\t\tfor (Instance ins : arrTrainInstances) {\n\t\t\tins.scorePmi_E1E2 = ins.scorePmi_E1E2 / largestPMI;\n\t\t}\n\n\t\tfor (Instance ins : arrTestInstances) {\n\t\t\tins.scorePmi_E1E2 = ins.scorePmi_E1E2 / largestPMI;\n\t\t}\n\n\t\tint sizeD0 = arrD0.size();\n\t\tint sizeD1 = arrD1.size();\n\t\tint sizeD2 = arrD2.size();\n\t\tint sizeD3 = arrD3.size();\n\n\t\tint sizeMin = Math.min(sizeD0, Math.min(sizeD1, Math\n\t\t\t\t.min(sizeD2, sizeD3)));\n\t\tSystem.out.println(\"sizeMin=\" + sizeMin);\n\n\t\tint n = instanceNums.length;\n\n\t\tboolean flag = false;\n\n\t\tint count = 0;\n\n\t\tfor (int i = 0; i < n; i++) {\n\n\t\t\tint k = instanceNums[i];\n\n\t\t\tif (k > sizeMin) {\n\t\t\t\tk = sizeMin;\n\t\t\t\tinstanceNums[i] = k;\n\t\t\t\tflag = true;\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\\nk=\" + k);\n\n\t\t\tArrayList<Instance> arrSub0 = getInstances(arrD0, k);\n\t\t\tArrayList<Instance> arrSub1 = getInstances(arrD1, k);\n\t\t\tArrayList<Instance> arrSub2 = getInstances(arrD2, k);\n\t\t\tArrayList<Instance> arrSub3 = getInstances(arrD3, k);\n\n\t\t\tArrayList<Instance> arrTrains = new ArrayList<Instance>();\n\t\t\tarrTrains.addAll(arrSub0);\n\t\t\tarrTrains.addAll(arrSub1);\n\t\t\tarrTrains.addAll(arrSub2);\n\t\t\tarrTrains.addAll(arrSub3);\n\t\t\tCollections.shuffle(arrTrains);\n\n\t\t\tSystem.out.println(\"Training size: \" + arrTrains.size());\n\n\t\t\ttrain(arrTrains);\n\n\t\t\tdouble acc = test();\n\t\t\tacc = test();\n\n\t\t\taccuracies[i] = acc;\n\n\t\t\tcount++;\n\n\t\t\tif (flag == true)\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tfor (int i = 0; i < count; i++) {\n\t\t\tSystem.out.print(\" | \" + \"K=\" + instanceNums[i]);\n\t\t}\n\t\tSystem.out.println();\n\n\t\tfor (int i = 0; i < count; i++) {\n\n\t\t\tDecimalFormat df = new DecimalFormat(\"#.####\");\n\t\t\tString res = df.format(accuracies[i]);\n\t\t\tSystem.out.print(\" | \" + res);\n\t\t}\n\t\tSystem.out.println();\n\t}", "protected void adjustScore() {\r\n scoreMultiplier = (int) (mineField.getDensity() * 100);\r\n maxScore = scoreMultiplier * (int) Math.pow( mineField.getFieldLength(), 2.0 );\r\n }", "@Override\n public double makePrediction(ParsedText text) {\n double pr = 0.0;\n\n /* FILL IN HERE */\n double productSpam = 0;\n double productNoSpam = 0;\n \n int i, tempSpam,tempNoSpam;\n int minSpam, minNoSpam ;\n \n \n for (String ng: text.ngrams) {\n \tminSpam = Integer.MAX_VALUE;\n \tminNoSpam = Integer.MAX_VALUE;\n \n\n \tfor (int h = 0;h < nbOfHashes; h++) {\n \t\ti = hash(ng,h);\n\n \t\ttempSpam = counts[1][h][i];\n \t\ttempNoSpam = counts[0][h][i];\n \t\t\n \t\t//System.out.print(tempSpam + \" \");\n\n \t\tminSpam = minSpam<tempSpam?minSpam:tempSpam; \n \t\tminNoSpam = minNoSpam<tempNoSpam?minNoSpam:tempNoSpam; \n \t\t\n \t}\n\n \t//System.out.println(minSpam + \"\\n\");\n \tproductSpam += Math.log(minSpam);\n \tproductNoSpam += Math.log(minNoSpam);\n }\n \n // size of set minus 1\n int lm1 = text.ngrams.size() - 1;\n \n //System.out.println((productNoSpam - productSpam ));\n //System.out.println((lm1*Math.log(this.classCounts[1]) - lm1*Math.log(this.classCounts[0])));\n\n //\n pr = 1 + Math.exp(productNoSpam - productSpam + lm1*(Math.log(classCounts[1]) - Math.log(classCounts[0])));\n // System.out.print(1.0/pr + \"\\n\");\n \n return 1.0 / pr;\n\n }", "@Test\n public void testScoreUpdate() {\n try {\n final BestEvalScore score = new BestEvalScore(\"thjtrfwaw\");\n double expected = 0;\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n final Evaluation eval = new Evaluation(2);\n eval.eval(0,1);\n eval.eval(1,1);\n\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(0,1);\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n eval.eval(1,1);\n eval.eval(1,1);\n expected = eval.accuracy();\n score.accept(eval);\n assertEquals(\"Incorrect score!\", expected , score.get(), 1e-10);\n\n\n\n } catch (IOException e) {\n throw new IllegalStateException(\"Failed to create instance!\", e);\n }\n\n\n }", "@Test(timeout = 4000)\n public void test070() throws Throwable {\n TextDirectoryLoader textDirectoryLoader0 = new TextDirectoryLoader();\n Instances instances0 = textDirectoryLoader0.getDataSet();\n Evaluation evaluation0 = new Evaluation(instances0);\n double[] doubleArray0 = new double[7];\n evaluation0.updateNumericScores(doubleArray0, doubleArray0, 0.0);\n assertEquals(0.0, evaluation0.SFPriorEntropy(), 0.01);\n }", "protected abstract List<Double> calcScores();", "public void normaliseProbs() {\n\t\t// Get total\n\t\tdouble sum = 0;\n\t\tfor (Double d : itemProbs_.values()) {\n\t\t\tsum += d;\n\t\t}\n\n\t\t// If already at 1, just return.\n\t\tif ((sum >= 0.9999) && (sum <= 1.0001))\n\t\t\treturn;\n\n\t\t// Normalise\n\t\tint count = itemProbs_.size();\n\t\tfor (T element : itemProbs_.keySet()) {\n\t\t\t// If the sum is 0, everything is equal.\n\t\t\tif (sum == 0)\n\t\t\t\titemProbs_.put(element, 1.0 / count);\n\t\t\telse\n\t\t\t\titemProbs_.put(element, itemProbs_.get(element) / sum);\n\t\t}\n\t\trebuildProbs_ = true;\n\t\tklSize_ = 0;\n\t}", "public static int villa(int... result) {\n\n int score = nSame(3, 6, result);\n int firstPairVal = score/3;\n\n result = IntStream.of(result).filter(val -> val != firstPairVal).toArray();\n score = nSame(3, 6, result);\n int secondPairVal = score/3;\n\n if (firstPairVal*secondPairVal > 0) {\n score = 3*firstPairVal + 3*secondPairVal;\n } else {\n score = 0;\n }\n\n return score;\n }", "private static void kmeans(int[] rgb, int k) {\n\t\tColor[] rgbColor = new Color[rgb.length];\r\n\t\tColor[] ColorCluster = new Color[rgb.length];\r\n\t\tint[] ColorClusterID = new int[rgb.length];\r\n\t\t\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgbColor[i] = new Color(rgb[i]);\r\n\t\t\tColorClusterID[i] = -1;\r\n\t\t}\r\n\t\t\r\n\t\tColor[] currentCluster = new Color[k];\t\t\r\n\t\tint randomNumber[]= ThreadLocalRandom.current().ints(0, rgb.length).distinct().limit(k).toArray();\r\n\t\tColor[] modifiedColorCluster = new Color[k];\t\r\n\t\t\r\n\t\tfor(int j=0;j<k;j++) {\r\n\t\t\tcurrentCluster[j]=rgbColor[randomNumber[j]];\r\n\t\t}\r\n\t\tint flag = 1;\r\n\t\tint maxIterations = 1000;\r\n\t\tint numIteration=0;\r\n\t\tdouble[] distance = new double[maxIterations+1];\t\t\r\n\t\tdistance[0]=Double.MAX_VALUE;\r\n\t\twhile(flag == 1) {\r\n\t\t\tflag = 0;\r\n\t\t\tnumIteration++;\r\n\t\t\tdistance[numIteration]=assignCLustersToPixels(rgbColor,currentCluster,ColorCluster,ColorClusterID,k,rgb.length);\r\n\t\t\tmodifiedColorCluster= findMeans(rgbColor,ColorClusterID,modifiedColorCluster,k,rgb.length);\r\n\t\t\tif(!clusterCenterCheck(currentCluster, modifiedColorCluster,k)){\r\n\t\t\t\tflag = 1;\r\n\t\t\t\tfor(int j=0;j<k;j++) {\r\n\t\t\t\t\tcurrentCluster[j]=modifiedColorCluster[j];}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tfor(int i = 0;i<rgb.length;i++) {\r\n\t\t\trgb[i]= getValue(ColorCluster[i].getRed(),ColorCluster[i].getGreen(),ColorCluster[i].getBlue());\r\n\t\t}\r\n\t\treturn;\r\n\t }", "public void normalize() {\n // YOUR CODE HERE\n String w1, w2;\n for (int i = 0; i < row; i++) {\n w1 = NDTokens.get(i);\n for (int j = 0; j < column; j++) {\n w2 = NDTokens.get(j);\n if(smooth) {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = (getCount(w1, w2))/(uni_grams[NDTokens.indexOf(w1)] + NDTokens_size);\n }else {\n bi_grams_normalized[NDTokens.indexOf(w1)][NDTokens.indexOf(w2)] = getCount(w1, w2)/(uni_grams[NDTokens.indexOf(w1)]);\n }\n }\n }\n }", "void iterate( int numberOfDocs, int maxIterations ) {\n\n\tdouble[] prev_a = new double[numberOfDocs];\n\tArrays.fill(prev_a, 1.0 / numberOfDocs);\n\t\n\tthis.ranks = new double[numberOfDocs];\n\tthis.ranks[0] = 1;\n\t\n\tboolean converged = false;\n\tint iterations = 0;\n\tdouble sum = 0;\n\tdouble error = 0;\n\t\n\twhile( !converged && iterations++ < maxIterations ) {\n\t\t\n\t\tif(iterations%1000==0) {\n\t\t\t//System.err.println(Integer.toString(iterations) + \"\\t iterations...\");\n\t\t\t//System.err.println(Double.toString(error) + \"\\t error.\");\n\t\t}\n\t\t\n\t\tdouble[] a = new double[numberOfDocs];\n\t\tArrays.fill(a, BORED / numberOfDocs);\n\t\t\n\t\tlink.entrySet().forEach(entry -> {\n\t entry.getValue().keySet().forEach(outLink -> {\n\t a[outLink] += ranks[entry.getKey()] * (1.0 - BORED) / out[entry.getKey()];\n\t });\n\t });\n\t\t\n\t\t/**\n\t\t// Distribution normalization\n\t\tdouble error = 0;\n\t\tfor(int i=0; i<a.length; i++) {\n\t\t\terror += a[i];\n\t\t}\n\t\tfor(int i=0; i<a.length; i++) {\n\t\t\ta[i] += a[i]/error;\n\t\t}\n\t\t*/\n\t\t\n\t\t\n\t\t\n\t\t// Epsilon threshold checking\n\t\terror = 0;\n\t\tfor(int i=0; i<a.length; i++) {\n\t\t\terror += Math.abs(a[i] - ranks[i]);\n\t\t}\n\t\t\n\t\tthis.ranks = a;\n\t\t\n\t\tif(error < EPSILON) {\n\t\t\t//System.err.println(\"Power iteration converged at iteration \" + Integer.toString(iterations));\n\t\t\tsum = Arrays.stream(a).sum(); //poner a embede ranks?\n\t for (int i = 0; i < ranks.length; i++) {\n\t ranks[i] = this.ranks[i]/sum;\n\t }\n\t\t\tconverged = true;\n\t\t}\n\t\t\n\t}\n }", "public synchronized void resetScore() {\n\t\twhile (true) {\n\t\t\tint existingValueW = getCaught();\n\t\t\tint existingValueG = getScore();\n\t\t\tint existingValueM = getMissed();\n\t\t\tint newValueW = 0;\n\t\t\tint newValueG = 0;\n\t\t\tint newValueM = 0;\n\t\t\tif (caughtWords.compareAndSet(existingValueW, newValueW)\n\t\t\t\t\t&& gameScore.compareAndSet(existingValueG, newValueG)\n\t\t\t\t\t&& missedWords.compareAndSet(existingValueM, newValueM)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public void recalc() {\n\t\tMapping mapping = getConsumerProductMatrix();\n\t\tif (mapping == null) {\n\t\t\treturn; // there is nobody to calculate recommendation for\n\t\t}\n\t\tSparseMatrix<Float64> Ct = makeC(mapping.matrix).transpose();\n\t\tSparseMatrix<Float64> B = makeB(mapping.matrix);\n\t\tSparseMatrix<Float64> CR0 = makeCR0(mapping.matrix.getNumberOfRows());\n\n\t\tSparseMatrix<Float64> PR = null;\n\t\tSparseMatrix<Float64> CR = CR0;\n\n\t\tint iterations =\n\t\t\tConfigService.CONFIG_SERVICE.getConfig(\n\t\t\t\tServerConfigKey.RECOMMENDATION_ITERATIONS).get();\n\t\tfor (int i = 0; i < iterations; i++) {\n\t\t\tPR = CR.times(B);\n\t\t\tCR = PR.times(Ct).plus(CR0);\n\t\t}\n\n\t\tsaveRecommendations(mapping, PR);\n\t}", "public ScoreReduction (Score score)\r\n {\r\n this.score = score;\r\n\r\n for (TreeNode pn : score.getPages()) {\r\n Page page = (Page) pn;\r\n pages.put(page.getIndex(), page);\r\n }\r\n }", "public abstract double score(double tf, double docLength, double precomp);", "protected final void calcScore()\n {\n\n m_score = SCORE_OTHER;\n\n if (null == m_targetString)\n calcTargetString();\n }", "public static void main(String[] args) {\n\t\tint a = 10;\n\t\tSystem.out.println(\"the score is\" + a);\n\t\t\n\t\t\n\t\t// a = a + 2\n\t\ta+=2;\n\t\tSystem.out.println(a);\n\t\t\t\t\n\t\t\n\t\t\n\t\tint k = 10;\n\t\t\n\t\tk -= 1; // k = k - 1;\n\t\t\n\t\tSystem.out.println(k);\n\t\t\n\t\tk/= 2; // k = k/2\n\t\tSystem.out.println(k);\n\t\t\n\t\tint j = 10;\n\t\tj = j + 2;\n\t\tj += 2;\n\t\tj++; // ++j;\n\t\tSystem.out.println(j);\n\t\tint c = 10;\n\t\tc++;\n\t\tSystem.out.println(\"c++ is \" + c);\n\t\tint d = 10;\n\t\t++d;\n\t\tSystem.out.println(\"s++ is \" + d);\n\t\t\n\t}", "private static void testKWIK() {\n\t\tint turns = 100;\n\t\tdouble[] winRate = {0,0,0,0};\n\t\tfor (int i = 0; i < turns; i++) {\n\t\t\tdouble[] wins = testKWIKOnce();\n\t\t\tfor (int j = 0; j < wins.length; j++) winRate[j] += wins[j];\n\t\t}\n\t\tfor (int j = 0; j < winRate.length; j++) winRate[j] /= turns;\n\t\tSystem.out.println(\"KWIK scores\");\n\t\tSystem.out.println(Utils.stringArray(winRate, 4));\n\t}", "public void trainBernoulli() {\t\t\n\t\tMap<String, Cluster> trainingDataSet = readFile(trainLabelPath, trainDataPath, \"training\");\n\t\tMap<String, Cluster> testingDataSet = readFile(testLabelPath, testDataPath, \"testing\");\n\n\t\t// do testing, if the predicted class and the gold class is not equal, increment one\n\t\tdouble error = 0;\n\n\t\tdouble documentSize = 0;\n\n\t\tSystem.out.println(\"evaluate the performance\");\n\t\tfor (int testKey = 1; testKey <= 20; testKey++) {\n\t\t\tCluster testingCluster = testingDataSet.get(Integer.toString(testKey));\n\t\t\tSystem.out.println(\"Cluster: \"+testingCluster.toString());\n\n\t\t\tfor (Document document : testingCluster.getDocuments()) {\n\t\t\t\tdocumentSize += 1; \n\t\t\t\tList<Double> classprobability = new ArrayList<Double>();\n\t\t\t\tMap<String, Integer> testDocumentWordCounts = document.getWordCount();\n\n\t\t\t\tfor (int classindex = 1; classindex <= 20; classindex++) {\n\t\t\t\t\t// used for calculating the probability\n\t\t\t\t\tCluster trainCluster = trainingDataSet.get(Integer.toString(classindex));\n\t\t\t\t\t// System.out.println(classindex + \" \" + trainCluster.mClassId);\n\t\t\t\t\tMap<String, Double> bernoulliProbability = trainCluster.bernoulliProbabilities;\n\t\t\t\t\tdouble probability = Math.log(trainCluster.getDocumentSize()/trainDocSize);\n\t\t\t\t\tfor(int index = 1; index <= voc.size(); index++ ){\n\n\t\t\t\t\t\t// judge whether this word is stop word \n\t\t\t\t\t\tboolean isStopwords = englishStopPosition.contains(index);\n\t\t\t\t\t\tif (isStopwords) continue;\n\n\t\t\t\t\t\tboolean contain = testDocumentWordCounts.containsKey(Integer.toString(index));\t\t\t\t\t\t\n\t\t\t\t\t\tif (contain) {\n\t\t\t\t\t\t\tprobability += Math.log(bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tprobability += Math.log(1 - bernoulliProbability.get(Integer.toString(index)));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// put the probability into the map for the specific class\n\t\t\t\t\tclassprobability.add(probability);\n\t\t\t\t}\n\t\t\t\tObject obj = Collections.max(classprobability);\n\t\t\t\t// System.out.println(classprobability);\n\t\t\t\tString predicte_class1 = obj.toString();\n\t\t\t\t// System.out.println(predicte_class1);\n\t\t\t\t// System.out.println(Double.parseDouble(predicte_class1));\n\t\t\t\tint index = classprobability.indexOf(Double.parseDouble(predicte_class1));\n\t\t\t\t// System.out.println(index);\n\t\t\t\tString predicte_class = Integer.toString(index + 1);\n\n\n\t\t\t\tconfusion_matrix[testKey - 1][index] += 1;\n\n\t\t\t\t// System.out.println(document.docId + \": G, \" + testKey + \"; P: \" + predicte_class);\n\t\t\t\tif (!predicte_class.equals(Integer.toString(testKey))) {\n\t\t\t\t\terror += 1;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize);\n\t\t}\n\n\t\tSystem.out.println(\"the error is \" + error + \"; the document size : \" + documentSize + \" precision rate : \" + (1 - error/documentSize));\n\n\t\t// print confusion matrix\n\t\tprintConfusionMatrix(confusion_matrix);\n\t}", "public void evaluate() {\n for (Chromosome chromo : chromosomes) {\n double chromoGH = chromo.getTotalGH();\n if (chromo.isValid()) {\n this.validChromosomes++;\n if (chromoGH > this.getBestScore()) {\n this.bestScore = chromoGH;\n this.setBestChromo(chromo);\n }\n }\n //Log.debugMsg(chromo.getTotalGH().toString());\n// this.map.put(chromoGH, chromo);\n }\n }", "public void evaluate(String sampleFile, String featureDefFile, int nFold, float tvs, String modelDir, String modelFile) {\n/* 854 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 855 */ List<List<RankList>> validationData = new ArrayList<>();\n/* 856 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* */ \n/* 860 */ List<RankList> samples = readInput(sampleFile);\n/* */ \n/* */ \n/* 863 */ int[] features = readFeature(featureDefFile);\n/* 864 */ if (features == null) {\n/* 865 */ features = FeatureManager.getFeatureFromSampleVector(samples);\n/* */ }\n/* 867 */ FeatureManager.prepareCV(samples, nFold, tvs, trainingData, validationData, testData);\n/* */ \n/* */ \n/* 870 */ if (normalize)\n/* */ {\n/* 872 */ for (int j = 0; j < nFold; j++) {\n/* */ \n/* 874 */ normalizeAll(trainingData, features);\n/* 875 */ normalizeAll(validationData, features);\n/* 876 */ normalizeAll(testData, features);\n/* */ } \n/* */ }\n/* */ \n/* 880 */ Ranker ranker = null;\n/* 881 */ double scoreOnTrain = 0.0D;\n/* 882 */ double scoreOnTest = 0.0D;\n/* 883 */ double totalScoreOnTest = 0.0D;\n/* 884 */ int totalTestSampleSize = 0;\n/* */ \n/* 886 */ double[][] scores = new double[nFold][]; int i;\n/* 887 */ for (i = 0; i < nFold; i++) {\n/* 888 */ (new double[2])[0] = 0.0D; (new double[2])[1] = 0.0D; scores[i] = new double[2];\n/* 889 */ } for (i = 0; i < nFold; i++) {\n/* */ \n/* 891 */ List<RankList> train = trainingData.get(i);\n/* 892 */ List<RankList> vali = null;\n/* 893 */ if (tvs > 0.0F)\n/* 894 */ vali = validationData.get(i); \n/* 895 */ List<RankList> test = testData.get(i);\n/* */ \n/* 897 */ RankerTrainer trainer = new RankerTrainer();\n/* 898 */ ranker = trainer.train(this.type, train, vali, features, this.trainScorer);\n/* */ \n/* 900 */ double s2 = evaluate(ranker, test);\n/* 901 */ scoreOnTrain += ranker.getScoreOnTrainingData();\n/* 902 */ scoreOnTest += s2;\n/* 903 */ totalScoreOnTest += s2 * test.size();\n/* 904 */ totalTestSampleSize += test.size();\n/* */ \n/* */ \n/* 907 */ scores[i][0] = ranker.getScoreOnTrainingData();\n/* 908 */ scores[i][1] = s2;\n/* */ \n/* */ \n/* 911 */ if (!modelDir.isEmpty()) {\n/* */ \n/* 913 */ ranker.save(FileUtils.makePathStandard(modelDir) + \"f\" + (i + 1) + \".\" + modelFile);\n/* 914 */ System.out.println(\"Fold-\" + (i + 1) + \" model saved to: \" + modelFile);\n/* */ } \n/* */ } \n/* 917 */ System.out.println(\"Summary:\");\n/* 918 */ System.out.println(this.testScorer.name() + \"\\t| Train\\t| Test\");\n/* 919 */ System.out.println(\"----------------------------------\");\n/* 920 */ for (i = 0; i < nFold; i++)\n/* 921 */ System.out.println(\"Fold \" + (i + 1) + \"\\t| \" + SimpleMath.round(scores[i][0], 4) + \"\\t| \" + SimpleMath.round(scores[i][1], 4) + \"\\t\"); \n/* 922 */ System.out.println(\"----------------------------------\");\n/* 923 */ System.out.println(\"Avg.\\t| \" + SimpleMath.round(scoreOnTrain / nFold, 4) + \"\\t| \" + SimpleMath.round(scoreOnTest / nFold, 4) + \"\\t\");\n/* 924 */ System.out.println(\"----------------------------------\");\n/* 925 */ System.out.println(\"Total\\t| \\t\\t| \" + SimpleMath.round(totalScoreOnTest / totalTestSampleSize, 4) + \"\\t\");\n/* */ }", "public double[] runOptimizer() {\n List<Integer> sents = new ArrayList<Integer>();\n for(int i=0; i<sentNum; i++)\n sents.add(i);\n \n if(needShuffle)\n Collections.shuffle(sents);\n \n double oraMetric, oraScore, predMetric, predScore;\n double[] oraPredScore = new double[4];\n double eta = 1.0; //learning rate, will not be changed if run percep\n double avgEta = 0; //average eta, just for analysis\n double loss = 0;\n double featNorm = 0;\n double featDiffVal;\n double sumMetricScore = 0;\n double sumModelScore = 0;\n String oraFeat = \"\";\n String predFeat = \"\";\n String[] oraPredFeat = new String[2];\n String[] vecOraFeat;\n String[] vecPredFeat;\n String[] featInfo;\n boolean first = true;\n //int processedSent = 0;\n Iterator it;\n Integer diffFeatId;\n double[] avgLambda = new double[initialLambda.length]; //only needed if averaging is required\n for(int i=0; i<initialLambda.length; i++)\n avgLambda[i] = 0.0;\n\n //update weights\n for(Integer s : sents) {\n //find out oracle and prediction\n if(first)\n findOraPred(s, oraPredScore, oraPredFeat, initialLambda, featScale);\n else\n findOraPred(s, oraPredScore, oraPredFeat, finalLambda, featScale);\n \n //the model scores here are already scaled in findOraPred\n oraMetric = oraPredScore[0];\n oraScore = oraPredScore[1];\n predMetric = oraPredScore[2];\n predScore = oraPredScore[3];\n oraFeat = oraPredFeat[0];\n predFeat = oraPredFeat[1];\n \n //update the scale\n if(needScale) { //otherwise featscale remains 1.0\n sumMetricScore += java.lang.Math.abs(oraMetric+predMetric);\n sumModelScore += java.lang.Math.abs(oraScore+predScore)/featScale; //restore the original model score\n \n if(sumModelScore/sumMetricScore > scoreRatio)\n featScale = sumMetricScore/sumModelScore;\n\n /* a different scaling strategy \n if( (1.0*processedSent/sentNum) < sentForScale ) { //still need to scale\n double newFeatScale = java.lang.Math.abs(scoreRatio*sumMetricDiff / sumModelDiff); //to make sure modelScore*featScale/metricScore = scoreRatio\n \n //update the scale only when difference is significant\n if( java.lang.Math.abs(newFeatScale-featScale)/featScale > 0.2 )\n featScale = newFeatScale;\n }*/\n }\n// processedSent++;\n\n HashMap<Integer, Double> allOraFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> allPredFeat = new HashMap<Integer, Double>();\n HashMap<Integer, Double> featDiff = new HashMap<Integer, Double>();\n\n vecOraFeat = oraFeat.split(\"\\\\s+\");\n vecPredFeat = predFeat.split(\"\\\\s+\");\n \n for (int i = 0; i < vecOraFeat.length; i++) {\n featInfo = vecOraFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allOraFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n featDiff.put(diffFeatId, Double.parseDouble(featInfo[1]));\n }\n\n for (int i = 0; i < vecPredFeat.length; i++) {\n featInfo = vecPredFeat[i].split(\":\");\n diffFeatId = Integer.parseInt(featInfo[0]);\n allPredFeat.put(diffFeatId, Double.parseDouble(featInfo[1]));\n\n if (featDiff.containsKey(diffFeatId)) //overlapping features\n featDiff.put(diffFeatId, featDiff.get(diffFeatId)-Double.parseDouble(featInfo[1]));\n else //features only firing in the 2nd feature vector\n featDiff.put(diffFeatId, -1.0*Double.parseDouble(featInfo[1]));\n }\n\n if(!runPercep) { //otherwise eta=1.0\n featNorm = 0;\n\n Collection<Double> allDiff = featDiff.values();\n for(it =allDiff.iterator(); it.hasNext();) {\n featDiffVal = (Double) it.next();\n featNorm += featDiffVal*featDiffVal;\n }\n \n //a few sanity checks\n if(! evalMetric.getToBeMinimized()) {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score+ora_metric > pred_score+pred_metric\n * pred_score-pred_metric > ora_score-ora_metric\n * => ora_metric > pred_metric */\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be greater than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric+1e-10 < predMetric) {\n System.err.println(\"WARNING: for max-metric oracle selection or min-metric prediction selection, the oracle metric \" +\n \t\t\"score must be greater than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n } else {\n if(oraSelectMode==1 && predSelectMode==1) { //\"hope-fear\" selection\n /* ora_score-ora_metric > pred_score-pred_metric\n * pred_score+pred_metric > ora_score+ora_metric\n * => ora_metric < pred_metric */\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for hope-fear selection, oracle metric score must be smaller than prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n if(oraSelectMode==2 || predSelectMode==3) {\n if(oraMetric-1e-10 > predMetric) {\n System.err.println(\"WARNING: for min-metric oracle selection or max-metric prediction selection, the oracle metric \" +\n \"score must be smaller than the prediction metric score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n }\n \n if(predSelectMode==2) {\n if(predScore+1e-10 < oraScore) {\n System.err.println(\"WARNING: for max-model prediction selection, the prediction model score must be greater than oracle model score!\");\n System.err.println(\"Something is wrong!\");\n }\n }\n \n //cost - margin\n //remember the model scores here are already scaled\n loss = evalMetric.getToBeMinimized() ? //cost should always be non-negative \n (predMetric-oraMetric) - (oraScore-predScore)/featScale: \n (oraMetric-predMetric) - (oraScore-predScore)/featScale;\n \n if(loss<0)\n loss = 0;\n\n if(loss == 0)\n eta = 0;\n else\n //eta = C < loss/(featNorm*featScale*featScale) ? C : loss/(featNorm*featScale*featScale); //feat vector not scaled before\n eta = C < loss/(featNorm) ? C : loss/(featNorm); //feat vector not scaled before\n }\n \n avgEta += eta;\n\n Set<Integer> diffFeatSet = featDiff.keySet();\n it = diffFeatSet.iterator();\n\n if(first) {\n first = false;\n \n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = initialLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n else {\n if(eta!=0) {\n while(it.hasNext()) {\n diffFeatId = (Integer)it.next();\n finalLambda[diffFeatId] = finalLambda[diffFeatId] + eta*featDiff.get(diffFeatId);\n }\n }\n }\n \n if(needAvg) {\n for(int i=0; i<avgLambda.length; i++)\n avgLambda[i] += finalLambda[i];\n }\n }\n \n if(needAvg) {\n for(int i=0; i<finalLambda.length; i++)\n finalLambda[i] = avgLambda[i]/sentNum;\n }\n \n avgEta /= sentNum;\n System.out.println(\"Average learning rate: \"+avgEta);\n\n // the intitialLambda & finalLambda are all trainable parameters\n //if (!trainMode.equals(\"3\")) // for mode 3, no need to normalize sparse\n // feature weights\n //normalizeLambda(finalLambda);\n //else\n //normalizeLambda_mode3(finalLambda);\n\n /*\n * for( int i=0; i<finalLambda.length; i++ ) System.out.print(finalLambda[i]+\" \");\n * System.out.println(); System.exit(0);\n */ \n\n double initMetricScore = computeCorpusMetricScore(initialLambda); // compute the initial corpus-level metric score\n double finalMetricScore = computeCorpusMetricScore(finalLambda); // compute final corpus-level metric score // the\n\n // prepare the printing info\n int numParamToPrint = 0;\n String result = \"\";\n\n if (trainMode.equals(\"1\") || trainMode.equals(\"4\")) {\n numParamToPrint = paramDim > 10 ? 10 : paramDim; // how many parameters\n // to print\n result = paramDim > 10 ? \"Final lambda(first 10): {\" : \"Final lambda: {\";\n\n for (int i = 1; i < numParamToPrint; i++)\n // in ZMERT finalLambda[0] is not used\n result += finalLambda[i] + \" \";\n } else {\n int sparseNumToPrint = 0;\n if (trainMode.equals(\"2\")) {\n result = \"Final lambda(regular feats + first 5 sparse feats): {\";\n for (int i = 1; i <= regParamDim; ++i)\n result += finalLambda[i] + \" \";\n\n result += \"||| \";\n\n sparseNumToPrint = 5 < (paramDim - regParamDim) ? 5 : (paramDim - regParamDim);\n\n for (int i = 1; i <= sparseNumToPrint; i++)\n result += finalLambda[regParamDim + i] + \" \";\n } else {\n result = \"Final lambda(first 10 sparse feats): {\";\n sparseNumToPrint = 10 < paramDim ? 10 : paramDim;\n\n for (int i = 1; i < sparseNumToPrint; i++)\n result += finalLambda[i] + \" \";\n }\n }\n\n output.add(result + finalLambda[numParamToPrint] + \"}\\n\" + \"Initial \"\n + evalMetric.get_metricName() + \": \" + initMetricScore + \"\\nFinal \"\n + evalMetric.get_metricName() + \": \" + finalMetricScore);\n\n // System.out.println(output);\n\n if (trainMode.equals(\"3\")) {\n // finalLambda = baseline(unchanged)+disc\n for (int i = 0; i < paramDim; i++)\n copyLambda[i + regParamDim + 1] = finalLambda[i];\n\n finalLambda = copyLambda;\n }\n\n return finalLambda;\n }", "@Test\n\tpublic void testOptimization() throws Exception {\n\t\tfor(int i = 0; i < 20000000; i++) {\n\t\t\tint _300s = (int) (Math.random() * 100);\n\t\t\tint _100s = (int) (Math.random() * 100);\n\t\t\tint _50s = (int) (Math.random() * 100);\n\t\t\tint misses = (int) (Math.random() * 100);\n\t\t\t\n\t\t\tdouble acc = OsuApiScore.getAccuracy(_300s, _100s, _50s, misses);\n\t\t\t\n\t\t\tAccuracyDistribution accuracyDistribution = AccuracyDistribution.closest(\n\t\t\t\t\t_300s + _100s + _50s + misses, misses,\n\t\t\t\t\tacc);\n\t\t\t\n\t\t\tdouble rec = OsuApiScore.getAccuracy(accuracyDistribution.getX300(),\n\t\t\t\t\taccuracyDistribution.getX100(), accuracyDistribution.getX50(),\n\t\t\t\t\taccuracyDistribution.getMiss());\n\t\t\t\n\t\t\tassertEquals(acc, rec, 0d);\n\t\t}\n\t}", "public void evaluate() {\n int score = sequence.getScore();\n // sequence has already been evaluated\n if (score > 0) {\n sequence.setScore(score);\n return;\n }\n \n int sum = 0;\n for (SingleConstraint c : singleConstraints) {\n sum += c.sumOfPenalties();\n }\n for (PairConstraint c : pairConstraints) {\n sum += c.sumOfPenalties();\n }\n sequence.setScore(sum);\n int bestSequenceScore = bestSequence.getScore();\n if (bestSequenceScore < 0 || sum < bestSequenceScore) {\n bestSequence = sequence;\n System.out.format(\"New best sequence: %s (Score: %d)\\n\", sequence,\n sequence.getScore());\n }\n }", "@Override\n\tpublic void inputScore() {\n\n\t}", "public void reduce ()\r\n {\r\n if (score.getPages().isEmpty()) {\r\n return;\r\n }\r\n\r\n /* Connect parts across the pages */\r\n connection = PartConnection.connectScorePages(pages);\r\n\r\n // Force the ids of all ScorePart's\r\n numberResults();\r\n\r\n // Create score part-list and connect to pages and systems parts\r\n addPartList();\r\n\r\n // Debug: List all candidates per result\r\n if (logger.isDebugEnabled()) {\r\n dumpResultMapping();\r\n }\r\n }", "private void zScoreNormalize(List<Double> data)\n\t{\n\t\tdouble mean=Statistics.mean(data);\n\t\tdouble sd=Statistics.sd(data);\n\t\tfor(int i=0; i!= data.size(); ++i)\n\t\t{\n\t\t\tdata.set(i, (data.get(i)-mean)/sd);\n\t\t}\n\n\t}", "public static void incrementScore() {\n\t\tscore++;\n\t}", "private void EvalFitness(){\r\n _FitVal=0;\r\n for(int i=0; i<7;i++)\r\n for(int j=i+1;j<8;j++){\r\n if( _Data[i]==_Data[j]) _FitVal++;\r\n if(j-i==Math.abs(_Data[i]-_Data[j])) _FitVal++;\r\n }\r\n }", "@Override\n public int[] schedule(TestInstance testInstance, int[] minizincSolution) {\n\n long start = System.currentTimeMillis();\n\n int numAgents = testInstance.numAgents;\n int numJobs = testInstance.numJobs;\n //Initialize some testers for later\n CondorcetConsistencyTester condorsetTests = new CondorcetConsistencyTester(numJobs, numAgents);\n SumOfTardinessTester sumOfTardTests = new SumOfTardinessTester(numJobs, numAgents);\n ParetoEfficiencyTester paretoTests = new ParetoEfficiencyTester(numJobs, numAgents);\n\n // Initialize the scores with all 0\n Scores scores = new Scores(numJobs);\n\n //PART 1\n // This double loop compares each job with all the others\n for(int i = 0; i < numJobs - 1; i++) {\n for (int j = i + 1; j < numJobs; j++) {\n\n int counter_i = 0;\n int counter_j = 0;\n // Now we count how many times the job with ID=i comes before the job with ID=j\n // For all preferences\n // If job with ID=i comes before the job with ID=j\n for (Preference preference : testInstance.preferences)\n if (preference.isBefore(i, j))\n counter_i++; // Increment the number of agents preferring i over j\n else counter_j++; // Increment the number of agents preferring j over i\n\n\n int p_i = testInstance.processingTimes[i];\n int p_j = testInstance.processingTimes[j];\n\n // The threshold of job i, as given by our definition\n // This rule is the main and only way the processing times of the\n // jobs are taken into account for the final \"true\" ranking\n float threshold = (float)(p_i * numAgents) / (float)(p_i + p_j);\n\n if (counter_i == threshold) { //If the number of votes equals the threshold for job i,\n // the same applies for job j and its corresponding threshold, because math, so give both of them a point\n scores.addOne(i);\n scores.addOne(j);\n } else if (counter_i > threshold) { //Give a point to job i for surpassing the threshold\n scores.addOne(i);\n } else { //Give a point to job j for surpassing its threshold (again, because math)\n scores.addOne(j);\n }\n\n // Store the votes each job got against the other\n CondorcetConsistencyTester.votes[i][j] = counter_i;\n CondorcetConsistencyTester.votes[j][i] = counter_j;\n\n }\n }\n\n //Sort the jobs in descending order, based on the score they obtained\n ArrayList scheduleArrayList = scores.sorted();\n\n //Transform the sorted list of jobs into an array\n int[] schedule = new int[numJobs];\n for(int i = 0; i < numJobs; i++){\n schedule[i] = (int)scheduleArrayList.get(i);\n }\n\n// boolean isThereWinner = condorsetTests.isThereCondorcetWinner();\n// System.out.println(\"isThereWinner: \" + isThereWinner);\n// boolean isCondorcetWinner = condorsetTests.testCondorcetWinner(schedule);\n// System.out.println(\"isCondorcetWinner: \" + isCondorcetWinner);\n// System.out.println(\"--------------------------------------------------------------------\");\n// System.out.println(\"PTA violations before: \" + condorsetTests.countPTACondorcetViolations(schedule, testInstance.processingTimes));\n// System.out.println(\"Sum of Tardiness before: \" + sumOfTardTests.calculateSumOfTardiness(schedule, testInstance.preferences, testInstance.processingTimes));\n// System.out.println(\"--------------------------------------------------------------------\");\n// int[] agentTardiness = sumOfTardTests.getAgentTardiness();\n// System.out.println(\"Tardiness per agent (before): \" + Arrays.toString(agentTardiness));\n// System.out.println(\"Gini Index (before): \" + GiniIndexTester.getIndex(agentTardiness, numAgents));\n\n\n //PART 2 - Make our schedule Condorcet-consistent\n //First cell of the \"results\" array represents consistency,\n //second cell represents index to start the next search from (optimization purposes)\n int[] results = new int[2];\n //While our schedule is not Condorcet-consistent\n while (results[0] == 0) {\n //Search for swaps that will render the schedule Condorcet-consistent\n results = condorsetTests.testCondorcetConsistency(schedule, results[1]);\n //If schedule has become Condorcet-consistent\n if (results[0] == 1)\n System.out.println(\"Schedule: \" + Arrays.toString(schedule));\n }\n\n //Runtime\n long end = System.currentTimeMillis();\n long ourRuntime = end - start;\n System.out.println(\"OUR TOTAL RUNTIME: \" + ourRuntime + \" ms\");\n\n Statistics.myRuntime.add(ourRuntime);\n Statistics.numAgents.add(testInstance.numAgents);\n Statistics.numJobs.add(testInstance.numJobs);\n\n //PTA-Violations\n double myPercPTA = ((double)condorsetTests.countPTACondorcetViolations(schedule, testInstance.processingTimes)) / (numJobs * numJobs /2);\n System.out.println(\"PTA violations % for our solution: \" + myPercPTA);\n Statistics.myPTAviolations.add(myPercPTA);\n if (minizincSolution != null) {\n double mznPercPTA = ((double) condorsetTests.countPTACondorcetViolations(minizincSolution, testInstance.processingTimes) / (numJobs * numJobs /2));\n System.out.println(\"PTA violations % for MINIZINC: \" + mznPercPTA);\n Statistics.mznPTAviolations.add(mznPercPTA);\n }\n\n //Sum-of-tardiness and tardiness per agent\n int mySum = sumOfTardTests.calculateSumOfTardiness(schedule, testInstance.preferences, testInstance.processingTimes);\n System.out.println(\"Sum of Tardiness for our solution: \" + mySum);\n int[] agentTardiness = sumOfTardTests.getAgentTardiness();\n\n int mznSum = 0;\n int[] agentTardinessMinizinc = null;\n if (minizincSolution != null) {\n mznSum = sumOfTardTests.calculateSumOfTardiness(minizincSolution, testInstance.preferences, testInstance.processingTimes);\n System.out.println(\"Sum of Tardiness for MINIZINC: \" + mznSum);\n agentTardinessMinizinc = sumOfTardTests.getAgentTardiness();\n }\n\n Statistics.mySumOfTardiness.add(mySum);\n if (minizincSolution != null) {\n Statistics.mznSumOfTardiness.add(mznSum);\n }\n\n System.out.println(\"Tardiness per agent: \" + Arrays.toString(agentTardiness));\n\n //Pareto efficiency\n System.out.println(\"Pareto Efficient schedule: \" + paretoTests.isScheduleParetoEfficient(schedule));\n //System.out.println(\"Pareto Efficiency per agent: \" + Arrays.toString(paretoTests.agentParetoEfficiency(agentTardiness)));\n\n //Gini index\n double myIndex = GiniIndexTester.getIndex(agentTardiness, numAgents);\n System.out.println(\"Gini Index for our solution: \" + myIndex);\n Statistics.myGiniIndex.add(myIndex);\n\n if (minizincSolution != null) {\n double mznIndex = GiniIndexTester.getIndex(agentTardinessMinizinc, numAgents);\n System.out.println(\"Gini Index for MINIZINC: \" + mznIndex);\n Statistics.mznGiniIndex.add(mznIndex);\n }\n\n return schedule;\n\n\n }", "public static void main(String[] args) throws Exception {\n\t\tint i;\r\n\t\tint [][]preci_recall = new int [5][6]; \r\n\r\n\t\tNGRAM ngram = new NGRAM();\r\n\t\t\r\n\t\tfor(i=0; i<5; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.println((i+1) + \" th FOLD IS A TEST SET\");\r\n\t\t\t\r\n\t\t\tdouble[][] test_ngram_features = ngram.feature(i,1);\r\n\t\t\tdouble[][] train_ngram_features = ngram.feature(i,0);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"NGRAM FEATURES...OK\");\r\n\t\r\n//\t\t\t\r\n//\t\t\tLIWC liwc = new LIWC();\r\n//\t\t\t\r\n//\t\t\tdouble[][] test_liwc_features = liwc.feature(i,1,test_ngram_features.length);\r\n//\t\t\tdouble[][] train_liwc_features = liwc.feature(i,0,train_ngram_features.length);\r\n//\r\n//\t\t\tSystem.out.println(\"LIWC FEATURES..OK\");\r\n//\t\t\t\r\n//\t\t\tCOMBINE combine = new COMBINE();\r\n//\t\t\tdouble[][] train_features = combine.sum(train_liwc_features,train_ngram_features);\r\n//\t\t\tdouble[][] test_features = combine.sum(test_liwc_features,test_ngram_features);\r\n//\t\t\t\r\n//\t\t\tSystem.out.println(\"COMBINE...OK\");\r\n\t\t\r\n\t\t\tSVMLIGHT svmlight = new SVMLIGHT();\r\n\t\t\tpreci_recall[i]=svmlight.calcc(train_ngram_features, test_ngram_features);\r\n\r\n\t\t}\r\n\t\t\r\n//\t 0 : truthful TP\r\n//\t 1 : truthful TP+FP\r\n//\t 2 : truthful TP+FN\r\n//\t 3 : deceptive TP\r\n//\t 4 : deceptive TP+FP\r\n//\t 5 : deceptive TP+FN\r\n\t\t\r\n\t\tint truthful_TP_sum=0,truthful_TPFP_sum=0,truthful_TPFN_sum=0;\r\n\t\tint deceptive_TP_sum=0,deceptive_TPFP_sum=0,deceptive_TPFN_sum=0;\r\n\t\t\r\n\t\tfor(i=0;i<5;i++) {\r\n\t\t\ttruthful_TP_sum+=preci_recall[i][0];\r\n\t\t\ttruthful_TPFP_sum+=preci_recall[i][1];\r\n\t\t\ttruthful_TPFN_sum+=preci_recall[i][2];\r\n\t\t\t\r\n\t\t\tdeceptive_TP_sum+=preci_recall[i][3];\r\n\t\t\tdeceptive_TPFP_sum+=preci_recall[i][4];\r\n\t\t\tdeceptive_TPFN_sum+=preci_recall[i][5];\r\n\t\t}\r\n\t\t\t\t\r\n\t\tSystem.out.println(\"\\n\\nTRUTHFUL_TP_SUM : \" + truthful_TP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFP_SUM : \" + truthful_TPFP_sum);\r\n\t\tSystem.out.println(\"TRUTHFUL_TPFN_SUM : \" + truthful_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE_TP_SUM : \" + deceptive_TP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFP_SUM : \" + deceptive_TPFP_sum);\r\n\t\tSystem.out.println(\"DECEPTIVE_TPFN_SUM : \" + deceptive_TPFN_sum);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nTRUTHFUL PRECISION : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFP_sum));\r\n\t\tSystem.out.println(\"TRUTHFUL RECALL : \" + (double)(truthful_TP_sum)/(double)(truthful_TPFN_sum));\r\n\t\t\r\n\t\tSystem.out.println(\"DECEPTIVE PRECISION : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFP_sum));\r\n\t\tSystem.out.println(\"DECEPTIVE RECALL : \" + (double)(deceptive_TP_sum)/(double)(deceptive_TPFN_sum));\r\n\t\t\r\n\r\n\t}", "private void swim(int k) {\r\n while (k > 1 && greater(k/2, k)) {\r\n swap(k, k / 2);\r\n k = k/2;\r\n }\r\n }", "public double getBestScore();", "public static int getOptimalK(Dataset<Row> vectorData) {\n\t\tList<Integer> K = new ArrayList<Integer>();\n\t\tList<Double> computeCost = new ArrayList<Double>();\n\n\t\tfor (int i = 2; i < 10; i++) {\n\n\t\t\tKMeans kMeansForTops = new KMeans().setK(i).setSeed(1L);\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tKMeansModel kMeansModel = kMeansForTops.fit(vectorData);\n\t\t\tSystem.out.println(\"Time to FIT \" + (System.currentTimeMillis() - start) / 1000);\n\t\t\tdouble cost = kMeansModel.computeCost(vectorData); // WCSS\n\t\t\t// KMeansSummary\n\t\t\tK.add(i);\n\t\t\tcomputeCost.add(cost);\n\t\t\t// System.out.println(\"================ Compite cost for K == \" + i + \" is == \"\n\t\t\t// + cost);\n\n\t\t\tDataset<Row> kMeansPredictions = kMeansModel.transform(vectorData);\n\n\t\t\tfor (int j = 0; j < i; j++) {\n\n\t\t\t\t// System.out.println(\"====================== Running it for \" + j + \"th cluster\n\t\t\t\t// when the K is \" + i);\n\t\t\t\t// System.out.println(\"====================== Range for the cluster count \" + i\n\t\t\t\t// + \" ===================\");\n\t\t\t\t// kMeansPredictions.where(kMeansPredictions.col(\"prediction\").equalTo(j)).agg(min(\"features\"),\n\t\t\t\t// max(\"features\")).show();\n\n\t\t\t}\n\n\t\t\t// kMeansPredictions.agg(min(\"features\"), max(\"features\")).show();\n\t\t\t// System.out.println(\"====================== Calculating Silhouette\n\t\t\t// ===================\");\n\n\t\t\t// Evaluate clustering by computing Silhouette score\n\t\t\tClusteringEvaluator topsEvaluator = new ClusteringEvaluator();\n\n\t\t\tdouble TopsSilhouette = topsEvaluator.evaluate(kMeansPredictions);\n\n\t\t\t// System.out.println(\"================ Silhouette score for K == \" + i + \" is\n\t\t\t// == \" + TopsSilhouette);\n\n\t\t}\n\n\t\tPlot plt = Plot.create();\n\t\t// plt.plot().add(K, computeCost).label(\"MyLabel\").linestyle(\"bx-\");\n\t\t// plt.plot().\n\n\t\tSystem.out.println(\"K List \" + K);\n\t\tSystem.out.println(\"Cost List \" + computeCost);\n\t\tplt.plot().add(K, computeCost).label(\"Elbow\").linestyle(\"--\");\n\t\tplt.xlabel(\"K\");\n\t\tplt.ylabel(\"Cost\");\n\t\tplt.title(\"Compute Cost for K-Means !\");\n\t\tplt.legend();\n\t\ttry {\n\t\t\tplt.show();\n\t\t} catch (IOException | PythonExecutionException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn 0;\n\n\t}", "public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }", "public void process()\n {\n for (int i = 0; i <= names.length-1; i++)\n {\n int x = 0;\n System.out.println(\"\");\n System.out.print(names[i] + \" had test scores of \");\n for (int j = 0; j <= scores[0].length-1; j++)\n {\n System.out.print(scores[i][j] + \", \");\n \n x += scores[i][j];\n \n }\n System.out.print(\" Test average is \" + x/4 + \".\");\n }\n System.out.println(\"\");\n findL();\n findH();\n findAvg();\n }", "public void rla() {\r\n\t\tint iter = 0;\r\n\t\t\r\n\t\twhile (true) {\r\n\t\t\titer++;\r\n\t\t\t\r\n\t\t\tHashMap<RouteState, ActionValue<RouteAction>> V0 = new HashMap<RouteState, ActionValue<RouteAction>> (V);\r\n\r\n\t\t\tfor (RouteState state : Q.keySet()) {\r\n\t\t\t\tfor (RouteAction action : Q.get(state).keySet()) {\t\t\t\r\n\t\t\t\t\tdouble value = R.get(state).get(action) + discountedSum(state, action);\r\n\t\t\t\t\tQ.get(state).put(action, value);\r\n\t\t\t\t}\r\n\t\t\t\tRouteAction bestAction = Q.get(state).entrySet().stream().max((entry1, entry2) -> entry1.getValue() > entry2.getValue() ? 1 : -1).get().getKey();\r\n\t\t\t\tDouble bestValue = Q.get(state).get(bestAction);\r\n\t\t\t\tActionValue<RouteAction> av = new ActionValue<RouteAction>(bestAction, bestValue);\r\n\r\n\t\t\t\tV.put(state, av);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (goodEnough(V0, V)) break;\r\n\t\t}\r\n\t\tSystem.out.println(\"Number of iterations: \" + iter);\r\n\t}", "public void resetScore (View v) {\n vScore = 0;\n kScore = 0;\n displayForTeamK(kScore);\n displayForTeamV(vScore);\n }", "public void calculateScore() {\n\n turnScore();\n\n if (turn == 1) {\n p1.setScore(p1.getScore() - turnScore);\n\n } else if (turn == 2) {\n p2.setScore(p2.getScore() - turnScore);\n\n }\n\n\n }", "int main()\n{\n int n,count=0;\n float score=0.0;\n while(1)\n {\n cin>>n;\n if(n<0)\n {\n score-=1;\n break;\n }\n if(n%2==0)\n score-=0.5;\n else if(n%2==1)\n {\n count++;\n score+=1;\n if(count==3)\n break;\n }\n }\n\tprintf(\"%.1f\",score);\n}", "private static float computeScore(GameModel model) {\n\n float score = 0;\n int numEmptyCells = 0;\n for (byte b : model.getGrid()) {\n if (b < 0) {\n numEmptyCells++;\n } else {\n score += 1 << b;\n }\n }\n return score * (1 + numEmptyCells * EMPTY_CELL_SCORE_BONUS);\n }", "public void makeStochastic() {\n \n double sum = 0.0;\n \n for(T row : getFirstDimension()) {\n \n // sum all values\n for(T col : getMatches(row)) {\n \n if(get(row, col)!=null) {\n sum += get(row, col);\n }\n \n }\n }\n \n \n for(T row : getFirstDimension()) {\n \n // sum all values\n for(T col : getMatches(row)) {\n \n if(get(row, col)!=null) {\n set(row, col, get(row, col)/sum);\n }\n \n }\n }\n }", "private void process() {\n\n Cluster current=_clusters.get(0);\n while (!current.isValid()) {\n KMeans kmeans=new KMeans(K,current);\n for (Cluster cluster : kmeans.getResult())\n if (cluster.getId()!=current.getId())\n _clusters.add(cluster);\n for (; current.isValid() && current.getId()+1<_clusters.size(); current=_clusters.get(current.getId()+1));\n }\n }", "S predictScores(P preProcInputs);", "public void cycle() {\r\n processTask(); // tune relative frequency?\r\n processConcept(); // use this order to check the new result\r\n }", "void calcScore() {\n\t\t\tMat points = new Mat(nodes.size(),2,CvType.CV_32FC1);\n\t\t\tMat line = new Mat(4,1,CvType.CV_32FC1);\n\n\t\t\tif(nodes.size() > 2) {\n\t\t\t\t// We know for sure here that the size() is at least 3\n\t\t\t\tfor(int i = 0; i < nodes.size(); i++) {\n\t\t\t\t\tpoints.put(i, 0, nodes.get(i).x);\n\t\t\t\t\tpoints.put(i, 1, nodes.get(i).y);\n\t\t\t\t}\n\t\n\t\t\t\tImgproc.fitLine(points, line, Imgproc.CV_DIST_L2, 0, 0.01, 0.01);\n\t\t\t\tPoint2 lineNormale = new Point2(line.get(0, 0)[0], line.get(1, 0)[0]);\n\t\t\t\tPoint2 linePoint = new Point2(line.get(2, 0)[0], line.get(3, 0)[0]);\n\t\n\t\t\t\tscore = 0;\n\t\t\t\tdouble totalLength = 0;\n\t\t\t\tdouble[] lengths = new double[nodes.size() - 1];\n\t\t\t\tfor(int i = 0; i < nodes.size(); i++) {\n\t\t\t\t\t// First score is the distance from each point to the fitted line\n\t\t\t\t\t// We normalize the distances by the base size so the size doesn't matter\n\t\t\t\t\tscore += Math.abs(nodes.get(i).distanceToLine(linePoint, lineNormale) / base().norm());\n\t\t\t\t\tif(i > 0) {\n\t\t\t\t\t\t// Then the collinearity of the steps with the base\n\t\t\t\t\t\t// That is cosine -> 1.0, where cosine = a dot b / |a|*|b|\n\t\t\t\t\t\tPoint2 step = nodes.get(i).minus(nodes.get(i-1));\n\t\t\t\t\t\tdouble dotProduct = step.dot(base());\n\t\t\t\t\t\tscore += Math.abs(dotProduct/(base().norm()*step.norm()) - 1);\n\t\t\t\t\t\ttotalLength += step.norm();\n\t\t\t\t\t\tlengths[i-1] = step.norm();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Normalize by the number of nodes so the shorter sequences don't have advantage\n\t\t\t\tscore /= nodes.size();\n\t\t\t\t// Add scores (penalties) for missing nodes\n\t\t\t\t// If we divide the total length by the expected number of steps\n\t\t\t\t// the result should be close to the length of the majority of the visible steps \n\t\t\t\tArrays.sort(lengths);\n\t\t\t\tdouble median = lengths.length % 2 == 0\n\t\t\t\t\t\t? (lengths[nodes.size()/2] + lengths[nodes.size()/2-1]) / 2\n\t\t\t\t\t\t: lengths[nodes.size()/2];\n\t\t\t\tscore += Math.abs(median - totalLength/(maxNodes-1)) / median;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Two or less nodes is not a chain. So give it the worst score possible \n\t\t\t\tscore = Double.MAX_VALUE;\n\t\t\t}\n\t\t}", "public void updateScore( Realization realization ){\n\t\trealization.setScore( calcScore(realization) ) ;\n\t}", "public static void forLoop() {\n // In this case, we have the raw score results of students.\n // In a test they took with 67 questions, we have recorded\n // how many they got correct.\n int[] testScores = {57, 65, 53, 34};\n\n // Our goal is to go through each score and convert that score into\n // a percentage score.\n // The overall flow of the code goes as follows.\n // 1) Initially, create a variable, i, and set it to 0. -> 2\n // 2) if i < testScores.length, then step 3. Otherwise, Step 5\n // 3) execute the body of code below. -> 4\n // 4) Once done executing the body, increment i by 1. -> 2.\n // 5) We're out of the loop!\n for (int i = 0; i < testScores.length; i++) {\n System.out.println(\"Test Score initially \" + testScores[i]);\n testScores[i] = (testScores[i] * 100) / 67;\n System.out.println(\"Test Score now \" + testScores[i]);\n System.out.println(\"==================\");\n }\n }", "private static <Key extends Comparable<Key> > void swim(Key []a, int k){\n while(k>1 &&less(a, k/2, k)){\n exch(a, k/2, k);\n k=k/2;\n }\n }", "@Override\n\tpublic void checkScore() {\n\t\t\n\t}", "@Test\r\n\tpublic void calculMetricInferiorStudentBetterScoreTest() {\r\n\t\tAssert.assertEquals(UtilCalculGrade.calculMetricInferior(new ModelValue(25f, 2f), 12f, 8f), new Float(0));\r\n\t}", "public void resetScore() {\n\t\tthis.score = 0;\n\t}", "double actFunction(double k){\n\t\treturn Math.max(0, k); //ReLU\n\t}", "private double scorePonderated(int i, int total) {\r\n\t\tif (total == 1) {\r\n\t\t\treturn 100.0;\r\n\t\t}\r\n\t\tdouble score = 100.0 / (2.0 * (i + 1));\r\n\t\treturn score;\r\n\t}", "public void updateScore(double d) {\n\t\tscore+=d;\t\n\t}", "private void evaluateProbabilities()\n\t{\n\t}", "private void process() {\n\tint i = 0;\n\tIOUtils.log(\"In process\");\n\tfor (Map.Entry<Integer, double[]> entry : vecSpaceMap.entrySet()) {\n\t i++;\n\t if (i % 1000 == 0)\n\t\tIOUtils.log(this.getName() + \" : \" + i + \" : \" + entry.getKey()\n\t\t\t+ \" : \" + this.getId());\n\t double[] cent = null;\n\t double sim = 0;\n\t for (double[] c : clusters.keySet()) {\n\t\t// IOUtils.log(\"before\" + c);\n\t\tdouble csim = cosSim(entry.getValue(), c);\n\t\tif (csim > sim) {\n\t\t sim = csim;\n\t\t cent = c;\n\t\t}\n\t }\n\t if (cent != null && entry.getKey() != null) {\n\t\ttry {\n\t\t clusters.get(cent).add(entry.getKey());\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t}\n\t }\n\t}\n }", "public static void main(String[] args) {\n\r\n\t\tScanner input= new Scanner(System.in);\r\n\t\tSystem.out.println(\"학생 수 입력해봐라\");\r\n\t\tint su=input.nextInt();//학생 수 입력 받음\r\n\r\n\t\t// 점수(score)를 입력 받은 학생 수만큼 선언, 그런데 한 학생당 과목 3개 점수 입력 받음\r\n\t\tint [][] score=new int[su][3];\r\n\r\n\t\t/*\t\t\t\t//입력\r\n\t\tint sum_1[] =new int[score.length-1];\t\r\n\t\tdouble avg_1[] = new double[score.length-1];//학생 평균\t\r\n\t\tfor(int i =0; i<score.length;i++) {\r\n\t\t\tSystem.out.println((i+1)+\"째 학생의 성적을 입력 -> \");\r\n\t\t\tfor(int j=0; j<score[i].length;j++) {\r\n\t\t\t\tscore[i][j]=input.nextInt();\r\n\t\t\t\tsum_1[i] +=score[i][j];\r\n\t\t\t}\r\n\t\t\tavg_1[i]=sum_1[i]/score.length;\r\n\t\t}\r\n\r\n\r\n\t\t출력\r\n\r\n\t\tfor(int i =0; i<score.length;i++) {\r\n\t\t\tSystem.out.printf(\"%d번째 학생의 총점은 %d\",(i+1),sum_1[i]);\r\n\r\n\t\t * \t \r\n\t\t */\r\n\t\t//입력2\r\n\r\n\t\tfor(int i =0; i<score.length;i++) {\r\n\t\t\tSystem.out.println((i+1)+\"째 학생의 성적을 입력 -> \");\r\n\t\t\tfor(int j=0; j<score[i].length;j++) {\r\n\t\t\t\tscore[i][j]=input.nextInt();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tint sum_2[] =new int[score[su-1].length];//과목의 갯수는 한학생의 열의 갯수 이다.\r\n\t\tdouble avg_2[] = new double[score[su-1].length];//과목 평균\r\n\t\t\r\n\t\tfor(int j=0;j<score[su-1].length;j++) {\r\n\t\t\tfor(int i=0;i<score.length;i++) {\r\n\t\t\t\tsum_2[j] += score[i][j];//[0][0] +[1][0]+[2][0] = 한 과목의 합\r\n\t\t\t} \r\n\t\t\tavg_2[j]=sum_2[j]/score[su-1].length;\r\n\t\t}\r\n\t\t//출력 \r\n\t\tSystem.out.println();\r\n\r\n\t\tSystem.out.printf(\"국어 과목 총점 %d이고 평균은 %f입니다.\",sum_2[0],avg_2[0]);\r\n\t\tSystem.out.printf(\"\\n수학 과목 총점 %d이고 평균은 %f입니다.\",sum_2[1],avg_2[1]);\r\n\t\tSystem.out.printf(\"\\n영어 과목 총점 %d이고 평균은 %f입니다.\",sum_2[2],avg_2[2]);\r\n\t}", "private static void k_means_online(double[][] X, int k, String[] args){\n double[][] m = chooseKCluserCentres(k, X[0].length);\n double[][] oldM = m;\n \n //while loop and stopping condition\n int count = 0;\n \n //the index of each m associated to X, done below\n //first array is list of m's, second will be associated X_row indexes\n /*int[][] X_Assignments = new int[k][noRows];*/\n List<List<Integer>> X_Assignments = initXAssignments(m);\n\n \tboolean continue_ = findTermination(count, oldM, m);\n while(continue_){\n \toldM = m;\n \tX_Assignments = initXAssignments(m);\n\n \tfor(int i=0; i<X.length; i++){\n \t\tint minClusterIndex = findMinClusterIndex(X[i], m);\n \t\t//System.out.println(minClusterIndex);\n \t\tX_Assignments.get(minClusterIndex).add(i); //add to the list of clusters to points\n \t}\n\n \t//Check lists\n \t//printDoubleArrayList(X_Assignments);\n\n \tfor (int i=0; i<m.length; i++){\n \t\tm[i] = findClusterMean(X, X_Assignments, m, i); //finds for every dimension \n \t}\n\n \tcontinue_ = findTermination(count, oldM, m);\n \tcount++;\n }\n\n double sumOfSquaresError = findSumOfSquaresError(X, m);\n printOutput(X_Assignments, m, sumOfSquaresError, k, count);\n\n //append output file specified by args[1]\n //writeOutputToFile (args[0], k, m, sumOfSquaresError, args[1]);\n }", "protected Double successProbability(){\n\t\tnodeKValues = collectKValues();\n\t\tList<Integer[]> placements = getDistinctPlacements(getMinKPath());\n\t\tlong maxNumberOfColorings = 0;\n\t\tfor (Integer[] placement : placements){\n\t\t\tlong colorings = numberOfColorings(placement);\n\t\t\tif (colorings > maxNumberOfColorings)\n\t\t\t\tmaxNumberOfColorings = colorings;\n\t\t}\n\t\tDouble probability = 1.0/maxNumberOfColorings;\n\t\tfor (int i=1; i<=pathLength; i++){ // factorial of pathlength\n\t\t\tprobability = probability * i;\n\t\t}\n\t\treturn probability;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tList<Integer> a = new ArrayList<>();\n\t\ta.add(1);\n\t\ta.add(1);\n\t\ta.add(2);\n\t\ta.add(2);\n\t\ta.add(4);\n\t\ta.add(3);\n\t\tList<Integer> b = new ArrayList<>();\n\t\tb.add(2);\n\t\tb.add(3);\n\t\tb.add(3);\n\t\tb.add(4);\n\t\tb.add(4);\n\t\tb.add(5);\n\t\tgetMinScore(6, a, b);\n\t}", "public void score(List<String> modelFiles, String testFile, String outputFile) {\n/* 1180 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 1181 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* 1184 */ int nFold = modelFiles.size();\n/* */ \n/* 1186 */ List<RankList> samples = readInput(testFile);\n/* 1187 */ System.out.print(\"Preparing \" + nFold + \"-fold test data... \");\n/* 1188 */ FeatureManager.prepareCV(samples, nFold, trainingData, testData);\n/* 1189 */ System.out.println(\"[Done.]\");\n/* */ try {\n/* 1191 */ BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), \"UTF-8\"));\n/* 1192 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* 1194 */ List<RankList> test = testData.get(f);\n/* 1195 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1196 */ int[] features = ranker.getFeatures();\n/* 1197 */ if (normalize)\n/* 1198 */ normalize(test, features); \n/* 1199 */ for (RankList l : test) {\n/* 1200 */ for (int j = 0; j < l.size(); j++) {\n/* 1201 */ out.write(l.getID() + \"\\t\" + j + \"\\t\" + ranker.eval(l.get(j)) + \"\");\n/* 1202 */ out.newLine();\n/* */ } \n/* */ } \n/* */ } \n/* 1206 */ out.close();\n/* */ }\n/* 1208 */ catch (IOException ex) {\n/* */ \n/* 1210 */ throw RankLibError.create(\"Error in Evaluator::score(): \", ex);\n/* */ } \n/* */ }", "private static double[] performBackSubstitution (double[][] augmentedMatrix, int n) {\n double[] solution = new double[n];\n for (int i = n - 1; i >= 0; i--) {\n double sum = 0.0;\n for (int j = i + 1; j < n; j++) {\n sum += augmentedMatrix[i][j] * solution[j];\n }\n solution[i] = (augmentedMatrix[i][n] - sum) / augmentedMatrix[i][i];\n }\n return solution;\n }", "@Test\n public void testRunScoringScenario() throws Exception\n {\n YahtzeeModel y1 = new YahtzeeModel();\n\n //Turn 1\n y1.getDiceCollection().setValues(1, 1, 3, 3, 3);\n assertEquals(2, y1.scoreOnes());\n //Turn 2\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(6, y1.scoreTwos());\n //Turn 3\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(3, y1.scoreThrees());\n //Turn 4\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y1.scoreFours());\n //Turn 5\n y1.getDiceCollection().setValues(2, 1, 2, 2, 5);\n assertEquals(5, y1.scoreFives());\n //Turn 6\n y1.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(30, y1.scoreSixes());\n //3 of a kind\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(10, y1.scoreThreeOfAKind());\n //4 of a kind\n y1.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(10, y1.scoreFourOfAKind());\n //full house\n y1.getDiceCollection().setValues(6, 4, 6, 4, 6);\n assertEquals(25, y1.scoreFullHouse());\n //small straight\n y1.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(0, y1.scoreSmallStraight());\n //large straight\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y1.scoreLargeStraight());\n //yahtzee\n y1.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(50, y1.scoreYahtzee());\n //chance\n y1.getDiceCollection().setValues(6, 1, 1, 1, 1);\n assertEquals(10, y1.scoreChance());\n\n //calculate bonus and verify bonus\n assertEquals(0, y1.scoreBonus());\n\n //verify that the available scoring types has one entry for YAHTZEE since it was scored\n assertEquals(1, y1.getScoreCard().getAvailableScoreTypes().size());\n assertTrue(y1.getScoreCard().getAvailableScoreTypes().contains(YahtzeeScoreTypes.YAHTZEE));\n\n //verify final score\n assertEquals(151, y1.getScoreCard().getScore());\n\n\n //*** Game 2: 0 Bonus, 2 Yahtzee ***\n YahtzeeModel y2 = new YahtzeeModel();\n\n //Turn 1\n y2.getDiceCollection().setValues(1, 1, 1, 1, 1);\n assertEquals(50, y2.scoreYahtzee());\n //Turn 2\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(6, y2.scoreTwos());\n //Turn 3\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(3, y2.scoreThrees());\n //Turn 4\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y2.scoreFours());\n //Turn 5\n y2.getDiceCollection().setValues(2, 1, 2, 2, 5);\n assertEquals(5, y2.scoreFives());\n //Turn 6\n y2.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(30, y2.scoreSixes());\n //3 of a kind\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(10, y2.scoreThreeOfAKind());\n //4 of a kind\n y2.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(10, y2.scoreFourOfAKind());\n //full house\n y2.getDiceCollection().setValues(6, 4, 6, 4, 6);\n assertEquals(25, y2.scoreFullHouse());\n //small straight\n y2.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(0, y2.scoreSmallStraight());\n //large straight\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y2.scoreLargeStraight());\n //yahtzee\n y2.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(100, y2.scoreYahtzee());\n //chance\n y2.getDiceCollection().setValues(6, 1, 1, 1, 1);\n assertEquals(10, y2.scoreChance());\n\n //calculate bonus and verify bonus\n assertEquals(0, y2.scoreBonus());\n\n //verify that the available scoring types has two entres...\n // one for YAHTZEE and one for ONES\n assertEquals(2, y2.getScoreCard().getAvailableScoreTypes().size());\n assertTrue(y2.getScoreCard().getAvailableScoreTypes().contains(YahtzeeScoreTypes.ONES));\n assertTrue(y2.getScoreCard().getAvailableScoreTypes().contains(YahtzeeScoreTypes.YAHTZEE));\n\n //verify final score\n assertEquals(249, y2.getScoreCard().getScore());\n\n //*** Game 3: 1 Bonus, 0 Yahtzee ***\n YahtzeeModel y3 = new YahtzeeModel();\n\n //Turn 1\n y3.getDiceCollection().setValues(1, 1, 1, 1, 1);\n assertEquals(5, y3.scoreOnes());\n //Turn 2\n y3.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(6, y3.scoreTwos());\n //Turn 3\n y3.getDiceCollection().setValues(3, 3, 2, 2, 3);\n assertEquals(9, y3.scoreThrees());\n //Turn 4\n y3.getDiceCollection().setValues(2, 4, 4, 4, 3);\n assertEquals(12, y3.scoreFours());\n //Turn 5\n y3.getDiceCollection().setValues(2, 5, 2, 2, 5);\n assertEquals(10, y3.scoreFives());\n //Turn 6\n y3.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(30, y3.scoreSixes());\n //3 of a kind\n y3.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(10, y3.scoreThreeOfAKind());\n //4 of a kind\n y3.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(10, y3.scoreFourOfAKind());\n //full house\n y3.getDiceCollection().setValues(6, 4, 6, 4, 6);\n assertEquals(25, y3.scoreFullHouse());\n //small straight\n y3.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(0, y3.scoreSmallStraight());\n //large straight\n y3.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y3.scoreLargeStraight());\n //yahtzee\n y3.getDiceCollection().setValues(2, 1, 2, 2, 2);\n assertEquals(0, y3.scoreYahtzee());\n //chance\n y3.getDiceCollection().setValues(6, 1, 1, 1, 1);\n assertEquals(10, y3.scoreChance());\n\n //calculate bonus and verify bonus\n assertEquals(35, y3.scoreBonus());\n\n //verify that no scoring types remain\n assertEquals(0, y3.getScoreCard().getAvailableScoreTypes().size());\n\n //verify final score\n assertEquals(162, y3.getScoreCard().getScore());\n }", "private double gaussprob(int k, double r)\n\t{\n\t\treturn \tMath.exp( -0.5*Math.pow( ((double)k-r)/data_bg_std , 2 ) ) * \n\t\t\t\tMath.pow( 2*Math.PI, -0.5 ) / data_bg_std;\n\t}", "public void train(){\r\n\t\tdouble output = 0.0;\r\n\t\tList<Integer> teacher = null;\r\n\t\tdouble adjustedWeight = 0.0;\r\n\t\tdouble error = 0.0;\r\n\t\tdouble deltaK = 0.0;\r\n\r\n\t\tfor(int counter = 0; counter < maxEpoch; counter++){\r\n\t\t\tfor(Instance inst : trainingSet){\r\n\t\t\t\tcalculateOutputForInstance(inst);\r\n\t\t\t\tteacher = inst.classValues;\r\n\t\t\t\t//jk weight\r\n\t\t\t\tfor(int i = 0; i < outputNodes.size(); i++){\r\n\t\t\t\t\tNode kNode = outputNodes.get(i);\r\n\t\t\t\t\toutput = kNode.getOutput();\r\n\t\t\t\t\terror = teacher.get(i) - output;\r\n\t\t\t\t\tdeltaK = error*getReLU(kNode.getSum());\r\n\t\t\t\t\tfor(int j = 0; j < kNode.parents.size(); j++){\r\n\t\t\t\t\t\tNodeWeightPair jkWeight = kNode.parents.get(j);\r\n\t\t\t\t\t\tNode jNode = jkWeight.node;\r\n\t\t\t\t\t\tadjustedWeight = getJK(jNode, deltaK);\r\n\t\t\t\t\t\tjkWeight.weight += adjustedWeight;\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//ij weight\r\n\t\t\t\tfor(int i = 0; i < hiddenNodes.size(); i++){\r\n\t\t\t\t\tNode jNode = hiddenNodes.get(i);\r\n\t\t\t\t\tif(jNode.parents == null) continue;\r\n\t\t\t\t\tfor(int j = 0; j < jNode.parents.size(); j++){\r\n\t\t\t\t\t\tNodeWeightPair ijWeight = jNode.parents.get(j);\r\n\t\t\t\t\t\tNode iNode = ijWeight.node;\r\n\t\t\t\t\t\tadjustedWeight = getIJ(iNode, jNode, teacher, i);\r\n\t\t\t\t\t\tijWeight.weight += adjustedWeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void testScoreboardCaseThree () throws Exception {\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (first Yes counts only Min.Pts)\n \"3,1,A,5,No\", // 20\n \"4,1,A,7,Yes\", // 20 (all runs count!)\n \"5,1,A,9,No\", // 20\n\n \"6,1,B,11,No\", // zero (not solved)\n \"7,1,B,13,No\", // zero (not solved)\n\n \"8,2,A,30,Yes\", // 30\n\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 3 tests when all runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n \n// String [] rankData = {\n// \"1,team2,1,30\"\n// \"2,team1,1,83\",\n// };\n \n scoreboardTest (2, runsData, rankData);\n }", "private void runBest() {\n }" ]
[ "0.62225026", "0.6026785", "0.58101755", "0.579233", "0.5788909", "0.5784515", "0.57049996", "0.56948453", "0.56916964", "0.56843805", "0.5661735", "0.5657526", "0.56532264", "0.5622327", "0.55669487", "0.5563056", "0.5558342", "0.555665", "0.553551", "0.5533695", "0.55243045", "0.55025625", "0.54888904", "0.5464776", "0.54604024", "0.5448857", "0.54442567", "0.5431556", "0.5429589", "0.5429176", "0.54065144", "0.5374015", "0.5352668", "0.53460085", "0.5340924", "0.53406984", "0.5325431", "0.5325275", "0.53194076", "0.53165776", "0.5295524", "0.52764183", "0.52728224", "0.52724016", "0.5269852", "0.5262209", "0.5253787", "0.5252653", "0.5250942", "0.5246193", "0.5242526", "0.5231356", "0.5221722", "0.52098995", "0.5202036", "0.5201382", "0.5198736", "0.5190679", "0.51733404", "0.51701605", "0.5169771", "0.5165549", "0.5162483", "0.5160393", "0.51587945", "0.51582235", "0.51575667", "0.51570207", "0.5127913", "0.5119176", "0.5118843", "0.511802", "0.5111035", "0.5106465", "0.51064134", "0.5105578", "0.51036143", "0.5100738", "0.51006883", "0.50934863", "0.50905377", "0.50892407", "0.50873315", "0.50815237", "0.50794977", "0.50776106", "0.50717145", "0.50716394", "0.5071611", "0.5067924", "0.5063661", "0.506304", "0.5060376", "0.50520873", "0.505168", "0.50479203", "0.504718", "0.5045039", "0.5044471", "0.503774", "0.50371146" ]
0.0
-1
Determine how much values in a list are changing. Useful for detecting convergence of data values.
public double getAveDelta(double[] curr, double[] prev) { double aveDelta = 0; assert (curr.length == prev.length); for (int j = 0; j < curr.length; j++) { aveDelta += Math.abs(curr[j] - prev[j]); } aveDelta /= curr.length; return aveDelta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getChanged () {\n int d = getDiff () * 2;\n int s = getSize () * 2;\n\n for (int i = 0; i < references.length; i++) {\n if (references[i] != null) {\n d += references[i].getDiff ();\n s += references[i].getSize ();\n }\n }\n \n // own cluster change is twice as much important than \n // those referenced\n int ret = d * 100 / s;\n if (ret == 0 && d > 0) {\n ret = 1;\n }\n return ret;\n }", "public long getLossCount()\n\t{\n\t\tCollections.sort(list);\n\t\treturn list.get(list.size()-1)- list.get(0) - list.size()+1;\n\t}", "private void updateElementListFromSegmet(int changeValue, List<Integer> elementList) {\n\n int changeIndex = 0;\n int change = 0;\n\n for (int i = 0; i < elementList.size(); i++) {\n if (changeValue == elementList.get(i)) {\n changeIndex = i;\n change++;\n }\n }\n\n if (change == 0) {\n for (int i = 0; i < elementList.size(); i++) {\n if (changeValue > elementList.get(i)) {\n continue;\n }\n int value = elementList.get(i) - 1;\n elementList.set(i, value);\n }\n return;\n }\n\n for (int i = elementList.size() - 1; i >= 0; i--) {\n if (elementList.get(i) == changeValue) {\n break;\n } else {\n int value = elementList.get(i) - 1;\n elementList.set(i, value);\n }\n\n }\n\n elementList.remove(changeIndex);\n\n }", "private void countChange() {\n /* To make 0.00, we use 0 coins. */\n myIndices[0] = 0;\n \n /* \n * Work from subproblem $0.01 to target. \n * Because subproblems overlap, we will\n * store them and use them dynamically.\n */\n for (int curr = 1; curr <= myTarget; curr++) {\n /* \n * Adds one coin (current-next used) to\n * the preemptive minimum coins needed.\n */\n myIndices[curr] = getMinPrior(curr) + 1;\n }\n \n myMinCoins = myIndices[myTarget];\n }", "private static int count(Number[] data, double value, int start) {\n int count = 0;\n for (int i = start; i < data.length; ++i) {\n if (Helper.roughlyEqual(data[i].doubleValue(), value)) {\n ++count;\n }\n }\n\n return count;\n }", "public int how_far_away_isPowerOf2(ArrayList list) {\n int toMinus = Integer.MAX_VALUE;\n for (int i = 1; i <= list.size() / 2; i++) {\n int pow2 = (int) Math.pow(2, i);\n if (pow2 == list.size()) {\n return 0;\n }\n int diff = list.size() - pow2;\n // diff can not be less that 0\n if (diff < toMinus && diff > 0) {\n toMinus = diff;\n }\n }\n // the original size of the waveform should be smaller than the size after the cut\n // times 2.\n assert 0 <= toMinus && toMinus < list.size();// double check\n assert list.size() < (list.size() - toMinus) * 2;\n return toMinus;\n\n }", "public void update( Double newVal ){\n\t\tDouble val = normalize( newVal );\n\t\tint idx = findInterval( val );\n\t\t//log.info( \"interval for value {} is {}\", val, idx );\n\t\thistogram[idx]++;\n\t\tcount++;\n\t}", "public double getEstimate()\n {\n assert list.length > 0: \"The list cannot be empty\";\n int R = list[0];\n \n //count how many are smaller or equal to R\n double counter = 0;\n for (int i = 1; i < k; i++) {\n if (list[i]<R)\n counter++;\n }\n return -Math.pow(2, R - 1) * Math.log(counter / (k-1)); }", "public void calculateDifferences() {\n\t\t\tMap<Integer, Integer> shifts = new HashMap<Integer, Integer>();\n\t\t\tfor (int voiceDetected : vDitected) {\n\t\t\t\tfor (int oldValue : occurences) {\n\t\t\t\t\tint shift = voiceDetected - oldValue;\n\t\t\t\t\tif (shifts.containsKey(shift)) {\n\t\t\t\t\t\tshifts.put(shift, shifts.get(shift) + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshifts.put(shift, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!shifts.isEmpty()) {\n\t\t\t\tpossibleShift = getMaxValuedKey(shifts);\n\t\t\t\tvaluesSet = true;\n\t\t\t}\n\t\t}", "private int countPeaks(double[] values, double epsilon) {\n\t\t\n\t\tint nPeaks = 0;\n\t\tboolean previouslyIncreased = false;\n\t\tdouble previousValue = values[0]; // we can't have this count as previouslyIncreased\n\t\tfor (double value : values) {\n\t\t\tif (previouslyIncreased && value < previousValue) {\n\t\t\t\tnPeaks++;\n\t\t\t}\n\t\t\tif (value > previousValue) {\n\t\t\t\tpreviouslyIncreased = true;\n\t\t\t} else {\n\t\t\t\tpreviouslyIncreased = false;\n\t\t\t}\n\t\t\tpreviousValue = value;\n\t\t}\n\t\t\n\t\treturn nPeaks;\n\n\t}", "public int wyeDeltaCount(List<String> sequence);", "protected void updateValues(){\n double total = 0;\n for(int i = 0; i < values.length; i++){\n values[i] = \n operation(minimum + i * (double)(maximum - minimum) / (double)numSteps);\n \n total += values[i];\n }\n for(int i = 0; i < values.length; i++){\n values[i] /= total;\n }\n }", "@Override\n\tpublic int checkHandVal(List<Integer> Hand) {\n\t\tint total = 0;\n\t\tfor (Integer v : Hand) {\n\t\t\ttotal += v;\n\t\t}\n\t\treturn total;\n\t}", "public void calculateTimeDifferences() {\n\n findExits();\n\n try {\n\n\n if (accumulate.size() > 0) {\n\n for (int i = 1; i < accumulate.size() - 1; i++) {\n if (accumulate.get(i).value > accumulate.get(i - 1).value\n && timeOfExists.size() > 0) {\n\n double timeOfEntry = accumulate.get(i).timeOfChange;\n double timeOfExit = timeOfExists.get(0);\n\n timeOfExists.remove(timeOfExit);\n timeOfChanges.add(timeOfExit - timeOfEntry);\n }\n\n }\n }\n } catch (IndexOutOfBoundsException exception) {\n LOG_HANDLER.logger.severe(\"calculateTimeDifferences \"\n + \"Method as thrown an OutOfBoundsException: \"\n + exception\n + \"Your timeOfChanges seems to be null\");\n }\n }", "public double oldKelly (ArrayList<Double> returnList) {\n\t\tDescriptiveStatistics positiveReturnList = new DescriptiveStatistics();\n\t\tDescriptiveStatistics negativeReturnList = new DescriptiveStatistics();\n\t\tdouble countPositive=0.0;\n\t\tdouble countNegative=0.0;\n\n\t\tfor(Double ret : returnList){\n\t\t\tif(ret > 0){\n\t\t\t\tpositiveReturnList.addValue(ret);\n\t\t\t\tcountPositive++;\n\t\t\t\t\n\t\t\t} else if(ret < 0){\n\t\t\t\tnegativeReturnList.addValue(ret);\n\t\t\t\tcountNegative++;\n\t\t\t}\n\t\t}\n\t\tdouble winningPercentage = countPositive/(countNegative+countPositive);\n\t\tdouble averageGain = positiveReturnList.getMean();\n\t\tdouble averageLoss = negativeReturnList.getMean();\n\t\tdouble gainRatio = Math.abs(averageGain/averageLoss);\n\t\tdouble kelly = winningPercentage - ((1-winningPercentage)/gainRatio);\n\t\treturn kelly;\n\t\t\n\t}", "public Double getChange(int in);", "private static ArrayList<Float> manipulate(Set manipulatePosList, int anomaly, ArrayList<Float> simList) {\r\n for (Object elem : manipulatePosList) {\r\n switch (anomaly) {\r\n case 3:\r\n if ((Integer) elem == 0) {\r\n lowerLimNext = startHum + max_rateOfChange;\r\n } else {\r\n lowerLimNext = (float) simList.get((Integer) elem - 1) + max_rateOfChange;\r\n }\r\n upperLimNext = upperLimit;\r\n nextValue = calcNextValue(lowerLimNext, upperLimNext);\r\n simList.add((Integer) elem, nextValue);\r\n break;\r\n case 4:\r\n simList.add((Integer) elem, -1f);\r\n break;\r\n case 5:\r\n simList.add((Integer) elem, -1f);\r\n break;\r\n }\r\n }\r\n return simList;\r\n }", "private void updateValue() {\n int minValue = 100; //Minimum value to be calculated, initialized to a large number\n value = 0; //Value reinitialized to 0\n for (Integer i : values) {\n if (i > value && i <= 21) {\n value = i; //Sets value to maximum value less than or equal to 21\n }\n if (i < minValue) {\n minValue = i; //Sets minimum value to lowest value in the list\n }\n }\n if (value == 0) {\n value = minValue; //Sets value to minValue if no values 21 or less\n }\n valueLabel.setText(\"Value: \" + value); //Sets text of value label\n if (value > 21) {\n bust(); //Busts if value greater than 21\n }\n }", "public int countInversion(){\r\n\t\tsetInversiones(0);\r\n\t\tnumeros = countStep(numeros, 0, numeros.size()-1);\r\n\t\treturn getInversiones();\r\n\t}", "@Override\n\t\tboolean hasMatch(ArrayList<Card> hand) {\n\t\t\tfor (int i = 0; i < hand.size(); i++) {\n\t\t\t\tif (i + 1 < hand.size()) {\n\t\t\t\t\tif (hand.get(i + 1).getCardValue().getValue()\n\t\t\t\t\t\t\t- hand.get(i).getCardValue().getValue() > 1)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "private static List<Integer> statify(List<Double> weights, double mean, double stdDev) {\n \tList<Integer> stateList = new LinkedList<Integer>();\n \t\n \tdouble stateOneLine = mean;\n\t\tdouble stateTwoLine = mean + stdDev/2;\n\t\t\n \tfor(Double weight : weights) {\n \t\tif (weight.doubleValue() < stateOneLine) {\n \t\t\tstateList.add(0);\n \t\t} else if (weight.doubleValue() < stateTwoLine) {\n \t\t\tstateList.add(1);\n \t\t} else {\n \t\t\tstateList.add(2);\n \t\t}\n \t}\n \t\n \treturn stateList;\n }", "public Double getChange();", "public void eventLiving(double[] changes){\n living = (int) Math.floor(living * (1 + (changes[0]/100)));\n living += changes[1];\n \n if(living > 100){\n living = 100;\n }\n \n if(living < 0){\n living = 0;\n }\n }", "public int countInversion(){\n\t\tsetInversiones(0);\n\t\tnumeros = countStep(numeros, 0, numeros.size()-1);\n\t\treturn getInversiones();\n\t}", "public int[] coldN(ArrayList<LottoDay> list)\n\t{ \n\t\tint low=200;//set low to 200\n\t\tint[] numF = new int [48]; //create array of occurrences\n\t\tint[] check = new int [5]; //create an array for the first five numbers and the five lowest numbers\n\t\tint counter =0; //counts number of occurrences\n\t\t//cold numbers for 1-47\n\t\tfor(int i=0; i<list.size();i++)\n\t\t{\n\t\t\tone = list.get(i);//get object\n\t\t\tcheck = one.getWNum();//store the 5 lotto numbers\n\t\t\tfor(int j=0; j<numF.length;j++)\n\t\t\t{\n\t\t\t\tfor(int k =0; k<check.length;k++)\n\t\t\t\t{\n\t\t\t\t\t//if lotto number equals the index\n\t\t\t\t\tif(check[k]==j)\n\t\t\t\t\t{\n\t\t\t\t\t\tcounter++; //add one to counter\n\t\t\t\t\t\tnumF[j]=counter+numF[j];//add one to occurrence\n\t\t\t\t\t\tcounter=0;//reset counter\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//check for lowest number\n\t\tfor(int j=0; j<check.length; j++)\n\t\t{\n\t\t\tfor(int i=0; i<numF.length;i++)\n\t\t\t{\n\t\t\t\t//occurrence isn't zero and is lower than low\n\t\t\t\tif(numF[i]<low &&numF[i]!=0)\n\t\t\t\t{\n\t\t\t\t\tlow = numF[i]; //set low to new low of occurrence\n\t\t\t\t\tcheck[j]=i; //store new low occurrence\n\t\t\t\t\tindex=i; //store index of occurrence\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tlow=200;//reset low\n\t\t\tnumF[index]=0;//sets the lowest occurrence to zero\n\n\t\t}\n\n\n\n\t\treturn check;//return 5 lowest numbers\n\n\n\t}", "public double countSSE(List<Offer> list) {\n double sse = 0.0;\n for (Offer offer : list) {\n sse += Math.pow((offer.getFinalDistance()), 2);\n }\n return (int) Math.sqrt(sse);\n }", "private void EvalFitness(){\r\n _FitVal=0;\r\n for(int i=0; i<7;i++)\r\n for(int j=i+1;j<8;j++){\r\n if( _Data[i]==_Data[j]) _FitVal++;\r\n if(j-i==Math.abs(_Data[i]-_Data[j])) _FitVal++;\r\n }\r\n }", "@Override\n\tpublic int getEVotesDem(ArrayList<InfoTemp> copy) {\n\t\tint twoPercent=0;\n\t\tint total=0;\n\t\tfor (InfoTemp e: copy){\n\t\t\ttwoPercent=(int)(e.pVoteRep*.02);\n\t\t\te.pVoteRep-=twoPercent;\n\t\t\te.pVoteDem+=twoPercent;\n\t\t\tif (e.pVoteDem>e.pVoteRep){\n\t\t\t\ttotal+=e.eVote;\n\t\t\t}\n\t\t}\n\t\treturn total; \n\t}", "int findMax(List<double[]> x){\n List<double[]> maxInfo = new ArrayList<>();\n boolean increasing = false;\n double maxNum = x.get(0)[0];\n double maxFrame = 1;\n double slope = 0;\n for(int i = 0; i<x.size()-1;i++){\n System.out.println(x.get(i)[0]);\n if(x.get(i+1)[0] < x.get(i)[0]){\n increasing = true;\n slope = x.get(i+1)[0] - x.get(i)[0];\n maxNum = x.get(i+1)[0];\n maxFrame = x.get(i+1)[1];\n }\n else if(x.get(i+1)[0] > x.get(i)[0] && increasing && maxNum<150){\n System.out.println(\"PEAK: \" + maxNum + \",\" + maxFrame);\n increasing = false;\n maxInfo.add(new double[]{maxNum, maxFrame});\n maxNum = 0;\n maxFrame = 0;\n }\n }\n //removes false peaks with close frame tag near each other\n for(int i = 0; i < maxInfo.size()-1;i++){\n if(maxInfo.get(i+1)[1] - maxInfo.get(i)[1] <=10){\n System.out.println(\"REMOVED \" + maxInfo.get(i+1)[0]);\n maxInfo.remove(i+1);\n }\n }\n return maxInfo.size();\n }", "public long getTimeOfLastValuesChanged();", "public int deltaWyeCount(List<String> sequence);", "public static int computeTimeFinish(ArrayList<Integer> l) {\n\n int sum = 0;\n Collections.sort(l);\n int[] peoples = new int[3];\n peoples[0] = l.size() / 3;\n peoples[1] = (l.size() - peoples[0]) / 2;\n peoples[2] = (l.size() - peoples[0]) / 2;\n int position = 0;\n\n while (l.size() > 0){\n int count = 0;\n int total = 0;\n\n while (peoples[position] > 0){\n\n if (l.size() == 0){\n break;\n }\n\n if (count % 2 == 0) {\n total += l.get(l.size() - 1);\n l.remove(l.size() - 1);\n } else {\n total += l.get(0);\n l.remove(0);\n }\n peoples[position]--;\n count++;\n }\n if (total > sum){\n sum = total;\n }\n position++;\n }\n\n return sum;\n }", "public void differences(){\n\n\t\t/* Set the value of the initial differences to zero (it is calculated through\n\t\t * incrementing the variable) */\n\t\tfixeddifferences=0;\n\n\t\t/* For every cell in the cell space */\n\t\tfor (int i=0;i<GlobalAttributes.xCells;i++){\n\t\t\tfor(int j=0;j<GlobalAttributes.yCells;j++){\n\n\t\t\t\t/* If the value in the initial configuration differs from the value\n\t\t\t\t * in the target configuration */\n\t\t\t\tif(source[i][j].topSubcellValue != target[i][j].topSubcellValue ||\n\t\t\t\t\t\tsource[i][j].bottomSubcellValue != target[i][j].bottomSubcellValue ||\n\t\t\t\t\t\tsource[i][j].leftSubcellValue != target[i][j].leftSubcellValue ||\n\t\t\t\t\t\tsource[i][j].rightSubcellValue != target[i][j].rightSubcellValue){\n\n\t\t\t\t\t/* Set the value in the fixed initial difference matrix\n\t\t\t\t\t * to true and increment the fixed initial differences counter */\n\t\t\t\t\tfixeddifferent[i][j]=true;\n\t\t\t\t\tfixeddifferences++;\n\t\t\t\t}\n\n\t\t\t\t/* Else if the value does not differ, set the value in the\n\t\t\t\t * fixed initial differences matrix to false and do not increment\n\t\t\t\t * the fixed initial differences counter */\n\t\t\t\telse{\n\t\t\t\t\tfixeddifferent[i][j]=false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean needsToRecalcStats() {\n\n return this.equipsChanged;\n }", "public double refreshData(double newValue){\n\t\t\n\t\tlastResultValue = resultValue;\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t *\tAdding new value \n\t\t */\n\t\tif( (isThresholdUsingEnabled) && ( Math.abs((resultValue - newValue)) > threshold) ){\t// If the newValue is much different then previous resultValues then we discard the previous values..\n\t\t\tthis.valueCount = 0;\n\t\t\tthis.values = new double[this.maxValueCount];\n\t\t}\n\t\t\n\t\tif(valueCount == maxValueCount){\n\t\t\t\n\t\t\tfor(int i=1; i<maxValueCount; i++)\n\t\t\t\tvalues[i-1] = values[i]; \n\t\t\t\n\t\t\tvalues[maxValueCount-1] = newValue;\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\tvalues[valueCount] = newValue;\n\t\t\t\n\t\t\tvalueCount++;\n\t\t}\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * \tCalculating result value\n\t\t */\n\t\t\n\t\t// Not need calculating if the new value equals the last result...\n\t\tif(resultValue == newValue)\t\n\t\t\treturn resultValue;\n\t\t\n\t\t// If the last result is not equal to the value of the new input value...\n\t\tdouble sum = 0;\n\t\tint div = 0;\n\t\tfor (int i = 0; i < valueCount; i++){\n\t\t\t\n\t\t\tsum += (values[i] * priorities[ ( (maxValueCount-valueCount ) + i) ]);\n\t\t\tdiv += priorities[ ( (maxValueCount-valueCount ) + i) ];\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.resultValue = sum / div;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * If we have new result (not equals the last) than we call onDataChanged method what can be implemented on parent\n\t\t */\n\t\tif(resultValue != lastResultValue)\n\t\t\tthis.onDataChanged();\n\t\t\n\t\t\n\t\t\n\t\t// Returns the new result\n\t\treturn this.resultValue;\n\t}", "@Subscribe\n\tpublic void priceListListener(PriceList list) {\n\n\t\tfinal int value = price + 1 - list.getCurrentPrice();\n\n\t\tif (price == 1 && list.getCurrentPrice() == 1) {\n\t\t\t// When the price is 1 the price cannot go down. This means that the number can only not be 0.\n\t\t\tcalledNextInt(r -> r.nextInt(PRICE_BOUND) != RISING_PRICE_VALUE);\n\t\t}\n\t\telse {\n\t\t\tcalledNextInt(value);\n\t\t}\n\t\tprice = list.getCurrentPrice();\n\t}", "public static double getArrayListDoubleVariance(ArrayList<Double> list) {\n\t\treturn 0;\n\t}", "public static List<List> calculateCost(List<List> papa_list){\n /*\n algo for evaluation:\n if contains 2 \n yes - check if also contains 1\n yes - drop it, continue\n no - count # of 2's, add points twice, continue\n no - check if contains 1\n yes - count # of 1's, subtract points, continue\n no - line of 0's - drop it\n */\n\n int points = 0;\n int count =0;\n for(int i=0;i<papa_list.size();i++){\n points = 0;\n List<Integer> temp = papa_list.get(i);\n if(temp.contains(2)){\n if(temp.contains(1)){\n temp.add(points);\n }\n else{\n count =0; \n for(int num : temp){\n if(num==2){\n count++;\n }\n }\n points+=count;\n //playing offensive game: you get more points for attacking (playing to win) rather than defensing (cancelling out opponent's move) \n //temp.add(2*points);\n temp.add(points);\n }\n }\n else if(temp.contains(1)){\n count =0; \n for(int num : temp){\n if(num==1){\n count--;\n }\n }\n points+=count;\n temp.add(points);\n }\n else{\n temp.add(points);\n }\n }\n return papa_list; \n }", "private int calcDistance()\n\t{\n\t\tint distance = 0;\n\n\t\t// Generate a sum of all of the difference in locations of each list element\n\t\tfor(int i = 0; i < listSize; i++) \n\t\t{\n\t\t\tdistance += Math.abs(indexOf(unsortedList, sortedList[i]) - i);\n\t\t}\n\n\t\treturn distance;\n\t}", "public Integer trueCounter(List<Boolean> list) {\n\t\tint temp=0;\n\t\tfor (int i=0;i<list.size();i++){\n\t\t\tif (list.get(i)==true)\t{\n\t\t\t\ttemp++;\n\t\t\t}\n\t\t}\n\t\treturn temp;\n\t}", "private int getTotalVariations(){\r\n\t\tint sumVariations = 0;\r\n\t\tfor (int i = 0; i < ledDisplay.length; i++) {\r\n\t\t\tsumVariations += getLedsVariations (lastLedDisplay[i], ledDisplay[i]);\r\n\t\t}\r\n\t\treturn sumVariations;\r\n\t}", "boolean updateValue() {\n boolean ret;\n\n if (Math.abs(curUtilityValue - nextUtilityValue) < Math.abs(curUtilityValue) * MAX_ERR_PERCENT / 100)\n ret = true;\n else {\n ret = false;\n // System.out.println(\" no match cell: x: \"+x+\" y: \"+y);\n }\n curUtilityValue = nextUtilityValue;\n return ret;\n\n }", "int updateCount(double dist);", "public int[] coldM(ArrayList<LottoDay> list)\n\t{\n\t\tint counter=0; //counts occurrences\n\t\tint low=200; //sets low to 200\n\t\tint [] megaF = new int [28]; //creates an array to store occurrences of mega numbers\n\t\tint[] check = new int [5]; //creates an array to store lowest mega numbers\n\t\tfor(int i=0; i<list.size();i++)\n\t\t{\n\t\t\tone = list.get(i);//get object\n\t\t\tmega= one.getMega();//get the mega number of the object\n\t\t\tfor(int j=0; j<megaF.length;j++)\n\t\t\t{\n\t\t\t\t//if mega number equals index\n\t\t\t\tif(mega==j)\n\t\t\t\t{\n\t\t\t\t\tcounter++; //add one to count\n\t\t\t\t\tmegaF[j]=counter+megaF[j]; //add one to occurrence\n\t\t\t\t\tcounter=0; //reset counter\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\n\t\tlow=200;//resets low\n\t\t//looks for the lowest number in the mega number array\n\t\tfor(int j=0; j<check.length;j++)\n\t\t{\n\t\t\tfor(int i=0; i<megaF.length;i++)\n\t\t\t{\n\t\t\t\t//if mega number is not zero and the occurrence is lower than low\n\t\t\t\tif(megaF[i]<low &&megaF[i]!=0)\n\t\t\t\t{\n\t\t\t\t\tlow = megaF[i]; //occurrence becomes new low\n\t\t\t\t\tindex=i;//store index\n\t\t\t\t\tcheck[j]=i;//store the mega number\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tlow=200;//reset low\n\t\t\tmegaF[index]=0;//set occurrence of the number to zero\n\t\t}\n\t\t//return 5 lowest mega numbers\n\t\treturn check;\n\t}", "protected double calculateChange(double currentValue, double baselineValue) {\n return (currentValue - baselineValue) / baselineValue;\n }", "@Test\r\n public void testListPropertyNotificationMultipleListener() {\r\n ObservableList<String> initialValue = createObservableList(false);\r\n ListProperty<String> property = new SimpleListProperty<>(initialValue);\r\n ChangeReport report = new ChangeReport(property);\r\n ChangeReport otherListener = new ChangeReport(property);\r\n ObservableList<String> otherValue = createObservableList(false);\r\n assertTrue(\"sanity: FXCollections returns a new instance\", otherValue != initialValue);\r\n property.set(otherValue);\r\n assertEquals(1, report.getEventCount());\r\n assertSame(initialValue, report.getLastOldValue());\r\n assertSame(otherValue, report.getLastNewValue());\r\n }", "public void FindPriceState(ArrayList<Float> prices) {\n\t\t\n\t\tint window_size = 4;\n\t\tfor(int i=0; i<grad.length; i++) {\n\t\t\t\n\t\t\tif(window_size <= prices.size()) {\n\t\t\t\tLinearRegression.Regression(prices, prices.size() - window_size, prices.size());\n\t\t\t\tgrad[i] = (int) (LinearRegression.gradient * 8);\n\t\t\t}\n\t\t\t\n\t\t\twindow_size <<= 1;\n\t\t}\n\t}", "public static int jump_over_numbers(List<Integer> list) {\n\t\tIterator<Integer> it = list.iterator();\n\t\tint count = 0;\n\t\twhile(it.hasNext()){\n\t\t\tint current = it.next();\n\t\t\tcount++;\n\t\t\tif(current == 0){\n\t\t\t\tcount = -1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\twhile(it.hasNext() && current > 1 ){\n\t\t\t\tit.next();\n\t\t\t\tcurrent--;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t }", "double getInfoLoss(InputRecord record) {\n return Math.abs(anonymisedValue - record.getRawValue());\n }", "@Test\n public void testUpdateInputsHistory() {\n model.updateInputsHistory(1);\n model.updateInputsHistory(2);\n model.updateInputsHistory(3);\n int[] expectedInputsHistory = {1, 2, 3, 0};\n int expectedInputsElements = 3;\n int[] resultedInputsHistory = model.getInputsHistory();\n int resultedInputsElements = model.getElementsInInputsHistory();\n\n Assert.assertArrayEquals(expectedInputsHistory, resultedInputsHistory);\n Assert.assertEquals(expectedInputsElements, resultedInputsElements);\n\n //inputsHistory array resizing with next updates\n model.updateInputsHistory(4);\n model.updateInputsHistory(5);\n int[] expectedResizedInputsHistory = {1, 2, 3, 4, 5};\n int expectedInputsElementsAfterResize = 5;\n int[] resultedResizedInputsHistory = model.getInputsHistory();\n int resultingInputsElementsAfterResize = model.getElementsInInputsHistory();\n\n Assert.assertArrayEquals(expectedResizedInputsHistory, resultedResizedInputsHistory);\n Assert.assertEquals(expectedInputsElementsAfterResize, resultingInputsElementsAfterResize);\n }", "public static List<List<Integer>> minCoinsForMakingChange(int[] coinVals, int amount) {\n List<List<Integer>>[] minWays = new ArrayList[amount + 1];\n // no coins to make value 0\n minWays[0] = new ArrayList<>();\n for (int currAmount = 1; currAmount <= amount; currAmount++) {\n List<List<Integer>> minCoinLists = null;\n for (int coinVal : coinVals) {\n int prevVal = currAmount - coinVal;\n // reached the currAmount using a singleCoin of coinVal\n // that's the shortest way. No need to check any further\n if (prevVal == 0) {\n // list with single coin\n minCoinLists = new ArrayList(Arrays.asList(Arrays.asList(coinVal)));\n break;\n } else if (prevVal > 0) {\n List<List<Integer>> prevValCoinLists = minWays[prevVal];\n // get the min list of coins to reach prevVal. if such a list exits\n // i.e. there is a way to use the coins to reach prevVal\n if ((prevValCoinLists != null) && (!prevValCoinLists.isEmpty())) {\n // compare the number of coins with the prevMin number of coins\n if (((minCoinLists == null) || (minCoinLists.isEmpty())) || (minCoinLists.get(0).size() > prevValCoinLists.get(0).size() + 1)) {\n minCoinLists = new ArrayList();\n }\n addLists(prevValCoinLists, minCoinLists, coinVal);\n }\n }\n\n }\n minWays[currAmount] = minCoinLists;\n }\n return minWays[amount];\n }", "private void updatePlayersWorth(){\n for (Player e : playerList) {\n e.setPlayerWorth(getTotalShareValue(e) + e.getFunds());\n }\n }", "public int getLaps() {\n\t\treturn meanTimes.size() + 1;\n\t}", "@Test\r\n\tpublic void testChangeTheOriginalChooseIsBetterThanNotChange() {\r\n\t\tMontyHall monty = new MontyHall();\r\n\t\tmonty.setChanged(true);\r\n\t\tfloat rateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10);\r\n\t\tmonty.setChanged(false);\r\n\t\tfloat rateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 100 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(100);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(100);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 10000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(10000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(10000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\r\n\t\t/* count is 1000000 */\r\n\t\tmonty.setChanged(true);\r\n\t\trateOfChange = monty.rateOfWinThePrizeWithChangeTheOriginalChoose(1000000);\r\n\t\tmonty.setChanged(false);\r\n\t\trateOfNotChange = monty.rateOfWinThePrizeWithoutChangeTheOriginalChoose(1000000);\r\n\t\tassertTrue(rateOfChange > rateOfNotChange);\r\n\t}", "public void allActualValuesUpdated ();", "private int countOccurrence(Integer valueToCount) {\n int count = 0;\n\n for(Integer currentValue : list) {\n if (currentValue == valueToCount) {\n count++;\n }\n }\n\n return count;\n }", "public int ListLength(){\n int j = 0;\n // Get index of the first element with value\n int i = StaticLinkList[MAXSIZE-1].cur;\n while (i!=0)\n {\n i = StaticLinkList[i].cur;\n j++;\n }\n return j;\n }", "public static void plusMinus(List<Integer> arr) {\n // Write your code here\n double cPlus = 0;\n double cMinus = 0;\n double cZero = 0;\n for (Integer integer : arr) {\n if (integer > 0) {\n cPlus++;\n } else if (integer < 0) {\n cMinus++;\n } else {\n cZero++;\n }\n }\n System.out.println(cPlus / arr.size());\n System.out.println(cMinus / arr.size());\n System.out.println(cZero / arr.size());\n }", "public abstract List<Double> updatePopulations();", "public int numberOfEllipsoids() { \r\n if (list.size() == 0) {\r\n return 0; \r\n }\r\n return list.size(); \r\n }", "private int getAmountOfSuccessorsAndRemoveThem(PhoneForward pf, List<PhoneForward> list, int currentCount) {\n for (PhoneForward value : list) {\n if (value.getOwnNumber().equals(pf.getTargetNumber())) {\n list.remove(value);\n currentCount++;\n return getAmountOfSuccessorsAndRemoveThem(value, list, currentCount);\n }\n }\n return currentCount;\n }", "boolean listDoubleEquals(double[] list1, double[] list2) {\r\n\t\tassert(list1.length == list2.length);\r\n\t\tdouble error = 0;\r\n\t\tfor (int i=0 ; i < list1.length ; i++) {\r\n\t\t\terror += (list1[i] - list2[i]);\r\n\t\t}\r\n\t\t\r\n\t\treturn (error < 0.00001 && error > -0.00001);\r\n\t}", "public void Changed(List<Sensor> sensors, int monitorCount, int sensorCount) throws java.rmi.RemoteException;", "@Override\n\tpublic int getEVotesRep(ArrayList<InfoTemp> copy) {\n\t\tint twoPercent=0;\n\t\tint total=0;\n\t\tfor (InfoTemp e: copy){\n\t\t\ttwoPercent=(int)(e.pVoteRep*.02);\n\t\t\te.pVoteRep-=twoPercent;\n\t\t\te.pVoteDem+=twoPercent;\n\t\t\tif (e.pVoteRep>e.pVoteDem){\n\t\t\t\ttotal+=e.eVote;\n\t\t\t}\n\t\t}\n\t\treturn total; \n\t}", "public static int[] getChange (int value, int[] denominations, int[] amounts) {\n\t\tint [] f = new int[value + 1];\r\n\t\tint m = denominations.length;\r\n\t\tint result, temp = 1, j;\r\n\t\tint d = 0;\r\n\t\tfor (int i = 1; i <= value; i ++) {\r\n\t\t\ttemp = value + 1; j = 0;\r\n\t\t\t\r\n\t\t\twhile (j < m && i >= denominations[j] ){\r\n\t\t\t\td = f[i-denominations[j]];\r\n\t\t\t\tif (temp > d)\r\n\t\t\t\t temp = d;\r\n\t\t\t\tj ++;\r\n\t\t\t} \r\n\t\t\tf[i] = temp + 1;\r\n\t\t}\r\n\t\tresult = f[value]; // will be put in the position 0\r\n // tracing the array f backwards, finding the denomination contributing to the minimum number of coins\r\n\t\tint k = result;\r\n\t\tint [] change = new int[k + 1]; // position 0 for the number of coins, positions 1 to k for the denominations\r\n\t\tj = 0;\r\n\t\tint pos = 0;\r\n\t\twhile (k > 0) {\r\n\t\t\ttemp = k;\r\n\t\t\tfor (j = 0; j < m && denominations[j] <= value; j ++) {\r\n\t\t\t\td = f[value-denominations[j]];\r\n\t\t\t\tif ( temp > d) {\r\n\t\t\t\t\ttemp = d;\r\n\t\t\t\t\tpos = j;\r\n\t\t\t\t}\r\n\t\t\t\t//pos is the index in the array of denominations indicating the \r\n //pos = smallest num of needed coins // smallest number of needed coins\t\t\r\n\t\t\t}\r\n\t\t\tchange[k] = denominations[pos]; \r\n\t\t\tvalue -= change[k --]; // use the remaining value and decrement number of coins\r\n\t\t}\r\n\t\tchange[0] = result;\r\n\t\t\r\n\t\tfor(int i = 1; i < change.length; i++) {\r\n\t\t\t\r\n\t\t\tint a = amounts[i -1] - change[i];\r\n\t\t\tif(a <= 0) {\r\n\t\t\t\tdenomupdate[i - 1] = a;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn change;\t\r\n\t}", "private float[] accDiff(float[] oldAcc, float[] newAcc)\n {\n float[] diffAcc = new float[]{0.0f, 0.0f, 0.0f};\n\n for (int i = 0; i < 3; i++)\n {\n diffAcc[i] = (newAcc[i]-oldAcc[i]);\n }\n return diffAcc;\n }", "@Override\n public List<SDVariable> doDiff(List<SDVariable> f1) {\n List<SDVariable> out = new ArrayList<>();\n for(SDVariable v : args()){\n out.add(sameDiff.zerosLike(v));\n }\n return out;\n }", "public float influence(ArrayList<String> s)\n {\n HashMap<Integer, Integer> distances = new HashMap<>();\n HashMap<String, Integer> nodeDistances = new HashMap<>();\n\n for(String node : s){\n if(!graphVertexHashMap.containsKey(node)) continue;\n //At the end nodeDistances will contain min distance from all nodes to all other nodes\n getMinDistances(node, distances, nodeDistances);\n }\n distances = new HashMap<>();\n Iterator it = nodeDistances.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n Integer distance = (Integer) entry.getValue();\n if(distances.containsKey(distance)){\n distances.put(distance, distances.get(distance)+1);\n }else{\n distances.put(distance, 1);\n }\n }\n return getTotal(distances);\n\n\n\n// float sum = 0.0f;\n// for(int i =0; i < numVertices; i++){\n// int y = gety(s, i);\n//// System.out.println(\"i is \" + i + \" and nodes at distance are \" + y);\n// sum += (1/(Math.pow(2,i)) * y);\n// }\n// return sum;\n }", "@Test\r\n\tvoid lowDiffListHighSum()\r\n\t{\r\n\t\tSystem.out.println(\"NOW TESTING LOWDIFF LIST HIGHSUM\");\r\n\t\tList<Integer> myList = new ArrayList <Integer> ();\r\n\t\tmyList.add(5);\r\n\t\tmyList.add(7);\r\n\t\tDomino d1 = new DominoLowDifferenceStringImpl_Khan(myList);\r\n\t\tint assertHigh = d1.getHighPipCount();\r\n\t\tint assertLow = d1.getLowPipCount();\r\n\t\tassertEquals(assertHigh, 5);\r\n\t\tassertEquals(assertLow, 2);\r\n\t\t\r\n\t\t\r\n\t\tList<Integer> myList2 = new ArrayList <Integer> ();\r\n\t\tmyList2.add(2);\r\n\t\tmyList2.add(4);\r\n\t\tDomino d2 = new DominoLowDifferenceStringImpl_Khan(myList2);\r\n\t\tassertHigh = d2.getHighPipCount();\r\n\t\tassertLow = d2.getLowPipCount();\r\n\t\tassertEquals(assertHigh, 2);\r\n\t\tassertEquals(assertLow, 2);\r\n\t\tSystem.out.println(\"TEST SUCCESFULLY COMPLETE\");\r\n\t}", "Integer getMaxSuccessiveDeltaCycles();", "public long numOfInversions(int[] list) {\n\t\tif(list.length <= 1) return 0;\t//Base case - if list contains only one integer, then there are obviously no inversions.\n\n\t\t/* Divide and conquer algorithm. Divide the given list to 2 smaller lists.\n\t\t * Then do recursive call to first half and second half.\n\t\t * NOTE: this also performs a merge sort of the list. */\n\t\tint firstHalfLength = list.length / 2;\n\t\tint[] firstHalf = new int[firstHalfLength];\n\t\tSystem.arraycopy(list, 0, firstHalf, 0, firstHalfLength);\n\t\tlong x = numOfInversions(firstHalf);\t//Recursive call!\n\n\t\t/* This is the second half. */\n\t\tint secondHalfLength = list.length - firstHalfLength;\n\t\tint[] secondHalf = new int[secondHalfLength];\n\t\tSystem.arraycopy(list, firstHalfLength, secondHalf, 0, secondHalfLength);\n\t\tlong y = numOfInversions(secondHalf);\t//Recursive call!\n\n\t\t// Merge firstHalf with secondHalf into list and in doing so, we count the number of inversions\n\t\t// between these two lists!\n\t\tlong z = mergeAndCountInversions(firstHalf, secondHalf, list); //custom call\n\t\treturn x + y + z;\t//the sum of x, y and z is the total number of inversions.\n\t}", "public static void vendingMachine(int change) {\n int notes[] = {1, 2, 5, 10, 50, 100, 500, 1000};\n int len = notes.length;\n int count = 0;\n for (int i = len - 1; i >= 0; i--) {\n while (change >= notes[i]) {\n change -= notes[i];\n System.out.print(notes[i] + \" \");\n count++;\n }\n }\n System.out.println(\"\\nNumber of changes:\" + count);\n }", "@Override\n public int evaluate(int[] l) {\n int s = 0;\n HashSet<Integer> map = new HashSet<Integer>();\n for (int i = 0; i < l.length; ++i) {\n int elmt = l[i];\n if (map.add(elmt))\n s += this.getValue(elmt);\n if (i != 0)\n s -= neighbourCheck[l[i - 1]][l[i]];\n }\n return s;\n }", "private static int maxDifferenceBetweenNumbers(int[] arr, int size) {\n\t\tint maximumDifference = 0;\n\t\t// minimum number seen is first element\n\t\tint minimumNumberSeen = arr[0];\n\t\t// Iterate over all the elements in the list\n\t\tfor (int index = 1; index < size; index++) {\n\t\t\t// Calculate the maximum difference and update\n\t\t\tmaximumDifference = Math.max(maximumDifference, arr[index] - minimumNumberSeen);\n\t\t\t// Check and update if number seen is less than minimum see sofar\n\t\t\tminimumNumberSeen = Math.min(minimumNumberSeen, arr[index]);\n\t\t}\n\t\treturn maximumDifference;\n\t}", "public int difference(ArrayList<Integer> numbers) {\n\t\tif(numbers == null) {\n\t\t\treturn -1;\n\t\t} else if(numbers.size() < 1) {\n\t\t\treturn -1;\n\t\t}\n\t\tint maximum = numbers.get(0);\n\t\tint mininum = numbers.get(0);\n\t\tfor(int i = 0; i < numbers.size(); i++) {\n\t\t\tmaximum = (numbers.get(i) > maximum) ? numbers.get(i) : maximum;\n\t\t\tmininum = (numbers.get(i) < mininum) ? numbers.get(i) : mininum;\n\t\t}\n\t\treturn maximum - mininum;\t\t// default return value to ensure compilation\n\t}", "int getTotalLeased();", "private int countWinnerScore(LinkedList<Integer> cards){\n int size = cards.size();\n return IntStream.range(0, size)\n .map(i -> cards.get(i) * (size - i))\n .sum();\n }", "private int countWinnerScore(LinkedList<Integer> cards){\n int size = cards.size();\n return IntStream.range(0, size)\n .map(i -> cards.get(i) * (size - i))\n .sum();\n }", "long getNumberOfComparisons();", "int getComparisons();", "public static double readingsInRange (ArrayList<Background> list, int min, int max) {\r\n\t\tint currentMin, currentMax;\r\n\t\tdouble totEvents=0;\r\n\t\tfor (Background bc : list) {\r\n\t\t\tcurrentMin = bc.getMin();\r\n\t\t\tcurrentMax = bc.getMax();\r\n\r\n\t\t\tif (currentMin >= min && currentMax <= max) {\r\n\t\t\t\ttotEvents += bc.getEvents();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn totEvents;\r\n\t}", "public float findFrequency(ArrayList<Float> wave){\n\r\n ArrayList<Float> newWave = new ArrayList<>();\r\n\r\n for(int i=0;i<wave.size()-4;i++){\r\n newWave.add((wave.get(i)+wave.get(i+1)+wave.get(i+2)+wave.get(i+4))/4f);\r\n }\r\n\r\n\r\n boolean isBelow = wave1.get(0)<triggerVoltage;\r\n\r\n ArrayList<Integer> triggerSamples = new ArrayList<>();\r\n\r\n\r\n System.out.println(\"starting f calc\");\r\n\r\n for(int i=1;i<newWave.size();i++){\r\n if(isBelow){\r\n if(newWave.get(i)>triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=false;\r\n }\r\n }else{\r\n if(newWave.get(i)<triggerVoltage){\r\n triggerSamples.add(i);\r\n isBelow=true;\r\n }\r\n }\r\n }\r\n System.out.println(\"F len in \"+triggerSamples.size());\r\n\r\n ArrayList<Float> freqValues = new ArrayList<>();\r\n\r\n\r\n for(int i=0;i<triggerSamples.size()-2;i++){\r\n freqValues.add(1/(Math.abs(SecondsPerSample*(triggerSamples.get(i)-triggerSamples.get(i+2)))));\r\n }\r\n\r\n float finalAVG =0;\r\n for (Float f : freqValues) {\r\n finalAVG+=f;\r\n }\r\n finalAVG/=freqValues.size();\r\n\r\n\r\n return finalAVG;\r\n //System.out.println(finalAVG);\r\n }", "public boolean hasChanges() {\n return Math.abs(this.x) > 1.0E-5f || Math.abs(this.y) > 1.0E-5f || Math.abs(this.scale - this.minimumScale) > 1.0E-5f || Math.abs(this.rotation) > 1.0E-5f || Math.abs(this.orientation) > 1.0E-5f;\n }", "public boolean isDifficult()\n {\n int count = 0;\n for (int i = 1; i < markers.length; i++) {\n if (Math.abs(markers[i] - markers[i-1]) >= 30){\n count++;\n }\n }\n return (count >= 3);\n }", "public double gennemsnit(ArrayList<Integer> list) {\r\n double snit = 0.0;\r\n\r\n for (int i : list) {\r\n snit = snit + i;\r\n }\r\n\r\n return snit / list.size();\r\n }", "int getValuesCount();", "private int calculateConsecutiveDuplicateMutationsThreshold(){\n \tint combinedSiteLength = region.getCombinedSitesLength();\n \tif(combinedSiteLength <= 10){\n \t\treturn 100; // around the order of magnitude of 1,000,000 if we assume each of the 10 positions could have any of the 4 nucleotides\n \t}else{\n \t\tint consecFactor = 400000 / (combinedSiteLength * combinedSiteLength * combinedSiteLength * iContext.strategy.nucleotides.length);\n \t\treturn Math.max(2, consecFactor);\n \t}\n }", "private int sizeOfList(Student [] list) {\r\n\t\t\r\n\t\tint size = 0;\r\n\t\tStudent sizechecker;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\twhile (true) {\r\n\t\t\t\t\r\n\t\t\t\tsizechecker = list[size];\r\n\t\t\t\tsize++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e) { \r\n\t\t \r\n\t\t}\r\n\t\t\r\n\t\treturn size;\r\n\t}", "private boolean CompareValues(int oldValue, int value)\n {\n if (playerType == PlayerType.White)\n {\n if (turn == 1)\n return oldValue > value;\n else\n return oldValue < value;\n }\n else\n if (turn == 1)\n return oldValue < value;\n else\n return oldValue > value;\n }", "public int updateBoard() {\n clearTemporaryData();\n setUsedValuesbyRow();\n setUsedValuesByColumns();\n setUsedValueInBoxes();\n findUniqueInBoxes();\n updateValues();\n\n return numbers.stream()\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList()).size();\n }", "public double trueCount() {\n\t\t\t\n\t\t\treturn (double)total_count/((double)size/52);\n\t\t}", "void bellford(ArrayList<Integer> nlist){\n\n int stval = nlist.get(0);\n dlist.get(stval).setval(stval);\n dlist.get(stval).setDist(0);\n\n for(int i = 0; i < nlist.size()-1; i++){\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(key);\n dlist.get(val).setDist(odist+we);\n }\n }\n }\n }\n }\n for(int key: dlist.keySet()){\n System.out.println(key+\" dist:\"+dlist.get(key).getDist()+\" prev:\"+dlist.get(key).getval());\n }\n System.out.println(\"Negative cycles at:\");\n //iisue should run n-1 times:\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(-999);\n dlist.get(val).setDist(odist+we);\n System.out.println(val);\n }\n }\n }\n }\n }", "public double[] calculateDrift(ArrayList<T> tracks){\n\t\tdouble[] result = new double[3];\n\t\t\n\t\tdouble sumX =0;\n\t\tdouble sumY = 0;\n\t\tdouble sumZ = 0;\n\t\tint N=0;\n\t\tfor(int i = 0; i < tracks.size(); i++){\n\t\t\tT t = tracks.get(i);\n\t\t\tTrajectoryValidIndexTimelagIterator it = new TrajectoryValidIndexTimelagIterator(t,1);\n\t\n\t\t\t//for(int j = 1; j < t.size(); j++){\n\t\t\twhile(it.hasNext()) {\n\t\t\t\tint j = it.next();\n\t\t\t\tsumX += t.get(j+1).x - t.get(j).x;\n\t\t\t\tsumY += t.get(j+1).y - t.get(j).y;\n\t\t\t\tsumZ += t.get(j+1).z - t.get(j).z;\n\t\t\t\tN++;\n\t\t\t}\n\t\t}\n\t\tresult[0] = sumX/N;\n\t\tresult[1] = sumY/N;\n\t\tresult[2] = sumZ/N;\n\t\treturn result;\n\t}", "public static void checkUpdateProbabilityOnALLRelations()\r\n\t{\r\n\t\tint[] base_relations = {1,2,4,8,16,32,64,128};\r\n\t\tint r1,r2,r3;\r\n\t\tint total = 0;\r\n\t\tint update = 0;\r\n\t\tfor (int i = 0; i < 8; i++)\r\n\t\t{\r\n\t\t\t r1 = base_relations[i];\r\n\t\t\tfor(int j = 1; j < 255; j++)\r\n\t\t\t{\r\n\t\t\t\tr2 = j;\r\n\t\t\t\t/*if(r2 == 1 || r2 == 2 || r2 == 4 || r2 == 8 || r2 == 16 || r2 == 32 || r2 == 64 || r2 == 128)\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\telse*/\r\n\t\t\t\tfor(int k = 1; k < 255; k++)\r\n\t\t\t\t{ \r\n\t\t\t\t\tr3 = k;\r\n\t\t\t\t\t/*if(r3 == 1 || r3 == 2 || r3 == 4 || r3 == 8 || r3 == 16 || r3 == 32 || r3 == 64 || r3 == 128)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse*/\r\n\t\t\t\t\t{\t\r\n\t\t\t\t\t\ttotal++;\r\n\t\t\t\t\t\tint new_r3 = SetOperators.intersection(r3, \r\n\t\t\t\t\t\t\t\tCompositionTable.LookUpTable(r1, r2));\r\n\t\t\t\t\t\tif(new_r3 != r3 && new_r3 != 0)\r\n\t\t\t\t\t\t\tupdate++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println((double)update/total);\r\n\t\t\t\t\r\n\t}", "public int getMultChanged() {\r\n\t\treturn this.multChanged;\r\n\t}", "@Test\r\n public void testListPropertyNotificationSingleListener() {\r\n ObservableList<String> initialValue = createObservableList(false);\r\n ListProperty<String> property = new SimpleListProperty<>(initialValue);\r\n ChangeReport report = new ChangeReport(property);\r\n ObservableList<String> otherValue = createObservableList(false);\r\n assertTrue(\"sanity: FXCollections returns a new instance\", otherValue != initialValue);\r\n property.set(otherValue);\r\n assertEquals(1, report.getEventCount());\r\n assertSame(initialValue, report.getLastOldValue());\r\n assertSame(otherValue, report.getLastNewValue());\r\n }", "private void updateValues() {\n \n //Find the spaces that can be solved.\n List<Number>updatableNumbers = numbers.stream()\n .filter(n -> n.getUsedValues() != null)\n .filter(n -> n.getUsedValues().size() == 8)\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList());\n\n updatableNumbers.forEach(u -> {\n //Create a list of numbers 1-9\n List<Integer> intThrough9 = IntStream.rangeClosed(1, 9)\n .boxed()\n .collect(Collectors.toList());\n\n //Remove the used numbers from the list of 9 \n //to get expected value.\n intThrough9.removeAll(u.getUsedValues());\n u.setValue(intThrough9.get(0));\n }\n );\n }", "private double calculateDeltaSW(double boost_value)\r\n\t{\n\t\tint count = 0;\r\n\t\tIterator<Synapse> synapses_it = synapses.iterator();\r\n\t\twhile(synapses_it.hasNext())\r\n\t\t{\r\n\t\t\tSynapse nextSynapse = (Synapse)synapses_it.next();\r\n\t\t\tif(nextSynapse.getPreNode().active) //check if preNode is active\r\n\t\t\t{\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"no. of active synapses = \"+count);\r\n\t\treturn boost_value/count;\r\n\t}", "double getChangePercent() {\n\t return 100 - (currentPrice * 100 / previousClosingPrice);\n\t }", "public long getObservations() {\r\n\t\tlong result = 0;\r\n\t\tfor (TransitionMode mode : transitionModes) {\r\n\r\n\t\t\tresult = result + mode.getObservations();\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public double getTotalSignalEstBackCount(){\n\t\tdouble total=0;\n\t\tfor(ControlledExperiment r : replicates){\n\t\t\ttotal+=r.getNoiseCount();\n\t\t}\n\t\treturn total;\n\t}" ]
[ "0.62487435", "0.55201507", "0.5518594", "0.5471348", "0.54398644", "0.54368585", "0.5415743", "0.5399658", "0.53885674", "0.53703123", "0.53592044", "0.53477573", "0.53453475", "0.53285223", "0.53115946", "0.52847767", "0.5262324", "0.52515316", "0.523595", "0.5226385", "0.52213305", "0.5211358", "0.51941884", "0.5192565", "0.51718855", "0.5139462", "0.5106719", "0.50905645", "0.5090379", "0.5073935", "0.5056639", "0.5037506", "0.50365967", "0.50309116", "0.502322", "0.5019879", "0.50098425", "0.50041133", "0.4999514", "0.49978432", "0.49681985", "0.49628276", "0.49595696", "0.495833", "0.49576828", "0.49546966", "0.4926038", "0.4920408", "0.49071792", "0.4905587", "0.49025446", "0.49024248", "0.48956227", "0.4886943", "0.48838854", "0.48759228", "0.4872806", "0.48692396", "0.48688158", "0.48687145", "0.48647425", "0.48632374", "0.48554882", "0.48518574", "0.48501801", "0.48415583", "0.48373374", "0.48363608", "0.48353565", "0.4830034", "0.48239714", "0.48202187", "0.48188972", "0.47991228", "0.47926825", "0.4791965", "0.47896904", "0.47896904", "0.47880933", "0.47823647", "0.47793877", "0.4774844", "0.47711116", "0.47688916", "0.47680345", "0.4762514", "0.47549498", "0.47509718", "0.4749894", "0.47491142", "0.47463217", "0.47441003", "0.47328892", "0.47234935", "0.47185504", "0.47164002", "0.47152957", "0.47091535", "0.47005358", "0.4697633", "0.4694719" ]
0.0
-1
Return from a set of Pages the Page with the greatest Hub value
public Page getMaxHub(List<Page> result) { Page maxHub = null; for (Page currPage : result) { if (maxHub == null || currPage.hub > maxHub.hub) maxHub = currPage; } return maxHub; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Album getAlbumWithMostTracks()\r\n {\r\n\t// Initialise variables to store max track count and album with the most \r\n\t// tracks\r\n\tint maxTrackCount = 0;\r\n\tAlbum maxTrackAlbum = null;\r\n\r\n\t// Create Iterator to iterate over the album collection\r\n\t// Netbeans warns 'use of iterator for simple loop' but Iterator is used\r\n\t// here to demonstrate knowledge of using Iterators rather than using for\r\n\t// loop and List.get() method\r\n\tIterator iterator = albumCollection.iterator();\r\n\twhile (iterator.hasNext())\r\n\t{\r\n\t // get current album and number of tracks in current album\r\n\t Album currentAlbum = (Album) iterator.next();\r\n\t int trackCount = currentAlbum.getTrackCount();\r\n\r\n\t // if track count exceeds max found so far, update max track count and\r\n\t // store the album in maxTrackAlbum\r\n\t if (trackCount > maxTrackCount)\r\n\t {\r\n\t\tmaxTrackCount = trackCount;\r\n\t\tmaxTrackAlbum = currentAlbum;\r\n\t }\r\n\t}\r\n\treturn maxTrackAlbum;\r\n }", "public DataValue getGreatestDataByDeviceIdAndSensorType(SensorValue sensorVal) throws Exception;", "public Book mostExpensive() {\n //create variable that stores the book thats most expensive\n Book mostExpensive = bookList.get(0);//most expensive book is set as the first in the array\n for (Book book : bookList) {\n if(book.getPrice() > mostExpensive.getPrice()){\n mostExpensive = book;\n }\n } return mostExpensive;//returns only one (theFIRST) most expensive in the array if tehre are several with the same price\n }", "Object getMaximumValue(Object elementID) throws Exception;", "Integer getMaximumResults();", "private void printMostVisited()\r\n\t{\r\n\t\tint greatestIndex = 0;\r\n\t\tint greatest = (int)webVisited[1][greatestIndex];\r\n\t\t\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\tif ((int)webVisited[1][i] > greatest)\r\n\t\t\t{\r\n\t\t\t\tgreatestIndex = i;\r\n\t\t\t\tgreatest = (int)webVisited[1][greatestIndex];\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Most visited website is: \" + webVisited[0][greatestIndex]);\r\n\t}", "private List<NewsArticle> getMostPopular() {\n LOGGER.log(Level.INFO, \"getMostPopular\");\n return newsService.getMostPopular();\n }", "Integer getMaxPageResults();", "public int getMaximun(){\n int highGrade = grades[0]; //assumi que grades[0] é a maior nota\n //faz o loop pelo array de notas\n for(int grade: grades){\n //se a nota for maior que highGrade. atribui essa nota a highGrade\n if(grade > highGrade){\n highGrade = grade; //nota mais alta\n }\n }\n \n return highGrade;\n }", "long getMaxItemFindings();", "public Building mostFitInPopulation(){\n\t\tCollections.sort(population);\n\t\treturn population.get(population.size() - 1);\n\t}", "static int BinarySerach_upperValue(ArrayList<Integer> list , int value){ \r\n\t\t\r\n\t\tint mid,l,r;\r\n\t\t\r\n\t\tl = 0;\r\n\t\tr = list.size()-1;\r\n\t\t\r\n\t\tif(value>=list.get(r))\r\n\t\t\treturn r;\r\n\t\tif(value<=list.get(l))\r\n\t\t\treturn l;\r\n\t\t\r\n\t\tmid = (l+r)/2;\r\n\t\t\r\n\t\twhile(l<r){\r\n\t\t\t\r\n\t\t\tmid = (l+r)/2;\r\n\t\t\t\r\n\t\t\tif(list.get(mid)==value)\r\n\t\t\t\treturn mid;\r\n\t\t\t\r\n\t\t\tif(mid+1<list.size() && list.get(mid)<value && list.get(mid+1)>=value)\r\n\t\t\t\treturn mid+1;\r\n\t\t\tif(mid-1>0 && list.get(mid-1)<value && list.get(mid)>=value)\r\n\t\t\t\treturn mid;\r\n\t\t\tif(list.get(mid)<value)\r\n\t\t\t\tl = mid+1;\r\n\t\t\telse\r\n\t\t\t\tr = mid-1;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn -1;\r\n\t}", "private RolapCalculation getAbsoluteMaxSolveOrder() {\n // Find member with the highest solve order.\n RolapCalculation maxSolveMember = calculations[0];\n for (int i = 1; i < calculationCount; i++) {\n RolapCalculation member = calculations[i];\n if (expandsBefore(member, maxSolveMember)) {\n maxSolveMember = member;\n }\n }\n return maxSolveMember;\n }", "public Money findMaxPrice(long n) {\n\t\tif (!hashMap.containsKey(n)) {\n\t\t\treturn new Money();\n\t\t}\n\t\tTreeSet<Long> idSet = hashMap.get(n);\n\t\tMoney max = new Money();\n\t\tboolean flag = false;\n\t\tfor (Long id : idSet) {\n\t\t if(treeMap.containsKey(id)){\n\t\t\tMoney current = treeMap.get(id).price;\n\t\t\tif (max.compareTo(current) == -1 || !flag) {\n\t\t\t\tmax = current;\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t}\n\t\t}\n\t\treturn max;\n\t}", "private static ImageFile mostTaggedImage()\n {\n ImageFile currentMostTaggedImage;\n currentMostTaggedImage = Log.allImages.get(0);\n for (ImageFile i : Log.allImages)\n {\n if (i.tagList.size() > currentMostTaggedImage.tagList.size())\n {\n currentMostTaggedImage = i;\n }\n }\n return currentMostTaggedImage;\n }", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "List<T> findMostPopularTags(Integer firstResult, Integer maxResult);", "Object getWorst();", "Price getHighestPricedTrade(Collection<Trade> trades);", "private int getPRFurthestUse() {\n int max = -1;\n int maxPR = -1;\n for (int i = 0; i < numPhysRegs - 1; i++) {\n if (PRNU[i] > max) {\n max = PRNU[i];\n maxPR = i;\n }\n }\n return maxPR; // no free physical register\n }", "public Page getMaxAuthority(List<Page> result) {\n\t\tPage maxAuthority = null;\n\t\tfor (Page currPage : result) {\n\t\t\tif (maxAuthority == null || currPage.authority > maxAuthority.authority)\n\t\t\t\tmaxAuthority = currPage;\n\t\t}\n\t\treturn maxAuthority;\n\t}", "public Page getLastPageObject() {\n return getPageObject(pages.length - 1);\n }", "private static Pair<Double, Integer> findMaxEntry(double[] array) {\n int index = 0;\n double max = array[0];\n for (int i = 1; i < array.length; i++) {\n if ( array[i] > max ) {\n max = array[i];\n index = i;\n }\n }\n return new Pair<Double, Integer>(max, index);\n }", "public Iterable<DBObject> mostGrumpy(DBCollection collection) {\n Iterable<DBObject> ai = collection.aggregate(Arrays.asList(\n new BasicDBObject(\"$match\", new BasicDBObject(\"polarity\", new BasicDBObject(\"$eq\", 0))),\n new BasicDBObject(\"$group\", new BasicDBObject(\"_id\", \"$user\").append(\"count\", new BasicDBObject(\"$sum\", 1))),\n new BasicDBObject(\"$sort\", new BasicDBObject(\"count\", -1)),\n new BasicDBObject(\"$limit\", 5)\n )).results();\n return ai;\n }", "private PageBuilder removeMostUnsed(Map<PartitionKey, PageBuilder> hash)\n {\n Iterator<Map.Entry<PartitionKey, PageBuilder>> ite = hash.entrySet().iterator();\n PageBuilder builder = ite.next().getValue();\n ite.remove();\n return builder;\n }", "public double SumInlinkHubScore(Page page) {\n\t\tList<String> inLinks = page.getInlinks();\n\t\tdouble hubScore = 0;\n\t\tfor (String inLink1 : inLinks) {\n\t\t\tPage inLink = pTable.get(inLink1);\n\t\t\tif (inLink != null)\n\t\t\t\thubScore += inLink.hub;\n\t\t\t// else: page is linked to by a Page not in our table\n\t\t}\n\t\treturn hubScore;\n\t}", "public abstract int getMaximumValue();", "public int houseRobberWithMaxAmount(int[] a) {\n\t\tint n = a.length;\n\t\tif (1 == n)\n\t\t\treturn a[0];\n\n\t\t// Rob house including 1stHouse, excluding last house\n\t\tint amt1 = houseRobberWithMaxAmountHousesFromItoJInConstantSpace(a, 0, a.length - 2);\n\t\t// Rob house excluding 1stHouse, including last house\n\t\tint amt2 = houseRobberWithMaxAmountHousesFromItoJInConstantSpace(a, 1, a.length - 1);\n\n\t\treturn Math.max(amt1, amt2);\n\t}", "public Computer findMostExpensiveComputerV4( ) { \n\n\t\tComputer highest= computers.get(0);\n\t\tIterator<Computer> it= computers.iterator();\n\t\tComputer current=null; // a temporary copy of has.next() to perform multiple actions on it inside the loop\n\t\twhile(it.hasNext()) {\n\t\t\tcurrent=it.next();\n\t\t\tif (highest.getPrice()<current.getPrice()) \n\t\t\t\thighest=current;\n\n\n\t\t}\n\n\t\treturn highest;\n\n\t}", "private StreamEvent findIfActualMax(AttributeDetails latestEvent) {\n int indexCurrentMax = valueStack.indexOf(currentMax);\n int postBound = valueStack.indexOf(latestEvent) - indexCurrentMax;\n // If latest event is at a distance greater than maxPostBound from max, max is not eligible to be sent as output\n if (postBound > maxPostBound) {\n currentMax.notEligibleForRealMax();\n return null;\n }\n // If maxPreBound is 0, no need to check preBoundChange. Send output with postBound value\n if (maxPreBound == 0) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMax);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"max\", 0, postBound });\n currentMax.sentOutputAsRealMax();\n return outputEvent;\n }\n int preBound = 1;\n double dThreshold = currentMax.getValue() - currentMax.getValue() * preBoundChange / 100;\n while (preBound <= maxPreBound && indexCurrentMax - preBound >= 0) {\n if (valueStack.get(indexCurrentMax - preBound).getValue() <= dThreshold) {\n StreamEvent outputEvent = eventStack.get(indexCurrentMax);\n complexEventPopulater.populateComplexEvent(outputEvent, new Object[] { \"max\", preBound, postBound });\n currentMax.sentOutputAsRealMax();\n return outputEvent;\n }\n ++preBound;\n }\n // Completed iterating through maxPreBound older events. No events which satisfy preBoundChange condition found.\n // Therefore max is not eligible to be sent as output.\n currentMax.notEligibleForRealMax();\n return null;\n }", "@Test\n void descendingSetHigherReturnsCorrectValue() {\n assertNull(reverseSet.higher(0));\n assertNull(reverseSet.higher(1));\n assertEquals(Integer.valueOf(1), reverseSet.higher(2));\n assertEquals(Integer.valueOf(2), reverseSet.higher(3));\n assertEquals(Integer.valueOf(2), reverseSet.higher(4));\n assertEquals(Integer.valueOf(4), reverseSet.higher(5));\n assertEquals(Integer.valueOf(4), reverseSet.higher(6));\n assertEquals(Integer.valueOf(6), reverseSet.higher(7));\n assertEquals(Integer.valueOf(6), reverseSet.higher(8));\n assertEquals(Integer.valueOf(6), reverseSet.higher(9));\n assertEquals(Integer.valueOf(9), reverseSet.higher(10));\n }", "public int heapExtractMax(){\n\t\tint max = a[0];\t\n\t\ta[0] = a[n-1];\n\t\ta[n-1] = Integer.MIN_VALUE;\n\t\tn--;\n\t\tmaxHeapfy(0);\t\t\n\t\treturn max;\n\t}", "private int getGenreDownloadedMostByAllUsers(){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query query = session.createQuery(\"SELECT mvd, mvd.musicVideo.genre.id, count(*) FROM MusicVideoDownload mvd JOIN FETCH mvd.musicVideo GROUP BY mvd.musicVideo.genre.id ORDER BY count(*) DESC\") ;\n query.setMaxResults(1) ;\n List resultSet = query.list() ;\n session.close() ;\n //if there is no result set, it means there are no downloads so return -1\n if(resultSet.isEmpty())\n return -1 ;\n //else return the genre id field of the first tuple since the result set has been sorted in desc order\n Object[] tupleFields = (Object[])resultSet.get(0) ;\n return (int)tupleFields[1] ;\n }", "private void getMostPopularDesigners(){\n System.out.println(this.ctrl.getMostPopularDesigner().getKey() + \" \" + this.ctrl.getMostPopularDesigner().getValue().toString() + \" items\");\n }", "int findMaximumOrderByWorkflowId( int nWorkflowId );", "int getMaximum();", "private int postprocess() {\n // Index with highest probability\n int maxIndex = -1;\n float maxProb = 0.0f;\n for (int i = 0; i < outputArray[0].length; i++) {\n if (outputArray[0][i] > maxProb) {\n maxProb = outputArray[0][i];\n maxIndex = i;\n }\n }\n return maxIndex;\n }", "public List<T> mostliked();", "public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}", "@Nullable\n protected abstract Map.Entry<K, V> onGetHighestEntry();", "private double getMaxNumber(ArrayList<Double> provinceValues)\n {\n Double max = 0.0;\n\n for (Double type : provinceValues)\n {\n if (type > max)\n {\n max = type;\n }\n }\n return max;\n }", "public int GetMaxVal();", "private int getHighestLevelFromProperties(){\n GameModel gameModel = GameModel.getInstance();\n int highestReachedLevel;\n int level = gameModel.getCurrentLevelIndex();\n String highest = properties.getProperty(\"highestReachedLevel\");\n if (highest!=null){ //if property not saved\n highestReachedLevel = Integer.parseInt(highest);\n } else {\n highestReachedLevel = level;\n }\n return highestReachedLevel;\n }", "private static <K, V extends Comparable<? super V>> List<Map.Entry<K, V>>\n findGreatest(Map<K, V> map, int n)\n {\n Comparator<? super Map.Entry<K, V>> comparator =\n new Comparator<Map.Entry<K, V>>()\n {\n @Override\n public int compare(Map.Entry<K, V> e0, Map.Entry<K, V> e1)\n {\n V v0 = e0.getValue();\n V v1 = e1.getValue();\n return v0.compareTo(v1);\n }\n };\n PriorityQueue<Map.Entry<K, V>> highest =\n new PriorityQueue<Map.Entry<K,V>>(n, comparator);\n for (Map.Entry<K, V> entry : map.entrySet())\n {\n highest.offer(entry);\n while (highest.size() > n)\n {\n highest.poll();\n }\n }\n\n List<Map.Entry<K, V>> result = new ArrayList<Map.Entry<K,V>>();\n while (highest.size() > 0)\n {\n result.add(highest.poll());\n }\n return result;\n }", "public abstract Key getLargest();", "public Page getLastPageObject() {\n return getPageObject(pages.length - 1);\n }", "public int getMaximumValueForSet(long j, int i) {\n int a = this.b.a() - 1;\n return (i > a || i < 1) ? getMaximumValue(j) : a;\n }", "public final void max() {\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\tpush(secondTopMostValue);\n\t\t\t} else {\n\t\t\t\tpush(topMostValue);\n\t\t\t}\n\t\t}\n\t}", "public VariantType getLargestVariantType(VariantType notThis) {\n VariantType[] values = { VariantType.SNP_A, VariantType.SNP_C, VariantType.SNP_G, VariantType.SNP_T, VariantType.DELETION, VariantType.INSERTION, VariantType.OTHER };\n\n VariantType snpNuc = null;\n\n for (VariantType n : values) {\n if (n != notThis) {\n if (getCoverage(n, null) > 0 && (snpNuc == null || getCoverage(n, null) > getCoverage(snpNuc, null))){\n snpNuc = n;\n }\n }\n }\n\n return snpNuc;\n }", "private Floor getHighestButPan(LiftButton[] bP){\r\n\t\t\r\n\t\tint x=numberOfFloors-1;\r\n\t\twhile(x>=0){\r\n\t\t\tif (bP[x]==LiftButton.ACTIVE) return new Floor(x);\r\n\t\t\tx--;\r\n\t\t}\r\n\t\treturn new Floor(0);\r\n\t}", "public int getHighestChromID();", "private boolean isLatest()\n {\n return varIndexes.get(curDisplay.get()) >= children.stream().mapToInt(c -> c.varIndexes.isEmpty() ? -1 : c.varIndexes.get(c.varIndexes.size() - 1)).max().orElse(-1);\n }", "public Computer findMostExpensiveComputerV1( ) { \n\t\tComputer highest= computers.get(0);\n\t\tfor (int index=1; index<computers.size();index++){\n\t\t\tif (highest.getPrice()<computers.get(index).getPrice()) {\n\t\t\t\thighest= computers.get(index);\n\n\t\t\t}\n\t\t}\n\t\treturn highest;\n\t}", "E maxVal();", "int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}", "private void getMaxValue(){\n maxValue = array[0];\n for(int preIndex = -1; preIndex<number; preIndex++){\n for(int sufIndex = preIndex+1; sufIndex<=number;sufIndex++){\n long maxTmp = getPrefixValue(preIndex)^getSuffixCValue(sufIndex);\n if(maxTmp>maxValue){\n maxValue = maxTmp;\n }\n }\n }\n System.out.println(maxValue);\n }", "public Individual getWorst() {\n\t\treturn individuals[individuals.length-1];\n\t}", "private static Optional<Student> getHighestGPA(List<Student> studentList) {\n return studentList.stream()\n .reduce((student1, student2) -> {\n if (student1.getGpa() >= student2.getGpa()) return student1;\n else return student2;\n });\n }", "private static int[] findGreatestNumInArray(int[] array) {\r\n\t\tint maxValue = Integer.MIN_VALUE;\r\n \r\n\t\tint secondValue = Integer.MIN_VALUE;\r\n\t\t\r\n\t\tint thirdValue = Integer.MIN_VALUE;\r\n\t\t\r\n\t int[] result = new int[2];\r\n\t \r\n\t int[] result2 = new int[3];\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tif (array[i] > maxValue) {\r\n\t\t\t\tthirdValue = secondValue;\r\n\t\t\t\tsecondValue = maxValue;\r\n\t\t\t\tmaxValue = array[i];\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(array[i]>secondValue)\r\n\t\t\t{\r\n\t\t\t\tsecondValue = array[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if(array[i]>thirdValue)\r\n\t\t\t{\r\n\t\t\t\tthirdValue = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\tallowResult( result,maxValue,secondValue);\r\n\t\t\r\n\t\tallowResult( result2,maxValue,secondValue,thirdValue);\r\n\t\t//return maxValue;\r\n\t\treturn result2;\r\n\t}", "public static <V extends Comparable<? super V>> V maxValueKey(List<V> list)\n\t{\n\t\tCollections.sort(list);\n\t\treturn list.get(list.size() - 1);\n\t}", "public Point getMax () {\r\n\r\n\treturn getB();\r\n }", "String getMaximumRedeliveries();", "private int getGenreDownloadedMostByUser(int profileAccountId){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query query = session.createQuery(\"SELECT mvd, mvd.musicVideo.genre.id, count(*) FROM MusicVideoDownload mvd JOIN FETCH mvd.musicVideo WHERE mvd.profileAccount.id = :profileAccountId GROUP BY mvd.musicVideo.genre.id ORDER BY count(*) DESC\") ;\n query.setParameter(\"profileAccountId\", profileAccountId) ;\n query.setMaxResults(1) ;\n List resultSet = query.list() ;\n session.close() ;\n //if there is no result set, it means the user hasn't made any downloads so return -1\n if(resultSet.isEmpty())\n return -1 ;\n //else return the genre id field of the first tuple since the result set has been sorted in desc order\n Object[] tupleFields = (Object[])resultSet.get(0) ;\n return (int)tupleFields[1] ;\n }", "private RolapCalculation getScopedMaxSolveOrder() {\n // Finite state machine that determines the member with the highest\n // solve order.\n RolapCalculation maxSolveMember = null;\n ScopedMaxSolveOrderFinderState state =\n ScopedMaxSolveOrderFinderState.START;\n for (int i = 0; i < calculationCount; i++) {\n RolapCalculation calculation = calculations[i];\n switch (state) {\n case START:\n maxSolveMember = calculation;\n if (maxSolveMember.containsAggregateFunction()) {\n state = ScopedMaxSolveOrderFinderState.AGG_SCOPE;\n } else if (maxSolveMember.isCalculatedInQuery()) {\n state = ScopedMaxSolveOrderFinderState.QUERY_SCOPE;\n } else {\n state = ScopedMaxSolveOrderFinderState.CUBE_SCOPE;\n }\n break;\n\n case AGG_SCOPE:\n if (calculation.containsAggregateFunction()) {\n if (expandsBefore(calculation, maxSolveMember)) {\n maxSolveMember = calculation;\n }\n } else if (calculation.isCalculatedInQuery()) {\n maxSolveMember = calculation;\n state = ScopedMaxSolveOrderFinderState.QUERY_SCOPE;\n } else {\n maxSolveMember = calculation;\n state = ScopedMaxSolveOrderFinderState.CUBE_SCOPE;\n }\n break;\n\n case CUBE_SCOPE:\n if (calculation.containsAggregateFunction()) {\n continue;\n }\n\n if (calculation.isCalculatedInQuery()) {\n maxSolveMember = calculation;\n state = ScopedMaxSolveOrderFinderState.QUERY_SCOPE;\n } else if (expandsBefore(calculation, maxSolveMember)) {\n maxSolveMember = calculation;\n }\n break;\n\n case QUERY_SCOPE:\n if (calculation.containsAggregateFunction()) {\n continue;\n }\n\n if (calculation.isCalculatedInQuery()) {\n if (expandsBefore(calculation, maxSolveMember)) {\n maxSolveMember = calculation;\n }\n }\n break;\n }\n }\n\n return maxSolveMember;\n }", "private long getMaxValue( Item[] items, int maxWeight, int n) {\n\t\tif ( n == 0 || maxWeight == 0 )\n\t\t\treturn 0;\n\n\t\t// Weight of the nth item is more than maxWeight -> \n\t\t// We cannot include this item into the optimal solutions.\n\t\t// Fall back to to the nth-1 item.\n\t\tif ( items[n - 1].getWeight() > maxWeight)\n\t\t\treturn getMaxValue( items, maxWeight, n-1);\n\t\t\n\t\t// Return the maximum of these two cases:\n\t\t// 1) nth item included\n\t\t// 2) nth item is not included\n\t\t\n\t\tlong includedValue = items[n-1].getValue() + getMaxValue(items, maxWeight-items[n-1].getWeight(), n-1);\n\t\tlong notIncludedValue = getMaxValue(items, maxWeight, n - 1);\n\t\treturn Math.max( includedValue, notIncludedValue);\n\t}", "protected String getMaxValue(HashSet<String> set) {\n\t\tLong max = Long.MIN_VALUE;\n\t\tint count = 0;\n\n\t\tfor (String bound : set) \n\t\t\tif (bound.equals(\"+Inf\"))\n\t\t\t\treturn \"+Inf\";\n\t\t\telse if (bound.equals(\"-Inf\")) \n\t\t\t\tcount++;\n\t\t\telse if (Long.parseLong(bound) > max)\n\t\t\t\tmax = Long.parseLong(bound);\n\n\t\treturn count == 4 ? \"-Inf\" : String.valueOf(max);\n\t}", "public Integer mostCommon() {\n Integer common = list.get(0);\n int commonCount = countOccurrence(common);\n\n for(Integer currentNumber : list) {\n int currentCount = countOccurrence(currentNumber);\n if (currentCount > commonCount) {\n common = currentNumber;\n commonCount = currentCount;\n }\n }\n\n\n return common;\n }", "public static void main(String[] args) {\n\n\n List<Stock> listOfStock = Arrays.asList(new Stock(\"ICICI\", 10), new Stock(\"ICICI\", 30), new Stock(\"SBI\", 60), new Stock(\"SBI\", 30));\n\n ///Map<String, Integer> collect = listOfStock.stream().collect(Collectors.toMap(Stock::getName , stock -> stock.getValue(), Stock::getValue ));\n //System.out.println(collect);\n\n\n List<Integer> integerList = Arrays.asList(1, 2, 35, 32, 34);\n\n Integer integer = integerList.stream().filter(i -> i <\n integerList.stream().mapToInt(j -> j).max().getAsInt()).max(Comparator.naturalOrder()).get();\n System.out.println(integer);\n\n\n // Output : {ICICI=40, SBI=90}\n }", "private static WorkFrame Wf_getPrior(Set<WorkFrame> activeWorkFrames) {\n\t\tint maxPri = 0;\n\t\tif (activeWorkFrames.size() == 0) return null;\n\t\t//find the wf with the highest priority\n\t\tfor (WorkFrame wf : activeWorkFrames) {\n\t\t\tif (wf.getPriority() > 0) {\n\t\t\t\tmaxPri = updateMaxPriority(wf.getPriority(), maxPri);\n\t\t\t\tcontinue;\n\t\t\t} \n\t\t\t//get the priority from the activities \n\t\t\tint maxActPri = 0;\n\t\t\tfor (Event event : wf.getEvents()) {\n\t\t\t\tif (!(event instanceof EventActivity))\tcontinue;\n\n\t\t\t\tActivity tmpAct = getActivity(b, (EventActivity) event);\n\t\t\t\t//maxActPri = updateMaxPriority(tmpAct.getPriority(b), maxActPri);\n\t\t\t}\n\t\t\twf.setPriority(maxActPri);\n\t\t\tmaxPri = updateMaxPriority(wf.getPriority(), maxPri);\n\n\t\t}\n\t\tList<WorkFrame> highestPriorityFrames = new ArrayList<WorkFrame>();\n\t\tfor(WorkFrame wfFrame : activeWorkFrames) {\n\t\t\tif(wfFrame.getPriority() != maxPri) continue;\n\t\t\thighestPriorityFrames.add(wfFrame);\n\t\t}\n\t\t\n\t\tint index = Utils.getHighestPriorityFrameIndex(highestPriorityFrames.size());\n\t\tif (index < 0)\n\t\t\treturn null;\n\t\n\t\treturn highestPriorityFrames.get(index);\n\t}", "public Region findHighestEarningRegion() {\n Region highest = regionList[0];\n for (int i = 1; i < numRegions; i++) {\n if (highest.calcEarnings() <= regionList[i].calcEarnings())\n highest = regionList[i];\n }\n return highest;\n }", "public Computer findMostExpensiveComputerV3( ) {\n\n\t\tComputer highest= computers.get(0);\n\n\t\tfor (Computer c : computers)\n\t\t\tif (highest.getPrice()<c.getPrice()) {\n\t\t\t\thighest=c;\n\n\t\t\t}\n\n\n\t\treturn highest;\n\t}", "public Card.Face getHighestCard(){\n return uniqueFaces.getFirst();\n }", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "public int getMax(final float upperBoundPercentage) {\n\t\tfinal int upperBoundPixelValueSum;\n\t\tupperBoundPixelValueSum = Math.round(upperBoundPercentage * pixelCount);\n\n\t\tint addedUpPixelValues = 0;\n\n\t\tfinal int lastHistogramIndex = pixelValueSums.length;\n\t\tint iHistogram = lastHistogramIndex;\n\n\t\tdo {\n\t\t\tiHistogram--;\n\n\t\t\tfinal int pixelValue = pixelValueSums[iHistogram];\n\t\t\taddedUpPixelValues += pixelValue;\n\n\t\t} while (addedUpPixelValues <= upperBoundPixelValueSum\n\t\t\t\t&& iHistogram > 0);\n\n\t\treturn iHistogram;\n\t}", "public static void main(String[] args) {\n int[] arr={24,34,56,98,2,59};\r\n int val =arr [0];\r\n for(int i=0;i<arr.length;i++){\r\n \t if(arr[i]>val){\r\n \t\t val=arr[i];\r\n \t }\r\n }\r\n System.out.println(\"largest value\"+ val);\r\n\t}", "static int findGreatestValue(int x, int y) {\r\n\t\t\r\n\t\tif(x>y)\r\n\t\t\treturn x;\r\n\t\telse\r\n\t\t return y;\r\n\t}", "public Computer findMostExpensiveComputerV2( ) { \n\t\tComputer highest= computers.get(0);\n\t\tint index=1; \n\t\twhile (index<computers.size()){\n\t\t\tif (highest.getPrice()<computers.get(index).getPrice()) {\n\t\t\t\thighest= computers.get(index);\n\n\t\t\t}\n\t\t\tindex ++;\n\t\t}\n\t\treturn highest;\n\n\t}", "public int compare(Page p1, Page p2) {\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}", "public int compare(Page p1, Page p2) {\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}", "<T> Collection<T> getMostRecent(Class<T> t, int max);", "public static int findNextHigher(int[] a, int k) {\n\t int low = 0; \n\t int high = a.length - 1;\n\t \n\t int result = Integer.MAX_VALUE;\n\t while (low <= high) {\n\t int mid = (low + high) / 2;\n\t \n\t if (a[mid] > k) {\n\t result = a[mid]; /*update the result and continue*/\n\t high = mid - 1;\n\t } else {\n\t low = mid + 1;\n\t }\n\t } \n\t \n\t return result;\n\t}", "double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}", "private static int[] FindHighest(int[][] terrainMap) {\n\n int[] highestPosition = {-1, -1};\n int highestValue = terrainMap[0][0];\n\n int i, j;\n\n for (i = 0; i < terrainMap.length; i++) {\n for (j = 0; j < terrainMap[0].length; j++) {\n if (terrainMap[i][j] > highestValue) {\n highestValue = terrainMap[i][j];\n highestPosition[0] = i;\n highestPosition[1] = j;\n }\n }\n }\n\n return highestPosition;\n }", "public int getOldest(){\n\t\tCurrentSets = getCurrentSets();\n\t\tOldest = 0;\n\t\tSmallestValue = blocks[0].getAge();\n\t\tif(CurrentSets == 1){\n\t\t\treturn 0;\n\t\t}\n\t\telse if(CurrentSets == 2){\n\t\t\tif(blocks[0].getAge() > blocks[1].getAge())\n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn 0;\n\t\t}\n\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\tif(blocks[i].getAge() < SmallestValue){\n\t\t\t\tOldest = i;\n\t\t\t\tSmallestValue = blocks[i].getAge();\n\t\t\t}\n\t\t}\n\t\treturn Oldest;\n\t}", "public static int getIndexOfMax(double[] array){\n\n int largest = 0;\n for ( int i = 1; i < array.length; i++ )\n {\n if ( array[i] > array[largest] ) largest = i;\n }\n return largest;\n\n }", "@In Integer max();", "@In Integer max();", "public V getLatest() {\n return lastItemOfList(versions);\n }", "private int getArtisteDownloadedMostByAllUsers(){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query query = session.createQuery(\"SELECT mvd, mvd.musicVideo.artiste.id, count(*) FROM MusicVideoDownload mvd JOIN FETCH mvd.musicVideo GROUP BY mvd.musicVideo.artiste.id ORDER BY count(*) DESC\") ;\n query.setMaxResults(1) ;\n List resultSet = query.list() ;\n session.close() ;\n //if there is no result set, it means there are no downloads so return -1\n if(resultSet.isEmpty())\n return -1 ;\n //else return the artiste id field of the first tuple since the result set has been sorted in desc order\n Object[] tupleFields = (Object[])resultSet.get(0) ;\n return (int)tupleFields[1] ;\n }", "@Override\n public List getMostViewedPages(Long count, String orderBy) {\n log.debug(\"This fetches most viewed pages with count : {}\", count);\n TreeMap<String, Integer> responseMap = new TreeMap<>();\n HashMap<String, Integer> checkPagesMap = new HashMap<>();\n List<String> eventLabelList = csvRepository.findAllEventLabel();\n if (eventLabelList == null) {\n throw new CsvException(String.format(\"Event_label column is empty, please insert some records\"));\n }\n for (String cc : eventLabelList) {\n if (checkPagesMap.containsKey(cc)) {\n checkPagesMap.put(cc, checkPagesMap.get(cc)+1);\n } else {\n checkPagesMap.put(cc,1);\n }\n }\n List<String> listOfPages = new ArrayList<>();\n responseMap.putAll(checkPagesMap);\n for (int i = 1; i <= count; i++) {\n for (Map.Entry<String, Integer> entry : responseMap.entrySet()) {\n listOfPages.add(entry.getKey());\n }\n }\n log.debug(\"List of pages fetched successfully\");\n return listOfPages;\n }", "private int[] getHighestPricesInTerm(int[] prices){\n int highest = -1;\n int index = -1;\n for(int i=0;i<prices.length;i++){\n if(prices[i]>highest){\n highest = prices[i];\n index = i;\n }\n }\n return new int[]{highest,index};\n }", "public abstract int maxIndex();", "public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}", "public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}", "private ResultIntent.IntentProbability maxElementIntent(List<ResultIntent.IntentProbability> element) {\n return Collections.max(element, (intentProbability, t1) -> {\n if (intentProbability.getProbability() == t1.getProbability()) {\n return 0;\n } else if (intentProbability.getProbability() < t1.getProbability()) {\n return -1;\n }\n return 1;\n });\n }", "Object getBest();", "private float calculateMaxValue(int[] probes) {\r\n float max = 0f;\r\n float value;\r\n final int samples = experiment.getNumberOfSamples();\r\n for (int sample=0; sample<samples; sample++) {\r\n for (int probe=0; probe<probes.length; probe++) {\r\n value = experiment.get(probes[probe], sample);\r\n if (!Float.isNaN(value)) {\r\n max = Math.max(max, Math.abs(value));\r\n }\r\n }\r\n }\r\n return max;\r\n }", "public MediaFile getBiggestMediaFile(MediaFileType... types) {\n MediaFile mf = null;\n\n readWriteLock.readLock().lock();\n for (MediaFile mediaFile : mediaFiles) {\n for (MediaFileType type : types) {\n if (mediaFile.getType().equals(type)) {\n if (mf == null || mediaFile.getFilesize() >= mf.getFilesize()) {\n mf = mediaFile;\n }\n }\n }\n }\n readWriteLock.readLock().unlock();\n return mf;\n }", "private static void afisareSubsecventaMaxima() {\n afisareSir(citireSir().SecvMax());\n }", "int maxNoteValue();" ]
[ "0.5404516", "0.52651376", "0.52594167", "0.525014", "0.52370155", "0.52352417", "0.5218154", "0.5199563", "0.51250124", "0.51197046", "0.5111402", "0.51027095", "0.5060654", "0.50400335", "0.5034061", "0.5031519", "0.5019915", "0.5009256", "0.5008773", "0.49940217", "0.49824142", "0.4966937", "0.4957763", "0.49372408", "0.49312717", "0.49310312", "0.49284288", "0.492824", "0.4926707", "0.49165404", "0.49154404", "0.48982728", "0.48948488", "0.48883763", "0.48870963", "0.48828438", "0.4877415", "0.48763868", "0.48711058", "0.4866075", "0.48584318", "0.48548293", "0.48407686", "0.48355478", "0.48343897", "0.48214936", "0.48146027", "0.48108026", "0.48065314", "0.4802873", "0.4791491", "0.4791221", "0.47872862", "0.47846407", "0.47562432", "0.47457764", "0.47416088", "0.4738443", "0.47375557", "0.47299075", "0.47294575", "0.47293824", "0.47257632", "0.47248048", "0.4724031", "0.47224447", "0.47186127", "0.47182584", "0.4715837", "0.47154444", "0.47022542", "0.47013193", "0.47001234", "0.469031", "0.4684539", "0.4684014", "0.468088", "0.46790057", "0.46790057", "0.46765503", "0.467331", "0.4665713", "0.46612066", "0.46607146", "0.46559864", "0.46476206", "0.46476206", "0.4643246", "0.46327785", "0.46273136", "0.46256277", "0.4614662", "0.46092755", "0.46090144", "0.4605947", "0.46041864", "0.46036893", "0.46032315", "0.45995635", "0.4598891" ]
0.73783934
0
Return from a set of Pages the Page with the greatest Authority value
public Page getMaxAuthority(List<Page> result) { Page maxAuthority = null; for (Page currPage : result) { if (maxAuthority == null || currPage.authority > maxAuthority.authority) maxAuthority = currPage; } return maxAuthority; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getGenreDownloadedMostByUser(int profileAccountId){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query query = session.createQuery(\"SELECT mvd, mvd.musicVideo.genre.id, count(*) FROM MusicVideoDownload mvd JOIN FETCH mvd.musicVideo WHERE mvd.profileAccount.id = :profileAccountId GROUP BY mvd.musicVideo.genre.id ORDER BY count(*) DESC\") ;\n query.setParameter(\"profileAccountId\", profileAccountId) ;\n query.setMaxResults(1) ;\n List resultSet = query.list() ;\n session.close() ;\n //if there is no result set, it means the user hasn't made any downloads so return -1\n if(resultSet.isEmpty())\n return -1 ;\n //else return the genre id field of the first tuple since the result set has been sorted in desc order\n Object[] tupleFields = (Object[])resultSet.get(0) ;\n return (int)tupleFields[1] ;\n }", "private static Optional<Student> getHighestGPA(List<Student> studentList) {\n return studentList.stream()\n .reduce((student1, student2) -> {\n if (student1.getGpa() >= student2.getGpa()) return student1;\n else return student2;\n });\n }", "public Book mostExpensive() {\n //create variable that stores the book thats most expensive\n Book mostExpensive = bookList.get(0);//most expensive book is set as the first in the array\n for (Book book : bookList) {\n if(book.getPrice() > mostExpensive.getPrice()){\n mostExpensive = book;\n }\n } return mostExpensive;//returns only one (theFIRST) most expensive in the array if tehre are several with the same price\n }", "public static <E extends Comparable<E>> Optional<E> max3(Collection<E> c){\n return c.stream().max(Comparator.naturalOrder());\n }", "Integer getMaxPageResults();", "public Page getMaxHub(List<Page> result) {\n\t\tPage maxHub = null;\n\t\tfor (Page currPage : result) {\n\t\t\tif (maxHub == null || currPage.hub > maxHub.hub)\n\t\t\t\tmaxHub = currPage;\n\t\t}\n\t\treturn maxHub;\n\t}", "private int getGenreDownloadedMostByAllUsers(){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query query = session.createQuery(\"SELECT mvd, mvd.musicVideo.genre.id, count(*) FROM MusicVideoDownload mvd JOIN FETCH mvd.musicVideo GROUP BY mvd.musicVideo.genre.id ORDER BY count(*) DESC\") ;\n query.setMaxResults(1) ;\n List resultSet = query.list() ;\n session.close() ;\n //if there is no result set, it means there are no downloads so return -1\n if(resultSet.isEmpty())\n return -1 ;\n //else return the genre id field of the first tuple since the result set has been sorted in desc order\n Object[] tupleFields = (Object[])resultSet.get(0) ;\n return (int)tupleFields[1] ;\n }", "public void getPostWithMostComments(){\n Map<Integer, Integer> postCommentCount = new HashMap<>();\n Map<Integer, Post> posts = DataStore.getInstance().getPosts();\n \n for(Post p: posts.values()){\n for(Comment c : p.getComments()){\n int commentCount = 0;\n if(postCommentCount.containsKey(p.getPostId())){\n commentCount = postCommentCount.get(p.getPostId());\n \n }\n commentCount += 1;\n postCommentCount.put(p.getPostId(), commentCount);\n \n }\n }\n int max = 0;\n int maxId = 0;\n for (int id : postCommentCount.keySet()) {\n if (postCommentCount.get(id) > max) {\n max = postCommentCount.get(id);\n maxId = id;\n }\n }\n System.out.println(\"\\nPost with most Comments \");\n System.out.println(posts.get(maxId));\n \n }", "private int getArtisteDownloadedMostByUser(int profileAccountId){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query query = session.createQuery(\"SELECT mvd, mvd.musicVideo.artiste.id, count(*) FROM MusicVideoDownload mvd JOIN FETCH mvd.musicVideo WHERE mvd.profileAccount.id = :profileAccountId GROUP BY mvd.musicVideo.artiste.id ORDER BY count(*) DESC\") ;\n query.setParameter(\"profileAccountId\", profileAccountId) ;\n query.setMaxResults(1) ;\n List resultSet = query.list() ;\n session.close() ;\n //if there is no result set, it means the user hasn't made any downloads so return -1\n if(resultSet.isEmpty())\n return -1 ;\n //else return the artiste id field of the first tuple since the result set has been sorted in desc order\n Object[] tupleFields = (Object[])resultSet.get(0) ;\n return (int)tupleFields[1] ;\n }", "<T> Collection<T> getMostRecent(Class<T> t, int max);", "public Page getLastPageObject() {\n return getPageObject(pages.length - 1);\n }", "public Staff findHighestEarningLabour() {\n Staff highest = new Labourer(null,0,null,0,0);\n \n for (int i = 0; i < staffList.length; i++) { \n if (staffList[i] instanceof Labourer) {\n if (((Labourer)staffList[i]).getWage() >= ((Labourer)highest).getWage()){\n highest = staffList[i];\n }\n }\n }\n return highest;\n }", "int findMaximumOrderByWorkflowId( int nWorkflowId );", "public int getHighestChromID();", "private int getArtisteDownloadedMostByAllUsers(){\n \n SessionFactory sessionFactory = (SessionFactory)servletContext.getAttribute(OpusApplication.HIBERNATE_SESSION_FACTORY) ;\n Session session = sessionFactory.openSession() ;\n Query query = session.createQuery(\"SELECT mvd, mvd.musicVideo.artiste.id, count(*) FROM MusicVideoDownload mvd JOIN FETCH mvd.musicVideo GROUP BY mvd.musicVideo.artiste.id ORDER BY count(*) DESC\") ;\n query.setMaxResults(1) ;\n List resultSet = query.list() ;\n session.close() ;\n //if there is no result set, it means there are no downloads so return -1\n if(resultSet.isEmpty())\n return -1 ;\n //else return the artiste id field of the first tuple since the result set has been sorted in desc order\n Object[] tupleFields = (Object[])resultSet.get(0) ;\n return (int)tupleFields[1] ;\n }", "public static <E extends Comparable<E>> Optional<E>\n max2(Collection<E> c){\n if(c.isEmpty()){\n return Optional.empty();\n }\n E result = null;\n for(E e : c){\n if(result == null || e.compareTo(result) > 0){\n result = Objects.requireNonNull(e);\n }\n }\n return Optional.of(result);\n }", "List<T> findMostPopularTags(Role role, Integer firstResult, Integer maxResult);", "List<Article> findTop3ByOrderByPostTimeDesc();", "public static File LargestFile (File f)\n\t{\n\t\tif (f.isFile())\n\t\t{\n\t\t\treturn f;\n\t\t}\n\t\telse \n\t\t{\n\t\t\tFile largest = f;\n\t\t\tfor (File file: f.listFiles())\n\t\t\t{\n\t\t\t\tFile g = LargestFile(file);\n\t\t\t\tif(g.length()>file.length())\n\t\t\t\t{\n\t\t\t\t\tlargest = g;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn largest;\n\n\t\t}\n\t}", "List<T> findMostPopularTags(Integer firstResult, Integer maxResult);", "public Book booksByThreeAuthor(){\n for(Book book:bookList){\n if(book.getAuthors().size() == 3){ //checks the number of elements in the arraylist\n return book;\n }\n }\n return null;\n }", "public int getOldest(){\n\t\tCurrentSets = getCurrentSets();\n\t\tOldest = 0;\n\t\tSmallestValue = blocks[0].getAge();\n\t\tif(CurrentSets == 1){\n\t\t\treturn 0;\n\t\t}\n\t\telse if(CurrentSets == 2){\n\t\t\tif(blocks[0].getAge() > blocks[1].getAge())\n\t\t\t\treturn 1;\n\t\t\telse\n\t\t\t\treturn 0;\n\t\t}\n\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\tif(blocks[i].getAge() < SmallestValue){\n\t\t\t\tOldest = i;\n\t\t\t\tSmallestValue = blocks[i].getAge();\n\t\t\t}\n\t\t}\n\t\treturn Oldest;\n\t}", "public Region findHighestEarningRegion() {\n Region highest = regionList[0];\n for (int i = 1; i < numRegions; i++) {\n if (highest.calcEarnings() <= regionList[i].calcEarnings())\n highest = regionList[i];\n }\n return highest;\n }", "public double SumOutlinkAuthorityScore(Page page) {\n\t\tList<String> outLinks = page.getOutlinks();\n\t\tdouble authScore = 0;\n\t\tfor (String outLink1 : outLinks) {\n\t\t\tPage outLink = pTable.get(outLink1);\n\t\t\tif (outLink != null)\n\t\t\t\tauthScore += outLink.authority;\n\t\t}\n\t\treturn authScore;\n\t}", "public int houseRobberWithMaxAmount(int[] a) {\n\t\tint n = a.length;\n\t\tif (1 == n)\n\t\t\treturn a[0];\n\n\t\t// Rob house including 1stHouse, excluding last house\n\t\tint amt1 = houseRobberWithMaxAmountHousesFromItoJInConstantSpace(a, 0, a.length - 2);\n\t\t// Rob house excluding 1stHouse, including last house\n\t\tint amt2 = houseRobberWithMaxAmountHousesFromItoJInConstantSpace(a, 1, a.length - 1);\n\n\t\treturn Math.max(amt1, amt2);\n\t}", "public static MyStudent studentWithHighest ( List<MyStudent> list) {\n\t\treturn list.stream().sorted(Comparator.comparing(MyStudent::getScore)).skip(list.size()-1).findFirst().get();\n\t}", "private void printMostVisited()\r\n\t{\r\n\t\tint greatestIndex = 0;\r\n\t\tint greatest = (int)webVisited[1][greatestIndex];\r\n\t\t\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\tif ((int)webVisited[1][i] > greatest)\r\n\t\t\t{\r\n\t\t\t\tgreatestIndex = i;\r\n\t\t\t\tgreatest = (int)webVisited[1][greatestIndex];\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Most visited website is: \" + webVisited[0][greatestIndex]);\r\n\t}", "public Page getLastPageObject() {\n return getPageObject(pages.length - 1);\n }", "public void setMaxDoc(Comparator<Doc> comparator) {\n Doc[] arr = docs.toArray(new Doc[docs.size()]);\n Arrays.sort(arr, comparator);\n maxDoc = arr.length > 0 ? arr[0] : null;\n }", "public static Optional<Student> getStudentWithHighestGpa() {\n\t\treturn StudentDb.getAllStudents().stream()\n\t\t\t\t.collect(maxBy(Comparator.comparing(Student::getGpa)));\n\t}", "public Album getAlbumWithMostTracks()\r\n {\r\n\t// Initialise variables to store max track count and album with the most \r\n\t// tracks\r\n\tint maxTrackCount = 0;\r\n\tAlbum maxTrackAlbum = null;\r\n\r\n\t// Create Iterator to iterate over the album collection\r\n\t// Netbeans warns 'use of iterator for simple loop' but Iterator is used\r\n\t// here to demonstrate knowledge of using Iterators rather than using for\r\n\t// loop and List.get() method\r\n\tIterator iterator = albumCollection.iterator();\r\n\twhile (iterator.hasNext())\r\n\t{\r\n\t // get current album and number of tracks in current album\r\n\t Album currentAlbum = (Album) iterator.next();\r\n\t int trackCount = currentAlbum.getTrackCount();\r\n\r\n\t // if track count exceeds max found so far, update max track count and\r\n\t // store the album in maxTrackAlbum\r\n\t if (trackCount > maxTrackCount)\r\n\t {\r\n\t\tmaxTrackCount = trackCount;\r\n\t\tmaxTrackAlbum = currentAlbum;\r\n\t }\r\n\t}\r\n\treturn maxTrackAlbum;\r\n }", "private Set<String> findLargestCluster(Map<double[], Set<String>> restaurantClusters) {\n int maxSize = 0;\n Set<String> largestCluster = null;\n for (Set<String> cluster : restaurantClusters.values()) {\n if (cluster.size() > maxSize) {\n largestCluster = cluster;\n maxSize = cluster.size();\n }\n }\n return largestCluster;\n }", "public Computer findMostExpensiveComputerV3( ) {\n\n\t\tComputer highest= computers.get(0);\n\n\t\tfor (Computer c : computers)\n\t\t\tif (highest.getPrice()<c.getPrice()) {\n\t\t\t\thighest=c;\n\n\t\t\t}\n\n\n\t\treturn highest;\n\t}", "public List<T> mostliked();", "private static Key max(Key... ks) {\n\t\tif (ks == null || ks.length == 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tKey max = ks[0];\n\t\tfor (int i = 1; i < ks.length; i++) {\n\t\t\tif (ks[i].compareTo(max) > 0) {\n\t\t\t\tmax = ks[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "static public Set<Employee> removeWithWageAbove(Set<Employee> company, Float maximumWage){\n\t\tfor(Iterator<Employee> iterator = company.iterator(); iterator.hasNext(); ){\n\t\t\tEmployee currentEmpl = iterator.next();\n\t\t\tif(currentEmpl.getSalary() > maximumWage) {\n\t\t\t\titerator.remove();\n\t\t\t}\n\t\t}\n\t\treturn company;\n\t}", "@VisibleForTesting\n public static Severity getHighestSeverity(Collection<Incident> incidents) {\n Severity max = Severity.OK;\n for (Incident incident : incidents) {\n if (max.compareTo(incident.severity) < 0) {\n max = incident.severity;\n }\n }\n return max;\n }", "private List<NewsArticle> getMostPopular() {\n LOGGER.log(Level.INFO, \"getMostPopular\");\n return newsService.getMostPopular();\n }", "public T max() {return max(comparator);}", "Price getHighestPricedTrade(Collection<Trade> trades);", "@Test()\n public void testGetBiggestPerMonthWithYearly() {\n\tYearMonth yearMonth = YearMonth.of(2015, 8);\n\tList<Expense> list = expenseManager.getBiggestPerMonth(yearMonth);\n\tassertEquals(\"vacation\", list.get(0).getName());\n }", "private static List<UserData> getLastCommittedPageVersions() throws IOException {\n File transactionDir = new File(\"logdata\");\n\n File[] files = transactionDir.listFiles();\n\n if (files == null) {\n System.out.println(\"error reading logdata files\");\n System.exit(1);\n }\n\n //all committed transaction ids\n List<Integer> committedTransactionIds = new ArrayList<>();\n\n //first collect committed transaction ids\n for (File file : files) {\n int LSN = Integer.parseInt(file.getName());\n\n //read the first line of the page file\n BufferedReader reader = new BufferedReader(new FileReader(file));\n String[] contentParts = reader.readLine().split(\",\");\n\n //only collect committed transaction ids\n if (Objects.equals(contentParts[1], \"commit\")) {\n committedTransactionIds.add(Integer.parseInt(contentParts[0]));\n }\n }\n\n HashMap<Integer, UserData> map = new HashMap<>();\n //now collect the last page contents for each page\n for (File file : files) {\n int LSN = Integer.parseInt(file.getName());\n\n //read the first line of the page file\n BufferedReader reader = new BufferedReader(new FileReader(file));\n String[] contentParts = reader.readLine().split(\",\");\n\n //ignore commits\n if (!Objects.equals(contentParts[1], \"commit\")) {\n int transactionId = Integer.parseInt(contentParts[0]);\n int pageId = Integer.parseInt(contentParts[1]);\n\n //only consider committed transactions\n if (committedTransactionIds.contains(transactionId)) {\n\n if (map.containsKey(pageId)) {\n //check if current file has newer version\n if (map.get(pageId).getLSN() < LSN) {\n map.put(pageId, new UserData(pageId, contentParts[2], LSN));\n }\n } else {\n map.put(pageId, new UserData(pageId, contentParts[2], LSN));\n }\n }\n }\n }\n return new ArrayList<>(map.values());\n }", "private RolapCalculation getAbsoluteMaxSolveOrder() {\n // Find member with the highest solve order.\n RolapCalculation maxSolveMember = calculations[0];\n for (int i = 1; i < calculationCount; i++) {\n RolapCalculation member = calculations[i];\n if (expandsBefore(member, maxSolveMember)) {\n maxSolveMember = member;\n }\n }\n return maxSolveMember;\n }", "public T max(Comparator<T> c) {\n if (isEmpty()) {\n return null;\n }\n\n T biggest = this.get(0);\n for (T item: this) {\n if (c.compare(item, biggest) > 0) {\n biggest = item;\n }\n }\n return biggest;\n }", "int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}", "public Money findMaxPrice(long n) {\n\t\tif (!hashMap.containsKey(n)) {\n\t\t\treturn new Money();\n\t\t}\n\t\tTreeSet<Long> idSet = hashMap.get(n);\n\t\tMoney max = new Money();\n\t\tboolean flag = false;\n\t\tfor (Long id : idSet) {\n\t\t if(treeMap.containsKey(id)){\n\t\t\tMoney current = treeMap.get(id).price;\n\t\t\tif (max.compareTo(current) == -1 || !flag) {\n\t\t\t\tmax = current;\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public Computer findMostExpensiveComputerV4( ) { \n\n\t\tComputer highest= computers.get(0);\n\t\tIterator<Computer> it= computers.iterator();\n\t\tComputer current=null; // a temporary copy of has.next() to perform multiple actions on it inside the loop\n\t\twhile(it.hasNext()) {\n\t\t\tcurrent=it.next();\n\t\t\tif (highest.getPrice()<current.getPrice()) \n\t\t\t\thighest=current;\n\n\n\t\t}\n\n\t\treturn highest;\n\n\t}", "public static <E extends Comparable<E>> E max(Collection<E> c){\n if(c.isEmpty()){\n throw new IllegalArgumentException(\"Empty Collection\");\n }\n E result = null;\n for(E e : c){\n if(result == null || e.compareTo(result) > 0){\n result = Objects.requireNonNull(e);\n }\n }\n return result;\n }", "public static MyStudent SecondHighest (List<MyStudent> list) {\n\t\t\t\n\t\t\treturn list.stream().sorted(Comparator.comparing(MyStudent::getScore)).skip(list.size()-2).findFirst().get();\n\t\t\t\n\t\t}", "public static void main(String[] args) {\n int[] arr={24,34,56,98,2,59};\r\n int val =arr [0];\r\n for(int i=0;i<arr.length;i++){\r\n \t if(arr[i]>val){\r\n \t\t val=arr[i];\r\n \t }\r\n }\r\n System.out.println(\"largest value\"+ val);\r\n\t}", "public static void maxWithSort(List<Integer> list){\n Optional<Integer> max = list.stream().sorted().reduce((x, y)->y);\n System.out.println(max);\n }", "public Integer returnMaxBiblioId(String library_id, String sublibrary_id) {\n Session session = HibernateUtil.getSessionFactory().openSession();\n Integer maxbiblio=null;\n try {\n session.beginTransaction();\n\n Criteria criteria = session.createCriteria(BibliographicDetails.class);\n Criterion a = Restrictions.eq(\"id.libraryId\", library_id);\n Criterion b = Restrictions.eq(\"id.sublibraryId\", sublibrary_id);\n LogicalExpression le = Restrictions.and(a, b);\n maxbiblio = (Integer) criteria.add(le).setProjection(Projections.max(\"id.biblioId\")).uniqueResult();\n if (maxbiblio == null) {\n maxbiblio = 1;\n } else {\n maxbiblio++;\n }\n\n session.getTransaction().commit();\n } catch(Exception e){\n e.printStackTrace();\n }\n finally {\n session.close();\n }\n return maxbiblio;\n }", "public Map<Integer, LanguageEntry> getTop(int max, Language lang) {\r\n\t\tMap<Integer, LanguageEntry> temp = new ConcurrentHashMap<>();\r\n\t\tList<LanguageEntry> les = new ArrayList<>(getDb().get(lang).values());\r\n\t\t\r\n\t\tCollections.sort(les);\r\n\t\t\r\n\t\tint rank = 1;\r\n\t\tfor (LanguageEntry le : les) {\r\n\t\t\tle.setRank(rank);\r\n\t\t\ttemp.put(le.getKmer(), le);\t\t\t\r\n\t\t\tif (rank == max) break;\r\n\t\t\trank++;\r\n\t\t}\r\n\t\t// Return\r\n\t\treturn temp;\r\n\t}", "public void biggestPalindromeNumber() {\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < palindromeNumbers.size(); i++) {\n\t\t\tfor (int j = 1; j < palindromeNumbers.size(); j++) {\n\t\t\t\tif (palindromeNumbers.get(j) > palindromeNumbers.get(i)) {\n\t\t\t\t\ttemp = palindromeNumbers.get(j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Largest Palindrome : \" + temp);\n\t}", "private static HashMap<Integer, Integer> getLastPageVersions() throws IOException {\n File transactionDir = new File(\"userdata\");\n\n File[] files = transactionDir.listFiles();\n\n if (files == null) {\n System.out.println(\"error reading userdata files\");\n System.exit(1);\n }\n\n //maps PageId to LSN\n HashMap<Integer, Integer> map = new HashMap<>();\n\n for (File file : files) {\n int pageId = Integer.parseInt(file.getName());\n\n //read the first line of the page file\n BufferedReader reader = new BufferedReader(new FileReader(file));\n String content = reader.readLine();\n\n int lsn = Integer.parseInt(content.split(\",\")[0]);\n map.put(pageId, lsn);\n }\n return map;\n }", "private void getTweetsMostCommonHashTag() {\r\n final List<Entry<String, Integer>> list = \r\n getCommonList(countHashtags, countHashtags.size());\r\n list.stream()\r\n .filter(entry -> !searched.contains(entry.getKey().toLowerCase()))\r\n .limit(1)\r\n .forEach(entry -> getTweets(entry.getKey(), geocode, getAuth()));\r\n }", "public static <T extends Comparable<T>> T max(Collection<? extends T> values) {\r\n\t\treturn values.stream().filter(Objects::nonNull).max(Comparable::compareTo).orElse(null);\r\n\t}", "public static <K, V, C extends Comparator<Map.Entry<K, V>>> K maxValueKey(Map<K, V> map, C c)\n\t{\n\t\tList<Map.Entry<K, V>> list = new LinkedList<Map.Entry<K, V>>(map.entrySet());\n\t\tCollections.sort(list, c);\n\n\t\ttry\n\t\t{\n\t\t\treturn list.get(0).getKey();\n\t\t}\n\t\tcatch (IndexOutOfBoundsException e)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public static <T> T findMax(Collection<T> collection, Comparator<T> comparator) {\n return collection.stream().max(comparator).get();\n }", "@Test()\n public void testGetBiggestPerMonth() {\n\tYearMonth yearMonth = YearMonth.of(2015, 6);\n\tList<Expense> list = expenseManager.getBiggestPerMonth(yearMonth);\n\tassertEquals(\"gas\", list.get(0).getName());\n }", "private int largestCard(Card[] cards) {\n int i;\n\n // Initialize maximum element\n int max = 0;\n\n // Traverse array elements from second and\n // compare every element with current max\n for (i = 1; i < cards.length; i++)\n if (cards[i].getDenomination() > cards[max].getDenomination())\n max = i;\n\n return max;\n }", "public String biggestSet(HashMap<String, TreeSet<String>> myMap){\n\t\tString testKey = \"\";\n\t\tString biggestKey = \"\";\n\t\tIterator<Entry<String, TreeSet<String>>>\n\t\titer= myMap.entrySet().iterator();\n\n\t\tTreeSet<String> largestFamily = new TreeSet<String>();\n\t\tTreeSet<String> test;\n\n\t\twhile(iter.hasNext()){\n\t\t\ttestKey = iter.next().getKey();\n\t\t\ttest = myMap.get(testKey);\n\t\t\tif(test.size()>largestFamily.size()){\n\t\t\t\tlargestFamily = test;\n\t\t\t\tbiggestKey = testKey;\n\t\t\t}\n\t\t}\n\t\treturn biggestKey;\n\t}", "private long findMaxId() {\n\t\tlong max = 0;\n\t\tfor (Block block : this.getBlockCollection()) {\n\t\t\tif (block.getId() > max) {\n\t\t\t\tmax = block.getId();\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public Optional<DataModel> max(){\n return stream.max(Comparator.comparing(DataModel::getAge));\n }", "public int getMaximun(){\n int highGrade = grades[0]; //assumi que grades[0] é a maior nota\n //faz o loop pelo array de notas\n for(int grade: grades){\n //se a nota for maior que highGrade. atribui essa nota a highGrade\n if(grade > highGrade){\n highGrade = grade; //nota mais alta\n }\n }\n \n return highGrade;\n }", "static int extractHeapMax(int[] ar){\r\n\t\tif(heapSize<1) return -1;\r\n\t\tint max = ar[1];\r\n\t\tswap(ar,1,heapSize);\r\n\t\theapSize-=1;\r\n\t\tmax_heapify(ar, 1);\r\n\t\treturn max;\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tlong ln= 6008514751431L;\r\n\t\tint max=0;\r\n\t\tfor (int i=2; i<= ln;i++)\r\n\t\t\twhile (ln % i == 0)\r\n\t\t\t{\r\n\t\t\t\tif(i>max)\r\n\t\t\t\tmax=i;\r\n\t\t\t\tln/=i;\r\n\t\t\t}\t\r\n\t\tSystem.out.println(\"the greatest prime factor of the given number is :\"+max);\r\n\t\t}", "private double getMaxNumber(ArrayList<Double> provinceValues)\n {\n Double max = 0.0;\n\n for (Double type : provinceValues)\n {\n if (type > max)\n {\n max = type;\n }\n }\n return max;\n }", "long getMaxItemFindings();", "@Override\n public Set<Book> query(Set<Book> books) {\n Comparator<Book> comparator = Comparator.comparing(Book::getNumberOfPages);\n List<Book> list = new LinkedList<Book>(books);\n if (!isAscending) {\n comparator = comparator.reversed();\n }\n list.sort(comparator);\n return new LinkedHashSet<>(list);\n }", "ComparableExpression<T> max();", "public static <E extends Comparable<? super E>> Optional<E> max(Set<? extends E> s1) {\r\n\t\tE res = null;\r\n\t\tfor(E val : s1) {\r\n\t\t\tif(res == null || val.compareTo(res) > 0) {\r\n\t\t\t\tres = val;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn Optional.ofNullable(res);\r\n\t}", "public static TransactionIsolation max(TransactionIsolation head, TransactionIsolation... tail) {\n TransactionIsolation acc = head;\n for (TransactionIsolation current : tail) {\n if (current.compareTo(acc) >= 1) {\n acc = current;\n }\n }\n return acc;\n }", "@Override\r\n\tpublic String getPage() {\n\t\ttry {\r\n\t\t\tWriter wr = new OutputStreamWriter(\r\n\t\t\t\t\tnew FileOutputStream(OutputPath), \"utf-8\");\r\n\t\t\tList<String> colleges = IOUtil.read2List(\r\n\t\t\t\t\t\"property/speciality.properties\", \"GBK\");\r\n\t\t\tfor (String college : colleges) {\r\n\t\t\t\tfor (int i = 1; i < 10000; i++) {\r\n\t\t\t\t\tString html = getSeach(college, null, null, 1, i);\r\n\t\t\t\t\tif (html.equals(\"\")) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tDocument page = Jsoup.parse(html);\r\n\t\t\t\t\tElements authors = page.getElementsByAttributeValue(\r\n\t\t\t\t\t\t\t\"class\", \"listBox wauto clearfix\");\r\n\t\t\t\t\tfor (Element author : authors) {\r\n\t\t\t\t\t\tElement e = author.getElementsByAttributeValue(\"class\",\r\n\t\t\t\t\t\t\t\t\"xuezheName\").get(0);\r\n\t\t\t\t\t\tElement a = e.getElementsByAttributeValue(\"target\",\r\n\t\t\t\t\t\t\t\t\"_blank\").first();\r\n\t\t\t\t\t\tString name = a.text();\r\n\t\t\t\t\t\tString school = author.getElementsByAttributeValue(\r\n\t\t\t\t\t\t\t\t\"class\", \"f14\").text();\r\n\t\t\t\t\t\tString id = a.attr(\"href\");\r\n\t\t\t\t\t\tString speciallity = author\r\n\t\t\t\t\t\t\t\t.getElementsByAttributeValue(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\"xuezheDW\").first().text();\r\n\t\t\t\t\t\twr.write(school + \"\\t\" + id + \"\\t\" + speciallity\r\n\t\t\t\t\t\t\t\t+ \"\\r\\n\");\r\n\t\t\t\t\t\tSystem.out.println(i + \":\" + school);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twr.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public Integer mostCommon() {\n Integer common = list.get(0);\n int commonCount = countOccurrence(common);\n\n for(Integer currentNumber : list) {\n int currentCount = countOccurrence(currentNumber);\n if (currentCount > commonCount) {\n common = currentNumber;\n commonCount = currentCount;\n }\n }\n\n\n return common;\n }", "public int heapExtractMax(){\n\t\tint max = a[0];\t\n\t\ta[0] = a[n-1];\n\t\ta[n-1] = Integer.MIN_VALUE;\n\t\tn--;\n\t\tmaxHeapfy(0);\t\t\n\t\treturn max;\n\t}", "public static <V extends Comparable<? super V>> V maxValueKey(List<V> list)\n\t{\n\t\tCollections.sort(list);\n\t\treturn list.get(list.size() - 1);\n\t}", "java.lang.String getAuthorities(int index);", "@Test()\n public void testGetBiggestPerYear() {\n\tYear year = Year.of(2015);\n\tList<Expense> list = expenseManager.getBiggestPerYear(year);\n\tassertEquals(\"gas\", list.get(0).getName());\n }", "public static int mostRestrictiveLoc(int location1, int location2) {\n if (location1 == location2) {\n return location1;\n } else if (Mech.restrictScore(location1) >= Mech.restrictScore(location2)) {\n return location1;\n } else {\n return location2;\n }\n }", "public MediaFile getBiggestMediaFile(MediaFileType... types) {\n MediaFile mf = null;\n\n readWriteLock.readLock().lock();\n for (MediaFile mediaFile : mediaFiles) {\n for (MediaFileType type : types) {\n if (mediaFile.getType().equals(type)) {\n if (mf == null || mediaFile.getFilesize() >= mf.getFilesize()) {\n mf = mediaFile;\n }\n }\n }\n }\n readWriteLock.readLock().unlock();\n return mf;\n }", "public void maxHeapify(int i){\n\t\tint left, right, largest;\n\t\tKeyword temp;\n\t\tleft=2*i;\n\t\tright=2*i+1;\n\t\tif(left<=heapSize){\n\t\t\tif(keywords[left].keyword.equalsIgnoreCase(keywords[i].keyword)){\t\t//if keywords of the two Keyword objects are equal\n\t\t\t\tif(keywords[left].pageNo.compareTo(keywords[i].pageNo)>0){\t//comparing pageNo of the Keyword objects\n\t\t\t\t\tlargest=left;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tlargest=i;\n\t\t\t}\n\t\t\telse if(keywords[left].keyword.compareToIgnoreCase(keywords[i].keyword)>0){\n\t\t\t\tlargest=left;\n\t\t\t}\n\t\t\telse \n\t\t\t\tlargest = i;\n\t\t}\n\t\t\n\t\telse \n\t\t\tlargest =i;\n\t\t\n\t\tif(right<=heapSize){\n\t\t\tif(keywords[right].keyword.equalsIgnoreCase(keywords[largest].keyword)){\t//if keywords of the two Keyword objects are equal\n\t\t\t\tif(keywords[right].pageNo.compareTo(keywords[largest].pageNo)>0){\t//comparing pageNo of the Keyword object\n\t\t\t\t\tlargest=right;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(keywords[right].keyword.compareToIgnoreCase(keywords[largest].keyword)>0)\n\t\t\t\tlargest=right;\n\t\t}\n\t\t\n\t\tif (largest!=i){\n\t\t\ttemp=keywords[i];\n\t\t\tkeywords[i]=keywords[largest];\n\t\t\tkeywords[largest]=temp;\n\t\t\tmaxHeapify(largest);\n\t\t}\n\t}", "private Request findLastRequest(Set<FeedProvider> provider, Map<Request,Set<FeedProvider>> lastRequests) {\n Request r = null;\n for (Entry<Request, Set<FeedProvider>> entry:lastRequests.entrySet()) {\n if (entry.getValue() == provider) {\n r = entry.getKey();\n break;\n }\n }\n \n return r;\n }", "public int findHighestScore() {\n int highest = 0;\n for (int i = 0; i < allQuizTakers.size(); i++) {\n\n if (allQuizTakers.get(i).getScore(0).compareTo(highest) > 0) {\n highest = (int) allQuizTakers.get(i).getScore(0);\n }\n\n }\n return highest;\n }", "private int[] getHighestPricesInTerm(int[] prices){\n int highest = -1;\n int index = -1;\n for(int i=0;i<prices.length;i++){\n if(prices[i]>highest){\n highest = prices[i];\n index = i;\n }\n }\n return new int[]{highest,index};\n }", "public abstract Key getLargest();", "public static List<Course> getCourseMaxAvrScr1(List<Course> courseList){\n return courseList.\n stream().\n sorted(Comparator.comparing(Course::getAverageScore).\n reversed()).limit(1).collect(Collectors.toList());\n }", "private int getLastIDRisposte() {\n\n\t\tArrayList<Integer> risposteIdList = new ArrayList<>();\n\t\trisposteIdList.add(0);\n\t\tDB db = getDB();\t\t\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"risposte\");\n\t\t\n\t\tfor(Map.Entry<Long, Risposta> risposta : risposte.entrySet())\n\t\t\tif(risposta.getValue() instanceof Risposta)\n\t\t\t\trisposteIdList.add(risposta.getValue().getId());\n\t\t\n\t\tInteger id = Collections.max(risposteIdList);\n\t\treturn id;\n\t}", "public Set getPages () {\n return new TreeSet (allPages.values ());\n }", "public Contenedor getContenedorMaximo()\n {\n Contenedor maxCont = null;\n int maxPeso ;\n\n maxPeso = 0;\n\n for (Contenedor c : this.losContenedores){\n if (c.peso > maxPeso)\n {\n maxPeso = c.peso;\n maxCont = c;\n }\n }\n\n return maxCont;\n }", "static long maximumPeople(long[] p, long[] x, long[] y, long[] r) {\n city[] allCity = new city[n];\n for(int i = 0; i < n; i++)\n allCity[i] = new city(p[i], x[i]);\n Arrays.sort(allCity);\n for(int i = 0; i < m; i++){\n long start = y[i] - r[i];\n long end = y[i] + r[i];\n int startindex = Arrays.binarySearch(allCity, new city(0, start));\n if(startindex < 0)\n startindex = - startindex - 1;\n else{\n long value = allCity[startindex].loc;\n while(true){\n startindex--;\n if(startindex < 0)\n break;\n if(allCity[startindex].loc != value)\n break;\n }\n startindex++;\n }\n int endindex = Arrays.binarySearch(allCity, new city(0, end));\n if(endindex < 0)\n endindex = -endindex - 2;\n else{\n long value = allCity[endindex].loc;\n while(true){\n endindex++;\n if(endindex >= n)\n break;\n if(allCity[endindex].loc != value)\n break;\n }\n endindex--;\n }\n for(int j = startindex; j <= endindex; j++){\n if(j >= n)\n break;\n allCity[j].clouds.add(i);\n }\n }\n int prev = -1;\n long sunny = 0;\n long max = 0;\n long accu = 0;\n for(int i = 0; i < n; i++){\n if(allCity[i].clouds.size() == 0)\n sunny += allCity[i].population;\n if(allCity[i].clouds.size() == 1){\n if(allCity[i].clouds.get(0) == prev){\n accu += allCity[i].population;\n if(accu > max)\n max = accu;\n }\n else {\n accu = allCity[i].population;\n prev = allCity[i].clouds.get(0);\n if(accu > max)\n max = accu;\n }\n }\n }\n return max + sunny;\n }", "public Integer returnMaxDocumentId(String library_id, String sublibrary_id) {\n Session session = HibernateUtil.getSessionFactory().openSession();\n Integer maxbiblio=null;\n try {\n session.beginTransaction();\n\n Criteria criteria = session.createCriteria(DocumentDetails.class);\n Criterion a = Restrictions.eq(\"id.libraryId\", library_id);\n Criterion b = Restrictions.eq(\"id.sublibraryId\", sublibrary_id);\n LogicalExpression le = Restrictions.and(a, b);\n maxbiblio = (Integer) criteria.add(le).setProjection(Projections.max(\"id.documentId\")).uniqueResult();\n if (maxbiblio == null) {\n maxbiblio = 1;\n } else {\n maxbiblio++;\n }\nsession.getTransaction().commit();\n \n } catch(Exception e){\n e.printStackTrace();\n }\n finally {\n session.close();\n }\n return maxbiblio;\n }", "private static ImageFile mostTaggedImage()\n {\n ImageFile currentMostTaggedImage;\n currentMostTaggedImage = Log.allImages.get(0);\n for (ImageFile i : Log.allImages)\n {\n if (i.tagList.size() > currentMostTaggedImage.tagList.size())\n {\n currentMostTaggedImage = i;\n }\n }\n return currentMostTaggedImage;\n }", "public static int max3(int a, int b, int c) {\r\n\t\t// Implement!\r\n\t\tint[] values = new int[3];\r\n\t\tvalues[0] = c;\r\n\t\tvalues[1] = a;\r\n\t\tvalues[2] = b;\r\n\r\n\t\tArrays.sort(values);\r\n\t\treturn values[2];\r\n\t}", "public static void function4(Set<String> stringSet) {\n System.out.println(\"4 - The maximum (the last in alphabetical order) string in the list is:\");\n System.out.println(stringSet.stream().max(Comparator.comparing(String::toString)).get());\n }", "public PublicationPermission getAlternativeRightFromSearchResults(PublicationPermission pubPerm, int licenseeClass, Date pubDate) {\n //objective: find the PublicationPermission in the search results that matches the arguments supplied.\n Publication publication = pubPerm.getPublication();\n UsageDescriptor usageDescriptor = pubPerm.getUsageDescriptor();\n \n Publication[] searchResult = UserContextService.getSearchState().getSearchResults().getResultSet();\n //iterate over the search results looking for a matching publication\n for (int i=0; i<searchResult.length; i++) {\n if (searchResult[i].getWrkInst() == publication.getWrkInst()) { \n //found the pub, now retrieve the permissions that match the usageDescriptor\n PublicationPermission[] perms = searchResult[i].getPublicationPermissions(usageDescriptor.getTypeOfUse(), licenseeClass);\n //permissions retrieved, now find the one that matches the licenseeClass\n for (int j=0; j<perms.length; j++) {\n if ((perms[j].getUsageDescriptor().getTypeOfUse()==usageDescriptor.getTypeOfUse()) &&\n (perms[j].getLicenseeClass() == licenseeClass) &&\n (perms[j].getPubBeginDate().before(pubDate)) &&\n (perms[j].getPubEndDate().after(pubDate)))\n {\n return perms[j];\n }\n }\n }\n }\n \n return pubPerm;\n }", "private String checkOldestChoreInList(List<Chore> histChores) {\n \t\n \tif(histChores.size() == 0){\n \t\treturn null;\n \t}\n \t \n \t\tCollections.sort(histChores, new DeadlineComparator());\n\t\treturn histChores.get(0).getId();\n \t}", "int getLastItemOnPage();", "private static WorkFrame Wf_getPrior(Set<WorkFrame> activeWorkFrames) {\n\t\tint maxPri = 0;\n\t\tif (activeWorkFrames.size() == 0) return null;\n\t\t//find the wf with the highest priority\n\t\tfor (WorkFrame wf : activeWorkFrames) {\n\t\t\tif (wf.getPriority() > 0) {\n\t\t\t\tmaxPri = updateMaxPriority(wf.getPriority(), maxPri);\n\t\t\t\tcontinue;\n\t\t\t} \n\t\t\t//get the priority from the activities \n\t\t\tint maxActPri = 0;\n\t\t\tfor (Event event : wf.getEvents()) {\n\t\t\t\tif (!(event instanceof EventActivity))\tcontinue;\n\n\t\t\t\tActivity tmpAct = getActivity(b, (EventActivity) event);\n\t\t\t\t//maxActPri = updateMaxPriority(tmpAct.getPriority(b), maxActPri);\n\t\t\t}\n\t\t\twf.setPriority(maxActPri);\n\t\t\tmaxPri = updateMaxPriority(wf.getPriority(), maxPri);\n\n\t\t}\n\t\tList<WorkFrame> highestPriorityFrames = new ArrayList<WorkFrame>();\n\t\tfor(WorkFrame wfFrame : activeWorkFrames) {\n\t\t\tif(wfFrame.getPriority() != maxPri) continue;\n\t\t\thighestPriorityFrames.add(wfFrame);\n\t\t}\n\t\t\n\t\tint index = Utils.getHighestPriorityFrameIndex(highestPriorityFrames.size());\n\t\tif (index < 0)\n\t\t\treturn null;\n\t\n\t\treturn highestPriorityFrames.get(index);\n\t}", "public int maxNumber(){\n int highest = 0;\n ArrayList<String> currentFileList = null;\n for (String word : hashWords.keySet()) {\n currentFileList= hashWords.get(word);\n int currentNum = currentFileList.size();\n if (currentNum > highest) {\n highest = currentNum;\n }\n // System.out.println(\"currentFileList \" + currentFileList +\"highest num = \"+ highest );\n }\n \n return highest;\n /*for (ArrayList s : hashWords.values()){\n if (s.size() > maxSize) {\n maxSize = s.size();\n }\n }\n return maxSize;*/\n }" ]
[ "0.49765536", "0.49695158", "0.4959375", "0.4909228", "0.489135", "0.47644952", "0.47401568", "0.47254455", "0.47134325", "0.4663827", "0.46610275", "0.464504", "0.46361732", "0.46245176", "0.4622371", "0.4597477", "0.45934567", "0.45929152", "0.458695", "0.45749125", "0.4566792", "0.4565008", "0.455542", "0.4549374", "0.4545661", "0.45443255", "0.45286983", "0.45189902", "0.44821683", "0.44803387", "0.44424292", "0.44388944", "0.44348785", "0.44201565", "0.44196773", "0.44087002", "0.44062743", "0.44017777", "0.4400834", "0.43949378", "0.4389687", "0.43890426", "0.43880874", "0.43847713", "0.43834406", "0.4366769", "0.43561605", "0.4346527", "0.43377385", "0.4334869", "0.43288785", "0.43273863", "0.43192562", "0.43163192", "0.4314633", "0.43141654", "0.43015787", "0.429772", "0.42962041", "0.42873713", "0.42852414", "0.42814046", "0.42774427", "0.42715472", "0.427021", "0.42660213", "0.42640993", "0.42639816", "0.42636827", "0.42617157", "0.42588696", "0.42575544", "0.4249084", "0.42398667", "0.4234839", "0.42319605", "0.42280605", "0.42277664", "0.4223861", "0.42209345", "0.42182595", "0.42164028", "0.4216229", "0.4212363", "0.4212018", "0.42077923", "0.42032322", "0.42020985", "0.420185", "0.41951582", "0.41902977", "0.41890508", "0.41856006", "0.41846415", "0.4184304", "0.418385", "0.41753125", "0.41751507", "0.41719854", "0.4171482" ]
0.7167735
0
Organize the list of pages according to their descending Hub scores.
public void sortHub(List<Page> result) { Collections.sort(result, new Comparator<Page>() { public int compare(Page p1, Page p2) { // Sorts by 'TimeStarted' property return p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2); } // If 'TimeStarted' property is equal sorts by 'TimeEnded' property public int secondaryOrderSort(Page p1, Page p2) { return p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1 : p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Page> normalize(List<Page> pages) {\n\t\tdouble hubTotal = 0;\n\t\tdouble authTotal = 0;\n\t\tfor (Page p : pages) {\n\t\t\t// Sum Hub scores over all pages\n\t\t\thubTotal += Math.pow(p.hub, 2);\n\t\t\t// Sum Authority scores over all pages\n\t\t\tauthTotal += Math.pow(p.authority, 2);\n\t\t}\n\t\t// divide all hub and authority scores for all pages\n\t\tfor (Page p : pages) {\n\t\t\tif (hubTotal > 0) {\n\t\t\t\tp.hub /= hubTotal;\n\t\t\t} else {\n\t\t\t\tp.hub = 0;\n\t\t\t}\n\t\t\tif (authTotal > 0) {\n\t\t\t\tp.authority /= authTotal;\n\t\t\t} else {\n\t\t\t\tp.authority = 0;\n\t\t\t}\n\t\t}\n\t\treturn pages; // with normalised scores now\n\t}", "public void sortScoresDescendently(){\n this.langsScores.sort((LangScoreBankUnit o1, LangScoreBankUnit o2) -> {\n return Double.compare(o2.getScore(),o1.getScore());\n });\n }", "public void report(List<Page> result) {\n\n\t\t// Print Pages out ranked by highest authority\n\t\tsortAuthority(result);\n\t\tSystem.out.println(\"AUTHORITY RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.authority);\n\t\tSystem.out.println();\n\t\t// Print Pages out ranked by highest hub\n\t\tsortHub(result);\n\t\tSystem.out.println(\"HUB RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.hub);\n\t\tSystem.out.println();\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Authority score: \" + getMaxAuthority(result).getLocation());\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Hub score: \" + getMaxAuthority(result).getLocation());\n\t}", "public Iterator rankOrdering(Iterator pages)\n\t{\n\t\t//Iterator allWebNode = ind.retrievePages(keyword);\n\t\tIterator allWebNode = pages;\n\t\tif(allWebNode.hasNext()){\n\t\t\tWebNode wb = (WebNode) allWebNode.next();\n\t\t\tint score = wb.getInDegree() * wb.getWordFreq(keyword);\n\t\t\twb.keywordScore = score;\n\t\t\taL.add(wb); \n\t\t}\n\t\t\n\t\twhile (allWebNode.hasNext()) {\n\t\t\tWebNode nwb = (WebNode) allWebNode.next();\n\t\t\tint nscore = nwb.getInDegree() * nwb.getWordFreq(keyword);\n\t\t\tnwb.keywordScore = nscore;\n\t\t\tint i = 0; \n\t\t\twhile(i<aL.size()){\n\t\t\t\tif (nwb.keywordScore < ((WebNode) aL.get(i)).keywordScore)\n\t\t\t \ti++;\n\t\t\t else\n\t\t\t \taL.add(i,nwb);\n\t\t\t} \n\t\t}\n\t\t\n\t\treturn aL.iterator();\n\t}", "public void sortScores(){\r\n // TODO: Use a single round of bubble sort to bubble the last entry\r\n // TODO: in the high scores up to the correct location.\r\n \tcount=0;\r\n \tfor(int i=Settings.numScores-1; i>0;i--){\r\n \t\tif(scores[i]>scores[i-1]){\r\n \t\t\tint tempS;\r\n \t\t\ttempS=scores[i];\r\n \t\t\tscores[i]=scores[i-1];\r\n \t\t\tscores[i-1]=tempS;\r\n \t\t\t\r\n \t\t\tString tempN;\r\n \t\t\ttempN=names[i];\r\n \t\t\tnames[i]=names[i-1];\r\n \t\t\tnames[i-1]=tempN;\r\n \t\t\tcount++;\r\n \t\t}\r\n \t}\r\n }", "public void sortHighscores(){\n Collections.sort(highscores);\n Collections.reverse(highscores);\n }", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "List<SurveyQuestion> sortByPageAndPosition(List<SurveyQuestion> questions);", "private void sortPlayerScores(){\n text=\"<html>\";\n for (int i = 1; i <= Options.getNumberOfPlayers(); i++){\n if(Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey() != null){\n Integer pl = Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey();\n if(pl != null && playerScores.containsKey(pl)){\n text += \"<p>Player \" + pl + \" Scored : \" + playerScores.get(pl) + \" points </p></br>\";\n playerScores.remove(pl);\n }\n }\n }\n text += \"</html>\";\n }", "private void sortEScores() {\n LinkedHashMap<String, Double> sorted = eScores\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n eScores = sorted;\n }", "public void sortHighScores(){\n for(int i=0; i<MAX_SCORES;i++){\n long score = highScores[i];\n String name= names[i];\n int j;\n for(j = i-1; j>= 0 && highScores[j] < score; j--){\n highScores[j+1] = highScores[j];\n names[j+1] = names[j];\n }\n highScores[j+1] = score;\n names[j+1] = name;\n }\n }", "public void createSummary(){\n\n for(int j=0;j<=noOfParagraphs;j++){\n int primary_set = paragraphs.get(j).sentences.size()/5;\n\n //Sort based on score (importance)\n Collections.sort(paragraphs.get(j).sentences,new SentenceComparator());\n for(int i=0;i<=primary_set;i++){\n contentSummary.add(paragraphs.get(j).sentences.get(i));\n }\n }\n\n //To ensure proper ordering\n Collections.sort(contentSummary,new SentenceComparatorForSummary());\n printSummary();\n }", "public void sortAuthority(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "public void assignPageRanks(double epsilon) {\r\n\t\t// TODO : Add code here\r\n\t\tArrayList<String> vertices=internet.getVertices();\r\n\t\tList<Double> currentRank=Arrays.asList(new Double[vertices.size()]);\r\n\t\tCollections.fill(currentRank,1.0);\r\n\r\n\t\tdo{\r\n\t\t\tfor(int i=0;i<vertices.size();i++){\r\n\t\t\t\tinternet.setPageRank(vertices.get(i),currentRank.get(i));\r\n\t\t\t}\r\n\t\t\tcurrentRank=computeRanks(vertices);\r\n\t\t}while (!stopRank(epsilon,currentRank,vertices));\r\n\r\n\t}", "private void sortArticlesByRating() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"Ratings\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Map<Double,ArrayList<Article>> articlesTreeMap;\n articlesTreeMap = new TreeMap<>(Collections.reverseOrder());\n for(Article a : articles) {\n DataSnapshot ratingArticleSnapShot = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if (a.getLink() != null && a.getLink() != \"\" && snapshot.child(\"Link\").getValue().equals(a.getLink())) {\n ratingArticleSnapShot = snapshot;\n break;\n }\n }\n Double rating = 0.0;\n if (ratingArticleSnapShot != null) {\n int totalVoteCount = 0, weightedSum = 0;\n for(int i=1 ;i<=5 ;i++) {\n int numberOfVotes = Integer.parseInt(ratingArticleSnapShot.child(\"Votes\").child(String.valueOf(i)).getValue().toString());\n weightedSum += (i * numberOfVotes);\n totalVoteCount += numberOfVotes;\n }\n rating = ((double) weightedSum) / ((double) totalVoteCount);\n }\n if(!articlesTreeMap.containsKey(rating)) {\n articlesTreeMap.put(rating, new ArrayList<Article>());\n }\n articlesTreeMap.get(rating).add(a);\n }\n\n articles.clear();\n for(Map.Entry<Double,ArrayList<Article>> entry : articlesTreeMap.entrySet()) {\n ArrayList<Article> list = entry.getValue();\n articles.addAll(list);\n }\n mSectionsPagerAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "public void sortByPopularity() {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByPopularity\");\n\n listInteractor.sortByPopularity(new ListCallback() {\n @Override\n public void setPhotosList(List<BasePojo.Result> photosList) {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - ListCallback - setPhotosList\");\n getViewState().setData(photosList);\n }\n });\n }", "public List<Page> hits(String query) {\n\t\t// pages <- EXPAND-PAGES(RELEVANT-PAGES(query))\n\t\tList<Page> pages = expandPages(relevantPages(query));\n\t\t// for each p in pages\n\t\tfor (Page p : pages) {\n\t\t\t// p.AUTHORITY <- 1\n\t\t\tp.authority = 1;\n\t\t\t// p.HUB <- 1\n\t\t\tp.hub = 1;\n\t\t}\n\t\t// repeat until convergence do\n\t\twhile (!convergence(pages)) {\n\t\t\t// for each p in pages do\n\t\t\tfor (Page p : pages) {\n\t\t\t\t// p.AUTHORITY <- &Sigma<sub>i</sub> INLINK<sub>i</sub>(p).HUB\n\t\t\t\tp.authority = SumInlinkHubScore(p);\n\t\t\t\t// p.HUB <- &Sigma;<sub>i</sub> OUTLINK<sub>i</sub>(p).AUTHORITY\n\t\t\t\tp.hub = SumOutlinkAuthorityScore(p);\n\t\t\t}\n\t\t\t// NORMALIZE(pages)\n\t\t\tnormalize(pages);\n\t\t}\n\t\treturn pages;\n\n\t}", "private void sortScoreboard() {\n score.setSortType(TableColumn.SortType.DESCENDING);\n this.scoreboard.getSortOrder().add(score);\n score.setSortable(true);\n scoreboard.sort();\n }", "private void sortArticleByViews() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"Views\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Map<Integer,ArrayList<Article>> articlesTreeMap;\n articlesTreeMap = new TreeMap<>(Collections.reverseOrder());\n for(Article a : articles) {\n DataSnapshot viewArticleSnapShot = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if (a.getLink() != null && a.getLink() != \"\" && snapshot.child(\"Link\").getValue().equals(a.getLink())) {\n viewArticleSnapShot = snapshot;\n break;\n }\n }\n int views = 0;\n if (viewArticleSnapShot != null) {\n views = Integer.parseInt(viewArticleSnapShot.child(\"Count\").getValue().toString());\n }\n if(!articlesTreeMap.containsKey(views)) {\n articlesTreeMap.put(views, new ArrayList<Article>());\n }\n articlesTreeMap.get(views).add(a);\n }\n\n articles.clear();\n for(Map.Entry<Integer,ArrayList<Article>> entry : articlesTreeMap.entrySet()) {\n ArrayList<Article> list = entry.getValue();\n articles.addAll(list);\n }\n mSectionsPagerAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "public void sortPageList()\r\n {\r\n if (log.isDebugEnabled())\r\n {\r\n log.debug(\"[\" + this.id + \"] sorting page list\");\r\n }\r\n sortRowList(this.getRowListPage());\r\n\r\n }", "public void sortCompetitors(){\n\t\t}", "public void reduce ()\r\n {\r\n if (score.getPages().isEmpty()) {\r\n return;\r\n }\r\n\r\n /* Connect parts across the pages */\r\n connection = PartConnection.connectScorePages(pages);\r\n\r\n // Force the ids of all ScorePart's\r\n numberResults();\r\n\r\n // Create score part-list and connect to pages and systems parts\r\n addPartList();\r\n\r\n // Debug: List all candidates per result\r\n if (logger.isDebugEnabled()) {\r\n dumpResultMapping();\r\n }\r\n }", "public int compare(Page p1, Page p2) {\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}", "public int compare(Page p1, Page p2) {\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "private void sortOutlines() {\r\n Collections.sort(outlines, reversSizeComparator);\r\n }", "public static List<Double> sortScores(List<Double> results) {\n\t\t\n\t\t\n\t\tfor (int i = 0; i < results.size()-1; i++) {\n\t\t\tif (results.get(i)>results.get(i+1)) {\n\t\t\t\t//highScore = results.get(i);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tDouble temp = results.get(i);\n\t\t\t\t\n\t\t\t\tresults.set(i, results.get(i+1));\n\t\t\t\t\n\t\t\tresults.set(i+1, temp);\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t\t\n\t\treturn results;\n\t\t//return null;\n\t}", "public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}", "private void sortCourses() {\n ctrl.sortCourses().forEach(System.out::println);\n }", "public void sortChart() {\n\t\tPassengerTrain temp;\n\t\tGoodsTrain temp1;\n\n\t\tfor (int index = 0; index < TrainDetails.passengerList.size(); index++) {\n\t\t\tfor (int i = 0; i < TrainDetails.passengerList.size(); i++) {\n\t\t\t\tdouble totalTime1 = ((TrainDetails.passengerList).get(index).duration);\n\t\t\t\tdouble totalTime2 = (TrainDetails.passengerList.get(i).duration);\n\t\t\t\tif (totalTime1 < totalTime2) {\n\t\t\t\t\ttemp = TrainDetails.passengerList.get(index);\n\t\t\t\t\tTrainDetails.passengerList.set(index,\n\t\t\t\t\t\t\tTrainDetails.passengerList.get(i));\n\t\t\t\t\tTrainDetails.passengerList.set(i, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int index = 0; index < TrainDetails.goodsList.size(); index++) {\n\t\t\tfor (int i = 0; i < TrainDetails.goodsList.size(); i++) {\n\t\t\t\tdouble totalTime1 = ((TrainDetails.goodsList).get(index).duration);\n\t\t\t\tdouble totalTime2 = (TrainDetails.goodsList.get(i).duration);\n\t\t\t\tif (totalTime1 < totalTime2) {\n\t\t\t\t\ttemp1 = TrainDetails.goodsList.get(index);\n\t\t\t\t\tTrainDetails.goodsList.set(index,\n\t\t\t\t\t\t\tTrainDetails.goodsList.get(i));\n\t\t\t\t\tTrainDetails.goodsList.set(i, temp1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "void computePageRank(int num_iters){\n\t\t if(num_iters < 0) return;\n\t\t double rank[] = new double[numofvert]; // array that will hold the rank number\n\t\t double prevrank[] = new double[numofvert];\n\t\t int node[] = new int [numofvert];\n\t\t Arrays.fill(rank, 0);\n\t\t Arrays.fill(prevrank,1);\n\t\t RowHeadNode prevrow = dGraphin.getfirstRow();\n\t\t for(int i = 0; i < node.length;i++){//making node array\n\t\t\t node[i] = i;\n\t\t }\n\t\t if(num_iters == 0){\n\t\t\t Arrays.fill(rank,1);//return an array filled with ones\n\t\t\t print(rank,node);\n\t\t\t return;\n\t\t }\n\t\t for(int i = 0; i < num_iters;i++){\n\t\t\t RowHeadNode currentrow = dGraphin.getfirstRow();\n\t\t\t while (currentrow != null){\n\t\t\t\t rank[currentrow.getRowidx()] = currentrow.getPR(prevrank,outdegree);//pagerank function\n\t\t\t\t prevrow = currentrow;\n\t\t\t\t currentrow = currentrow.getNextRow();//increment row\n\t\t\t }\n\t\t\t for(int c = 0; c < numofvert;c++)// put rank values into the prevrank array\n\t\t\t\t prevrank[c] = rank[c];\n\t\t }\n\t\t \n\t\t selectionSort(prevrank,node,numofvert);// sort arrays based on calculated pagerank\n\t\t print(prevrank,node);\n\t\t return;\n\t }", "public void sort()\n {\n com.jayway.restassured.response.Response response= given().relaxedHTTPSValidation().when().get(\"http://18.222.188.206:3333/accounts?_sort=title&_order=asc\");\n response.then().assertThat().statusCode(200);\n System.out.println(\"The accounts that are sorted according to it's title is displayed below:\");\n response.prettyPrint();\n \n }", "List<List<SurveyQuestionDTO>> getSortedDtosByPage(List<SurveyQuestion> questions);", "public static void sortByFitlvl() {\n Collections.sort(Population);\n if (debug) {\n debugLog(\"\\nSorted: \");\n printPopulation();\n }\n }", "public void scoreSorting(SortingQuiz scoringMethod, SortingSample s) {\r\n for(int i=1; i<=s.answers.size(); i++) {\r\n HourGlass scores = new HourGlass();\r\n scores.weightAnswer(scoringMethod.answers.get(s.getAnswerNum(i)));\r\n System.out.println(scores);\r\n// this.scores.weightAnswer(scoringMethod.answers.get(s.getAnswerNum(i)));\r\n }\r\n }", "public void writeList() {\n\n HeapSort heapSort = new HeapSort();\n heapSort.sort(list);\n\n// QuickSort quickSort = new QuickSort();\n// quickSort.sort(list);\n\n// MergeSort mergeSort = new MergeSort();\n// mergeSort.sortNumbers(list);\n\n System.out.println(\"Result of sorting :\");\n list.stream().forEach(s -> System.out.println(s));\n }", "public void sort() {\n documents.sort();\n }", "private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }", "void comparatorSort() {\n Collections.sort(vendor, Vendor.sizeVendor); // calling collection sort method and passing list and comparator variables\r\n for (HDTV item : vendor) { //looping arraylist\r\n System.out.println(\"Brand: \" + item.brandname + \" Size: \" + item.size);\r\n }\r\n }", "@Override\n public void sort() {\n int cont = 0;\n int mov = 0;\n for (int i = 0; i < (100 - 1); i++) {\n int menor = i;\n for (int j = (i + 1); j < 100; j++){\n if (array[menor] > array[j]){\n cont= cont + 1;\n menor = j;\n mov = mov + 1;\n }\n }\n swap(menor, i);\n mov = mov + 3;\n }\n System.out.println(cont + \" comparações\");\n System.out.println(mov + \" Movimenteções\");\n }", "private static List<MoneyLoss> sortLosses(Collection<MoneyLoss> unsortedLosses)\n {\n //Sort budget items first on frequency and then alphabetically\n ArrayList<MoneyLoss> oneTimeItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> dailyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> weeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> biweeklyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> monthlyItems = new ArrayList<MoneyLoss>();\n ArrayList<MoneyLoss> yearlyItems = new ArrayList<MoneyLoss>();\n\n for (MoneyLoss loss : unsortedLosses)\n {\n switch (loss.lossFrequency())\n {\n case oneTime:\n {\n oneTimeItems.add(loss);\n break;\n }\n case daily:\n {\n dailyItems.add(loss);\n break;\n }\n case weekly:\n {\n weeklyItems.add(loss);\n break;\n }\n case biWeekly:\n {\n biweeklyItems.add(loss);\n break;\n }\n case monthly:\n {\n monthlyItems.add(loss);\n break;\n }\n case yearly:\n {\n yearlyItems.add(loss);\n break;\n }\n }\n }\n\n Comparator<MoneyLoss> comparator = new Comparator<MoneyLoss>() {\n @Override\n public int compare(MoneyLoss lhs, MoneyLoss rhs) {\n return lhs.expenseDescription().compareTo(rhs.expenseDescription());\n }\n };\n\n Collections.sort(oneTimeItems, comparator);\n Collections.sort(dailyItems, comparator);\n Collections.sort(weeklyItems, comparator);\n Collections.sort(biweeklyItems, comparator);\n Collections.sort(monthlyItems, comparator);\n Collections.sort(yearlyItems, comparator);\n\n ArrayList<MoneyLoss> sortedItems = new ArrayList<MoneyLoss>();\n BadBudgetApplication.appendItems(sortedItems, oneTimeItems);\n BadBudgetApplication.appendItems(sortedItems, dailyItems);\n BadBudgetApplication.appendItems(sortedItems, weeklyItems);\n BadBudgetApplication.appendItems(sortedItems, biweeklyItems);\n BadBudgetApplication.appendItems(sortedItems, monthlyItems);\n BadBudgetApplication.appendItems(sortedItems, yearlyItems);\n\n return sortedItems;\n }", "private static void rankCourses() {\r\n\t\tfor (String subject : courses.keySet()) {\r\n\t\t\tLinkedList<Course> subjectCourses = courses.get(subject);\r\n\t\t\tfor (int i = 1; i <= 8; i++) {\r\n\t\t\t\tswitch (i) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\t// Subject rank\r\n\t\t\t\t\tintRanker(1, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\t// Student satisfaction\r\n\t\t\t\t\tintRanker(2, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\t// Nationwide ranking\r\n\t\t\t\t\tdoubleRanker(3, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\t// Cost of living\r\n\t\t\t\t\tdoubleRanker(4, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\t// Student to faculty ratio\r\n\t\t\t\t\tdoubleRanker(5, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\t// Research Output\r\n\t\t\t\t\tintRanker(6, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\t// International students\r\n\t\t\t\t\tdoubleRanker(7, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 8:\r\n\t\t\t\t\t// Graduate prospects\r\n\t\t\t\t\tdoubleRanker(8, subjectCourses);\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 createSortLink() {\n\n String newGrouping;\n\n if (\"plugin\".equals(grouping)) {\n newGrouping = \"publisher\";\n } else {\n newGrouping = \"plugin\";\n }\n String timeString = \"\";\n if (\"accurate\".equals(timeKey)) {\n timeString = \"&amp;timeKey=\" + timeKey;\n }\n\n String linkHref = \"/DisplayContentStatus?group=\" + newGrouping + timeString;\n String linkText = \"Order by \" + newGrouping;\n Link sortLink = new Link(linkHref);\n sortLink.attribute(\"class\", \"filters\");\n sortLink.add(linkText);\n page.add(sortLink);\n }", "public void sortPriceDescending() throws Exception {\n\n WebDriverWait wait=new WebDriverWait(driver, 20);\n WebElement dropdownList = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(\"//option[@value='prce-desc']\")));\n dropdownList.click();\n\n Thread.sleep(5000);\n\n JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver;\n javascriptExecutor.executeScript(\"window.scrollBy(0,300)\");\n List<WebElement> price = driver.findElements(By.xpath(\"//span[@class='price ']\"));\n\n String priceListString;\n List<String> priceArrayList =new ArrayList<>();\n\n for (int i = 0; i < price.size(); i = i + 1) {\n\n priceListString = price.get(i).getText();\n\n String trimPriceListString = priceListString.replaceAll(\"Rs. \",\"\");\n String commaRemovedPriceList= trimPriceListString.replaceAll(\",\",\"\");\n priceArrayList.add(commaRemovedPriceList);\n\n }\n ArrayList<Float> priceList = new ArrayList<Float>();\n for (String stringValue : priceArrayList) {\n priceList.add(Float.parseFloat(stringValue));\n }\n if (descendingCheck(priceList)) {\n Reports.extentTest.log(Status.PASS, \"Verified Items displayed as Highest Price first \", MediaEntityBuilder.createScreenCaptureFromPath(takeScreenshot()).build());\n\n }\n else{\n Assert.fail(\"Item price not in descending order\");\n Reports.extentTest.log(Status.FAIL, \"Verified Items not displayed as Highest Price first \", MediaEntityBuilder.createScreenCaptureFromPath(takeScreenshot()).build());\n\n }\n\n }", "private void displayStudentByGrade() {\n\n studentDatabase.sortArrayList();\n\n for (Student student : studentDatabase) {\n\n stdOut.println(student.toStringsort() + \"\\n\");\n }\n }", "ArrayList<String> getScoreContent(String order) {\n ArrayList<String> ids = new ArrayList<>();\n String name = \"\";\n String score = \"\";\n if (order.equals(\"Ascending\")) {\n for (Object o : topScores.keySet().toArray()) {\n name = name + o.toString() + \"\\r\\n\";\n }\n for (Object o : topScores.values().toArray()) {\n score = score + o.toString() + \"\\r\\n\";\n }\n } else if (order.equals(\"Descending\")) {\n for (Object o : topScores.keySet().toArray()) {\n name = o.toString() + \"\\r\\n\" + name;\n }\n for (Object o : topScores.values().toArray()) {\n score = o.toString() + \"\\r\\n\" + score;\n }\n }\n ids.add(name);\n ids.add(score);\n return ids;\n }", "public void triCollection(){\r\n Collections.sort(collection);\r\n }", "private static void sortSlidesByNumberTags() {\n\t\tCollections.sort(slideList, new Comparator<Slide>() {\n\t\t\tpublic int compare(Slide s1, Slide s2) {\n\n\t\t\t\tInteger sS1 = s1.getTagList().size();\n\t\t\t\tInteger sS2 = s2.getTagList().size();\n\n\t\t\t\tint sComp = sS1.compareTo(sS2);\n\n\t\t\t\treturn -1 * sComp;\n\t\t\t}\n\t\t});\n\t}", "public Page getMaxHub(List<Page> result) {\n\t\tPage maxHub = null;\n\t\tfor (Page currPage : result) {\n\t\t\tif (maxHub == null || currPage.hub > maxHub.hub)\n\t\t\t\tmaxHub = currPage;\n\t\t}\n\t\treturn maxHub;\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate static ArrayList<Result> sortByScore(ArrayList<Result> sortThis){\n\t\tArrayList<Result> sorted = sortThis;\n\t\tCollections.sort(sorted, new Comparator(){\n\t\t\t\n\t\t\tpublic int compare(Object o1, Object o2){\n\t\t\t\tResult r1 = (Result) o1;\n\t\t\t\tResult r2 = (Result) o2;\n\n\t\t\t\tDouble Score1 = new Double(r1.getScore());\n\t\t\t\tDouble Score2 = new Double(r2.getScore());\n\t\t\t\treturn Score1.compareTo(Score2);\n\t\t\t}\n\t\t});\n\t\tCollections.reverse(sorted);\n\t\t\n\t\treturn sorted;\n\t}", "private List<? extends Publication> sortPublicationsAfterTitle(Collection<? extends Publication> publicationList) {\n\n return publicationList.stream().sorted(Comparator.comparing(Publication::getTitle)).collect(Collectors.toList());\n }", "public static Student[] sortScore( Student s[]){\n\t\tStudent temp ;\r\n\t\tfor(int i=0; i<s.length; i++){\r\n\t\t\tfor(int j=i+1; j<s.length;j++)\r\n\t\t\t\tif(s[i].score > s[j].score){\r\n\t\t\t\t\ttemp = s[i];\r\n\t\t\t\t\ts[i] = s[j];\r\n\t\t\t\t\ts[j]= temp;\r\n\t\t\t\t} \t\t\t\r\n\t\t\t}\r\n\t\t\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Students with score<50 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score<50){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Students with score>=50 and <65 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=50 && s[i].score<65){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Students with score>=65 and <80 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=65 && s[i].score<80){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Students with score>=80 and <100 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=80 && s[i].score<=100){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn s;\r\n\r\n\r\n\t}", "public void sortByAndser() {\r\n\t\tQuestion[][] question2DArray = new Question[displayingList.size()][];\r\n\t\tfor (int i = 0; i < displayingList.size(); i++) {\r\n\t\t\tquestion2DArray[i] = new Question[1];\r\n\t\t\tquestion2DArray[i][0] = displayingList.get(i);\r\n\t\t}\r\n\r\n\t\twhile (question2DArray.length != 1) {\r\n\t\t\tquestion2DArray = (Question[][]) merge2DArray(question2DArray);\r\n\t\t}\r\n\t\tdisplayingList.removeAll(displayingList);\r\n\t\tfor (int i = 0; i < question2DArray[0].length; i++) {\r\n\t\t\tdisplayingList.add(question2DArray[0][i]);\r\n\t\t}\r\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void sortDocumentsByDocnos() {\n order = new int[mDocSet.length];\n mDocSet_tmp = new double[mDocSet.length];\n accumulated_scores_tmp = new float[mDocSet.length];\n\n for (int i = 0; i < order.length; i++) {\n order[i] = i;\n mDocSet_tmp[i] = mDocSet[i];\n accumulated_scores_tmp[i] = accumulated_scores[i];\n }\n\n ivory.smrf.model.constrained.ConstraintModel.Quicksort(mDocSet_tmp, order, 0, order.length - 1);\n\n for (int i = 0; i < order.length; i++) {\n mDocSet[i] = (int) mDocSet_tmp[i];\n accumulated_scores[i] = accumulated_scores_tmp[order[i]];\n }\n }", "private void generateOutgoingRankingReport() {\r\n\r\n\t\tStringBuilder stringBuilder = new StringBuilder();\r\n\t\tstringBuilder.append(\"\\n----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Outgoing Ranking \\n\")\r\n\t\t\t\t.append(\"----------------------------------------\\n\")\r\n\t\t\t\t.append(\" Entity | Rank \\n\")\r\n\t\t\t\t.append(\"-----------------+----------------------\\n\");\r\n\t\tallOutgoingRankings.entrySet().stream().sorted(Map.Entry.<String, Integer>comparingByValue())\r\n\t\t\t\t.forEach(key -> stringBuilder\r\n\t\t\t\t\t\t.append(\" \" + key.getKey() + \" | \" + key.getValue() + \" \\n\"));\r\n\t\tdataWriter.write(stringBuilder.toString());\r\n\t}", "public Page[] sortPagesByRelevance(String query, ArrayList<Page> pages) {\n\t\tArrayList<Page> result = new ArrayList<Page>();\n\t\tfor (Page page : pages) {\n\t\t\tpage.setRelevance(calculatePageRelevance(query, page));\n\t\t}\n\t\t\n\t\tpages.sort(null);\n\t\t\n\t\tfor (int i = 0; i < MAX_QUERY_RESULT_COUNT; i++) {\n\t\t\tresult.add(pages.get(i));\n\t\t}\n\t\treturn result.toArray(new Page[MAX_QUERY_RESULT_COUNT]);\n\t}", "public void winner() {\n\t\tList<String> authors = new ArrayList<String>(scores_authors.keySet());\n\t\tCollections.sort(authors, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_authors.get(o1).compareTo(scores_authors.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des auteurs :\");\n\t\tfor(String a :authors) {\n\t\t\tSystem.out.println(a.substring(0,5)+\" : \"+scores_authors.get(a));\n\t\t}\n\t\t\n\t\tList<String> politicians = new ArrayList<String>(scores_politicians.keySet());\n\t\tCollections.sort(politicians, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_politicians.get(o1).compareTo(scores_politicians.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des politiciens :\");\n\t\tfor(String p :politicians) {\n\t\t\tSystem.out.println(p.substring(0,5)+\" : \"+scores_politicians.get(p));\n\t\t}\n\t}", "@Override\n public List getMostViewedPages(Long count, String orderBy) {\n log.debug(\"This fetches most viewed pages with count : {}\", count);\n TreeMap<String, Integer> responseMap = new TreeMap<>();\n HashMap<String, Integer> checkPagesMap = new HashMap<>();\n List<String> eventLabelList = csvRepository.findAllEventLabel();\n if (eventLabelList == null) {\n throw new CsvException(String.format(\"Event_label column is empty, please insert some records\"));\n }\n for (String cc : eventLabelList) {\n if (checkPagesMap.containsKey(cc)) {\n checkPagesMap.put(cc, checkPagesMap.get(cc)+1);\n } else {\n checkPagesMap.put(cc,1);\n }\n }\n List<String> listOfPages = new ArrayList<>();\n responseMap.putAll(checkPagesMap);\n for (int i = 1; i <= count; i++) {\n for (Map.Entry<String, Integer> entry : responseMap.entrySet()) {\n listOfPages.add(entry.getKey());\n }\n }\n log.debug(\"List of pages fetched successfully\");\n return listOfPages;\n }", "public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }", "@Override\r\n\tpublic List<String> getPageRank()\r\n\t{\r\n\r\n\t\tlogger.info(\"Getting PageRank...\");\r\n\t\tPageRank<Entity, EntityGraphEdge> ranker = new PageRank<Entity, EntityGraphEdge>(\r\n\t\t\t\tdirectedGraph, 0.15);\r\n\t\tlogger.info(\"Ranker was created.\");\r\n\t\tlogger.info(\"Evaluating...\");\r\n\t\tranker.evaluate();\r\n\r\n\t\tlogger.info(\"Got PageRank.\");\r\n\t\tCollection<Entity> vertices = directedGraph.getVertices();\r\n\t\tList<String> rankingList = new ArrayList<String>();\r\n\t\tFormat formatter = new DecimalFormat(\"%7.6f\");\r\n\r\n\t\tfor (Entity vertex : vertices) {\r\n\t\t\trankingList.add(formatter.format(ranker.getVertexScore(vertex))\r\n\t\t\t\t\t+ \" \" + vertex);\r\n\t\t\t// logger.info(\"PageRanking for \" + vertex.getVertexEntity() + \" : \"\r\n\t\t\t// + ranker.getRankScore(vertex));\r\n\t\t}\r\n\r\n\t\tCollections.sort(rankingList);\r\n\t\tCollections.reverse(rankingList);\r\n\t\t// logger.info(\"Sorted PageRankings: \" + rankingList);\r\n\t\t// ranker.printRankings(false, true);\r\n\r\n\t\treturn rankingList;\r\n\t}", "private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }", "List<Hybridization> searchByCriteria(PageSortParams<Hybridization> params, HybridizationSearchCriteria criteria);", "public List<String>top10Utilizadores() {\n Map<String,List<String>> utilizadorEncomendas = new HashMap<String,List<String>>();\n \n for(Encomenda e : this.encomendas.values()) {\n if(!utilizadorEncomendas.containsKey(e.getCodigoUtilizador())) {\n utilizadorEncomendas.put(e.getCodigoUtilizador(), new ArrayList<>());\n }\n utilizadorEncomendas.get(e.getCodigoUtilizador()).add(e.getCodigoEncomenda());\n }\n \n // a partir do primeiro map criar um segundo com codigo de utilizador e numero de encomendas\n // a razao de ser um double é porque o mesmo comparator é também utilizado no metodo List<String>top10Transportadores()\n Map<String,Double> utilizadoresNumeroEncs = new HashMap<>();\n \n Iterator<Map.Entry<String, List<String>>> itr = utilizadorEncomendas.entrySet().iterator(); \n \n while(itr.hasNext()) { \n Map.Entry<String, List<String>> entry = itr.next(); \n utilizadoresNumeroEncs.put(entry.getKey(), Double.valueOf(entry.getValue().size()));\n }\n \n MapStringDoubleComparator comparator = new MapStringDoubleComparator(utilizadoresNumeroEncs);\n \n // criar map ordenado (descending)\n TreeMap<String, Double> utilizadorNumeroEncsOrdenado = new TreeMap<String, Double>(comparator);\n \n utilizadorNumeroEncsOrdenado.putAll(utilizadoresNumeroEncs);\n \n // retornar a lista de codigos de utilizadores pretendida\n return utilizadorNumeroEncsOrdenado.keySet()\n .stream()\n .limit(10)\n .collect(Collectors.toList()); \n }", "private void bigWigToScores(BBFileReader reader){\n\n\t\t// List of length equal to screen size. Each inner map contains info about the screen locus \n\t\tList<ScreenWiggleLocusInfo> screenWigLocInfoList= new ArrayList<ScreenWiggleLocusInfo>();\n\t\tfor(int i= 0; i < getGc().getUserWindowSize(); i++){\n\t\t\tscreenWigLocInfoList.add(new ScreenWiggleLocusInfo());\n\t\t}\n\t\t\n\t\tBigWigIterator iter = reader.getBigWigIterator(getGc().getChrom(), getGc().getFrom(), getGc().getChrom(), getGc().getTo(), false);\n\t\twhile(iter.hasNext()){\n\t\t\tWigItem bw = iter.next();\n\t\t\tfor(int i= bw.getStartBase(); i <= bw.getEndBase(); i++){\n\t\t\t\tint idx= Utils.getIndexOfclosestValue(i, getGc().getMapping()); // Where should this position be mapped on screen?\n\t\t\t\tscreenWigLocInfoList.get(idx).increment(bw.getWigValue());\n\t\t\t} \n\t\t}\n\t\tArrayList<Double> screenScores= new ArrayList<Double>();\n\t\tfor(ScreenWiggleLocusInfo x : screenWigLocInfoList){\n\t\t\tscreenScores.add((double)x.getMeanScore());\n\t\t}\n\t\tthis.setScreenScores(screenScores);\t\t\n\t}", "List<Sppprm> exportPrimesJourToPaie(List<Pointage> pointagesOrderedByDateAsc);", "void readWriteFile() throws IOException{\n\t\t\t\t\n\t\t// Sorting before writing it to the file\n\t Map<String, Double> sortedRank = sortByValues(PageRank); \n\t\t\n // below code is used for finding the inlinks count, Comment the probablity sum in below iterator if uncommenting this line\n\t\t//Map<String, Integer> sortedRank = sortByinlinks(inlinks_count);\n\t\t\n\n\t\t//Writing it to the file\n\t\tFile file = new File(\"C:/output.txt\");\n\t\tBufferedWriter output = new BufferedWriter(new FileWriter(file,true));\n\t\tIterator iterator = sortedRank.entrySet().iterator();\n\t\tdouble s = 0.0;\n\t\t\twhile(iterator.hasNext()){\n\t\t\t\tMap.Entry val = (Map.Entry)iterator.next();\n\t\t\t\toutput.write(val.getKey() +\"\\t\"+ val.getValue()+ \"\\n\");\t\t\t\t\n\t\t\t\ts= s+ (double)val.getValue(); //Adding the Probablity ; Comment this line if using Inlink calculation\n\t\t\t}\n\t\t\tSystem.out.println(\"Probablity Sum : \"+s); //After convergence should be 1; ; Comment this line if using Inlink calculation\n\t\t\toutput.flush();\n\t\t\toutput.close();\n\t}", "private static void SortHash(HashMap<String,ArrayList<input>> hashMap,Distribution list)\n\t{\n\t\tCollections.sort(list.First, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Second, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Third, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fourth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.sort(list.Fifth, new Comparator<input>() {\n\t\t public int compare(input one, input other) {\n\t\t \tif(one.sum>other.sum)\n\t\t \t{\n\t\t \t\treturn 1;\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn -1;\n\t\t \t}\n\t\t }\n\t\t}); \n\t\tCollections.reverse(list.First);\n\t\tCollections.reverse(list.Second);\n\t\tCollections.reverse(list.Third);\n\t\tCollections.reverse(list.Fourth);\n\t\tCollections.reverse(list.Fifth);\n\t\tputInHashMap(hashMap,list);\n\t}", "private Map<String, Double> sortBottomPercents(final String gradingScaleName, final Map<String, Double> percents) {\n\n\t\tMap<String, Double> rval = null;\n\n\t\tif (StringUtils.equals(gradingScaleName, \"Pass / Not Pass\")) {\n\t\t\trval = new TreeMap<>(Collections.reverseOrder()); // P before NP.\n\t\t} else {\n\t\t\trval = new TreeMap<>(new LetterGradeComparator()); // letter grade mappings\n\t\t}\n\t\trval.putAll(percents);\n\n\t\treturn rval;\n\t}", "private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }", "private static List<StudentRecord> vratiSortiranuListuOdlikasa(List<StudentRecord> records) {\n\t\treturn records.stream()\n\t\t\t\t\t\t.filter(s -> s.getGrade() == 5)\n\t\t\t\t\t\t.sorted(StudentRecord.BY_POINTS.reversed())\n\t\t\t\t\t\t.collect(Collectors.toList());\n\t}", "public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }", "private IDictionary<URI, Double> makePageRanks(IDictionary<URI, ISet<URI>> graph,\n double decay,\n int limit,\n double epsilon) {\n \tIDictionary<URI, Double> computedPageRanks = new ChainedHashDictionary<URI, Double>();\n \tIDictionary<URI, Double> oldPageRanks = new ChainedHashDictionary<URI, Double>();\n \tdouble initPageRank = 1.0 / (double) graph.size();\n \tdouble newSurfers = (1.0 - decay) / (double) graph.size();\n \tfor (KVPair<URI, ISet<URI>> pair : graph) {\n \t\tURI pageUri = pair.getKey();\n \t\toldPageRanks.put(pageUri, initPageRank);\n \t}\n\n \tif (limit == 0) {\n \t\treturn oldPageRanks;\n \t}\n for (int i = 0; i < limit; i++) {\n \tfor (KVPair<URI, ISet<URI>> webpage : graph) {\n \t\tURI uri = webpage.getKey();\n \t\tcomputedPageRanks.put(uri, newSurfers);\n \t}\n \tfor (KVPair<URI, ISet<URI>> webpage : graph) {\n \t\tURI pageUri = webpage.getKey();\n \t\tISet<URI> links = webpage.getValue();\n \t\tdouble oldPageRank = oldPageRanks.get(pageUri);\n \t\tif (links.isEmpty()) {\n \t\t\t// d * oldPR / N\n \t\t\tfor (KVPair<URI, ISet<URI>> page : graph) {\n \t\t\t\tURI uri = page.getKey();\n \t\t\t\tdouble currPageRank = computedPageRanks.get(uri);\n \t\t\t\tdouble update = ((decay * oldPageRank) / ((double) graph.size()));\n \t\t\t\tcomputedPageRanks.put(uri, currPageRank + update);\n \t\t\t}\n \t\t} else {\n \t\t\t// d * oldPR / outgoing links\n \t\t\tfor (URI uri : links) {\n \t\t\t\tdouble update = ((decay * oldPageRank) / ((double) links.size()));\n \t\t\t\tdouble currPageRank = computedPageRanks.get(uri);\n \t\t\t\tcomputedPageRanks.put(uri, currPageRank + update);\n \t\t\t}\n \t\t}\n \t}\n\n \tboolean converged = true;\n \tfor (KVPair<URI, Double> pair : computedPageRanks) {\n \t\tURI pageUri = pair.getKey();\n \t\tdouble currPageRank = pair.getValue();\n \t\tdouble oldPageRank = oldPageRanks.get(pageUri);\n \t\tdouble difference = Math.abs(currPageRank - oldPageRank);\n \t\tif (converged) { \n \t\t\tconverged = (difference <= epsilon);\n \t\t}\n \t\toldPageRanks.put(pageUri, currPageRank);\n \t}\n \tif (converged) {\n \t\treturn computedPageRanks;\n \t}\n }\n return computedPageRanks;\n }", "public ArrayList sortIt(ArrayList stats) {\n ArrayList statsCopy = (ArrayList)stats.clone(); //need to do this otherwise it can mess up later stats\n\n //just for all\n if(statsCopy.size() < 10) {\n sortAll(statsCopy);\n }\n //have to do for 10 and all\n else if(statsCopy.size() <= 100){\n sort10(statsCopy);\n sortAll(statsCopy);\n }\n //for everything!\n else if(statsCopy.size() >= 100) {\n sort10(statsCopy);\n sort100(statsCopy);\n sortAll(statsCopy);\n } else {}\n\n //add the new sorted results in\n results.add(min10);\n results.add(max10);\n results.add(avg10);\n results.add(med10);\n results.add(min100);\n results.add(max100);\n results.add(avg100);\n results.add(med100);\n results.add(minAll);\n results.add(maxAll);\n results.add(avgAll);\n results.add(medAll);\n\n return results;\n\n }", "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "private void calculateOverall()\n {\n ArrayList<Integer> average = new ArrayList<Integer>(1);\n ArrayList<Integer> median = new ArrayList<Integer>(1);\n ArrayList<Integer> mode = new ArrayList<Integer>();\n ArrayList<Integer> stdDev = new ArrayList<Integer>(1);\n \n int avg = 0;\n int med = 90;\n int mod = 90;\n int dev = 0;\n \n int[] modeArray = new int[100];\n \n for (int i = 0; i < 100; i++) {\n \tmodeArray[i] = 0;\n }\n \n for (Integer score : allScores) {\n \tavg += score;\n \tmodeArray[score]++;\n }\n \n for (int i = 0; i < 100; i++) {\n \tif (modeArray[i] > mod) {\n \t\tmod = modeArray[i];\n \t}\n }\n \n avg = avg / allScores.size();\n \n Collections.sort(allScores);\n med = allScores.get(allScores.size() / 2);\n \n for (Integer score : allScores) {\n \tdev += Math.pow(score - avg, 2);\n }\n dev = (int)Math.floor(Math.sqrt(dev / allScores.size()));\n\n // TODO: Perform the actual calculations here\n average.add(avg);\n median.add(med);\n mode.add(mod);\n stdDev.add(dev);\n\n this.overallAnalytics.put(\"Average\", average);\n this.overallAnalytics.put(\"Median\", median);\n this.overallAnalytics.put(\"Mode\", mode);\n this.overallAnalytics.put(\"Standard Deviation\", stdDev);\n }", "private static ArrayList<MovieList> classifyByPopularity(MovieList mvList) {\n\n ArrayList<MovieList> playLists = new ArrayList<MovieList>();\n\n MovieList greatMovies = new MovieList();\n MovieList mediocreMovies = new MovieList();\n MovieList badMovies = new MovieList();\n\n // We sort because want to show the movies in that order\n // This makes sense since the user asked for popularity distinguished lists. \n // We suppose must be interested in this feature.\n // Also in the future we might want arbitrary categories\n Collections.sort(mvList, new Movie.OrderByPopularity());\n\n for(Movie mv : mvList) {\n if (mv.getPopularity() < 5.0) \n badMovies.add(mv);\n else if (mv.getPopularity() >= 5 && mv.getPopularity() <= 8.0) \n mediocreMovies.add(mv);\n else if (mv.getPopularity() > 8.0 && mv.getPopularity() <= 10.0) \n greatMovies.add(mv);\n else\n System.out.println(\"Warning wrong popularity for movie: \" + mv.getId() + \" \" + mv.getTitle() );\n }\n\n playLists.add(greatMovies);\n playLists.add(mediocreMovies);\n playLists.add(badMovies);\n\n return playLists;\n }", "protected List<Score> getScoresToDisplay(){\n boolean allUsers = btnUser.getText() == btnUser.getTextOff();\n Integer selectedOption = gameOptions.get(spinGameOptions.getSelectedItem().toString());\n String fileName = Board.getHighScoreFile(Game.SLIDING_TILES, selectedOption);\n return allUsers?\n GameScoreboard.getScores(this, fileName, Board.getComparator()) :\n GameScoreboard.getScoresByUser(this, fileName, user, Board.getComparator());\n }", "private void histogramScore() {\r\n View.histogram(score, 0, this.getSize().width + 15, 0);\r\n }", "private void addPartList ()\r\n {\r\n // Map (page) ScorePart -> (score) ScorePart data\r\n List<ScorePart> partList = new ArrayList<>();\r\n\r\n for (Result result : connection.getResultMap().keySet()) {\r\n ScorePart scorePart = (ScorePart) result.getUnderlyingObject();\r\n partList.add(scorePart);\r\n }\r\n\r\n // Need map: pagePart instance -> set of related systemPart instances\r\n // (Since we only have the reverse link)\r\n Map<ScorePart, List<SystemPart>> page2syst = new LinkedHashMap<>();\r\n\r\n for (TreeNode pn : score.getPages()) {\r\n Page page = (Page) pn;\r\n\r\n for (TreeNode sn : page.getSystems()) {\r\n ScoreSystem system = (ScoreSystem) sn;\r\n\r\n for (TreeNode n : system.getParts()) {\r\n SystemPart systPart = (SystemPart) n;\r\n\r\n ScorePart pagePart = systPart.getScorePart();\r\n List<SystemPart> cousins = page2syst.get(pagePart);\r\n\r\n if (cousins == null) {\r\n cousins = new ArrayList<>();\r\n page2syst.put(pagePart, cousins);\r\n }\r\n\r\n cousins.add(systPart);\r\n }\r\n }\r\n }\r\n\r\n // Align each candidate to its related result (System -> Page -> Score)\r\n for (Result result : connection.getResultMap().keySet()) {\r\n ScorePart scorePart = (ScorePart) result.getUnderlyingObject();\r\n int newId = scorePart.getId();\r\n\r\n for (Candidate candidate : connection.getResultMap().get(result)) {\r\n ScorePart pagePart = (ScorePart) candidate.getUnderlyingObject();\r\n // Update (page) part id\r\n pagePart.setId(newId);\r\n\r\n // Update all related (system) part id\r\n for (SystemPart systPart : page2syst.get(pagePart)) {\r\n systPart.setId(newId);\r\n }\r\n }\r\n }\r\n\r\n score.setPartList(partList);\r\n }", "@Test\n public void Scenario1() {\n\n Response resp = reqSpec.request().get();\n\n DataWrapper respBody = resp.as(DataWrapper.class);\n List<Regions> regions = respBody.getData().get(0).getRegions();\n\n Map<Integer, String> sortedIntensity = new TreeMap<>();\n\n try {\n\n ListIterator iterator = regions.listIterator();\n int iter = 0;\n\n while (iterator.hasNext()) {\n\n sortedIntensity.put(regions.get(iter).getIntensity().getForecast(),\n regions.get(iter).getShortname());\n iter++;\n iterator.next();\n }\n\n } catch (NullPointerException npe) {\n npe.printStackTrace();\n }\n\n System.out.println(\"Regions sorted by intensity forecast:\");\n System.out.println(sortedIntensity);\n }", "public static void main(String[] args) throws IOException \n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.print(\"Please input the keyword: \");\n\t\tString keyword = sc.next();\n\t\tsc.close();\n\t\n\t\tKeywordList kLst = new KeywordList();\t\n\t\tSystem.out.println(\"-------------------------------------------------------\\nRelative Word List: \");\n\t\tkLst.printKeywordList(kLst.getKeywords());\n\t\tSystem.out.print(\"-------------------------------------------------------\\nValid Web Pages for Keyword [\" + keyword + \"]: \\n\");\n\t\tGoogleSearch google = new GoogleSearch(keyword);\n\t\tSystem.out.print(google.toString());\n\t\t\n\t\tArrayList<WebNode> wLst = new ArrayList<WebNode>();\t\n\t\t\n\t\ttry \n\t\t{\t\t\n\t\t\tfor(String title: google.query().keySet()) \n\t\t\t{\n\t\t\t\tString webUrl = google.query().get(title);\t\n\t\t\t\tWebPage rootPage = new WebPage(webUrl, title);\n\t\t\t\tWebTree tree = new WebTree(rootPage);\n\t\t\t\t\t\n\t\t\t\tChildPageQuery childQ = new ChildPageQuery(webUrl);\n\t\t\t\tint count = 0;\n\t\t\t\tif(childQ.query() != null) \n\t\t\t\t{\t\t\t\n\t\t\t\t\tfor(String childUrl: childQ.query()) \n\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\tcount++;\t\t\t\t\t\t\t\n\t\t\t\t\t\ttree.root.addChild(new WebNode(new WebPage(childUrl, count + \"\")));\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\ttree.setPostOrderScore(kLst.getKeywords());\n\t\t\t\t\twLst.add(tree.root);\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\tWebRating rating = new WebRating(wLst);\n\t\t\trating.sort();\n\t\t\tSystem.out.println(\"-------------------------------------------------------\\n★★★Rating★★★\\n(Title, Total Child Pages, Total Root Page Score)\");\n\t\t\tSystem.out.print(rating.output());\n\t\t} \n\n\t\tcatch(IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }", "@Test\n public void testCombineRankHighPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 10, 1000000000.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n Assert.assertEquals(10, resultList.size());\n Assert.assertTrue(resultList.stream().limit(3).map(p -> p.getLeft())\n .anyMatch(doc -> doc.getText().contains(\"wics.ics.uci.edu\")));\n }", "@Test\n public void sort_Courses() throws InterruptedException {\n HomePage homePage = new HomePage(driver);\n homePage.search();\n\n Courses courses = new Courses(driver);\n String actualUrl = courses.sortCourses(\"Highest Rated\");\n String expectedUrl = \"https://www.udemy.com/courses/development/software-testing/?sort=highest-rated\";\n\n Assert.assertEquals(actualUrl, expectedUrl);\n }", "private void setBoardData(Map<Player, Integer> scores) {\n Map<Player, Integer> sortedMap = MapUtil.sortByValueReverse(scores);\n\n for (Player player : Bukkit.getOnlinePlayers()) {\n int line = 1;\n for (Map.Entry<Player, Integer> entry : sortedMap.entrySet()) {\n if (line > scores.size() || line > 15) return;\n\n Player scoreboardEntry = entry.getKey();\n String score = Integer.toString(entry.getValue());\n\n titleManagerAPI.setScoreboardValue(player, line, score + \" \" + ChatColor.GREEN + scoreboardEntry.getDisplayName());\n\n line++;\n }\n }\n }", "public void sortAndSave() {\n\t\tsort();\n\t\tShopIO.writeFile(ShopIO.getDataFile(), ShopIO.getGson().toJson(this));\n\t}", "private List<Score> order(List<Score> s)\n {\n Collections.sort(s, new Comparator<Score>()\n {\n\n @Override\n public int compare(Score o1, Score o2) {\n // TODO Auto-generated method stub\n\n return o1.getSentId() - o2.getSentId();\n }\n });\n return s;\n }", "public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}", "private void sort() {\n\t\tCollections.sort(this.entities, comparator);\n\t}", "public void sortDescending()\r\n\t{\r\n\t\tList<Book> oldItems = items;\r\n\t\titems = new ArrayList<Book>(items);\r\n\t\tCollections.sort(items, Collections.reverseOrder());\r\n\t\tfirePropertyChange(\"books\", oldItems, items);\r\n\t}", "public double SumInlinkHubScore(Page page) {\n\t\tList<String> inLinks = page.getInlinks();\n\t\tdouble hubScore = 0;\n\t\tfor (String inLink1 : inLinks) {\n\t\t\tPage inLink = pTable.get(inLink1);\n\t\t\tif (inLink != null)\n\t\t\t\thubScore += inLink.hub;\n\t\t\t// else: page is linked to by a Page not in our table\n\t\t}\n\t\treturn hubScore;\n\t}", "Pages getPages();", "void topologicalSort() {\n\n\t\tfor (SimpleVertex vertice : allvertices) {\n\n\t\t\tif (vertice.isVisited == false) {\n\t\t\t\tlistset.add(vertice.Vertexname);\n\t\t\t\ttopologicalSortUtil(vertice);\n\n\t\t\t}\n\t\t}\n\n\t}", "private void scoreBoard(){\n \n //sort brackets by score \n //playerBrackets.sort((Bracket p1, Bracket p2) -> p1.scoreBracket(simResultBracket) -p2.scoreBracket(simResultBracket)); \n \n //scoreBoardButton.setDisable(true);\n displayPane(scoreBoard._start());\n //viewBracket.setDisable(false);\n }" ]
[ "0.60747874", "0.60422707", "0.5947372", "0.58777696", "0.57888126", "0.57003796", "0.5691459", "0.5636785", "0.56043565", "0.55418974", "0.5502585", "0.54989773", "0.54170465", "0.540134", "0.53996074", "0.5356888", "0.5354962", "0.53371775", "0.5329301", "0.52989894", "0.52973", "0.5273089", "0.52426064", "0.52196676", "0.5214983", "0.52109677", "0.52109677", "0.5209438", "0.51666945", "0.51407754", "0.5084327", "0.50791234", "0.5067837", "0.50491625", "0.50223136", "0.5018975", "0.50015724", "0.49990216", "0.49951288", "0.49872988", "0.49850065", "0.49825236", "0.49813598", "0.49562272", "0.4940259", "0.49247718", "0.49241734", "0.4919366", "0.49164864", "0.48984796", "0.48878187", "0.48621058", "0.48551565", "0.4853918", "0.48522133", "0.48489928", "0.48377183", "0.4833307", "0.48229703", "0.48221025", "0.48210767", "0.48186707", "0.48127738", "0.48097643", "0.48086944", "0.4799534", "0.47985336", "0.47981077", "0.4797853", "0.47848454", "0.47727984", "0.4750377", "0.47488523", "0.4745893", "0.47396764", "0.47372282", "0.47290096", "0.4725149", "0.47251326", "0.47225493", "0.4719909", "0.47195873", "0.47178158", "0.47093937", "0.47064054", "0.47045338", "0.47024345", "0.4701934", "0.46954843", "0.46937698", "0.46901518", "0.46894205", "0.46865392", "0.46732527", "0.46692693", "0.46555403", "0.4651069", "0.46491253", "0.4648507", "0.4647361" ]
0.5932073
3
Sorts by 'TimeStarted' property
public int compare(Page p1, Page p2) { return p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sort(){\n listOperation.sort(Comparator.comparingInt(Operation::getiStartTime));\n }", "public long getSortTime(){ \n return endTime - startTime;\n }", "public void sortEventsByTime() {\n for (OrgEvent event : events) {\n event.setCompareByTime(true);\n }\n Collections.sort(events);\n }", "double getSortTime();", "public double getSortTime() {\n return sortTime_;\n }", "public double getSortTime() {\n return sortTime_;\n }", "public static void sortEvents(){\n if(events.size()>0){\n Comparator<Event> comp = new Comparator<Event>(){\n public int compare(Event e1, Event e2){\n if(e1.getEventStartTime().before(e2.getEventStartTime())){\n return -1;\n }\n else if(e1.getEventStartTime().after(e2.getEventStartTime())){\n return 1;\n }\n else{\n return 0;\n }\n }\n \n };\n Collections.sort(events, comp);\n \n }}", "public static void sortActivities() {\n Activity.activitiesList.sort(new Comparator<Activity>() {\n @Override\n public int compare(Activity activity, Activity t1) {\n if (activity.getStartTime().isAfter(t1.getStartTime())) {\n return 1;\n }\n else if (activity.getStartTime().isBefore(t1.getStartTime())){\n return -1;\n }\n else {\n return 0;\n }\n }\n });\n }", "public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }", "public Integer getTimeSort() {\n return timeSort;\n }", "public Comparator<PoiPoint> getPointStartTimeComparator() {\r\n \r\n class PointStartTimeComparator implements Comparator<PoiPoint> {\r\n public int compare(PoiPoint point1, PoiPoint point2) {\r\n return (point1.getStartTimeInt() - point2.getStartTimeInt());\r\n }\r\n }\r\n \r\n return new PointStartTimeComparator();\r\n }", "public void sortBasedPendingJobs();", "public void sortAuthority(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tpublic List<Listing> findAllSortedByTime() {\n\t\treturn theListingRepo.findAll(Sort.by(Direction.DESC, \"dateUploaded\"));\n\t}", "private ArrayList<Task> sortByDate(ArrayList<Task> toSort) {\n ArrayList<Task> sorted = new ArrayList<>();\n\n toSort = removeNoTimeTask(toSort);\n\n int size = toSort.size();\n for (int i = 0; i < size; i++) {\n Date earliest = new Date(Long.MAX_VALUE);\n int earliestIndex = -1;\n for (int j = 0; j < toSort.size(); j++) {\n if (toSort.get(j).getClass().equals(Deadline.class)) {\n Deadline temp = (Deadline) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Event.class)) {\n Event temp = (Event) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Period.class)) {\n Period temp = (Period) toSort.get(j);\n if (temp.getStart().before(earliest)) {\n earliest = temp.getStart();\n earliestIndex = j;\n }\n }\n }\n\n sorted.add(toSort.get(earliestIndex));\n toSort.remove(earliestIndex);\n }\n return sorted;\n }", "public void sortHub(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "public void setTimeSort(Integer timeSort) {\n this.timeSort = timeSort;\n }", "private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }", "@Override\n public Sort getDefaultSort() {\n return Sort.add(SiteConfineArea.PROP_CREATE_TIME, Direction.DESC);\n }", "public void sort() {\n Collections.sort(tasks);\n }", "public int compare(TimeEntry t1, TimeEntry t2) {\n\t\t\t\t\treturn t1.getTime().compareTo(t2.getTime());\n\t\t\t\t//return 1;\n\t\t\t }", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "private static ArrayList<Quest> sortAfterTimestamp(ArrayList<Quest> questListToSort) {\n\t\tfor (int i = 0; i < questListToSort.size() - 1; i++) {\n\t\t\tint index = i;\n\t\t\tfor (int j = i + 1; j < questListToSort.size(); j++) {\n\t\t\t\tif (questListToSort.get(j).getTimestamp() > questListToSort.get(index).getTimestamp()) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.swap(questListToSort, index, i);\n\t\t}\n\t\treturn questListToSort;\n\t}", "public void sortEvents() {\n\t\tCollections.sort(events);\n\t}", "@Override\r\n\t\t\t\tpublic int compare(twi arg0, twi arg1) {\n\t\t\t\t\tif (arg0.timestamp > arg1.timestamp) {\r\n\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t} else if (arg0.timestamp < arg1.timestamp) {\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public void sortQueries(){\n\t\tif (queries == null || queries.isEmpty()) {\n\t\t\treturn;\n\t\t} else {\n\t\t Collections.sort(queries, new Comparator<OwnerQueryStatsDTO>() {\n @Override\n public int compare(OwnerQueryStatsDTO obj1, OwnerQueryStatsDTO obj2) {\n if(obj1.isArchived() && obj2.isArchived()) {\n return 0;\n } else if(obj1.isArchived()) {\n return 1;\n } else if(obj2.isArchived()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n\n\t }\n\t}", "@Override\n\t\t\tpublic int compare(LiveAlarm object1, LiveAlarm object2) {\n\t\t\t\tlong start1 = object1.startT;\n\t\t\t\tlong start2 = object2.startT;\n\t\t\t\t\n\t\t\t\tif (start1 < start2) return -1;\n\t\t\t\tif (start1 == start2) return 0;\n\t\t\t\tif (start1 > start2) return 1;\n\t\t\t\t\n\t\t\t\treturn 0;//to suppress the compiler error;\n\t\t\t}", "public int compare(TimeSpan std1, TimeSpan std2) {\n\t\t\t//ascending order\n\t\t\treturn std1.start - std2.start;\n\t\t}", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }", "private static void sortingArrayList() {\n Collections.sort(allMapData, new Comparator<MapDataModel>() {\n public int compare(MapDataModel d1, MapDataModel d2) {\n return valueOf(d1.getDateTime().compareTo(d2.getDateTime()));\n }\n });\n }", "@Test\r\n public void testGetShapesSortedByTimestamp() {\r\n List<Shape> expectedOutput = new ArrayList<Shape>();\r\n expectedOutput.add(circle);\r\n expectedOutput.add(square);\r\n expectedOutput.add(rectangle);\r\n expectedOutput.add(triangle);\r\n expectedOutput.add(regularPolygon);\r\n List<Shape> actualOutput = screen.sortShape(SortType.TIMESTAMP);\r\n assertEquals(expectedOutput, actualOutput);\r\n }", "public synchronized void firstSort(){\n Process temp;\n for(int j = 0; j<queue.length;j++){\n temp = null;\n for(int i = 0; i<pros.proSize(); i++){\n if(i==0){\n temp = new Process((pros.getPro(i)));\n }else if(temp.getArrivalTime() == pros.getPro(i).getArrivalTime()){\n if(temp.getId() > pros.getPro(i).getId()){\n temp = pros.getPro(i);\n }\n }else if (temp.getArrivalTime() > pros.getPro(i).getArrivalTime()){\n temp = pros.getPro(i);\n }\n }\n queue[j] = temp;\n pros.remove(temp.getId());\n }\n for(int i = 0; i< queue.length; i++){\n pros.addPro(queue[i]);\n }\n }", "LiveData<List<Task>> getSortedTasks(LocalDate startDate,\r\n LocalDate endDate);", "private static long sortingTime(String[] array, boolean isStandardSort) {\n long start = System.currentTimeMillis(); // starting time\n if (isStandardSort) \n Arrays.sort(array);\n selectionSort(array);\n return System.currentTimeMillis() - start; // measure time consumed\n }", "@Override\n\tpublic double sort() {\n\t\tlong startTime = System.nanoTime();\n\t\tArrayList<Offender> offenders = Offender.readArrayListCSV();\n\t\tCollections.sort(offenders, (a, b) -> ((Offender) a).getAge() < ((Offender) b).getAge() ? -1 : ((Offender) a).getAge() == ((Offender) b).getAge() ? 0 : 1);\n\t\tlong endTime = System.nanoTime();\n\t\tlong duration = (endTime - startTime); \n\t\tdouble seconds = (double)duration / 1_000_000_000.0;\n\t\t\n\t\treturn seconds;\n\t}", "protected int compareTime(Date first, Date second) {\n\t\treturn first.compareTo(second);\n\t}", "public final void testSortCriteria() throws Exception\n {\n Vector vect = new Vector();\n final long modifier = 100;\n long sdArr[][] = { { 0, 10 }, { 0, 12 }, { 0, 8 }, { -5, 20 }, { -5, 13 }, { -5, 15 }, { -5, -7 }, { 2, 10 },\n { 2, 8 }, { 2, 2 }, { 12, 14 }, { -5, 5 }, { 10, 2 } };\n long sorted[][] = { { -5, -7 }, { 10, 2 }, { 2, 2 }, { -5, 5 }, { 0, 8 }, { 2, 8 }, { 0, 10 }, { 2, 10 },\n { 0, 12 }, { -5, 13 }, { 12, 14 }, { -5, 15 }, { -5, 20 } };\n\n patchArray(sdArr, modifier);\n patchArray(sorted, modifier);\n\n for (int i = 0; i < sdArr.length; i++)\n {\n vect.addElement(new RecordingImplMock(new Date(sdArr[i][0]), sdArr[i][1]));\n }\n RecordingList recordingList = new RecordingListImpl(vect);\n Comparator comparator = new Comparator();\n\n RecordingList newList = recordingList.sortRecordingList(comparator);\n\n assertNotNull(\"recordingList returned null\", newList);\n\n // check results\n LocatorRecordingSpec lrs = null;\n RecordingRequest req = null;\n\n int i = newList.size();\n for (i = 0; i < newList.size(); i++)\n {\n req = (RecordingRequest) newList.getRecordingRequest(i);\n lrs = (LocatorRecordingSpec) req.getRecordingSpec();\n assertEquals(\"sort criteria is wrong\", sorted[i][1], lrs.getDuration());\n }\n }", "public int compareTo(Showtime showtime) {\r\n\t\tint x = this.startTime.compareTo(showtime.startTime);\r\n\t\treturn x;\r\n\t}", "public static void listByWatched(){\r\n System.out.println('\\n'+\"List by Watched\");\r\n CompareWatched compareWatched = new CompareWatched();\r\n Collections.sort(movies, compareWatched);\r\n for (Movie watch:movies){\r\n System.out.println('\\n'+\"Times Watched \"+ watch.getTimesWatched()+'\\n'+\"Title: \"+ watch.getName()+'\\n'+\"Rating: \"+ watch.getRating()+'\\n');\r\n }\r\n }", "public static void printAllEventListInSortedOrder(){\n sortEvents();\n for(int i=0;i<events.size();i++){\n System.out.println((events.get(i).getMonth()+1)+\"/\"+events.get(i).getDate()+\"/\"+events.get(i).getYear()+\" \"+events.get(i).getStringStartandFinish()+\" \"+events.get(i).getEventTitle());\n }\n }", "public int compare(KThread s1,KThread s2) { \n if (s1.time > s2.time) \n return 1; \n else if (s1.time < s2.time) \n return -1; \n return 0; \n }", "@Override\n public int compareTo(Record otherRecord) {\n return (int) (otherRecord.mCallEndTimestamp - mCallEndTimestamp);\n }", "public Timestamp getDateOrdered();", "private void sortViewEntries() {\n runOnUiThread(new Runnable() {\n public void run() {\n try {\n Collections.sort(viewEntries, new DateComparator());\n } catch (final Exception ex) {\n // Log.i(\"sortViewEntries\", \"Exception in thread\");\n }\n }\n });\n }", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "private void sortMessages() {\n if (sendloadSuccess && recievedloadSuccess) {\n\n Collections.sort(chatMessages, new Comparator<ChatMessage>() {\n @Override\n public int compare(ChatMessage msg1, ChatMessage msg2) {\n\n return msg1.getMessageTime().compareTo(msg2.getMessageTime());\n }\n });\n\n saveChatMessagesInFile();\n updateListAdapter();\n }\n }", "Sort asc(QueryParameter parameter);", "private static long sortingTime(double[] array, boolean isStandardSort) {\n long start = 0; // starting time\n if (isStandardSort) { \n start = System.currentTimeMillis(); \n Arrays.sort(array);\n } else {\t\n start = System.currentTimeMillis();\n selectionSort(array);\n }\n return System.currentTimeMillis() - start; // measure time consumed\n }", "public void sortTasks() {\n tasks.sort(null);\n }", "public void sortEventsByValue() {\n for (OrgEvent event : events) {\n event.setCompareByTime(false);\n }\n Collections.sort(events);\n }", "public static ArrayList<Process> sortArrivalTime(ArrayList<Process> process){\r\n\t\tCollections.sort(process, new MyComparator2());\r\n\t\treturn process;\r\n\t}", "public void sortMarkers() {\n\t\tCollections.sort(getMarkerSet().getMarkers(),\r\n\t\t\t\tnew MarkerTimeComparator());\r\n\t\t// log.debug(\"[sortMarkers]after: \" + getMarkerSet().getMarkers());\r\n\r\n\t}", "public void sort()\n {\n RecordComparator comp = new RecordComparator(Context.getCurrent().getApplicationLocale());\n if (comp.hasSort)\n sort(comp);\n }", "public ArrayList<Question> getQuestionsSortedByDate() {\n \t\tArrayList<Question> sortedQuestions = this.getQuestions();\n \n \t\tCollections.sort(sortedQuestions, new DateComparator());\n \n \t\treturn sortedQuestions;\n \t}", "public long getTimeStarted() {\n\t\treturn _timeStarted;\n\t}", "public void timSort(int[] nums) {\n\t\t\t\n\t}", "public Builder setSortTime(double value) {\n \n sortTime_ = value;\n onChanged();\n return this;\n }", "Time started() {\n return started;\n }", "@Override\n\tpublic int compareTo(Time t) {\n\t\tif (this.getIndex() < t.getIndex())\n\t\t\treturn 1;\n\t\telse if (this.getIndex() == t.getIndex())\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn -1;\n\t}", "private Stream<File> sort(final Stream<File> fileStream) {\n return fileStream.sorted(new FileMetaDataComparator(callback.orderByProperty().get(),\n callback.orderDirectionProperty().get()));\n }", "public void sortToDo(){\n\t\tCollections.sort(allToDoLists);\n\t}", "@Override\n\tpublic int compareTo(Object o)\n\t{\n\t if(o instanceof Context)\n\t {\n\t \tif (timestamp==null || ((Context) o).timestamp==null)\n\t \t\treturn 0;\n\t return timestamp.compareTo(((Context) o).timestamp);\n\t }\n\t return 0;\n\t}", "private void sortByDateOpen() {\n //selection sort\n for (int i = 0; i < size - 1; i++) {\n int earliestDateIndex = i;\n for (int j = i + 1; j < size; j++)\n if (accounts[j].getDateOpen().compareTo(accounts[earliestDateIndex].getDateOpen()) < 0) {\n earliestDateIndex = j;\n }\n Account acc = accounts[earliestDateIndex];\n accounts[earliestDateIndex] = accounts[i];\n accounts[i] = acc;\n }\n }", "public void sortByDate(){\n output.setText(manager.display(true, \"date\"));\n }", "@Override\n\tpublic int compareTo(TimeInt other) {\n\t\tif (this.time < other.time) {\n\t\t\treturn -1;\n\t\t} else if (this.time > other.time) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\n\t}", "@Test\n public void testSort() {\n topScreenModel.setSortFieldAndFields(Field.LOCALITY, fields);\n\n FieldValue previous = null;\n\n // Test for ascending sort\n topScreenModel.refreshMetricsData();\n\n for (Record record : topScreenModel.getRecords()) {\n FieldValue current = record.get(Field.LOCALITY);\n if (previous != null) {\n assertTrue(current.compareTo(previous) < 0);\n }\n previous = current;\n }\n\n // Test for descending sort\n topScreenModel.switchSortOrder();\n topScreenModel.refreshMetricsData();\n\n previous = null;\n for (Record record : topScreenModel.getRecords()) {\n FieldValue current = record.get(Field.LOCALITY);\n if (previous != null) {\n assertTrue(current.compareTo(previous) > 0);\n }\n previous = current;\n }\n }", "public static JwComparator<AcWebServiceRequestData> getCreatedUtcTsComparator()\n {\n return AcWebServiceRequestDataTools.instance.getCreatedUtcTsComparator();\n }", "@Override\n public int compareTo(Object o) {\n Run run = (Run)o;\n if(runDate.compareTo(run.getRunDate()) == 0){ \n return getName().compareTo(run.getName());\n }else{\n return run.getRunDate().compareTo(getRunDate());\n }\n }", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "public Date getStartTime() {\r\n return this.startTime;\r\n }", "@Override\n\tpublic int compare(Map e1, Map e2) {\n\t\tif (!e1.containsKey(\"event_start_time\") && !e2.containsKey(\"event_start_time\")) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (!e1.containsKey(\"event_start_time\")) {\n\t\t\treturn e2.get(\"event_start_time\") == null ? 0 : 1;\n\t\t} else if (!e2.containsKey(\"event_start_time\")) {\n\t\t\treturn e1.get(\"event_start_time\") == null ? 0 : -1;\n\t\t}\n\n\t\tTimestamp e1_event_start_time = Timestamp.valueOf(e1.get(\"event_start_time\").toString());\n\t\tTimestamp e2_event_start_time = Timestamp.valueOf(e2.get(\"event_start_time\").toString());\n\n\t\tif (e1_event_start_time.equals(e2_event_start_time)) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn e1_event_start_time.before(e2_event_start_time) ? -1 : 1;\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "@Override\n\t\tpublic int compareTo(pair2 o) {\n\t\t\tif (this.time == o.time) {\n\t\t\t\treturn o.status - this.status;\n\t\t\t} else {\n\t\t\t\treturn this.time - o.time;\n\t\t\t}\n\t\t}", "@JsonProperty(\"startTime\")\n public String getStartTime() {\n return startTime;\n }", "public void timSort(int[] nums) {\n\n\t}", "public Date getStartTime() {\n return this.startTime;\n }", "@Override\n\tpublic int compare(ExecutionNode o1, ExecutionNode o2) {\n\t\t// compare start times\n\t\tTimePoint s1 = o1.getInterval().getStartTime();\n\t\tTimePoint s2 = o2.getInterval().getStartTime();\n\t\t// compare lower bounds\n\t\treturn s1.getLowerBound() < s2.getLowerBound() ? -1 : s1.getLowerBound() > s2.getLowerBound() ? 1 : 0;\n\t}", "public void sort() {\n }", "@Override\n\t\t\t\tpublic int compare(StatisticsItemData o1, StatisticsItemData o2) {\n\t\t\t\t\treturn o2.getDate().compareTo(o1.getDate());\n\t\t\t\t}", "public static <T extends Time> Comparator<T> timeComparator() {\n return new Comparator<T>() {\n\n @Override\n public int compare(T o1, T o2) {\n return o1.getTimeStamp().compareTo(o2.getTimeStamp());\n }\n };\n }", "public static JwComparator<AcGlobalDevice> getCreatedUtcTsComparator()\n {\n return AcGlobalDeviceTools.instance.getCreatedUtcTsComparator();\n }", "private void sortByDateOpen() { // sort in ascending order\n\t\tint numAccounts = size;\n\t\tDate firstDateOpen;\n\t\tDate secondDateOpen;\n\t\t\n\t\tfor (int i = 0; i < numAccounts-1; i++) {\n\t\t\t\n\t\t\t\n\t\t\tint min_idx = i;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = i+1; j < numAccounts; j++) {\n\t\t\t\t\n\t\t\t\t// Retrieve last name of two that you are comparing\n\t\t\t\tfirstDateOpen = accounts[j].getDateOpen();\n\t\t\t\tsecondDateOpen = accounts[min_idx].getDateOpen();\n\t\t\t\t\n\t\t\t\tif (firstDateOpen.compareTo(secondDateOpen) < 0) {\n\t\t\t\t\tmin_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAccount temp = accounts[min_idx];\n\t\t\taccounts[min_idx] = accounts[i];\n\t\t\taccounts[i] = temp;\n\t\t}\n\t\t\n\t}", "protected void sortCheck() {\n if (m_instances == null) {\n return;\n }\n \n if (m_simpleConfigPanel.isUsingANativeTimeStamp()) {\n String timeStampF = m_simpleConfigPanel.getSelectedTimeStampField();\n Attribute timeStampAtt = m_instances.attribute(timeStampF); \n if (timeStampAtt != null) {\n \n double lastNonMissing = Utils.missingValue();\n boolean ok = true;\n boolean hasMissing = false;\n for (int i = 0; i < m_instances.numInstances(); i++) {\n Instance current = m_instances.instance(i);\n \n if (Utils.isMissingValue(lastNonMissing)) {\n if (!current.isMissing(timeStampAtt)) {\n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n } else {\n if (!current.isMissing(timeStampAtt)) {\n if (current.value(timeStampAtt) - lastNonMissing < 0) {\n ok = false;\n break;\n }\n \n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n }\n }\n \n if (!ok && !hasMissing) {\n // ask if we should sort\n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". Do you want to sort the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Sorting data...\");\n }\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n \n if (!ok && hasMissing) {\n // we can't really proceed in this situation. We can't sort by the timestamp\n // because instances with missing values will be put at the end of the data.\n // The only thing we can do is to remove the instances with missing time\n // stamps but this is likely to screw up the periodicity and majorly impact\n // on results.\n \n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". \\nFurthermore, there are rows with\\n\" +\n \t\t\"missing timestamp values. We can remove these\\n\" +\n \t\t\"rows and then sort the data but this is likely to\\n\" +\n \t\t\"result in degraded performance. It is strongly\\n\" +\n \t\t\"recommended that you fix these issues in the data\\n\" +\n \t\t\"before continuing. Do you want the system to proceed\\n\" +\n \t\t\"anyway by removing rows with missing timestamps and\\n\" +\n \t\t\"then sorting the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Removing rows with missing time stamps and sorting data...\");\n }\n m_instances.deleteWithMissing(timeStampAtt);\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\tList<StatetostateDetail> list = new ArrayList<StatetostateDetail>();\n\t\tfor(int i = 1; i < 16; i++){\n\t\t\tStatetostateDetail s = new StatetostateDetail();\n\t\t\ts.setId(i);\n\t\t\ts.setStatue(0);\n\t\t\ts.setTime(System.currentTimeMillis() + (i + i * 100));\n\t\t\tlist.add(s);\n\t\t}\n\t\tlist.get(3).setStatue(1);\n\t\tlist.get(5).setStatue(1);\n\t\tlist.get(10).setStatue(1);\n\t\tlist.get(14).setStatue(1);\n\t\tlist.get(7).setStatue(2);\n\t\tlist.get(9).setStatue(2);\n\t\tSystem.out.println(\"list:\" + list);\n\t\n\t\t\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \tLong t1 = null;\n \tLong t2 = null;\n \ttry{\n \t\tt1 = s1.getTime();\n\t \tt2 = s2.getTime();\n \t}catch(Exception e){\n \t\te.printStackTrace();\n \t}\n \n return t2.compareTo(t1);\n }\n });\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \treturn s1.getStatue()>s2.getStatue()?1:(s1.getStatue()==s2.getStatue()?0:(s2.getTime()>s1.getTime()?-1:0));\n }\n });\n\t\t\n\t\tSystem.out.println(\"list:\" + list);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void updateSortingComparators(Comparator<ReadOnlyEntry> eventComparator,\n Comparator<ReadOnlyEntry> deadlineComparator,\n Comparator<ReadOnlyEntry> floatingTaskComparator);", "public Date getStartTime() {\n return startTime;\n }", "public Date getStartTime() {\n return startTime;\n }", "public Date getStartTime() {\n return startTime;\n }", "public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}", "public int compareTo(Punch another) {\n return ((new DateTime(time)).compareTo(another.getTime()));\n }", "@Override\n public int compareTo(Record o) {\n if (this.result - o.result > 0) {\n return 1;\n } else if (this.result - o.result < 0) {\n return -1;\n } else {\n // press time: the less, the better.\n if (this.pressTime < o.pressTime) {\n return 1;\n } else if (this.pressTime > o.pressTime) {\n return -1;\n } else {\n // total times: the more, the better.\n if (this.totalTimes > o.totalTimes) {\n return 1;\n } else if (this.totalTimes < o.totalTimes) {\n return -1;\n }\n return 0;\n }\n }\n }", "public ArrayList<Event> sortByDate() {\n\t\tArrayList<Event>calendarSortedByDate = new ArrayList();\n\t\tfor(int j = 0; j<calendar.size(); j++) {\n\t\t\tcalendarSortedByDate.add(calendar.get(j));\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < calendarSortedByDate.size() - 1; i++) {\n\t\t // Find the minimum in the list[i..list.size-1]\n\t\t Event currentMin = calendarSortedByDate.get(i);\n\t\t int currentMinIndex = i;\n\n\t\t for (int j = i + 1; j < calendarSortedByDate.size(); j++) {\n\t\t if (currentMin.compareDate​(calendarSortedByDate.get(j)) > 0) {\n\t\t currentMin = calendarSortedByDate.get(j);\n\t\t currentMinIndex = j;\n\t\t }\n\t\t }\n\n\t\t // Swap list[i] with list[currentMinIndex] if necessary;\n\t\t if (currentMinIndex != i) {\n\t\t \t calendarSortedByDate.set(currentMinIndex, calendarSortedByDate.get(i));\n\t\t \t calendarSortedByDate.set(i, currentMin);\n\t\t }\n\t\t }\n\t\treturn calendarSortedByDate;\n\t}", "@Override\n public int compare(Task task1, Task task2) {\n return task1.getDate().compareTo(task2.getDate());\n }", "private void sortByDate(List<Entry> entries) {\n\t\t\n\t\tCollections.sort(entries, new Comparator<Entry>() {\n\t\t\tpublic int compare(Entry o1, Entry o2) {\n\t\t\t if (o1.getTimestamp() == null || o2.getTimestamp() == null)\n\t\t\t return 0;\n\t\t\t return o1.getTimestamp().compareTo(o2.getTimestamp());\n\t\t\t }\n\t\t\t});\n\t}", "public Integer getStartTime() {\n return startTime;\n }", "public String getStartTime() {\n return startTime;\n }", "Date getStartedOn();", "@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}", "@Override\n\tpublic int compareTo(ParsedURLInfo o) {\n\t\treturn this.seqTime.compareTo(o.getSeqTime());\n\t}", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "public void sort() {\n\t\tArrayList<Medication> dayList = new ArrayList<Medication>();\n\t\tupcomingMedsLabel.setText(\"\");\n\t\tDate dt = new Date();\n\t\tDateFormat df = new SimpleDateFormat(\"EEEE\");\n\t\tString currentDay = df.format(dt);\n\t\t\n\t\t//Runs through all elements in the array\n\t\tfor(int i = 0; i < medList.size(); i++) {\n\t\t\t//Checks to see if the medication needs to be taken today\n\t\t\tif(medList.get(i).getMedDateTime().contains(currentDay)) {\n\t\t\t\tboolean added = false;\n\t\t\t\t//If no other element has been added, added the element\n\t\t\t\tif(dayList.size() == 0) {\n\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t} else {\n\t\t\t\t\t//Checks all other medications in the dayList to order them chronologicaly\n\t\t\t\t\tfor(int j = 0; j < dayList.size(); j++) {\n\t\t\t\t\t\t//Get the hour of element at j and compare it again element at i of medList\n\t\t\t\t\t\tint hour = Integer.parseInt(dayList.get(j).getHour());\n\t\t\t\t\t\t//If < add at j, if equal check minutes else add later\n\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getHour()) < hour) {\n\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (Integer.parseInt(medList.get(i).getHour()) == hour) {\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\t//Checks against minutes\n\t\t\t\t\t\t\tint minute = Integer.parseInt(dayList.get(j).getMinute());\n\t\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getMinute()) < minute) {\n\t\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(dayList.size() > (j + 1)) {\n\t\t\t\t\t\t\t\t\tdayList.add(j+1, medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(added == false) {\n\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Update the upcomingMedsLabel\n\t\tfor(int i = 0; i < dayList.size(); i++) {\n\t\t\tupcomingMedsLabel.setText(upcomingMedsLabel.getText() + \"\\n\\n\" + dayList.get(i));\n\t\t}\n\t}" ]
[ "0.71990544", "0.69180787", "0.6899925", "0.6818451", "0.6457486", "0.6427237", "0.63983643", "0.63283145", "0.6315511", "0.6290683", "0.6125058", "0.6122243", "0.6092077", "0.60294205", "0.5833757", "0.5794416", "0.5793885", "0.5785558", "0.57808423", "0.56512886", "0.5588033", "0.55824274", "0.5575733", "0.55727005", "0.557124", "0.55530113", "0.5493712", "0.5487639", "0.54194105", "0.54167384", "0.5368964", "0.53573585", "0.5321948", "0.5321838", "0.53183407", "0.53174067", "0.53052926", "0.5303475", "0.529993", "0.5296207", "0.5287468", "0.5279947", "0.5273409", "0.5265826", "0.5255797", "0.5226971", "0.52257687", "0.52222055", "0.521967", "0.52122056", "0.52118003", "0.52082545", "0.51977205", "0.5184827", "0.5177275", "0.51692903", "0.516084", "0.51590085", "0.51463675", "0.51448673", "0.51439315", "0.51322854", "0.5127932", "0.5122962", "0.5115394", "0.5112927", "0.5111364", "0.5111185", "0.5093199", "0.50827503", "0.5074787", "0.5071057", "0.506193", "0.5056302", "0.5054255", "0.50440514", "0.5035251", "0.5014042", "0.50133824", "0.49968496", "0.498902", "0.49847203", "0.49738982", "0.49734098", "0.49704948", "0.4963929", "0.4963929", "0.4963929", "0.496178", "0.495755", "0.49490127", "0.4947136", "0.49440977", "0.4937094", "0.4936338", "0.4935304", "0.4929687", "0.4928495", "0.49238178", "0.4920745", "0.4918237" ]
0.0
-1
If 'TimeStarted' property is equal sorts by 'TimeEnded' property
public int secondaryOrderSort(Page p1, Page p2) { return p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1 : p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sortEventsByTime() {\n for (OrgEvent event : events) {\n event.setCompareByTime(true);\n }\n Collections.sort(events);\n }", "public long getSortTime(){ \n return endTime - startTime;\n }", "public static void sortEvents(){\n if(events.size()>0){\n Comparator<Event> comp = new Comparator<Event>(){\n public int compare(Event e1, Event e2){\n if(e1.getEventStartTime().before(e2.getEventStartTime())){\n return -1;\n }\n else if(e1.getEventStartTime().after(e2.getEventStartTime())){\n return 1;\n }\n else{\n return 0;\n }\n }\n \n };\n Collections.sort(events, comp);\n \n }}", "public void sort(){\n listOperation.sort(Comparator.comparingInt(Operation::getiStartTime));\n }", "double getSortTime();", "public int compare(TimeEntry t1, TimeEntry t2) {\n\t\t\t\t\treturn t1.getTime().compareTo(t2.getTime());\n\t\t\t\t//return 1;\n\t\t\t }", "@Override\n\t\t\tpublic int compare(LiveAlarm object1, LiveAlarm object2) {\n\t\t\t\tlong start1 = object1.startT;\n\t\t\t\tlong start2 = object2.startT;\n\t\t\t\t\n\t\t\t\tif (start1 < start2) return -1;\n\t\t\t\tif (start1 == start2) return 0;\n\t\t\t\tif (start1 > start2) return 1;\n\t\t\t\t\n\t\t\t\treturn 0;//to suppress the compiler error;\n\t\t\t}", "public int compare(TimeSpan std1, TimeSpan std2) {\n\t\t\t//ascending order\n\t\t\treturn std1.start - std2.start;\n\t\t}", "@Override\r\n\t\t\t\tpublic int compare(twi arg0, twi arg1) {\n\t\t\t\t\tif (arg0.timestamp > arg1.timestamp) {\r\n\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t} else if (arg0.timestamp < arg1.timestamp) {\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n\tpublic int compare(Map e1, Map e2) {\n\t\tif (!e1.containsKey(\"event_start_time\") && !e2.containsKey(\"event_start_time\")) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (!e1.containsKey(\"event_start_time\")) {\n\t\t\treturn e2.get(\"event_start_time\") == null ? 0 : 1;\n\t\t} else if (!e2.containsKey(\"event_start_time\")) {\n\t\t\treturn e1.get(\"event_start_time\") == null ? 0 : -1;\n\t\t}\n\n\t\tTimestamp e1_event_start_time = Timestamp.valueOf(e1.get(\"event_start_time\").toString());\n\t\tTimestamp e2_event_start_time = Timestamp.valueOf(e2.get(\"event_start_time\").toString());\n\n\t\tif (e1_event_start_time.equals(e2_event_start_time)) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn e1_event_start_time.before(e2_event_start_time) ? -1 : 1;\n\t}", "@Override\n\t\tpublic int compareTo(Event other) {\n\t\t\tif (this.time < other.time + 1.0e-9) return -1;\n\t\t\telse if (this.time > other.time - 1.0e-9) return 1;\n\t\t\telse {\n\t\t\t\tif(this.active > other.active) return 1;\n\t\t\t\telse return -1;\n\t\t\t}\n\t\t}", "private static int compareEndTimes(TaskItem task1, TaskItem task2) {\n\t\tif (task1 instanceof FloatingTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (task1 instanceof DeadlinedTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t}\n\t}", "public Comparator<PoiPoint> getPointStartTimeComparator() {\r\n \r\n class PointStartTimeComparator implements Comparator<PoiPoint> {\r\n public int compare(PoiPoint point1, PoiPoint point2) {\r\n return (point1.getStartTimeInt() - point2.getStartTimeInt());\r\n }\r\n }\r\n \r\n return new PointStartTimeComparator();\r\n }", "@Override\n public int compareTo(Record otherRecord) {\n return (int) (otherRecord.mCallEndTimestamp - mCallEndTimestamp);\n }", "@Override\n\t\tpublic int compareTo(pair2 o) {\n\t\t\tif (this.time == o.time) {\n\t\t\t\treturn o.status - this.status;\n\t\t\t} else {\n\t\t\t\treturn this.time - o.time;\n\t\t\t}\n\t\t}", "@Override\n public int compareTo(Event e) {\n\n if(this.getAllDay() && !e.getAllDay()){\n return -1;\n }\n\n else if(e.getAllDay() && !this.getAllDay()){\n return 1;\n }\n\n else if(this.getAllDay() && e.getAllDay()){\n return 0;\n }\n\n else {\n int event1 = parseTime(this.getStartTime());\n int event2 = parseTime(e.getStartTime());\n\n if(event1 - event2 < 0){\n return -1;\n }\n\n else if(event1 - event2 > 0){\n return 1;\n }\n\n else {\n return 0;\n }\n }\n }", "@Override\n public int compareTo(Record o) {\n if (this.result - o.result > 0) {\n return 1;\n } else if (this.result - o.result < 0) {\n return -1;\n } else {\n // press time: the less, the better.\n if (this.pressTime < o.pressTime) {\n return 1;\n } else if (this.pressTime > o.pressTime) {\n return -1;\n } else {\n // total times: the more, the better.\n if (this.totalTimes > o.totalTimes) {\n return 1;\n } else if (this.totalTimes < o.totalTimes) {\n return -1;\n }\n return 0;\n }\n }\n }", "public static void sortActivities() {\n Activity.activitiesList.sort(new Comparator<Activity>() {\n @Override\n public int compare(Activity activity, Activity t1) {\n if (activity.getStartTime().isAfter(t1.getStartTime())) {\n return 1;\n }\n else if (activity.getStartTime().isBefore(t1.getStartTime())){\n return -1;\n }\n else {\n return 0;\n }\n }\n });\n }", "@Override\n\tpublic int compareTo(Time t) {\n\t\tif (this.getIndex() < t.getIndex())\n\t\t\treturn 1;\n\t\telse if (this.getIndex() == t.getIndex())\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn -1;\n\t}", "protected int compareTime(Date first, Date second) {\n\t\treturn first.compareTo(second);\n\t}", "public void sortEventsByValue() {\n for (OrgEvent event : events) {\n event.setCompareByTime(false);\n }\n Collections.sort(events);\n }", "static int compare(EpochTimeWindow left, EpochTimeWindow right) {\n long leftValue = left.isEmpty() ? Long.MIN_VALUE : left.getBeginTime();\n long rightValue = right.isEmpty() ? Long.MIN_VALUE : right.getBeginTime();\n\n int result = Long.compare(leftValue, rightValue);\n if (0 != result) {\n return result;\n }\n\n leftValue = left.isEmpty() ? Long.MIN_VALUE : left.getEndTime();\n rightValue = right.isEmpty() ? Long.MIN_VALUE : right.getEndTime();\n\n result = Long.compare(leftValue, rightValue);\n return result;\n }", "public void sortHub(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tpublic int compare(ExecutionNode o1, ExecutionNode o2) {\n\t\t// compare start times\n\t\tTimePoint s1 = o1.getInterval().getStartTime();\n\t\tTimePoint s2 = o2.getInterval().getStartTime();\n\t\t// compare lower bounds\n\t\treturn s1.getLowerBound() < s2.getLowerBound() ? -1 : s1.getLowerBound() > s2.getLowerBound() ? 1 : 0;\n\t}", "public int compare(KThread s1,KThread s2) { \n if (s1.time > s2.time) \n return 1; \n else if (s1.time < s2.time) \n return -1; \n return 0; \n }", "public void sortAuthority(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "public int compareTo(Punch another) {\n return ((new DateTime(time)).compareTo(another.getTime()));\n }", "@Override\n\tpublic int compareTo(Score s) {\n\t\treturn totalSecs - s.totalSecs;\n\t}", "public void sortBasedPendingJobs();", "public int compareTo(Showtime showtime) {\r\n\t\tint x = this.startTime.compareTo(showtime.startTime);\r\n\t\treturn x;\r\n\t}", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "public Integer getTimeSort() {\n return timeSort;\n }", "public int compare(Object o1, Object o2)\r\n/* 237: */ {\r\n/* 238:196 */ DisgustingMoebiusTranslator.ThingTimeTriple x = (DisgustingMoebiusTranslator.ThingTimeTriple)o1;\r\n/* 239:197 */ DisgustingMoebiusTranslator.ThingTimeTriple y = (DisgustingMoebiusTranslator.ThingTimeTriple)o2;\r\n/* 240:198 */ if (DisgustingMoebiusTranslator.this.mode == DisgustingMoebiusTranslator.this.stop)\r\n/* 241: */ {\r\n/* 242:199 */ if (x.to > y.to) {\r\n/* 243:200 */ return 1;\r\n/* 244: */ }\r\n/* 245:203 */ return -1;\r\n/* 246: */ }\r\n/* 247:206 */ if (DisgustingMoebiusTranslator.this.mode == DisgustingMoebiusTranslator.this.start)\r\n/* 248: */ {\r\n/* 249:207 */ if (x.from > y.from) {\r\n/* 250:208 */ return 1;\r\n/* 251: */ }\r\n/* 252:211 */ return -1;\r\n/* 253: */ }\r\n/* 254:214 */ return 0;\r\n/* 255: */ }", "@Override\n\tpublic int compareTo(TimeInt other) {\n\t\tif (this.time < other.time) {\n\t\t\treturn -1;\n\t\t} else if (this.time > other.time) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\n\t}", "public int compareTo(TimeSpan other) {\n\t\tif (this.hours == other.hours) { // if the hours are the same then compare the minutes\n\t\t\tif (this.minutes > other.minutes) {\n\t\t\t\treturn 1;\n\t\t\t} else if (this.minutes < other.minutes) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (this.hours > other.hours) {\n\t\t\treturn 1;\n\t\t} else if (this.hours < other.hours) {\n\t\t\treturn -1;\n\t\t} // else if the timespans are the same\n\t\treturn 0;\n\t}", "public void sortEvents() {\n\t\tCollections.sort(events);\n\t}", "private static ArrayList<Quest> sortAfterTimestamp(ArrayList<Quest> questListToSort) {\n\t\tfor (int i = 0; i < questListToSort.size() - 1; i++) {\n\t\t\tint index = i;\n\t\t\tfor (int j = i + 1; j < questListToSort.size(); j++) {\n\t\t\t\tif (questListToSort.get(j).getTimestamp() > questListToSort.get(index).getTimestamp()) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.swap(questListToSort, index, i);\n\t\t}\n\t\treturn questListToSort;\n\t}", "@Override\n public int compareTo(Booking other) {\n // Push new on top\n other.updateNewQuestion(); // update NEW button\n this.updateNewQuestion();\n\n\n String[] arr1 = other.time.split(\":\");\n String[] arr2 = this.time.split(\":\");\n// Date thisDate = new Date(this.getCalendarYear(), this.getCalendarMonth(), this.getCalendarDay(), Integer.getInteger(arr2[0]), Integer.getInteger(arr2[1]));\n// if (this.newQuestion != other.newQuestion) {\n// return this.newQuestion ? 1 : -1; // this is the winner\n// }\n\n\n if (this.calendarYear == other.calendarYear) {\n if (this.calendarMonth == other.calendarMonth) {\n if (this.calendarDay == other.calendarDay) {\n if (Integer.parseInt(arr2[0]) == Integer.parseInt(arr1[0])) { // hour\n if (Integer.parseInt(arr2[1]) == Integer.parseInt(arr1[1])) { // minute\n return 0;\n } else {\n return Integer.parseInt(arr1[1]) > Integer.parseInt(arr2[1]) ? -1 : 1;\n }\n } else {\n return Integer.parseInt(arr1[0]) > Integer.parseInt(arr2[0]) ? -1 : 1;\n }\n }\n else\n return other.calendarDay > this.calendarDay ? -1 : 1;\n }\n else\n return other.calendarMonth > this.calendarMonth ? -1 : 1;\n }\n else\n return other.calendarYear > this.calendarYear ? -1 : 1;\n\n\n// if (this.echo == other.echo) {\n// if (other.calendarMonth == this.calendarMonth) {\n// return 0;\n// }\n// return other.calendarMonth > this.calendarMonth ? -1 : 1;\n// }\n// return this.echo - other.echo;\n }", "@Override\n public int compareTo(CacheEntry cacheEntry) {\n if (arrivalTime < cacheEntry.arrivalTime) return -1;\n else if (arrivalTime > cacheEntry.arrivalTime) return 1;\n else return 0;\n }", "public final void testSortCriteria() throws Exception\n {\n Vector vect = new Vector();\n final long modifier = 100;\n long sdArr[][] = { { 0, 10 }, { 0, 12 }, { 0, 8 }, { -5, 20 }, { -5, 13 }, { -5, 15 }, { -5, -7 }, { 2, 10 },\n { 2, 8 }, { 2, 2 }, { 12, 14 }, { -5, 5 }, { 10, 2 } };\n long sorted[][] = { { -5, -7 }, { 10, 2 }, { 2, 2 }, { -5, 5 }, { 0, 8 }, { 2, 8 }, { 0, 10 }, { 2, 10 },\n { 0, 12 }, { -5, 13 }, { 12, 14 }, { -5, 15 }, { -5, 20 } };\n\n patchArray(sdArr, modifier);\n patchArray(sorted, modifier);\n\n for (int i = 0; i < sdArr.length; i++)\n {\n vect.addElement(new RecordingImplMock(new Date(sdArr[i][0]), sdArr[i][1]));\n }\n RecordingList recordingList = new RecordingListImpl(vect);\n Comparator comparator = new Comparator();\n\n RecordingList newList = recordingList.sortRecordingList(comparator);\n\n assertNotNull(\"recordingList returned null\", newList);\n\n // check results\n LocatorRecordingSpec lrs = null;\n RecordingRequest req = null;\n\n int i = newList.size();\n for (i = 0; i < newList.size(); i++)\n {\n req = (RecordingRequest) newList.getRecordingRequest(i);\n lrs = (LocatorRecordingSpec) req.getRecordingSpec();\n assertEquals(\"sort criteria is wrong\", sorted[i][1], lrs.getDuration());\n }\n }", "@Test\r\n public void testGetShapesSortedByTimestamp() {\r\n List<Shape> expectedOutput = new ArrayList<Shape>();\r\n expectedOutput.add(circle);\r\n expectedOutput.add(square);\r\n expectedOutput.add(rectangle);\r\n expectedOutput.add(triangle);\r\n expectedOutput.add(regularPolygon);\r\n List<Shape> actualOutput = screen.sortShape(SortType.TIMESTAMP);\r\n assertEquals(expectedOutput, actualOutput);\r\n }", "public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }", "public int compareTo(ScheduleTime compare) {\n return (this.startHours - compare.startHours) * 100 + (this.startMins - compare.startMins);\n }", "public int compareTo(Event other){\n return other.timestamp.compareTo(timestamp);\n }", "@Override\n\tpublic int compare(Player o1, Player o2) {\n\t\treturn (int) (o1.getTime() - o2.getTime());\t\t\t\t\t\t\t\t\t\t//returns the time difference, if big, then player two is better \n\t}", "@Override\n\tpublic int compareTo(Object arg0) {\n\t\treturn this.start - ((liveRange) arg0).start;\n\t}", "@Override\n public int compare(Score o1, Score o2) {\n\n return o1.getSentId() - o2.getSentId();\n }", "public int compare(Itemset o1, Itemset o2) {\n long time1 = o1.getTimestamp();\n long time2 = o2.getTimestamp();\n if (time1 < time2) {\n return -1;\n }\n return 1;\n }", "LiveData<List<Task>> getSortedTasks(LocalDate startDate,\r\n LocalDate endDate);", "@Override\n public int compare(Task task1, Task task2) {\n return task1.getDate().compareTo(task2.getDate());\n }", "public double getSortTime() {\n return sortTime_;\n }", "public void sortQueries(){\n\t\tif (queries == null || queries.isEmpty()) {\n\t\t\treturn;\n\t\t} else {\n\t\t Collections.sort(queries, new Comparator<OwnerQueryStatsDTO>() {\n @Override\n public int compare(OwnerQueryStatsDTO obj1, OwnerQueryStatsDTO obj2) {\n if(obj1.isArchived() && obj2.isArchived()) {\n return 0;\n } else if(obj1.isArchived()) {\n return 1;\n } else if(obj2.isArchived()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n\n\t }\n\t}", "@Override\n public int compare(Event o1, Event o2) {\n char[] event1 = o1.getEvent().toCharArray();\n char[] event2 = o2.getEvent().toCharArray();\n\n int i = 0; // Intiialize counter variable i\n\n while (i < event1.length && i < event2.length) // We reached the end, stop\n {\n if (event1[i] - event2[i] == 0) /* if the two elements are the same, tells us nothing about difference */\n {\n i++; // Keep going\n }\n\n else if (event1[i] - event2[i] < 0) // If true, this->str[i] comes first\n {\n return -1; // Return -1 for sorting\n }\n\n else if (event1[i] - event2[i] > 0) // If true,argStr.str[i] comes first\n {\n return 1;\n }\n }\n\n if (event1.length < event2.length)\n {\n return -1;\n }\n\n else if (event1.length > event2.length)\n {\n return 1;\n }\n\n else\n {\n return 0;\n }\n\n }", "@Override\n\t\tpublic int compareTo(Pair newThread) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tif(this.wakeTime > newThread.wakeTime) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse if(this.wakeTime < newThread.wakeTime) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}", "@Override\n\tpublic List<Listing> findAllSortedByTime() {\n\t\treturn theListingRepo.findAll(Sort.by(Direction.DESC, \"dateUploaded\"));\n\t}", "@Test\n public void testFail(){\n List<StoryPart> storyParts = new ArrayList<>();\n StoryPart a = new StoryPart(LocalTime.of(0, 2), null, null, StoryEvent.HALF_TIME_A_END, StoryTitle.create(\"halftime 1 end\"),\n StoryDescription.create(\"halftime 2 end\"));\n StoryPart b = new StoryPart(LocalTime.of(0, 3), null, GameMinute.create(\"2.\"), StoryEvent.GOAL, StoryTitle.create(\"Goal 2\"),\n StoryDescription.create(\"goal 2\"));\n StoryPart c = new StoryPart(LocalTime.of(0, 1), null, GameMinute.create(\"1.\"), StoryEvent.YELLOW_CARD,\n StoryTitle.create(\"yellow card 1\"), StoryDescription.create(\"yellow card 1\"));\n storyParts.add(a);\n storyParts.add(b);\n storyParts.add(c);\n\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortA = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortB = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortC = new ArrayList<>(storyParts);\n\n assertEquals(sortA.get(0), sortB.get(0));\n assertEquals(sortA.get(0), sortC.get(0));\n\n assertEquals(sortA.get(1), sortB.get(1));\n assertEquals(sortA.get(1), sortC.get(1));\n\n assertEquals(sortA.get(2), sortB.get(2));\n assertEquals(sortA.get(2), sortC.get(2));\n\n }", "public void sortFinalsList() {\n \n Course course = null;\n int j = 0;\n for (int i = 1; i < finalsList.size(); i++) {\n\n j = i;\n // checks to see if the start time of the element j is less than the\n // previous element, and if j > 0\n while (j > 0) {\n\n // if the current element, is less than the previous, then....\n if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) < 0) {\n\n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n else if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) == 0) {\n \n if (compareTimes(finalsList.get(j).getBeginTime(), finalsList.get(j - 1).getBeginTime()) < 0) {\n \n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n }\n\n // decrement j\n j--;\n }\n }\n }", "public double getSortTime() {\n return sortTime_;\n }", "@Override\n\t\t\t\tpublic int compare(StatisticsItemData o1, StatisticsItemData o2) {\n\t\t\t\t\treturn o2.getDate().compareTo(o1.getDate());\n\t\t\t\t}", "@Override\n public int compare(Object mMailPersonItem1, Object mMailPersonItem2) {\n Conversation tem1 = (Conversation) mMailPersonItem1;\n Conversation tem2 = (Conversation) mMailPersonItem2;\n String[] array = new String[2];\n int cr = 0;\n int a = tem2.mPriority - tem1.mPriority;\n if (a != 0) {\n cr = (a > 0) ? 2 : -1;\n } else {\n //按薪水降序排列\n array[0] = ((Conversation) mMailPersonItem1).mTime;\n array[1] = ((Conversation) mMailPersonItem2).mTime;\n if (array[0].equals(array[1])) {\n cr = 0;\n }\n Arrays.sort(array);\n if (array[0].equals(((Conversation) mMailPersonItem1).mTime)) {\n cr = -2;\n } else if (array[0].equals(((Conversation) mMailPersonItem2).mTime)) {\n cr = 1;\n }\n }\n return cr;\n }", "public int compare(Meeting meetingOne, Meeting meetingTwo) {\n return meetingOne.getDate().compareTo(meetingTwo.getDate());\n }", "boolean hasOrderByDay();", "@Override\r\n\t\tpublic int compareTo(Event compareEvent){\r\n\t\t\t\r\n\t\t\tint compareQuantity = ((Event)compareEvent).date;\r\n\t\t\t//ascending order\r\n\t\t\treturn this.date-compareQuantity;\r\n\t\t\t//descending order\r\n\t\t\t//return compareQuantity -this.quantity;\r\n\t\t}", "@Override\n public int compareTo(TestTask o) {\n assert o != null;\n int result;\n if (this.isEvent()){\n result = o.isEvent() \n ? this.endTime.compareTo(o.endTime) \n : this.endTime.compareTo(o.deadline);\n } else {\n result = o.isEvent() \n ? this.deadline.compareTo(o.endTime) \n : this.deadline.compareTo(o.deadline);\n }\n return result == 0 \n ? this.name.compareTo(o.name)\n : result;\n }", "@Test\n public void testCompareTo () {\n CountDownTimer s1 = new CountDownTimer(5, 59, 00);\n CountDownTimer s2 = new CountDownTimer(6, 01, 00);\n CountDownTimer s3 = new CountDownTimer(5, 50, 20);\n CountDownTimer s4 = new CountDownTimer(\"5:59:00\");\n\n assertTrue(s2.compareTo(s1) > 0);\n assertTrue(s3.compareTo(s1) < 0);\n assertTrue(s1.compareTo(s4) == 0);\n assertTrue(CountDownTimer.compareTo(s2, s4) > 0);\n assertTrue(CountDownTimer.compareTo(s3, s1) < 0);\n assertTrue(CountDownTimer.compareTo(s1, s4) == 0);\n }", "public int compareTo(Message other){\n if(time < other.time) {\n return -1;\n } else { // assume one comes before the other in all instances\n return 1;\n }\n }", "@Override\n public int compareTo(GameScores gs) {\n if (this.getTime() == gs.getTime()) return 0;\n else return this.getTime() > gs.getTime() ? 1 : -1;\n }", "private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }", "public int compare(ThreadWait a, ThreadWait b)\n {\n if(b.wakeUp > a.wakeUp){\n return -1;\n }\n if (b.wakeUp == a.wakeUp){\n return 0;\n }\n \n return 1;\n \n }", "void updateSortingComparators(Comparator<ReadOnlyEntry> eventComparator,\n Comparator<ReadOnlyEntry> deadlineComparator,\n Comparator<ReadOnlyEntry> floatingTaskComparator);", "@Override\n\t\tpublic int compareTo(Job j)\n\t\t{\n\t\t\tJob job = j;\n\t\t\tif (this.getRunTime() < job.getRunTime()) {\n\t\t\t\treturn -1;\n\t\t\t} \n\t\t\treturn 1;\n\t\t}", "@Override\n public int compare(Student o1, Student o2) {\n \n int o1class =\n (o1.getArchived()) ? 4:\n (o1.getStudyStartDate() != null && o1.getStudyEndDate() == null) ? 1:\n (o1.getStudyStartDate() == null && o1.getStudyEndDate() == null) ? 2:\n (o1.getStudyEndDate() != null) ? 3:\n 5;\n int o2class =\n (o2.getArchived()) ? 4:\n (o2.getStudyStartDate() != null && o2.getStudyEndDate() == null) ? 1:\n (o2.getStudyStartDate() == null && o2.getStudyEndDate() == null) ? 2:\n (o2.getStudyEndDate() != null) ? 3:\n 5;\n\n if (o1class == o2class) {\n // classes are the same, we try to do last comparison from the start dates\n return ((o1.getStudyStartDate() != null) && (o2.getStudyStartDate() != null)) ? \n o2.getStudyStartDate().compareTo(o1.getStudyStartDate()) : 0; \n } else\n return o1class < o2class ? -1 : o1class == o2class ? 0 : 1;\n }", "private ArrayList<Task> sortByDate(ArrayList<Task> toSort) {\n ArrayList<Task> sorted = new ArrayList<>();\n\n toSort = removeNoTimeTask(toSort);\n\n int size = toSort.size();\n for (int i = 0; i < size; i++) {\n Date earliest = new Date(Long.MAX_VALUE);\n int earliestIndex = -1;\n for (int j = 0; j < toSort.size(); j++) {\n if (toSort.get(j).getClass().equals(Deadline.class)) {\n Deadline temp = (Deadline) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Event.class)) {\n Event temp = (Event) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Period.class)) {\n Period temp = (Period) toSort.get(j);\n if (temp.getStart().before(earliest)) {\n earliest = temp.getStart();\n earliestIndex = j;\n }\n }\n }\n\n sorted.add(toSort.get(earliestIndex));\n toSort.remove(earliestIndex);\n }\n return sorted;\n }", "@Override\n\tpublic int compareTo(Object o)\n\t{\n\t if(o instanceof Context)\n\t {\n\t \tif (timestamp==null || ((Context) o).timestamp==null)\n\t \t\treturn 0;\n\t return timestamp.compareTo(((Context) o).timestamp);\n\t }\n\t return 0;\n\t}", "@Override\n public int compareTo(Object object) {\n return Comparator\n .comparing(PhoneCall::getStartTime)\n .thenComparing(PhoneCall::getCaller)\n .compare(this, (PhoneCall) object);\n }", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "@Override\r\n\t\t\t\tpublic int compare(Comparendo o1, Comparendo o2) \r\n\t\t\t\t{\n\t\t\t\t\treturn o1.fechaHora.compareTo(o2.fechaHora);\r\n\t\t\t\t}", "@Override\n\t\t\tpublic int compare(Interval o1, Interval o2) {\n\t\t\t\treturn o1.start-o2.start;\n\t\t\t}", "@Override\n\tpublic int compareTo(Edge arg0) {\n\t\treturn arg0.time - this.time;\n\t}", "@Override\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// luon duoc sap xep theo thoi gian thuc hien con lai\n\t\t\tpublic int compare(Integer o1, Integer o2) {\t\t\t\t\t\t // tu be den lon sau moi lan add them gia tri vao \n\t\t\t\tif (burstTimeArr[o1] > burstTimeArr[o2]) return 1;\n\t\t\t\tif (burstTimeArr[o1] < burstTimeArr[o2]) return -1;\n\t\t\t\treturn 0;\n\t\t\t}", "public void setTimeSort(Integer timeSort) {\n this.timeSort = timeSort;\n }", "protected void sortCheck() {\n if (m_instances == null) {\n return;\n }\n \n if (m_simpleConfigPanel.isUsingANativeTimeStamp()) {\n String timeStampF = m_simpleConfigPanel.getSelectedTimeStampField();\n Attribute timeStampAtt = m_instances.attribute(timeStampF); \n if (timeStampAtt != null) {\n \n double lastNonMissing = Utils.missingValue();\n boolean ok = true;\n boolean hasMissing = false;\n for (int i = 0; i < m_instances.numInstances(); i++) {\n Instance current = m_instances.instance(i);\n \n if (Utils.isMissingValue(lastNonMissing)) {\n if (!current.isMissing(timeStampAtt)) {\n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n } else {\n if (!current.isMissing(timeStampAtt)) {\n if (current.value(timeStampAtt) - lastNonMissing < 0) {\n ok = false;\n break;\n }\n \n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n }\n }\n \n if (!ok && !hasMissing) {\n // ask if we should sort\n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". Do you want to sort the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Sorting data...\");\n }\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n \n if (!ok && hasMissing) {\n // we can't really proceed in this situation. We can't sort by the timestamp\n // because instances with missing values will be put at the end of the data.\n // The only thing we can do is to remove the instances with missing time\n // stamps but this is likely to screw up the periodicity and majorly impact\n // on results.\n \n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". \\nFurthermore, there are rows with\\n\" +\n \t\t\"missing timestamp values. We can remove these\\n\" +\n \t\t\"rows and then sort the data but this is likely to\\n\" +\n \t\t\"result in degraded performance. It is strongly\\n\" +\n \t\t\"recommended that you fix these issues in the data\\n\" +\n \t\t\"before continuing. Do you want the system to proceed\\n\" +\n \t\t\"anyway by removing rows with missing timestamps and\\n\" +\n \t\t\"then sorting the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Removing rows with missing time stamps and sorting data...\");\n }\n m_instances.deleteWithMissing(timeStampAtt);\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n }\n }\n }", "@Override\n public int compareTo(AbstractAppointment o) {\n try {\n if (this.beginTime == null) {\n throw new NullPointerException(\"No start time to compare\");\n }\n if (o.getBeginTime() == null) {\n throw new NullPointerException(\"No begin time to compare\");\n }\n long diff = this.beginTime.getTime()-o.getBeginTime().getTime();\n\n if (diff > 0) {\n return 1;\n }\n if (diff < 0) {\n return -1;\n }\n if (diff == 0) {\n long enddiff = this.endTime.getTime()-o.getEndTime().getTime();\n\n if(enddiff >0){\n return 1;\n }\n if(enddiff<0){\n return -1;\n }\n if(enddiff == 0){\n int descriptiondiff = this.description.compareTo(o.getDescription());\n if(descriptiondiff >0){\n return 1;\n }\n if(descriptiondiff<0){\n return -1;\n }\n }\n }\n }\n catch(Exception ex){\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n return 0;\n }", "private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }", "@Override\n public int compareTo(Task task) {\n int r = 0;\n\n if(this.hasStartAndEnd() && task.hasStartAndEnd()) {\n r = this.start.compareTo(task.start);\n if(r == 0) r = this.end.compareTo(task.end);\n } else if(this.hasStartAndEnd()) {\n return -1;\n } else if(task.hasStartAndEnd()) {\n return 1;\n }\n\n if(r == 0) r = this.name.compareTo(task.name);\n if(r == 0) r = this.duration.compareTo(task.duration);\n if(r == 0) r = this.description.compareTo(task.description);\n\n return r;\n }", "public void sort() {\n\t\tArrayList<Medication> dayList = new ArrayList<Medication>();\n\t\tupcomingMedsLabel.setText(\"\");\n\t\tDate dt = new Date();\n\t\tDateFormat df = new SimpleDateFormat(\"EEEE\");\n\t\tString currentDay = df.format(dt);\n\t\t\n\t\t//Runs through all elements in the array\n\t\tfor(int i = 0; i < medList.size(); i++) {\n\t\t\t//Checks to see if the medication needs to be taken today\n\t\t\tif(medList.get(i).getMedDateTime().contains(currentDay)) {\n\t\t\t\tboolean added = false;\n\t\t\t\t//If no other element has been added, added the element\n\t\t\t\tif(dayList.size() == 0) {\n\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t} else {\n\t\t\t\t\t//Checks all other medications in the dayList to order them chronologicaly\n\t\t\t\t\tfor(int j = 0; j < dayList.size(); j++) {\n\t\t\t\t\t\t//Get the hour of element at j and compare it again element at i of medList\n\t\t\t\t\t\tint hour = Integer.parseInt(dayList.get(j).getHour());\n\t\t\t\t\t\t//If < add at j, if equal check minutes else add later\n\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getHour()) < hour) {\n\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (Integer.parseInt(medList.get(i).getHour()) == hour) {\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\t//Checks against minutes\n\t\t\t\t\t\t\tint minute = Integer.parseInt(dayList.get(j).getMinute());\n\t\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getMinute()) < minute) {\n\t\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(dayList.size() > (j + 1)) {\n\t\t\t\t\t\t\t\t\tdayList.add(j+1, medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(added == false) {\n\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Update the upcomingMedsLabel\n\t\tfor(int i = 0; i < dayList.size(); i++) {\n\t\t\tupcomingMedsLabel.setText(upcomingMedsLabel.getText() + \"\\n\\n\" + dayList.get(i));\n\t\t}\n\t}", "@Override\n public int compareTo(Object o) {\n Run run = (Run)o;\n if(runDate.compareTo(run.getRunDate()) == 0){ \n return getName().compareTo(run.getName());\n }else{\n return run.getRunDate().compareTo(getRunDate());\n }\n }", "public int compareTo(Instruction other){\n return this.arrivalTime - other.arrivalTime;\n }", "@Override\n\tpublic int compareTo(Meeting meeting){\n\t\tif(this.getDate().equals(meeting.getDate())){\n\t\t\treturn 0;\n\t\t}\n\t\telse if(this.getDate().before(meeting.getDate())){\n\t\t\treturn -1;\n\t\t}\n\t\telse{\n\t\t\treturn 1;\n\t\t}\n\t}", "@Test\n\tpublic void testAssociatorSort() throws Exception {\n\t\t// add out of order to events list\n\t\tJsonEventInfoComparatorTest comparatorTest = new JsonEventInfoComparatorTest();\n\t\tcomparatorTest.setup();\n\t\ttestService.events.add(comparatorTest.farEvent);\n\t\ttestService.events.add(comparatorTest.fartherEvent);\n\t\ttestService.events.add(comparatorTest.closeEvent);\n\n\t\tJsonEventInfo reference = new JsonEventInfo(comparatorTest.referenceEvent);\n\t\tList<JsonEventInfo> sorted = testAssociator.getSortedNearbyEvents(\n\t\t\t\treference, null);\n\t\tAssert.assertEquals(\"closest event first\",\n\t\t\t\tcomparatorTest.closeEvent, sorted.get(0).getEvent());\n\t\tAssert.assertEquals(\"farther event last\",\n\t\t\t\tcomparatorTest.fartherEvent,\n\t\t\t\tsorted.get(testService.events.size() - 1).getEvent());\n\n\t\tSystem.err.println(testAssociator.formatOutput(reference, null, sorted));\n\t}", "public static void printAllEventListInSortedOrder(){\n sortEvents();\n for(int i=0;i<events.size();i++){\n System.out.println((events.get(i).getMonth()+1)+\"/\"+events.get(i).getDate()+\"/\"+events.get(i).getYear()+\" \"+events.get(i).getStringStartandFinish()+\" \"+events.get(i).getEventTitle());\n }\n }", "@Override\n\tpublic int compareTo(FinishedMatch o) {\n\t\treturn (int)(o.getMatchId() - this.getMatchId());\n\t}", "@Test\n public void ratingAtSameTimeAsStartIsReturned() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n TimePeriod tp = new TimePeriod(firstTime, firstTime.plusHours(4));\n ScoreTime r1 = new ScoreTime(firstTime, 3);\n ScoreTime r2 = new ScoreTime(firstTime.plusHours(3), 3);\n\n List<ScoreTime> returnedList = getRatingsBetweenAndSometimesOneBefore(tp, Arrays.asList(r1, r2));\n assertEquals(2, returnedList.size());\n assertEquals(r1.getTime(), returnedList.get(0).getTime());\n assertEquals(r2.getTime(), returnedList.get(1).getTime());\n }", "@Override\n\tpublic int compareTo(ParsedURLInfo o) {\n\t\treturn this.seqTime.compareTo(o.getSeqTime());\n\t}", "public int compareTo(Actor actor1, Actor actor2) {\n\n List<Event> actorEvents1 = actor1.getEventList();\n List<Event> actorEvents2 = actor2.getEventList();\n\n // it's the same number of events,therefore order further by timestamp\n List<Timestamp> timestampsOfActor1 = DateUtil.getInstance().getTimeStampsOfEventList(actorEvents1);\n Timestamp maxTimestampOfActor1 = DateUtil.getInstance().getMaxTimestamp(timestampsOfActor1);\n\n List<Timestamp> timestampsOfActor2 = DateUtil.getInstance().getTimeStampsOfEventList(actorEvents2);\n Timestamp maxTimestampOfActor2 = DateUtil.getInstance().getMaxTimestamp(timestampsOfActor2);\n\n int resultOfComparingMaxTimestampsOfBothActors = maxTimestampOfActor1.compareTo(maxTimestampOfActor2);\n\n //now since comparing both maximum timestamps and they are the same,we use the login names to compare\n if (resultOfComparingMaxTimestampsOfBothActors == 0) {\n\n String loginNameActor1 = actor1.getLogin().trim();\n String loginNameActor2 = actor2.getLogin().trim();\n\n //finally we compare the strings ignoring case and since the login name is unique,\n // we can be sure that the list will be sorted alphabetically perfectly\n return loginNameActor1.compareToIgnoreCase(loginNameActor2);\n }\n //it will be greater than or equal so we return it,\n // but we need to go vice versa because we need it in ascending order not desceding\n return (resultOfComparingMaxTimestampsOfBothActors == -1) ? 1 : -1;\n }", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }", "public void sortQ(ArrayList<String> requestQ){\r\n\t\tfor(int i=0; i< (requestQ.size()-1); i++){\r\n\t\t\tint small = i;\r\n\t\t\tfor(int j = i+1; j < requestQ.size(); j++){\r\n\t\t\t\tString value1 = (String) requestQ.get(small);\r\n\t\t\t\tString[] temp1 = value1.split(\",\");\r\n\t\t\t\tString value2 = (String) requestQ.get(j);\r\n\t\t\t\tString[] temp2 = value2.split(\",\");\r\n\t\t\t\t// if timestamp is lower\r\n\t\t\t\tif(Integer.parseInt(temp1[1]) > Integer.parseInt(temp2[1])){\r\n\t\t\t\t\tsmall = j;\r\n\t\t\t\t}\r\n\t\t\t\t// if timestamp is equal\r\n\t\t\t\telse if(Integer.parseInt(temp1[1]) == Integer.parseInt(temp2[1])){\r\n\t\t\t\t\t// check for process ids\r\n\t\t\t\t\tif(Integer.parseInt(temp1[0]) > Integer.parseInt(temp2[0])){\r\n\t\t\t\t\t\tsmall = j;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}// inner for loop\r\n\t\tString swap = (String)requestQ.get(i);\r\n\t\trequestQ.set(i, requestQ.get(small));\r\n\t\trequestQ.set(small, swap);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public static void listByWatched(){\r\n System.out.println('\\n'+\"List by Watched\");\r\n CompareWatched compareWatched = new CompareWatched();\r\n Collections.sort(movies, compareWatched);\r\n for (Movie watch:movies){\r\n System.out.println('\\n'+\"Times Watched \"+ watch.getTimesWatched()+'\\n'+\"Title: \"+ watch.getName()+'\\n'+\"Rating: \"+ watch.getRating()+'\\n');\r\n }\r\n }", "public int compare(Object a, Object b) {\n if (a == b) {\n return 0;\n }\n CountedObject ca = (CountedObject)a;\n CountedObject cb = (CountedObject)b;\n int countA = ca.count;\n int countB = cb.count;\n if (countA < countB) {\n return 1;\n }\n if (countA > countB) {\n return -1;\n }\n return 0;\n }", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\tList<StatetostateDetail> list = new ArrayList<StatetostateDetail>();\n\t\tfor(int i = 1; i < 16; i++){\n\t\t\tStatetostateDetail s = new StatetostateDetail();\n\t\t\ts.setId(i);\n\t\t\ts.setStatue(0);\n\t\t\ts.setTime(System.currentTimeMillis() + (i + i * 100));\n\t\t\tlist.add(s);\n\t\t}\n\t\tlist.get(3).setStatue(1);\n\t\tlist.get(5).setStatue(1);\n\t\tlist.get(10).setStatue(1);\n\t\tlist.get(14).setStatue(1);\n\t\tlist.get(7).setStatue(2);\n\t\tlist.get(9).setStatue(2);\n\t\tSystem.out.println(\"list:\" + list);\n\t\n\t\t\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \tLong t1 = null;\n \tLong t2 = null;\n \ttry{\n \t\tt1 = s1.getTime();\n\t \tt2 = s2.getTime();\n \t}catch(Exception e){\n \t\te.printStackTrace();\n \t}\n \n return t2.compareTo(t1);\n }\n });\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \treturn s1.getStatue()>s2.getStatue()?1:(s1.getStatue()==s2.getStatue()?0:(s2.getTime()>s1.getTime()?-1:0));\n }\n });\n\t\t\n\t\tSystem.out.println(\"list:\" + list);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}" ]
[ "0.6694357", "0.66612476", "0.6291751", "0.59298056", "0.58945274", "0.5891976", "0.58677155", "0.58254486", "0.5794877", "0.57768446", "0.5767092", "0.5760854", "0.56985486", "0.5683411", "0.5642523", "0.56283975", "0.56255466", "0.5597049", "0.5596312", "0.5588556", "0.55716926", "0.55674493", "0.5548898", "0.5527646", "0.5503035", "0.5470602", "0.5468994", "0.544463", "0.54377776", "0.54253644", "0.5420392", "0.5415489", "0.54029685", "0.5396878", "0.5351628", "0.5351119", "0.5348272", "0.5310749", "0.5309035", "0.52867013", "0.5278117", "0.52671933", "0.5249782", "0.52054423", "0.5190858", "0.5187318", "0.51733357", "0.5168855", "0.5148492", "0.5131151", "0.51284367", "0.51162946", "0.5109887", "0.50986457", "0.5094033", "0.50938654", "0.5092142", "0.5091148", "0.50837064", "0.5072117", "0.507202", "0.50671804", "0.5063786", "0.50636005", "0.506355", "0.50474876", "0.5044038", "0.5043978", "0.50201267", "0.50146043", "0.50008637", "0.49975994", "0.49965397", "0.49920973", "0.49900374", "0.498679", "0.49864885", "0.4985889", "0.49776408", "0.49769437", "0.4976621", "0.49649894", "0.49583635", "0.4945916", "0.49404207", "0.49252322", "0.4923526", "0.49221042", "0.49092817", "0.48954228", "0.4894622", "0.4890659", "0.48902988", "0.4883655", "0.48825788", "0.4877681", "0.48723975", "0.4864697", "0.4863434", "0.48598024", "0.48525253" ]
0.0
-1
Organize the list of pages according to their descending Authority Scores
public void sortAuthority(List<Page> result) { Collections.sort(result, new Comparator<Page>() { public int compare(Page p1, Page p2) { // Sorts by 'TimeStarted' property return p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2); } // If 'TimeStarted' property is equal sorts by 'TimeEnded' property public int secondaryOrderSort(Page p1, Page p2) { return p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1 : p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Iterator rankOrdering(Iterator pages)\n\t{\n\t\t//Iterator allWebNode = ind.retrievePages(keyword);\n\t\tIterator allWebNode = pages;\n\t\tif(allWebNode.hasNext()){\n\t\t\tWebNode wb = (WebNode) allWebNode.next();\n\t\t\tint score = wb.getInDegree() * wb.getWordFreq(keyword);\n\t\t\twb.keywordScore = score;\n\t\t\taL.add(wb); \n\t\t}\n\t\t\n\t\twhile (allWebNode.hasNext()) {\n\t\t\tWebNode nwb = (WebNode) allWebNode.next();\n\t\t\tint nscore = nwb.getInDegree() * nwb.getWordFreq(keyword);\n\t\t\tnwb.keywordScore = nscore;\n\t\t\tint i = 0; \n\t\t\twhile(i<aL.size()){\n\t\t\t\tif (nwb.keywordScore < ((WebNode) aL.get(i)).keywordScore)\n\t\t\t \ti++;\n\t\t\t else\n\t\t\t \taL.add(i,nwb);\n\t\t\t} \n\t\t}\n\t\t\n\t\treturn aL.iterator();\n\t}", "public void sortScoresDescendently(){\n this.langsScores.sort((LangScoreBankUnit o1, LangScoreBankUnit o2) -> {\n return Double.compare(o2.getScore(),o1.getScore());\n });\n }", "private void sortPlayerScores(){\n text=\"<html>\";\n for (int i = 1; i <= Options.getNumberOfPlayers(); i++){\n if(Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey() != null){\n Integer pl = Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey();\n if(pl != null && playerScores.containsKey(pl)){\n text += \"<p>Player \" + pl + \" Scored : \" + playerScores.get(pl) + \" points </p></br>\";\n playerScores.remove(pl);\n }\n }\n }\n text += \"</html>\";\n }", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "public void report(List<Page> result) {\n\n\t\t// Print Pages out ranked by highest authority\n\t\tsortAuthority(result);\n\t\tSystem.out.println(\"AUTHORITY RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.authority);\n\t\tSystem.out.println();\n\t\t// Print Pages out ranked by highest hub\n\t\tsortHub(result);\n\t\tSystem.out.println(\"HUB RANKINGS : \");\n\t\tfor (Page currP : result)\n\t\t\tSystem.out.printf(currP.getLocation() + \": \" + \"%.5f\" + '\\n', currP.hub);\n\t\tSystem.out.println();\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Authority score: \" + getMaxAuthority(result).getLocation());\n\t\t// Print Max Authority\n\t\tSystem.out.println(\"Page with highest Hub score: \" + getMaxAuthority(result).getLocation());\n\t}", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "public void sortScores(){\r\n // TODO: Use a single round of bubble sort to bubble the last entry\r\n // TODO: in the high scores up to the correct location.\r\n \tcount=0;\r\n \tfor(int i=Settings.numScores-1; i>0;i--){\r\n \t\tif(scores[i]>scores[i-1]){\r\n \t\t\tint tempS;\r\n \t\t\ttempS=scores[i];\r\n \t\t\tscores[i]=scores[i-1];\r\n \t\t\tscores[i-1]=tempS;\r\n \t\t\t\r\n \t\t\tString tempN;\r\n \t\t\ttempN=names[i];\r\n \t\t\tnames[i]=names[i-1];\r\n \t\t\tnames[i-1]=tempN;\r\n \t\t\tcount++;\r\n \t\t}\r\n \t}\r\n }", "public double SumOutlinkAuthorityScore(Page page) {\n\t\tList<String> outLinks = page.getOutlinks();\n\t\tdouble authScore = 0;\n\t\tfor (String outLink1 : outLinks) {\n\t\t\tPage outLink = pTable.get(outLink1);\n\t\t\tif (outLink != null)\n\t\t\t\tauthScore += outLink.authority;\n\t\t}\n\t\treturn authScore;\n\t}", "private void sortEScores() {\n LinkedHashMap<String, Double> sorted = eScores\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n eScores = sorted;\n }", "public void sortHighscores(){\n Collections.sort(highscores);\n Collections.reverse(highscores);\n }", "public void sortHighScores(){\n for(int i=0; i<MAX_SCORES;i++){\n long score = highScores[i];\n String name= names[i];\n int j;\n for(j = i-1; j>= 0 && highScores[j] < score; j--){\n highScores[j+1] = highScores[j];\n names[j+1] = names[j];\n }\n highScores[j+1] = score;\n names[j+1] = name;\n }\n }", "public void sortCompetitors(){\n\t\t}", "public List<Page> normalize(List<Page> pages) {\n\t\tdouble hubTotal = 0;\n\t\tdouble authTotal = 0;\n\t\tfor (Page p : pages) {\n\t\t\t// Sum Hub scores over all pages\n\t\t\thubTotal += Math.pow(p.hub, 2);\n\t\t\t// Sum Authority scores over all pages\n\t\t\tauthTotal += Math.pow(p.authority, 2);\n\t\t}\n\t\t// divide all hub and authority scores for all pages\n\t\tfor (Page p : pages) {\n\t\t\tif (hubTotal > 0) {\n\t\t\t\tp.hub /= hubTotal;\n\t\t\t} else {\n\t\t\t\tp.hub = 0;\n\t\t\t}\n\t\t\tif (authTotal > 0) {\n\t\t\t\tp.authority /= authTotal;\n\t\t\t} else {\n\t\t\t\tp.authority = 0;\n\t\t\t}\n\t\t}\n\t\treturn pages; // with normalised scores now\n\t}", "private void sortCourses() {\n ctrl.sortCourses().forEach(System.out::println);\n }", "public Page getMaxAuthority(List<Page> result) {\n\t\tPage maxAuthority = null;\n\t\tfor (Page currPage : result) {\n\t\t\tif (maxAuthority == null || currPage.authority > maxAuthority.authority)\n\t\t\t\tmaxAuthority = currPage;\n\t\t}\n\t\treturn maxAuthority;\n\t}", "private static void rankCourses() {\r\n\t\tfor (String subject : courses.keySet()) {\r\n\t\t\tLinkedList<Course> subjectCourses = courses.get(subject);\r\n\t\t\tfor (int i = 1; i <= 8; i++) {\r\n\t\t\t\tswitch (i) {\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\t// Subject rank\r\n\t\t\t\t\tintRanker(1, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\t// Student satisfaction\r\n\t\t\t\t\tintRanker(2, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\t// Nationwide ranking\r\n\t\t\t\t\tdoubleRanker(3, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\t// Cost of living\r\n\t\t\t\t\tdoubleRanker(4, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\t// Student to faculty ratio\r\n\t\t\t\t\tdoubleRanker(5, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\t// Research Output\r\n\t\t\t\t\tintRanker(6, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\t// International students\r\n\t\t\t\t\tdoubleRanker(7, subjectCourses);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 8:\r\n\t\t\t\t\t// Graduate prospects\r\n\t\t\t\t\tdoubleRanker(8, subjectCourses);\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}", "List<SurveyQuestion> sortByPageAndPosition(List<SurveyQuestion> questions);", "public static Student[] sortScore( Student s[]){\n\t\tStudent temp ;\r\n\t\tfor(int i=0; i<s.length; i++){\r\n\t\t\tfor(int j=i+1; j<s.length;j++)\r\n\t\t\t\tif(s[i].score > s[j].score){\r\n\t\t\t\t\ttemp = s[i];\r\n\t\t\t\t\ts[i] = s[j];\r\n\t\t\t\t\ts[j]= temp;\r\n\t\t\t\t} \t\t\t\r\n\t\t\t}\r\n\t\t\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Students with score<50 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score<50){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Students with score>=50 and <65 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=50 && s[i].score<65){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Students with score>=65 and <80 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=65 && s[i].score<80){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Students with score>=80 and <100 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=80 && s[i].score<=100){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn s;\r\n\r\n\r\n\t}", "public void createSummary(){\n\n for(int j=0;j<=noOfParagraphs;j++){\n int primary_set = paragraphs.get(j).sentences.size()/5;\n\n //Sort based on score (importance)\n Collections.sort(paragraphs.get(j).sentences,new SentenceComparator());\n for(int i=0;i<=primary_set;i++){\n contentSummary.add(paragraphs.get(j).sentences.get(i));\n }\n }\n\n //To ensure proper ordering\n Collections.sort(contentSummary,new SentenceComparatorForSummary());\n printSummary();\n }", "private void sortArticlesByRating() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"Ratings\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Map<Double,ArrayList<Article>> articlesTreeMap;\n articlesTreeMap = new TreeMap<>(Collections.reverseOrder());\n for(Article a : articles) {\n DataSnapshot ratingArticleSnapShot = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if (a.getLink() != null && a.getLink() != \"\" && snapshot.child(\"Link\").getValue().equals(a.getLink())) {\n ratingArticleSnapShot = snapshot;\n break;\n }\n }\n Double rating = 0.0;\n if (ratingArticleSnapShot != null) {\n int totalVoteCount = 0, weightedSum = 0;\n for(int i=1 ;i<=5 ;i++) {\n int numberOfVotes = Integer.parseInt(ratingArticleSnapShot.child(\"Votes\").child(String.valueOf(i)).getValue().toString());\n weightedSum += (i * numberOfVotes);\n totalVoteCount += numberOfVotes;\n }\n rating = ((double) weightedSum) / ((double) totalVoteCount);\n }\n if(!articlesTreeMap.containsKey(rating)) {\n articlesTreeMap.put(rating, new ArrayList<Article>());\n }\n articlesTreeMap.get(rating).add(a);\n }\n\n articles.clear();\n for(Map.Entry<Double,ArrayList<Article>> entry : articlesTreeMap.entrySet()) {\n ArrayList<Article> list = entry.getValue();\n articles.addAll(list);\n }\n mSectionsPagerAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "public void sort()\n {\n com.jayway.restassured.response.Response response= given().relaxedHTTPSValidation().when().get(\"http://18.222.188.206:3333/accounts?_sort=title&_order=asc\");\n response.then().assertThat().statusCode(200);\n System.out.println(\"The accounts that are sorted according to it's title is displayed below:\");\n response.prettyPrint();\n \n }", "public static void main(String[] args) throws IOException \n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.print(\"Please input the keyword: \");\n\t\tString keyword = sc.next();\n\t\tsc.close();\n\t\n\t\tKeywordList kLst = new KeywordList();\t\n\t\tSystem.out.println(\"-------------------------------------------------------\\nRelative Word List: \");\n\t\tkLst.printKeywordList(kLst.getKeywords());\n\t\tSystem.out.print(\"-------------------------------------------------------\\nValid Web Pages for Keyword [\" + keyword + \"]: \\n\");\n\t\tGoogleSearch google = new GoogleSearch(keyword);\n\t\tSystem.out.print(google.toString());\n\t\t\n\t\tArrayList<WebNode> wLst = new ArrayList<WebNode>();\t\n\t\t\n\t\ttry \n\t\t{\t\t\n\t\t\tfor(String title: google.query().keySet()) \n\t\t\t{\n\t\t\t\tString webUrl = google.query().get(title);\t\n\t\t\t\tWebPage rootPage = new WebPage(webUrl, title);\n\t\t\t\tWebTree tree = new WebTree(rootPage);\n\t\t\t\t\t\n\t\t\t\tChildPageQuery childQ = new ChildPageQuery(webUrl);\n\t\t\t\tint count = 0;\n\t\t\t\tif(childQ.query() != null) \n\t\t\t\t{\t\t\t\n\t\t\t\t\tfor(String childUrl: childQ.query()) \n\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\tcount++;\t\t\t\t\t\t\t\n\t\t\t\t\t\ttree.root.addChild(new WebNode(new WebPage(childUrl, count + \"\")));\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\ttree.setPostOrderScore(kLst.getKeywords());\n\t\t\t\t\twLst.add(tree.root);\n\t\t\t\t}\n\t\t\t}\t\n\t\t\t\n\t\t\tWebRating rating = new WebRating(wLst);\n\t\t\trating.sort();\n\t\t\tSystem.out.println(\"-------------------------------------------------------\\n★★★Rating★★★\\n(Title, Total Child Pages, Total Root Page Score)\");\n\t\t\tSystem.out.print(rating.output());\n\t\t} \n\n\t\tcatch(IOException e)\n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "private static List<String> getTopNCompetitors(int numCompetitors,\n int topNCompetitors, \n List<String> competitors,\n int numReviews,\n List<String> reviews) {\n\t\t\n\t\t HashMap<String, Integer> map = new HashMap<>();\n\t\t for(String comp : competitors){\n\t map.put(comp.toLowerCase(),0);\n\t }\n\t\t\n\t for(String sentence : reviews){\n\t String[] words = sentence.split(\" \"); // get all the words in one sentence and put them in a String array \n\t for(String word : words){\n\t if(map.containsKey(word.toLowerCase())) { // check if map has any of the words (competitor name). if yes increase its value\n\t map.put(word.toLowerCase(), map.get(word.toLowerCase()) + 1);\n\t }\n\t }\n\t }\n\t \n\t PriorityQueue<String> pq =new PriorityQueue<>((String i1,String i2)->{ \n\t return map.get(i1)-map.get(i2); \n\t });\n\t for(String key:map.keySet()){\n\t pq.add(key);\n\t if(pq.size()>topNCompetitors) pq.poll();\n\t }\n\t List<String> result=new ArrayList<>();\n\t while(!pq.isEmpty())\n\t result.add(pq.poll());\n\t \n\t Collections.reverse(result);\n\t \n\t return result; \n\t \n}", "public void winner() {\n\t\tList<String> authors = new ArrayList<String>(scores_authors.keySet());\n\t\tCollections.sort(authors, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_authors.get(o1).compareTo(scores_authors.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des auteurs :\");\n\t\tfor(String a :authors) {\n\t\t\tSystem.out.println(a.substring(0,5)+\" : \"+scores_authors.get(a));\n\t\t}\n\t\t\n\t\tList<String> politicians = new ArrayList<String>(scores_politicians.keySet());\n\t\tCollections.sort(politicians, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_politicians.get(o1).compareTo(scores_politicians.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des politiciens :\");\n\t\tfor(String p :politicians) {\n\t\t\tSystem.out.println(p.substring(0,5)+\" : \"+scores_politicians.get(p));\n\t\t}\n\t}", "public static void topAwards(MongoDatabase db){\n\t\tAggregateIterable<Document> query3=db.getCollection(\"bios\")\n\t\t\t\t.aggregate(Arrays.asList(\n\t\t\t\t\t\tnew Document(\"$unwind\",\"$awards\"),\n\t\t\t\t\t\tnew Document(\"$group\", new Document(\"_id\", new Document(\"name\",\"$name.first\").append(\"lastname\", \"$name.last\")).append(\"premios\", new Document(\"$sum\",1))),\n\t\t\t\t\t\tnew Document(\"$sort\", new Document(\"premios\",-1)),\n\t\t\t\t\t\tnew Document(\"$project\", new Document(\"_id\",\"$_id\").append(\"Total_Premios\", \"$premios\"))\n\t\t\t\t\t\t));\n\t\t\n\t\tSystem.out.println(\"Ranking de premios recibidos\");\n\t\tfor(Document d3: query3){\n\t\t\tSystem.out.println(d3);\n\t\t}\n\t}", "List<Athlete> getAllOrderByScore(OrderBy orderBy);", "private void displayStudentByGrade() {\n\n studentDatabase.sortArrayList();\n\n for (Student student : studentDatabase) {\n\n stdOut.println(student.toStringsort() + \"\\n\");\n }\n }", "@Override\r\n\tpublic String getPage() {\n\t\ttry {\r\n\t\t\tWriter wr = new OutputStreamWriter(\r\n\t\t\t\t\tnew FileOutputStream(OutputPath), \"utf-8\");\r\n\t\t\tList<String> colleges = IOUtil.read2List(\r\n\t\t\t\t\t\"property/speciality.properties\", \"GBK\");\r\n\t\t\tfor (String college : colleges) {\r\n\t\t\t\tfor (int i = 1; i < 10000; i++) {\r\n\t\t\t\t\tString html = getSeach(college, null, null, 1, i);\r\n\t\t\t\t\tif (html.equals(\"\")) {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tDocument page = Jsoup.parse(html);\r\n\t\t\t\t\tElements authors = page.getElementsByAttributeValue(\r\n\t\t\t\t\t\t\t\"class\", \"listBox wauto clearfix\");\r\n\t\t\t\t\tfor (Element author : authors) {\r\n\t\t\t\t\t\tElement e = author.getElementsByAttributeValue(\"class\",\r\n\t\t\t\t\t\t\t\t\"xuezheName\").get(0);\r\n\t\t\t\t\t\tElement a = e.getElementsByAttributeValue(\"target\",\r\n\t\t\t\t\t\t\t\t\"_blank\").first();\r\n\t\t\t\t\t\tString name = a.text();\r\n\t\t\t\t\t\tString school = author.getElementsByAttributeValue(\r\n\t\t\t\t\t\t\t\t\"class\", \"f14\").text();\r\n\t\t\t\t\t\tString id = a.attr(\"href\");\r\n\t\t\t\t\t\tString speciallity = author\r\n\t\t\t\t\t\t\t\t.getElementsByAttributeValue(\"class\",\r\n\t\t\t\t\t\t\t\t\t\t\"xuezheDW\").first().text();\r\n\t\t\t\t\t\twr.write(school + \"\\t\" + id + \"\\t\" + speciallity\r\n\t\t\t\t\t\t\t\t+ \"\\r\\n\");\r\n\t\t\t\t\t\tSystem.out.println(i + \":\" + school);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twr.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private void sortRating()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "ArrayList<String> getScoreContent(String order) {\n ArrayList<String> ids = new ArrayList<>();\n String name = \"\";\n String score = \"\";\n if (order.equals(\"Ascending\")) {\n for (Object o : topScores.keySet().toArray()) {\n name = name + o.toString() + \"\\r\\n\";\n }\n for (Object o : topScores.values().toArray()) {\n score = score + o.toString() + \"\\r\\n\";\n }\n } else if (order.equals(\"Descending\")) {\n for (Object o : topScores.keySet().toArray()) {\n name = o.toString() + \"\\r\\n\" + name;\n }\n for (Object o : topScores.values().toArray()) {\n score = o.toString() + \"\\r\\n\" + score;\n }\n }\n ids.add(name);\n ids.add(score);\n return ids;\n }", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "@GetMapping(\"/scores/year/{year}\")\n\tpublic ResponseEntity<ArrayNode> getYearlyTopScores(@PathVariable int year) {\n\t\t// List of JSON objects\n\t\tArrayNode result = mapper.createArrayNode();\n\n\t\t// List of array of BigIntegers that contain userId and month score\n\t\tList<Object[]> orderedScores = new ArrayList<>();\n\t\torderedScores = this.scoreRepo.findAllYearlyScores(year);\n\n\t\tfor (int i = 0; i < 10 && i < orderedScores.size(); i++) {\n\t\t\t// current userId and month score\n\t\t\tObject[] currScore = orderedScores.get(i);\n\t\t\t// One JSON object\n\t\t\tObjectNode score = mapper.createObjectNode();\n\t\t\t// Convert BigInteger to long and int\n\t\t\tlong userId = ((Number) currScore[0]).longValue();\n\t\t\tint monthScore = ((Number) currScore[1]).intValue();\n\t\t\tCustomUser user = this.userRepo.findById(userId);\n\t\t\tString username = user.getUsername();\n\n\t\t\tscore.put(\"rank\", i + 1);\n\t\t\tscore.put(\"username\", username);\n\t\t\tscore.put(\"user\", userId);\n\t\t\tscore.put(\"score\", monthScore);\n\t\t\tscore.put(\"picId\", user.getPicId());\n\t\t\t// add to result array of JSON objects\n\t\t\tresult.add(score);\n\t\t}\n\n\t\treturn ResponseEntity.ok().body(result);\n\t}", "public static List<Course> sortElNumOfStdLimitByTwo(List<Course> courseList){\n return courseList.stream().\n sorted(Comparator.comparing(Course::getNumberOfStudents)).\n limit(2).\n collect(Collectors.toList());\n }", "private void sortScoreboard() {\n score.setSortType(TableColumn.SortType.DESCENDING);\n this.scoreboard.getSortOrder().add(score);\n score.setSortable(true);\n scoreboard.sort();\n }", "public List<Page> hits(String query) {\n\t\t// pages <- EXPAND-PAGES(RELEVANT-PAGES(query))\n\t\tList<Page> pages = expandPages(relevantPages(query));\n\t\t// for each p in pages\n\t\tfor (Page p : pages) {\n\t\t\t// p.AUTHORITY <- 1\n\t\t\tp.authority = 1;\n\t\t\t// p.HUB <- 1\n\t\t\tp.hub = 1;\n\t\t}\n\t\t// repeat until convergence do\n\t\twhile (!convergence(pages)) {\n\t\t\t// for each p in pages do\n\t\t\tfor (Page p : pages) {\n\t\t\t\t// p.AUTHORITY <- &Sigma<sub>i</sub> INLINK<sub>i</sub>(p).HUB\n\t\t\t\tp.authority = SumInlinkHubScore(p);\n\t\t\t\t// p.HUB <- &Sigma;<sub>i</sub> OUTLINK<sub>i</sub>(p).AUTHORITY\n\t\t\t\tp.hub = SumOutlinkAuthorityScore(p);\n\t\t\t}\n\t\t\t// NORMALIZE(pages)\n\t\t\tnormalize(pages);\n\t\t}\n\t\treturn pages;\n\n\t}", "public void printInOrder() {\n\t\tCollections.sort(students);\n\t\tSystem.out.println(\"Student Score List\");\n\t\tfor(Student student : students) {\n\t\t\tSystem.out.println(student);\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void sortAuthor(){\r\n \r\n Book temp; // used for swapping books in the array\r\n for(int i=0; i<items.size(); i++) {\r\n\r\n\t // Check to see the item is a book. We will only\r\n //use books.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.BOOK)\r\n\t continue;\r\n\t\t\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only books\r\n\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.BOOK)\r\n\t\t continue;\r\n\t\t // Compare the authors of the two books\r\n\t if(((Book)items.get(i)).getAuthor().compareTo(((Book)items.get(j)).getAuthor()) > 0) {\r\n\t\t // Swap the items\r\n\t\t temp = (Book)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n for(int i=0; i<items.size(); i++)\r\n\t if(items.get(i).getItemType() == Item.ItemTypes.BOOK)\r\n\t\tSystem.out.println(items.get(i).toString());\r\n \t\r\n }", "public void sortDocumentsByDocnos() {\n order = new int[mDocSet.length];\n mDocSet_tmp = new double[mDocSet.length];\n accumulated_scores_tmp = new float[mDocSet.length];\n\n for (int i = 0; i < order.length; i++) {\n order[i] = i;\n mDocSet_tmp[i] = mDocSet[i];\n accumulated_scores_tmp[i] = accumulated_scores[i];\n }\n\n ivory.smrf.model.constrained.ConstraintModel.Quicksort(mDocSet_tmp, order, 0, order.length - 1);\n\n for (int i = 0; i < order.length; i++) {\n mDocSet[i] = (int) mDocSet_tmp[i];\n accumulated_scores[i] = accumulated_scores_tmp[order[i]];\n }\n }", "private List<? extends Publication> sortPublicationsAfterTitle(Collection<? extends Publication> publicationList) {\n\n return publicationList.stream().sorted(Comparator.comparing(Publication::getTitle)).collect(Collectors.toList());\n }", "public ArrayList<Question> getQuestionsSortedByScore() {\n \t\tArrayList<Question> sortedQuestions = questions;\n \n \t\tCollections.sort(sortedQuestions, Collections.reverseOrder(new ScoreComparator()));\n \t\t\n \t\treturn sortedQuestions;\n \t}", "public void sort() {\n documents.sort();\n }", "public void sortBasedYearService();", "java.lang.String getAuthorities(int index);", "public void printScore(PrintWriter out) {\n out.format(\"SCORE OF %d PLAYERS%n\", players.size());\n out.println(\"ID\\tCASH\\tTYPE\");\n \t\n // Cria uma lista com os jogadores\n \tList<Competitor> score = new ArrayList<Competitor>(players.keySet());\n\n \t// Ordena os jogadores com base no total de cash\n \tCollections.sort(score, new PlayerComparator());\n\n \t// Imprime os resultados\n \tfor(Competitor c : score) {\n \t\tout.format(\"%d.%d\\t%.2f\\t(%s)%n\", players.get(c).Type,\n players.get(c).Id, c.getTotalCash(),\n c.getClass().getSimpleName());\n \t}\n out.flush();\n }", "public void sort_crystals() {\n\t\tArrays.sort(identifiedArray, new SortByRating()); \n\t}", "private void sortOutlines() {\r\n Collections.sort(outlines, reversSizeComparator);\r\n }", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate static ArrayList<Result> sortByScore(ArrayList<Result> sortThis){\n\t\tArrayList<Result> sorted = sortThis;\n\t\tCollections.sort(sorted, new Comparator(){\n\t\t\t\n\t\t\tpublic int compare(Object o1, Object o2){\n\t\t\t\tResult r1 = (Result) o1;\n\t\t\t\tResult r2 = (Result) o2;\n\n\t\t\t\tDouble Score1 = new Double(r1.getScore());\n\t\t\t\tDouble Score2 = new Double(r2.getScore());\n\t\t\t\treturn Score1.compareTo(Score2);\n\t\t\t}\n\t\t});\n\t\tCollections.reverse(sorted);\n\t\t\n\t\treturn sorted;\n\t}", "public int compare(Object a, Object b)\n {\n WebPage webPage1 = (WebPage) a;\n WebPage webPage2 = (WebPage) b;\n\n if(webPage1.getRank() < webPage2.getRank())\n {\n return -1;\n }\n\n if(webPage1.getRank() > webPage2.getRank())\n {\n return 1;\n }\n\n return 0;\n }", "public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }", "public static List<Course> sortElNumOfStdSkipFirstLimitByTwo(List<Course> courseList){\n return courseList.\n stream().\n sorted(Comparator.comparing(Course::getNumberOfStudents)).\n skip(1).\n limit(2).\n collect(Collectors.toList());\n }", "@Test\n public void sort_Courses() throws InterruptedException {\n HomePage homePage = new HomePage(driver);\n homePage.search();\n\n Courses courses = new Courses(driver);\n String actualUrl = courses.sortCourses(\"Highest Rated\");\n String expectedUrl = \"https://www.udemy.com/courses/development/software-testing/?sort=highest-rated\";\n\n Assert.assertEquals(actualUrl, expectedUrl);\n }", "private void printingSearchResults() {\n HashMap<Integer, Double> resultsMap = new HashMap<>();\n for (DocCollector collector : resultsCollector) {\n if (resultsMap.containsKey(collector.getDocId())) {\n double score = resultsMap.get(collector.getDocId()) + collector.getTermScore();\n resultsMap.put(collector.getDocId(), score);\n } else {\n resultsMap.put(collector.getDocId(), collector.getTermScore());\n }\n }\n List<Map.Entry<Integer, Double>> list = new LinkedList<>(resultsMap.entrySet());\n Collections.sort(list, new Comparator<Map.Entry<Integer, Double>>() {\n public int compare(Map.Entry<Integer, Double> o1,\n Map.Entry<Integer, Double> o2) {\n return (o2.getValue()).compareTo(o1.getValue());\n }\n });\n if (list.isEmpty())\n System.out.println(\"no match\");\n else {\n DecimalFormat df = new DecimalFormat(\".##\");\n for (Map.Entry<Integer, Double> each : list)\n System.out.println(\"docId: \" + each.getKey() + \" score: \" + df.format(each.getValue()));\n }\n\n }", "public void sortByPopularity() {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - sortByPopularity\");\n\n listInteractor.sortByPopularity(new ListCallback() {\n @Override\n public void setPhotosList(List<BasePojo.Result> photosList) {\n Log.d(Contract.TAG_WORK_PROCESS_CHECKING, \"ListPresenter - ListCallback - setPhotosList\");\n getViewState().setData(photosList);\n }\n });\n }", "public Scores[] dbSorter(int score, String name){\n\n\n Scores s1 = new Scores(score, name); // makes the current score and name into a score object\n\n db.addScore(s1);\n Scores[] scoreList = db.getAllScores(); // gets score list from main activity\n scoreList = db.sortScores(scoreList);\n Log.i(\"Scores count\", Integer.toString(db.getScoresCount()));\n\n return scoreList;\n }", "private static void print_Assignment(Gradebook gradebook, String[] flags) {\n //sort grades highest to lowest\n if (flags[3] != null && flags[3].equals(\"G\")) {\n List<Student> studentList = gradebook.getAllStudents();\n Map<Integer, Set<Student>> gradeToName = new HashMap<Integer, Set<Student>>();\n Set<Integer> grades = new HashSet<Integer>();\n\n for(Student s : studentList){\n Assignment assign = gradebook.getAssignment(flags[0]);\n Map<Assignment, Integer> gradeMap = gradebook.getStudentGrades(s);\n Integer grade = gradeMap.get(assign);\n\n Set<Student> studs = gradeToName.get(grade);\n if(studs == null){\n\n studs = new HashSet<Student>();\n }\n\n studs.add(s);\n gradeToName.put(grade, studs);\n grades.add(grade);\n }\n\n List<Integer> sortedList = new ArrayList<Integer>(grades);\n Collections.sort(sortedList, Collections.reverseOrder());\n\n for(Integer i : sortedList){\n Set<Student> studs = gradeToName.get(i);\n for(Student s : studs)\n System.out.println(\"(\" + s.getLast() + \", \" + s.getFirst() + \", \" + i + \")\");\n }\n\n // sort display aplhabetically\n } else if (flags[4] != null && flags[4].equals(\"A\")){\n //compare override class at bottom of file\n List<Student> studentsAlpha = gradebook.getAllStudents();\n Collections.sort(studentsAlpha, new Comparator<Student>() {\n @Override\n public int compare(Student o1, Student o2) {\n if ( o2.getLast().compareToIgnoreCase(o1.getLast()) == 0) {\n return o1.getFirst().compareToIgnoreCase(o2.getFirst());\n } else {\n return o1.getLast().compareToIgnoreCase(o2.getLast());\n }\n }\n });\n\n for (Student stud: studentsAlpha) {\n // flags[0] should be assign name\n System.out.println(\"(\" + stud.getLast() + \", \" + stud.getFirst() + \", \" + gradebook.getPointsAssignment(stud, gradebook.getAssignment(flags[0])) + \")\");\n }\n\n } else {\n throw new IllegalArgumentException(\"Please specify if you want the display to be alphabetical or by grades highest to lowest.\");\n }\n return;\n }", "public static void runExercise8() {\n List <Integer> years = students.stream().map(student -> student.getBirthYear()).sorted(Comparator.reverseOrder()).collect(Collectors.toList());\n System.out.println(years);\n }", "private void announceScores(List<Integer> scores) {\r\n\t\tCollections.sort(scores);\r\n\t\tCollections.reverse(scores);\r\n\t\tscores = scores.subList(0, 4);\r\n\t\tint spots = 4;\r\n\r\n\t\tfor (ListIterator<Contestant> it = Contestant.mContestants.listIterator(); it.hasNext();) {\r\n\t\t\tContestant c = it.next();\r\n\t\t\tint cScore = c.getExamScore();\r\n\r\n\t\t\tif (scores.contains(cScore) && spots > 0) {\r\n\t\t\t\tspots--;\r\n\t\t\t\tc.setPassedExam(true);\r\n\t\t\t\tlog(mName + \": \" + c.getName() + \" has passed the exam\");\r\n\t\t\t} else {\r\n\t\t\t\tc.setPassedExam(false);\r\n\t\t\t\tlog(mName + \": \" + c.getName() + \" has failed the exam\");\r\n\t\t\t\tit.remove();\r\n\t\t\t}\r\n\t\t\tsynchronized (c.mConvey) {\r\n\t\t\t\tc.mConvey.notify();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "Page<ExamPackage> getPageByUsername(String username, int pageNo, int pageSize, Sort sort);", "private static void print_Final(Gradebook gradebook, String[] flags){\n if (flags[3] != null && flags[3].equals(\"G\")){\n List<Student> studentsList = gradebook.getAllStudents();\n //Map<Student, Double>\n Map<Double, List<Student>> grades = new HashMap<Double, List<Student>>();\n Set<Double> gradeSet = new HashSet<Double>();\n\n for(Student s : studentsList){\n double grade = gradebook.getGradeStudent(s);\n List<Student> studs = grades.get(grade);\n\n if(studs == null){\n studs = new ArrayList<Student>();\n }\n\n studs.add(s);\n grades.put(grade, studs);\n gradeSet.add(grade);\n }\n\n List<Double> gradeList = new ArrayList<Double>(gradeSet);\n Collections.sort(gradeList, Collections.reverseOrder());\n\n DecimalFormat df = new DecimalFormat(\"#.####\"); //Round to 4 decimal places\n df.setRoundingMode(RoundingMode.HALF_UP);\n for(Double d : gradeList){\n\n List<Student> studs = grades.get(d);\n for(Student s : studs){\n\n System.out.println(\"(\" + s.getLast() + \", \" + s.getFirst() + \", \" + df.format(d) + \")\");\n }\n }\n } else if (flags[4] != null && flags[4].equals(\"A\")){\n //compare override class at bottom of file\n List<Student> studentsAlpha = gradebook.getAllStudents();\n Collections.sort(studentsAlpha, new Comparator<Student>() {\n @Override\n public int compare(Student o1, Student o2) {\n if ( o2.getLast().compareToIgnoreCase(o1.getLast()) == 0) {\n return o1.getFirst().compareToIgnoreCase(o2.getFirst());\n } else {\n return o1.getLast().compareToIgnoreCase(o2.getLast());\n }\n }\n });\n\n DecimalFormat df = new DecimalFormat(\"#.####\"); //Round to 4 decimal places\n df.setRoundingMode(RoundingMode.HALF_UP);\n for (Student stud: studentsAlpha) {\n System.out.println(\"(\" + stud.getLast() + \", \" + stud.getFirst() + \", \" + df.format(gradebook.getGradeStudent(stud)) + \")\");\n }\n\n }\n else{\n throw new IllegalArgumentException(\"Grade or Alphabetical flag missing.\");\n }\n return;\n }", "public void sortareDesc(List<Autor> autoriList){\n\t\tboolean ok;\t\t\t\t \n\t\tdo { \n\t\t ok = true;\n\t\t for (int i = 0; i < autoriList.size() - 1; i++)\n\t\t if (autoriList.get(i).getNrPublicatii() < autoriList.get(i+1).getNrPublicatii()){ \n\t\t \t Autor aux = autoriList.get(i);\t\t//schimbarea intre autori\n\t\t \t Autor aux1 = autoriList.get(i+1);\t\n\t\t \t try {\n\t\t \t\t \trepo.schimbareAutori(aux,aux1);\n\t\t\t } catch (Exception e) {\n\t\t\t System.out.println(e.getMessage());\n\t\t\t }\n\t\t\t\t ok = false;\n\t\t\t}\n\t\t}\n\t while (!ok);\n\t }", "public void reduce ()\r\n {\r\n if (score.getPages().isEmpty()) {\r\n return;\r\n }\r\n\r\n /* Connect parts across the pages */\r\n connection = PartConnection.connectScorePages(pages);\r\n\r\n // Force the ids of all ScorePart's\r\n numberResults();\r\n\r\n // Create score part-list and connect to pages and systems parts\r\n addPartList();\r\n\r\n // Debug: List all candidates per result\r\n if (logger.isDebugEnabled()) {\r\n dumpResultMapping();\r\n }\r\n }", "private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }", "private ArrayList<Teacher> sortTeacherByPriorty(ArrayList<Teacher> teachers, ArrayList<Integer> preferedTeachers, int numSections) {\n ArrayList<Teacher> aux = new ArrayList<>();\r\n if (preferedTeachers.isEmpty()) {\r\n return aux;\r\n }\r\n\r\n for (int i = 0; i < numSections; i++) {\r\n Teacher teacher = findTeacher(teachers, preferedTeachers.get(i % preferedTeachers.size()));\r\n aux.add(teacher);\r\n }\r\n return aux;\r\n }", "@Test\n public void testCombineRankHighPageRankWeight() {\n Iterator<Pair<Document, Double>> resultIterator = icsSearchEngine.searchQuery(Arrays.asList(\"anteater\"),\n 10, 1000000000.0);\n ImmutableList<Pair<Document, Double>> resultList = ImmutableList.copyOf(resultIterator);\n Assert.assertEquals(10, resultList.size());\n Assert.assertTrue(resultList.stream().limit(3).map(p -> p.getLeft())\n .anyMatch(doc -> doc.getText().contains(\"wics.ics.uci.edu\")));\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\tList<Student> students = new ArrayList<>();\r\n\t\t\r\n\t\tstudents.add(new Student(23, \"Aryan\"));\r\n\t\tstudents.add(new Student(23, \"Jeet\"));\r\n\t\tstudents.add(new Student(83, \"Dhruv\"));\r\n\t\tstudents.add(new Student(13, \"Amit\"));\r\n\t\tstudents.add(new Student(65, \"Aditya\"));\r\n\t\tstudents.add(new Student(57, \"Jeet\"));\r\n\t\t\r\n//\t\tCollections.sort(students);\r\n\t\t\r\n//\t\tCollections.sort(students, new SortByNameThenMarks());\t// We passed our own comparator object.\r\n\t\t\r\n\t\t// We can have our own anonymous comparator without making a class. We can do that so by doing the following:\r\n\t\t\r\n//\t\tCollections.sort(students, new Comparator<Student>() {\r\n//\r\n//\t\t\t@Override\r\n//\t\t\tpublic int compare(Student obj1, Student obj2) {\r\n//\t\t\t\tif(obj1.name.equals(obj2)) return obj1.marks - obj2.marks;\r\n//\t\t\t\treturn obj1.name.compareTo(obj2.name);\r\n//\t\t\t}\r\n//\t\t\t\r\n//\t\t});\r\n\t\t\r\n\t\t// With the help of Lambda we could cut short the lines but we have to mention the sign \"->\".\r\n//\t\tCollections.sort(students,(Student obj1, Student obj2) -> {\r\n\t\t\r\n//\t\tCollections.sort(students,(obj1, obj2) -> {\r\n//\t\t\t\tif(obj1.name.equals(obj2)) return obj1.marks - obj2.marks;\r\n//\t\t\t\treturn obj1.name.compareTo(obj2.name);\r\n//\t\t\t});\r\n\t\t\r\n//\t\tCollections.sort(students, (obj1, obj2) -> obj1.name.compareTo(obj2.name));\r\n\t\t\r\n//\tThe comparator SortByNameThenMarks can be written in one line as follows. Also \".reversed()\" is used to reverse the order of comparison.\r\n\t\tCollections.sort(students, Comparator.comparing(Student::getName).thenComparing(Student::getMarks).reversed());\r\n\t\t\r\n\t\tstudents.forEach(System.out::println);\t// This is lambda expression to print \r\n\t}", "public static void main(String[] args) {\n\t\tint numCourses = 5;\n\t\tint[][] prerequisites = {\n\t\t\t\t{0,1},\n\t\t\t\t{2,4},\n\t\t\t\t{3,4},\n\t\t\t\t{1,3},\n\t\t\t\t{2,3}\n\t\t\t};\n\t\t\n\t\tint res[] = findOrder(numCourses, prerequisites);\n\t\t\n\t\tfor(int val: res)\n\t\t\tSystem.out.print(\" \" + val);\n\t\t\n\t}", "public void sortPageList()\r\n {\r\n if (log.isDebugEnabled())\r\n {\r\n log.debug(\"[\" + this.id + \"] sorting page list\");\r\n }\r\n sortRowList(this.getRowListPage());\r\n\r\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tArrayList<Student2> studs = new ArrayList<>();\r\n\t\tstuds.add(new Student2(6,\"neena\"));\r\n\t\tstuds.add(new Student2(1,\"nimmy\"));\r\n\t\tstuds.add(new Student2(4,\"cookie\"));\r\n\t\t\r\n\t\tCollections.sort(studs);\r\n\t\t\r\n\t\tfor(Student2 s : studs) {\r\n\t\t\tSystem.out.println(s);\r\n\t\t}\r\n\r\n\t}", "private void createSortLink() {\n\n String newGrouping;\n\n if (\"plugin\".equals(grouping)) {\n newGrouping = \"publisher\";\n } else {\n newGrouping = \"plugin\";\n }\n String timeString = \"\";\n if (\"accurate\".equals(timeKey)) {\n timeString = \"&amp;timeKey=\" + timeKey;\n }\n\n String linkHref = \"/DisplayContentStatus?group=\" + newGrouping + timeString;\n String linkText = \"Order by \" + newGrouping;\n Link sortLink = new Link(linkHref);\n sortLink.attribute(\"class\", \"filters\");\n sortLink.add(linkText);\n page.add(sortLink);\n }", "public ArrayList<University> findRecommended(String schoolToCompare) {\n\t\tArrayList<University> closeMatch = sfCon.rankUniversity(schoolToCompare);\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(closeMatch.get(i).getName());\n\t\t}\n\n\t\treturn closeMatch;\n\t}", "public static void main(String[] args) {\n ArrayList<Course> courses = new ArrayList<>();\n courses.add(new Course(\"Math\", \"12030\"));\n courses.add(new Course(\"English\", \"46537\"));\n courses.add(new Course(\"Programming\", \"64537\"));\n\n ArrayList<Teacher> teachers = new ArrayList<>();\n teachers.add(new Teacher(\"Albert\", \"Einstein\", \"[email protected]\", \"1\"));\n teachers.add(new Teacher(\"Nikola\", \"Tesla\", \"[email protected]\", \"2\"));\n teachers.add(new Teacher(\"Ada\", \"Lovelace\", \"[email protected]\", \"3\"));\n teachers.add(new Teacher(\"Charles\", \"Babbage\", \"[email protected]\", \"4\"));\n\n courses.get(0).getTaughtBy().add(teachers.get(1));\n courses.get(0).getTaughtBy().add(teachers.get(2));\n courses.get(1).getTaughtBy().add(teachers.get(0));\n courses.get(1).getTaughtBy().add(teachers.get(1));\n courses.get(2).getTaughtBy().add(teachers.get(2));\n\n\n\n ArrayList<Student> students = new ArrayList<>();\n students.add(new Student(\"Irina\", \"Smirnova\", \"[email protected]\", \"245\"));\n students.add(new Student(\"Andrey\", \"Smirnov\", \"[email protected]\", \"249\"));\n students.add(new Student(\"Galina\", \"Kutarina\", \"[email protected]\", \"246\"));\n\n courses.get(0).getTakenBy().add(students.get(1));\n courses.get(0).getTakenBy().add(students.get(2));\n courses.get(1).getTakenBy().add(students.get(1));\n courses.get(2).getTakenBy().add(students.get(0));\n\n\n listCourses(courses);\n // listTeachers(teachers);\n// listStudents(students);\n\n\n\n }", "private void sortArticleByViews() {\n final DatabaseReference database;\n database = FirebaseDatabase.getInstance().getReference();\n\n database.child(\"Views\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Map<Integer,ArrayList<Article>> articlesTreeMap;\n articlesTreeMap = new TreeMap<>(Collections.reverseOrder());\n for(Article a : articles) {\n DataSnapshot viewArticleSnapShot = null;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n if (a.getLink() != null && a.getLink() != \"\" && snapshot.child(\"Link\").getValue().equals(a.getLink())) {\n viewArticleSnapShot = snapshot;\n break;\n }\n }\n int views = 0;\n if (viewArticleSnapShot != null) {\n views = Integer.parseInt(viewArticleSnapShot.child(\"Count\").getValue().toString());\n }\n if(!articlesTreeMap.containsKey(views)) {\n articlesTreeMap.put(views, new ArrayList<Article>());\n }\n articlesTreeMap.get(views).add(a);\n }\n\n articles.clear();\n for(Map.Entry<Integer,ArrayList<Article>> entry : articlesTreeMap.entrySet()) {\n ArrayList<Article> list = entry.getValue();\n articles.addAll(list);\n }\n mSectionsPagerAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(DatabaseError d) {\n Log.d(\"Login DbError Msg ->\", d.getMessage());\n Log.d(\"Login DbError Detail ->\", d.getDetails());\n }\n });\n }", "private List<Article> sortTopics(Article queryTopic, List<Article>relatedTopics) throws Exception {\n for (Article art:relatedTopics) \n art.setWeight(_comparer.getRelatedness(art, queryTopic)) ;\n\n //Now that the weight attribute is set, sorting will be in descending order of weight.\n //If weight was not set, it would be in ascending order of id. \n Collections.sort(relatedTopics) ;\n return relatedTopics ;\n }", "int getPopularity();", "public ScoreReduction (Score score)\r\n {\r\n this.score = score;\r\n\r\n for (TreeNode pn : score.getPages()) {\r\n Page page = (Page) pn;\r\n pages.put(page.getIndex(), page);\r\n }\r\n }", "private void formatTopScore(LeaderboardAdapter.ViewHolder holder, int position,\n int titlePosition, String scoreType) {\n int rank = position - titlePosition;\n int rankIndex = rank - 1;\n holder.mRank.setText(String.valueOf(rank));\n \n holder.mTitle.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);\n \n if (scoreType.equals(AccessKeys.getTotalScoreRef())) {\n String username = topTotalScorers[rankIndex].getUsername();\n String formattedScore = NumberFormatter.formatNumber(topTotalScorers[rankIndex]\n .getTotalPoints());\n \n holder.mTitle.setText(username);\n holder.mValue.setText(formattedScore);\n \n } else if (scoreType.equals(AccessKeys.getAverageScoreRef())) {\n String username = topAvgScorers[rankIndex].getUsername();\n String formattedScore = NumberFormatter.formatNumber(topAvgScorers[rankIndex]\n .getAveragePoints());\n \n holder.mTitle.setText(username);\n holder.mValue.setText(formattedScore);\n }\n }", "public Page[] sortPagesByRelevance(String query, ArrayList<Page> pages) {\n\t\tArrayList<Page> result = new ArrayList<Page>();\n\t\tfor (Page page : pages) {\n\t\t\tpage.setRelevance(calculatePageRelevance(query, page));\n\t\t}\n\t\t\n\t\tpages.sort(null);\n\t\t\n\t\tfor (int i = 0; i < MAX_QUERY_RESULT_COUNT; i++) {\n\t\t\tresult.add(pages.get(i));\n\t\t}\n\t\treturn result.toArray(new Page[MAX_QUERY_RESULT_COUNT]);\n\t}", "@Test\n\tpublic void shouldReturnSecondPageSortedByOriginalAmountAsc()\n\t{\n\n\t\tfinal SearchPageData<B2BDocumentModel> result = pagedB2BDocumentDao.getAllPagedDocuments(\n\t\t\t\tcreatePageableData(1, 2, \"byOriginalAmountAsc\"), Collections.singletonList(AccountSummaryAddonUtils\n\t\t\t\t\t\t.createFilterByCriteriaObject(StringUtils.EMPTY, StringUtils.EMPTY)));\n\n\t\tTestCase.assertEquals(2, result.getResults().size());\n\n\t\tTestCase.assertEquals(AMOUNT_75_31, result.getResults().get(0).getAmount().toString());\n\t\tTestCase.assertEquals(AMOUNT_85_20, result.getResults().get(1).getAmount().toString());\n\t}", "public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}", "public void scoreSorting(SortingQuiz scoringMethod, SortingSample s) {\r\n for(int i=1; i<=s.answers.size(); i++) {\r\n HourGlass scores = new HourGlass();\r\n scores.weightAnswer(scoringMethod.answers.get(s.getAnswerNum(i)));\r\n System.out.println(scores);\r\n// this.scores.weightAnswer(scoringMethod.answers.get(s.getAnswerNum(i)));\r\n }\r\n }", "private static void sortMovies(MovieSort movieSort) {\n\t\tList<Movie> movies = null;\n\t\t// Check the sorting method to see which comparator to use.\n\t\tif(movieSort == MovieSort.TA || movieSort == MovieSort.TD) {\n\t\t\tmovies = movieManager.getSortedMovies(new TitleComparator());\n\t\t} else if(movieSort == MovieSort.YA || movieSort == MovieSort.YD) {\n\t\t\tmovies = movieManager.getSortedMovies(new YearComparator());\n\t\t}\n\t\t// Make sure movies isn't null.\n\t\tif(movies != null) {\n\t\t\tprintln(\"Title Year Actors\");\n\t\t\tprintln(\"------------------------------------------------\"\n\t\t\t + \"-------------------------------------------\");\n\t\t\t// Check if we need to print in decrementing order.\n\t\t\tif(movieSort == MovieSort.TD || movieSort == MovieSort.YD) {\n\t\t\t\tfor(int i = movies.size() - 1; i >= 0; i--) {\n\t\t\t\t\tMovie movie = movies.get(i);\n\t\t\t\t\tprintMovieTab(movie);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor(Movie movie : movies) {\n\t\t\t\t\tprintMovieTab(movie);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static List<Course> sortElSeasonAverageScore(List<Course> courseList){\n return courseList.stream().\n sorted(Comparator.comparing(Course::getSeason).\n thenComparing(Course::getAverageScore)).\n collect(Collectors.toList());\n }", "private void sortByLastName() { \r\n\t\tfor ( int i = 0; i < size-1; i++) {\r\n\t\t\tint minIndex = i; \r\n\t\t\tfor(int j = i + 1; j < size; j++) {\r\n\t\t\t\tif ( accounts[j].getHolder().getLname().compareTo(accounts[minIndex].getHolder().getLname()) < 0 ) { \r\n\t\t\t\t\tSystem.out.println(accounts[j].getHolder().getLname());\r\n\t\t\t\t\tminIndex = j;\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t\tAccount temp = accounts[minIndex];\r\n\t\t\taccounts[minIndex] = accounts[i];\r\n\t\t\taccounts[i] = temp;\r\n\t\t}\r\n\t\treturn;\r\n\t}", "private void sortByLastName() { \n\t\t\n\t\tint numAccounts = size;\n\t\tString firstHolder_lname;\n\t\tString secondHolder_lname;\n\t\t\n\t\tfor (int i = 0; i < numAccounts-1; i++) {\n\t\t\t\n\t\t\t\n\t\t\tint min_idx = i;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = i+1; j < numAccounts; j++) {\n\t\t\t\t\n\t\t\t\t// Retrieve last name of two that you are comparing\n\t\t\t\tfirstHolder_lname = (accounts[j].getHolder()).get_lname();\n\t\t\t\tsecondHolder_lname = (accounts[min_idx].getHolder()).get_lname();\n\t\t\t\t\n\t\t\t\tif (firstHolder_lname.compareTo(secondHolder_lname) < 0) {\n\t\t\t\t\tmin_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAccount temp = accounts[min_idx];\n\t\t\taccounts[min_idx] = accounts[i];\n\t\t\taccounts[i] = temp;\n\n\t\t\t\n\t\t}\n\t}", "public static List<Double> sortScores(List<Double> results) {\n\t\t\n\t\t\n\t\tfor (int i = 0; i < results.size()-1; i++) {\n\t\t\tif (results.get(i)>results.get(i+1)) {\n\t\t\t\t//highScore = results.get(i);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tDouble temp = results.get(i);\n\t\t\t\t\n\t\t\t\tresults.set(i, results.get(i+1));\n\t\t\t\t\n\t\t\tresults.set(i+1, temp);\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t\t\n\t\treturn results;\n\t\t//return null;\n\t}", "List<PersonPageRank> getPageRank() throws Exception {\n // first map to pair of pID and uID and keep only distinct\n JavaPairRDD<String, String> graph = movieReviews\n .mapToPair(s->new Tuple2<>(s.getMovie().getProductId(), s.getUserId())).distinct();\n // now, join graph to graph (by pId) and filter out those with the same uID\n // then, map to \" \" divided string of pID and uID and keep only distinct pairs\n JavaRDD<String> graphCart =\n graph.join(graph)\n .filter(s->(!s._2._1.equals(s._2._2)))\n .map(s->s._2._1 + \" \" + s._2._2)\n .distinct();\n // call pageRank code and return it's result\n return JavaPageRank.pageRank(graphCart, 100);\n }", "public List<Idea> allIdeasLikersDesc() {\n\n List<Idea> ideas = ideaRepo.findAll();\n\n ideas.sort(new Comparator<Idea>() {\n @Override\n public int compare(Idea i1, Idea i2) {\n if(i1.getLikers().size() == i2.getLikers().size()){\n return 0;\n }\n return i1.getLikers().size() > i2.getLikers().size() ? -1 : 1;\n }\n });\n\n return ideas;\n }", "public static void main(String[] args){\n\n List<Student> arrList = new ArrayList<>(); // arraylist of our own class type\n arrList.add(new Student(111, \"bbb\", \"London\"));\n arrList.add(new Student(222,\"aaa\", \"nyc\"));\n arrList.add(new Student(333, \"ccc\", \"Jaipur\"));\n\n System.out.println(\"Unsorted list : \");\n for (Student student : arrList)\n System.out.println(student);\n\n // Sort the arrayList based on roll no\n Collections.sort(arrList, new Sortbyroll());\n\n System.out.println(\"Sorted by rollNo : \");\n for(Student student : arrList)\n System.out.println(student);\n\n // Sort the arrayList based on name\n Collections.sort(arrList, new Sortbyname());\n\n System.out.println(\"Sorted by name : \");\n for (int i=0; i<arrList.size(); i++)\n System.out.println(arrList.get(i));\n }", "public int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}", "public int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}", "private void sortByLastName() {\n //selection sort\n for (int i = 0; i < size - 1; i++) {\n int alphaSmallerIndex = i;\n for (int j = i + 1; j < size; j++)\n if (accounts[j].getHolder().getLastNameFirstName().compareTo(accounts[alphaSmallerIndex].getHolder().getLastNameFirstName()) < 0) {\n alphaSmallerIndex = j;\n }\n Account acc = accounts[alphaSmallerIndex];\n accounts[alphaSmallerIndex] = accounts[i];\n accounts[i] = acc;\n }\n }", "private static void sortFriends() {\n friends.postValue(friends.getValue());\n }", "@Override\n public void sort() {\n int cont = 0;\n int mov = 0;\n for (int i = 0; i < (100 - 1); i++) {\n int menor = i;\n for (int j = (i + 1); j < 100; j++){\n if (array[menor] > array[j]){\n cont= cont + 1;\n menor = j;\n mov = mov + 1;\n }\n }\n swap(menor, i);\n mov = mov + 3;\n }\n System.out.println(cont + \" comparações\");\n System.out.println(mov + \" Movimenteções\");\n }", "public void assignPageRanks(double epsilon) {\r\n\t\t// TODO : Add code here\r\n\t\tArrayList<String> vertices=internet.getVertices();\r\n\t\tList<Double> currentRank=Arrays.asList(new Double[vertices.size()]);\r\n\t\tCollections.fill(currentRank,1.0);\r\n\r\n\t\tdo{\r\n\t\t\tfor(int i=0;i<vertices.size();i++){\r\n\t\t\t\tinternet.setPageRank(vertices.get(i),currentRank.get(i));\r\n\t\t\t}\r\n\t\t\tcurrentRank=computeRanks(vertices);\r\n\t\t}while (!stopRank(epsilon,currentRank,vertices));\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tList<Integer> numbers = List.of(10,1, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9);\n\t\tList<String> courses = List.of(\"Spring\", \"Spring Boot\", \"API\" , \"Microservices\",\"AWS\", \"PCF\",\"Azure\", \"Docker\", \"Kubernetes\");\n\n//01 distinct numbers in stream\t\t\n\t\tnumbers.stream().distinct()\n\t\t .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//02 sorted\n\t\tnumbers.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t\n//03 sort Strings-- by default is natural order\t\t\n\t\tcourses.stream().sorted()\n .forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\n//04 sort Strings- user Comparator--- sort(Comparator)\n\t/*Comparators can be passed to a sort method (such as Collections.\n\t * sort or Arrays.sort) to allow precise control over the sort order. \n\t */\t\n\t \tcourses.stream().sorted(Comparator.naturalOrder())\n\t .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//05 Comparator calss -Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.reverseOrder())\n .forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\t \t\n//06 Comparator(lambda)-Sort String- based on string length\n\t \t//05 Sort string reverse order \n\t \tcourses.stream().sorted(Comparator.comparing(x->x.length())).forEach(System.out::println);\n\t \t System.out.println(\"---------------------------------------\");\n\n//07 sort string - based on last char\t \t\n\t\tcourses.stream().\n\t\tsorted((str1, str2) -> \n\t\tCharacter.compare(str1.charAt(str1.length() - 1),str2.charAt(str2.length() - 1)))\n . forEach(System.out::println);\n\t\t System.out.println(\"---------------------------------------\");\n\t\n//08 sort Book list based on year of release\n\t\tBook book=new Book();\n\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\t \n\t\t // .sorted((o1, o2) -> (o1 - o2.getSalary())).collect(Collectors.toList());\n\t\t //.out.println(bookSortedList1);\n\t\t System.out.println(\"---------------------------------------\");\n\t\t \n\t\t \n //08 sort Book list based on year of release\n\t\t \n\t\t Book.bookList.stream()\n\t\t\t\t .sorted((o1, o2) -> (o1.getReleaseYear() - o2.getReleaseYear())).forEach(System.out::println); \n\n\t\t \n//Reversed order\n\t\t\t Comparator<Book> comparator_reversed_order = Comparator.comparingLong(Book::getReleaseYear).reversed();\n\t\t\tBook.bookList.stream()\n\t\t\t\t\t .sorted(comparator_reversed_order).forEach(System.out::println); \n//\t\tBook book=new Book();\n\t\t\t Book.bookList.stream()\n\t\t\t\t .sorted(Comparator.comparingLong(Book::getReleaseYear)).forEach(System.out::println);\n\t\n//\tIf this Comparator considers two elements equal, i.e. compare(a, b) == 0, other is used to determine the order. \n//comparator1.thenComparing(comparator2)\n\t\t\t \n\t}", "public void sortByTagCount() {\r\n this.addSortField(\"\", \"*\", SORT_DESCENDING, \"count\");\r\n }", "private List<Score> order(List<Score> s)\n {\n Collections.sort(s, new Comparator<Score>()\n {\n\n @Override\n public int compare(Score o1, Score o2) {\n // TODO Auto-generated method stub\n\n return o1.getSentId() - o2.getSentId();\n }\n });\n return s;\n }", "public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.60220444", "0.5955384", "0.5823338", "0.5820613", "0.57607377", "0.5634144", "0.56180865", "0.5612765", "0.5563659", "0.55631685", "0.5514011", "0.54646254", "0.5433303", "0.5362336", "0.5348588", "0.5287188", "0.52834743", "0.5215997", "0.5200048", "0.51904273", "0.5176192", "0.5158196", "0.51455224", "0.51311547", "0.51296526", "0.5125895", "0.51244354", "0.51162285", "0.5109461", "0.5104356", "0.50734746", "0.50566167", "0.5016285", "0.50069046", "0.49920064", "0.4987096", "0.49866253", "0.49395272", "0.49296454", "0.4924648", "0.4886609", "0.4884123", "0.48808903", "0.48721662", "0.48707297", "0.48675594", "0.48661932", "0.48654205", "0.48634037", "0.48454708", "0.4840755", "0.48294353", "0.48247337", "0.48203433", "0.48160097", "0.48047724", "0.4800347", "0.47992295", "0.47922772", "0.4792031", "0.47816685", "0.47811818", "0.47732136", "0.47518107", "0.47511473", "0.47394055", "0.4738652", "0.4735709", "0.47311008", "0.47271657", "0.47182038", "0.47105", "0.47005242", "0.4698015", "0.4696224", "0.46955326", "0.4694115", "0.46934018", "0.46929386", "0.4683284", "0.46821195", "0.4676697", "0.4673681", "0.4670783", "0.46690813", "0.4666841", "0.46640787", "0.46477464", "0.4645817", "0.46418822", "0.46234068", "0.46234068", "0.46222752", "0.4621084", "0.46198583", "0.46131933", "0.46110064", "0.46070462", "0.4598818", "0.45988116" ]
0.5605898
8
Sorts by 'TimeStarted' property
public int compare(Page p1, Page p2) { return p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sort(){\n listOperation.sort(Comparator.comparingInt(Operation::getiStartTime));\n }", "public long getSortTime(){ \n return endTime - startTime;\n }", "public void sortEventsByTime() {\n for (OrgEvent event : events) {\n event.setCompareByTime(true);\n }\n Collections.sort(events);\n }", "double getSortTime();", "public double getSortTime() {\n return sortTime_;\n }", "public double getSortTime() {\n return sortTime_;\n }", "public static void sortEvents(){\n if(events.size()>0){\n Comparator<Event> comp = new Comparator<Event>(){\n public int compare(Event e1, Event e2){\n if(e1.getEventStartTime().before(e2.getEventStartTime())){\n return -1;\n }\n else if(e1.getEventStartTime().after(e2.getEventStartTime())){\n return 1;\n }\n else{\n return 0;\n }\n }\n \n };\n Collections.sort(events, comp);\n \n }}", "public static void sortActivities() {\n Activity.activitiesList.sort(new Comparator<Activity>() {\n @Override\n public int compare(Activity activity, Activity t1) {\n if (activity.getStartTime().isAfter(t1.getStartTime())) {\n return 1;\n }\n else if (activity.getStartTime().isBefore(t1.getStartTime())){\n return -1;\n }\n else {\n return 0;\n }\n }\n });\n }", "public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }", "public Integer getTimeSort() {\n return timeSort;\n }", "public Comparator<PoiPoint> getPointStartTimeComparator() {\r\n \r\n class PointStartTimeComparator implements Comparator<PoiPoint> {\r\n public int compare(PoiPoint point1, PoiPoint point2) {\r\n return (point1.getStartTimeInt() - point2.getStartTimeInt());\r\n }\r\n }\r\n \r\n return new PointStartTimeComparator();\r\n }", "public void sortBasedPendingJobs();", "public void sortAuthority(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tpublic List<Listing> findAllSortedByTime() {\n\t\treturn theListingRepo.findAll(Sort.by(Direction.DESC, \"dateUploaded\"));\n\t}", "private ArrayList<Task> sortByDate(ArrayList<Task> toSort) {\n ArrayList<Task> sorted = new ArrayList<>();\n\n toSort = removeNoTimeTask(toSort);\n\n int size = toSort.size();\n for (int i = 0; i < size; i++) {\n Date earliest = new Date(Long.MAX_VALUE);\n int earliestIndex = -1;\n for (int j = 0; j < toSort.size(); j++) {\n if (toSort.get(j).getClass().equals(Deadline.class)) {\n Deadline temp = (Deadline) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Event.class)) {\n Event temp = (Event) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Period.class)) {\n Period temp = (Period) toSort.get(j);\n if (temp.getStart().before(earliest)) {\n earliest = temp.getStart();\n earliestIndex = j;\n }\n }\n }\n\n sorted.add(toSort.get(earliestIndex));\n toSort.remove(earliestIndex);\n }\n return sorted;\n }", "public void sortHub(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "public void setTimeSort(Integer timeSort) {\n this.timeSort = timeSort;\n }", "private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }", "@Override\n public Sort getDefaultSort() {\n return Sort.add(SiteConfineArea.PROP_CREATE_TIME, Direction.DESC);\n }", "public void sort() {\n Collections.sort(tasks);\n }", "public int compare(TimeEntry t1, TimeEntry t2) {\n\t\t\t\t\treturn t1.getTime().compareTo(t2.getTime());\n\t\t\t\t//return 1;\n\t\t\t }", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "private static ArrayList<Quest> sortAfterTimestamp(ArrayList<Quest> questListToSort) {\n\t\tfor (int i = 0; i < questListToSort.size() - 1; i++) {\n\t\t\tint index = i;\n\t\t\tfor (int j = i + 1; j < questListToSort.size(); j++) {\n\t\t\t\tif (questListToSort.get(j).getTimestamp() > questListToSort.get(index).getTimestamp()) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.swap(questListToSort, index, i);\n\t\t}\n\t\treturn questListToSort;\n\t}", "public void sortEvents() {\n\t\tCollections.sort(events);\n\t}", "@Override\r\n\t\t\t\tpublic int compare(twi arg0, twi arg1) {\n\t\t\t\t\tif (arg0.timestamp > arg1.timestamp) {\r\n\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t} else if (arg0.timestamp < arg1.timestamp) {\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "public void sortQueries(){\n\t\tif (queries == null || queries.isEmpty()) {\n\t\t\treturn;\n\t\t} else {\n\t\t Collections.sort(queries, new Comparator<OwnerQueryStatsDTO>() {\n @Override\n public int compare(OwnerQueryStatsDTO obj1, OwnerQueryStatsDTO obj2) {\n if(obj1.isArchived() && obj2.isArchived()) {\n return 0;\n } else if(obj1.isArchived()) {\n return 1;\n } else if(obj2.isArchived()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n\n\t }\n\t}", "@Override\n\t\t\tpublic int compare(LiveAlarm object1, LiveAlarm object2) {\n\t\t\t\tlong start1 = object1.startT;\n\t\t\t\tlong start2 = object2.startT;\n\t\t\t\t\n\t\t\t\tif (start1 < start2) return -1;\n\t\t\t\tif (start1 == start2) return 0;\n\t\t\t\tif (start1 > start2) return 1;\n\t\t\t\t\n\t\t\t\treturn 0;//to suppress the compiler error;\n\t\t\t}", "public int compare(TimeSpan std1, TimeSpan std2) {\n\t\t\t//ascending order\n\t\t\treturn std1.start - std2.start;\n\t\t}", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }", "private static void sortingArrayList() {\n Collections.sort(allMapData, new Comparator<MapDataModel>() {\n public int compare(MapDataModel d1, MapDataModel d2) {\n return valueOf(d1.getDateTime().compareTo(d2.getDateTime()));\n }\n });\n }", "@Test\r\n public void testGetShapesSortedByTimestamp() {\r\n List<Shape> expectedOutput = new ArrayList<Shape>();\r\n expectedOutput.add(circle);\r\n expectedOutput.add(square);\r\n expectedOutput.add(rectangle);\r\n expectedOutput.add(triangle);\r\n expectedOutput.add(regularPolygon);\r\n List<Shape> actualOutput = screen.sortShape(SortType.TIMESTAMP);\r\n assertEquals(expectedOutput, actualOutput);\r\n }", "public synchronized void firstSort(){\n Process temp;\n for(int j = 0; j<queue.length;j++){\n temp = null;\n for(int i = 0; i<pros.proSize(); i++){\n if(i==0){\n temp = new Process((pros.getPro(i)));\n }else if(temp.getArrivalTime() == pros.getPro(i).getArrivalTime()){\n if(temp.getId() > pros.getPro(i).getId()){\n temp = pros.getPro(i);\n }\n }else if (temp.getArrivalTime() > pros.getPro(i).getArrivalTime()){\n temp = pros.getPro(i);\n }\n }\n queue[j] = temp;\n pros.remove(temp.getId());\n }\n for(int i = 0; i< queue.length; i++){\n pros.addPro(queue[i]);\n }\n }", "LiveData<List<Task>> getSortedTasks(LocalDate startDate,\r\n LocalDate endDate);", "private static long sortingTime(String[] array, boolean isStandardSort) {\n long start = System.currentTimeMillis(); // starting time\n if (isStandardSort) \n Arrays.sort(array);\n selectionSort(array);\n return System.currentTimeMillis() - start; // measure time consumed\n }", "@Override\n\tpublic double sort() {\n\t\tlong startTime = System.nanoTime();\n\t\tArrayList<Offender> offenders = Offender.readArrayListCSV();\n\t\tCollections.sort(offenders, (a, b) -> ((Offender) a).getAge() < ((Offender) b).getAge() ? -1 : ((Offender) a).getAge() == ((Offender) b).getAge() ? 0 : 1);\n\t\tlong endTime = System.nanoTime();\n\t\tlong duration = (endTime - startTime); \n\t\tdouble seconds = (double)duration / 1_000_000_000.0;\n\t\t\n\t\treturn seconds;\n\t}", "protected int compareTime(Date first, Date second) {\n\t\treturn first.compareTo(second);\n\t}", "public final void testSortCriteria() throws Exception\n {\n Vector vect = new Vector();\n final long modifier = 100;\n long sdArr[][] = { { 0, 10 }, { 0, 12 }, { 0, 8 }, { -5, 20 }, { -5, 13 }, { -5, 15 }, { -5, -7 }, { 2, 10 },\n { 2, 8 }, { 2, 2 }, { 12, 14 }, { -5, 5 }, { 10, 2 } };\n long sorted[][] = { { -5, -7 }, { 10, 2 }, { 2, 2 }, { -5, 5 }, { 0, 8 }, { 2, 8 }, { 0, 10 }, { 2, 10 },\n { 0, 12 }, { -5, 13 }, { 12, 14 }, { -5, 15 }, { -5, 20 } };\n\n patchArray(sdArr, modifier);\n patchArray(sorted, modifier);\n\n for (int i = 0; i < sdArr.length; i++)\n {\n vect.addElement(new RecordingImplMock(new Date(sdArr[i][0]), sdArr[i][1]));\n }\n RecordingList recordingList = new RecordingListImpl(vect);\n Comparator comparator = new Comparator();\n\n RecordingList newList = recordingList.sortRecordingList(comparator);\n\n assertNotNull(\"recordingList returned null\", newList);\n\n // check results\n LocatorRecordingSpec lrs = null;\n RecordingRequest req = null;\n\n int i = newList.size();\n for (i = 0; i < newList.size(); i++)\n {\n req = (RecordingRequest) newList.getRecordingRequest(i);\n lrs = (LocatorRecordingSpec) req.getRecordingSpec();\n assertEquals(\"sort criteria is wrong\", sorted[i][1], lrs.getDuration());\n }\n }", "public int compareTo(Showtime showtime) {\r\n\t\tint x = this.startTime.compareTo(showtime.startTime);\r\n\t\treturn x;\r\n\t}", "public static void listByWatched(){\r\n System.out.println('\\n'+\"List by Watched\");\r\n CompareWatched compareWatched = new CompareWatched();\r\n Collections.sort(movies, compareWatched);\r\n for (Movie watch:movies){\r\n System.out.println('\\n'+\"Times Watched \"+ watch.getTimesWatched()+'\\n'+\"Title: \"+ watch.getName()+'\\n'+\"Rating: \"+ watch.getRating()+'\\n');\r\n }\r\n }", "public static void printAllEventListInSortedOrder(){\n sortEvents();\n for(int i=0;i<events.size();i++){\n System.out.println((events.get(i).getMonth()+1)+\"/\"+events.get(i).getDate()+\"/\"+events.get(i).getYear()+\" \"+events.get(i).getStringStartandFinish()+\" \"+events.get(i).getEventTitle());\n }\n }", "public int compare(KThread s1,KThread s2) { \n if (s1.time > s2.time) \n return 1; \n else if (s1.time < s2.time) \n return -1; \n return 0; \n }", "@Override\n public int compareTo(Record otherRecord) {\n return (int) (otherRecord.mCallEndTimestamp - mCallEndTimestamp);\n }", "public Timestamp getDateOrdered();", "private void sortViewEntries() {\n runOnUiThread(new Runnable() {\n public void run() {\n try {\n Collections.sort(viewEntries, new DateComparator());\n } catch (final Exception ex) {\n // Log.i(\"sortViewEntries\", \"Exception in thread\");\n }\n }\n });\n }", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "private void sortMessages() {\n if (sendloadSuccess && recievedloadSuccess) {\n\n Collections.sort(chatMessages, new Comparator<ChatMessage>() {\n @Override\n public int compare(ChatMessage msg1, ChatMessage msg2) {\n\n return msg1.getMessageTime().compareTo(msg2.getMessageTime());\n }\n });\n\n saveChatMessagesInFile();\n updateListAdapter();\n }\n }", "Sort asc(QueryParameter parameter);", "private static long sortingTime(double[] array, boolean isStandardSort) {\n long start = 0; // starting time\n if (isStandardSort) { \n start = System.currentTimeMillis(); \n Arrays.sort(array);\n } else {\t\n start = System.currentTimeMillis();\n selectionSort(array);\n }\n return System.currentTimeMillis() - start; // measure time consumed\n }", "public void sortTasks() {\n tasks.sort(null);\n }", "public void sortEventsByValue() {\n for (OrgEvent event : events) {\n event.setCompareByTime(false);\n }\n Collections.sort(events);\n }", "public static ArrayList<Process> sortArrivalTime(ArrayList<Process> process){\r\n\t\tCollections.sort(process, new MyComparator2());\r\n\t\treturn process;\r\n\t}", "public void sortMarkers() {\n\t\tCollections.sort(getMarkerSet().getMarkers(),\r\n\t\t\t\tnew MarkerTimeComparator());\r\n\t\t// log.debug(\"[sortMarkers]after: \" + getMarkerSet().getMarkers());\r\n\r\n\t}", "public void sort()\n {\n RecordComparator comp = new RecordComparator(Context.getCurrent().getApplicationLocale());\n if (comp.hasSort)\n sort(comp);\n }", "public ArrayList<Question> getQuestionsSortedByDate() {\n \t\tArrayList<Question> sortedQuestions = this.getQuestions();\n \n \t\tCollections.sort(sortedQuestions, new DateComparator());\n \n \t\treturn sortedQuestions;\n \t}", "public long getTimeStarted() {\n\t\treturn _timeStarted;\n\t}", "public void timSort(int[] nums) {\n\t\t\t\n\t}", "public Builder setSortTime(double value) {\n \n sortTime_ = value;\n onChanged();\n return this;\n }", "Time started() {\n return started;\n }", "@Override\n\tpublic int compareTo(Time t) {\n\t\tif (this.getIndex() < t.getIndex())\n\t\t\treturn 1;\n\t\telse if (this.getIndex() == t.getIndex())\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn -1;\n\t}", "private Stream<File> sort(final Stream<File> fileStream) {\n return fileStream.sorted(new FileMetaDataComparator(callback.orderByProperty().get(),\n callback.orderDirectionProperty().get()));\n }", "public void sortToDo(){\n\t\tCollections.sort(allToDoLists);\n\t}", "@Override\n\tpublic int compareTo(Object o)\n\t{\n\t if(o instanceof Context)\n\t {\n\t \tif (timestamp==null || ((Context) o).timestamp==null)\n\t \t\treturn 0;\n\t return timestamp.compareTo(((Context) o).timestamp);\n\t }\n\t return 0;\n\t}", "private void sortByDateOpen() {\n //selection sort\n for (int i = 0; i < size - 1; i++) {\n int earliestDateIndex = i;\n for (int j = i + 1; j < size; j++)\n if (accounts[j].getDateOpen().compareTo(accounts[earliestDateIndex].getDateOpen()) < 0) {\n earliestDateIndex = j;\n }\n Account acc = accounts[earliestDateIndex];\n accounts[earliestDateIndex] = accounts[i];\n accounts[i] = acc;\n }\n }", "public void sortByDate(){\n output.setText(manager.display(true, \"date\"));\n }", "@Override\n\tpublic int compareTo(TimeInt other) {\n\t\tif (this.time < other.time) {\n\t\t\treturn -1;\n\t\t} else if (this.time > other.time) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\n\t}", "@Test\n public void testSort() {\n topScreenModel.setSortFieldAndFields(Field.LOCALITY, fields);\n\n FieldValue previous = null;\n\n // Test for ascending sort\n topScreenModel.refreshMetricsData();\n\n for (Record record : topScreenModel.getRecords()) {\n FieldValue current = record.get(Field.LOCALITY);\n if (previous != null) {\n assertTrue(current.compareTo(previous) < 0);\n }\n previous = current;\n }\n\n // Test for descending sort\n topScreenModel.switchSortOrder();\n topScreenModel.refreshMetricsData();\n\n previous = null;\n for (Record record : topScreenModel.getRecords()) {\n FieldValue current = record.get(Field.LOCALITY);\n if (previous != null) {\n assertTrue(current.compareTo(previous) > 0);\n }\n previous = current;\n }\n }", "public static JwComparator<AcWebServiceRequestData> getCreatedUtcTsComparator()\n {\n return AcWebServiceRequestDataTools.instance.getCreatedUtcTsComparator();\n }", "@Override\n public int compareTo(Object o) {\n Run run = (Run)o;\n if(runDate.compareTo(run.getRunDate()) == 0){ \n return getName().compareTo(run.getName());\n }else{\n return run.getRunDate().compareTo(getRunDate());\n }\n }", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "public Date getStartTime() {\r\n return this.startTime;\r\n }", "@Override\n\tpublic int compare(Map e1, Map e2) {\n\t\tif (!e1.containsKey(\"event_start_time\") && !e2.containsKey(\"event_start_time\")) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (!e1.containsKey(\"event_start_time\")) {\n\t\t\treturn e2.get(\"event_start_time\") == null ? 0 : 1;\n\t\t} else if (!e2.containsKey(\"event_start_time\")) {\n\t\t\treturn e1.get(\"event_start_time\") == null ? 0 : -1;\n\t\t}\n\n\t\tTimestamp e1_event_start_time = Timestamp.valueOf(e1.get(\"event_start_time\").toString());\n\t\tTimestamp e2_event_start_time = Timestamp.valueOf(e2.get(\"event_start_time\").toString());\n\n\t\tif (e1_event_start_time.equals(e2_event_start_time)) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn e1_event_start_time.before(e2_event_start_time) ? -1 : 1;\n\t}", "protected void sort() {\n\n\t\tCollections.sort(this.myRRList);\n\t}", "@Override\n\t\tpublic int compareTo(pair2 o) {\n\t\t\tif (this.time == o.time) {\n\t\t\t\treturn o.status - this.status;\n\t\t\t} else {\n\t\t\t\treturn this.time - o.time;\n\t\t\t}\n\t\t}", "@JsonProperty(\"startTime\")\n public String getStartTime() {\n return startTime;\n }", "public void timSort(int[] nums) {\n\n\t}", "public Date getStartTime() {\n return this.startTime;\n }", "@Override\n\tpublic int compare(ExecutionNode o1, ExecutionNode o2) {\n\t\t// compare start times\n\t\tTimePoint s1 = o1.getInterval().getStartTime();\n\t\tTimePoint s2 = o2.getInterval().getStartTime();\n\t\t// compare lower bounds\n\t\treturn s1.getLowerBound() < s2.getLowerBound() ? -1 : s1.getLowerBound() > s2.getLowerBound() ? 1 : 0;\n\t}", "public void sort() {\n }", "@Override\n\t\t\t\tpublic int compare(StatisticsItemData o1, StatisticsItemData o2) {\n\t\t\t\t\treturn o2.getDate().compareTo(o1.getDate());\n\t\t\t\t}", "public static <T extends Time> Comparator<T> timeComparator() {\n return new Comparator<T>() {\n\n @Override\n public int compare(T o1, T o2) {\n return o1.getTimeStamp().compareTo(o2.getTimeStamp());\n }\n };\n }", "public static JwComparator<AcGlobalDevice> getCreatedUtcTsComparator()\n {\n return AcGlobalDeviceTools.instance.getCreatedUtcTsComparator();\n }", "private void sortByDateOpen() { // sort in ascending order\n\t\tint numAccounts = size;\n\t\tDate firstDateOpen;\n\t\tDate secondDateOpen;\n\t\t\n\t\tfor (int i = 0; i < numAccounts-1; i++) {\n\t\t\t\n\t\t\t\n\t\t\tint min_idx = i;\n\t\t\t\n\t\t\t\n\t\t\tfor (int j = i+1; j < numAccounts; j++) {\n\t\t\t\t\n\t\t\t\t// Retrieve last name of two that you are comparing\n\t\t\t\tfirstDateOpen = accounts[j].getDateOpen();\n\t\t\t\tsecondDateOpen = accounts[min_idx].getDateOpen();\n\t\t\t\t\n\t\t\t\tif (firstDateOpen.compareTo(secondDateOpen) < 0) {\n\t\t\t\t\tmin_idx = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tAccount temp = accounts[min_idx];\n\t\t\taccounts[min_idx] = accounts[i];\n\t\t\taccounts[i] = temp;\n\t\t}\n\t\t\n\t}", "protected void sortCheck() {\n if (m_instances == null) {\n return;\n }\n \n if (m_simpleConfigPanel.isUsingANativeTimeStamp()) {\n String timeStampF = m_simpleConfigPanel.getSelectedTimeStampField();\n Attribute timeStampAtt = m_instances.attribute(timeStampF); \n if (timeStampAtt != null) {\n \n double lastNonMissing = Utils.missingValue();\n boolean ok = true;\n boolean hasMissing = false;\n for (int i = 0; i < m_instances.numInstances(); i++) {\n Instance current = m_instances.instance(i);\n \n if (Utils.isMissingValue(lastNonMissing)) {\n if (!current.isMissing(timeStampAtt)) {\n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n } else {\n if (!current.isMissing(timeStampAtt)) {\n if (current.value(timeStampAtt) - lastNonMissing < 0) {\n ok = false;\n break;\n }\n \n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n }\n }\n \n if (!ok && !hasMissing) {\n // ask if we should sort\n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". Do you want to sort the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Sorting data...\");\n }\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n \n if (!ok && hasMissing) {\n // we can't really proceed in this situation. We can't sort by the timestamp\n // because instances with missing values will be put at the end of the data.\n // The only thing we can do is to remove the instances with missing time\n // stamps but this is likely to screw up the periodicity and majorly impact\n // on results.\n \n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". \\nFurthermore, there are rows with\\n\" +\n \t\t\"missing timestamp values. We can remove these\\n\" +\n \t\t\"rows and then sort the data but this is likely to\\n\" +\n \t\t\"result in degraded performance. It is strongly\\n\" +\n \t\t\"recommended that you fix these issues in the data\\n\" +\n \t\t\"before continuing. Do you want the system to proceed\\n\" +\n \t\t\"anyway by removing rows with missing timestamps and\\n\" +\n \t\t\"then sorting the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Removing rows with missing time stamps and sorting data...\");\n }\n m_instances.deleteWithMissing(timeStampAtt);\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\tList<StatetostateDetail> list = new ArrayList<StatetostateDetail>();\n\t\tfor(int i = 1; i < 16; i++){\n\t\t\tStatetostateDetail s = new StatetostateDetail();\n\t\t\ts.setId(i);\n\t\t\ts.setStatue(0);\n\t\t\ts.setTime(System.currentTimeMillis() + (i + i * 100));\n\t\t\tlist.add(s);\n\t\t}\n\t\tlist.get(3).setStatue(1);\n\t\tlist.get(5).setStatue(1);\n\t\tlist.get(10).setStatue(1);\n\t\tlist.get(14).setStatue(1);\n\t\tlist.get(7).setStatue(2);\n\t\tlist.get(9).setStatue(2);\n\t\tSystem.out.println(\"list:\" + list);\n\t\n\t\t\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \tLong t1 = null;\n \tLong t2 = null;\n \ttry{\n \t\tt1 = s1.getTime();\n\t \tt2 = s2.getTime();\n \t}catch(Exception e){\n \t\te.printStackTrace();\n \t}\n \n return t2.compareTo(t1);\n }\n });\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \treturn s1.getStatue()>s2.getStatue()?1:(s1.getStatue()==s2.getStatue()?0:(s2.getTime()>s1.getTime()?-1:0));\n }\n });\n\t\t\n\t\tSystem.out.println(\"list:\" + list);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void updateSortingComparators(Comparator<ReadOnlyEntry> eventComparator,\n Comparator<ReadOnlyEntry> deadlineComparator,\n Comparator<ReadOnlyEntry> floatingTaskComparator);", "public Date getStartTime() {\n return startTime;\n }", "public Date getStartTime() {\n return startTime;\n }", "public Date getStartTime() {\n return startTime;\n }", "public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}", "public int compareTo(Punch another) {\n return ((new DateTime(time)).compareTo(another.getTime()));\n }", "@Override\n public int compareTo(Record o) {\n if (this.result - o.result > 0) {\n return 1;\n } else if (this.result - o.result < 0) {\n return -1;\n } else {\n // press time: the less, the better.\n if (this.pressTime < o.pressTime) {\n return 1;\n } else if (this.pressTime > o.pressTime) {\n return -1;\n } else {\n // total times: the more, the better.\n if (this.totalTimes > o.totalTimes) {\n return 1;\n } else if (this.totalTimes < o.totalTimes) {\n return -1;\n }\n return 0;\n }\n }\n }", "public ArrayList<Event> sortByDate() {\n\t\tArrayList<Event>calendarSortedByDate = new ArrayList();\n\t\tfor(int j = 0; j<calendar.size(); j++) {\n\t\t\tcalendarSortedByDate.add(calendar.get(j));\n\t\t\t\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < calendarSortedByDate.size() - 1; i++) {\n\t\t // Find the minimum in the list[i..list.size-1]\n\t\t Event currentMin = calendarSortedByDate.get(i);\n\t\t int currentMinIndex = i;\n\n\t\t for (int j = i + 1; j < calendarSortedByDate.size(); j++) {\n\t\t if (currentMin.compareDate​(calendarSortedByDate.get(j)) > 0) {\n\t\t currentMin = calendarSortedByDate.get(j);\n\t\t currentMinIndex = j;\n\t\t }\n\t\t }\n\n\t\t // Swap list[i] with list[currentMinIndex] if necessary;\n\t\t if (currentMinIndex != i) {\n\t\t \t calendarSortedByDate.set(currentMinIndex, calendarSortedByDate.get(i));\n\t\t \t calendarSortedByDate.set(i, currentMin);\n\t\t }\n\t\t }\n\t\treturn calendarSortedByDate;\n\t}", "@Override\n public int compare(Task task1, Task task2) {\n return task1.getDate().compareTo(task2.getDate());\n }", "private void sortByDate(List<Entry> entries) {\n\t\t\n\t\tCollections.sort(entries, new Comparator<Entry>() {\n\t\t\tpublic int compare(Entry o1, Entry o2) {\n\t\t\t if (o1.getTimestamp() == null || o2.getTimestamp() == null)\n\t\t\t return 0;\n\t\t\t return o1.getTimestamp().compareTo(o2.getTimestamp());\n\t\t\t }\n\t\t\t});\n\t}", "public Integer getStartTime() {\n return startTime;\n }", "public String getStartTime() {\n return startTime;\n }", "Date getStartedOn();", "@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}", "@Override\n\tpublic int compareTo(ParsedURLInfo o) {\n\t\treturn this.seqTime.compareTo(o.getSeqTime());\n\t}", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "public void sort() {\n\t\tArrayList<Medication> dayList = new ArrayList<Medication>();\n\t\tupcomingMedsLabel.setText(\"\");\n\t\tDate dt = new Date();\n\t\tDateFormat df = new SimpleDateFormat(\"EEEE\");\n\t\tString currentDay = df.format(dt);\n\t\t\n\t\t//Runs through all elements in the array\n\t\tfor(int i = 0; i < medList.size(); i++) {\n\t\t\t//Checks to see if the medication needs to be taken today\n\t\t\tif(medList.get(i).getMedDateTime().contains(currentDay)) {\n\t\t\t\tboolean added = false;\n\t\t\t\t//If no other element has been added, added the element\n\t\t\t\tif(dayList.size() == 0) {\n\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t} else {\n\t\t\t\t\t//Checks all other medications in the dayList to order them chronologicaly\n\t\t\t\t\tfor(int j = 0; j < dayList.size(); j++) {\n\t\t\t\t\t\t//Get the hour of element at j and compare it again element at i of medList\n\t\t\t\t\t\tint hour = Integer.parseInt(dayList.get(j).getHour());\n\t\t\t\t\t\t//If < add at j, if equal check minutes else add later\n\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getHour()) < hour) {\n\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (Integer.parseInt(medList.get(i).getHour()) == hour) {\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\t//Checks against minutes\n\t\t\t\t\t\t\tint minute = Integer.parseInt(dayList.get(j).getMinute());\n\t\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getMinute()) < minute) {\n\t\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(dayList.size() > (j + 1)) {\n\t\t\t\t\t\t\t\t\tdayList.add(j+1, medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(added == false) {\n\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Update the upcomingMedsLabel\n\t\tfor(int i = 0; i < dayList.size(); i++) {\n\t\t\tupcomingMedsLabel.setText(upcomingMedsLabel.getText() + \"\\n\\n\" + dayList.get(i));\n\t\t}\n\t}" ]
[ "0.71990544", "0.69180787", "0.6899925", "0.6818451", "0.6457486", "0.6427237", "0.63983643", "0.63283145", "0.6315511", "0.6290683", "0.6125058", "0.6122243", "0.6092077", "0.60294205", "0.5833757", "0.5794416", "0.5793885", "0.5785558", "0.57808423", "0.56512886", "0.5588033", "0.55824274", "0.5575733", "0.55727005", "0.557124", "0.55530113", "0.5493712", "0.5487639", "0.54194105", "0.54167384", "0.5368964", "0.53573585", "0.5321948", "0.5321838", "0.53183407", "0.53174067", "0.53052926", "0.5303475", "0.529993", "0.5296207", "0.5287468", "0.5279947", "0.5273409", "0.5265826", "0.5255797", "0.5226971", "0.52257687", "0.52222055", "0.521967", "0.52122056", "0.52118003", "0.52082545", "0.51977205", "0.5184827", "0.5177275", "0.51692903", "0.516084", "0.51590085", "0.51463675", "0.51448673", "0.51439315", "0.51322854", "0.5127932", "0.5122962", "0.5115394", "0.5112927", "0.5111364", "0.5111185", "0.5093199", "0.50827503", "0.5074787", "0.5071057", "0.506193", "0.5056302", "0.5054255", "0.50440514", "0.5035251", "0.5014042", "0.50133824", "0.49968496", "0.498902", "0.49847203", "0.49738982", "0.49734098", "0.49704948", "0.4963929", "0.4963929", "0.4963929", "0.496178", "0.495755", "0.49490127", "0.4947136", "0.49440977", "0.4937094", "0.4936338", "0.4935304", "0.4929687", "0.4928495", "0.49238178", "0.4920745", "0.4918237" ]
0.0
-1
If 'TimeStarted' property is equal sorts by 'TimeEnded' property
public int secondaryOrderSort(Page p1, Page p2) { return p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1 : p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sortEventsByTime() {\n for (OrgEvent event : events) {\n event.setCompareByTime(true);\n }\n Collections.sort(events);\n }", "public long getSortTime(){ \n return endTime - startTime;\n }", "public static void sortEvents(){\n if(events.size()>0){\n Comparator<Event> comp = new Comparator<Event>(){\n public int compare(Event e1, Event e2){\n if(e1.getEventStartTime().before(e2.getEventStartTime())){\n return -1;\n }\n else if(e1.getEventStartTime().after(e2.getEventStartTime())){\n return 1;\n }\n else{\n return 0;\n }\n }\n \n };\n Collections.sort(events, comp);\n \n }}", "public void sort(){\n listOperation.sort(Comparator.comparingInt(Operation::getiStartTime));\n }", "double getSortTime();", "public int compare(TimeEntry t1, TimeEntry t2) {\n\t\t\t\t\treturn t1.getTime().compareTo(t2.getTime());\n\t\t\t\t//return 1;\n\t\t\t }", "@Override\n\t\t\tpublic int compare(LiveAlarm object1, LiveAlarm object2) {\n\t\t\t\tlong start1 = object1.startT;\n\t\t\t\tlong start2 = object2.startT;\n\t\t\t\t\n\t\t\t\tif (start1 < start2) return -1;\n\t\t\t\tif (start1 == start2) return 0;\n\t\t\t\tif (start1 > start2) return 1;\n\t\t\t\t\n\t\t\t\treturn 0;//to suppress the compiler error;\n\t\t\t}", "public int compare(TimeSpan std1, TimeSpan std2) {\n\t\t\t//ascending order\n\t\t\treturn std1.start - std2.start;\n\t\t}", "@Override\r\n\t\t\t\tpublic int compare(twi arg0, twi arg1) {\n\t\t\t\t\tif (arg0.timestamp > arg1.timestamp) {\r\n\t\t\t\t\t\treturn -1;\r\n\t\t\t\t\t} else if (arg0.timestamp < arg1.timestamp) {\r\n\t\t\t\t\t\treturn 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturn 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "@Override\n\tpublic int compare(Map e1, Map e2) {\n\t\tif (!e1.containsKey(\"event_start_time\") && !e2.containsKey(\"event_start_time\")) {\n\t\t\treturn 0;\n\t\t}\n\n\t\tif (!e1.containsKey(\"event_start_time\")) {\n\t\t\treturn e2.get(\"event_start_time\") == null ? 0 : 1;\n\t\t} else if (!e2.containsKey(\"event_start_time\")) {\n\t\t\treturn e1.get(\"event_start_time\") == null ? 0 : -1;\n\t\t}\n\n\t\tTimestamp e1_event_start_time = Timestamp.valueOf(e1.get(\"event_start_time\").toString());\n\t\tTimestamp e2_event_start_time = Timestamp.valueOf(e2.get(\"event_start_time\").toString());\n\n\t\tif (e1_event_start_time.equals(e2_event_start_time)) {\n\t\t\treturn 0;\n\t\t}\n\t\treturn e1_event_start_time.before(e2_event_start_time) ? -1 : 1;\n\t}", "@Override\n\t\tpublic int compareTo(Event other) {\n\t\t\tif (this.time < other.time + 1.0e-9) return -1;\n\t\t\telse if (this.time > other.time - 1.0e-9) return 1;\n\t\t\telse {\n\t\t\t\tif(this.active > other.active) return 1;\n\t\t\t\telse return -1;\n\t\t\t}\n\t\t}", "private static int compareEndTimes(TaskItem task1, TaskItem task2) {\n\t\tif (task1 instanceof FloatingTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (task1 instanceof DeadlinedTask) {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((DeadlinedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t} else {\n\t\t\tif (task2 instanceof FloatingTask) {\n\t\t\t\treturn 1;\n\t\t\t} else if (task2 instanceof DeadlinedTask) {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((DeadlinedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t} else {\n\t\t\t\tDate endTime1 = ((TimedTask) task1).getEndTime();\n\t\t\t\tDate endTime2 = ((TimedTask) task2).getEndTime();\n\t\t\t\treturn endTime2.compareTo(endTime1);\n\t\t\t}\n\t\t}\n\t}", "public Comparator<PoiPoint> getPointStartTimeComparator() {\r\n \r\n class PointStartTimeComparator implements Comparator<PoiPoint> {\r\n public int compare(PoiPoint point1, PoiPoint point2) {\r\n return (point1.getStartTimeInt() - point2.getStartTimeInt());\r\n }\r\n }\r\n \r\n return new PointStartTimeComparator();\r\n }", "@Override\n public int compareTo(Record otherRecord) {\n return (int) (otherRecord.mCallEndTimestamp - mCallEndTimestamp);\n }", "@Override\n\t\tpublic int compareTo(pair2 o) {\n\t\t\tif (this.time == o.time) {\n\t\t\t\treturn o.status - this.status;\n\t\t\t} else {\n\t\t\t\treturn this.time - o.time;\n\t\t\t}\n\t\t}", "@Override\n public int compareTo(Event e) {\n\n if(this.getAllDay() && !e.getAllDay()){\n return -1;\n }\n\n else if(e.getAllDay() && !this.getAllDay()){\n return 1;\n }\n\n else if(this.getAllDay() && e.getAllDay()){\n return 0;\n }\n\n else {\n int event1 = parseTime(this.getStartTime());\n int event2 = parseTime(e.getStartTime());\n\n if(event1 - event2 < 0){\n return -1;\n }\n\n else if(event1 - event2 > 0){\n return 1;\n }\n\n else {\n return 0;\n }\n }\n }", "@Override\n public int compareTo(Record o) {\n if (this.result - o.result > 0) {\n return 1;\n } else if (this.result - o.result < 0) {\n return -1;\n } else {\n // press time: the less, the better.\n if (this.pressTime < o.pressTime) {\n return 1;\n } else if (this.pressTime > o.pressTime) {\n return -1;\n } else {\n // total times: the more, the better.\n if (this.totalTimes > o.totalTimes) {\n return 1;\n } else if (this.totalTimes < o.totalTimes) {\n return -1;\n }\n return 0;\n }\n }\n }", "public static void sortActivities() {\n Activity.activitiesList.sort(new Comparator<Activity>() {\n @Override\n public int compare(Activity activity, Activity t1) {\n if (activity.getStartTime().isAfter(t1.getStartTime())) {\n return 1;\n }\n else if (activity.getStartTime().isBefore(t1.getStartTime())){\n return -1;\n }\n else {\n return 0;\n }\n }\n });\n }", "@Override\n\tpublic int compareTo(Time t) {\n\t\tif (this.getIndex() < t.getIndex())\n\t\t\treturn 1;\n\t\telse if (this.getIndex() == t.getIndex())\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn -1;\n\t}", "protected int compareTime(Date first, Date second) {\n\t\treturn first.compareTo(second);\n\t}", "public void sortEventsByValue() {\n for (OrgEvent event : events) {\n event.setCompareByTime(false);\n }\n Collections.sort(events);\n }", "static int compare(EpochTimeWindow left, EpochTimeWindow right) {\n long leftValue = left.isEmpty() ? Long.MIN_VALUE : left.getBeginTime();\n long rightValue = right.isEmpty() ? Long.MIN_VALUE : right.getBeginTime();\n\n int result = Long.compare(leftValue, rightValue);\n if (0 != result) {\n return result;\n }\n\n leftValue = left.isEmpty() ? Long.MIN_VALUE : left.getEndTime();\n rightValue = right.isEmpty() ? Long.MIN_VALUE : right.getEndTime();\n\n result = Long.compare(leftValue, rightValue);\n return result;\n }", "public void sortHub(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "@Override\n\tpublic int compare(ExecutionNode o1, ExecutionNode o2) {\n\t\t// compare start times\n\t\tTimePoint s1 = o1.getInterval().getStartTime();\n\t\tTimePoint s2 = o2.getInterval().getStartTime();\n\t\t// compare lower bounds\n\t\treturn s1.getLowerBound() < s2.getLowerBound() ? -1 : s1.getLowerBound() > s2.getLowerBound() ? 1 : 0;\n\t}", "public int compare(KThread s1,KThread s2) { \n if (s1.time > s2.time) \n return 1; \n else if (s1.time < s2.time) \n return -1; \n return 0; \n }", "public void sortAuthority(List<Page> result) {\n\t\tCollections.sort(result, new Comparator<Page>() {\n\t\t\tpublic int compare(Page p1, Page p2) {\n\t\t\t\t// Sorts by 'TimeStarted' property\n\t\t\t\treturn p1.hub < p2.hub ? -1 : p1.hub > p2.hub ? 1 : secondaryOrderSort(p1, p2);\n\t\t\t}\n\n\t\t\t// If 'TimeStarted' property is equal sorts by 'TimeEnded' property\n\t\t\tpublic int secondaryOrderSort(Page p1, Page p2) {\n\t\t\t\treturn p1.getLocation().compareToIgnoreCase(p2.getLocation()) < 1 ? -1\n\t\t\t\t\t\t: p1.getLocation().compareToIgnoreCase(p2.getLocation()) > 1 ? 1 : 0;\n\t\t\t}\n\t\t});\n\t}", "public int compareTo(Punch another) {\n return ((new DateTime(time)).compareTo(another.getTime()));\n }", "@Override\n\tpublic int compareTo(Score s) {\n\t\treturn totalSecs - s.totalSecs;\n\t}", "public void sortBasedPendingJobs();", "public int compareTo(Showtime showtime) {\r\n\t\tint x = this.startTime.compareTo(showtime.startTime);\r\n\t\treturn x;\r\n\t}", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "public Integer getTimeSort() {\n return timeSort;\n }", "public int compare(Object o1, Object o2)\r\n/* 237: */ {\r\n/* 238:196 */ DisgustingMoebiusTranslator.ThingTimeTriple x = (DisgustingMoebiusTranslator.ThingTimeTriple)o1;\r\n/* 239:197 */ DisgustingMoebiusTranslator.ThingTimeTriple y = (DisgustingMoebiusTranslator.ThingTimeTriple)o2;\r\n/* 240:198 */ if (DisgustingMoebiusTranslator.this.mode == DisgustingMoebiusTranslator.this.stop)\r\n/* 241: */ {\r\n/* 242:199 */ if (x.to > y.to) {\r\n/* 243:200 */ return 1;\r\n/* 244: */ }\r\n/* 245:203 */ return -1;\r\n/* 246: */ }\r\n/* 247:206 */ if (DisgustingMoebiusTranslator.this.mode == DisgustingMoebiusTranslator.this.start)\r\n/* 248: */ {\r\n/* 249:207 */ if (x.from > y.from) {\r\n/* 250:208 */ return 1;\r\n/* 251: */ }\r\n/* 252:211 */ return -1;\r\n/* 253: */ }\r\n/* 254:214 */ return 0;\r\n/* 255: */ }", "@Override\n\tpublic int compareTo(TimeInt other) {\n\t\tif (this.time < other.time) {\n\t\t\treturn -1;\n\t\t} else if (this.time > other.time) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\n\t}", "public int compareTo(TimeSpan other) {\n\t\tif (this.hours == other.hours) { // if the hours are the same then compare the minutes\n\t\t\tif (this.minutes > other.minutes) {\n\t\t\t\treturn 1;\n\t\t\t} else if (this.minutes < other.minutes) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t} else if (this.hours > other.hours) {\n\t\t\treturn 1;\n\t\t} else if (this.hours < other.hours) {\n\t\t\treturn -1;\n\t\t} // else if the timespans are the same\n\t\treturn 0;\n\t}", "public void sortEvents() {\n\t\tCollections.sort(events);\n\t}", "private static ArrayList<Quest> sortAfterTimestamp(ArrayList<Quest> questListToSort) {\n\t\tfor (int i = 0; i < questListToSort.size() - 1; i++) {\n\t\t\tint index = i;\n\t\t\tfor (int j = i + 1; j < questListToSort.size(); j++) {\n\t\t\t\tif (questListToSort.get(j).getTimestamp() > questListToSort.get(index).getTimestamp()) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tCollections.swap(questListToSort, index, i);\n\t\t}\n\t\treturn questListToSort;\n\t}", "@Override\n public int compareTo(Booking other) {\n // Push new on top\n other.updateNewQuestion(); // update NEW button\n this.updateNewQuestion();\n\n\n String[] arr1 = other.time.split(\":\");\n String[] arr2 = this.time.split(\":\");\n// Date thisDate = new Date(this.getCalendarYear(), this.getCalendarMonth(), this.getCalendarDay(), Integer.getInteger(arr2[0]), Integer.getInteger(arr2[1]));\n// if (this.newQuestion != other.newQuestion) {\n// return this.newQuestion ? 1 : -1; // this is the winner\n// }\n\n\n if (this.calendarYear == other.calendarYear) {\n if (this.calendarMonth == other.calendarMonth) {\n if (this.calendarDay == other.calendarDay) {\n if (Integer.parseInt(arr2[0]) == Integer.parseInt(arr1[0])) { // hour\n if (Integer.parseInt(arr2[1]) == Integer.parseInt(arr1[1])) { // minute\n return 0;\n } else {\n return Integer.parseInt(arr1[1]) > Integer.parseInt(arr2[1]) ? -1 : 1;\n }\n } else {\n return Integer.parseInt(arr1[0]) > Integer.parseInt(arr2[0]) ? -1 : 1;\n }\n }\n else\n return other.calendarDay > this.calendarDay ? -1 : 1;\n }\n else\n return other.calendarMonth > this.calendarMonth ? -1 : 1;\n }\n else\n return other.calendarYear > this.calendarYear ? -1 : 1;\n\n\n// if (this.echo == other.echo) {\n// if (other.calendarMonth == this.calendarMonth) {\n// return 0;\n// }\n// return other.calendarMonth > this.calendarMonth ? -1 : 1;\n// }\n// return this.echo - other.echo;\n }", "@Override\n public int compareTo(CacheEntry cacheEntry) {\n if (arrivalTime < cacheEntry.arrivalTime) return -1;\n else if (arrivalTime > cacheEntry.arrivalTime) return 1;\n else return 0;\n }", "public final void testSortCriteria() throws Exception\n {\n Vector vect = new Vector();\n final long modifier = 100;\n long sdArr[][] = { { 0, 10 }, { 0, 12 }, { 0, 8 }, { -5, 20 }, { -5, 13 }, { -5, 15 }, { -5, -7 }, { 2, 10 },\n { 2, 8 }, { 2, 2 }, { 12, 14 }, { -5, 5 }, { 10, 2 } };\n long sorted[][] = { { -5, -7 }, { 10, 2 }, { 2, 2 }, { -5, 5 }, { 0, 8 }, { 2, 8 }, { 0, 10 }, { 2, 10 },\n { 0, 12 }, { -5, 13 }, { 12, 14 }, { -5, 15 }, { -5, 20 } };\n\n patchArray(sdArr, modifier);\n patchArray(sorted, modifier);\n\n for (int i = 0; i < sdArr.length; i++)\n {\n vect.addElement(new RecordingImplMock(new Date(sdArr[i][0]), sdArr[i][1]));\n }\n RecordingList recordingList = new RecordingListImpl(vect);\n Comparator comparator = new Comparator();\n\n RecordingList newList = recordingList.sortRecordingList(comparator);\n\n assertNotNull(\"recordingList returned null\", newList);\n\n // check results\n LocatorRecordingSpec lrs = null;\n RecordingRequest req = null;\n\n int i = newList.size();\n for (i = 0; i < newList.size(); i++)\n {\n req = (RecordingRequest) newList.getRecordingRequest(i);\n lrs = (LocatorRecordingSpec) req.getRecordingSpec();\n assertEquals(\"sort criteria is wrong\", sorted[i][1], lrs.getDuration());\n }\n }", "@Test\r\n public void testGetShapesSortedByTimestamp() {\r\n List<Shape> expectedOutput = new ArrayList<Shape>();\r\n expectedOutput.add(circle);\r\n expectedOutput.add(square);\r\n expectedOutput.add(rectangle);\r\n expectedOutput.add(triangle);\r\n expectedOutput.add(regularPolygon);\r\n List<Shape> actualOutput = screen.sortShape(SortType.TIMESTAMP);\r\n assertEquals(expectedOutput, actualOutput);\r\n }", "public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }", "public int compareTo(ScheduleTime compare) {\n return (this.startHours - compare.startHours) * 100 + (this.startMins - compare.startMins);\n }", "public int compareTo(Event other){\n return other.timestamp.compareTo(timestamp);\n }", "@Override\n\tpublic int compare(Player o1, Player o2) {\n\t\treturn (int) (o1.getTime() - o2.getTime());\t\t\t\t\t\t\t\t\t\t//returns the time difference, if big, then player two is better \n\t}", "@Override\n\tpublic int compareTo(Object arg0) {\n\t\treturn this.start - ((liveRange) arg0).start;\n\t}", "@Override\n public int compare(Score o1, Score o2) {\n\n return o1.getSentId() - o2.getSentId();\n }", "public int compare(Itemset o1, Itemset o2) {\n long time1 = o1.getTimestamp();\n long time2 = o2.getTimestamp();\n if (time1 < time2) {\n return -1;\n }\n return 1;\n }", "LiveData<List<Task>> getSortedTasks(LocalDate startDate,\r\n LocalDate endDate);", "@Override\n public int compare(Task task1, Task task2) {\n return task1.getDate().compareTo(task2.getDate());\n }", "public double getSortTime() {\n return sortTime_;\n }", "public void sortQueries(){\n\t\tif (queries == null || queries.isEmpty()) {\n\t\t\treturn;\n\t\t} else {\n\t\t Collections.sort(queries, new Comparator<OwnerQueryStatsDTO>() {\n @Override\n public int compare(OwnerQueryStatsDTO obj1, OwnerQueryStatsDTO obj2) {\n if(obj1.isArchived() && obj2.isArchived()) {\n return 0;\n } else if(obj1.isArchived()) {\n return 1;\n } else if(obj2.isArchived()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n\n\t }\n\t}", "@Override\n public int compare(Event o1, Event o2) {\n char[] event1 = o1.getEvent().toCharArray();\n char[] event2 = o2.getEvent().toCharArray();\n\n int i = 0; // Intiialize counter variable i\n\n while (i < event1.length && i < event2.length) // We reached the end, stop\n {\n if (event1[i] - event2[i] == 0) /* if the two elements are the same, tells us nothing about difference */\n {\n i++; // Keep going\n }\n\n else if (event1[i] - event2[i] < 0) // If true, this->str[i] comes first\n {\n return -1; // Return -1 for sorting\n }\n\n else if (event1[i] - event2[i] > 0) // If true,argStr.str[i] comes first\n {\n return 1;\n }\n }\n\n if (event1.length < event2.length)\n {\n return -1;\n }\n\n else if (event1.length > event2.length)\n {\n return 1;\n }\n\n else\n {\n return 0;\n }\n\n }", "@Override\n\t\tpublic int compareTo(Pair newThread) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tif(this.wakeTime > newThread.wakeTime) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse if(this.wakeTime < newThread.wakeTime) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}", "@Override\n\tpublic List<Listing> findAllSortedByTime() {\n\t\treturn theListingRepo.findAll(Sort.by(Direction.DESC, \"dateUploaded\"));\n\t}", "@Test\n public void testFail(){\n List<StoryPart> storyParts = new ArrayList<>();\n StoryPart a = new StoryPart(LocalTime.of(0, 2), null, null, StoryEvent.HALF_TIME_A_END, StoryTitle.create(\"halftime 1 end\"),\n StoryDescription.create(\"halftime 2 end\"));\n StoryPart b = new StoryPart(LocalTime.of(0, 3), null, GameMinute.create(\"2.\"), StoryEvent.GOAL, StoryTitle.create(\"Goal 2\"),\n StoryDescription.create(\"goal 2\"));\n StoryPart c = new StoryPart(LocalTime.of(0, 1), null, GameMinute.create(\"1.\"), StoryEvent.YELLOW_CARD,\n StoryTitle.create(\"yellow card 1\"), StoryDescription.create(\"yellow card 1\"));\n storyParts.add(a);\n storyParts.add(b);\n storyParts.add(c);\n\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortA = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortB = new ArrayList<>(storyParts);\n Collections.shuffle(storyParts);\n storyParts.sort(new StoryPartTimeLineComparator());\n List<StoryPart> sortC = new ArrayList<>(storyParts);\n\n assertEquals(sortA.get(0), sortB.get(0));\n assertEquals(sortA.get(0), sortC.get(0));\n\n assertEquals(sortA.get(1), sortB.get(1));\n assertEquals(sortA.get(1), sortC.get(1));\n\n assertEquals(sortA.get(2), sortB.get(2));\n assertEquals(sortA.get(2), sortC.get(2));\n\n }", "public void sortFinalsList() {\n \n Course course = null;\n int j = 0;\n for (int i = 1; i < finalsList.size(); i++) {\n\n j = i;\n // checks to see if the start time of the element j is less than the\n // previous element, and if j > 0\n while (j > 0) {\n\n // if the current element, is less than the previous, then....\n if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) < 0) {\n\n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n else if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) == 0) {\n \n if (compareTimes(finalsList.get(j).getBeginTime(), finalsList.get(j - 1).getBeginTime()) < 0) {\n \n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n }\n\n // decrement j\n j--;\n }\n }\n }", "public double getSortTime() {\n return sortTime_;\n }", "@Override\n\t\t\t\tpublic int compare(StatisticsItemData o1, StatisticsItemData o2) {\n\t\t\t\t\treturn o2.getDate().compareTo(o1.getDate());\n\t\t\t\t}", "@Override\n public int compare(Object mMailPersonItem1, Object mMailPersonItem2) {\n Conversation tem1 = (Conversation) mMailPersonItem1;\n Conversation tem2 = (Conversation) mMailPersonItem2;\n String[] array = new String[2];\n int cr = 0;\n int a = tem2.mPriority - tem1.mPriority;\n if (a != 0) {\n cr = (a > 0) ? 2 : -1;\n } else {\n //按薪水降序排列\n array[0] = ((Conversation) mMailPersonItem1).mTime;\n array[1] = ((Conversation) mMailPersonItem2).mTime;\n if (array[0].equals(array[1])) {\n cr = 0;\n }\n Arrays.sort(array);\n if (array[0].equals(((Conversation) mMailPersonItem1).mTime)) {\n cr = -2;\n } else if (array[0].equals(((Conversation) mMailPersonItem2).mTime)) {\n cr = 1;\n }\n }\n return cr;\n }", "public int compare(Meeting meetingOne, Meeting meetingTwo) {\n return meetingOne.getDate().compareTo(meetingTwo.getDate());\n }", "boolean hasOrderByDay();", "@Override\r\n\t\tpublic int compareTo(Event compareEvent){\r\n\t\t\t\r\n\t\t\tint compareQuantity = ((Event)compareEvent).date;\r\n\t\t\t//ascending order\r\n\t\t\treturn this.date-compareQuantity;\r\n\t\t\t//descending order\r\n\t\t\t//return compareQuantity -this.quantity;\r\n\t\t}", "@Override\n public int compareTo(TestTask o) {\n assert o != null;\n int result;\n if (this.isEvent()){\n result = o.isEvent() \n ? this.endTime.compareTo(o.endTime) \n : this.endTime.compareTo(o.deadline);\n } else {\n result = o.isEvent() \n ? this.deadline.compareTo(o.endTime) \n : this.deadline.compareTo(o.deadline);\n }\n return result == 0 \n ? this.name.compareTo(o.name)\n : result;\n }", "@Test\n public void testCompareTo () {\n CountDownTimer s1 = new CountDownTimer(5, 59, 00);\n CountDownTimer s2 = new CountDownTimer(6, 01, 00);\n CountDownTimer s3 = new CountDownTimer(5, 50, 20);\n CountDownTimer s4 = new CountDownTimer(\"5:59:00\");\n\n assertTrue(s2.compareTo(s1) > 0);\n assertTrue(s3.compareTo(s1) < 0);\n assertTrue(s1.compareTo(s4) == 0);\n assertTrue(CountDownTimer.compareTo(s2, s4) > 0);\n assertTrue(CountDownTimer.compareTo(s3, s1) < 0);\n assertTrue(CountDownTimer.compareTo(s1, s4) == 0);\n }", "public int compareTo(Message other){\n if(time < other.time) {\n return -1;\n } else { // assume one comes before the other in all instances\n return 1;\n }\n }", "@Override\n public int compareTo(GameScores gs) {\n if (this.getTime() == gs.getTime()) return 0;\n else return this.getTime() > gs.getTime() ? 1 : -1;\n }", "private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }", "public int compare(ThreadWait a, ThreadWait b)\n {\n if(b.wakeUp > a.wakeUp){\n return -1;\n }\n if (b.wakeUp == a.wakeUp){\n return 0;\n }\n \n return 1;\n \n }", "void updateSortingComparators(Comparator<ReadOnlyEntry> eventComparator,\n Comparator<ReadOnlyEntry> deadlineComparator,\n Comparator<ReadOnlyEntry> floatingTaskComparator);", "@Override\n\t\tpublic int compareTo(Job j)\n\t\t{\n\t\t\tJob job = j;\n\t\t\tif (this.getRunTime() < job.getRunTime()) {\n\t\t\t\treturn -1;\n\t\t\t} \n\t\t\treturn 1;\n\t\t}", "@Override\n public int compare(Student o1, Student o2) {\n \n int o1class =\n (o1.getArchived()) ? 4:\n (o1.getStudyStartDate() != null && o1.getStudyEndDate() == null) ? 1:\n (o1.getStudyStartDate() == null && o1.getStudyEndDate() == null) ? 2:\n (o1.getStudyEndDate() != null) ? 3:\n 5;\n int o2class =\n (o2.getArchived()) ? 4:\n (o2.getStudyStartDate() != null && o2.getStudyEndDate() == null) ? 1:\n (o2.getStudyStartDate() == null && o2.getStudyEndDate() == null) ? 2:\n (o2.getStudyEndDate() != null) ? 3:\n 5;\n\n if (o1class == o2class) {\n // classes are the same, we try to do last comparison from the start dates\n return ((o1.getStudyStartDate() != null) && (o2.getStudyStartDate() != null)) ? \n o2.getStudyStartDate().compareTo(o1.getStudyStartDate()) : 0; \n } else\n return o1class < o2class ? -1 : o1class == o2class ? 0 : 1;\n }", "private ArrayList<Task> sortByDate(ArrayList<Task> toSort) {\n ArrayList<Task> sorted = new ArrayList<>();\n\n toSort = removeNoTimeTask(toSort);\n\n int size = toSort.size();\n for (int i = 0; i < size; i++) {\n Date earliest = new Date(Long.MAX_VALUE);\n int earliestIndex = -1;\n for (int j = 0; j < toSort.size(); j++) {\n if (toSort.get(j).getClass().equals(Deadline.class)) {\n Deadline temp = (Deadline) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Event.class)) {\n Event temp = (Event) toSort.get(j);\n if (temp.getTime().before(earliest)) {\n earliest = temp.getTime();\n earliestIndex = j;\n }\n } else if (toSort.get(j).getClass().equals(Period.class)) {\n Period temp = (Period) toSort.get(j);\n if (temp.getStart().before(earliest)) {\n earliest = temp.getStart();\n earliestIndex = j;\n }\n }\n }\n\n sorted.add(toSort.get(earliestIndex));\n toSort.remove(earliestIndex);\n }\n return sorted;\n }", "@Override\n\tpublic int compareTo(Object o)\n\t{\n\t if(o instanceof Context)\n\t {\n\t \tif (timestamp==null || ((Context) o).timestamp==null)\n\t \t\treturn 0;\n\t return timestamp.compareTo(((Context) o).timestamp);\n\t }\n\t return 0;\n\t}", "@Override\n public int compareTo(Object object) {\n return Comparator\n .comparing(PhoneCall::getStartTime)\n .thenComparing(PhoneCall::getCaller)\n .compare(this, (PhoneCall) object);\n }", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "@Override\r\n\t\t\t\tpublic int compare(Comparendo o1, Comparendo o2) \r\n\t\t\t\t{\n\t\t\t\t\treturn o1.fechaHora.compareTo(o2.fechaHora);\r\n\t\t\t\t}", "@Override\n\t\t\tpublic int compare(Interval o1, Interval o2) {\n\t\t\t\treturn o1.start-o2.start;\n\t\t\t}", "@Override\n\tpublic int compareTo(Edge arg0) {\n\t\treturn arg0.time - this.time;\n\t}", "@Override\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// luon duoc sap xep theo thoi gian thuc hien con lai\n\t\t\tpublic int compare(Integer o1, Integer o2) {\t\t\t\t\t\t // tu be den lon sau moi lan add them gia tri vao \n\t\t\t\tif (burstTimeArr[o1] > burstTimeArr[o2]) return 1;\n\t\t\t\tif (burstTimeArr[o1] < burstTimeArr[o2]) return -1;\n\t\t\t\treturn 0;\n\t\t\t}", "public void setTimeSort(Integer timeSort) {\n this.timeSort = timeSort;\n }", "protected void sortCheck() {\n if (m_instances == null) {\n return;\n }\n \n if (m_simpleConfigPanel.isUsingANativeTimeStamp()) {\n String timeStampF = m_simpleConfigPanel.getSelectedTimeStampField();\n Attribute timeStampAtt = m_instances.attribute(timeStampF); \n if (timeStampAtt != null) {\n \n double lastNonMissing = Utils.missingValue();\n boolean ok = true;\n boolean hasMissing = false;\n for (int i = 0; i < m_instances.numInstances(); i++) {\n Instance current = m_instances.instance(i);\n \n if (Utils.isMissingValue(lastNonMissing)) {\n if (!current.isMissing(timeStampAtt)) {\n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n } else {\n if (!current.isMissing(timeStampAtt)) {\n if (current.value(timeStampAtt) - lastNonMissing < 0) {\n ok = false;\n break;\n }\n \n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n }\n }\n \n if (!ok && !hasMissing) {\n // ask if we should sort\n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". Do you want to sort the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Sorting data...\");\n }\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n \n if (!ok && hasMissing) {\n // we can't really proceed in this situation. We can't sort by the timestamp\n // because instances with missing values will be put at the end of the data.\n // The only thing we can do is to remove the instances with missing time\n // stamps but this is likely to screw up the periodicity and majorly impact\n // on results.\n \n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". \\nFurthermore, there are rows with\\n\" +\n \t\t\"missing timestamp values. We can remove these\\n\" +\n \t\t\"rows and then sort the data but this is likely to\\n\" +\n \t\t\"result in degraded performance. It is strongly\\n\" +\n \t\t\"recommended that you fix these issues in the data\\n\" +\n \t\t\"before continuing. Do you want the system to proceed\\n\" +\n \t\t\"anyway by removing rows with missing timestamps and\\n\" +\n \t\t\"then sorting the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Removing rows with missing time stamps and sorting data...\");\n }\n m_instances.deleteWithMissing(timeStampAtt);\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n }\n }\n }", "@Override\n public int compareTo(AbstractAppointment o) {\n try {\n if (this.beginTime == null) {\n throw new NullPointerException(\"No start time to compare\");\n }\n if (o.getBeginTime() == null) {\n throw new NullPointerException(\"No begin time to compare\");\n }\n long diff = this.beginTime.getTime()-o.getBeginTime().getTime();\n\n if (diff > 0) {\n return 1;\n }\n if (diff < 0) {\n return -1;\n }\n if (diff == 0) {\n long enddiff = this.endTime.getTime()-o.getEndTime().getTime();\n\n if(enddiff >0){\n return 1;\n }\n if(enddiff<0){\n return -1;\n }\n if(enddiff == 0){\n int descriptiondiff = this.description.compareTo(o.getDescription());\n if(descriptiondiff >0){\n return 1;\n }\n if(descriptiondiff<0){\n return -1;\n }\n }\n }\n }\n catch(Exception ex){\n System.out.println(ex.getMessage());\n System.exit(1);\n }\n return 0;\n }", "private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }", "@Override\n public int compareTo(Task task) {\n int r = 0;\n\n if(this.hasStartAndEnd() && task.hasStartAndEnd()) {\n r = this.start.compareTo(task.start);\n if(r == 0) r = this.end.compareTo(task.end);\n } else if(this.hasStartAndEnd()) {\n return -1;\n } else if(task.hasStartAndEnd()) {\n return 1;\n }\n\n if(r == 0) r = this.name.compareTo(task.name);\n if(r == 0) r = this.duration.compareTo(task.duration);\n if(r == 0) r = this.description.compareTo(task.description);\n\n return r;\n }", "public void sort() {\n\t\tArrayList<Medication> dayList = new ArrayList<Medication>();\n\t\tupcomingMedsLabel.setText(\"\");\n\t\tDate dt = new Date();\n\t\tDateFormat df = new SimpleDateFormat(\"EEEE\");\n\t\tString currentDay = df.format(dt);\n\t\t\n\t\t//Runs through all elements in the array\n\t\tfor(int i = 0; i < medList.size(); i++) {\n\t\t\t//Checks to see if the medication needs to be taken today\n\t\t\tif(medList.get(i).getMedDateTime().contains(currentDay)) {\n\t\t\t\tboolean added = false;\n\t\t\t\t//If no other element has been added, added the element\n\t\t\t\tif(dayList.size() == 0) {\n\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t} else {\n\t\t\t\t\t//Checks all other medications in the dayList to order them chronologicaly\n\t\t\t\t\tfor(int j = 0; j < dayList.size(); j++) {\n\t\t\t\t\t\t//Get the hour of element at j and compare it again element at i of medList\n\t\t\t\t\t\tint hour = Integer.parseInt(dayList.get(j).getHour());\n\t\t\t\t\t\t//If < add at j, if equal check minutes else add later\n\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getHour()) < hour) {\n\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (Integer.parseInt(medList.get(i).getHour()) == hour) {\n\t\t\t\t\t\t\tadded = true;\n\t\t\t\t\t\t\t//Checks against minutes\n\t\t\t\t\t\t\tint minute = Integer.parseInt(dayList.get(j).getMinute());\n\t\t\t\t\t\t\tif(Integer.parseInt(medList.get(i).getMinute()) < minute) {\n\t\t\t\t\t\t\t\tdayList.add(j, medList.get(i));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif(dayList.size() > (j + 1)) {\n\t\t\t\t\t\t\t\t\tdayList.add(j+1, medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(added == false) {\n\t\t\t\t\t\tdayList.add(medList.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Update the upcomingMedsLabel\n\t\tfor(int i = 0; i < dayList.size(); i++) {\n\t\t\tupcomingMedsLabel.setText(upcomingMedsLabel.getText() + \"\\n\\n\" + dayList.get(i));\n\t\t}\n\t}", "@Override\n public int compareTo(Object o) {\n Run run = (Run)o;\n if(runDate.compareTo(run.getRunDate()) == 0){ \n return getName().compareTo(run.getName());\n }else{\n return run.getRunDate().compareTo(getRunDate());\n }\n }", "public int compareTo(Instruction other){\n return this.arrivalTime - other.arrivalTime;\n }", "@Override\n\tpublic int compareTo(Meeting meeting){\n\t\tif(this.getDate().equals(meeting.getDate())){\n\t\t\treturn 0;\n\t\t}\n\t\telse if(this.getDate().before(meeting.getDate())){\n\t\t\treturn -1;\n\t\t}\n\t\telse{\n\t\t\treturn 1;\n\t\t}\n\t}", "@Test\n\tpublic void testAssociatorSort() throws Exception {\n\t\t// add out of order to events list\n\t\tJsonEventInfoComparatorTest comparatorTest = new JsonEventInfoComparatorTest();\n\t\tcomparatorTest.setup();\n\t\ttestService.events.add(comparatorTest.farEvent);\n\t\ttestService.events.add(comparatorTest.fartherEvent);\n\t\ttestService.events.add(comparatorTest.closeEvent);\n\n\t\tJsonEventInfo reference = new JsonEventInfo(comparatorTest.referenceEvent);\n\t\tList<JsonEventInfo> sorted = testAssociator.getSortedNearbyEvents(\n\t\t\t\treference, null);\n\t\tAssert.assertEquals(\"closest event first\",\n\t\t\t\tcomparatorTest.closeEvent, sorted.get(0).getEvent());\n\t\tAssert.assertEquals(\"farther event last\",\n\t\t\t\tcomparatorTest.fartherEvent,\n\t\t\t\tsorted.get(testService.events.size() - 1).getEvent());\n\n\t\tSystem.err.println(testAssociator.formatOutput(reference, null, sorted));\n\t}", "public static void printAllEventListInSortedOrder(){\n sortEvents();\n for(int i=0;i<events.size();i++){\n System.out.println((events.get(i).getMonth()+1)+\"/\"+events.get(i).getDate()+\"/\"+events.get(i).getYear()+\" \"+events.get(i).getStringStartandFinish()+\" \"+events.get(i).getEventTitle());\n }\n }", "@Override\n\tpublic int compareTo(FinishedMatch o) {\n\t\treturn (int)(o.getMatchId() - this.getMatchId());\n\t}", "@Test\n public void ratingAtSameTimeAsStartIsReturned() {\n LocalDateTime firstTime = LocalDateTime.of(2017, Month.JANUARY, 1, 0, 0);\n\n TimePeriod tp = new TimePeriod(firstTime, firstTime.plusHours(4));\n ScoreTime r1 = new ScoreTime(firstTime, 3);\n ScoreTime r2 = new ScoreTime(firstTime.plusHours(3), 3);\n\n List<ScoreTime> returnedList = getRatingsBetweenAndSometimesOneBefore(tp, Arrays.asList(r1, r2));\n assertEquals(2, returnedList.size());\n assertEquals(r1.getTime(), returnedList.get(0).getTime());\n assertEquals(r2.getTime(), returnedList.get(1).getTime());\n }", "@Override\n\tpublic int compareTo(ParsedURLInfo o) {\n\t\treturn this.seqTime.compareTo(o.getSeqTime());\n\t}", "public int compareTo(Actor actor1, Actor actor2) {\n\n List<Event> actorEvents1 = actor1.getEventList();\n List<Event> actorEvents2 = actor2.getEventList();\n\n // it's the same number of events,therefore order further by timestamp\n List<Timestamp> timestampsOfActor1 = DateUtil.getInstance().getTimeStampsOfEventList(actorEvents1);\n Timestamp maxTimestampOfActor1 = DateUtil.getInstance().getMaxTimestamp(timestampsOfActor1);\n\n List<Timestamp> timestampsOfActor2 = DateUtil.getInstance().getTimeStampsOfEventList(actorEvents2);\n Timestamp maxTimestampOfActor2 = DateUtil.getInstance().getMaxTimestamp(timestampsOfActor2);\n\n int resultOfComparingMaxTimestampsOfBothActors = maxTimestampOfActor1.compareTo(maxTimestampOfActor2);\n\n //now since comparing both maximum timestamps and they are the same,we use the login names to compare\n if (resultOfComparingMaxTimestampsOfBothActors == 0) {\n\n String loginNameActor1 = actor1.getLogin().trim();\n String loginNameActor2 = actor2.getLogin().trim();\n\n //finally we compare the strings ignoring case and since the login name is unique,\n // we can be sure that the list will be sorted alphabetically perfectly\n return loginNameActor1.compareToIgnoreCase(loginNameActor2);\n }\n //it will be greater than or equal so we return it,\n // but we need to go vice versa because we need it in ascending order not desceding\n return (resultOfComparingMaxTimestampsOfBothActors == -1) ? 1 : -1;\n }", "public void sort() {\r\n for (int i = 0; i < namesOfApp.length && i < runTimeOfApp.length; i++) {\r\n for (int j = 0; j < i; j++) {\r\n if (runTimeOfApp[j] < runTimeOfApp[i]) {\r\n String tempName = namesOfApp[i];\r\n long tempRunTime = runTimeOfApp[i];\r\n namesOfApp[i] = namesOfApp[j];\r\n runTimeOfApp[i] = runTimeOfApp[j];\r\n namesOfApp[j] = tempName;\r\n runTimeOfApp[j] = tempRunTime;\r\n }\r\n }\r\n }\r\n\r\n }", "public void sortQ(ArrayList<String> requestQ){\r\n\t\tfor(int i=0; i< (requestQ.size()-1); i++){\r\n\t\t\tint small = i;\r\n\t\t\tfor(int j = i+1; j < requestQ.size(); j++){\r\n\t\t\t\tString value1 = (String) requestQ.get(small);\r\n\t\t\t\tString[] temp1 = value1.split(\",\");\r\n\t\t\t\tString value2 = (String) requestQ.get(j);\r\n\t\t\t\tString[] temp2 = value2.split(\",\");\r\n\t\t\t\t// if timestamp is lower\r\n\t\t\t\tif(Integer.parseInt(temp1[1]) > Integer.parseInt(temp2[1])){\r\n\t\t\t\t\tsmall = j;\r\n\t\t\t\t}\r\n\t\t\t\t// if timestamp is equal\r\n\t\t\t\telse if(Integer.parseInt(temp1[1]) == Integer.parseInt(temp2[1])){\r\n\t\t\t\t\t// check for process ids\r\n\t\t\t\t\tif(Integer.parseInt(temp1[0]) > Integer.parseInt(temp2[0])){\r\n\t\t\t\t\t\tsmall = j;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}// inner for loop\r\n\t\tString swap = (String)requestQ.get(i);\r\n\t\trequestQ.set(i, requestQ.get(small));\r\n\t\trequestQ.set(small, swap);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public static void listByWatched(){\r\n System.out.println('\\n'+\"List by Watched\");\r\n CompareWatched compareWatched = new CompareWatched();\r\n Collections.sort(movies, compareWatched);\r\n for (Movie watch:movies){\r\n System.out.println('\\n'+\"Times Watched \"+ watch.getTimesWatched()+'\\n'+\"Title: \"+ watch.getName()+'\\n'+\"Rating: \"+ watch.getRating()+'\\n');\r\n }\r\n }", "public int compare(Object a, Object b) {\n if (a == b) {\n return 0;\n }\n CountedObject ca = (CountedObject)a;\n CountedObject cb = (CountedObject)b;\n int countA = ca.count;\n int countB = cb.count;\n if (countA < countB) {\n return 1;\n }\n if (countA > countB) {\n return -1;\n }\n return 0;\n }", "private void sortDate()\n {\n for(int i = 0; i < movieList.size(); i++){\n for(int j = 1; j < movieList.size() - i; j++)\n {\n Movie a = movieList.get(j-1);\n Movie b = movieList.get(j);\n int result = a.getReleaseDate().compareTo(b.getReleaseDate());\n if( result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n result = a.getTitle().compareTo(b.getTitle());\n if(result > 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n }\n }\n }\n }", "public static void main(String[] args) {\n\t\tList<StatetostateDetail> list = new ArrayList<StatetostateDetail>();\n\t\tfor(int i = 1; i < 16; i++){\n\t\t\tStatetostateDetail s = new StatetostateDetail();\n\t\t\ts.setId(i);\n\t\t\ts.setStatue(0);\n\t\t\ts.setTime(System.currentTimeMillis() + (i + i * 100));\n\t\t\tlist.add(s);\n\t\t}\n\t\tlist.get(3).setStatue(1);\n\t\tlist.get(5).setStatue(1);\n\t\tlist.get(10).setStatue(1);\n\t\tlist.get(14).setStatue(1);\n\t\tlist.get(7).setStatue(2);\n\t\tlist.get(9).setStatue(2);\n\t\tSystem.out.println(\"list:\" + list);\n\t\n\t\t\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \tLong t1 = null;\n \tLong t2 = null;\n \ttry{\n \t\tt1 = s1.getTime();\n\t \tt2 = s2.getTime();\n \t}catch(Exception e){\n \t\te.printStackTrace();\n \t}\n \n return t2.compareTo(t1);\n }\n });\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \treturn s1.getStatue()>s2.getStatue()?1:(s1.getStatue()==s2.getStatue()?0:(s2.getTime()>s1.getTime()?-1:0));\n }\n });\n\t\t\n\t\tSystem.out.println(\"list:\" + list);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}" ]
[ "0.6694357", "0.66612476", "0.6291751", "0.59298056", "0.58945274", "0.5891976", "0.58677155", "0.58254486", "0.5794877", "0.57768446", "0.5767092", "0.5760854", "0.56985486", "0.5683411", "0.5642523", "0.56283975", "0.56255466", "0.5597049", "0.5596312", "0.5588556", "0.55716926", "0.55674493", "0.5548898", "0.5527646", "0.5503035", "0.5470602", "0.5468994", "0.544463", "0.54377776", "0.54253644", "0.5420392", "0.5415489", "0.54029685", "0.5396878", "0.5351628", "0.5351119", "0.5348272", "0.5310749", "0.5309035", "0.52867013", "0.5278117", "0.52671933", "0.5249782", "0.52054423", "0.5190858", "0.5187318", "0.51733357", "0.5168855", "0.5148492", "0.5131151", "0.51284367", "0.51162946", "0.5109887", "0.50986457", "0.5094033", "0.50938654", "0.5092142", "0.5091148", "0.50837064", "0.5072117", "0.507202", "0.50671804", "0.5063786", "0.50636005", "0.506355", "0.50474876", "0.5044038", "0.5043978", "0.50201267", "0.50146043", "0.50008637", "0.49975994", "0.49965397", "0.49920973", "0.49900374", "0.498679", "0.49864885", "0.4985889", "0.49776408", "0.49769437", "0.4976621", "0.49649894", "0.49583635", "0.4945916", "0.49404207", "0.49252322", "0.4923526", "0.49221042", "0.49092817", "0.48954228", "0.4894622", "0.4890659", "0.48902988", "0.4883655", "0.48825788", "0.4877681", "0.48723975", "0.4864697", "0.4863434", "0.48598024", "0.48525253" ]
0.0
-1
Simple console display of HITS Algorithm results.
public void report(List<Page> result) { // Print Pages out ranked by highest authority sortAuthority(result); System.out.println("AUTHORITY RANKINGS : "); for (Page currP : result) System.out.printf(currP.getLocation() + ": " + "%.5f" + '\n', currP.authority); System.out.println(); // Print Pages out ranked by highest hub sortHub(result); System.out.println("HUB RANKINGS : "); for (Page currP : result) System.out.printf(currP.getLocation() + ": " + "%.5f" + '\n', currP.hub); System.out.println(); // Print Max Authority System.out.println("Page with highest Authority score: " + getMaxAuthority(result).getLocation()); // Print Max Authority System.out.println("Page with highest Hub score: " + getMaxAuthority(result).getLocation()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void displayResults() {\r\n Preferences.debug(\" ******* FitMultiExponential ********* \\n\\n\", Preferences.DEBUG_ALGORITHM);\r\n dumpTestResults();\r\n }", "public void showHeuristics() {\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int col = 0; col < BOARD_SIZE; col++) {\n System.out.printf(\"%3d\", getSquareAccessibility(row, col));\n if (col == BOARD_SIZE - 1) {\n System.out.println();\n }\n }\n }\n }", "private static void displayHelp(){\n System.out.println(\"1. (R)eport\");\n System.out.println(\"2. (M)inimum Spanning Tree\");\n System.out.println(\"3. (S)hortest Path from i j\");\n System.out.println(\"4. (D)own i j\");\n System.out.println(\"5. (U)p i j\");\n System.out.println(\"6. (C)hange Weight i j x\");\n System.out.println(\"7. (E)ulerian\");\n System.out.println(\"8. (Q)uit\");\n }", "@Override\r\n\tpublic void displayHashTable()\r\n\t{\r\n\t\tSystem.out.println(hm.toString());\r\n\t}", "public static void printResults() {\n System.out.println(\" Results: \");\n Crawler.getKeyWordsHits().forEach((keyWord, hitsNumber) -> System.out.println(keyWord + \" : \" + hitsNumber + \";\"));\n System.out.println(\" Total hits: \" + Crawler.getTotalHits());\n\n }", "public void outputStats (){\n System.out.println(\"Your sorcerer's stats:\");\n System.out.println(\"HP = \" + hp);\n System.out.println(\"Mana = \" + mana);\n System.out.println(\"Strength = \" + strength);\n System.out.println(\"Vitality = \" + vitality);\n System.out.println(\"Energy = \" + energy);\n }", "void printStats();", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out.println(\"Time Taken: \" + (endTime - startTime) +\"ms\");\t\n\t}", "public void stats() {\n\t\tSystem.out.println(\"Hash Table Stats\");\n\t\tSystem.out.println(\"=================\");\n\t\tSystem.out.println(\"Number of Entries: \" + numEntries);\n\t\tSystem.out.println(\"Number of Buckets: \" + myBuckets.size());\n\t\tSystem.out.println(\"Histogram of Bucket Sizes: \" + histogram());\n\t\tSystem.out.printf(\"Fill Percentage: %.5f%%\\n\", fillPercent());\n\t\tSystem.out.printf(\"Average Non-Empty Bucket: %.7f\\n\\n\", avgNonEmpty());\t\t\n\t}", "public void displayResults() {\n\t\tcreateCluster();\n\t\tassignClusterID();\n\t\tSystem.out.println(iterations);\n\t\tWriter writer;\n\t\ttry {\n\t\t\twriter = new FileWriter(\"/Users/saikalyan/Documents/ClusterResult_kmeans.txt\");\n\t\t\tfor (int key : labelsMap.keySet()) {\n\t\t\t\tclusterResultsList.add(clusterIdMap.get(labelsMap.get(key)));\n\t\t\t\twriter.write(String.valueOf(clusterIdMap.get(labelsMap.get(key))));\n\t\t\t\twriter.write(\"\\r\\n\");\n\t\t\t\tSystem.out.println(key + \" : \" + clusterIdMap.get(labelsMap.get(key)));\n\t\t\t}\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tExternalValidator extValidation = new ExternalValidator(count, groundTruthList, clusterResultsList);\n\n\t\tfloat res = extValidation.getCoefficient();\n\t\tSystem.out.println(\"Rand Index------------\" + res);\n\n\t\tfloat jaccard = extValidation.getJaccardCoeff();\n\t\tSystem.out.println(\"Jaccard co-efficient------------\" + jaccard);\n\n\t}", "public void display() {\n System.out.println(toString());\n }", "public void printResults(){\n\t\tSystem.out.println(\"The area of the triangle is \" + findArea());\n\t\tSystem.out.println(\"The perimeter of the triangle is \"+ findPerimeter());}", "@Override\n\tpublic void display() {\n\t\tStringBuilder string = new StringBuilder();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (hashArray[i] == null)\n\t\t\t\tstring.append(\"** \");\n\t\t\telse if (hashArray[i] == deleted)\n\t\t\t\tstring.append(hashArray[i].value + \" \");\n\t\t\telse\n\t\t\t\tstring.append(\"[\" + hashArray[i].value + \", \"\n\t\t\t\t\t\t+ hashArray[i].frequency + \"] \");\n\t\t}\n\t\tSystem.out.println(string.toString());\n\t}", "private static void printStats()\r\n\t{\r\n\t\tSystem.out.println(\"Keywords found: \" + keywordHits);\r\n\t\tSystem.out.println(\"Links found: \" + SharedLink.getLinksFound());\r\n\t\tSystem.out.println(\"Pages found: \" + SharedPage.getPagesDownloaded());\r\n\t\tSystem.out.println(\"Failed downloads: \" + SharedPage.getFailedDownloads());\r\n\t\tSystem.out.println(\"Producers: \" + fetchers);\r\n\t\tSystem.out.println(\"Consumers: \" + parsers);\r\n\t}", "public static void display() {\n\n\t\tSystem.out.println(\"************************************************************\");\n\t\tSystem.out.println(\"* Omar Oraby\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* 900133379\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* Salma Talaat *\");\n\t\tSystem.out.println(\"* 900161560\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* Ahmed Elshafey *\");\n\t\tSystem.out.println(\"* 900131045 *\");\n\t\tSystem.out.println(\"* Programming in Java *\");\n\t\tSystem.out.println(\"* (2018 Fall) *\");\n\t\tSystem.out.println(\"************************************************************\");\n\t\tSystem.out.println();\n }", "public static void printUsage() {\n System.out.println(\"*****\\t*****\\t*****\");\n System.out.println(\"Usage:\");\n System.out.println(\"par/seq, L/B, N, M, C, output file\");\n System.out.println(\"Using type of calculation: par(parallel) or seq(sequential)\");\n System.out.println(\"Using numbers: L - Long, B - BigInteger\");\n System.out.println(\"Program finds all prime numbers in range [N, M]\");\n System.out.println(\"That ends with number C\");\n System.out.println(\"N, M, C should be whole numbers and N must be less than M!\");\n System.out.println(\"Output is written into file \\\"output file\\\", first number is \");\n System.out.println(\"The quantity of prime numbers and after - all found prime numbers\");\n System.out.println(\"*****\\t*****\\t*****\");\n }", "public void printAll(){\n\t\tSystem.out.println(\"Single hits: \" + sin);\n\t\tSystem.out.println(\"Double hits: \" + doub);\n\t\tSystem.out.println(\"Triple hits: \" + trip);\n\t\tSystem.out.println(\"Homerun: \" + home);\n\t\tSystem.out.println(\"Times at bat: \" + atbat);\n\t\tSystem.out.println(\"Total hits: \" + hits);\n\t\tSystem.out.println(\"Baseball average: \" + average);\n\t}", "public void display(){\n int n = nb_instructions;\n System.out.println(\"There are \" + n + \" key_words\");\n for(int i = 0; i<n;i++){\n System.out.println(\"\\tKey_word \" + (i+1) + \": \" + key_words.get(i));\n }\n }", "@Override\n public void visualize() {\n if (this.count() > 0){\n for (int i = 0; i < this.count(); i++){\n System.out.println(i + \".- \" + this.bench.get(i).getName() + \" (ID: \" + this.bench.get(i).getId() + \")\");\n }\n } else {\n System.out.println(\"La banca está vacía.\");\n }\n\n }", "void display(){\n System.out.println(\"Name:\"+name);\n System.out.println(\"Age:\"+age);\n System.out.println(\"Faculty:\"+faculty);\n System.out.println(\"Department:\"+department);\n System.out.println(\"IsHandicapped:\"+isHandicapped);\n }", "public void display() {System.out.println(skaitlis);}", "static void displayMessage() {\n\n System.out.println(\"\\nA total of \" + graphVisited.size() + \" vertices visited\");\n\n System.out.println(\"Found \" + silhouetteAnalyzer(numberOfVertices)\n + \" silhouettes\");\n }", "private static void printStats(Stats stats) {\n long elapsedTime = (System.nanoTime() - startTime) / 1000000;\n System.out.println(\"Analysis completed - \" + keyCount + \" keys processed in \" + elapsedTime + \" ms\");\n getConsole().println(\"Analysis completed - \" + keyCount + \" keys processed in \" + elapsedTime + \" ms\");\n stats.print();\n }", "public static void displaySta() {\n System.out.println(\"\\n\\n\");\n System.out.println(\"average service time: \" + doAvgProcessingTime() /100 + \" milliseconds\");\n System.out.println(\"max service time: \" + maxProcessingTime /100 + \" milliseconds\");\n System.out.println(\"average turn around time \" + doAvgTurnAroundTime()/100 + \" milliseconds\");\n System.out.println(\"max turn around time \" + maxTurnAroundTime/100 + \" milliseconds\");\n System.out.println(\"average wait time \" + doAvgWaitTime()/10000 + \" milliseconds\");\n System.out.println(\"max wait time \" + maxWaitTime/10000 + \" milliseconds\");\n System.out.println(\"end time \" + endProgramTime);\n System.out.println(\"start time \" + startProgramTime);\n System.out.println(\"processor utilization: \" + doCPU_usage() + \" %\");\n System.out.println(\"Throughput: \" + doThroughPut());\n System.out.println(\"---------------------------\");\n\n\n }", "public void displayStats(PrintStream out) \r\n {\r\n \t// The current load factor\r\n \tdouble currLoadFactor = ((double)numItems)/((double)size);\r\n \t\r\n out.println(\"Current table size: \" + size);\r\n out.println(\"The number of items currently in the table: \" + numItems);\r\n out.println(\"The current load factor: \" + currLoadFactor);\r\n \r\n int largestChain = 0; // The largest chain\r\n int numZeroes = 0; // Number of LinkedList chains or \"buckets\" with size 0\r\n double averageLength = 0; // The average length of the buckets\r\n double average = 0; // The number of buckets\r\n \r\n for(int i = 0; i < hashTable.length; i++)\r\n {\r\n \tif(hashTable[i].size() > largestChain)\r\n \t{\r\n \t\tlargestChain = hashTable[i].size();\r\n \t}\r\n \tif(hashTable[i].isEmpty())\r\n \t{\r\n \t\tnumZeroes++;\r\n \t}\r\n \tif(hashTable[i].size() != 0)\r\n \t{\r\n \t\taverageLength += hashTable[i].size();\r\n \t\taverage++;\r\n \t}\r\n }\r\n \r\n // Retrieve the average length of a bucket\r\n averageLength = averageLength / average;\r\n \r\n out.println(\"The length of the largest chain: \" + largestChain);\r\n out.println(\"The number of chains of length 0: \" + numZeroes);\r\n out.println(\"The average of the chains of length > 0: \" + averageLength);\r\n }", "@Override\r\n\tpublic void showSpeed() {\n\t\tSystem.out.println(\"i can run at 100km/h\");\r\n\t}", "public void describe() {\n\t\tSystem.out.println(\"这是汽车底盘\");\n\t}", "private void displayGameHeader()\n {\n System.out.println(\"########Welcome to Formula 9131 Championship########\");\n }", "public void printResults() {\n getUtl().getOutput().add(\"~~ Results ~~\\n\");\n for (int i = 0; i < getHeroes().size(); i++) {\n if (getHeroes().get(i).isDead()) {\n getUtl().getOutput().add(getHeroes().get(i).getName().\n toCharArray()[0] + \" dead\\n\");\n } else {\n getUtl().getOutput().add(getHeroes().get(i).getName().\n toCharArray()[0] + \" \"\n + getHeroes().get(i).getLevel() + \" \"\n + getHeroes().get(i).getXp() + \" \"\n + getHeroes().get(i).getHp() + \" \"\n + getHeroes().get(i).getPosX() + \" \"\n + getHeroes().get(i).getPosY() + \"\\n\");\n }\n }\n // Write output to given outputPath.\n getGameFileWriter().write(getUtl().getOutput());\n for (int i = 0; i < getUtl().getOutput().size(); i++) {\n // Write output to console as well.\n System.out.print(getUtl().getOutput().get(i));\n }\n }", "public static void printHHSV(FqImage imh){\n\t\tint\ti,j;\r\n\t\tfor( i = 0 ; i < imh.width ; i++ ){\r\n\t\t\tfor( j = 0 ; j < imh.height ; j++ ){\r\n\t\t\t\tSystem.out.print(\"h\"+imh.points[i][j].getHHSV() );\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t}", "public void echo() {\n\tSystem.out.printf(\"cache name: %s\\n\", myCache.getName());\n\tSystem.out.printf(\"cache size: %s\\n\", myCache.size());\n\tSystem.out.printf(\"cache entry[%s]: %s\\n\", \"bean1\", myCache.get(\"bean1\").toString());\n\tSystem.out.printf(\"cache entry[%s]: %s\\n\", \"bean2\", myCache.get(\"bean2\").toString());\n }", "private static void printHelp() {\n getConsole().println(\"Keycheck\\n\" +\n \"\\n\" +\n \"Usage:\\n\" +\n \" keycheck.jar parameter1 parameter2 ... file1 file2 ...\\n\" +\n \"Example:\\n\" +\n \" java -jar keycheck.jar -\" + PARAMETER_BASE + \" -\" + PARAMETER_BITS + \" file1.csv file2.csv\" +\n \"\\n\" +\n \"Parameters:\\n\" +\n \" -\" + PARAMETER_GENERATE + \" [512|1024] Generate \" + GENERATED_KEY_COUNT + \" keys\\n\" +\n \" -\" + PARAMETER_NEW_FORMAT + \" New format will be use to load keys from file\\n\" +\n \" -\" + PARAMETER_TRANSFORM + \" Transform all keys to new format to file 'CARD_ICSN.csv'\\n\" +\n \" -\" + PARAMETER_BASE + \" Check base stats of keys\\n\" +\n \" -\" + PARAMETER_BITS + \" Generate statistics for all bits\\n\" +\n \" -\" + PARAMETER_BYTES + \" Generate statistics for all bytes\\n\" +\n \" -\" + PARAMETER_DIFFERENCE + \" Check primes difference\\n\" +\n \" -\" + PARAMETER_STRENGTH + \" Check primes strength\\n\" +\n \" -\" + PARAMETER_TIME + \" Generate time statistics\\n\" +\n \" -\" + PARAMETER_ALL + \" Generate all statistics and check all tests.\\n\");\n }", "public void displayHuffCodesTable() {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t\n\t\tfor (int i = 0; i < this.huffCodeVals.length; i++) {\n\t\t\t\n\t\t\tif (this.huffCodeVals[i] != null) {\n\t\t\t\tif (i == 9) {\n\t\t\t\t\ttoPrint.append(\"\\\\t\");\n\t\t\t\t\t\n\t\t\t\t} else if (i == 10) {\n\t\t\t\t\ttoPrint.append(\"\\\\n\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\ttoPrint.append((char) i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttoPrint.append(\":\" + this.huffCodeVals[i] + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(toPrint.toString());\n\t}", "private static void showUsage(String arg) {\n char notA = 97;\n if (arg.equals(\"1337h\" + notA + \"ckerm\" + notA + \"n\")) {\n // don't worry about this!\n // this is a really insecure decryption function\n // Don't worry about how it works. If you really want to know,\n // come hang out with me in my office hours! ~Alex\n char[] ct = WHAT_IS_THIS.toCharArray();\n int n = ct.length - 2;\n // These are bitwise operators. Yikes!\n // You'll learn about them in CS2110 if you take it.\n java.util.Random r\n = new java.util.Random(((ct[0] << 8) & 0x0F00) | ct[1]);\n\n StringBuilder sb = new StringBuilder();\n\n // some nice java8 functional programming here\n r.ints(0, n).distinct().limit(n).forEachOrdered(\n i -> sb.append((char) (ct[i + 0x2] ^ 0x9)));\n System.out.println(sb.toString());\n } else {\n System.out.println(\"Usage is:\\t\"\n + \"java StraightAs <filename.csv> <separator> <displayMode>\"\n + \"\\n\\nSeparators: any valid java string. For example:\"\n + \"\\n\\tNOTACOMMA\\n\"\n + \"\\t,\\n\"\n + \"\\t4L3X1SK00L\\n\\nDisplay Modes (see instructions for\"\n + \" more info):\\n\"\n + \"\\tTABLE\\tdisplays a table of the names and grades in \"\n + \"the csv file\\n\\tHIST\\tdisplays the histogram of \"\n + \"the grades.\\n\\tBOTH\\tdisplays both the table and \"\n + \"the histogram\\n\"\n + \"\\nRunning the program with arguments:\"\n + \"\\n\\tjava StraightAs sample_data.csv , HIST\");\n }\n }", "public String showHashTableStatus()\n\t {\n\t \t int index;\n\t \t int Empty = 0;\n\t \t int contCount = 0;\n\t \t int Min = tableSize;\n\t \t int Max = 0;\n\t \t String binOut = \"\";\n\t \t \n\t \t for(index = 0; index < tableSize; index++) \n\t \t {\n\t \t\t if(tableArray[index] == null) \n\t \t\t {\n\t \t\t\t binOut += \"N\";\n\t \t\t }\n\t \t\t else \n\t \t\t {\n\t \t\t\t binOut += \"D\";\n\t \t\t }\n\t \t }\n\t \t for(index = 0; index < tableSize; index++) \n\t \t {\n\t \t\t if(tableArray[index] != null) \n\t \t\t {\n\t \t\t\t contCount++;\n\t \t\t\t if(contCount > 0) \n\t \t\t\t {\n\t \t\t\t\t if(Max < contCount) \n\t \t\t\t\t {\n\t \t\t\t\t\t Max = contCount;\n\t \t\t\t\t }\n\t \t\t\t\t if(Min > contCount) \n\t \t\t\t\t {\n\t \t\t\t\t\t Min = contCount;\n\t \t\t\t\t }\n\t \t\t\t }\n\t \t\t }\n\t \t\t else \n\t \t\t {\n\t \t\t\t Empty++;\n\t \t\t\t contCount = 0;\n\t \t\t }\n\t \t }\t\t\t \n\t\t\t System.out.println(\"\\n\");\t\t\t \n\t\t\t System.out.println(\"Hash Table Status: \" + binOut);\n\t\t\t System.out.println(\"\\n\");\n\t\t\t System.out.println(\"\tMinimum Contiguous Bins: \" + Min);\t\t\t \n\t\t\t System.out.println(\"\tMaximum Contiguous Bins: \" + Max);\t\t\t \n\t\t\t System.out.println(\"\t\tNumber of empty bins: \" + Empty);\t\t \n\t\t\t System.out.println(\"\\n\");\n\t\t\t System.out.println(\"Array Dump:\");\n\t\t\t \n\t\t\t for(index = 0; index < tableSize; index++) \n\t\t\t {\n\t\t\t\t if(tableArray[index] == null) \n\t\t\t\t {\n\t\t\t\t\t System.out.println(\"null\");\n\t\t\t\t }\n\t\t\t\t else \n\t\t\t\t {\n\t\t\t\t\t System.out.println(tableArray[index].toString());\n\t\t\t\t }\n\t\t\t }\n\t\t\t return null;\t \n\t }", "public static void displayHashTable() {\n\t\t\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------\");\n\t\t\n\t\t// Traverse hash table and print out values by index\n\t\tfor (int i = 0; i < sizeHashTable; i++) {\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"Index \" + i + \"---> \");\n\t\t\tbst.inorderTraversalPrint(hashTable[i]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Here is a list of all the elements, sorted by index and inorder traversal: \");\n\n\t\t// Print out all of the values in one line\n\t\tfor (int i = 0; i < sizeHashTable; i++) {\n\t\t\tbst.inorderTraversalPrint(hashTable[i]);\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t}", "public void KosarajuPrint() {\n long start = System.currentTimeMillis();\n io.println(\"The given statement is \");\n if (kosaraju.checkSatisfiability()) {\n io.println(\"satisfiable.\");\n } else {\n io.println(\"not satisfiable.\");\n }\n io.println(\"The calculation took \" + (System.currentTimeMillis() - start) + \" milliseconds.\\n\");\n }", "static private void showSolution() {\n\t\tfor (int x = 1; x <= 6; ++x) {\n\t\t\tfor (int y = 1; y <= 6; ++y) {\n\t\t\t\tSystem.out.print(color[x - 1][y - 1]\n\t\t\t\t\t\t+ Messages.getString(\"dddcube.stringkey.0\")); //$NON-NLS-1$\n\t\t\t}\n\t\t\tSystem.out.print(Messages.getString(\"dddcube.stringkey.1\")); //$NON-NLS-1$\n\t\t\tfor (int y = 1; y <= 6; ++y) {\n\t\t\t\tSystem.out.print(offset[x - 1][y - 1]\n\t\t\t\t\t\t+ Messages.getString(\"dddcube.stringkey.0\")); //$NON-NLS-1$\n\t\t\t}\n\t\t\tSystem.out.print(Messages.getString(\"dddcube.stringkey.1\")); //$NON-NLS-1$\n\t\t\tbricks.showColorBricks(x);\n\n\t\t\tSystem.out.println(Messages.getString(\"dddcube.stringkey.2\")); //$NON-NLS-1$\n\t\t}\n\t}", "public void statistics(){\n\t\tSystem.out.println(\"heads: \"+ heads+\"\\ttails: \"+tails);\n\t\t\n\t}", "public String display();", "public void printResults() {\n\t System.out.println(\"BP\\tBR\\tBF\\tWP\\tWR\\tWF\");\n\t System.out.print(NF.format(boundaryPrecision) + \"\\t\" + NF.format(boundaryRecall) + \"\\t\" + NF.format(boundaryF1()) + \"\\t\");\n\t System.out.print(NF.format(chunkPrecision) + \"\\t\" + NF.format(chunkRecall) + \"\\t\" + NF.format(chunkF1()));\n\t System.out.println();\n }", "public void printUsage() {\n printUsage(System.out);\n }", "public void show() {\n\t\t\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 void display() {\n\t\tSystem.out.println(x + \" \" + y + \" \" + z);\n\t}", "public void display()\n\t{\n\t\tSystem.out.println(data+\" \");\n\t}", "public void display()\r\n\t{\r\n\t\tSystem.out.println(\"This program calculates simpleinterest\");\r\n\t\tcalculateinterest();\r\n\t}", "private static void displayHelp(){\n System.out.println(\"-host hostaddress: \\n\" +\n \" connect the host and run the game \\n\" +\n \"-help: \\n\" +\n \" display the help information \\n\" +\n \"-images: \\n\" +\n \" display the images directory \\n\" +\n \"-sound: \\n\" +\n \" display the sounds file directory \\n\"\n\n );\n }", "private void showHelp() {\n \tHelpFormatter formatter = new HelpFormatter();\n \tformatter.printHelp( \"java -cp moustache.jar Main\", options );\n }", "public static void printSHSV(FqImage imh){\n\t\tint\ti,j;\r\n\t\tfor( i = 0 ; i < imh.width ; i++ ){\r\n\t\t\tfor( j = 0 ; j < imh.height ; j++ ){\r\n\t\t\t\tSystem.out.print(\"s\"+imh.points[i][j].getSHSV() );\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\t\r\n\t}", "public void display() {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(a[i] + \"\\t\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void displayAllInfo(){\nSystem.out.println(\"Dimensions of the room - length in feet : \" + room.getLengthInFeet() + \" width in feet :\" + room.getWidthInFeet());\nSystem.out.println(\"Price per square foot :\" + pricePerSquareFoot);\nSystem.out.println(\"Total Cost :\" + calculateTotalCost());\n}", "public static void p_show_info_program() {\n System.out.println(\"╔══════════════════════════════╗\");\n System.out.println(\"║ SoftCalculator V1.2 ║\");\n System.out.println(\"║ Oscar Javier Cardozo Diaz ║\");\n System.out.println(\"║ 16/04/2021 ║\");\n System.out.println(\"╚══════════════════════════════╝\");\n }", "public void display() {\n\t\tSystem.out.println(\"display..\");\n\t}", "@Override\n\tpublic void printCacheEntries() {\n\t\tSystem.out.println(\"********* Fast Cache Entries *********\");\n\t\tSet<Map.Entry<K, V>> entrySet = cache.entrySet();\n\t\tfor (Map.Entry<K, V> entry : entrySet) {\n\t\t\tSystem.out.println(entry.getKey() + \", \" + entry.getValue());\n\t\t}\n\t\tSystem.out.println(\"*******************************\");\n\t}", "public static void showStatistics(){\n\n }", "public void printAnalysis(){\n System.out.println(\"Product: \" + this.getName());\n System.out.println(\"History: \" + this.history());\n System.out.println(\"Largest amount of product: \" + this.inventoryHistory.maxValue());\n System.out.println(\"Smallest amount of product: \" + this.inventoryHistory.minValue());\n System.out.println(\"Average: \" + this.inventoryHistory.average());\n }", "public static void main(String [] arg){\n showHands();\n simulateOdds();\n }", "public void displayResult()\n {\n for(int i = 0; i < this.etatPopulation.size(); i++)\n {\n String line = \"\";\n for (int j = 0; j < this.etatPopulation.get(i).size(); j++)\n {\n line += this.etatPopulation.get(i).get(j).toString() + \" \";\n }\n System.out.println(line);\n }\n }", "public void display() {\n String box = \"\\n+--------------------------------------------+\\n\";\n String header = \"| \" + name;\n String lvlStat = \"Lv\" + level;\n for (int i=0; i<42-name.length()-lvlStat.length(); i++) {\n header += \" \";\n }\n header += lvlStat + \" |\\n\";\n System.out.println(box + header + \"| \" + getHealthBar() + \" |\" + box);\n }", "private void showSummary() {\r\n System.out.println(\"LCG: a=\"+generator.getA()+\", m=\"+generator.getM()+\", c=\"+generator.getC());\r\n for (int i = 1; i < T; i++) {\r\n System.out.println(\"nu(\"+(i+1)+\") : \"+Math.sqrt(getNu()[i])+\"\\t\\t| mu(\"+(i+1)+\") : \"+getMu()[i]);\r\n }\r\n boolean goodMultiplier=true, greatMultiplier=true, sufficientNu = true;\r\n \r\n System.out.println(\"\\nSummary comments: \");\r\n for (int i = 1; i < 6; i++) {\r\n if(mu[i]<0.1) {\r\n goodMultiplier = false;\r\n System.out.println(\"mu[\"+(i+1)+\"] is less than 0.1\");\r\n }\r\n if(mu[i]<1)\r\n greatMultiplier = false;\r\n }\r\n \r\n if(greatMultiplier)\r\n System.out.println(\"The multiplier is a really good one.\");\r\n else if(goodMultiplier)\r\n System.out.println(\"The multiplier meets minimum requirements\");\r\n else\r\n System.out.println(\"The multiplier is not good enough\");\r\n \r\n \r\n for (int i = 1; i < 6; i++) {\r\n if(nu[i]<Math.pow(2, 30/(i+1)))\r\n sufficientNu = false;\r\n }\r\n \r\n if(sufficientNu)\r\n System.out.println(\"nu values for dimensions 2 through 6 are quite good for most applications.\");\r\n else\r\n System.out.println(\"nu values for some dimensions are low. LCG may not be suitable for your specific application\");\r\n \r\n }", "public void printHelp() {\n System.out.println(\". - jeden znak (bez znaku nowej linii)\");\n System.out.println(\".* - zero lub więcej znaków\");\n System.out.println(\"\\\\w* - zero lub więcej słów\");\n }", "public void statistics(){\n System.out.println(this.scoreboard.toString());\n }", "public void Display() {\n\t\tSystem.out.println(Integer.toHexString(PID) + \"\\t\" + Integer.toString(CreationTime) + \"\\t\"+ Integer.toHexString(CommandCounter) + \"\\t\" + ProcessStatus.toString() \n\t\t+ \"\\t\" + Integer.toString(MemoryVolume) + \"\\t\" + Integer.toHexString(Priority) + \"\\t\" + ((MemorySegments != null)? MemorySegments.toString() : \"null\"));\n\t}", "private void showFinalResults(){\r\n\r\n System.out.println(\"Player\\t\\t:\\t\\tPoints\");\r\n for(Player player : this.sortedPlayers){\r\n System.out.println(player.toString());\r\n }\r\n System.out.println();\r\n }", "public void display() {\r\n System.out.println(firstPrompt + \"[\" + minScale + \"-\" + maxScale + \"]\");\r\n }", "private void summarize() {\n System.out.println();\n System.out.println(totalErrors + \" errors found in \" +\n totalTests + \" tests.\");\n }", "private void summarize() {\n System.out.println();\n System.out.println(totalErrors + \" errors found in \" +\n totalTests + \" tests.\");\n }", "public static void printAll() {\n // Print all the data in the hashtable\n RocksIterator iter = db.newIterator();\n\n for (iter.seekToFirst(); iter.isValid(); iter.next()) {\n System.out.println(new String(iter.key()) + \"\\t=\\t\" + ByteIntUtilities.convertByteArrayToDouble(iter.value()));\n }\n\n iter.close();\n }", "public void print_metrics(){\n\t\tHashMap<Integer, HashSet<Integer>> pairs=return_pairs();\n\t\tint total=gold.data.getTuples().size();\n\t\ttotal=total*(total-1)/2;\n\t\tSystem.out.println(\"Reduction Ratio is: \"+(1.0-(double) countHashMap(pairs)/total));\n\t\tint count=0;\n\t\tfor(int i:pairs.keySet())\n\t\t\tfor(int j:pairs.get(i))\n\t\t\tif(goldContains(i,j))\n\t\t\t\tcount++;\n\t\tSystem.out.println(\"Pairs Completeness is: \"+(double) count/gold.num_dups);\n\t}", "private void showFacts() {\n\t\tSystem.out.println(\"=============================\");\n\t\tSystem.out.println(\"Your lose! Try harder and better luck next time.\");\n\t}", "public void display()\r\n\t{\r\n\t\tSystem.out.println(\"Dollar: $\"+getAmount());\r\n\t\tSystem.out.println(\"Rupiah: Rp.\"+dollarTorp());\r\n\t}", "public void displayTextToConsole();", "public void displayHuffCodefile() {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t/*\n\t\t * Go through every line and print them with the codes\n\t\t */\n\t\tfor (char[] curLine : this.fileData) {\n\t\t\tfor (char c : curLine) {\n\t\t\t\ttoPrint.append(this.huffCodeVals[c]);\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * Keep taps on the number of newLines displayed. This ensures that we don't print a new\n\t\t\t * line code for the last line\n\t\t\t */\n\t\t\tif (this.frequencyCount[10] > 0) {\n\t\t\t\ttoPrint.append(huffCodeVals[10]);\n\t\t\t\tthis.frequencyCount[10]--;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(toPrint.toString());\n\t}", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "public void printStatistics() {\n\t// Skriv statistiken samlad så här långt\n stats.print();\n }", "public void print() {\n\t\tSystem.out.println(word0 + \" \" + word1 + \" \" + similarity);\n\t}", "void reportResults()\n {\n if (primes.isEmpty())\n throw new IllegalArgumentException();\n System.out.println(\"Primes up to \" + lastComp + \" are as follows:\");\n String results = \"\";\n int count = 0;\n Iterator<Integer> it = primes.iterator();\n while(it.hasNext())\n {\n results += \"\" + it.next() + \" \";\n count++;\n if(count % 12 == 0)\n results += \"\\n\";\n }\n System.out.println(results);\n }", "@Override\n\tpublic void show() {\n\t\tfor (int i = 0; i < cache.length; i++) {\n\t\t\tSystem.out.println(\"####\\tWay \"+i+\"\\t####\");\n\t\t\tcache[i].show(qtdLinha/qtdConjunto*i);\n\t\t}\n\t\tmemoria.show();\n\t}", "private static void consoleOutput() {\n\n Output airportFlightCounter = new AirportFlightCounter(airports);\n Output flightInventory = new FlightInventory(flights);\n Output flightPassengerCounter = new FlightPassengerCounter(flights);\n Output mileageCounter = new MileageCounter(flights, airports);\n\n airportFlightCounter.toConsole();\n flightInventory.toConsole();\n flightPassengerCounter.toConsole();\n mileageCounter.toConsole();\n }", "public void printStats() {\n\t\tSystem.out.println(\"QuickSort terminates!\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Duration: \" + getDuration() + \" seconds\");\n\t\tSystem.out.println(\"Comparisons: \" + this.comparisonCounter);\n\t\tSystem.out.println(\"Boundary: \" + this.b);\n\t}", "private void help() {\n for (GameMainCommandType commandType : GameMainCommandType.values()) {\n System.out.printf(\"%-12s%s\\n\", commandType.getCommand(), commandType.getInfo());\n }\n System.out.println();\n }", "private static void displayHeaders( float t ) {\n\t\t/** Traverse the list of all outputs and display their\n\t\t * names and then scheduling the first output display event.\n\t\t * All names are output in a 5-space field.\n\t\t * Following the headers, display the associated values.\n\t\t */\n\t\tfor (Output o: outputList) {\n\t\t\tString n = o.name;\n\n\t\t\t// long names must be truncated\n\t\t\tif (n.length() > 4) {\n\t\t\t\tn = n.substring( 0, 4 );\n\t\t\t}\n\n\t\t\t// output leading blank\n\t\t\tSystem.out.append( ' ' );\n\n\t\t\t// output edited name\n\t\t\tSystem.out.append( n );\n\n\t\t\t// output padding up to next column\n\t\t\tif (n.length() < 4) {\n\t\t\t\tSystem.out.append(\n\t\t\t\t\t\" \".substring( 0, 4 - n.length() )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\n\t\t// headers preceed first output of values\n\t\tdisplayOutput( t );\n\t}", "private void printHelp() \n {\n Logger.Log(\"You have somehow ended up in this strange, magical land. But really you just want to go home.\");\n Logger.Log(\"\");\n Logger.Log(\"Your command words are:\");\n parser.showCommands();\n Logger.Log(\"You may view your inventory or your companions\");\n }", "private static void displayOutput( float t ) {\n\t\tfor (Output o: outputList) {\n\t\t\to.outputMe();\n\t\t}\n\t\tSystem.out.println();\n\n\t\t/*if (Simulator.moreEvents()) {\n\t\t\tSimulator.schedule(\n\t\t\t\tt + 1,\n\t\t\t\t(float time) -> displayOutput( time )\n\t\t\t);\n\t\t}*/\n\t}", "public static void computeSummary() {\r\n\r\n String text = \"\\n\";\r\n\r\n //print the rank matrix\r\n\r\n text += \"\\\\begin{sidewaystable}[!htp]\\n\\\\centering\\\\scriptsize\\n\"\r\n + \"\\\\resizebox{\\\\textwidth}{!}{\\\\begin{tabular}{\\n\";\r\n text += \"|c\";\r\n for (int i = 0; i < columns; i++) {\r\n text += \"|r\";\r\n }\r\n text += \"|}\\n\\\\hline\\n\";\r\n\r\n for (int i = 0; i < columns; i++) {\r\n text += \"&(\" + (i + 1) + \") \";\r\n }\r\n text += \"\\\\\\\\\\n\\\\hline\\n\";\r\n for (int i = 0; i < columns; i++) {\r\n text += algorithms[i] + \" (\" + (i + 1) + \")\";\r\n for (int j = 0; j < columns; j++) {\r\n if (i != j) {\r\n text += \"& \" + wilcoxonRanks[i][j];\r\n } else {\r\n text += \"& -\";\r\n }\r\n }\r\n text += \"\\\\\\\\\\n\\\\hline\\n\";\r\n }\r\n\r\n text += \"\\n\" + \"\\\\end{tabular}}\\n\" + \"\\\\caption{Ranks computed by the Wilcoxon test}\\n\";\r\n text += \"\\n\\\\end{sidewaystable}\\n\";\r\n text += \"\\n \\\\clearpage \\n\\n\";\r\n\r\n Files.addToFile(outputSummaryFileName, text);\r\n\r\n //print the p-value matrix\r\n\r\n text = \"\\n\";\r\n\r\n text += \"\\\\begin{sidewaystable}[!htp]\\n\\\\centering\\\\scriptsize\\n\"\r\n + \"\\\\resizebox{\\\\textwidth}{!}{\\\\begin{tabular}{\\n\";\r\n text += \"|c\";\r\n for (int i = 0; i < columns; i++) {\r\n text += \"|c\";\r\n }\r\n text += \"|}\\n\\\\hline\\n\";\r\n\r\n for (int i = 0; i < columns; i++) {\r\n text += \"&(\" + (i + 1) + \") \";\r\n }\r\n text += \"\\\\\\\\\\n\\\\hline\\n\";\r\n\r\n if (rows <= 50) {\r\n for (int i = 0; i < columns; i++) {\r\n text += algorithms[i] + \" (\" + (i + 1) + \")\";\r\n for (int j = 0; j < columns; j++) {\r\n \r\n if (i < j) {//0.1\r\n text += \"& \" + getSymbol(i,j,exactPValues[i][j], exactPValues[j][i], 0.1) + \" \";\r\n }\r\n if (i == j) {\r\n text += \"& -\";\r\n }\r\n if (i > j) {//0.05\r\n text += \"& \" + getSymbol(i,j,exactPValues[i][j], exactPValues[j][i], 0.05) + \" \";\r\n }\r\n }\r\n \r\n text += \"\\\\\\\\\\n\\\\hline\\n\";\r\n }\r\n } else {\r\n for (int i = 0; i < columns; i++) {\r\n text += algorithms[i] + \" (\" + (i + 1) + \")\";\r\n for (int j = 0; j < columns; j++) {\r\n if (i < j) {//0.1\r\n text += \"& \" + getSymbol(i,j,asymptoticPValues[i][j], asymptoticPValues[j][i], 0.1) + \" \";\r\n }\r\n if (i == j) {\r\n text += \"& -\";\r\n }\r\n if (i > j) {//0.05\r\n text += \"& \" + getSymbol(i,j,asymptoticPValues[i][j], asymptoticPValues[j][i], 0.05) + \" \";\r\n }\r\n }\r\n text += \"\\\\\\\\\\n\\\\hline\\n\";\r\n }\r\n }\r\n\r\n text += \"\\n\" + \"\\\\end{tabular}}\\n\" + \"\\\\caption{Summary of the Wilcoxon test. \\\\textbullet = \"\r\n + \"the method in the row improves the method of the column. \\\\textopenbullet = \"\r\n + \"the method in the column improves the method of the row. Upper diagonal of level significance $\\\\alpha=0.9$,\"\r\n + \"Lower diagonal level of significance $\\\\alpha=0.95$}\\n\";\r\n text += \"\\n\\\\end{sidewaystable}\\n\";\r\n text += \"\\n \\\\clearpage \\n\\n\";\r\n\r\n Files.addToFile(outputSummaryFileName, text);\r\n\r\n text = \"\\n\";\r\n\r\n //print the summary table\r\n\r\n text += \"\\\\begin{table}[!htp]\\n\\\\centering\\\\scriptsize\\n\"\r\n + \"\\\\begin{tabular}{\\n\";\r\n text += \"|c|c|c|c|c|}\\n\\\\hline\\n\";\r\n text += \"&\\\\multicolumn{2}{c|}{$\\\\alpha=0.9$} & \\\\multicolumn{2}{c|}{$\\\\alpha=0.95$}\\\\\\\\\\\\hline\\n\";\r\n text += \"Method & + & $\\\\pm$ & + & $\\\\pm$ \";\r\n\r\n text += \"\\\\\\\\\\n\\\\hline\\n\";\r\n for (int i = 0; i < columns; i++) {\r\n text += algorithms[i]+\" & \"+wins90[i]+\" & \"+draw90[i]+\" & \"+wins95[i]+\" & \"+draw95[i];\r\n text += \"\\\\\\\\\\n\\\\hline\\n\";\r\n }\r\n\r\n text += \"\\n\" + \"\\\\end{tabular}\\n\" + \"\\\\caption{Wilcoxon test summary results}\\n\";\r\n text += \"\\n\\\\end{table}\\n\";\r\n text += \"\\n \\\\clearpage \\n\\n\";\r\n\r\n Files.addToFile(outputSummaryFileName, text);\r\n\r\n }", "public void display(String result);", "public void display() {\n\t\tSystem.out.println(\"do something...\");\n\t}", "public void printStatistics() {\r\n\t\tLog.info(\"*** Statistics of Sequence Selector ***\");\r\n\r\n\t\t// chains\r\n\t\tLog.info(String.format(\"Chains: %d\", chains.size()));\r\n\t\tLog.info(String.format(\"Executable Chains: %d\", execChains.size()));\r\n\t\tLog.info(String.format(\"Causal Executable Chains: %d\",\r\n\t\t\t\tcausalExecChains.size()));\r\n\r\n\t\t// bushes\r\n\t\tLog.info(String.format(\"Bushes: %d\", bushes.size()));\r\n\t\tLog.info(String.format(\"Executable Bushes: %d\", execBushes.size()));\r\n\t\tLog.info(String.format(\"Required Bushes: %d\", requiredExecBushes.size()));\r\n\t\tLog.info(String.format(\"Redundant Bushes: %d\",\r\n\t\t\t\tredundantExecBushes.size()));\r\n\r\n\t\t// total\r\n\t\tLog.info(String.format(\"Bushes in Chains: %d\", bushesInChains.size()));\r\n\t\tLog.info(String.format(\"Total Sequences: %d\", totalSequences.size()));\r\n\r\n\t\t// time\r\n\t\tLog.info(String.format(\"Total Time: %d ms\", stopWatch.getTime()));\r\n\t\tLog.info(String.format(\"Time per Event: %d ms\", stopWatch.getTime()\r\n\t\t\t\t/ events.size()));\r\n\t}", "void show() {\n\t\tSystem.out.println(\"k: \" + k);\n\t}", "@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"Displaying...\");\r\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"Hyunjun\");\n\t}", "private void printResults() {\n\t\tdouble percentCorrect = (double)(correctAnswers/numberAmt) * 100;\n\t\tSystem.out.println(\"Amount of number memorized: \" + numberAmt +\n\t\t\t\t \"\\n\" + \"Amount correctly answered: \" + correctAnswers +\n\t\t\t\t \"\\n\" + \"Percent correct: \" + (int)percentCorrect);\n\t}", "public static void main(String[] args) {\n int N = Integer.parseInt(args[0]);\n int x = Integer.parseInt(args[1]);\n Integer[] a = new Integer[N];\n for (int i = 0; i < N; i++) {\n a[i] = i % x;\n }\n StdOut.printf(\"H = %4.2f\\n\", entropy(a));\n }", "public static void main(String[] args) {\n\r\n\t\tSystem.out.print(\"[\");\r\n\t\tfor(int i=1; i<=100; i++)\r\n\t\t{\r\n\t\t\tif(isPerfectNumber(i))\r\n\t\t\tSystem.out.print(i + \" \");\t\r\n\t\t}\r\n\t\tSystem.out.println(\"]\");\r\n\t}", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"콘텐츠화면이 출력되었습니다\");\n\t}", "private static void printUsage() {\n System.err.println(\"\\n\\nUsage:\\n\\tAnalyzeRandomizedDB [-p] [-v] [--enzyme <enzymeName> [--mc <number_of_missed_cleavages>]] <original_DB> <randomized_DB>\");\n System.err.println(\"\\n\\tFlag significance:\\n\\t - p : print all redundant sequences\\n\\t - v : verbose output (application flow and basic statistics)\\n\");\n System.exit(1);\n }", "void printHelp();", "public static int display( int binlength){\r\n JOptionPane.showMessageDialog(null, \"\\n FOR DETAILED REPORT\\nPLEASE CHECK CONSOLE\");\r\n\r\n int summary = JOptionPane.showConfirmDialog(null, \r\n \"\\n-------------RESULTS----------------\\n\"+\r\n \"TOTAL BINS USED : \" + binlength + \" \\n\"+\r\n \"TIME TAKEN: \" + elapsedTime + \" (M/S) \\n\" +\r\n \"\\n\\n\" +\"Run NEW test? \\n\"+\r\n \" [CHOOSE ONE]\\n\" + \r\n \"[YES] - to RUN \\n\" +\r\n \"[NO] - to EXIT PROGRAM \\n\" , \"CONFIRMATION\" , JOptionPane.YES_NO_OPTION);\r\n if (summary != 0) {\r\n quit();\r\n }\r\n return summary;\r\n }", "public void printHourlyCounts()\n {\n System.out.println(\"Hr: Count\");\n for(int hour = 0; hour < hourCounts.length; hour++) {\n System.out.println(hour + \": \" + hourCounts[hour]);\n }\n }", "public void displayImageToConsole();", "@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"RedHeadDuck\");\r\n\t}" ]
[ "0.67749256", "0.64157164", "0.63754493", "0.6307042", "0.63034075", "0.62488633", "0.6224291", "0.6198375", "0.61668724", "0.6159503", "0.6096727", "0.60546637", "0.60462", "0.604507", "0.6022353", "0.60036576", "0.59892726", "0.59444743", "0.5941304", "0.59335285", "0.59249085", "0.58845514", "0.5880806", "0.5878692", "0.58773977", "0.5873839", "0.58499736", "0.58341897", "0.5825379", "0.58093053", "0.5804431", "0.5804067", "0.57913065", "0.57817966", "0.5767803", "0.5762533", "0.5755952", "0.5744609", "0.5738321", "0.5732964", "0.57254744", "0.56974715", "0.5688787", "0.56840575", "0.5683862", "0.5683755", "0.56821305", "0.56809306", "0.5674254", "0.5673701", "0.5672964", "0.5671008", "0.56654054", "0.56597894", "0.56572706", "0.5646415", "0.5634346", "0.5633471", "0.56307966", "0.56104976", "0.5609195", "0.5608629", "0.5607276", "0.5598857", "0.55985135", "0.55982697", "0.55982697", "0.559319", "0.55919564", "0.55887103", "0.558327", "0.5581432", "0.5579988", "0.55767363", "0.557516", "0.5563855", "0.55607325", "0.5558014", "0.5550958", "0.55505204", "0.5544997", "0.554214", "0.5539357", "0.5536712", "0.5533428", "0.55323464", "0.5530546", "0.5527165", "0.5523716", "0.55215776", "0.55208737", "0.55169475", "0.5515867", "0.5513573", "0.5505094", "0.55011946", "0.5500625", "0.5493211", "0.54928136", "0.54880124", "0.5486988" ]
0.0
-1
TODO Autogenerated method stub
public void update(TheatreMashup todo) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
here are implemented all the methods that the server can call remotely to the client This method is called by the server to check connection
public void ping() throws RemoteException{ return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract boolean isConnected();", "private boolean isConnected() {\n\t\treturn (this.serverConnection!=null); \n }", "public boolean testConnection() {\r\n boolean toReturn = true;\r\n\r\n String[] paramFields = {};\r\n SocketMessage request = new SocketMessage(\"admin\", \"ping\", SocketMessage.PriorityType.EMERGENCY, SocketMessage.TransferType.BI_WAY, \"\", paramFields);\r\n SocketMessage response = handleMessage(request);\r\n if (isSuccessful(response)) {\r\n toReturn = true;\r\n } else {\r\n toReturn = false;\r\n }\r\n\r\n return toReturn;\r\n }", "private void connection() {\n boolean connect;\n try {\n connect = true;\n this.jTextArea1.setText(\"Server starts...\");\n server = new MultiAgentServer(this);\n String ip = \"\";\n int errorBit = 256;\n for (int i = 0; i < server.getIpAddr().length; i++) {\n int currentIP = server.getIpAddr()[i];\n if (currentIP < 0) {\n currentIP += errorBit;\n }\n ip += currentIP + \".\";\n }\n ip = ip.substring(0, ip.length() - 1);\n System.out.println(ip);\n Naming.rebind(\"//\" + ip + \"/server\", server);\n this.jTextArea1.setText(\"Servername: \" + ip);\n this.jTextArea1.append(\"\\nServer is online\");\n } catch (MalformedURLException | RemoteException e) {\n this.jTextArea1.append(\"\\nServer is offline, something goes wrong!!!\");\n connect = false;\n }\n if (dialog.getMusicBox().isSelected()) {\n sl = new SoundLoopExample();\n }\n reconnectBtn.setEnabled(!connect);\n }", "protected synchronized boolean checkConnectivity() {\n return this.connect();\n }", "@Override\n public void check(Connection connection) throws RemotingException {\n\n }", "public boolean connect(){\r\n\r\n\t\t// Connect to server via TCP socket\r\n\t\ttry {\r\n\r\n\t\t\tclient = new Socket(host, port);\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"[EXCEPTION] connecting to server\");\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Connection to server could not be made. Try again later.\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\n\r\n\t\t// Get input and output Streams\r\n\t\ttry {\r\n\r\n\t\t\tpw = new PrintWriter(client.getOutputStream());\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(client.getInputStream()));\r\n\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\tSystem.err.println(\"[EXCEPTION] creating streams\");\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Connection to server SUCESSFULL\");\r\n\t\treturn true;\r\n\t}", "private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }", "private boolean checkConnection() {\n return isConnected = ConnectionReceiver.isConnected();\n }", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "boolean isConnected();", "public boolean isConnected();", "public boolean isConnected();", "public boolean isConnected();", "public boolean isConnected();", "public boolean isConnected();", "boolean hasAvailableConnection();", "public void conectServer() {\n\n\t}", "public boolean open() {\n boolean success = true;\n SocketAddress serverAddress = new InetSocketAddress(serverHostName, serverHostPort);\n\n try {\n commSocket = new Socket();\n commSocket.connect(serverAddress);\n } catch(UnknownHostException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - the target server is an unknown host: \" + serverHostName + \"!\");\n e.printStackTrace();\n System.exit(1);\n } catch(NoRouteToHostException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - the target server is unreachable: \" + serverHostName + \"!\");\n e.printStackTrace();\n System.exit(1);\n } catch(ConnectException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - the server did not respond at: \" + serverHostName + \".\" + serverHostPort + \"!\");\n if (e.getMessage().equals(\"Connection refused\"))\n success = false;\n else {\n GenericIO.writelnString(e.getMessage() + \"!\");\n e.printStackTrace();\n System.exit(1);\n }\n } catch(SocketTimeoutException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - connection timed out while attempting to reach: \"\n + serverHostName + \".\" + serverHostPort + \"!\");\n success = false;\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - unidentified error while connecting to: \" + serverHostName + \".\" + serverHostPort + \"!\");\n e.printStackTrace();\n System.exit(1);\n }\n\n if(!success) return (success);\n\n try {\n outputStream = new ObjectOutputStream(commSocket.getOutputStream ());\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread().getName()\n + \" - could not open the socket's output stream!\");\n e.printStackTrace();\n System.exit(1);\n }\n\n try {\n inputStream = new ObjectInputStream(commSocket.getInputStream ());\n } catch(IOException e) {\n GenericIO.writelnString(Thread.currentThread ().getName ()\n + \" - could not open the socket's input stream!\");\n e.printStackTrace();\n System.exit(1);\n }\n\n return (success);\n }", "@Override\n\tpublic boolean canConnect() {\n return false;\n }", "public boolean connect() throws RemoteException {\n\t\ttry {\n\t\t\t// Get remote object reference\n\t\t\tthis.registry = LocateRegistry.getRegistry(host, port);\n\t\t\tthis.server = (ServerInterface) registry.lookup(\"Server\");\n\t\t\tid = this.server.getNewClientId();\n\t\t\tClientInterface c_strub = (ClientInterface) UnicastRemoteObject.exportObject(this, 0);\n\t\t\tregistry.bind(id, c_strub);\n\t\t\treturn this.server.addClient(username, password, id);\n\t\t}\n\t\tcatch (AlreadyBoundException | NotBoundException e) {\n\t\t\tSystem.err.println(\"Error on client :\" + e);\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public boolean login() {\r\n try {\r\n if (socket == null) {\r\n SocketFactory socketFactory = SSLSocketFactory.getDefault();\r\n socket = socketFactory.createSocket(host, port);\r\n // System.err.println(\"Socket created\");\r\n if (Preferences.debugLevel(Preferences.DEBUG_COMMS)) {\r\n if (socket instanceof SSLSocket) { // of course it is!\r\n SSLSession session = ((SSLSocket) socket).getSession();\r\n try {\r\n javax.security.cert.X509Certificate[] x509 = session.getPeerCertificateChain();\r\n for (int i = 0; i < x509.length; i++ )\r\n System.out.println(\"Certs: \" + x509[i].toString());\r\n } catch (SSLPeerUnverifiedException ex) {\r\n System.err.println(ex.toString());\r\n return false;\r\n }\r\n }\r\n }\r\n if (socket.isConnected()) {\r\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\r\n out = new PrintWriter(socket.getOutputStream(), true);\r\n out.println(clientName);\r\n out.println(clientIP);\r\n start();\r\n } else {\r\n println(\"Unable to make connection with server\");\r\n return false;\r\n }\r\n }\r\n } catch (ConnectException e) {\r\n println(\"Unable to connect. Server is most likely down.\");\r\n return false;\r\n } catch (UnknownHostException e) {\r\n println(\"Unknown host, please notify admin.\");\r\n return false;\r\n } catch (IOException e) {\r\n println(\"I/O socket error.\");\r\n e.printStackTrace();\r\n return false;\r\n } catch (Exception e) {\r\n println(\"Cannot log in, please try again later.\");\r\n return false;\r\n }\r\n return true;\r\n }", "boolean isIsRemote();", "private void establishServerConnection() {\n int lb_port = Integer.parseInt(gui.getLBPort_Text().getText());\n gui.getLBPort_Text().setEnabled(false);\n String lb_ip = gui.getLBIP_Text().getText();\n gui.getLBIP_Text().setEnabled(false);\n int server_port = Integer.parseInt(gui.getServerPort_Text().getText());\n gui.getServerPort_Text().setEnabled(false);\n String server_ip = gui.getServerIP_Text().getText();\n gui.getServerIP_Text().setEnabled(false);\n obtainId(server_ip, server_port);\n lbInfo = new ConnectionInfo(lb_ip, lb_port, 3);\n\n if (connection.startServer(server_port)) {\n connectionHandler = new ServerConnections(connection, lbInfo, requestsAnswered, processingRequests, gui.getCompleted_Text(), gui.getProcessing_Text());\n new Thread(connectionHandler).start();\n\n requestServerId();\n scheduler.scheduleAtFixedRate(heartbeat, 10, 10, TimeUnit.SECONDS);\n } else {\n gui.getLBPort_Text().setEnabled(true);\n gui.getLBIP_Text().setEnabled(true);\n gui.getServerPort_Text().setEnabled(true);\n gui.getServerIP_Text().setEnabled(true);\n gui.getButton_Connect().setEnabled(true);\n }\n }", "public void connectionControl() throws ServerOfflineException {\n\t\tServer.connectionCheck(this.serverTyp, this.connection);\n\t}", "protected boolean isConnected() {\n/* 160 */ return this.delegate.isConnected();\n/* */ }", "public boolean checkConnection() {\n\treturn getBoolean(ATTR_CONNECTION, false);\n }", "public boolean connectionAlive() throws RemoteException;", "@Override\n public boolean connect() {\n\n if (!isConnected) {\n try {\n\n Socket socket = new Socket(hostName, portNumber);\n out = new PrintWriter(socket.getOutputStream(), true);\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n isConnected = true;\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n return isConnected;\n }", "@Override\n public void Connected() {\n if (strClientSerial != null) {\n LoginInfo_Req();\n }\n }", "public NegotiationReturn workAsServer() {\n this.isClient = false;\n\n peer_mac_address = null;\n ServerSocket serverSocket = null;\n Socket socket = null;\n int code = 0;\n NegotiationReturn negReturn;\n boolean restartAfterwards = false;\n\n try {\n // use the port to start\n serverSocket = new ServerSocket(PORT);\n serverSocket.setSoTimeout(serverTimeoutMillis);\n Log.d(TAG, \"doInBackground: Server is waiting for connection\");\n\n // accept one connection\n socket = serverSocket.accept();\n socket.setSoTimeout(serverTimeoutMillis);\n\n // wrap the socket\n socketWrapper = new SocketWrapper(socket);\n\n // WAIT FOR CLIENT\n String hello = socketWrapper.getLine();\n\n if (hello == null || hello.contains(\"java.net.SocketException\")) {\n return error(R.string.no_hello_received, true);\n }\n\n // Check: Is the peer in the same role as we are\n // server and server or client and client MAKES NO SENSE\n if (hello.contains(\"SERVER\") && !isClient || hello.contains(\"CLIENT\") && isClient){\n return error(R.string.err_pairing_roles_broken, true);\n }\n\n // Whether we want to provide a hotspot or use one\n if (isConsumer) {\n negReturn = runConsumerProtocol(socketWrapper.getClientAddress().getHostAddress());\n } else {\n negReturn = runHotspotProtocol(socketWrapper.getClientAddress().getHostAddress());\n }\n peer_mac_address = negReturn.mac;\n code = negReturn.code;\n restartAfterwards = negReturn.restartAfterwards;\n\n } catch (SocketTimeoutException ste) {\n Log.d(TAG, \"workAsServer: ### Timed out\");\n code = R.string.err_timeout;\n peer_mac_address = null;\n restartAfterwards = true;\n } catch (IOException e) {\n Log.d(TAG, e.getMessage());\n code = R.string.err_io_exception;\n peer_mac_address = null;\n restartAfterwards = true;\n } finally {\n if (socket != null) {\n try {\n socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (serverSocket != null) {\n try {\n serverSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return new NegotiationReturn(code, peer_mac_address, restartAfterwards);\n }", "private boolean checkConnection() {\n return InternetConnectivityReceiver.isConnected();\n }", "@WebMethod(operationName = \"CheckConnection\")\n public boolean CheckConnection() {\n return true;\n }", "boolean testConnection(RemoteService service);", "private boolean checkServer(Context mContext) {\n\t\t\t\tConnectivityManager cm = (ConnectivityManager) mContext\n\t\t\t\t\t\t.getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\t\tNetworkInfo netInfo = cm.getActiveNetworkInfo();\n\t\t\t\tif (netInfo != null && netInfo.isConnectedOrConnecting()) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "@Override\r\n public Object connect() {\n if(status()){\r\n //creates thread that checks messages in the network\r\n System.out.println(\"notifying network that connection is good\");\r\n notifyObservers(this);\r\n }\r\n return socket;\r\n }", "boolean supportsConnects();", "@Override\n public void testIfConnected() {\n }", "private void checkConnectivity() throws NotConnected\n\t{\n\t\tif (!s_ctx.isConnected())\n\t\t{\n\t\t\tthrow new NotConnected(\"Cannot operate: not conected to context\");\n\t\t}\n\t}", "boolean hasSock();", "private void checkConnection(){\n NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo();\n\n // if activeNetwork is not null, and a network connection is detected,\n // isConnected is true\n boolean isConnected = activeNetwork != null &&\n activeNetwork.isConnectedOrConnecting();\n\n // prepare output to indicate connection status\n String message = isConnected ? \"Connection Detected!\" : \"No Connection Detected!\";\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "@Override\r\n\tpublic ServerBean connect() throws RemoteException {\n\t\tSystem.out.println(\"coming from DealServerImp\");\r\n\t\treturn null;\r\n\t}", "private boolean connectServer() {\n\t\tclNetwork networkInfo = new clNetwork();\n\t\ttry {\n\t\t\tSocket _socket = new Socket(dstAddress, networkInfo.NTP_PORT);\n\t\t\t_socket.setSoTimeout(1000);\n\t\t\t_socket.setTcpNoDelay(true);\n\t\t\topenedSocket = _socket;\n\t\t\tinStream = openedSocket.getInputStream();\n\t\t\toutStream = openedSocket.getOutputStream();\n\t\t\treturn true;\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public boolean isConnecting ()\r\n\t{\r\n\t\tsynchronized (this)\r\n\t\t{\r\n\t\t\treturn _roboCOM!=null;\r\n\t\t}\r\n\t}", "ClientConnection connection();", "@Override\n\tprotected void onConnect() {\n\t\tLogUtil.debug(\"server connect\");\n\n\t}", "private boolean validateConnection() {\n boolean success = _vcVlsi.testConnection();\n if (!success) {\n _log.log(Level.WARNING, \"Found VC connection dropped; reconnecting\");\n return connect();\n }\n return success;\n }", "private static boolean isServerReachable() {\n\t\treturn new PingRpcExample().pingServer();\n\t}", "protected abstract boolean sharedConnectionEnabled();", "public void verifyConnectivity() {\n\n // Attempt to make a valid request to the VPLEX management server.\n URI requestURI = _baseURI.resolve(VPlexApiConstants.URI_CLUSTERS);\n ClientResponse response = null;\n try {\n response = get(requestURI);\n String responseStr = response.getEntity(String.class);\n s_logger.info(\"Verify connectivity response is {}\", responseStr);\n if (responseStr == null || responseStr.equals(\"\")) {\n s_logger.error(\"Response from VPLEX was empty.\");\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n int responseStatus = response.getStatus();\n if (responseStatus != VPlexApiConstants.SUCCESS_STATUS) {\n s_logger.info(\"Verify connectivity response status is {}\", responseStatus);\n if (responseStatus == VPlexApiConstants.AUTHENTICATION_STATUS) {\n // Bad user name and/or password.\n throw VPlexApiException.exceptions.authenticationFailure(_baseURI.toString());\n } else {\n // Could be a 404 because the IP was not that for a VPLEX.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n }\n }\n } catch (VPlexApiException vae) {\n throw vae;\n } catch (Exception e) {\n // Could be a java.net.ConnectException for an invalid IP address\n // or a java.net.SocketTimeoutException for a bad port.\n throw VPlexApiException.exceptions.connectionFailure(_baseURI.toString());\n } finally {\n if (response != null) {\n response.close();\n }\n }\n }", "private boolean connect(String host, int port){\n\t\t/* Connect to server */\n\t\tDebug.log(\"Player\", \"Connecting on host ...\");\n\n\t\t/* Get the Registry! */\n\t\ttry{\n\t\t\tRegistry reg = LocateRegistry.getRegistry(host, port);\n\t\t\tserver = (ServerInterface)reg.lookup(\"Server\");\n\n\t\t\t/* Reflect in GUI */\n\t\t\tgui.showConnectionProgress();\n\n\t\t\tDebug.log(\"Player\", \"Connected!\");\n\n\t\t\treturn true;\n\t\t}catch(AccessException e){\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.err.println(\"Player could not access server registry \" + e.toString());\n\t\t}catch(RemoteException e){\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.err.println(\"Player could not find the RMI register on the server\" + e.toString());\n\t\t}catch(NotBoundException e){\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.err.println(\"Player could not bind to the provided RMI address \" + e.toString());\n\t\t}\n\n\t\treturn false;\n\t}", "boolean hasRemoteHost();", "@Override\r\n\tpublic boolean isConnected(String remoteName) {\n\t\treturn objectServerInputPort.isConnected(remoteName);\r\n\t}", "public synchronized boolean start(){\n \n\t\t/**\n\t\t * CONNECT TO SERVER\n\t\t */\n\t\tboolean connection = connectToServer(oml_server);\n \n\t\t/**\n\t\t * CREATE THE HEADER\n\t\t */\n\t\tcreate_head();\n \n\t\t/**\n\t\t * SEND THE HEADER\n\t\t */\n\t\tboolean injection = inject_head();\n\t\t\n\t\tif( connection && injection ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "@Override\r\n\tpublic boolean isConnected() {\n\t\treturn false;\r\n\t}", "private static boolean AttemptConnect() {\n try {\n if (Connect()) {\n Log.Confirmation(\"Connected to server on: \" + socket);\n // send connection type\n dos.writeUTF(\"viewer\");\n return true;\n } else {\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n }", "protected void handleConnect()\n throws ConnectionFailedException\n { \n int registryPort = getRegistryPort(locator);\n Home home = null;\n Exception savedException = null;\n Iterator it = getConnectHomes().iterator();\n \n while (it.hasNext())\n {\n //TODO: -TME Need to figure this out a little better as am now dealing with\n // with 2 ports, the rmi server and the registry.\n try\n {\n home = (Home) it.next();\n String host = home.host;\n final int port = home.port;\n locator.setHomeInUse(home);\n storeLocalConfig(configuration);\n log.debug(this + \" looking up registry: \" + host + \",\" + port);\n final Registry registry = LocateRegistry.getRegistry(host, registryPort);\n log.debug(this + \" trying to connect to: \" + home);\n Remote remoteObj = lookup(registry, \"remoting/RMIServerInvoker/\" + port);\n log.debug(\"Remote RMI Stub: \" + remoteObj);\n setServerStub((RMIServerInvokerInf) remoteObj);\n connected = true;\n break;\n }\n catch(Exception e)\n {\n savedException = e;\n connected = false;\n RemotingRMIClientSocketFactory.removeLocalConfiguration(locator);\n log.trace(\"Unable to connect RMI invoker client to \" + home, e);\n\n }\n }\n\n if (server == null)\n {\n String message = this + \" unable to connect RMI invoker client\";\n log.debug(message);\n throw new CannotConnectException(message, savedException);\n }\n }", "public boolean initAndConnectToServer() {\n try {\n mTCPSocket.connect(new InetSocketAddress(mIpAdress, port), 1000);\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n return true;\n }", "private static void setupConnection() {\r\n\t\t\r\n\t\t// Variable used to keep track of if a connection is sucessful\r\n\t\tboolean connectionSuccess;\r\n\t\t\r\n\t\t// Loop until a sucessful connection is made\r\n\t\tdo {\r\n\t\t\tconnectionSuccess = true;\r\n\t\t\t\r\n\t\t\t// Get server info from user\r\n\t\t\tString serverInfo = JOptionPane.showInputDialog(null, \"Please input the server IP and port\"\r\n\t\t\t\t\t+ \" in the form \\\"IP:Port\\\"\", \"Server Connection Details\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\r\n\t\t\t// If the X button or cancel is clicked exit the program\r\n\t\t\tif(serverInfo == null) {\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tString[] serverInfoArray = serverInfo.split(\":\", 2);\r\n\t\t\tint port = 0;\r\n\t\t\t\r\n\t\t\t// Check that both the port and IP have been inputted\r\n\t\t\tif(serverInfoArray.length > 1) {\r\n\t\t\t\t\r\n\t\t\t\t// Check that the port inputted is valid\r\n\t\t\t\ttry{\r\n\t\t\t\t\tport = Integer.parseInt(serverInfoArray[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(port > 65536 || port < 0) {\r\n\t\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} catch(NumberFormatException e) {\r\n\t\t\t\t\tshowMSG(PORT_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tshowMSG(\"Please input a port number and IP address\");\r\n\t\t\t\tconnectionSuccess = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// After port validation try to connect to the server\r\n\t\t\tif(connectionSuccess == true) {\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsock = new Socket(serverInfoArray[0], port);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\t\t\tconnectionSuccess = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Loop until a successful connection to the server is made\r\n\t\t} while(connectionSuccess == false);\r\n\t\t\r\n\t\t\r\n\t\t// Setup buffered reader to read from the server\r\n\t\ttry {\r\n\t\t\tserverReader = new BufferedReader(new InputStreamReader(sock.getInputStream()));\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\tshowMSG(CONNECTION_ERROR_MSG);\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}", "public void connecting() {\n\n }", "public interface ClientInterface extends Remote {\n\tpublic static final int NUMBEROFSERVER=7;\n\t\n\t/*public static final String[] SERVERS = { \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\",\n\t\t\"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\",\n\t\t\"glados.cs.rit.edu\", \"glados.cs.rit.edu\", \"glados.cs.rit.edu\" };*/\n\tpublic static final String[] SERVERS = { \"glados.cs.rit.edu\", \"kansas.cs.rit.edu\", \"doors.cs.rit.edu\", \"gorgon.cs.rit.edu\",\n\t\t\"newyork.cs.rit.edu\", \"yes.cs.rit.edu\", \"kinks.cs.rit.edu\", \"medusa.cs.rit.edu\", \"joplin.cs.rit.edu\",\n\t\t\"delaware.cs.rit.edu\", \"buddy.cs.rit.edu\", \"arizona.cs.rit.edu\" };\n\t//public static final String ClientIP=\"129.21.88.98\";\n\t/**\n\t * This remote method will be called by server for copying file at Client using remote object.\n\t * @param data Byte array containing File data\n\t * @param name Name of the File\n\t * @param Server Name of the server\n\t * @throws RemoteException\n\t */\n\tpublic void getFile(byte[] data, String name,String server) throws RemoteException;\n\t/**\n\t * Servers will update request trail by invoking this remote method\n\t * @param request Name of the Server which is serving the file request.\n\t * @throws RemoteException\n\t */\n\tpublic void updateRequestTrail(String request) throws RemoteException;\n\t/**\n\t * Severs invoke this method for passing message to client Ex File does not exist \n\t * @param error Message contains\n\t * @throws RemoteException \n\t */\n\tpublic void Error(String error) throws RemoteException; \n\t\t\n\t\n}", "public boolean init()\n\t{\n\t\tboolean ret = false;\n\t\ttry\n\t\t{\n\t\t\tsocket = new Socket(Setting.SERVER_IP, Setting.SERVER_PORT);\n\t\t\tis = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\tos = new PrintWriter(socket.getOutputStream());\n\t\t\t\n\t\t\tsentInitInfo();\n\t\t\t\n\t\t\tThread listeningThread = new Thread(listenRunnable);\n\t\t\tlisteningThread.start();\n\t\t\t\n\t\t\tret = true;\n\t\t}\n\t\tcatch (UnknownHostException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn ret;\n\t}", "@Override\n\tpublic void networkIsOk() {\n\n\t}", "void clientReady();", "private void verifyAuthWithServer() {\n mRegisterModel.connect(binding.personFirstName.getText().toString(),\n binding.personLastName.getText().toString(),\n binding.registerEmail.getText().toString(),\n binding.registerPassword.getText().toString());\n //this is an Asynchronous call no statements after should rely on the result of connect\n }", "private void connectAndLogonIfRequired() {\n\t\tloadFtpConfiguration();\n\t\ttry{\n\t\t\tif (!client.isConnected()){\n\t\t\t\t\n\t\t\t\tprintConsole(\"Connecting \"+ HOST);\n\t\t\t\tprintConsole(\"Port \"+ PORT);\n\t\n\t\t\t\tclient.setRemoteHost(HOST);\n\t\t\t\tclient.setRemotePort(PORT);\n\t\t\t\t\n\t\t\t\t//Encoding\n\t\t\t\tclient.getAdvancedSettings().setControlEncoding(ENCODING);\n\t\t\t\t\n\t\t\t\t//Default mode in AndFTP\n\t\t\t\t//Passive mode\n\t\t\t\tclient.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);\n\t\t\t\tprintConsole(\"Added passive mode\");\n\t\t\t}\n\n\t\t\tif (!client.isConnected()){\n\t\t\t\tprintConsole(\"User: \"+USERNAME);\n\t\t\t\tprintConsole(\"Pass: HIDDEN\");\n\t\t\t\t\n\t\t\t\tclient.setUserName(USERNAME);\n\t\t\t\tclient.setPassword(PASSWORD); \t\t\t\t\n\t\t\t\t\n\t\t\t\tclient.connect();\n\t\t\t\tprintConsole(\"STATUS: Authenticated\");\t\t\t\t\t\t\t\t\n\t\t\t}\n\n\t\t} catch (IllegalStateException e) {\n\t\t\tprintExceptionConsole(e);\t\t\t\t\t\n\t\t} catch (IOException e) {\n\t\t\tprintExceptionConsole(e);\t\t\t\t\t\n\t\t} catch (FTPException e) {\n\t\t\tprintExceptionConsole(e);\t\t\t\t\t\n\t\t}\t\t\n\t}", "@Override\n\tpublic boolean isConnected() {\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean isConnected() {\n\t\treturn false;\n\t}", "private void startClientConnection() {\r\n\t\t\t\r\n\t//\tStringBuilder sbreq = new StringBuilder();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\t/*making connection request*/\r\n\t\t\tclientsoc = new Socket(ip,port);\r\n\t\t\t\r\n\t\t\t/*Input and output streams for data sending and receiving through client and server sockets.*/\r\n\t\t\tdis = new DataInputStream(clientsoc.getInputStream());\t\r\n\t\t\tdos = new DataOutputStream(clientsoc.getOutputStream());\r\n\t\t\t\r\n\t\t\tStringBuilder sbconnreq = new StringBuilder();\r\n\r\n\t\t\t/*Building the Http Connection Request and passing Client name as body. Thus the Http Header\r\n\t\t\tare encoded around the client name data.*/\r\n\t\t\tsbconnreq.append(\"POST /\").append(\"{\"+clientname+\"}\").append(\"/ HTTP/1.1\\r\\n\").append(host).append(\"\\r\\n\").\r\n\t\t\tappend(userAgent).append(\"\\r\\n\").append(contentType).append(\"\\r\\n\").append(contentlength).append(clientname.length()).append(\"\\r\\n\").\r\n\t\t\tappend(date).append(new Date()).append(\"\\r\\n\");\r\n\t\t\t\r\n\t\t\tdos.writeUTF(sbconnreq.toString());\r\n\r\n\t\t\totherusers = new ArrayList<>(10);\r\n\t\t\tusertimestamp = new HashMap<>(10);\r\n\t\t\tJOptionPane.showMessageDialog(null, \"You have logged in. You can start Chatting: \" + clientname);\r\n\t\t\tconnected = true;\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}", "public boolean ConnectionCheck(){\n ConnectivityManager cm =\n (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n NetworkInfo activeNetwork = cm.getActiveNetworkInfo();\n isConnected = activeNetwork != null &&\n activeNetwork.isConnectedOrConnecting();\n return isConnected;\n }", "boolean hasClientHello();", "private synchronized int srvConnect() {\n \n\t\ttry {\n\t\t\t// The address to connect to\n\t\t\tSystem.out.println(TAG + \":Address:\" + getAddress());\n\t\t\tSystem.out.println(TAG + \":Port:\" + String.valueOf(getPort()));\n\t\t\taddr = InetAddress.getByName(getAddress());\n\t\t\t// The address plus the port\n\t\t\tservAddress = new InetSocketAddress(addr, getPort());\n\n\t\t\t// Try to connect\n\t\t\tmysock = new Socket();\n\t\t\t// This socket will block/ try connect for 5s\n\t\t\tmysock.connect(servAddress, 5000);\n\t\t\t// Show me if i was connected successfully\n\t\t\tif (mysock.isConnected()) {\n\t\t\t\tif(out == null){\n\t\t\t\t\tout = new PrintWriter(mysock.getOutputStream(),true);\n\t\t\t\t\tSystem.out.println(TAG + \":New socket and new streamer was created.\");\n\t\t\t\t}\n\t\t\t}\n \n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.out.println(TAG + \":Null Pointer occured.\");\n\t\t\treturn -1;\n\t\t} catch (UnknownHostException e) {\n\t\t\tSystem.out.println(TAG + \":Server does not exist.\");\n\t\t\treturn -1;\n\t\t} catch (IOException e) {\n\t\t\tif (e instanceof SocketException && e.getMessage().contains(\"Permission denied\")) {\n\t\t\t\tSystem.out.println(TAG + \":You don't have internet permission:\" + e);\n\t\t\t} else if(e instanceof ConnectException && e.getMessage().contains(\"Connection refused\")){\n\t\t\t\tSystem.out.println(TAG + \":Connection is refused, the service on the server is probably down:\" + e);\n\t\t\t} else {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.out.println(TAG + \":Could not connect\");\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n \n\t\treturn 0;\n\t}", "public boolean start() {\n\t\t\n\t\t// Try to connect to the server\n\t\t\n\t\ttry {\n\t\t\tsocket = new Socket(server, port);\n\t\t}\n\t\t\n\t\t// If failed can only display the error\n\t\t\n\t\tcatch(Exception ec) {\n\t\t\tdisplay(\"Error connectiong to server:\" + ec);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString msg = \"Connection accepted \" + socket.getInetAddress() + \" : \" + socket.getPort();\n\t\tdisplay(msg);\n\t\n\t\t// Creating I/O data streams\n\t\t\n\t\ttry\n\t\t{\n\t\t\tsInput = new ObjectInputStream(socket.getInputStream());\n\t\t\tsOutput = new ObjectOutputStream(socket.getOutputStream());\n\t\t}\n\t\tcatch (IOException eIO) {\n\t\t\tdisplay(\"Exception creating new Input/output Streams: \" + eIO);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Creates Server listener Thread \n\t\t\n\t\tnew ListenFromServer().start();\n\t\t\n\t\t// Send username to the server as a string - all chat messages will be sent as objects\n\t\t\n\t\ttry {\n\t\t\tsOutput.writeObject(username);\n\t\t}\n\t\tcatch (IOException eIO) {\n\t\t\tdisplay(\"Exception during login : \" + eIO);\n\t\t\tdisconnect();\n\t\t\treturn false;\n\t\t}\n\t\treturn true; // Inform caller it worked\n\t}", "@Override\n\tpublic boolean connect() {\n\t\treturn false;\n\t}", "public static void doConnect() {\r\n\t\tlogger.info(\"Connecting to server......\");\r\n\t\tChannelFuture future = null;\r\n\t\ttry {\r\n\t\t\tfuture = bootstrap.connect(new InetSocketAddress(host, port));\r\n\t\t\tfuture.addListener(channelFutureListener);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t// future.addListener(channelFutureListener);\r\n\t\t\tlogger.warn(\"Closed connection.\");\r\n\t\t}\r\n\r\n\t}", "@Override\n public void clientTryingConnectionToHost(PiClient piClient) {\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(activity, \"Connecting\", Toast.LENGTH_SHORT).show();\n }\n });\n }", "public boolean checkServer() {\n boolean result = false;\n \n int url = 195885416; //Using www.vg.no for now. There might be a problem in the ip-format, but we'll know more after testing.\n if(isNetworkAvailable()) {\n ConnectivityManager cm = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);\n \n if(cm.requestRouteToHost(ConnectivityManager.TYPE_WIFI, url)) {\n result = true;\n } else if(cm.requestRouteToHost(ConnectivityManager.TYPE_MOBILE, url)) {\n result = true;\n }\n }\n \n return result;\n }", "public static boolean isConnectedToInternet() {\n String pingServerURL = pingBackUrl.substring(0, pingBackUrl.indexOf(\"/\", \"http://url\".length()));\n try {\n URL url = new URL(pingServerURL);\n HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n urlConn.connect();\n return (HttpURLConnection.HTTP_NOT_FOUND != urlConn.getResponseCode());\n } catch (MalformedURLException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n \n } catch (IOException e) {\n LOG.error(\"LeadCapture : Error creating HTTP connection to the server : \" + pingServerURL);\n }\n return false;\n }", "public static void serverConnected() {\r\n jButton5.setEnabled(false);\r\n jButton4.setEnabled(false);\r\n jButton6.setEnabled(true);\r\n jButton1.setEnabled(true);\r\n jTextField1.setEnabled(true);\r\n log(\"GREEN\", \"[Status] - Connected !\");\r\n }", "public void connectionCheck(Long sessionId);", "public void establishSocketConnection() {\n\t\ttry {\n\t\t\tsocket = new Socket(serverIP, serverPort);\n\t\t\tlogger.info(\"Connection with JSON-RPC server opened at local endpoint \" + socket.getLocalAddress().getHostAddress() + \":\" + socket.getLocalPort());\n\t\t\t// create a writer to send JSON-RPC requests to the JSON-RPC server\n\t\t\twriter = new OutputStreamWriter(socket.getOutputStream(), \"utf-8\");\n\t\t\t// create a JsonReader object to receive JSON-RPC response\n\t\t\tjsonReader = new JsonReader(new InputStreamReader(socket.getInputStream(), \"utf-8\"));\n\t\t} catch (UnknownHostException e) {\n\t\t\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void getConnection() throws Exception {\n\t\ttry {\n\t\t\tSystem.out.println(\"Waiting for new client!\");\n\n\n\n\t\t\tclient = serverSocket.accept();\n\t\t\tis = client.getInputStream();\n\t\t\tisr = new InputStreamReader(is);\n\t\t\tbr = new BufferedReader(isr);\n\t\t\tos = client.getOutputStream();\n\t\t\tosw = new OutputStreamWriter(os);\n\t\t\tpw = new PrintWriter(osw, true);\n\t\t\tsleep(500);\n\t\t\t//clientkey = getClientKey();\n\t\t\tSystem.out.println(\"Client has connected!\");\n\t\t\t\n\t\t\tGetTimestamp(\"Client Publickey is being stored: \" ) ;\n\t\t\t\n\t\t\tpublicKey = getClientPublicKey();\n\t\t\t\n\t\t\tGetTimestamp(\"Client Publickey is stored: \" ) ;\n\t\t\t\n\t\t\tString tosend = encrypt1(getSharedKey(), getClientPublicKey());\n\t\t\t\n\t\t\tGetTimestamp(\"Client sharedkey is being encrypted: \") ;\n\t\t\t\n\t\t\tGetTimestamp(\"Waiting for Authorization Request from Client: \");\n\t\t\t\n\t\t\t//getclientpublickey();\n\t\t\tgetAUTH_REQUEST();\n\t\t\t//getMessage();\n\n\t\t} catch (IOException | InterruptedException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t}", "public void waitClient() {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"wait connect\");\n\t\t\t\tsocket = server.accept();\n\t\t\t\tSystem.out.println(\"Server connect successed\");\n\t\t\t\tSystem.out.println(\"gethost : InetAddress = \" + socket.getInetAddress());\n\t\t\t\tserver.close();\n\t\t\t} catch (java.io.IOException e) {\n\t\t\t\tSystem.out.println(e.getMessage());\n\t\t\t}\n\t\t}", "@Override\n\tpublic void run(){\n\t\tInetAddress IPAddress = serverTcpSocket.getInetAddress();\n\t\tfor (ClientObj c: clients)\n\t\t\tif (c.getId() == client.getId()){\n\t\t\t\tSystem.out.print(IPAddress + \" Client already connected!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\ttry{\n\t\t\t// Check handshake received for correctness\n\t\t\t//(connect c->s) [herader | \"JUSTIN\\0\" | connection port] (udp)\n\t\t\t//(connect response s->c) [header | client id | port] (udp)\n\t \n\t // open the connection\n\t\t clientSocket = null;\n\t\t Socket clientListener = null;\n\t\t // wait for client connection on tcp port\n\t\t //serverTcpSocket.setSoTimeout(5000);\n\t \tSystem.out.println (\" Waiting for tcp connection.....\");\n\t \tclientSocket = serverTcpSocket.accept();\n\t \tclientListener = serverTcpSocket.accept();\n\t \tclient.setListenerSocket(clientListener);\n\t\t\tIPAddress = clientSocket.getInetAddress();\n\t\t\tint recv_port = clientSocket.getPort();\n\t\t\tSystem.out.println(IPAddress + \": Client connected @ port \" + recv_port);\n\n\t\t // handle tcp connection\n\t\t\tclientSocket.setSoTimeout(Constants.ACK_TIMEOUT);\n\t\t out = new BufferedOutputStream(clientSocket.getOutputStream());\n\t\t\tin = new BufferedInputStream(clientSocket.getInputStream());\n\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\tclient.setPort(clientSocket.getPort());\n\t\t clients.add(client);\n\t\t\t\n\t\t // handle requests\n\t\t\twhile (!shutdown_normally) {\n\t\t\t\t// read just the header, then handle the req based on the info in the header\n\t\t\t\tif ((buf = Utility.readIn(in, Constants.HEADER_LEN)) == null)\n\t\t\t\t\tbreak;\n\t\t\t\tint flag = buf.getInt(0);\n\t\t\t\tint len2 = buf.getInt(4);\n\t\t\t\tint id = buf.getInt(8);\n\t\t\t\t\n\t\t\t\t// check for correctness of header\n\t\t\t\t\n\t\t\t\tif (flag < Constants.OPEN_CONNECTION || \n\t\t\t\t\t\tflag > Constants.NUM_FLAGS || \n\t\t\t\t\t\tid != client.getId() || \n\t\t\t\t\t\tlen2 < 0){\n\t\t\t\t\tout.close(); \n\t\t\t\t\tin.close(); \n\t\t\t\t\tclientSocket.close(); \n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t\t\tclients.remove(client);\n\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\"Connection - FAILURE! (malformed header)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// read payload\n\t\t\t\tif ((buf = Utility.readIn(in, Utility.getPaddedLength(len2))) == null)\n\t\t\t\t\tthrow new IOException(\"read failed.\");\n\t\t\t\t// update address (necessary?)\n\t\t\t\tclients.get(clients.indexOf(client)).setAddress(clientSocket.getInetAddress());\n\t\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\t\tswitch (flag){\n\t\t\t\t\tcase Constants.ACK:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.VIEW_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing view request...\");\n\t\t\t\t\t\tViewFiles(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download request...\");\n\t\t\t\t\t\tDownload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.UPLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing upload request...\");\n\t\t\t\t\t\tUpload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_ACK:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download acknowledgment...\");\n\t\t\t\t\t\tDownloadCompleted(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.CLOSE_CONNECTION:\n\t\t\t\t\t\tshutdown_normally = true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// close all open sockets\n\t\t out.close(); \n\t\t in.close(); \n\t\t clientSocket.close(); \n\t\t serverTcpSocket.close();\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tSystem.err.println(IPAddress + \": Timeout waiting for response.\");\n\t\t} catch (UnknownHostException e) {\n\t\t\t// IPAdress unknown\n\t\t\tSystem.err.println(\"Don't know about host \" + IPAddress);\n\t\t} catch (IOException e) {\n\t\t\t// Error in communication\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to \" +\n\t\t\t\t\tIPAddress);\n\t\t} catch (RuntimeException e){\n\t\t\t// Malformed Header or payload most likely\n\t\t\tSystem.err.println(IPAddress + \": Connection - FAILURE! (\" + e.getMessage() + \")\");\n\t\t} finally {\n\t\t\t// remove this client from active lists, close all (possibly) open sockets\n\t\t\tSystem.out.println(IPAddress + \": Connection - Closing!\");\n\t\t\tclients.remove(client);\n\t\t\ttry {\n\t\t\t\tSocket clientConnection = client.getListenerSocket();\n\t\t\t\tOutputStream out_c = new BufferedOutputStream(clientConnection.getOutputStream());\n\t\t\t\tbuf = Utility.addHeader(Constants.CLOSE_CONNECTION, 0, client.getId());\n\t\t\t\tout_c.write(buf.array());\n\t\t\t\tout_c.flush();\n\t\t\t\tout_c.close();\n\t\t\t\tclientConnection.close();\n\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t\tif (in != null)\n\t\t\t\t\tin.close();\n\t\t\t\tif (!clientSocket.isClosed())\n\t\t\t\t\tclientSocket.close();\n\t\t\t\tif (!serverTcpSocket.isClosed())\n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t} catch (IOException e){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n }", "public boolean isConnected() {\n if (client == null) {\n return false;\n }\n return client.isConnected();\n }", "public boolean pingServer() {\n WifiMouseApplication.KnownServer selected = WifiMouseApplication.getSelectedServer();\n if(this.server.name != selected.name || this.server.bluetooth != selected.bluetooth)\n return false;\n\n sendStringOverNetwork(\"PING\", true);\n //Log.d(\"Waiting for ping...\", \"count: \"+(++count) +\", sessionIv: \"+sessionIV);\n String response = readStringFromNetwork(true);\n //Log.d(\"PingResponse\", \" \"+response);\n\n return response.equals(\"PING\");\n }", "private void connectToServer() {\n\n try {\n this.socket = new Socket(InetAddress.getByName(serverIP), this.port);\n\n oos = new ObjectOutputStream(socket.getOutputStream());\n oos.flush();\n ois = new ObjectInputStream(socket.getInputStream());\n\n Message connectMessage = new Message(Message.CLIENT_CONNECT);\n connectMessage.setMessage(userName);\n sendToServer(connectMessage);\n\n Message message;\n while (true){// wait for welcome message\n message = (Message) ois.readObject();\n if(message != null && message.getType() == Message.WELCOME){\n handleMessage(message);\n break;\n }\n }\n\n } catch (UnknownHostException e) {\n e.printStackTrace();\n System.exit(0);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }", "void open(String nameNport) {\n\tString[] token=nameNport.split(\":\");\n\tString host=token[0];\n\tint port=Integer.parseInt(token[1]);\n\tint proceedFlag=1;\n\tIterator<Socket> iterator=Connection.connections.iterator();\n\tif(host.equalsIgnoreCase(\"localhost\") || host.equals(\"127.0.0.1\"))\n\t\thost=simpella.infoSocket.getLocalAddress().getHostAddress();\n\tif((host.equalsIgnoreCase(simpella.infoSocket.getLocalAddress().getHostAddress())||host.equalsIgnoreCase(simpella.infoSocket.getLocalAddress().getCanonicalHostName()))&&(simpella.serverPortNo==port || simpella.downloadPortNo==port)){\n\t\tproceedFlag=0;\n\t\tSystem.out.println(\"Client: Self Connect not allowed\");\n\t\t}\n\twhile(iterator.hasNext() && proceedFlag==1)\n\t{\n\t\tSocket sock=(Socket)iterator.next();\n\t\t\n\t\tif((host.equalsIgnoreCase(sock.getInetAddress().getHostAddress()) || host.equalsIgnoreCase(sock.getInetAddress().getCanonicalHostName())) && port==sock.getPort()){\n\t\t\tproceedFlag=0; \n\t\t\tSystem.out.println(\"Client: Duplicate connection to same IP/port not allowed\");\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}\n\tif(proceedFlag==1)\n\t\t{\n\t\n\t\n\tbyte type=04;\n\tMessage msg=new Message(type);\n\ttry {\n\t\tConnection.outgoingConnPackRecv[noOfConn]=0;\n\t\tConnection.outgoingConnPackSent[noOfConn]=0;\n\t\tConnection.outgoingConnPackSentSize[noOfConn]=0;\n\t\tConnection.outgoingConnPackRecvSize[noOfConn]=0;\n\t\t\n\t\tclientSideSocket[noOfConn]=new Socket(host,port);\n\t\tSystem.out.println(\"Client:TCP Connection established...Begin handshake\");\n\t\toutToServer[noOfConn]=new ObjectOutputStream(clientSideSocket[noOfConn].getOutputStream());\n\t\tinFromServer[noOfConn]=new ObjectInputStream(clientSideSocket[noOfConn].getInputStream());\n\t\tString strToServer=\"SIMPELLA CONNECT/0.6\\r\\n\";\n\t\tbyte[] byteArray= strToServer.getBytes(\"UTF-16LE\");\n\t\tmsg.setPayload(byteArray);\n \t\n\t\tSystem.out.println(\"Client:\"+new String(byteArray));\n\t\t//outToServer.writeUTF(\"SIMPELLA CONNECT/0.6\\r\\n\");\n\t\tConnection.outgoingConnPackSent[noOfConn]++;\n\t\tConnection.outgoingConnPackSentSize[noOfConn]+=byteArray.length+23;\n\t\toutToServer[noOfConn].writeObject((Object)msg);\n\t\tConnection.outgoingConnPackRecv[noOfConn]++;\n\t\t\n\t\tMessage msg1=(Message) inFromServer[noOfConn].readObject();\n\t\tbyte[] fromServer=msg1.getPayload();\n\t\tConnection.outgoingConnPackRecvSize[noOfConn]+=fromServer.length+23;\n\t\tString strFromServer=new String(fromServer);\n\t\tSystem.out.println(\"Server:\"+strFromServer);\n\t\tif(msg1.getMessage_type()==05)\n\t\t\t{\n\t\t\tstrToServer=\"SIMPELLA/0.6 200 thank you for accepting me\\r\\n\";\n\t\t\tbyte[] byteArray1= strToServer.getBytes(\"UTF-16LE\");\n\t\t\tMessage m=new Message((byte)05);\n\t\t\tm.setPayload(byteArray1);\n\t\t\tConnection.outgoingConnPackSent[noOfConn]++;\n\t\t\tConnection.outgoingConnPackSentSize[noOfConn]+=byteArray1.length+23;\n\t\t\toutToServer[noOfConn].writeObject((Object)m);\n\t\t\t\n\t\t\tConnection.connections.add(clientSideSocket[client.noOfConn]);\n\t\t\tConnection.outgoingConnection[client.noOfConn]=clientSideSocket[client.noOfConn];\n\t\t\tConnection.clientOutStream[client.noOfConn]=outToServer[client.noOfConn];\n\t\t\tnew clientSocketListen(clientSideSocket[noOfConn],outToServer[noOfConn],inFromServer[noOfConn]);\n\t\t\tupdate();\n\t\t\tnoOfConn++;\n\t\t\t//System.out.println(\"Client:num of conn=\"+noOfConn);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"<open>:Cannot open connection to \"+host+\" at this time\");\n\t\t\t\tclientSideSocket[noOfConn].close();\n\t\t\t\tinFromServer[noOfConn].close();\n\t\t\t\toutToServer[noOfConn].close();\n//\t\t\t\tSystem.out.println(\"Client:num of conn=\"+noOfConn);\n\t\t\t}\n\t\t\n\t\t\n\t} catch (UnknownHostException e) {\n\t\tSystem.out.println(\"Unknown Host: Destination host unreachable\");\n\t\t//e.printStackTrace();\n\t} catch (Exception e) {\n\t\tSystem.out.println(\"Connection Refused/Destination host unreachable\");\n\t}\n\t\t}\n\t}", "private boolean _check() throws SessionException {\n\n this._client = new Client(this._domainFile, \n System.getProperty(Constants.PROPERTY_SSL_TRUSTSTORE));\n \n\n //get a list of server groups\n LinkedList groups = this._client.getGroupList();\n boolean success = true;\n \n //for each group, get a list of filetypes\n while (groups.size() != 0) \n {\n String group = (String) groups.getFirst();\n LinkedList filetypes = this._client.getFileTypeList(group);\n this._argTable.put(CMD.SERVERGROUP, group);\n \n \n //we will need to re-set the login info based on the \n //current server group\n this._argTable.remove(CMD.USER);\n this._argTable.remove(CMD.PASSWORD);\n \n \n String username, password;\n //get the username and password for current active servergroup\n try {\n username = this._loginReader.getUsername(group);\n password = this._loginReader.getPassword(group);\n } catch (Exception e) {\n this._logger.error(ERROR_TAG + \"Unable to locate user login file.\");\n ++this._errorCount;\n return false;\n }\n \n\n //check that we have credentials, if not, then skip group\n if (username == null || password == null)\n {\n String msg = \"No login credentials associated with server group '\"\n + group + \"'. Skipping the server group.\";\n this._logger.error(ERROR_TAG + msg);\n ++this._errorCount;\n success = false;\n groups.removeFirst();\n continue;\n }\n else\n {\n this._argTable.put(CMD.USER, username);\n this._argTable.put(CMD.PASSWORD, password);\n }\n \n \n while (filetypes.size() != 0) \n {\n String filetype = (String) filetypes.getFirst();\n this._argTable.put(CMD.FILETYPE, filetype);\n \n String fullFiletype = FileType.toFullFiletype(group, filetype);\n \n this._logger.info(\"Trying connection to file type \\\"\" + \n fullFiletype + \"\\\"\");\n try {\n this._client.login(username, password, group, filetype);\n this._logger.info(\"OK\");\n } catch (SessionException e) {\n this._logger.error(ERROR_TAG + e.getMessage());\n ++this._errorCount;\n success = false;\n }\n filetypes.removeFirst();\n }\n groups.removeFirst();\n }\n return success;\n }", "void checkConnection() {\n\n //Call method which checks for connection.\n boolean isNetworkConnected = isNetworkConnected();\n\n //If there is a data connection currently available for use, attempt to authenticate login details with Firebase,\n // allow user to login offline but without a profile and access only to local storage.\n if(isNetworkConnected) {\n\n //If there is an active data connection, set authenticated value to true\n authenticated = true;\n }\n\n else {\n\n //If there is an active data connection, set authenticated value to false\n authenticated = false;\n }\n }", "public abstract void handleConnected() throws Exception;", "public static boolean connect2Server() {\n\t\ttry {\n\t\t\tinetAdd = InetAddress.getByName(null);\n\t\t\ts = new Socket(inetAdd, PORT);\n\t\t\toos = new ObjectOutputStream(s.getOutputStream());\n\t\t\tois = new ObjectInputStream(s.getInputStream());\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Errore connessione al server\");\n\t\t}\n\t\treturn false;\n\t}", "@Override\n public boolean isConnected() {\n boolean result = false;\n synchronized (CONN_SYNC) {\n result = ((system != null) && system.isConnected());\n }\n return result;\n }", "public boolean start() {\n\t\t// Tenta se conectar ao servidor\n\t\ttry {\n\t\t\tsocket = new Socket(server, port); //assimila o socket e busca conexão caso a porta esteja aberta\n\t\t} \n\t\tcatch(Exception ec) {\n\t\t\tdisplay(\"Não foi possível estabelecer a conexão com o servidor\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tString msg = \"Conexão estabelecida com servidor [\" + socket.getInetAddress() + \":\" + socket.getPort()+\"]\";\n\t\tdisplay(msg);\n\t\n\t\t\n\t\t\n\t\t//\tCria canal de entrada e canal de saida com servidor\n\t\ttry\n\t\t{\n\t\t\tsInput = new ObjectInputStream(socket.getInputStream());\n\t\t\tsOutput = new ObjectOutputStream(socket.getOutputStream());\n\t\t}\n\t\tcatch (IOException eIO) {\n\t\t\tdisplay(\"Não foi possível criar canais de comunicação\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// INCIA THREAD ( escuta o servidor ) \n\t\tnew ListenFromServer().start();\n\t\t\n\t\t\n\t\t// tenta enviar a primeira mensagem\n\t\ttry\t{\n\t\t\tsOutput.writeObject(username);\n\t\t} catch (IOException eIO) {\n\t\t\tdisplay(\"A comunicação não foi estabelecida por completo, a conexão será desfeita\");\n\t\t\tdisconnect();\n\t\t\treturn false;\n\t\t}\n\n\t\t//retorna true para validar a conexão estabelecida\n\t\treturn true;\n\t}", "abstract public boolean createConnection();" ]
[ "0.69835293", "0.692086", "0.68837035", "0.6843786", "0.68413323", "0.6802004", "0.67832476", "0.67329776", "0.67329776", "0.6696942", "0.6696942", "0.6696942", "0.6696942", "0.6696942", "0.6696942", "0.6696942", "0.6696942", "0.6695805", "0.6695805", "0.6695805", "0.6695805", "0.6695805", "0.6651315", "0.6565607", "0.6557586", "0.65549636", "0.6528744", "0.65278697", "0.6502668", "0.6484791", "0.6484656", "0.64777935", "0.645864", "0.64571553", "0.6448744", "0.6448637", "0.6446805", "0.64397", "0.64284587", "0.64203477", "0.64119583", "0.638169", "0.63746405", "0.63657975", "0.63575876", "0.63518476", "0.63487", "0.6344409", "0.6343999", "0.63297313", "0.6324178", "0.63225746", "0.6311776", "0.62920475", "0.6290156", "0.62848943", "0.62766576", "0.62728006", "0.6266053", "0.62582463", "0.6247063", "0.6236831", "0.62355655", "0.6235098", "0.6233426", "0.6230279", "0.6228278", "0.62206876", "0.6202349", "0.62003714", "0.61912996", "0.6175942", "0.61754215", "0.61754215", "0.6172131", "0.6162659", "0.6156472", "0.61382186", "0.6137678", "0.61363256", "0.61328965", "0.6126626", "0.6125552", "0.61115855", "0.6108253", "0.6106674", "0.61000264", "0.60984784", "0.60849", "0.60797495", "0.6060593", "0.60541517", "0.6052383", "0.60480416", "0.60476923", "0.6047187", "0.6043664", "0.6041977", "0.6038446", "0.6037641", "0.603523" ]
0.0
-1
Updates the view of the connected players
public void updateConnectedPlayers(ArrayList<Player> connectedPlayers) throws RemoteException{ match.setPlayers(connectedPlayers); for (int i=0;i<match.getPlayers().size();i++){ System.out.println("[LOBBY]: Player "+ match.getPlayers().get(i).getNickname()+ " is in lobby"); } System.out.println("[LOBBY]: Refreshing Lobby.."); Platform.runLater(() -> firstPage.refreshPlayersInLobby());// Update on JavaFX Application Thread }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void displayPlayers() {\n\t\tfor (Player p: game.getPlayers()) {\n\t\t\tview.updateDisplay(p.getId(), p.getDeck().getNumberOfCards());\n\t\t}\n\t}", "public void enterPlayerView(){\n\t\tplayerSeen=true;\r\n\t\tplayerMapped=true;\r\n\t}", "public void update() {\n\t\t//Indicate that data is fetched\n\t\tactivity.showProgressBar();\n\t\n\t\tPlayer currentPlayer = dc.getCurrentPlayer();\n\t\tactivity.updatePlayerInformation(\n\t\t\t\tcurrentPlayer.getName(),\n\t\t\t\tgetGlobalRanking(),\n\t\t\t\tcurrentPlayer.getGlobalScore(),\n\t\t\t\tcurrentPlayer.getPlayedGames(),\n\t\t\t\tcurrentPlayer.getWonGames(),\n\t\t\t\tcurrentPlayer.getLostGames(),\n\t\t\t\tcurrentPlayer.getDrawGames());\n\n\t\tactivity.hideProgressBar();\n\t}", "@Override\r\n\tpublic void update() {\n\t\tListIterator<Player> it = players.listIterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tit.next().update();\r\n\t\t}\r\n\t\t// Logica del juego, etc\r\n\t\tcontrolMenu();\r\n\t}", "@SuppressWarnings(\"deprecation\")\n private void update(Player player) {\n Team team = teams.getTeam(player);\n\n if (team == null) {\n for (Player online : game.getPlayers()) {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n return;\n }\n\n for (Player online : game.getPlayers()) {\n if (team.hasPlayer(online)) {\n player.hidePlayer(online);\n online.hidePlayer(player);\n } else {\n player.showPlayer(online);\n online.showPlayer(player);\n }\n }\n }", "public void refreshPlayerPanel() {\n view.clearDice();\n Player curPlayer;\n \n for(int i = 0; i < players.size(); i++){\n curPlayer = players.peek();\n \n view.setDie(curPlayer);\n players.add(players.remove());\n \n }\n board.reloadImgs();\n }", "public void updatePlayerPanel()\n {\n playerInfoPanel.updateLabel();\n }", "@Override\n public void update(Observable o, Object remoteView) {\n RemoteView remote = (RemoteView) remoteView;\n this.mapView = remote.getMapView();\n this.playerHand = remote.getPlayerHands().get(this.playerId);\n this.playerBoardViews = remote.getPlayerBoardViews();\n this.playerPosition = remote.getMapView().getPlayerPosition(remote.getPlayerBoardViews().get(this.playerId).getColor());\n }", "private void updatePlayerList() \n\t{\n\t\tplayerStatus.clear();\n\n\t\tfor(Player thisPlayer: players) // Add the status of each player to the default list model.\n\t\t{\n\t\t\tplayerStatus.addElement(thisPlayer.toString());\n\t\t}\n\n\t}", "public void updatePlayerPoints() {\n setText(Integer.toString(owner.getPlayerPoints()) + \" points\");\n }", "public void updateLobby(Set<String> players) {\r\n lobbyFrame.updateList(players);\r\n }", "private void updateInfo() {\n /* Show the current server address in use */\n String text = String.format(getResources().getString(R.string.main_activity_server_address),\n Utils.getAddress(), Utils.getPort());\n serverTextView.setText(text);\n\n /* Show information about current player */\n Player player = SharedDataManager.getPlayer(this);\n /* No player is logged in */\n if (player == null) {\n playerTextView.setText(getString(R.string.your_nickname));\n return;\n }\n /* Player is logged in, show some information about him */\n text = String.format(getResources().getString(R.string.main_activity_player_title),\n player.getNickname(), player.getScore());\n playerTextView.setText(text);\n }", "public void refresh() {\r\n\t\tmainGUI.getPlayerFrame().setMyTurn(\r\n\t\t\t\tclient.getID() == island.getCurrentPlayer().getID());\r\n\t\ttradingMenu.update();\r\n\t\tsupplyPanel.update();\r\n\t\tcardMenu.update();\r\n\t\trefreshOpponents();\r\n\t}", "@Override\n public void updateView(UserInteraction userInteraction) {\n userInteraction.getGame().setPlayers(this.players);\n userInteraction.getGame().setDevelopmentCardTable(this.table);\n userInteraction.getGame().setMarket(this.market);\n userInteraction.getGame().setFaithTrack(this.faithTrack);\n if(this.players.get(1).getNickname().equals(\"Lorenzo il Magnifico\"))\n userInteraction.getGame().setGameType(GameType.SINGLEPLAYER);\n else\n userInteraction.getGame().setGameType(GameType.MULTIPLAYER);\n userInteraction.setMessage(this);\n\n this.displayAction(userInteraction);\n }", "@Override\n public void updateContent() {\n lmDriver.getTournaments();\n\n // Show all tournaments in the scene\n table.createTable();\n\n // Disable buttons\n btnJoin.disableProperty().bind(Bindings.isEmpty(tblTournaments.getSelectionModel().getSelectedItems()));\n btnWithdraw.disableProperty().bind(Bindings.isEmpty(tblTournaments.getSelectionModel().getSelectedItems()));\n btnShowInfo.disableProperty().bind(Bindings.isEmpty(tblTournaments.getSelectionModel().getSelectedItems()));\n\n // Clear list\n listLeaderboard.getItems().clear();\n\n // Update global leaderboard\n ArrayList<String> leaderboard = lmDriver.getGlobalLeaderboard();\n\n if (leaderboard.size() == 0) {\n listLeaderboard.getItems().add(\"There are no values yet.\");\n } else {\n listLeaderboard.getItems().add(\"Position Score Player\");\n for (String row : leaderboard) {\n listLeaderboard.getItems().add(row);\n }\n }\n }", "private void updatePlayersStatus() {\n PlayerModel[] playersInLobby = this.lobbyModel.getPlayersInLobby();\n int i = 0;\n for (; i < playersInLobby.length; i++) {\n final PlayerModel playerInLobby = playersInLobby[i];\n final TextField playerStatus = this.playersStatus[i];\n playerStatus.setColor(playerInLobby.isReady() ? Color.GREEN : Color.RED);\n playerStatus.setText(playerInLobby.getUsername());\n playerInLobby.clearPropertyChangeListeners();\n this.addPropertyChangeListener(playerInLobby, new PropertyChangeListener() {\n @Override\n public void propertyChange(PropertyChangeEvent evt) {\n String propertyName = evt.getPropertyName();\n if (propertyName.equals(\"username\")) {\n playerStatus.setText((String) evt.getNewValue());\n } else if (propertyName.equals(\"ready\")) {\n playerStatus.setColor((boolean) evt.getNewValue() ? Color.GREEN : Color.RED);\n }\n }\n });\n if (i >= 1 && this.host) {\n TextButton kickButton = kickButtons[i - 1];\n kickButton.clearListeners();\n kickButton.addListener(new ClickListener() {\n @Override\n public void clicked(InputEvent e, float x, float y) {\n Connection connection = ConnectionManager.getInstance().getConnection();\n if (connection instanceof ServerConnection) {\n UUID playerUUID = playerInLobby.getPlayerUUID();\n ServerSenderReceiver client = ((ServerConnection) connection).getClientByUUID(playerUUID);\n if (client != null) {\n connection.sendPacket(new KickPlayerPacket(playerUUID));\n ((ServerConnection) connection).removeClient(client);\n connection.getPlayer().getLobby().removePlayer(client.getPlayer());\n }\n }\n }\n });\n kickButton.setDisabled(false);\n }\n }\n for (int j = i; j < this.playersStatus.length; j++) {\n final TextField playerStatus = this.playersStatus[j];\n playerStatus.setColor(Color.RED);\n playerStatus.setText(\"\");\n if (j >= 1 && this.host) {\n TextButton kickButton = kickButtons[j - 1];\n kickButton.clearListeners();\n kickButton.setDisabled(true);\n }\n }\n }", "public void updatePlayers(ArrayList<PlayerDeck> decks)\n\t{\n\t\tplayers = decks;\n\t\trepaint();\n\t}", "public void update(){\r\n\t\tupdateTurnLabel();\r\n\t\tupdateCanvas();\r\n\t}", "void updateView () {\n updateScore();\n board.clearTemp();\n drawGhostToBoard();\n drawCurrentToTemp();\n view.setBlocks(board.getCombined());\n view.repaint();\n }", "public void showLobby(ArrayList<String> players) throws IOException {\n String firstOpponentUsername = null, secondOpponentUsername;\n lobbyPane= FXMLLoader.load(Objects.requireNonNull(GodsController.class.getClassLoader().getResource(\"Fxml/Lobby.fxml\")));\n borderPane=(BorderPane) lobbyPane.getChildren().get(1);\n exitButton=(ImageView) borderPane.getBottom();\n playerStackPane=(StackPane) borderPane.getLeft();\n playerUsernameLabel=(Label) playerStackPane.getChildren().get(2);\n opponentsVBox=(VBox) borderPane.getRight();\n firstOpponentPane=(StackPane) opponentsVBox.getChildren().get(0);\n secondOpponentPane=(StackPane) opponentsVBox.getChildren().get(1);\n firstOpponentLabel=(Label) firstOpponentPane.getChildren().get(2);\n secondOpponentLabel=(Label) secondOpponentPane.getChildren().get(2);\n if(Client.getNumPlayers()==2) opponentsVBox.getChildren().remove(1);\n playerUsernameLabel.setText(Client.getUsername());\n for(String username :players ){\n if(!Client.getUsername().equals(username)) {\n if(firstOpponentUsername==null) {\n firstOpponentLabel.setText(firstOpponentUsername=username);\n }\n else secondOpponentLabel.setText(secondOpponentUsername = username);\n }\n }\n GUI.getGameStage().setScene(new Scene(lobbyPane));\n GUI.getGameStage().show();\n }", "public void updateViews() {\n\t\tif (App.isInitialized() && App.getPlayer().isPlaying()) {\r\n\t\t\tactionButton.setImageResource(R.drawable.ic_media_pause);\r\n\t\t} else {\r\n\t\t\tactionButton.setImageResource(R.drawable.ic_media_play);\r\n\t\t}\r\n\t\t\r\n\t\t// Update the seek text\r\n\t\tint seek = App.getPlayer().getSeek();\r\n\t\tint duration = App.getPlayer().getDuration();\r\n\t\tseekText.setText(Utilities.formatTime(seek));\r\n\t\tdurationText.setText(Utilities.formatTime(duration));\r\n\t\t\r\n\t\t// Update the seek progress\r\n\t\tseekBar.setMax(duration);\r\n\t\tif (autoUpdateSeek) {\r\n\t\t\tseekBar.setProgress(seek);\r\n\t\t}\r\n\t}", "void setPlayerView(View v);", "void setVisiblePlayers() {\n\n switch (team1Players) {\n\n case 6:\n\n tvt1p6.setVisibility(View.VISIBLE);\n\n spnPlayer6.setVisibility(View.VISIBLE);\n\n case 5:\n\n tvt1p5.setVisibility(View.VISIBLE);\n\n spnPlayer5.setVisibility(View.VISIBLE);\n\n case 4:\n\n tvt1p4.setVisibility(View.VISIBLE);\n\n spnPlayer4.setVisibility(View.VISIBLE);\n\n case 3:\n\n tvt1p3.setVisibility(View.VISIBLE);\n\n spnPlayer3.setVisibility(View.VISIBLE);\n\n case 2:\n\n tvt1p2.setVisibility(View.VISIBLE);\n\n spnPlayer2.setVisibility(View.VISIBLE);\n\n case 1:\n\n tvt1p1.setVisibility(View.VISIBLE);\n\n spnPlayer1.setVisibility(View.VISIBLE);\n\n break;\n\n }\n\n }", "private void setInfoPlayers() {\n\n\t\t//PLAYER 1\n\t\tlblPlayer1name.setText(players.get(0).getName());\n\t\tlblCashP1.setText(\"\" + players.get(0).getMoney());\n\t\tlblBuildP1.setText(\"\" + players.get(0).getNumberBuildings());\n\t\tlblPropP1.setText(\"\" + players.get(0).getOwnproperties().size());\n\t\tlblPosP1.setText(\"\"+ players.get(0).getPosition());\n\n\t\t//PLAYER 2\n\t\tlblPlayer2name.setText(players.get(1).getName());\n\t\tlblCashP2.setText(\"\" + players.get(1).getMoney());\n\t\tlblBuildP2.setText(\"\" + players.get(1).getNumberBuildings());\n\t\tlblPropP2.setText(\"\" + players.get(1).getOwnproperties().size());\n\t\tlblPosP2.setText(\"\"+ players.get(1).getPosition());\n\t\t\n\t\tif(players.size() > 2){\n\t\t\t//PLAYER 3\n\t\t\tlblPlayerName3.setText(players.get(2).getName());\n\t\t\tlblCashP3.setText(\"\" + players.get(2).getMoney());\n\t\t\tlblBuildP3.setText(\"\" + players.get(2).getNumberBuildings());\n\t\t\tlblPropP3.setText(\"\" + players.get(2).getOwnproperties().size());\n\t\t\tlblPosP3.setText(\"\"+ players.get(2).getPosition());\n\n\t\t\tif(players.size() > 3){\n\t\t\t\t//PLAYER 4\n\t\t\t\tlblPlayerName4.setText(players.get(3).getName());\n\t\t\t\tlblCashP4.setText(\"\" + players.get(3).getMoney());\n\t\t\t\tlblBuildP4.setText(\"\" + players.get(3).getNumberBuildings());\n\t\t\t\tlblPropP4.setText(\"\" + players.get(3).getOwnproperties().size());\n\t\t\t\tlblPosP4.setText(\"\"+ players.get(3).getPosition());\n\t\t\t}\n\t\t}\n\t\t\n\t}", "private void updateSessionListView() {\n FastLap[] temp = lapMap.values().toArray(new FastLap[lapMap.size()]);\n SessionAdapter adapter = new SessionAdapter(getApplicationContext(), temp);\n mSessionFragment.update(adapter);\n //Log.d(TAG, \"sessionListView UI updated...\");\n }", "void notifyPlayerChanged(PlayerNumber newPlayer);", "void playerPositionChanged(Player player);", "void updatePlayer(Player player);", "public void updateMatch(Match match){\n setMatch(match);\n Platform.runLater( () -> {\n firstPage.setMatch(match);\n firstPage.refreshPlayersInLobby();\n });\n if(mainPage != null) {\n Platform.runLater( () -> {\n mainPage.setMatch(match);\n senderRemoteController.setMatch(match);\n this.match = match;\n mainPage.refreshPlayersPosition();\n mainPage.refreshPoints();\n if(match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY)){\n mainPage.setFrenzyMode(true);\n mainPage.frenzyButtonBoosted();\n System.out.println(\"[FRENZY]: Started FINAL FRENZY\");\n System.out.println(\"[FRENZY]: Current Player: \"+match.getCurrentPlayer().getNickname()+ \" in status \"+match.getCurrentPlayer().getStatus().getTurnStatus());\n\n }\n if (match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY_LOWER)){\n mainPage.setFrenzyMode(true);\n mainPage.frenzyButtonLower();\n }\n });\n }\n //questo metodo viene chiamato piu volte.\n }", "public void multiPlayerChosen(){\n IP = view.ipTF.getText();\n ConnectingViewController connecting = new ConnectingViewController(this, IP);\n connecting.showView();\n this.hideView();\n }", "public void updateScoreBoard() {\n Player player1 = playerManager.getPlayer(1);\n Player player2 = playerManager.getPlayer(2);\n MainActivity mainActivity = (MainActivity) this.getContext();\n\n mainActivity.updateScoreBoard(player1, player2);\n }", "public Connect4View() {\n\t\tgame = new TilePane();\n\t\tcontroller = new SingleController(game);\n\t\tcontroller.getModel().addObserver(this);\n\t\tgameFinished = false;\n\t}", "public void refreshTablePlayer()\n {\t \n String[][] dataPlayer = new String[this.joueurs.size()][columnNamesPlayers.length];\n for (int i=0; i<this.joueurs.size(); i++) {\n \tdataPlayer[i] = this.joueurs.get(i).toArray();\n }\n this.tableJoueurs.setModel(new DefaultTableModel(dataPlayer, columnNamesPlayers) {\n @Override\n public boolean isCellEditable(int row, int column) { return false; }\n });\n }", "public void update(Player player) {\n\t\t\n\t}", "void updateView();", "void updateView();", "@FXML\n\tpublic void gridUpdate() {\n\t\tfor (int i = 0; i < gridPlayer.getChildren().size(); i++)\n\t\t\tif (gridPlayer.getChildren().get(i).getClass() == st.getClass())\n\t\t\t\t((Text) (gridPlayer.getChildren().get(i))).setText(\"\");\n\n\t\tTournament current = Tournament.getInstance();\n\t\tTeam t = current.getTeams()[current.getMyTeamId()];\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t\tText playerName = new Text(t.getPlayers().get(i).getName());\n\t\t\tText overall = new Text(t.getPlayers().get(i).getOverall() + \"\");\n\t\t\tText nation = new Text(t.getPlayers().get(i).getNationality());\n\t\t\tText value = new Text(t.getPlayers().get(i).getValue() / 1000000 + \"m €\");\n\n\t\t\tif (i < 11) {\n\t\t\t\toverall.setStyle(\"-fx-font-weight: bold\");\n\t\t\t\tplayerName.setStyle(\"-fx-font-weight: bold\");\n\t\t\t\tnation.setStyle(\"-fx-font-weight: bold\");\n\t\t\t\tvalue.setStyle(\"-fx-font-weight: bold\");\n\t\t\t}\n\n\t\t\tFile nationImg = new File(\"img/flags/\" + nation.getText().toLowerCase().trim() + \".png\");\n\t\t\tImageView flag = new ImageView(new Image(nationImg.toURI().toString()));\n\t\t\tflag.setFitHeight(20);\n\t\t\tflag.setFitWidth(40);\n\n\t\t\tgridPlayer.add(playerName, 1, i);\n\t\t\tgridPlayer.add(overall, 2, i);\n\t\t\tgridPlayer.add(flag, 3, i);\n\t\t\tgridPlayer.add(value, 4, i);\n\t\t}\n\t}", "public void showView(){\n this.addObserver(GameView.GameViewNewGame(this));\n }", "private void updateView() {\n\t\tpbrLoading.setVisibility(View.GONE);\n\t\tif (isPlaying()) {\n\t\t\tgifVoiceLoader.setVisibility(View.VISIBLE);\n\t\t\timgPlay.setVisibility(View.GONE);\n\t\t} else {\n\t\t\tgifVoiceLoader.setVisibility(View.GONE);\n\t\t\timgPlay.setVisibility(View.VISIBLE);\n\t\t}\n\t\timgPlay.setImageResource(getPlayImageResId());\n\t\tgifVoiceLoader.setGifImageResourceID(getVoiceLoderGif());\n\t\ttxtButtonCaption.setText(getText() + \" s\");\n\n\t}", "public void updateWin(PlayerInterface p) {\n notifyWin(p);\n }", "public void playerRefresh(Player player) {\n \tclearRecentQuits();\n this.resetSeeing(player);\n if (this.isVanished(player) && !VanishPerms.canVanish(player)) {\n this.toggleVanish(player);\n }\n }", "@Override\r\n\tpublic void updateScreen() {\r\n\t\tsuper.updateScreen();\r\n\t\t_resolutionResolver = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);\r\n\t\tthis.width = _resolutionResolver.getScaledWidth();\r\n\t\tthis.height = _resolutionResolver.getScaledHeight();\r\n\r\n\t\t// Handle when the player clicked on a cell\r\n\t\tif (_selectedCell != -1) {\r\n\t\t \r\n\t\t\t// make sure we have our player or otherwise we will\r\n\t\t // not be able to set the correct position for the player\r\n\t\t\tif (HubbyUtils.getServerPlayer() != null) {\r\n\t\t\t\tint cellIndex = _startCell + _selectedCell;\r\n\t\t\t\tif (cellIndex < UltraTeleportWaypoint.getWaypointCount()) {\r\n\t\t\t\t UltraTeleportWaypoint p = UltraTeleportWaypoint.getWaypoints().get(cellIndex);\r\n\t\t\t\t double posX = p.getPos().getX();\r\n\t\t\t\t double posY = p.getPos().getY();\r\n\t\t\t\t double posZ = p.getPos().getZ();\r\n\t\t\t\t float yaw = p.getRotationY();\r\n\t\t\t\t float pitch = p.getRotationX();\r\n\r\n\t\t\t\t // Get the client world to be able to find the proper block for teleporting\r\n\t\t\t\t World world = HubbyUtils.getClientWorld();\r\n\t\t\t\t if (world != null) {\r\n\t\t\t\t while (true) {\r\n\t\t\t\t \tBlockPos pos = new BlockPos(posX, posY, posZ);\r\n\t\t\t\t if (world.isAirBlock(pos)) {\r\n\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t posY += 1.0d;\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\r\n\t\t\t\t // Update the player's location on the server and then\r\n\t\t\t\t // that will pass down to the client player and update his\r\n\t\t\t\t // position as well\r\n\t\t\t\t HubbyUtils.getServerPlayer().playerNetServerHandler.setPlayerLocation(posX, posY, posZ, yaw, pitch);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t_selectedCell = -1;\r\n\t\t}\r\n\r\n\t\t// update selected list\r\n for (int i = 0; i < UltraTeleportWaypoint.getWaypointCount(); ++i) {\r\n if (i >= _selectedList.size()) {\r\n _selectedList.add(false);\r\n }\r\n }\r\n\r\n // Only show delete button when we have something selected\r\n if (getSelectedCount() > 0) {\r\n this.buttonList.add(_deleteButton);\r\n }\r\n else {\r\n this.buttonList.clear();\r\n }\r\n\t}", "public Player updatePlayer(Player player);", "public void updateView(ClientView view);", "public void update()\n\t{\n\t\t//update the view's list of movies...\n\t\tthis.getRemoveButton().setEnabled((this.database.getNumberOfMovies()>0));\n\t\tthis.movieList.setListData(this.database.toList());\n\t}", "public void updateView(GameScreen game) {\n Vector2 playerPos = game.getCurrentPlayer().getPosition();\n\n Vector2 gameBounds = game.getBounds();\n\n Vector2 viewSize = getSize();\n\n float gWidth = gameBounds.x;\n float gHeight = gameBounds.y;\n\n float cHalfWidth = viewSize.x / 2;\n float cHalfHeight = viewSize.y / 2;\n\n if (playerPos.x > -gWidth + cHalfWidth\n && playerPos.x < gWidth - cHalfWidth) {\n pos = new Vector2(playerPos.x, pos.y);\n }\n if (playerPos.y > -gHeight + cHalfHeight\n && playerPos.y < gHeight - cHalfHeight) {\n pos = new Vector2(pos.x, playerPos.y);\n }\n view.setCenter(pos.toVector2f());\n }", "public void changePlayerPixels() {\n //change the player point2pixels\n if (!playerFlag) {\n game.getPlayer().setPixels(convertor.gps2Pixels(game.getPlayer().getPoint()));\n Point3D point = new Point3D(game.getPlayer().getPixels()[0] , game.getPlayer().getPixels()[1]);\n GraphNode playerNode = new GraphNode(point);\n vertices.add(playerNode);\n\n }\n\n else {\n Point3D point = new Point3D(game.getPlayer().getPixels()[0] , game.getPlayer().getPixels()[1]);\n GraphNode playerNode = new GraphNode(point);\n vertices.add(playerNode);\n }\n\n playerFlag = true;\n\n }", "private void updateView() {\n model.inlezenHighscore();\n for (int i = 0; i < 10; i++) {\n view.getNaamLabels(i).setText(model.getNaam(i));\n view.getScoreLabels(i).setText(model.getScores(i));\n }\n }", "private void update()\n {\n // update the grid square panels\n Component[] components = pnlIsland.getComponents();\n for ( Component c : components )\n {\n // all components in the panel are GridSquarePanels,\n // so we can safely cast\n GridSquarePanel gsp = (GridSquarePanel) c;\n gsp.update();\n }\n \n // update player information\n int[] playerValues = game.getPlayerValues();\n txtPlayerName.setText(game.getPlayerName());\n progPlayerStamina.setMaximum(playerValues[Game.MAXSTAMINA_INDEX]);\n progPlayerStamina.setValue(playerValues[Game.STAMINA_INDEX]);\n progBackpackWeight.setMaximum(playerValues[Game.MAXWEIGHT_INDEX]);\n progBackpackWeight.setValue(playerValues[Game.WEIGHT_INDEX]);\n progBackpackSize.setMaximum(playerValues[Game.MAXSIZE_INDEX]);\n progBackpackSize.setValue(playerValues[Game.SIZE_INDEX]);\n \n //Update Kiwi and Predator information\n txtKiwisCounted.setText(Integer.toString(game.getKiwiCount()) );\n txtPredatorsLeft.setText(Integer.toString(game.getPredatorsRemaining()));\n \n // update inventory list\n listInventory.setListData(game.getPlayerInventory());\n listInventory.clearSelection();\n listInventory.setToolTipText(null);\n btnUse.setEnabled(false);\n btnDrop.setEnabled(false);\n \n // update list of visible objects\n listObjects.setListData(game.getOccupantsPlayerPosition());\n listObjects.clearSelection();\n listObjects.setToolTipText(null);\n btnCollect.setEnabled(false);\n btnCount.setEnabled(false);\n \n // update movement buttons\n btnMoveNorth.setEnabled(game.isPlayerMovePossible(MoveDirection.NORTH));\n btnMoveEast.setEnabled( game.isPlayerMovePossible(MoveDirection.EAST));\n btnMoveSouth.setEnabled(game.isPlayerMovePossible(MoveDirection.SOUTH));\n btnMoveWest.setEnabled( game.isPlayerMovePossible(MoveDirection.WEST));\n }", "public void updateView() {\n if (mData.isEmpty()) {\n Logger.d(TAG, \"The mData is empty\");\n return;\n }\n Set<View> viewSet = mData.keySet(); // keySet() returns [] if map is\n // empty\n Iterator<View> viewIterator = viewSet.iterator();\n if (viewIterator == null) {\n Logger.d(TAG, \"The viewIterator is null\");\n return;\n }\n while (viewIterator.hasNext()) {\n View view = viewIterator.next();\n if (view == null) {\n Logger.d(TAG, \"The view is null\");\n } else {\n Object obj = mData.get(view);\n if (obj == null) {\n Logger.d(TAG, \"The value is null\");\n } else {\n if (obj instanceof ChatsStruct) {\n ChatsStruct chatStruct = (ChatsStruct) obj;\n updateChats(view, chatStruct);\n } else if (obj instanceof InvitationStruct) {\n InvitationStruct inviteStruct = (InvitationStruct) obj;\n updateInvitations(view, inviteStruct);\n } else {\n Logger.d(TAG, \"Unknown view type\");\n }\n }\n }\n }\n }", "void updateState() {\n String[] players = client.getPlayers();\n System.out.println(Arrays.toString(players));\n\n if(oldPlayerNum != players.length){\n oldPlayerNum = players.length;\n updateComboBox();\n }\n\n playersListModel.clear();\n\n for (int i = 0; i < players.length; i++) {\n playersListModel.add(i, players[i]);\n }\n\n // SECOND check if player holding the ball / update GUI accordingly\n String[] playerBall = client.whoIsBall();\n boolean serverSideBall = Integer.parseInt(playerBall[1]) == client.getId();\n\n if (client.hasBall != serverSideBall) { // If the server says something different\n client.hasBall = serverSideBall;\n ballState(serverSideBall, playerBall[0]);\n }\n // THIRD if you are holding the ball update gui so that ball is throwable\n\n }", "public void update()\n {\n reinit(viewer.getScene().getActors());\n\n list.invalidate();\n invalidate();\n repaint();\n }", "private void update()\n {\n\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //System.out.println(\"UPDATE\");\n updateHumanPlayerMoney();\n updateListViewDoctorItems();\n updateListViewHospitalItems();\n updateListViewLogWindow();\n updateListViewComputerPlayer();\n load_figure();\n updateComputerPlayerMoney();\n }\n });\n }", "public void updateWindow() {\n MatchDAO ma = new MatchDAO();\n ArrayList<User> u = ma.getTopFiveMostMatchedUsers();\n view.updateWindow(ma.getLastMonthMatches(), ma.getLastWeekMatches(), ma.getLastDayMatches(), u);\n }", "public void display (Player player) {\n player.setScoreboard(this.bukkitScoreboard);\n }", "List<Player> getViewers();", "public void refresh() {\n\tts = parent.globals.twitchAPI.getStream(this.getChannel());\n\tif (ts != null) {\n\t game = ts.getMeta_game();\n\t title = ts.getTitle();\n\t online = ts.isOnline();\n\t current_viewers = ts.getCurrent_viewers();\n\t created_at = ts.getCreated_At();\n\t updated_at = ts.getUpdated_At();\n\t upTimeHour = 0L;\n\t upTimeMinute = 0L;\n\n\t if (online) {\n\t\tcreated_at_Long = convertDate(created_at);\n\t\tcalcUpTime(created_at_Long);\n\t\tsetOnlineString(\"<html>Currently playing: \" + getGame()\n\t\t\t+ \"<br>(Online for: \" + getUpTimeHours() + \":\"\n\t\t\t+ getUpTimeMinutes() + \" hours) |\"\n\t\t\t+ \" Current Viewers: \" + getCurrent_viewers() + \"<br>\"\n\t\t\t+ getTitle() + \"</html>\");\n\t }\n\t preview = null;\n\t if (ts.getScreen_cap_url_medium() != null\n\t\t && parent.globals.showPreview) {\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t try {\n\t\t\tpreview = ImageIO.read(new URL(ts\n\t\t\t\t.getScreen_cap_url_medium()));\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tboolean rw = ImageIO.write(preview, \"PNG\", bos);\n\t\t\tparent.globals.downloadedBytes += bos.toByteArray().length;\n\t\t } catch (IOException e) {\n\t\t\tif (parent.globals._DEBUG)\n\t\t\t e.printStackTrace();\n\t\t }\n\t\t if (preview != null) {\n\t\t\tbreak;\n\t\t }\n\t\t}\n\t }\n\t}\n }", "public void UpdateView(){\n\t\tStageArray[CurrentStage].Update();\r\n\t\t//updateUI will activate the Draw function\r\n\t\tStageArray[CurrentStage].updateUI();\r\n\t\t//this completely refreshes totalGUI and removes and mouse listener it had\r\n\t\tif(CardMain.frame.getContentPane()!=StageArray[CurrentStage]){\r\n\t\t\tCardMain.frame.setContentPane(StageArray[CurrentStage]);\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n for (int i = 0; i < numberOfPlayers; i++) {\n addPlayer();\n controller\n .getSpf()\n .getLabel1()\n .setText(\n \"\" +\n players.get(players.size() - 1).getName() +\n \" Jugador # \" +\n (players.size() - 1)\n );\n }\n\n controller\n .getSpf()\n .getLabel1()\n .setText(\"Jugadores listos, iniciando partida\");\n\n startMatch();\n\n sendId();\n\n UpdateMatchThread umt = new UpdateMatchThread(this, 0);\n umt.start();\n\n UpdateMatchThread umt1 = new UpdateMatchThread(this, 1);\n umt1.start();\n\n UpdateServerThread upt = new UpdateServerThread(this);\n upt.start();\n }", "public void changePlayer(int index) {\n currentPlayer.setText(\"Aktueller Spieler: \" + index);\n if(index == 1){\n pointsPlayer2.setOpaque(false);\n pointsPlayer1.setBackground(Color.green);\n pointsPlayer1.setOpaque(true);\n this.repaint();\n }\n else{\n pointsPlayer1.setOpaque(false);\n pointsPlayer2.setBackground(Color.green);\n pointsPlayer2.setOpaque(true);\n this.repaint();\n }\n }", "private void updatePlayersUI() {\n LinearLayout playersList = findViewById(R.id.playersList);\n playersList.removeAllViews();\n if (invitees != null) {\n for (Invitee i: invitees) {\n View playersChunk = getLayoutInflater().inflate(R.layout.chunk_invitee, playersList, false);\n TextView inviteeEmail = playersChunk.findViewById(R.id.inviteeEmail);\n inviteeEmail.setText(i.getEmail());\n\n Spinner inviteeTeam = playersChunk.findViewById(R.id.inviteeTeam);\n Button removeButton = playersChunk.findViewById(R.id.removeInvitee);\n\n inviteeTeam.setSelection(i.getTeamId());\n\n inviteeTeam.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(final AdapterView<?> parent, final View view, final int position,\n final long id) {\n i.setTeamId(position);\n updatePlayersUI();\n }\n\n @Override\n public void onNothingSelected(final AdapterView<?> parent) {\n\n }\n });\n\n if (i.getEmail().equals(FirebaseAuth.getInstance().getCurrentUser().getEmail())) {\n removeButton.setVisibility(View.GONE);\n }\n removeButton.setOnClickListener(unused -> {\n invitees.remove(i);\n updatePlayersUI();\n });\n\n playersList.addView(playersChunk);\n }\n }\n }", "private void refreshView() {\n this.view.updateRobots();\n }", "@Override\n public void send(Gui view) {\n view.update(this);\n }", "@Override\n public void onDataAvailable(Object data) {\n try {\n\n Utility.gameName = Utility.game.getGameName();\n Log.e(\"show leader board\",\"game name ---> \" + Utility.game.getGameName());\n final List<Player> playersList = new ArrayList<Player>();\n\n\n JSONObject playersObject = new JSONObject(data.toString());\n JSONArray playersArray = playersObject.getJSONArray(\"players\");\n\n SharedPreferences useridpref = getSharedPreferences(\"userid\", MODE_PRIVATE);\n Integer userId = Integer.parseInt(useridpref.getString(\"userid\", \"0\"));\n\n for (int i = 0; i < playersArray.length(); i++) {\n Player player = new Player();\n player.jsonParser((JSONObject) playersArray.get(i));\n\n playersList.add(player);\n\n\n if (userId == (player.getUserId())) {\n\n setGamePoints(player.getGamepoints() + \"\");\n setUserNoOfPlays(player.getNoOfPlays() + \"\");\n //updating user lastgame details\n userObject.setLastGameCreator(Creator.getUserName());\n userObject.setUserRank(player.getWorldRank() + \"\");\n userObject.setLastGameName(Utility.game.getGameName());\n userObject.setLastGamePoints(player.getTotalPoints() + \"\");\n userObject.setLastGamePlays((Utility.game.getLength()) + \"\");\n\n Log.e(\"user game length\",userObject.getLastGamePlays()+\"\");\n Log.e(\"user plays left\",userObject.getTotalNoOfPlays()+\"\");\n Log.e(\"user plays game name\",userObject.getLastGameName()+\"\");\n\n\n// updating current player info\n currentGamePoints = player.getPointsRank();\n\n }\n }\n\n final List<Player> playersListtemp = playersList;\n // playersList;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n\n //stuff that updates leaderboard\n PlayByPlay playByPlay = new PlayByPlay();\n gameleaderboardList.setAdapter(new GameScreenLeaderBoardList(GameScreenActivity.this, playersListtemp));\n gameleaderboardList.setDividerHeight(1);\n currentPlayerName.setText(Utility.user.getUserName());\n currentPlayerPoints.setText(getGamePoints());\n playerListSize.setText(\"(\" + playersList.size() + \")\");\n gsUserRank.setText(\"#\" + userObject.getUserRank());\n\n noOfPlaysInHeader.setText(getUserNoOfPlays() + \"\");\n noOfPlaysInAddPlays.setText(\"Balance: \" + getUserNoOfPlays() + \" plays\");\n\n }\n });\n\n\n\n\n } catch (Exception e) {\n // TODO Auto-generated catch block\n // Toast.makeText(getApplicationContext(),\"error data \" + data.toString(),Toast.LENGTH_LONG).show();\n\n\n e.printStackTrace();\n }\n\n }", "@Override\n public void update(App_Risk_Game.src.interfaces.Observable observable) {\n List<String> territories = new ArrayList<>();\n Iterator iterator = ((Board)observable).getTiles().keySet().iterator();\n while (iterator.hasNext()){\n String name = (String) iterator.next();\n territories.add(name);\n }\n CardsCollection cardsCollection = new CardsCollection(territories, 5);\n List<Player> players = PlayerCollectionTest.players;\n CardsCollection.distributeCards(players);\n for (Player p:players\n ) {\n System.out.println(p.getName());\n\n System.out.println(p.getTerritories());\n }\n Turns.turns.setCurrentPlayerID(players.get(0).getId());\n Turns.turns.setCurrent_player(players.get(0).getName());\n }", "public void setPlayer(Player p){\r\n playerModel=p; \r\n jEnemigoDatos.setText(p.getEnemy().getName());\r\n /*if(p.getBadConsequence()==null)\r\n jMalRolloDatos.setText(\"No\");\r\n else\r\n jMalRolloDatos.setText(\"Si\");*/\r\n if(p.isDead())\r\n jMuertoDatos.setText(\"Si\");\r\n else\r\n jMuertoDatos.setText(\"No\");\r\n \r\n jNivelDatos.setText(p.getLevels()+\"\");\r\n jCombatLevelDatos.setText(p.getCombatLevel()+\"\");\r\n jNombreDatos.setText(p.getName());\r\n if(p.canISteal())\r\n jRobarDatos.setText(\"Si\");\r\n else\r\n jRobarDatos.setText(\"No\");\r\n \r\n jNSectDatos.setText(Integer.toString(CultistPlayer.getTotalCultistPlayer()));\r\n \r\n if(playerModel.getClass() == CultistPlayer.class){\r\n jSectarioDatos.setText(\"Si\");\r\n //String text=(CultistPlayer)playerModel.getMyCultist().getGainedLevels()+\"\";\r\n //jSectarioDatos.setText(\"\"+(CultistPlayer)playerModel.getGainedLevels());\r\n \r\n }else\r\n jSectarioDatos.setText(\"No\");\r\n \r\n /*if(playerModel.getBadConsequence().isEmpty())\r\n pendingBadView1.setVisiblePending(false);\r\n else*/\r\n pendingBadView1.setVisiblePending(true);\r\n pendingBadView1.limpiar();\r\n \r\n // A continuación se actualizan sus tesoros \r\n fillTreasurePanel (jpVisibles, playerModel.getVisibleTreasures()); \r\n fillTreasurePanel (jpOcultos, playerModel.getHiddenTreasures()); \r\n btRobar.setEnabled(playerModel.canISteal());\r\n manejarBotones(true);\r\n repaint(); \r\n revalidate();\r\n }", "public void update()\r\n {\n for (MapObject mo : gameData.getMap().getObjects())\r\n {\r\n mo.getAI().advance();\r\n }\r\n \r\n // update the UI\r\n for (UIElement uiEl : ui.getUIElements())\r\n {\r\n uiEl.update();\r\n }\r\n\r\n // Move the map objects\r\n movHandler.moveObjects();\r\n\r\n // Refresh the screen position\r\n Player player = gameData.getPlayer();\r\n this.centerScreen((int) player.getX() + Tile.TILESIZE / 2, (int) player.getY() + Tile.TILESIZE / 2);\r\n }", "public void setPlayerView(PlayerView playerView) {\n this.playerView = playerView;\n }", "@Override\n public void makeVisible(Player viewer) {\n \n }", "private void updateView(){\n \n camera.updateView();\n }", "@Override\n\tpublic void start() \n\t{\n\t\tServerPoller.getServerPoller().setObserver(this);\n\t\tList<Game> gamelist = Reference.GET_SINGLETON().proxy.getGameList();\n\t\tGameInfo[] games = new GameInfo[gamelist.size()];\n\t\tint counter = 0;\n\t\tfor(Game game: gamelist)\n\t\t{\n\t\t\tGameInfo thisgame = new GameInfo();\n\t\t\tthisgame.setId(game.getId());\n\t\t\tthisgame.setTitle(game.getTitle());\n\t\t\tfor(Player player : game.getPlayers())\n\t\t\t{\n\t\t\t\tPlayerInfo player_info = new PlayerInfo(player);\n\t\t\t\tplayer_info.setColor(player.getColor());\n\t\t\t\tif(!(player.color == null))thisgame.addPlayer(player_info);\n\t\t\t}\n\t\t\tgames[counter] = thisgame;\n\t\t\tcounter++;\n\t\t}\n\n\t\tif (Reference.GET_SINGLETON().getPlayer_color() != null) return;\n\t\tif (!hasChanged(games, oldGames)) return;\n\t\toldGames = games;\n\t\t\n\t\tReference ref = Reference.GET_SINGLETON();\n\t\t\n\t\tPlayerInfo ourguy = new PlayerInfo();\n\t\t\n\t\tourguy.setId(ref.player_id);\n\t\tourguy.setName(ref.name);\n\t\t\n\t\tgetJoinGameView().setGames(games, ourguy);\n\n\t\tif (getJoinGameView().isModalShowing()) getJoinGameView().closeModal();\n\t\tif(!getJoinGameView().isModalShowing())\n\t\t{\n\t\t\tgetJoinGameView().showModal();\n\t\t}\n\t}", "private void renderPlayers() {\n\t\tfor (Player player : this.game.players()) {\n\t\t\t/* So, logically convluted crap ahead.\n\t\t\t * Player position is tracked via a 1-based coordinate system.\n\t\t\t * Our output array is 0-based.\n\t\t\t * Our output array contains an additional row/column on each side for the wall.\n\t\t\t *\n\t\t\t * Hence, when mapping the player's position to an\n\t\t\t * index in the output array, we have to subtract one\n\t\t\t * to switch from 1-basedness to 0-basedness, then add\n\t\t\t * 1 to accomodate for the wall column/row. Which\n\t\t\t * leaves us with a difference of 0. */\n\t\t\tthis.output[player.position().y][player.position().x] = player.sign();\n\t\t}\n\t}", "void updateScreen() {\n\t\tZone possibleNewZone = currentZone.getSpace(playerY, playerX).getNextZone();\n\t\tif (possibleNewZone != null) {\n\t\t\tString oldBGMusic = currentZone.getBackgroundMusic();\n\t\t\tcurrentZone = possibleNewZone;\n\t\t\tcurrentZone.enableZoneWarpSpaces();\n\t\t\tplayerX = currentZone.getPlayerStartX();\n\t\t\tplayerY = currentZone.getPlayerStartY();\n\t\t\t\n\n\t\t\tif (!oldBGMusic.equals(currentZone.getBackgroundMusic())) {\n\t\t\t\tmusicPlayer.stop();\n\t\t\t\tmusicPlayer.play(currentZone.getBackgroundMusic(), 100);\n\t\t\t}\n\t\t}\n\n\t\t// Update Panel Colors\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\t\t\t\tpanels[i][a].setBackground(currentZone.getSpace(i, a).getColor());\n\t\t\t}\n\t\t}\n\n\t\t// Update Labels\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tfor (int a = 0; a < 10; a++) {\n\n\t\t\t\tlabels[i][a].setIcon(currentZone.getSpace(i, a).getPic());\n\t\t\t}\n\t\t}\n\t\t// Shows player in the new space\n\t\tlabels[playerY][playerX].setIcon(playerPic);\n\n\t\t// Shows enemy in the new space\n\t\t// labels[enemyY][enemyX].setIcon(enemyPic);\n\t}", "public void onUpdatedPlaylist() {\n setCurrentTrack();\n //this was implemented so this device could have a view of the playlist\n }", "private void refreshHomePanel() {\n // Set Player Name Text\n view.getHomePanel().getNameLabel().setText(model.getPlayer().getFullname().toUpperCase());\n\n // Update Highscore Table\n view.getHomePanel().getTableModel().setRowCount(0);\n updateHighscores(model.getHighscores());\n }", "private void broadcast() {\n for (int key : bootstrapMap.keySet()) {\n bootstrapMap.get(key).getBroadcastView().show(Colors.BLUE + gameService.getCurrentPlayer().getName() + Colors.NOCOLOR, lastAnswer);\n }\n gameService.upDateCurrentPlayer();\n }", "public void updateConicalView();", "@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String numReady = dataSnapshot.child(\"numReady\").getValue().toString();\n int numPlayers = Integer.parseInt(dataSnapshot.child(\"numPlayers\").getValue().toString());\n TextView playersReadyTextView = (TextView) findViewById(R.id.playersReadyTextView);\n playersReadyTextView.setText(numReady + \" / \" + String.valueOf(numPlayers));\n\n\n\n String status = dataSnapshot.child(\"players/\" + id + \"/status\").getValue().toString();\n RelativeLayout yourTargetLayout = (RelativeLayout) findViewById(R.id.yourTargetLayout);\n\n switch (status){\n case \"0\": // Waiting\n readyBar.setVisibility(View.VISIBLE);\n playersReadyView.setVisibility(View.VISIBLE);\n break;\n case \"1\": // Ready\n break;\n case \"3\": // Dead\n yourTargetLayout.setVisibility(View.GONE);\n break;\n default: // Alive\n targetID = dataSnapshot.child(\"players/\" + id + \"/target\").getValue().toString();\n String targetName = dataSnapshot.child(\"players/\" + targetID + \"/name\").getValue().toString();\n\n // If you are your own target, you've won the game.\n if (!id.equals(targetID)) {\n yourTargetLayout.setVisibility(View.VISIBLE);\n targetTextView.setText(targetName);\n }\n\n\n int numDead = Integer.parseInt(dataSnapshot.child(\"numDead\").getValue().toString());\n String numAlive = String.valueOf(numPlayers - numDead);\n\n playersInGameTextView.setText(numAlive + \" / \" + String.valueOf(numPlayers));\n }\n\n // Get every player in game\n final List<String> playerList = new ArrayList<String>();\n final List<Integer> playerStatusList = new ArrayList<Integer>();\n\n for (DataSnapshot child : dataSnapshot.child(\"players\").getChildren()) {\n playerList.add(String.valueOf(child.child(\"name\").getValue()));\n playerStatusList.add(Integer.parseInt(child.child(\"status\").getValue().toString()));\n }\n\n ListView playerListView = (ListView) findViewById(R.id.list_players);\n\n ArrayAdapter<String> adapter = new ArrayAdapter<String>(\n context,\n R.layout.list_item_players,\n android.R.id.text1,\n playerList\n ) {\n @Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View view = super.getView(position, convertView, parent);\n\n TextView text1 = (TextView) view.findViewById(android.R.id.text1);\n TextView text2 = (TextView) view.findViewById(android.R.id.text2);\n\n text1.setText(playerList.get(position));\n switch (playerStatusList.get(position)) { // set status text and color\n case 0: // waiting\n text2.setText(\"waiting\");\n break;\n case 1: // ready\n text2.setText(\"ready\");\n text2.setTextColor(Color.BLUE);\n break;\n case 2: // alive\n text2.setText(\"alive\");\n text2.setTextColor(Color.GREEN);\n break;\n case 3: // dead\n text2.setText(\"dead\");\n text2.setTextColor(Color.RED);\n break;\n case 4: // winner\n text2.setText(\"winner\");\n text2.setTextColor(Color.GREEN);\n break;\n }\n return view;\n }\n };\n\n playerListView.setAdapter(adapter);\n }", "public void onPlayerLoggedIn() {\n\t\tshowPlayerButtons();\n\t}", "public void gameupdate(){\n game.update();\r\n panel.formUpdate(game.lives);\r\n }", "private void refreshPlayerList() {\n List<MarketItem> items = new ArrayList<>();\n EntityRef player = localPlayer.getCharacterEntity();\n for (int i = 0; i < inventoryManager.getNumSlots(player); i++) {\n EntityRef entity = inventoryManager.getItemInSlot(player, i);\n\n if (entity.getParentPrefab() != null) {\n MarketItem item;\n\n if (entity.hasComponent(BlockItemComponent.class)) {\n String itemName = entity.getComponent(BlockItemComponent.class).blockFamily.getURI().toString();\n item = marketItemRegistry.get(itemName, 1);\n } else {\n item = marketItemRegistry.get(entity.getParentPrefab().getName(), 1);\n }\n\n items.add(item);\n }\n }\n\n tradingScreen.setPlayerItems(items);\n }", "@Override\n\tpublic void updatePlayer(Joueur joueur) {\n\t\t\n\t}", "public void updateInventory(ArrayList<Player> players) {\n inventoryArea.selectAll();\n inventoryArea.replaceSelection(\"\");\n for(Player p : players) {\n inventoryArea.append(\"\\n\" + p.toString());\n inventoryArea.setCaretPosition(inventoryArea.getDocument().getLength());\n\n }\n }", "public void displayWin()\n {\n if(player1 instanceof GameController){\n player1.gameOver(1);\n } else {\n player2.gameOver(1);\n }\n }", "public void singlePlayerChosen(){\n DifficultyViewController dif = new DifficultyViewController(this);\n dif.showView();\n this.hideView();\n }", "public void reconnectPlayers(List<String> playerIds){\n System.out.println(playerIds);\n reconnectedPlayersController.updateReconnectedPlayers(playerIds);\n reconnectedPlayersPane.setVisible(true);\n PauseTransition delay = new PauseTransition(Duration.seconds(4));\n delay.setOnFinished( event -> reconnectedPlayersPane.setVisible(false) );\n delay.play();\n }", "public abstract Scoreboard update(Player player);", "public PlayerView getPlayerView() {\n return playerView;\n }", "@Override\n\tpublic void update() {\n\n\t\ttimer++;\n\t\tupdatePlayer();\n\t\tupdateScreen();\n\t\tupdateLives();\n\n\t}", "public void playTheGame() {\n\t\tint column;\n\t\ttry {\n\t\t\tboolean gameIsOver = false;\n\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\taConnect4Field.toString());\n\n\t\t\tdo {\n\t\t\t\tfor (int index = 0; index < thePlayers.length; index++) {\n\t\t\t\t\t// thePlayers[index].getView().showOutput(aConnect4Field.toString());\n\t\t\t\t\tif (aConnect4Field.isItaDraw()) {\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\"Draw\");\n\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\tthePlayers[index].getName()\n\t\t\t\t\t\t\t\t\t\t+ \" it's Your Turn! play your move\");\n\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\twhile (!aConnect4Field\n\t\t\t\t\t\t\t\t.checkIfPiecedCanBeDroppedIn(column)) {\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\"Invalid Turn Try again\");\n\t\t\t\t\t\t\tcolumn = thePlayers[index].nextMove();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taConnect4Field.dropPieces(column,\n\t\t\t\t\t\t\t\tthePlayers[index].getGamePiece());\n\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.toString());\n\t\t\t\t\t\tif (aConnect4Field.error != \"\") {\n\n\t\t\t\t\t\t\tthePlayers[index].getView().showOutput(\n\t\t\t\t\t\t\t\t\taConnect4Field.error);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (aConnect4Field.didLastMoveWin()) {\n\t\t\t\t\t\t\t\tgameIsOver = true;\n\t\t\t\t\t\t\t\t// all player get to know\n\t\t\t\t\t\t\t\tfor (int count = 0; count < thePlayers.length; count++)\n\t\t\t\t\t\t\t\t\tthePlayers[count].getView().showOutput(\n\t\t\t\t\t\t\t\t\t\t\t\"The winner is: \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ thePlayers[index]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getName());\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} while (!gameIsOver);\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public void displayDetails(List<String> players, int np, int rID) {\n Platform.runLater(() -> {\n roomID.setText(\"Rood ID: \" + rID);\n playerNumber.setText(\"Players: \" + players.size() + \"/\" + np);\n playerList.getChildren().clear();\n for (String username : players) {\n Text usernameText = new Text(username);\n usernameText.getStyleClass().add(\"light-text\");\n playerList.getChildren().add(usernameText);\n }\n });\n }", "public void attachPlayerView() {\n simpleExoPlayerView.setPlayer(player);\n }", "public void update() {\n\n\t\tdisplay();\n\t}", "private void broadcast(ArrayList<Integer> update){\n for (Player p : players.values()){\n p.sendModel(update);\n }\n }", "public void getPlayerList() {\n if (connected == true) {\n try {\n write(\"get playerlist\");\n } catch (IOException e) {\n System.out.println(\"No connecting with server:ServerCommunication:getPlayerList()\");\n }\n }\n }", "@Override\n\t\t\tpublic void run() \n\t\t\t{\n\t\t\t\tsummaryPanel.updatePlayerStatus(player.getPlayerId());\n\t\t\t}", "private void handlePlayerConnect(Player player) {\n server.runTaskLater(() -> server.getPaymentLog().checkPendingAccepts(player), 1500, TimeUnit.MILLISECONDS);\n\n if (player.hasPermission(Rank.ADMIN)) {\n server.runTaskLater(() -> server.getDataSource().getCollection(\"archon\", \"dailytop\").count((result, t) -> {\n if (result == null) {\n result = 0L;\n }\n\n List<String> msg = new ArrayList<>();\n msg.add(\"&8\" + Message.BAR);\n msg.add(\"&6[&c&lArchon&6] &aProxy \" + player.getProxy().getId() + \" &7[\" + player.getRegion().name() + \" Network]\");\n msg.add(\"\");\n msg.add(\"&e[Today]\");\n int mostOnlineToday = server.getCache().getCurrentMostOnline();\n int uniqueLoginsToday = (int) (long) result;\n int newPlayersToday = server.getCache().getCurrentNewPlayers();\n\n try (Connection conn = server.getDataSource().getConnection();\n Statement stmt = conn.createStatement()) {\n // 1-day stats\n try (ResultSet rs = stmt.executeQuery(\"SELECT most_online, unique_logins, new_players FROM dailytop WHERE date = (SELECT MAX(date) FROM dailytop)\")) {\n if (rs.next()) {\n int mostOnlineYesterday = rs.getInt(\"most_online\");\n int uniqueLoginsYesterday = rs.getInt(\"unique_logins\");\n int newPlayersYesterday = rs.getInt(\"new_players\");\n\n double mostOnlineChange = Util.getPercentageChange(mostOnlineYesterday, mostOnlineToday);\n String disp = (mostOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(mostOnlineChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6Most Online: &d\" + Util.addCommas(mostOnlineToday) + \" \" + disp);\n\n double uniqueLoginsChange = Util.getPercentageChange(uniqueLoginsYesterday, uniqueLoginsToday);\n disp = (uniqueLoginsChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(uniqueLoginsChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6Unique Logins: &d\" + Util.addCommas(uniqueLoginsToday) + \" \" + disp);\n\n double newPlayersChange = Util.getPercentageChange(newPlayersYesterday, newPlayersToday);\n disp = (newPlayersChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(newPlayersChange) + \"% &7from yesterday)\";\n msg.add(\"&7* &6New Players: &d\" + Util.addCommas(newPlayersToday) + \" \" + disp);\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n ZonedDateTime time = ZonedDateTime.now(ZoneId.of(\"America/Los_Angeles\"));\n msg.add(\"&e[From yesterday at this hour: \" + time.format(DateTimeFormatter.ofPattern(\"h a\")) + \" \" + time.getZone().getDisplayName(TextStyle.FULL, Locale.ENGLISH) + \"]\");\n // prev day (same hour) stats\n try (ResultSet rs = stmt.executeQuery(\"SELECT online, most_online, unique_logins, new_players FROM daily_stats WHERE DATE(time) = DATE(SUBDATE(UTC_TIMESTAMP, 1)) && HOUR(time) = HOUR(UTC_TIMESTAMP) LIMIT 1;\")) {\n if (rs.next()) {\n int onlineYesterday = rs.getInt(\"online\");\n int mostOnlineYesterday = rs.getInt(\"most_online\");\n int uniqueLoginsYesterday = rs.getInt(\"unique_logins\");\n int newPlayersYesterday = rs.getInt(\"new_players\");\n\n double currentOnlineChange = Util.getPercentageChange(onlineYesterday, server.getOnlineCount());\n String disp = (currentOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(currentOnlineChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Online: &b\" + Util.addCommas(onlineYesterday) + \" \" + disp);\n\n double mostOnlineChange = Util.getPercentageChange(mostOnlineYesterday, mostOnlineToday);\n disp = (mostOnlineChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(mostOnlineChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Most Online: &b\" + Util.addCommas(mostOnlineYesterday) + \" \" + disp);\n\n double uniqueLoginsChange = Util.getPercentageChange(uniqueLoginsYesterday, uniqueLoginsToday);\n disp = (uniqueLoginsChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(uniqueLoginsChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3Unique Logins: &b\" + Util.addCommas(uniqueLoginsYesterday) + \" \" + disp);\n\n double newPlayersChange = Util.getPercentageChange(newPlayersYesterday, newPlayersToday);\n disp = (newPlayersChange < 0 ? \"&7(&c\" : \"&7(&a+\") + format.format(newPlayersChange) + \"% &7from yesterday at this hour)\";\n msg.add(\"&7* &3New Players: &b\" + Util.addCommas(newPlayersYesterday) + \" \" + disp);\n } else {\n msg.add(\"&7&oNo data to display from this time.\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n msg.add(\"&8\" + Message.BAR);\n\n try (ResultSet rs = stmt.executeQuery(\"SELECT (SELECT COUNT(*) FROM votes) AS total, COUNT(*) AS today FROM votes WHERE DATE(time) = CURDATE();\")) {\n if (rs.next()) {\n msg.add(\"&aVotes Today: &7\" + Util.addCommas(rs.getInt(\"today\"))\n + \"&a, Total Votes: &7\" + Util.addCommas(rs.getInt(\"total\")) + \" (\" + Util.humanReadableNumber(rs.getInt(\"total\")) + \")\");\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n player.message(msg);\n }), 1, TimeUnit.SECONDS);\n }\n }", "@Override\n public void playerAttributeChange() {\n\n Logger.info(\"HUD Presenter: playerAttributeChange\");\n view.setLives(String.valueOf(player.getLives()));\n view.setMoney(String.valueOf(player.getMoney()));\n setWaveCount();\n }", "@Override\n public void run() {\n PlayByPlay playByPlay = new PlayByPlay();\n gameleaderboardList.setAdapter(new GameScreenLeaderBoardList(GameScreenActivity.this, playersListtemp));\n gameleaderboardList.setDividerHeight(1);\n currentPlayerName.setText(Utility.user.getUserName());\n currentPlayerPoints.setText(getGamePoints());\n playerListSize.setText(\"(\" + playersList.size() + \")\");\n gsUserRank.setText(\"#\" + userObject.getUserRank());\n\n noOfPlaysInHeader.setText(getUserNoOfPlays() + \"\");\n noOfPlaysInAddPlays.setText(\"Balance: \" + getUserNoOfPlays() + \" plays\");\n\n }", "abstract void updatePlayer();" ]
[ "0.74531734", "0.72903705", "0.70533", "0.70111305", "0.70060056", "0.69831795", "0.6920378", "0.6842198", "0.6818179", "0.6711089", "0.6692111", "0.6620196", "0.6618237", "0.6435448", "0.6414977", "0.64026064", "0.63928425", "0.6374145", "0.6367156", "0.63645107", "0.6347121", "0.6325929", "0.6311317", "0.6309088", "0.63037765", "0.62579787", "0.62471414", "0.62187624", "0.6211934", "0.61609", "0.614571", "0.613553", "0.61295885", "0.60912216", "0.6079369", "0.6079369", "0.60790604", "0.6076053", "0.6070574", "0.6062339", "0.6056668", "0.6047384", "0.60278887", "0.6016677", "0.60146296", "0.6005819", "0.6000731", "0.5988346", "0.5979228", "0.5972621", "0.5957296", "0.5957112", "0.5955688", "0.59531945", "0.5950015", "0.59323364", "0.59187615", "0.591613", "0.5900954", "0.58972657", "0.58886653", "0.58710396", "0.58572286", "0.5850696", "0.583851", "0.5821641", "0.5816772", "0.5809681", "0.58084023", "0.5807178", "0.57883", "0.578777", "0.5784483", "0.5783822", "0.5782189", "0.57755226", "0.5769391", "0.57656056", "0.57586", "0.57553405", "0.57397294", "0.5737668", "0.57348216", "0.57340974", "0.5732445", "0.5732145", "0.5730108", "0.5713271", "0.57122886", "0.57105416", "0.56980973", "0.5696855", "0.5694675", "0.5694379", "0.5692218", "0.5689492", "0.56803465", "0.56797034", "0.56770533", "0.5673149" ]
0.744819
1
The server calls automatically this method when a client can pay a cost with a powerUp
public void askForPowerUpAsAmmo() { mainPage.setRemoteController(senderRemoteController); mainPage.setMatch(match); if (!mainPage.isPowerUpAsAmmoActive()) { //check if there is a PowerUpAsAmmo already active Platform.runLater( () -> { try { mainPage.askForPowerUpAsAmmo(); } catch (Exception e) { e.printStackTrace(); } } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void autoPay() {}", "@Override\n\tpublic void powerUp(int PowerId) {\n\n\t}", "@Override\r\n public void pay() {\n }", "public boolean canRequestPower();", "public void power()\r\n {\r\n powerOn = true;\r\n }", "public void priceCheck() {\n\t\tnew WLPriceCheck().execute(\"\");\n\t}", "@Override\r\n\tpublic void payCheck() {\n\t\t\r\n\t}", "public void payCharge()\r\n\t{\r\n\t\tSystem.out.print(\"This method is used for pay charge\");\t\r\n\t}", "void powerOn();", "CarPaymentMethod processHotDollars();", "public void buyFuelGainMultiply() {\n this.fuelGainMultiply++;\n }", "public abstract int getCostToUpgrade();", "private final void maintain(){\n\t\tif(host.getStrength()>MAINTENANCE_COST){\n\t\t\thost.expend(MAINTENANCE_COST);\n\t\t}\n\t\telse{\n\t\t\tkill();\n\t\t}\n\t}", "@Override\n\tpublic void payCrew() {\n\t\tSystem.out.println(\"Crew paid!, You can start sailing now!\");\n\t\tgame.loading();\n\t}", "@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}", "void onDemandAsked(Vehicule newDemand);", "@Override\n\tprotected void action() {\n\t\tif(Directory.profile.removeGold(cost)){\n\t\t\t//Increment player's power by 1\n\t\t\tDirectory.profile.getPlayer().incrementPower(1);\n\t\t\t\n\t\t\tcost = Directory.profile.getPlayer().getPower() * 10;\n\t\t\tsuper.setText(\"Upgrade Power: \" + cost + \" gold\"); \n\t\t}\n\t}", "protected void onGetRatedPowerConsumptionOfHPUnitInSummertime(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}", "public void payEconomical() {\n if (this.balance >= 2.50) {\n this.balance -= 2.50;\n }\n }", "public void setPowerUp(object_type powerUp) {\n this.powerUp = powerUp;\n }", "public void handleBuyGuppyCommand() {\n if (Aquarium.money >= GUPPYPRICE) {\n guppyController.addNewEntity();\n Aquarium.money -= GUPPYPRICE;\n }\n }", "public abstract void PowerOn();", "public TransactionResponse buyXP() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tint shopstock = 0;\r\n \t\t\t\tshopstock = (int) hyperObject.getStock();\r\n \t\t\t\tif (shopstock >= amount) {\r\n \t\t\t\t\tdouble price = hyperObject.getCost(amount);\r\n \t\t\t\t\tdouble taxpaid = hyperObject.getPurchaseTax(price);\r\n \t\t\t\t\tprice = calc.twoDecimals(price + taxpaid);\r\n \t\t\t\t\tif (acc.checkFunds(price, hp.getPlayer())) {\r\n \t\t\t\t\t\tint totalxp = im.gettotalxpPoints(hp.getPlayer());\r\n \t\t\t\t\t\tint newxp = totalxp + amount;\r\n \t\t\t\t\t\tint newlvl = im.getlvlfromXP(newxp);\r\n \t\t\t\t\t\tnewxp = newxp - im.getlvlxpPoints(newlvl);\r\n \t\t\t\t\t\tfloat xpbarxp = (float) newxp / (float) im.getxpfornextLvl(newlvl);\r\n \t\t\t\t\t\thp.getPlayer().setLevel(newlvl);\r\n \t\t\t\t\t\thp.getPlayer().setExp(xpbarxp);\r\n \t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\thyperObject.setStock(shopstock - amount);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tacc.withdraw(price, hp.getPlayer());\r\n \t\t\t\t\t\tacc.depositShop(price);\r\n \t\t\t\t\t\tif (hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\")) {\r\n \t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"PURCHASE_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), calc.twoDecimals(taxpaid)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"purchase\", hp.getName(), (double) amount, calc.twoDecimals(price), calc.twoDecimals(taxpaid), playerecon, type);\r\n \t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\tnot.setNotify(hyperObject.getName(), null, playerecon);\r\n \t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.get(\"INSUFFICIENT_FUNDS\"), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"THE_SHOP_DOESNT_HAVE_ENOUGH\"), hyperObject.getName()), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_BUY_LESS_THAN_ONE\"), hyperObject.getName()), hyperObject);\r\n \t\t\t}\r\n \t\t\treturn response;\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"Transaction buyXP() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "public void checkAndExecute(){\n if(priceListener.getSecurityPrice() < buyPrice){\n executionService.buy(security, buyPrice, 100);\n // if the price < buyPrice then executionService.buy(buyquantity)\n }else if ( priceListener.getSecurityPrice() > sellPrice ) {\n executionService.sell(security, buyPrice, 100);\n }\n }", "BigInteger getPower_consumption();", "@Override\r\n public void dispenseProduct() {\r\n System.out.println(\"Insufficient funds!\");\r\n\r\n }", "public double pay()\r\n{\r\ndouble pay = hoursWorked * payRate;\r\nhoursWorked = 0;\r\nreturn pay;\r\n//IMPLEMENT THIS\r\n}", "void askBuyResources();", "public void notifyNewPower (StoredPower power) {\n UserEvent.NewPower message = new UserEvent.NewPower(this.id, power, \"\");\n notifyMe(message);\n\t}", "public void superCOPower(){\r\n SCOP = true;\r\n }", "public void buyhouse(int cost){\n\t\n}", "private void buy() {\n if (asset >= S_I.getPirce()) {\n Item item = S_I.buy();\n asset -= item.getPrice();\n S_I.setAsset(asset);\n } else {\n System.out.println(\"cannot afford\");\n }\n }", "private void onCalculatingChargingTime() {\n store.saveString(remainingTimeForBatteryToDrainOrCharge, \"Computing charging time...\");\n }", "@Override\n\tpublic void upgrade() {\n\t\tthis.power += 5;\n\t}", "public void buyHealthGainMultiply() {\n this.healthGainMultiply++;\n }", "public void power() {\r\n\t\tpowerOn = !powerOn;\r\n\t}", "private void pay() {\r\n System.out.println(\"Customer sent payment\");\r\n }", "@Override\r\n\tpublic void pay(long dateTime, float charge) {\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void mainBuyPro() {\n\t\t\t\tif (iap_is_ok && mHelper != null) {\n\t\t\t\t\t\n\t\t\t\t\t String payload = \"\";\n\t\t\t\t\t mHelper.launchPurchaseFlow(MainActivity.this, Paid_Id_VF, RC_REQUEST, mPurchaseFinishedListener);\n\t\t\t\t}else{\n\t\t\t\t}\n\t\t\t}", "protected void onGetRatedPowerConsumptionOfHPUnitInWintertime(EchoObject eoj, short tid, byte esv, EchoProperty property, boolean success) {}", "@Override\r\n\tpublic void paidBehavior() {\n\t\tSystem.out.println(\"You paid using your Vias card\");\r\n\t\t\r\n\t}", "EDataType getActivePower();", "void purchaseMade();", "public void doChangeTicketPrices();", "@Override\n public void activatePowerUp() {\n myGame.getStatusDisplay().getMyProgress().updateScoreMultiplier(SCORE_MULTIPLIED_COUNTER);\n }", "public void activatePowerup(Powerup p)\r\n\t{\r\n\t\thasPowerup = true;\r\n\t\tcurrentPowerup = p;\r\n\t}", "public void doLogicBuy() {\n\t\tif (!player.isHuman) {\n\t\t\tif (player.money > estimatedFee * 1.5) //\n\t\t\t{\n\t\t\t\tint free = (int) (player.money - estimatedFee * 1.5);\n\t\t\t\tCell c = board.getCells().get(player.position);\n\t\t\t\tif (c instanceof TradeableCell) {\n\t\t\t\t\tTradeableCell tc = (TradeableCell) c;\n\t\t\t\t\tif (tc.getOwner() == null && tc.getPrice() < free) {\n\t\t\t\t\t\ttc.buy(player);\n\t\t\t\t\t\tboard.addMessage(\"Just bought\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void buy(String security, double price, int volume) {\n\t\t\t\tSystem.out.println(\"buy is\"+price+volume);\r\n\t\t\t\t\r\n\t\t\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 }", "@Override\r\n\tpublic void uniqueOnStartInteraction() {\n\t\tif (Main.clientPlayer.getNumWood() < cost) {\r\n\t\t\tMain.clientPlayer.stopInteraction();\r\n\t\t}\r\n\r\n\t}", "public void determineWeeklyPay(){\r\n weeklyPay = commission*sales;\r\n }", "protected void handleBuy(Message m) {\n return;\n }", "@Override\n\tpublic void landedOn() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(300);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 300 dollars by landing on Bonus Square\");\n\t\tMonopolyGameController.allowCurrentPlayerToEndTurn();\n\n\t}", "@Override\n public void pay(RealPlayer realPlayer) throws DepotException {\n if (check(realPlayer)) {\n for (Map.Entry<Resource, Integer> entry : productionPowerInput.entrySet()) {\n int count = entry.getValue();\n\n\n while (count > 0 && realPlayer.getPersonalBoard().getWareHouseDepot().getSpecificResourceCount(entry.getKey().getResourceType()) > 0) {\n realPlayer.getPersonalBoard().getWareHouseDepot().removeResources(entry.getKey().getResourceType(), 1);\n count--;\n }\n while (count > 0 && realPlayer.getPersonalBoard().getSpecialDepots().getSpecificResourceCount(entry.getKey().getResourceType()) > 0) {\n realPlayer.getPersonalBoard().getSpecialDepots().removeResources(entry.getKey().getResourceType(), 1);\n count--;\n }\n while (count > 0 && realPlayer.getPersonalBoard().getStrongBoxDepot().getSpecificResourceCount(entry.getKey().getResourceType()) > 0) {\n realPlayer.getPersonalBoard().getStrongBoxDepot().removeResources(entry.getKey().getResourceType(), 1);\n count--;\n }\n }\n }\n }", "void payBills();", "public abstract double pay();", "boolean hasTxpower();", "@Override\n\tpublic int cost() {\n\t\treturn 5000;\n\t}", "public void buyFuelUpgrades()\n {\n if(play_state.getMoney() >= fuel_upgrade_cost) {\n play_state.setMoney(play_state.getMoney() - fuel_upgrade_cost);\n fuel_upgrade_cost += 100;\n play_state.getDriller().addMax_fuel(10);\n }\n }", "public void buyFuel() {\n this.fuelMod++;\n fuelMax += +750 * fuelMod;\n }", "java.lang.String getTxpower();", "@Override\r\n\tprotected void processCost() {\n\r\n\t}", "@Test\n public void buy() {\n System.out.println(client.purchase(1, 0, 1));\n }", "public void powerdown() {\n monitor.sendPowerdown();\n }", "public void pay(int cost) {\r\n\t\tmoney -= cost;\r\n\t}", "@Override\n\tpublic void tranfermoney() {\n\t\tSystem.out.println(\"hsbc tranfermoney\");\n\t}", "public void sendPowerUpdate()\n\t{\n\t\tif (!this.worldObj.isRemote)\n\t\t{\n\t\t\tPacketHandler.sendPacketToClients(ResonantInduction.PACKET_TILE.getPacket(this, SimplePacketTypes.RUNNING.name, this, this.functioning), worldObj, new Vector3(this), 64);\n\t\t}\n\t}", "@Override\r\n\tpublic void makeDeliveryFree() {\n\t\t\r\n\t}", "public void handleBuyEggCommand(){\n if(Aquarium.money >= EGGPRICE) {\n Aquarium.money -= EGGPRICE;\n Aquarium.egg++;\n }\n }", "public void addBuy() {\r\n\t\tbuys++;\r\n\t\tnotifyObservers();\r\n\t}", "@Override\n public void setPower(double power) {\n\n }", "public object_type getPowerUp() {\n return powerUp;\n }", "void onApPowerStateChange(PowerState state);", "double purchasePrice();", "public void changePowerUp(boolean powerUpQuestion)\n {\n this.currentState = ClientStateName.POWERUP;\n setChanged();\n notifyObservers(currentState);\n }", "void addEventPowerUp(DefaultPowerUp powerUp);", "@Override\r\n\tpublic void OnNotifyUpdatePower(long tempid, int power) {\n\t\tNotifyPowerUpdate(String.valueOf(tempid),power);\r\n\t}", "public void enterPayment(int coinCount, Coin coinType)\n {\n balance = balance + coinType.getValue() * coinCount;\n // your code here\n \n }", "int getBuyCurrent();", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpc.product();\n\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tpc.product();\n\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public void buySellEnergy(boolean buy, Player customer) {\n if (buy && energyQuantity == 0) {\n GameController.errorMessageBox(\"Not enough Energy in the store\");\n } else {\n if (buy) {\n if (customer.getMoney() >= energyCost) {\n energyQuantity--;\n customer.addSubMoney(-energyCost);\n customer.addSubEnergy(1);\n if (energyQuantity == 0) {\n energyCost = 25;\n } else {\n energyCost += 2;\n }\n } else {\n GameController.errorMessageBox(\"You do not have enough money for this item\");\n }\n } else {\n if (customer.getEnergy() >= 1) {\n customer.addSubMoney(energyCost - 5);\n if (energyQuantity == 0) {\n energyCost = 25;\n } else {\n energyCost -= 2;\n }\n customer.addSubEnergy(-1);\n energyQuantity++;\n } else {\n GameController.errorMessageBox(\"You do not have any of this item to sell\");\n }\n }\n }\n }", "void useGodPower(boolean use);", "public void setPowerup(Powerup p)\n\t{\n\t\titsPowerup = p;\n\t}", "private void onCalculatingDischargingTime() {\n store.saveString(remainingTimeForBatteryToDrainOrCharge, \"Computing drain time...\");\n }", "private NotifySuspendedCommandControllerPowerState() {\n\n\t}", "ch.crif_online.www.webservices.crifsoapservice.v1_00.PaymentDelay addNewPaymentDelay();", "public void getPowerUp(PowerUp powerUp) \n\t{\n\t\tswitch(powerUp.getType())\n\t\t{\n\t\t\tcase 0:\n\t\t\t\t\n\t\t\t\tif(weapon != PROTON_WEAPON)\n\t\t\t\t\tbulletPool.clear(weapon);\n\t\t\t\t\n\t\t\t\tweapon = PROTON_WEAPON;\n\t\t\t\tfireRate = 5;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 1:\n\t\t\t\t\n\t\t\t\tif(weapon != VULCAN_WEAPON)\n\t\t\t\t\tbulletPool.clear(weapon);\n\t\t\t\t\n\t\t\t\tweapon = VULCAN_WEAPON;\n\t\t\t\tfireRate = 3;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 2:\n\t\t\t\t\n\t\t\t\tif(weapon != GAMMA_WEAPON)\n\t\t\t\t\tbulletPool.clear(weapon);\n\t\t\t\t\n\t\t\t\tweapon = GAMMA_WEAPON;\n\t\t\t\tfireRate = 8;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 3:\n\t\t\t\thealth += (health+20>100)?0: 20;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 4:\n\t\t\t\t\n\t\t\t\tif(speedBoost == 0)\n\t\t\t\t\tspeedBoost = 3;\n\t\t\t\t\n\t\t\t\tspeedBoostCounter =0;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n\t\tSoundManager.getInstance().playSound(\"powerup\", false);\n\t}", "public void givePowerUp(PowerUp powerup) throws RuntimeException {\n\n if (powerUpList.size() > 2)\n throw new RuntimeException(\"This player already has 3 power up\");\n\n powerUpList.add(powerup);\n }", "@Override\r\n\tpublic void receiveSunshine() {\r\n\r\n\t\tthis.batteryToLoad.charge(0.1d);\r\n\t}", "@Override\n\tpublic double sendbid() {\n\t\treturn 0;\n\t}", "@Override\n\tpublic double sendbid() {\n\t\treturn 0;\n\t}", "public void showUpgradeButton(String cost)\r\n {\r\n \tmGUIManager.newCost(\"Upgrade Tower \" + cost + \" ZP\");\r\n Message message = new Message();\r\n message.what = GUIManager.SHOW_UPGRADE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }", "@Override\r\n public double purchaseFee(){\r\n return fee;\r\n }", "@Override\n\tvoid get_cost_per_sqarefeet() {\n\t\tcost=1800;\n\t}", "@Override\n\tpublic void powerOn() {\n\t\tSystem.out.println(\"samsongTV powerOn\");\n\n\t}", "private void promote() {\r\n //promote gives more money\r\n increment();\r\n }", "public TransactionResponse sellXP() {\r\n \t\tTransactionResponse response = new TransactionResponse(hp);\r\n \t\ttry {\r\n \t\t\tDataHandler sf = hc.getDataFunctions();\r\n \t\t\tCalculation calc = hc.getCalculation();\r\n \t\t\tAccount acc = hc.getAccount();\r\n \t\t\tLanguageFile L = hc.getLanguageFile();\r\n \t\t\tLog log = hc.getLog();\r\n \t\t\tNotification not = hc.getNotify();\r\n \t\t\tInfoSignHandler isign = hc.getInfoSignHandler();\r\n \t\t\tString playerecon = hp.getEconomy();\r\n \t\t\tif (amount > 0) {\r\n \t\t\t\tint totalxp = im.gettotalxpPoints(hp.getPlayer());\r\n \t\t\t\tif (totalxp >= amount) {\r\n \t\t\t\t\tdouble price = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\tBoolean toomuch = false;\r\n \t\t\t\t\tif (price == 3235624645000.7) {\r\n \t\t\t\t\t\ttoomuch = true;\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (!toomuch) {\r\n \t\t\t\t\t\tint maxi = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\tboolean itax;\r\n \t\t\t\t\t\tboolean stax;\r\n \t\t\t\t\t\titax = Boolean.parseBoolean(hyperObject.getInitiation());\r\n \t\t\t\t\t\tstax = Boolean.parseBoolean(hyperObject.getIsstatic());\r\n \t\t\t\t\t\tif (amount > (maxi) && !stax && itax) {\r\n \t\t\t\t\t\t\tamount = maxi;\r\n \t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t\tboolean sunlimited = hc.getYaml().getConfig().getBoolean(\"config.shop-has-unlimited-money\");\r\n \t\t\t\t\t\tif (acc.checkshopBalance(price) || sunlimited) {\r\n \t\t\t\t\t\t\tif (maxi == 0) {\r\n \t\t\t\t\t\t\t\tprice = hyperObject.getValue(amount, hp);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tint newxp = totalxp - amount;\r\n \t\t\t\t\t\t\tint newlvl = im.getlvlfromXP(newxp);\r\n \t\t\t\t\t\t\tnewxp = newxp - im.getlvlxpPoints(newlvl);\r\n \t\t\t\t\t\t\tfloat xpbarxp = (float) newxp / (float) im.getxpfornextLvl(newlvl);\r\n \t\t\t\t\t\t\thp.getPlayer().setLevel(newlvl);\r\n \t\t\t\t\t\t\thp.getPlayer().setExp(xpbarxp);\r\n \t\t\t\t\t\t\tif (!Boolean.parseBoolean(hyperObject.getIsstatic()) || !hc.getConfig().getBoolean(\"config.unlimited-stock-for-static-items\")) {\r\n \t\t\t\t\t\t\t\thyperObject.setStock(amount + hyperObject.getStock());\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tint maxi2 = hyperObject.getMaxInitial();\r\n \t\t\t\t\t\t\tif (maxi2 == 0) {\r\n \t\t\t\t\t\t\t\thyperObject.setInitiation(\"false\");\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tdouble salestax = hp.getSalesTax(price);\r\n \t\t\t\t\t\t\tacc.deposit(price - salestax, hp.getPlayer());\r\n \t\t\t\t\t\t\tacc.withdrawShop(price - salestax);\r\n \t\t\t\t\t\t\tif (sunlimited) {\r\n \t\t\t\t\t\t\t\tString globalaccount = hc.getYaml().getConfig().getString(\"config.global-shop-account\");\r\n \t\t\t\t\t\t\t\tacc.setBalance(0, globalaccount);\r\n \t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresponse.addSuccess(L.f(L.get(\"SELL_MESSAGE\"), amount, calc.twoDecimals(price), hyperObject.getName(), calc.twoDecimals(price - salestax)), calc.twoDecimals(price), hyperObject);\r\n \t\t\t\t\t\t\tresponse.setSuccessful();\r\n \t\t\t\t\t\t\tString type = \"dynamic\";\r\n \t\t\t\t\t\t\tif (Boolean.parseBoolean(hyperObject.getInitiation())) {\r\n \t\t\t\t\t\t\t\ttype = \"initial\";\r\n \t\t\t\t\t\t\t} else if (Boolean.parseBoolean(hyperObject.getIsstatic())) {\r\n \t\t\t\t\t\t\t\ttype = \"static\";\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\tlog.writeSQLLog(hp.getName(), \"sale\", hyperObject.getName(), (double) amount, calc.twoDecimals(price - salestax), calc.twoDecimals(salestax), playerecon, type);\r\n \r\n \t\t\t\t\t\t\tisign.updateSigns();\r\n \t\t\t\t\t\t\tnot.setNotify(hyperObject.getName(), null, playerecon);\r\n \t\t\t\t\t\t\tnot.sendNotification();\r\n \t\t\t\t\t\t} else {\r\n \t\t\t\t\t\t\tresponse.addFailed(L.get(\"SHOP_NOT_ENOUGH_MONEY\"), hyperObject);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t} else {\r\n \t\t\t\t\t\tresponse.addFailed(L.f(L.get(\"CURRENTLY_CANT_SELL_MORE_THAN\"), sf.getHyperObject(hyperObject.getName(), playerecon).getStock(), hyperObject.getName()), hyperObject);\r\n \t\t\t\t\t}\r\n \t\t\t\t} else {\r\n \t\t\t\t\tresponse.addFailed(L.f(L.get(\"YOU_DONT_HAVE_ENOUGH\"), hyperObject.getName()), hyperObject);\r\n \t\t\t\t}\r\n \t\t\t} else {\r\n \t\t\t\tresponse.addFailed(L.f(L.get(\"CANT_SELL_LESS_THAN_ONE\"), hyperObject.getName()), hyperObject);\r\n \t\t\t}\r\n \t\t\treturn response;\r\n \t\t} catch (Exception e) {\r\n \t\t\tString info = \"Transaction sellXP() passed values name='\" + hyperObject.getName() + \"', player='\" + hp.getName() + \"', amount='\" + amount + \"'\";\r\n \t\t\tnew HyperError(e, info);\r\n \t\t\treturn new TransactionResponse(hp);\r\n \t\t}\r\n \t}", "@Override\n\tpublic int getCostUpgrade() {\n\t\treturn costUpgrade;\n\t}", "public int getPower();", "public void calculatePayment() {}" ]
[ "0.6603676", "0.6424966", "0.62275606", "0.6205994", "0.6205522", "0.61816776", "0.6132819", "0.60813993", "0.6033265", "0.6015114", "0.60053825", "0.5940226", "0.5939105", "0.59356976", "0.5901522", "0.5887198", "0.5886524", "0.5873834", "0.58639705", "0.5848684", "0.5836537", "0.5827795", "0.5819685", "0.5818756", "0.5794112", "0.57900745", "0.5787761", "0.5781576", "0.5777154", "0.5776614", "0.57508266", "0.5746768", "0.57366335", "0.5732883", "0.5732186", "0.57196933", "0.5717249", "0.5717056", "0.5710836", "0.57052493", "0.5704895", "0.5689122", "0.56757724", "0.5673928", "0.5668409", "0.5665047", "0.5655954", "0.56533605", "0.5645065", "0.56413734", "0.56409514", "0.56345266", "0.56247306", "0.5620304", "0.5617283", "0.5601551", "0.55951905", "0.5580889", "0.55808336", "0.55774283", "0.5572727", "0.5572305", "0.55641747", "0.55471927", "0.5539727", "0.5535223", "0.55218655", "0.55032897", "0.55004114", "0.5500036", "0.54992044", "0.5498657", "0.54969937", "0.54915416", "0.5491157", "0.5490755", "0.5476339", "0.547371", "0.5467509", "0.54591423", "0.54591423", "0.54397666", "0.5438632", "0.5436415", "0.54358876", "0.5433669", "0.5429782", "0.54294425", "0.54272145", "0.54223996", "0.5417921", "0.5417921", "0.54119974", "0.5410981", "0.54001385", "0.53929645", "0.53912884", "0.5380757", "0.5378927", "0.53780955", "0.537422" ]
0.0
-1
Gets the nickname linked to this controller
public String getNickname() throws RemoteException{ return this.nickname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\n return nickname;\n }", "public String getNickname() {\r\n return nickname;\r\n }", "java.lang.String getNickname();", "public java.lang.String getNickname() {\n return localNickname;\n }", "public String getNickname();", "public String getnick() {\n return nickname;\n }", "public String getUserNickname()\n {\n if (nickName == null)\n nickName =\n provider.getInfoRetreiver().getNickName(\n provider.getAccountID().getUserID());\n\n return nickName;\n }", "public String getNick() {\n return this.session.sessionPersona().getUserName();\n }", "@java.lang.Override\n public com.google.protobuf.StringValue getNickname() {\n return nickname_ == null ? com.google.protobuf.StringValue.getDefaultInstance() : nickname_;\n }", "public java.lang.String getNickname() {\n java.lang.Object ref = nickname_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n nickname_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "@java.lang.Override\n public java.lang.String getNickname() {\n java.lang.Object ref = nickname_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n nickname_ = s;\n return s;\n }\n }", "public String getCurrentNickname() {\n return currentPlayer.getNickName();\n }", "public com.google.protobuf.StringValue getNickname() {\n if (nicknameBuilder_ == null) {\n return nickname_ == null ? com.google.protobuf.StringValue.getDefaultInstance() : nickname_;\n } else {\n return nicknameBuilder_.getMessage();\n }\n }", "public String getNickname() {\r\n return insertMode ? \"\" : stringValue(CONTACTS_NICKNAME);\r\n }", "java.lang.String getNick();", "java.lang.String getNick();", "public com.google.protobuf.ByteString getNickname() {\n return nickname_;\n }", "public com.google.protobuf.ByteString getNickname() {\n return nickname_;\n }", "@ApiModelProperty(value = \"昵称\")\n\tpublic String getNickname() {\n\t\treturn nickname;\n\t}", "public String getNickname() throws RemoteException {\n \n\treturn this.nickname;\n\t\t\t }", "public String getNickName() {\r\n return nickName;\r\n }", "com.google.protobuf.ByteString getNickname();", "public String getNickName() {\n return nickName;\n }", "public String getNickName() {\n return nickName;\n }", "public String getNickName() {\n return nickName;\n }", "public String getNickName() {\n return nickName;\n }", "public String getNickName() {\n return nickName;\n }", "public String getNickName() {\n return nickName;\n }", "public String getNick() {\r\n return nick;\r\n }", "public String getNick() {\n\t\treturn nick;\n\t}", "public String getNick() {\n\t\treturn nick;\n\t}", "public String getNick()\n\t{\n\t\treturn _nick;\n\t}", "public String getUserNick() {\r\n return userNick;\r\n }", "public String getNickName()\r\n {\r\n\treturn nickName;\r\n }", "public String getNickName()\r\n {\r\n\treturn nickName;\r\n }", "public com.google.protobuf.ByteString\n getNicknameBytes() {\n java.lang.Object ref = nickname_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n nickname_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@java.lang.Override\n public com.google.protobuf.ByteString\n getNicknameBytes() {\n java.lang.Object ref = nickname_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n nickname_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "@ApiModelProperty(value = \"The short display name of the payee as provided by the customer\")\n\n public String getNickname() {\n return nickname;\n }", "String getFromNick();", "public String getName() {\n return (String) getObject(\"username\");\n }", "public com.google.protobuf.StringValueOrBuilder getNicknameOrBuilder() {\n if (nicknameBuilder_ != null) {\n return nicknameBuilder_.getMessageOrBuilder();\n } else {\n return nickname_ == null ?\n com.google.protobuf.StringValue.getDefaultInstance() : nickname_;\n }\n }", "public String getContactNick() {\n return contactNick;\n }", "@Override\n public String returnName(){\n return this.nickName;\n }", "public String getName() {\n\t\treturn this.username;\n\t}", "@java.lang.Override\n public com.google.protobuf.StringValueOrBuilder getNicknameOrBuilder() {\n return getNickname();\n }", "public String getName() {\r\n\t\treturn username;\r\n\t}", "public String getName() {\n\t\t\n\t\tString name = \"\";\n\t\t\n\t\tif (securityContext != null) {\n\t\t\tname = securityContext.getIdToken().getPreferredUsername();\n\t\t}\n\t\t\n\t\treturn name;\n\t}", "public String getLoggedPlayerName() {\r\n return ctrlDomain.getLoggedPlayerName();\r\n }", "public String getName() {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE,\n\t\t\t\tContext.MODE_PRIVATE);\n\t\treturn settings.getString(USERNAME_KEY, null);\n\t}", "public static String getUserDisplayName() {\r\n return getUsername();\r\n }", "com.google.protobuf.ByteString\n getNicknameBytes();", "public String getNickUsuario() {\r\n return nickUsuario;\r\n }", "@ApiModelProperty(value = \"Optional display name for the plan provided by the customer to help differentiate multiple plans\")\n public String getNickname() {\n return nickname;\n }", "public String getUsername() {\n return username.get();\n }", "public String getNickName(){\n return nombreUsuario;\n }", "@Column(length = 100, nullable = false, unique = true)\n\tpublic String getNickName() {\n\t\treturn nickName;\n\t}", "@Column(length = 50, nullable = false, unique = true)\n public String getNick() {\n return nick;\n }", "com.google.protobuf.ByteString\n getNickBytes();", "com.google.protobuf.ByteString\n getNickBytes();", "public String getIdentityLogin()\r\n {\r\n return securityService.findLoggedInUsername();\r\n }", "public String getName() {\n return \"nickel\";\n }", "@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}", "@Override\n\tpublic String getUserName() {\n\t\treturn model.getUserName();\n\t}", "@Override\n\tpublic String getNaam(){\n\t\tString pName= ctx.getCallerPrincipal().getName();\n\t\tPerson p=userEJB.findPerson(pName);\n\t\tString w=p.getName();\n\t\treturn w;\n\t}", "public String getName() {\n return user.getName();\n }", "public String getFromNick() {\n Object ref = fromNick_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n fromNick_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }", "public String getLogin() {\n return this.session.sessionPersona().getUserName();\n }", "public String getName(){\n return username;\n\t}", "public String getFromNick() {\n Object ref = fromNick_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n fromNick_ = s;\n return s;\n }\n }", "@Override\n\tpublic String getUsername() {\n\t\treturn user.getUserName();\n\t}", "public String getName() {\r\n\t\treturn this.userName;\r\n\t}", "public String getUserName() {\n\t\tsharedPreferences = context.getSharedPreferences(\"Login\",\n\t\t\t\tcontext.MODE_PRIVATE);\n\t\treturn sharedPreferences.getString(\"USERNAME\", null);\n\t}", "public String getName() {\n\t\t\treturn this.getIdentity();\n\t\t}", "public String getName() {\n\t\t\treturn this.getIdentity();\n\t\t}", "public String getDisplayName() {\n\t\treturn displayName.get();\n\t}", "@Override\n\tpublic String getUsername(Context ctx){\n\t\treturn ctx.session().get(\"username\");\n\t}", "public static String getUsername() {\n\t\treturn General.getTRiBotUsername();\n\t}", "public final String getUsername() {\n\t\treturn username.trim();\n\t}", "public String getPlayerOneUserName() {\n if (gameStatus == null) return \"\";\n if (gameStatus.getPlayerOneUserName() == null) return \"\";\n return gameStatus.getPlayerOneUserName();\n }", "public final String getUsername() {\n return username;\n }", "public static String getUserName() {\r\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n\t\t\t\t.getExternalContext().getSession(false);\r\n\t\treturn session.getAttribute(\"username\").toString();\r\n\t}", "public static String getUserName() {\r\n\t\tHttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n\t\t\t\t.getExternalContext().getSession(false);\r\n\t\treturn session.getAttribute(\"username\").toString();\r\n\t}", "public String getName() {\n return this.session.sessionPersona().getRealName();\n }", "public int getNickel () {\n return NNickel;\n }", "public String getUserName() {\n\t\treturn phoneText.getText().toString();\n\t}", "public final String getUser() {\n return username;\n }", "public String nickFromUserId(String userId) {\n SlackUser user = this.slackUserFromId(userId);\n return user == null ? null : user.getUserName();\n }", "@Override\n\tpublic String getUsername() {\n\t\treturn user.getUsername();\n\t}", "public String getDisplayName ( ) {\n\t\treturn handleOptional ( ).map ( Player :: getDisplayName ).orElse ( name );\n\t}", "@NotNull\n public String getName() {\n if (myName == null) {\n myName = myId;\n int index = myName.lastIndexOf('/');\n if (index != -1) {\n myName = myName.substring(index + 1);\n }\n }\n\n return myName;\n }" ]
[ "0.79540616", "0.7899854", "0.7899854", "0.7899854", "0.7899854", "0.7899854", "0.7899854", "0.7899854", "0.7899854", "0.7899854", "0.7899854", "0.7874473", "0.785798", "0.7692572", "0.7640243", "0.7606042", "0.7531716", "0.75094074", "0.7495869", "0.7494988", "0.749198", "0.7483092", "0.73259866", "0.7316192", "0.73068166", "0.73068166", "0.72259843", "0.7206872", "0.7122446", "0.7099733", "0.7041264", "0.7031988", "0.7030415", "0.7030415", "0.7030415", "0.7030415", "0.7030415", "0.7030415", "0.6991224", "0.69085974", "0.69085974", "0.6905538", "0.68492055", "0.684546", "0.684546", "0.6783956", "0.6782831", "0.67339873", "0.66709346", "0.66115844", "0.65394706", "0.65332896", "0.6507423", "0.6499911", "0.6487979", "0.64571595", "0.6426028", "0.64243096", "0.64205337", "0.6351766", "0.6326455", "0.63087755", "0.62800556", "0.6253314", "0.62415355", "0.6187767", "0.6148795", "0.6120181", "0.6120181", "0.6109978", "0.6093172", "0.6086481", "0.6086481", "0.6077922", "0.605751", "0.60565096", "0.60535765", "0.60480946", "0.6026197", "0.60215604", "0.60060257", "0.5976222", "0.5966874", "0.5966874", "0.5961134", "0.59597695", "0.5954324", "0.5951002", "0.5950881", "0.59479874", "0.59291834", "0.59291834", "0.59202087", "0.5916689", "0.5905789", "0.5903458", "0.5873301", "0.5868185", "0.5845472", "0.58445174" ]
0.72045
28
This method is called when the match is started, the client has to see the MainPage
public void startGame(){ System.out.println("[SERVER]: Starting a new game"); mainPage = new MainPage(); mainPage.setMatch(match); mainPage.setRemoteController(senderRemoteController); Platform.runLater( () -> { try { firstPage.closePrimaryStage(); if(chooseMap != null) chooseMap.closePrimaryStage(); mainPage.start(new Stage()); } catch (Exception e) { e.printStackTrace(); } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void run() {\n\t\t\t\t\t\tUiApplication.getUiApplication().pushScreen(new HomeScreen());\n\t\t\t\t\t}", "public void run() {\n\t\t\t\t\t\tUiApplication.getUiApplication().pushScreen(new HomeScreen());\n\t\t\t\t\t}", "public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}", "public MainPage() {\n initComponents();\n \n initPage();\n }", "public StartPage() {\n initComponents();\n \n }", "@Override protected void startup() {\n show(new MIDLetParamsView(this));\n }", "public void loadStartPage()\n\t{\n\t}", "@FXML\r\n\tpublic void goToMain() {\r\n\t\tViewNavigator.loadScene(\"Welcome to WatchPlace\", ViewNavigator.HOME_SCENE);\r\n\t}", "public void onModuleLoad() {\r\n\t\trpcService = GWT.create(ContactService.class);\r\n\t\teventBus = new HandlerManager(null);\r\n\t\tappViewer = new AppController(rpcService, eventBus);\r\n\t\tappViewer.go(RootPanel.get(\"initView\"));\r\n\t}", "@Override protected void startup() {\n show(new FrontView());\n //show(new RestaurantManagementView(this));\n }", "public void startUp() {\n\t\twhile (startupSettings.getContinue()) {\n\t\t\tstartView.showLogo();\n\t\t\tthis.setupNewMatch();\n\t\t\tstartView.showNewMatchStarting();\n\t\t\tcurrentMatch.start();\n\t\t\tstartupSettings = startView.askNewStartupSettings();\n\t\t}\n\t\tthis.ending();\n\t}", "public void run()\r\n {\n\ttopLevelSearch=FIND_TOP_LEVEL_PAGES;\r\n\ttopLevelPages=new Vector();\r\n\tnextLevelPages=new Vector();\r\n \r\n\t// Check to see if a proxy is being used. If so then we use IP Address rather than host name.\r\n\tproxyDetected=detectProxyServer();\r\n\t \r\n\tstartSearch();\r\n \r\n\tapp.enableButtons();\r\n\tapp.abort.disable();\r\n \r\n\tif(hitsFound == 0 && pageOpened == true)\r\n\t app.statusArea.setText(\"No Matches Found\");\r\n else if(hitsFound==1)\r\n\t app.statusArea.setText(hitsFound+\" Match Found\");\r\n else app.statusArea.setText(hitsFound+\" Matches Found\");\r\n }", "@Override\n public void startingScreen(Home.ToHome presenter) {\n presenter.onScreenStarted();\n }", "public void onModuleLoad() {\n \t\tMainPage.currentPage = this;\n \t\t\n \t\tif(Window.Location.getHash().length() == 0){\n \t\t\tloggedIn = false;\n \t\t}else{\n \t\t\tloggedIn = true;\n \t\t}\n \t\t\n \t\tinitUI();\n \t\t\n \t\tif(loggedIn){\n \t\t\tsetStatus(\"fetching JSON...\", false);\n \t\t\tfbFetcher.fetchNeededJSON();\n \t\t}\n \t\t\n \t}", "@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }", "public void onStart(MainMVPApplication app) {\n\t\tthis.application = app;\n\n\t\t// set the applications main windows (the view)\n\t\t//this.application.setMainWindow((Window) this.view);\n\n\t\t// load the nav presenter\n\t\tIPresenterFactory pf = application.getPresenterFactory();\n\t\tthis.navPresenter = (WorkspaceNavigationPresenter) pf.createPresenter(WorkspaceNavigationPresenter.class);\n\t\tIWorkspaceNavigationView navView = this.navPresenter.getView();\n\t\tthis.view.setNavigation(navView);\n\t\t\n\t\tIPresenter<?, ? extends EventBus> dbpresenter = pf.createPresenter(DashboardPresenter.class);\n\t\t((DashboardEventBus)dbpresenter.getEventBus()).launch(application);\n\t\tComponent dbView = (Component)dbpresenter.getView();\n\t\t\n\t\tthis.view.setContent(dbView);\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\t// EasyTracker.getInstance(this).activityStart(this);\n\t\tEasyTracker.getInstance(this).set(Fields.SCREEN_NAME, \"Login Screen\");\n\t\tEasyTracker.getInstance(this).send(MapBuilder.createAppView().build());\n\t}", "public void launchMainScreen() {\n\t\tmainWindow = new MainGameScreen(this);\n\t}", "public void start(){\n this.speakerMessageScreen.printScreenName();\n mainPart();\n }", "private void startViewer() {\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n finish();\n }", "@FXML\r\n public void handleOnHomeButtonClick ()\r\n {\r\n mainApp.showMainScreen();\r\n }", "public void showMainPage() {\r\n\t\tmainFrame.showPage(mainPage.getClass().getCanonicalName());\r\n\t}", "private void ini_TabMainView()\r\n\t{\r\n\r\n\t\tif (splashEndTime > System.currentTimeMillis()) return;\r\n\r\n\t\tLogger.DEBUG(\"ini_TabMainView\");\r\n\t\tGL.that.removeRenderView(this);\r\n\t\t((GdxGame) GL.that).switchToMainView();\r\n\r\n\t\tGL.setIsInitial();\r\n\t}", "@Override \n protected void startup() {\n GretellaView view = new GretellaView(this);\n show( view );\n view.initView(); \n }", "private void startMatch() {\n game = new Match(players.get(0), players.get(1), \"Nueva Partida\");\n showMatch();\n state = 1;\n }", "public void startProgram() {\n this.displayBanner();\n// prompt the player to enter their name Retrieve the name of the player\n String playersName = this.getPlayersName();\n// create and save the player object\n User user = ProgramControl.createPlayer(playersName);\n// Display a personalized welcome message\n this.displayWelcomeMessage(user);\n// Display the Main menu.\n MainMenuView mainMenu = new MainMenuView();\n mainMenu.display();\n }", "public void onModuleLoad() {\r\n\r\n\t\tClientFactory clientFactory = GWT.create(ClientFactory.class);\r\n\t\tEventBus eventBus = clientFactory.getEventBus();\r\n\t\tPlaceController placeController = clientFactory.getPlaceController();\r\n\r\n\t\t// Start ActivityManager for the main widget with our ActivityMapper\r\n\t\tActivityMapper activityMapper = new AppMapper(clientFactory);\r\n\t\tActivityManager activityManager = new ActivityManager(activityMapper, eventBus);\r\n\t\tactivityManager.setDisplay(new SimplePanel());\r\n\r\n\t\t// Start PlaceHistoryHandler with our PlaceHistoryMapper\r\n\t\tAppPlaceHistoryMapper historyMapper = GWT.create(AppPlaceHistoryMapper.class);\r\n\t\tPlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);\r\n\t\thistoryHandler.register(placeController, eventBus, defaultPlace);\r\n\r\n\t\t// Goes to the place represented on URL else default place\r\n\t\thistoryHandler.handleCurrentHistory();\r\n\t}", "public void startApp() {\r\n\t\ttry {\r\n\t\t\tFXMLLoader loader;\r\n\t\t\t// load the FXML resource\r\n\t\t\tif (isRegister) {\r\n\t\t\t\tloader = changeScreen(\"/view/HomeRegister.fxml\", new BorderPane(), \"Register\");\r\n\t\t\t\tHomeRegisterController regiController = loader.getController();\r\n\t\t\t\tregiController.setMain(this);\r\n\t\t\t} else {\r\n\t\t\t\tloader = changeScreen(\"/view/HomeIdentification.fxml\", new BorderPane(), \"Identification\");\r\n\t\t\t\tHomeIdentificationController identiController = loader.getController();\r\n\t\t\t\tidentiController.setMain(this);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}", "private void goToMainScreen() {\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent mainIntent;\n\n MainActivity act = new MainActivity();\n Intent intent = new Intent(getApplication(), MainActivity.class);\n startActivity(intent);\n finish();\n }\n }, SPLASH_DISPLAY_LENGHT);\n }", "public void onModuleLoad() {\n useCorrectRequestBaseUrl();\n ClientFactory clientFactory = GWT.create(ClientFactory.class);\n EventBus eventBus = clientFactory.getEventBus();\n //this is for history\n PlaceController placeController = clientFactory.getPlaceController();\n\n ActivityMapper activityMapper = new TritonActivityMapper(clientFactory);\n ActivityManager activityManager = new ActivityManager(activityMapper, eventBus);\n activityManager.setDisplay(appWidget);\n\n TritonPlaceHistoryMapper historyMapper = GWT.create(TritonPlaceHistoryMapper.class);\n PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);\n historyHandler.register(placeController, eventBus, defaultPlace);\n\n RootPanel.get().add(appWidget);\n historyHandler.handleCurrentHistory();\n }", "@Override\n protected void onStart() {\n super.onStart();\n\n //connect google api client\n googleApi.connect();\n // ATTENTION: This was auto-generated to implement the App Indexing API.\n // See https://g.co/AppIndexing/AndroidStudio for more information.\n Action viewAction = Action.newAction(\n Action.TYPE_VIEW, // TODO: choose an action type.\n \"Maps Page\", // TODO: Define a title for the content shown.\n // TODO: If you have web page content that matches this app activity's content,\n // make sure this auto-generated web page URL is correct.\n // Otherwise, set the URL to null.\n Uri.parse(\"http://host/path\"),\n // TODO: Make sure this auto-generated app URL is correct.\n Uri.parse(\"android-app://coupletones.pro.cse110.coupletones/http/host/path\")\n );\n AppIndex.AppIndexApi.start(googleApi, viewAction);\n }", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t\tUiUpdater.registerClient(handler);\r\n\t\tupdateUI();\r\n\t}", "@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\t\n\t\t//For Google Analytics\n\t\tEasyTracker.getInstance(this).activityStart(this);\n\t\t\n\t\t//For Google Analytics\n\t\tTracker v3Tracker = GoogleAnalytics.getInstance(this).getTracker(\"UA-67985681-1\");\n\n\t\t// This screen name value will remain set on the tracker and sent with\n\t\t// hits until it is set to a new value or to null.\n\t\tv3Tracker.set(Fields.SCREEN_NAME, \"Change Password Screen, \"\n\t\t\t\t+AppLoginUser.getUserName());\n\t\t\n\t\t// This screenview hit will include the screen name.\n\t\tv3Tracker.send(MapBuilder.createAppView().build());\n\t}", "public void onStart() {\n }", "public void onStart() {\n\t\t\n\t}", "private void launchMain() {\n\t\tfinal Intent i = new Intent(this, MainActivity.class);\n\t\tstartActivity(i);\n\t}", "public void onModuleLoad() {\r\n\r\n Mvp4gModule module = (Mvp4gModule)GWT.create( Mvp4gModule.class );\r\n module.createAndStartModule();\r\n RootPanel.get().add( (IsWidget)module.getStartView() );\r\n\t\t// Use RootPanel.get() to get the entire body element\r\n\r\n\r\n\t}", "public void startProgram()\r\n\t{\r\n\t\tview.displayPlayerNames();\r\n\t\tview.loadGameData();\r\n\t\tview.displayGame();\r\n\t}", "@Override\n public void onStart() {\n \n }", "@Override\n public void onStart() {\n \n }", "public void loadPage() {\n\t\tLog.i(TAG, \"MyGardenListActivity::LoadPage ! Nothing to do anymore here :)\");\n\t}", "public MainScreen() {\n initComponents();\n \n }", "public void onStart() {\n }", "public void onModuleLoad() {\n\t\tRootPanel.get().addStyleName(\"body-background\");\n\t\tApp app = new App();\n\t\tapp.start();\n\t}", "protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n //Starts the selected layout as the first page when app opens\n setContentView(R.layout.activity_main_page);\n new JSONArrayExtractor().execute(); //This command allows the class to run and make URL requests without crashing\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n mSectionStatePagerAdapter = new SectionsStatePagerAdapter(getSupportFragmentManager());\n mViewPager = (ViewPager) findViewById(R.id.container);\n setupViewPager(mViewPager);\n\n Log.i(TAG,\"MainPage Started.\");\n Toast.makeText(getApplicationContext(),\"Weather Found\", Toast.LENGTH_SHORT).show();\n }", "public Main() {\n\t\tsuper();\n\t\tInitScreen screen = new InitScreen();\n\t\tpushScreen(screen);\n\t\tUiApplication.getUiApplication().repaint();\n\t}", "@Override\n public void start(Stage primaryStage) throws Exception {\n\n stage = primaryStage;\n stage.setOnCloseRequest(e -> exitProgram());\n Parent root;\n\n// if (!ManagerAccount.isThereAChiefManager()) {\n// root = FXMLLoader.load(new File((RegisterManager.FXML_PATH)).toURI().toURL());\n//\n// FXMLLoader loginPageLoader = new FXMLLoader(new File(LoginSignUpPage.FXML_PATH).toURI().toURL());\n// loginPageLoader.load();\n// //LoginSignUpPage.mediaPlayer.play();\n//\n// stage.setTitle(RegisterManager.TITLE);\n// sceneTrace.add(RegisterManager.FXML_PATH);\n// } else {\n\n\n //this scope\n String response = DataRequestBuilder.buildProgramStartModeRequest();\n if (response.equals(\"1\")) {\n root = FXMLLoader.load(new File(RegisterManager.FXML_PATH).toURI().toURL());\n stage.setTitle(RegisterManager.TITLE);\n sceneTrace.add(RegisterManager.FXML_PATH);\n } else {\n root = FXMLLoader.load(new File(MainMenuController.FXML_PATH).toURI().toURL());\n stage.setTitle(MainMenuController.TITLE);\n sceneTrace.add(MainMenuController.FXML_PATH);\n }\n\n\n// root = FXMLLoader.load(new File(ChatPageController.FXML_PATH).toURI().toURL());\n// stage.setTitle(RegisterManager.TITLE);\n// sceneTrace.add(RegisterManager.FXML_PATH);\n\n //audioClip.play();\n // }\n\n titleTrace.add(stage.getTitle());\n\n Scene scene = new Scene(root);\n stage.setScene(scene);\n primaryStage.show();\n }", "public Home() {\n initComponents();\n ShowLauncher();\n }", "public void onStart() {\n super.onStart();\n this.mZxingview.startCamera();\n this.mZxingview.startSpotAndShowRect();\n }", "public void factoryMainScreen()\n\t{\n\t\t\n\t}", "public void start() {\r\n\t\tfinal Element frame = this.createFrame();\r\n\t\tthis.setFrame(frame);\r\n\r\n\t\tthis.getSupport().start(this, frame);\r\n\r\n\t\t// the reason for the query string is to avoid caching problems...the\r\n\t\t// src attribute is set before the frame is attached this also\r\n\t\t// avoids the nasty clicking noises in ie.\r\n\t\tDOM.setElementProperty(frame, \"src\", this.getServiceEntryPoint() + \"?serializationEngine=Gwt&\" + System.currentTimeMillis());\r\n\r\n\t\tfinal Element body = RootPanel.getBodyElement();\r\n\t\tDOM.appendChild(body, frame);\r\n\t}", "@Override\n public void onStart() {\n super.onStart();\n updateUI();\n }", "public void onModuleLoad() {\r\n\r\n\t\tnew UseTracking(this.getClass().getName());\r\n\r\n\t\tRootPanel.get(\"main\").clear();\r\n\t\tRootPanel.get(\"main\").setWidth(\"100%\");\r\n\t\tVerticalPanel vpMain = new VerticalPanel();\r\n\t\tvpMain.setSize(\"100%\", \"100%\");\r\n\t\tvpMain.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);\r\n\t\tRootPanel.get(\"main\").add(vpMain, 0, 0);\r\n\r\n\t\tString uniqueID = EncryptText.decrypt(Cookies.getCookie(\"UniqueID\"));\r\n\t\t// uniqueID = \"AllineWatkins_1332886062783\";\r\n\r\n\t\tfinal String company = Location.getParameter(\"company\");\r\n\t\tif (company != null) {\r\n\r\n\t\t\tJSONObject json = new JSONObject();\r\n\t\t\tjson.put(\"ID\", new JSONString(company));\r\n\r\n\t\t\tUniqueIDGlobalVariables.companyUniqueID = json;\r\n\t\t}\r\n\r\n\t\tif (uniqueID == null || uniqueID.equals(\"null\")) {\r\n\r\n\t\t\tString authenticationCode = Location.getParameter(\"code\");\r\n\r\n\t\t\tfinal String error = Location.getParameter(\"error_reason\");\r\n\r\n\t\t\tif (!((null != error && error.equals(\"user_denied\")) || (authenticationCode == null || \"\"\r\n\t\t\t\t\t.equals(authenticationCode)))) {\r\n\r\n\t\t\t\tInitializeApplication.VerifyFacebookLogin(authenticationCode);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tInitializeApplication.verifyParameters(vpMain, uniqueID, company);\r\n\r\n\t}", "public void start()\n {\n uploadDataFromFile();\n menu.home();\n home();\n }", "@Override\n public void onResume() {\n super.onResume();\n updateUserAcount();\n showMainBottom();\n MobclickAgent.onPageStart(\"MyMainFragment\");\n }", "public EntryPoint()\n { \n \tpushScreen(new HelperScreen());\n }", "@Override\n public void onStart()\n {\n }", "@Override\n protected void onStart() {\n super.onStart();\n sendToLogin();\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n }", "@Override\n public void onStart() {\n GuiMain gui = new GuiMain(this);\n gui.setVisible(true);\n log(\"Script is starting!\");\n\n }", "@Override\r\n\tpublic void start(Stage primaryStage) {\r\n\t\tthis.primaryStage=primaryStage;\r\n\t\tthis.primaryStage.setTitle(\"AmwayWinston\");\r\n\t\t\r\n\t\tinitRootLayout();\r\n\t\t\r\n\t\tshowPersonOverview();\r\n\t\t\r\n\t}", "public void onStart() {\r\n\t\tLog.w(LOG_TAG, \"Simple iMeeting base view = \" + this\r\n\t\t\t\t+ \" onStart method not implement\");\r\n\t}", "public void onModuleLoad() {\n\t\t// set viewport and other settings for mobile\n\t\tMGWT.applySettings(MGWTSettings.getAppSetting());\n\n\t\t// build animation helper and attach it\n\t\tAnimationHelper animationHelper = new AnimationHelper();\n\t\tRootPanel.get().add(animationHelper);\n\n\t\t// build some UI\n\t\tRootFlexPanel rootFlexPanel = new RootFlexPanel();\n\t\tButton button = new Button(\"Hello mgwt\");\n\t\trootFlexPanel.add(button);\n\n\t\t// animate\n\t\tanimationHelper.goTo(rootFlexPanel, Animations.SLIDE);\n\t}", "public void home() {\n\t\tUserUI ui = new UserUI();\n\t\tui.start();\n\t}", "private void main() {\n // # I DON'T HAVE A MAIN DASHBOARD YET. MACAYLA MIGHT WANT #\n // # TO DESIGN THAT PART. FOR NOW, I HAVE A \"FAUX\" RESULTS #\n // # PAGE SHOWING, JUST SO I CAN GET A LOOK AT HOW THE RESULTS PAGE #\n // # WILL LOOK. #\n // ######################################################################\n\n ResultsFragment fragment = new ResultsFragment();\n String tag = ResultsFragment.class.getCanonicalName();\n getSupportFragmentManager().beginTransaction()\n .replace(R.id.fragment_frame, fragment, tag).commit();\n }", "@Override\n protected void appStart() {\n }", "public void run() {\r\n frame = new MainFrame(this);\r\n newAccountFrame = new NewAccountPage(this);\r\n \r\n frame.setVisible(true);\r\n }", "public Homepage() {\n initComponents();\n }", "public void onStart() {\n super.onStart();\n ApplicationStateMonitor.getInstance().activityStarted();\n }", "public void run() {\n SimpleChatUI firstWin = new SimpleChatUI();\n windows.add(firstWin);\n firstWin.setVisible(true);\n hub = new HubSession(new LoginCredentials(new ChatKeyManager(CHAT_USER)));\n\n firstWin.setStatus(\"No active chat\");\n }", "@Override\n public void onStart() {\n\n }", "public HomePage() {\n initComponents();\n }", "public HomePage() {\n initComponents();\n }", "public final void onStart() {\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.huawei.hms.maps.MapView) this.getHInstance()).onStart()\");\n ((com.huawei.hms.maps.MapView) this.getHInstance()).onStart();\n } else {\n org.xms.g.utils.XmsLog.d(\"XMSRouter\", \"((com.google.android.gms.maps.MapView) this.getGInstance()).onStart()\");\n ((com.google.android.gms.maps.MapView) this.getGInstance()).onStart();\n }\n }", "@Override\r\n public void onStart() {\n super.onStart();\r\n }", "void onStart() {\n\n }", "public MainView() {\r\n\t\tinitialize();\r\n\t}", "void onStartGameRequested();", "protected void onStart ()\n\t{\n\t\tsuper.onStart ();\n\t}", "private void startHome() {\n if (context instanceof MainActivity) {\n CityListFragment fragment = CityListFragment\n .getInstance(fatherParent);\n ((MainActivity) context).switchContent(fragment, true);\n }\n }", "public void updateMatch(Match match){\n setMatch(match);\n Platform.runLater( () -> {\n firstPage.setMatch(match);\n firstPage.refreshPlayersInLobby();\n });\n if(mainPage != null) {\n Platform.runLater( () -> {\n mainPage.setMatch(match);\n senderRemoteController.setMatch(match);\n this.match = match;\n mainPage.refreshPlayersPosition();\n mainPage.refreshPoints();\n if(match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY)){\n mainPage.setFrenzyMode(true);\n mainPage.frenzyButtonBoosted();\n System.out.println(\"[FRENZY]: Started FINAL FRENZY\");\n System.out.println(\"[FRENZY]: Current Player: \"+match.getCurrentPlayer().getNickname()+ \" in status \"+match.getCurrentPlayer().getStatus().getTurnStatus());\n\n }\n if (match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY_LOWER)){\n mainPage.setFrenzyMode(true);\n mainPage.frenzyButtonLower();\n }\n });\n }\n //questo metodo viene chiamato piu volte.\n }", "void createMainContent() {\n appContent = new DashboardMain(this);\n }", "public void onStart() {\n super.onStart();\n }", "@Override\n\t\t\tpublic void onStart()\n\t\t\t{\n\t\t\t\tsuper.onStart();\n\t\t\t}", "@Override protected void startup() {\n LoganoView main = new LoganoView(this);\n JFrame frame = main.getFrame();\n\n \n show(main);\n\n frame.setMinimumSize(new Dimension(800, 600));\n frame.setExtendedState(JFrame.MAXIMIZED_BOTH);\n\n FrmLogin frmLogin = new FrmLogin();\n Helper.showForm(frmLogin);\n frmLogin.setLocationRelativeTo(frame);\n }", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}", "@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t}", "@Override\r\n public void run() {\n ax.browserPane.setTitleAt(0,ax.browser.getTitle());\r\n String stringToken1 = null; \r\n try {\r\n stringToken1 = (\"<Navigate Home>::\" + getHome());\r\n } catch (IOException ex) {\r\n Logger.getLogger(AxBrowser.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n ax.consoleTextArea.setText(stringToken1);\r\n //Put the current html address in the addressbar\r\n ax.addressBar.setText(ax.browser.getCurrentLocation());\r\n \r\n }" ]
[ "0.6728287", "0.6728287", "0.65852684", "0.6553018", "0.63649017", "0.627354", "0.62520266", "0.6251093", "0.6236759", "0.6230823", "0.6218976", "0.61824363", "0.61763644", "0.61596555", "0.61365736", "0.6104722", "0.61007434", "0.60919213", "0.6088983", "0.60769296", "0.6072996", "0.6022601", "0.6020615", "0.6012046", "0.60109806", "0.5999319", "0.59975404", "0.59916234", "0.59521323", "0.59417766", "0.5940153", "0.59291035", "0.5913408", "0.59098995", "0.5894617", "0.58918804", "0.58916616", "0.5869295", "0.58642334", "0.58642334", "0.5863344", "0.585635", "0.5849276", "0.5828753", "0.58167416", "0.58143276", "0.58107436", "0.5805514", "0.5804696", "0.5781463", "0.57790434", "0.57761353", "0.5771214", "0.5770006", "0.5769566", "0.5752816", "0.5746583", "0.5746518", "0.5745792", "0.5745792", "0.5745792", "0.5745792", "0.5745792", "0.5745792", "0.5745792", "0.5745792", "0.5745792", "0.574008", "0.5738853", "0.57265687", "0.57242316", "0.57217366", "0.57197005", "0.57155865", "0.5713271", "0.5712533", "0.5711277", "0.57104737", "0.5697284", "0.5696071", "0.5696071", "0.56894004", "0.5688862", "0.5688463", "0.5686853", "0.56868464", "0.5681744", "0.56795007", "0.5673901", "0.56725234", "0.5669191", "0.5667658", "0.56620806", "0.56620777", "0.56620777", "0.56620777", "0.56620777", "0.56620777", "0.566107", "0.56544065" ]
0.72468054
0
Updates the values in the client copy of the match object
public void updateMatch(Match match){ setMatch(match); Platform.runLater( () -> { firstPage.setMatch(match); firstPage.refreshPlayersInLobby(); }); if(mainPage != null) { Platform.runLater( () -> { mainPage.setMatch(match); senderRemoteController.setMatch(match); this.match = match; mainPage.refreshPlayersPosition(); mainPage.refreshPoints(); if(match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY)){ mainPage.setFrenzyMode(true); mainPage.frenzyButtonBoosted(); System.out.println("[FRENZY]: Started FINAL FRENZY"); System.out.println("[FRENZY]: Current Player: "+match.getCurrentPlayer().getNickname()+ " in status "+match.getCurrentPlayer().getStatus().getTurnStatus()); } if (match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY_LOWER)){ mainPage.setFrenzyMode(true); mainPage.frenzyButtonLower(); } }); } //questo metodo viene chiamato piu volte. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateMatches(){\n getContext().getContentResolver().delete(MatchesContract.BASE_CONTENT_URI, null, null);\n\n // Fetch new data\n new FetchScoreTask(getContext()).execute();\n }", "@Override\n\tpublic void updateMatch(AdrenalinaMatch toGetUpdateFrom) {\n\t\tJSONObject message = new JSONObject();\n\t\tmessage.put(\"function\", \"update\");\n\t\tmessage.put(\"type\", \"match\");\n\t\tmessage.put(\"match\", toGetUpdateFrom.toJSON());\n\t\tthis.sendInstruction(message);\n\t}", "@Override\r\n\tpublic void updateclient(Client client) {\n\t\t\r\n\t}", "@Override\n\tpublic void updateClient() {\n\t\t\n\t}", "public void updateClientParty()\n\t{\n\t\tfor(int i = 0; i < getParty().length; i++)\n\t\t\tupdateClientParty(i);\n\t}", "public void updateClient()\n\t{\n\t\t// TODO\n\t}", "@Override\n\tpublic Client update(Client obj) {\n\t\treturn null;\n\t}", "public void updateMatch(Match match) {\n\t\tmatchDao.update(match);\r\n\t}", "@Override\n public void clientObjectUpdate(ClientObjectInterface client)\n throws SimpleException {\n }", "public void updateClient(){\n\n System.out.println(\"Update client with ID: \");\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n System.out.println(\"Enter new characteristics: \");\n System.out.println(\"Name: \");\n String newName = bufferRead.readLine();\n System.out.println(\"Age: \");\n int newAge = Integer.parseInt(bufferRead.readLine());\n System.out.println(\"Membership type: \");\n String newMembershipType = bufferRead.readLine();\n\n Client newClient = new Client(newName, newAge, newMembershipType);\n newClient.setId(id);\n this.ctrl.updateClient(newClient);\n\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }", "private Match updateMatch(Match matchById) {\r\n return matchRepository.saveAndFlush(matchById);\r\n }", "public static void update() {\n\t\tfor (int index = matches.length - 1; index >= 0; index--) {\n\t\t\tMatch left = null, right = null;\n\t\t\ttry {\n\t\t\t\tleft = matches[getLeft(index)];\n\t\t\t\tright = matches[getRight(index)];\n\t\t\t} catch (ArrayIndexOutOfBoundsException e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (left.getWinner() != null)\n\t\t\t\tmatches[index].setTeam1(left.getWinner());\n\t\t\telse\n\t\t\t\tmatches[index].setTeam1(null);\n\t\t\tif (right.getWinner() != null)\n\t\t\t\tmatches[index].setTeam2(right.getWinner());\n\t\t\telse\n\t\t\t\tmatches[index].setTeam2(null);\n\t\t}\n\t}", "public void update(DroitsMembre client) {\n\n\t}", "Client updateClient(Client client) throws BaseException;", "private void setCurrentMatch(SingleMatch newMatch) {\n\t\tcurrentMatch = newMatch;\n\t}", "@Override\n\tpublic void updateById(Doublematchscore doublematchscore) throws Exception {\n\t\tdoublematchscoreMapper.updateById(doublematchscore);\n\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "@Override\n\t\tpublic void update() {\n\n\t\t}", "private void update() {\n ambianceModel.ambiance.uniq_id = ambianceModel._id.$oid;\n\n RestAdapter restAdapter = new RestAdapter.Builder().setLogLevel(RestAdapter.LogLevel.FULL).setEndpoint(getResources().getString(R.string.api)).build();\n final GsonBuilder builder = new GsonBuilder();\n builder.excludeFieldsWithoutExposeAnnotation();\n builder.disableHtmlEscaping();\n final Gson gson = builder.create();\n Request r = new Request(Singleton.token, ambianceModel._id.$oid, ambianceModel);\n String json = gson.toJson(r);\n Log.v(\"Ambiance activity\", json);\n\n final Lumhueapi lumhueapi = restAdapter.create(Lumhueapi.class);\n lumhueapi.updateAmbiance(r, new Callback<AmbianceApplyResponse>() {\n @Override\n public void success(AmbianceApplyResponse ambianceApplyResponse, Response response) {\n Log.v(\"Ambiance activity\", \"It worked\");\n }\n\n @Override\n public void failure(RetrofitError error) {\n String tv = error.getMessage();\n Log.v(\"Ambiance activity\", tv + \"\");\n }\n });\n }", "public void updateFakeEntities() { \n for(ViewableEntity playerEntity : replicatedEntites.values()) {\n playerEntity.update();\n }\n }", "void setCompleteMatch(Match completeMatch);", "public void updateByObject()\r\n\t{\n\t}", "public void update(){}", "public void update(){}", "public void setMatches() {\r\n this.matches++;\r\n\r\n }", "private void update() {\n\t\ttheMap.update();\n\t\ttheTrainer.update();\n\t}", "@Override\n\tpublic void update() {\n\t\tobj.update();\n\t}", "@Override\r\n public final void update() {\r\n\r\n logger.entering(this.getClass().getName(), \"update\");\r\n\r\n setFilterMap();\r\n\r\n logger.exiting(this.getClass().getName(), \"update\");\r\n\r\n }", "Client updateClient(Client client) throws ClientNotFoundException;", "@Override\n public void setMatch(Match match) {\n if (this.match != null) {\n this.match.removeObserver(this);\n }\n this.match = match;\n this.match.addObserver(this);\n }", "public void setMatchID(int id){\r\n\t\tmatchID = id;\r\n\t}", "@Override\n public Client update(Client zav) {\n return em.merge(zav);\n }", "List patch(List inputObject, List inputSnapshot, Settings settings);", "void onModelChanged(MatchSnapshot matchSnapshot);", "@Override\n\tpublic void update(CcNoticereceive entity) {\n\t\t\n\t}", "public void receivedUpdateFromServer();", "void update(Subscriber record);", "public Client update(Client object) throws DataNotFoundException {\n\t\treturn null;\r\n\t}", "void update(storage_server_connections connection);", "@Override\n @Transactional\n public void updateClient(Client newClient){\n log.trace(\"updateClient: client={}\", newClient);\n clientValidator.validate(newClient);\n clientRepository.findById(newClient.getId())\n .ifPresent(client1 -> {\n client1.setName(newClient.getName());\n client1.setMoneySpent(newClient.getMoneySpent());\n log.debug(\"updateClient --- client updated --- \" +\n \"client={}\", client1);\n });\n log.trace(\"updateClient --- method finished\");\n }", "@Override\r\n\tpublic void update(Responsible p) {\n\t\t\r\n\t}", "public void updateTeamFromResults(Match m){\r\n \r\n //Update team1\r\n m.getTeam1().setGoalsFor(m.getTeam1().getGoalsFor() + m.getScore1());\r\n m.getTeam1().setGoalsAgainst(m.getTeam1().getGoalsAgainst() + m.getScore2());\r\n \r\n //Update team2\r\n m.getTeam2().setGoalsFor(m.getTeam2().getGoalsFor() + m.getScore2());\r\n m.getTeam2().setGoalsAgainst(m.getTeam2().getGoalsAgainst() + m.getScore1());\r\n \r\n //Add points\r\n if (m.getScore1() < m.getScore2()){\r\n m.getTeam2().setPoints(m.getTeam2().getPoints() + 3);\r\n m.getTeam1().setMatchLost(m.getTeam1().getMatchLost() + 1);\r\n m.getTeam2().setMatchWon(m.getTeam2().getMatchWon() + 1);\r\n }\r\n else if (m.getScore1() > m.getScore2()){\r\n m.getTeam1().setPoints(m.getTeam1().getPoints() + 3);\r\n m.getTeam2().setMatchLost(m.getTeam2().getMatchLost() + 1);\r\n m.getTeam1().setMatchWon(m.getTeam1().getMatchWon() + 1);\r\n }\r\n else {\r\n m.getTeam1().setPoints(m.getTeam1().getPoints() + 1);\r\n m.getTeam2().setPoints(m.getTeam2().getPoints() + 1);\r\n m.getTeam1().setMatchDrawn(m.getTeam1().getMatchDrawn() + 1);\r\n m.getTeam2().setMatchDrawn(m.getTeam2().getMatchDrawn() + 1);\r\n }\r\n \r\n //Update the rankings\r\n this.updateTeamRank();\r\n }", "public Client askUpdate(Client toUpdate){\n System.out.println(\"Set a name of a client: \");\n String name = in.nextLine();\n System.out.println(\"Set a surname of a client: \");\n String surname = in.nextLine();\n System.out.println(\"Set a city of a client: \");\n String city = in.nextLine();\n \n toUpdate.setName(name);\n toUpdate.setSurname(surname);\n toUpdate.setCity(city);\n \n return toUpdate;\n }", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic void update() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void update(Map<String, Object> params)\n\t{\n\t}", "public void update() {}", "void update(Map<Player, List<Move>> history);", "@Test\n public void testgetMatch() throws java.lang.Exception{\n\n /* org.seadva.matchmaker.webservice.MatchMakerServiceStub stub =\n new org.seadva.matchmaker.webservice.MatchMakerServiceStub();//the default implementation should point to the right endpoint\n\n org.seadva.matchmaker.webservice.GetMatchRequest getMatchRequest18=\n (org.seadva.matchmaker.webservice.GetMatchRequest)getTestObject(org.seadva.matchmaker.webservice.GetMatchRequest.class);\n // TODO : Fill in the getMatchRequest18 here\n\n ClassAdType param = new ClassAdType();\n\n param.setType(\"user\");\n CharacteristicsType characteristicsType = new CharacteristicsType();\n CharacteristicType[] characs = new CharacteristicType[1];\n CharacteristicType charac = new CharacteristicType();\n charac.setName(\"license\");\n charac.setValue(\"CC\");\n characs[0] = charac;\n characteristicsType.setCharacteristic(characs);\n param.setCharacteristics(characteristicsType);\n\n RequirementsType reqs = new RequirementsType();\n RuleType rules = new RuleType();\n rules.setObject(\"dspace\");\n rules.setSubject(\"type\");\n rules.setPredicate(\"equals\");\n reqs.addRule(rules);\n param.setRequirements(reqs);\n\n PreferencesType preferencesType = new PreferencesType();\n RuleType[] rs = new RuleType[1];\n rs[0] = rules;\n preferencesType.setRule(rs);\n param.setPreferences(preferencesType);\n\n getMatchRequest18.setUserClassAd(param);\n GetMatchResponse resourcesResponse = stub.getMatch(\n getMatchRequest18);\n for(int i =0; i<resourcesResponse.getResourceClassAd().getCharacteristics().getCharacteristic().length;i++)\n System.out.print(\"printing \"+\n resourcesResponse.getResourceClassAd().getType()+\" \\n\"+\n resourcesResponse.getResourceClassAd().getCharacteristics().getCharacteristic()[i].getName() + \" : \" +\n resourcesResponse.getResourceClassAd().getCharacteristics().getCharacteristic()[i].getValue() + \"\\n\");\n param.setPreferences(new PreferencesType());\n assertNotNull(resourcesResponse);\n \n */\n\n\n GetMatchRequest getMatchRequest=\n new GetMatchRequest();\n\n ClassAdType param = new ClassAdType();\n\n param.setType(\"user\");\n CharacteristicsType characteristicsType = new CharacteristicsType();\n CharacteristicType[] characs = new CharacteristicType[2];\n CharacteristicType licCharac = new CharacteristicType();\n licCharac.setName(\"license\");\n licCharac.setValue(\"CC\");\n CharacteristicType sizeCharac = new CharacteristicType();\n sizeCharac.setName(\"dataCollectionSize\");\n sizeCharac.setValue(\"1073741825\");\n characs[0] = licCharac;\n characs[1] = sizeCharac;\n characteristicsType.setCharacteristic(characs);\n param.setCharacteristics(characteristicsType);\n\n RequirementsType reqs = new RequirementsType();\n RuleType rules = new RuleType();\n rules.setSubject(\"type\");\n rules.setPredicate(\"equals\");\n rules.setObject(\"cloud\");\n reqs.addRule(rules);\n param.setRequirements(reqs);\n\n PreferencesType preferencesType = new PreferencesType();\n RuleType[] rs = new RuleType[1];\n rs[0] = rules;\n preferencesType.setRule(rs);\n param.setPreferences(preferencesType);\n\n getMatchRequest.setUserClassAd(param);\n MatchMakerServiceStub stub = null;\n try {\n stub = new MatchMakerServiceStub();\n } catch (AxisFault axisFault) {\n axisFault.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n GetMatchResponse resourcesResponse = null;\n try {\n resourcesResponse = stub.getMatch(\n getMatchRequest);\n System.out.print(\"printing \"+\n resourcesResponse.getResourceClassAd().getType()+\" \\n\");\n for(int i =0; i<resourcesResponse.getResourceClassAd().getCharacteristics().getCharacteristic().length;i++)\n System.out.print(\n resourcesResponse.getResourceClassAd().getCharacteristics().getCharacteristic()[i].getName() + \" : \" +\n resourcesResponse.getResourceClassAd().getCharacteristics().getCharacteristic()[i].getValue() + \"\\n\");\n param.setPreferences(new PreferencesType());\n assertNotNull(resourcesResponse);\n } catch (RemoteException e) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }", "@Override\r\n\tpublic void update(PartyType entity) {\n\t\t\r\n\t}", "@Test\n public void testUpdatePerson() {\n final AuthenticationToken myToken = login(\"[email protected]\", \"finland\");\n final Group memberGroup = findMemberGroup(myToken);\n final FetchGroupRequest groupRequest = new FetchGroupRequest(memberGroup.getGroupId());\n groupRequest.setUsersToFetch(FetchGroupRequest.UserFetchType.ACTIVE);\n final FetchGroupResponse groupResponse1 = administration.fetchGroup(myToken, groupRequest);\n assertThat(groupResponse1.isOk(), is(true));\n assertThat(groupResponse1.getMembers().size(), is(1));\n\n // Now, let's update the Object, and send it into the IWS\n final User myself = groupResponse1.getMembers().get(0).getUser();\n final Person person = myself.getPerson();\n final Address address = new Address();\n address.setStreet1(\"Mainstreet 1\");\n address.setPostalCode(\"12345\");\n address.setCity(\"Cooltown\");\n address.setState(\"Coolstate\");\n person.setAddress(address);\n person.setFax(\"My fax\");\n person.setBirthday(new Date(\"01-JAN-1980\"));\n person.setMobile(\"+1 1234567890\");\n person.setGender(Gender.UNKNOWN);\n person.setPhone(\"+1 0987654321\");\n person.setUnderstoodPrivacySettings(true);\n person.setAcceptNewsletters(false);\n myself.setPerson(person);\n final UserRequest updateRequest = new UserRequest();\n updateRequest.setUser(myself);\n final Response updateResult = administration.controlUserAccount(myToken, updateRequest);\n assertThat(updateResult.isOk(), is(true));\n\n // Let's find the account again, and verify that the updates were applied\n final FetchUserRequest userRequest = new FetchUserRequest();\n userRequest.setUserId(myself.getUserId());\n final FetchUserResponse userResponse = administration.fetchUser(myToken, userRequest);\n assertThat(userResponse.isOk(), is(true));\n final User myUpdate = userResponse.getUser();\n final Person updatedPerson = myUpdate.getPerson();\n assertThat(updatedPerson.getAlternateEmail(), is(person.getAlternateEmail()));\n assertThat(updatedPerson.getBirthday(), is(person.getBirthday()));\n assertThat(updatedPerson.getFax(), is(person.getFax()));\n assertThat(updatedPerson.getGender(), is(person.getGender()));\n assertThat(updatedPerson.getMobile(), is(person.getMobile()));\n assertThat(updatedPerson.getPhone(), is(person.getPhone()));\n assertThat(updatedPerson.getUnderstoodPrivacySettings(), is(person.getUnderstoodPrivacySettings()));\n assertThat(updatedPerson.getAcceptNewsletters(), is(person.getAcceptNewsletters()));\n\n final Address updatedAddress = updatedPerson.getAddress();\n assertThat(updatedAddress.getStreet1(), is(address.getStreet1()));\n assertThat(updatedAddress.getStreet2(), is(address.getStreet2()));\n assertThat(updatedAddress.getPostalCode(), is(address.getPostalCode()));\n assertThat(updatedAddress.getCity(), is(address.getCity()));\n assertThat(updatedAddress.getState(), is(address.getState()));\n\n // Wrapup... logout\n logout(myToken);\n }", "public static void update(Client client) throws ClassNotFoundException, SQLException { \r\n \r\n \tif (connection == null || connection.isClosed()) \r\n \t\tconnection = DataSourceManager.getConnection();\r\n \r\n \tstatement = connection.prepareStatement(UPDATE);\r\n \tstatement.setInt(1, client.group.id);\r\n \tstatement.setString(2, client.name);\r\n \tstatement.setInt(3, client.connections);\r\n \tstatement.setString(4, client.ip);\r\n \tstatement.setString(5, client.guid);\r\n \tif (client.auth != null) statement.setString(6, client.auth);\r\n \telse statement.setNull(6, Types.VARCHAR);\r\n statement.setLong(7, client.time_edit.getTime());\r\n statement.setInt(8, client.id);\r\n \r\n // Executing the statement.\r\n statement.executeUpdate();\r\n statement.close();\r\n \r\n }", "public void updateClientBadges()\n\t{\n\t\tString data = \"\";\n\t\tfor(int i = 0; i < m_badges.length; i++)\n\t\t\tdata += m_badges[i];\n\t\tServerMessage message = new ServerMessage(ClientPacket.BADGES_PACKET);\n\t\tmessage.addInt(0);\n\t\tmessage.addString(data);\n\t\tgetSession().Send(message);\n\t}", "public void sendMatch() {\n for (int i = 0; i < numberOfPlayers; i++) {\n try {\n // s = ss.accept();\n oos = new ObjectOutputStream(sockets.get(i).getOutputStream());\n oos.writeObject(game);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "@Override\n public void update(Observable o, Object remoteView) {\n RemoteView remote = (RemoteView) remoteView;\n this.mapView = remote.getMapView();\n this.playerHand = remote.getPlayerHands().get(this.playerId);\n this.playerBoardViews = remote.getPlayerBoardViews();\n this.playerPosition = remote.getMapView().getPlayerPosition(remote.getPlayerBoardViews().get(this.playerId).getColor());\n }", "public void updateRecord(Record object);", "@Override\n\tpublic void update() {}", "@Override\n\tpublic void update() {}", "private static Person updatePerson(Request req) {\n int id = Integer.parseInt(req.params(\"id\"));\n Person personRequested = gson.fromJson(req.body(), Person.class);\n \n // get the data from personRequested keeping the id\n Person personFound = findPersonById(id);\n int index = persons.lastIndexOf(personFound);\n\n personFound = personRequested;\n personFound.setId(id);\n\n persons.set(index, personRequested);\n\n System.out.println(personRequested);\n return personRequested;\n }", "@Test\n public void updateConversationRest() {\n Conversation original = new Conversation();\n\n Conversation modified = restTemplate.postForObject(\n String.format(\"%s/api/conversations/%s\", baseUri(), MAIN_BLOG_NAME), original, Conversation.class);\n assertThat(modified).isNotNull();\n\n modified.setNumMessages(5);\n modified.setParticipant(\"new participant\");\n modified.setParticipantAvatarUrl(\"avatar URL\");\n modified.setParticipantId(\"pid123\");\n modified.setHideConversation(true);\n\n restTemplate.put(String.format(\"%s/api/conversations/%s/%d\", baseUri(), MAIN_BLOG_NAME, modified.getId()),\n modified);\n\n Conversation finalFromServer = restTemplate.getForObject(\n String.format(\"%s/api/conversations/%s/byParticipant/%s\", baseUri(), MAIN_BLOG_NAME, \"new participant\"),\n Conversation.class);\n\n assertThat(finalFromServer).isNotNull();\n assertThat(finalFromServer).isEqualToComparingFieldByField(modified);\n }", "public Player updatePlayer(Player player);", "public interface EditMatchInfoView extends RestView {\n\n void onUpdatedMatch(Match match);\n}", "@Override\r\n\tpublic void update(Connection con, Object obj) throws Exception {\n\t}", "@Override\r\n public void update(Vehicle vehicle) {\n }", "public void updateIdentities() {\n // get a list of the internal conversation addresses\n ArrayList<String> addresses = new ArrayList<>();\n for (int i = 0; i < size(); i++)\n addresses.add(get(i).getFromAddress());\n\n // retrieve and set the identities of the internal addresses\n ArrayList<String> identities = retrieveIdentities(addresses);\n for (int i = 0; i < size(); i++)\n get(i).setIdentity(identities.get(i));\n }", "@Override\r\n\tpublic void update(Object object) {\n\t\t\r\n\t}", "int updateByPrimaryKeySelective(CraftAdvReq record);", "public Client update(Client updated) throws EntityNotFoundException;", "@Override\n public void sendInitialUpdate(String username) {\n if (match == null) return;\n InitialUpdate update = match.generateUpdate();\n notifyObservers(username, update);\n }", "public abstract Response update(Request request, Response response);", "int updateByPrimaryKeySelective(GpPubgPlayer record);", "static void m125295a(MatchEntity matchEntity, Parcel parcel) {\n matchEntity.mTopicId = parcel.readString();\n matchEntity.mMatchId = parcel.readInt();\n matchEntity.mTeamA = parcel.readString();\n matchEntity.mTeamB = parcel.readString();\n matchEntity.mTimeStart = parcel.readLong();\n matchEntity.mPendingIntent = (PendingIntent) parcel.readParcelable(PendingIntent.class.getClassLoader());\n matchEntity.mAlarmManagerType = parcel.readInt();\n }", "public void updateClientBag()\n\t{\n\t\tfor(int i = 0; i < getBag().getItems().size(); i++)\n\t\t\tupdateClientBag(i);\n\t}", "public void updated(ServerList list);", "public void updateConnectedPlayers(ArrayList<Player> connectedPlayers) throws RemoteException{\n match.setPlayers(connectedPlayers);\n for (int i=0;i<match.getPlayers().size();i++){\n System.out.println(\"[LOBBY]: Player \"+ match.getPlayers().get(i).getNickname()+ \" is in lobby\");\n }\n System.out.println(\"[LOBBY]: Refreshing Lobby..\");\n Platform.runLater(() -> firstPage.refreshPlayersInLobby());// Update on JavaFX Application Thread\n }", "@Override\n public void update() {\n updateBuffs();\n }", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void update() {\n\t\t\r\n\t}", "void updatePlayer(Player player);", "@Override\n\tpublic void update(Object o) {\n\n\t}", "@Override\n\tpublic void update(Object o) {\n\n\t}", "public void updateClientMoney()\n\t{\n\t\tServerMessage message = new ServerMessage(ClientPacket.MONEY_CHANGED);\n\t\tmessage.addInt(m_money);\n\t\tgetSession().Send(message);\n\t}", "@Override\n\tpublic void update() { }", "@Override\n protected void updateProperties() {\n }", "public void updateCurrClient(){\n if ( ( ( client2 == currClient) && ( client3 != null ) ) || ( (client1 == currClient) && ( client2 == null ) ) ) {\n currClient = client3;\n } else if ( ( ( client3 == currClient) && ( client1 != null ) ) || ( ( client2 == currClient ) && ( client3 == null ) ) ) {\n currClient = client1;\n } else if ( ( ( client1 == currClient ) && ( client2 != null ) ) || ( ( client3 ==currClient) && ( client1 == null ) ) ) {\n currClient = client2;\n }\n }", "public void updateData() {}", "int updateByPrimaryKey(CraftAdvReq record);", "@Override\r\n\tpublic Client update(Client entity) {\n\t\treturn clientService.mergeClient(entity);//TODO update should only be based on baseEntityId\r\n\t}", "int updateByPrimaryKey(ScPartyMember record);", "Snapshot.Update update();", "@Override\n\tpublic int update(Reservation objet) {\n\t\treturn 0;\n\t}", "void updateCards(List<CardEntity> data);", "public void update()\n {\n this.controller.updateAll();\n theLogger.info(\"Update request recieved from UI\");\n }", "@Override\r\n\tpublic void update() {\r\n\r\n\t}", "@Override\r\n\tpublic void update() {\r\n\t}", "public void update(final Observable peer, final Object obj) {\n \t\tif (obj != null) {\n \t\t\tif (obj instanceof PhysicalObject) {\n \t\t\t\taddObject((PhysicalObject) obj);\n \t\t\t\t\n \t\t\t} else if (obj instanceof CollidableObject) {\n \t\t\t\taddObject(new PhysicalObject((CollidableObject) obj));\n \t\t\t}\n \t\t}\n \t}" ]
[ "0.63217974", "0.6116491", "0.6093341", "0.60359234", "0.58102447", "0.57826036", "0.57733935", "0.57029194", "0.56942934", "0.5627386", "0.5577913", "0.5574394", "0.5526116", "0.55162746", "0.5383062", "0.5356969", "0.535104", "0.535104", "0.535104", "0.534656", "0.534592", "0.53356135", "0.5333134", "0.5322161", "0.5322161", "0.5320117", "0.5307985", "0.5289941", "0.5289572", "0.5286396", "0.52733773", "0.5247054", "0.52412486", "0.52034926", "0.5202197", "0.5192853", "0.5189266", "0.51795125", "0.5167629", "0.5157818", "0.5155025", "0.51527214", "0.51355654", "0.5130567", "0.5111585", "0.5111585", "0.51088643", "0.5105905", "0.51049495", "0.5103464", "0.50869125", "0.50862855", "0.5085535", "0.50811464", "0.50808597", "0.507971", "0.50791985", "0.5078862", "0.5078862", "0.50777954", "0.5077695", "0.50763613", "0.5070686", "0.50698495", "0.50684804", "0.50659895", "0.5064809", "0.50625026", "0.5052751", "0.50469106", "0.50439394", "0.50386244", "0.50380045", "0.5037004", "0.5031299", "0.5028316", "0.5019808", "0.5015999", "0.5015999", "0.5015999", "0.5015999", "0.5015999", "0.50147355", "0.5013887", "0.5013887", "0.5012735", "0.50070214", "0.50065166", "0.50035846", "0.4996762", "0.4975658", "0.4975561", "0.49716318", "0.49713847", "0.4968678", "0.49641585", "0.49561626", "0.49546027", "0.49540854", "0.49525556" ]
0.60511196
3
Used to ask the map to the MASTER player (opens the chooseMap window)
public void askMap() throws Exception{ // Platform.runLater( () -> firstPage.closePrimaryStage()); chooseMap = new ChooseMap(); chooseMap.setRemoteController(senderRemoteController); Platform.runLater( () -> { // Update UI here. try { chooseMap.start(new Stage()); }catch (Exception e){ e.printStackTrace(); } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void mapshow() {\r\n showMap l_showmap = new showMap(d_playerList, d_country);\r\n l_showmap.check();\r\n }", "void willChooseGameMap() throws RemoteException;", "protected void showMap() {\n \t\t\n \t\tApplicationData applicationData;\n \t\ttry {\n \t\t\tapplicationData = ApplicationData.readApplicationData(this);\n \t\t\tif(applicationData != null){\n \t\t\t\tIntent intent = getIntent();\n \t\t\t\tNextLevel nextLevel = (NextLevel)intent.getSerializableExtra(ApplicationData.NEXT_LEVEL_TAG);\n \t\t\t\tAppLevelDataItem item = applicationData.getDataItem(this, nextLevel);\t\t\t\t\n \t\t\t\t\n \t\t\t\tif(Utils.hasLength(item.getGeoReferencia())){\n \t\t\t\t\tString urlString = \"http://maps.google.com/maps?q=\" + item.getGeoReferencia() + \"&near=Madrid,Espa�a\";\n \t\t\t\t\tIntent browserIntent = new Intent(\"android.intent.action.VIEW\", \n \t\t\t\t\t\t\tUri.parse(urlString ));\n \t\t\t\t\tstartActivity(browserIntent);\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (InvalidFileException e) {\n \t\t}\n \t}", "public void showMaps() throws Exception{\r\n MapMaintenanceBaseWindow mapMaintenanceBaseWindow = null;\r\n String unitNumber=mdiForm.getUnitNumber();\r\n \r\n if( ( mapMaintenanceBaseWindow = (MapMaintenanceBaseWindow)mdiForm.getFrame(\r\n CoeusGuiConstants.MAPS_BASE_FRAME_TITLE+\" \"+unitNumber))!= null ){\r\n if( mapMaintenanceBaseWindow.isIcon() ){\r\n mapMaintenanceBaseWindow.setIcon(false);\r\n }\r\n mapMaintenanceBaseWindow.setSelected( true );\r\n return;\r\n }\r\n \r\n MapMaintenanceBaseWindowController mapMaintenanceBaseWindowController = new MapMaintenanceBaseWindowController(unitNumber,false);\r\n mapMaintenanceBaseWindowController.display();\r\n \r\n }", "public void showmap() {\n MapForm frame = new MapForm(this.mapLayout);\n frame.setSize(750, 540);\n frame.setLocationRelativeTo(null);\n frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);\n frame.setVisible(true);\n }", "void chooseMap(String username);", "public void switchToMap()\n {\n feedbackLabel.setVisible(false);\n d.setVisible(false);\n a.setText(destinations[0].getName());\n b.setText(destinations[1].getName());\n c.setText(destinations[2].getName());\n currentClue=destinations[0].getRandClue();\n questionLabel.setText(currentClue);\n atQuestionStage=false;\n shuffleButtons();\n questionLabel.setBounds(650-questionLabel.getPreferredSize().width,120,600,30);\n mapImageLabel.setVisible(true);\n mapImageLabel.repaint();\n revalidate();\n }", "public void displayMap() {\n MapMenuView mapMenu = new MapMenuView();\r\n mapMenu.display();\r\n \r\n }", "void mapChosen(int map);", "public static void movePlayerToStartingLocation(Map map) {\n movePlayer(map, 2, 2); // or instead of 0,0 you can select a different starting location\r\n }", "protected void startMap(){\n Intent activityChangeIntent = new Intent(MainActivity.this, MapActivity.class);\n startActivity(activityChangeIntent);\n }", "private void openMapPicker() {\n PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();\n try {\n startActivityForResult(builder.build(this), AnyConstant.PLACE_PICKER_REQUEST);\n } catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException e) {\n e.printStackTrace();\n }\n }", "public int askMap();", "public void map(){\n this.isMap = true;\n System.out.println(\"Switch to map mode\");\n }", "private void showMapTypeSelectorDialog() {\n final String fDialogTitle = getActivity().getString(R.string.select_map);\n AlertDialog.Builder builder = new AlertDialog.Builder(getContext());\n builder.setTitle(fDialogTitle);\n\n // Find the current map type to pre-check the item representing the current state.\n int checkItem = map.getMapType() - 1;\n\n // Add an OnClickListener to the dialog, so that the selection will be handled.\n builder.setSingleChoiceItems(\n MAP_TYPE_ITEMS,\n checkItem,\n new DialogInterface.OnClickListener() {\n\n public void onClick(DialogInterface dialog, int item) {\n // Locally create a finalised object.\n Log.d(\"DIALOG\", String.valueOf(item));\n // Perform an action depending on which item was selected.\n switch (item) {\n case 0:\n map.setMapType(GoogleMap.MAP_TYPE_NORMAL);\n break;\n case 1:\n map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);\n break;\n case 2:\n map.setMapType(GoogleMap.MAP_TYPE_TERRAIN);\n break;\n case 3:\n map.setMapType(GoogleMap.MAP_TYPE_HYBRID);\n break;\n default:\n break;\n }\n dialog.dismiss();\n }\n }\n );\n\n // Build the dialog and show it.\n AlertDialog fMapTypeDialog = builder.create();\n fMapTypeDialog.setCanceledOnTouchOutside(true);\n fMapTypeDialog.show();\n }", "private void viewMap() {\r\n \r\n // Get the current game \r\n theGame = cityofaaron.CityOfAaron.getTheGame();\r\n \r\n // Get the map \r\n Map map = theGame.getMap();\r\n Location locations = null;\r\n \r\n // Print the map's title\r\n System.out.println(\"\\n*** Map: CITY OF AARON and Surrounding Area ***\\n\");\r\n // Print the column numbers \r\n System.out.println(\" 1 2 3 4 5\");\r\n // for every row:\r\n for (int i = 0; i < max; i++){\r\n // Print a row divider\r\n System.out.println(\" -------------------------------\");\r\n // Print the row number\r\n System.out.print((i + 1) + \" \");\r\n // for every column:\r\n for(int j = 0; j<max; j++){\r\n // Print a column divider\r\n System.out.print(\"|\");\r\n // Get the symbols and locations(row, column) for the map\r\n locations = map.getLocation(i, j);\r\n System.out.print(\" \" + locations.getSymbol() + \" \");\r\n }\r\n // Print the ending column divider\r\n System.out.println(\"|\");\r\n }\r\n // Print the ending row divider\r\n System.out.println(\" -------------------------------\\n\");\r\n \r\n // Print a key for the map\r\n System.out.println(\"Key:\\n\" + \"|=| - Temple\\n\" + \"~~~ - River\\n\" \r\n + \"!!! - Farmland\\n\" + \"^^^ - Mountains\\n\" + \"[*] - Playground\\n\" \r\n + \"$$$ - Capital \" + \"City of Aaron\\n\" + \"### - Chief Judge/Courthouse\\n\" \r\n + \"YYY - Forest\\n\" + \"TTT - Toolshed\\n\" +\"xxx - Pasture with \"\r\n + \"Animals\\n\" + \"+++ - Storehouse\\n\" +\">>> - Undeveloped Land\\n\");\r\n }", "private void setMapPos()\r\n {\r\n try\r\n {\r\n Thread.sleep(1000);//so that you can see players move\r\n }\r\n catch(Exception e){}\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n int unitPos = 0;\r\n int firstX = 0;\r\n int firstY = 0;\r\n if (currentPlayer == 1)\r\n {\r\n unitPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n }\r\n if (currentPlayer == 2)\r\n {\r\n unitPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n }\r\n int tempX = unitPos % mapWidth;\r\n int tempY = unitPos - tempX;\r\n if (tempY == 0) {}\r\n else\r\n tempY = tempY / mapHeight;\r\n tempX = tempX - 11;\r\n tempY = tempY - 7;\r\n if (tempX >= 0)\r\n firstX = tempX;\r\n else\r\n firstX = tempX + mapWidth;\r\n if (tempY >= 0)\r\n firstY = tempY;\r\n else\r\n firstY = tempY + mapWidth;\r\n\r\n int drawWidth = worldPanel.getDrawWidth();\r\n int drawHeight = worldPanel.getDrawHeight();\r\n worldPanel.setNewXYPos(firstX, firstY);\r\n miniMap.setNewXY(firstX, firstY, drawWidth, drawHeight);\r\n }", "private void inputLocation() {\n// boolean googleMapExist= (ConnectionResult.SUCCESS==GooglePlayServicesUtil.isGooglePlayServicesAvailable(mContext));\n//\n// if(googleMapExist) {\n// org.wowtalk.Log.w(\"google map exist\");\n// Intent mapIntent = new Intent(mContext, PickLocActivity.class);\n// mapIntent.putExtra(\"auto_loc\", true);\n// mContext.startActivityForResult(mapIntent, REQ_INPUT_LOC);\n// } else {\n //org.wowtalk.Log.w(\"google map not exist\");\n Intent mapIntent = new Intent(mContext, PickLocActivityWithAMap.class);\n mapIntent.putExtra(\"auto_loc\", true);\n mContext.startActivityForResult(mapIntent, REQ_INPUT_LOC);\n //}\n }", "public void win() {\n\n\t\t// exist next level?\n\t\tif (Project.project.getMaps().get(maptyp).size() > id + 1) {\n\t\t\tProject.project.startLevel(maptyp, id + 1);\n\n\t\t\t// save it\n\t\t\tif (Project.project.getMapLevel(maptyp) < id + 1) {\n\t\t\t\tProject.project.setMapLevel(maptyp, id + 1);\n\t\t\t}\n\t\t} else {\n\t\t\tPWindow.window.setActScene(new MessageScene(\"Gewonnen\", \"\", new MenuMainScene()));\n\t\t}\n\t}", "public void multiplayerSelected()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyDiscoveryState()\n clientController.searchForGames();\n\n //populate the GameSelectScreen's text box with the lobbies from the\n //state\n gameSelectScreen.clearGames();\n\n //set state to GAMESELECT\n state = CurrentWindow.GAMESELECT;\n\n //hide the intro screen and show the game select screen\n introScreen.setVisible(false);\n gameSelectScreen.setVisible(true);\n }", "public void startGame(int map) {\r\n if (!state[0]) {\r\n menu.setVisible(false);\r\n if (game == null) {\r\n game = new Game();\r\n game.setPreferredSize(new Dimension(GAME_WIDTH, GAME_HEIGHT));\r\n }\r\n game.map = map;\r\n frame.add(game, BorderLayout.CENTER);\r\n state[0] = true;\r\n game.setVisible(true);\r\n frame.pack();\r\n game.init();\r\n game.start();\r\n }\r\n }", "public void startGame(){\n System.out.println(\"[SERVER]: Starting a new game\");\n mainPage = new MainPage();\n mainPage.setMatch(match);\n mainPage.setRemoteController(senderRemoteController);\n\n Platform.runLater( () -> {\n try {\n firstPage.closePrimaryStage();\n if(chooseMap != null)\n chooseMap.closePrimaryStage();\n mainPage.start(new Stage());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n );\n }", "public void testMapping() {\n\t\ttry { Thread.sleep(1000); } catch (Exception e) { }\n\t\tPuzzleView view = app.getPuzzleView();\n\t\t\n\t\tapp.setVisible(true);\n\t\t\n\t}", "private void showMapAndSendCoordinate(String coordinateMap, String name) {\n showMapFragment = new ShowMapFragment();\n Bundle bundle = new Bundle();\n bundle.putString(\"LatLng\", coordinateMap);\n bundle.putString(\"Name\", name);\n showMapFragment.setArguments(bundle);\n\n getSupportFragmentManager()\n .beginTransaction()\n .replace(R.id.linearMap, showMapFragment)\n .commit();\n }", "public void setMap01(){\n\t\tmapSelect = \"map01.txt\";\n\t\treloadMap(mapSelect);\n\t\tsetImg(mapSelect);\n\t}", "public void setMap(String mn){\r\n mapName = mn;\r\n currentMap = new ImageIcon(mapName);\r\n }", "@Override\r\n public void ShowMaps() throws Exception {\r\n printInvalidCommandMessage();\r\n }", "@Override\n public void start(Stage primaryStage) {\n// if (screenWidth >= 414) {\n// screenWidth = 414;\n// }\n// if (screenHeight >= 736) {\n// screenHeight = 736;\n// }//preset stage/scene size\n\n //System.out.println(Integer.toString(screenWidth) + Integer.toString(screenHeight));\n System.out.print(\"Default:\");\n gameController = new GameController(1, 4);//default player and map size\n// gameController.newMapPane();//preload a Map Pane\n\n ScreenController mainContainer = new ScreenController();\n mainContainer.loadScreen(GroupGame.homeScreenID, GroupGame.homeScreenFile);\n mainContainer.loadScreen(GroupGame.newOptionID, GroupGame.newOptionFile);\n mainContainer.loadScreen(GroupGame.createPlayerID, GroupGame.createPlayerFile);\n mainContainer.loadScreen(GroupGame.MapScreenID, GroupGame.MapScreenFile);\n mainContainer.setScreen(GroupGame.homeScreenID);\n\n Group root = new Group();\n root.getChildren().addAll(mainContainer);\n Scene scene = new Scene(root);\n primaryStage.setScene(scene);\n primaryStage.show();\n }", "public void setMap()\n {\n gameManager.setMap( savedFilesFrame.getCurrent_index() );\n }", "public void showLobby() {\n \t\tgameMain.showScreen(lobby);\n \t}", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 0);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}", "public void showMap(boolean isEnd) {\n\t\t// Map shown inbetween games. Works by grabbing the system time in milliseconds,\n\t\t// adding 5000, and then counting down 1 second every second. Effectively keeping\n\t\t// the map screen up for 5 seconds.\n//\t\tif(legnum == 4) {\n//\t\t\treplay = new JButton(\"Replay\");\n//\t\t\treplay.setSize(frameWidth*5/100, frameHeight*5/100);\n//\t\t\tif(isOsprey) {\n//\t\t\t\treplay.setLocation((frameWidth/2)+frameWidth*30/100, frameHeight/2);\n//\t\t\t}\n//\t\t\telse {\n//\t\t\t\treplay.setLocation((frameWidth/2)+frameWidth*15/100, frameWidth/2);\n//\t\t\t}\n//\t\t\tframe.add(replay);\n//\t\t}\n\t\tlong tEnd = System.currentTimeMillis();\n\t\tframe.setVisible(true);\n\t\tlong tStart = tEnd + 3*1000;\n\t\twhile(tStart > tEnd) {\n\t\t\ttStart -= 1000;\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void askSpawn() throws RemoteException{\n respawnPopUp = new RespawnPopUp();\n respawnPopUp.setSenderRemoteController(senderRemoteController);\n respawnPopUp.setMatch(match);\n\n Platform.runLater(\n ()-> {\n try{\n respawnPopUp.start(new Stage());\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }\n );\n }", "@Override\n\tpublic void run() {\n\t\tfinal MapOptions options = MapOptions.create(); //Dhmiourgeia antikeimenou me Factory (xwris constructor)\n\t\t//Default na fenetai xarths apo doruforo (Hybrid)\n\t\toptions.setMapTypeId(MapTypeId.HYBRID);\n\t\toptions.setZoom(Map.GOOGLE_MAPS_ZOOM);\n\t\t//Dhmiourgei ton xarth me tis panw ruthmiseis kai to vazei sto mapDiv\n\t\tgoogleMap = GoogleMap.create(map, options);\n\t\t//Otan o xrhsths kanei click epanw ston xarth\n\t\tfinal MarkerOptions markerOptions = MarkerOptions.create();\n\t\tmarkerOptions.setMap(googleMap);\n\t\tmarker = Marker.create(markerOptions);\n\t\t//psaxnei antikeimeno gia na kentrarei o xarths kai na fortwsei h forma\n\t\tfinal String id = Window.Location.getParameter(\"id\");\n\t\tif (id == null) {\n\t\t\tWindow.alert(MOBILE_MEDIA_SHARE_MESSAGES.errorRetrievingMedium(\n\t\t\t\t\tMOBILE_MEDIA_SHARE_CONSTANTS.noMediaIdSpecified()));\n\t\t\t//redirect sto map\n\t\t\tWindow.Location.assign(MOBILE_MEDIA_SHARE_URLS.map(GWT.getHostPageBaseURL(), URL.encodeQueryString(\n\t\t\t\t\t//me to antistoixo locale \n\t\t\t\t\tLocaleInfo.getCurrentLocale().getLocaleName())));\n\t\t} else {\n\t\t\t//Klhsh tou MEDIA_SERVICE gia na paroume to antikeimeno (metadedomena)\n\t\t\tMEDIA_SERVICE.getMedia(id, new AsyncCallback<Media>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(final Throwable throwable) {\n\t\t\t\t\tWindow.alert(MOBILE_MEDIA_SHARE_MESSAGES.errorRetrievingMedium(throwable.getMessage()));\n\t\t\t\t\t//redirect sto map\n\t\t\t\t\tWindow.Location.assign(MOBILE_MEDIA_SHARE_URLS.map(GWT.getHostPageBaseURL(), URL.encodeQueryString(\n\t\t\t\t\t\t\t//me to antistoixo locale \n\t\t\t\t\t\t\tLocaleInfo.getCurrentLocale().getLocaleName())));\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onSuccess(final Media media) {\n\t\t\t\t\tif (media == null) {\n\t\t\t\t\t\tWindow.alert(MOBILE_MEDIA_SHARE_MESSAGES.errorViewingMedia(\n\t\t\t\t\t\t\t\tMOBILE_MEDIA_SHARE_CONSTANTS.mediaNotFound()));\n\t\t\t\t\t\t//redirect sto map\n\t\t\t\t\t\tWindow.Location.assign(MOBILE_MEDIA_SHARE_URLS.map(GWT.getHostPageBaseURL(), URL.encodeQueryString(\n\t\t\t\t\t\t\t\t//me to antistoixo locale \n\t\t\t\t\t\t\t\tLocaleInfo.getCurrentLocale().getLocaleName())));\n\t\t\t\t\t//o xrhsths vlepei to media giati einai diko tou 'h einai diaxeirisths 'h to media einai public\n\t\t\t\t\t} else if (currentUser.equals(media.getUser()) || (currentUser.getStatus() == UserStatus.ADMIN) || media.isPublic()) {\n\t\t\t\t\t\t//Gemisma tou div content analoga ton tupo\n\t\t\t\t\t\tswitch (MediaType.getMediaType(media.getType())) {\n\t\t\t\t\t\tcase APPLICATION:\n\t\t\t\t\t\t\tfinal ImageElement application = Document.get().createImageElement();\n\t\t\t\t\t\t\tapplication.setSrc(MOBILE_MEDIA_SHARE_URLS.selectedImage(GWT.getHostPageBaseURL(), MediaType.APPLICATION.name().toLowerCase()));\n\t\t\t\t\t\t\tapplication.setAlt(media.getTitle());\n\t\t\t\t\t\t\tapplication.getStyle().setWidth(CONTENT_WIDTH, Style.Unit.PX);\n\t\t\t\t\t\t\tapplication.getStyle().setHeight(CONTENT_HEIGHT, Style.Unit.PX);\n\t\t\t\t\t\t\tcontent.appendChild(application);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase AUDIO:\n\t\t\t\t\t\t\tfinal AudioElement audio = Document.get().createAudioElement();\n\t\t\t\t\t\t\taudio.setControls(true);\n\t\t\t\t\t\t\taudio.setPreload(AudioElement.PRELOAD_AUTO);\n\t\t\t\t\t\t\t//url sto opoio vriskontai ta dedomena tou antikeimenou. Ta travaei o browser\n\t\t\t\t\t\t\t//me xrhsh tou media servlet\n\t\t\t\t\t\t\tfinal SourceElement audioSource = Document.get().createSourceElement();\n\t\t\t\t\t\t\taudioSource.setSrc(MOBILE_MEDIA_SHARE_URLS.download(GWT.getHostPageBaseURL(), media.getId()));\n\t\t\t\t\t\t\taudioSource.setType(media.getType());\n\t\t\t\t\t\t\taudio.appendChild(audioSource);\n\t\t\t\t\t\t\tcontent.appendChild(audio);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase IMAGE:\n\t\t\t\t\t\t\tfinal ImageElement image = Document.get().createImageElement();\n\t\t\t\t\t\t\timage.setSrc(MOBILE_MEDIA_SHARE_URLS.download(GWT.getHostPageBaseURL(), media.getId()));\n\t\t\t\t\t\t\timage.setAlt(media.getTitle());\n\t\t\t\t\t\t\timage.getStyle().setWidth(CONTENT_WIDTH, Style.Unit.PX);\n\t\t\t\t\t\t\timage.getStyle().setHeight(CONTENT_HEIGHT, Style.Unit.PX);\n\t\t\t\t\t\t\tcontent.appendChild(image);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase TEXT:\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * @see http://www.gwtproject.org/doc/latest/tutorial/JSON.html#http\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tfinal ParagraphElement text = Document.get().createPElement();\n\t\t\t\t\t\t\ttext.getStyle().setWidth(CONTENT_WIDTH, Style.Unit.PX);\n\t\t\t\t\t\t\ttext.getStyle().setHeight(CONTENT_HEIGHT, Style.Unit.PX);\n\t\t\t\t\t\t\t//scrollbar gia to text\n\t\t\t\t\t\t\ttext.getStyle().setOverflow(Style.Overflow.SCROLL);\n\t\t\t\t\t\t\tcontent.appendChild(text);\n\t\t\t\t\t\t\t//Zhtaei asugxrona to periexomeno enos url\n\t\t\t\t\t\t\tfinal RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,\n\t\t\t\t\t\t\t\t\tMOBILE_MEDIA_SHARE_URLS.download(GWT.getHostPageBaseURL(), media.getId()));\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\trequestBuilder.sendRequest(null, new RequestCallback() {\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void onError(final Request request, final Throwable throwable) {\n\t\t\t\t\t\t\t\t\t\tWindow.alert(MOBILE_MEDIA_SHARE_MESSAGES.errorViewingMedia(throwable.getMessage()));\n\t\t\t\t\t\t\t\t\t\t//redirect sto map\n\t\t\t\t\t\t\t\t\t\tWindow.Location.assign(MOBILE_MEDIA_SHARE_URLS.map(GWT.getHostPageBaseURL(), URL.encodeQueryString(\n\t\t\t\t\t\t\t\t\t\t\t\t//me to antistoixo locale \n\t\t\t\t\t\t\t\t\t\t\t\tLocaleInfo.getCurrentLocale().getLocaleName())));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\t\t\tpublic void onResponseReceived(final Request request, final Response response) {\n\t\t\t\t\t\t\t\t\t\tif (response.getStatusCode() == Response.SC_OK) {\n\t\t\t\t\t\t\t\t\t\t\t//selida pou fernei to response se me to keimeno pros anazhthsh\n\t\t\t\t\t\t\t\t\t\t\ttext.setInnerText(response.getText());\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t//selida pou efere to response se periptwsh sfalmatos (getText())\n\t\t\t\t\t\t\t\t\t\t\tWindow.alert(MOBILE_MEDIA_SHARE_MESSAGES.errorViewingMedia(response.getText()));\n\t\t\t\t\t\t\t\t\t\t\t//redirect sto map\n\t\t\t\t\t\t\t\t\t\t\tWindow.Location.assign(MOBILE_MEDIA_SHARE_URLS.map(GWT.getHostPageBaseURL(), URL.encodeQueryString(\n\t\t\t\t\t\t\t\t\t\t\t\t\t//me to antistoixo locale \n\t\t\t\t\t\t\t\t\t\t\t\t\tLocaleInfo.getCurrentLocale().getLocaleName())));\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} catch (final RequestException e) {\n\t\t\t\t\t\t\t\tWindow.alert(MOBILE_MEDIA_SHARE_MESSAGES.errorViewingMedia(e.getMessage()));\n\t\t\t\t\t\t\t\t//redirect sto map\n\t\t\t\t\t\t\t\tWindow.Location.assign(MOBILE_MEDIA_SHARE_URLS.map(GWT.getHostPageBaseURL(), URL.encodeQueryString(\n\t\t\t\t\t\t\t\t\t\t//me to antistoixo locale \n\t\t\t\t\t\t\t\t\t\tLocaleInfo.getCurrentLocale().getLocaleName())));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase VIDEO:\n\t\t\t\t\t\t\tfinal VideoElement video = Document.get().createVideoElement();\n\t\t\t\t\t\t\tvideo.setPoster(MOBILE_MEDIA_SHARE_URLS.selectedImage(GWT.getHostPageBaseURL(), MediaType.VIDEO.name().toLowerCase()));\n\t\t\t\t\t\t\tvideo.setControls(true);\n\t\t\t\t\t\t\tvideo.setPreload(VideoElement.PRELOAD_AUTO);\n\t\t\t\t\t\t\tvideo.setWidth(Double.valueOf(CONTENT_WIDTH).intValue());\n\t\t\t\t\t\t\tvideo.setHeight(Double.valueOf(CONTENT_HEIGHT).intValue());\n\t\t\t\t\t\t\tfinal SourceElement videoSource = Document.get().createSourceElement();\n\t\t\t\t\t\t\tvideoSource.setSrc(MOBILE_MEDIA_SHARE_URLS.download(GWT.getHostPageBaseURL(), media.getId()));\n\t\t\t\t\t\t\tvideoSource.setType(media.getType());\n\t\t\t\t\t\t\tvideo.appendChild(videoSource);\n\t\t\t\t\t\t\tcontent.appendChild(video);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//O current user peirazei to media an einai diko tou 'h an einai diaxeirisths\n\t\t\t\t\t\tif (currentUser.equals(media.getUser()) || (currentUser.getStatus() == UserStatus.ADMIN)) {\n\t\t\t\t\t\t\tedit.setEnabled(true);\n\t\t\t\t\t\t\tdelete.setEnabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttitle.setText(media.getTitle());\n\t\t\t\t\t\t//prosthikh html (keimeno kai eikona) stin selida\n\t\t\t\t\t\ttype.setHTML(List.TYPE.getValue(media));\n\t\t\t\t\t\t//analoga ton tupo dialegetai to katallhlo eikonidio\n\t\t\t\t\t\tmarker.setIcon(MarkerImage.create(MOBILE_MEDIA_SHARE_URLS.selectedImage(GWT.getHostPageBaseURL(), \n\t\t\t\t\t\t\t\tMediaType.getMediaType(media.getType()).name().toLowerCase())));\n\t\t\t\t\t\tsize.setText(List.SIZE.getValue(media));\n\t\t\t\t\t\tduration.setText(List.DURATION.getValue(media));\n\t\t\t\t\t\tuser.setText(List.USER.getValue(media));\n\t\t\t\t\t\tcreated.setText(List.CREATED.getValue(media));\n\t\t\t\t\t\tedited.setText(List.EDITED.getValue(media));\n\t\t\t\t\t\tpublik.setHTML(List.PUBLIC.getValue(media));\n\t\t\t\t\t\tlatitudeLongitude.setText(\"(\" + List.LATITUDE.getValue(media) + \", \" + List.LONGITUDE.getValue(media) + \")\");\n\t\t\t\t\t\tfinal LatLng latLng = LatLng.create(media.getLatitude().doubleValue(), media.getLongitude().doubleValue());\n\t\t\t\t\t\tgoogleMap.setCenter(latLng);\n\t\t\t\t\t\tmarker.setPosition(latLng);\n\t\t\t\t\t} else { //Vrethike to media alla einai private allounou\n\t\t\t\t\t\tWindow.alert(MOBILE_MEDIA_SHARE_MESSAGES.errorViewingMedia(\n\t\t\t\t\t\t\t\tMOBILE_MEDIA_SHARE_CONSTANTS.accessDenied()));\n\t\t\t\t\t\t//redirect sto map\n\t\t\t\t\t\tWindow.Location.assign(MOBILE_MEDIA_SHARE_URLS.map(GWT.getHostPageBaseURL(), \n\t\t\t\t\t\t\t\tURL.encodeQueryString(LocaleInfo.getCurrentLocale().getLocaleName())));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "public void enterPlayerView(){\n\t\tplayerSeen=true;\r\n\t\tplayerMapped=true;\r\n\t}", "public void singlePlayerSelected()\n {\n //call Client Controller's setState method with\n //a parameter of new ClientLobbyState()\n clientController.startSinglePlayerGame();\n }", "public void clickOnMainMap(MouseEvent e) {\n //button 1\n //on stack\n //on planet\n Point p = SU.getSpaceMapClickPoint(e);\n\n if (e.getButton() == MouseEvent.BUTTON3) {\n SU.clickOnSpaceMapButton3(p);\n } else if (e.getButton() == MouseEvent.BUTTON1) {\n clickOnSpaceMapButton1(p);\n }\n }", "private boolean setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))\n .getMap();\n\n if (mMap == null) {\n Log.e(TAG, \"Can not find map\");\n return false;\n }\n\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap();\n }\n }\n\n if (bCurrentPos!= null)\n bCurrentPos.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n goCurrentLocation(mMap);\n }\n });\n\n return true;\n\n }", "private void setUpMap() throws IOException {\n // Get last location which means current location\n lastKnownLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);\n\n if (lastKnownLocation != null) {\n // shift view to current location\n LatLng latlng = new LatLng(lastKnownLocation.getLatitude(), lastKnownLocation.getLongitude());\n Geocoder geocoder = new Geocoder(this);\n adminArea = geocoder.getFromLocation(latlng.latitude, latlng.longitude, 1).get(0).getAdminArea();\n CameraUpdate update = CameraUpdateFactory.newLatLngZoom(latlng, 12);\n mMap.moveCamera(update);\n } else {\n Toast.makeText(this, \"Current Location is not Available\", Toast.LENGTH_SHORT).show();\n }\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 2);\n\t\t\t\tintent.putExtra(\"latc\", 13.0827);\n\t\t\t\tintent.putExtra(\"lngc\", 80.2707);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}", "public void showMap(Uri geoLocation) {\n Intent intent = new Intent(Intent.ACTION_VIEW);\n intent.setData(geoLocation);\n if (intent.resolveActivity(getPackageManager()) != null) {\n startActivity(intent);\n }\n }", "public boolean initiateMovePrompt(MapPanel caller) {\n\t\tif(activePath == null || !pf.isValidPath(activePath))\n\t\t\treturn false;\n\t\tlog.log(\"Now prompting player for move.\");\n\t\tMapViewListener l = caller.getMapViewListener();\n\t\tl.setStatus(GameState.PLAYER_CONFIRMING_MOVE);\n\t\tattackableFromHere = canAttackFromDestination();\n\t\twithinRange = findSquaresWithinAtkRange();\n\t\tl.setMoveMenu(caller, attackableFromHere.size() != 0);\n\t\treturn true;\n\t}", "public void mapMode() {\n\t\ttheTrainer.setUp(false);\n\t\ttheTrainer.setDown(false);\n\t\ttheTrainer.setLeft(false);\n\t\ttheTrainer.setRight(false);\n\n\t\tinBattle = false;\n\t\tred = green = blue = 255;\n\t\tthis.requestFocus();\n\t}", "public void chooseLocation(View v) {\n InternetConnectionChecker checker = new InternetConnectionChecker();\n Context context = getApplicationContext();\n final boolean isOnline = checker.isOnline(context);\n\n if (isOnline) {\n if (currentLocationCheckbox.isChecked()) {\n Toast.makeText(getApplicationContext(), \"Sorry, You have already chosen CURRENT LOCATION.\", Toast.LENGTH_LONG).show();\n } else {\n Intent child = new Intent(getApplicationContext(), ChooseLocationOnMapActivity.class);\n startActivityForResult(child, REQ_CODE_CHILD);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Map is not available when this device is offline.\", Toast.LENGTH_LONG).show();\n }\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MapActivity.class);\n\t\t\t\tintent.putExtra(\"Choice\", 1);\n\t\t\t\tintent.putExtra(\"latb\", 12.9716);\n\t\t\t\tintent.putExtra(\"lngb\", 77.5946);\n\t\t\t\tstartActivity(intent);\n\n\t\t\t}", "private JButton defaultMap() {\n JButton defaultMap = new JButton(\"Default maps\");\n defaultMap.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n builder.defaultMap();\n window.setVisible(false);\n }\n });\n return defaultMap;\n }", "void switchToMapSelectActivity();", "public static void printAvailableMaps() {\n \tFile folder = new File(\"./examples/\");\n \tFile[] listOfFiles = folder.listFiles();\n \tSystem.out.println(\"Available maps (choose one and start game with command 'game map_name' ) : \");\n\n \t for (int i = 0; i < listOfFiles.length; i++) {\n \t if (listOfFiles[i].isFile()) {\n \t System.out.println(\"\\t\"+listOfFiles[i].getName());\n \t } \n \t }\n }", "public void chooseBonusTile(Map<Integer, String> bonusTiles) {\n bonusTilePane.setVisible(true);\n bonusTileController.setBonusTiles(bonusTiles);\n }", "@SuppressWarnings(\"all\")\r\n\tpublic Map(String map, Location mapLocation){\r\n\t\tMapPreset preset = MapPreset.presets.get(map);\r\n\t\tif (preset != null){\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tfinal World world = mapLocation.getWorld();\r\n\t\t\t\tfinal double x = mapLocation.getX();\r\n\t\t\t\tfinal double y = mapLocation.getY();\r\n\t\t\t\tfinal double z = mapLocation.getZ();\r\n\t\t\t\tfinal float pitch = mapLocation.getPitch();\r\n\t\t\t\tfinal float yaw = mapLocation.getYaw();\r\n\t\t\t\t\t\t\r\n\t\t\t\tfinal Float[] alliesBase = preset.getSpawnAllies();\r\n\t\t\t\tfinal Float[] axisBase = preset.getSpawnAxis();\r\n\t\t\t\t\r\n\t\t\t\tfinal Float[] bombA = preset.getBombA();\r\n\t\t\t\tfinal Float[] bombB = preset.getBombB();\r\n\t\t\t\t\r\n\t\t\t\tfinal Float[] domA = preset.getDomA();\r\n\t\t\t\tfinal Float[] domB = preset.getDomB();\r\n\t\t\t\tfinal Float[] domC = preset.getDomC();\r\n\t\t\t\t\r\n\t\t\t\tmainSpawn = mapLocation;\r\n\t\t\t\talliesSpawn = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + alliesBase[0], \r\n\t\t\t\t\t\ty + alliesBase[1], \r\n\t\t\t\t\t\tz + alliesBase[2],\r\n\t\t\t\t\t\talliesBase[3], \r\n\t\t\t\t\t\talliesBase[4]);\r\n\t\t\t\t\r\n\t\t\t\taxisSpawn = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + axisBase[0], \r\n\t\t\t\t\t\ty + axisBase[1], \r\n\t\t\t\t\t\tz + axisBase[2],\r\n\t\t\t\t\t\taxisBase[3], \r\n\t\t\t\t\t\taxisBase[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.bombA = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + bombA[0], \r\n\t\t\t\t\t\ty + bombA[1], \r\n\t\t\t\t\t\tz + bombA[2],\r\n\t\t\t\t\t\tbombA[3], \r\n\t\t\t\t\t\tbombA[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.bombB = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + bombB[0], \r\n\t\t\t\t\t\ty + bombB[1], \r\n\t\t\t\t\t\tz + bombB[2],\r\n\t\t\t\t\t\tbombB[3], \r\n\t\t\t\t\t\tbombB[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domA = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domA[0], \r\n\t\t\t\t\t\ty + domA[1], \r\n\t\t\t\t\t\tz + domA[2],\r\n\t\t\t\t\t\tdomA[3], \r\n\t\t\t\t\t\tdomA[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domB = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domB[0], \r\n\t\t\t\t\t\ty + domB[1], \r\n\t\t\t\t\t\tz + domB[2],\r\n\t\t\t\t\t\tdomB[3], \r\n\t\t\t\t\t\tdomB[4]);\r\n\t\t\t\t\r\n\t\t\t\tthis.domC = new Location(\r\n\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\tx + domC[0], \r\n\t\t\t\t\t\ty + domC[1], \r\n\t\t\t\t\t\tz + domC[2],\r\n\t\t\t\t\t\tdomC[3], \r\n\t\t\t\t\t\tdomC[4]);\r\n\t\t\t\t\r\n\t\t\t\tfor (Float[] spawnpoint : preset.getSpawnpoints()){\r\n\t\t\t\t\tspawnsList.add(new Location(\r\n\t\t\t\t\t\t\tworld, \r\n\t\t\t\t\t\t\tx + spawnpoint[0], \r\n\t\t\t\t\t\t\ty + spawnpoint[1], \r\n\t\t\t\t\t\t\tz + spawnpoint[2], \r\n\t\t\t\t\t\t\tspawnpoint[3], \r\n\t\t\t\t\t\t\tspawnpoint[4]));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tmapID = maps.size()+1;\r\n\t\t\t\tmapName = map;\r\n\t\t\t\tmapAvailable.add(mapID);\r\n\t\t\t\tmaps.put(maps.size()+1, this);\r\n\t\t\t} catch (Exception e){\r\n\t\t\t\tFPSCaste.log(\"Something went wrong! disabling map: \" + map, Level.WARNING);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tFPSCaste.log(\"Could not initialise the Map \" + map, Level.WARNING);\r\n\t\t}\r\n\t}", "public void printMiniMap() \n { \n /* this.miniMapFrame(); */\n }", "@Override\r\n public void mapshow()\r\n {\r\n printInvalidCommandMessage();\r\n }", "public void runGame(GameMap startMap) throws RemoteException{\n\t\tDebug.log(\"Player\", \"game start signal received\");\n\t\tthis.playerMap = startMap;\n\n\t\tif(gui.isClosed()) return; // if gui closed, did the impatient user close the window?\n\n\t\t/* Update GUI */\n\t\tsynchronized(GameMap.gameMapLock){\n\t\t\tgui.setPlayerDetails(playerId, playerDetails.getUsername());\n\t\t\tgui.setGameMap(playerMap);\n\t\t\tgui.refresh();\n\t\t}\n\n\t\t/* Get the move from the user OR get the latest game map */\n\t\twhile(!gui.isClosed()){ // as long as the user didn't close the window\n\n\t\t\t/* Wait a while for fairness */\n\t\t\tdelay(moveTime);\n\n\t\t\t/* Find something to do */\n\t\t\tsynchronized(GameMap.gameMapLock){\n\n\t\t\t\t/* Is there any valid move? */\n\t\t\t\tint moveDirection = gui.getUserInput();\n\n\t\t\t\tif(GameMap.isValidDirection(moveDirection)){ // just confirm if the movement keys are valid\n\n\t\t\t\t\t/* Movement */\n\t\t\t\t\tDebug.log(\"Player\", \"User input detected!\");\n\t\t\t\t\tCoordinates moveCoords = playerMap.getMoveCoords(currentPosition, moveDirection);\n\t\t\t\t\tDebug.log(\"Player\", \"New coords: \" + moveCoords);\n\n\t\t\t\t\t/* Send the move to the server */\n\t\t\t\t\tsendMove(moveCoords, false);\n\n\t\t\t\t}else if(moveDirection == GameMap.RESET){\n\n\t\t\t\t\t/* Reset */\n\t\t\t\t\tDebug.log(\"Player\", \"User asked for reset\");\n\n\t\t\t\t\t/* Do we have any resets left? */\n\t\t\t\t\tif(resetsLeft <= 0){\n\t\t\t\t\t\tDebug.log(\"Player \" + playerId, \"Resets exhausted\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\t/* Send the move to the server */\n\t\t\t\t\t\tsendMove(playerMap.CENTRE, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = null,chooser = null;\n\t\t\t\tintent = new Intent(android.content.Intent.ACTION_VIEW);\n\t \t\t//For any Action\n\t \t\tintent.setData(Uri.parse(\"geo:27.961429,76.402788\"));\n\t \t\tchooser = Intent.createChooser(intent,\"MAPS Launch\");\n\t \t\tstartActivity(chooser);\n\t\t\t}", "private void pickCurrentPlace() {\n if (mMap == null) {\n return;\n }\n\n if (mLocationPermissionGranted) {\n getDeviceLocation();\n } else {\n getLocationPermission();\n }\n }", "public void mapsOpen (View view) {\n Intent mapIntent = new Intent(this, MapsActivity.class);\n startActivity(mapIntent);\n }", "public Player(int aMapPort,String aCompName, String aMapName)\r\n\t{\r\n\t\tmapPort = aMapPort;\r\n\t\tcompName = aCompName;\r\n\t\tmapName = aMapName;\r\n\t\t\r\n\t\tJFrame frameBoard = new JFrame();\r\n\t\tframeBoard.setTitle(\"MapFrame \"+mapName);\r\n\t\tframeBoard.setSize(800, 480);\r\n\t\tframeBoard.setLocation(450, 100);\r\n\t\tframeBoard.setResizable(false);\r\n\t\t\r\n\t\tSystem.out.println(\"We got so far\");\t\r\n\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tgetInfo();\r\n\t\t\t board = new Hub_Board(sizeX, sizeY, frameBoard.getContentPane(),value,mapName);\r\n\t\t\t setPlayerPosition();\r\n\t\t\tframeBoard.setVisible(true);\r\n\t\t\t\r\n\t\t\tfieldArray = board.getArray();\r\n\t\t\t\r\n\t\t} catch (UnknownHostException e) {\r\n\t\t\tSystem.out.println(\"Exception occured\");\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Exception occured\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\nSystem.out.println(\"We are victorious with matthiew\");\r\n\t\t \r\n\t}", "public static void main(String[] args)\n\t{\n\t\tloginWindow = new ClientLogonDialog(null);\n\t\t\n\t\t// If the user quit the dialog, we must quit\n\t\tif (!loginWindow.show())\n\t\t\tSystem.exit(0);\n\t\t// Else play the game\n\n\t\tMap map;\n\t\tGameEngine game;\n\t\tdo\n\t\t{\n\t\t\t// This grabs a random map on startup\n\t\t\tmap = new Map(MAP_LIST[RANDOM.nextInt(MAP_LIST.length)]);\n Random random = new Random();\n char playerId = (char) random.nextInt(MAX_PLAYERS);\n //System.out.println(playerId);\n\t\t\tgame = new GameEngine(map, playerId, loginWindow.getUserName(), false);\n\t\t\t\n\t\t\t// Set up the game gameWindow\n\t\t\tgameWindow = new JDialog();\n\t\t\tgameWindow.setTitle(CLIENT_WINDOW_NAME);\n\t\t\tgameWindow.setModal(true);\n\t\t\t\n\t\t\tgameWindow.getContentPane().add(game.getGameViewArea(), BorderLayout.CENTER);\n\t\t\t\n\t\t\tgameWindow.pack();\n\t\t\tgameWindow.setLocationRelativeTo(null);\n\t\t\t\n ClientWindow s = new ClientWindow(game);\n\n s.start();\n\t\t\t\n\t\t\tgame.registerActionListeners(gameWindow);\n\t\t\t// Play the game once:\n\t\t\tgameWindow.setVisible(true);\n\t\t\tgame.unregisterActionListeners(gameWindow);\n\t\t\t\n\t\t\t// Show the login dialog again\n\t\t}\n\t\twhile (loginWindow != null && loginWindow.show());\n\t\t// If quit, don't loop\n\t\t\n\t\t// TEMP: this is for testing only:\n\t\tgameWindow.dispose();\n\t\t\n\t\tSystem.exit(0);\n\t}", "void chooseStarterPlayer() {\n\t\tSystem.out.println(\"\\nWer beginnt?\");\n\t\tSystem.out.println(\"1 - Computer\");\n\t\tSystem.out.println(\"2 - Human\");\n\t}", "private void startGame() {\r\n\t\tthis.gameMap.startGame();\r\n\t}", "public static void intro(){\n System.out.println(\"Welcome to Maze Runner!\");\n System.out.println(\"Here is your current position:\");\n myMap.printMap();\n\n }", "@Override\n\tpublic void setMap(ServerMap map, Direction dir)\n\t{\n\t\tchar direction = 'n';\n\t\tif(dir != null)\n\t\t\tswitch(dir)\n\t\t\t{\n\t\t\t\tcase Up:\n\t\t\t\t\tdirection = 'u';\n\t\t\t\t\tbreak;\n\t\t\t\tcase Down:\n\t\t\t\t\tdirection = 'd';\n\t\t\t\t\tbreak;\n\t\t\t\tcase Left:\n\t\t\t\t\tdirection = 'l';\n\t\t\t\t\tbreak;\n\t\t\t\tcase Right:\n\t\t\t\t\tdirection = 'r';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\tsuper.setMap(map, dir);\n\t\tclearRequests();\n\t\t/* Send the map switch packet to the client. */\n\t\tServerMessage message = new ServerMessage(ClientPacket.SET_MAP_AND_WEATHER);\n\t\tmessage.addString(java.lang.Character.toString(direction));\n\t\tmessage.addInt(map.getX());\n\t\tmessage.addInt(map.getY());\n\t\tmessage.addInt(map.isWeatherForced() ? map.getWeatherId() : TimeService.getWeatherId());\n\t\tgetSession().Send(message);\n\t\tCharacter c;\n\t\tString packet = \"\";\n\t\t/* Send all player information to the client. */\n\t\tfor(Player p : map.getPlayers().values())\n\t\t{\n\t\t\tc = p;\n\t\t\tpacket = packet + c.getName() + \",\" + c.getId() + \",\" + c.getSprite() + \",\" + c.getX() + \",\" + c.getY() + \",\"\n\t\t\t\t\t+ (c.getFacing() == Direction.Down ? \"D\" : c.getFacing() == Direction.Up ? \"U\" : c.getFacing() == Direction.Left ? \"L\" : \"R\") + \",\" + p.getAdminLevel() + \",\";\n\t\t}\n\t\t/* Send all npc information to the client. */\n\t\tfor(int i = 0; i < map.getNpcs().size(); i++)\n\t\t{\n\t\t\tc = map.getNpcs().get(i);\n\t\t\tif(!c.getName().equalsIgnoreCase(\"NULL\"))\n\t\t\t\t/* Send no name to indicate NPC */\n\t\t\t\tpacket = packet + \"!NPC!,\" + c.getId() + \",\" + c.getSprite() + \",\" + c.getX() + \",\" + c.getY() + \",\"\n\t\t\t\t\t\t+ (c.getFacing() == Direction.Down ? \"D\" : c.getFacing() == Direction.Up ? \"U\" : c.getFacing() == Direction.Left ? \"L\" : \"R\") + \",0,\";\n\t\t}\n\t\t/* Only send the packet if there were players on the map */\n\t\t/* TODO: Clean this stuff up? */\n\t\tif(packet.length() > 2)\n\t\t{\n\t\t\tServerMessage initPlayers = new ServerMessage(ClientPacket.INIT_PLAYERS);\n\t\t\tinitPlayers.addString(packet);\n\t\t\tgetSession().Send(initPlayers);\n\t\t}\n\t}", "@Override\n public void onClick(View view) {\n Uri gmmIntentUri = Uri.parse(\"geo:0,0?q=\" + selected_location);\n Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);\n mapIntent.setPackage(\"com.google.android.apps.maps\");\n if (mapIntent.resolveActivity(getActivity().getPackageManager()) != null) {\n startActivity(mapIntent);\n }\n }", "public void showMapTypePanel(){\n mapTypePanel.showMapTypePanel();\n if(mapTypePanel.isVisible() && optionsPanel.isVisible()){\n optionsPanel.setVisible(false);\n if(iconPanel.isVisible()) iconPanel.setVisible(false);\n }\n if(routePanel.isVisible()) routePanel.setVisible(false); closeDirectionList();\n canvas.repaint();\n }", "@Override\n public void onClick(View view) {\n Uri gmmIntentUri = Uri.parse(\"geo:0, 0?q=Animal+Shelter+near+me\");\n Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);\n mapIntent.setPackage(\"com.google.android.apps.maps\");\n startActivity(mapIntent);\n }", "public void sendMap ( MapView map ) {\n\t\texecute ( handle -> handle.sendMap ( map ) );\n\t}", "public void createMapIntent(View view){\n Uri uri = Uri.parse(\"geo:0,0?q=\" + Uri.encode(\"12 Community Rd, Allen, Ikeja, Lagos\"));\n\n //Step 2: Create a mapIntent with action \"Intent.ACTION_VIEW\". Pass the data too\n Intent mapIntent = new Intent(Intent.ACTION_VIEW, uri);\n\n //Step 3: Set the package name of the Map App (i.e the unique name of the app)\n //E.g mapIntent.setPackage(\"com.google.android.apps.maps\");\n mapIntent.setPackage(\"com.google.android.apps.maps\");\n\n //Step 4: Check if the Map app is available to ACCEPT this intent, if Map app is available, start the Map Activity\n if(mapIntent.resolveActivity(getPackageManager()) != null){\n startActivity(mapIntent);\n }\n else{\n Toast.makeText(this, \"No available client\", Toast.LENGTH_LONG).show();\n }\n\n }", "private void openPreferredLocationMap()\n\t{\n\n\t\tif (_forecastAdapter != null)\n\t\t{\n\t\t\tCursor cursor = _forecastAdapter.getCursor();\n\n\t\t\tif (cursor != null)\n\t\t\t{\n\t\t\t\tcursor.moveToPosition(0);\n\n\t\t\t\tString posLat = cursor.getString(COL_COORD_LAT);\n\t\t\t\tString posLong = cursor.getString(COL_COORD_LONG);\n\n\t\t\t\tUri geoLocation = Uri.parse(\"geo:\" + posLat + \",\" + posLong);\n\n\t\t\t\tIntent intent = new Intent(Intent.ACTION_VIEW);\n\t\t\t\tintent.setData(geoLocation);\n\n\t\t\t\tif (intent.resolveActivity(getActivity().getPackageManager()) != null)\n\t\t\t\t{\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tTraceUtil.logD(CLASS_NAME, \"openPreferredLocationMap\",\n\t\t\t\t\t\t\t\"Couldn't call \" + geoLocation.toString() +\n\t\t\t\t\t\t\t\t\t\", no receiving apps installed!\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override public void doAction(int option)\r\n{\r\n switch(option)\r\n {\r\n case 1: //view the map\r\n viewMap();\r\n break;\r\n case 2: //view/print a list\r\n viewList();\r\n break;\r\n case 3: // Move to a new location\r\n moveToNewLocation();\r\n break;\r\n case 4: // Manage the crops\r\n manageCrops();\r\n break;\r\n case 5: // Return to Main Menu\r\n System.out.println(\"You will return to the Main Menu now\");\r\n \r\n }\r\n}", "private void setUpOverview() {\n mapInstance = GameData.getInstance();\n //get reference locally for the database\n db = mapInstance.getDatabase();\n\n //retrieve the current player and the current area\n currentPlayer = mapInstance.getPlayer();\n\n }", "public MapGenerator(GameMap map) {\n\n gameMap = map;\n setGuiHashMap();\n firstCountryFlag=true;\n validator = new MapValidator(gameMap);\n }", "public void SetupMap()\n {\n mMap.setMyLocationEnabled(true);\n\n // GAME LatLng\n LatLng latLng = new LatLng(53.227668, -0.540038);\n\n // Create instantiate Marker\n MarkerOptions markerOptions = new MarkerOptions();\n markerOptions.position(latLng);\n markerOptions.draggable(false);\n markerOptions.title(\"GAME\");\n\n MapsInitializer.initialize(getActivity());\n // Create Marker at pos\n mMap.addMarker(markerOptions);\n // Position Map Camera to pos\n mMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition(latLng, 100, 0, 0)));\n }", "private void choseLocal(java.awt.event.MouseEvent evt) { \n\t\tgameChoice = 'a';\n\t\twindowComplete = true;\n\t}", "@Override\n public void onMapClick(LatLng arg0) {\n mBaiduMap.hideInfoWindow();\n if (window != null) {\n window.showAtLocation(search, Gravity.BOTTOM, 0, 0);\n }\n }", "@FXML\n\tpublic void loadMap(ActionEvent ev) {\n menuBar.getScene().getWindow().hide();\n \n\t\tStage map = new Stage();\n\t\ttry {\n\t\t\tParent root = FXMLLoader.load(getClass().getResource(\"/FXML/Map.fxml\"));\n\t\t\tScene scene = new Scene(root);\n\t\t\tmap.setScene(scene);\n\t\t\tmap.show();\n\t\t\tmap.setResizable(false);\n\t\t\tmap.centerOnScreen();\n\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\t\n\t}", "@FXML\n\tpublic void loadMap(ActionEvent ev) {\n menuBar.getScene().getWindow().hide();\n \n\t\tStage map = new Stage();\n\t\ttry {\n\t\t\tParent root = FXMLLoader.load(getClass().getResource(\"/FXML/Map.fxml\"));\n\t\t\tScene scene = new Scene(root);\n\t\t\tmap.setScene(scene);\n\t\t\tmap.show();\n\t\t\tmap.setResizable(false);\n\t\t\tmap.centerOnScreen();\n\n\t\t} catch (IOException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\t\n\t}", "public void looser()\n {\n this.mapFrame.looser();\n }", "public void multiPlayerChosen(){\n IP = view.ipTF.getText();\n ConnectingViewController connecting = new ConnectingViewController(this, IP);\n connecting.showView();\n this.hideView();\n }", "@Override\n public void run() {\n AlertDialog.Builder dialog = new AlertDialog.Builder( getMapController().getContext());\n dialog.setTitle(geoCode.getDisplayName());\n dialog.show();\n }", "public void setShowMap( boolean show )\r\n {\r\n showMap = show;\r\n }", "private void broadcast() {\n for (int key : bootstrapMap.keySet()) {\n bootstrapMap.get(key).getBroadcastView().show(Colors.BLUE + gameService.getCurrentPlayer().getName() + Colors.NOCOLOR, lastAnswer);\n }\n gameService.upDateCurrentPlayer();\n }", "private void launchLocal(String name) {\n Intent loc = new Intent(homeActivity.this, cardsMenu.class);\n Bundle b = new Bundle();\n b.putString(\"key\",\"local\"); //pass along that this will be a single player multigame\n b.putString(\"name\",name); //pass the player's name\n // b.putString(\"State\", State); //pass along the game type\n loc.putExtras(b);\n startActivity(loc);\n\n }", "public void switchToCountry()\n {\n questionLabel.setText(currentQuestion.getQuestion());\n d.setVisible(true);\n atQuestionStage=true;\n mapImageLabel.setVisible(false);\n a.setText(\"A\");\n b.setText(\"B\");\n c.setText(\"C\");\n a.setBounds(380,220,a.getPreferredSize().height+20,30);\n b.setBounds(500,220,b.getPreferredSize().height+20,30);\n c.setBounds(380,320,c.getPreferredSize().height+20,30);\n d.setBounds(500,320,d.getPreferredSize().height+20,30);\n questionLabel.setBounds(380,100,600,100);\n revalidate();\n }", "private void mapConfig(GoogleMap googleMap) {\n LatLng position=new LatLng(playerDetails.getLat(),playerDetails.getLongitude());\n\n googleMap.addMarker(new MarkerOptions().position(position).title(playerDetails.getWinnerName())).showInfoWindow();\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(position));\n }", "public void printDetailedMap(GameMap map, List<String> playersNames);", "private void setupMap() {\n int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());\n \t\tif ( status != ConnectionResult.SUCCESS ) {\n \t\t\t// Google Play Services are not available.\n \t\t\tint requestCode = 10;\n \t\t\tGooglePlayServicesUtil.getErrorDialog( status, this, requestCode ).show();\n \t\t} else {\n \t\t\t// Google Play Services are available.\n \t\t\tif ( this.googleMap == null ) {\n \t\t\t\tFragmentManager fragManager = this.getSupportFragmentManager();\n \t\t\t\tSupportMapFragment mapFrag = (SupportMapFragment) fragManager.findFragmentById( R.id.edit_gpsfilter_area_google_map );\n \t\t\t\tthis.googleMap = mapFrag.getMap();\n \n \t\t\t\tif ( this.googleMap != null ) {\n \t\t\t\t\t// The Map is verified. It is now safe to manipulate the map.\n \t\t\t\t\tthis.configMap();\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public void openMapActivity() {\n Log.d(\"StartActivity\", \"opening map activity\");\n Intent intent = new Intent(this, MapsActivity.class);\n startActivity(intent);\n finish();\n }", "public static void restartGame(boolean newMap) {\r\n\t\t// KeyboardInput.getInstance().cleanListenerList();\r\n\t\tKeyboardInput.getInstance().resetAllKeys();\r\n\t\trestartPositions();\r\n\t\tgenerateNewPanel(newMap);\r\n\t\taddUnitPanels();\r\n\t\tpauseGame();\r\n\t\tMapGFrame.getInstance().setVisible(false);\r\n\t\tMapGFrame.getInstance().setVisible(true);\r\n\t\tMapGFrame.getInstance().setFocusable(true);\r\n\t}", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n Intent info = getIntent();\n setUpMap(new LatLng(info.getDoubleExtra(\"latitude\", 0), info.getDoubleExtra(\"longitude\", 0)), info.getStringExtra(\"name\"));\n }\n }\n }", "public void onAddByMapPressed( ) {\n Router.Instance().changeView(Router.Views.AddWithMap);\n }", "private void BacktoMainActionPerformed(java.awt.event.ActionEvent evt) {\n new Machines().setVisible(true);\n }", "public static void playMapSelectSound() {\n int roll = MathUtils.random(3);\n switch (roll) {\n case 0: {\n CardCrawlGame.sound.play(\"MAP_SELECT_1\");\n break;\n }\n case 1: {\n CardCrawlGame.sound.play(\"MAP_SELECT_2\");\n break;\n }\n case 2: {\n CardCrawlGame.sound.play(\"MAP_SELECT_3\");\n break;\n }\n default: {\n CardCrawlGame.sound.play(\"MAP_SELECT_4\");\n }\n }\n }", "@Override\n\tpublic void onLookUp(PlatformPlayer player) {\n\t\t\n\t}", "private void toggleGoToMapBtn() {\n boolean isShow = isValidLocationFound();\n NodeUtil.setNodeVisibility(this.gotoGeoMapBtn, isShow);\n }", "private void onOpenMapButtonClicked() {\n\n // Create a new intent to start an map activity\n Intent mapIntent =\n new Intent(DetailActivity.this, MapsActivity.class);\n if (mMapDestination != null && mMapDestination.getLocation() != null &&\n mMapDestination.getRadius() >= 0) {\n MapDestination mapDestination =\n new MapDestination(mMapDestination.getLatitude(),\n mMapDestination.getLongitude(), mMapDestination.getLocation(),\n mMapDestination.getRadius());\n mapIntent.putExtra(Constants.EXTRA_ALARM_DESTINATION, mapDestination);\n }\n startActivityForResult(mapIntent, MAP_REQUEST_CODE);\n\n }", "private void startMatch() {\n game = new Match(players.get(0), players.get(1), \"Nueva Partida\");\n showMatch();\n state = 1;\n }", "public void newGame() {\n // this.dungeonGenerator = new TowerDungeonGenerator();\n this.dungeonGenerator = cfg.getGenerator();\n\n Dungeon d = dungeonGenerator.generateDungeon(cfg.getDepth());\n Room[] rooms = d.getRooms();\n\n String playername = JOptionPane.showInputDialog(null, \"What's your name ?\");\n if (playername == null) playername = \"anon\";\n System.out.println(playername);\n\n this.player = new Player(playername, rooms[0], 0, 0);\n player.getCurrentCell().setVisible(true);\n rooms[0].getCell(0, 0).setEntity(player);\n\n frame.showGame();\n frame.refresh(player.getCurrentRoom().toString());\n frame.setHUD(player.getGold(), player.getStrength(), player.getCurrentRoom().getLevel());\n }", "protected void showMineSettings() {\r\n settingsFrame.setLocation( scorePanel.getLocationOnScreen() );\r\n settingsFrame.setVisible( true );\r\n }", "private void setUpMapIfNeeded() {\n if (mMap == null) {\n // Try to obtain the map from the SupportMapFragment.\n mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.mapView2))\n .getMap();\n // Check if we were successful in obtaining the map.\n if (mMap != null) {\n setUpMap( lat, longi, \"ISS/ NUS\");\n }\n }\n }", "private void enterRoom() {\n connect();\n\n clientName = nameTextFiled.getText();\n try {\n toServer.writeInt(ENTERROOM);\n toServer.writeUTF(clientName);\n toServer.flush();\n report(\"Client ----> Server: \" + ENTERROOM + \" \" + clientId + \" \" + nameTextFiled.getText());\n\n clientFrame.setTitle(clientName);\n btnNewGame.setEnabled(true);\n\n// loginPanel.setVisible(false);\n// centerPanel.setVisible(true);\n // disable the login frame component\n nameTextFiled.removeActionListener(clientAction);\n nameTextFiled.setEnabled(false);\n btnEnterRoom.removeActionListener(clientAction);\n btnEnterRoom.setEnabled(false);\n\n // close the login frame\n loginFrame.setVisible(false);\n loginFrame.dispose();\n\n // open the client frame\n clientFrame.setVisible(true);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }" ]
[ "0.6669147", "0.6532998", "0.6399329", "0.6272505", "0.6249688", "0.62111104", "0.60159826", "0.5989861", "0.59883875", "0.59658027", "0.59371483", "0.59332657", "0.58801174", "0.5872402", "0.58713263", "0.58685106", "0.58231646", "0.577671", "0.5770919", "0.5766066", "0.575862", "0.57484454", "0.57389295", "0.5719409", "0.56973714", "0.56775844", "0.56759906", "0.5669001", "0.5664931", "0.5656815", "0.56141376", "0.5613693", "0.5575555", "0.5553498", "0.5548014", "0.5534455", "0.5533814", "0.5521443", "0.55184907", "0.55139416", "0.55122733", "0.551005", "0.5503396", "0.55003273", "0.5482937", "0.5460726", "0.5458083", "0.544777", "0.54464537", "0.5444867", "0.54355574", "0.54317594", "0.5427726", "0.54265463", "0.54148656", "0.5389927", "0.5384648", "0.538171", "0.53813297", "0.53804415", "0.53768283", "0.5376197", "0.53626215", "0.53610194", "0.5360498", "0.5330927", "0.53239346", "0.5319077", "0.531465", "0.531166", "0.5309049", "0.5308713", "0.53039235", "0.53034973", "0.529595", "0.529595", "0.52954507", "0.5293445", "0.52851933", "0.5278317", "0.527773", "0.52715814", "0.5268944", "0.52668023", "0.5252857", "0.52496064", "0.5247467", "0.5244397", "0.5239936", "0.52393126", "0.523252", "0.52316", "0.5231544", "0.5226309", "0.52234244", "0.52223253", "0.52177185", "0.52164644", "0.521378", "0.52128553" ]
0.6960917
0
This method is called by the server on the client when he has to spawn or respawn
public void askSpawn() throws RemoteException{ respawnPopUp = new RespawnPopUp(); respawnPopUp.setSenderRemoteController(senderRemoteController); respawnPopUp.setMatch(match); Platform.runLater( ()-> { try{ respawnPopUp.start(new Stage()); } catch(Exception e){ e.printStackTrace(); } } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void respawn() {\n\t\tbounds.x = OmniWorld.SpawnX;\n\t\tbounds.y = OmniWorld.SpawnY;\n\t\tHP = MaxHP;\n\t\tisDead = false;\n\t\tstateTime = 0;\n\t}", "public final void respawn() {\r\n World.submit(new Pulse(getRespawnRate()) {\r\n\r\n @Override\r\n public boolean pulse() {\r\n GroundItemManager.create(GroundSpawn.this);\r\n return true;\r\n }\r\n });\r\n }", "void willStartFromRespawn() throws RemoteException;", "@Override\n public void process() {\n Simulator.allocateServer(c);\n }", "@Override\n\tpublic boolean canRespawnHere() {\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean canRespawnHere()\n\t{\n\t\treturn false;\n\t}", "public void serverRestarting() {\n notifyServerRestart();\n }", "abstract public void initSpawn();", "void forceSpawn() throws SpawnException;", "@Override\n public void run() {\n serverHelper.newGame(game, player);\n }", "public boolean canRespawnHere()\n {\n return false;\n }", "public void kickStart() {\n startLobby();\n }", "public void notifyRespawn()\n {\n playerObserver.onRespawn();\n }", "private void startSpawning()\n {\n MAUtils.setSpawnFlags(plugin, world, 1, allowMonsters, allowAnimals);\n \n // Start the spawnThread.\n spawnThread = new MASpawnThread(plugin, this);\n spawnTaskId = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, spawnThread, waveDelay, (!waveClear) ? waveInterval : 60);\n }", "private void spawnPlayer() {\n\t\tplayer.show(true);\n\t\tplayer.resetPosition();\n\t\tplayerDead = false;\n\t\tplayerDeadTimeLeft = 0.0;\n\t}", "private void runServer()\n\t{\n\t\tif(sm == null)\n\t\t{\n\t\t\tsm = new ServerManager();\n\t\t}\n\t\t\n\t\tint port = 1209;\n\t\ttry \n\t\t{\n\t\t\twaitUser(sm, port);\n\t\t\t//이 아래 로직이 실행된다는건 유저가 다 들어왔다는 뜻임. 즉 게임 시작할 준비 되었음을 의미함\t\t\t\n\t\t\tGame.getInstance().runGame();\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"[Server.runServer()] error >>> : \" + e.getMessage());\n\t\t}\n\t}", "@Override\n\tprotected boolean canDespawn() {\n\t\treturn false;\n\t}", "public void respawn(Vector2 spawnPos){\n position.x = spawnPos.x;\n position.y = spawnPos.y;\n }", "@Override\n public String getName() {\n return \"sspawn:spawn\";\n }", "public void run(){\n\t\tstartServer();\n\t}", "public boolean canRespawnHere() {\n\t\treturn false;\n\t}", "@Override\n\tpublic void run() {\n\t\t\t\n\t\t\ttry {\n\t\t\tLocateRegistry.createRegistry(port);\n\t\t\t}catch(RemoteException e){\n\t\t\t\tSystem.out.println(\"Another peer is running in this machine\");\n\t\t\t}\n\t\t\t\n\t\t\tInterfaceUI rmi;\n\t\t\ttry {\n\t\t\t\trmi = (InterfaceUI)UnicastRemoteObject.exportObject(this, 0);\n\t\t\t\tRegistry registry = LocateRegistry.getRegistry();\n\t\t\t\tregistry.rebind(this.id, rmi);\n\t\t\t\n\t\t\t\n\t\t\t} catch (RemoteException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\n\t}", "public void start(){\n log.debug(\"Starting Host Router\");\n lobbyThread = pool.submit(new Runnable() {\n public void run() {\n waitForClients();\n }\n });\n }", "static void respawnReplicaServers(Master master) throws IOException {\n System.out.println(\"[@main] respawning replica servers \");\n // TODO make file names global\n BufferedReader br = new BufferedReader(new FileReader(\"repServers.txt\"));\n int n = Integer.parseInt(br.readLine().trim());\n ReplicaLoc replicaLoc;\n String s;\n\n for (int i = 0; i < n; i++) {\n s = br.readLine().trim();\n replicaLoc = new ReplicaLoc(i, s.substring(0, s.indexOf(':')), true);\n ReplicaServer rs = new ReplicaServer(i, \"./\");\n\n ReplicaInterface stub = (ReplicaInterface) UnicastRemoteObject.exportObject(rs, 0);\n registry.rebind(\"ReplicaClient\" + i, stub);\n\n master.registerReplicaServer(replicaLoc, stub);\n\n System.out.println(\"replica server state [@ main] = \" + rs.isAlive());\n }\n br.close();\n }", "private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }", "public void initiateRespawnBlindness() {\n this.respawnBlindnessEndTick = CommonUtil.getServerTicks() + 5;\n }", "private void newGame() {\n try {\n toServer.writeInt(READY);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void conectServer() {\n\n\t}", "private void doSpawnProcess()\n\t{\n\t\t// spawn sometin\n\t\tthis.spawn();\n\t\t\n\t\t// record another spawned enemy\n\t\tspawnCurrent++;\n\t\t\n\t\t// if that wasn't the last Walker\n\t\tif(currentWave.getNumberOfWalkers() > 0)\n\t\t{\n\t\t\t// restart the spawn timer\n\t\t\tfloat delay = currentWave.getSpawnDelay();\n\t\t\tspawnTimer.start(delay);\n\t\t}\n\t\t// otherwise, we've spawned all our piggies in this wave\n\t\telse\n\t\t{\n\t\t\tprepareNextWave();\n\t\t}\n\t}", "@Override\n\tpublic boolean init()\n\t{\n\t\tentityMap = new EntityIDMap();\n\t\t\n\t\tServerBootstrap bootstrap = new ServerBootstrap();\n\t\tbootstrap.group(bossGroup, workerGroup)\n\t\t\t\t.channel(NioServerSocketChannel.class) // Channel type\n\t\t\t\t.childHandler(new ChannelInitializer<SocketChannel>() // Setup ChannelInitializer\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void initChannel(SocketChannel ch)\n\t\t\t\t\t{\n\t\t\t\t\t\t// On client connect:\n\t\t\t\t\t\t// Send back client-id\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Client side:\n\t\t\t\t\t\t// Send back position of player\n\t\t\t\t\t\t// client id | pos x | pos y | pos z\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Server side:\n\t\t\t\t\t\t// Broadcast all player positions\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldPrepender(2));\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldBasedFrameDecoder(0xFFFF, 0, 2));\n\t\t\t\t\t\tch.pipeline().addLast(new PacketCodec());\n\t\t\t\t\t\tch.pipeline().addLast(new ServerChannelHandler(instance));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.option(ChannelOption.SO_BACKLOG, 128)\n\t\t\t\t.childOption(ChannelOption.SO_KEEPALIVE, true);\n\t\t\n\t\t// Bind & start accepting connections\n\t\ttry\n\t\t{\n\t\t\tChannelFuture f = bootstrap.bind(this.hostPort).sync();\n\t\t\tserverChannel = f.channel();\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\tSystem.err.println(\"Unable to bind to the requested port\");\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "void ship_respawn() {\n ship.resetPosition();\n ship_image_view.setX(ship.x_position); // Update the ship image position\n }", "public void spawnNew() {\n\t\tif (tier> 1) {\n\t\t\ttier--;\n\t\t\thealth = tier;\n\t\t\tdamage = tier;\n\t\t\tspeed = 5;\n\t\t\timg = getImage(updateImage(tier)); // converted getImage to protected b/c it wasn't accessible by Balloon class (child class)\n\t\t}\n\t\telse {\n\t\t\tisAlive = false;\n\t\t\tdeletePath();\t\t\t\n\t\t}\n\t}", "public void control(Spawn spawn) {}", "public void spawn()\n\t{\n\t\tsynchronized(this)\n\t\t{\n\t\t\t// Set the x,y,z position of the L2Object spawn and update its _worldregion\n\t\t\tsetVisible(true);\n\t\t\tsetWorldRegion(WorldManager.getInstance().getRegion(getWorldPosition()));\n\n\t\t\t// Add the L2Object spawn in the _allobjects of L2World\n\t\t\tWorldManager.getInstance().storeObject(object);\n\n\t\t\t// Add the L2Object spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion\n\t\t\tregion.addVisibleObject(object);\n\t\t}\n\n\t\t// this can synchronize on others instancies, so it's out of\n\t\t// synchronized, to avoid deadlocks\n\t\t// Add the L2Object spawn in the world as a visible object\n\t\tWorldManager.getInstance().addVisibleObject(object, region);\n\n\t\tobject.onSpawn();\n\t}", "protected void restartServer() throws Exception {\n createRuntimeWrapper();\n }", "@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void despawn() {\n\t\t\n\t}", "public Ex spawn() {\n return spawn(false);\n }", "@Override\n\tpublic void spawn(Location loc) {\n\t\t\n\t}", "void onRespawned(Need need, NeedLevel level, PlayerEntity player, PlayerEntity oldPlayer);", "public void run() {\n try {\n peerBootstrap = createPeerBootStrap();\n\n peerBootstrap.setOption(\"reuseAddr\", true);\n peerBootstrap.setOption(\"child.keepAlive\", true);\n peerBootstrap.setOption(\"child.tcpNoDelay\", true);\n peerBootstrap.setOption(\"child.sendBufferSize\", Controller.SEND_BUFFER_SIZE);\n\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "@Override\r\n\tpublic void spawn(Location location) {\n\t\t\r\n\t}", "public void startserver()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\twhile(true)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tSocket clientsocket = serversocket.accept();\r\n\t\t\t\tif(clientsocket.isConnected())\r\n\t\t\t\t{\r\n\t\t\t\t\tDataOutputStream wdata = new DataOutputStream(clientsocket.getOutputStream());\r\n\t\t\t\t\tDataInputStream rdata = new DataInputStream(clientsocket.getInputStream());\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t// read message from client and add new player\r\n\t\t\t\t\tJsonObject newplayrejson = gson.fromJson(rdata.readUTF(), JsonObject.class);\r\n\t\t\t\t\tint mode = newplayrejson.get(\"mode\").getAsInt();\r\n\t\t\t\t\tclientaddresslist.get(mode).add(clientsocket.getInetAddress());\r\n\t\t\t\t\tString profession = newplayrejson.get(\"profession\").getAsString();\r\n\t\t\t\t\tString teamname;\r\n\t\t\t\t\tif(mode == 0)\r\n\t\t\t\t\t\tteamname = \"deathMatch\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(teamcount)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tteamname = \"teamBlue\";\r\n\t\t\t\t\t\t\tif(king[0] == -1)\r\n\t\t\t\t\t\t\t\tking[0] = idcount[mode];\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\tteamname = \"teamRed\";\r\n\t\t\t\t\t\t\tif(king[1] == -1)\r\n\t\t\t\t\t\t\t\tking[1] = idcount[mode];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tteamcount = !teamcount;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tcdc.collideObjectManager[mode].addCharacter(collideObjecctClass.valueOf(profession), idcount[mode], randposition(), newplayrejson.get(\"name\").getAsString(), TeamName.valueOf(teamname));\r\n\t\t\t\t\tclientidlist.get(mode).add(idcount[mode]);\r\n\t\t\t\t\t++idcount[mode];\r\n\t\t\t\t\t++playercount[mode];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// sending collideobject list to client\r\n\t\t\t\t\twdata.writeInt(idcount[mode] - 1);\r\n\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tfor(CollideObject object : cdc.collideObjectManager[mode].collideObjectList)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twdata.writeUTF(object.getClass().getName());\r\n\t\t\t\t\t\twdata.writeUTF(gson.toJson(object));\r\n\t\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\twdata.writeUTF(\"done\");\r\n\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// send king id if mode is kingkill\r\n\t\t\t\t\tif(mode == 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twdata.writeInt(king[0]);\r\n\t\t\t\t\t\twdata.writeInt(king[1]);\r\n\t\t\t\t\t\twdata.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tThread thread = new Thread(new clientmanager(clientsocket , this , mode));\r\n\t\t\t\t\tthread.start();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void run() {\n Runtime.getRuntime().addShutdownHook(new MNOSManagerShutdownHook(this));\n\n OFNiciraVendorExtensions.initialize();\n\n this.startDatabase();\n\n try {\n final ServerBootstrap switchServerBootStrap = this\n .createServerBootStrap();\n\n this.setServerBootStrapParams(switchServerBootStrap);\n\n switchServerBootStrap.setPipelineFactory(this.pfact);\n final InetSocketAddress sa = this.ofHost == null ? new InetSocketAddress(\n this.ofPort) : new InetSocketAddress(this.ofHost,\n this.ofPort);\n this.sg.add(switchServerBootStrap.bind(sa));\n }catch (final Exception e){\n throw new RuntimeException(e);\n }\n\n }", "@Override\n\t\tpublic void run() {\n\n\n\t\t\tif (((CitizensNPC)myNPC).getHandle() == null ) sentryStatus = Status.isDEAD; // incase it dies in a way im not handling.....\n\n\t\t\tif (sentryStatus != Status.isDEAD && System.currentTimeMillis() > oktoheal && HealRate > 0) {\n\t\t\t\tif (myNPC.getBukkitEntity().getHealth() < sentryHealth) {\n\t\t\t\t\tmyNPC.getBukkitEntity().setHealth(myNPC.getBukkitEntity().getHealth() + 1);\n\t\t\t\t\tif (healanim!=null)net.citizensnpcs.util.Util.sendPacketNearby(myNPC.getBukkitEntity().getLocation(),healanim , 64);\n\n\t\t\t\t\tif (myNPC.getBukkitEntity().getHealth() >= sentryHealth) _myDamamgers.clear(); //healed to full, forget attackers\n\n\t\t\t\t}\n\t\t\t\toktoheal = (long) (System.currentTimeMillis() + HealRate * 1000);\n\t\t\t}\n\n\t\t\tif (sentryStatus == Status.isDEAD && System.currentTimeMillis() > isRespawnable && RespawnDelaySeconds != 0) {\n\t\t\t\t// Respawn\n\n\t\t\t\t// Location loc =\n\t\t\t\t// myNPC.getTrait(CurrentLocation.class).getLocation();\n\t\t\t\t// if (myNPC.hasTrait(Waypoints.class)){\n\t\t\t\t// Waypoints wp = myNPC.getTrait(Waypoints.class);\n\t\t\t\t// wp.getCurrentProvider()\n\t\t\t\t// }\n\n\t\t\t\t// plugin.getServer().broadcastMessage(\"Spawning...\");\n\t\t\t\tif (guardEntity == null) {\n\t\t\t\t\tmyNPC.spawn(Spawn);\n\t\t\t\t} else {\n\t\t\t\t\tmyNPC.spawn(guardEntity.getLocation().add(2, 0, 2));\n\t\t\t\t}\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isHOSTILE && myNPC.isSpawned()) {\n\n\t\t\t\tif (projectileTarget != null && !projectileTarget.isDead()) {\n\t\t\t\t\tif (_projTargetLostLoc == null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\tfaceEntity(myNPC.getBukkitEntity(), projectileTarget);\n\n\t\t\t\t\tif (System.currentTimeMillis() > oktoFire) {\n\t\t\t\t\t\t// Fire!\n\t\t\t\t\t\toktoFire = (long) (System.currentTimeMillis() + AttackRateSeconds * 1000.0);\n\t\t\t\t\t\tFire(projectileTarget);\n\t\t\t\t\t}\n\t\t\t\t\tif (projectileTarget != null)\n\t\t\t\t\t\t_projTargetLostLoc = projectileTarget.getLocation();\n\n\t\t\t\t\treturn; // keep at it\n\n\t\t\t\t}\n\n\t\t\t\telse if (meleeTarget != null && !meleeTarget.isDead()) {\n\t\t\t\t\t// Did it get away?\n\t\t\t\t\tif (meleeTarget.getLocation().distance(myNPC.getBukkitEntity().getLocation()) > sentryRange) {\n\t\t\t\t\t\t// it got away...\n\t\t\t\t\t\tsetTarget(null);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// target died or null\n\t\t\t\t\tsetTarget(null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if (sentryStatus == Status.isLOOKING && myNPC.isSpawned()) {\n\n\t\t\t\tif (guardTarget != null && guardEntity == null) {\n\t\t\t\t\t// daddy? where are u?\n\t\t\t\t\tsetGuardTarget(guardTarget);\n\t\t\t\t}\n\n\t\t\t\tLivingEntity target = findTarget(sentryRange);\n\n\t\t\t\tif (target != null) {\n\t\t\t\t\t// plugin.getServer().broadcastMessage(\"Target selected: \" +\n\t\t\t\t\t// target.toString());\n\t\t\t\t\tsetTarget(target);\n\t\t\t\t} else\n\t\t\t\t\tsetTarget(null);\n\n\t\t\t}\n\n\t\t}", "interface RespawnPolicy {\n\n /**\n * Respawn a process.\n *\n * @param process\n */\n void respawn(int count, ManagedProcess process);\n\n RespawnPolicy NONE = new RespawnPolicy() {\n\n @Override\n public void respawn(final int count, final ManagedProcess process) {\n ProcessLogger.SERVER_LOGGER.tracef(\"not trying to respawn process %s.\", process.getProcessName());\n }\n\n };\n\n RespawnPolicy RESPAWN = new RespawnPolicy() {\n\n private static final int MAX_WAIT = 60;\n private static final int MAX_RESTARTS = 10;\n\n @Override\n public void respawn(final int count, final ManagedProcess process) {\n if(count <= MAX_RESTARTS) {\n try {\n final int waitPeriod = Math.min((count * count), MAX_WAIT);\n ProcessLogger.SERVER_LOGGER.waitingToRestart(waitPeriod, process.getProcessName());\n TimeUnit.SECONDS.sleep(waitPeriod);\n } catch (InterruptedException e) {\n return;\n }\n process.respawn();\n }\n }\n };\n\n\n}", "private void startFedServer(){\r\n \r\n try {\r\n System.out.println(\"Start server to listen for client connection....\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Start server to listen for client connection....\", \"info\");\r\n sSocket = new ServerSocket(serverPort);\r\n sSocket.setReuseAddress(true);\r\n //System.out.println(\"FedServer is launching\");\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Error listening on port \" + serverPort, \"severe\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n List<Thread> proc_list = new ArrayList();\r\n while (FLAG) {\r\n if (proc_list.size() == PROC_MAX) {\r\n boolean full = true;\r\n //check if thread number reach the maximum number, if yes, sleep; \r\n while (full) {\r\n for (int i = proc_list.size() - 1; i >= 0; i--) {\r\n if (!proc_list.get(i).isAlive()) {\r\n proc_list.remove(i);\r\n full = false;\r\n }\r\n }\r\n if (full) {\r\n try {\r\n Thread.sleep(1000);\r\n } catch (InterruptedException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n }\r\n }\r\n }\r\n //if not full, accpet new client connection\r\n try {\r\n cSocket = sSocket.accept();\r\n //System.out.println(\"[C4C-Notification] Accept connection from client\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Accept connection from client\", \"info\");\r\n //create new thread to process client request\r\n // System.out.println(\"Accept connection from client -step 1\");\r\n Thread request = new Thread(new processRequest(cSocket));\r\n request.start();\r\n proc_list.add(request);\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n\r\n }\r\n closeFedSockets();\r\n }", "@Override\n protected void Start() {\n }", "public void respawnPlayer() {\n \tboard.swapTile(board.getTile(player.getPos()), board.getTile(new Point(8,0)));\n player.setPlayerPos(new Point(8,0));\n resetAmmo();\n }", "void onRespawnedWhenContinuous(Need need, NeedLevel level, PlayerEntity player, PlayerEntity oldPlayer);", "private void initiateServerInstance(Socket newSocket){\n KVCommunicationModule com = createCommunicationModule(newSocket);\n KVServerInstance instance = createServerInstance(com, master);\n aliveInstances.add(instance);\n Thread aliveinstancethread = new Thread(instance);\n aliveinstancethread.start();\n aliveinstancethreads.add(aliveinstancethread);\n }", "public void setSpawned() {\n spawned = 1;\n setChanged();\n notifyObservers(1);\n }", "@Listener\n public void onPlayerRespawnPost(final RespawnPlayerEvent.Post event)\n {\n ServerPlayer serverPlayer = event.entity();\n if (HOME_TELEPORT_PLAYER_UUIDS.contains(serverPlayer.uniqueId()))\n {\n HOME_TELEPORT_PLAYER_UUIDS.remove(serverPlayer.uniqueId());\n Faction faction = getPlugin().getFactionLogic().getFactionByPlayerUUID(serverPlayer.uniqueId())\n .orElse(null);\n\n if(faction == null)\n return;\n\n FactionHome factionHome = faction.getHome();\n if (factionHome == null)\n {\n serverPlayer.sendMessage(PluginInfo.ERROR_PREFIX.append(messageService.resolveComponentWithMessage(\"error.home.could-not-spawn-at-faction-home-it-may-not-be-set\")));\n return;\n }\n\n ServerWorld world = WorldUtil.getWorldByUUID(factionHome.getWorldUUID()).orElse(null);\n if (world != null)\n {\n ServerLocation safeLocation = Sponge.server().teleportHelper().findSafeLocation(ServerLocation.of(world, factionHome.getBlockPosition()))\n .orElse(ServerLocation.of(world, factionHome.getBlockPosition()));\n serverPlayer.setLocation(safeLocation);\n }\n else\n {\n serverPlayer.sendMessage(PluginInfo.ERROR_PREFIX.append(messageService.resolveComponentWithMessage(\"error.home.could-not-spawn-at-faction-home-it-may-not-be-set\")));\n }\n }\n }", "private void start() {\n\n\t}", "@Override\n public Boolean call() throws RemoteException {\n stateGame = applicationServerGameInterface.startMessage(playerId);\n return true;\n }", "private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}", "public void spawnRubble() {\n\t\tString rubbleName \t= \"\";\n\t\tPlayer newPlayer \t= null; \n\t\tint numberOfRubble \t= server.getRubbleCount();\n\t\t\n\t\tfor(int i = 0; i < numberOfRubble; i++) {\n\t\t\trubbleName = \"Rubble\" + (i+1);\n\t\t\tnewPlayer = initPlayerToGameplane(rubbleName, \n\t\t\t\t\t\t\t\t\t\t\t PlayerType.Rubble, \n\t\t\t\t\t\t\t\t\t\t\t 0, 0);\n\t\t\t\n\t\t\tHandleCommunication.broadcastToClient(null, \n\t\t\t\t\t\t\t\t\t\t\t\t server.getConnectedClientList(), \n\t\t\t\t\t\t\t\t\t\t\t\t SendSetting.AddPlayer, \n\t\t\t\t\t\t\t\t\t\t\t\t newPlayer, \n\t\t\t\t\t\t\t\t\t\t\t\t null);\n\t\t}\n\t}", "@Override\n\tpublic void execute() {\n\t\tlog.info(\"running...\");\n\n\n\t\t/* example for finding the server agent */\n\t\tIAgentDescription serverAgent = thisAgent.searchAgent(new AgentDescription(null, \"ServerAgent\", null, null, null, null));\n\t\tif (serverAgent != null) {\n\t\t\tthis.server = serverAgent.getMessageBoxAddress();\n\n\t\t\t// TODO\n\t\t\tif (!hasGameStarted) {\n\t\t\t\tStartGameMessage startGameMessage = new StartGameMessage();\n\t\t\t\tstartGameMessage.brokerId = thisAgent.getAgentId();\n\t\t\t\tstartGameMessage.gridFile = \"/grids/h_01.grid\";\n\t\t\t\t// Send StartGameMessage(BrokerID)\n\t\t\t\tsendMessage(server, startGameMessage);\n\t\t\t\treward = 0;\n\t\t\t\tthis.hasGameStarted = true;\n\t\t\t}\n\n\t\t} else {\n\t\t\tSystem.out.println(\"SERVER NOT FOUND!\");\n\t\t}\n\n\n\t\t/* example of handling incoming messages without listener */\n\t\tfor (JiacMessage message : memory.removeAll(new JiacMessage())) {\n\t\t\tObject payload = message.getPayload();\n\n\t\t\tif (payload instanceof StartGameResponse) {\n\t\t\t\t/* do something */\n\n\t\t\t\t// TODO\n\t\t\t\tStartGameResponse startGameResponse = (StartGameResponse) message.getPayload();\n\n\t\t\t\tthis.maxNum = startGameResponse.initialWorkers.size();\n\t\t\t\tthis.agentDescriptions = getMyWorkerAgents(this.maxNum);\n\t\t\t\tthis.gameId = startGameResponse.gameId;\n\n\t\t\t\t/**\n\t\t\t\t *\n\t\t\t\t * DEBUGGING\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tSystem.out.println(\"SERVER SENDING \" + startGameResponse.toString());\n\n\t\t\t\t// TODO handle movements and obstacles\n\t\t\t\tthis.gridworldGame = new GridworldGame();\n\t\t\t\tthis.gridworldGame.obstacles.addAll(startGameResponse.obstacles);\n\n\n\n\t\t\t\t// TODO nicht mehr worker verwenden als zur Verfügung stehen\n\n\t\t\t\t/**\n\t\t\t\t * Initialize the workerIdMap to get the agentDescription and especially the\n\t\t\t\t * MailBoxAdress of the workerAgent which we associated with a specific worker\n\t\t\t\t *\n\n\t\t\t\tfor (Worker worker: startGameResponse.initialWorkers) {\n\t\t\t\t\tworkerIdMap.put(worker.id, this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)));\n\t\t\t\t\tworkerIdReverseAId.put(this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)).getAid(), worker.id);\n\t\t\t\t} */\n\n\t\t\t\t/**\n\t\t\t\t * Send the Position messages to each Agent for a specific worker\n\t\t\t\t * PositionMessages are sent to inform the worker where it is located\n\t\t\t\t * additionally put the position of the worker in the positionMap\n\t\t\t\t */\n\t\t\t\tfor (Worker worker: startGameResponse.initialWorkers) {\n\t\t\t\t\tpositionMap.put(worker.id, worker.position);\n\n\t\t\t\t\tworkerIdMap.put(worker.id, this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)));\n\t\t\t\t\tworkerIdReverseAID.put(this.agentDescriptions.get(startGameResponse.initialWorkers.indexOf(worker)).getAid(), worker.id);\n\n\t\t\t\t\tIAgentDescription agentDescription = workerIdMap.get(worker.id);\n\t\t\t\t\tICommunicationAddress workerAddress = agentDescription.getMessageBoxAddress();\n\n\t\t\t\t\t// Send each Agent their current position\n\t\t\t\t\tPositionMessage positionMessage = new PositionMessage();\n\t\t\t\t\tpositionMessage.workerId = agentDescription.getAid();\n\t\t\t\t\tpositionMessage.gameId = startGameResponse.gameId;\n\t\t\t\t\tpositionMessage.position = worker.position;\n\t\t\t\t\tpositionMessage.workerIdForServer = worker.id;\n\t\t\t\t\t//System.out.println(\"ADDRESS IS \" + workerAddress);\n\n\t\t\t\t\tsendMessage(workerAddress, positionMessage);\n\t\t\t\t\t//break;\n\t\t\t\t}\n\n\t\t\t\thasAgents = true;\n\n\t\t\t\tfor (Order order: savedOrders) {\n\t\t\t\t\t// 3 Runden anfangs zum Initialisieren\n\t\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(order);\n\t\t\t\t\tPosition workerPosition = null;\n\t\t\t\t\tfor (IAgentDescription agentDescription: agentDescriptions) {\n\t\t\t\t\t\tif (agentDescription.getMessageBoxAddress().equals(workerAddress)) {\n\t\t\t\t\t\t\tString workerId = workerIdReverseAID.get(agentDescription.getAid());\n\t\t\t\t\t\t\tworkerPosition = positionMap.get(workerId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tint steps = workerPosition.distance(order.position) + 2;\n\t\t\t\t\tint rewardMove = (steps > order.deadline)? 0 : order.value - steps * order.turnPenalty;\n\n\t\t\t\t\tSystem.out.println(\"REWARD: \" + rewardMove);\n\n\t\t\t\t\tif(rewardMove > 0) {\n\t\t\t\t\t\tTakeOrderMessage takeOrderMessage = new TakeOrderMessage();\n\t\t\t\t\t\ttakeOrderMessage.orderId = order.id;\n\t\t\t\t\t\ttakeOrderMessage.brokerId = thisAgent.getAgentId();\n\t\t\t\t\t\ttakeOrderMessage.gameId = gameId;\n\t\t\t\t\t\tsendMessage(server, takeOrderMessage);\n\n\t\t\t\t\t\t// Save order into orderMap\n\t\t\t\t\t\tthis.orderMap.put(order.id, order);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (payload instanceof PositionConfirm) {\n\t\t\t\tPositionConfirm positionConfirm = (PositionConfirm) message.getPayload();\n\t\t\t\tif(positionConfirm.state == Result.FAIL) {\n\t\t\t\t\tString workerId = workerIdReverseAID.get(positionConfirm.workerId);\n\t\t\t\t\tIAgentDescription agentDescription = workerIdMap.get(workerId);\n\t\t\t\t\tICommunicationAddress workerAddress = agentDescription.getMessageBoxAddress();\n\n\t\t\t\t\tPositionMessage positionMessage = new PositionMessage();\n\n\t\t\t\t\tpositionMessage.workerId = agentDescription.getAid();\n\t\t\t\t\tpositionMessage.gameId = positionConfirm.gameId;\n\t\t\t\t\tpositionMessage.position = positionMap.get(workerId);\n\t\t\t\t\tpositionMessage.workerIdForServer = workerId;\n\n\t\t\t\t\tsendMessage(workerAddress, positionMessage);\n\t\t\t\t} else {\n\t\t\t\t\tactiveWorkers.add(message.getSender());\n\t\t\t\t\tfor (String orderId: orderMessages) {\n\t\t\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(this.orderMap.get(orderId));\n\t\t\t\t\t\tif(workerAddress.equals(message.getSender())){\n\t\t\t\t\t\t\tAssignOrderMessage assignOrderMessage = new AssignOrderMessage();\n\t\t\t\t\t\t\tassignOrderMessage.order = this.orderMap.get(orderId);\n\t\t\t\t\t\t\tassignOrderMessage.gameId = gameId;\n\t\t\t\t\t\t\tassignOrderMessage.server = this.server;\n\t\t\t\t\t\t\tif(activeWorkers.contains(workerAddress)){\n\t\t\t\t\t\t\t\tsendMessage(workerAddress, assignOrderMessage);\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\n\t\t\t}\n\n\n\t\t\tif (payload instanceof OrderMessage) {\n\n\t\t\t\t// TODO entscheide, ob wir die Order wirklich annehmen wollen / können\n\n\t\t\t\tOrderMessage orderMessage = (OrderMessage) message.getPayload();\n\n\t\t\t\tif (!hasAgents){\n\t\t\t\t\tsavedOrders.add(orderMessage.order);\n\t\t\t\t\tcontinue;\n\t\t\t\t}else {\n\t\t\t\t\tOrder thisOrder = orderMessage.order;\n\n\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(thisOrder);\n\t\t\t\tPosition workerPosition = null;\n\t\t\t\tfor (IAgentDescription agentDescription: agentDescriptions) {\n\t\t\t\t\tif (agentDescription.getMessageBoxAddress().equals(workerAddress)) {\n\t\t\t\t\t\tString workerId = workerIdReverseAID.get(agentDescription.getAid());\n\t\t\t\t\t\tworkerPosition = positionMap.get(workerId);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// 3 Runden anfangs zum Initialisieren\n\t\t\t\t\tint steps = workerPosition.distance(thisOrder.position) + 1;\n\t\t\t\t\tint rewardMove = (steps > thisOrder.deadline)? 0 : thisOrder.value - steps * thisOrder.turnPenalty;\n\n\n\t\t\t\t\tSystem.out.println(\"REWARD: \" + rewardMove);\n\n\t\t\t\tif(rewardMove > 0) {\n\t\t\t\t\tTakeOrderMessage takeOrderMessage = new TakeOrderMessage();\n\t\t\t\t\ttakeOrderMessage.orderId = orderMessage.order.id;\n\t\t\t\t\ttakeOrderMessage.brokerId = thisAgent.getAgentId();\n\t\t\t\t\ttakeOrderMessage.gameId = orderMessage.gameId;\n\t\t\t\t\tsendMessage(server, takeOrderMessage);\n\n\t\t\t\t\t// Save order into orderMap\n\t\t\t\t\tOrder order = ((OrderMessage) message.getPayload()).order;\n\t\t\t\t\tthis.orderMap.put(order.id, order);\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 * DEBUGGING\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tSystem.out.println(\"SERVER SENDING \" + orderMessage.toString());\n\n\t\t\t\t// Save order into orderMap\n\n\t\t\t}\n\n\t\t\tif (payload instanceof TakeOrderConfirm) {\n\n\t\t\t\t// TODO\n\t\t\t\t// Got Order ?!\n\t\t\t\tTakeOrderConfirm takeOrderConfirm = (TakeOrderConfirm) message.getPayload();\n\t\t\t\tResult result = takeOrderConfirm.state;\n\n\t\t\t\t/**\n\t\t\t\t *\n\t\t\t\t * DEBUGGING\n\t\t\t\t *\n\t\t\t\t */\n\t\t\t\tSystem.out.println(\"SERVER SENDING \" + takeOrderConfirm.toString());\n\n\t\t\t\tif (result == Result.FAIL) {\n\t\t\t\t\t// Handle failed confirmation\n\n\t\t\t\t\t// Remove order from orderMap as it was rejected by the server\n\t\t\t\t\tthis.orderMap.remove(takeOrderConfirm.orderId);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\n\t\t\t\t// TODO send serverAddress\n\t\t\t\t// Assign order to Worker(Bean)\n\t\t\t\t// Send the order to the first agent\n\t\t\t\tAssignOrderMessage assignOrderMessage = new AssignOrderMessage();\n\t\t\t\tassignOrderMessage.order = this.orderMap.get(takeOrderConfirm.orderId);\n\t\t\t\tassignOrderMessage.gameId = takeOrderConfirm.gameId;\n\t\t\t\tassignOrderMessage.server = this.server;\n\t\t\t\tICommunicationAddress workerAddress = decideOrderAssigment(assignOrderMessage.order);\n\t\t\t\tif(activeWorkers.contains(workerAddress)){\n\t\t\t\t\tsendMessage(workerAddress, assignOrderMessage);\n\t\t\t\t} else {\n\t\t\t\t\torderMessages.add(takeOrderConfirm.orderId);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (payload instanceof AssignOrderConfirm) {\n\n\t\t\t\t// TODO\n\t\t\t\tAssignOrderConfirm assignOrderConfirm = (AssignOrderConfirm) message.getPayload();\n\t\t\t\tResult result = assignOrderConfirm.state;\n\n\t\t\t\tif (result == Result.FAIL) {\n\t\t\t\t\t// Handle failed confirmation\n\t\t\t\t\t// TODO\n\t\t\t\t\tICommunicationAddress alternativeWorkerAddress = getAlternativeWorkerAddress(((AssignOrderConfirm) message.getPayload()).workerId);\n\t\t\t\t\treassignOrder(alternativeWorkerAddress, assignOrderConfirm);\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\torderMessages.remove(assignOrderConfirm.orderId);\n\n\t\t\t\t// TODO Inform other workers that this task is taken - notwendig??\n\n\t\t\t}\n\n\t\t\tif (payload instanceof OrderCompleted) {\n\n\t\t\t\tOrderCompleted orderCompleted = (OrderCompleted) message.getPayload();\n\t\t\t\tResult result = orderCompleted.state;\n\n\t\t\t\tif (result == Result.FAIL) {\n\t\t\t\t\t// TODO Handle failed order completion -> minus points for non handled rewards\n\t\t\t\t\treward += orderCompleted.reward;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\treward += orderCompleted.reward;\n\t\t\t\t// TODO remove order from the worker specific order queues\n\n\t\t\t}\n\n\t\t\tif (payload instanceof PositionUpdate) {\n\n\t\t\t\tPositionUpdate positionUpdate = (PositionUpdate) message.getPayload();\n\t\t\t\tupdateWorkerPosition(positionUpdate.position, positionUpdate.workerId);\n\n\t\t\t}\n\n\t\t\tif (payload instanceof EndGameMessage) {\n\n\t\t\t\tEndGameMessage endGameMessage = (EndGameMessage) message.getPayload();\n\t\t\t\t// TODO lernen lernen lernen lol\n\t\t\t\tSystem.out.println(\"Reward: \" + endGameMessage.totalReward);\n\t\t\t}\n\n\t\t}\n\t}", "@Override\r\n\tpublic void start() {\n\t\t\r\n\t}", "public void startToRecivePlayers() {\n while (numberOfPlayers == 0) {\n controller.getSpf().getLabel1().setText(\"Ingresa el numero de jugadores\");\n }\n try {\n ss = new ServerSocket(8888);\n Thread.sleep(100);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n controller.getSpf().getLabel1().setText(\"Recibido\");\n run();\n }", "public SocketServer() {\n \n super();\n start();\n\n }", "public void start(){\n\t\tString h2FileName = \"./data/Emiregistry-parent\";\n\t\t // A File object to represent the filename\n\t File f = new File(h2FileName.substring(0, 6));\n\n\t // Make sure the file or directory exists and isn't write protected\n\t if (!f.exists()) {\n\t \tSystem.out.println(\"Delete: no such file or directory: \" + h2FileName.substring(0, 6));\n\t }\n\t\n\t // If it is a directory, make sure it is empty\n\t if (f.isDirectory()) {\n\t \tString[] files = f.list();\n\t \tif (files.length > 0) {\n\t \t\tSystem.out.println(\"Delete: directory not empty: \" + h2FileName.substring(0, 6));\n\t \t}\n\t \tfor (int i=0; i< files.length; i++){\n\t \t\t// Attempt to delete it\n\t \t\tif (f.listFiles()[i].canWrite() && f.listFiles()[i].toString().subSequence(0, 24).equals(h2FileName)) {\n\t\t \t\tSystem.out.println(\"deleted: \"+ f.listFiles()[i]);\n\t \t\t\tf.listFiles()[i].delete();\n\t \t\t}\n\t \t}\n\t }\n\t Properties c = getConfiguration(\"localhost\", 9001, \"localhost\",\n\t\t\t\t27017, \"emiregistry-parentdb\", false, null,\n\t\t\t\th2FileName); \n\t\t\n\t\tclient = new EMIRServer();\t\t\n\t\t\n\t\t\n\t\tclient. run(c);\n\t\tSystem.err.println(\"ParentServer started.\");\n\t}", "public void launch() throws NotBoundException, IOException\n\t{\n\t\t//call method to connect to server\t\t\n\t\tServerManager serverConnect = initialConnect();\t\n\t\n\t\t//get Setup menu from server\n\t\tSetUpMenu newSetup = new SetUpMenu(serverConnect);\n\t\tnewSetup.welcomeMenu();\n\t}", "void startAIGame() {\n int status = gameServer.restartServer( true, settingsMenu.getMapSize(),\n settingsMenu.getPlayFor(), settingsMenu.getFirstMove(),\n settingsMenu.getServerName() );\n if( status != 0 ) {\n JOptionPane.showMessageDialog( frame, Language.ERROR_STARTUP,\n Language.CAPTION_ERROR, JOptionPane.PLAIN_MESSAGE );\n } else {\n host = \"127.0.0.1\";\n role = \"admin\";\n password = gameServer.getServerPassword();\n ( new Thread( this ) ).start();\n }\n }", "@Override\r\n\t\t\tpublic void run()\r\n\t\t\t{\n\t\t\t\tString path = \"D:\\\\TUM\\\\3rd Semester\\\\3. Lab Course - Cloud DB [IN0012, IN2106, IN4163]\\\\LatestVersion\\\\gr6\\\\path\";\r\n\t\t\t\tKVServer newServer = new KVServer(\"newNode\", 50001, 30000, 3, \"FIFO\", path, 0,1,1);\r\n\t\t\t}", "@Override\n public void onKill() {\n }", "private void execute() {\n\n\t\tPropertiesParser propertiesParser = new PropertiesParser();\n\t\t\n\t\tsetupServer(propertiesParser);\n\t\ttry {\n\t\t\t\n\t\t\tThread.sleep(SERVER_AFTER_RUN_DELAY);\n\t\t\t\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tint i=0;\n\t\tfor( ; i < propertiesParser.getReadersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,true);\n\t\t\t\n\t\t}\n\t\tfor(; i < propertiesParser.getReadersNum()+ propertiesParser.getWritersNum() ; i++){\n\t\t\t\n\t\t\tsetupClient(propertiesParser , i,false);\n\t\t\t\n\t\t}\n\t\t\n\t}", "@Override\n\tpublic void spawn(List<String> args) throws IOException,\n\t\t\tURISyntaxException, InterruptedException {\n\t\t\n\t}", "public void sendeLobby();", "public void restart() {\n try {\n getXMPPServer().restart();\n }\n catch (Exception e) {\n Log.error(e.getMessage(), e);\n }\n sleep();\n }", "public Intermediary()\r\n\t{\r\n\t\ttry {\r\n\t\t\treceiveSocket = new DatagramSocket(68);\r\n\t\t\tsendReceiveSocket = new DatagramSocket();\t\t\t\r\n\t\t\t\r\n\t\t} catch (SocketException se) {\r\n\t\t\tse.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t} \r\n\t\t\r\n\t\treqID = 1;\r\n\t\tSystem.out.println(\"===== INTERMEDIATE HOST STARTED =====\\n\");\r\n\t}", "@Override\n\tpublic void handleServerCmd() {\n\t\t\n\t}", "SpawnController createSpawnController();", "public void clientStart()\n\t{\n\t\tint cnt = 0;\n\t\tfor(ConnectionThread i : connectionPool)\n\t\t{\n\t\t\ti.sendMessage(\"Rock and Roll\");\n\t\t\taddText(\"send start signal to Player\" + cnt++);\n\t\t}\n\t\tchangePicture();\n\t}", "protected void start() {\n }", "protected void mainTask() {\n\ttry {\n\t socket = serverSocket.accept();\t\n\t spawnConnectionThread(socket);\n\t} catch (IOException e) {\n\t return;\n\t}\n }", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tisAlive = false;\r\n\t\t\t}", "private void respawnChest(){\n //remove the physical chest\n this.location.getBlock().setType(Material.AIR);\n\n //increment the level of the chest. If its higher than its max level, shut down.\n if(++this.level >= getMaxLevel()){\n deleteInstance();\n return;\n }\n\n //play a sound effect for all players (INCLUDING juggernaut) to indicate a chest respawned.\n for(JuggernautPlayer jp: JuggernautGame.getInstance().getPlayers()){\n PacketHelper.playSound(jp.getPlayer(), location, Sound.DIG_WOOD, 1f, 1f);\n }\n\n //set the seconds to unlock depending on the level of the chest\n this.secondsToUnlock = this.level==0 ? 15 : this.level==1 ? 30 : 60;\n\n //reset all old values\n this.claimProgress.clear();\n this.unlockedPercentage = 0;\n this.chestProgressLevel = 0;\n\n //get a new location to spawn the new chest in.\n this.location = JuggernautGame.getInstance().getRandomChestLocation().use();\n\n //log\n System.out.println(\"[Jugg] Respawned chest \" + this.getClass().getSimpleName() + \" Level \" + this.level + \" at \" + location.getBlockX() + \",\" + location.getBlockY() + \",\" + location.getBlockZ());\n\n //set the new location to a chest block\n this.location.getBlock().setType(Material.CHEST);\n }", "private static void createServer(final IChordNode node, int localPort)\n throws Exception {\n LocateRegistry.createRegistry(localPort);\n Naming.rebind(\n String.format(\"//localhost:%d/%s\", localPort, CHORDNODE),\n node\n );\n System.out.printf(\n \"New server started on localhost:%d with ID %d%n\",\n localPort, node.getID()\n );\n\n // Make nodes leave cleanly if the JVM is terminated\n Runtime.getRuntime().addShutdownHook( new Thread() {\n public void run() {\n try {\n node.leave();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n } );\n\n\n // Continuously print network information, keeping server alive\n while (true) {\n System.out.printf(\"### %4d ####%n\", node.getID());\n System.out.println( node.ringToString() );\n System.out.println();\n Thread.sleep(3000);\n }\n }", "@Override\n public void create() {\n setScreen(new ServerScreen(\n new RemoteGame(),\n new SocketIoGameServer(HOST, PORT)\n ));\n }", "private void manageClients() {\n manage = new Thread(\"Manage\") {\n public void run() {\n //noinspection StatementWithEmptyBody\n while (running) {\n sendToAll(\"/p/server ping/e/\".getBytes());\n try {\n Thread.sleep(1500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n //noinspection ForLoopReplaceableByForEach\n for (int i = 0; i < clients.size(); i++) {\n ServerClient tempClient = clients.get(i);\n if (!clientResponse.contains(tempClient.getID())) {\n if (tempClient.getAttempt() >= MAX_ATTEMPTS)\n disconnect(tempClient.getID(), false);\n else\n tempClient.setAttempt(tempClient.getAttempt() + 1);\n } else {\n clientResponse.remove(new Integer(tempClient.getID()));\n tempClient.setAttempt(0);\n }\n }\n }\n }\n };\n manage.start();\n }", "@Override\n public void run() {\n syncToServer();\n }", "@Override\r\n public void start() {\r\n }", "private void gameAdmin() {\n\t\tgamePause();\n\t\tsnakeFrame.snakePanel.player.close();\n\t\t try {\n\t\t\t\tRuntime.getRuntime().exec(\n\t\t\t\t\t\t \"cmd /c start http://localhost/snakegame/welcome.html \");\n\t\t\t} catch (IOException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\n\t}", "protected abstract boolean start();", "@Override\n public void run(){\n\n boolean gotReady = false;\n\n try {\n player.sendCommandToPlayer(new Command(CommandTypes.waitingForClientToGetReady , null));\n } catch (IOException e) {\n God.removeOfflinePlayerNotifyOthers(player);\n }\n\n while (! gotReady){\n try {\n Command command = player.receivePlayerRespond();\n\n if(command.getType() == CommandTypes.imReady){\n gotReady = true;\n }\n\n else {\n God.doTheCommand(command);\n }\n\n } catch (IOException e) {\n God.removeOfflinePlayerNotifyOthers(player);\n break;\n }\n }\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tmp.start();\n\t}", "public boolean canDespawn()\n {\n return false;\n }", "boolean spawningEnabled();", "@Override\n public void start() {}", "private void startServer() throws RemoteException, AlreadyBoundException{\n\t\ttry{\n\t\t\tInsuranceImplementation impl = new InsuranceImplementation();\n\t\t\timpl.setIPAddress(ipHospital.getText());\n\t\t\timpl.setPortNumebr(Integer.parseInt(portHospital.getText()));\n\t\t\t\n\t\t\tRegistry registry = LocateRegistry.createRegistry(Integer.parseInt(portInsurance.getText()));\n\t\t\tregistry.bind(Constants.RMI_ID, impl); \n\t\t\t\n\t\t\tlogMessage(\"Insurance Server Started\");\n\t\t\t\n\t\t} catch (Exception exp)\n\t\t{\n\t\t\tlogMessage(\"ObjID already in use.\\nPlease kill the process running at port 5002\");\n\t\t\texp.printStackTrace();\n\t\t} \n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n\tpublic void start() {\n\t\t\n\t}", "@Override\n public void Start() {\n\n }", "@Override\n public void Start() {\n\n }", "@Override\n public void Start() {\n\n }", "@Override\r\n\tpublic void start() {\n\t\tsuper.start();\r\n\t\t\r\n\t}", "@Override\n\tpublic void start() {\n\n\t}" ]
[ "0.6706469", "0.6677018", "0.66253126", "0.6592394", "0.6376733", "0.6297081", "0.62392604", "0.6224227", "0.61719865", "0.61574316", "0.61529213", "0.6148702", "0.61370856", "0.6113643", "0.611105", "0.6045944", "0.6025552", "0.6000212", "0.5986277", "0.59824187", "0.5954846", "0.59138685", "0.59071696", "0.5899438", "0.58918583", "0.5890146", "0.58865505", "0.5884105", "0.5835659", "0.5827409", "0.5821362", "0.58163947", "0.5805055", "0.5786451", "0.577748", "0.5772146", "0.5768469", "0.5764557", "0.57533604", "0.5738705", "0.57118016", "0.57085913", "0.57013935", "0.5683104", "0.5676103", "0.5675838", "0.5674241", "0.5669723", "0.56601244", "0.56587523", "0.5649068", "0.56346536", "0.5616455", "0.56108725", "0.5607228", "0.5583267", "0.55764115", "0.5571456", "0.5568923", "0.5565922", "0.5564202", "0.5553698", "0.5550918", "0.5543062", "0.5542254", "0.55418044", "0.5534097", "0.5515855", "0.5507928", "0.55078983", "0.5505319", "0.5503202", "0.5487599", "0.548214", "0.5478885", "0.5473427", "0.5465668", "0.5457189", "0.5455481", "0.5450321", "0.5439234", "0.54325527", "0.54241586", "0.54203945", "0.5420262", "0.5413006", "0.5412523", "0.5410813", "0.54095864", "0.5405534", "0.5402144", "0.53940237", "0.53940237", "0.53940237", "0.53940237", "0.5393891", "0.5393891", "0.5393891", "0.53884894", "0.5384781" ]
0.60710233
15
Asks to use the tagback grenade
@Override public void askForTagBackGrenade() throws RemoteException { mainPage.setRemoteController(senderRemoteController); mainPage.setMatch(match); Platform.runLater( () -> { try { mainPage.askForTagBackPopup(); } catch (Exception e) { e.printStackTrace(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void askOxygen(){\n _brain.lungs.breath();\n _brain.heart.accelerate(1);\n }", "@Override\n public void onRedBagTip(RewardResult arg0) {\n\n }", "public void handleBuyEggCommand(){\n if(Aquarium.money >= EGGPRICE) {\n Aquarium.money -= EGGPRICE;\n Aquarium.egg++;\n }\n }", "@Override\n public void onTakeTeaBagRaised() {\n }", "@Override\r\n\tpublic void onTravelGearEquip(EntityPlayer player, ItemStack stack)\r\n\t{\n\t}", "@Override\r\n\tpublic void onTravelGearUnequip(EntityPlayer player, ItemStack stack)\r\n\t{\n\t}", "ItemStack getEggItem(IGeneticMob geneticMob);", "public void shootGun() {\n\t\tammo--;\n\t}", "public boolean processInteract(EntityPlayer entityplayer, EnumHand hand, @Nullable ItemStack stack)\n {\n ItemStack itemstack = entityplayer.inventory.getCurrentItem();\n\n if (!bumgave && angerLevel == 0)\n {\n if (itemstack != null && (itemstack.getItem() == Items.DIAMOND || itemstack.getItem() == Items.GOLD_INGOT || itemstack.getItem() == Items.IRON_INGOT))\n {\n if (itemstack.getItem() == Items.IRON_INGOT)\n {\n value = rand.nextInt(2) + 1;\n }\n else if (itemstack.getItem() == Items.GOLD_INGOT)\n {\n value = rand.nextInt(5) + 1;\n }\n else if (itemstack.getItem() == Items.DIAMOND)\n {\n value = rand.nextInt(10) + 1;\n }\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n for (int i = 0; i < 4; i++)\n {\n for (int i1 = 0; i1 < 10; i1++)\n {\n double d1 = rand.nextGaussian() * 0.02D;\n double d3 = rand.nextGaussian() * 0.02D;\n double d6 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height) + (double)i, (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d1, d3, d6);\n }\n }\n\n texture = new ResourceLocation(Reference.MODID, Reference.TEXTURE_PATH_ENTITES +\n \t\tReference.TEXTURE_BUM_DRESSED);\n angerLevel = 0;\n //findPlayerToAttack();\n\n if (rand.nextInt(5) == 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumsucker\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_SUCKER, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthankyou\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKYOU, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n bumgave = true;\n\n for (int j = 0; j < 10; j++)\n {\n double d = rand.nextGaussian() * 0.02D;\n double d2 = rand.nextGaussian() * 0.02D;\n double d5 = rand.nextGaussian() * 0.02D;\n worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_NORMAL, (posX + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, posY + (double)(rand.nextFloat() * height), (posZ + (double)(rand.nextFloat() * width * 2.0F)) - (double)width, d, d2, d5);\n }\n\n for (int k = 0; k < value; k++)\n {\n \tif(!worldObj.isRemote) {\n\t dropItem(Item.getItemById(rand.nextInt(95)), 1);\n\t dropItem(Items.IRON_SHOVEL, 1);\n \t}\n }\n\n return true;\n }\n }\n else if (itemstack != null)\n {\n if (timetopee > 0)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumdontwant\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_DONTWANT, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n \n }\n else if (itemstack != null && (itemstack.getItem() == Item.getItemFromBlock(Blocks.YELLOW_FLOWER) || itemstack.getItem() == Item.getItemFromBlock(Blocks.RED_FLOWER)))\n {\n \t/* TODO\n \tif(!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n \t{\n \tworldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n \tentityplayer.addStat(MoreCreepsAndWeirdos.achievebumflower, 1);\n \tconfetti(entityplayer);\n \t} */\n\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.BUCKET)\n {\n \t/* TODO\n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumflower))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n confetti(entityplayer);\n } \n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n }\n else if (itemstack != null && itemstack.getItem() == Items.LAVA_BUCKET)\n {\n \t/* \n if (!((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumlava) && ((EntityPlayerMP)entityplayer).getStatFile().hasAchievementUnlocked(MoreCreepsAndWeirdos.achievebumpot))\n {\n worldObj.playSoundAtEntity(entityplayer, \"morecreeps:achievement\", 1.0F, 1.0F);\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumlava, 1);\n confetti(entityplayer);\n }\n\n entityplayer.addStat(MoreCreepsAndWeirdos.achievebumpot, 1);\n */\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumthanks\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_THANKS, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n timetopee = rand.nextInt(1900) + 1500;\n\n if (itemstack.stackSize - 1 == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, null);\n }\n else\n {\n itemstack.stackSize--;\n }\n\n int l = (int)posX;\n int j1 = (int)posY;\n int k1 = (int)posZ;\n\n if (rand.nextInt(4) == 0)\n {\n for (int l1 = 0; l1 < rand.nextInt(3) + 1; l1++)\n {\n Blocks.OBSIDIAN.dropBlockAsItem(worldObj, new BlockPos(l, j1, k1), worldObj.getBlockState(new BlockPos(l, j1, k1)), 0);\n }\n }\n\n for (int i2 = 0; i2 < 15; i2++)\n {\n double d4 = (float)l + worldObj.rand.nextFloat();\n double d7 = (float)j1 + worldObj.rand.nextFloat();\n double d8 = (float)k1 + worldObj.rand.nextFloat();\n double d9 = d4 - posX;\n double d10 = d7 - posY;\n double d11 = d8 - posZ;\n double d12 = MathHelper.sqrt_double(d9 * d9 + d10 * d10 + d11 * d11);\n d9 /= d12;\n d10 /= d12;\n d11 /= d12;\n double d13 = 0.5D / (d12 / 10D + 0.10000000000000001D);\n d13 *= worldObj.rand.nextFloat() * worldObj.rand.nextFloat() + 0.3F;\n d9 *= d13;\n d10 *= d13;\n d11 *= d13;\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, (d4 + posX * 1.0D) / 2D, (d7 + posY * 1.0D) / 2D + 2D, (d8 + posZ * 1.0D) / 2D, d9, d10, d11);\n worldObj.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d4, d7, d8, d9, d10, d11);\n }\n\n if (rand.nextInt(4) == 0)\n {\n entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, new ItemStack(Items.BUCKET));\n }\n }\n else if (!bumgave)\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumpee\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_PEE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n }\n }\n else\n {\n // worldObj.playSoundAtEntity(this, \"morecreeps:bumleavemealone\", 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n worldObj.playSound((EntityPlayer) null, getPosition(), MCSoundEvents.ENTITY_BUM_LEAVEMEALONE, SoundCategory.NEUTRAL, 1.0F, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);\n }\n\n return super.processInteract(entityplayer, hand, stack);\n }", "boolean willEggHatch(IGeneticMob geneticMob);", "@EventHandler ( priority = EventPriority.HIGHEST )\n\tpublic void onThrow ( PlayerInteractEvent event ) {\n\t\tfinal Action action = event.getAction();\n\t\tif (action != Action.RIGHT_CLICK_AIR \n\t\t\t\t&& action != Action.LEFT_CLICK_AIR) { // check is left or right click to air.\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get event values.\n\t\tfinal Player p = event.getPlayer();\n\t\tfinal BRPlayer bp = BRPlayer.getBRPlayer(p);\n\t\tfinal ItemStack stack = event.getItem();\n\t\t\n\t\t// check item.\n\t\tif (!BattleItems.TNT_GRENADE.isThis(stack)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* check is not knocked */\n\t\tif (!bp.isKnocked()) {\n\t\t\t// spawn and modify tnt if the event is not cancelled\n\t\t\tfinal TNTPrimed tnt = (TNTPrimed) p.getWorld().spawn(p.getLocation(), TNTPrimed.class);\n\t\t\tMemberThrowTNT evemt = new MemberThrowTNT(bp, tnt).call();\n\t\t\tif (evemt.isCancelled()) {\n\t\t\t\ttnt.remove();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t/* apply modifiers */\n\t\t\ttnt.setVelocity(p.getLocation().getDirection().clone().multiply(1.1D));\n\t\t\ttnt.setFuseTicks(30); /* 80 by default */\n\t\t\ttnt.setMetadata(TNT_GRENADE_METADATA, new FixedMetadataValue(BattleRoyale.getInstance(), TNT_GRENADE_METADATA));\n\t\t\ttnt.setIsIncendiary(true);\n\t\t\ttnt.setYield(evemt.getExplosionStrength()); /* set explosion strength */\n\t\t\t\n\t\t\t/* consume item */\n\t\t\tif (evemt.isCosumeItemInHand()) {\n\t\t\t\tif (p.getGameMode() != GameMode.CREATIVE) { // check is not in creative mode.\n\t\t\t\t\t// consume.\n\t\t\t\t\tif ((stack.getAmount() - 1) > 0) {\n\t\t\t\t\t\tp.setItemInHand(BattleItems.TNT_GRENADE.asItemStack(stack.getAmount() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp.setItemInHand(null);\n\t\t\t\t\t}\n\t\t\t\t\tp.updateInventory();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* cancel interaction */\n\t\tevent.setCancelled(true);\n\t}", "void askLeaderCardThrowing();", "@Override\n public void tick() {\n if (!this.world.isRemote) {\n if (this.angler == null) {\n this.remove();\n return;\n }\n this.setFlag(6, this.isGlowing());\n }\n this.baseTick();\n age++;\n\n if (this.world.isRemote) {\n int i = this.getDataManager().get(cau_ent);\n\n if (i > 0 && this.caughtEntity == null) {\n this.caughtEntity = this.world.getEntityByID(i - 1);\n MinecraftForge.EVENT_BUS.post(new HookReturningEvent(this));\n }\n } else {\n ItemStack itemstack = this.angler.getHeldItemMainhand();\n\n if (age > 80 || !this.angler.isAlive() || itemstack.getItem() != Items.ITEM_GRAB_HOOK || this.getDistanceSq(this.angler) > 4096.0D) {\n this.remove();\n this.angler.fishingBobber = null;\n return;\n }\n }\n\n if (this.caughtEntity != null && this.angler != null) {\n pullEntity();\n return;\n }\n if (this.inGround) {\n if(hasGrappling && this.angler != null){\n pullUser();\n }else{\n this.remove();\n }\n return;\n }\n\n // In the air\n ++this.ticksInAir;\n if (this.ticksInAir == 20) {\n setReturning();\n }\n if (!this.world.isRemote) {\n boolean caughtSomething = checkCollision();\n if(caughtSomething){\n return;\n }\n\n if (this.isReturning) {\n Vector3d target = this.angler.getPositionVec().add(0, this.angler.getEyeHeight(), 0);\n Vector3d v = target.subtract(this.getPositionVec());\n if (v.length() < 3D) {\n this.remove();\n return;\n }\n v = v.normalize().scale(speed).subtract(0, 0.1, 0);\n this.setMotion(v);\n }\n }\n\n this.move(MoverType.SELF, this.getMotion());\n this.setPosition(this.getPosX(), this.getPosY(), this.getPosZ());\n }", "private void tryEquipItem() {\n if (fakePlayer.get().getHeldItem(EnumHand.MAIN_HAND).isEmpty()) {\n ItemStack unbreakingPickaxe = new ItemStack(Items.DIAMOND_PICKAXE, 1);\n unbreakingPickaxe.addEnchantment(Enchantments.EFFICIENCY, 3);\n unbreakingPickaxe.setTagCompound(new NBTTagCompound());\n unbreakingPickaxe.getTagCompound().setBoolean(\"Unbreakable\", true);\n fakePlayer.get().setItemStackToSlot(EntityEquipmentSlot.MAINHAND, unbreakingPickaxe);\n }\n }", "private void asignGarlicSandwich() {\n\t\tbaguette = new GarlicSandwich();\n\t\tSystem.out.println(\"\\nYou have selected garlic bread.\\n\" +\n\t\t\t\"Now, choose the ingredientes you want:\\n\" +\n\t\t\tbaguette.ingredients());\n\t}", "public String e_(ItemStack paramamj)\r\n/* 14: */ {\r\n/* 15:19 */ if (paramamj.getDamage2() == 1) {\r\n/* 16:20 */ return \"item.charcoal\";\r\n/* 17: */ }\r\n/* 18:22 */ return \"item.coal\";\r\n/* 19: */ }", "public void gripGlyph(){\n grabberRearLeft.setPosition(glyphClosePosBL);\n grabberFrontLeft.setPosition(glyphClosePosFL);\n grabberFrontRight.setPosition(glyphClosePosFR);\n grabberRearRight.setPosition(glyphClosePosBR);\n isGripped = true;\n }", "public void throwBait() {\n\t\tpokemon.eatBait();;\n\t}", "@Override\r\n\tpublic void onUnequipped(ItemStack stack, EntityLivingBase living)\r\n\t{\n\t}", "public void OnDamage(AI ai, int aTK, float f) {\n\tif(DamagedTimer < 0.8f)\n\t\treturn;\n\tvel.x = f;\n\tvel.y = 3;\n\tDamagedTimer = 0;\n\tgrounded = false;\n\taTK -= (getDEF()*0.8f);\n\tif(aTK <= 0)\n\t\taTK = 1;\n\tHP -= aTK;\n\tInventory.CurrentInventory.dmgTxts.add(new dmgText(pos.x, pos.y+1, aTK));\n\t\n\tSoundManager.PlaySound(\"playerHurt\",3);\n\t\n\t\n}", "@Override\n protected void brake() {\n System.out.println(\"Bike Specific Brake\");\n }", "boolean canLayEgg(IGeneticMob geneticMob);", "@Override\n public void onTakeOffTeaBagRaised() {\n }", "@Override\n \tpublic void msgHereIsGlass(Glass g) {\n \t\tprint(\"Received msgHereIsGlass\");\n \t\tstate = ConveyorState.GLASS_JUST_ARRIVED; // previous sensor should have already started the conveyor\n \t\t// at this point, this should be true: family.runningState == RunningState.ON_BC_SENSOR_TO_CONVEYOR\n \t\tglasses.add(g);\n \t\tstateChanged();\n \t}", "void pickGarb() {\n if (model.hasObject(GARB, getAgPos(0))) {\n // sometimes the \"picking\" action doesn't work\n // but never more than MErr times\n if (random.nextBoolean() || nerr == MErr) {\n remove(GARB, getAgPos(0));\n nerr = 0;\n r1HasGarb = true;\n } else {\n nerr++;\n }\n }\n }", "@Override\n \tpublic boolean interactFirst(EntityPlayer player) //interact : change back when Forge updates\n \t{\n \t\tif (gunner != null && (gunner instanceof EntityPlayer) && gunner != player)\n \t\t{\n \t\t\treturn true;\n \t\t}\n \t\tif (!worldObj.isRemote)\n \t\t{\n \t\t\tif (gunner == player)\n \t\t\t{\n \t\t\t\tmountGun(player, false);\n \t\t\t\tPacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 100, dimension, PacketMGMount.buildMGPacket(player, this, false));\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\tif (FlansModPlayerHandler.getPlayerData(player).mountingGun != null && !FlansModPlayerHandler.getPlayerData(player).mountingGun.isDead)\n \t\t\t{\n \t\t\t\treturn true;\n \t\t\t}\n \n \t\t\tmountGun(player, true);\n \t\t\tPacketDispatcher.sendPacketToAllAround(posX, posY, posZ, 100, dimension, PacketMGMount.buildMGPacket(player, this, true));\n \t\t\tif (ammo == null)\n \t\t\t{\n \t\t\t\tint slot = findAmmo(player);\n \t\t\t\tif (slot >= 0)\n \t\t\t\t{\n \t\t\t\t\tammo = player.inventory.getStackInSlot(slot);\n \t\t\t\t\tplayer.inventory.setInventorySlotContents(slot, null);\n \t\t\t\t\treloadTimer = type.reloadTime;\n \t\t\t\t\tworldObj.playSoundAtEntity(this, type.reloadSound, 1.0F, 1.0F / (rand.nextFloat() * 0.4F + 0.8F));\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t}\n \t\treturn true;\n \t}", "public void func_70299_a(int par1, ItemStack stack)\n/* */ {\n/* 54 */ if (!this.field_145850_b.field_72995_K) {\n/* 55 */ EntityItemGrate ei = new EntityItemGrate(this.field_145850_b, this.field_145851_c + 0.5D, this.field_145848_d + 0.6D, this.field_145849_e + 0.5D, stack.func_77946_l());\n/* 56 */ ei.field_70181_x = -0.1D;\n/* 57 */ ei.field_70159_w = 0.0D;\n/* 58 */ ei.field_70179_y = 0.0D;\n/* 59 */ this.field_145850_b.func_72838_d(ei);\n/* */ }\n/* */ }", "public void equip();", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) \n {\n \n }", "boolean useItem(Command command) {\n HashMap newInventory = inventory.getInventory();\n Iterator iterator = newInventory.entrySet().iterator();\n String seeItem;\n String nameOfItem = \"\";\n String useItem = \"debug\";\n\n while (iterator.hasNext()) {\n HashMap.Entry liste = (HashMap.Entry) iterator.next();\n String itemName = (String) liste.getKey();\n if (itemName.equalsIgnoreCase(command.getSecondWord())) {\n useItem = itemName;\n nameOfItem = itemName;\n break;\n }\n }\n if (!nameOfItem.equals(\"\") && inventory.getUseable(nameOfItem)) {\n\n System.out.println(\"You have dropped: \" + nameOfItem);\n inventory.removeItemInventory(nameOfItem);\n player.setEnergy(player.getEnergy() + 20);\n player.setHealth(player.getHealth() + 5);\n\n return true;\n }\n return false;\n }", "public void abortDigging(){\n\t\tint tile = mWorld.get(diggingX, diggingY);\n\t\tint type = tile & MaterialBank.MATERIAL_MASK;\n\t\tint result = type | WorldPhysic.COLLISION_MASK;\n\t\tmWorld.set(diggingX, diggingY, result);\n\t\t\n\t\tswitch(direction){\n\t\tcase DIRECTION_LEFT:\n\t\t\tmPhysic.setPos(World.TILE_SIZE*(diggingX+1), World.TILE_SIZE * diggingY);\n\t\t\tmWorld.computeVideType(diggingX+1, diggingY);\n\t\t\tbreak;\n\t\tcase DIRECTION_RIGHT:\n\t\t\tmPhysic.get2D().setRight(World.TILE_SIZE*diggingX);\n\t\t\tmWorld.computeVideType(diggingX-1, diggingY);\n\t\t\tbreak;\n\t\tcase DIRECTION_DOWN:\n\t\t\tmPhysic.get2D().setBottom(World.TILE_SIZE*diggingY);\n\t\t\tmWorld.computeVideType(diggingX, diggingY-1);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tmPhysic.setEnabled(true);\n\t\tmIsDigging = false;\n\t\t\n\t\tmAnimation.stop();\n\t}", "@Override\r\n\tpublic void quack() {\n\t\tsuper.gobble();\r\n\t}", "@Override\n\tprotected void readEntityFromNBT(NBTTagCompound tag) {\n\t\tthis.fuse = tag.getByte(\"Fuse\");\n\t\tthis.variant = tag.getByte(\"Variant\");\n\t}", "@Override\n public void onSmelting(EntityPlayer player, ItemStack item) {\n }", "public void handleBuyGuppyCommand() {\n if (Aquarium.money >= GUPPYPRICE) {\n guppyController.addNewEntity();\n Aquarium.money -= GUPPYPRICE;\n }\n }", "@Override\n\t\tpublic boolean touchDown(InputEvent event, float x, float y,\n\t\t\t\tint pointer, int button) {\n\t\t\tif(Inventory.CurrentInventory.BagActive)\n\t\t\t\treturn false;\n\t\t\tattack_queue = true;\n\t\t\t\n\t\t\t\n\t\t\treturn super.touchDown(event, x, y, pointer, button);\n\t\t}", "@Override\r\n\tpublic void quack() {\n\t\tmGoose.honk();\r\n\t}", "@Override\n\tprotected String getHurtSound() {\n\t\treturn \"mob.creeper.say\";\n\t}", "@Override\n\tpublic boolean canBePushed() {\n\t\treturn super.canBePushed() && isEgg();\n\t}", "ILogo getMugShot();", "public void changeHasTagBoost()\r\n\t{\r\n\t\thasTagBoost = !hasTagBoost;\r\n\t}", "public void bark() {\n\t\tsuper.bark(bark1);\n\t}", "public void remove() {\n super.remove();\n if (this.caughtEntity != null) {\n this.caughtEntity.noClip = false;\n }\n if (this.angler != null) {\n this.angler.fishingBobber = null;\n this.angler.noClip = false;\n }\n if(this.rod.getItem() == Items.ITEM_GRAB_HOOK){\n this.rod.getOrCreateTag().putBoolean(\"cast\", false);\n }\n }", "public static boolean tag(String taggerString, String taggedString, String gamecode){\n \tboolean failed = !Server.checkGameExisits(gamecode);\n \tUser tagger = Server.getUser(taggerString, gamecode);\n \tUser tagged = Server.getUser(taggedString, gamecode);\n \tPlayer human = null;\n \tPlayer zombie= null;\n \tif (tagger == null || tagged == null){\n \t\tfailed = true;\n \t}\n \tif (!failed && (tagger.isAdmin || tagged.isAdmin)){\n \t\tfailed = true;\n \t}\n \tif (!failed){\n \t\tif (((Player) tagger).isZombie){\n \t\t\tzombie = (Player) tagger;\n \t\t}\n \t\telse{\n \t\t\thuman = (Player) tagger;\n \t\t}\n \t\t\n \t\tif (((Player) tagged).isZombie) {\n \t\t\tzombie = (Player) tagged;\n \t\t}\n \t\telse{\n \t\t\thuman = (Player) tagged;\n \t\t}\n \t}\n \tif (human == null || zombie == null){\n \t\tfailed = true;\n \t}\n \t\n \tif (!failed){\n \t\ttry {\n\t\t\t\tif (DBHandler.getcooldown(taggerString, gamecode, c) < 0){\n\t\t\t\t\tfailed = true;\n\t\t\t\t}\n\t\t\t\tif (DBHandler.getcooldown(taggedString, gamecode, c) < 0){\n\t\t\t\t\tfailed = true;\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tfailed = true;\n\t\t\t}\n \t}\n \t\n \t//human stuns zombie\n \tif (!failed && human == (Player) tagger){\n \t\ttry {\n\t\t\t\tDBHandler.tag(taggerString, taggedString, gamecode, 0, c);\n\t\t\t\tDBHandler.setcooldown(taggedString, gamecode, c);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n \t}\n \t//zombie tags player\n \telse if (!failed){\n \t\ttry {\n \t\t\tDBHandler.makeZombie(human.feedcode, gamecode, c);\n\t\t\t\tDBHandler.tag(taggerString, taggedString, gamecode, 1, c);\n\t\t\t\tDBHandler.setcooldown(taggedString, gamecode, c);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n \t}\n \t\n \treturn !failed;\n }", "private void unequip(Equip e)\r\n { \r\n if (e.getType()==Equip.WEAPON)\r\n {\r\n attack -= e.getRating();\r\n items.add(e);\r\n }\r\n else if (e.getType() == Equip.ARMOR)\r\n {\r\n items.add(e);\r\n defense -= e.getRating();\r\n }\r\n }", "private void registerGlow()\n {\n try {\n Field f = Enchantment.class.getDeclaredField(\"acceptingNew\");\n f.setAccessible(true);\n f.set(null, true);\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n try {\n GlowEnchantment glow = new GlowEnchantment(70);\n Enchantment.registerEnchantment(glow);\n }\n catch (IllegalArgumentException e){\n }\n catch(Exception e){\n e.printStackTrace();\n }\n }", "@Override\n\tprotected void killReward() {\n\t\t\n\t}", "public void knockBack(Entity entity, float par2, double par3, double par5, double par6) {\n\t\tif (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).getAttributeValue()) {\n\t\t\tthis.isAirBorne = true;\n\t\t\tfloat f1 = MathHelper.sqrt_double(par3 * par3 + par5 * par5);\n\t\t\tfloat f2 = 0.4F;\n\t\t\tthis.motionX /= 2.0D;\n\t\t\tthis.motionY /= 2.0D;\n\t\t\tthis.motionZ /= 2.0D;\n\t\t\tthis.motionX -= par3 / (double)f1 * (double)f2;\n\t\t\tthis.motionY += (double)f2;\n\t\t\tthis.motionZ -= par5 / (double)f1 * (double)f2;\n\t\t\tif (this.motionY > par6) {\n\t\t\t\tthis.motionY = par6;\n\t\t\t}\n\t\t}\n\t}", "public void throwRock() {\n\t\tpokemon.HitByRock();\n\t}", "int getGunType();", "private void useItem(Command command) \n { \n if(!command.hasSecondWord()) { \n // if there is no second word, we don't know where to go... \n Logger.Log(\"What are you trying to use?\"); \n return; \n } \n \n String itemUsed = command.getSecondWord();\n String secondUsed = itemUsed + \"2\";\n \n Item thisItem = player.getItem(itemUsed);\n Item secondItem = player.getItem(secondUsed);\n \n Creature thisFriend = player.getCompanion(itemUsed);\n \n //Tries to retrieve which item or creature to use. If not, an error message is returned \n if (thisItem == null&&secondItem == null&&thisFriend == null) {\n Logger.Log(\"You don't have a \" + itemUsed);\n }\n else if (player.inventory.containsKey(itemUsed)) { \n player.removeItem(itemUsed); //The item is removed from inventory\n thisItem.UseItem(this);\n }\n else if (player.inventory.containsKey(secondUsed)) {\n player.removeItem(secondUsed); //The item is removed from inventory\n secondItem.UseItem(this);\n }\n else if (player.friends.containsKey(itemUsed)){ \n thisFriend.UseCompanion(this);\n if (thisFriend.flees){\n player.removeCompanion(itemUsed); //Companions do not get removed from inventory unless the flees boolean has been set to true.\n }\n } \n }", "public void equipSelectedWeapon() {\n }", "@Override\n\tprotected void on_object_drop(GfxObject bonus) {\n\n\t}", "protected String getHurtSound() {\n return \"dig.stone\";\n }", "public boolean hasSwordBlade(ItemStack stack) {\n if (!isValidManeuverGearHandleStack(stack)) {\n return false;\n }\n CompoundTag tag = stack.getTag();\n return tag != null && tag.getInt(Names.NBT.DAMAGE) > 0;\n }", "@Override\n public void readFromNBT(NBTTagCompound compound, boolean array) {\n super.readFromNBT(compound, array);\n fuel = DictionaryEntry.readFromNBTSafely(compound.getCompoundTag(\"fuel\"));\n edgeItem = new ItemStack(compound.getCompoundTag(\"edgeItem\"));\n }", "public void differentiate() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->differentiate() unimplemented!\\n\");\n }", "@Test\n void doEffectgrenadelauncher() {\n ArrayList<Player> pl = new ArrayList<>();\n AlphaGame g = new AlphaGame(1, pl,false, 8);\n WeaponFactory wf = new WeaponFactory(\"grenade launcher\");\n Weapon w18 = new Weapon(\"grenade launcher\", 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(w18);\n p.setPlayerPosition(Board.getSquare(6));\n p.getPh().drawWeapon(wd, w18.getName());\n RealPlayer victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n ArrayList<Player> players = new ArrayList<>();\n players.add(victim);\n ArrayList<GenericSquare> s = new ArrayList<>();\n s.add(Board.getSquare(10));\n try {\n p.getPh().getWeaponDeck().getWeapon(w18.getName()).doEffect(\"base\", null, null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim.getPlayerPosition() == Board.getSquare(10));\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n players.clear();\n players.add(victim);\n s.clear();\n try {\n p.getPh().getWeaponDeck().getWeapon(w18.getName()).doEffect(\"base\", null, null, p, players, null);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim.getPlayerPosition() == Board.getSpawnpoint('y'));\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n RealPlayer victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(10));\n RealPlayer victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(10));\n try {\n p.getPh().getWeaponDeck().getWeapon(w18.getName()).doEffect(\"base\", \"opt1\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 1 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSpawnpoint('y'));\n victim2 = new RealPlayer('v', \"ciccia\");\n victim2.setPlayerPosition(Board.getSquare(10));\n victim3 = new RealPlayer('g', \"ciccia\");\n victim3.setPlayerPosition(Board.getSquare(10));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(10));\n s.add(Board.getSquare(10));\n try {\n p.getPh().getWeaponDeck().getWeapon(w18.getName()).doEffect(\"base\", \"opt1\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { }\n\n assertTrue(victim.getPb().countDamages() == 2 && victim2.getPb().countDamages() == 1 && victim3.getPb().countDamages() == 1);\n\n victim = new RealPlayer('y', \"ciccia\");\n victim.setPlayerPosition(Board.getSquare(10));\n victim2 = new RealPlayer('v', \"ciccia1\");\n victim2.setPlayerPosition(Board.getSquare(10));\n players.clear();\n players.add(victim);\n s.clear();\n s.add(Board.getSquare(10));\n s.add(Board.getSpawnpoint('y'));\n try {\n p.getPh().getWeaponDeck().getWeapon(w18.getName()).doEffect(\"opt1\", \"base\", null, p, players, s);\n }catch (WrongValueException | WrongPlayerException | WrongSquareException e) { System.out.println(\"ERROR\");}\n\n assertTrue(victim.getPb().countDamages() == 2 && victim.getPlayerPosition() == Board.getSpawnpoint('y') && victim2.getPb().countDamages() == 1);\n }", "boolean useVoicedCommand(String command, Player activeChar, String target);", "public static int haveGun() {\n\t\treturn 108;\n\t}", "public abstract void mo20157a(DogHomeRsp dogHomeRsp);", "@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)\r\n public void onPlayerDamagedByPlayer(final EntityDamageByEntityEvent event) {\n if (!(event.getEntity() instanceof Player)) {\r\n return;\r\n }\r\n if (!(event.getDamager() instanceof Player)) {\r\n return;\r\n }\r\n \r\n final Player target = (Player)event.getEntity();\r\n final Player attacker = (Player)event.getDamager();\r\n final ItemStack is = attacker.getItemInHand();\r\n \r\n if (is != null){\r\n switch (is.getType()){\r\n case EMERALD:\r\n attacker.setItemInHand(ItemUtil.decrementItem(is, 1));\r\n \r\n // 体力・空腹回復、燃えてたら消化\r\n target.setHealth(target.getMaxHealth());\r\n target.setFoodLevel(20);\r\n target.setFireTicks(0);\r\n \r\n // ポーション効果付与\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 45 * 20, 0)); // 45 secs\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 7 * 60 * 20, 0)); // 7 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 9 * 60 * 20, 1)); // 9 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 9 * 60 * 20, 0)); // 9 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.FAST_DIGGING, 5 * 60 * 20, 1)); // 5 mins\r\n target.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 3 * 60 * 20, 0)); // 3 mins\r\n \r\n // effect, messaging\r\n target.getWorld().playEffect(target.getLocation(), Effect.ENDER_SIGNAL, 0, 10);\r\n Util.message(target, PlayerManager.getPlayer(attacker).getName() + \" &aから特殊効果を与えられました!\");\r\n Util.message(attacker, PlayerManager.getPlayer(target).getName() + \" &aに特殊効果を与えました!\");\r\n \r\n event.setCancelled(true);\r\n event.setDamage(0);\r\n break;\r\n default: break;\r\n }\r\n }\r\n }", "public void getTagCommand() {\n\n }", "public boolean hitEntity(ItemStack var1, EntityLiving var2, EntityLiving var3)\r\n {\r\n if (this.toolMaterial == XCEnumToolMaterial.FORSAKEN)\r\n {\r\n var1.damageItem(1, var3);\r\n var2.setFire(30);\r\n return true;\r\n }\r\n else\r\n {\r\n var1.damageItem(1, var3);\r\n return true;\r\n }\r\n }", "private static char askIfGoBack() {\n Scanner input = new Scanner(System.in);\n\n\t System.out.print(\"Enter (b)ack to go back: \");\n\t char go = input.next().toLowerCase().charAt(0);\n\n\t return go;\n }", "public void readEntityFromNBT(NBTTagCompound tagCompund)\n {\n super.readEntityFromNBT(tagCompund);\n\n if (tagCompund.hasKey(\"Potion\", 10))\n {\n this.potion = ItemStack.loadItemStackFromNBT(tagCompund.getCompoundTag(\"Potion\"));\n }\n else\n {\n this.setPotionDamage(tagCompund.getInteger(\"potionValue\"));\n }\n\n if (this.potion == null)\n {\n this.setDead();\n }\n }", "private void quitarCorazones(){\n if(ramiro.estadoItem== Ramiro.EstadoItem.NORMAL){\n efectoDamage.play();\n vidas--;\n }\n }", "public void catchCard(){\r\n changePlace(deck);\r\n changePlace(hand);\r\n }", "public void msgKitIsBad(AgentKit kit) {\n\t\tfor(MyKit mk: myKits){\n\t\t\tif(mk.kit.equals(kit)){\n\t\t\t\tmk.status = KitStatus.Bad_Kit;\n\t\t\t\tGuiKit k = mk.kit.guikit;\n\t\t\t\tk.clearKit();\n\t\t\t\tmk.kit = new AgentKit(mk.kit.config, mk.kit.position,mk.kit.name);\n\t\t\t\tmk.kit.guikit = k;\n\t\t\t\tstateChanged();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "public boolean onActivated(EntityPlayer player, QRayTraceResult hit, ItemStack item);", "public void spitIntakeCargo(){\n shoot.set(SPIT_INTAKE);\n }", "public CardBuilder withBackFace(String back) {\n BackFace backFace = new BackFace(back);\n this.backFace = backFace;\n return this;\n }", "private void onGauntletEvent(GauntletEvent event)\n\t{\n\t\tswitch (event.getType())\n\t\t{\n\t\t\tcase ATTACK_STYLE_SWITCHED:\n\t\t\t\tGauntletBoss.AttackStyle newAttackStyle = ((BossAttackStyleSwitched) event).getNewAttackStyle();\n\t\t\t\tplaySoundIfEnabled(getAudioClipForAttackStyle(newAttackStyle), config.playSoundOnAttackStyleSwitch());\n\t\t\t\tlog.debug(\"{} | Playing attack style switch sound for: {}\", client.getTickCount(), newAttackStyle);\n\t\t\t\tbreak;\n\t\t\tcase PROTECTION_PRAYER_SWITCHED:\n\t\t\t\tplaySoundIfEnabled(overheadSwitchAudioClip, config.playSoundOnOverheadSwitch(), true);\n\t\t\t\tlog.debug(\"{} | Playing prot prayer switched sound\", client.getTickCount());\n\t\t\t\tbreak;\n\t\t\tcase CRYSTAL_ATTACK:\n\t\t\t\tplaySoundIfEnabled(crystalAudioClip, config.playSoundOnCrystalAttack());\n\t\t\t\tlog.debug(\"{} | Playing crystal attack sound\", client.getTickCount());\n\t\t\t\tbreak;\n\t\t\tcase PLAYER_PRAYER_DISABLED:\n\t\t\t\tplaySoundIfEnabled(prayerDisabledAudioClip, config.playSoundOnDisablePrayerAttack());\n\t\t\t\tlog.debug(\"{} | Playing prayer disabled sound\", client.getTickCount());\n\t\t\t\tbreak;\n\t\t\tcase PLAYER_DEATH:\n\t\t\t\tplaySoundIfEnabled(playerDeathAudioClip, config.playSoundOnPlayerDeath());\n\t\t\t\tbreak;\n\t\t\tcase DEMI_BOSS_SPAWNED:\n\t\t\t\tDemiBossSpawned demiBossSpawned = ((DemiBossSpawned) event);\n\t\t\t\tNPC demiBoss = demiBossSpawned.getNpc();\n\t\t\t\tif (isHighlightEnabledForDemiBoss(demiBoss.getId()))\n\t\t\t\t{\n\t\t\t\t\tclient.setHintArrow(demiBossSpawned.getWorldLocation());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase DEMI_BOSS_DESPAWNED:\n\t\t\t\tNPC despawnedDemiBoss = ((DemiBossDespawned) event).getNpc();\n\t\t\t\tlog.debug(\"Demi boss despawned: {}\", despawnedDemiBoss.getId());\n\t\t\t\tif (isHighlightEnabledForDemiBoss(despawnedDemiBoss.getId()))\n\t\t\t\t{\n\t\t\t\t\tlog.debug(\"Demi boss despawned: {}, arrow cleared\", despawnedDemiBoss.getId());\n\t\t\t\t\tclient.clearHintArrow();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase BOSS_ROOM_ENTERED:\n\t\t\t\tclient.clearHintArrow();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlog.warn(\"Unknown gauntlet event: {}\", event.getType());\n\t\t}\n\t}", "@Override\n public int quantityDropped(int meta, int fortune, Random random)\n {\n return super.quantityDropped(meta, fortune, random);\n }", "public IIcon getIconFromDamage(int par1)\n/* 54: */ {\n/* 55:53 */ if (this.isIron) {\n/* 56:54 */ return Items.iron_sword.getIconFromDamage(par1);\n/* 57: */ }\n/* 58:55 */ return Items.diamond_sword.getIconFromDamage(par1);\n/* 59: */ }", "public void addCrafting(StackType option);", "@Override\n protected void dropRareDrop(int superRare) {\n ItemStack drop = new ItemStack(Items.fishing_rod);\n EffectHelper.setItemName(drop, \"Whip of Destruction\", 0xd);\n drop.addEnchantment(Enchantment.sharpness, 1);\n drop.addEnchantment(Enchantment.unbreaking, 10);\n this.entityDropItem(drop, 0.0F);\n }", "public void EjectStackOnMilled( ItemStack stack )\r\n {\r\n \tint iFacing = 2 + worldObj.rand.nextInt( 4 ); // random direction to the sides\r\n \t\r\n \tVec3 ejectPos = Vec3.createVectorHelper( worldObj.rand.nextDouble() * 1.25F - 0.125F, \r\n \t\tworldObj.rand.nextFloat() * ( 1F / 16F ) + ( 7F / 16F ), \r\n \t\t-0.2F );\r\n \t\r\n \tejectPos.RotateAsBlockPosAroundJToFacing( iFacing );\r\n \t\r\n EntityItem entity = new EntityItem( worldObj, xCoord + ejectPos.xCoord, \r\n \t\tyCoord + ejectPos.yCoord, zCoord + ejectPos.zCoord, stack );\r\n\r\n \tVec3 ejectVel = Vec3.createVectorHelper( worldObj.rand.nextGaussian() * 0.025D, \r\n \t\tworldObj.rand.nextGaussian() * 0.025D + 0.1F, \r\n \t\t-0.06D + worldObj.rand.nextGaussian() * 0.04D );\r\n \t\r\n \tejectVel.RotateAsVectorAroundJToFacing( iFacing );\r\n \t\r\n entity.motionX = ejectVel.xCoord;\r\n entity.motionY = ejectVel.yCoord;\r\n entity.motionZ = ejectVel.zCoord;\r\n \r\n entity.delayBeforeCanPickup = 10;\r\n \r\n worldObj.spawnEntityInWorld( entity );\r\n }", "public void toSelectingWeapon() {\n }", "public void onKilled(AI ai) {\n\t\n}", "@Override\n\tpublic void msgGotHungry() {\n\t\t\n\t}", "void doEffect(Skill castSkill, double power, Creature performer, Item target) {\n/* 87 */ if ((!target.isMailBox() && !target.isSpringFilled() && !target.isPuppet() && \n/* 88 */ !target.isUnenchantedTurret() && !target.isEnchantedTurret()) || (target\n/* 89 */ .hasDarkMessenger() && !target.isEnchantedTurret())) {\n/* */ \n/* 91 */ performer.getCommunicator().sendNormalServerMessage(\"The spell fizzles.\", (byte)3);\n/* */ return;\n/* */ } \n/* 94 */ if (target.isUnenchantedTurret() || target.isEnchantedTurret()) {\n/* */ \n/* 96 */ int spirit = Zones.getSpiritsForTile(performer.getTileX(), performer.getTileY(), performer.isOnSurface());\n/* 97 */ String sname = \"no spirits\";\n/* 98 */ int templateId = 934;\n/* 99 */ if (spirit == 4) {\n/* */ \n/* 101 */ templateId = 942;\n/* 102 */ sname = \"There are plenty of air spirits at this height.\";\n/* */ } \n/* 104 */ if (spirit == 2) {\n/* */ \n/* 106 */ templateId = 968;\n/* 107 */ sname = \"Some water spirits were closeby.\";\n/* */ } \n/* 109 */ if (spirit == 3) {\n/* */ \n/* 111 */ templateId = 940;\n/* 112 */ sname = \"Earth spirits are everywhere below ground.\";\n/* */ } \n/* 114 */ if (spirit == 1) {\n/* */ \n/* 116 */ sname = \"Some nearby fire spirits are drawn to your contraption.\";\n/* 117 */ templateId = 941;\n/* */ } \n/* 119 */ if (templateId == 934) {\n/* */ \n/* 121 */ performer.getCommunicator().sendAlertServerMessage(\"There are no spirits nearby. Nothing happens.\", (byte)3);\n/* */ \n/* */ return;\n/* */ } \n/* 125 */ if (target.isUnenchantedTurret()) {\n/* */ \n/* 127 */ performer.getCommunicator().sendSafeServerMessage(sname);\n/* 128 */ target.setTemplateId(templateId);\n/* 129 */ target.setAuxData(performer.getKingdomId());\n/* */ }\n/* 131 */ else if (target.isEnchantedTurret()) {\n/* */ \n/* 133 */ if (target.getTemplateId() != templateId) {\n/* */ \n/* 135 */ performer.getCommunicator().sendAlertServerMessage(\"The nearby spirits ignore your contraption. Nothing happens.\", (byte)3);\n/* */ \n/* */ return;\n/* */ } \n/* */ \n/* 140 */ performer.getCommunicator().sendSafeServerMessage(sname);\n/* */ } \n/* */ } \n/* */ \n/* 144 */ ItemSpellEffects effs = target.getSpellEffects();\n/* 145 */ if (effs == null)\n/* 146 */ effs = new ItemSpellEffects(target.getWurmId()); \n/* 147 */ SpellEffect eff = effs.getSpellEffect(this.enchantment);\n/* 148 */ if (eff == null) {\n/* */ \n/* 150 */ performer.getCommunicator().sendNormalServerMessage(\"You summon nearby spirits into the \" + target\n/* 151 */ .getName() + \".\", (byte)2);\n/* */ \n/* 153 */ eff = new SpellEffect(target.getWurmId(), this.enchantment, (float)power, 20000000);\n/* 154 */ effs.addSpellEffect(eff);\n/* 155 */ Server.getInstance().broadCastAction(performer\n/* 156 */ .getName() + \" looks pleased as \" + performer.getHeSheItString() + \" summons some spirits into the \" + target\n/* 157 */ .getName() + \".\", performer, 5);\n/* 158 */ if (!target.isEnchantedTurret()) {\n/* 159 */ target.setHasCourier(true);\n/* */ \n/* */ }\n/* */ }\n/* 163 */ else if (eff.getPower() > power) {\n/* */ \n/* 165 */ performer.getCommunicator().sendNormalServerMessage(\"You frown as you fail to summon more spirits into the \" + target\n/* 166 */ .getName() + \".\", (byte)3);\n/* */ \n/* 168 */ Server.getInstance().broadCastAction(performer.getName() + \" frowns.\", performer, 5);\n/* */ }\n/* */ else {\n/* */ \n/* 172 */ performer.getCommunicator().sendNormalServerMessage(\"You succeed in summoning more spirits into the \" + this.name + \".\", (byte)2);\n/* */ \n/* */ \n/* 175 */ eff.improvePower(performer, (float)power);\n/* 176 */ if (!target.isEnchantedTurret())\n/* 177 */ target.setHasCourier(true); \n/* 178 */ Server.getInstance().broadCastAction(performer\n/* 179 */ .getName() + \" looks pleased as \" + performer.getHeSheItString() + \" summons some spirits into the \" + target\n/* 180 */ .getName() + \".\", performer, 5);\n/* */ } \n/* */ }", "@Override\n public Answer processCommand(Command command) {\n\n // Add Item to your backpack\n if (command.hasActionOf(HitWord.GET, HitWord.TAKE)) {\n return PersonManager.get().getPerson().getBackpack().addItem(this);\n }\n // Remove the item from your backpack\n if (command.hasActionOf(HitWord.DROP, HitWord.REMOVE)) {\n if (PersonManager.get().getPerson().getBackpack().removeItemById(this.getId())) {\n return new Answer(\"Removed \" + getColor().name() + \" \" + getName() + \" from your backpack, \" + getName() + \" is lost.\", Answer.DECORATION.REMOVING);\n }\n }\n\n return super.processCommand(command);\n }", "private void vulIn(String teken, GraphicsContext gc)\n {\n switch (teken)\n {\n case \"#\":\n drawImage(gc, \"/images/muur.png\", 0, 0);\n break;\n case \"#r\":\n drawImage(gc, \"/images/muur_rand.png\", 0, 0);\n break;\n case \"@\":\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/hero_onder.png\", 5, 5);\n break;\n case \".\":\n drawImage(gc, \"/images/doel.png\", 0, 0);\n break;\n case \"$.\":\n drawImage(gc, \"/images/doel.png\", 0, 0);\n drawImage(gc, \"/images/kist.png\", 5, 5);\n break;\n case \"@.\":\n drawImage(gc, \"/images/doel.png\", 0, 0);\n break;\n case \"$\":\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n drawImage(gc, \"/images/kist.png\", 5, 5);\n break;\n case \"_\":\n drawImage(gc, \"/images/wandel.png\", 0, 0);\n break;\n\n }\n }", "private void inAvanti() {\n\t\tif (Game.getInstance().isOnGround) {\n\t\t\tjump=false;\n\t\t\tGame.getInstance().getPersonaggio().setStato(Protagonista.RUN);\n\t\t\tGraficaProtagonista.getInstance().cambiaAnimazioni(Protagonista.RUN);\n\t\t}\n\t}", "public Carta hit() {\n\trobadas++;\n\treturn deck[robadas-1];\n}", "public void func_70037_a(NBTTagCompound par1NBTTagCompound) {\n/* 349 */ super.func_70037_a(par1NBTTagCompound);\n/* 350 */ setIsSummoned(par1NBTTagCompound.func_74767_n(\"summoned\"));\n/* 351 */ this.damBonus = par1NBTTagCompound.func_74771_c(\"damBonus\");\n/* */ }", "public void hungry()\r\n {\r\n \tSystem.out.println(\"I'm hungry!! Feed me!!\");\r\n \tbarking();\r\n }", "protected final void hit() throws InsufficientCardsException {\n hand.add(deck.deal());\n update();\n }", "public void readEntityFromNBT(NBTTagCompound tagCompund) {}", "public abstract void receiveFavor(int playerIndex, Card card);", "@Override\n public void readFromNBT(NBTTagCompound nbt)\n {\n super.readFromNBT(nbt);\n pokedexNb = nbt.getInteger(\"pokedexNb\");\n time = nbt.getInteger(\"time\");\n NBTBase temp = nbt.getTag(\"Inventory\");\n if (temp instanceof NBTTagList)\n {\n NBTTagList tagList = (NBTTagList) temp;\n for (int i = 0; i < tagList.tagCount(); i++)\n {\n NBTTagCompound tag = tagList.getCompoundTagAt(i);\n byte slot = tag.getByte(\"Slot\");\n\n if (slot >= 0 && slot < inventory.length)\n {\n inventory[slot] = ItemStack.loadItemStackFromNBT(tag);\n }\n }\n }\n }", "public void aapneBomberOgFlagg() {\n brettTapt = true;\n if (trykketPaa) {\n return;\n }\n // Viser alle bomber som ikke er flagget\n if (bombe && !flagget) {\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.GREY, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n // Fargekoder om flaggingen var korrekt eller ikke\n if (flagget) {\n if (!bombe) {\n setBackground(new Background(new BackgroundFill(Color.PINK, CornerRadii.EMPTY, Insets.EMPTY)));\n } else {\n Color lysegroenn = Color.rgb(86, 130, 3, 0.3);\n setBackground(new Background(new BackgroundFill(lysegroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n }\n }", "@Test\n public void test_BoostOnDies() {\n addCard(Zone.HAND, playerA, \"Silumgar Scavenger\", 1); // {4}{B}\n addCard(Zone.BATTLEFIELD, playerA, \"Swamp\", 5);\n //\n addCard(Zone.BATTLEFIELD, playerA, \"Balduvian Bears\", 1);\n\n // cast and exploit\n castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, \"Silumgar Scavenger\");\n setChoice(playerA, true); // yes, exploit\n addTarget(playerA, \"Balduvian Bears\");\n\n checkPermanentCounters(\"boost\", 1, PhaseStep.BEGIN_COMBAT, playerA, \"Silumgar Scavenger\", CounterType.P1P1, 1);\n checkAbility(\"boost\", 1, PhaseStep.BEGIN_COMBAT, playerA, \"Silumgar Scavenger\", HasteAbility.class, true);\n\n setStopAt(1, PhaseStep.END_TURN);\n setStrictChooseMode(true);\n execute();\n }", "public void setGunName(String name) {\n\t\tgunName = name;\n\t}", "public void eatItem(Command command) {\n if (!command.hasSecondWord()) { // check if there's a second word\n System.out.println(\"Eat what?\");\n return;\n }\n String itemToBeEaten = command.getSecondWord();\n List<Item> playerInventory = player.getPlayerInventory(); // load the inventory of the player\n\n boolean somethingToUse = false;\n int notThisItem = 0;\n int loop;\n\n for (loop = 0; loop < playerInventory.size(); loop++) { // loop through the player inventory\n Item currentItem = playerInventory.get(loop); // set currentitem on the item that is currently in the loop\n if (itemToBeEaten.equals(currentItem.getItemName()) ){ // get the item name, then check if that matches the secondWord\n if (currentItem.getItemCategory().equals(\"food\")){ // check if the item used is an item in the \"food\" category\n if((player.getHealth())<(20)) { // check if the player's health is full\n player.addHealth(currentItem.getHealAmount()); // heal the player\n player.removeItemFromInventory(currentItem); // remove item from inventory\n System.out.println(\"You eat the \" + itemToBeEaten + \". It heals for \" + currentItem.getHealAmount()+\".\");\n } else { // the player's health is full\n System.out.println(\"Your are at full health!\");\n }\n } else { // item is not a food item\n System.out.println(\"You can't eat that item!\");\n }\n } else { // the item did not match the player provided name\n notThisItem++;\n }\n somethingToUse = true;\n }\n\n //errors afvangen\n if (!somethingToUse) { // the item is not found in the player inventory\n System.out.println(\"You can't eat that!\");\n }\n\n if (loop == notThisItem) { // the player has nothing to burn secondWord with\n //ThisItem is the same amount as loop. Then the player put something in that is not in the room\n System.out.println(\"You cannot eat \" + itemToBeEaten + \" because you don't have it in your inventory!\");\n }\n }", "boolean hasGemReward();", "public boolean applySwordBlade(LivingEntity entity, ItemStack stack, boolean left) {\n if (!isValidManeuverGearHandleStack(stack)) {\n return false;\n }\n if (hasSwordBlade(stack)) {\n return false;\n }\n if (entity instanceof Player) {\n Player player = (Player) entity;\n ItemStack maneuverGearStack = DartHandler.instance.getManeuverGear(player);\n if (maneuverGearStack == null || !(maneuverGearStack.getItem() instanceof ItemManeuverGear)) {\n return false;\n }\n ItemManeuverGear maneuverGear = (ItemManeuverGear) maneuverGearStack.getItem();\n if (maneuverGear.getBladeCount(maneuverGearStack, left) > 0) {\n maneuverGear.removeBlades(maneuverGearStack, 1, left);\n CompoundTag tag = stack.getTag();\n tag = tag == null ? new CompoundTag() : tag;\n tag.putInt(Names.NBT.DAMAGE, getDurability());\n stack.setTag(tag);\n return true;\n }\n }\n return false;\n }", "@Override\n\tpublic void eat() {\n\t\tSystem.out.println(\"eat grass\");\n\t}", "boolean takeDamage(int dmg);" ]
[ "0.5824643", "0.53433955", "0.5268929", "0.52553385", "0.5181295", "0.5134795", "0.51144886", "0.51125455", "0.5098377", "0.5049892", "0.50476116", "0.49928555", "0.498612", "0.49760073", "0.49710828", "0.49641833", "0.49427745", "0.49397945", "0.49249005", "0.4914353", "0.49045867", "0.49044132", "0.4890087", "0.48838666", "0.48804638", "0.4834642", "0.48054394", "0.47997826", "0.47949642", "0.47938678", "0.47851136", "0.478343", "0.4773832", "0.47664747", "0.47443256", "0.4736208", "0.47355267", "0.472767", "0.47216418", "0.47128826", "0.47120768", "0.47101998", "0.47067505", "0.47036883", "0.46810168", "0.468039", "0.46621713", "0.46475118", "0.46415678", "0.4617077", "0.4595524", "0.45890644", "0.45887205", "0.4583585", "0.45825952", "0.45811108", "0.45780414", "0.45765823", "0.45748484", "0.45744255", "0.45703158", "0.45702", "0.45591235", "0.45520335", "0.45503148", "0.4549419", "0.45448893", "0.45362368", "0.45351398", "0.45327348", "0.4524437", "0.4519097", "0.45178282", "0.450754", "0.4503798", "0.4503622", "0.44970727", "0.4496891", "0.44965485", "0.44960663", "0.4495767", "0.4494051", "0.44929576", "0.4489582", "0.44844252", "0.44841218", "0.44831234", "0.4479751", "0.44797143", "0.44768274", "0.4475572", "0.4474719", "0.44719303", "0.44718346", "0.44715682", "0.44713658", "0.44702214", "0.4468059", "0.44649756", "0.44636396" ]
0.6038444
0
Asks the client to use the targeting scope
@Override public void askForTargetingScope() throws RemoteException { mainPage.setRemoteController(senderRemoteController); mainPage.setMatch(match); Platform.runLater( () -> { try { mainPage.askForTargetingScope(); } catch (Exception e) { e.printStackTrace(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setScopeRelevant(boolean scopeRelevant);", "public void setScope(String scope) {\n this.scope = scope;\n }", "public void setScope(String scope) {\n this.scope = scope;\n }", "public void setScope(String scope) {\n this.scope = scope;\n }", "public void setScope(Scope scope) {\n this.scope = scope;\n }", "public void setScope(Scope scope) {\n this.scope = scope;\n }", "public void setScope(Scope scope) {\n this.scope = scope;\n }", "public void setScope(java.lang.String scope) {\r\n this.scope = scope;\r\n }", "protected void initScopeInfo()\n {\n String className = null;\n Object target = getTarget();\n if (target != null)\n className = target.getClass().getName();\n setScopeInfo(new AbstractScopeInfo(getName(), className));\n }", "void activateTarget(@ParamName(\"targetId\") String targetId);", "@Override\n\tprotected void updateTargetRequest() {\n\t}", "public void setTarget(String target) {\n this.target = target;\n }", "public void setScope(JexlEngine.Scope theScope) {\r\n this.scope = theScope;\r\n }", "void setTarget(java.lang.String target);", "public com.google.api.ads.adwords.axis.v201402.video.TargetingScope getTargetingScope() {\n return targetingScope;\n }", "public String getScope() {\n return scope;\n }", "public String getScope() {\n return scope;\n }", "@Override\n\tpublic void setTarget(Object arg0) {\n\t\tdefaultEdgle.setTarget(arg0);\n\t}", "public void toSelectingAttackTarget() {\n }", "String getScope();", "public void setScope ( Object scope ) {\r\n\t\tgetStateHelper().put(PropertyKeys.scope, scope);\r\n\t\thandleAttribute(\"scope\", scope);\r\n\t}", "public void setTarget(java.lang.String target) {\n this.target = target;\n }", "public void setShowScope(int scope)\r\n\t{\r\n\t\tthis.m_showScope = scope;\r\n\t}", "public void setScope(String scope) {\n\t\tthis.scope = TagUtils.getScope(scope);\n\t}", "public String getScope() {\n\t\treturn scope;\n\t}", "public String getScope() {\n return this.scope;\n }", "public String getScope() {\n return this.scope;\n }", "public String getScope() {\n return this.scope;\n }", "public void setScope(String scope) {\n this.scope = scope == null ? null : scope.trim();\n }", "public interface Target {\n\n /**\n * Activates (focuses) the target.\n *\n * @param targetId\n */\n void activateTarget(@ParamName(\"targetId\") String targetId);\n\n /**\n * Attaches to the target with given id.\n *\n * @param targetId\n */\n @Returns(\"sessionId\")\n String attachToTarget(@ParamName(\"targetId\") String targetId);\n\n /**\n * Attaches to the target with given id.\n *\n * @param targetId\n * @param flatten Enables \"flat\" access to the session via specifying sessionId attribute in the\n * commands.\n */\n @Returns(\"sessionId\")\n String attachToTarget(\n @ParamName(\"targetId\") String targetId,\n @Experimental @Optional @ParamName(\"flatten\") Boolean flatten);\n\n /** Attaches to the browser target, only uses flat sessionId mode. */\n @Experimental\n @Returns(\"sessionId\")\n String attachToBrowserTarget();\n\n /**\n * Closes the target. If the target is a page that gets closed too.\n *\n * @param targetId\n */\n @Returns(\"success\")\n Boolean closeTarget(@ParamName(\"targetId\") String targetId);\n\n /**\n * Inject object to the target's main frame that provides a communication channel with browser\n * target.\n *\n * <p>Injected object will be available as `window[bindingName]`.\n *\n * <p>The object has the follwing API: - `binding.send(json)` - a method to send messages over the\n * remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that\n * will be called for the protocol notifications and command responses.\n *\n * @param targetId\n */\n @Experimental\n void exposeDevToolsProtocol(@ParamName(\"targetId\") String targetId);\n\n /**\n * Inject object to the target's main frame that provides a communication channel with browser\n * target.\n *\n * <p>Injected object will be available as `window[bindingName]`.\n *\n * <p>The object has the follwing API: - `binding.send(json)` - a method to send messages over the\n * remote debugging protocol - `binding.onmessage = json => handleMessage(json)` - a callback that\n * will be called for the protocol notifications and command responses.\n *\n * @param targetId\n * @param bindingName Binding name, 'cdp' if not specified.\n */\n @Experimental\n void exposeDevToolsProtocol(\n @ParamName(\"targetId\") String targetId,\n @Optional @ParamName(\"bindingName\") String bindingName);\n\n /**\n * Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than\n * one.\n */\n @Experimental\n @Returns(\"browserContextId\")\n String createBrowserContext();\n\n /** Returns all browser contexts created with `Target.createBrowserContext` method. */\n @Experimental\n @Returns(\"browserContextIds\")\n @ReturnTypeParameter(String.class)\n List<String> getBrowserContexts();\n\n /**\n * Creates a new page.\n *\n * @param url The initial URL the page will be navigated to.\n */\n @Returns(\"targetId\")\n String createTarget(@ParamName(\"url\") String url);\n\n /**\n * Creates a new page.\n *\n * @param url The initial URL the page will be navigated to.\n * @param width Frame width in DIP (headless chrome only).\n * @param height Frame height in DIP (headless chrome only).\n * @param browserContextId The browser context to create the page in.\n * @param enableBeginFrameControl Whether BeginFrames for this target will be controlled via\n * DevTools (headless chrome only, not supported on MacOS yet, false by default).\n * @param newWindow Whether to create a new Window or Tab (chrome-only, false by default).\n * @param background Whether to create the target in background or foreground (chrome-only, false\n * by default).\n */\n @Returns(\"targetId\")\n String createTarget(\n @ParamName(\"url\") String url,\n @Optional @ParamName(\"width\") Integer width,\n @Optional @ParamName(\"height\") Integer height,\n @Optional @ParamName(\"browserContextId\") String browserContextId,\n @Experimental @Optional @ParamName(\"enableBeginFrameControl\") Boolean enableBeginFrameControl,\n @Optional @ParamName(\"newWindow\") Boolean newWindow,\n @Optional @ParamName(\"background\") Boolean background);\n\n /** Detaches session with given id. */\n void detachFromTarget();\n\n /**\n * Detaches session with given id.\n *\n * @param sessionId Session to detach.\n * @param targetId Deprecated.\n */\n void detachFromTarget(\n @Optional @ParamName(\"sessionId\") String sessionId,\n @Deprecated @Optional @ParamName(\"targetId\") String targetId);\n\n /**\n * Deletes a BrowserContext. All the belonging pages will be closed without calling their\n * beforeunload hooks.\n *\n * @param browserContextId\n */\n @Experimental\n void disposeBrowserContext(@ParamName(\"browserContextId\") String browserContextId);\n\n /** Returns information about a target. */\n @Experimental\n @Returns(\"targetInfo\")\n TargetInfo getTargetInfo();\n\n /**\n * Returns information about a target.\n *\n * @param targetId\n */\n @Experimental\n @Returns(\"targetInfo\")\n TargetInfo getTargetInfo(@Optional @ParamName(\"targetId\") String targetId);\n\n /** Retrieves a list of available targets. */\n @Returns(\"targetInfos\")\n @ReturnTypeParameter(TargetInfo.class)\n List<TargetInfo> getTargets();\n\n /**\n * Sends protocol message over session with given id.\n *\n * @param message\n */\n void sendMessageToTarget(@ParamName(\"message\") String message);\n\n /**\n * Sends protocol message over session with given id.\n *\n * @param message\n * @param sessionId Identifier of the session.\n * @param targetId Deprecated.\n */\n void sendMessageToTarget(\n @ParamName(\"message\") String message,\n @Optional @ParamName(\"sessionId\") String sessionId,\n @Deprecated @Optional @ParamName(\"targetId\") String targetId);\n\n /**\n * Controls whether to automatically attach to new targets which are considered to be related to\n * this one. When turned on, attaches to all existing related targets as well. When turned off,\n * automatically detaches from all currently attached targets.\n *\n * @param autoAttach Whether to auto-attach to related targets.\n * @param waitForDebuggerOnStart Whether to pause new targets when attaching to them. Use\n * `Runtime.runIfWaitingForDebugger` to run paused targets.\n */\n @Experimental\n void setAutoAttach(\n @ParamName(\"autoAttach\") Boolean autoAttach,\n @ParamName(\"waitForDebuggerOnStart\") Boolean waitForDebuggerOnStart);\n\n /**\n * Controls whether to automatically attach to new targets which are considered to be related to\n * this one. When turned on, attaches to all existing related targets as well. When turned off,\n * automatically detaches from all currently attached targets.\n *\n * @param autoAttach Whether to auto-attach to related targets.\n * @param waitForDebuggerOnStart Whether to pause new targets when attaching to them. Use\n * `Runtime.runIfWaitingForDebugger` to run paused targets.\n * @param flatten Enables \"flat\" access to the session via specifying sessionId attribute in the\n * commands.\n */\n @Experimental\n void setAutoAttach(\n @ParamName(\"autoAttach\") Boolean autoAttach,\n @ParamName(\"waitForDebuggerOnStart\") Boolean waitForDebuggerOnStart,\n @Experimental @Optional @ParamName(\"flatten\") Boolean flatten);\n\n /**\n * Controls whether to discover available targets and notify via\n * `targetCreated/targetInfoChanged/targetDestroyed` events.\n *\n * @param discover Whether to discover available targets.\n */\n void setDiscoverTargets(@ParamName(\"discover\") Boolean discover);\n\n /**\n * Enables target discovery for the specified locations, when `setDiscoverTargets` was set to\n * `true`.\n *\n * @param locations List of remote locations.\n */\n @Experimental\n void setRemoteLocations(@ParamName(\"locations\") List<RemoteLocation> locations);\n\n /** Issued when attached to target because of auto-attach or `attachToTarget` command. */\n @EventName(\"attachedToTarget\")\n @Experimental\n EventListener onAttachedToTarget(EventHandler<AttachedToTarget> eventListener);\n\n /**\n * Issued when detached from target for any reason (including `detachFromTarget` command). Can be\n * issued multiple times per target if multiple sessions have been attached to it.\n */\n @EventName(\"detachedFromTarget\")\n @Experimental\n EventListener onDetachedFromTarget(EventHandler<DetachedFromTarget> eventListener);\n\n /**\n * Notifies about a new protocol message received from the session (as reported in\n * `attachedToTarget` event).\n */\n @EventName(\"receivedMessageFromTarget\")\n EventListener onReceivedMessageFromTarget(EventHandler<ReceivedMessageFromTarget> eventListener);\n\n /** Issued when a possible inspection target is created. */\n @EventName(\"targetCreated\")\n EventListener onTargetCreated(EventHandler<TargetCreated> eventListener);\n\n /** Issued when a target is destroyed. */\n @EventName(\"targetDestroyed\")\n EventListener onTargetDestroyed(EventHandler<TargetDestroyed> eventListener);\n\n /** Issued when a target has crashed. */\n @EventName(\"targetCrashed\")\n EventListener onTargetCrashed(EventHandler<TargetCrashed> eventListener);\n\n /**\n * Issued when some information about a target has changed. This only happens between\n * `targetCreated` and `targetDestroyed`.\n */\n @EventName(\"targetInfoChanged\")\n EventListener onTargetInfoChanged(EventHandler<TargetInfoChanged> eventListener);\n}", "public int getScope() {\r\n\t\treturn scope;\r\n\t}", "public void setTargetType(int targetType) {\n this.targetType = targetType;\n \n Ability ability = battleEvent.getAbility();\n \n switch ( targetType ) {\n case NORMAL_TARGET:\n case AE_CENTER:\n //targetSelfButton.setVisible(ability.can(\"TARGETSELF\"));\n noMoreTargetsButton.setVisible(false);\n noTargetButton.setVisible(false);\n \n break;\n case SKILL_TARGET:\n //targetSelfButton.setVisible(ability.can(\"TARGETSELF\"));\n noMoreTargetsButton.setVisible(false);\n noTargetButton.setVisible(false);\n \n break;\n case AE_TARGET:\n case AE_SELECTIVE_TARGET:\n case AE_NONSELECTIVE_TARGET:\n //targetSelfButton.setVisible(ability.can(\"TARGETSELF\"));\n noMoreTargetsButton.setVisible(true);\n if ( targetSelected == true ) {\n noMoreTargetsButton.setText( \"Remove Target\" );\n } else {\n noMoreTargetsButton.setText( \"No More Targets\" );\n }\n noTargetButton.setVisible(false);\n break;\n case KNOCKBACK_TARGET:\n //targetSelfButton.setVisible(false);\n noMoreTargetsButton.setVisible(false);\n noTargetButton.setVisible(true);\n break;\n case SECONDARY_TARGET:\n //targetSelfButton.setVisible(ability.can(\"TARGETSELF\"));\n \n if ( targetSelected == true ) {\n noMoreTargetsButton.setText( \"Remove Target\" );\n noMoreTargetsButton.setVisible(true);\n noTargetButton.setVisible(false);\n } else {\n noMoreTargetsButton.setVisible(false);\n noTargetButton.setVisible(true);\n }\n \n break;\n }\n }", "public Scope getScope() {\n return scope;\n }", "public Scope getScope() {\n return scope;\n }", "public Scope getScope() {\n return scope;\n }", "public void setTarget(Target target) {\n\t\tthis.target = target;\n\t}", "public java.lang.String getScope() {\r\n return scope;\r\n }", "@Nullable\n public String getScope() {\n return scope;\n }", "public DraggableBehavior setScope(String scope)\n\t{\n\t\tthis.options.putLiteral(\"scope\", scope);\n\t\treturn this;\n\t}", "public void setScope(String scope)\n {\n if (\"singleton\".equals(scope))\n _scope = Singleton.class;\n else if (\"dependent\".equals(scope))\n _scope = Dependent.class;\n else if (\"request\".equals(scope))\n _scope = RequestScoped.class;\n else if (\"session\".equals(scope))\n _scope = SessionScoped.class;\n else if (\"application\".equals(scope))\n _scope = ApplicationScoped.class;\n else if (\"conversation\".equals(scope))\n _scope = ConversationScoped.class;\n else {\n Class cl = null;\n \n try {\n \tClassLoader loader = Thread.currentThread().getContextClassLoader();\n \t\n \tcl = Class.forName(scope, false, loader);\n } catch (ClassNotFoundException e) {\n }\n \n if (cl == null)\n \tthrow new ConfigException(L.l(\"'{0}' is an invalid scope. The scope must be a valid @ScopeType annotation.\"));\n \n if (! Annotation.class.isAssignableFrom(cl))\n \tthrow new ConfigException(L.l(\"'{0}' is an invalid scope. The scope must be a valid @ScopeType annotation.\"));\n \n if (! cl.isAnnotationPresent(ScopeType.class))\n \tthrow new ConfigException(L.l(\"'{0}' is an invalid scope. The scope must be a valid @ScopeType annotation.\"));\n \n _scope = cl;\n }\n }", "public void setTargetingScope(com.google.api.ads.adwords.axis.v201402.video.TargetingScope targetingScope) {\n this.targetingScope = targetingScope;\n }", "public interface TwitterAdsTargetingApi {\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param lineItemId Scope targeting criteria to a specific line item by providing its identifier.\n * @param withDeleted Include deleted results in your request. Defaults to false.\n * @return Retrieve details for some or all TargetingCriterias associated with the current account.\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_criteria\">https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_criteria</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getTargetingCriterias(String accountId, String lineItemId, boolean withDeleted)\n throws TwitterException;\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param targetingId A reference to the targeting criteria you are operating with in the request.\n * @param withDeleted Include deleted results in your request. Defaults to false.\n * @return Retrieve detailed information on a targeting criterion associated with a specific line item.\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_criteria/%3Aid\">https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_criteria/%3Aid</a>\n */\n BaseAdsResponse<TargetingCriteria> getTargetingCriteriaById(String accountId, String targetingId, boolean withDeleted) throws TwitterException;\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param lineItemId The line item ID to create targeting criteria upon.\n * @param targetingType The type of targeting to be used with this targeting criteria.\n * @param targetingValue The targeting value being set.\n * @param operatorType The operator type\n * @return created targeting criteria\n * @throws TwitterException\n * @see <a href=\n * \"https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/targeting_criteria\">https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/targeting_criteria</a>\n */\n BaseAdsResponse<TargetingCriteria> createTargetingCriteria(String accountId, String lineItemId, TargetingType targetingType,\n String targetingValue, OperatorType operatorType)\n throws TwitterException;\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param lineItemId The line item ID to create targeting criteria upon.\n * @param targetingCriteriaValues A list of TargetingCriteria object to set multiple targeting criteria.\n * @return created targeting criterias\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/put/accounts/%3Aaccount_id/targeting_criteria\">https://dev.twitter.com/ads/reference/put/accounts/%3Aaccount_id/targeting_criteria</a>\n */\n //deprecated in v3\n List<TargetingCriteria> createTargetingCriterias(String accountId, String lineItemId, List<TargetingCriteria> targetingCriteriaValues)\n throws TwitterException;\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param targetingCriteriaId The targeting criteria ID to delete.\n * @return deleted targeting criteria with deleted field set to true\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/delete/accounts/%3Aaccount_id/targeting_criteria\">https://dev.twitter.com/ads/reference/delete/accounts/%3Aaccount_id/targeting_criteria</a>\n */\n BaseAdsResponse<TargetingCriteria> deleteTargetingCriteria(String accountId, String targetingCriteriaId) throws TwitterException;\n\n /**\n * @param locationType (optional) Scope the results to a specific type of location.\n * @param q (optional) Search for a specific location.\n * @param countryCode (optional) Specify a country code to retrieve results from.\n * @param count (optional) Limit the number of results to the given count.\n * @return all possible targeting locations to choose from\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/locations\">https://dev.twitter.com/ads/reference/get/targeting_criteria/locations</a>\n */\n BaseAdsListResponseIterable<TargetingLocation> getAllTargetingLocations(Optional<LocationType> locationType, String q,\n String countryCode, Optional<Integer> count) throws TwitterException;\n\n /**\n * @param locationType (optional) Scope the results to a specific type of location.\n * @param query (optional) Search for a specific location.\n * @return all possible targeting locations to choose from for the given location type\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/locations\">https://dev.twitter.com/ads/reference/get/targeting_criteria/locations</a>\n */\n BaseAdsListResponseIterable<TargetingLocation> getTargetingLocations(String query, LocationType locationType) throws TwitterException;\n\n /**\n * @param q (optional) Search results for matching a specific locale.\n * @return all possible twitter targeting languages to choose from\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/languages\">https://dev.twitter.com/ads/reference/get/targeting_criteria/languages</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTargetingLocales(String q) throws TwitterException;\n\n /**\n * @param q (optional) Search for a specific event.\n * @return all possible events to choose from\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/events\">https://dev.twitter.com/ads/reference/get/targeting_criteria/events</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTargetingEvents(String q) throws TwitterException;\n\n /**\n * @return all the events that can be targeted\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/events\">https://dev.twitter.com/ads/reference/get/targeting_criteria/events</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllEvents() throws TwitterException;\n\n /**\n * @param q (optional) Search for a specific interest.\n * @return all possible targeting interests to choose from\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/interests\">https://dev.twitter.com/ads/reference/get/targeting_criteria/interests</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTargetingInterests(String q) throws TwitterException;\n\n /**\n * @param q (optional) Search results for matching a specific platform.\n * @return all possible targeting platforms to choose from\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/platforms\">https://dev.twitter.com/ads/reference/get/targeting_criteria/platforms</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTargetingPlatforms(String q) throws TwitterException;\n\n /**\n * @param q (optional) Search results for matching a specific network operator.\n * @return all possible network operators to choose from\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/network_operators\">https://dev.twitter.com/ads/reference/get/targeting_criteria/network_operators</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTargetingNetworkOperators(String q) throws TwitterException;\n\n /**\n * @return all possible targeting conversations to choose from\n * @throws TwitterException\n */\n BaseAdsListResponseIterable<Conversations> getAllTargetingConversations() throws TwitterException;\n\n /**\n * @param tvMarketLocale (optional) Scope the results to a specific tv market locale.\n * @param count (optional) Limit the number of results to the given count.\n * @param cursor (optional) Specify a cursor to retrieve data from a specific page (function automatically handles paging upon iteration when you do not specify cursor value).\n * @return all possible twitter targeting tv channels to choose from\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_channels\">https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_channels</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTargetingTVChannels(String tvMarketLocale, Optional<Integer> count, Optional<String> cursor)\n throws TwitterException;\n\n /**\n * @param tvMarket (optional) Scope the results to a specific tv market.\n * @param q (optional) Search results for matching a specific tv show.\n * @param count (optional) Limit the number of results to the given count.\n * @param cursor (optional) Specify a cursor to retrieve data from a specific page (function automatically handles paging upon iteration when you do not specify cursor value).\n * @return all the tv shows (matching q if provided) that can be targeted\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_shows\">https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_shows</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTVShows(String tvMarket, String q, Optional<Integer> count, Optional<String> cursor) throws TwitterException;\n\n /**\n * @return All the TV Markets that can be targeted\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_markets\">https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_markets</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTVMarkets() throws TwitterException;\n\n /**\n * @return All the TV Genres that can be targeted\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_genres\">https://dev.twitter.com/ads/reference/get/targeting_criteria/tv_genres</a>\n */\n BaseAdsListResponseIterable<TargetingCriteria> getAllTargetingTVGenres() throws TwitterException;\n\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param suggestionType Specify the enum of suggestions being received.\n * @param targetingValues Targeting values being used to seed the suggestion.\n * @param count (optional) Limit the number of results to the given count.\n * @param ignoredValues (optional) A list of values to ignore from suggested output.\n * @return list of targeting suggestions for keywords and user IDs\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_suggestions\">https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/targeting_suggestions</a>\n */\n List<TargetingSuggestion> getTargetingSuggestion(String accountId, SuggestionType suggestionType, List<String> targetingValues,\n Optional<Integer> count, List<String> ignoredValues) throws TwitterException;\n\n /**\n * @param count (optional) Limit the number of results to the given count.\n * @param cursor (optional) Specify a cursor to retrieve data from a specific page (function automatically handles paging upon iteration when you do not specify cursor value).\n * @return all the behaviors that can be targeted\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/behaviors\">https://dev.twitter.com/ads/reference/get/targeting_criteria/behaviors</a>\n */\n BaseAdsListResponseIterable<TwitterBehavior> getBehaviors(Optional<Integer> count, Optional<String> cursor,\n Optional<String> countryCode) throws TwitterException;\n\n /**\n * @param parentBehaviorTaxonomyIds (optional) List of behavior taxonomy identifiers of parent nodes in the tree structures. Specifying parents will only return children nodes of the taxonomy.\n * @param count (optional) Limit the number of results to the given count.\n * @param cursor (optional) Specify a cursor to retrieve data from a specific page (function automatically handles paging upon iteration when you do not specify cursor value).\n * @return the full or partial behavior taxonomy tree\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/behavior_taxonomies\">https://dev.twitter.com/ads/reference/get/targeting_criteria/behavior_taxonomies</a>\n */\n BaseAdsListResponseIterable<TwitterBehaviorTaxonomy> getBehaviorTaxonomy(List<String> parentBehaviorTaxonomyIds,\n Optional<Integer> count,\n Optional<String> cursor) throws TwitterException;\n\n /**\n * @param q (optional) Search results for matching a specific app store category.\n * @param appStoreSearchType (optional) Limit the number of results to the given count.\n * @return Some or all of the targetable app store categories\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/targeting_criteria/app_store_categories\">https://dev.twitter.com/ads/reference/get/targeting_criteria/app_store_categories</a>\n */\n List<TwitterAppStore> searchAppStoreCategories(String q, Optional<AppStoreSearchType> appStoreSearchType) throws TwitterException;\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @return all app lists associated with the specified account ID\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/app_lists\">https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/app_lists</a>\n */\n BaseAdsListResponseIterable<TwitterApplicationList> getAllAppLists(String accountId) throws TwitterException;\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param listId A specific app list ID.\n * @return an application list given a specific list ID\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/app_lists\">https://dev.twitter.com/ads/reference/get/accounts/%3Aaccount_id/app_lists</a>\n */\n BaseAdsResponse<TwitterApplicationList> getAllAppsListsById(String accountId, String listId) throws TwitterException;\n\n /**\n * @param accountId The identifier for the leveraged account.\n * @param twitterApplicationList A list of applications to add to app list.\n * @return response of creating a new application list\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/app_lists\">https://dev.twitter.com/ads/reference/post/accounts/%3Aaccount_id/app_lists</a>\n */\n BaseAdsResponse<TwitterApplicationList> createNewApplicationList(String accountId, TwitterApplicationList twitterApplicationList)\n throws TwitterException;\n\n /**\n * @param q (optional) Search results for matching a specific IAB category.\n * @return all the Twitter IAB categories that can be targeted\n * @throws TwitterException\n * @see <a href=\"https://dev.twitter.com/ads/reference/get/iab_categories\">https://dev.twitter.com/ads/reference/get/iab_categories</a>\n */\n BaseAdsListResponseIterable<IabCategory> getAllIabCategories(String q) throws TwitterException;\n\n /**\n * @return audience_estimate of the ad\n */\n BaseAdsResponse<AudienceEstimate> getAudienceEstimate(String accountId, AudienceEstimateRequest audienceSummaryRequest)\n throws TwitterException;\n\n BaseAdsListResponseIterable<IabCategory> fetchIabCategories(String q) throws TwitterException;\n\n TargetingParamResponse createTargetingBatchRequest(String accountId, List<TargetingParamRequest> targetingParamRequests)\n throws TwitterException;\n\n}", "public void OpenScope(){\n Scope newScope = new Scope();\n currentScope.AddChildScope(newScope);\n currentScope = newScope;\n }", "public void setScope(Scope scp) {\n this.scope = scp;\n }", "String getTarget();", "String getTarget();", "protected void setTarget(Command target) {\n\t\tproxy.setTarget(target);\n\t}", "public void setTargetSelected(boolean targetSelected) {\n this.targetSelected = targetSelected;\n }", "public void setTarget(String val)\r\n\t{\r\n\t\t_target = val;\r\n\t}", "public void registerScope(OntologyScope scope, boolean activate);", "public void processTargetTracker (Entity squad, Entity target, boolean contactEnd) {\n\t}", "public void setTargetType(String targetType) {\n this.targetType = targetType;\n }", "@Override\n\tpublic void onAction(L2PcInstance player, boolean interact)\n\t{\n\t\tif(!canTarget(player))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tplayer.setLastFolkNPC(this);\n\n\t\t// Check if the L2PcInstance already target the L2GuardInstance\n\t\tif(getObjectId() != player.getTargetId())\n\t\t{\n\t\t\t// Send a Server->Client packet MyTargetSelected to the L2PcInstance player\n\t\t\t// The color to display in the select window is White\n\t\t\tMyTargetSelected my = new MyTargetSelected(getObjectId(), 0);\n\t\t\tplayer.sendPacket(my);\n\n\t\t\t// Set the target of the L2PcInstance player\n\t\t\tplayer.setTarget(this);\n\n\t\t\t// Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client\n\t\t\tplayer.sendPacket(new ValidateLocation(this));\n\t\t}\n\t\telse if(interact)\n\t\t{\n\t\t\t// Check if the L2PcInstance is in the _aggroList of the L2GuardInstance\n\t\t\tif(containsTarget(player))\n\t\t\t{\n\t\t\t\t// Set the L2PcInstance Intention to AI_INTENTION_ATTACK\n\t\t\t\tplayer.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Calculate the distance between the L2PcInstance and the L2NpcInstance\n\t\t\t\tif(canInteract(player))\n\t\t\t\t{\n\t\t\t\t\t// Send a Server->Client packet SocialAction to the all L2PcInstance on the _knownPlayer of the L2NpcInstance\n\t\t\t\t\t// to display a social action of the L2GuardInstance on their client\n\t\t\t\t\t// Если НПЦ не разговаривает, то слать социалку приветствия собственно и не имеет смысла\n\t\t\t\t\tif(!Config.NON_TALKING_NPCS.contains(getNpcId()))\n\t\t\t\t\t{\n\t\t\t\t\t\tbroadcastPacket(new SocialAction(getObjectId(), Rnd.get(8)));\n\t\t\t\t\t}\n\n\t\t\t\t\tList<Quest> qlsa = getTemplate().getEventQuests(Quest.QuestEventType.QUEST_START);\n\t\t\t\t\tList<Quest> qlst = getTemplate().getEventQuests(Quest.QuestEventType.ON_FIRST_TALK);\n\n\t\t\t\t\tif(qlsa != null && !qlsa.isEmpty())\n\t\t\t\t\t{\n\t\t\t\t\t\tplayer.setLastQuestNpcObject(getObjectId());\n\t\t\t\t\t}\n\n\t\t\t\t\tif(qlst != null && qlst.size() == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tqlst.get(0).notifyFirstTalk(this, player);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tshowChatWindow(player, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Set the L2PcInstance Intention to AI_INTENTION_INTERACT\n\t\t\t\t\tplayer.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Send a Server->Client ActionFail to the L2PcInstance in order to avoid that the client wait another packet\n\t\tplayer.sendActionFailed();\n\t}", "public String getTarget() {\n return target;\n }", "public String getTarget() {\n return target;\n }", "public void referToGP(){\r\n\t\t//here is some code that we do not have access to\r\n\t}", "public void setNameRange( AjaxRequestTarget target, NameRange range ) {\n nameRange = range;\n nameRangePanel.setSelected( target, range );\n addWhosWhoTable();\n target.addComponent( whosWhoTable );\n }", "Target target();", "public boolean definesTargetAttribute(String name);", "@Override\n public void readAhead(DescriptorScope scope) {\n }", "java.lang.String getTarget();", "java.lang.String getTarget();", "public abstract String getRequestTarget(final int requestNumber);", "@Test\n public void testWithExpectedClientScope() {\n AuthzClient authzClient = getAuthzClient();\n PermissionRequest request = new PermissionRequest(\"Resource A\");\n String ticket = authzClient.protection().permission().create(request).getTicket();\n AuthorizationResponse response = authzClient.authorization(\"marta\", \"password\", \"foo\")\n .authorize(new AuthorizationRequest(ticket));\n assertNotNull(response.getToken());\n\n // Access Resource A with client scope bar.\n request = new PermissionRequest(\"Resource A\");\n ticket = authzClient.protection().permission().create(request).getTicket();\n response = authzClient.authorization(\"marta\", \"password\", \"bar\").authorize(new AuthorizationRequest(ticket));\n assertNotNull(response.getToken());\n\n // Access Resource B with client scope bar.\n request = new PermissionRequest(\"Resource B\");\n ticket = authzClient.protection().permission().create(request).getTicket();\n response = authzClient.authorization(\"marta\", \"password\", \"bar\").authorize(new AuthorizationRequest(ticket));\n assertNotNull(response.getToken());\n }", "public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}", "public void setTarget(String newValue);", "@Override\n public String getScopeContent()\n {\n\treturn scopeName;\n }", "ScopeEvaluationCondition getScope();", "@Override\n public String getTarget()\n {\n return null;\n }", "String getTargetClient();", "@Override\n public void useSkill(Creature activeChar, Creature targets) {\n }", "public String getTarget() {\n return this.target;\n }", "@Override\n\tpublic Response<Boolean> getRecommendScopes(RequestContext requestContext) {\n\t\treturn null;\n\t}", "boolean isScope();", "ITargetMode getCurrentTargetMode();", "public OntologyScope getScope(IRI scopeID);", "@VTID(7)\n void treeScope(\n mmarquee.automation.uiautomation.TreeScope scope);", "public void setTargetType(String targetType) {\n this.targetType = targetType == null ? null : targetType.trim();\n }", "public void showAdvice(View target){\r\n\t\thintDialog.show();\r\n\t\tadviceIcon.setVisibility(View.INVISIBLE);\r\n//\t\tFGCourse.this.startActivityForResult(new Intent(FGCourse.this,FGCAdvice.class),CREATE_ADVICE_ACTIVITY);\r\n\t}", "@objid (\"19651663-f981-4f11-802a-d5d7cbd6f88a\")\n Instance getTarget();", "public CheckPrincipalAccessRequest setScope(String scope) {\n this.scope = scope;\n return this;\n }", "public UserExperienceAnalyticsDeviceScopeTriggerDeviceScopeActionParameterSet() {}", "@ClientConfig(JsonMode.Object)\n\r\n\tpublic Object getScope () {\r\n\t\treturn (Object) getStateHelper().eval(PropertyKeys.scope);\r\n\t}", "com.google.analytics.admin.v1alpha.AudienceFilterScope getScope();", "public SelectionScopeBase(String scopeName)\n {\n\tthis.scopeName = scopeName;\n }", "public java.lang.String getTarget() {\n return target;\n }", "Scope createScope();", "public void setTarget(TestSetDiscrepancyReportResourceTarget target) {\n this.target = target;\n }", "public String targetAvailabilitySetId() {\n return this.targetAvailabilitySetId;\n }", "@ApiModelProperty(value = \"The scopes of the token\")\n public String getScope() {\n return scope;\n }", "private static Scope buildScope() {\n return Scope.build(Scope.R_BASICPROFILE, Scope.W_SHARE);\n }", "@Override\n public boolean isScoped() {\n \treturn getScope() != null && !getScope().isEmpty();\n }", "boolean isSwitchingScope();", "public abstract boolean isTarget();", "public void setTargetNamespace(String targetNamespace)\r\n {\r\n this.targetNamespace = targetNamespace;\r\n }", "public int getScope()\n {\n\t\treturn url.getScope();\n }", "public Target getTarget() {\n return target;\n }", "public void setTarget(String target) {\n this.target = target == null ? null : target.trim();\n }", "boolean isSetTarget();", "public void setFeedback()\n\t{\n\t\tif(feedback == null || feedback.equals(\"\")) {\n\t\t System.out.println(\"\");\n\t\t return;\n\t\t}\n\t\tSystem.out.println(\"here in feedback!\");\n\t\tfinal StringTokenizer st = new StringTokenizer(feedback,\",\");\n\t\t//switch dependants mode based on om string\n\t\tif(om.equals(\"graphic_associate_interaction\"))\n\t\t{\n\t\t\tif(associations == null)\n\t\t\t\tassociations = new Vector<Association>();\n\n\t\t\twhile(st.hasMoreTokens())\n\t\t\t{\n\t\t\t\t//split the token again to get the two key codes\n\t\t\t\tfinal String[] parts = st.nextToken().split(\" \");\n\t\t\t\tBoundObject start = null;\n\t\t\t\tBoundObject end = null;\n\t\t\t\tfor(int i=0; i< hotspots.size(); i++)\n\t\t\t\t{\n\t\t\t\t\tif(hotspots.elementAt(i).keyCode.equals(parts[0]))\n\t\t\t\t\t\tstart = hotspots.elementAt(i);\n\t\t\t\t\tif(hotspots.elementAt(i).keyCode.equals(parts[1]))\n\t\t\t\t\t\tend = hotspots.elementAt(i);\n\t\t\t\t}\n\n\t\t\t\tif(start != null && end != null)\n\t\t\t\t{\n\t\t\t\t\tstart.assCount++;\n\t\t\t\t\tend.assCount++;\n\t\t\t\t\tassociations.add(new Association(start,end,start.getPoint(end.getCentrePoint()),end.getPoint(start.getCentrePoint())));\n\t\t\t\t}\n\t\t\t\tuser_responses++;\n\t\t\t}\n\t\t}else if(om.equals(\"hotspot_interaction\"))\n\t\t{\n\t\t\twhile(st.hasMoreTokens())\n\t\t\t{\n\t\t\t\tfinal String code = st.nextToken();\n\t\t\t\tfor(int i=0; i < hotspots.size(); i++)\n\t\t\t\t{\n\t\t\t\t\tif(hotspots.elementAt(i).keyCode.equals(code))\n\t\t\t\t\t\thotspots.elementAt(i).highlighted = true;\n\t\t\t\t}\n\t\t\t\tuser_responses++;\n\t\t\t}\n\t\t}else if(om.equals(\"graphic_order_interaction\"))\n\t\t{\n\t\t\tint index = 0;\n\t\t\twhile(st.hasMoreTokens())\n\t\t\t{\n\t\t\t\tfinal String code = st.nextToken();\n\t\t\t\tBoundObject hotSpot = null;\n\t\t\t\tMovableObject movObj = null;\n\t\t\t\tfor(int i=0; i<hotspots.size(); i++)\n\t\t\t\t{\n\t\t\t\t\tif(hotspots.elementAt(i).keyCode.equals(code))\n\t\t\t\t\t\thotSpot = hotspots.elementAt(i);\n\t\t\t\t}\n\n\t\t\t\tmovObj = movableObjects.elementAt(index);\n\n\t\t\t\tif(movObj != null && hotSpot != null)\n\t\t\t\t{\n\t\t\t\t\tmovObj.bound.put(hotSpot.keyCode,new Boolean(true));\n\t\t\t\t\tmovObj.assCount++;\n\t\t\t\t\thotSpot.bound.put(movObj.keyCode,new Boolean(true));\n\t\t\t\t\thotSpot.assCount++;\n\t\t\t\t\tmovObj.setPos(hotSpot.getCentrePoint());\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tuser_responses++;\n\t\t\t}\n\t\t}else if(om.equals(\"gap_match_interaction\"))\n\t\t{\n\t\t\twhile(st.hasMoreTokens())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"handling a token!\");\n\t\t\t\tfinal String[] codepair = st.nextToken().split(\" \");\n\t\t\t\tBoundObject hotSpot = null;\n\t\t\t\tMovableObject movObj = null;\n\t\t\t\tfor(int i=0; i<hotspots.size(); i++)\n\t\t\t\t{\n\t\t\t\t\tif(hotspots.elementAt(i).keyCode.equals(codepair[1]))\n\t\t\t\t\t\thotSpot = hotspots.elementAt(i);\n\t\t\t\t}\n\n\t\t\t\tfor(int i=0; i < movableObjects.size(); i++)\n\t\t\t\t{\n\t\t\t\t\tif(movableObjects.elementAt(i).keyCode.equals(codepair[0]))\n\t\t\t\t\t\tmovObj = movableObjects.elementAt(i);\n\t\t\t\t}\n\n\t\t\t\tif(movObj != null && hotSpot != null)\n\t\t\t\t{\n\t\t\t\t\tmovObj.bound.put(hotSpot.keyCode,new Boolean(true));\n\t\t\t\t\tmovObj.assCount++;\n\t\t\t\t\thotSpot.bound.put(movObj.keyCode,new Boolean(true));\n\t\t\t\t\thotSpot.assCount++;\n\t\t\t\t\tmovObj.setPos(hotSpot.getCentrePoint());\n\n\t\t\t\t\tSystem.out.println(\"looking to clone...\");\n\t \t\t\t\tfinal Integer size = movObjCount.get(movObj.keyCode);\n\t \t\t\t\tmovObjCount.remove(movObj.keyCode);\n\t \t\t\t\tfinal int sz = size.intValue()+1;\n\t \t\t\t\tmovObjCount.put(movObj.keyCode, new Integer(sz));\n\t \t\t\t\tfinal Integer maxSize = movObjMaxCount.get(movObj.keyCode);\n\t \t\t\t\tSystem.out.println(\"key variables are [current size] : \"+sz+\" and [maxSize] : \"+maxSize.intValue());\n\t \t\t\t\tif(maxSize.intValue() == 0 || sz < maxSize.intValue())\n\t \t\t\t\t{\n\t \t\t\t\t\tfinal MovableObject copy = movObj.lightClone();\n\t \t\t\t\t\tcopy.resetPos();\n\t \t\t\t\t\tmovableObjects.add(copy);\n\t \t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tuser_responses++;\n\t\t\t}\n\t\t} else if (om.equals(\"figure_placement_interaction\")) {\n\t\t while (st.hasMoreTokens()) {\n\t\t final String[] codepair = st.nextToken().split(\":\");\n\t\t final String[] coords;\n\t\t if (codepair.length > 1) {\n\t\t coords = codepair[1].split(\"-\");\n\t\t if (coords.length > 1) {\n\t\t System.out.println(\"Code pair is: \"+coords[0]+\", \"+coords[1]);\n\t\t }\n\t\t } else {\n\t\t continue;\n\t\t }\n\t\t MovableObject movObj = null;\n\t\t for(int i=0; i < movableObjects.size(); i++)\n {\n\t\t System.out.println(\"keycode is: \" + movableObjects.elementAt(i).getKeyCode() + \" saved one is: \" + codepair[0]);\n if(movableObjects.elementAt(i).getKeyCode().equals(codepair[0])) {\n movObj = movableObjects.elementAt(i);\n break;\n }\n }\n\t\t if (movObj != null && coords.length > 1) {\n\t\t movObj.setPos(new Point(Integer.parseInt(coords[0]), Integer.parseInt(coords[1])));\n\t\t }\n\t\t }\n\t\t}\n\t}" ]
[ "0.60618865", "0.58181965", "0.58181965", "0.58181965", "0.58161116", "0.58161116", "0.58161116", "0.57032293", "0.5563643", "0.55276626", "0.5376275", "0.53487307", "0.5239869", "0.523871", "0.5237317", "0.51841915", "0.51841915", "0.51812077", "0.5161368", "0.5145436", "0.51442057", "0.5113595", "0.5099679", "0.5008908", "0.49995", "0.49981517", "0.49981517", "0.49981517", "0.4979212", "0.49635082", "0.49630296", "0.49325156", "0.49294117", "0.49294117", "0.49294117", "0.49159747", "0.4909185", "0.4901047", "0.4884439", "0.48731974", "0.48632738", "0.4834144", "0.4827041", "0.4820528", "0.4770787", "0.4770787", "0.4761122", "0.47565398", "0.47554502", "0.47532567", "0.4751808", "0.47499618", "0.47293532", "0.47284028", "0.47284028", "0.47260782", "0.47159696", "0.47053936", "0.47051075", "0.46953526", "0.46877775", "0.46877775", "0.4686989", "0.46858513", "0.46827057", "0.4680749", "0.46800184", "0.46779925", "0.46715227", "0.46644434", "0.4656666", "0.4654946", "0.46390846", "0.46374083", "0.463333", "0.46282265", "0.4624804", "0.46108723", "0.4610025", "0.46079057", "0.4603063", "0.45975596", "0.45919067", "0.45907024", "0.459028", "0.4589591", "0.45863292", "0.45841047", "0.458063", "0.45759544", "0.45508927", "0.45422846", "0.45417684", "0.4536551", "0.45362958", "0.45341328", "0.45309302", "0.4527442", "0.4525165", "0.45180753" ]
0.6550418
0
During the final moments of the game, called to popUp the ranking of the match
public void createRanking() throws RemoteException{ mainPage.setRemoteController(senderRemoteController); mainPage.setMatch(match); Platform.runLater( () -> { try { mainPage.createRanking(); } catch (Exception e) { e.printStackTrace(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void showRanking(String winner, String rank);", "private void showResult() {\n int i = 0;\n matchList.forEach(match -> match.proceed());\n for (Match match : matchList) {\n setTextInlabels(match.showTeamWithResult(), i);\n i++;\n }\n }", "public void rankMatches();", "private void announceRoundResult()\n {\n // Last actions of each player, to compare\n GameAction fpAction = firstPlayer.getLastAction();\n GameAction spAction = secondPlayer.getLastAction();\n\n // Display first IA game\n if (!hasHuman)\n {\n if (fpAction instanceof RockAction)\n {\n animateSelectedButton(firstPlayerRock, true);\n }\n else if (fpAction instanceof PaperAction)\n {\n animateSelectedButton(firstPlayerPaper, true);\n }\n else if (fpAction instanceof ScissorsAction)\n {\n animateSelectedButton(firstPlayerScissors, true);\n }\n }\n // Display second IA game\n if (spAction instanceof RockAction)\n {\n animateSelectedButton(secondPlayerRock, false);\n }\n else if (spAction instanceof PaperAction)\n {\n animateSelectedButton(secondPlayerPaper, false);\n }\n else if (spAction instanceof ScissorsAction)\n {\n animateSelectedButton(secondPlayerScissors, false);\n }\n\n\n // First player has played something ==> look at result\n if (firstPlayer.hasAlreadyPlayed())\n {\n switch (fpAction.versus(spAction))\n {\n case WIN:\n updateResultIcons(true, false);\n break;\n case DRAW:\n updateResultIcons(false, true);\n break;\n case LOSE:\n updateResultIcons(false, false);\n break;\n }\n }\n // First player didn't play ==> draw or loose\n else\n {\n // Draw\n if (!secondPlayer.hasAlreadyPlayed())\n {\n updateResultIcons(false, true);\n }\n // Lose\n else\n {\n updateResultIcons(false, false);\n }\n }\n }", "private void updateResultOnScreen() {\n teamAScoreTv.setText(Integer.toString(teamAScoreInt));\n teamBScoreTv.setText(Integer.toString(teamBScoreInt));\n\n if (teamAFoulScoreInt > 1)\n teamAFoulScoreTv.setText(teamAFoulScoreInt + \" fouls\");\n else\n teamAFoulScoreTv.setText(teamAFoulScoreInt + \" foul\");\n\n if (teamBFoulScoreInt > 1)\n teamBFoulScoreTv.setText(teamBFoulScoreInt + \" fouls\");\n else\n teamBFoulScoreTv.setText(teamBFoulScoreInt + \" foul\");\n }", "void finishMatch() {\n\t\tint playerResult = ParticipantResult.MATCH_RESULT_NONE;\n\t\tint opponentResult = ParticipantResult.MATCH_RESULT_NONE;\n\n\t\tif (!GameActivity.gameMachine.player.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, false);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t} else if (!GameActivity.gameMachine.opponent.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, true);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t}\n\n\t\tArrayList<ParticipantResult> results = new ArrayList<ParticipantResult>();\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getMyId(\n\t\t\t\tgameHelper.getApiClient(), match), playerResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getOpponentId(\n\t\t\t\tgameHelper.getApiClient(), match), opponentResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tif (match.getStatus() == TurnBasedMatch.MATCH_STATUS_ACTIVE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId(),\n\t\t\t\t\t\twriteGameState(match), results);\n\t\t\t\tturnUsed = true;\n\t\t\t\tremoveNotification();\n\t\t\t}\n\t\t} else if (match.getStatus() == TurnBasedMatch.MATCH_STATUS_COMPLETE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId());\n\t\t\t}\n\t\t}\n\t}", "private void doMatch() {\n // Remember how many games in this session\n mGameCounter++;\n\n PebbleDictionary resultDict = new PebbleDictionary();\n\n switch (mChoice) {\n case Keys.CHOICE_ROCK:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n case Keys.CHOICE_PAPER:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN); // Inform Pebble of opposite result\n break;\n case Keys.CHOICE_SCISSORS:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n }\n break;\n case Keys.CHOICE_PAPER:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n case Keys.CHOICE_PAPER:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n case Keys.CHOICE_SCISSORS:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN);\n break;\n }\n break;\n case Keys.CHOICE_SCISSORS:\n switch(mP2Choice) {\n case Keys.CHOICE_ROCK:\n mInstructionView.setText(\"You lose!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_WIN);\n break;\n case Keys.CHOICE_PAPER:\n mWinCounter++;\n mInstructionView.setText(\"You win! (\" + mWinCounter + \" of \" + mGameCounter + \")\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_LOSE);\n break;\n case Keys.CHOICE_SCISSORS:\n mInstructionView.setText(\"It's a tie!\");\n resultDict.addInt32(Keys.KEY_RESULT, Keys.RESULT_TIE);\n break;\n }\n break;\n }\n\n // Inform Pebble of result\n PebbleKit.sendDataToPebble(getApplicationContext(), APP_UUID, resultDict);\n\n // Finally reset both\n mChoice = Keys.CHOICE_WAITING;\n mP2Choice = Keys.CHOICE_WAITING;\n\n // Leave announcement for 5 seconds\n mHandler.postDelayed(new Runnable() {\n\n @Override\n public void run() {\n updateUI();\n }\n\n }, 5000);\n }", "void playMatch() {\n while (!gameInformation.checkIfSomeoneWonGame() && gameInformation.roundsPlayed() < 3) {\n gameInformation.setMovesToZeroAfterSmallMatch();\n playSmallMatch();\n }\n String winner = gameInformation.getWinner();\n if(winner.equals(\"DRAW!\")){\n System.out.println(messageProvider.provideMessage(\"draw\"));\n }else {\n System.out.println(messageProvider.provideMessage(\"winner\")+\" \"+winner+\"!\");\n }\n }", "public void tellPlayerResult(int winner) {\n\t}", "public void gameOver() {\n\t\tgameResult = new GameResult(writer);\n\n\t\tString winnersName = \"\";\n\t\tString resultList = \"\";\n\n\t\tGamePlayer[] tempList = new GamePlayer[playerList.size()];\n\t\tfor (int i = 0; i < tempList.length; i++) {\n\t\t\ttempList[i] = playerList.get(i);\n\t\t}\n\n\t\tArrays.sort(tempList); // Sort the players according to the scores\n\n\t\tint max = tempList[tempList.length - 1].getPlayerScore();\n\t\tint position = 0;\n\n\t\tfor (int i = tempList.length - 1; i >= 0; i--) {\n\t\t\tif (max == tempList[i].getPlayerScore()) {\n\t\t\t\twinnersName += tempList[i].getPlayerName() + \"\\t\";\n\t\t\t}\n\t\t\tresultList += \"No.\" + (++position) + \"\\t\" + tempList[i].getPlayerName() + \"\\t\"\n\t\t\t\t\t+ tempList[i].getPlayerScore() + \"\\n\";\n\t\t}\n\t\tgameResult.initialize(winnersName, resultList, roomNumber, gameRoom);\n\t\tframe.dispose();\n\t}", "private void displayOnResult(String title, String message, Integer gifImage, int whoWon){\n\n switch (whoWon){\n case 1:{\n TextView textView = (TextView) mScoreGrid.getChildAt(3);\n scorePlayer1++;\n textView.setText(String.valueOf(scorePlayer1));\n break;\n }\n case 2:{\n TextView textView = (TextView) mScoreGrid.getChildAt(4);\n scorePlayer2++;\n textView.setText(String.valueOf(scorePlayer2));\n break;\n }\n case 0:\n default:{\n TextView textView = (TextView) mScoreGrid.getChildAt(5);\n scoreDraw++;\n textView.setText(String.valueOf(scoreDraw));\n break;\n }\n }\n\n new MaterialDialog.Builder(this)\n .setTitle(title)\n .setMessage(message)\n .setCancelable(false)\n .setPositiveButton(\"Okay\", R.drawable.ic_baseline_download_done_24, new MaterialDialog.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int which) {\n dialogInterface.dismiss();\n resetEverything();\n }\n })\n .setNegativeButton(\"Exit\", R.drawable.ic_baseline_cancel_24, new MaterialDialog.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int which) {\n dialogInterface.dismiss();\n finish();\n }\n })\n .setAnimation(gifImage)\n .build().show();\n }", "private void showGameScore() {\n System.out.println(messageProvider.provideMessage(\"score\"));\n System.out.println(settings.getPlayers().get(0).getScore()\n + \" vs \" + settings.getPlayers().get(1).getScore());\n }", "public void finalResult() {\n ConnectionSockets.getInstance().sendMessage(Integer.toString(points)+\"\\n\");\n System.out.println(\"escreveu para o oponente\");\n opponentPoints = Integer.parseInt(ConnectionSockets.getInstance().receiveMessage());\n System.out.println(\"leu do oponente\");\n if(points != opponentPoints) {\n if (points > opponentPoints) {// Won\n MatchController.getInstance().getSets().add(1);\n MatchController.getInstance().increaseSet();\n } else { //Lost\n MatchController.getInstance().getSets().add(0);\n MatchController.getInstance().increaseSet();\n }\n }\n }", "private void showMatch() {\n System.out.println(\"Player 1\");\n game.getOne().getField().showField();\n System.out.println(\"Player 2\");\n game.getTwo().getField().showField();\n }", "public static void matchFinished(Match m) {\n for (int i = 0; i < roundOne.size(); i++) {\n if (roundOne.get(i).equals(m)) {\n if (i%2 == 0) {\n quarterFinals.get((int)Math.floor((double)(i/2))).setTeam1(m.getWinningTeam());\n }else {\n quarterFinals.get((int)Math.floor((double)(i/2))).setTeam2(m.getWinningTeam());\n }\n }\n }\n for (int i = 0; i < quarterFinals.size(); i++) {\n if (quarterFinals.get(i).equals(m)) {\n if (i%2 == 0) {\n semiFinals.get((int)Math.floor((double)(i/2))).setTeam1(m.getWinningTeam());\n }else {\n semiFinals.get((int)Math.floor((double)(i/2))).setTeam2(m.getWinningTeam());\n }\n }\n }\n for (int i = 0; i < semiFinals.size(); i++) {\n if (semiFinals.get(i).equals(m)) {\n if (i%2 == 0) {\n finalLabel1.setText(m.getWinningTeam().getName());\n if (!finalLabel2.getText().equals(\"TBD\")) {\n activateFinals();\n }\n }else {\n finalLabel2.setText(m.getWinningTeam().getName());\n if (!finalLabel1.getText().equals(\"TBD\")) {\n activateFinals();\n }\n }\n }\n }\n }", "public void showGameResult(GameMenu myGameMenu){\n //Anropa metoden för att kontrollera resultat av spelet\n gameResult(myGameMenu);\n if (Objects.equals(getMatchResult(), \"Oavgjort\")){\n System.out.println(\"Oavgjort! Du Gjorde Samma Val Som Datorn!\");\n System.out.println(\"Spelaren: \" + getPlayersResult() + \"\\nDatorn: \" + getComputersResult());\n }\n else if (Objects.equals(getMatchResult(),\"Vann\")){\n System.out.println(\"Du Vann! Bra Jobbat!\");\n System.out.println(\"Spelaren: \" + getPlayersResult() + \"\\nDatorn: \" + getComputersResult());\n }\n else if (Objects.equals(getMatchResult(),\"Förlorade\")){\n System.out.println(\"Tyvärr! Du Förlorade!\");\n System.out.println(\"Spelaren: \" + getPlayersResult() + \"\\nDatorn: \" + getComputersResult());\n }\n }", "public void refreshRank() {\n rank = getRank();\n lblUserTitle.setText(username + \" - \" + rank);\n }", "public void getScores(){\n String p1 = \"Player 1 has \" + Integer.toString(player1.getWins());\n String p2 = \"Player 2 has \" + Integer.toString(player2.getWins());\n String winner = \"tie\";\n if(player1.getWins()>player2.getWins()){\n winner = player1.getName() + \" wins!!!!\";\n }\n else if(player2.getWins()>player1.getWins()){\n winner = player2.getName() + \" Wins!!!\";\n }\n JOptionPane.showMessageDialog(null, (p1 + \"\\n\" + p2 + \"\\n\" + winner));\n }", "public void compare(){\n\t\tboolean gameOver = false;\n\t\tfor (int j = 0; j < player.size(); j++){\n\t\t\t/**\n\t\t\t * gameover screen\n\t\t\t */\n\t\t\tif (player.get(j) != input.get(j)){\n\t\t\t\tif (score <= 3){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" + \"You got the rank \"\n\t\t\t\t\t\t+ \"of a Joker with a score of \" + score + '.');}\n\t\t\t\telse if (score > 3 && score <= 10){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" +\n\t\t\t\t\"You got the ranking of a Knight with a score of \" + score + '.');}\n\t\t\t\telse if (score > 10 && score <=20){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" +\n\t\t\t\t\"You got the ranking of a King with a score of \" + score + '.');}\n\t\t\t\telse if (score >20){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" +\n\t\t\t\t\"You got the ranking of a Master with a score of \" + score + '.');}\n\t\t\t\tgameOver = true;\n\t\t\t\tif (score > highScore){\n\t\t\t\t\thighScore = score;\n\t\t\t\t\tscoreBoard.setHighScore(highScore);\n\t\t\t\t}\n\t\t\t\tplayer.clear();\n\t\t\t\tinput.clear();\n\t\t\t\tlist();\n\t\t\t\t++totalGames;\n\t\t\t\tfindGames();\n\t\t\t\tfindAvg();\n\t\t\t\tscore = 0;\n\t\t\t\tscoreBoard.setScore(score);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * starts new round after a successful round\n\t\t */\n\t\tif (player.size() == input.size() && !gameOver){\n\t\t\tplayer.clear();\n\t\t\tscore++;\n\t\t\tscoreBoard.setScore(score);\n\t\t\tstartGame();\n\t\t\t}\n\t}", "private void showFinalResults(){\r\n\r\n System.out.println(\"Player\\t\\t:\\t\\tPoints\");\r\n for(Player player : this.sortedPlayers){\r\n System.out.println(player.toString());\r\n }\r\n System.out.println();\r\n }", "private void showFinalScore() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setMessage(\"Time's up! Your final score is: \" + score + \"\\nHigh score: \" + highScore);\n builder.setOnDismissListener(unused -> finish());\n AlertDialog dialog = builder.create();\n dialog.show();\n }", "private void showMatchOverDialog(String winnerName) {\n this.computerPaquetView.showOnceHiddenCards();\n int dialogResult = JOptionPane.showConfirmDialog (null, String.format(\"%s won!\\nContinue?\", winnerName),\"\", JOptionPane.YES_NO_OPTION);\n if(dialogResult == JOptionPane.YES_OPTION){\n this.startGame();\n } else {\n this.dispose();\n }\n }", "private void showSpecificWobblyScore(MessageChannel channel) {\n int index = 0;\n try {\n index = Integer.parseInt(matchId) - 1;\n }\n catch(NumberFormatException e) {\n e.printStackTrace();\n }\n if(index < 0 || index > leaderboard.size() - 1) {\n channel.sendMessage(\"That's not a rank!\").queue();\n return;\n }\n WobblyScore score = leaderboard.get(index);\n Map map = score.getMap();\n\n EmbedBuilder entryEmbedBuilder = new EmbedBuilder()\n .setTitle(codManager.getGameName() + \" Wobbly Rank #\" + (index + 1))\n .setThumbnail(thumbnail)\n .setDescription(\"Use **\" + getTrigger() + \" wobblies** to view the full leaderboard.\")\n .addField(\"Name\", score.getPlayerName(), true)\n .addField(\"Date\", score.getDateString(), true)\n .addBlankField(true)\n .addField(\"Wobblies\", MatchPlayer.formatDistance(score.getWobblies(), \"wobblies\"), true)\n .addField(\"Metres\", MatchPlayer.formatDistance(score.getMetres(), \"metres\"), true)\n .addBlankField(true)\n .addField(\"Map\", score.getMap().getName(), true)\n .addField(\"Mode\", score.getMode().getName(), true)\n .addBlankField(true)\n .addField(\"Match ID\", score.getMatchId(), true)\n .setColor(EmbedHelper.PURPLE);\n\n if(map.hasImageUrl()) {\n entryEmbedBuilder.setImage(map.getImageUrl());\n }\n channel.sendMessage(entryEmbedBuilder.build()).queue();\n }", "public static void displayGrandWinner(Player player1, Player player2) {\r\n JOptionPane JO = new JOptionPane();\r\n String message;\r\n System.out.println(\"----------------------------\");\r\n\r\n if (player1.getPoints() > player2.getPoints())\r\n message = player1.getName() + \" is the grand winner!\";\r\n else if (player2.getPoints() > player1.getPoints())\r\n message = player2.getName() + \" is the grand winner!\";\r\n else\r\n message = \"Both players are tied!\";\r\n\r\n JOptionPane.showMessageDialog(null, \"Game over. Here are the results:\\n\" + player1.getName() + \": \" + player1.getPoints() + \" points.\\n\" + player2.getName() + \": \" + player2.getPoints() + \" points.\\n\" + message);\r\n\r\n }", "public void updateScoreboard() {\n\t\tif(obj != null) {\t\t\t\r\n\t\t\tobj.unregister();\r\n\t\t}\r\n\t\tobj = scoreboard.registerNewObjective(\"gui\", \"dummy\");\r\n\t\tobj.setDisplaySlot(DisplaySlot.SIDEBAR);\r\n\t\tobj.setDisplayName(\"§c§lVitality\");\r\n\t\tScore currentRank = obj.getScore(\"§e§lRank\");\r\n\t\tcurrentRank.setScore(40);\r\n\t\tScore currentRankVal = obj.getScore(\"§f\" + getRank().getName());\r\n\t\tcurrentRankVal.setScore(39);\r\n\t\tScore spacer1 = obj.getScore(\" \");\r\n\t\tspacer1.setScore(38);\r\n\t\tPrisonRank next = PrisonRank.getNextRank(rank);\r\n\t\tif(next != null) {\r\n\t\t\tScore nextRank = obj.getScore(\"§b§lProgress to \" + next.getName());\r\n\t\t\tnextRank.setScore(37);\r\n\t\t\tdouble percent = (Prison.getEco().getBalance(this) / next.getValue()) * 100;\r\n\t\t\tif(percent > 100) {\r\n\t\t\t\tpercent = 100;\r\n\t\t\t}\r\n\t\t\tScore nextRankVal = obj.getScore(\"§f\" + ((int)percent + \"%\"));\r\n\t\t\tnextRankVal.setScore(36);\r\n\t\t} else {\r\n\t\t\tScore nextRank = obj.getScore(\"§b§lNext Rank\");\r\n\t\t\tnextRank.setScore(37);\r\n\t\t\tScore nextRankVal = obj.getScore(\"§fNone\");\r\n\t\t\tnextRankVal.setScore(36);\r\n\t\t}\r\n\t\tScore spacer2 = obj.getScore(\" \");\r\n\t\tspacer2.setScore(35);\r\n\t\tScore money = obj.getScore(\"§a§lBalance\");\r\n\t\tmoney.setScore(34);\r\n\t\tScore moneyVal = obj.getScore(\"§f$\" + moneyFormat.format(Prison.getEco().getBalance(this)));\r\n\t\tmoneyVal.setScore(33);\r\n\t\tScore spacer3 = obj.getScore(\" \");\r\n\t\tspacer3.setScore(32);\r\n\t\t\r\n\t\tScore mult = obj.getScore(\"§6§lMultiplier\");\r\n\t\tmult.setScore(31);\r\n\t\t\r\n\t\tif(Multiplier.getMultiplier() > 1.0) {\r\n\t\t\tScore multVal = obj.getScore(\"§f\" + Multiplier.getMultiplier() + \"x\");\r\n\t\t\tmultVal.setScore(30);\r\n\t\t} else {\r\n\t\t\tScore multVal = obj.getScore(\"§fNone\");\r\n\t\t\tmultVal.setScore(30);\r\n\t\t}\r\n\t\tScore spacer4 = obj.getScore(\" \");\r\n\t\tspacer4.setScore(29);\r\n\t\tScore onlineStaff = obj.getScore(\"§c§lOnline Staff\");\r\n\t\tonlineStaff.setScore(28);\r\n\t\tScore onlineStaffVal = obj.getScore(\"§f\" + Prison.getStaffOnline().getCurrent());\r\n\t\tonlineStaffVal.setScore(27);\r\n\t}", "private void printMatch(){\n nameHomelbl.setText(match.getHomeTeam().getName());\n cittaHomelbl.setText(match.getHomeTeam().getCity());\n nameGuestlbl.setText(match.getGuestTeam().getName());\n cittaGuestlbl.setText(match.getGuestTeam().getCity());\n if(match.getPlayed()) {\n pointsHometxt.setText(String.valueOf(match.getPointsHome()));\n pointsGuesttxt.setText(String.valueOf(match.getPointsGuest()));\n } else {\n pointsHometxt.setText(\"-\");\n pointsGuesttxt.setText(\"-\");\n }\n \n try{\n logoGuestlbl.setIcon(new ImageIcon(ImageIO.read(new File(match.getGuestTeam().getLogo())).getScaledInstance(200, 200, Image.SCALE_SMOOTH)));\n logoHomelbl.setIcon(new ImageIcon(ImageIO.read(new File(match.getHomeTeam().getLogo())).getScaledInstance(200, 200, Image.SCALE_SMOOTH)));\n \n } catch (IOException ex){\n System.out.println(\"immagine non esistente\");\n JOptionPane.showMessageDialog(null, \"immagine non esistente\");\n }\n }", "@Override\n public void actionPerformed(ActionEvent ae)\n {\n total++;\n String display = \"\";\n if(jt.getText().trim().equals(qs.getAnswer().trim()))\n {\n score++;\n display += \"Score : \"+score+ \" / \" +total;\n //myDialog.setTitle(\"ok \"+score+\" / \"+total);\n }else{\n display += \"Score : \"+score+ \" / \" +total;\n display += \" prev answer : \"+qs.getAnswer().trim();\n }\n scoreBoard.setText(display);\n addDataTolist();\n\n }", "public void rank(){\n\n\t}", "public void gameOver() {\r\n\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Game is over. Calculating points\");\r\n\t\tstatus = \"over\";\r\n\t\ttry {\r\n\t\t\tupdateBoard();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tupdateEvents(false);\r\n\t\tEmbedBuilder embed = new EmbedBuilder();\r\n\t\tembed.setTitle(\"Game Results\");\r\n\t\tMap<Integer, Integer> scores = new HashMap<Integer, Integer>();\r\n\t\t\r\n\t\tfor (int i = 0; i < players.size(); i++) {\r\n\t\t\tscores.put(i,players.get(i).calculatePoints());\r\n\t\t\t// Utils.getName(players.get(i).getPlayerID(),guild)\r\n\t\t}\r\n\t\t\r\n\t\tList<Entry<Integer, Integer>> sortedList = sortScores(scores);\r\n\t\t\r\n\t\t// If tied, add highest artifact values\r\n\t\tif ((playerCount > 1) && (sortedList.get(0).getValue().equals(sortedList.get(1).getValue()))) {\r\n\t\t\tSystem.out.println(\"[DEBUG LOG/Game.java] Scores were tied\");\r\n\t\t\tint highestScore = sortedList.get(0).getValue();\r\n\t\t\tfor (Map.Entry<Integer, Integer> entry : sortedList) {\r\n\t\t\t\t// Only add artifacts to highest scores\r\n\t\t\t\tif (entry.getValue().equals(highestScore)) {\r\n\t\t\t\t\tscores.put(entry.getKey(),entry.getValue()+players.get(entry.getKey()).getHighestArtifactValue());\r\n\t\t\t\t\tplayers.get(entry.getKey()).setAddedArtifactValue(true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Sort with added artifact values\r\n\t\tsortedList = sortScores(scores);\r\n\t\t\r\n\t\t// Assigns 1st, 2nd, 3rd\r\n\t\tfor (int i = 0; i < sortedList.size(); i++) {\r\n\t\t\tMap.Entry<Integer, Integer> entry = sortedList.get(i);\r\n\t\t\t// If tie, include artifact\r\n\t\t\tString name = Utils.getName(players.get(entry.getKey()).getPlayerID(),guild);\r\n\t\t\tif (players.get(entry.getKey()).getAddedArtifactValue()) {\r\n\t\t\t\tint artifactValue = players.get(entry.getKey()).getHighestArtifactValue();\r\n\t\t\t\tembed.addField(Utils.endGamePlaces[i],\"**\"+name+\"** - ``\"+(entry.getValue()-artifactValue)+\" (\"+artifactValue+\")``\",true);\r\n\t\t\t} else {\r\n\t\t\t\tembed.addField(Utils.endGamePlaces[i],\"**\"+name+\"** - ``\"+entry.getValue()+\"``\",true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tembed.setFooter(\"Credit to Renegade Game Studios\", null);\r\n\t\tgameChannel.sendMessage(embed.build()).queueAfter(dragonAttackingDelay+3000,TimeUnit.MILLISECONDS);\r\n\t\t\r\n\t\tGlobalVars.remove(this);\r\n\t}", "public static void decidedWinner(){\n if(playerOneWon == true ){\n//\n// win.Fill(\"Player One Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else if (playerTwoWon == true){\n// win.Fill(\"Player Two Has Won !\");\n// new WinnerWindow().setVisible(true);\n }\n else\n {\n// win.Fill(\"Match Has been Tied !\");\n// new WinnerWindow().setVisible(true);\n }\n }", "int getRanking();", "public void displayCorrect(){\n textPane1.setText(\"\");\r\n generatePlayerName();\r\n textPane1.setText(\"GOOD JOB! That was the correct answer.\\n\"\r\n + atBatPlayer + \" got a hit!\\n\" +\r\n \"Press Next Question, or hit ENTER, to continue.\");\r\n SWINGButton.setText(\"Next Question\");\r\n formattedTextField1.setText(\"\");\r\n formattedTextField1.setText(\"Score: \" + score);\r\n }", "public void winner() {\n\t\tList<String> authors = new ArrayList<String>(scores_authors.keySet());\n\t\tCollections.sort(authors, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_authors.get(o1).compareTo(scores_authors.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des auteurs :\");\n\t\tfor(String a :authors) {\n\t\t\tSystem.out.println(a.substring(0,5)+\" : \"+scores_authors.get(a));\n\t\t}\n\t\t\n\t\tList<String> politicians = new ArrayList<String>(scores_politicians.keySet());\n\t\tCollections.sort(politicians, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_politicians.get(o1).compareTo(scores_politicians.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des politiciens :\");\n\t\tfor(String p :politicians) {\n\t\t\tSystem.out.println(p.substring(0,5)+\" : \"+scores_politicians.get(p));\n\t\t}\n\t}", "public void updatescore() {\n scorelabel.setText(\"\" + score + \" points\");\n if (100 - score <= 10) win();\n }", "private void showEndGameResults() {\n EndGameDialog endGameDialog = new EndGameDialog(this, stats, playerOne, playerTwo, (e) -> {\n dispose();\n\n this.start();\n });\n\n\n }", "public void displayPlayerWinnings()\n {\n for(int card = 0; card < playerCardsWon; card++)\n {\n System.out.println(playerWinnings[card].toString());\n }\n }", "public void updateScoreboard() {\r\n \tif(parentActivity instanceof GameActivity) {\r\n \t\t((TextView)(((GameActivity)parentActivity).getScoreboard())).setText(\"\"+score);\r\n \t}\r\n }", "private void scoreDialog() {\n JPanel jp = new JPanel();\n \n Box verticalBox = Box.createVerticalBox();\n \n JLabel scoreTitle = new JLabel(\"<html><font size=13><center>Score: \" + challengeModel.getChallenge().getScore().getScorePoints() + \"</center></font></html>\");\n scoreTitle.setAlignmentX(CENTER_ALIGNMENT);\n verticalBox.add(scoreTitle);\n \n Box horizontalBox = Box.createHorizontalBox();\n String scoreResult = \"\" + challengeModel.getChallenge().getScore().getGold() + challengeModel.getChallenge().getScore().getSilver() + challengeModel.getChallenge().getScore().getBronze();\n switch(Integer.parseInt(scoreResult)) {\n case 111: // Gold, Silver, Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalGold()));\n case 11: // Silver, Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalSilver()));\n case 1: // Bronze\n horizontalBox.add(new JLabel(Resources.getImageMedalBronze()));\n break;\n default:\n break;\n }\n \n verticalBox.add(horizontalBox);\n \n jp.add(verticalBox);\n \n int value = JOptionPane.showOptionDialog(null, jp, \"Fim do desafio\", JOptionPane.NO_OPTION, JOptionPane.PLAIN_MESSAGE, null, new String[] {\"Novo Desafio\"}, 1);\n \n hideAnswerResult(false);\n \n if (value == 0)\n challengeModel.newGame();\n }", "private static void SecondUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "public void displayForpoint_one(View view){\n score = score + 1;\n displayForTeamA(score);\n }", "public void updateMatch(Match match){\n setMatch(match);\n Platform.runLater( () -> {\n firstPage.setMatch(match);\n firstPage.refreshPlayersInLobby();\n });\n if(mainPage != null) {\n Platform.runLater( () -> {\n mainPage.setMatch(match);\n senderRemoteController.setMatch(match);\n this.match = match;\n mainPage.refreshPlayersPosition();\n mainPage.refreshPoints();\n if(match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY)){\n mainPage.setFrenzyMode(true);\n mainPage.frenzyButtonBoosted();\n System.out.println(\"[FRENZY]: Started FINAL FRENZY\");\n System.out.println(\"[FRENZY]: Current Player: \"+match.getCurrentPlayer().getNickname()+ \" in status \"+match.getCurrentPlayer().getStatus().getTurnStatus());\n\n }\n if (match.getPlayer(senderRemoteController.getNickname()).getStatus().getSpecialAbility().equals(AbilityStatus.FRENZY_LOWER)){\n mainPage.setFrenzyMode(true);\n mainPage.frenzyButtonLower();\n }\n });\n }\n //questo metodo viene chiamato piu volte.\n }", "public void printOtherPlayersInfo(Match match, String nickname) {\n try {\n ArrayList<Player> otherPlayers = match.getOtherPlayers(nickname);\n for (Player player : otherPlayers) {\n System.out.println(player.getNickname());\n System.out.println(player.getNumOfToken());\n ShowScheme scheme = new ShowScheme(player.getScheme());\n System.out.println(\"\");\n chooseAction(match, nickname);\n }\n } catch (NullPointerException e) {\n } catch (NumberFormatException e) {\n System.out.println(\"Digita un carattere valido\");\n } catch (IndexOutOfBoundsException e) {\n }\n\n }", "public void showResult(NimPlayer player1, NimPlayer player2) {\n String g1 = \"game\";\n String g2 = \"game\";\n\n // check the sigular\n if (player1.getWinTimes() >= 2) {\n g1 = \"games\";\n }\n if (player2.getWinTimes() >= 2) {\n g2 = \"games\";\n }\n System.out.println(player1.getName() + \" won \" +\n player1.getWinTimes() + \" \" + g1 + \" out of \" +\n player1.getTotalTimes() + \" played\");\n System.out.println(player2.getName() + \" won \" +\n player2.getWinTimes() + \" \" + g2 + \" out of \" +\n player2.getTotalTimes() + \" played\");\n }", "public void updateScore(){\r\n if (this.isArtist || winners.contains(this)) {\r\n this.score += pointsGainedLastRound;\r\n }\r\n pointsGainedLastRound = 0;\r\n placeLastRound = 0;\r\n }", "public void updateIsWinning() {\n if(!isOpponentDone && !isUserDone) {\n TextView opponentPosition = (TextView) findViewById(R.id.position_indicator_receiver);\n TextView userPosition = (TextView) findViewById(R.id.position_indicator_sender);\n\n Run opponentRun = ((ChallengeReceiverFragment) receiverFragment).getRun();\n Run userRun = ((ChallengeSenderFragment) senderFragment).getRun();\n\n float opponentDistance = opponentRun.getTrack().getDistance();\n float userDistance = userRun.getTrack().getDistance();\n\n if (opponentDistance == userDistance) {\n opponentPosition.setText(R.string.dash);\n userPosition.setText(R.string.dash);\n } else if (opponentDistance > userDistance) {\n opponentPosition.setText(R.string.first_position);\n userPosition.setText(R.string.second_position);\n } else {\n opponentPosition.setText(R.string.second_position);\n userPosition.setText(R.string.first_position);\n }\n System.out.println(opponentDistance + \" \" + userDistance);\n }\n }", "public void updateTeamFromResults(Match m){\r\n \r\n //Update team1\r\n m.getTeam1().setGoalsFor(m.getTeam1().getGoalsFor() + m.getScore1());\r\n m.getTeam1().setGoalsAgainst(m.getTeam1().getGoalsAgainst() + m.getScore2());\r\n \r\n //Update team2\r\n m.getTeam2().setGoalsFor(m.getTeam2().getGoalsFor() + m.getScore2());\r\n m.getTeam2().setGoalsAgainst(m.getTeam2().getGoalsAgainst() + m.getScore1());\r\n \r\n //Add points\r\n if (m.getScore1() < m.getScore2()){\r\n m.getTeam2().setPoints(m.getTeam2().getPoints() + 3);\r\n m.getTeam1().setMatchLost(m.getTeam1().getMatchLost() + 1);\r\n m.getTeam2().setMatchWon(m.getTeam2().getMatchWon() + 1);\r\n }\r\n else if (m.getScore1() > m.getScore2()){\r\n m.getTeam1().setPoints(m.getTeam1().getPoints() + 3);\r\n m.getTeam2().setMatchLost(m.getTeam2().getMatchLost() + 1);\r\n m.getTeam1().setMatchWon(m.getTeam1().getMatchWon() + 1);\r\n }\r\n else {\r\n m.getTeam1().setPoints(m.getTeam1().getPoints() + 1);\r\n m.getTeam2().setPoints(m.getTeam2().getPoints() + 1);\r\n m.getTeam1().setMatchDrawn(m.getTeam1().getMatchDrawn() + 1);\r\n m.getTeam2().setMatchDrawn(m.getTeam2().getMatchDrawn() + 1);\r\n }\r\n \r\n //Update the rankings\r\n this.updateTeamRank();\r\n }", "public void win() {\n JOptionPane.showConfirmDialog(null, \"You won! You got out with \" + this.player.getGold() + \" gold!\", \"VICTORY!\", JOptionPane.OK_OPTION);\n this.saveScore();\n this.updateScores();\n this.showTitleScreen();\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 }", "private void showResults() {\n\n AlertDialog.Builder builder1 = new AlertDialog.Builder(this);\n\n Collections.shuffle(selectedPlayers); // shuffle the players the user has selected\n\n StringBuilder sb = new StringBuilder(); // create a string builder to add numbers in front of the players' names\n for (int i = 0; i < selectedPlayers.size(); i++) {\n sb.append(String.valueOf(i + 1) + \". \" + selectedPlayers.get(i) + \"\\n\");\n }\n builder1.setTitle(\"Player order is\");\n String s = sb.toString();\n s = s.trim();\n builder1.setMessage(s);\n builder1.setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n }\n });\n gong.stop();\n gong.start();\n builder1.show();\n }", "@Override\n public void showWinnerDialog() {\n String message = getGameOverMessage();\n JOptionPane.showMessageDialog( this, message, GameContext.getLabel(\"GAME_OVER\"),\n JOptionPane.INFORMATION_MESSAGE );\n }", "public void completedGame()\n\t{\n\t\tJOptionPane.showMessageDialog(this,\"Congratulations, you beat the game!\" + ship.getTotalScore(), \"Beat the Game\", JOptionPane.INFORMATION_MESSAGE);\n\t\tbuttonPanel.endGameButton.setEnabled(false);\n\t\tsendScore();\n\t}", "private void scoreboard() {\n Intent intent = new Intent(this, AlienPainterScoreboardActivity.class);\n intent.putExtra(SCOREBOARD_STATUS, presenter.getIsVictorious());\n intent.putExtra(POINTS, presenter.getPoints());\n intent.putExtra(NUM_MOVES, presenter.getNumMoves());\n intent.putExtra(TIME_LEFT, presenter.getTimeLeft());\n intent.putExtra(LANGUAGE, isEnglish);\n intent.putExtra(PASS_USER, currUser);\n startActivity(intent);\n finish();\n }", "private void calcWinner(){\n //local class for finding ties\n class ScoreSorter implements Comparator<Player> {\n public int compare(Player p1, Player p2) {\n return p2.calcFinalScore() - p1.calcFinalScore();\n }\n }\n\n List<Player> winners = new ArrayList<Player>();\n int winningScore;\n\n // convert queue of players into List<Player> for determining winner(s)\n while (players.size() > 0) {\n winners.add(players.remove());\n } \n\n // scoreSorter's compare() should sort in descending order by calcFinalScore()\n // Arrays.sort(winnersPre, new scoreSorter()); // only works w/ normal arrays :(\n Collections.sort(winners, new ScoreSorter());\n\n // remove any players that don't have the winning score\n winningScore = winners.get(0).calcFinalScore();\n for (int i = winners.size()-1; i > 0; i--) { // remove non-ties starting from end, excluding 0\n if (winners.get(i).calcFinalScore() < winningScore) {\n winners.remove(i);\n }\n }\n\n // Announce winners\n boolean hideCalculatingWinnerPopUp = false;\n String winnersString = \"\";\n if (winners.size() > 1) {\n winnersString = \"There's a tie with \" + winners.get(0).calcFinalScore() + \" points. The following players tied: \";\n for (Player p : winners) {\n winnersString += p.getName() + \" \";\n }\n view.showPopUp(hideCalculatingWinnerPopUp, winnersString);\n } else {\n view.showPopUp(hideCalculatingWinnerPopUp, winners.get(0).getName() + \" wins with a score of \" + winners.get(0).calcFinalScore() + \" points! Clicking `ok` will end and close the game.\");\n }\n }", "public void displayReceivedRewards() {\n ;////System.out.println(\"\");\n ;////System.out.println(\"displayReceivedRewards() called...\");\n ;////System.out.println(\"-playerModelDiff1: \" + playerModelDiff1.toString());\n ;////System.out.println(\"-playerModelDiff4: \" + playerModelDiff4.toString());\n ;////System.out.println(\"-playerModelDiff7: \" + playerModelDiff7.toString());\n }", "private void resultsScreen(Stage stage, String[][] leaderboard) {\n\t\t\n\t\t//A HBox is prepared, with an int to determine spacing between the nodes within it later.\n\t\tHBox h = new HBox(30);\n\t\t\n\t\t//A VBox array of length 3 is prepared, as well as a Label array, with three values given\n\t\t//to it immediately. \n\t\tVBox[] v = new VBox[3];\n\t\tLabel[] title = {new Label(\"Name\"), new Label(\"Incorrect Guesses\"), new Label(\"Time\")};\n\t\t\n\t\t//A separate VBox is prepared.\n\t\tVBox v2;\n\t\t\n\t\t//For loop adding all the names from the leaderboard array into one VBox, then\n\t\t//adding all the incorrectGuesses to a second VBox, then adding all the times\n\t\t//to the third VBox. By doing it this way, names and scores are much more better\n\t\t//aligned as columns than if each player and their scores were put into HBoxes.\n\t\tfor(int i = 0; i < 3; i++) {\n\t\t\tv[i] = new VBox();\n\t\t\tv[i].getChildren().add(title[i]);\n\t\t\t\n\t\t\tfor(int j = 0; j < 3; j++) {\n\t\t\t\tLabel l = new Label(leaderboard[j][i]);\n\t\t\t\tv[i].getChildren().add(l);\n\t\t\t}\n\t\t\th.getChildren().add(v[i]);\n\t\t}\n\t\t\n\t\th.setAlignment(Pos.BASELINE_CENTER);\n\t\t\n\t\t//A label is now created and put into the second VBox, along with the HBox just created.\n\t\t//This results in the statement being placed below the entire leaderboard without issues.\n\t\tLabel endStatement = new Label(\"Press any key to start a new game or escape to exit.\");\n\t\tendStatement.setWrapText(true);\n\t\tendStatement.setPrefWidth(200);\n\t\tendStatement.setMinWidth(200);\n\t\tendStatement.setMaxWidth(200);\n\n\t\tv2 = new VBox(2,h,endStatement);\n\t\tv2.setAlignment(Pos.TOP_CENTER);\n\t\tgroup = new Group(v2);\n\t\t\n\t\tscene = new Scene(group,300,300,Color.LIGHTGREY);\n\t\tstage.setScene(scene);\n\t\tstage.setResizable(false);\n\t\tstage.setTitle(\"Hangman\");\n\t\tstage.show();\n\t\t\n\t\tscene.setOnKeyReleased(new EventHandler<KeyEvent>() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\t\n\t\t\t\tif(e.getCode()==KeyCode.ESCAPE) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tclient.close();\n\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t}\n\t\t\t\t\tstage.close();\n\t\t\t\t}else {\n\t\t\t\t\tstart(stage);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "@Then(\"^I choose by ranking of occupated$\")\n public void i_choose_by_ranking_of_occupated() {\n onViewWithId(R.id.spinnerStatisticsType).click();\n onViewWithText(\"Ranking\").isDisplayed();\n onViewWithText(\"Ranking\").click();\n }", "@Override\n\tpublic void homeTeamScored(int points) {\n\t\t\n\t}", "public static void score() {\n\t\tSystem.out.println(\"SCORE: \");\n\t\tSystem.out.println(player1 + \": \" + score1);\n\t\tSystem.out.println(player2 + \": \" + score2);\n\t}", "@Override\n\tpublic void gameEnded(Player winner) {\n\t\tcurrentPlayerLabel.setText(\"Winner is:\" + winner.name());\n\t}", "public void drawGameCompleteScreen() {\r\n PennDraw.clear();\r\n\r\n if (didPlayerWin()) {\r\n PennDraw.text(width / 2, height / 2, \"You Win!\");\r\n } else if (didPlayerLose()) {\r\n PennDraw.text(width / 2, height / 2, \"You have lost...\");\r\n }\r\n\r\n PennDraw.advance();\r\n }", "public void displayForpoint_one2(View view){\n score2 = score2 + 1;\n displayForTeamA2(score2);\n }", "public void createRanking() {\n Question q = new Ranking(this.in,this.o);\n this.o.setDisplay(\"Enter the prompt for your Ranking question:\\n\");\n this.o.getDisplay();\n\n q.setPrompt(this.in.getUserInput());\n\n int numAns = 0;\n while (numAns == 0) {\n this.o.setDisplay(\"How many items need to be ranked?\\n\");\n this.o.getDisplay();\n\n try {\n numAns = Integer.parseInt(this.in.getUserInput());\n if (numAns < 1) {\n numAns = 0;\n } else {\n q.setMaxResponses(numAns);\n }\n } catch (NumberFormatException e) {\n numAns = 0;\n }\n }\n\n if (isTest) {\n RCA ca = new RCA(this.in,this.o);\n Test t = (Test)this.survey;\n String ans;\n\n this.o.setDisplay(\"Enter correct answer(s):\\n\");\n this.o.getDisplay();\n for (int j=0; j < q.getMaxResponses(); j++){\n\n ans = this.in.getUserInput();\n\n ca.addResponse(ans);\n }\n t.addAnswer(ca);\n }\n this.survey.addQuestion(q);\n }", "private void showGameOver()\n {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n //Todo:\n // step 1. get the winner name using game.getWinner()\n // step 2. put the string player.getName()+\" won the game!\" to the string reference called \"result\"\n Player winner = game.getWinner();\n String result = winner.getName() + \" won the game!\";\n\n // pass the string referred by \"result\" to make an alert window\n // check the bottom of page 9 of the PA description for the appearance of this alert window\n Alert alert = new Alert(AlertType.CONFIRMATION, result, ButtonType.YES, ButtonType.NO);\n alert.showAndWait();\n if (alert.getResult() == ButtonType.YES)\n {\n Platform.exit();\n }\n }\n });\n }", "public void displayForTeamA2(int scoredisplay) {\n TextView scoreView = (TextView) findViewById(R.id.team_a_score2);\n scoreView.setText(String.valueOf(scoredisplay));\n }", "public void updateWindow() {\n MatchDAO ma = new MatchDAO();\n ArrayList<User> u = ma.getTopFiveMostMatchedUsers();\n view.updateWindow(ma.getLastMonthMatches(), ma.getLastWeekMatches(), ma.getLastDayMatches(), u);\n }", "public static void viewLeaderBoard()\n\t{\n\t}", "@Override\n public void RageQuit() {\n //They won't have a score\n timer.stopTimer();\n\n if (view.confirmRageQuit()){\n // Punish them!\n DesktopAudio.getInstance().playPunish();\n grid = game.getSolved();\n for (int i = 0; i < 9; i++){\n for (int j = 0; j < 9; j++){\n view.setGiven(i, j, grid.getNumber(i, j));\n }\n }\n if (view.confirmNewGame()){\n setNextGame();\n }\n }else{\n timer.startTimer();\n }\n }", "private static void ThridUmpireReview() {\n\t\tSystem.out.println(\" Umpier Reviews the Score Board\");\n\t\t \n\t\t\n\t}", "public void determineRank(){\r\n //ranks highcard 0, pair 1, twopair 2, three of a kind 3, straight 4, flush 5,\r\n //full house 6, four of a kind 7 , straight flush 8, royal flush 9\r\n //I should start top down.\r\n\r\n //Royal Flush\r\n if(isRoyalFlush())\r\n setRank(9);\r\n //Straight flush\r\n else if(isFlush() && isStraight())\r\n setRank(8);\r\n //four of a kind\r\n else if(isFourOfAKind())\r\n setRank(7);\r\n //full house\r\n else if( isFullHouse())\r\n setRank(6);\r\n //flush\r\n else if(isFlush())\r\n setRank(5);\r\n //straight\r\n else if(isStraight())\r\n setRank(4);\r\n //three of a kind\r\n else if(isThreeOfAKind())\r\n setRank(3);\r\n //twoPair\r\n else if(isTwoPair())\r\n setRank(2);\r\n //pair\r\n else if(isPair())\r\n setRank(1);\r\n //highcard\r\n else\r\n setRank(0);\r\n\r\n }", "private void scoreBoard(){\n \n //sort brackets by score \n //playerBrackets.sort((Bracket p1, Bracket p2) -> p1.scoreBracket(simResultBracket) -p2.scoreBracket(simResultBracket)); \n \n //scoreBoardButton.setDisable(true);\n displayPane(scoreBoard._start());\n //viewBracket.setDisable(false);\n }", "private static void displayUserTeam() {\n\t\tif (game.getCurrentRound()==1) {\n\t\t\tfor (int i = 0; i<11; i++) {\n\t\t\t\tplayerNameArray[i].setText(\"Name\");\n\t\t\t\timageArray[i].setIcon(MainGui.getShirt(\"noTeam\"));\n\t\t\t\tbuttonArray[i].setText(\"+\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void youWin(Map<String, Integer> rankingMap) {\n try {\n if (getClientInterface() != null)\n getClientInterface().gameEnded(\"YOU WON, CONGRATS BUDDY!!\", rankingMap);\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending you won error\");\n }\n }", "private void refreshScore(){\n String info = players[0] + \" \"+playerScores[0]+\":\" +playerScores[1]+ \" \"+players[1];\n scoreInfo.setText(info);\n }", "public void showNextMovePrompt() {\n\n if(model.isXTurn()){\n resultLabel.setText(\"X's Turn\");\n }\n else{\n resultLabel.setText(\"O's Turn\");\n }\n }", "public void dispEasy()\r\n {\r\n //Null block of code was original display method; keeping just in case\r\n \r\n /* switch (Win)\r\n {\r\n case 1: \r\n case 2: \r\n case 3: JOptionPane.showMessageDialog(null, \r\n \"It's a tie!\",\r\n \"digiRPS - Results\",\r\n JOptionPane.INFORMATION_MESSAGE);\r\n break;\r\n case 4: \r\n case 5: \r\n case 6: JOptionPane.showMessageDialog(null, \r\n userName + \" won!\",\r\n \"digiRPS - Results\",\r\n JOptionPane.INFORMATION_MESSAGE);\r\n break;\r\n case 7: \r\n case 8: \r\n case 9: JOptionPane.showMessageDialog(null, \r\n \"Computer won!\",\r\n \"digiRPS - Results\",\r\n JOptionPane.INFORMATION_MESSAGE);\r\n break;\r\n }\r\n */\r\n }", "void matchEnd(boolean winner);", "public void announceWinners(String winners) {\n JOptionPane.showMessageDialog(frame, winners + \" won the game!\");\n }", "@Override\r\n\t\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\tif(match.getMatchStatus() != MatchStatus.ENDED) {\r\n\t\t\t\t\t\t\tmatch.simMatch(); \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (p1==match.getWinner()) { \r\n\t\t\t\t\t\t\t\tPlayer1.setForeground(Color.GREEN);\r\n\t\t\t\t\t\t\t\tPlayer2.setForeground(Color.red); \r\n\t\t\t\t\t\t\t}else { \r\n\t\t\t\t\t\t\t\tPlayer2.setForeground(Color.green);\r\n\t\t\t\t\t\t\t\tPlayer1.setForeground(Color.red); \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\tmatchStatus.setText(\" Ended\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}", "public void displayForTeamA(int scoredisplay) {\n TextView scoreView = (TextView) findViewById(R.id.team_a_score);\n scoreView.setText(String.valueOf(scoredisplay));\n }", "public void displayForpoint_two(View view){\n score = score + 2;\n displayForTeamA(score);\n }", "private void gameOverDialog() {\n Toast makeText;\n makeText = Toast.makeText(this.getContext(), getResources().getString(R.string.game_over), Toast.LENGTH_LONG);\n makeText.show();\n makeText = Toast.makeText(this.getContext(), getResources().getString(R.string.final_score) + score, Toast.LENGTH_LONG);\n makeText.show();\n }", "private void endGame() {\r\n\r\n m_state.setState(State.ENDING_GAME);\r\n\r\n /* find winner */\r\n for(KimTeam team : m_survivingTeams) {\r\n if(team != null) {\r\n if(!team.isOut()) {\r\n m_winner = team;\r\n }\r\n\r\n //remove survivors from m_teams so not to duplicate stats\r\n m_teams[team.m_freq] = null;\r\n }\r\n }\r\n\r\n /* end poll */\r\n if(m_poll != null) {\r\n m_poll.endPoll(m_winner, m_connectionName);\r\n m_poll = null;\r\n }\r\n\r\n /* display scoresheet */\r\n m_botAction.sendArenaMessage(\"--------Base1--------W--L --------Base2--------W--L --------Base3--------W--L --------Base4--------W--L\");\r\n\r\n if(!m_skipFirstRound) {\r\n printFormattedTeams(m_teams, m_numTeams);\r\n m_botAction.sendArenaMessage(\"------------------------- ------------------------- ------------------------- -------------------------\");\r\n }\r\n\r\n printFormattedTeams(m_survivingTeams, 4);\r\n m_botAction.sendArenaMessage(\"-------------------------------------------------------------------------------------------------------\");\r\n\r\n if(m_winner != null) {\r\n m_botAction.sendArenaMessage(\"Winner: \" + m_winner.toString(), 5);\r\n\r\n for(KimPlayer kp : m_winner) {\r\n Player p = m_botAction.getPlayer(kp.m_name);\r\n\r\n if(p != null && p.isPlaying()) {\r\n m_botAction.warpTo(p.getPlayerID(), 512, 277);\r\n }\r\n }\r\n } else {\r\n m_botAction.sendArenaMessage(\"No winner.\");\r\n }\r\n\r\n updateDB();\r\n\r\n /* announce mvp and clean up */\r\n m_botAction.scheduleTask(new TimerTask() {\r\n public void run() {\r\n m_botAction.sendArenaMessage(\"MVP: \" + m_mvp.m_name, 7);\r\n //refreshScoreboard();\r\n cleanUp();\r\n resetArena();\r\n m_state.setState(State.STOPPED);\r\n }\r\n }, 4000);\r\n }", "private void endGame() {\n\t\tPlayRound.endGame();\n\t\tint score1 = users.get(0).getPoints();\n\t\tint score2 = users.get(1).getPoints();\n\t\tString winnerString;\n\t\tif(score1 > score2){\n\t\t\twinnerString = users.get(0).getName() + \" \" + \"won!\";\n\t\t}\n\t\telse if (score2 > score1) {\n\t\t\twinnerString = users.get(1).getName() + \" \" + \"won!\";;\n\t\t}\n\t\telse {\n\t\t\twinnerString = \"there was a tie!\";\n\t\t}\n\t\tJFrame frame = new JFrame();\n\t\tImageIcon icon = new ImageIcon(Game.class.getResource(\"/resources/cup.png\"));\n\t\tJOptionPane.showMessageDialog(null, winnerString, \"Congratulations\", JOptionPane.OK_OPTION, icon);\n\t}", "private void bankUserScore() {\n if (game.isPlayer_turn()) {\n game.addPlayerScore(round_score);\n player_tot_view.setText(String.valueOf(game.getPlayer_total()));\n }\n else {\n game.addBankScore(round_score);\n bank_tot_view.setText(String.valueOf(game.getBank_total()));\n }\n if (game.isGameWon()) {\n gameWonDialog();\n } else {\n game.changeTurn();\n round_score = 0;\n round_score_view.setText(String.valueOf(round_score));\n String label;\n if (game.isPlayer_turn()) {\n game.incrementRound();\n label = \"Round \" + game.getRound() + \" - Player's Turn\";\n }\n else {\n label = \"Round \" + game.getRound() + \" - Banker's Turn\";\n }\n round_label.setText(label);\n if (!game.isPlayer_turn())\n doBankTurn();\n }\n }", "public void calcMatch() {\n if (leftResult == null || rightResult == null) {\n match_score = 0.0f;\n } else {\n match_score = FaceLockHelper.Similarity(leftResult.getFeature(), rightResult.getFeature(), rightResult.getFeature().length);\n match_score *= 100.0f;\n tvFaceMatchScore1.setText(Float.toString(match_score));\n llFaceMatchScore.setVisibility(View.VISIBLE);\n\n }\n }", "private void startMatch() {\n game = new Match(players.get(0), players.get(1), \"Nueva Partida\");\n showMatch();\n state = 1;\n }", "public void displayResult(Dealer d) {\n if (d.getPlayer2ResultMap() != null) {\n\n controller.p1result.setText(String.format(\"%.2f\", controller.p1WinPercentage) + \"%\");\n controller.p2result.setText(String.format(\"%.2f\", controller.p2WinPercentage) + \"%\");\n controller.tielabel.setText(\"tie\");\n controller.tielabel.setTextFill(Color.BROWN);\n controller.tieresult.setText(String.format(\"%.2f\", controller.tiePercentage));\n controller.tieresult.setTextFill(Color.BROWN);\n if (controller.p1WinPercentage > controller.p2WinPercentage) {\n controller.p1result.setTextFill(Color.GREEN);\n controller.p2result.setTextFill(Color.RED);\n } else {\n controller.p1result.setTextFill(Color.RED);\n controller.p2result.setTextFill(Color.GREEN);\n }\n for (int i = 0; i < controller.p2ResultList.size(); i++) {\n controller.p2ResultList.get(i).setText(controller.p2Results[i]);\n }\n } else {\n for (int i = 0; i < controller.p2ResultList.size(); i++) {\n controller.p2ResultList.get(i).setText(\"\");\n }\n controller.p2result.setText(\"\");\n controller.tielabel.setText(\"\");\n controller.tieresult.setText(\"\");\n }\n\n for (int i = 0; i < controller.p1ResultList.size(); i++) {\n\n controller.p1ResultList.get(i).setText(controller.p1Results[i]);\n }\n controller.errorLabel.setText(\"\");\n }", "public void updateScoreUI() {\n\t\tMap<Integer, Integer> scoreMap = gameLogic.getScoreboard().getTotalScore();\n\n\t\tlblScoreA.setText(String.valueOf(scoreMap.get(0)));\n lblScoreB.setText(String.valueOf(scoreMap.get(1)));\n lblScoreC.setText(String.valueOf(scoreMap.get(2)));\n lblScoreD.setText(String.valueOf(scoreMap.get(3)));\n\t}", "@Override\n public void actionPerformed(ActionEvent event){\n \t\n \tStableFord game = new StableFord(course, group);\n \t\n \tfor (int i = 0; i < stringArray.length; i++){\n \t\tint[] integerArray = new int[18];\n \t\tScanner input = new Scanner(stringArray[i]);\n \t\tfor (int x = 0; x < 18; x++){\n \t\t\tintegerArray[x] = input.nextInt();\n \t\t}\n \t\tgame.setIndividualScore(i, integerArray);\n \t} \n \t\n \tgame.calculateGameScore();\n \tint [] points = game.getArrayScore();\n \tString string =\"\";\n \tfor(int i = 0; i < group.getPlayers().size(); i++){\n \t\tstring = string + String.format(\"Player %s points: %d %n\",\n \t\t\t\tgroup.getPlayers().get(i).getName(), points[i] );\n \t}\n \tJOptionPane.showMessageDialog(null, string);\n }", "public void onBattleCompleted(BattleCompletedEvent e) {\n System.out.println(\"-- Battle has completed --\");\n \n // Print out the sorted results with the robot names\n System.out.println(\"Battle results:\");\n for (robocode.BattleResults result : e.getSortedResults()) {\n System.out.println(\" \" + result.getTeamLeaderName() + \": \" + result.getScore());\n }\n }", "public void ScoreTeamA(View view) {\n scoreteamA = scoreteamA +1;\n displayScoreA(scoreteamA);\n }", "protected abstract void displayEndMsg(int resultGame);", "public void onBattleCompleted(BattleCompletedEvent e) {\n//\t\tSystem.out.println(\"-- Battle has completed --\");\n\n\t\t// Print out the sorted results with the robot names\n//\t\tSystem.out.println(\"Battle results:\");\n\t\tfor (robocode.BattleResults result : e.getSortedResults()) {\n\t\t\tSystem.out.println(\" \" + result.getTeamLeaderName() + \": \"\n\t\t\t\t\t+ result.getScore());\n\t\t}\n\t}", "public void showScore()\n {\n showText(\"Score:\" + score,550,50);\n }", "private void showEndMessage()\n {\n showText(\"Time is up - you win!\", 390, 150);\n showText(\"Your final score: \" + healthLevel + \" points\", 390, 170);\n }", "public synchronized void announceWinner(Team team) {\n\n String[] gameStats = new String[players.length];\n for(int i = 0; i < players.length; i++){\n\n String s = players[i].getName() + \": \" + players[i].getCorrectAnswers();\n gameStats[i] = s;\n System.err.println(s);\n }\n\n for (PlayerHandler playerHandler : players) {\n\n if (playerHandler.getTeam() == team) {\n playerHandler.getOutputStream().println(\n GFXGenerator.drawYouWon(playerHandler.getTeam().getColor(), score, teams[0], teams[1]) +\n \"\\n\" + GFXGenerator.drawTable(gameStats, 4, \"GAME STATS (CORRECT ANSWERS)\"));\n\n continue;\n }\n\n playerHandler.getOutputStream().println(\n GFXGenerator.drawGameOver(playerHandler.getTeam().getColor(), score, teams[0], teams[1])+\n \"\\n\" + GFXGenerator.drawTable(gameStats, 4, \"GAME STATS (CORRECT ANSWERS)\"));\n }\n\n }", "private void gameOverAlert() {\n \tAlert alert = new Alert(AlertType.INFORMATION);\n \t\n \talert.setTitle(\"Game Over!\");\n \talert.setHeaderText(\"You Did Not Get A New High Score!\\nYour High Score: \" + level.animal.getPoints());\n \talert.setContentText(\"Try Again Next Time!\");\n \talert.show();\n\t}", "@Override\r\n\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\tif(match.getMatchStatus() != MatchStatus.ENDED) {\r\n\t\t\t\tmatch.simMatch(); \r\n\t\t\t\t\r\n\t\t\t\tif (p1==match.getWinner()) { \r\n\t\t\t\t\tPlayer1.setForeground(Color.GREEN);\r\n\t\t\t\t\tPlayer2.setForeground(Color.red); \r\n\t\t\t\t}else { \r\n\t\t\t\t\tPlayer2.setForeground(Color.green);\r\n\t\t\t\t\tPlayer1.setForeground(Color.red); \r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tmatchStatus.setText(\" Ended\");\r\n\t\t\t\t}\r\n\t\t\t\t}", "public void finishSubRound(){\n\n\t\t/* sorts the cards on in the table pool in a decsending order */\n List<PlayerCardArray> sortedTableHand =\n\t\t\t\tgameLogic.getTableHand().sortedTableHand(gameLogic.getTrumpCard().getSuit(),\n gameLogic.getLeadSuitCard().getSuit());\n\n System.out.println(sortedTableHand);\n\n PlayerCardArray winner = sortedTableHand.get(0);\n\n\t\t/* Display winner of the round */\n System.out.println(\"The winner of this round is player ID: \" + winner.getPlayerId());\n gameLogic.getScoreboard().addTricksWon(round, winner.getPlayerId());\n\n\t\t/* Get the winner name */\n\t\tif (winner.getPlayerId() == 0){\n\t\t\twinnerName = lblNameA.getText();\n\t\t} else if (winner.getPlayerId() == 1){\n\t\t\twinnerName = lblNameB.getText();\n\t\t}else if (winner.getPlayerId() == 2){\n\t\t\twinnerName = lblNameC.getText();\n\t\t}else if (winner.getPlayerId() == 3){\n\t\t\twinnerName = lblNameD.getText();\n\t\t}\n\n\t\t/* displays the message dialog box informing winner of the round */\n JOptionPane.showMessageDialog(null, \"Round: \" + round + \"\\nSubround: \" + (roundCounter+1) + \"\\nWinner is: \" + winnerName);\n\n\t\t/* set Winner for player */\n for (Player p : gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n if ( p.getPlayerId() == winner.getPlayerId() ) {\n p.setTrickWinner(true);\n } else {\n p.setTrickWinner(false);\n }\n }\n\n\t\t/* updates the UI informing play how many tricks won so far */\n\t\tfor (Player p : gameLogic.getArrayOfPlayers().getArrayOfPlayers()) {\n\t\t\tif (winner.getPlayerId() == 0){\n\t\t\t\troundBidsWon += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 1){\n\t\t\t\troundBidsWon1 += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 2){\n\t\t\t\troundBidsWon2 += 1;\n\t\t\t\tbreak;\n\t\t\t} else if (winner.getPlayerId() == 3){\n\t\t\t\troundBidsWon3 += 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* Set position for players */\n System.out.println(\"OLD PLAYER ORDER: \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers());\n if (round != 11) {\n gameLogic.setPlayerOrder(round);\n currentPlayer = gameLogic.getArrayOfPlayers().getArrayOfPlayers().get(0).getPlayerId();\n if (currentPlayer == 0){\n \tSystem.out.println(\"YOU ARE NOW THE FIRST PERSON TO PLAY\");\n \twaitingUser = true;\n } else {\n \twaitingUser = false;\n }\n System.out.println(\"NEW PLAYER ORDER: \" + gameLogic.getArrayOfPlayers().getArrayOfPlayers());\n }\n\n\t\t/* Clear tableHand at end of subround */\n gameLogic.getTableHand().clearTableHand();\n\t}", "public void tossUpForTeamB(View v) {\n\n if (questionNumber <= 19) {\n scoreTeamB = scoreTeamB + 10;\n questionNumber = questionNumber + 1;\n displayQuestionNumber(questionNumber);\n displayForTeamB(scoreTeamB);\n }\n\n if (questionNumber == 20) {\n Toast.makeText(getApplicationContext(), \"Game Over!\", Toast.LENGTH_SHORT).show();\n\n }\n\n }" ]
[ "0.7361101", "0.6914728", "0.6877294", "0.6689919", "0.65610415", "0.653506", "0.6523009", "0.63862956", "0.63566965", "0.6345505", "0.6233483", "0.6207941", "0.61976653", "0.61813974", "0.6133486", "0.61257446", "0.61239296", "0.61097616", "0.6098905", "0.60979176", "0.6093479", "0.6071678", "0.60706073", "0.6067338", "0.60546154", "0.6035232", "0.6030296", "0.6026528", "0.60080147", "0.59870416", "0.5981059", "0.5959407", "0.5933555", "0.5929776", "0.59168226", "0.59156936", "0.59042895", "0.5902118", "0.5888059", "0.58821416", "0.5880753", "0.5868737", "0.5862811", "0.5862273", "0.586007", "0.5855938", "0.58480924", "0.5844472", "0.5838671", "0.5838314", "0.58374166", "0.5830733", "0.5825855", "0.58248305", "0.58155465", "0.5807702", "0.5807032", "0.5801236", "0.5800121", "0.5784464", "0.5778954", "0.5777726", "0.57749516", "0.5751891", "0.5747962", "0.5747697", "0.5745858", "0.574335", "0.57422954", "0.5739909", "0.5738658", "0.5736505", "0.57340103", "0.5732196", "0.5723438", "0.5717384", "0.5713618", "0.5711736", "0.5709295", "0.57085574", "0.5707529", "0.57035697", "0.57027006", "0.5698928", "0.5692634", "0.5688853", "0.56859934", "0.5680287", "0.5669396", "0.5660478", "0.56602067", "0.5656738", "0.56514996", "0.56492496", "0.564817", "0.5644214", "0.5643806", "0.5642329", "0.56376696", "0.563375" ]
0.61911076
13
Compiles classes in given source. The resulting .class files are added to an internal list which can be later retrieved by getClassFiles().
public boolean compile(String source) { return compile(source, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] getClassesToCompile();", "private Path compileTestClass(\n String packageName, String classname, String classSource, Path destinationDir)\n throws FileCompiler.FileCompilerException {\n // TODO: The use of FileCompiler is temporary. Should be replaced by use of SequenceCompiler,\n // which will compile from source, once it is able to write the class file to disk.\n Path sourceFile;\n try {\n sourceFile = javaFileWriter.writeClassCode(packageName, classname, classSource);\n } catch (RandoopOutputException e) {\n throw new RandoopBug(\"Output error during flaky-test filtering\", e);\n }\n FileCompiler fileCompiler = new FileCompiler();\n fileCompiler.compile(sourceFile, destinationDir);\n return sourceFile;\n }", "public Class[] generateAllClasses(\n CompilationSource source,\n String... doPaths) throws DataObjectException, NullPointerException, IllegalArgumentException {\n\n //\n return new DataObjectCompiler(source, doPaths).generateAllClasses();\n }", "public WorkResult execute() {\n source = new SimpleFileCollection(source.getFiles());\n classpath = new SimpleFileCollection(Lists.newArrayList(classpath));\n\n for (File file : source) {\n if (!file.getName().endsWith(\".java\")) {\n throw new InvalidUserDataException(String.format(\"Cannot compile non-Java source file '%s'.\", file));\n }\n }\n configure(compiler);\n return compiler.execute();\n }", "public boolean compile(String name, String source) {\n\t return compile(source);\n\t}", "public Map<String, Class<?>> generateClasses(CompilationSource source,\n String... doPaths) throws DataObjectException, NullPointerException, IllegalArgumentException {\n\n //\n return new DataObjectCompiler(source, doPaths).generateClasses();\n }", "public Set<String> getJavaSourceListing() {\n Set<String> javasrcs = new TreeSet<String>();\n \n String javasrc;\n for(String classname: classlist) {\n if(classname.contains(\"$\")) {\n continue; // skip (inner classes don't have a direct 1::1 java source file\n }\n \n javasrc = classname.replaceFirst(\"\\\\.class$\", \".java\");\n javasrcs.add(javasrc);\n }\n \n return javasrcs;\n }", "private void compileJavaFiles(File binDir, File javaFile) throws Exception {\n\t\tPathAssert.assertFileExists(\"Java Source\", javaFile);\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tLinkedList<File> classpath = ClassPathUtil.getClassPath();\n\t\tclasspath.add(0, binDir);\n\t\tStringBuilder cp = new StringBuilder();\n\t\tClassPathUtil.appendClasspath(cp, classpath);\n\t\tif (compiler.run(null, System.out, System.err, \"-cp\", cp.toString(), javaFile.getAbsolutePath()) != 0) {\n\t\t\tthrow new Exception(\"Exception while compiling file\");\n\t\t}\n\t}", "public List<ClassDescription> scanSources()\n throws SCRDescriptorFailureException, SCRDescriptorException {\n final List<ClassDescription> result = new ArrayList<ClassDescription>();\n\n for (final Source src : project.getSources()) {\n if ( src.getFile().getName().equals(\"package-info.java\") ) {\n log.debug(\"Skipping file \" + src.getClassName());\n continue;\n }\n log.debug(\"Scanning class \" + src.getClassName());\n\n try {\n // load the class\n final Class<?> annotatedClass = project.getClassLoader().loadClass(src.getClassName());\n\n this.process(annotatedClass, src, result);\n } catch ( final SCRDescriptorFailureException e ) {\n throw e;\n } catch ( final SCRDescriptorException e ) {\n throw e;\n } catch ( final ClassNotFoundException e ) {\n log.warn(\"ClassNotFoundException: \" + e.getMessage());\n } catch ( final NoClassDefFoundError e ) {\n log.warn(\"NoClassDefFoundError: \" + e.getMessage());\n } catch (final Throwable t) {\n throw new SCRDescriptorException(\"Unable to load compiled class: \" + src.getClassName(), src.getFile().toString(), t);\n }\n }\n return result;\n }", "private void buildClassPath() throws InterruptedException, IOException, CheckedAnalysisException {\n IClassPathBuilder builder = classFactory.createClassPathBuilder(bugReporter);\n\n for (String path : project.getFileArray()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), true);\n }\n for (String path : project.getAuxClasspathEntryList()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), false);\n }\n\n builder.scanNestedArchives(analysisOptions.scanNestedArchives);\n\n builder.build(classPath, progress);\n\n appClassList = builder.getAppClassList();\n\n if (PROGRESS) {\n System.out.println(appClassList.size() + \" classes scanned\");\n }\n\n // If any of the application codebases contain source code,\n // add them to the source path.\n // Also, use the last modified time of application codebases\n // to set the project timestamp.\n for (Iterator<? extends ICodeBase> i = classPath.appCodeBaseIterator(); i.hasNext();) {\n ICodeBase appCodeBase = i.next();\n\n if (appCodeBase.containsSourceFiles()) {\n String pathName = appCodeBase.getPathName();\n if (pathName != null) {\n project.addSourceDir(pathName);\n }\n }\n\n project.addTimestamp(appCodeBase.getLastModifiedTime());\n }\n\n }", "void compileToJava();", "public boolean compile(String source, boolean generate) {\n\t CompilerOptions options = getDefaultCompilerOptions();\n\t\tICompilerRequestor requestor = this;\n\t\tIErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems();\n\t IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());\n\t Source[] units = new Source[1];\n\t units[0] = new Source(source);\n\t units[0].setName();\t\t\n\t options.generateClassFiles = generate;\t \n\t\torg.eclipse.jdt.internal.compiler.Compiler compiler = new org.eclipse.jdt.internal.compiler.Compiler(\n\t\t\t\tnew CompilerAdapterEnvironment(environment, units[0]), \n\t\t\t\tpolicy, options, requestor, problemFactory);\n\t\t\n\t\tcompiler.compile(units);\n\t\treturn getResult().hasErrors();\n\t}", "public ClassNode source(String source) {\n $.sourceFile = source;\n return this;\n }", "List<String> getClassNames() {\n List<String> allGeneratedClasses = new ArrayList<String>();\n for (int i = 0; i < classesToScan.size(); i++) {\n String lookupName = classesToScan.get(i);\n byte classBytes[] = getClassBytes(lookupName);\n if (classBytes == null) {\n /*\n * Weird case: javac might generate a name and reference the class in\n * the bytecode but decide later that the class is unnecessary. In the\n * bytecode, a null is passed for the class.\n */\n continue;\n }\n \n /*\n * Add the class to the list only if it can be loaded to get around the\n * javac weirdness issue where javac refers a class but does not\n * generate it.\n */\n if (CompilingClassLoader.isClassnameGenerated(lookupName)\n && !allGeneratedClasses.contains(lookupName)) {\n allGeneratedClasses.add(lookupName);\n }\n AnonymousClassVisitor cv = new AnonymousClassVisitor();\n new ClassReader(classBytes).accept(cv, 0);\n List<String> innerClasses = cv.getInnerClassNames();\n for (String innerClass : innerClasses) {\n // The innerClass has to be an inner class of the lookupName\n if (!innerClass.startsWith(mainClass + \"$\")) {\n continue;\n }\n /*\n * TODO (amitmanjhi): consider making this a Set if necessary for\n * performance\n */\n // add the class to classes\n if (!classesToScan.contains(innerClass)) {\n classesToScan.add(innerClass);\n }\n }\n }\n Collections.sort(allGeneratedClasses, new GeneratedClassnameComparator());\n return allGeneratedClasses;\n }", "Set<CompiledClass> getCompiledClasses() {\n if (!isCompiled()) {\n return null;\n }\n if (exposedCompiledClasses == null) {\n FindTypesInCud typeFinder = new FindTypesInCud();\n cud.traverse(typeFinder, cud.scope);\n Set<CompiledClass> compiledClasses = typeFinder.getClasses();\n exposedCompiledClasses = Sets.normalizeUnmodifiable(compiledClasses);\n }\n return exposedCompiledClasses;\n }", "public Header [] compilationUnit(Header [] loaded, final int depth)\r\n {\r\n\ttry\r\n\t{\r\n this.depth = depth;\r\n String trunc = sources.getPath();\r\n list = loaded == null?new Header[0]:loaded;\r\n countToken = 0;\r\n \r\n Find.notePass(null);\r\n \r\n lookAhead();\r\n\r\n // read package name\r\n String myPackage = null;\r\n if (nextSymbol == Keyword.PACKAGESY)\r\n {\r\n lookAhead();\r\n myPackage = qualident();\r\n matchKeyword(Keyword.SEMICOLONSY);\r\n }\r\n\r\n Header header = new Header(new File(Parser.jdkSource).getPath(), trunc, myPackage, depth);\r\n\r\n Vector imported = new Vector();\r\n imported.add(\"java.lang.\");\r\n\r\n // read import statements\r\n while (nextSymbol == Keyword.IMPORTSY)\r\n imported.add(importDeclaration());\r\n\r\n header.imports = new String[imported.size()];\r\n for(int l = 0; l < imported.size(); l++)\r\n header.imports[l] = (String)imported.get(l);\r\n\r\n trunc = trunc.substring(0, sources.getPath().lastIndexOf(\".java\"));\r\n String basename = trunc.substring(trunc.lastIndexOf('\\\\') + 1);\r\n\r\n scopeStack = header.scopes;\r\n\r\n while(nextSymbol != Keyword.EOFSY)\r\n typeDeclaration(header.base, basename);\r\n\r\n matchKeyword(Keyword.EOFSY);\r\n\r\n if (Errors.count() != 0)\r\n return null;\r\n\r\n // write valid header\r\n header.write(trunc + \".h\");\r\n\r\n // append compiled file to list\r\n Header [] newList = new Header[(list != null?list.length:0) + 1];\r\n\r\n for(int i = 0; i < newList.length - 1; i++)\r\n newList[i] = list[i];\r\n\r\n newList[newList.length - 1] = header;\r\n list = newList;\r\n connectClasses(list);\r\n\r\n // resolve superclasses and interfaces\r\n for(int i = 0; i < header.scopes.size() && list != null; i++)\r\n {\r\n Vector v = new Vector();\r\n Scope scope = (Scope)header.scopes.get(i);\r\n\r\n for(Iterator iter = scope.iterator(); iter.hasNext();)\r\n {\r\n Basic b = (Basic)iter.next();\r\n if (b instanceof ClassType)\r\n v = getExtendImplement((ClassType)b);\r\n }\r\n\r\n while(v.size() > 0 && list != null)\r\n {\r\n connectClasses(list);\r\n list = loadSource((String)v.get(0), list, header, force);\r\n v.remove(0);\r\n }\r\n }\r\n\r\n if (Errors.count() != 0 || header.depth > 0 || list == null)\r\n return list;\r\n\r\n // process imports\r\n for(int i = 0; i < imported.size() && list != null; i++)\r\n {\r\n String st = (String)imported.get(i);\r\n if (!st.endsWith(\".\"))\r\n {\r\n connectClasses(list);\r\n list = loadSource(st.substring(st.lastIndexOf('.') + 1), list, header, force);\r\n }\r\n }\r\n\r\n if (Errors.count() != 0 || header.depth > 0 || list == null)\r\n return list;\r\n\r\n connectClasses(list);\r\n // process unresolved references\r\n for(int i = 0; i < header.scopes.size() && list != null; i++)\r\n {\r\n Scope scope = (Scope)header.scopes.get(i);\r\n Iterator step = scope.iterator();\r\n while(step.hasNext() && list != null)\r\n {\r\n Basic x = (Basic)step.next();\r\n\r\n if (x instanceof ClassType)\r\n {\r\n boolean inner = false;\r\n ClassType y = (ClassType)x;\r\n\r\n while(y.unresolved.size() > 0 && list != null)\r\n {\r\n Iterator it = y.unresolved.iterator();\r\n if (!it.hasNext())\r\n break;\r\n String name = (String)it.next();\r\n it = null;\r\n y.unresolved.remove(name);\r\n String [] s = name.split(\"\\\\.\");\r\n Scope [] z = null;\r\n\r\n z = Find.find(s[0], scope, true);\r\n\r\n if (z.length == 0)\r\n {\r\n list = loadSource(s[0], list, header, force);\r\n connectClasses(list);\r\n }\r\n try {\r\n if (s.length > 1)\r\n {\r\n ClassType [] classes = null;\r\n \r\n classes = Find.findClass(s[0], 0, scope);\r\n \r\n if (classes.length == 0)\r\n {\r\n classes = new ClassType[1];\r\n classes[0] = y;\r\n }\r\n for(int k = 1; k < s.length && classes.length > 0; k++)\r\n {\r\n Basic[] b = classes[0].scope.get(s[k]);\r\n for (int j = 0; j < b.length; j++)\r\n if (b[j] instanceof VariableType)\r\n {\r\n VariableType v = (VariableType) b[j];\r\n if (v.type.type == Keyword.NONESY)\r\n {\r\n classes = Find.findClass(v.type.ident.string, 0, scope);\r\n \r\n if (classes.length == 0)\r\n {\r\n y.unresolved.add(v.type.ident.string);\r\n //y.unresolved.add(name);\r\n }\r\n }\r\n else\r\n classes = new ClassType[0];\r\n break;\r\n }\r\n else if (b[j] instanceof MethodType)\r\n {\r\n MethodType v = (MethodType) b[j];\r\n if (v.type.type == Keyword.NONESY)\r\n {\r\n classes = Find.findClass(v.type.ident.string, 0, scope);\r\n \r\n if (classes.length == 0)\r\n {\r\n y.unresolved.add(v.type.ident.string);\r\n //y.unresolved.add(name);\r\n }\r\n }\r\n else\r\n classes = new ClassType[0];\r\n break;\r\n }\r\n else if (b[j] instanceof ClassType)\r\n {\r\n classes = new ClassType[1];\r\n classes[0] = (ClassType) b[j];\r\n break;\r\n }\r\n }\r\n }\r\n } catch(Exception ee){error(\"nullpointer \" + s[0] + '.' + s[1]);}\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (depth > 0)\r\n return list;\r\n\r\n if (Errors.count() != 0 || list == null)\r\n return null;\r\n\r\n connectClasses(list);\r\n \r\n Find.notePass(this);\r\n\r\n // resolve operator tree to Forth-code\r\n FileOutputStream file = null, starter = null;\r\n try\r\n {\r\n file = new FileOutputStream(header.name.substring(0, header.name.lastIndexOf('.')) + \".fs\");\r\n starter = new FileOutputStream(header.name.substring(0, header.name.lastIndexOf('.')) + \".start.fs\");\r\n System.out.println(\"translate \" + header.name);\r\n\r\n for(int k = 0; k < header.scopes.size(); k++)\r\n {\r\n Scope scope = (Scope)header.scopes.get(k);\r\n boolean module = (k == 0);\r\n for(Iterator iter = scope.iterator(); iter.hasNext();)\r\n {\r\n Basic b = (Basic)iter.next();\r\n if (b instanceof ClassType && (b.modify & Keyword.INTERFACESY.value) == 0)\r\n {\r\n if (gc.startsWith(\"m\"))\r\n CodeRCmodified.codeClass( (ClassType) b, file, starter, module);\r\n else\r\n Code3color.codeClass( (ClassType) b, file, starter, module);\r\n module = false;\r\n }\r\n }\r\n }\r\n\r\n file.close();\r\n starter.close();\r\n }\r\n catch(IOException ex1) { ex1.printStackTrace(); }\r\n \r\n Find.notePass(this);\r\n\t}\r\n\tcatch(Exception failed)\r\n\t{ error(failed.getMessage() + \" aborted\"); }\r\n \r\n return (Errors.count() != 0)?null:list;\r\n }", "public void compileScript( TemplateCompilerContext context )\r\n\t{\r\n\t\t// Compile to bytes\r\n\t\tCompilationUnit unit = new CompilationUnit();\r\n\t\tunit.addSource( context.getPath(), context.getScript().toString() );\r\n\t\tunit.compile( Phases.CLASS_GENERATION );\r\n\r\n\t\t// Results\r\n\t\t@SuppressWarnings( \"unchecked\" )\r\n\t\tList< GroovyClass > classes = unit.getClasses();\r\n\t\tAssert.isTrue( classes.size() > 0, \"Expecting 1 or more classes\" );\r\n\r\n\t\tClassLoader parent = Thread.currentThread().getContextClassLoader();\r\n\t\tif( parent == null )\r\n\t\t\tparent = GroovyTemplateCompiler.class.getClassLoader();\r\n\r\n\t\t// Define the class\r\n\t\t// TODO Configurable class loader\r\n\t\tDefiningClassLoader classLoader = new DefiningClassLoader( parent );\r\n\t\tClass< ? > first = null;\r\n\t\tfor( GroovyClass cls : classes )\r\n\t\t{\r\n\t\t\tClass< ? > clas = classLoader.defineClass( cls.getName(), cls.getBytes() );\r\n\t\t\tif( first == null )\r\n\t\t\t\tfirst = clas; // TODO Are we sure that the first one is always the right one?\r\n\t\t}\r\n\r\n\t\t// Instantiate the first\r\n\t\tGroovyObject object = (GroovyObject)Util.newInstance( first );\r\n\t\tClosure closure = (Closure)object.invokeMethod( \"getClosure\", null );\r\n\r\n\t\t// The old way:\r\n//\t\tClass< GroovyObject > groovyClass = new GroovyClassLoader().parseClass( new GroovyCodeSource( getSource(), getName(), \"x\" ) );\r\n\r\n\t\tcontext.setTemplate( new GroovyTemplate( closure ) );\r\n\t}", "public void compileMutants() {\n\tif (classOp != null && classOp.length > 0) {\n\t Debug.println(\"* Compiling class mutants into bytecode\");\n\t MutationSystem.MUTANT_PATH = MutationSystem.CLASS_MUTANT_PATH;\n\t super.compileMutants();\n\t}\n }", "protected void beginToCompile(org.eclipse.jdt.internal.compiler.env.ICompilationUnit[] sourceUnits, String[] bindingKeys) {\n int sourceLength = sourceUnits.length;\n int keyLength = bindingKeys.length;\n int maxUnits = sourceLength + keyLength;\n this.totalUnits = 0;\n this.unitsToProcess = new CompilationUnitDeclaration[maxUnits];\n int index = 0;\n // walks the source units\n this.requestedSources = new HashtableOfObject();\n for (int i = 0; i < sourceLength; i++) {\n org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = sourceUnits[i];\n CompilationUnitDeclaration parsedUnit;\n CompilationResult unitResult = new CompilationResult(sourceUnit, index++, maxUnits, this.options.maxProblemsPerUnit);\n try {\n if (this.options.verbose) {\n this.out.println(Messages.bind(Messages.compilation_request, new String[] { String.valueOf(index++ + 1), String.valueOf(maxUnits), new String(sourceUnit.getFileName()) }));\n }\n // diet parsing for large collection of units\n if (this.totalUnits < this.parseThreshold) {\n parsedUnit = this.parser.parse(sourceUnit, unitResult);\n } else {\n parsedUnit = this.parser.dietParse(sourceUnit, unitResult);\n }\n // initial type binding creation\n this.lookupEnvironment.buildTypeBindings(parsedUnit, /*no access restriction*/\n null);\n addCompilationUnit(sourceUnit, parsedUnit);\n this.requestedSources.put(unitResult.getFileName(), sourceUnit);\n worked(1);\n } finally {\n // no longer hold onto the unit\n sourceUnits[i] = null;\n }\n }\n // walk the binding keys\n this.requestedKeys = new HashtableOfObject();\n for (int i = 0; i < keyLength; i++) {\n BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment);\n resolver.parse(/*pause after fully qualified name*/\n true);\n // If it doesn't have a type name, then it is either an array type, package or base type, which will definitely not have a compilation unit.\n // Skipping it will speed up performance because the call will open jars. (theodora)\n CompilationUnitDeclaration parsedUnit = resolver.hasTypeName() ? resolver.getCompilationUnitDeclaration() : null;\n if (parsedUnit != null) {\n char[] fileName = parsedUnit.compilationResult.getFileName();\n Object existing = this.requestedKeys.get(fileName);\n if (existing == null)\n this.requestedKeys.put(fileName, resolver);\n else if (existing instanceof ArrayList)\n ((ArrayList) existing).add(resolver);\n else {\n ArrayList list = new ArrayList();\n list.add(existing);\n list.add(resolver);\n this.requestedKeys.put(fileName, list);\n }\n } else {\n char[] key = resolver.hasTypeName() ? // binary binding\n resolver.getKey().toCharArray() : // package binding or base type binding\n CharOperation.concatWith(resolver.compoundName(), '.');\n this.requestedKeys.put(key, resolver);\n }\n worked(1);\n }\n // binding resolution\n this.lookupEnvironment.completeTypeBindings();\n }", "private static void compileAndRun(String fileName, String code) {\n\n if(verboseCompiling) println(\"Deleting old temp files...\", warning);\n new File(fileName + \".java\").delete();\n new File(fileName + \".class\").delete();\n\n if(verboseCompiling) println(\"Creating source file...\", progErr);\n file = new File(fileName + \".java\");\n\n if(verboseCompiling) println(\"Writing code to source file...\", progErr);\n try {\n new FileWriter(file).append(code).close();\n } catch (IOException i) {\n println(\"Had an IO Exception when trying to write the code. Stack trace:\", error);\n i.printStackTrace();\n return; //Exit on error\n }\n\n if(verboseCompiling) println(\"Compiling code...\", progErr);\n //This should only ever be called if the JDK isn't installed. How you'd get here, I don't know.\n if (compiler == null) {\n println(\"Fatal Error: JDK not installed. Go to java.sun.com and install.\", error);\n return;\n }\n\n //Tries to compile. Success code is 0, so if something goes wrong, report.\n int result = -1;\n if (compileOptions.trim().equals(\"\"))\n result = compiler.run(null, out, err, file.getAbsolutePath());\n else\n //result = compiler.run(null, out, err, compileOptions, file.getAbsolutePath());\n result = compiler.run(null, out, err, \"-cp\", \"/Users/student/Desktop/bluecove-2.1.0.jar\", file.getAbsolutePath());\n //ArrayList<String> files = new ArrayList<>();\n //files.add(fileName);\n //boolean result = compiler.getTask(null, null, new ErrorReporter(), null, files, null).call();\n if (result != 0) {\n displayLog();\n //println(\"end record\", error); //End recording and pull out the message\n\n //println(\"Error type: \" + result,error);\n println(\"Failed to compile.\", warning);\n return; //Return on error\n }\n\n if(verboseCompiling) println(\"Attempting to run code...\", progErr);\n try {\n //Makes sure the JVM resets if it's already running.\n if(JVMrunning) \n kill();\n\n //Clears terminal window on main method call.\n if(clearOnMethod)\n outputText.setText(\"\");\n\n //Some String constants for java path and OS-specific separators.\n String separator = System.getProperty(\"file.separator\");\n String path = System.getProperty(\"java.home\")\n + separator + \"bin\" + separator + \"java\";\n\n //Creates a new process that executes the source file.\n ProcessBuilder builder = null;\n if(runOptions.trim().equals(\"\")) \n builder = new ProcessBuilder(path, fileName);\n else \n builder = new ProcessBuilder(path, runOptions, fileName);\n\n //Everything should be good now. Everything past this is on you. Don't mess it up.\n println(\"Build succeeded on \" + java.util.Calendar.getInstance().getTime().toString(), progErr);\n println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\", progErr); \n\n //Tries to run compiled code.\n JVM = builder.start();\n JVMrunning = true;\n\n //Links runtime out/err to our terminal window. No support for input yet.\n Reader errorReader = new InputStreamReader(JVM.getErrorStream());\n Reader outReader = new InputStreamReader(JVM.getInputStream());\n //Writer inReader = new OutputStreamWriter(JVM.getOutputStream());\n\n redirectErr = redirectIOStream(errorReader, err);\n redirectOut = redirectIOStream(outReader, out);\n //redirectIn = redirectIOStream(null, inReader);\n } catch (IOException e) {\n //JVM = builder.start() can throw this.\n println(\"IOException when running the JVM.\", progErr);\n e.printStackTrace();\n displayLog();\n return;\n }\n }", "public void generateCode(String[] sourceCode) {\n LexicalAnalyser lexicalAnalyser = new LexicalAnalyser(Helper.getInstructionSet());\n SynaticAnalyser synaticAnalyser = new SynaticAnalyser(console);\n HashMap<Integer, Instruction> intermediateRepresentation =\n synaticAnalyser.generateIntermediateRepresentation(\n lexicalAnalyser.generateAnnotatedToken(sourceCode));\n\n if (intermediateRepresentation == null) {\n this.console.reportError(\"Terminating code generation\");\n return;\n }\n\n printCode(intermediateRepresentation);\n\n FileUtility.saveJavaProgram(null, new JavaProgramTemplate(intermediateRepresentation));\n }", "@InterfaceAudience.Public\n Reducer compileReduce(String source, String language);", "protected JavaSource getJavaSourceForClass(String clazzname) {\n String resource = clazzname.replaceAll(\"\\\\.\", \"/\") + \".java\";\n FileObject fileObject = classPath.findResource(resource);\n if (fileObject == null) {\n return null;\n }\n Project project = FileOwnerQuery.getOwner(fileObject);\n if (project == null) {\n return null;\n }\n SourceGroup[] sourceGroups = ProjectUtils.getSources(project).getSourceGroups(\"java\");\n for (SourceGroup sourceGroup : sourceGroups) {\n return JavaSource.create(ClasspathInfo.create(sourceGroup.getRootFolder()));\n }\n return null;\n }", "public List<String> codeAnalyse(List<String> srcLines) {\n\t\t// Initializes the return List\n\t\tList<String> listForCsv = new ArrayList<String>();\n\t\t\n\t\t// Declares main comment pattern\n\t\tPattern patComments = Pattern.compile(\"^\\\\*.*|//.*|/\\\\*.*\");\n\t\t\n\t\t/*\n\t\t * Initializes our metrics loc(Lines of code),\n\t\t * noc(Number of classes), nom(Number of methods)\n\t\t */\n\t\tint loc = 0;\n\t\tint noc = 0;\n\t\tint nom = 0;\n\t\t\n\t\t// Variable to check if the loop is inside a multiple line comment\n\t\tboolean multLine = false;\n\t\t\n\t\t// Looping through the lines of code\n\t\tfor (String line: srcLines) {\n\t\t\tMatcher matcher = patComments.matcher(line);\n\t\t\t// If line is not a comment\n\t\t\tif (!matcher.matches()) {\n\t\t\t\tif (multLine == false) {\n\t\t\t\t\t// Regex for checking if line represents the beginning of a class\n\t\t\t\t\tif (line.matches(\"(?:\\\\s*(public|private|native|abstract|strictfp|abstract\"\n\t\t\t\t\t\t\t+ \"|protected|final)\\\\s+)?(?:static\\\\s+)?class.*\")) {\n\t\t\t\t\t\t// If true then increases noc by 1\n\t\t\t\t\t\tnoc ++;\n\t\t\t\t\t}\n\t\t\t\t\t// Regex for checking if line represents the beginning of a method\n\t\t\t\t\tif (line.matches(\"((public|private|native|static|final|protected\"\n\t\t\t\t\t\t\t+ \"|abstract|transient)+\\\\s)+[\\\\$_\\\\w\\\\<\\\\>\\\\[\\\\]]*\\\\s+[\\\\$_\\\\w]+\\\\([^\"\n\t\t\t\t\t\t\t+ \"\\\\)]*\\\\)?\\\\s*\\\\{?[^\\\\}]*\\\\}?\")) {\n\t\t\t\t\t\t// If true then increases nom by 1\n\t\t\t\t\t\tnom ++;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * Line is not a comment neither a blank line(insured while\n\t\t\t\t\t * reading the file) so we add 1 to the loc variable\n\t\t\t\t\t */ \n\t\t\t\t\tloc ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Potential multiple line comment starter\n\t\t\tif (line.matches(\"/\\\\*.*\")) {\n\t\t\t\tmultLine = true;\n\t\t\t}\n\t\t\t// Potential multiple line comment ender\n\t\t\tif (line.matches(\".*\\\\*/.*$\")) {\n\t\t\t\tmultLine = false;\n\t\t\t}\n\t\t}\n\t\t// Adds metrics to the return list\n\t\tlistForCsv.add(String.valueOf(loc));\n\t\tlistForCsv.add(String.valueOf(noc));\n\t\tlistForCsv.add(String.valueOf(nom));\n\t\t\n\t\t// Returns the list\n\t\treturn listForCsv;\n\t}", "private static void compileFile(String path) throws IOException {\n File f = new File(path);\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n File[] files = {f};\n Iterable<? extends JavaFileObject> compilationUnits =\n fileManager.getJavaFileObjectsFromFiles(Arrays.asList(files));\n compiler.getTask(null, fileManager, null, null, null, compilationUnits).call();\n fileManager.close();\n }", "public boolean compile()\n {\n if(this.compiling.get())\n {\n return false;\n }\n\n this.componentEditor.removeAllTemporaryModification();\n\n final String text = this.componentEditor.getText();\n final Matcher matcher = CompilerEditorPanel.PATTERN_CLASS_DECLARATION.matcher(text);\n\n if(!matcher.find())\n {\n this.printMessage(\"No class declaration !\");\n return false;\n }\n\n final String className = matcher.group(1);\n\n if(this.classManager.isResolved(className))\n {\n this.classManager.newClassLoader();\n }\n\n this.compiling.set(true);\n this.actionCompile.setEnabled(false);\n this.printMessage(className);\n this.informationMessage.append(\"\\ncompiling ...\");\n final byte[] data = text.getBytes();\n final ByteArrayInputStream stream = new ByteArrayInputStream(data);\n this.classManager.compileASMs(this.eventManager, stream);\n return true;\n }", "public abstract void compile();", "void initClasses() {\n\t\tif (programUnit == null) return;\n\n\t\t// Add all classes\n\t\tList<BdsNode> cdecls = BdsNodeWalker.findNodes(programUnit, ClassDeclaration.class, true, true);\n\t\tfor (BdsNode n : cdecls) {\n\t\t\tClassDeclaration cd = (ClassDeclaration) n;\n\t\t\tbdsvm.addType(cd.getType());\n\t\t}\n\t}", "public JasminBytecode( String className ) {\n this.className = className;\n this.jasminCode = new ArrayList<>();\n }", "public String[] compile(String[] names) throws IOException {\n String[] compiled = super.compile(names);\n for (int j=0;j<names.length;j++) {\n syncSources(names[j]);\n }\n return compiled;\n }", "protected Class[] getSourceClassesImpl() throws Exception {\n\t\treturn null;\n\t}", "public static JavaSourceFolder of( _JavaFileModel... javaModels )\r\n {\r\n JavaSourceFolder sourceFolder = new JavaSourceFolder();\r\n sourceFolder.add( javaModels );\r\n return sourceFolder;\r\n }", "void compileClass() throws IOException {\n tagBracketPrinter(CLASS_TAG, OPEN_TAG_BRACKET);\n try {\n compileClassHelper();\n } catch (IOException e) {\n e.printStackTrace();\n }\n tagBracketPrinter(CLASS_TAG, CLOSE_TAG_BRACKET);\n\n }", "@SuppressWarnings(\"unchecked\")\n public void loadClasses(String pckgname) throws ClassNotFoundException {\n File directory = null;\n try {\n ClassLoader cld = Thread.currentThread().getContextClassLoader();\n String path = \"/\" + pckgname.replace(\".\", \"/\");\n URL resource = cld.getResource(path);\n if (resource == null) {\n throw new ClassNotFoundException(\"sem classes no package \" + path);\n }\n directory = new File(resource.getFile());\n }\n catch (NullPointerException x) {\n throw new ClassNotFoundException(pckgname + \" (\" + directory + \") package invalido\");\n }\n if (directory.exists()) {\n String[] files = directory.list();\n for (int i = 0; i < files.length; i++) {\n if (files[i].endsWith(\".class\") && !files[i].contains(\"$\")) {\n Class cl = Class.forName(pckgname + '.' + files[i].substring(0, files[i].length() - 6));\n Method methods[] = cl.getDeclaredMethods();\n boolean ok = false;\n for (Method m : methods) {\n if ((m.getReturnType().equals(List.class) || m.getReturnType().isArray()) && m.getParameterTypes().length == 0) {\n ok = true;\n break;\n }\n }\n if (ok) {\n classes.add(cl);\n }\n }\n }\n }\n else {\n throw new ClassNotFoundException(pckgname + \" package invalido\");\n }\n }", "public SourceLister(String []srcDirs) {\n this.srcDirs = srcDirs;\n }", "private static Iterable<String> calcClosure(List<String> classes) {\n Set<String> ret = new HashSet<String>();\n\n List<String> newClasses = new ArrayList<String>();\n for (String cName : classes) {\n newClasses.add(cName);\n ret.add(cName);\n }\n\n boolean updating = true;\n while (updating) {\n updating = false;\n classes = newClasses;\n newClasses = new ArrayList<String>();\n for (String cName : classes) {\n Set<String> nC = new HashSet<String>();\n Analysis as = new Analysis() {\n @Override\n public ClassVisitor getClassVisitor() {\n return new ReachingClassAnalysis(Opcodes.ASM5, null, nC);\n }\n };\n\n try {\n as.analyze(cName);\n } catch (IOException ex) {\n System.err.println(\"WARNING: IOError handling: \" + cName);\n System.err.println(ex);\n }\n\n for (String cn : nC) {\n if (!ret.contains(cn) &&\n !cn.startsWith(\"[\")) {\n ret.add(cn);\n newClasses.add(cn);\n updating = true;\n }\n }\n }\n }\n\n System.err.println(\"Identified \" + ret.size() +\n \" potentially reachable classes\");\n\n return ret;\n }", "private List<JCMethodDecl> addCompactConstructorIfNeeded(JavacNode typeNode, JavacNode source) {\n\t\tList<JCMethodDecl> answer = List.nil();\n\t\t\n\t\tif (typeNode == null || !(typeNode.get() instanceof JCClassDecl)) return answer;\n\t\t\n\t\tJCClassDecl cDecl = (JCClassDecl) typeNode.get();\n\t\tif ((cDecl.mods.flags & RECORD) == 0) return answer;\n\t\t\n\t\tboolean generateConstructor = false;\n\t\t\n\t\tJCMethodDecl existingCtr = null;\n\t\t\n\t\tfor (JCTree def : cDecl.defs) {\n\t\t\tif (def instanceof JCMethodDecl) {\n\t\t\t\tJCMethodDecl md = (JCMethodDecl) def;\n\t\t\t\tif (md.name.contentEquals(\"<init>\")) {\n\t\t\t\t\tif ((md.mods.flags & Flags.GENERATEDCONSTR) != 0) {\n\t\t\t\t\t\texistingCtr = md;\n\t\t\t\t\t\texistingCtr.mods.flags = existingCtr.mods.flags & ~Flags.GENERATEDCONSTR;\n\t\t\t\t\t\tgenerateConstructor = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!isTolerate(typeNode, md)) {\n\t\t\t\t\t\t\tif ((md.mods.flags & COMPACT_RECORD_CONSTRUCTOR) != 0) {\n\t\t\t\t\t\t\t\tgenerateConstructor = false;\n\t\t\t\t\t\t\t\tanswer = answer.prepend(md);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (generateConstructor) {\n\t\t\tJCMethodDecl ctr;\n\t\t\tif (existingCtr != null) {\n\t\t\t\tctr = createRecordArgslessConstructor(typeNode, source, existingCtr);\n\t\t\t} else {\n\t\t\t\tctr = createRecordArgslessConstructor(typeNode, source, null);\n\t\t\t\tinjectMethod(typeNode, ctr);\n\t\t\t}\n\t\t\tanswer = answer.prepend(ctr);\n\t\t}\n\t\t\n\t\treturn answer;\n\t}", "@Override\n public CompilationSource createCompilationSource(String name) {\n File sourceFile = getSourceFile(name);\n if (sourceFile == null || !sourceFile.exists()) {\n return null;\n }\n\n return new FileSource(name, sourceFile);\n }", "private void scan() {\n if (classRefs != null)\n return;\n // Store ids rather than names to avoid multiple name building.\n Set classIDs = new HashSet();\n Set methodIDs = new HashSet();\n\n codePaths = 1; // there has to be at least one...\n\n offset = 0;\n int max = codeBytes.length;\n\twhile (offset < max) {\n\t int bcode = at(0);\n\t if (bcode == bc_wide) {\n\t\tbcode = at(1);\n\t\tint arg = shortAt(2);\n\t\tswitch (bcode) {\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret:\n\t\t\toffset += 4;\n\t\t\tbreak;\n\n\t\t case bc_iinc:\n\t\t\toffset += 6;\n\t\t\tbreak;\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t } else {\n\t\tswitch (bcode) {\n // These bcodes have CONSTANT_Class arguments\n case bc_instanceof: \n case bc_checkcast: case bc_new:\n {\n\t\t\tint index = shortAt(1);\n classIDs.add(new Integer(index));\n\t\t\toffset += 3;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_putstatic: case bc_getstatic:\n case bc_putfield: case bc_getfield: {\n\t\t\tint index = shortAt(1);\n CPFieldInfo fi = (CPFieldInfo)cpool.get(index);\n classIDs.add(new Integer(fi.getClassID()));\n\t\t\toffset += 3;\n\t\t\tbreak;\n }\n\n // These bcodes have CONSTANT_MethodRef_info arguments\n\t\t case bc_invokevirtual: case bc_invokespecial:\n case bc_invokestatic:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_jsr_w:\n\t\t case bc_invokeinterface:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n // Branch instructions\n\t\t case bc_ifeq: case bc_ifge: case bc_ifgt:\n\t\t case bc_ifle: case bc_iflt: case bc_ifne:\n\t\t case bc_if_icmpeq: case bc_if_icmpne: case bc_if_icmpge:\n\t\t case bc_if_icmpgt: case bc_if_icmple: case bc_if_icmplt:\n\t\t case bc_if_acmpeq: case bc_if_acmpne:\n\t\t case bc_ifnull: case bc_ifnonnull:\n\t\t case bc_jsr:\n codePaths++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n case bc_lcmp: case bc_fcmpl: case bc_fcmpg:\n case bc_dcmpl: case bc_dcmpg:\n codePaths++;\n\t\t\toffset++;\n break;\n\n\t\t case bc_tableswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tlong low = intAt(tbl, 1);\n\t\t\tlong high = intAt(tbl, 2);\n\t\t\ttbl += 3 << 2; \t\t\t// three int header\n\n // Find number of unique table addresses.\n // The default path is skipped so we find the\n // number of alternative paths here.\n Set set = new HashSet();\n int length = (int)(high - low + 1);\n for (int i = 0; i < length; i++) {\n int jumpAddr = (int)intAt (tbl, i) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n\n\t\t\toffset = tbl + (int)((high - low + 1) << 2);\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_lookupswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tint npairs = (int)intAt(tbl, 1);\n\t\t\tint nints = npairs * 2;\n\t\t\ttbl += 2 << 2; \t\t\t// two int header\n\n // Find number of unique table addresses\n Set set = new HashSet();\n for (int i = 0; i < nints; i += 2) {\n // use the address half of each pair\n int jumpAddr = (int)intAt (tbl, i + 1) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n \n\t\t\toffset = tbl + (nints << 2);\n\t\t\tbreak;\n\t\t }\n\n // Ignore other bcodes.\n\t\t case bc_anewarray: \n offset += 3;\n break;\n\n\t\t case bc_multianewarray: {\n\t\t\toffset += 4;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret: case bc_newarray:\n\t\t case bc_bipush: case bc_ldc:\n\t\t\toffset += 2;\n\t\t\tbreak;\n\t\t \n\t\t case bc_iinc: case bc_sipush:\n\t\t case bc_ldc_w: case bc_ldc2_w:\n\t\t case bc_goto:\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_goto_w:\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t }\n\t}\n classRefs = expandClassNames(classIDs);\n methodRefs = expandMethodNames(methodIDs);\n }", "private void parse() {\n try {\n SimpleNode rootNode = jmm.parseClass(sourcefile);\n assert rootNode.is(JJTPROGRAM);\n\n SimpleNode classNode = rootNode.jjtGetChild(0);\n assert classNode.is(JJTCLASSDECLARATION);\n\n data.classNode = classNode;\n } catch (FileNotFoundException e) {\n throw new CompilationException(e);\n } catch (ParseException e) {\n throw new CompilationException(\"Parsing Error: \" + e.getMessage(), e);\n }\n }", "public CompilationResult compile(TestConfiguration configuration) {\n TestUtilities.ensureDirectoryExists(new File(configuration.getOptions().get(\"-d\")));\n\n final StringWriter javacOutput = new StringWriter();\n DiagnosticCollector<JavaFileObject> diagnostics = new\n DiagnosticCollector<JavaFileObject>();\n\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n Iterable<? extends JavaFileObject> javaFiles =\n fileManager.getJavaFileObjects(configuration.getTestSourceFiles().toArray(new File[]{}));\n\n\n\n //Even though the method compilergetTask takes a list of processors, it fails if processors are passed this way\n //with the message:\n //error: Class names, 'org.checkerframework.checker.interning.InterningChecker', are only accepted if\n // annotation processing is explicitly requested\n //Therefore, we now add them to the beginning of the options list\n final List<String> options = new ArrayList<String>();\n options.add(\"-processor\");\n options.add(PluginUtil.join(\",\", configuration.getProcessors()));\n List<String> nonJvmOptions = new ArrayList<String>();\n for (String option : configuration.getFlatOptions()) {\n if (! option.startsWith(\"-J-\")) {\n nonJvmOptions.add(option);\n }\n }\n options.addAll(nonJvmOptions);\n\n if (configuration.shouldEmitDebugInfo()) {\n System.out.println(\"Running test using the following invocation:\");\n System.out.println(\"javac \" + PluginUtil.join(\" \", options) + \" \"\n + PluginUtil.join(\" \", configuration.getTestSourceFiles()));\n }\n\n JavaCompiler.CompilationTask task =\n compiler.getTask(javacOutput, fileManager, diagnostics, options, new ArrayList<String>(), javaFiles);\n\n /*\n * In Eclipse, std out and std err for multiple tests appear as one\n * long stream. When selecting a specific failed test, one sees the\n * expected/unexpected messages, but not the std out/err messages from\n * that particular test. Can we improve this somehow?\n */\n final Boolean compiledWithoutError = task.call();\n javacOutput.flush();\n return new CompilationResult(compiledWithoutError, javacOutput.toString(), javaFiles,\n diagnostics.getDiagnostics());\n }", "public BdsVm compile() {\n\t\tif (bdsvm != null) throw new RuntimeException(\"Code already compiled!\");\n\n\t\t// Initialize\n\t\tbdsvm = new BdsVm();\n\t\tcode = new ArrayList<>();\n\t\tbdsvm.setDebug(debug);\n\t\tbdsvm.setVerbose(verbose);\n\t\tinit();\n\n\t\t// Read file and parse each line\n\t\tlineNum = 1;\n\t\tfor (String line : code().split(\"\\n\")) {\n\t\t\t// Remove comments and labels\n\t\t\tif (isCommentLine(line)) continue;\n\n\t\t\t// Parse label, if any.Keep the rest of the line\n\t\t\tline = label(line);\n\t\t\tif (line.isEmpty()) continue;\n\n\t\t\t// Decode instruction\n\t\t\tOpCode opcode = opcode(line);\n\t\t\tString param = null;\n\t\t\tif (opcode.hasParam()) param = param(line);\n\t\t\t// Add instruction\n\t\t\taddInstruction(opcode, param);\n\t\t\tlineNum++;\n\t\t}\n\n\t\tbdsvm.setCode(code);\n\t\tif (debug) System.err.println(\"# Assembly: Start\\n\" + bdsvm.toAsm() + \"\\n# Assembly: End\\n\");\n\t\treturn bdsvm;\n\t}", "public JasminBytecode(String className, List<String> jasminCode ) {\n this.className = className;\n this.jasminCode = new ArrayList<>(jasminCode);\n }", "public String getCompilerClassName();", "public void compileStarted() { }", "public void compileStarted() { }", "public static String run(Compilation compilation) throws Exception {\n\t\tfor (String code : compilation.jFiles) {\n\t\t\tClassFile classFile = new ClassFile();\n\t\t\tclassFile.getClassName();\n\t\t\tclassFile.readJasmin(new StringReader(code), \"\", false);\n\t\t\tPath outputPath = tempDir.resolve(classFile.getClassName() + \".class\");\n\t\t\ttry (OutputStream output = Files.newOutputStream(outputPath)) {\n\t\t\t\tclassFile.write(output);\n\t\t\t}\n\t\t}\n\n\t\treturn runJavaClass(tempDir, JasminTemplate.MAIN_CLASS_NAME);\n\t}", "protected void compile() throws FileNotFoundException, DebuggerCompilationException{\n String[] compileArgs = new String[5];\n String cOutFile = Integer.toString(handle);//filename + Integer.toString(handle);\n String outArg = cOutFile;\n compileArgs[0] = ocamlCompileC;\n compileArgs[1] = \"-g\";\n compileArgs[2] = filename;\n compileArgs[3] = \"-o\";\n compileArgs[4] = cOutFile;\n outFile = cOutFile;\n\n /* Start the ocamlc compiler */\n Process compileProcess;\n try{\n compileProcess = runtime.exec(compileArgs);\n }catch(IOException e){\n System.out.println(\"HERE\");\n throw new DebuggerCompilationException();\n //}catch(FileNotFoundException f){\n // throw new FileNotFoundException();\n }\n OutputStreamWriter compileWriter = new OutputStreamWriter(compileProcess.getOutputStream());\n\n InputStream processInputStream = compileProcess.getInputStream();\n\n /* Create a DebugListener to read the output */\n DebugListener compileReader = new DebugListener(processInputStream, this.observers, handle);\n\n compileReader.start();\n \n try{\n Thread.sleep(2000);\n }catch(Exception e){\n\n }\n\n }", "private static boolean writeAndCompile(String className, String implement, String header, String expression) {\n\n\t\t// build the class\n\t\tString classData = String.format(classBase, className, implement, header, expression);\n\t\tString classFileName = className + \".java\";\n\n\t\t// write the .java file\n\t\ttry (PrintWriter out = new PrintWriter(path + classFileName)) {\n\t\t\tout.println(classData);\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\n\t\t// compile the file\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tint result;\n\n\t\tif (compiler == null) {\n\t\t\tSystem.out.println(\"No Compiler! Trying external tools..\");\n\n\t\t\ttry {\n\t\t\t\tcom.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();\n\t\t\t\tresult = javac.compile(new String[] {path + classFileName});\n\t\t\t} catch (NoClassDefFoundError e) {\n\t\t\t\tSystem.out.println(\"No external tools found!\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//return false;\n\t\t} else\n\t\t\tresult = compiler.run(null, null, null, path + classFileName);\n\n\t\t// delete the .java file, just because\n\t\ttry {\n\t\t\tnew File(path + classFileName).delete();\n\n\t\t// meh, we tried\n\t\t} catch (Exception e) {}\n\n\t\t// if result is 0, compilation was successful\n\t\treturn result == 0;\n\t}", "public ClassFile[] getClassFiles() {\n\t\treturn getResult().getClassFiles();\n\t}", "public void scanClasspath() {\n List<String> classNames = new ArrayList<>(Collections.list(dexFile.entries()));\n\n ClassLoader classLoader = org.upacreekrobotics.dashboard.ClasspathScanner.class.getClassLoader();\n\n for (String className : classNames) {\n if (filter.shouldProcessClass(className)) {\n try {\n Class klass = Class.forName(className, false, classLoader);\n\n filter.processClass(klass);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoClassDefFoundError e) {\n e.printStackTrace();\n }\n }\n }\n }", "protected abstract void generateClassFiles(ClassDoc[] arr, ClassTree classtree);", "protected Object compileAndLoad() throws IOException {\n String generatedSource = printJCodeModel();\n return compileAndLoadSource(generatedSource, TEST_CLASS_NAME);\n }", "public static JavaSourceFolder of( JavaSourceFile...adHocJavaFiles )\r\n {\r\n JavaSourceFolder sourceFolder = new JavaSourceFolder();\r\n sourceFolder.add( adHocJavaFiles );\r\n return sourceFolder;\r\n }", "public List<Class<?>> getAllImportedClasses(Class<?> aSourceClass) {\n\t\tList<Class<?>> result = new ArrayList<Class<?>>();\n\t\tfor (Fw fld : this.getAllFields(aSourceClass)) {\n\t\t\tif (fld.isEnum() || !fld.isSimple()) {\n\t\t\t\tresult.add(fld.type());\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n File file = new File(\"./src/testcode.c\");\n \n Compiler compiler = new Compiler(file);\n compiler.compile();\n }", "private void getCompilationUnits(String filePath) {\n File file = new File(filePath);\n\n for(File f : file.listFiles()) {\n if(f.isFile() && f.getName().endsWith(\".java\")) {\n FileInputStream in = null;\n try {\n\n in = new FileInputStream(f);\n CompilationUnit cu = JavaParser.parse(in);\n compilationUnits.add(cu);\n\n } catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException from getCompilationUnits method\");\n e.printStackTrace();\n } catch (Exception e) {\n System.out.println(\"Exception from getCompilationUnits method\");\n e.printStackTrace();\n } finally {\n try {\n\n in.close();\n\n } catch (IOException e) {\n System.out.println(\"IOException from getCompilationUnits method\");\n e.printStackTrace();\n }\n }\n }\n }\n }", "private void generateClassFiles(ClassTree classtree) {\n String[] packageNames = configuration.classDocCatalog.packageNames();\n for (int packageNameIndex = 0; packageNameIndex < packageNames.length;\n packageNameIndex++) {\n generateClassFiles(configuration.classDocCatalog.allClasses(\n packageNames[packageNameIndex]), classtree);\n }\n }", "@InterfaceAudience.Public\n Mapper compileMap(String source, String language);", "public void updateSource() {\n\t\t// Set the mode to recording\n\t\tmode = RECORD;\n\t\t// Traverse the source and record the architectures structure\n\t\tinspect();\n\t\t// Set the mode to code generation\n\t\tmode = GENERATE;\n\t\t// Traverse the source and calls back when key source elements are\n\t\t// missing\n\t\tinspect();\n\t\t// System.out.println(tree);\n\t\t// Add the source files that are missing\n\t\tArrayList<TagNode> tags = tree.getUnvisited();\n\t\tcreateSourceFiles(tags);\n\t}", "public void main(ArrayList<String> files) throws IOException {\n\t\tDesignParser.CLASSES = files;\n\t\t\n\t\tthis.model = new Model();\n\n\t\tfor (String className : CLASSES) {\n//\t\t\tSystem.out.println(\"====================\");\n\t\t\t// ASM's ClassReader does the heavy lifting of parsing the compiled\n\t\t\t// Java class\n//\t\t\tSystem.out.println(\"Analyzing: \" + className);\n//\t\t\tSystem.out.println(className + \"[\");\n\t\t\tClassReader reader = new ClassReader(className);\n\t\t\t\t\t\t\n\t\t\t// make class declaration visitor to get superclass and interfaces\n\t\t\tClassVisitor decVisitor = new ClassDeclarationVisitor(Opcodes.ASM5, this.model);\n\t\t\t\n\t\t\t// DECORATE declaration visitor with field visitor\n\t\t\tClassVisitor fieldVisitor = new ClassFieldVisitor(Opcodes.ASM5, decVisitor, this.model);\n\t\t\t\n\t\t\t// DECORATE field visitor with method visitor\n\t\t\tClassVisitor methodVisitor = new ClassMethodVisitor(Opcodes.ASM5, fieldVisitor, this.model);\n\t\t\t\n\t\t\t// TODO: add more DECORATORS here in later milestones to accomplish\n\t\t\t// specific tasks\n\t\t\tClassVisitor extensionVisitor = new ExtensionVisitor(Opcodes.ASM5, methodVisitor, this.model);\n\t\t\t\n\t\t\tClassVisitor implementationVisitor = new ImplementationVisitor(Opcodes.ASM5, extensionVisitor, this.model);\n\t\t\t\t\t\t\n\t\t\tClassVisitor usesVisitor = new UsesVisitor(Opcodes.ASM5, implementationVisitor, this.model);\n\t\t\t\n\t\t\tClassVisitor compositionVisitor = new CompositionVisitor(Opcodes.ASM5, usesVisitor, this.model);\n\t\t\t\n\t\t\t// Tell the Reader to use our (heavily decorated) ClassVisitor to\n\t\t\t// visit the class\n\t\t\treader.accept(compositionVisitor, ClassReader.EXPAND_FRAMES);\n//\t\t\tSystem.out.println(\"\\n]\");\n\t\t}\n//\t\tSystem.out.println(\"End Of Code\");\n\t}", "@Override\n public ClassPath getClassPath()\n {\n return getProjectSourcesClassPath();\n }", "protected void generateClassFiles(RootDoc root, ClassTree classtree) {\n generateClassFiles(classtree);\n PackageDoc[] packages = root.specifiedPackages();\n for (int i = 0; i < packages.length; i++) {\n generateClassFiles(packages[i].allClasses(), classtree);\n }\n }", "public static void compile(final InputStream source, final OutputStream destination) throws IOException, ParsingException {\n final Reader reader = new Reader();\n final SList program = reader.read(source);\n try (ObjectOutputStream oos = new ObjectOutputStream(destination)) {\n oos.writeObject(program);\n }\n }", "@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}", "@Override\r\n public boolean begin(List<File> sources, File outputDir, DataStore args) {\r\n this.args = args;\r\n classPath = new ArrayList<>();\r\n this.outputDir = outputDir;\r\n clearOutputFolder = false;\r\n reset();\r\n parseOptions(args);\r\n\r\n // if (prettyPrint) {\r\n // tempOutFolder = new File(IoUtils.getCanonicalPath(outputDir) + \"_temp\");\r\n // outputDir = tempOutFolder;\r\n // }\r\n\r\n if (prettyPrint) {\r\n\r\n this.outputDir.mkdirs();\r\n temp = getTemporaryWeaverFolder();// new File(\"_jw_temp\");\r\n outputDir = temp;\r\n // this.setOutputProcessor(temp, spoon, spoon.getEnvironment());\r\n //\r\n // this.setInputSources(Arrays.asList(temp), spoon);\r\n }\r\n\r\n // Pass only Java files to spoon\r\n // Method can do some processing, such as filtering duplicate classes\r\n var javaSources = getJavaSources(sources);\r\n spoon = newSpoon(javaSources, outputDir);\r\n\r\n // spoon = newSpoon(sources, outputDir);\r\n this.currentOutputDir = outputDir;\r\n buildAndProcess();\r\n /* turning off path verifier as it is giving errors for new classes and code */\r\n // spoon.getEnvironment().setNoClasspath(true);\r\n // spoon.getEnvironment().setNoClasspath(false);\r\n jApp = JApp.newInstance(spoon, sources);\r\n // spoon.getEnvironment().setAutoImports(false);\r\n\r\n return true;\r\n }", "private boolean doCompile(String sourceName, String destName,\n PrintStream out, PrintStream err)\n throws DecacFatalError, LocationException {\n AbstractProgram prog = doLexingAndParsing(sourceName, err);\n\n if (prog == null) {\n LOG.info(\"Parsing failed\");\n return true;\n }\n assert(prog.checkAllLocations());\n if (compilerOptions.getParseOnly()) {\n prog.decompile(System.out);\n return false;\n }\n\n\n prog.verifyProgram(this);\n assert(prog.checkAllDecorations());\n\n if (compilerOptions.getVerificationOnly()) {\n return false;\n }\n\n addComment(\"start main program\");\n prog.codeGenProgram(this);\n addComment(\"end main program\");\n LOG.debug(\"Generated assembly code:\" + nl + program.display());\n LOG.info(\"Output file assembly file is: \" + destName);\n\n FileOutputStream fstream = null;\n try {\n fstream = new FileOutputStream(destName);\n } catch (FileNotFoundException e) {\n throw new DecacFatalError(\"Failed to open output file: \" + e.getLocalizedMessage());\n }\n\n LOG.info(\"Writing assembler file ...\");\n\n program.display(new PrintStream(fstream));\n LOG.info(\"Compilation of \" + sourceName + \" successful.\");\n return false;\n }", "public static void compile(final File source, final String destinationFolder) throws IOException, ParsingException {\n try (InputStream input = new FileInputStream(source);\n OutputStream output = new FileOutputStream(getDestinationFileName(source, destinationFolder).toFile())) {\n compile(input, output);\n }\n }", "private Map<String, Entity> parseJavaClasses(List<Path> classFiles) {\r\n logger.trace(\"parseJavaClass\");\r\n\r\n // Instantiate walker and listener\r\n ParseTreeWalker walker = new ParseTreeWalker();\r\n Java8CustomListener listener = new Java8CustomListener();\r\n\r\n classFiles.forEach(path -> {\r\n logger.trace(\"========== Parse: \" + path.toFile().getName() + \" ==========\");\r\n\r\n try {\r\n ParseTree tree = getTree(path);\r\n\r\n // walk through class\r\n walker.walk(listener, tree);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading creating tree for: {}\", path, e);\r\n }\r\n });\r\n\r\n return listener.getEntityMap();\r\n }", "public void processClasses(CompilationUnit cu) {\n\t\t\n\t\tif(cu.getStorage().get().getFileName().equals(\"package-info.java\")) {\n\t\t\tthis.packageInfo = cu;\n\t\t}else {\n\t\t\tthis.cus.add(cu);\n\t\t}\n\t\tfor(TypeDeclaration<?> node : cu.findAll(TypeDeclaration.class)) {\n\t\t\tthis.classes.put(node.getNameAsString(), new ClassAST(node, this));\n\t\t}\n\t}", "public boolean compile() {\n String sourceFile = source.getAbsolutePath();\n String destFile;\n try {\n destFile = destFilename(sourceFile);\n } catch (InvalidNameException e) {\n LOG.fatal(\"Wrong extension name (not .deca)\");\n System.err.println(\"Error : source file extension is not .deca\");\n return true;\n }\n\n PrintStream err = System.err;\n PrintStream out = System.out;\n LOG.debug(\"Compiling file \" + sourceFile + \" to assembly file \" + destFile);\n try {\n return doCompile(sourceFile, destFile, out, err);\n } catch (LocationException e) {\n e.display(err);\n return true;\n } catch (DecacFatalError e) {\n err.println(e.getMessage());\n return true;\n } catch (StackOverflowError e) {\n LOG.debug(\"stack overflow\", e);\n err.println(\"Stack overflow while compiling file \" + sourceFile + \".\");\n return true;\n } catch (Exception e) {\n LOG.fatal(\"Exception raised while compiling file \" + sourceFile\n + \":\", e);\n err.println(\"Internal compiler error while compiling file \" + sourceFile + \", sorry.\");\n return true;\n } catch (AssertionError e) {\n LOG.fatal(\"Assertion failed while compiling file \" + sourceFile\n + \":\", e);\n err.println(\"Internal compiler error while compiling file \" + sourceFile + \", sorry.\");\n return true;\n }\n }", "@Override\n\tpublic void compile() {\n\t\t\n\t}", "public Class<?> getSource() {\r\n \t\treturn source;\r\n \t}", "protected Set<SModule> processModuleFiles(SRepository repo, final Collection<File> moduleSourceDescriptorFiles) {\n Set<SModule> modules = new LinkedHashSet<SModule>();\n\n // XXX need a way to figure which FS to use here. Technically, it should come from a project as we are going to\n // use these modules as part of the project. OTOH, we know these are local FS files.\n final IFileSystem fs = myEnvironment.getPlatform().findComponent(VFSManager.class).getFileSystem(VFSManager.FILE_FS);\n DescriptorIOFacade descriptorIOFacade = myEnvironment.getPlatform().findComponent(DescriptorIOFacade.class);\n final ModulesMiner mminer = new ModulesMiner(Collections.<IFile>emptySet(), descriptorIOFacade);\n for (File df : CollectionSequence.fromCollection(moduleSourceDescriptorFiles)) {\n IFile descriptorFile = fs.getFile(df);\n if (descriptorIOFacade.fromFileType(descriptorFile) == null) {\n info(String.format(\"File %s doesn't point to module descriptor, ignored\", moduleSourceDescriptorFiles));\n continue;\n }\n mminer.collectModules(descriptorFile);\n }\n ModuleRepositoryFacade mrf = new ModuleRepositoryFacade(repo);\n final SRepositoryExt repoExt = ((SRepositoryExt) mrf.getRepository());\n for (ModulesMiner.ModuleHandle mh : mminer.getCollectedModules()) {\n // seems reasonable just to instantiate a module here and leave its registration to caller\n // however, at the moment, Generator modules need access to their source Language module, which they look up in the repository\n SModule module = repoExt.registerModule(mrf.instantiate(mh.getDescriptor(), mh.getFile()), myOwner);\n info(\"Loaded module \" + module);\n modules.add(module);\n }\n return modules;\n }", "private void buildClass(ast.classs.Class c) {\r\n\t\tthis.classTable.put(c.id, new ClassBinding(c.extendss));\r\n\t\tfor (ast.dec.T dec : c.decs) {\r\n\t\t\tast.dec.Dec d = (ast.dec.Dec) dec;\r\n\t\t\tthis.classTable.put(c.id, d.id, d.type, d.lineNum);\r\n\t\t}\r\n\t\tfor (ast.method.T method : c.methods) {\r\n\t\t\tast.method.Method m = (ast.method.Method) method;\r\n\t\t\tthis.classTable.put(c.id, m.id,\r\n\t\t\t\t\tnew MethodType(m.retType, m.formals));\r\n\t\t}\r\n\t}", "public void run() throws Exception {\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tStandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n\t\tPath tempFolder = Files.createTempDirectory(\"gwt-jackson-apt-tmp\", new FileAttribute[0]);\n\t\tfileManager.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tfileManager.setLocation(StandardLocation.SOURCE_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tCompilationTask task = compiler.getTask(\n\t\t\t\tnew PrintWriter(System.out), \n\t\t\t\tfileManager, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tfileManager.getJavaFileObjects(\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicTest.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseInterface.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass2.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SimpleGenericBeanObject.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicGenericClass.java\")));\n\n\n\t\ttask.setProcessors(Arrays.asList(new ObjectMapperProcessor()));\n\t\ttask.call();\n\t}", "java.util.List<java.lang.String>\n getSourceFileList();", "@SuppressWarnings(\"deprecation\")\n\tprotected CompilationUnit internal_parseCompilationUnit(final ITypeRoot source) {\n\t\t// Code parsing : here is indicated the version of JDK (~JLS) to\n\t\t// consider, see Class comments\n\t\tASTParser parser = ASTParser.newParser(AST.JLS3);\n\t\tparser.setResolveBindings(true);\n\t\tparser.setSource(source);\n\t\t\n\t\t// >>> optimization: already ignore method bodies on parsing\n\t\tparser.setIgnoreMethodBodies(isIgnoreMethodBodies());\n\t\t// <<<\n\t\t\n\t\tCompilationUnit parsedCompilationUnit = (CompilationUnit) parser.createAST(null);\n\t\treturn parsedCompilationUnit;\n\t}", "CompilationBuilder(CharSequence source, String name, CompilerConfiguration compilerConfiguration) {\n\t\tif(source==null) throw new IllegalArgumentException(\"The passed source text was null\");\n\t\tif(name==null) name = \"WatchTowerGroovy\" + syntheticNameSerial.incrementAndGet();\n\t\tthis.compilerConfiguration = compilerConfiguration!=null ? compilerConfiguration : new CompilerConfiguration(CompilerConfiguration.DEFAULT);\t\t\n\t\ttry {\n\t\t\tcodeSource = new GroovyCodeSource(source.toString(), name, \"watchtower\");\n\t\t} catch (Exception ex) {\n\t\t\tthrow new RuntimeException(\"Failed to create GroovyCodeSource from [\" + name + \"/\" + source + \"]\", ex);\n\t\t}\n\t}", "private void installBasicClasses() {\n \tAbstractSymbol filename \n \t = AbstractTable.stringtable.addString(\"<basic class>\");\n \t\n \t// The following demonstrates how to create dummy parse trees to\n \t// refer to basic Cool classes. There's no need for method\n \t// bodies -- these are already built into the runtime system.\n \n \t// IMPORTANT: The results of the following expressions are\n \t// stored in local variables. You will want to do something\n \t// with those variables at the end of this method to make this\n \t// code meaningful.\n \n \t// The Object class has no parent class. Its methods are\n \t// cool_abort() : Object aborts the program\n \t// type_name() : Str returns a string representation \n \t// of class name\n \t// copy() : SELF_TYPE returns a copy of the object\n \n \tclass_c Object_class = \n \t new class_c(0, \n \t\t TreeConstants.Object_, \n \t\t TreeConstants.No_class,\n \t\t new Features(0)\n \t\t\t .appendElement(new method(0, \n \t\t\t\t\t TreeConstants.cool_abort, \n \t\t\t\t\t new Formals(0), \n \t\t\t\t\t TreeConstants.Object_, \n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.type_name,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.copy,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \t\n \t// The IO class inherits from Object. Its methods are\n \t// out_string(Str) : SELF_TYPE writes a string to the output\n \t// out_int(Int) : SELF_TYPE \" an int \" \" \"\n \t// in_string() : Str reads a string from the input\n \t// in_int() : Int \" an int \" \" \"\n \n \tclass_c IO_class = \n \t new class_c(0,\n \t\t TreeConstants.IO,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.out_string,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Str)),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.out_int,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Int)),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.in_string,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.in_int,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// The Int class has no methods and only a single attribute, the\n \t// \"val\" for the integer.\n \n \tclass_c Int_class = \n \t new class_c(0,\n \t\t TreeConstants.Int,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// Bool also has only the \"val\" slot.\n \tclass_c Bool_class = \n \t new class_c(0,\n \t\t TreeConstants.Bool,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// The class Str has a number of slots and operations:\n \t// val the length of the string\n \t// str_field the string itself\n \t// length() : Int returns length of the string\n \t// concat(arg: Str) : Str performs string concatenation\n \t// substr(arg: Int, arg2: Int): Str substring selection\n \n \tclass_c Str_class =\n \t new class_c(0,\n \t\t TreeConstants.Str,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.str_field,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.length,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.concat,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg, \n \t\t\t\t\t\t\t\t TreeConstants.Str)),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.substr,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Int))\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg2,\n \t\t\t\t\t\t\t\t TreeConstants.Int)),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t/* Do somethind with Object_class, IO_class, Int_class,\n Bool_class, and Str_class here */\n nameToClass.put(TreeConstants.Object_.getString(), Object_class);\n nameToClass.put(TreeConstants.IO.getString(), IO_class);\n nameToClass.put(TreeConstants.Int.getString(), Int_class);\n nameToClass.put(TreeConstants.Bool.getString(), Bool_class);\n nameToClass.put(TreeConstants.Str.getString(), Str_class);\n adjacencyList.put(TreeConstants.Object_.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.IO.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Int.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Bool.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Str.getString(), new ArrayList<String>() );\n // Do the same for other basic classes\n basicClassList = new Classes(0);\n basicClassList.appendElement(Object_class);\n basicClassList.appendElement(IO_class);\n basicClassList.appendElement(Int_class);\n basicClassList.appendElement(Bool_class);\n basicClassList.appendElement(Str_class);\n \n }", "@Override\n\t\tpublic CompilationUnitTree process(CompilationUnitTree source) throws Exception {\n\t\t\treturn null;\n\t\t}", "protected void compile(String[] args) {\n String[] commandArray = null;\n File tmpFile = null;\n\n try {\n String myos = System.getProperty(\"os.name\");\n\n\n if (myos.toLowerCase().indexOf(\"windows\") >= 0 \n && args.length > 250) {\n PrintWriter out = null;\n try {\n tmpFile = new File(\"jikes\"+(new Random(System.currentTimeMillis())).nextLong());\n out = new PrintWriter(new FileWriter(tmpFile));\n for (int i = 0; i < args.length; i++) {\n out.println(args[i]);\n }\n out.flush();\n commandArray = new String[] { command, \n \"@\" + tmpFile.getAbsolutePath()};\n } catch (IOException e) {\n throw new BuildException(\"Error creating temporary file\", e);\n } finally {\n if (out != null) {\n try {out.close();} catch (Throwable t) {}\n }\n }\n } else {\n commandArray = new String[args.length+1];\n commandArray[0] = command;\n System.arraycopy(args,0,commandArray,1,args.length);\n }\n \n try {\n Execute exe = new Execute(jop);\n exe.setAntRun(project);\n exe.setWorkingDirectory(project.getBaseDir());\n exe.setCommandline(commandArray);\n exe.execute();\n } catch (IOException e) {\n throw new BuildException(\"Error running Jikes compiler\", e);\n }\n } finally {\n if (tmpFile != null) {\n tmpFile.delete();\n }\n }\n }", "public static <T extends PathVertexVisitor> List<Result<T>> walkPaths(\n GraphTraversalSource g, String sourceCode) {\n return walkPaths(g, new String[] {sourceCode});\n }", "private static List<String> getJavasSourceCodeFiels(Map<String,Object> map){\r\n \t\t\r\n \t\t\r\n \t\tSystem.out.println(\"............\");\r\n \t\tLinkedList<String> list = new LinkedList<String>();\r\n \t\tfor(String key : map.keySet()){\r\n \t\t\tObject o = map.get(key);\r\n \r\n \t\t\t//package...\r\n \t\t\tif(o instanceof IPackageFragment){\r\n \t\t\t\t//System.out.println(\"Package --> \" + key);\r\n \t\t\t\tkey = key.substring(0,key.indexOf('[')).trim();\r\n \t\t\t\tkey = PACKAGE + \"(\" + key + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t\t//class...\r\n \t\t\tif(o instanceof ICompilationUnit){\r\n \t\t\t\t//System.out.println(\"Class --> \" + key);\r\n \t\t\t\tString classname = key.substring(0,key.indexOf('[')).trim();\r\n \t\t\t\tString packagename = key.substring(key.indexOf(PACKAGE),key.indexOf('\\n',key.indexOf(PACKAGE)));\r\n \t\t\t\tkey = CLASS_WITH_MEMBERS + \"(\" + packagename + \",\" + classname + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}//method\r\n \t\t\tif(o instanceof IMethod){\r\n \t\t\t\tSystem.out.println(\"Methode --> \" + key);\r\n \t\t\t\tkey = METHOD + \"(\" + getQueryFromMethod((IMethod)o) + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(o instanceof IField){\r\n \t\t\t\tSystem.out.println(\"Attribut --> \" + key);\r\n \t\t\t\tkey = FIELD + \"(\" + getQueryFromField((IField)o) + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn list;\r\n \t\t\r\n \t\t\r\n \t\t/*\r\n \t\tfor(String key : map.keySet()){\r\n \t\t\tObject o = map.get(key);\r\n \t\t\t//if(o instanceof ISourceAttribute)\r\n \t\t\t\t//System.out.println(\"attribute\");\r\n \t\t\t//if(o instanceof ISourceMethod)\r\n \t\t\t\t//System.out.println(\"methode\");\r\n \t\t\tif(o instanceof IPackageFragment) \r\n \t\t\t\tSystem.out.println(\"Package\");\r\n \t\t\tif(o instanceof ICompilationUnit)\r\n \t\t\t\tSystem.out.println(\"sour code file\");\r\n \t\t\t\t\r\n \t\t\t//\"oldquery or class('voller packagename', klassenname)\"\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\tif(o instanceof IField)\r\n \t\t\t\tSystem.out.println(\"Attribut\");\r\n \t\t\tif(o instanceof IType)\r\n \t\t\t\tSystem.out.println(\"classe also class ... in einem file\");\r\n \t\t\tif(o instanceof IMethod)\r\n \t\t\t\tSystem.out.println(\"Methode\");\r\n \t\t\tif(o instanceof IPackageFragmentRoot) \r\n \t\t\t\tSystem.out.println(\"jar package / src Ordner\");\r\n \t\t\tif(o instanceof IProject)\r\n \t\t\t\tSystem.out.println(\"Projekt Ordner\");\r\n \t\t\tif(o instanceof IClassFile)\r\n \t\t\t\tSystem.out.println(\"ClassFile\");\r\n \t\t\tif(o instanceof IAdaptable) //trieft auch auf viele ander sachen zu\r\n \t\t\t\tSystem.out.println(\"Libaraycontainer\");\r\n \t\t\tif(o instanceof IFile)\r\n \t\t\t\tSystem.out.println(\"file\"); //je nach ausgewlter ansicht knnen file auch *.java datein sein\r\n \t\t\tif(o instanceof IFolder)\r\n \t\t\t\tSystem.out.println(\"folder\");\r\n \t\t\tSystem.out.println(o.getClass());\r\n \t\t\t\r\n \t\r\n \t\t}\r\n \t\treturn null;\r\n \t\t*/\r\n \t}", "private List<JCTree> makeClassFunctionProxyMethods(JFXClassDeclaration cDecl, List<MethodSymbol> needDispatch) {\n ListBuffer<JCTree> methods = ListBuffer.lb();\n for (MethodSymbol sym : needDispatch) {\n appendMethodClones(methods, cDecl, sym, true);\n }\n return methods.toList();\n }", "private IClasspathEntry[] removeSourceClasspath(IClasspathEntry[] entries, IContainer folder) {\n if (folder == null) {\n return entries;\n }\n IClasspathEntry source = JavaCore.newSourceEntry(folder.getFullPath());\n int n = entries.length;\n for (int i = n - 1; i >= 0; i--) {\n if (entries[i].equals(source)) {\n IClasspathEntry[] newEntries = new IClasspathEntry[n - 1];\n if (i > 0) System.arraycopy(entries, 0, newEntries, 0, i);\n if (i < n - 1) System.arraycopy(entries, i + 1, newEntries, i, n - i - 1);\n n--;\n entries = newEntries;\n }\n }\n return entries;\n }", "FileCollection getGeneratedSourcesDirs();", "public interface CompilerTestCase {\n\t/**\n * Retrieve the list of files whose compilation would be tested.\n * @return a list of files in relative or absolute position.\n */\n public String[] getClassesToCompile();\n \n /**\n * Perform the test.\n * \n * @param diagnostics the compiler diagnostics for the evaluated files.\n * @param stdoutS the output of the compiler.\n * @param result the result of the compilation. True if succeeded, false if not.\n */\n public void test(List<Diagnostic<? extends JavaFileObject>> diagnostics, String stdoutS, Boolean result);\n\n}", "private void connectClasses(Header [] list)\r\n {\r\n Vector queue;\r\n Vector garbage = new Vector();\r\n\r\n Find.setCrossreference(list);\r\n\r\n for(int i = 0; list != null && i < list.length; i++)\r\n {\r\n queue = list[i].scopes;\r\n\r\n for(int j = 0; j < queue.size(); j++)\r\n for(Iterator iter = ((Scope)queue.get(j)).iterator(); iter.hasNext();)\r\n {\r\n Iterator a = null;\r\n Basic x = (Basic)iter.next();\r\n\r\n if (x instanceof ClassType)\r\n {\r\n ClassType y = (ClassType)x;\r\n ClassType [] z;\r\n boolean done = false;\r\n String st = null;\r\n\r\n if (y.extend != null && y.extend.name != null && y.extend.scope == null)\r\n { // look for superclass\r\n st = y.extend.name.string;\r\n for(a = y.unresolved.iterator(); a.hasNext();)\r\n {\r\n String s = (String)a.next();\r\n if (s.endsWith('.' + st))\r\n {\r\n st = s;\r\n break;\r\n }\r\n }\r\n\r\n z = Find.findClass(st, 0, y.scope);\r\n \r\n for(int k = 0; k < z.length; k++)\r\n if (z[k].scope.javaPath(\"\").endsWith(st) || z[k].scope.buildPath(\"\").endsWith(st))\r\n {\r\n y.extend = z[k];\r\n garbage.add(st);\r\n done = true;\r\n }\r\n }\r\n\r\n for(int k = 0; k < y.implement.length; k++)\r\n if (y.implement[k].name != null && y.implement[k].scope == null)\r\n { // look for interface\r\n st = y.implement[k].name.string;\r\n for(a = y.unresolved.iterator(); a.hasNext();)\r\n {\r\n String s = (String)a.next();\r\n if (s.endsWith('.' + st))\r\n {\r\n st = s;\r\n break;\r\n }\r\n }\r\n done = false;\r\n \r\n z = Find.findClass(st, 0, y.scope);\r\n \r\n for(int l = 0; l < z.length && !done; l++)\r\n if (z[l].scope.javaPath(\"\").endsWith(st) || z[l].scope.buildPath(\"\").endsWith(st))\r\n {\r\n y.implement[k] = z[l];\r\n garbage.add(st);\r\n done = true;\r\n break;\r\n }\r\n }\r\n\r\n a = null;\r\n while(garbage.size() > 0)\r\n {\r\n st = (String)garbage.get(0);\r\n garbage.remove(0);\r\n y.unresolved.remove(st);\r\n }\r\n }\r\n }\r\n }\r\n }", "private void scanClass(String scanPackage) {\n URL url = this.getClass().getClassLoader().getResource(\"/\" + scanPackage.replaceAll(\"\\\\.\", \"/\"));\n File dir = new File(url.getFile());\n for (File file : dir.listFiles()) {\n if (file.isDirectory()) {\n scanClass(scanPackage + \".\" + file.getName());\n } else {\n classNames.add(scanPackage + \".\" + file.getName().replaceAll(\".class\", \"\").trim());\n }\n }\n\n }", "public static void main(String[] args) {\n\r\n\t\tFile sourceFileListing = new File(\"files/SortedSourceFilePathsTMP.txt\");\r\n\t\tSourceFileIterator sourceFileIterator = new SourceFileIterator(\r\n\t\t\t\tsourceFileListing);\r\n\t\tcountStatements(sourceFileIterator);\r\n\t\tcountClasses(sourceFileIterator);\r\n\t\t// countSystemOuts(sourceFileListing);\r\n\t}", "private void traverseSourceFiles(IResource[] members) {\n\t\tfor (int index = 0; index < members.length; index++) {\n\t\t\tif (monitor.isCanceled()) { // return if cancel is requested\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tIResource resource = members[index];\n\t\t\tif (resource instanceof IContainer) {\n\t\t\t\tIContainer container = (IContainer) resource;\n\t\t\t\tIResource[] newMembers = null;\n\t\t\t\ttry {\n\t\t\t\t\tnewMembers = container.members();\n\t\t\t\t} catch (CoreException e) {\n\t\t\t\t\tSystem.out.println(\"Could not access members \"\n\t\t\t\t\t\t\t+ \"of the container \" + container.getFullPath()\n\t\t\t\t\t\t\t+ \".\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\ttraverseSourceFiles(newMembers);\n\t\t\t}\n\t\t\tif (resource instanceof IFile) {\n\t\t\t\tastEngine = new ASTEngine((IFile) resource, this, mode, pattern);\n\t\t\t\tastEngine.traverseSource();\n\t\t\t\tmonitor.worked(1);\n\t\t\t}\n\t\t}\n\t}", "public void compile(String str) throws PaleoException {\n\t\trunProcess(\"javac paleo/\" + str + \".java\");\n\t\tif (erreur.length() != 0) {\n\t\t\tthrow new JavacException(erreur.toString());\n\t\t}\n\t}", "public static ImmutableList<CxxSource> resolveCxxSources(\n ImmutableMap<String, SourcePath> sources) {\n\n ImmutableList.Builder<CxxSource> cxxSources = ImmutableList.builder();\n\n // For each entry in the input C/C++ source, build a CxxSource object to wrap\n // it's name, input path, and output object file path.\n for (ImmutableMap.Entry<String, SourcePath> ent : sources.entrySet()) {\n cxxSources.add(\n new CxxSource(\n ent.getKey(),\n ent.getValue()));\n }\n\n return cxxSources.build();\n }", "private List<Class<?>> getClasses(String packageName) throws Exception {\n File directory = null;\n try {\n ClassLoader cld = getClassLoader();\n URL resource = getResource(packageName, cld);\n directory = new File(resource.getFile());\n } catch (NullPointerException ex) {\n throw new ClassNotFoundException(packageName + \" (\" + directory\n + \") does not appear to be a valid package\");\n }\n return collectClasses(packageName, directory);\n }", "public SourceLister() {\n this(defaultSrcDirs);\n }", "public void compile(MindFile f) {\n \t\t\n \t}", "public void buildFromCollection(List<? extends T> source) {\r\n\t\tsource.stream()\r\n\t\t\t\t.forEach(item -> addElement(item));\r\n\t}", "@NotNull\n List<? extends ClassInfo> getAllClasses();", "private List<String> runCode(JasminBytecode code) throws AssembleException {\n // Turn the Jasmin code into a (hopefully) working class file\n if (code == null) {\n throw new AssembleException(\"No valid Jasmin code to assemble\");\n }\n AssembledClass aClass = AssembledClass.assemble(code);\n // Run the class and return the output\n SandBox s = new SandBox();\n s.runClass(aClass);\n return s.getOutput();\n }" ]
[ "0.63847995", "0.635453", "0.6010189", "0.5953491", "0.5820217", "0.5797035", "0.569459", "0.55566984", "0.5522308", "0.5455462", "0.5430017", "0.54156154", "0.53269994", "0.5325674", "0.52267855", "0.5215708", "0.5212559", "0.51886773", "0.51804507", "0.5158696", "0.5117591", "0.509755", "0.5025956", "0.5014035", "0.5004053", "0.50013036", "0.4994596", "0.49878857", "0.4983255", "0.49520338", "0.49440628", "0.494355", "0.4895915", "0.48610815", "0.4849152", "0.48285508", "0.48140225", "0.48037797", "0.47752044", "0.47724676", "0.47517654", "0.4751714", "0.4732703", "0.47318402", "0.47306514", "0.47306514", "0.472258", "0.4717999", "0.47069934", "0.4706455", "0.4683028", "0.46692902", "0.46633667", "0.4659359", "0.46556658", "0.46545142", "0.46335647", "0.46326157", "0.4629543", "0.46190095", "0.46184546", "0.46140313", "0.4611809", "0.4602771", "0.45970455", "0.45962003", "0.45907632", "0.45802265", "0.45789656", "0.45749605", "0.4565288", "0.45588824", "0.45525348", "0.45461002", "0.452502", "0.4522754", "0.4516938", "0.45104042", "0.45077652", "0.4493575", "0.44763532", "0.4474322", "0.44721922", "0.44685626", "0.44612423", "0.44571206", "0.4455434", "0.444865", "0.44391692", "0.44388273", "0.44379014", "0.44371665", "0.44370025", "0.44291118", "0.44265953", "0.44255272", "0.44219643", "0.44208655", "0.44206944", "0.44170934" ]
0.56236154
7
Compiles classes in given source. The resulting .class files are added to an internal list which can be later retrieved by getClassFiles()
public boolean compile(String source, boolean generate) { CompilerOptions options = getDefaultCompilerOptions(); ICompilerRequestor requestor = this; IErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems(); IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault()); Source[] units = new Source[1]; units[0] = new Source(source); units[0].setName(); options.generateClassFiles = generate; org.eclipse.jdt.internal.compiler.Compiler compiler = new org.eclipse.jdt.internal.compiler.Compiler( new CompilerAdapterEnvironment(environment, units[0]), policy, options, requestor, problemFactory); compiler.compile(units); return getResult().hasErrors(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] getClassesToCompile();", "private Path compileTestClass(\n String packageName, String classname, String classSource, Path destinationDir)\n throws FileCompiler.FileCompilerException {\n // TODO: The use of FileCompiler is temporary. Should be replaced by use of SequenceCompiler,\n // which will compile from source, once it is able to write the class file to disk.\n Path sourceFile;\n try {\n sourceFile = javaFileWriter.writeClassCode(packageName, classname, classSource);\n } catch (RandoopOutputException e) {\n throw new RandoopBug(\"Output error during flaky-test filtering\", e);\n }\n FileCompiler fileCompiler = new FileCompiler();\n fileCompiler.compile(sourceFile, destinationDir);\n return sourceFile;\n }", "public Class[] generateAllClasses(\n CompilationSource source,\n String... doPaths) throws DataObjectException, NullPointerException, IllegalArgumentException {\n\n //\n return new DataObjectCompiler(source, doPaths).generateAllClasses();\n }", "public WorkResult execute() {\n source = new SimpleFileCollection(source.getFiles());\n classpath = new SimpleFileCollection(Lists.newArrayList(classpath));\n\n for (File file : source) {\n if (!file.getName().endsWith(\".java\")) {\n throw new InvalidUserDataException(String.format(\"Cannot compile non-Java source file '%s'.\", file));\n }\n }\n configure(compiler);\n return compiler.execute();\n }", "public Set<String> getJavaSourceListing() {\n Set<String> javasrcs = new TreeSet<String>();\n \n String javasrc;\n for(String classname: classlist) {\n if(classname.contains(\"$\")) {\n continue; // skip (inner classes don't have a direct 1::1 java source file\n }\n \n javasrc = classname.replaceFirst(\"\\\\.class$\", \".java\");\n javasrcs.add(javasrc);\n }\n \n return javasrcs;\n }", "public boolean compile(String name, String source) {\n\t return compile(source);\n\t}", "public Map<String, Class<?>> generateClasses(CompilationSource source,\n String... doPaths) throws DataObjectException, NullPointerException, IllegalArgumentException {\n\n //\n return new DataObjectCompiler(source, doPaths).generateClasses();\n }", "public List<ClassDescription> scanSources()\n throws SCRDescriptorFailureException, SCRDescriptorException {\n final List<ClassDescription> result = new ArrayList<ClassDescription>();\n\n for (final Source src : project.getSources()) {\n if ( src.getFile().getName().equals(\"package-info.java\") ) {\n log.debug(\"Skipping file \" + src.getClassName());\n continue;\n }\n log.debug(\"Scanning class \" + src.getClassName());\n\n try {\n // load the class\n final Class<?> annotatedClass = project.getClassLoader().loadClass(src.getClassName());\n\n this.process(annotatedClass, src, result);\n } catch ( final SCRDescriptorFailureException e ) {\n throw e;\n } catch ( final SCRDescriptorException e ) {\n throw e;\n } catch ( final ClassNotFoundException e ) {\n log.warn(\"ClassNotFoundException: \" + e.getMessage());\n } catch ( final NoClassDefFoundError e ) {\n log.warn(\"NoClassDefFoundError: \" + e.getMessage());\n } catch (final Throwable t) {\n throw new SCRDescriptorException(\"Unable to load compiled class: \" + src.getClassName(), src.getFile().toString(), t);\n }\n }\n return result;\n }", "private void compileJavaFiles(File binDir, File javaFile) throws Exception {\n\t\tPathAssert.assertFileExists(\"Java Source\", javaFile);\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tLinkedList<File> classpath = ClassPathUtil.getClassPath();\n\t\tclasspath.add(0, binDir);\n\t\tStringBuilder cp = new StringBuilder();\n\t\tClassPathUtil.appendClasspath(cp, classpath);\n\t\tif (compiler.run(null, System.out, System.err, \"-cp\", cp.toString(), javaFile.getAbsolutePath()) != 0) {\n\t\t\tthrow new Exception(\"Exception while compiling file\");\n\t\t}\n\t}", "public boolean compile(String source) {\n\t return compile(source, true);\n\t}", "private void buildClassPath() throws InterruptedException, IOException, CheckedAnalysisException {\n IClassPathBuilder builder = classFactory.createClassPathBuilder(bugReporter);\n\n for (String path : project.getFileArray()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), true);\n }\n for (String path : project.getAuxClasspathEntryList()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), false);\n }\n\n builder.scanNestedArchives(analysisOptions.scanNestedArchives);\n\n builder.build(classPath, progress);\n\n appClassList = builder.getAppClassList();\n\n if (PROGRESS) {\n System.out.println(appClassList.size() + \" classes scanned\");\n }\n\n // If any of the application codebases contain source code,\n // add them to the source path.\n // Also, use the last modified time of application codebases\n // to set the project timestamp.\n for (Iterator<? extends ICodeBase> i = classPath.appCodeBaseIterator(); i.hasNext();) {\n ICodeBase appCodeBase = i.next();\n\n if (appCodeBase.containsSourceFiles()) {\n String pathName = appCodeBase.getPathName();\n if (pathName != null) {\n project.addSourceDir(pathName);\n }\n }\n\n project.addTimestamp(appCodeBase.getLastModifiedTime());\n }\n\n }", "void compileToJava();", "List<String> getClassNames() {\n List<String> allGeneratedClasses = new ArrayList<String>();\n for (int i = 0; i < classesToScan.size(); i++) {\n String lookupName = classesToScan.get(i);\n byte classBytes[] = getClassBytes(lookupName);\n if (classBytes == null) {\n /*\n * Weird case: javac might generate a name and reference the class in\n * the bytecode but decide later that the class is unnecessary. In the\n * bytecode, a null is passed for the class.\n */\n continue;\n }\n \n /*\n * Add the class to the list only if it can be loaded to get around the\n * javac weirdness issue where javac refers a class but does not\n * generate it.\n */\n if (CompilingClassLoader.isClassnameGenerated(lookupName)\n && !allGeneratedClasses.contains(lookupName)) {\n allGeneratedClasses.add(lookupName);\n }\n AnonymousClassVisitor cv = new AnonymousClassVisitor();\n new ClassReader(classBytes).accept(cv, 0);\n List<String> innerClasses = cv.getInnerClassNames();\n for (String innerClass : innerClasses) {\n // The innerClass has to be an inner class of the lookupName\n if (!innerClass.startsWith(mainClass + \"$\")) {\n continue;\n }\n /*\n * TODO (amitmanjhi): consider making this a Set if necessary for\n * performance\n */\n // add the class to classes\n if (!classesToScan.contains(innerClass)) {\n classesToScan.add(innerClass);\n }\n }\n }\n Collections.sort(allGeneratedClasses, new GeneratedClassnameComparator());\n return allGeneratedClasses;\n }", "public Header [] compilationUnit(Header [] loaded, final int depth)\r\n {\r\n\ttry\r\n\t{\r\n this.depth = depth;\r\n String trunc = sources.getPath();\r\n list = loaded == null?new Header[0]:loaded;\r\n countToken = 0;\r\n \r\n Find.notePass(null);\r\n \r\n lookAhead();\r\n\r\n // read package name\r\n String myPackage = null;\r\n if (nextSymbol == Keyword.PACKAGESY)\r\n {\r\n lookAhead();\r\n myPackage = qualident();\r\n matchKeyword(Keyword.SEMICOLONSY);\r\n }\r\n\r\n Header header = new Header(new File(Parser.jdkSource).getPath(), trunc, myPackage, depth);\r\n\r\n Vector imported = new Vector();\r\n imported.add(\"java.lang.\");\r\n\r\n // read import statements\r\n while (nextSymbol == Keyword.IMPORTSY)\r\n imported.add(importDeclaration());\r\n\r\n header.imports = new String[imported.size()];\r\n for(int l = 0; l < imported.size(); l++)\r\n header.imports[l] = (String)imported.get(l);\r\n\r\n trunc = trunc.substring(0, sources.getPath().lastIndexOf(\".java\"));\r\n String basename = trunc.substring(trunc.lastIndexOf('\\\\') + 1);\r\n\r\n scopeStack = header.scopes;\r\n\r\n while(nextSymbol != Keyword.EOFSY)\r\n typeDeclaration(header.base, basename);\r\n\r\n matchKeyword(Keyword.EOFSY);\r\n\r\n if (Errors.count() != 0)\r\n return null;\r\n\r\n // write valid header\r\n header.write(trunc + \".h\");\r\n\r\n // append compiled file to list\r\n Header [] newList = new Header[(list != null?list.length:0) + 1];\r\n\r\n for(int i = 0; i < newList.length - 1; i++)\r\n newList[i] = list[i];\r\n\r\n newList[newList.length - 1] = header;\r\n list = newList;\r\n connectClasses(list);\r\n\r\n // resolve superclasses and interfaces\r\n for(int i = 0; i < header.scopes.size() && list != null; i++)\r\n {\r\n Vector v = new Vector();\r\n Scope scope = (Scope)header.scopes.get(i);\r\n\r\n for(Iterator iter = scope.iterator(); iter.hasNext();)\r\n {\r\n Basic b = (Basic)iter.next();\r\n if (b instanceof ClassType)\r\n v = getExtendImplement((ClassType)b);\r\n }\r\n\r\n while(v.size() > 0 && list != null)\r\n {\r\n connectClasses(list);\r\n list = loadSource((String)v.get(0), list, header, force);\r\n v.remove(0);\r\n }\r\n }\r\n\r\n if (Errors.count() != 0 || header.depth > 0 || list == null)\r\n return list;\r\n\r\n // process imports\r\n for(int i = 0; i < imported.size() && list != null; i++)\r\n {\r\n String st = (String)imported.get(i);\r\n if (!st.endsWith(\".\"))\r\n {\r\n connectClasses(list);\r\n list = loadSource(st.substring(st.lastIndexOf('.') + 1), list, header, force);\r\n }\r\n }\r\n\r\n if (Errors.count() != 0 || header.depth > 0 || list == null)\r\n return list;\r\n\r\n connectClasses(list);\r\n // process unresolved references\r\n for(int i = 0; i < header.scopes.size() && list != null; i++)\r\n {\r\n Scope scope = (Scope)header.scopes.get(i);\r\n Iterator step = scope.iterator();\r\n while(step.hasNext() && list != null)\r\n {\r\n Basic x = (Basic)step.next();\r\n\r\n if (x instanceof ClassType)\r\n {\r\n boolean inner = false;\r\n ClassType y = (ClassType)x;\r\n\r\n while(y.unresolved.size() > 0 && list != null)\r\n {\r\n Iterator it = y.unresolved.iterator();\r\n if (!it.hasNext())\r\n break;\r\n String name = (String)it.next();\r\n it = null;\r\n y.unresolved.remove(name);\r\n String [] s = name.split(\"\\\\.\");\r\n Scope [] z = null;\r\n\r\n z = Find.find(s[0], scope, true);\r\n\r\n if (z.length == 0)\r\n {\r\n list = loadSource(s[0], list, header, force);\r\n connectClasses(list);\r\n }\r\n try {\r\n if (s.length > 1)\r\n {\r\n ClassType [] classes = null;\r\n \r\n classes = Find.findClass(s[0], 0, scope);\r\n \r\n if (classes.length == 0)\r\n {\r\n classes = new ClassType[1];\r\n classes[0] = y;\r\n }\r\n for(int k = 1; k < s.length && classes.length > 0; k++)\r\n {\r\n Basic[] b = classes[0].scope.get(s[k]);\r\n for (int j = 0; j < b.length; j++)\r\n if (b[j] instanceof VariableType)\r\n {\r\n VariableType v = (VariableType) b[j];\r\n if (v.type.type == Keyword.NONESY)\r\n {\r\n classes = Find.findClass(v.type.ident.string, 0, scope);\r\n \r\n if (classes.length == 0)\r\n {\r\n y.unresolved.add(v.type.ident.string);\r\n //y.unresolved.add(name);\r\n }\r\n }\r\n else\r\n classes = new ClassType[0];\r\n break;\r\n }\r\n else if (b[j] instanceof MethodType)\r\n {\r\n MethodType v = (MethodType) b[j];\r\n if (v.type.type == Keyword.NONESY)\r\n {\r\n classes = Find.findClass(v.type.ident.string, 0, scope);\r\n \r\n if (classes.length == 0)\r\n {\r\n y.unresolved.add(v.type.ident.string);\r\n //y.unresolved.add(name);\r\n }\r\n }\r\n else\r\n classes = new ClassType[0];\r\n break;\r\n }\r\n else if (b[j] instanceof ClassType)\r\n {\r\n classes = new ClassType[1];\r\n classes[0] = (ClassType) b[j];\r\n break;\r\n }\r\n }\r\n }\r\n } catch(Exception ee){error(\"nullpointer \" + s[0] + '.' + s[1]);}\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (depth > 0)\r\n return list;\r\n\r\n if (Errors.count() != 0 || list == null)\r\n return null;\r\n\r\n connectClasses(list);\r\n \r\n Find.notePass(this);\r\n\r\n // resolve operator tree to Forth-code\r\n FileOutputStream file = null, starter = null;\r\n try\r\n {\r\n file = new FileOutputStream(header.name.substring(0, header.name.lastIndexOf('.')) + \".fs\");\r\n starter = new FileOutputStream(header.name.substring(0, header.name.lastIndexOf('.')) + \".start.fs\");\r\n System.out.println(\"translate \" + header.name);\r\n\r\n for(int k = 0; k < header.scopes.size(); k++)\r\n {\r\n Scope scope = (Scope)header.scopes.get(k);\r\n boolean module = (k == 0);\r\n for(Iterator iter = scope.iterator(); iter.hasNext();)\r\n {\r\n Basic b = (Basic)iter.next();\r\n if (b instanceof ClassType && (b.modify & Keyword.INTERFACESY.value) == 0)\r\n {\r\n if (gc.startsWith(\"m\"))\r\n CodeRCmodified.codeClass( (ClassType) b, file, starter, module);\r\n else\r\n Code3color.codeClass( (ClassType) b, file, starter, module);\r\n module = false;\r\n }\r\n }\r\n }\r\n\r\n file.close();\r\n starter.close();\r\n }\r\n catch(IOException ex1) { ex1.printStackTrace(); }\r\n \r\n Find.notePass(this);\r\n\t}\r\n\tcatch(Exception failed)\r\n\t{ error(failed.getMessage() + \" aborted\"); }\r\n \r\n return (Errors.count() != 0)?null:list;\r\n }", "Set<CompiledClass> getCompiledClasses() {\n if (!isCompiled()) {\n return null;\n }\n if (exposedCompiledClasses == null) {\n FindTypesInCud typeFinder = new FindTypesInCud();\n cud.traverse(typeFinder, cud.scope);\n Set<CompiledClass> compiledClasses = typeFinder.getClasses();\n exposedCompiledClasses = Sets.normalizeUnmodifiable(compiledClasses);\n }\n return exposedCompiledClasses;\n }", "public ClassNode source(String source) {\n $.sourceFile = source;\n return this;\n }", "public void compileScript( TemplateCompilerContext context )\r\n\t{\r\n\t\t// Compile to bytes\r\n\t\tCompilationUnit unit = new CompilationUnit();\r\n\t\tunit.addSource( context.getPath(), context.getScript().toString() );\r\n\t\tunit.compile( Phases.CLASS_GENERATION );\r\n\r\n\t\t// Results\r\n\t\t@SuppressWarnings( \"unchecked\" )\r\n\t\tList< GroovyClass > classes = unit.getClasses();\r\n\t\tAssert.isTrue( classes.size() > 0, \"Expecting 1 or more classes\" );\r\n\r\n\t\tClassLoader parent = Thread.currentThread().getContextClassLoader();\r\n\t\tif( parent == null )\r\n\t\t\tparent = GroovyTemplateCompiler.class.getClassLoader();\r\n\r\n\t\t// Define the class\r\n\t\t// TODO Configurable class loader\r\n\t\tDefiningClassLoader classLoader = new DefiningClassLoader( parent );\r\n\t\tClass< ? > first = null;\r\n\t\tfor( GroovyClass cls : classes )\r\n\t\t{\r\n\t\t\tClass< ? > clas = classLoader.defineClass( cls.getName(), cls.getBytes() );\r\n\t\t\tif( first == null )\r\n\t\t\t\tfirst = clas; // TODO Are we sure that the first one is always the right one?\r\n\t\t}\r\n\r\n\t\t// Instantiate the first\r\n\t\tGroovyObject object = (GroovyObject)Util.newInstance( first );\r\n\t\tClosure closure = (Closure)object.invokeMethod( \"getClosure\", null );\r\n\r\n\t\t// The old way:\r\n//\t\tClass< GroovyObject > groovyClass = new GroovyClassLoader().parseClass( new GroovyCodeSource( getSource(), getName(), \"x\" ) );\r\n\r\n\t\tcontext.setTemplate( new GroovyTemplate( closure ) );\r\n\t}", "protected void beginToCompile(org.eclipse.jdt.internal.compiler.env.ICompilationUnit[] sourceUnits, String[] bindingKeys) {\n int sourceLength = sourceUnits.length;\n int keyLength = bindingKeys.length;\n int maxUnits = sourceLength + keyLength;\n this.totalUnits = 0;\n this.unitsToProcess = new CompilationUnitDeclaration[maxUnits];\n int index = 0;\n // walks the source units\n this.requestedSources = new HashtableOfObject();\n for (int i = 0; i < sourceLength; i++) {\n org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit = sourceUnits[i];\n CompilationUnitDeclaration parsedUnit;\n CompilationResult unitResult = new CompilationResult(sourceUnit, index++, maxUnits, this.options.maxProblemsPerUnit);\n try {\n if (this.options.verbose) {\n this.out.println(Messages.bind(Messages.compilation_request, new String[] { String.valueOf(index++ + 1), String.valueOf(maxUnits), new String(sourceUnit.getFileName()) }));\n }\n // diet parsing for large collection of units\n if (this.totalUnits < this.parseThreshold) {\n parsedUnit = this.parser.parse(sourceUnit, unitResult);\n } else {\n parsedUnit = this.parser.dietParse(sourceUnit, unitResult);\n }\n // initial type binding creation\n this.lookupEnvironment.buildTypeBindings(parsedUnit, /*no access restriction*/\n null);\n addCompilationUnit(sourceUnit, parsedUnit);\n this.requestedSources.put(unitResult.getFileName(), sourceUnit);\n worked(1);\n } finally {\n // no longer hold onto the unit\n sourceUnits[i] = null;\n }\n }\n // walk the binding keys\n this.requestedKeys = new HashtableOfObject();\n for (int i = 0; i < keyLength; i++) {\n BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment);\n resolver.parse(/*pause after fully qualified name*/\n true);\n // If it doesn't have a type name, then it is either an array type, package or base type, which will definitely not have a compilation unit.\n // Skipping it will speed up performance because the call will open jars. (theodora)\n CompilationUnitDeclaration parsedUnit = resolver.hasTypeName() ? resolver.getCompilationUnitDeclaration() : null;\n if (parsedUnit != null) {\n char[] fileName = parsedUnit.compilationResult.getFileName();\n Object existing = this.requestedKeys.get(fileName);\n if (existing == null)\n this.requestedKeys.put(fileName, resolver);\n else if (existing instanceof ArrayList)\n ((ArrayList) existing).add(resolver);\n else {\n ArrayList list = new ArrayList();\n list.add(existing);\n list.add(resolver);\n this.requestedKeys.put(fileName, list);\n }\n } else {\n char[] key = resolver.hasTypeName() ? // binary binding\n resolver.getKey().toCharArray() : // package binding or base type binding\n CharOperation.concatWith(resolver.compoundName(), '.');\n this.requestedKeys.put(key, resolver);\n }\n worked(1);\n }\n // binding resolution\n this.lookupEnvironment.completeTypeBindings();\n }", "public void compileMutants() {\n\tif (classOp != null && classOp.length > 0) {\n\t Debug.println(\"* Compiling class mutants into bytecode\");\n\t MutationSystem.MUTANT_PATH = MutationSystem.CLASS_MUTANT_PATH;\n\t super.compileMutants();\n\t}\n }", "private static void compileAndRun(String fileName, String code) {\n\n if(verboseCompiling) println(\"Deleting old temp files...\", warning);\n new File(fileName + \".java\").delete();\n new File(fileName + \".class\").delete();\n\n if(verboseCompiling) println(\"Creating source file...\", progErr);\n file = new File(fileName + \".java\");\n\n if(verboseCompiling) println(\"Writing code to source file...\", progErr);\n try {\n new FileWriter(file).append(code).close();\n } catch (IOException i) {\n println(\"Had an IO Exception when trying to write the code. Stack trace:\", error);\n i.printStackTrace();\n return; //Exit on error\n }\n\n if(verboseCompiling) println(\"Compiling code...\", progErr);\n //This should only ever be called if the JDK isn't installed. How you'd get here, I don't know.\n if (compiler == null) {\n println(\"Fatal Error: JDK not installed. Go to java.sun.com and install.\", error);\n return;\n }\n\n //Tries to compile. Success code is 0, so if something goes wrong, report.\n int result = -1;\n if (compileOptions.trim().equals(\"\"))\n result = compiler.run(null, out, err, file.getAbsolutePath());\n else\n //result = compiler.run(null, out, err, compileOptions, file.getAbsolutePath());\n result = compiler.run(null, out, err, \"-cp\", \"/Users/student/Desktop/bluecove-2.1.0.jar\", file.getAbsolutePath());\n //ArrayList<String> files = new ArrayList<>();\n //files.add(fileName);\n //boolean result = compiler.getTask(null, null, new ErrorReporter(), null, files, null).call();\n if (result != 0) {\n displayLog();\n //println(\"end record\", error); //End recording and pull out the message\n\n //println(\"Error type: \" + result,error);\n println(\"Failed to compile.\", warning);\n return; //Return on error\n }\n\n if(verboseCompiling) println(\"Attempting to run code...\", progErr);\n try {\n //Makes sure the JVM resets if it's already running.\n if(JVMrunning) \n kill();\n\n //Clears terminal window on main method call.\n if(clearOnMethod)\n outputText.setText(\"\");\n\n //Some String constants for java path and OS-specific separators.\n String separator = System.getProperty(\"file.separator\");\n String path = System.getProperty(\"java.home\")\n + separator + \"bin\" + separator + \"java\";\n\n //Creates a new process that executes the source file.\n ProcessBuilder builder = null;\n if(runOptions.trim().equals(\"\")) \n builder = new ProcessBuilder(path, fileName);\n else \n builder = new ProcessBuilder(path, runOptions, fileName);\n\n //Everything should be good now. Everything past this is on you. Don't mess it up.\n println(\"Build succeeded on \" + java.util.Calendar.getInstance().getTime().toString(), progErr);\n println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\", progErr); \n\n //Tries to run compiled code.\n JVM = builder.start();\n JVMrunning = true;\n\n //Links runtime out/err to our terminal window. No support for input yet.\n Reader errorReader = new InputStreamReader(JVM.getErrorStream());\n Reader outReader = new InputStreamReader(JVM.getInputStream());\n //Writer inReader = new OutputStreamWriter(JVM.getOutputStream());\n\n redirectErr = redirectIOStream(errorReader, err);\n redirectOut = redirectIOStream(outReader, out);\n //redirectIn = redirectIOStream(null, inReader);\n } catch (IOException e) {\n //JVM = builder.start() can throw this.\n println(\"IOException when running the JVM.\", progErr);\n e.printStackTrace();\n displayLog();\n return;\n }\n }", "public void generateCode(String[] sourceCode) {\n LexicalAnalyser lexicalAnalyser = new LexicalAnalyser(Helper.getInstructionSet());\n SynaticAnalyser synaticAnalyser = new SynaticAnalyser(console);\n HashMap<Integer, Instruction> intermediateRepresentation =\n synaticAnalyser.generateIntermediateRepresentation(\n lexicalAnalyser.generateAnnotatedToken(sourceCode));\n\n if (intermediateRepresentation == null) {\n this.console.reportError(\"Terminating code generation\");\n return;\n }\n\n printCode(intermediateRepresentation);\n\n FileUtility.saveJavaProgram(null, new JavaProgramTemplate(intermediateRepresentation));\n }", "public List<String> codeAnalyse(List<String> srcLines) {\n\t\t// Initializes the return List\n\t\tList<String> listForCsv = new ArrayList<String>();\n\t\t\n\t\t// Declares main comment pattern\n\t\tPattern patComments = Pattern.compile(\"^\\\\*.*|//.*|/\\\\*.*\");\n\t\t\n\t\t/*\n\t\t * Initializes our metrics loc(Lines of code),\n\t\t * noc(Number of classes), nom(Number of methods)\n\t\t */\n\t\tint loc = 0;\n\t\tint noc = 0;\n\t\tint nom = 0;\n\t\t\n\t\t// Variable to check if the loop is inside a multiple line comment\n\t\tboolean multLine = false;\n\t\t\n\t\t// Looping through the lines of code\n\t\tfor (String line: srcLines) {\n\t\t\tMatcher matcher = patComments.matcher(line);\n\t\t\t// If line is not a comment\n\t\t\tif (!matcher.matches()) {\n\t\t\t\tif (multLine == false) {\n\t\t\t\t\t// Regex for checking if line represents the beginning of a class\n\t\t\t\t\tif (line.matches(\"(?:\\\\s*(public|private|native|abstract|strictfp|abstract\"\n\t\t\t\t\t\t\t+ \"|protected|final)\\\\s+)?(?:static\\\\s+)?class.*\")) {\n\t\t\t\t\t\t// If true then increases noc by 1\n\t\t\t\t\t\tnoc ++;\n\t\t\t\t\t}\n\t\t\t\t\t// Regex for checking if line represents the beginning of a method\n\t\t\t\t\tif (line.matches(\"((public|private|native|static|final|protected\"\n\t\t\t\t\t\t\t+ \"|abstract|transient)+\\\\s)+[\\\\$_\\\\w\\\\<\\\\>\\\\[\\\\]]*\\\\s+[\\\\$_\\\\w]+\\\\([^\"\n\t\t\t\t\t\t\t+ \"\\\\)]*\\\\)?\\\\s*\\\\{?[^\\\\}]*\\\\}?\")) {\n\t\t\t\t\t\t// If true then increases nom by 1\n\t\t\t\t\t\tnom ++;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * Line is not a comment neither a blank line(insured while\n\t\t\t\t\t * reading the file) so we add 1 to the loc variable\n\t\t\t\t\t */ \n\t\t\t\t\tloc ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Potential multiple line comment starter\n\t\t\tif (line.matches(\"/\\\\*.*\")) {\n\t\t\t\tmultLine = true;\n\t\t\t}\n\t\t\t// Potential multiple line comment ender\n\t\t\tif (line.matches(\".*\\\\*/.*$\")) {\n\t\t\t\tmultLine = false;\n\t\t\t}\n\t\t}\n\t\t// Adds metrics to the return list\n\t\tlistForCsv.add(String.valueOf(loc));\n\t\tlistForCsv.add(String.valueOf(noc));\n\t\tlistForCsv.add(String.valueOf(nom));\n\t\t\n\t\t// Returns the list\n\t\treturn listForCsv;\n\t}", "public boolean compile()\n {\n if(this.compiling.get())\n {\n return false;\n }\n\n this.componentEditor.removeAllTemporaryModification();\n\n final String text = this.componentEditor.getText();\n final Matcher matcher = CompilerEditorPanel.PATTERN_CLASS_DECLARATION.matcher(text);\n\n if(!matcher.find())\n {\n this.printMessage(\"No class declaration !\");\n return false;\n }\n\n final String className = matcher.group(1);\n\n if(this.classManager.isResolved(className))\n {\n this.classManager.newClassLoader();\n }\n\n this.compiling.set(true);\n this.actionCompile.setEnabled(false);\n this.printMessage(className);\n this.informationMessage.append(\"\\ncompiling ...\");\n final byte[] data = text.getBytes();\n final ByteArrayInputStream stream = new ByteArrayInputStream(data);\n this.classManager.compileASMs(this.eventManager, stream);\n return true;\n }", "protected JavaSource getJavaSourceForClass(String clazzname) {\n String resource = clazzname.replaceAll(\"\\\\.\", \"/\") + \".java\";\n FileObject fileObject = classPath.findResource(resource);\n if (fileObject == null) {\n return null;\n }\n Project project = FileOwnerQuery.getOwner(fileObject);\n if (project == null) {\n return null;\n }\n SourceGroup[] sourceGroups = ProjectUtils.getSources(project).getSourceGroups(\"java\");\n for (SourceGroup sourceGroup : sourceGroups) {\n return JavaSource.create(ClasspathInfo.create(sourceGroup.getRootFolder()));\n }\n return null;\n }", "public abstract void compile();", "private static void compileFile(String path) throws IOException {\n File f = new File(path);\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n File[] files = {f};\n Iterable<? extends JavaFileObject> compilationUnits =\n fileManager.getJavaFileObjectsFromFiles(Arrays.asList(files));\n compiler.getTask(null, fileManager, null, null, null, compilationUnits).call();\n fileManager.close();\n }", "void initClasses() {\n\t\tif (programUnit == null) return;\n\n\t\t// Add all classes\n\t\tList<BdsNode> cdecls = BdsNodeWalker.findNodes(programUnit, ClassDeclaration.class, true, true);\n\t\tfor (BdsNode n : cdecls) {\n\t\t\tClassDeclaration cd = (ClassDeclaration) n;\n\t\t\tbdsvm.addType(cd.getType());\n\t\t}\n\t}", "@InterfaceAudience.Public\n Reducer compileReduce(String source, String language);", "protected Class[] getSourceClassesImpl() throws Exception {\n\t\treturn null;\n\t}", "public JasminBytecode( String className ) {\n this.className = className;\n this.jasminCode = new ArrayList<>();\n }", "void compileClass() throws IOException {\n tagBracketPrinter(CLASS_TAG, OPEN_TAG_BRACKET);\n try {\n compileClassHelper();\n } catch (IOException e) {\n e.printStackTrace();\n }\n tagBracketPrinter(CLASS_TAG, CLOSE_TAG_BRACKET);\n\n }", "public String[] compile(String[] names) throws IOException {\n String[] compiled = super.compile(names);\n for (int j=0;j<names.length;j++) {\n syncSources(names[j]);\n }\n return compiled;\n }", "public static JavaSourceFolder of( _JavaFileModel... javaModels )\r\n {\r\n JavaSourceFolder sourceFolder = new JavaSourceFolder();\r\n sourceFolder.add( javaModels );\r\n return sourceFolder;\r\n }", "@SuppressWarnings(\"unchecked\")\n public void loadClasses(String pckgname) throws ClassNotFoundException {\n File directory = null;\n try {\n ClassLoader cld = Thread.currentThread().getContextClassLoader();\n String path = \"/\" + pckgname.replace(\".\", \"/\");\n URL resource = cld.getResource(path);\n if (resource == null) {\n throw new ClassNotFoundException(\"sem classes no package \" + path);\n }\n directory = new File(resource.getFile());\n }\n catch (NullPointerException x) {\n throw new ClassNotFoundException(pckgname + \" (\" + directory + \") package invalido\");\n }\n if (directory.exists()) {\n String[] files = directory.list();\n for (int i = 0; i < files.length; i++) {\n if (files[i].endsWith(\".class\") && !files[i].contains(\"$\")) {\n Class cl = Class.forName(pckgname + '.' + files[i].substring(0, files[i].length() - 6));\n Method methods[] = cl.getDeclaredMethods();\n boolean ok = false;\n for (Method m : methods) {\n if ((m.getReturnType().equals(List.class) || m.getReturnType().isArray()) && m.getParameterTypes().length == 0) {\n ok = true;\n break;\n }\n }\n if (ok) {\n classes.add(cl);\n }\n }\n }\n }\n else {\n throw new ClassNotFoundException(pckgname + \" package invalido\");\n }\n }", "private void parse() {\n try {\n SimpleNode rootNode = jmm.parseClass(sourcefile);\n assert rootNode.is(JJTPROGRAM);\n\n SimpleNode classNode = rootNode.jjtGetChild(0);\n assert classNode.is(JJTCLASSDECLARATION);\n\n data.classNode = classNode;\n } catch (FileNotFoundException e) {\n throw new CompilationException(e);\n } catch (ParseException e) {\n throw new CompilationException(\"Parsing Error: \" + e.getMessage(), e);\n }\n }", "private void scan() {\n if (classRefs != null)\n return;\n // Store ids rather than names to avoid multiple name building.\n Set classIDs = new HashSet();\n Set methodIDs = new HashSet();\n\n codePaths = 1; // there has to be at least one...\n\n offset = 0;\n int max = codeBytes.length;\n\twhile (offset < max) {\n\t int bcode = at(0);\n\t if (bcode == bc_wide) {\n\t\tbcode = at(1);\n\t\tint arg = shortAt(2);\n\t\tswitch (bcode) {\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret:\n\t\t\toffset += 4;\n\t\t\tbreak;\n\n\t\t case bc_iinc:\n\t\t\toffset += 6;\n\t\t\tbreak;\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t } else {\n\t\tswitch (bcode) {\n // These bcodes have CONSTANT_Class arguments\n case bc_instanceof: \n case bc_checkcast: case bc_new:\n {\n\t\t\tint index = shortAt(1);\n classIDs.add(new Integer(index));\n\t\t\toffset += 3;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_putstatic: case bc_getstatic:\n case bc_putfield: case bc_getfield: {\n\t\t\tint index = shortAt(1);\n CPFieldInfo fi = (CPFieldInfo)cpool.get(index);\n classIDs.add(new Integer(fi.getClassID()));\n\t\t\toffset += 3;\n\t\t\tbreak;\n }\n\n // These bcodes have CONSTANT_MethodRef_info arguments\n\t\t case bc_invokevirtual: case bc_invokespecial:\n case bc_invokestatic:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_jsr_w:\n\t\t case bc_invokeinterface:\n methodIDs.add(new Integer(shortAt(1)));\n messageSends++;\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n // Branch instructions\n\t\t case bc_ifeq: case bc_ifge: case bc_ifgt:\n\t\t case bc_ifle: case bc_iflt: case bc_ifne:\n\t\t case bc_if_icmpeq: case bc_if_icmpne: case bc_if_icmpge:\n\t\t case bc_if_icmpgt: case bc_if_icmple: case bc_if_icmplt:\n\t\t case bc_if_acmpeq: case bc_if_acmpne:\n\t\t case bc_ifnull: case bc_ifnonnull:\n\t\t case bc_jsr:\n codePaths++;\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n case bc_lcmp: case bc_fcmpl: case bc_fcmpg:\n case bc_dcmpl: case bc_dcmpg:\n codePaths++;\n\t\t\toffset++;\n break;\n\n\t\t case bc_tableswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tlong low = intAt(tbl, 1);\n\t\t\tlong high = intAt(tbl, 2);\n\t\t\ttbl += 3 << 2; \t\t\t// three int header\n\n // Find number of unique table addresses.\n // The default path is skipped so we find the\n // number of alternative paths here.\n Set set = new HashSet();\n int length = (int)(high - low + 1);\n for (int i = 0; i < length; i++) {\n int jumpAddr = (int)intAt (tbl, i) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n\n\t\t\toffset = tbl + (int)((high - low + 1) << 2);\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_lookupswitch:{\n\t\t\tint tbl = (offset+1+3) & (~3);\t// four byte boundry\n\t\t\tint npairs = (int)intAt(tbl, 1);\n\t\t\tint nints = npairs * 2;\n\t\t\ttbl += 2 << 2; \t\t\t// two int header\n\n // Find number of unique table addresses\n Set set = new HashSet();\n for (int i = 0; i < nints; i += 2) {\n // use the address half of each pair\n int jumpAddr = (int)intAt (tbl, i + 1) + offset;\n set.add(new Integer(jumpAddr));\n }\n codePaths += set.size();\n \n\t\t\toffset = tbl + (nints << 2);\n\t\t\tbreak;\n\t\t }\n\n // Ignore other bcodes.\n\t\t case bc_anewarray: \n offset += 3;\n break;\n\n\t\t case bc_multianewarray: {\n\t\t\toffset += 4;\n\t\t\tbreak;\n\t\t }\n\n\t\t case bc_aload: case bc_astore:\n\t\t case bc_fload: case bc_fstore:\n\t\t case bc_iload: case bc_istore:\n\t\t case bc_lload: case bc_lstore:\n\t\t case bc_dload: case bc_dstore:\n\t\t case bc_ret: case bc_newarray:\n\t\t case bc_bipush: case bc_ldc:\n\t\t\toffset += 2;\n\t\t\tbreak;\n\t\t \n\t\t case bc_iinc: case bc_sipush:\n\t\t case bc_ldc_w: case bc_ldc2_w:\n\t\t case bc_goto:\n\t\t\toffset += 3;\n\t\t\tbreak;\n\n\t\t case bc_goto_w:\n\t\t\toffset += 5;\n\t\t\tbreak;\n\n\t\t default:\n\t\t\toffset++;\n\t\t\tbreak;\n\t\t}\n\t }\n\t}\n classRefs = expandClassNames(classIDs);\n methodRefs = expandMethodNames(methodIDs);\n }", "public SourceLister(String []srcDirs) {\n this.srcDirs = srcDirs;\n }", "private static Iterable<String> calcClosure(List<String> classes) {\n Set<String> ret = new HashSet<String>();\n\n List<String> newClasses = new ArrayList<String>();\n for (String cName : classes) {\n newClasses.add(cName);\n ret.add(cName);\n }\n\n boolean updating = true;\n while (updating) {\n updating = false;\n classes = newClasses;\n newClasses = new ArrayList<String>();\n for (String cName : classes) {\n Set<String> nC = new HashSet<String>();\n Analysis as = new Analysis() {\n @Override\n public ClassVisitor getClassVisitor() {\n return new ReachingClassAnalysis(Opcodes.ASM5, null, nC);\n }\n };\n\n try {\n as.analyze(cName);\n } catch (IOException ex) {\n System.err.println(\"WARNING: IOError handling: \" + cName);\n System.err.println(ex);\n }\n\n for (String cn : nC) {\n if (!ret.contains(cn) &&\n !cn.startsWith(\"[\")) {\n ret.add(cn);\n newClasses.add(cn);\n updating = true;\n }\n }\n }\n }\n\n System.err.println(\"Identified \" + ret.size() +\n \" potentially reachable classes\");\n\n return ret;\n }", "public String getCompilerClassName();", "@Override\n public CompilationSource createCompilationSource(String name) {\n File sourceFile = getSourceFile(name);\n if (sourceFile == null || !sourceFile.exists()) {\n return null;\n }\n\n return new FileSource(name, sourceFile);\n }", "private List<JCMethodDecl> addCompactConstructorIfNeeded(JavacNode typeNode, JavacNode source) {\n\t\tList<JCMethodDecl> answer = List.nil();\n\t\t\n\t\tif (typeNode == null || !(typeNode.get() instanceof JCClassDecl)) return answer;\n\t\t\n\t\tJCClassDecl cDecl = (JCClassDecl) typeNode.get();\n\t\tif ((cDecl.mods.flags & RECORD) == 0) return answer;\n\t\t\n\t\tboolean generateConstructor = false;\n\t\t\n\t\tJCMethodDecl existingCtr = null;\n\t\t\n\t\tfor (JCTree def : cDecl.defs) {\n\t\t\tif (def instanceof JCMethodDecl) {\n\t\t\t\tJCMethodDecl md = (JCMethodDecl) def;\n\t\t\t\tif (md.name.contentEquals(\"<init>\")) {\n\t\t\t\t\tif ((md.mods.flags & Flags.GENERATEDCONSTR) != 0) {\n\t\t\t\t\t\texistingCtr = md;\n\t\t\t\t\t\texistingCtr.mods.flags = existingCtr.mods.flags & ~Flags.GENERATEDCONSTR;\n\t\t\t\t\t\tgenerateConstructor = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!isTolerate(typeNode, md)) {\n\t\t\t\t\t\t\tif ((md.mods.flags & COMPACT_RECORD_CONSTRUCTOR) != 0) {\n\t\t\t\t\t\t\t\tgenerateConstructor = false;\n\t\t\t\t\t\t\t\tanswer = answer.prepend(md);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (generateConstructor) {\n\t\t\tJCMethodDecl ctr;\n\t\t\tif (existingCtr != null) {\n\t\t\t\tctr = createRecordArgslessConstructor(typeNode, source, existingCtr);\n\t\t\t} else {\n\t\t\t\tctr = createRecordArgslessConstructor(typeNode, source, null);\n\t\t\t\tinjectMethod(typeNode, ctr);\n\t\t\t}\n\t\t\tanswer = answer.prepend(ctr);\n\t\t}\n\t\t\n\t\treturn answer;\n\t}", "public void compileStarted() { }", "public void compileStarted() { }", "public CompilationResult compile(TestConfiguration configuration) {\n TestUtilities.ensureDirectoryExists(new File(configuration.getOptions().get(\"-d\")));\n\n final StringWriter javacOutput = new StringWriter();\n DiagnosticCollector<JavaFileObject> diagnostics = new\n DiagnosticCollector<JavaFileObject>();\n\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n Iterable<? extends JavaFileObject> javaFiles =\n fileManager.getJavaFileObjects(configuration.getTestSourceFiles().toArray(new File[]{}));\n\n\n\n //Even though the method compilergetTask takes a list of processors, it fails if processors are passed this way\n //with the message:\n //error: Class names, 'org.checkerframework.checker.interning.InterningChecker', are only accepted if\n // annotation processing is explicitly requested\n //Therefore, we now add them to the beginning of the options list\n final List<String> options = new ArrayList<String>();\n options.add(\"-processor\");\n options.add(PluginUtil.join(\",\", configuration.getProcessors()));\n List<String> nonJvmOptions = new ArrayList<String>();\n for (String option : configuration.getFlatOptions()) {\n if (! option.startsWith(\"-J-\")) {\n nonJvmOptions.add(option);\n }\n }\n options.addAll(nonJvmOptions);\n\n if (configuration.shouldEmitDebugInfo()) {\n System.out.println(\"Running test using the following invocation:\");\n System.out.println(\"javac \" + PluginUtil.join(\" \", options) + \" \"\n + PluginUtil.join(\" \", configuration.getTestSourceFiles()));\n }\n\n JavaCompiler.CompilationTask task =\n compiler.getTask(javacOutput, fileManager, diagnostics, options, new ArrayList<String>(), javaFiles);\n\n /*\n * In Eclipse, std out and std err for multiple tests appear as one\n * long stream. When selecting a specific failed test, one sees the\n * expected/unexpected messages, but not the std out/err messages from\n * that particular test. Can we improve this somehow?\n */\n final Boolean compiledWithoutError = task.call();\n javacOutput.flush();\n return new CompilationResult(compiledWithoutError, javacOutput.toString(), javaFiles,\n diagnostics.getDiagnostics());\n }", "public ClassFile[] getClassFiles() {\n\t\treturn getResult().getClassFiles();\n\t}", "public BdsVm compile() {\n\t\tif (bdsvm != null) throw new RuntimeException(\"Code already compiled!\");\n\n\t\t// Initialize\n\t\tbdsvm = new BdsVm();\n\t\tcode = new ArrayList<>();\n\t\tbdsvm.setDebug(debug);\n\t\tbdsvm.setVerbose(verbose);\n\t\tinit();\n\n\t\t// Read file and parse each line\n\t\tlineNum = 1;\n\t\tfor (String line : code().split(\"\\n\")) {\n\t\t\t// Remove comments and labels\n\t\t\tif (isCommentLine(line)) continue;\n\n\t\t\t// Parse label, if any.Keep the rest of the line\n\t\t\tline = label(line);\n\t\t\tif (line.isEmpty()) continue;\n\n\t\t\t// Decode instruction\n\t\t\tOpCode opcode = opcode(line);\n\t\t\tString param = null;\n\t\t\tif (opcode.hasParam()) param = param(line);\n\t\t\t// Add instruction\n\t\t\taddInstruction(opcode, param);\n\t\t\tlineNum++;\n\t\t}\n\n\t\tbdsvm.setCode(code);\n\t\tif (debug) System.err.println(\"# Assembly: Start\\n\" + bdsvm.toAsm() + \"\\n# Assembly: End\\n\");\n\t\treturn bdsvm;\n\t}", "protected void compile() throws FileNotFoundException, DebuggerCompilationException{\n String[] compileArgs = new String[5];\n String cOutFile = Integer.toString(handle);//filename + Integer.toString(handle);\n String outArg = cOutFile;\n compileArgs[0] = ocamlCompileC;\n compileArgs[1] = \"-g\";\n compileArgs[2] = filename;\n compileArgs[3] = \"-o\";\n compileArgs[4] = cOutFile;\n outFile = cOutFile;\n\n /* Start the ocamlc compiler */\n Process compileProcess;\n try{\n compileProcess = runtime.exec(compileArgs);\n }catch(IOException e){\n System.out.println(\"HERE\");\n throw new DebuggerCompilationException();\n //}catch(FileNotFoundException f){\n // throw new FileNotFoundException();\n }\n OutputStreamWriter compileWriter = new OutputStreamWriter(compileProcess.getOutputStream());\n\n InputStream processInputStream = compileProcess.getInputStream();\n\n /* Create a DebugListener to read the output */\n DebugListener compileReader = new DebugListener(processInputStream, this.observers, handle);\n\n compileReader.start();\n \n try{\n Thread.sleep(2000);\n }catch(Exception e){\n\n }\n\n }", "public static String run(Compilation compilation) throws Exception {\n\t\tfor (String code : compilation.jFiles) {\n\t\t\tClassFile classFile = new ClassFile();\n\t\t\tclassFile.getClassName();\n\t\t\tclassFile.readJasmin(new StringReader(code), \"\", false);\n\t\t\tPath outputPath = tempDir.resolve(classFile.getClassName() + \".class\");\n\t\t\ttry (OutputStream output = Files.newOutputStream(outputPath)) {\n\t\t\t\tclassFile.write(output);\n\t\t\t}\n\t\t}\n\n\t\treturn runJavaClass(tempDir, JasminTemplate.MAIN_CLASS_NAME);\n\t}", "private static boolean writeAndCompile(String className, String implement, String header, String expression) {\n\n\t\t// build the class\n\t\tString classData = String.format(classBase, className, implement, header, expression);\n\t\tString classFileName = className + \".java\";\n\n\t\t// write the .java file\n\t\ttry (PrintWriter out = new PrintWriter(path + classFileName)) {\n\t\t\tout.println(classData);\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\n\t\t// compile the file\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tint result;\n\n\t\tif (compiler == null) {\n\t\t\tSystem.out.println(\"No Compiler! Trying external tools..\");\n\n\t\t\ttry {\n\t\t\t\tcom.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();\n\t\t\t\tresult = javac.compile(new String[] {path + classFileName});\n\t\t\t} catch (NoClassDefFoundError e) {\n\t\t\t\tSystem.out.println(\"No external tools found!\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//return false;\n\t\t} else\n\t\t\tresult = compiler.run(null, null, null, path + classFileName);\n\n\t\t// delete the .java file, just because\n\t\ttry {\n\t\t\tnew File(path + classFileName).delete();\n\n\t\t// meh, we tried\n\t\t} catch (Exception e) {}\n\n\t\t// if result is 0, compilation was successful\n\t\treturn result == 0;\n\t}", "protected abstract void generateClassFiles(ClassDoc[] arr, ClassTree classtree);", "public JasminBytecode(String className, List<String> jasminCode ) {\n this.className = className;\n this.jasminCode = new ArrayList<>(jasminCode);\n }", "protected Object compileAndLoad() throws IOException {\n String generatedSource = printJCodeModel();\n return compileAndLoadSource(generatedSource, TEST_CLASS_NAME);\n }", "public void scanClasspath() {\n List<String> classNames = new ArrayList<>(Collections.list(dexFile.entries()));\n\n ClassLoader classLoader = org.upacreekrobotics.dashboard.ClasspathScanner.class.getClassLoader();\n\n for (String className : classNames) {\n if (filter.shouldProcessClass(className)) {\n try {\n Class klass = Class.forName(className, false, classLoader);\n\n filter.processClass(klass);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (NoClassDefFoundError e) {\n e.printStackTrace();\n }\n }\n }\n }", "private void getCompilationUnits(String filePath) {\n File file = new File(filePath);\n\n for(File f : file.listFiles()) {\n if(f.isFile() && f.getName().endsWith(\".java\")) {\n FileInputStream in = null;\n try {\n\n in = new FileInputStream(f);\n CompilationUnit cu = JavaParser.parse(in);\n compilationUnits.add(cu);\n\n } catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException from getCompilationUnits method\");\n e.printStackTrace();\n } catch (Exception e) {\n System.out.println(\"Exception from getCompilationUnits method\");\n e.printStackTrace();\n } finally {\n try {\n\n in.close();\n\n } catch (IOException e) {\n System.out.println(\"IOException from getCompilationUnits method\");\n e.printStackTrace();\n }\n }\n }\n }\n }", "public void main(ArrayList<String> files) throws IOException {\n\t\tDesignParser.CLASSES = files;\n\t\t\n\t\tthis.model = new Model();\n\n\t\tfor (String className : CLASSES) {\n//\t\t\tSystem.out.println(\"====================\");\n\t\t\t// ASM's ClassReader does the heavy lifting of parsing the compiled\n\t\t\t// Java class\n//\t\t\tSystem.out.println(\"Analyzing: \" + className);\n//\t\t\tSystem.out.println(className + \"[\");\n\t\t\tClassReader reader = new ClassReader(className);\n\t\t\t\t\t\t\n\t\t\t// make class declaration visitor to get superclass and interfaces\n\t\t\tClassVisitor decVisitor = new ClassDeclarationVisitor(Opcodes.ASM5, this.model);\n\t\t\t\n\t\t\t// DECORATE declaration visitor with field visitor\n\t\t\tClassVisitor fieldVisitor = new ClassFieldVisitor(Opcodes.ASM5, decVisitor, this.model);\n\t\t\t\n\t\t\t// DECORATE field visitor with method visitor\n\t\t\tClassVisitor methodVisitor = new ClassMethodVisitor(Opcodes.ASM5, fieldVisitor, this.model);\n\t\t\t\n\t\t\t// TODO: add more DECORATORS here in later milestones to accomplish\n\t\t\t// specific tasks\n\t\t\tClassVisitor extensionVisitor = new ExtensionVisitor(Opcodes.ASM5, methodVisitor, this.model);\n\t\t\t\n\t\t\tClassVisitor implementationVisitor = new ImplementationVisitor(Opcodes.ASM5, extensionVisitor, this.model);\n\t\t\t\t\t\t\n\t\t\tClassVisitor usesVisitor = new UsesVisitor(Opcodes.ASM5, implementationVisitor, this.model);\n\t\t\t\n\t\t\tClassVisitor compositionVisitor = new CompositionVisitor(Opcodes.ASM5, usesVisitor, this.model);\n\t\t\t\n\t\t\t// Tell the Reader to use our (heavily decorated) ClassVisitor to\n\t\t\t// visit the class\n\t\t\treader.accept(compositionVisitor, ClassReader.EXPAND_FRAMES);\n//\t\t\tSystem.out.println(\"\\n]\");\n\t\t}\n//\t\tSystem.out.println(\"End Of Code\");\n\t}", "private void generateClassFiles(ClassTree classtree) {\n String[] packageNames = configuration.classDocCatalog.packageNames();\n for (int packageNameIndex = 0; packageNameIndex < packageNames.length;\n packageNameIndex++) {\n generateClassFiles(configuration.classDocCatalog.allClasses(\n packageNames[packageNameIndex]), classtree);\n }\n }", "public List<Class<?>> getAllImportedClasses(Class<?> aSourceClass) {\n\t\tList<Class<?>> result = new ArrayList<Class<?>>();\n\t\tfor (Fw fld : this.getAllFields(aSourceClass)) {\n\t\t\tif (fld.isEnum() || !fld.isSimple()) {\n\t\t\t\tresult.add(fld.type());\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static void main(String[] args) {\n File file = new File(\"./src/testcode.c\");\n \n Compiler compiler = new Compiler(file);\n compiler.compile();\n }", "private Map<String, Entity> parseJavaClasses(List<Path> classFiles) {\r\n logger.trace(\"parseJavaClass\");\r\n\r\n // Instantiate walker and listener\r\n ParseTreeWalker walker = new ParseTreeWalker();\r\n Java8CustomListener listener = new Java8CustomListener();\r\n\r\n classFiles.forEach(path -> {\r\n logger.trace(\"========== Parse: \" + path.toFile().getName() + \" ==========\");\r\n\r\n try {\r\n ParseTree tree = getTree(path);\r\n\r\n // walk through class\r\n walker.walk(listener, tree);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading creating tree for: {}\", path, e);\r\n }\r\n });\r\n\r\n return listener.getEntityMap();\r\n }", "public void updateSource() {\n\t\t// Set the mode to recording\n\t\tmode = RECORD;\n\t\t// Traverse the source and record the architectures structure\n\t\tinspect();\n\t\t// Set the mode to code generation\n\t\tmode = GENERATE;\n\t\t// Traverse the source and calls back when key source elements are\n\t\t// missing\n\t\tinspect();\n\t\t// System.out.println(tree);\n\t\t// Add the source files that are missing\n\t\tArrayList<TagNode> tags = tree.getUnvisited();\n\t\tcreateSourceFiles(tags);\n\t}", "@Override\n public ClassPath getClassPath()\n {\n return getProjectSourcesClassPath();\n }", "protected void generateClassFiles(RootDoc root, ClassTree classtree) {\n generateClassFiles(classtree);\n PackageDoc[] packages = root.specifiedPackages();\n for (int i = 0; i < packages.length; i++) {\n generateClassFiles(packages[i].allClasses(), classtree);\n }\n }", "public static JavaSourceFolder of( JavaSourceFile...adHocJavaFiles )\r\n {\r\n JavaSourceFolder sourceFolder = new JavaSourceFolder();\r\n sourceFolder.add( adHocJavaFiles );\r\n return sourceFolder;\r\n }", "public void processClasses(CompilationUnit cu) {\n\t\t\n\t\tif(cu.getStorage().get().getFileName().equals(\"package-info.java\")) {\n\t\t\tthis.packageInfo = cu;\n\t\t}else {\n\t\t\tthis.cus.add(cu);\n\t\t}\n\t\tfor(TypeDeclaration<?> node : cu.findAll(TypeDeclaration.class)) {\n\t\t\tthis.classes.put(node.getNameAsString(), new ClassAST(node, this));\n\t\t}\n\t}", "@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}", "@Override\n\tpublic void compile() {\n\t\t\n\t}", "@Override\r\n public boolean begin(List<File> sources, File outputDir, DataStore args) {\r\n this.args = args;\r\n classPath = new ArrayList<>();\r\n this.outputDir = outputDir;\r\n clearOutputFolder = false;\r\n reset();\r\n parseOptions(args);\r\n\r\n // if (prettyPrint) {\r\n // tempOutFolder = new File(IoUtils.getCanonicalPath(outputDir) + \"_temp\");\r\n // outputDir = tempOutFolder;\r\n // }\r\n\r\n if (prettyPrint) {\r\n\r\n this.outputDir.mkdirs();\r\n temp = getTemporaryWeaverFolder();// new File(\"_jw_temp\");\r\n outputDir = temp;\r\n // this.setOutputProcessor(temp, spoon, spoon.getEnvironment());\r\n //\r\n // this.setInputSources(Arrays.asList(temp), spoon);\r\n }\r\n\r\n // Pass only Java files to spoon\r\n // Method can do some processing, such as filtering duplicate classes\r\n var javaSources = getJavaSources(sources);\r\n spoon = newSpoon(javaSources, outputDir);\r\n\r\n // spoon = newSpoon(sources, outputDir);\r\n this.currentOutputDir = outputDir;\r\n buildAndProcess();\r\n /* turning off path verifier as it is giving errors for new classes and code */\r\n // spoon.getEnvironment().setNoClasspath(true);\r\n // spoon.getEnvironment().setNoClasspath(false);\r\n jApp = JApp.newInstance(spoon, sources);\r\n // spoon.getEnvironment().setAutoImports(false);\r\n\r\n return true;\r\n }", "private boolean doCompile(String sourceName, String destName,\n PrintStream out, PrintStream err)\n throws DecacFatalError, LocationException {\n AbstractProgram prog = doLexingAndParsing(sourceName, err);\n\n if (prog == null) {\n LOG.info(\"Parsing failed\");\n return true;\n }\n assert(prog.checkAllLocations());\n if (compilerOptions.getParseOnly()) {\n prog.decompile(System.out);\n return false;\n }\n\n\n prog.verifyProgram(this);\n assert(prog.checkAllDecorations());\n\n if (compilerOptions.getVerificationOnly()) {\n return false;\n }\n\n addComment(\"start main program\");\n prog.codeGenProgram(this);\n addComment(\"end main program\");\n LOG.debug(\"Generated assembly code:\" + nl + program.display());\n LOG.info(\"Output file assembly file is: \" + destName);\n\n FileOutputStream fstream = null;\n try {\n fstream = new FileOutputStream(destName);\n } catch (FileNotFoundException e) {\n throw new DecacFatalError(\"Failed to open output file: \" + e.getLocalizedMessage());\n }\n\n LOG.info(\"Writing assembler file ...\");\n\n program.display(new PrintStream(fstream));\n LOG.info(\"Compilation of \" + sourceName + \" successful.\");\n return false;\n }", "private static List<String> getJavasSourceCodeFiels(Map<String,Object> map){\r\n \t\t\r\n \t\t\r\n \t\tSystem.out.println(\"............\");\r\n \t\tLinkedList<String> list = new LinkedList<String>();\r\n \t\tfor(String key : map.keySet()){\r\n \t\t\tObject o = map.get(key);\r\n \r\n \t\t\t//package...\r\n \t\t\tif(o instanceof IPackageFragment){\r\n \t\t\t\t//System.out.println(\"Package --> \" + key);\r\n \t\t\t\tkey = key.substring(0,key.indexOf('[')).trim();\r\n \t\t\t\tkey = PACKAGE + \"(\" + key + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t\t//class...\r\n \t\t\tif(o instanceof ICompilationUnit){\r\n \t\t\t\t//System.out.println(\"Class --> \" + key);\r\n \t\t\t\tString classname = key.substring(0,key.indexOf('[')).trim();\r\n \t\t\t\tString packagename = key.substring(key.indexOf(PACKAGE),key.indexOf('\\n',key.indexOf(PACKAGE)));\r\n \t\t\t\tkey = CLASS_WITH_MEMBERS + \"(\" + packagename + \",\" + classname + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}//method\r\n \t\t\tif(o instanceof IMethod){\r\n \t\t\t\tSystem.out.println(\"Methode --> \" + key);\r\n \t\t\t\tkey = METHOD + \"(\" + getQueryFromMethod((IMethod)o) + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(o instanceof IField){\r\n \t\t\t\tSystem.out.println(\"Attribut --> \" + key);\r\n \t\t\t\tkey = FIELD + \"(\" + getQueryFromField((IField)o) + \")\";\r\n \t\t\t\tlist.add(key);\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn list;\r\n \t\t\r\n \t\t\r\n \t\t/*\r\n \t\tfor(String key : map.keySet()){\r\n \t\t\tObject o = map.get(key);\r\n \t\t\t//if(o instanceof ISourceAttribute)\r\n \t\t\t\t//System.out.println(\"attribute\");\r\n \t\t\t//if(o instanceof ISourceMethod)\r\n \t\t\t\t//System.out.println(\"methode\");\r\n \t\t\tif(o instanceof IPackageFragment) \r\n \t\t\t\tSystem.out.println(\"Package\");\r\n \t\t\tif(o instanceof ICompilationUnit)\r\n \t\t\t\tSystem.out.println(\"sour code file\");\r\n \t\t\t\t\r\n \t\t\t//\"oldquery or class('voller packagename', klassenname)\"\r\n \t\t\t\t\r\n \t\t\t\t\r\n \t\t\tif(o instanceof IField)\r\n \t\t\t\tSystem.out.println(\"Attribut\");\r\n \t\t\tif(o instanceof IType)\r\n \t\t\t\tSystem.out.println(\"classe also class ... in einem file\");\r\n \t\t\tif(o instanceof IMethod)\r\n \t\t\t\tSystem.out.println(\"Methode\");\r\n \t\t\tif(o instanceof IPackageFragmentRoot) \r\n \t\t\t\tSystem.out.println(\"jar package / src Ordner\");\r\n \t\t\tif(o instanceof IProject)\r\n \t\t\t\tSystem.out.println(\"Projekt Ordner\");\r\n \t\t\tif(o instanceof IClassFile)\r\n \t\t\t\tSystem.out.println(\"ClassFile\");\r\n \t\t\tif(o instanceof IAdaptable) //trieft auch auf viele ander sachen zu\r\n \t\t\t\tSystem.out.println(\"Libaraycontainer\");\r\n \t\t\tif(o instanceof IFile)\r\n \t\t\t\tSystem.out.println(\"file\"); //je nach ausgewlter ansicht knnen file auch *.java datein sein\r\n \t\t\tif(o instanceof IFolder)\r\n \t\t\t\tSystem.out.println(\"folder\");\r\n \t\t\tSystem.out.println(o.getClass());\r\n \t\t\t\r\n \t\r\n \t\t}\r\n \t\treturn null;\r\n \t\t*/\r\n \t}", "public void run() throws Exception {\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tStandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n\t\tPath tempFolder = Files.createTempDirectory(\"gwt-jackson-apt-tmp\", new FileAttribute[0]);\n\t\tfileManager.setLocation(StandardLocation.CLASS_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tfileManager.setLocation(StandardLocation.SOURCE_OUTPUT, Arrays.asList(tempFolder.toFile()));\n\t\tCompilationTask task = compiler.getTask(\n\t\t\t\tnew PrintWriter(System.out), \n\t\t\t\tfileManager, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tnull, \n\t\t\t\tfileManager.getJavaFileObjects(\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicTest.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseInterface.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicChildClass2.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicBaseClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SecondPolymorphicChildClass.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/SimpleGenericBeanObject.java\"),\n\t\t\t\t\t\tnew File(\"src/test/java/org/dominokit/jacksonapt/processor/PolymorphicGenericClass.java\")));\n\n\n\t\ttask.setProcessors(Arrays.asList(new ObjectMapperProcessor()));\n\t\ttask.call();\n\t}", "@InterfaceAudience.Public\n Mapper compileMap(String source, String language);", "public boolean compile() {\n String sourceFile = source.getAbsolutePath();\n String destFile;\n try {\n destFile = destFilename(sourceFile);\n } catch (InvalidNameException e) {\n LOG.fatal(\"Wrong extension name (not .deca)\");\n System.err.println(\"Error : source file extension is not .deca\");\n return true;\n }\n\n PrintStream err = System.err;\n PrintStream out = System.out;\n LOG.debug(\"Compiling file \" + sourceFile + \" to assembly file \" + destFile);\n try {\n return doCompile(sourceFile, destFile, out, err);\n } catch (LocationException e) {\n e.display(err);\n return true;\n } catch (DecacFatalError e) {\n err.println(e.getMessage());\n return true;\n } catch (StackOverflowError e) {\n LOG.debug(\"stack overflow\", e);\n err.println(\"Stack overflow while compiling file \" + sourceFile + \".\");\n return true;\n } catch (Exception e) {\n LOG.fatal(\"Exception raised while compiling file \" + sourceFile\n + \":\", e);\n err.println(\"Internal compiler error while compiling file \" + sourceFile + \", sorry.\");\n return true;\n } catch (AssertionError e) {\n LOG.fatal(\"Assertion failed while compiling file \" + sourceFile\n + \":\", e);\n err.println(\"Internal compiler error while compiling file \" + sourceFile + \", sorry.\");\n return true;\n }\n }", "java.util.List<java.lang.String>\n getSourceFileList();", "public Class<?> getSource() {\r\n \t\treturn source;\r\n \t}", "private void installBasicClasses() {\n \tAbstractSymbol filename \n \t = AbstractTable.stringtable.addString(\"<basic class>\");\n \t\n \t// The following demonstrates how to create dummy parse trees to\n \t// refer to basic Cool classes. There's no need for method\n \t// bodies -- these are already built into the runtime system.\n \n \t// IMPORTANT: The results of the following expressions are\n \t// stored in local variables. You will want to do something\n \t// with those variables at the end of this method to make this\n \t// code meaningful.\n \n \t// The Object class has no parent class. Its methods are\n \t// cool_abort() : Object aborts the program\n \t// type_name() : Str returns a string representation \n \t// of class name\n \t// copy() : SELF_TYPE returns a copy of the object\n \n \tclass_c Object_class = \n \t new class_c(0, \n \t\t TreeConstants.Object_, \n \t\t TreeConstants.No_class,\n \t\t new Features(0)\n \t\t\t .appendElement(new method(0, \n \t\t\t\t\t TreeConstants.cool_abort, \n \t\t\t\t\t new Formals(0), \n \t\t\t\t\t TreeConstants.Object_, \n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.type_name,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.copy,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \t\n \t// The IO class inherits from Object. Its methods are\n \t// out_string(Str) : SELF_TYPE writes a string to the output\n \t// out_int(Int) : SELF_TYPE \" an int \" \" \"\n \t// in_string() : Str reads a string from the input\n \t// in_int() : Int \" an int \" \" \"\n \n \tclass_c IO_class = \n \t new class_c(0,\n \t\t TreeConstants.IO,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.out_string,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Str)),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.out_int,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Int)),\n \t\t\t\t\t TreeConstants.SELF_TYPE,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.in_string,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.in_int,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// The Int class has no methods and only a single attribute, the\n \t// \"val\" for the integer.\n \n \tclass_c Int_class = \n \t new class_c(0,\n \t\t TreeConstants.Int,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// Bool also has only the \"val\" slot.\n \tclass_c Bool_class = \n \t new class_c(0,\n \t\t TreeConstants.Bool,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t// The class Str has a number of slots and operations:\n \t// val the length of the string\n \t// str_field the string itself\n \t// length() : Int returns length of the string\n \t// concat(arg: Str) : Str performs string concatenation\n \t// substr(arg: Int, arg2: Int): Str substring selection\n \n \tclass_c Str_class =\n \t new class_c(0,\n \t\t TreeConstants.Str,\n \t\t TreeConstants.Object_,\n \t\t new Features(0)\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.val,\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new attr(0,\n \t\t\t\t\t TreeConstants.str_field,\n \t\t\t\t\t TreeConstants.prim_slot,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.length,\n \t\t\t\t\t new Formals(0),\n \t\t\t\t\t TreeConstants.Int,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.concat,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg, \n \t\t\t\t\t\t\t\t TreeConstants.Str)),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0)))\n \t\t\t .appendElement(new method(0,\n \t\t\t\t\t TreeConstants.substr,\n \t\t\t\t\t new Formals(0)\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg,\n \t\t\t\t\t\t\t\t TreeConstants.Int))\n \t\t\t\t\t\t .appendElement(new formalc(0,\n \t\t\t\t\t\t\t\t TreeConstants.arg2,\n \t\t\t\t\t\t\t\t TreeConstants.Int)),\n \t\t\t\t\t TreeConstants.Str,\n \t\t\t\t\t new no_expr(0))),\n \t\t filename);\n \n \t/* Do somethind with Object_class, IO_class, Int_class,\n Bool_class, and Str_class here */\n nameToClass.put(TreeConstants.Object_.getString(), Object_class);\n nameToClass.put(TreeConstants.IO.getString(), IO_class);\n nameToClass.put(TreeConstants.Int.getString(), Int_class);\n nameToClass.put(TreeConstants.Bool.getString(), Bool_class);\n nameToClass.put(TreeConstants.Str.getString(), Str_class);\n adjacencyList.put(TreeConstants.Object_.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.IO.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Int.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Bool.getString(), new ArrayList<String>() );\n adjacencyList.put(TreeConstants.Str.getString(), new ArrayList<String>() );\n // Do the same for other basic classes\n basicClassList = new Classes(0);\n basicClassList.appendElement(Object_class);\n basicClassList.appendElement(IO_class);\n basicClassList.appendElement(Int_class);\n basicClassList.appendElement(Bool_class);\n basicClassList.appendElement(Str_class);\n \n }", "public static void compile(final InputStream source, final OutputStream destination) throws IOException, ParsingException {\n final Reader reader = new Reader();\n final SList program = reader.read(source);\n try (ObjectOutputStream oos = new ObjectOutputStream(destination)) {\n oos.writeObject(program);\n }\n }", "public interface CompilerTestCase {\n\t/**\n * Retrieve the list of files whose compilation would be tested.\n * @return a list of files in relative or absolute position.\n */\n public String[] getClassesToCompile();\n \n /**\n * Perform the test.\n * \n * @param diagnostics the compiler diagnostics for the evaluated files.\n * @param stdoutS the output of the compiler.\n * @param result the result of the compilation. True if succeeded, false if not.\n */\n public void test(List<Diagnostic<? extends JavaFileObject>> diagnostics, String stdoutS, Boolean result);\n\n}", "public static void compile(final File source, final String destinationFolder) throws IOException, ParsingException {\n try (InputStream input = new FileInputStream(source);\n OutputStream output = new FileOutputStream(getDestinationFileName(source, destinationFolder).toFile())) {\n compile(input, output);\n }\n }", "protected Set<SModule> processModuleFiles(SRepository repo, final Collection<File> moduleSourceDescriptorFiles) {\n Set<SModule> modules = new LinkedHashSet<SModule>();\n\n // XXX need a way to figure which FS to use here. Technically, it should come from a project as we are going to\n // use these modules as part of the project. OTOH, we know these are local FS files.\n final IFileSystem fs = myEnvironment.getPlatform().findComponent(VFSManager.class).getFileSystem(VFSManager.FILE_FS);\n DescriptorIOFacade descriptorIOFacade = myEnvironment.getPlatform().findComponent(DescriptorIOFacade.class);\n final ModulesMiner mminer = new ModulesMiner(Collections.<IFile>emptySet(), descriptorIOFacade);\n for (File df : CollectionSequence.fromCollection(moduleSourceDescriptorFiles)) {\n IFile descriptorFile = fs.getFile(df);\n if (descriptorIOFacade.fromFileType(descriptorFile) == null) {\n info(String.format(\"File %s doesn't point to module descriptor, ignored\", moduleSourceDescriptorFiles));\n continue;\n }\n mminer.collectModules(descriptorFile);\n }\n ModuleRepositoryFacade mrf = new ModuleRepositoryFacade(repo);\n final SRepositoryExt repoExt = ((SRepositoryExt) mrf.getRepository());\n for (ModulesMiner.ModuleHandle mh : mminer.getCollectedModules()) {\n // seems reasonable just to instantiate a module here and leave its registration to caller\n // however, at the moment, Generator modules need access to their source Language module, which they look up in the repository\n SModule module = repoExt.registerModule(mrf.instantiate(mh.getDescriptor(), mh.getFile()), myOwner);\n info(\"Loaded module \" + module);\n modules.add(module);\n }\n return modules;\n }", "private void scanClass(String scanPackage) {\n URL url = this.getClass().getClassLoader().getResource(\"/\" + scanPackage.replaceAll(\"\\\\.\", \"/\"));\n File dir = new File(url.getFile());\n for (File file : dir.listFiles()) {\n if (file.isDirectory()) {\n scanClass(scanPackage + \".\" + file.getName());\n } else {\n classNames.add(scanPackage + \".\" + file.getName().replaceAll(\".class\", \"\").trim());\n }\n }\n\n }", "private void buildClass(ast.classs.Class c) {\r\n\t\tthis.classTable.put(c.id, new ClassBinding(c.extendss));\r\n\t\tfor (ast.dec.T dec : c.decs) {\r\n\t\t\tast.dec.Dec d = (ast.dec.Dec) dec;\r\n\t\t\tthis.classTable.put(c.id, d.id, d.type, d.lineNum);\r\n\t\t}\r\n\t\tfor (ast.method.T method : c.methods) {\r\n\t\t\tast.method.Method m = (ast.method.Method) method;\r\n\t\t\tthis.classTable.put(c.id, m.id,\r\n\t\t\t\t\tnew MethodType(m.retType, m.formals));\r\n\t\t}\r\n\t}", "FileCollection getGeneratedSourcesDirs();", "private void connectClasses(Header [] list)\r\n {\r\n Vector queue;\r\n Vector garbage = new Vector();\r\n\r\n Find.setCrossreference(list);\r\n\r\n for(int i = 0; list != null && i < list.length; i++)\r\n {\r\n queue = list[i].scopes;\r\n\r\n for(int j = 0; j < queue.size(); j++)\r\n for(Iterator iter = ((Scope)queue.get(j)).iterator(); iter.hasNext();)\r\n {\r\n Iterator a = null;\r\n Basic x = (Basic)iter.next();\r\n\r\n if (x instanceof ClassType)\r\n {\r\n ClassType y = (ClassType)x;\r\n ClassType [] z;\r\n boolean done = false;\r\n String st = null;\r\n\r\n if (y.extend != null && y.extend.name != null && y.extend.scope == null)\r\n { // look for superclass\r\n st = y.extend.name.string;\r\n for(a = y.unresolved.iterator(); a.hasNext();)\r\n {\r\n String s = (String)a.next();\r\n if (s.endsWith('.' + st))\r\n {\r\n st = s;\r\n break;\r\n }\r\n }\r\n\r\n z = Find.findClass(st, 0, y.scope);\r\n \r\n for(int k = 0; k < z.length; k++)\r\n if (z[k].scope.javaPath(\"\").endsWith(st) || z[k].scope.buildPath(\"\").endsWith(st))\r\n {\r\n y.extend = z[k];\r\n garbage.add(st);\r\n done = true;\r\n }\r\n }\r\n\r\n for(int k = 0; k < y.implement.length; k++)\r\n if (y.implement[k].name != null && y.implement[k].scope == null)\r\n { // look for interface\r\n st = y.implement[k].name.string;\r\n for(a = y.unresolved.iterator(); a.hasNext();)\r\n {\r\n String s = (String)a.next();\r\n if (s.endsWith('.' + st))\r\n {\r\n st = s;\r\n break;\r\n }\r\n }\r\n done = false;\r\n \r\n z = Find.findClass(st, 0, y.scope);\r\n \r\n for(int l = 0; l < z.length && !done; l++)\r\n if (z[l].scope.javaPath(\"\").endsWith(st) || z[l].scope.buildPath(\"\").endsWith(st))\r\n {\r\n y.implement[k] = z[l];\r\n garbage.add(st);\r\n done = true;\r\n break;\r\n }\r\n }\r\n\r\n a = null;\r\n while(garbage.size() > 0)\r\n {\r\n st = (String)garbage.get(0);\r\n garbage.remove(0);\r\n y.unresolved.remove(st);\r\n }\r\n }\r\n }\r\n }\r\n }", "private String[] getReferencedJavaClasses() {\n\t\tclass ClassNameVisitor extends JVisitor {\n\t\t\tList<String> classNames = new ArrayList<String>();\n\n\t\t\t@Override\n\t\t\tpublic boolean visit(JClassType x, Context ctx) {\n\t\t\t\tclassNames.add(x.getName());\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tClassNameVisitor v = new ClassNameVisitor();\n\t\tv.accept(jprogram);\n\t\treturn v.classNames.toArray(new String[v.classNames.size()]);\n\t}", "@SuppressWarnings(\"deprecation\")\n\tprotected CompilationUnit internal_parseCompilationUnit(final ITypeRoot source) {\n\t\t// Code parsing : here is indicated the version of JDK (~JLS) to\n\t\t// consider, see Class comments\n\t\tASTParser parser = ASTParser.newParser(AST.JLS3);\n\t\tparser.setResolveBindings(true);\n\t\tparser.setSource(source);\n\t\t\n\t\t// >>> optimization: already ignore method bodies on parsing\n\t\tparser.setIgnoreMethodBodies(isIgnoreMethodBodies());\n\t\t// <<<\n\t\t\n\t\tCompilationUnit parsedCompilationUnit = (CompilationUnit) parser.createAST(null);\n\t\treturn parsedCompilationUnit;\n\t}", "private List<Class<?>> getClasses(String packageName) throws Exception {\n File directory = null;\n try {\n ClassLoader cld = getClassLoader();\n URL resource = getResource(packageName, cld);\n directory = new File(resource.getFile());\n } catch (NullPointerException ex) {\n throw new ClassNotFoundException(packageName + \" (\" + directory\n + \") does not appear to be a valid package\");\n }\n return collectClasses(packageName, directory);\n }", "public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tIOUtils.loadMethodIODeps(\"cb\");\n\t\t\n\t\tFile clazz = new File(args[0]);\n\n\t\tfinal ClassReader cr1 = new ClassReader(new FileInputStream(clazz));\n//\t\tPrintWriter pw = new PrintWriter(new FileWriter(\"z.txt\"));\n\t\tPrintWriter pw = new PrintWriter(System.out);\n\t\t/*ClassWriter cw1 = new ClassWriter(ClassWriter.COMPUTE_FRAMES) {\n\t\t\t@Override\n\t\t\tprotected String getCommonSuperClass(String type1, String type2) {\n\t\t\t\ttry {\n\t\t\t\t\treturn super.getCommonSuperClass(type1, type2);\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t//\t\t\t\t\tSystem.err.println(\"err btwn \" + type1 + \" \" +type2);\n\t\t\t\t\treturn \"java/lang/Unknown\";\n\t\t\t\t}\n\t\t\t}\n\t\t};*/\n\t\t\n\t\tClassWriter cw1 = new ClassWriter(ClassWriter.COMPUTE_MAXS);\n\t\t\n\t\tcr1.accept(new ClassVisitor(Opcodes.ASM5, cw1) {\n\t\t\t@Override\n\t\t\tpublic MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions);\n\t\t\t}\n\t\t}, ClassReader.EXPAND_FRAMES);\n\t\t\n\t\tfinal ClassReader cr = new ClassReader(cw1.toByteArray());\n\t\tTraceClassVisitor tcv = new TraceClassVisitor(null,new Textifier(),pw);\n\t\t//ClassWriter tcv = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS);\n\t\tClassVisitor cv = new ClassVisitor(Opcodes.ASM5, tcv) {\n\t\t\tString className;\n\n\t\t\t@Override\n\t\t\tpublic void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {\n\t\t\t\tsuper.visit(version, access, name, signature, superName, interfaces);\n\t\t\t\tthis.className = name;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tboolean isSynthetic = ClassInfoUtils.checkAccess(access, Opcodes.ACC_SYNTHETIC);\n\t\t\t\tboolean isNative = ClassInfoUtils.checkAccess(access, Opcodes.ACC_NATIVE);\n\t\t\t\tboolean isInterface = ClassInfoUtils.checkAccess(access, Opcodes.ACC_INTERFACE);\n\t\t\t\tboolean isAbstract = ClassInfoUtils.checkAccess(access, Opcodes.ACC_ABSTRACT);\n\t\t\t\t\n\t\t\t\tMethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions);\n\t\t\t\tif (name.equals(\"toString\") && desc.equals(\"()Ljava/lang/String;\")) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else if (name.equals(\"equals\") && desc.equals(\"(Ljava/lang/Object;)Z\")) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else if (name.equals(\"hashCode\") && desc.equals(\"()I\")) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else if (isSynthetic || isNative || isInterface || isAbstract) {\n\t\t\t\t\treturn mv;\n\t\t\t\t} else {\n\t\t\t\t\tmv = new DependencyAnalyzer(className, \n\t\t\t\t\t\t\taccess, \n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tdesc, \n\t\t\t\t\t\t\tsignature, \n\t\t\t\t\t\t\texceptions, \n\t\t\t\t\t\t\tmv, \n\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\tfalse, \n\t\t\t\t\t\t\ttrue, \n\t\t\t\t\t\t\ttrue);\n\t\t\t\t\t//mv = new CalleeAnalyzer(className, access, name, desc, signature, exceptions, mv, true);\n\t\t\t\t\treturn mv;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tcr.accept(cv, ClassReader.EXPAND_FRAMES);\n\t\tpw.flush();\n\t}", "private List<JCTree> makeClassFunctionProxyMethods(JFXClassDeclaration cDecl, List<MethodSymbol> needDispatch) {\n ListBuffer<JCTree> methods = ListBuffer.lb();\n for (MethodSymbol sym : needDispatch) {\n appendMethodClones(methods, cDecl, sym, true);\n }\n return methods.toList();\n }", "@NotNull\n List<? extends ClassInfo> getAllClasses();", "private IClasspathEntry[] removeSourceClasspath(IClasspathEntry[] entries, IContainer folder) {\n if (folder == null) {\n return entries;\n }\n IClasspathEntry source = JavaCore.newSourceEntry(folder.getFullPath());\n int n = entries.length;\n for (int i = n - 1; i >= 0; i--) {\n if (entries[i].equals(source)) {\n IClasspathEntry[] newEntries = new IClasspathEntry[n - 1];\n if (i > 0) System.arraycopy(entries, 0, newEntries, 0, i);\n if (i < n - 1) System.arraycopy(entries, i + 1, newEntries, i, n - i - 1);\n n--;\n entries = newEntries;\n }\n }\n return entries;\n }", "public static void main(String[] args) {\n\r\n\t\tFile sourceFileListing = new File(\"files/SortedSourceFilePathsTMP.txt\");\r\n\t\tSourceFileIterator sourceFileIterator = new SourceFileIterator(\r\n\t\t\t\tsourceFileListing);\r\n\t\tcountStatements(sourceFileIterator);\r\n\t\tcountClasses(sourceFileIterator);\r\n\t\t// countSystemOuts(sourceFileListing);\r\n\t}", "@Override\n\t\tpublic CompilationUnitTree process(CompilationUnitTree source) throws Exception {\n\t\t\treturn null;\n\t\t}", "CompilationBuilder(CharSequence source, String name, CompilerConfiguration compilerConfiguration) {\n\t\tif(source==null) throw new IllegalArgumentException(\"The passed source text was null\");\n\t\tif(name==null) name = \"WatchTowerGroovy\" + syntheticNameSerial.incrementAndGet();\n\t\tthis.compilerConfiguration = compilerConfiguration!=null ? compilerConfiguration : new CompilerConfiguration(CompilerConfiguration.DEFAULT);\t\t\n\t\ttry {\n\t\t\tcodeSource = new GroovyCodeSource(source.toString(), name, \"watchtower\");\n\t\t} catch (Exception ex) {\n\t\t\tthrow new RuntimeException(\"Failed to create GroovyCodeSource from [\" + name + \"/\" + source + \"]\", ex);\n\t\t}\n\t}", "public SourceLister() {\n this(defaultSrcDirs);\n }", "private List<Class> getClasses(String packageName)\n throws ClassNotFoundException, IOException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assert classLoader != null;\n String path = packageName.replace('.', '/');\n Enumeration<URL> resources = classLoader.getResources(path);\n List<File> dirs = new ArrayList<File>();\n while (resources.hasMoreElements()) {\n URL resource = resources.nextElement();\n dirs.add(new File(resource.getFile()));\n }\n ArrayList<Class> classes = new ArrayList<Class>();\n for (File directory : dirs) {\n classes.addAll(findClasses(directory, packageName));\n }\n return classes;\n }", "protected void compile(String[] args) {\n String[] commandArray = null;\n File tmpFile = null;\n\n try {\n String myos = System.getProperty(\"os.name\");\n\n\n if (myos.toLowerCase().indexOf(\"windows\") >= 0 \n && args.length > 250) {\n PrintWriter out = null;\n try {\n tmpFile = new File(\"jikes\"+(new Random(System.currentTimeMillis())).nextLong());\n out = new PrintWriter(new FileWriter(tmpFile));\n for (int i = 0; i < args.length; i++) {\n out.println(args[i]);\n }\n out.flush();\n commandArray = new String[] { command, \n \"@\" + tmpFile.getAbsolutePath()};\n } catch (IOException e) {\n throw new BuildException(\"Error creating temporary file\", e);\n } finally {\n if (out != null) {\n try {out.close();} catch (Throwable t) {}\n }\n }\n } else {\n commandArray = new String[args.length+1];\n commandArray[0] = command;\n System.arraycopy(args,0,commandArray,1,args.length);\n }\n \n try {\n Execute exe = new Execute(jop);\n exe.setAntRun(project);\n exe.setWorkingDirectory(project.getBaseDir());\n exe.setCommandline(commandArray);\n exe.execute();\n } catch (IOException e) {\n throw new BuildException(\"Error running Jikes compiler\", e);\n }\n } finally {\n if (tmpFile != null) {\n tmpFile.delete();\n }\n }\n }", "public void compile(MindFile f) {\n \t\t\n \t}", "private static List<IClassDefinition> getExtClasses(\n\t\t\tList<IClassDefinition> classList, String extensionName,\n\t\t\tEnvironment env)\n\t{\n\t\tList<IClassDefinition> classes = new LinkedList<IClassDefinition>();\n\n\t\tfor (IClassDefinition c : classList)\n\t\t{\n\t\t\t// Check for the existing of the classdef directly.\n\t\t\tif (env.isTreeNode(c))\n\t\t\t{\n\t\t\t\tclasses.add(c);\n\t\t\t}\n\t\t\t// else if it does not exist in env, check if the class has been\n\t\t\t// replaced and add this instead.\n\t\t\telse\n\t\t\t{\n\n\t\t\t\tString newName = c.getName().getPrefix() + extensionName\n\t\t\t\t\t\t+ c.getName().getRawName() + c.getName().getPostfix();\n\n\t\t\t\tIClassDefinition newC = env.lookUp(newName);\n\n\t\t\t\tif (null != newC)\n\t\t\t\t\tclasses.add(newC);\n\t\t\t}\n\t\t}\n\t\treturn classes;\n\t}", "public void process(byte[] inputClass) throws IOException {\n\t\tClassNode classNode = BytecodeUtils.getClassNode(inputClass);\n\t\t// TODO: address innerclasses, classNode.innerClasses, could these even be found from class files? they would be different files...\n\t\tif(classNode.invisibleAnnotations != null){\n\t\t\tfor(Object annotationObject : classNode.invisibleAnnotations){\n\t\t\t\tAnnotationNode annotationNode = (AnnotationNode) annotationObject;\n\t\t\t\tJREFAnnotationIdentifier checker = new JREFAnnotationIdentifier();\n\t\t\t\tchecker.visitAnnotation(annotationNode.desc, false);\n\t\t\t\tif(checker.isJREFAnnotation()){\n\t\t\t\t\tString qualifiedClassName = classNode.name + \".class\";\n\t\t\t\t\tif(checker.isDefineTypeAnnotation()){\n\t\t\t\t\t\tif(runtimeModifications.getJarEntrySet().contains(qualifiedClassName)){\n\t\t\t\t\t\t\truntimeModifications.add(qualifiedClassName, inputClass, true);\n//\t\t\t\t\t\t\tLog.info(\"Replaced: \" + qualifiedClassName + \" in \" + runtimeModifications.getJarFile().getName());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\truntimeModifications.add(qualifiedClassName, inputClass, false);\n//\t\t\t\t\t\t\tLog.info(\"Inserted: \" + qualifiedClassName + \" into \" + runtimeModifications.getJarFile().getName());\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(checker.isMergeTypeAnnotation()){\n\t\t\t\t\t\tString qualifiedParentClassName = classNode.superName + \".class\";\n\t\t\t\t\t\tbyte[] baseClass = runtimeModifications.extractEntry(qualifiedParentClassName);\n\t\t\t\t\t\tbyte[] mergedClass = mergeClasses(baseClass, inputClass);\n\t\t\t\t\t\truntimeModifications.add(qualifiedParentClassName, mergedClass, true);\n\t\t\t\t\t\t// TODO: clean up outputClass somehow, probably need to make a local temp\n\t\t\t\t\t\t// directory which gets deleted at the end of the build\n//\t\t\t\t\t\tLog.info(\"Merged: \" + qualifiedClassName + \" into \" + qualifiedParentClassName + \" in \" + runtimeModifications.getJarFile().getName());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Document compileClass() throws ParserConfigurationException, DOMException, CloneNotSupportedException {\n\t\tElement ele = null;\n\t\tString token;\n\n\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n\t\tDocumentBuilder builder = null;\n\t\tbuilder = factory.newDocumentBuilder();\n\t\tdocument = builder.newDocument();\n\n\t\t// Root level XML\n\t\troot = document.createElement(\"class\");\n\t\tdocument.appendChild(root);\n\n\t\t// First token is \"class\"\n\t\tjTokenizer.advance();\n\t\tele = createXMLnode(\"keyword\");\n\t\troot.appendChild(ele);\n\n\t\t// Second token is the class name\n\t\tjTokenizer.advance();\n\t\tclassName = jTokenizer.returnTokenVal();\n\t\tele = createXMLnode(\"identifier\");\n\t\troot.appendChild(ele);\n\n\t\t// Third token is '{'\n\t\tjTokenizer.advance();\n\t\tele = createXMLnode(\"symbol\");\n\t\troot.appendChild(ele);\n\n\t\t// Fourth token is the datatype of the class var declaration\n\t\tjTokenizer.advance();\n\t\tString tokenType;\n\t\ttoken = jTokenizer.returnTokenVal(\"keyword\");\n\n\t\tdo {\n\t\t\t// Declare the class variables\n\t\t\tif (token.matches(\"field|static\")) {\n\t\t\t\tcompileClassVarDec();\n\n\t\t\t}\n\t\t\t// Subroutine Declaration\n\t\t\tif (token.matches(\"constructor|function|method\")) {\n\t\t\t\tcompileSubroutine();\n\t\t\t}\n\t\t\tif (jTokenizer.hasNext()) {\n\t\t\t\tjTokenizer.advance();\n\t\t\t\ttokenType = jTokenizer.tokenType();\n\t\t\t\ttoken = jTokenizer.returnTokenVal(tokenType);\n\t\t\t}\n\n\t\t} while (!token.equals(\"}\"));\n\n\t\t// Token \"}\"\n\t\tele = createXMLnode(\"symbol\");\n\t\troot.appendChild(ele);\n\n\t\twriter.close();\n\t\treturn document;\n\t}" ]
[ "0.651338", "0.6404101", "0.6011751", "0.5985865", "0.5822418", "0.5804859", "0.5797301", "0.5637885", "0.56294477", "0.55969054", "0.5562478", "0.5523369", "0.54432374", "0.53531593", "0.5326347", "0.531074", "0.52504665", "0.5242884", "0.5240526", "0.5217571", "0.513345", "0.5119628", "0.50982434", "0.5091057", "0.5084409", "0.5076942", "0.5076763", "0.5070213", "0.50583017", "0.5050737", "0.50036365", "0.49651706", "0.49580848", "0.49546275", "0.49041423", "0.49028736", "0.49019986", "0.49011943", "0.48763677", "0.4853563", "0.48425296", "0.48326844", "0.48326844", "0.48248833", "0.48221365", "0.48096097", "0.48050898", "0.48015285", "0.48008853", "0.47995174", "0.479066", "0.4790384", "0.47899762", "0.4778197", "0.47294158", "0.47274694", "0.47091004", "0.4705911", "0.4698525", "0.46939248", "0.46796575", "0.467183", "0.46666324", "0.46571764", "0.4656812", "0.46515018", "0.46489993", "0.46481788", "0.46468642", "0.46449208", "0.46416008", "0.463602", "0.46337768", "0.461814", "0.4602087", "0.46013495", "0.45973328", "0.4584955", "0.45810705", "0.45734912", "0.45632613", "0.45625314", "0.4550758", "0.45305213", "0.45302245", "0.45293018", "0.45291698", "0.45214158", "0.4519027", "0.45121711", "0.4511037", "0.4508118", "0.45079887", "0.4507745", "0.45071796", "0.45042267", "0.45031205", "0.45000798", "0.44986683", "0.4497886" ]
0.5418134
13
Same as compile(String), for compatibility with old interface
public boolean compile(String name, String source) { return compile(source); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void compile();", "public String compile () throws IOException, RhinoEvaluatorException {\n return compile(1, null);\n }", "public boolean compile(String source) {\n\t return compile(source, true);\n\t}", "public void compile(String str) throws PaleoException {\n\t\trunProcess(\"javac paleo/\" + str + \".java\");\n\t\tif (erreur.length() != 0) {\n\t\t\tthrow new JavacException(erreur.toString());\n\t\t}\n\t}", "public String getCompiler();", "public PyCode compile(String script) {\n return null;\n }", "@Override\n\tpublic void compile() {\n\t\t\n\t}", "public static Expression compile(@NonNull final String s) {\n return new Expression(PARSER.parse(s));\n }", "String compile() throws IOException {\n\t\tString line = \"\";\n\t\tString[] command = {\n\t\t\t\tjavacPath,\n\t\t\t\tsavedFilePath\n\t\t};\n\t\tProcessBuilder pb=new ProcessBuilder(command);\n\t\tpb.redirectErrorStream(true);\n\t\tProcess process=pb.start();\n\t\tBufferedReader inStreamReader = new BufferedReader(\n\t\t\t\tnew InputStreamReader(process.getInputStream())); \n\n\t\tline = inStreamReader.readLine();\n\t\tif(line == null) {\n\t\t\tline = \"\";\n\t\t\tcompiled = true;\n\t\t}\n\t\treturn line;\n\t}", "public static String compileAndRun(String code) throws Exception {\n\t\treturn run(LavaCompiler.compile(code));\n\t}", "void compileToJava();", "public abstract String construct();", "public Module compileModule(String module) throws Exception, Error\n {\n Module m;\n while(containsCall(module))\n {\n \n Call call = getCall(module);\n module = resolveCall(module, call);\n }\n m = new Module(name(module), module);\n m.displayResults();\n return m;\n }", "@SuppressWarnings(\"unused\")\n\tprivate static void testFromStringToCompiledByteCode()\n\t{\n\t\tfinal String test = \"do end\";\n\t\tfinal int[] raw = compileFromRawString(test);\n\t\tfinal OpCodeMapper mapper = OpCodeMapper_v5_1.getInstance();\n\n\t\tfor (int i = raw.length - 1; i < raw.length; i++)\n\t\t{\n\t\t\tfinal int ByteCode = raw[i] & 0x3f;\n\t\t\tfinal AbstractOpCodes OpType = mapper.getOpCodeFor(ByteCode);\n\t\t\tfinal InstructionTypes instType = mapper.getTypeOf(OpType);\n\t\t\tfinal Instruction curInstruct;\n\n\t\t\tswitch (instType)\n\t\t\t{\n\t\t\t\tcase iABC:\n\t\t\t\t{\n\t\t\t\t\tcurInstruct = RawInstruction_iABC.parseFromRaw(raw[i], mapper);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase iABx:\n\t\t\t\t{\n\t\t\t\t\tcurInstruct = RawInstruction_iABx.parseFromRaw(raw[i], mapper);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase iAsBx:\n\t\t\t\t{\n\t\t\t\t\tcurInstruct = RawInstruction_iAsBx.parseFromRaw(raw[i], mapper);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//System.out.println(curInstruct.toString() + \"\\r\\n\\r\\n\");\n\t\t}\n\t}", "private static void compileFile(String path) throws IOException {\n File f = new File(path);\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n File[] files = {f};\n Iterable<? extends JavaFileObject> compilationUnits =\n fileManager.getJavaFileObjectsFromFiles(Arrays.asList(files));\n compiler.getTask(null, fileManager, null, null, null, compilationUnits).call();\n fileManager.close();\n }", "public CompilationObject compile(String code,\n com.microsoft.z3.Context z3Context,\n BlockingQueue<Object> messageQueue, Supplier<Boolean> symb)\n throws CompilationException, InterruptedException, ExecutionException {\n //LEX ->PARSE->COMPILE\n List<Token> codeInput = lexer.tokenise(code);\n AbstractSyntaxTree ast = parser.parse(codeInput, z3Context);\n messageQueue.add(new LogMessage(Runtime.class.getPackage().getImplementationVersion()+ \" XXXXXXXXX \"));\n messageQueue.add(new LogMessage(\"Compile starting symbolic \"+symb.get()));\n System.out.println(Runtime.class.getPackage().getImplementationVersion());\n System.out.println(\"Compiler called parse that output \" + ast.myString());\n return compile(ast, code, z3Context, messageQueue,symb);\n }", "private static void compile(String pat) {\r\n\t\ttry {\r\n\t\t\tpattern = Pattern.compile(pat);\r\n\t\t} catch (PatternSyntaxException x) {\r\n\t\t\tSystem.err.println(x.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}", "@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}", "public static Compile create(String html, String code) throws IOException {\n return create(html, code, \"1.7\");\n }", "public Code compile(final llvm.Function fn, final ValCont k) {\n Reg r = fn.reg(type.toLLVM());\n return new llvm.Op(r, new llvm.Load(loc), k.with(r));\n }", "public static Object compileCustomFunction(Class iface, String expression, String... params) {\n\n\t\t// check for obviously invalid expressions\n\t\tif (expression == null || expression.length() == 0)\n\t\t\treturn null;\n\n\t\t// class must be an interface\n\t\tif (!iface.isInterface())\n\t\t\treturn null;\n\n\t\tString signature;\n\n\t\ttry {\n\t\t\tMethod[] methods = iface.getMethods();\n\n\t\t\t// must be a functional interface\n\t\t\tif (methods.length != 1)\n\t\t\t\treturn null;\n\n\t\t\tMethod method = methods[0];\n\t\t\tClass<?> returnType = method.getReturnType();\n\t\t\tClass<?>[] paramTypes = method.getParameterTypes();\n\n\t\t\t// method must return a value\n\t\t\tif (returnType == Void.class)\n\t\t\t\treturn null;\n\n\t\t\tString paramString = \"\";\n\n\t\t\t// add parameter types and names to the parameter list\n\t\t\tfor (int i=0; i < params.length; i++) {\n\t\t\t\tif (i > 0)\n\t\t\t\t\tparamString += \", \";\n\t\t\t\tparamString += paramTypes[i].getCanonicalName() + \" \" + params[i];\n\t\t\t}\n\n\t\t\t// build the method signature\n\t\t\tsignature = returnType.getCanonicalName() + \" \" +\n\t\t\t\t\t\tmethod.getName() + \"(\" +\n\t\t\t\t\t\tparamString + \")\";\n\n\t\t} catch (SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\n\t\treturn createNewInstance(iface.getCanonicalName(),\n\t\t\t\t\t\t\t\t signature,\n\t\t\t\t\t\t\t\t expression);\n\t}", "private Pattern compilePattern(String pattern) throws PatternBuilderException {\n try{\n return Pattern.compile(pattern);\n } catch (PatternSyntaxException pse) {\n throw new PatternBuilderException(String.format(\"unable to compile regex for pattern: %s\", pattern), pse);\n }\n }", "public Script tryCompile(Node node) {\n return tryCompile(node, null, new JRubyClassLoader(getJRubyClassLoader()), false);\n }", "public String[] compile(String[] names) throws IOException {\n String[] compiled = super.compile(names);\n for (int j=0;j<names.length;j++) {\n syncSources(names[j]);\n }\n return compiled;\n }", "public void compile(String pipe)\n throws ComponentError\n , ServlexException\n {\n compile(pipe, null);\n }", "C11998c mo41092g(String str);", "public BdsVm compile() {\n\t\tif (bdsvm != null) throw new RuntimeException(\"Code already compiled!\");\n\n\t\t// Initialize\n\t\tbdsvm = new BdsVm();\n\t\tcode = new ArrayList<>();\n\t\tbdsvm.setDebug(debug);\n\t\tbdsvm.setVerbose(verbose);\n\t\tinit();\n\n\t\t// Read file and parse each line\n\t\tlineNum = 1;\n\t\tfor (String line : code().split(\"\\n\")) {\n\t\t\t// Remove comments and labels\n\t\t\tif (isCommentLine(line)) continue;\n\n\t\t\t// Parse label, if any.Keep the rest of the line\n\t\t\tline = label(line);\n\t\t\tif (line.isEmpty()) continue;\n\n\t\t\t// Decode instruction\n\t\t\tOpCode opcode = opcode(line);\n\t\t\tString param = null;\n\t\t\tif (opcode.hasParam()) param = param(line);\n\t\t\t// Add instruction\n\t\t\taddInstruction(opcode, param);\n\t\t\tlineNum++;\n\t\t}\n\n\t\tbdsvm.setCode(code);\n\t\tif (debug) System.err.println(\"# Assembly: Start\\n\" + bdsvm.toAsm() + \"\\n# Assembly: End\\n\");\n\t\treturn bdsvm;\n\t}", "public String getCompilerClassName();", "public abstract int compile(byte bc[], int index);", "public static Regex compile(String pattern) throws RegexException {\n return compile(pattern, 0);\n }", "@Override\n protected void compileRegex(String regex) {\n }", "public Pattern getCompiledPath();", "C11998c mo41090e(String str);", "protected void compile() throws FileNotFoundException, DebuggerCompilationException{\n String[] compileArgs = new String[5];\n String cOutFile = Integer.toString(handle);//filename + Integer.toString(handle);\n String outArg = cOutFile;\n compileArgs[0] = ocamlCompileC;\n compileArgs[1] = \"-g\";\n compileArgs[2] = filename;\n compileArgs[3] = \"-o\";\n compileArgs[4] = cOutFile;\n outFile = cOutFile;\n\n /* Start the ocamlc compiler */\n Process compileProcess;\n try{\n compileProcess = runtime.exec(compileArgs);\n }catch(IOException e){\n System.out.println(\"HERE\");\n throw new DebuggerCompilationException();\n //}catch(FileNotFoundException f){\n // throw new FileNotFoundException();\n }\n OutputStreamWriter compileWriter = new OutputStreamWriter(compileProcess.getOutputStream());\n\n InputStream processInputStream = compileProcess.getInputStream();\n\n /* Create a DebugListener to read the output */\n DebugListener compileReader = new DebugListener(processInputStream, this.observers, handle);\n\n compileReader.start();\n \n try{\n Thread.sleep(2000);\n }catch(Exception e){\n\n }\n\n }", "public void compile(MindFile f) {\n \t\t\n \t}", "public void compileScript( TemplateCompilerContext context )\r\n\t{\r\n\t\t// Compile to bytes\r\n\t\tCompilationUnit unit = new CompilationUnit();\r\n\t\tunit.addSource( context.getPath(), context.getScript().toString() );\r\n\t\tunit.compile( Phases.CLASS_GENERATION );\r\n\r\n\t\t// Results\r\n\t\t@SuppressWarnings( \"unchecked\" )\r\n\t\tList< GroovyClass > classes = unit.getClasses();\r\n\t\tAssert.isTrue( classes.size() > 0, \"Expecting 1 or more classes\" );\r\n\r\n\t\tClassLoader parent = Thread.currentThread().getContextClassLoader();\r\n\t\tif( parent == null )\r\n\t\t\tparent = GroovyTemplateCompiler.class.getClassLoader();\r\n\r\n\t\t// Define the class\r\n\t\t// TODO Configurable class loader\r\n\t\tDefiningClassLoader classLoader = new DefiningClassLoader( parent );\r\n\t\tClass< ? > first = null;\r\n\t\tfor( GroovyClass cls : classes )\r\n\t\t{\r\n\t\t\tClass< ? > clas = classLoader.defineClass( cls.getName(), cls.getBytes() );\r\n\t\t\tif( first == null )\r\n\t\t\t\tfirst = clas; // TODO Are we sure that the first one is always the right one?\r\n\t\t}\r\n\r\n\t\t// Instantiate the first\r\n\t\tGroovyObject object = (GroovyObject)Util.newInstance( first );\r\n\t\tClosure closure = (Closure)object.invokeMethod( \"getClosure\", null );\r\n\r\n\t\t// The old way:\r\n//\t\tClass< GroovyObject > groovyClass = new GroovyClassLoader().parseClass( new GroovyCodeSource( getSource(), getName(), \"x\" ) );\r\n\r\n\t\tcontext.setTemplate( new GroovyTemplate( closure ) );\r\n\t}", "CompilationBuilder(CharSequence source, String name, CompilerConfiguration compilerConfiguration) {\n\t\tif(source==null) throw new IllegalArgumentException(\"The passed source text was null\");\n\t\tif(name==null) name = \"WatchTowerGroovy\" + syntheticNameSerial.incrementAndGet();\n\t\tthis.compilerConfiguration = compilerConfiguration!=null ? compilerConfiguration : new CompilerConfiguration(CompilerConfiguration.DEFAULT);\t\t\n\t\ttry {\n\t\t\tcodeSource = new GroovyCodeSource(source.toString(), name, \"watchtower\");\n\t\t} catch (Exception ex) {\n\t\t\tthrow new RuntimeException(\"Failed to create GroovyCodeSource from [\" + name + \"/\" + source + \"]\", ex);\n\t\t}\n\t}", "static public GCode fromString(String str) {\n int c = str.indexOf('(');\n if(c != -1) {\n str = str.substring(0,c-1);\n } \n String[] parts = str.split(\" \");\n GCode g = new GCode(parts[0]);\n // parse args\n for(int i=1; i < parts.length; i++) {\n String arg = parts[i].substring(0,1);\n if(parts[i].length() == 1) {\n g.arg(arg);\n } else {\n String value = parts[i].substring(1);\n g.arg(arg, value); \n }\n }\n return g;\n }", "C11996a mo41085b(String str);", "public static IValueNode eval(@NonNull final String s) {\n return compile(s).eval();\n }", "C11996a mo41079a(String str);", "public T execute() {\n return GraalCompiler.compile(this);\n }", "private JavaCompiler.CompilationTask getCompilationTask(File file)\n\t{\n\t\tDiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>();\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);\n\n Iterable<? extends JavaFileObject> compilationUnit\n = fileManager.getJavaFileObjectsFromFiles(Arrays.asList(file));\n return compiler.getTask(null, fileManager, diagnostics, null, null, compilationUnit);\n\t}", "public Script tryCompile(Node node, ASTInspector inspector) {\n return tryCompile(node, null, new JRubyClassLoader(getJRubyClassLoader()), inspector, false);\n }", "public native void compile() /*-{\r\n\t\tvar template = [email protected]::getJsObj()();\r\n\t\ttemplate.compile();\r\n\t}-*/;", "protected Object compileAndLoad() throws IOException {\n String generatedSource = printJCodeModel();\n return compileAndLoadSource(generatedSource, TEST_CLASS_NAME);\n }", "static int type_of_cc(String passed){\n\t\treturn 1;\n\t}", "public String build();", "public String build();", "@InterfaceAudience.Public\n Reducer compileReduce(String source, String language);", "Object mo12923a(String str, Continuation<? super Unit> continuation);", "public abstract String parse(String name, List<CodeLine> c, Cluster cluster, Map<String,String> subs, Assemble compiler);", "@Override\r\n\tpublic void compile(Player p) {\n\r\n\t}", "public interface TemplateCompiler {\r\n \r\n /**\r\n * Compiles template into specified outputStream.\r\n * \r\n * @param t\r\n * @param context\r\n * @param out\r\n * @throws XMLStreamException\r\n */\r\n public void compile(Template t, TemplateModel model, OutputStream out) throws TemplateCompileException;\r\n\r\n /**\r\n * Compiles template into specified reader.\r\n * Compile method which takes OutputStream is preferrable to this one.\r\n * \r\n * @param t\r\n * @param context\r\n * @param out\r\n * @throws XMLStreamException\r\n */\r\n public void compile(Template t, TemplateModel model, Writer out) throws TemplateCompileException;\r\n\r\n /**\r\n * Compiles template into specified xml Result.\r\n * \r\n * @param t\r\n * @param context\r\n * @param out\r\n * @throws XMLStreamException\r\n */\r\n public void compile(Template t, TemplateModel model, XmlResult out) throws TemplateCompileException;\r\n \r\n}", "String generateCode(\n InputSource input, String filename,\n ProgrammingLanguage programmingLanguage,\n SourceResolver resolver\n ) throws Exception;", "@Override\n public CompilationSource createCompilationSource(String name) {\n File sourceFile = getSourceFile(name);\n if (sourceFile == null || !sourceFile.exists()) {\n return null;\n }\n\n return new FileSource(name, sourceFile);\n }", "private void compile(SSAProgram prog, String methodName, SSAStatement s) {\n // recommended for debuggability:\n sb.append(\" # \");\n if (s.getRegister() >= 0)\n sb.append(reg(s));\n sb.append(\": \");\n sb.append(s.toString());\n sb.append(\"\\n\");\n\n SSAStatement left, right;\n String special;\n StringBuilder built = new StringBuilder();\n\n left = s.getLeft();\n right = s.getRight();\n\n switch (s.getOp()) {\n // FILLIN (this is the actual code generator!)\n case Unify:\n case Alias:\n break; // Do nothing\n case Parameter:\n int paramPos = (Integer)s.getSpecial();\n if(paramPos > 3) {\n built.append(\" lw $\" + reg(s) + \", \" + (paramPos-3)*wordSize + \"($fp)\\n\"); \n }\n break; \n case Int:\n int intValue = (Integer)s.getSpecial();\n built.append(\" li $\" + reg(s) + \", \" + intValue + \"\\n\");\n break;\n case Print:\n callerSave(-1);\n built.append(crstores);\n built.append(moveRegister(\"a0\", reg(left)));\n built.append(\" jal minijavaPrint\\n\");\n built.append(crloads);\n break;\n case Boolean:\n boolean boolValue = (Boolean)s.getSpecial();\n if(boolValue) {\n built.append(\" li $\" + reg(s) + \", \" + 1 + \"\\n\");\n } else {\n built.append(\" move $\" + reg(s) + \", $zero\\n\");\n }\n break;\n case This:\n built.append(\" move $\" + reg(s) + \", $v0\\n\");\n break;\n case Arg:\n int argPos = (Integer)s.getSpecial();\n if(argPos > 3) {\n built.append(\" sw $\" + reg(left) + \", \" + (argPos-4)*wordSize + \"($sp)\\n\"); \n } else {\n built.append(moveRegister(reg(s) ,reg(left)));\n }\n break;\n case Null:\n built.append(\" move $\" + reg(s) + \", $zero\\n\");\n break;\n case NewObj:\n callerSave(freeReg(s));\n built.append(crstores);\n special = (String)s.getSpecial();\n built.append(\" la $a0, mj__v_\" + special + \"\\n\");\n built.append(\" li $a1, \" + objectSize(prog, prog.getClass(special)) + \"\\n\");\n built.append(\" jal minijavaNew\\n\");\n built.append(\" move $\" + reg(s) + \", $v0\\n\");\n built.append(crloads);\n break;\n case NewIntArray:\n callerSave(freeReg(s));\n built.append(crstores);\n built.append(moveRegister(\"a0\", reg(left)));\n built.append(\" jal minijavaNewArray\\n\");\n built.append(\" move $\" + reg(s) + \", $v0\\n\");\n built.append(crloads);\n break;\n case Label:\n special = (String)s.getSpecial();\n built.append(\" .\" + special + \":\\n\");\n break;\n case Goto:\n special = (String)s.getSpecial();\n built.append(\" j .\" + special + \"\\n\");\n break;\n case Branch:\n special = (String)s.getSpecial();\n built.append(\" bne $\" + reg(left) + \", $zero .\" + special +\"\\n\");\n break;\n case NBranch:\n // could change to beqz\n special = (String)s.getSpecial();\n built.append(\" beq $\" + reg(left) + \", $zero, .\" + special +\"\\n\");\n break;\n case Call:\n String clasName = left.getType().toString();\n SSACall call = (SSACall)s.getSpecial();\n String funcName = call.getMethod();\n Vtable vtab = getVtable(prog, prog.getClass(clasName));\n int methodOffset = vtab.methodOffsets.get(funcName);\n callerSave(freeReg(s));\n built.append(crstores);\n built.append(\" move $v0, $\" + reg(left) + \"\\n\");\n built.append(\" lw $v1, ($v0)\\n\");\n built.append(\" lw $v1, \" + (methodOffset*wordSize) + \"($v1)\\n\");\n built.append(\" jal $v1\\n\");\n built.append(\" move $\" + reg(s) + \", $v0\\n\");\n built.append(crloads);\n break;\n case Return:\n built.append(\" move $v0, $\" + reg(left) + \"\\n\");\n built.append(\" j .ret_\" + methodName + \"\\n\");\n break;\n case Member:\n special = (String)s.getSpecial();\n String clname = left.getType().toString();\n int memOffset;\n if(clname.equals(\"int[]\")) {\n memOffset = 0;\n } else {\n memOffset = fieldOffset(prog, prog.getClass(clname), special);\n }\n if(memOffset == 0) {\n built.append(\" lw $\" + reg(s) + \", ($\" + reg(left) + \")\\n\");\n } else {\n built.append(\" lw $\" + reg(s) + \", \" + (wordSize*memOffset) + \"($\" + reg(left) + \")\\n\");\n }\n break;\n case Index:\n built.append(\" mul $v1, $\" + reg(right) + \", 4\\n\");\n built.append(\" add $v1, $v1, 4\\n\");\n built.append(\" add $v1, $v1, $\" + reg(left) + \"\\n\");\n built.append(\" lw $\" + reg(s) + \", ($v1)\\n\");\n break;\n case VarAssg:\n built.append(moveRegister(reg(s), reg(left)));\n break;\n case MemberAssg:\n special = (String)s.getSpecial();\n String className = left.getType().toString();\n int memSOffset = fieldOffset(prog, prog.getClass(className), special);\n built.append(\" sw $\" + reg(right) + \", \" + (memSOffset*wordSize) + \"($\" + reg(left) + \")\\n\");\n built.append(moveRegister(reg(s), reg(right)));\n break;\n case IndexAssg:\n SSAStatement index = (SSAStatement)s.getSpecial();\n built.append(\" mul $v1, $\" + reg(index) + \", 4\\n\");\n built.append(\" add $v1, $v1, 4\\n\");\n built.append(\" add $v1, $v1, $\" + reg(left) + \"\\n\");\n built.append(\" sw $\" + reg(right) + \", ($v1)\\n\");\n built.append(moveRegister(reg(s), reg(right)));\n break;\n case Not:\n built.append(\" seq $\" + reg(s) + \", $zero , $\" + reg(left) + \"\\n\");\n break;\n case Eq:\n built.append(\" seq $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break; \n case Ne:\n built.append(\" sne $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break;\n case Lt:\n built.append(\" slt $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break;\n case Le:\n built.append(\" sle $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break; \n case Gt:\n built.append(\" sgt $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break;\n case Ge:\n built.append(\" sge $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break;\n case And:\n built.append(\" add $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n built.append(\" seq $\" + reg(s) + \", $\" + reg(s) + \", 2\\n\");\n break;\n case Or:\n built.append(\" add $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n built.append(\" sgt $\" + reg(s) + \", $\" + reg(s) + \", 0\\n\");\n break;\n case Plus:\n built.append(\" add $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break; \n case Minus:\n built.append(\" sub $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break; \n case Mul:\n built.append(\" mul $\" + reg(s) + \", $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n break; \n case Div: \n // can change this to one liner after verifying it works\n built.append(\" div $\" + reg(s) + \", $\"+ reg(left) + \", $\" + reg(right) + \"\\n\");\n //built.append(\" mflo $\" + reg(s) + \"\\n\");\n break; \n case Mod:\n // can change to one liner\n //built.append(\" div $\" + reg(left) + \", $\" + reg(right) + \"\\n\");\n //built.append(\" mfhi $\" + reg(s) + \"\\n\");\n built.append(\" rem $\" + reg(s) + \", $\"+ reg(left) + \", $\" + reg(right) + \"\\n\");\n \n break;\n case Store:\n int storeVal = (Integer)s.getSpecial();\n built.append(\" sw $\" + reg(left) + \", -\" + (storeVal+1)*wordSize + \"($fp)\\n\");\n break;\n case Load:\n int loadVal = (Integer)s.getSpecial();\n built.append(\" lw $\" + reg(s) + \", -\" + (loadVal+1)*wordSize + \"($fp)\\n\");\n break;\n default:\n throw new Error(\"Implement MIPS compiler for \" + s.getOp() + \"!\");\n }\n\n sb.append(built);\n }", "Value main(String main);", "private ArrayList<String> javacCommandBuilder(StringBuilder currentProject, StringBuilder currentFile)\n\t{\n\t\tFile folder = new File(currentProject.toString());\n\t\tString[] files = folder.list();\n\t\tArrayList<String> command = new ArrayList<String>(Arrays.asList(\"javac\", \"-d\", \"Class\"));\n\t\t\n\t\tfor(String file : files)\n\t\t{\n\t\t\tcommand.add(currentProject.toString()+\"\\\\\"+file);\n\t\t}\n\t\treturn command;\n\t}", "public Path compile(Path filePath, ErrorLog errorlog) {\n\n\t\tPath path = null;\n\n\t\tif (this.checkIfGccExists()) {\n\t\t\ttry {\n\t\t\t\tif (filePath != null) {\n\t\t\t\t\tpath = filePath;\n\t\t\t\t\tSystem.out.println(filePath.toString());\n\t\t\t\t\tCommandLineControls clc = new CommandLineControls(filePath.toString());\n\n\t\t\t\t\tif (!clc.getStdOut().equals(\"\")) {\n\t\t\t\t\t\terrorlog.setErrorLog((clc.getStdOut() + \"\\n\" + clc.getStdError() + \"\\n\").toString());\n\t\t\t\t\t\t//compileLog.setText(clc.getStdOut() + \"\\n\" + clc.getStdError() + \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\terrorlog.setErrorLog((clc.getStdError() + \"\\n\").toString());\n\t\t\t\t\t\t//compileLog.setText(clc.getStdError() + \"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (!clc.getStdError().equals(\"\")) {\n\t\t\t\t\t\t// this.deleteDontTouch();\n\t\t\t\t\t\tclc.runMyCompiler();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (IOException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\treturn path;\n\t}", "public static void compile(\n String[] arguments)\n throws ParserException, LexerException {\n\n // default destination directory is current working directory\n File destinationDirectory = new File(System.getProperty(\"user.dir\"));\n\n // default destination package is anonymous\n String destinationPackage = \"\";\n\n // default option values\n boolean generateCode = true;\n Verbosity verbosity = Verbosity.INFORMATIVE;\n Strictness strictness = Strictness.STRICT;\n\n // parse command line arguments\n ArgumentCollection argumentCollection\n = new ArgumentCollection(arguments);\n\n // handle option arguments\n for (OptionArgument optionArgument : argumentCollection\n .getOptionArguments()) {\n\n switch (optionArgument.getOption()) {\n\n case DESTINATION:\n destinationDirectory = new File(optionArgument.getOperand());\n break;\n\n case PACKAGE:\n destinationPackage = optionArgument.getOperand();\n break;\n\n case GENERATE:\n generateCode = true;\n break;\n\n case NO_CODE:\n generateCode = false;\n break;\n\n case LENIENT:\n strictness = Strictness.LENIENT;\n break;\n\n case STRICT:\n strictness = Strictness.STRICT;\n break;\n\n case QUIET:\n verbosity = Verbosity.QUIET;\n break;\n\n case INFORMATIVE:\n verbosity = Verbosity.INFORMATIVE;\n break;\n\n case VERBOSE:\n verbosity = Verbosity.VERBOSE;\n break;\n\n case VERSION:\n System.out.println(\"ObjectMacro, part of SableCC version \"\n + Version.VERSION);\n return;\n\n case HELP:\n System.out.println(\"Usage: objectmacro \"\n + Option.getShortHelpMessage() + \" file.objectmacro\");\n System.out.println(\"Options:\");\n System.out.println(Option.getLongHelpMessage());\n return;\n default:\n throw new InternalException(\n \"unhandled option \" + optionArgument.getOption());\n }\n }\n\n switch (verbosity) {\n case INFORMATIVE:\n case VERBOSE:\n System.out.println();\n System.out.println(\n \"ObjectMacro, part of SableCC version \" + Version.VERSION);\n System.out.println(\n \"by Etienne M. Gagnon <[email protected]> and other contributors.\");\n System.out.println();\n break;\n }\n\n // handle text arguments\n if (argumentCollection.getTextArguments().size() == 0) {\n System.out.println(\"Usage: objectmacro \"\n + Option.getShortHelpMessage() + \" file.objectmacro\");\n return;\n }\n else if (argumentCollection.getTextArguments().size() > 1) {\n throw CompilerException.invalidArgumentCount();\n }\n\n // check argument\n TextArgument textArgument\n = argumentCollection.getTextArguments().get(0);\n\n if (!textArgument.getText().endsWith(\".objectmacro\")) {\n throw CompilerException\n .invalidObjectmacroSuffix(textArgument.getText());\n }\n\n File macroFile = new File(textArgument.getText());\n\n if (!macroFile.exists()) {\n throw CompilerException.missingMacroFile(textArgument.getText());\n }\n\n if (!macroFile.isFile()) {\n throw CompilerException.macroNotFile(textArgument.getText());\n }\n\n ObjectMacroFront.compile(macroFile, destinationDirectory,\n destinationPackage, generateCode, strictness, verbosity);\n }", "abstract String mo1747a(String str);", "public void compile(Emitter e)\n {\n throw new RuntimeException(\"Implement me!!!!!\");\n }", "public String compile (int lineno, Object securityDomain) throws IOException, JavaScriptException {\n Context context = Context.enter();\n Reader reader = new InputStreamReader(program);\n Object ret = context.evaluateReader(instanceScope,\n reader,\n programName,\n lineno,\n securityDomain);\n if (ret instanceof org.mozilla.javascript.Undefined) {\n // This is really 'void'. Perhaps a separate 'compile' method\n // should be used that has 'void' as its return type, and that\n // get used by the likes of the RjsConfigCompiler\n return \"\";\n } else {\n return (String) ret;\n }\n }", "public boolean compile()\n {\n if(this.compiling.get())\n {\n return false;\n }\n\n this.componentEditor.removeAllTemporaryModification();\n\n final String text = this.componentEditor.getText();\n final Matcher matcher = CompilerEditorPanel.PATTERN_CLASS_DECLARATION.matcher(text);\n\n if(!matcher.find())\n {\n this.printMessage(\"No class declaration !\");\n return false;\n }\n\n final String className = matcher.group(1);\n\n if(this.classManager.isResolved(className))\n {\n this.classManager.newClassLoader();\n }\n\n this.compiling.set(true);\n this.actionCompile.setEnabled(false);\n this.printMessage(className);\n this.informationMessage.append(\"\\ncompiling ...\");\n final byte[] data = text.getBytes();\n final ByteArrayInputStream stream = new ByteArrayInputStream(data);\n this.classManager.compileASMs(this.eventManager, stream);\n return true;\n }", "private CompilationObject compile(AbstractSyntaxTree ast, String code,\n com.microsoft.z3.Context z3Context,\n BlockingQueue<Object> messageQueue,\n Supplier< Boolean> symb)\n throws CompilationException, InterruptedException, ExecutionException {\n HashMap<String, ProcessNode> processNodeMap = new HashMap<>();\n // HashMap<String, ProcessNode> dependencyMap = new HashMap<>();\n\n //System.out.println(\"\\nCOMPILER \"+ast.myString()+\" symb \"+symb.get()+\"\\n\");\n for (ProcessNode node : ast.getProcesses()) {\n //messageQueue.add(new LogMessage(\"Compile starting \"+node.getIdentifier()+\" s \"+symb.get()));\n //System.out.println(\"**COMPILER** Compiler Start node = \"+ node.myString());\n processNodeMap.put(node.getIdentifier(), (ProcessNode) node.copy());\n // dependencyMap.put(node.getIdentifier(), node);\n }\n\n AbstractSyntaxTree symbAST = ast.copy(); // to be used to build symbolic models\n //??????\n\n //System.out.println(\"symb \"+symb.get());\n if (!symb.get()) {\n ast = processAtomicAST(ast, z3Context, messageQueue);\n } else {\n //expander.expand(ast, messageQueue, z3Context); // use for error detection\n ast = symbAST;\n //ast = expander.expand(ast, messageQueue, z3Context);\n //System.out.println(\" COMPILER Before ReferenceReplacer \"+ast.processes2String());\n //ast = replacer.replaceReferences(ast, messageQueue);\n // If we replace the references then we lose the assignment information\n //System.out.println(\" COMPILER After ReferenceReplacer \"+ast.processes2String());\n\n }\n //\n //\n // ??????\n //store alphabet\n Set<String> alpha = ast.getAlphabet().stream().map(x -> x.getAction()).collect(Collectors.toSet());\n //System.out.println(\"Compiler alph = \"+alpha);\n\n //Having built the final AST now build the processes\n /*System.out.println(\"**COMPILER** Entering interpreter with ast for processes -> Types \"+\n ast.getProcesses().stream().map(x->\"\\n\"+x.getIdentifier()+\"->\"+x.getType())\n .reduce(\"\",(x,y)->x+\" \"+y)); */\n Interpreter.ProcessMapFull pmf = interpreter.interpret(ast,\n messageQueue, z3Context, alpha, symb.get());\n // Optional<Map<String, ProcessModel>> processMap = interpreter.interpret(ast,\n // messageQueue, z3Context, alpha, symb.get());\n\n //System.out.println(\" **COMPILER** before operation evaluation \"+processMap.keySet());\n List<OperationResult> opResults = new ArrayList<>();\n EquationEvaluator.EquationReturn eqResults = new EquationEvaluator.EquationReturn();\n if (pmf.getIsFull()) {\n\n //System.out.println(\" isPresent \"+pmf.getProcessMap().size()+\" \"+ast.getProcesses().size());\n // if (ast.getProcesses().size() <= processMap.get().size()) {\n //System.out.println(\"equal size\"); // not sure why <= and not ==\n opResults = evaluator.evaluateOperations(\n ast.getOperations(), pmf.getProcessMap(),\n interpreter.getpetrinetInterpreter(), code, z3Context, messageQueue, alpha);\n //System.out.println(\" **COMPILER** before equation evaluation \"+processMap.keySet());\n\n // HEAVY LIFTING need thread pool\n this.eqEvaluator = new EquationEvaluator(); // need to reset equationEvaluator else !!!!\n eqResults = eqEvaluator.evaluateEquations(\n pmf.getProcessMap(),\n interpreter.getpetrinetInterpreter(),\n ast.getEquations(), // one entry per equation\n z3Context, messageQueue, alpha);\n }\n\n\n //System.out.println(\"Compiler built pn \"+ pmf.getProcessMap().size());\n return new CompilationObject(pmf.getProcessMap(), opResults, eqResults.getResults());\n }", "public interface XpCompilerContext {\n\n JavaCompiler getJavaCompiler();\n TagLibraryRegistry getTagLibraryRegistry();\n File getJavaDirectory();\n OutputStream getOut();\n\n}", "public interface StringTransformer\r\n{\r\n String transform(String source, Matcher matcher);\r\n}", "private boolean compileMethod(String codeDirectory){\n String fileToCompile = new String();\n int compilationResult = 0;\n CodeCompile compileObject = new CodeCompile();\n compilationResult = compileObject.CompileJavaCode(codeDirectory,errorImage);\n return (boolean) (compilationResult==0);\n }", "void mo1582a(String str, C1329do c1329do);", "public C6550iu(java.lang.String r2) {\n /*\n r1 = this;\n java.util.regex.Pattern r2 = java.util.regex.Pattern.compile(r2)\n java.lang.String r0 = \"Pattern.compile(pattern)\"\n p118io.presage.C6514hl.m21414a((java.lang.Object) r2, (java.lang.String) r0)\n r1.<init>((java.util.regex.Pattern) r2)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p118io.presage.C6550iu.<init>(java.lang.String):void\");\n }", "<C> StringLiteralExp<C> createStringLiteralExp();", "private ClassLoader getCompileClassLoader() throws MojoExecutionException {\n\t\ttry {\n\t\t\tList<String> runtimeClasspathElements = project.getRuntimeClasspathElements();\n\t\t\tList<String> compileClasspathElements = project.getCompileClasspathElements();\n\t\t\tArrayList<URL> classpathURLs = new ArrayList<>();\n\t\t\tfor (String element : runtimeClasspathElements) {\n\t\t\t\tclasspathURLs.add(new File(element).toURI().toURL());\n\t\t\t}\n\t\t\tfor (String element : compileClasspathElements) {\n\t\t\t\tclasspathURLs.add(new File(element).toURI().toURL());\n\t\t\t}\n\t\t\tURL[] urlArray = classpathURLs.toArray(new URL[classpathURLs.size()]);\n\t\t\treturn new URLClassLoader(urlArray, Thread.currentThread().getContextClassLoader());\n\n\t\t} catch (Exception e) {\n\t\t\tthrow new MojoExecutionException(\"Unable to load project runtime !\", e);\n\t\t}\n\t}", "private String m118732a(String str) {\n return (String) InstanceProvider.m107965c(KmarketZaInterface.class).mo131258a((AbstractC32237i) new AbstractC32237i(str) {\n /* class com.zhihu.android.profile.newprofile.p1859ui.card.works.$$Lambda$ProfileWorksCard$tAaYopnsMeB4viDEa34d7b6uWJ4 */\n private final /* synthetic */ String f$0;\n\n {\n this.f$0 = r1;\n }\n\n @Override // java8.util.p2234b.AbstractC32237i\n public final Object apply(Object obj) {\n return ProfileWorksCard.lambda$tAaYopnsMeB4viDEa34d7b6uWJ4(this.f$0, (KmarketZaInterface) obj);\n }\n }).mo131266c(null);\n }", "Expression compileTemplate(Expression exp){\r\n\t\tif (exp.isVariable()){\r\n\t\t\texp = compile(exp.getVariable());\r\n\t\t}\r\n\t\telse if (isMeta(exp)){\r\n\t\t\t// variables of meta functions are compiled as kg:pprint()\r\n\t\t\t// variable of xsd:string() is not\r\n\t\t\texp = compileTemplateMeta((Term) exp);\r\n\t\t}\r\n\t\treturn exp;\r\n\t}", "public boolean compile(String source, boolean generate) {\n\t CompilerOptions options = getDefaultCompilerOptions();\n\t\tICompilerRequestor requestor = this;\n\t\tIErrorHandlingPolicy policy = DefaultErrorHandlingPolicies.exitAfterAllProblems();\n\t IProblemFactory problemFactory = new DefaultProblemFactory(Locale.getDefault());\n\t Source[] units = new Source[1];\n\t units[0] = new Source(source);\n\t units[0].setName();\t\t\n\t options.generateClassFiles = generate;\t \n\t\torg.eclipse.jdt.internal.compiler.Compiler compiler = new org.eclipse.jdt.internal.compiler.Compiler(\n\t\t\t\tnew CompilerAdapterEnvironment(environment, units[0]), \n\t\t\t\tpolicy, options, requestor, problemFactory);\n\t\t\n\t\tcompiler.compile(units);\n\t\treturn getResult().hasErrors();\n\t}", "CompilationBuilder(Reader source, String name, CompilerConfiguration compilerConfiguration) {\n\t\tif(source==null) throw new IllegalArgumentException(\"The passed source text was null\");\n\t\tif(name==null) name = \"WatchTowerGroovy\" + syntheticNameSerial.incrementAndGet();\n\t\tthis.compilerConfiguration = compilerConfiguration!=null ? compilerConfiguration : new CompilerConfiguration(CompilerConfiguration.DEFAULT);\n\t\ttry {\n\t\t\tcodeSource = new GroovyCodeSource(source.toString(), name, \"watchtower\");\n\t\t} catch (Exception ex) {\n\t\t\tthrow new RuntimeException(\"Failed to create GroovyCodeSource from [\" + name + \"/\" + source + \"]\", ex);\n\t\t}\n\t}", "public interface CompilerTestCase {\n\t/**\n * Retrieve the list of files whose compilation would be tested.\n * @return a list of files in relative or absolute position.\n */\n public String[] getClassesToCompile();\n \n /**\n * Perform the test.\n * \n * @param diagnostics the compiler diagnostics for the evaluated files.\n * @param stdoutS the output of the compiler.\n * @param result the result of the compilation. True if succeeded, false if not.\n */\n public void test(List<Diagnostic<? extends JavaFileObject>> diagnostics, String stdoutS, Boolean result);\n\n}", "public CompilationResult compile(TestConfiguration configuration) {\n TestUtilities.ensureDirectoryExists(new File(configuration.getOptions().get(\"-d\")));\n\n final StringWriter javacOutput = new StringWriter();\n DiagnosticCollector<JavaFileObject> diagnostics = new\n DiagnosticCollector<JavaFileObject>();\n\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n Iterable<? extends JavaFileObject> javaFiles =\n fileManager.getJavaFileObjects(configuration.getTestSourceFiles().toArray(new File[]{}));\n\n\n\n //Even though the method compilergetTask takes a list of processors, it fails if processors are passed this way\n //with the message:\n //error: Class names, 'org.checkerframework.checker.interning.InterningChecker', are only accepted if\n // annotation processing is explicitly requested\n //Therefore, we now add them to the beginning of the options list\n final List<String> options = new ArrayList<String>();\n options.add(\"-processor\");\n options.add(PluginUtil.join(\",\", configuration.getProcessors()));\n List<String> nonJvmOptions = new ArrayList<String>();\n for (String option : configuration.getFlatOptions()) {\n if (! option.startsWith(\"-J-\")) {\n nonJvmOptions.add(option);\n }\n }\n options.addAll(nonJvmOptions);\n\n if (configuration.shouldEmitDebugInfo()) {\n System.out.println(\"Running test using the following invocation:\");\n System.out.println(\"javac \" + PluginUtil.join(\" \", options) + \" \"\n + PluginUtil.join(\" \", configuration.getTestSourceFiles()));\n }\n\n JavaCompiler.CompilationTask task =\n compiler.getTask(javacOutput, fileManager, diagnostics, options, new ArrayList<String>(), javaFiles);\n\n /*\n * In Eclipse, std out and std err for multiple tests appear as one\n * long stream. When selecting a specific failed test, one sees the\n * expected/unexpected messages, but not the std out/err messages from\n * that particular test. Can we improve this somehow?\n */\n final Boolean compiledWithoutError = task.call();\n javacOutput.flush();\n return new CompilationResult(compiledWithoutError, javacOutput.toString(), javaFiles,\n diagnostics.getDiagnostics());\n }", "public abstract ILanguageProtocol makeInterpreter(String source, String replQualifiedName, String... salixPath) throws IOException, URISyntaxException, Exception;", "public boolean mustCompile() {\n return true;\n }", "public static Compile instance() {\n\tif (__instance == null) {\n\t synchronized (Compile.class) {\n\t\tif (__instance == null) {\n\t\t __instance = new Compile();\n\t\t}/* if (__instance == null) */\n\t }/* synchronized (Compile.class) */\n\t}/* if (__instance == null) */\n\n\treturn __instance;\n }", "C8325a mo21498a(String str);", "public abstract C24343db mo70723f(String str);", "public static void compile(final InputStream source, final OutputStream destination) throws IOException, ParsingException {\n final Reader reader = new Reader();\n final SList program = reader.read(source);\n try (ObjectOutputStream oos = new ObjectOutputStream(destination)) {\n oos.writeObject(program);\n }\n }", "public static void main(String[] args) {\n File file = new File(\"./src/testcode.c\");\n \n Compiler compiler = new Compiler(file);\n compiler.compile();\n }", "private SourceFile _parseString(String txt) throws ParseException {\n ACParser p = new ACParser(txt);\n return p.SourceFile();\n }", "public boolean compile() {\n String sourceFile = source.getAbsolutePath();\n String destFile;\n try {\n destFile = destFilename(sourceFile);\n } catch (InvalidNameException e) {\n LOG.fatal(\"Wrong extension name (not .deca)\");\n System.err.println(\"Error : source file extension is not .deca\");\n return true;\n }\n\n PrintStream err = System.err;\n PrintStream out = System.out;\n LOG.debug(\"Compiling file \" + sourceFile + \" to assembly file \" + destFile);\n try {\n return doCompile(sourceFile, destFile, out, err);\n } catch (LocationException e) {\n e.display(err);\n return true;\n } catch (DecacFatalError e) {\n err.println(e.getMessage());\n return true;\n } catch (StackOverflowError e) {\n LOG.debug(\"stack overflow\", e);\n err.println(\"Stack overflow while compiling file \" + sourceFile + \".\");\n return true;\n } catch (Exception e) {\n LOG.fatal(\"Exception raised while compiling file \" + sourceFile\n + \":\", e);\n err.println(\"Internal compiler error while compiling file \" + sourceFile + \", sorry.\");\n return true;\n } catch (AssertionError e) {\n LOG.fatal(\"Assertion failed while compiling file \" + sourceFile\n + \":\", e);\n err.println(\"Internal compiler error while compiling file \" + sourceFile + \", sorry.\");\n return true;\n }\n }", "String template();", "public void compile(String[] args){\n CharStream stream;\n if(args.length == 1){\n try {\n stream = new ANTLRFileStream(args[0]);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler o ficheiro \\\"\" + args[0] + \"\\\".\");\n e.printStackTrace();\n return;\n }\n } else{\n try {\n stream = new ANTLRInputStream(System.in);\n } catch (IOException e) {\n System.err.println(\"Ocorreu um problema ao tentar ler do stdin.\");\n e.printStackTrace();\n return;\n }\n }\n\n System.out.println(stream.toString());\n\n LissLexer lexer = new LissLexer(stream);\n TokenStream token = new CommonTokenStream(lexer);\n LissParser parser = new LissParser(token);\n parser.liss(this.idt,this.errorTable,this.mips);\n }", "public String[] getClassesToCompile();", "C1114c mo5879d(String str);", "public static Regex compile(String pattern, int cflags) throws RegexException {\n return new Regex(pattern, REG_EXTENDED | cflags);\n }", "public String compileSolidity(String contract) {\n String code = \"\";\n List<BlockchainProperties.BcInfo> bcInfos = blockchainProperties.getBcInfos();\n BlockchainProperties.BcInfo bcInfo = bcInfos.get(0);\n logger.info(\"contract:\" + contract);\n String[] methodParams = {contract};\n\n Map<String, Object> params = new HashMap<String, Object>();\n params.put(\"jsonrpc\", \"2.0\");\n params.put(\"method\", \"eth_compileSolidity\");\n params.put(\"params\", methodParams);\n params.put(\"id\", \"1\");\n\n try {\n RestTemplate restTemplate = new RestTemplate();\n HttpHeaders headers = new HttpHeaders();\n headers.setContentType(org.springframework.http.MediaType.APPLICATION_JSON);\n HttpEntity<Map<String, Object>> request = new HttpEntity<Map<String, Object>>(params, headers);\n ResponseEntity<String> compileResult = restTemplate.exchange(bcInfo.getClientUrl(), HttpMethod.POST, request, String.class);\n logger.info(String.valueOf(compileResult));\n logger.info(String.valueOf(compileResult.getBody()));\n String compileResultBody = compileResult.getBody();\n if (compileResult.getStatusCode() == HttpStatus.OK) {\n String tempResult1 = compileResultBody.substring(compileResultBody.indexOf(\"\\\"code\\\":\\\"\") + 8);\n String tempResult2 = tempResult1.split(\"\\\",\\\"\")[0];\n code = tempResult2;\n }\n\n } catch (Throwable e) {\n e.printStackTrace();\n }\n\n return code;\n }", "@org.junit.Test\n public void constrCompelemString1() {\n final XQuery query = new XQuery(\n \"fn:string(element elem {'a', element a {}, 'b'})\",\n ctx);\n try {\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 assertStringValue(false, \"ab\")\n );\n }", "public interface CommandFactory {\n Command fromString(String s) throws UnknownCommandException;\n}", "public void executeSTR(){\n\t\tBitString sourceBS = mIR.substring(4, 3);\n\t\tBitString baseBS = mIR.substring(7, 3);\n\t\tBitString offset6 = mIR.substring(10, 6);\n\n\n\t\tmMemory[mRegisters[baseBS.getValue()].getValue2sComp() + offset6.getValue2sComp()] = mRegisters[sourceBS.getValue()];\n\n\t\t//STR doesn't set CC\n\t}", "StringExpression createStringExpression();", "void mo1935c(String str);", "C12000e mo41087c(String str);" ]
[ "0.689332", "0.68328243", "0.6705063", "0.64135206", "0.63529116", "0.6272056", "0.6148588", "0.6141952", "0.5985903", "0.5888724", "0.5771149", "0.572308", "0.56816494", "0.5595201", "0.55835336", "0.5519125", "0.54874575", "0.5473049", "0.54704946", "0.53830487", "0.5378086", "0.53690296", "0.5366958", "0.5361574", "0.5355585", "0.53535646", "0.53502643", "0.53377926", "0.5329763", "0.5322381", "0.52896327", "0.52893484", "0.52768624", "0.52745885", "0.5268916", "0.5202918", "0.51945287", "0.5170287", "0.5142432", "0.51239866", "0.5122863", "0.51151", "0.5111431", "0.51016635", "0.50984377", "0.5096624", "0.5090222", "0.5085863", "0.5085863", "0.50642526", "0.50445485", "0.50402176", "0.5015171", "0.49760517", "0.49710402", "0.49589944", "0.49479067", "0.49463898", "0.49386638", "0.49373308", "0.49215248", "0.49069804", "0.4904587", "0.48942113", "0.48888022", "0.48844168", "0.4875567", "0.48742098", "0.4866193", "0.48658976", "0.4860774", "0.48541266", "0.48481825", "0.48457563", "0.4845593", "0.4833211", "0.4832719", "0.4830925", "0.48303637", "0.48220834", "0.4814781", "0.48097888", "0.4801283", "0.47968677", "0.47810143", "0.47737965", "0.47636762", "0.47633353", "0.47630063", "0.4751923", "0.47478592", "0.47318536", "0.4731271", "0.47305006", "0.47282124", "0.4727493", "0.4720861", "0.4710787", "0.47101453", "0.47068852" ]
0.6541228
3
Returns a list of JavaClassFiles that contains results of the compilation.
public ClassFile[] getClassFiles() { return getResult().getClassFiles(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String[] getClassesToCompile();", "public static String[] listFilesAsArray() {\n\t\t// Recursively find all .java files\n\t\tFile path = new File(Project.pathWorkspace());\n\t\tFilenameFilter filter = new FilenameFilter() {\n\n\t\t\tpublic boolean accept(File directory, String fileName) {\n\t\t\t\treturn fileName.endsWith(\".java\");\n\t\t\t}\n\t\t};\n\t\tCollection<File> files = listFiles(path, filter, true);\n\n\t\tArrayList<File> t = new ArrayList<File>(files);\n\t\tfor (int i = 0; i < t.size(); i++) {\n\t\t\tString s = t.get(i).getAbsolutePath();\n\t\t\tif (s.contains(\"XX\") || s.contains(\"testingpackage\") || s.contains(\"datageneration\")) {\n\t\t\t\tt.remove(t.get(i));\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfiles = t;\n\n\t\t// Convert the Collection into an array\n\t\tFile[] allJavaFiles = new File[files.size()];\n\t\tfiles.toArray(allJavaFiles);\n\n\t\tString[] allTestClasses = new String[allJavaFiles.length];\n\t\tString temp = \"\";\n\n\t\t// convert file path to full package declaration for the class\n\t\tfor (int i = 0; i < allJavaFiles.length; i++) {\n\t\t\ttemp = allJavaFiles[i].toString();\n\t\t\ttemp = temp.replace(\".java\", \"\").replace(\"\\\\\", \".\"); // remove .java convert backslash\n\t\t\tif (temp.indexOf(\"com.textura\") < 0) {\n\t\t\t\tallTestClasses[i] = \"null\";\n\t\t\t} else {\n\t\t\t\ttemp = temp.substring(temp.indexOf(\"com.textura\"));\n\t\t\t\ttemp = temp.replace(\"com.\", \"\");\n\t\t\t\tallTestClasses[i] = temp;\n\t\t\t}\n\t\t}\n\t\treturn allTestClasses;\n\t}", "public Set<String> getJavaSourceListing() {\n Set<String> javasrcs = new TreeSet<String>();\n \n String javasrc;\n for(String classname: classlist) {\n if(classname.contains(\"$\")) {\n continue; // skip (inner classes don't have a direct 1::1 java source file\n }\n \n javasrc = classname.replaceFirst(\"\\\\.class$\", \".java\");\n javasrcs.add(javasrc);\n }\n \n return javasrcs;\n }", "public String[] getClasspaths(IJavaProgramPrepareResult result) {\n\t\tString[] classpath = new String[0];\n\t\t\n\t\treturn classpath;\n\t}", "List<String> getClassNames() {\n List<String> allGeneratedClasses = new ArrayList<String>();\n for (int i = 0; i < classesToScan.size(); i++) {\n String lookupName = classesToScan.get(i);\n byte classBytes[] = getClassBytes(lookupName);\n if (classBytes == null) {\n /*\n * Weird case: javac might generate a name and reference the class in\n * the bytecode but decide later that the class is unnecessary. In the\n * bytecode, a null is passed for the class.\n */\n continue;\n }\n \n /*\n * Add the class to the list only if it can be loaded to get around the\n * javac weirdness issue where javac refers a class but does not\n * generate it.\n */\n if (CompilingClassLoader.isClassnameGenerated(lookupName)\n && !allGeneratedClasses.contains(lookupName)) {\n allGeneratedClasses.add(lookupName);\n }\n AnonymousClassVisitor cv = new AnonymousClassVisitor();\n new ClassReader(classBytes).accept(cv, 0);\n List<String> innerClasses = cv.getInnerClassNames();\n for (String innerClass : innerClasses) {\n // The innerClass has to be an inner class of the lookupName\n if (!innerClass.startsWith(mainClass + \"$\")) {\n continue;\n }\n /*\n * TODO (amitmanjhi): consider making this a Set if necessary for\n * performance\n */\n // add the class to classes\n if (!classesToScan.contains(innerClass)) {\n classesToScan.add(innerClass);\n }\n }\n }\n Collections.sort(allGeneratedClasses, new GeneratedClassnameComparator());\n return allGeneratedClasses;\n }", "private String[] getReferencedJavaClasses() {\n\t\tclass ClassNameVisitor extends JVisitor {\n\t\t\tList<String> classNames = new ArrayList<String>();\n\n\t\t\t@Override\n\t\t\tpublic boolean visit(JClassType x, Context ctx) {\n\t\t\t\tclassNames.add(x.getName());\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tClassNameVisitor v = new ClassNameVisitor();\n\t\tv.accept(jprogram);\n\t\treturn v.classNames.toArray(new String[v.classNames.size()]);\n\t}", "@NotNull\n List<? extends ClassInfo> getAllClasses();", "Set<CompiledClass> getCompiledClasses() {\n if (!isCompiled()) {\n return null;\n }\n if (exposedCompiledClasses == null) {\n FindTypesInCud typeFinder = new FindTypesInCud();\n cud.traverse(typeFinder, cud.scope);\n Set<CompiledClass> compiledClasses = typeFinder.getClasses();\n exposedCompiledClasses = Sets.normalizeUnmodifiable(compiledClasses);\n }\n return exposedCompiledClasses;\n }", "java.util.List<java.lang.String>\n getClasspathList();", "java.util.List<java.lang.String>\n getClasspathList();", "@NotNull\n List<? extends ClassInfo> getClasses();", "private List<Class<?>> getClasses(String packageName) throws Exception {\n File directory = null;\n try {\n ClassLoader cld = getClassLoader();\n URL resource = getResource(packageName, cld);\n directory = new File(resource.getFile());\n } catch (NullPointerException ex) {\n throw new ClassNotFoundException(packageName + \" (\" + directory\n + \") does not appear to be a valid package\");\n }\n return collectClasses(packageName, directory);\n }", "public static Class<?>[] getClassesInFile(File testsListFile){\n\t\tList<Class<?>> list = null;\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new InputStreamReader(new FileInputStream(testsListFile), \"UTF-8\")); //$NON-NLS-1$\n\t\t} catch (UnsupportedEncodingException | FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} \n\t\ttry {\n\t\t\tString line;\n\t\t\tlist = new ArrayList<Class<?>>();\n\t\t\ttry {\n\t\t\t\twhile ((line= br.readLine()) != null) {\n\t\t\t\t\tlist.add(Class.forName(line));\n\t\t\t\t}\n\t\t\t} catch (ClassNotFoundException | IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tbr.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn list.toArray(new Class<?>[list.size()]);\n\t}", "private List<Class> getClasses(String packageName)\n throws ClassNotFoundException, IOException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assert classLoader != null;\n String path = packageName.replace('.', '/');\n Enumeration<URL> resources = classLoader.getResources(path);\n List<File> dirs = new ArrayList<File>();\n while (resources.hasMoreElements()) {\n URL resource = resources.nextElement();\n dirs.add(new File(resource.getFile()));\n }\n ArrayList<Class> classes = new ArrayList<Class>();\n for (File directory : dirs) {\n classes.addAll(findClasses(directory, packageName));\n }\n return classes;\n }", "public abstract List<String> scanAllClassNames();", "public String[] getTestClassNames(String directoryName)\n\t{\n\t File directory = new File(directoryName);\n\t \n File[] fList = directory.listFiles();\n \n for (File file : fList){\n if (file.isFile()){\n if (file.getName().startsWith(\"Test\") && file.getName().endsWith(\".class\") && !file.getName().contains(\"$\"))\n {\n \t//Class Names\n \tfileNames = fileNames + \" , \" +file.getName();\n \t\n \t//create import statements from absolute paths\n \tabsolutePath = file.getAbsolutePath();\n importStatements += \"import \"+absolutePath.substring(absolutePath.indexOf(\"com\"),absolutePath.indexOf(\".class\")).replace(\"\\\\\", \".\")+\";\\n\"; \n \n }\n \n } else if (file.isDirectory()){\n \tgetTestClassNames(file.getAbsolutePath());\n }\n }\n \t\t\n testClasses[0]=fileNames;\n testClasses[1]=importStatements;\n\n return testClasses;\n\t}", "private List<IProjectCheckInconsistency> getClasspathVerificationCheckResults(IProject project)\n\t{\n\n\t\tString fileName = Messages.CheckForClasspathVerification_classpath;\n\t\tList<IProjectCheckInconsistency> checkList = new ArrayList<IProjectCheckInconsistency>();\n\n\t\tIFile file = project.getFile(fileName);\n\t\tif (file.exists())\n\t\t{\n\n\t\t\tString xmlFilePath = file.getLocation().toOSString();\n\t\t\tcheckProjectVerificationForClasspathEntry(xmlFilePath, checkList, file);\n\t\t}\n\n\t\treturn checkList;\n\n\t}", "public List<String> getClassList() {\n return classlist;\n }", "public ICompilationUnit[] getFiles() throws CoreException, JavaModelException\n {\n\tList<ICompilationUnit> files = new ArrayList<ICompilationUnit>();\n\tfor (final String projectName : ConfigurationSettings.projects)\n\t{\n\t IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);\n\t if (project.isNatureEnabled(\"org.eclipse.jdt.core.javanature\"))\n\t {\n\t\tIJavaProject javaProject = JavaCore.create(project);\n\t\tIPackageFragment[] packages = javaProject.getPackageFragments();\n\t\tfor (IPackageFragment p : packages)\n\t\t if (p.getKind() == IPackageFragmentRoot.K_SOURCE)\n\t\t\tfiles.addAll(packageFiles(p));\n\t }\n\t}\n\treturn files.toArray(new ICompilationUnit[0]);\n }", "public List<IclassItem> getClasses() {\n if(projectData!=null){\n return projectData.getClasses();\n }\n return new ArrayList<IclassItem>();\n }", "public String getClasses() {\n String classesString = \"\";\n\n for (String className : classes) {\n classesString += (className + \"\\n\");\n }\n\n return classesString;\n }", "private List<ICompilationUnit> packageFiles(IPackageFragment p) throws JavaModelException\n {\n\tList<ICompilationUnit> files = new ArrayList<ICompilationUnit>();\n\tICompilationUnit[] compilationUnits = p.getCompilationUnits();\n\tfor (ICompilationUnit cu : compilationUnits)\n\t{\n\t files.add(cu);\n\t}\n\treturn files;\n }", "public static List<Class<?>> getClasses( String packageName, String regexFilter ) throws Exception {\n\t\tPattern regex = null;\n\t\tif( regexFilter != null ) {\n\t\t\tregex = Pattern.compile( regexFilter );\n\t\t}\n\n\t\tClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n\t\tassert classLoader != null;\n\t\tString path = packageName.replace( '.', '/' );\n\t\tEnumeration<URL> resources = classLoader.getResources( path );\n\n\t\tList<String> dirs = new ArrayList<String>();\n\t\twhile( resources.hasMoreElements() ) {\n\t\t\tURL resource = resources.nextElement();\n\t\t\tdirs.add( resource.getFile() );\n\t\t}\n\n\t\tTreeSet<String> classes = new TreeSet<String>();\n\t\tfor( String directory : dirs ) {\n\t\t\tclasses.addAll( findClasses( directory, packageName, regex ) );\n\t\t}\n\n\t\tArrayList<Class<?>> classList = new ArrayList<Class<?>>();\n\t\tfor( String clazz : classes ) {\n\t\t\tclassList.add( Class.forName( clazz ) );\n\t\t}\n\n\t\treturn classList;\n\t}", "private Class<DimensionInterface>[] getAllClasses (String pckgname) {\n\t\t\n\t\ttry {\n\t\t \n\t\t\t// Classes will store our results\n\t\t\tArrayList classes = new ArrayList ();\n\t\t\t\n\n\t\t\t// Get a File object for the package \n\t\t File directory; \n\t\t \n\t\t \n\t\t // Load the package \n\t\t try { \n\t\t \tdirectory = new File (\n\t\t \t\tThread.currentThread ()\n\t\t \t\t\t.getContextClassLoader()\n\t\t \t\t\t.getResource (pckgname.replace('.', '/'))\n\t\t \t\t\t.getFile()\n\t\t \t); \n\t\t \n\t\t } catch (NullPointerException x) { \n\t\t \tSystem.out.println (\"Nullpointer\");\n\t\t \tthrow new ClassNotFoundException (pckgname + \" does not appear to be a valid package\"); \n\t\t }\n\t\t \n\t\t \n\t\t // IF we have found our package, then\n\t\t // obtain the files withtin\n\t\t if ( ! directory.exists ()) {\n\t\t \tSystem.out.println (\"Directory does not exist\");\n\t\t \tthrow new ClassNotFoundException(pckgname + \" does not appear to be a valid package\"); \n\t\t } \t\t \t\n\t\t \t\n\t\t \n\t \t// Get the list of the files contained in the package \n\t \tString[] files = directory.list ();\n\t\t \t\n\t\t \t\n\t \t// Get the files\n\t \tfor (int i=0; i<files.length; i++) { \n\n\t \t\t// we are only interested in .class files \n\t \t\tif ( ! files[i].endsWith(\".class\")) {\n\t \t\t\tcontinue;\n\t \t\t}\n\t \t\t\t\n \t\t\t// removes the .class extension \n \t\t\tclasses.add(Class.forName (pckgname + '.' + files[i].substring (0, files[i].length() - 6)));\n\t \t\t\t\n\t \t}\n\t\t \n\t\t \n\t \t// Convert the result in an array\n\t\t Class[] classesA = new Class[classes.size()]; \n\t\t classes.toArray (classesA); \n\t\t \n\t\t \n\t\t // Return\n\t\t return classesA;\n\t\t \n\t\t// Generic error\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public static String run(Compilation compilation) throws Exception {\n\t\tfor (String code : compilation.jFiles) {\n\t\t\tClassFile classFile = new ClassFile();\n\t\t\tclassFile.getClassName();\n\t\t\tclassFile.readJasmin(new StringReader(code), \"\", false);\n\t\t\tPath outputPath = tempDir.resolve(classFile.getClassName() + \".class\");\n\t\t\ttry (OutputStream output = Files.newOutputStream(outputPath)) {\n\t\t\t\tclassFile.write(output);\n\t\t\t}\n\t\t}\n\n\t\treturn runJavaClass(tempDir, JasminTemplate.MAIN_CLASS_NAME);\n\t}", "public static List<Class<?>> getClasses(String packageName) throws ClassNotFoundException, IOException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assert classLoader != null;\n String path = packageName.replace('.', '/');\n Enumeration<URL> resources = classLoader.getResources(path);\n List<File> dirs = new ArrayList<File>();\n while (resources.hasMoreElements()) {\n URL resource = resources.nextElement();\n dirs.add(new File(resource.getFile()));\n }\n ArrayList<Class<?>> classes = new ArrayList<Class<?>>();\n for (File directory : dirs) {\n classes.addAll(findClasses(directory, packageName));\n }\n return classes;\n }", "public static List<Class<?>> getClasses(String packageName) throws ClassNotFoundException, IOException {\n\t\tClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n\n\t\tassert classLoader != null;\n\t\tString path = packageName.replace('.', '/');\n\t\tEnumeration<URL> resources = classLoader.getResources(path);\n\n\t\tList<File> dirs = new ArrayList<File>();\n\t\twhile (resources.hasMoreElements()) {\n\t\t\tURL resource = resources.nextElement();\n\t\t\tdirs.add(new File(resource.getFile()));\n\t\t}\n\t\tArrayList<Class<?>> classes = new ArrayList<Class<?>>();\n\t\tfor (File directory : dirs) {\n\t\t\tclasses.addAll(findClasses(directory, packageName));\n\t\t}\n\t\treturn classes;\n\t}", "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}", "private void buildClassPath() throws InterruptedException, IOException, CheckedAnalysisException {\n IClassPathBuilder builder = classFactory.createClassPathBuilder(bugReporter);\n\n for (String path : project.getFileArray()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), true);\n }\n for (String path : project.getAuxClasspathEntryList()) {\n builder.addCodeBase(classFactory.createFilesystemCodeBaseLocator(path), false);\n }\n\n builder.scanNestedArchives(analysisOptions.scanNestedArchives);\n\n builder.build(classPath, progress);\n\n appClassList = builder.getAppClassList();\n\n if (PROGRESS) {\n System.out.println(appClassList.size() + \" classes scanned\");\n }\n\n // If any of the application codebases contain source code,\n // add them to the source path.\n // Also, use the last modified time of application codebases\n // to set the project timestamp.\n for (Iterator<? extends ICodeBase> i = classPath.appCodeBaseIterator(); i.hasNext();) {\n ICodeBase appCodeBase = i.next();\n\n if (appCodeBase.containsSourceFiles()) {\n String pathName = appCodeBase.getPathName();\n if (pathName != null) {\n project.addSourceDir(pathName);\n }\n }\n\n project.addTimestamp(appCodeBase.getLastModifiedTime());\n }\n\n }", "private void getCompilationUnits(String filePath) {\n File file = new File(filePath);\n\n for(File f : file.listFiles()) {\n if(f.isFile() && f.getName().endsWith(\".java\")) {\n FileInputStream in = null;\n try {\n\n in = new FileInputStream(f);\n CompilationUnit cu = JavaParser.parse(in);\n compilationUnits.add(cu);\n\n } catch (FileNotFoundException e) {\n System.out.println(\"FileNotFoundException from getCompilationUnits method\");\n e.printStackTrace();\n } catch (Exception e) {\n System.out.println(\"Exception from getCompilationUnits method\");\n e.printStackTrace();\n } finally {\n try {\n\n in.close();\n\n } catch (IOException e) {\n System.out.println(\"IOException from getCompilationUnits method\");\n e.printStackTrace();\n }\n }\n }\n }\n }", "public WorkResult execute() {\n source = new SimpleFileCollection(source.getFiles());\n classpath = new SimpleFileCollection(Lists.newArrayList(classpath));\n\n for (File file : source) {\n if (!file.getName().endsWith(\".java\")) {\n throw new InvalidUserDataException(String.format(\"Cannot compile non-Java source file '%s'.\", file));\n }\n }\n configure(compiler);\n return compiler.execute();\n }", "private static Class[] getClasses(String packageName)\n throws ClassNotFoundException, IOException {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n assert classLoader != null;\n String path = packageName.replace('.', '/');\n Enumeration<URL> resources = classLoader.getResources(path);\n List<File> dirs = new ArrayList<File>();\n while (resources.hasMoreElements()) {\n URL resource = resources.nextElement();\n dirs.add(new File(resource.getFile()));\n }\n ArrayList<Class> classes = new ArrayList<Class>();\n for (File directory : dirs) {\n classes.addAll(findClasses(directory, packageName));\n }\n return classes.toArray(new Class[classes.size()]);\n }", "private static Class[] getClasses(String packageName)\n\t\t\tthrows ClassNotFoundException, IOException {\n\t\tClassLoader classLoader = Thread.currentThread()\n\t\t\t\t.getContextClassLoader();\n\t\tassert classLoader != null;\n\t\tString path = packageName.replace('.', '/');\n\t\tEnumeration<URL> resources = classLoader.getResources(path);\n\t\tList<File> dirs = new ArrayList<File>();\n\t\twhile (resources.hasMoreElements()) {\n\t\t\tURL resource = resources.nextElement();\n\t\t\tdirs.add(new File(resource.getFile()));\n\t\t}\n\t\tArrayList<Class> classes = new ArrayList<Class>();\n\t\tfor (File directory : dirs) {\n\t\t\tclasses.addAll(findClasses(directory, packageName));\n\t\t}\n\t\treturn classes.toArray(new Class[classes.size()]);\n\t}", "private Map<String, Entity> parseJavaClasses(List<Path> classFiles) {\r\n logger.trace(\"parseJavaClass\");\r\n\r\n // Instantiate walker and listener\r\n ParseTreeWalker walker = new ParseTreeWalker();\r\n Java8CustomListener listener = new Java8CustomListener();\r\n\r\n classFiles.forEach(path -> {\r\n logger.trace(\"========== Parse: \" + path.toFile().getName() + \" ==========\");\r\n\r\n try {\r\n ParseTree tree = getTree(path);\r\n\r\n // walk through class\r\n walker.walk(listener, tree);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading creating tree for: {}\", path, e);\r\n }\r\n });\r\n\r\n return listener.getEntityMap();\r\n }", "public CompilationResult compile(TestConfiguration configuration) {\n TestUtilities.ensureDirectoryExists(new File(configuration.getOptions().get(\"-d\")));\n\n final StringWriter javacOutput = new StringWriter();\n DiagnosticCollector<JavaFileObject> diagnostics = new\n DiagnosticCollector<JavaFileObject>();\n\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);\n Iterable<? extends JavaFileObject> javaFiles =\n fileManager.getJavaFileObjects(configuration.getTestSourceFiles().toArray(new File[]{}));\n\n\n\n //Even though the method compilergetTask takes a list of processors, it fails if processors are passed this way\n //with the message:\n //error: Class names, 'org.checkerframework.checker.interning.InterningChecker', are only accepted if\n // annotation processing is explicitly requested\n //Therefore, we now add them to the beginning of the options list\n final List<String> options = new ArrayList<String>();\n options.add(\"-processor\");\n options.add(PluginUtil.join(\",\", configuration.getProcessors()));\n List<String> nonJvmOptions = new ArrayList<String>();\n for (String option : configuration.getFlatOptions()) {\n if (! option.startsWith(\"-J-\")) {\n nonJvmOptions.add(option);\n }\n }\n options.addAll(nonJvmOptions);\n\n if (configuration.shouldEmitDebugInfo()) {\n System.out.println(\"Running test using the following invocation:\");\n System.out.println(\"javac \" + PluginUtil.join(\" \", options) + \" \"\n + PluginUtil.join(\" \", configuration.getTestSourceFiles()));\n }\n\n JavaCompiler.CompilationTask task =\n compiler.getTask(javacOutput, fileManager, diagnostics, options, new ArrayList<String>(), javaFiles);\n\n /*\n * In Eclipse, std out and std err for multiple tests appear as one\n * long stream. When selecting a specific failed test, one sees the\n * expected/unexpected messages, but not the std out/err messages from\n * that particular test. Can we improve this somehow?\n */\n final Boolean compiledWithoutError = task.call();\n javacOutput.flush();\n return new CompilationResult(compiledWithoutError, javacOutput.toString(), javaFiles,\n diagnostics.getDiagnostics());\n }", "java.util.List<java.lang.String>\n getSourceFileList();", "public ClassInfo[] getClasses() {\r\n return classes.toArray(new ClassInfo[classes.size()]);\r\n }", "private static List<Class> findClasses(File directory, String packageName)\n\t\t\tthrows ClassNotFoundException {\n\t\tList<Class> classes = new ArrayList<Class>();\n\t\tif (directory.exists()) {\n\t\t\tFile[] files = directory.listFiles();\n\t\t\tfor (File file : files) {\n\t\t\t\tif (file.isDirectory()) {\n\t\t\t\t\tassert !file.getName().contains(\".\");\n\t\t\t\t\tclasses.addAll(findClasses(file,\n\t\t\t\t\t\t\tpackageName + \".\" + file.getName()));\n\t\t\t\t} else if (file.getName().endsWith(\".class\") && !file.getName().endsWith(\"Test.class\")) {\n\t\t\t\t\tclasses.add(Class.forName(packageName\n\t\t\t\t\t\t\t+ '.'\n\t\t\t\t\t\t\t+ file.getName().substring(0,\n\t\t\t\t\t\t\t\t\tfile.getName().length() - 6)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn classes;\n\t}", "public static List<String> getClassesFromFile(String fileName) throws Exception\r\n\t{\r\n\t\tValidationHelper.validateIfParameterIsNullOrEmpty(fileName, \"fileName\");\r\n\t\t\r\n\t\tFile file = new File(fileName);\r\n\t\t\r\n\t\tValidationHelper.validateIfFileParameterExists(file, fileName);\r\n\t\t\r\n\t\tList<String> classes = new ArrayList<String>();\r\n\t\t\r\n\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\r\n\t\t\r\n\t\tString temp = null;\r\n\t\t\r\n\t\twhile ((temp = reader.readLine()) != null)\r\n\t\t\tclasses.add(temp);\r\n\t\t\r\n\t\treturn classes;\r\n\t}", "public void execute()\n throws BuildException {\n this.validator = new TestClassValidator.DefaultClassValidator();\n this.validator.setListener(new TestClassValidator.ClassValidatorListener() {\n public void info(String message) {\n log(\"INFO> \" + message, verbosity);\n System.out.println(\"INFO> \" + message);\n }\n\n public void warning(String message) {\n log(\"WARNING> \" + message, verbosity);\n System.out.println(\"WARNING> \" + message);\n }\n\n public void error(String message) {\n log(\"ERROR> \" + message, verbosity);\n System.out.println(\"ERROR> \" + message);\n }\n });\n\n\n if (classpath != null) {\n classpath.setProject(project);\n this.loader = new AntClassLoader(project, classpath);\n }\n\n log(TestClassValidator.BANNER, Project.MSG_VERBOSE);\n System.out.println(TestClassValidator.BANNER);\n int count = 0;\n for (int i = 0; i < filesets.size(); i++) {\n FileSet fs = (FileSet) filesets.get(i);\n\n try {\n DirectoryScanner ds = fs.getDirectoryScanner(project);\n ds.scan();\n\n String[] files = ds.getIncludedFiles();\n\n for (int k = 0; k < files.length; k++) {\n String pathname = files[k];\n if (pathname.endsWith(\".class\")) {\n String classname = pathname.substring(0, pathname.length() - \".class\".length()).replace(File.separatorChar, '.');\n processFile(classname);\n }\n }\n count += files.length;\n } catch (BuildException e) {\n if (failonerror) {\n throw e;\n } else {\n log(e.getMessage(), quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);\n }\n } catch (ClassNotFoundException e) {\n if (failonerror) {\n throw new BuildException(e);\n } else {\n log(e.getMessage(), quiet ? Project.MSG_VERBOSE : Project.MSG_WARN);\n }\n }\n log(\"Number of classes: \" + count, Project.MSG_VERBOSE);\n System.out.println(\"Number of classes: \" + count);\n }\n }", "public static Set<String> getMazeJavaClasses() {\r\n\t\treturn Collections.unmodifiableSet(mazeJavaClasses);\r\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 }", "public List<File> getClasspathElements() {\n\t\tthis.parseSystemClasspath();\n\t return classpathElements;\n\t}", "public String[] readClasses();", "private ArrayList<char[]> getJavaFileList(String inputDir){\n\t\ttry {\n\t\t\treturn subdirectoriesToFiles(inputDir, new ArrayList<char[]>());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public Set<Class<?>> getScanClasses();", "public List<ClassDescription> scanSources()\n throws SCRDescriptorFailureException, SCRDescriptorException {\n final List<ClassDescription> result = new ArrayList<ClassDescription>();\n\n for (final Source src : project.getSources()) {\n if ( src.getFile().getName().equals(\"package-info.java\") ) {\n log.debug(\"Skipping file \" + src.getClassName());\n continue;\n }\n log.debug(\"Scanning class \" + src.getClassName());\n\n try {\n // load the class\n final Class<?> annotatedClass = project.getClassLoader().loadClass(src.getClassName());\n\n this.process(annotatedClass, src, result);\n } catch ( final SCRDescriptorFailureException e ) {\n throw e;\n } catch ( final SCRDescriptorException e ) {\n throw e;\n } catch ( final ClassNotFoundException e ) {\n log.warn(\"ClassNotFoundException: \" + e.getMessage());\n } catch ( final NoClassDefFoundError e ) {\n log.warn(\"NoClassDefFoundError: \" + e.getMessage());\n } catch (final Throwable t) {\n throw new SCRDescriptorException(\"Unable to load compiled class: \" + src.getClassName(), src.getFile().toString(), t);\n }\n }\n return result;\n }", "private List<List<XMLResults>> loadResults()\n {\n List<List<XMLResults>> ret = new ArrayList<List<XMLResults>>();\n\n for( Platform p : platforms ) {\n\n String platformResultsDir = p.resultsDir+\"/\"+p.libraryDir;\n\n File platformDir = new File(platformResultsDir);\n\n if( !platformDir.exists() ) {\n throw new RuntimeException(\"Results for \"+p.libraryDir+\" do not exist in \"+p.resultsDir);\n }\n\n List<XMLResults> opResults = new ArrayList<XMLResults>();\n\n File[] files = platformDir.listFiles();\n\n for( File f : files ) {\n String fileName = f.getName();\n\n if( fileName.contains(\".csv\")) {\n // extract the operation name\n String stripName = fileName.substring(0,fileName.length()-4);\n\n XMLResults r = new XMLResults();\n r.fileName = stripName;\n r.results = RuntimeResultsCsvIO.read(new File(f.getAbsolutePath()));\n\n opResults.add(r);\n }\n }\n\n ret.add( opResults );\n }\n\n return ret;\n }", "private static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException {\n List<Class<?>> classes = new ArrayList<Class<?>>();\n if (!directory.exists()) {\n return classes;\n }\n File[] files = directory.listFiles();\n for (File file : files) {\n if (file.isDirectory()) {\n assert !file.getName().contains(\".\");\n classes.addAll(findClasses(file, packageName + \".\" + file.getName()));\n } else if (file.getName().endsWith(\".class\")) {\n classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n }\n }\n return classes;\n }", "@Classpath\n @Incremental\n public abstract ConfigurableFileCollection getJavaResourceFiles();", "private static List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException {\n List<Class> classes = new ArrayList<Class>();\n if (!directory.exists()) {\n return classes;\n }\n File[] files = directory.listFiles();\n for (File file : files) {\n if (file.isDirectory()) {\n assert !file.getName().contains(\".\");\n classes.addAll(findClasses(file, packageName + \".\" + file.getName()));\n } else if (file.getName().endsWith(\".class\")) {\n classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n }\n }\n return classes;\n }", "public Stream<Class<?>> getClasses(@NotNull String packageName) {\n return CheckedFunction2.of(ClassLoader::getResources).unchecked()\n .reversed()\n .apply(packageName.replace('.', '/'))\n .andThen(Enumeration::asIterator)\n .andThen(urlIterator -> spliteratorUnknownSize(urlIterator, ORDERED))\n .andThen(urlSpliterator -> stream(urlSpliterator, false))\n .compose(Thread::getContextClassLoader)\n .apply(Thread.currentThread())\n .map(URL::getFile)\n .map(File::new)\n .flatMap(directory -> findClasses(directory, packageName));\n }", "void compileToJava();", "private static ArrayList<File> buildFilesArray() {\n ArrayList<File> result = new ArrayList<>();\n rAddFilesToArray(workingDirectory, result);\n return result;\n }", "@Override\n\tpublic List<Classes> findAllClasses() {\n\t\tString sql = \"select * from classes\";\n\t\tJdbcQuery querys = JdbcUtils.createNativeQuery(sql, Classes.class);\n\t\tList<Classes> classesList = (List<Classes>) querys.getResultList();\n\t\treturn classesList;\n\t}", "public List<Executable> listExecutables() throws IOException,\n\t\t\tClassNotFoundException {\n\t\treturn list(Executable.class);\n\t}", "@Test\n @Disabled(\"Not work in Java >=9\")\n void printAllClassJars() {\n var sysClassLoader = org.apache.commons.io.FileUtils.class.getClassLoader();\n var urLs = ((URLClassLoader) sysClassLoader).getURLs();\n for (var url : urLs) {\n System.out.println(url.getFile());\n }\n }", "@Override\n public List<Class> getAllUssdClasses(String packageName) {\n\n List<Class> commands = new ArrayList<Class>();\n List<String> classNames = new ArrayList<String>();\n\n JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n StandardJavaFileManager fileManager = compiler.getStandardFileManager(\n null, null, null);\n\n StandardLocation location = StandardLocation.CLASS_PATH;\n\n Set<JavaFileObject.Kind> kinds = new HashSet<>();\n kinds.add(JavaFileObject.Kind.CLASS);\n boolean recurse = false;\n Iterable<JavaFileObject> list = new ArrayList<>();\n try {\n list = fileManager.list(location, packageName,\n kinds, recurse);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n for (JavaFileObject javaFileObject : list) {\n String path = javaFileObject.toUri().getPath();\n String className = path.substring(path.lastIndexOf(\"/\") + 1, path.indexOf(\".\"));\n classNames.add(className);\n }\n\n for (String className : classNames) {\n Class klass = null;\n try {\n klass = Class.forName(packageName + \".\" + className);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n if (klass != null && klass.isAnnotationPresent(UssdService.class)) {\n commands.add(klass);\n }\n }\n return commands;\n }", "private List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException {\n List<Class> classes = new ArrayList<Class>();\n if (!directory.exists()) {\n return classes;\n }\n File[] files = directory.listFiles();\n for (File file : files) {\n if (file.isDirectory()) {\n assert !file.getName().contains(\".\");\n classes.addAll(findClasses(file, packageName + \".\" + file.getName()));\n } else if (file.getName().endsWith(\".class\")) {\n classes.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n }\n }\n return classes;\n }", "private void generateClassFiles(ClassTree classtree) {\n String[] packageNames = configuration.classDocCatalog.packageNames();\n for (int packageNameIndex = 0; packageNameIndex < packageNames.length;\n packageNameIndex++) {\n generateClassFiles(configuration.classDocCatalog.allClasses(\n packageNames[packageNameIndex]), classtree);\n }\n }", "private static List<Class<?>> findClasses(File directory, String packageName) throws ClassNotFoundException {\n\t\tList<Class<?>> classes = new ArrayList<Class<?>>();\n\t\tif (!directory.exists()) {\n\t\t\treturn classes;\n\t\t}\n\t\tFile[] files = directory.listFiles();\n\t\tfor (File file : files) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tassert !file.getName().contains(\".\");\n\t\t\t\tclasses.addAll(findClasses(file, packageName + \".\" + file.getName()));\n\t\t\t} else if (file.getName().endsWith(\".class\")) {\n\t\t\t\tclasses.add(Class.forName(packageName + '.' + file.getName().substring(0, file.getName().length() - 6)));\n\t\t\t}\n\t\t}\n\t\treturn classes;\n\t}", "public List<File> createJunitTestFiles(List<ExecutableSequence> sequences,\n\t\t\tString junitTestsClassName) {\n\t\tif (sequences.size() == 0) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"No sequences given to createJunitFiles. No Junit class created.\");\n\t\t\treturn new ArrayList<File>();\n\t\t}\n\n\t\t// Create the output directory.\n\t\tFile dir = getDir();\n\t\tif (!dir.exists()) {\n\t\t\tboolean success = dir.mkdirs();\n\t\t\tif (!success) {\n\t\t\t\tthrow new Error(\"Unable to create directory: \"\n\t\t\t\t\t\t+ dir.getAbsolutePath());\n\t\t\t}\n\t\t} else {\n\t\t\t// JJ\n\t\t\tFile[] files = dir.listFiles();\n\t\t\tfor (int i = 0; i < files.length; i++) {\n\t\t\t\tif (files[i].toString().contains(\"RandoopTest\"))\n\t\t\t\t\tfiles[i].delete();\n\t\t\t}\n\t\t}\n\n\t\tList<File> ret = new ArrayList<File>();\n\t\tList<List<ExecutableSequence>> subSuites = CollectionsExt\n\t\t\t\t.<ExecutableSequence> chunkUp(\n\t\t\t\t\t\tnew ArrayList<ExecutableSequence>(sequences),\n\t\t\t\t\t\ttestsPerFile);\n\t\tfor (int i = 0; i < subSuites.size(); i++) {\n\t\t\tret.add(writeSubSuite(subSuites.get(i), i, junitTestsClassName));\n\t\t}\n\t\tcreatedSequencesAndClasses.put(junitTestsClassName, subSuites);\n\t\treturn ret;\n\t}", "public ArrayList<Boolean> compareOutput() {\r\n\r\n\t\ttry {\r\n\t\t\tFile inputFile = new File(this.inOutFilesDirectory + \"entrada.txt\");\r\n\t\t\tFile outputFile = new File(this.inOutFilesDirectory + \"saida.txt\");\r\n\r\n\t\t\tArrayList<String> testSuite = readTestCasesFromFile(inputFile);\r\n\t\t\tArrayList<String> expectedOutput = readExpectedOutputsFromFile(outputFile);\r\n\t\t\tArrayList<Boolean> testVerdicts = new ArrayList<Boolean>(\r\n\t\t\t\t\ttestSuite.size());\r\n\r\n\t\t\tPrintStream stdout = System.out;\r\n\t\t\tOurOutputStream ourOutputStream = new OurOutputStream();\r\n\r\n\t\t\tSystem.setOut(new PrintStream(ourOutputStream));\r\n\r\n\t\t\tURLClassLoader cl;\r\n\t\t\tClass<?> testClass;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tTestExecutionFileFilter tv = new TestExecutionFileFilter();\r\n\t\t\t\t// Gets the names of all java files inside sourceDirectory\r\n\t\t\t\tArrayList<String> listSource = tv\r\n\t\t\t\t\t\t.visitAllDirsAndFiles(new File(sourceDirectory));\r\n\t\t\t\tif (listSource.size() != 0) {\r\n\t\t\t\t\tString pathFile = tv.findMainClass();\r\n\t\t\t\t\tString path = pathFile.substring(sourceDirectory.length(),\r\n\t\t\t\t\t\t\tpathFile.lastIndexOf(File.separator) + 1).replace(\r\n\t\t\t\t\t\t\tFile.separator, \".\");\r\n\t\t\t\t\tcl = new URLClassLoader(new URL[] { new File(\r\n\t\t\t\t\t\t\tsourceDirectory).toURI().toURL() });\r\n\t\t\t\t\ttestClass = cl.loadClass(path + Constants.mainClass);\r\n\r\n\t\t\t\t\tClass<?>[] getArg1 = { (new String[1]).getClass() };\r\n\t\t\t\t\tMethod m = testClass.getMethod(\"main\", getArg1);\r\n\r\n\t\t\t\t\tfor (int i = 0; i < testSuite.size(); i++) {\r\n\t\t\t\t\t\t// Solution Execution\r\n\t\t\t\t\t\tString[] arg1 = testSuite.get(i).split(\r\n\t\t\t\t\t\t\t\tConstants.TEST_DATA_SEPARATOR);\r\n\t\t\t\t\t\tObject[] args = { arg1 };\r\n\t\t\t\t\t\tm.invoke(null, args);\r\n\r\n\t\t\t\t\t\t// Result comparison\r\n\t\t\t\t\t\ttestVerdicts.add(\r\n\t\t\t\t\t\t\t\ti,\r\n\t\t\t\t\t\t\t\tcompareActualAndExpectedOutputs(\r\n\t\t\t\t\t\t\t\t\t\tourOutputStream.toString(),\r\n\t\t\t\t\t\t\t\t\t\texpectedOutput.get(i)));\r\n\r\n\t\t\t\t\t\t// Stream cleaning\r\n\t\t\t\t\t\tourOutputStream.flushOurStream();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tSystem.setOut(stdout);\r\n\t\t\t\t\tsetResult(\"OK!\");\r\n\t\t\t\t\treturn testVerdicts;\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\t\tsetResult(null);\r\n\t\t\t}\r\n\t\t} catch (EasyCorrectionException ece) {\r\n\t\t\treturn new ArrayList<Boolean>();\r\n\t\t}\r\n\t\treturn new ArrayList<Boolean>();\r\n\t}", "public static Class<?>[] findTestClasses(Class<?> clazz) throws ClassNotFoundException {\n\t\tFile testDir = findClassDir(clazz);\n\t\treturn findTestClasses(testDir);\n\t}", "@Override\n\tpublic List<Class<?>> getResultClasses() {\n\t\treturn Arrays.asList(String.class, JSONResult.class);\n\t}", "public Collection<CartridgeClasspathData> getAllCartridgeClassPaths() {\n\t\tif (this.cartridgeClassPaths == null) {\n\t\t\tthis.cartridgeClassPaths = this.setupCartridgeClassPaths();\n\t\t}\n\t\treturn this.cartridgeClassPaths.values();\n\t}", "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 }", "public com.google.protobuf.ProtocolStringList\n getClasspathList() {\n return classpath_;\n }", "public List<File> createJunitFiles(List<ExecutableSequence> sequences,\n\t\t\tList<Class<?>> allClasses) {\n\t\tList<File> ret = new ArrayList<File>();\n\t\tret.addAll(createJunitTestFiles(sequences));\n\t\tret.add(writeDriverFile(allClasses));\n\t\treturn ret;\n\t}", "@PathSensitive(PathSensitivity.RELATIVE)\n @InputFiles\n @SkipWhenEmpty\n public FileCollection getClassesDirs() {\n return classesDirs;\n }", "private ArrayList<String> gettemplates(){\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\ttry {\n\t\t String[] cmd = {\n\t\t \t\t\"/bin/sh\",\n\t\t \t\t\"-c\",\n\t\t \t\t\"ls -p | grep -v / | grep -v 'pom.xml' \"\n\t\t \t\t};\n\n\t\t Process p = Runtime.getRuntime().exec(cmd); //Runtime r = Runtime.getRuntime(); Process p = r.exec(cmd);\n\t\t BufferedReader in =\n\t\t new BufferedReader(new InputStreamReader(p.getInputStream()));\n\t\t String inputLine;\n\t\t while ((inputLine = in.readLine()) != null) {\n\t\t result.add(inputLine);\n\t\t }\n\t\t in.close();\n\n\t\t} catch (IOException e) {\n\t\t System.out.println(e);\n\t\t}\n\t\t\n\t\treturn result;\n\t\t}", "static URL[] getClassPath() throws MalformedURLException {\n List<URL> classPaths = new ArrayList<>();\n\n classPaths.add(new File(\"target/test-classes\").toURI().toURL());\n\n // Add this test jar which has some frontend resources used in tests\n URL jar = getTestResource(\"jar-with-frontend-resources.jar\");\n classPaths.add(jar);\n\n // Add other paths already present in the system classpath\n ClassLoader classLoader = ClassLoader.getSystemClassLoader();\n URL[] urls = URLClassLoader.newInstance(new URL[] {}, classLoader)\n .getURLs();\n for (URL url : urls) {\n classPaths.add(url);\n }\n return classPaths.toArray(new URL[0]);\n }", "private void compileJavaFiles(File binDir, File javaFile) throws Exception {\n\t\tPathAssert.assertFileExists(\"Java Source\", javaFile);\n\t\tJavaCompiler compiler = ToolProvider.getSystemJavaCompiler();\n\t\tLinkedList<File> classpath = ClassPathUtil.getClassPath();\n\t\tclasspath.add(0, binDir);\n\t\tStringBuilder cp = new StringBuilder();\n\t\tClassPathUtil.appendClasspath(cp, classpath);\n\t\tif (compiler.run(null, System.out, System.err, \"-cp\", cp.toString(), javaFile.getAbsolutePath()) != 0) {\n\t\t\tthrow new Exception(\"Exception while compiling file\");\n\t\t}\n\t}", "public static Collection<Class> getClassesForPackage(String packageName)\n throws Exception {\n String packagePath = packageName.replace(\".\", \"/\");\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n Set<URL> jarUrls = new HashSet<URL>();\n\n while (classLoader != null) {\n if (classLoader instanceof URLClassLoader) {\n for (URL url : ((URLClassLoader) classLoader).getURLs()) {\n if (url.getFile().endsWith(\".jar\")) // may want better way to detect jar files\n {\n jarUrls.add(url);\n } // if\n } // for\n } // if\n\n classLoader = classLoader.getParent();\n } // while\n\n Set<Class> classes = new HashSet<Class>();\n\n for (URL url : jarUrls) {\n JarInputStream stream = new JarInputStream(url.openStream()); // may want better way to open url connections\n JarEntry entry = stream.getNextJarEntry();\n\n while (entry != null) {\n String name = entry.getName();\n\n if (name.endsWith(\".class\") && name.substring(0,\n packagePath.length()).equals(packagePath)) {\n classes.add(Class.forName(name.substring(0,\n name.length() - 6).replace(\"/\", \".\")));\n } // if\n\n entry = stream.getNextJarEntry();\n } // while\n\n stream.close();\n } // for\n\n return classes;\n }", "public static Hashtable<String, ArrayList<String>> createClassTable() {\n\t\tResourceHandler resourceHandler = getResourceHandler(CLASSES_DIR);\n\t\tHashtable<String, ArrayList<String>> table = new Hashtable<String, ArrayList<String>>();\n\t\tfor(String dir : resourceHandler.listDirs()){\n\t\t\ttable.put(dir, new ArrayList<String>());\n\t\t\tfor(String file : resourceHandler.listFiles(dir)){\n\t\t\t\tfile = file.replaceAll(\"/\", \"\");\n\t\t\t\tif(!dir.endsWith(\"/\")){\n\t\t\t\t\tfile = \"/\" + file;\n\t\t\t\t}\n\t\t\t\ttable.get(dir).add(StringUtils.toFileName((dir+file.replaceAll(\"\\\\.xml\", \"\"))));\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}", "public List<String> getClassesList() {\n\t\tCursor c = theDb.rawQuery(\"SELECT * \" +\n\t\t\t\t\t\t\t\t \"FROM \" + DbContract.Classes.TABLE_NAME, null);\n\t\t\n\t\t//Read cursor into an ArrayList\n\t\tList<String> classesList = new ArrayList<String>();\n\t\tclassesList.add( context.getString(R.string.all_classes) );\t\t\t//Add \"All classes\"\n\t\t\n\t\twhile (c.moveToNext()) {\n\t\t\tclassesList.add( c.getString( c.getColumnIndex(DbContract.Classes.ATTRIBUTE_NAME)));\n\t\t}\n\t\t\n\t\treturn classesList;\n\t}", "public abstract Class<?>[] getCoClasses();", "public List<Class<?>> getKnownClasses();", "@SuppressWarnings(\"unchecked\")\n public void loadClasses(String pckgname) throws ClassNotFoundException {\n File directory = null;\n try {\n ClassLoader cld = Thread.currentThread().getContextClassLoader();\n String path = \"/\" + pckgname.replace(\".\", \"/\");\n URL resource = cld.getResource(path);\n if (resource == null) {\n throw new ClassNotFoundException(\"sem classes no package \" + path);\n }\n directory = new File(resource.getFile());\n }\n catch (NullPointerException x) {\n throw new ClassNotFoundException(pckgname + \" (\" + directory + \") package invalido\");\n }\n if (directory.exists()) {\n String[] files = directory.list();\n for (int i = 0; i < files.length; i++) {\n if (files[i].endsWith(\".class\") && !files[i].contains(\"$\")) {\n Class cl = Class.forName(pckgname + '.' + files[i].substring(0, files[i].length() - 6));\n Method methods[] = cl.getDeclaredMethods();\n boolean ok = false;\n for (Method m : methods) {\n if ((m.getReturnType().equals(List.class) || m.getReturnType().isArray()) && m.getParameterTypes().length == 0) {\n ok = true;\n break;\n }\n }\n if (ok) {\n classes.add(cl);\n }\n }\n }\n }\n else {\n throw new ClassNotFoundException(pckgname + \" package invalido\");\n }\n }", "@SneakyThrows\n private Stream<Class<?>> findClasses(File directory, String packageName) {\n\n val lookForClasses =\n Function2.of(ReflectionUtils::lookForClasses)\n .apply(packageName);\n\n return Optional.of(directory)\n .filter(File::exists)\n .map(File::listFiles)\n .stream()\n .flatMap(Arrays::stream)\n .flatMap(lookForClasses);\n }", "private void listAllClasses(List<Path> foundFiles, Path root) {\r\n if (root.toFile().isFile()) {\r\n foundFiles.add(root);\r\n } else {\r\n try (DirectoryStream<Path> stream = Files.newDirectoryStream(root, filter)) {\r\n for (Path path : stream) {\r\n if (Files.isDirectory(path)) {\r\n listAllClasses(foundFiles, path);\r\n } else {\r\n foundFiles.add(path);\r\n }\r\n }\r\n } catch (AccessDeniedException e) {\r\n logger.error(\"Access denied to directory {}\", root, e);\r\n } catch (IOException e) {\r\n logger.error(\"Error while reading directory {}\", root, e);\r\n }\r\n }\r\n }", "@Override\n protected List<String> compute() {\n List<String> fileNames = new ArrayList<>();\n\n // FolderProcessor tasks to store the sub-tasks that are going to process the sub-folders stored inside folder.\n List<FolderProcessor> subTasks = new ArrayList<>();\n\n // Get the content of the folder.\n File file = new File(path);\n File content[] = file.listFiles();\n\n //For each element in the folder, if there is a subfolder, create a new FolderProcessor object\n //and execute it asynchronously using the fork() method.\n for (int i = 0; i < content.length; i++) {\n if (content[i].isDirectory()) {\n FolderProcessor task = new FolderProcessor(content[i].getAbsolutePath(), extension);\n task.fork();\n subTasks.add(task);\n } else {\n //Otherwise, compare the extension of the file with the extension you are looking for using the checkFile() method\n //and, if they are equal, store the full path of the file in the list of strings declared earlier.\n\n if (checkFile(content[i].getName())) {\n fileNames.add(content[i].getAbsolutePath());\n }\n }\n }\n\n //If the list of the FolderProcessor sub-tasks has more than 50 elements,\n //write a message to the console to indicate this circumstance.\n if (subTasks.size() > 50) {\n System.out.printf(\"%s: %d tasks ran.\\n\", file.getAbsolutePath(), subTasks.size());\n }\n\n // Add the results from the sub-tasks.\n addResultsFrommSubTasks(fileNames, subTasks);\n\n return fileNames;\n }", "@SuppressWarnings(\"rawtypes\")\n public static Iterable<Class> getClasses(String packageName) throws ClassNotFoundException, IOException\n {\n return getClasses(packageName, null);\n }", "private List<Class> getClasses(final String scanPackage) {\n ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);\n provider.addIncludeFilter(new AnnotationTypeFilter(ElementEntity.class));\n provider.addIncludeFilter(new AnnotationTypeFilter(VertexEntity.class));\n provider.addIncludeFilter(new AnnotationTypeFilter(EdgeEntity.class));\n provider.addIncludeFilter(new AnnotationTypeFilter(EmbeddedEntity.class));\n Set<BeanDefinition> beanDefinitionSet = provider.findCandidateComponents(scanPackage);\n List<Class> entityClasses = new ArrayList<>();\n for (BeanDefinition beanDefinition : beanDefinitionSet) {\n String beanClassName = beanDefinition.getBeanClassName();\n try {\n entityClasses.add(Class.forName(beanClassName));\n } catch (ClassNotFoundException e) {\n LOG.error(\"Generate class: {}'s schema error: \", beanClassName, e);\n }\n }\n return entityClasses;\n }", "java.util.List<com.google.devtools.kythe.proto.Java.JarDetails.Jar> \n getJarList();", "@ApiModelProperty(value = \"A list of classification results\")\n public List<ProjectClassificationResult> getClassificationResults() {\n return classificationResults;\n }", "public interface CompilerTestCase {\n\t/**\n * Retrieve the list of files whose compilation would be tested.\n * @return a list of files in relative or absolute position.\n */\n public String[] getClassesToCompile();\n \n /**\n * Perform the test.\n * \n * @param diagnostics the compiler diagnostics for the evaluated files.\n * @param stdoutS the output of the compiler.\n * @param result the result of the compilation. True if succeeded, false if not.\n */\n public void test(List<Diagnostic<? extends JavaFileObject>> diagnostics, String stdoutS, Boolean result);\n\n}", "private ArrayList<String> getJARList() {\n String[] jars = getJARNames();\n return new ArrayList<>(Arrays.asList(jars));\n }", "public List<Path> getTestFiles() throws Exception {\n try (Stream<Path> stream = Files.list(Paths.get(BibTeXMLImporterTest.class.getResource(\"\").toURI()))) {\n return stream.filter(p -> !Files.isDirectory(p)).collect(Collectors.toList());\n }\n\n }", "private List<String> getClassesInPackage(String packageUniqueName) {\n List<String> result = new ArrayList<String>();\n if (theModel.packages.containsKey(packageUniqueName)){\n \tTreeSet<String> children = theModel.packages.get(packageUniqueName).children;\n \tif ((children != null)){\n \t\tfor (String uniqueName : children){\n \t\t\tFamixClass foundClass = theModel.classes.get(uniqueName);\n \t\t\tif (foundClass != null){\n \t\t\t\tresult.add(uniqueName);\n \t\t\t\tif (foundClass.hasInnerClasses){\n \t\t\t\t\tresult.addAll(foundClass.children);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }\n return result;\n }", "protected File[] getFiles() {\r\n DirectoryScanner scanner = new DirectoryScanner(rootDir,true,\"*.xml\");\r\n List<File> files = scanner.list();\r\n return files.toArray(new File[files.size()]);\r\n }", "List<? extends Test> build() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException{\n\t\tfor(String eachPositive:this.listOfPositive){\n\t\t\tcreateTest(eachPositive, getPositiveFileContent(eachPositive));\n\t\t}\n\t\tfor(String eachNegative:this.listOfNegative){\n\t\t\tcreateTest(eachNegative, getNegativeFileContent(eachNegative));\n\t\t}\n\t\t\n\t\t// create class loader\n\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { new File(PATH_BASE).toURI().toURL() });\n\t\t\n\t\t// load all classes\n\t\tList<NamedTestCase> returnValue=new ArrayList<NamedTestCase>(this.listOfNegative.size()+this.listOfPositive.size());\n\t\tfor(String eachPositive:this.listOfPositive){\n\t\t\tClass<?> cls = Class.forName(eachPositive, true, classLoader);\n\t\t\treturnValue.add((NamedTestCase)cls.newInstance());\n\t\t}\n\t\tfor(String eachNegative:this.listOfNegative){\n\t\t\tClass<?> cls = Class.forName(eachNegative, true, classLoader);\n\t\t\treturnValue.add((NamedTestCase)cls.newInstance());\n\t\t}\n\n\t\t// sort for output\n\t\tCollections.sort(returnValue, new Comparator<NamedTestCase>(){\n\t\t\t@Override\n\t\t\tpublic int compare(NamedTestCase o1, NamedTestCase o2) {\n\t\t\t\treturn o2.getName().compareTo(o1.getName());\n\t\t\t}\n\t\t});\n\t\treturn returnValue; \n\t}", "private String[] buildClassPath( final File systemFile,\n final List<LocalSystemFile> systemFiles,\n final Configuration configuration )\n {\n final StringBuilder prepend = new StringBuilder();\n final StringBuilder append = new StringBuilder();\n for( LocalSystemFile ref : systemFiles )\n {\n if( ref.getSystemFileReference().shouldPrepend() )\n {\n if( prepend.length() != 0 )\n {\n prepend.append( File.pathSeparator );\n }\n prepend.append( ref.getFile().getAbsolutePath() );\n }\n else\n {\n if( append.length() != 0 )\n {\n append.append( File.pathSeparator );\n }\n append.append( ref.getFile().getAbsolutePath() );\n }\n }\n if( prepend.length() != 0 )\n {\n prepend.append( File.pathSeparator );\n }\n if( append.length() != 0 )\n {\n append.insert( 0, File.pathSeparator );\n }\n final StringBuilder classPath = new StringBuilder();\n classPath.append( prepend );\n classPath.append( systemFile.getAbsolutePath() );\n classPath.append( append );\n classPath.append( configuration.getClasspath() );\n \n return classPath.toString().split( File.pathSeparator );\n }", "public File[] listFiles() {\n\n\t\tFileFilter Ff = f -> true;\n\t\treturn this.listFiles(Ff);\n\t}", "List<Class<?>> getManagedClasses();", "public com.google.protobuf.ProtocolStringList\n getClasspathList() {\n return classpath_.getUnmodifiableView();\n }", "@Override\n\tpublic List<Classe> getClasses() {\n\t\treturn classeRepository.findAll();\n\t}", "@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 }", "private void scanClass(String scanPackage) {\n URL url = this.getClass().getClassLoader().getResource(\"/\" + scanPackage.replaceAll(\"\\\\.\", \"/\"));\n File dir = new File(url.getFile());\n for (File file : dir.listFiles()) {\n if (file.isDirectory()) {\n scanClass(scanPackage + \".\" + file.getName());\n } else {\n classNames.add(scanPackage + \".\" + file.getName().replaceAll(\".class\", \"\").trim());\n }\n }\n\n }", "@Classpath\n @InputFiles\n public FileCollection getClasspath() {\n return _classpath;\n }" ]
[ "0.73677695", "0.72260654", "0.6937138", "0.6440683", "0.64101696", "0.6336952", "0.62327325", "0.62143844", "0.6143613", "0.61327165", "0.60719943", "0.6025785", "0.59797865", "0.59516513", "0.5904629", "0.5900357", "0.5874373", "0.5839229", "0.58131194", "0.57844263", "0.57593274", "0.5721267", "0.5694295", "0.5692524", "0.56734884", "0.5663474", "0.566249", "0.563163", "0.56302756", "0.5629626", "0.56163025", "0.56045", "0.5583316", "0.55808324", "0.5563667", "0.55524933", "0.55477464", "0.5516925", "0.5495027", "0.5486992", "0.5482305", "0.5479614", "0.54795915", "0.5470459", "0.5469918", "0.5469015", "0.5465064", "0.54630697", "0.54584527", "0.54575783", "0.5456754", "0.5446127", "0.5435755", "0.5431745", "0.5419611", "0.5403124", "0.5387898", "0.5387385", "0.5385417", "0.53712004", "0.53693223", "0.53441674", "0.5341987", "0.533296", "0.5329396", "0.5327964", "0.53256136", "0.5320045", "0.53098375", "0.53081095", "0.52963513", "0.5293885", "0.5286449", "0.52838176", "0.528057", "0.527928", "0.5267692", "0.5266417", "0.52625024", "0.5257061", "0.525583", "0.52557665", "0.5239684", "0.5226872", "0.52199966", "0.5205287", "0.52036726", "0.5202072", "0.51965535", "0.51939297", "0.5193897", "0.5192428", "0.5183822", "0.5171313", "0.51548326", "0.51519555", "0.5151588", "0.5149949", "0.51384073", "0.5132838" ]
0.7576886
0
TODO Autogenerated method stub
@Override public boolean onDoubleTap(MotionEvent e) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onAnimationStart(Animation animation) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onAnimationRepeat(Animation animation) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
nothing to do here
@Override public void onScaleEnd(ScaleGestureDetector detector) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "private void kk12() {\n\n\t}", "private static void cajas() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void smell() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "public final void mo51373a() {\n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "private void strin() {\n\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public void method_4270() {}", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void baocun() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "protected void mo6255a() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "public void redibujarAlgoformers() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "private static void iterator() {\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public void mo4359a() {\n }", "@Override\n protected void prot() {\n }", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doNext() {\n\t\t\r\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "protected boolean func_70814_o() { return true; }", "private void m50366E() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "public abstract void mo70713b();", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void compute() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n public void preprocess() {\n }", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "private void parseData() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void mo12628c() {\n }", "@Override\n\tpublic void processing() {\n\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void apply() {\n\t\t\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private void sub() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "protected void additionalProcessing() {\n\t}", "void berechneFlaeche() {\n\t}", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "public void Tyre() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "public void mo21877s() {\n }", "@Override\r\n\tpublic int sub() {\n\t\treturn 0;\r\n\t}", "private void remplirFabricantData() {\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n public void preprocess() {\n }", "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "public void mo6081a() {\n }", "@Override\n protected void init() {\n }" ]
[ "0.63796103", "0.6334971", "0.63205105", "0.6302668", "0.62852556", "0.6225275", "0.6146525", "0.6146525", "0.6144452", "0.60714036", "0.6044127", "0.6036487", "0.6034698", "0.6028312", "0.6009376", "0.60046643", "0.6002409", "0.59945714", "0.5979857", "0.59783345", "0.59775615", "0.59374535", "0.5936246", "0.5920857", "0.59174806", "0.5909387", "0.58943886", "0.5893071", "0.58459413", "0.583889", "0.5836388", "0.5820018", "0.5816212", "0.58142424", "0.57704717", "0.5769853", "0.5769853", "0.57654554", "0.5753895", "0.57275426", "0.57217467", "0.5704513", "0.5688861", "0.56851494", "0.56822747", "0.5679117", "0.56702274", "0.56509894", "0.5639693", "0.5639693", "0.5638187", "0.5630849", "0.5626496", "0.56236434", "0.5616146", "0.5613672", "0.561237", "0.5611539", "0.560555", "0.56031746", "0.55898", "0.5586348", "0.558419", "0.5581198", "0.5571984", "0.5561442", "0.5556029", "0.55553496", "0.5535239", "0.5533034", "0.5520651", "0.5519025", "0.5518827", "0.5518372", "0.55165464", "0.55165464", "0.55157036", "0.550578", "0.5503049", "0.55027115", "0.5488437", "0.5488437", "0.5488437", "0.5488437", "0.5488437", "0.5488437", "0.5488437", "0.54883677", "0.54855114", "0.54682034", "0.5460719", "0.5455392", "0.54415506", "0.5440544", "0.54357344", "0.54306525", "0.54305184", "0.5427702", "0.5425335", "0.54150033", "0.5413145" ]
0.0
-1
TODO Why don't you parametrised thi methods ?? Fixed, I made the method universal as it should have been
@Test public void metalAndColorsTest() { JdiSite.homePage.openNewPageByHeaderMenu(HeaderMenuItem.METALS_AND_COLORS); JdiSite.metalAndColorsPage.checkOpened(); // !TODO - I decided to remove the method from MetalAndColorsForm and make it easier JdiSite.metalAndColorsPage.fillAndSubmitMetalAndColorsForm(DefaultsData.DEFAULT_DATA); JdiSite.metalAndColorsPage.checkResults(DefaultsData.DEFAULT_DATA); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void func02() {\n\t\t\r\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "@Override\r\n\tpublic void func01() {\n\t\t\r\n\t}", "public abstract void afvuren();", "public interface ICommonAction {\n\n void obtainData(Object data, String methodIndex, int status,Map<String, String> parameterMap);\n\n\n}", "abstract String applicable(Method[] getters) throws InvalidObjectException;", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "@Override\r\n\tvoid func04() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void method() {\n\t\r\n\t}", "@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}", "abstract void method();", "@Override\n protected void adicionar(Funcionario funcionario) {\n\n }", "public void method_201() {}", "Operations operations();", "private void someUtilityMethod() {\n }", "private void someUtilityMethod() {\n }", "@Override\n\tpublic void myMethod() {\n\t\t\n\t}", "protected abstract Set method_1559();", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void method(){}", "public interface IMostSpecificOverloadDecider\n{\n OverloadRankingDto inNormalMode(\n WorkItemDto workItemDto, List<OverloadRankingDto> applicableOverloads, List<ITypeSymbol> argumentTypes);\n\n //Warning! start code duplication, more or less the same as in inNormalMode\n List<OverloadRankingDto> inSoftTypingMode(\n WorkItemDto workItemDto, List<OverloadRankingDto> applicableOverloads);\n}", "@Override\n\tpublic void function() {\n\t\t\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void buscar() {\n\t\t\n\t}", "public void method_4270() {}", "@Override\r\n\tpublic void Method1() {\n\t\t\r\n\t}", "public abstract Result mo5059a(Params... paramsArr);", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\r\n\tpublic void Method3() {\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void dosomething() {\n\t\t\n\t}", "List method_111(class_922 var1, int var2, int var3, int var4);", "public interface CommonEntityMethod extends ToJson,GetFieldValue,SetFieldValue{\n}", "public interface Methods {\n\n /**\n * List all static methods for a given content model.\n *\n * @param cmpid Pid of the content model.\n * @param asOfTime Use the methods defined at this time (unix time in ms), or null for now.\n *\n * @return List of methods defined.\n * @throws BackendInvalidCredsException If current credentials provided are invalid.\n * @throws BackendMethodFailedException If communicating with Fedora failed.\n * @throws BackendInvalidResourceException\n * If content model doesn't exist.\n */\n public List<Method> getStaticMethods(String cmpid,\n Long asOfTime)\n throws\n BackendInvalidCredsException,\n BackendMethodFailedException,\n BackendInvalidResourceException;\n\n /**\n * List all dynamic methods for a given object.\n *\n * @param objpid Pid of the object.\n * @param asOfTime Use the methods defined at this time (unix time in ms), or null for now.\n *\n * @return List of methods defined.\n * @throws BackendInvalidCredsException If current credentials provided are invalid.\n * @throws BackendMethodFailedException If communicating with Fedora failed.\n * @throws BackendInvalidResourceException\n * If object doesn't exist.\n */\n public List<Method> getDynamicMethods(String objpid,\n Long asOfTime)\n throws\n BackendInvalidCredsException,\n BackendMethodFailedException,\n BackendInvalidResourceException;\n\n /**\n * Invoke a given method with the given parameters.\n *\n * @param pid The pid of the content model or object defining the method.\n * @param methodName The name of the method.\n * @param parameters Parameters for the method, as a map from name list of values.\n * @param asOfTime Use the methods defined at this time (unix time in ms), or null for now.\n *\n * @return Result of calling method.\n * @throws BackendInvalidCredsException If current credentials provided are invalid.\n * @throws BackendMethodFailedException If communicating with Fedora failed.\n * @throws BackendInvalidResourceException\n * If object, content model or method doesn't exist.\n */\n public String invokeMethod(String pid,\n String methodName,\n Map<String, List<String>> parameters,\n Long asOfTime)\n throws\n BackendInvalidCredsException,\n BackendMethodFailedException,\n BackendInvalidResourceException;\n}", "abstract void uminus();", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public interface C2541a {\n /* renamed from: O */\n boolean mo6498O(C41531v c41531v);\n\n /* renamed from: P */\n boolean mo6499P(C41531v c41531v);\n\n /* renamed from: a */\n void mo6500a(int i, int i2, Object obj, boolean z);\n\n /* renamed from: a */\n void mo6501a(C41531v c41531v, View view, Object obj, int i);\n\n /* renamed from: a */\n boolean mo6502a(C41531v c41531v, Object obj);\n\n /* renamed from: b */\n View mo6503b(RecyclerView recyclerView, C41531v c41531v);\n\n /* renamed from: by */\n void mo6504by(Object obj);\n\n /* renamed from: cu */\n void mo6505cu(View view);\n}", "@Override\n\t\t\t\t\tpublic Method handleSimpleMethod(Element parent, FMethod src) {\n\t\t\t\t\t\treturn super.handleSimpleMethod(parent, src);\n\t\t\t\t\t}", "@Override\n\tvoid methodabstract() {\n\t\t\n\t}", "public void method_115() {}", "public interface IFollowTheMoney {\n\n ArrayList<FollowTheMoneyLegislator> getFollowTheMoneyLegislatorData(ArrayList<FollowTheMoneyLegislator> followTheMoneyArrayList);\n void getFollowTheMoneyLegislatorByLegID(ArrayList<FollowTheMoneyLegislator> followTheMoneyArrayList, String followTheMoneyID);\n void getFollowTheMoneyLegislatorByLastName(ArrayList<FollowTheMoneyLegislator> followTheMoneyArrayList, String lastName);\n\n\n\n}", "abstract protected boolean checkMethod();", "@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}", "public abstract void mo70713b();", "@Override\r\n\tpublic void Method2() {\n\t\t\r\n\t}", "abstract int pregnancy();", "public void method_192() {}", "public abstract void operation();", "public interface ch\n{\n\n public abstract void a(bv bv, p p, h h, long l, int i, int j, \n IMediaItem imediaitem);\n}", "public abstract String mo9238av();", "public abstract String mo9239aw();", "public abstract void mo56925d();", "public void method_202() {}", "public abstract void mo102899a();", "@FunctionalInterface\npublic interface ParamsHandlerFunc extends BaseHandlerFunc{\n\n default String handleRequest(Request request, Response response) {\n String check = checkSign(request);\n if (StringUtils.isNotBlank(check)) {\n return check;\n }\n Map<String, String> id = request.params();\n Answer processed = process(id);\n response.status(processed.getCode());\n return dataToJson(processed);\n }\n\n Answer process(Map<String, String> data);\n}", "protected abstract void handle(Object... params);", "public interface RestrictVatIdNumber<SELF extends Restrict<SELF>> extends Restrict<SELF>\n{\n\n default SELF vatIdNumber(String... numbers)\n {\n return restrict(\"vatIdNumber\", (Object[]) numbers);\n }\n\n default SELF vatIdNumbers(Collection<String> numbers)\n {\n return vatIdNumber(numbers.toArray(new String[numbers.size()]));\n }\n\n}", "@Override\n\tpublic Void visit(OwnMethodCall method) {\n\t\tprintIndent(\"implicit dispatch\");\n\t\tindent++;\n\t\tmethod.methodName.accept(this);\n\t\tfor (var v : method.args) \n\t\t\tv.accept(this);\n\t\tindent--;\n\t\treturn null;\n\t}", "@Override\n public void memoria() {\n \n }", "public abstract void mo30696a();", "public interface HttpDriver {\n public <R,T> T execute(HttpMethod method, String uri, R entity, Type expected) throws HttpDriverException;\n}", "@Override\n\tpublic void randomMethod(String name) {\n\t\t\n\t}", "@Override\n\tpublic void some() {\n\t\t\n\t}", "public interface MethodInteraction {\n\n void onMethodEdit(Method method, String newBody);\n\n void onMethodDrag(RecyclerView.ViewHolder holder);\n}", "public abstract void method1();", "public interface ConsultParametersBack {\n\t\n \t/**\n *\n * Method consultParametersArmed\n * @return ResponseEntity<?> value as parameter.\n *\n * @param ConsultParametersInDTO beanConsultParametersIn\n * @param HttpServletRequest request\n\t*\n */\n\tpublic ResponseEntity<?> consultParametersArmed(ConsultParametersInDTO beanConsultParametersIn, HttpServletRequest request);\n\n}", "public void method_191() {}", "public interface IRDubboProInvestImageService {\n /**\n * searchProInvestHotList\n * 品类网 特殊定制 合并调用 拼 pic 获取url\n @param hotStatus hot表状态\n * @param hot_siteId hot表站点id\n * @param orderType hot排序\n * @param webCategory 分类\n * @param num 显示条数\n * @param oldPicFormat old规格\n * @param newPicFormat new规格\n * @return\n * String\n * @author guoYang\n * @supply\n * @date 2013-8-8 下午3:44:53\n * @exception\n * @since 1.0\n */\n public String searchProInvestHotList(int hotStatus,int hot_siteId,String orderType,String webCategory,int num,\n String oldPicFormat,String newPicFormat);\n}", "protected abstract T mo2623i();", "public void method_200() {}", "public abstract void mo27385c();", "void method_115();", "public abstract Object mo26777y();", "public abstract void mo4359a();", "public abstract void mo27386d();", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void method1() {\n\t}", "@FunctionalInterface // or we can call it SAM\r\n interface ShowMe{\r\n\t\r\n\t void showOk();\r\n\t \r\n\tpublic default void one()\r\n\t {\r\n\t System.out.println(\"method one \");\r\n };\r\n \r\n public static void one1()\r\n {\r\n System.out.println(\"method one 1 \");\r\n };\r\n \r\n public default void one2()\r\n \t {\r\n \t System.out.println(\"method one2 \");\r\n };\r\n \r\n }", "private void mappingMethods() throws SecurityException, NoSuchMethodException{\n\t\tmappingMethodGet();\n\t\tmappingMethodSet();\n\t}", "abstract Function get(Object arg);", "public abstract void mo35054b();", "@Override\n\tpublic void VisitMethodCallNode(MethodCallNode Node) {\n\n\t}", "public abstract void mo2624j();", "public String overloadingMeth(int angka) { //contoh dari overloading method\n int x;\n x = angka % 10;\n valueword = \"\";\n if (angka == 0) {\n valueword = \"Nol\";\n\n } else if (angka == 100) {\n valueword = \"Seratus\";\n } else if (x == 0) {\n valueword += normalword[angka / 10] + \" Puluh\";\n\n } else if (angka < 12) {\n valueword += normalword[angka];\n } else if (angka < 20) {\n\n valueword += normalword[angka - 10] + \" Belas\";\n } else if (angka < 100) {\n valueword += normalword[angka / 10] + \" Puluh \" + normalword[angka % 10];\n } else if (angka > 100) {\n System.out.println(\"MASUKAN ERROR,ANGKA TIDAK BOLEH LEBIH DARI 100\");\n }\n return valueword;\n }", "public abstract void alimentarse();", "abstract protected Set<Method> createMethods();", "@Override\n\tprotected void interr() {\n\t}", "public abstract void mo2150a();", "@Override\n public int getMethodCount()\n {\n return 1;\n }", "public abstract void mo957b();", "public interface IPresenterHienThiSanPhamTheoDanhMuc {\n void LayDanhSachSP_theoMaLoai(int masp,boolean kiemtra);\n}", "public void andThisIsAMethodName(){}" ]
[ "0.6175759", "0.60644144", "0.59955287", "0.59006625", "0.59006625", "0.5831797", "0.5831797", "0.5794214", "0.5783962", "0.5759522", "0.5759066", "0.57497257", "0.57150066", "0.5687344", "0.5683565", "0.565533", "0.5653317", "0.5627319", "0.5624136", "0.5621835", "0.5593238", "0.5593238", "0.55788606", "0.55592656", "0.55469173", "0.5546037", "0.5535314", "0.553036", "0.5530101", "0.5513686", "0.54907054", "0.54845864", "0.5484157", "0.5466908", "0.5459796", "0.5450852", "0.5450476", "0.54382193", "0.5436085", "0.5432116", "0.5430824", "0.5428427", "0.5428402", "0.54249525", "0.54247254", "0.5423572", "0.54176354", "0.54103833", "0.54083204", "0.5403194", "0.54004073", "0.53994584", "0.5366016", "0.53597623", "0.53568196", "0.53553003", "0.5347932", "0.5345335", "0.5343697", "0.5328371", "0.53271306", "0.5324647", "0.5323893", "0.5322461", "0.5321032", "0.5314639", "0.53122586", "0.5309893", "0.53068566", "0.5305514", "0.5303529", "0.52977765", "0.52843606", "0.5280626", "0.5278842", "0.52763027", "0.52748764", "0.5273779", "0.5272229", "0.5271685", "0.5270949", "0.526996", "0.52680284", "0.5266416", "0.52661103", "0.5265907", "0.52636254", "0.5263456", "0.5258995", "0.5258108", "0.5257222", "0.52520955", "0.52497625", "0.5248468", "0.5248232", "0.52472097", "0.52462363", "0.52456796", "0.5244603", "0.5242393", "0.5240373" ]
0.0
-1
where the data lives
public RLDiskDrive() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object getCurrentData();", "public void getData() {\n\t\tfileIO.importRewards();\n\t\tfileIO.getPrefs();\n\t}", "protected void loadData()\n {\n }", "private void Initialized_Data() {\n\t\t\r\n\t}", "Object getData() { /* package access */\n\t\treturn data;\n\t}", "private void InitData() {\n\t}", "public String getDataPath() {\n\t\treturn \"data\";\r\n\t}", "private void initData() {\n\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "public void saveData() {\n\t\t//place to save notes e.g to file\n\t}", "public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}", "private void initData() {\n\n }", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "private void initData() {\n }", "@Override\r\n protected String getDiskLocation()\r\n {\r\n return dataFile.getFilePath();\r\n }", "public String getDataFilePath() {\r\n \t\treturn dataFile;\r\n \t}", "private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}", "private String getDataPath()\n {\n Location location = Platform.getInstanceLocation();\n if (location == null) {\n return \"@none\";\n } else {\n return location.getURL().getPath();\n }\n }", "public void initData() {\n }", "public void initData() {\n }", "private void initData(){\n\n }", "@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 static void populateData() {\n\n }", "private void initialData() {\n\n }", "@Override\n\tpublic void getData() {\n\t\t\n\t}", "protected ScServletData getData()\n {\n return ScServletData.getLocal();\n }", "public File getDataFolder() {\n return dataFolder;\n }", "private void parseData() {\n\t\t\r\n\t}", "void loadData();", "void loadData();", "void addingGlobalData() {\n\n }", "@Override\n protected void initData() {\n }", "@Override\n protected void initData() {\n }", "private void initData() {\n requestServerToGetInformation();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "abstract public Object getUserData();", "private void loadData() {\n\t\tOptional<ServerData> loaded_data = dataSaver.load();\n\t\tif (loaded_data.isPresent()) {\n\t\t\tdata = loaded_data.get();\n\t\t} else {\n\t\t\tdata = new ServerData();\n\t\t}\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "public Map<String, Object> getCurrentData() throws Exception;", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "public void setUpData() {\n generalStatsCalculator.calculateOffsetTrees();\n this.MostEmissionsRouteString =\n RoutesArrayToString(routeStatsCalculator.getMostEmissionsRoutes());\n this.LeastEmissionsRouteString =\n RoutesArrayToString(routeStatsCalculator.getLeastEmissionsRoutes());\n this.MostDistanceRouteString =\n RoutesArrayToString(routeStatsCalculator.getMostDistanceRoutes());\n this.LeastDistanceRouteString =\n RoutesArrayToString(routeStatsCalculator.getLeastDistanceRoutes());\n this.MostVisitedSourceAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getMostVisitedSrcAirports());\n this.LeastVisitedSourceAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getLeastVisitedSrcAirports());\n this.MostVisitedDestAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getMostVisitedDestAirports());\n this.LeastVisitedDestAirportString =\n CombineAirportsToOneString(airportStatsCalculator.getLeastVisitedDestAirports());\n numOfTreesToString(generalStatsCalculator.getTreesToGrow());\n generalStatsCalculator.createCarbonEmissionsComment();\n }", "Object getData();", "Object getData();", "public void initData(){\r\n \r\n }", "@Override\n\tpublic void initData() {\n\n\n\n\t}", "protected AbstractShapeData getCurrentData()\n {\n return this.currentData;\n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "public IData getStoreddata();", "@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}", "void initData() {\r\n\t\tthis.daVinci = new Artist(\"da Vinci\");\r\n\t\tthis.mona = new Painting(daVinci, \"Mona Lisa\");\r\n\t\t//this.lastSupper = new Painting(this.daVinci, \"Last Supper\");\r\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public String getPFDataPath() {\n\t\t// TODO Auto-generated method stub\n\t\tString path = pfDir.getPath()+\"/data/\";\n\t\treturn path;\n\t}", "public void InitData() {\n }", "void populateData();", "public void loadData ( ) {\n\t\tinvokeSafe ( \"loadData\" );\n\t}", "public String getDataOwner();", "public Object getData(){\n\t\treturn this.data;\n\t}", "public Object getData()\r\n\t\t{\r\n\t\t\treturn data;\r\n\t\t}", "public List<DataLocation> getOutputDataLocations(){\n\treturn defaultDataLocations();\n }", "abstract void initializeNeededData();", "private void saveData() {\n }", "public Object getUserData () {\n\t\treturn userData;\n\t}", "public Object getData() {\r\n\t\t\treturn data;\r\n\t\t}", "String getData();", "public void store() {\r\n\t\tdata = busExt.get();\r\n\t}", "@Override\r\n\tprotected Object getData() {\n\t\treturn null;\r\n\t}", "public DataStorage getDataStorage();", "public Data() {\n initComponents();\n koneksi_db();\n tampil_data();\n }", "protected abstract void loadData();", "public void initializeData() {\n _currentDataAll = _purityReportData.getAll();\n }", "public Object getUserData()\n\t{\n\t\treturn userData;\n\t}", "@Override\n\tpublic void initData() {\n\t\t\n\t}", "private void setData() {\n\t\t\n\t\tString str = readInternalStorage();\n\t\tString[] arr = str.split(\"--\");\n\t\tLog.v(\"CONSOLE\", arr.length+\" \"+arr);\n\t\t\n\t\tLog.v(\"CONSOLE\", \"path\"+arr[0]+\n\t\t\t\t\" name \"+arr[1]+\n\t\t\t\t\" date \"+arr[2]+\n\t\t\t\t\" desc \"+arr[3]); \n\t\t\n\t\tString desc =str;\n\t\t\n\t\ttxtName.setText(entity.getName());\n\t\ttxtDate.setText(entity.getDate());\n\t\ttxtDesc.setText(desc);\n\t}", "public mainData() {\n }", "private void verificaData() {\n\t\t\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\n\tpublic void initData() {\n\n\t}", "@Override\r\n\tpublic void initData() {\n\t}", "public Object getData() \n {\n return data;\n }", "public String getDataDir() {\n\t\treturn dataDir;\n\t}", "public Object getData() {\n\t\treturn data;\n\t}", "private void fillData()\n {\n\n }", "public Object getUserData();", "public void getData() {\n\t\tContext context = getApplicationContext();\n\t\tint ch;\n\t\tStringBuffer fileContent = new StringBuffer(\"\");\n\t\tFileInputStream fis;\n\t\ttry {\n\t\t\tfis = context.openFileInput(filename);\n\t\t\ttry {\n\t\t\t\twhile ((ch = fis.read()) != -1)\n\n\t\t\t\t\tfileContent.append((char) ch);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tdata = new String(fileContent);\n\n\t}", "private void collectData() {\n this.collectContest();\n this.collectProblems();\n this.collectPreCollegeParticipants();\n this.collectObservers();\n }", "@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}", "@Override\n protected Object[] getData() {\n return new Object[] { creator };\n }", "@Override\r\n\tpublic void crawl_data() {\n\t\t\r\n\t}", "public abstract Object getData();", "public Object data() {\n return this.data;\n }", "Object getUserData();", "private void saveData() {\n\t\tdataSaver.save(data);\n\t}" ]
[ "0.6960824", "0.6798826", "0.6558848", "0.6518472", "0.6374701", "0.63228935", "0.63021004", "0.6292341", "0.62843335", "0.62623954", "0.62576944", "0.6251995", "0.6248592", "0.6236112", "0.6223183", "0.6190672", "0.6172567", "0.6170143", "0.61183697", "0.61183697", "0.6070681", "0.6067466", "0.6067466", "0.6067466", "0.6067466", "0.6067466", "0.6067466", "0.60632765", "0.6062855", "0.60528725", "0.6000199", "0.5986898", "0.5976763", "0.59735614", "0.59735614", "0.5970255", "0.5961723", "0.5961723", "0.59614116", "0.59562254", "0.5954671", "0.5943908", "0.5934821", "0.5934821", "0.5932926", "0.59316057", "0.59316057", "0.59296507", "0.59275997", "0.59275997", "0.59122455", "0.59083414", "0.59064996", "0.5906057", "0.5901213", "0.58997846", "0.58936346", "0.5892133", "0.5888913", "0.5888332", "0.5883361", "0.587681", "0.58756006", "0.58658504", "0.5863762", "0.58597976", "0.585961", "0.58587694", "0.5853004", "0.58443683", "0.5843136", "0.58295137", "0.58275926", "0.58273196", "0.5813332", "0.5810887", "0.58073556", "0.5802328", "0.5794055", "0.57933533", "0.5785289", "0.57842195", "0.5783987", "0.57769126", "0.57769126", "0.57769126", "0.57759476", "0.5772186", "0.57690346", "0.5766794", "0.5763041", "0.5762208", "0.5755856", "0.57511926", "0.57430863", "0.574167", "0.5737608", "0.5735465", "0.57348037", "0.57340026", "0.572231" ]
0.0
-1
Creates a new instance of AbstractServlet
public AbstractServlet() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BaseServlet() {\r\n\t\tsuper();\r\n\t}", "public HttpServlet() {\r\n\t\tsuper();\r\n\t}", "public AddServlet() {\n\t\tsuper();\n\t}", "public ToptenServlet() {\r\n\t\tsuper();\r\n\t}", "@Override\n public <T extends Servlet> T createServlet(Class<T> clazz) throws ServletException {\n return null;\n }", "public HttpServlet createServlet(String servletname, Context con){\n\t\t\n\t\tHttpServlet servlet = null;\n\t\tConfig config = new Config(servletname,con);\n\t\tHashMap<String,String> servletClassMap = handler.getServletClass();\n\t\t\n\t//get servlet class name through servletClass map\n\t\t\n\t\tString classname = servletClassMap.get(servletname);\n\t\t\n\t//get the exact servlet when we know servlet name\n\t\tClass servletEmptyClass = null;\n\t\ttry{\n\t\t\tlog.info(\"ServletContainer: classname is \"+classname);\n\t\t\t\n\t\t\tservletEmptyClass = Class.forName(\"edu.upenn.cis.cis455.webserver.\"+classname); // must contain the path in class\n\t\t\t\n\t\t\tservlet = (HttpServlet) servletEmptyClass.newInstance();\n\t\t\t\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tlog.info(\"ServletContainer: cannot create a servlet\");\n\t\t}\n\t\n\t//set init data in config\n\t\tHashMap<String, String> initParamsConfigMap = handler.getInitParams();\n\t\tSet<String> set = initParamsConfigMap.keySet();\n\t\tfor(String key : set){\n\t\t\tString value = initParamsConfigMap.get(key);\n\t\t\tconfig.setInitParameter(key, value);\t\t\t\n\t\t}\n\t\t\n\t// init servlet\t\n\t\ttry{\n\t\t\tservlet.init(config);\n\t\t\t\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\tlog.info(\"ServletContainer: cannot init servlet\");\n\t\t}\n\t\t\n\t\treturn servlet;\n\t\t\t\n\t}", "public BdgServlet() {\r\n\t\tsuper();\r\n\t}", "public EntryServlet()\n {\n super();\n }", "private AppServlet() {\r\n\r\n }", "public RegServlet() {\r\n\t\tsuper();\r\n\t}", "public ControllerServlet() {\n\t\tsuper();\n\t}", "public StudentServlet() {\n\t\tsuper();\n\t}", "public RackPortletServlet() {\n }", "public ServletPersonne() {\n super();\n }", "public RestServlet() {}", "public ShowServlet() {\n\t\tsuper();\n\t}", "@Override\n public Dynamic addServlet(String servletName, Class<? extends Servlet> servletClass) {\n return null;\n }", "public RhinoServlet() {\r\n if (!ContextFactory.hasExplicitGlobal())\r\n ContextFactory.initGlobal(new DynamicFactory());\r\n globalScope = new GlobalScope(this);\r\n }", "public createMessageServlet() {\n\t\tsuper();\n\t}", "@Override\n public Dynamic addServlet(String servletName, Servlet servlet) {\n return null;\n }", "public ShanChuServlet() {\n\t\tsuper();\n\t}", "public SearchServlet() {\n\t\tsuper();\n\t}", "public PreRepackServlet() {\n\t\tsuper();\n\t}", "public OAuthServlet() {\r\n\t\tsuper();\r\n\t}", "public ItsNatServlet createItsNatServlet(Servlet servlet)\r\n {\n ItsNatHttpServletImpl itsNatServlet = new ItsNatHttpServletImpl(this,(HttpServlet)servlet);\r\n String name = itsNatServlet.getName();\r\n synchronized(servletsByName)\r\n {\r\n servletsByName.put(name,itsNatServlet);\r\n }\r\n return itsNatServlet;\r\n }", "@Override\n public Dynamic addServlet(String servletName, String className) {\n return null;\n }", "public DownLoadServlet() {\n\t\tsuper();\n\t}", "public interface Servlet {\n\n /**\n * Called by the servlet container to indicate to a servlet that the servlet is being placed into service.\n * <p>\n * The servlet container calls the <code>init</code> method exactly once after instantiating the servlet. The\n * <code>init</code> method must complete successfully before the servlet can receive any requests.\n * <p>\n * The servlet container cannot place the servlet into service if the <code>init</code> method\n * <ol>\n * <li>Throws a <code>ServletException</code>\n * <li>Does not return within a time period defined by the Web server\n * </ol>\n *\n * @param config a <code>ServletConfig</code> object containing the servlet's configuration and initialization\n * parameters\n *\n * @exception ServletException if an exception has occurred that interferes with the servlet's normal operation\n *\n * @see UnavailableException\n * @see #getServletConfig\n */\n void init(ServletConfig config) throws ServletException;\n\n /**\n * Returns a {@link ServletConfig} object, which contains initialization and startup parameters for this servlet.\n * The <code>ServletConfig</code> object returned is the one passed to the <code>init</code> method.\n * <p>\n * Implementations of this interface are responsible for storing the <code>ServletConfig</code> object so that this\n * method can return it. The {@link GenericServlet} class, which implements this interface, already does this.\n *\n * @return the <code>ServletConfig</code> object that initializes this servlet\n *\n * @see #init\n */\n ServletConfig getServletConfig();\n\n /**\n * Called by the servlet container to allow the servlet to respond to a request.\n * <p>\n * This method is only called after the servlet's <code>init()</code> method has completed successfully.\n * <p>\n * The status code of the response always should be set for a servlet that throws or sends an error.\n * <p>\n * Servlets typically run inside multithreaded servlet containers that can handle multiple requests concurrently.\n * Developers must be aware to synchronize access to any shared resources such as files, network connections, and as\n * well as the servlet's class and instance variables. More information on multithreaded programming in Java is\n * available in <a href=\"http://java.sun.com/Series/Tutorial/java/threads/multithreaded.html\"> the Java tutorial on\n * multi-threaded programming</a>.\n *\n * @param req the <code>ServletRequest</code> object that contains the client's request\n * @param res the <code>ServletResponse</code> object that contains the servlet's response\n *\n * @exception ServletException if an exception occurs that interferes with the servlet's normal operation\n * @exception IOException if an input or output exception occurs\n */\n void service(ServletRequest req, ServletResponse res) throws ServletException, IOException;\n\n /**\n * Returns information about the servlet, such as author, version, and copyright.\n * <p>\n * The string that this method returns should be plain text and not markup of any kind (such as HTML, XML, etc.).\n *\n * @return a <code>String</code> containing servlet information\n */\n String getServletInfo();\n\n /**\n * Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. This\n * method is only called once all threads within the servlet's <code>service</code> method have exited or after a\n * timeout period has passed. After the servlet container calls this method, it will not call the\n * <code>service</code> method again on this servlet.\n * <p>\n * This method gives the servlet an opportunity to clean up any resources that are being held (for example, memory,\n * file handles, threads) and make sure that any persistent state is synchronized with the servlet's current state\n * in memory.\n */\n void destroy();\n}", "public UserServlet() {\n super();\n }", "public EchoServlet()\n {\n super();\n\n // Create a logging instance\n this.log = Logger.getLogger(EchoServlet.class.getName());\n\n log.info(\"Constructed new EchoServlet\");\n }", "public SkillServlet() {\r\n\t\tsuper();\r\n\t}", "public StatisticsServlet() {\n\t\tsuper();\n\t}", "public LoginServlet() {\n\t\tsuper();\n\t}", "public LoginServlet() {\n\t\tsuper();\n\t}", "public LeaveServlet() {\n\t\tsuper();\n\t}", "public JsonServlet() {\n\t\tsuper();\n\t}", "public EmployeeServlet()\n {\n logger = Logger.getLogger(getClass().getName());\n }", "public ImageIOServlet() {\n\t\tsuper();\n\t}", "private Servlets() {\n\t\tthrow new AssertionError();\n\t}", "private ServletUtils() { }", "public PointServlet() {\n\t\tsuper();\n\t}", "public NewsModifyServlet() {\n\t\tsuper();\n\t}", "public SearchEmployeesServlet() {\r\n\t\tsuper();\r\n\t}", "public String getServletInfo() { return \"ServletExercice20\";}", "public GetAdminClassServlet() {\n\t\tsuper();\n\t}", "public HashMap<String, HttpServlet> createServletMaps(){\n\t\tHashMap<String,String> servletClass = handler.getServletClass();\n\t\tSet<String> allServletName = servletClass.keySet();\n\t\tContext con = createContext();\n\t\t\n\t\tfor(String servletname: allServletName){\n\t\t\tlog.info(\"ServletContainer: servletname is \"+servletname);\n\t\t\tHttpServlet servlet = createServlet(servletname,con);\n\t\t\t\n\t\t\tservletsmap.put(servletname, servlet);\t\t\t\n\t\t}\n\t\t\n\t\treturn servletsmap;\t\t\n\t\t\n\t}", "protected synchronized ServletHolder getServlet(String servletPath) {\n ServletHolder jerseyServlet =\n super.getServlet(org.glassfish.jersey.servlet.ServletContainer.class, servletPath);\n jerseyServlet.setInitOrder(0);\n return jerseyServlet;\n }", "public static RhinoServlet getServlet(Context cx) {\r\n Object o = cx.getThreadLocal(\"rhinoServer\");\r\n if (o==null || !(o instanceof RhinoServlet)) return null;\r\n return (RhinoServlet)o;\r\n }", "public GetMessageServlet() {\n\t\tsuper();\n\t}", "Servlet2Configurator(final ServletContext servletContext) {\n // Nothing to do.\n }", "public updateIndexServlet() {\r\n\t\tsuper();\r\n\t}", "public ServletLogChute()\r\n {\r\n }", "@Override\n public void init(ServletConfig servletConfig) throws ServletException {\n }", "public FileUploadServlet() {\r\n\t\tsuper();\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "@Override\r\n public void init(ServletConfig arg0) throws ServletException {\n\r\n }", "@Override\r\npublic void init(ServletConfig config) throws ServletException {\r\n super.init(config);\r\n}", "@Override\n public String getServletInfo() {\n return \"Hello World Servlet\";\n }", "public ServletMappingDispatcher() {\n super(new ServletMethodResolver());\n }", "private void startServlets(){\n\t\ttry{\n\t\t\tserver = new Server();\n\t\t\tServerConnector c = new ServerConnector(server);\n\t\t\tc.setIdleTimeout(15000);\n\t\t\tc.setAcceptQueueSize(256);\n\t\t\tc.setPort(port);\n\t\t\tif(!bind.equals(\"*\")){\n\t\t\t\tc.setHost(bind);\n\t\t\t}\n\n\t\t\tServletContextHandler handler = new ServletContextHandler(server,\"/\", true, false);\n\t\t\tServletHolder servletHolder = new ServletHolder(StatusServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/status/*\");\n\n\t\t\tservletHolder = new ServletHolder(SampleAPIServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/sample/*\");\n\n\t\t\tservletHolder = new ServletHolder(FileServlet.class);\n\t\t\thandler.addServlet(servletHolder, \"/*\");\n\t\t\tFileServlet.sourceFolder=\"./site\";\t\t\t\n\n\t\t\tserver.addConnector(c);\n\t\t\tserver.start();\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public AsyncHttpServer(NioEventloop eventloop, AsyncHttpServlet servlet) {\n\t\tsuper(eventloop);\n\t\tthis.connectionsList = new ExposedLinkedList<>();\n\t\tthis.servlet = servlet;\n\t\tchar[] chars = eventloop.get(char[].class);\n\t\tif (chars == null || chars.length < MAX_HEADER_LINE_SIZE) {\n\t\t\tchars = new char[MAX_HEADER_LINE_SIZE];\n\t\t\teventloop.set(char[].class, chars);\n\t\t}\n\t\tthis.headerChars = chars;\n\t}", "public downloadImageServlet() {\n\t\tsuper();\n\t}", "public boolean isServletBased ()\n\t{\n\t\treturn servletBased;\n\t}", "void add(final Servlet servlet, final URI servletPath, final Config config);", "protected WebApplication newApplication() {\n return new DummyWebApplication();\n }", "public AddOrderServlet() {\n\t\tsuper();\n\t}", "public AddMessageServlet() {\n\t\tsuper();\n\t}", "void init(ServletConfig config) throws ServletException;", "@Override\n\tpublic void init(ServletConfig arg0) throws ServletException {\n\t\t\n\t}", "@Override\n\tpublic void init(ServletConfig arg0) throws ServletException {\n\t\t\n\t}", "public IntegrationServicesProviderServlet() {\n this.engine = ExpandedOsgiEngine.getInstance();\n }", "public void init() throws ServletException {\n }", "@Override\n public void onStartup(ServletContext servletContext) throws ServletException {\n this.addServlet(servletContext);\n }", "protected void setUpServletObjects() throws Exception\n {\n servletContext = new MockServletContext();\n config = new MockServletConfig(servletContext);\n session = new MockHttpSession();\n session.setServletContext(servletContext);\n request = new MockHttpServletRequest(session);\n request.setServletContext(servletContext);\n response = new MockHttpServletResponse();\n }", "@Override\n\tpublic void init() throws ServletException {\n\t}", "@Override\n\tpublic void init() throws ServletException {\n\t}", "@Override\n\tpublic void init() throws ServletException {\n\t}", "static BasePage getPageInstance(String page_name,HttpServletRequest request,\n HttpServletResponse response,HttpServlet servlet){\n HttpSession session = request.getSession();\n BasePage page = (BasePage)session.getAttribute(page_name);\n if(page == null){\n page = (BasePage)createInstance(page_name);\n session.setAttribute(page_name,page);\n if(page == null)\n System.err.println(\"Could not create \" + page_name);\n } //if\n page.request = request;\n page.session = session;\n page.servlet = servlet;\n if(!page.$isLoaded())\n page.fillDom();\n return page;\n}", "public FindAllStudentServlet() {\n\t\tsuper();\n\t}", "public WebServer()\n {\n if (!Variables.exists(\"w_DebugLog\"))\n Variables.setVariable(\"w_DebugLog\", true);\n\n if (!Variables.exists(\"w_Port\"))\n Variables.setVariable(\"w_Port\", 80);\n\n if (!Variables.exists(\"w_NetworkBufferSize\"))\n Variables.setVariable(\"w_NetworkBufferSize\", 2048);\n\n PORT = Variables.getInt(\"w_Port\");\n DEBUG = Variables.getBoolean(\"w_DebugLog\");\n BUFFER_SIZE = Variables.getInt(\"w_NetworkBufferSize\");\n }", "public EmailAddNoSendServlet() {\r\n\t\tsuper();\r\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public void init() throws ServletException {\n\t}", "public interface ServletContextAware {\r\n\r\n /**\r\n * Called by GuiceContainerFactory when initialize module.\r\n *\r\n * @param servletContext ServletContext object to be used by this object\r\n */\r\n void setServletContext(ServletContext servletContext);\r\n\r\n}", "public SalesStatementServlet() {\r\n\t\tsuper();\r\n\t}", "public void init() throws ServletException {\r\n\r\n\t}", "public RechercheEtudiantServlet() {\n\t\tsuper();\n//\t\tstudentService = new EtudiantService(etudiantDao);\n\t}", "@Override\n\tpublic void init() throws ServletException {\n\t\t\n\t}" ]
[ "0.76000464", "0.7389686", "0.7234967", "0.7169051", "0.7041872", "0.69900155", "0.69642764", "0.6901035", "0.6848942", "0.68170625", "0.67686594", "0.6755626", "0.6742096", "0.6684524", "0.66084146", "0.6604393", "0.656933", "0.65627617", "0.65218586", "0.65196925", "0.6518228", "0.6515006", "0.64857554", "0.64713687", "0.64696693", "0.64547807", "0.6452381", "0.6407428", "0.6373354", "0.63650554", "0.63531405", "0.6286132", "0.6169324", "0.6169324", "0.61325943", "0.6065332", "0.60355186", "0.6022734", "0.5989553", "0.5934472", "0.5890246", "0.5853179", "0.5845935", "0.58304787", "0.58301556", "0.5806524", "0.57979465", "0.57668155", "0.57130694", "0.5709605", "0.5708278", "0.5705632", "0.567254", "0.5671038", "0.5666177", "0.56655157", "0.56373405", "0.55985177", "0.55606544", "0.5557428", "0.5552703", "0.5546837", "0.5544677", "0.55379194", "0.55285174", "0.5523297", "0.5514006", "0.5508918", "0.5508918", "0.5508201", "0.5491565", "0.5479027", "0.5466387", "0.543292", "0.543292", "0.543292", "0.5429028", "0.54285115", "0.5427057", "0.54221445", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.5421176", "0.54173005", "0.5408203", "0.5407384", "0.5390519", "0.53870463" ]
0.83046716
0
Handles the HTTP GET method.
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { internalProcessRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}", "public Result get(Get get) throws IOException;", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }", "@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\npublic void get(String url) {\n\t\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }", "@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }", "public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }", "public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}", "@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }", "HttpGet getRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}" ]
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", "0.6754993", "0.67394847", "0.6719924", "0.6716244", "0.67054695", "0.67054695", "0.67012346", "0.6684415", "0.6676695", "0.6675696", "0.6675696", "0.66747975", "0.66747975", "0.6669016", "0.66621476", "0.66621476", "0.66476154", "0.66365504", "0.6615004", "0.66130257", "0.6604073", "0.6570195", "0.6551141", "0.65378064", "0.6536579", "0.65357745", "0.64957607", "0.64672184", "0.6453189", "0.6450501", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.64067316", "0.6395873", "0.6379907", "0.63737476", "0.636021", "0.6356937", "0.63410467", "0.6309468", "0.630619", "0.630263", "0.63014317", "0.6283933", "0.62738425", "0.62680805", "0.62585783", "0.62553537", "0.6249043", "0.62457556", "0.6239428", "0.6239428", "0.62376446", "0.62359244", "0.6215947", "0.62125194", "0.6207376", "0.62067443", "0.6204527", "0.6200444", "0.6199078", "0.61876005", "0.6182614", "0.61762017", "0.61755335", "0.61716276", "0.6170575", "0.6170397", "0.616901" ]
0.0
-1
Handles the HTTP POST method.
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { internalProcessRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public String post();", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "public void postData() {\n\n\t}", "@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract boolean handlePost(FORM form, BindException errors) throws Exception;", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException 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\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }", "protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}", "public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }", "@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197", "0.6515622", "0.6513045", "0.6512626", "0.6492367", "0.64817846", "0.6477479", "0.64725804", "0.6472099", "0.6469389", "0.6456206", "0.6452577", "0.6452577", "0.6452577", "0.6450273", "0.6450273", "0.6438126", "0.6437522", "0.64339423", "0.64253825", "0.6422238", "0.6420897", "0.6420897", "0.6420897", "0.6407662", "0.64041835", "0.64041835", "0.639631", "0.6395677", "0.6354875", "0.63334197", "0.6324263", "0.62959254", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6280875", "0.6272104", "0.6272104", "0.62711537", "0.62616795", "0.62544584", "0.6251865", "0.62274224", "0.6214439", "0.62137586", "0.621211", "0.620854", "0.62023044", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61638993", "0.61603814", "0.6148914", "0.61465937", "0.61465937", "0.614548", "0.6141879", "0.6136717", "0.61313903", "0.61300284", "0.6124381", "0.6118381", "0.6118128", "0.61063534", "0.60992104", "0.6098801", "0.6096766" ]
0.0
-1
/return a reg of type $s or $t
private Register allocateANewRegister() { Register retReg = freeRegisterPool.first(); freeRegisterPool.remove(retReg); return retReg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String reg(SSAStatement s) {\n return registers[freeRegisters[s.getRegister()]];\n }", "private String getReg ( String reg ) throws EVASyntaxException\r\n\t{\r\n\t\tString actual = reg;\r\n\t\tif ( reg.charAt(0) != '$' )\r\n\t\t{\r\n\t\t\t\t\t\tthrow ( new EVASyntaxException (\r\n\t\t\t\"Register must start with dollar sign\" ) );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//quitar el dolar\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t}\r\n\t\tif ( actual.substring(0,2).equalsIgnoreCase(\"ra\") )\r\n\t\t{\r\n\t\t\treturn ra;\r\n\t\t}\r\n\t\telse if ( actual.charAt(0) == 'r' )\r\n\t\t{\r\n\t\t\t//quitar la r\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t\t//a ve si es numero\r\n\t\t\tint regnum;\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tregnum = Integer.valueOf(actual).intValue();\r\n\t\t\t\treturn r[regnum];\r\n\t\t\t}\r\n\t\t\tcatch ( NumberFormatException NumExc )\r\n\t\t\t{\r\n\t\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( actual.charAt(0) == 'v' )\r\n\t\t{\r\n\t\t\t//quitar la v\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t\t//a ve si es numero\r\n\t\t\tint regnum;\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tregnum = Integer.valueOf(actual).intValue();\r\n\t\t\t\treturn v[regnum];\r\n\t\t\t}\r\n\t\t\tcatch ( NumberFormatException NumExc )\r\n\t\t\t{\r\n\t\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( actual.charAt(0) == 'a' )\r\n\t\t{\r\n\t\t\t//quitar la r\r\n\t\t\tactual = actual.substring(1,actual.length());\r\n\t\t\t//a ve si es numero\r\n\t\t\tint regnum;\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tregnum = Integer.valueOf(actual).intValue();\r\n\t\t\t\treturn a[regnum];\r\n\t\t\t}\r\n\t\t\tcatch ( NumberFormatException NumExc )\r\n\t\t\t{\r\n\t\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( actual.substring(0,3).equalsIgnoreCase(\"exc\") )\r\n\t\t{\r\n\t\t\treturn exc;\r\n\t\t}\r\n\t\telse if ( actual.substring(0,3).equalsIgnoreCase(\"obj\") )\r\n\t\t{\r\n\t\t\treturn obj;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow( new EVASyntaxException(\"Wrong register format\"));\r\n\t\t}\r\n\t}", "private int get_sreg() { return get_ioreg(SREG); }", "private static String or(String s, String t)\r\n\t{\r\n\t\tchar[] out = s.toCharArray();\r\n\t\tfor (int i = 0; i < out.length; i++)\r\n\t\t{\r\n\t\t\tif(out[i] == '0' && t.charAt(i) == '1')\r\n\t\t\t\tout[i] = '1';\r\n\t\t}\r\n\t\treturn new String(out);\r\n\t}", "String regen();", "static int type_of_xra(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}", "static int type_of_sbb(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}", "static int type_of_ora(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}", "static int type_of_sub(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}", "private String getAltRegType() { // TODO - fix Register reference hardcoded in reg defines parm default?\n\t\tString firstChar = regProperties.getId().substring(0, 1);\n\t\t// change case of first character in name to create type\n\t\tString regTypeParam;\n\t\tif (firstChar.equals(firstChar.toUpperCase()))\n\t\t regTypeParam = regProperties.getId().replaceFirst(firstChar, firstChar.toLowerCase()); // change to lc\n\t\telse\n\t\t regTypeParam = regProperties.getId().replaceFirst(firstChar, firstChar.toUpperCase()); // change to uc \n\t\tString regBaseType = regProperties.isReplicated()? \"RegisterArray\" : \"Register\";\n\t\treturn regBaseType + \" #(\" + getAltBlockType() + \"::\" + regTypeParam + \")\"; // TODO - make parameterizable, getAddressMapName() + \"_\" + regProperties.getBaseName() + \"_t\" \n\t}", "private String getRegValueScorboard(String strReg) {\n\t\tString _strTemp = \"\";\n\t\tif (strReg.contains(\"R\") || strReg.contains(\"F\")) {\n\t\t\tif (strReg.length() == 2) {\n\t\t\t\t_strTemp = strReg.substring(1, 2);\n\t\t\t} else if (strReg.length() == 3) {\n\t\t\t\t_strTemp = strReg.substring(1, 3);\n\t\t\t}\n\t\t}\n\t\treturn _strTemp;\n\t}", "static int type_of_inr(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}", "String getZero_or_one();", "public static EvalTypes valueOf(int s) throws IllegalArgumentException\n {\n EvalTypes types[] = values();\n for (int i = 0; i < types.length; i++)\n {\n if (types[i].getValue() == s)\n return types[i];\n }\n throw new IllegalArgumentException(\"No match for value: \" + s);\n }", "public boolean checkReg(String op) {\r\n\t\tString pattern = \"(R[1-2][0-9])|R[3][0-2]|R[0-9]$\";\r\n\t\tPattern reg = Pattern.compile(pattern);\r\n\t\tMatcher match = reg.matcher(op);\r\n\t\t\r\n\t\treturn match.find();\r\n\t}", "static int type_of_add(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}", "private NFA regEx() {\n NFA term = term();\n\n //If the regex requires a union operation\n if (more() && peek() == '|') {\n\n eat('|');\n NFA regex = regEx();\n return union(term, regex);\n //If no union is needed, just return the NFA\n } else {\n return term;\n }\n }", "static int type_of_dcr(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}", "public Expression determine(String s);", "X86.Operand gen_source_operand(boolean imm_ok, X86.Reg temp);", "int[] parse(String re, int s, int t)\r\n\t{\r\n\t\tint [] st;\r\n\t\tint i;\r\n\t\t\r\n\t\t//single symbol\r\n\t\tif (s==t)\r\n\t\t{\r\n\t\t\tst=new int[2];\r\n\t\t\tst[0]=incCapacity();\r\n\t\t\tst[1]=incCapacity();\r\n\t\t\tif (re.charAt(s)=='e') //epsilon\r\n\t\t\t\taddEdge(st[0],symbol,st[1]);\r\n\t\t\telse addEdge(st[0],re.charAt(s)-'0',st[1]);\r\n\t\t\treturn st;\r\n\t\t}\r\n\t\t\r\n\t\t//(....)\r\n\t\tif ((re.charAt(s)=='(')&&(re.charAt(t)==')'))\r\n\t\t{\r\n\t\t\tif (next[s]==t)\r\n\t\t\t\treturn parse(re,s+1,t-1);\r\n\t\t}\r\n\t\t\r\n\t\t//RE1+RE2\r\n\t\ti=s;\r\n\t\twhile (i<=t)\r\n\t\t{\r\n\t\t\ti=next[i];\r\n\t\t\t\r\n\t\t\tif ((i<=t)&&(re.charAt(i)=='+'))\r\n\t\t\t{\r\n\t\t\t\tint [] st1=parse(re,s,i-1);\r\n\t\t\t\tint [] st2=parse(re,i+1,t);\r\n\t\t\t\tst = union(st1[0],st1[1],st2[0],st2[1]);\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t\t++i;\r\n\t\t}\r\n\t\t\r\n\t\t//RE1.RE2\r\n\t\ti=s;\r\n\t\twhile (i<=t)\r\n\t\t{\r\n\t\t\ti=next[i];\r\n\t\t\t\r\n\t\t\tif ((i<=t)&&(re.charAt(i)=='.'))\r\n\t\t\t{\r\n\t\t\t\tint [] st1=parse(re,s,i-1);\r\n\t\t\t\tint [] st2=parse(re,i+1,t);\r\n\t\t\t\tst = concat(st1[0],st1[1],st2[0],st2[1]);\r\n\t\t\t\treturn st;\r\n\t\t\t}\r\n\t\t\t++i;\r\n\t\t}\r\n\t\t\r\n\t\t//(RE)*\r\n\t\tassert(re.charAt(t)=='*');\r\n\t\tint [] st1=parse(re,s,t-1);\r\n\t\tst=clo(st1[0],st1[1]);\r\n\t\treturn st; \r\n\t}", "X86.Reg gen_dest_operand();", "static int type_of_sta(String passed){\n\t\treturn 1;\n\t}", "String getSFunc();", "java.lang.String getRegex();", "java.lang.String getRegex();", "static int type_of_ral(String passed){\n\t\treturn 1;\n\t}", "public static Gate findGate( String s ) {\n\t// quick and dirty implementation\n\tfor (Gate i: gates) {\n\t if (i.name.equals( s )) {\n\t\treturn i;\n\t }\n\t}\n\treturn null;\n }", "private final TypeSAT GetTypeSAT(String expression, String leftExpression, String rightExpression) {\r\n // remove extra brackets\r\n expression = this.RemoveExtraBrackets(expression);\r\n // look for binary implies\r\n if (expression.contains(\">\")) {\r\n if (this.IsBinaryOp(expression, \">\", leftExpression, rightExpression)) {\r\n return TypeSAT.Implies;\r\n }\r\n \r\n }\r\n \r\n // look for binary and\r\n if (expression.contains(\"&\")) {\r\n if (this.IsBinaryOp(expression, \"&\", leftExpression, rightExpression)) {\r\n return TypeSAT.And;\r\n }\r\n \r\n }\r\n \r\n // look for binary or\r\n if (expression.contains(\"|\")) {\r\n if (this.IsBinaryOp(expression, \"|\", leftExpression, rightExpression)) {\r\n return TypeSAT.Or;\r\n }\r\n \r\n }\r\n \r\n // look for binary AU\r\n if (expression.startsWith(\"A(\")) {\r\n String strippedExpression = expression.substring(2, (expression.length() - 3));\r\n if (this.IsBinaryOp(strippedExpression, \"U\", leftExpression, rightExpression)) {\r\n return TypeSAT.AU;\r\n }\r\n \r\n }\r\n \r\n // look for binary EU\r\n if (expression.startsWith(\"E(\")) {\r\n String strippedExpression = expression.substring(2, (expression.length() - 3));\r\n if (this.IsBinaryOp(strippedExpression, \"U\", leftExpression, rightExpression)) {\r\n return TypeSAT.EU;\r\n }\r\n \r\n }\r\n \r\n // look for unary T, F, !, AX, EX, AG, EG, AF, EF, atomic\r\n if (expression.equals(\"T\")) {\r\n this.leftExpression = expression;\r\n return TypeSAT.AllTrue;\r\n }\r\n \r\n if (expression.equals(\"F\")) {\r\n this.leftExpression = expression;\r\n return TypeSAT.AllFalse;\r\n }\r\n \r\n if (this.IsAtomic(expression)) {\r\n this.leftExpression = expression;\r\n return TypeSAT.Atomic;\r\n }\r\n \r\n if (expression.startsWith(\"!\")) {\r\n this.leftExpression = expression.substring(1,expression.length());\r\n return TypeSAT.Not;\r\n }\r\n \r\n if (expression.startsWith(\"AX\")) {\r\n this.leftExpression = expression.substring(2,expression.length());\r\n return TypeSAT.AX;\r\n }\r\n \r\n if (expression.startsWith(\"EX\")) {\r\n this.leftExpression = expression.substring(2,expression.length());\r\n System.out.println(\"exp\"+leftExpression);\r\n return TypeSAT.EX;\r\n }\r\n \r\n if (expression.startsWith(\"EF\")) {\r\n this.leftExpression = expression.substring(2,expression.length());\r\n return TypeSAT.EF;\r\n }\r\n \r\n if (expression.startsWith(\"EG\")) {\r\n this.leftExpression = expression.substring(2,expression.length());\r\n return TypeSAT.EG;\r\n }\r\n \r\n if (expression.startsWith(\"AF\")) {\r\n this.leftExpression = expression.substring(2,expression.length());\r\n return TypeSAT.AF;\r\n }\r\n \r\n if (expression.startsWith(\"AG\")) {\r\n this.leftExpression = expression.substring(2,expression.length());\r\n return TypeSAT.AG;\r\n }\r\n \r\n return TypeSAT.Unknown;\r\n }", "public int getReg(int reg) {\r\n\t\tswitch (reg) {\r\n\t\t\tcase 0:\r\n\t\t\t\treturn m_registers[R0];\r\n\t\t\tcase 1:\r\n\t\t\t\treturn m_registers[R1];\r\n\t\t\tcase 2:\r\n\t\t\t\treturn m_registers[R2];\r\n\t\t\tcase 3:\r\n\t\t\t\treturn m_registers[R3];\r\n\t\t\tcase 4:\r\n\t\t\t\treturn m_registers[R4];\r\n\t\t\tdefault:\r\n\t\t\t\t// Return default (should never be reached)\r\n\t\t\t\treturnError(ERROR_REG_DNE);\r\n\t\t\t\treturn 0;\r\n\t\t}\r\n\t}", "public static PseudostateKind get(String literal) {\r\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\r\n\t\t\tPseudostateKind result = VALUES_ARRAY[i];\r\n\t\t\tif (result.toString().equals(literal)) {\r\n\t\t\t\treturn result;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public long getRegType() {\r\n return regType;\r\n }", "public ValueWrapper parseConstant(String t) {\n \tthrow new UnsupportedOperationException();\n }", "<C> StringLiteralExp<C> createStringLiteralExp();", "static int type_of_mov(String passed){\n\t\tif(passed.charAt(4)=='M' && general_registers.contains(passed.charAt(6)))\n\t\t\treturn 2;\n\t\telse if(passed.charAt(6)=='M' && general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(general_registers.contains(passed.charAt(6)) && general_registers.contains(passed.charAt(4)))\n\t\t\treturn 3;\n\t\telse\n\t\t\treturn 0;\n\t}", "public REG(Reg r) {\n\t\treg = r;\n\t}", "static void ora_with_reg(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tval1 = val1|val2;\n\t\tregisters.put('A',decimel_to_hexa_8bit(val1));\n\t\tmodify_status(registers.get('A'));\n\t}", "static int type_of_rrc(String passed){\n\t\treturn 1;\n\t}", "static int type_of_stc(String passed){\n\t\treturn 1;\n\t}", "private String getAltRegDataType() {\n\t\treturn \"logic[PIO_MAX_TR_WIDTH-1:0]\"; // TODO - make parameterizable, \"u_int\" + regProperties.getRegWidth() + \"_t\"\n\t}", "public Object getRegister(Register r) {\n int i = r.getNumber(); \n if (s.registers[i] == null) {\n System.err.println(method+\" ::: Reg \"+i+\" is null\");\n System.err.println(this.bb.fullDump());\n }\n if(TRACE_REGISTERS) System.out.println(this.method + \": getting \" + i + \" <- \" + s.registers[i] + \" from \"\n + Arrays.asList(s.registers));\n return s.registers[i];\n }", "static int type_of_ana(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}", "String getLiteral();", "String getLiteral();", "private PatternType matchPatternEnum(String s){\n s = s.toLowerCase();\n switch(s){\n case \"factory method\":\n return PatternType.FACTORY_METHOD;\n case \"prototype\":\n return PatternType.PROTOTYPE;\n case \"singleton\":\n return PatternType.SINGLETON;\n case \"(object)adapter\":\n return PatternType.OBJECT_ADAPTER;\n case \"command\":\n return PatternType.COMMAND;\n case \"composite\":\n return PatternType.COMPOSITE;\n case \"decorator\":\n return PatternType.DECORATOR;\n case \"observer\":\n return PatternType.OBSERVER;\n case \"state\":\n return PatternType.STATE;\n case \"strategy\":\n return PatternType.STRATEGY;\n case \"bridge\":\n return PatternType.BRIDGE;\n case \"template method\":\n return PatternType.TEMPLATE_METHOD;\n case \"visitor\":\n return PatternType.VISITOR;\n case \"proxy\":\n return PatternType.PROXY;\n case \"proxy2\":\n return PatternType.PROXY2;\n case \"chain of responsibility\":\n return PatternType.CHAIN_OF_RESPONSIBILITY;\n default:\n System.out.println(\"Was not able to match pattern with an enum. Exiting because this should not happen\");\n System.exit(0);\n\n }\n //should never get here because we exit on the default case\n return null;\n }", "public String getRegEx();", "<C> RealLiteralExp<C> createRealLiteralExp();", "public static Term createRegExp(Expression exp) {\r\n\t\tTerm term = Term.function(REGEX, exp);\r\n\t\treturn term;\r\n\t}", "int getOrAdd(String symbol);", "private void constructTerm(String s) {\r\n int coefficient;\r\n int power;\r\n String regexPattern =\r\n \"([+-]?)([1-9]\\\\d*|0{1})([x]{1})(\\\\^{1})([1-9]\\\\d*|0{1})|([+-]?)([1-9]\\\\d*|0{1})\";\r\n Pattern p = Pattern.compile(regexPattern);\r\n Matcher m = p.matcher(s);\r\n if (!m.matches()) {\r\n throw new IllegalArgumentException(\"Illegal term, cannot be created\");\r\n }\r\n if (m.group(1) != null) {\r\n coefficient = Integer.parseInt(m.group(1).concat(m.group(2)));\r\n power = Integer.parseInt(m.group(5));\r\n addTerm(coefficient, power);\r\n } else if (m.group(6) != null) {\r\n coefficient = Integer.parseInt(m.group(6).concat(m.group(7)));\r\n power = 0;\r\n addTerm(coefficient, power);\r\n }\r\n }", "public void printReg(String s) {\n\t\tif(s.equals(\"lo\"))\n\t\t\tSystem.out.println(\"$LO=0x\" + MIPSEmulator.formatHex(this.LO));\n\t\telse if(s.equals(\"hi\"))\n\t\t\tSystem.out.println(\"$HI=0x\" + MIPSEmulator.formatHex(this.HI));\n\t\telse if(s.equals(\"pc\"))\n\t\t\tSystem.out.println(\"$PC=0x\" + MIPSEmulator.formatHex(this.pc));\n\t}", "static int type_of_rnc(String passed){\n\t\treturn 1;\n\t}", "static void xra_with_reg(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tval1 = val1&val2;\n\t\tregisters.put('A',decimel_to_hexa_8bit(val1));\n\t\tmodify_status(registers.get('A'));\n\t}", "static int type_of_rpe(String passed){\n\t\treturn 1;\n\t}", "String getOr_op();", "TypeLiteralExp createTypeLiteralExp();", "String symbol();", "public static HydroPlantType get(String literal) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tHydroPlantType result = VALUES_ARRAY[i];\n\t\t\tif (result.toString().equals(literal)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public LinearRegister getRegister(int index)\n {\n if (index < 0 || index >= registers.size())\n {\n return new LinearRegister(\"0\");\n }\n \n return registers.get(index);\n }", "public static PortType get(String literal)\n {\n for (int i = 0; i < VALUES_ARRAY.length; ++i)\n {\n PortType result = VALUES_ARRAY[i];\n if (result.toString().equals(literal))\n {\n return result;\n }\n }\n return null;\n }", "static int type_of_rpo(String passed){\n\t\treturn 1;\n\t}", "public Literal getLiteral();", "public Literal getLiteral();", "@Override\r\n public Complex valOf(String s, Ring ring) {\r\n String ss = s.trim();\r\n int i = ss.indexOf('+');\r\n if (i < 2) {\r\n i = ss.indexOf('-', i);\r\n }\r\n Element rea, imm;\r\n String n1 = ss.substring(i);\r\n String nn2, n2;\r\n if (i >= 2) {\r\n n2 = ss.substring(0, i);\r\n nn2 = n2.replace('i', ' ').replace('I', ' ');\r\n if (!nn2.equals(n2)) {\r\n rea = re.valOf(n1, ring);\r\n imm = re.valOf(nn2, ring);\r\n } else {\r\n imm = re.valOf(n1.replace('i', ' ').replace('I', ' '), ring);\r\n rea = re.valOf(n2, ring);\r\n }\r\n } else {\r\n nn2 = ss.replace('i', ' ').replace('I', ' ');\r\n if (!nn2.equals(ss)) {\r\n rea = re.myZero(ring);\r\n imm = re.valOf(nn2, ring);\r\n } else {\r\n imm = re.myZero(ring);\r\n rea = re.valOf(nn2, ring);\r\n }\r\n }\r\n return new Complex(rea, imm);\r\n }", "public T getExactMatch(String arg)\n\t{\n\t\treturn null;\n\t}", "public String getPhoneType(String s) {\r\n\t\t// Needs to be further developed \r\n\t\treturn null;\r\n\t}", "public int getReg() {\n\t\treturn -1;\n\t}", "public void register(T t);", "public int getRegister(int regInd) {\n return regs[regInd];\n }", "static int type_of_rc(String passed){\n\t\treturn 1;\n\t}", "static int type_of_xri(String passed){\n\t\treturn 1;\n\t}", "static void mov_reg_to_reg(String passed){\n\t\tregisters.put(passed.charAt(4),registers.get(passed.charAt(6)));\n\t}", "StringLiteralExp createStringLiteralExp();", "public int getIOReg(String n) {\n return layout.getIOReg(n);\n }", "public char checkType(String line) {\n int index;\n List<String> iType = Arrays.asList(\"addi\", \"slti\", \"andi\", \"ori\", \"lw\", \"sw\", \"beq\");\n List<String> rType = Arrays.asList(\"add\", \"sub\", \"slt\", \"and\", \"or\", \"sll\",\"srl\", \"s\",\"jr\");\n List<String> jType = Arrays.asList(\"j\", \"jal\");\n\n if (line.indexOf(' ') != -1) {\n index = line.indexOf(' ');\n } else {\n return 'u';\n }\n String checkStr = line.substring(0, index);\n if (iType.contains(checkStr)) {\n return 'i';\n }\n if (rType.contains(checkStr)) {\n return 'r';\n }\n if (jType.contains(checkStr)) {\n return 'j';\n }\n return 'u';\n }", "public static GSC_DataType getReference( String s )\n {\n return( (GSC_DataType)( nameHash.get( s ) ) );\n }", "RegisterParam getRegister();", "public static Gate newGate( Scanner sc ) throws ConstructorFailure {\n\t// going to write a whole bunch of new junk here and then slowly\n\t// remove what I no longer need. This code is ages from being able\n\t// to be compiled\n\tString name = ScanSupport.nextName( sc ); \n\tif( \" \".equals( name )){\n\t Errors.warn( \"No gate name provided\" ); \n\t throw new ConstructorFailure(); \n\t}\t\t\n\tif (Logic.findGate( name ) != null) {\n\t Errors.warn( \"Gate redefined: \" + name );\n\t throw new ConstructorFailure();\n\t}\n\t\n\tString type = ScanSupport.nextName( sc ); \n\t\n\tif( \"or\".equals( type ) ){\n\t return new orGate( sc, name ); \n\t} else if ( \"and\".equals( type )){\n\t return new andGate( sc, name ); \n\t} else if ( \"not\".equals( type )){ \n\t return new notGate( sc, name ); \n\t} else if ( \"const\".equals( type )){\n\t return new constant( sc, name ); \n\t} else {\n\t Errors.warn( \"Gate \" + name + \" \" + type\n\t\t\t+ \" has an invalid type\" );\n\t\n\t throw new ConstructorFailure();\n\t}\n }", "public String getRegex();", "static int type_of_rm(String passed){\n\t\treturn 1;\n\t}", "public synchronized Literal createLiteral(String str) {\n\n // check whether we have it in the registry\n Literal r = (Literal)lmap.get(str);\n if(r == null) {\n r = new LiteralImpl(/*getUnusedNodeID(),*/ str);\n lmap.put(str, r);\n }\n return r;\n }", "<C> BooleanLiteralExp<C> createBooleanLiteralExp();", "public PatternTypeLiteralElements getPatternTypeLiteralAccess() {\r\n\t\treturn pPatternTypeLiteral;\r\n\t}", "@Override\n\tpublic boolean test(MyRegex t) {\n\t\treturn false;\n\t}", "static int type_of_rz(String passed){\n\t\treturn 1;\n\t}", "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}", "Register.Res getRegisterRes();", "public Object visitBitwiseOrExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a | (Long) b;\n }\n else {\n result = parens(a) + \" | \" + parens(b);\n }\n \n return result;\n }", "public static TTL_SystemRequest getReference( String s )\n {\n return( (TTL_SystemRequest)( nameHash.get( s ) ) );\n }", "int getRType();", "String getSType();", "public String jump(String s) {\n\t\tif(s.equals(\"JGT\")) {\n\t\t\treturn \"001\";\n\t\t} else if(s.equals(\"JEQ\")) {\n\t\t\treturn \"010\";\n\t\t} else if(s.equals(\"JGE\")) {\n\t\t\treturn \"011\";\n\t\t} else if(s.equals(\"JLT\")) {\n\t\t\treturn \"100\";\n\t\t} else if(s.equals(\"JNE\")) {\n\t\t\treturn \"101\";\n\t\t} else if(s.equals(\"JLE\")) {\n\t\t\treturn \"110\";\n\t\t} else if(s.equals(\"JMP\")) {\n\t\t\treturn \"111\";\n\t\t} else {\n\t\t\treturn \"000\";\n\t\t}\n\t}", "public static TableSpaceType get(String literal) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tTableSpaceType result = VALUES_ARRAY[i];\n\t\t\tif (result.toString().equals(literal)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "ExpOperand createExpOperand();", "LocalSimpleType getSimpleType();", "RealLiteralExp createRealLiteralExp();", "public static TopmarkType get(String literal) {\n\t\tfor (int i = 0; i < VALUES_ARRAY.length; ++i) {\n\t\t\tTopmarkType result = VALUES_ARRAY[i];\n\t\t\tif (result.toString().equals(literal)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "static boolean isaNonMinusOperator(char s){\n boolean nonMinusOperator = false;\n switch (s){\n case '+':nonMinusOperator = true; break;\n case '*':nonMinusOperator = true; break;\n case '/':nonMinusOperator = true; break;\n case '^':nonMinusOperator = true; break;\n }\n return nonMinusOperator;\n }", "public String returnRegex() {\n\t\tString chosenRegex;\n\t\tSystem.out.println(\"selectedRegex value is: \" + selectedRegex);\n\t\tswitch (selectedRegex) {\n\t\tcase 1:\n\t\t\tchosenRegex = \"(\\\\&?\\\\??t=\\\\d*?[h]?\\\\d*[m]?\\\\d*[s]|\\\\&t=\\\\d*)\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tchosenRegex = \"(\\\\&list=[a-zA-Z 0-9 -]+\\\\&?index=?\\\\d+?)\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tchosenRegex = \"(\\\\&feature=youtu.be)\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tchosenRegex = \"\\\\?t.*|\\\\&t.*|\\\\&l.*|\\\\&f.*\"; // alternative:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// (\\\\&?\\\\??t=\\\\d*?[h]?\\\\d*[m]?\\\\d*[s]|\\\\&t=\\\\d*|\\\\&list=[a-zA-Z\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 0-9 -]*)\n\t\t\tbreak;\n\t\t}\n\t\tSystem.out.println(chosenRegex);\n\t\treturn chosenRegex;\n\t}", "public String nextToken(String s, int start)\n {\n TokenBuilder token = new TokenBuilder();\n char[] temp = s.toCharArray();\n int count = start;\n if(Operator.isOperator(temp[start]) || Brackets.isLeftBracket(temp[start]) || Brackets.isRightBracket(temp[start]))\n {\n return temp[start] + \"\";\n }\n while(count < temp.length && isOperand(temp[count] + \"\"))\n {\n token.append(temp[count]);\n count++;\n }\n return token.build();\n }", "protected static SimpleType getSimpleType(String sType)\n {\n SimpleType type = MBeanHelper.SCALAR_SIMPLETYPES.get(sType);\n return type == null ? SimpleType.STRING : type;\n }" ]
[ "0.67252415", "0.6141697", "0.599541", "0.584423", "0.55162805", "0.54042584", "0.5375602", "0.534178", "0.5325128", "0.52937365", "0.525556", "0.5248306", "0.5176977", "0.51202595", "0.5120105", "0.5086228", "0.50827044", "0.50791645", "0.49918756", "0.49565983", "0.49565825", "0.49460322", "0.4931588", "0.49278465", "0.49176612", "0.49176612", "0.4900567", "0.4899325", "0.48946178", "0.48881742", "0.48711494", "0.48681897", "0.48656824", "0.48290485", "0.4824719", "0.4793307", "0.47931537", "0.4790249", "0.4786036", "0.47803065", "0.47793427", "0.4770967", "0.47623563", "0.47623563", "0.47599864", "0.47588012", "0.4756017", "0.4750101", "0.47465426", "0.47416598", "0.4740202", "0.47340024", "0.47303757", "0.47232157", "0.47197464", "0.47163016", "0.47004595", "0.46968883", "0.46926036", "0.46783623", "0.4677686", "0.4663807", "0.4663807", "0.46603692", "0.46535078", "0.46506703", "0.46334678", "0.4613113", "0.46092835", "0.46089756", "0.46052107", "0.4598645", "0.45924848", "0.45910785", "0.4590809", "0.45895958", "0.4587553", "0.45817465", "0.45808116", "0.45728177", "0.45714825", "0.45658848", "0.4559546", "0.45521313", "0.45465598", "0.4545416", "0.4541164", "0.4539749", "0.4536209", "0.45346382", "0.45339307", "0.45298246", "0.4529396", "0.45243415", "0.45224905", "0.45218652", "0.4519239", "0.4517918", "0.4509125", "0.4507221", "0.45044857" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { DisplayInfo displayInfo=new DisplayInfo(); displayInfo.studentName("Surabhi"); displayInfo.display(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public int getCount() { return mList.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public Object getItem(int arg0) { return mList.get(arg0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public long getItemId(int arg0) { return arg0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public View getView(int arg0, View arg1, ViewGroup arg2) { ViewHolder holder = null; String name ; String value; name = mList.get(arg0).getItemName(); value = mList.get(arg0).getItemValue(); Log.d("videoplayer_setting adpter","now arg0 is "+arg0+"now name is "+name+"now value is "+value); if(arg1 == null){ arg1 = mInflater.inflate(R.layout.settingmenuitemxml, null); holder = new ViewHolder(); holder.name = (TextView)arg1.findViewById(R.id.xmlmenuname); holder.value = (TextView)arg1.findViewById(R.id.xmlmenuvalue); arg1.setTag(holder); }else { holder = (ViewHolder)arg1.getTag(); } holder.name.setText(name); holder.value.setText(value); return arg1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
new GStreamClient("localhost", 8080).makeBlockingRequestForLargeDataStream(); new GStreamClient("localhost", 8080).makeAsyncRequestForLargeDataStream(); new GStreamClient("localhost", 8080).makeStreamingRequestForSum();
public static void main(String[] args) throws Exception { new GStreamClient("localhost", 8080).makeStreamingRequestForBatchedSum(); // Observation : for the first two calls - behavior is same. // Iterable hasNext and next are getting called every 2 seconds once server responds // Observation : server is always assumed to stream the response // hence responseObserver is always present // if client does not stream the request, then input is just the simple request object, else StreamObserver }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long request(MarketDataRequest inRequest,\n boolean inStreamEvents);", "DataStreamApi getDataStreamApi();", "@Test\n public void bigDataInMap() throws Exception {\n\n final byte[] data = new byte[16 * 1024 * 1024]; // 16 MB\n rnd.nextBytes(data); // use random data so that Java does not optimise it away\n data[1] = 0;\n data[3] = 0;\n data[5] = 0;\n\n CollectingSink resultSink = new CollectingSink();\n\n StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();\n env.setParallelism(1);\n\n DataStream<Integer> src = env.fromElements(1, 3, 5);\n\n src.map(\n new MapFunction<Integer, String>() {\n private static final long serialVersionUID = 1L;\n\n @Override\n public String map(Integer value) throws Exception {\n return \"x \" + value + \" \" + data[value];\n }\n })\n .addSink(resultSink);\n\n JobGraph jobGraph = StreamingJobGraphGenerator.createJobGraph(env.getStreamGraph());\n\n final RestClusterClient<StandaloneClusterId> restClusterClient =\n new RestClusterClient<>(\n MINI_CLUSTER_RESOURCE.getClientConfiguration(),\n StandaloneClusterId.getInstance());\n\n try {\n submitJobAndWaitForResult(restClusterClient, jobGraph, getClass().getClassLoader());\n\n List<String> expected = Arrays.asList(\"x 1 0\", \"x 3 0\", \"x 5 0\");\n\n List<String> result = CollectingSink.result;\n\n Collections.sort(expected);\n Collections.sort(result);\n\n assertEquals(expected, result);\n } finally {\n restClusterClient.close();\n }\n }", "DataStreams createDataStreams();", "long getChunkSize();", "long getChunkSize();", "long getChunkSize();", "long getChunkSize();", "public interface Stream<T> extends Lifecycle {\n\n PendingRequest<T> next(int requestId, T request);\n\n int getPendingRequestCount();\n\n ClientResponseObserver<T, RpcResult> newObserver();\n\n\n final class PendingRequest<T> {\n\n private final T request;\n\n private final int requestId;\n\n private final SettableFuture<com.baichen.jraft.transport.RpcResult> future;\n\n private RepeatableTimer.TimerTask timeout;\n\n private long startTime;\n\n public PendingRequest(T request, int requestId, SettableFuture<com.baichen.jraft.transport.RpcResult> future) {\n this.request = request;\n this.requestId = requestId;\n this.future = future;\n }\n\n public long getStartTime() {\n return startTime;\n }\n\n public void setStartTime(long startTime) {\n this.startTime = startTime;\n }\n\n public void setTimeout(RepeatableTimer.TimerTask timeout) {\n this.timeout = timeout;\n }\n\n public RepeatableTimer.TimerTask getTimeout() {\n return timeout;\n }\n\n public T getRequest() {\n return request;\n }\n\n public int getRequestId() {\n return requestId;\n }\n\n public SettableFuture<com.baichen.jraft.transport.RpcResult> getFuture() {\n return future;\n }\n }\n}", "public void test_001_Stream() throws Throwable {\n\n final String RESOURCE_URI = \"asimov_it_test_001_SP_PROXYING\";\n String uri = createTestResourceUri(RESOURCE_URI);\n\n HttpRequest request = createRequest().setUri(uri).addHeaderField(\"Cache-Control\" ,\"max-age=500\").getRequest();\n PrepareResourceUtil.prepareResource(uri, false);\n\n //miss\n sendRequest2(request, 10);\n //R1.2 miss\n checkMiss(request, 2, VALID_RESPONSE);\n }", "@Test\n public void largeMessageVolumeTest_buffered() {\n int batches = 15;\n int batchSize = 5_000;\n List<Long> sendReceiveTimings = new ArrayList<>();\n List<Long> sendTimings = new ArrayList<>();\n for(int i = 0; i< batches; i++) {\n List<String> messages = messages(batchSize, 100);\n long startTime = System.currentTimeMillis();\n for (String message : messages) {\n publisher.publishBuffered(topic, message.getBytes());\n }\n publisher.flushBatchers();\n sendTimings.add(System.currentTimeMillis()-startTime);\n List<NSQMessage> nsqMessages = handler1.drainMessagesOrTimeOut(batchSize);\n sendReceiveTimings.add(System.currentTimeMillis()-startTime);\n\n validateReceivedAllMessages(messages,nsqMessages,true);\n LOGGER.info(\"published batch {} of {}\",i,batches);\n }\n\n double sendAverageMillis = sendTimings.stream().mapToLong(e -> e).average().getAsDouble();\n double throughput = batchSize/sendAverageMillis*1000;\n LOGGER.info(\"Average send time for {} messages: {} millis, {} op/s\", batchSize, sendAverageMillis, throughput);\n\n double totalAverageMillis = sendReceiveTimings.stream().mapToLong(e -> e).average().getAsDouble();\n throughput = batchSize/totalAverageMillis*1000;\n LOGGER.info(\"Average send time for {} messages: {} millis, {} op/s\", batchSize, totalAverageMillis, throughput);\n }", "int getChunkSize();", "private static void bidiStreamService(ManagedChannel channel){\n CalculatorServiceGrpc.CalculatorServiceStub asynClient = CalculatorServiceGrpc.newStub(channel);\n CountDownLatch latch = new CountDownLatch(1);\n StreamObserver<FindMaximumRequest> streamObserver = asynClient.findMaximum(new StreamObserver<FindMaximumResponse>() {\n @Override\n public void onNext(FindMaximumResponse value) {\n System.out.println(\"Got new maxium from server: \"+ value.getMaximum());\n }\n\n @Override\n public void onError(Throwable t) {\n latch.countDown();\n }\n\n @Override\n public void onCompleted() {\n System.out.println(\"Server is done sending data\");\n latch.countDown();\n }\n });\n\n Arrays.asList(1,5,3,6,2,20).forEach(\n number -> {\n System.out.println(\"Sending number: \"+ number);\n streamObserver.onNext(FindMaximumRequest.newBuilder()\n .setNumber(number)\n .build());\n }\n );\n\n streamObserver.onCompleted();\n try {\n latch.await(3L, TimeUnit.SECONDS);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "public long getStream();", "public interface StreamingRiakFuture<ResultType, QueryInfoType>\n extends RiakFuture<ResultType, QueryInfoType>\n{\n /**\n * An Queue that provides the stream of results as they return from Riak.\n * @return An Queue.\n */\n TransferQueue<ResultType> getResultsQueue();\n}", "public static void main(String[] args) {\n MyOptions options = PipelineOptionsFactory\n .fromArgs(args)\n .withValidation()\n .as(MyOptions.class);\n \n options.setStreaming(true);\n projectName = options.getProject();\n\n String subscription = \"projects/\"\n + projectName\n + \"/subscriptions/\"\n + \"dataflow-stream-demo\";\n\n String batchSubscription = \"projects/\"\n + projectName\n + \"/subscriptions/\"\n + \"dataflow-stream-gcs-demo\";\n Pipeline p = Pipeline.create(options);\n PCollection<String> merged;\n\n // Collect batched data events from Pub/Sub\n PCollection<String> uris = p.apply(PubsubIO.readMessagesWithAttributes()\n .fromSubscription(batchSubscription))\n .apply(MapElements\n .via(new InferableFunction<PubsubMessage, String>() {\n private static final long serialVersionUID = 1L;\n public String apply(PubsubMessage msg) throws Exception {\n return GcsPath.fromComponents(\n msg.getAttribute(\"bucketId\"),\n msg.getAttribute(\"objectId\")\n ).toString();\n }\n }));\n\n // Get our files from the batched events\n PCollection<String> batchedData = uris.apply(FileIO.matchAll()\n .withEmptyMatchTreatment(EmptyMatchTreatment.DISALLOW))\n .apply(FileIO.readMatches())\n .apply(TextIO.readFiles());\n\n // Read live data from Pub/Sub\n PCollection<String> pubsubStream = p.apply(\"Read from Pub/Sub\", PubsubIO.readStrings()\n .fromSubscription(subscription));\n \n // Merge our two streams together\n merged = PCollectionList\n .of(batchedData)\n .and(pubsubStream)\n .apply(\"Flatten Streams\",\n Flatten.<String>pCollections());\n // Decode the messages into TableRow's (a type of Map), split by tag\n // based on how our decode function emitted the TableRow\n PCollectionTuple decoded = merged.apply(\"Decode JSON into Rows\", ParDo\n .of(new DecodeMessage())\n .withOutputTags(windowData, TupleTagList\n .of(badData)\n .and(rawData)));\n \n // @decoded is now a single object that contains 3 streams, badData, rawData,\n // and windowData. This illustrates a \"mono\" stream approach where data from\n // a stream can be split and worked differently depending on variables in the\n // data at run time.\n\n // Write data that we couldn't decode (bad JSON, etc) to BigQuery\n decoded.get(badData)\n .apply(\"Send Dead Letter (Failed Decode)\", new DeadLetter(\"Failed Decode\"));\n\n // Write full, raw output, to a BigQuery table\n decoded.get(rawData)\n .apply(\"Raw to BigQuery\", BigQueryIO.writeTableRows()\n .to(projectName + \":dataflow_demo.rawData\")\n .withMethod(Method.STREAMING_INSERTS)\n .withSchema(Helpers.generateSchema(Helpers.rawSchema))\n .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED)\n .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND)\n .withFailedInsertRetryPolicy(InsertRetryPolicy.retryTransientErrors()))\n .getFailedInserts()\n .apply(\"Send Dead Letter (Raw)\", new DeadLetter(\"Raw\"));\n\n // Write full, raw output, to a BigTable table.\n decoded.get(rawData).apply(\"Convert to Mutation\", ParDo\n .of(new CreateMutation()))\n .apply(\"Raw to BigTable\", BigtableIO.write()\n .withProjectId(projectName)\n .withInstanceId(\"df-demo\")\n .withTableId(\"df-demo\"));\n\n // Process our previously decoded KV of (event, TableRow) outputs\n // and bucket them into 1 minute long buckets of data. Think of this\n // as a dam that opens the gates every minute.\n decoded.get(windowData)\n .apply(\"1 Minute Window\", Window.<KV<String,TableRow>>\n into(FixedWindows\n .of(Duration.standardMinutes(1))))\n\n // Take our 1 minute worth of data and combine it by Key, and\n // call our previously defined SumEvents function. This will in turn\n // emit a series of KV (event, TableRows) for each unique event\n // type.\n .apply(\"Calculate Rollups\", Combine.<String, TableRow>perKey(new SumEvents()))\n\n // Get the event name for this rollup, and apply it to the TableRow\n .apply(\"Apply Event Name\", ParDo\n .of(new DoFn<KV<String, TableRow>, TableRow>(){\n private static final long serialVersionUID = -690923091551584848L;\n @ProcessElement\n public void processElement(ProcessContext c, BoundedWindow window) {\n TableRow r = c.element().getValue();\n r.set(\"event\", c.element().getKey());\n r.set(\"timestamp\",window.maxTimestamp().getMillis() / 1000);\n c.output(r);\n }\n }))\n // Write our one minute rollups for each event to BigQuery\n .apply(\"Rollup to BigQuery\", BigQueryIO.writeTableRows()\n .to(projectName + \":dataflow_demo.rollupData\")\n .withMethod(Method.STREAMING_INSERTS)\n .withSchema(Helpers.generateSchema(Helpers.rollupSchema))\n .withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED)\n .withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND)\n .withFailedInsertRetryPolicy(InsertRetryPolicy.retryTransientErrors()))\n .getFailedInserts()\n .apply(\"Send Dead Letter (Rollups)\", new DeadLetter(\"Rollups\"));\n\n // Run our pipeline, and do not block/wait for execution!\n p.run();\n }", "public void test_002_Stream() throws Throwable {\n\n final String RESOURCE_URI = \"asimov_it_test_002_SP_PROXYING\";\n String uri = createTestResourceUri(RESOURCE_URI);\n\n HttpRequest request = createRequest().setUri(uri).addHeaderField(\"Cache-Control\" ,\"max-age=500\").getRequest();\n PrepareResourceUtil.prepareResource(uri, false);\n\n //miss, cached by RFC\n sendRequest2(request, 0);\n // R1.2 hit\n checkHit(request, 2, VALID_RESPONSE);\n }", "void sendChunkRequest(int chunkX, int chunkY);", "@Test\n public void syncStreamsTest() {\n try (Context context = GrCUDATestUtil.buildTestContext().build()) {\n Value createStream = context.eval(\"grcuda\", \"cudaStreamCreate\");\n Value stream1 = createStream.execute();\n Value stream2 = createStream.execute();\n\n final int numElements = 100;\n final int numBlocks = (numElements + NUM_THREADS_PER_BLOCK - 1) / NUM_THREADS_PER_BLOCK;\n Value deviceArrayConstructor = context.eval(\"grcuda\", \"DeviceArray\");\n Value x = deviceArrayConstructor.execute(\"float\", numElements);\n Value y = deviceArrayConstructor.execute(\"float\", numElements);\n Value buildkernel = context.eval(\"grcuda\", \"buildkernel\");\n Value squareKernel = buildkernel.execute(SQUARE_KERNEL, \"square\", \"pointer, pointer, sint32\");\n for (int i = 0; i < numElements; ++i) {\n x.setArrayElement(i, 2.0);\n }\n // Set the custom streams;\n Value configuredSquareKernel1 = squareKernel.execute(numBlocks, NUM_THREADS_PER_BLOCK, stream1);\n Value configuredSquareKernel2 = squareKernel.execute(numBlocks, NUM_THREADS_PER_BLOCK, stream2);\n\n Value createEvent = context.eval(\"grcuda\", \"cudaEventCreate\");\n Value eventRecord = context.eval(\"grcuda\", \"cudaEventRecord\");\n Value streamEventWait = context.eval(\"grcuda\", \"cudaStreamWaitEvent\");\n\n configuredSquareKernel1.execute(x, y, numElements);\n\n // Create an event to ensure that kernel 2 executes after kernel 1 is completed;\n Value event = createEvent.execute();\n eventRecord.execute(event, stream1);\n streamEventWait.execute(stream2, event);\n\n configuredSquareKernel2.execute(y, x, numElements);\n\n Value syncStream = context.eval(\"grcuda\", \"cudaStreamSynchronize\");\n syncStream.execute(stream2);\n\n for (int i = 0; i < numElements; i++) {\n assertEquals(16.0, x.getArrayElement(i).asFloat(), 0.01);\n assertEquals(4.0, y.getArrayElement(i).asFloat(), 0.01);\n }\n }\n }", "public interface DataStreamClient {\n\n Logger LOG = LoggerFactory.getLogger(DataStreamClient.class);\n\n /** Return Client id. */\n ClientId getId();\n\n /** Return Streamer Api instance. */\n DataStreamApi getDataStreamApi();\n\n /**\n * send to server via streaming.\n * Return a completable future.\n */\n\n /** To build {@link DataStreamClient} objects */\n class Builder {\n private ClientId clientId;\n private DataStreamClientRpc dataStreamClientRpc;\n private RaftProperties properties;\n private Parameters parameters;\n\n private Builder() {}\n\n public DataStreamClientImpl build(){\n if (clientId == null) {\n clientId = ClientId.randomId();\n }\n if (properties != null) {\n if (dataStreamClientRpc == null) {\n final SupportedDataStreamType type = RaftConfigKeys.DataStream.type(properties, LOG::info);\n dataStreamClientRpc = DataStreamClientFactory.cast(type.newFactory(parameters))\n .newDataStreamClientRpc(clientId, properties);\n }\n }\n return new DataStreamClientImpl(clientId, properties, dataStreamClientRpc);\n }\n\n public Builder setClientId(ClientId clientId) {\n this.clientId = clientId;\n return this;\n }\n\n public Builder setParameters(Parameters parameters) {\n this.parameters = parameters;\n return this;\n }\n\n public Builder setDataStreamClientRpc(DataStreamClientRpc dataStreamClientRpc){\n this.dataStreamClientRpc = dataStreamClientRpc;\n return this;\n }\n\n public Builder setProperties(RaftProperties properties) {\n this.properties = properties;\n return this;\n }\n }\n\n}", "public static void throughput(BasicGraphService bgs) {\n \tRandom random = new Random();\n \tlong timer = System.currentTimeMillis();\n\t\tlong dif = 0l;\n\t\tint ops = 0;\n\t\twhile(dif < 1000) {\n\t\t\tint key = random.nextInt(maxRandInt);\n\t\t\tbgs.getConnections(key);\n\t\t\tdif = System.currentTimeMillis() - timer;\n\t\t\tops++;\n\t\t}\n\t\tdebug(debug, \"operations in 1 second: \" + ops);\n }", "public static void main(String[] args) throws MalformedURLException, InterruptedException\n\t{\n\n\t\tint meterNum = 10;\n//\t\tif(Integer.parseInt(args[1]) > 0) {\n//\t\t\tmeterNum = Integer.parseInt(args[1]);\n//\t\t}\n\t\t\n\t\tint threadNum = 5;\n\t\tint totalDocNum = 10;\n\t\t\n\t\tSystem.gc();\n\t\t\n\t\tmeterStream[] ms = new meterStream[meterNum]; \t\t\t\n\t\t\n\t\tfor(int i = 0 ; i < meterNum ; i++)\n\t\t{\n\t\t\tms[i] = new meterStream();\n\t\t\t//ms[i].setUrl(\"http://service2.allenworkspace.net/xml/xmldata/testxml\"+(i+1)+\".xml\");\n\t\t\tms[i].setUrl(\"http://program.allenworkspace.net/xml/xmldata/testxml\"+(i+1)+\".xml\");\t\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t/*\n\t\tString[] xpathArray = new String[] {\"/a0CC175B9C0F1B6A831C399E269772661/a92EB5FFEE6AE2FEC3AD71C777531578F/@aB80BB7740288FDA1F201890375A60C8F\",\n\t\t\t\t\"/a0CC175B9C0F1B6A831C399E269772661/a4A8A08F09D37B73795649038408B5F33/@a2063C1608D6E0BAF80249C42E2BE5804\"};\n\t\t*/\n\t\t\n\t\tString[] xpathArray = new String[] {\"/a0CC175B9C0F1B6A831C399E269772661/a92EB5FFEE6AE2FEC3AD71C777531578F/\",\n\t\t\t\t\"/a0CC175B9C0F1B6A831C399E269772661/a4A8A08F09D37B73795649038408B5F33/\"};//YFilter專用\n\t\t\n\t\tList<String> xpathList = new ArrayList<String>();\n\t\tCollections.addAll(xpathList, xpathArray);\n\t\t\n\t\t//List<XMLDogTask> taskPool = null;\n\t\t//List<SaxonTask> taskPool = null;\n\t\tList<YFilterTask> taskPool = null;\n\t\t\n\t\tif(threadNum > 0) {\n\t\t\t//taskPool = TaskPool.CreateXMLDogTasks(threadNum, xpathList);\n\t\t\t//taskPool = TaskPool.CreateSaxonTasks(threadNum, xpathList);\n\t\t\ttaskPool = TaskPool.CreateYFilterTasks(threadNum, xpathList);\n\t\t\t\n\t\t\t/*\n\t\t\tfor(int i = 0; i < threadNum; ++i) {\n\t\t\t\tDefaultNamespaceContext nsContext = new DefaultNamespaceContext(); // an implementation of javax.xml.namespace.NamespaceContext\n\t\t\t\tnsContext.declarePrefix(\"xsd\", Namespaces.URI_XSD);\n\t\t\t\tdog = new XMLDog(nsContext);\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tExpression xpath1 = dog.addXPath(\"/a0CC175B9C0F1B6A831C399E269772661/a92EB5FFEE6AE2FEC3AD71C777531578F/@aB80BB7740288FDA1F201890375A60C8F\");\n\t\t\t\t\tExpression xpath2 = dog.addXPath(\"/a0CC175B9C0F1B6A831C399E269772661/a4A8A08F09D37B73795649038408B5F33/@a2063C1608D6E0BAF80249C42E2BE5804\");\t\n\t\t\t\t} \n\t\t\t\tcatch (SAXPathException e) \n\t\t\t\t{\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \n\t\t\t} */\n\t\t}\n\t\t\n\t\tExecutorService executorService = Executors.newFixedThreadPool(threadNum);\n\t\tExecutorService reducerService = Executors.newCachedThreadPool(); \n\t\tList<Future<List<String>>> resultList = null;\n\t\t\n\t\tlong starttime = System.currentTimeMillis();\n\t\t\n\t\tfor(int i = 0 ; i < totalDocNum ; i++ )\n\t\t{\n\t\t\t//callXMLDogFilter myFilter = new callXMLDogFilter(ms[i%meterNum].strURI);\n\t\t\t//callSaxonFilter myFilter = new callSaxonFilter(ms[i%meterNum].strURI);\n\t\t\tcallYFilter myFilter = new callYFilter(ms[i%meterNum].strURI);\n\t\t\t\n\t\t\tmyFilter.SetTaskList(taskPool);\n\t\t\t// myFilter.setStream(ms[i%meterNum].getStream());\n\t\t\t/* myThreads[t] = new Thread(testFilter[t]);\n\t\t\tmyThreads[t].start(); */\n\t\t\tFuture<List<String>> result = executorService.submit(myFilter);\n\t\t\tif(i % meterNum == 0) {\n\t\t\t\tresultList = new ArrayList<Future<List<String>>>();\n\t\t\t} \n\t\t\tresultList.add(result);\n\t\t\tif(resultList.size() == meterNum) {\n\t\t\t\t//ExecuteService myReducer = Executors.newFixedThreadPool(threadNum)\n\t\t\t\tString taskID = (i/meterNum)+\"\";\n\t\t\t\t\n\t\t\t\t//XMLDogTaskReducer reducer = (XMLDogTaskReducer) TaskReducerFactory.Create(\"XMLDogTaskReducer\");\n\t\t\t\t//SaxonTaskReducer reducer = (SaxonTaskReducer) TaskReducerFactory.Create(\"SaxonTaskReducer\");\n\t\t\t\tYFilterTaskReducer reducer = (YFilterTaskReducer) TaskReducerFactory.Create(\"YFilterTaskReducer\");\n\t\t\t\t\n\t\t\t\treducer.SetID(taskID);\n\t\t\t\treducer.resultList = resultList;\t\t\t\t\t\n\t\t\t\treducerService.execute(reducer);\n\t\t\t}\n\t\t\t// resultList.add(result);\n\t\t}\n\t\texecutorService.shutdown(); \n\t\texecutorService.awaitTermination(30, TimeUnit.MINUTES);\n\t\treducerService.shutdown();\n\t\treducerService.awaitTermination(30, TimeUnit.MINUTES);\n\t\t\t\t\n\t\tlong endTime = System.currentTimeMillis();\n\t\tSystem.out.println((\"duration:\" + (endTime - starttime)));\n\t}", "R request();", "public interface FileService {\n @POST(\"file/upload\")\n Call<Result<String>> upload(@Body RequestBody file);\n\n @GET\n @Streaming\n Call<ResponseBody> download(@Url String url);\n}", "public interface BackPressuredWriteStream<T> extends WriteStream<T> {\n\n static <T> BackPressuredWriteStream create(Handler<T> writeHandler) {\n return new BackPressuredWriteStreamImpl<T>(writeHandler);\n }\n\n static <T> BackPressuredWriteStream createThrottled(Handler<T> writeHandler, long quotaPeriod, int quota, String persistentQuotaTimeFile, Vertx vertx) {\n return new ThrottleStreamImpl(writeHandler, quotaPeriod, quota, persistentQuotaTimeFile, vertx);\n }\n\n void drop();\n\n long getQueueSize();\n}", "@Ignore\n @Test\n public void testPerformanceFuserOnly() throws JAXBException, ClassNotFoundException, Exception\n {\n int num_messages = 20000;\n int num_samples = 10;\n \n long total = 0;\n long min = Long.MAX_VALUE;\n long max = Long.MIN_VALUE;\n \n for( int i = 0; i < num_samples; i++ )\n {\n long proc_time = sendMatmFlightMsgs( num_messages );\n total = total + proc_time;\n min = Math.min( min, proc_time );\n max = Math.max( max, proc_time );\n }\n \n log.info( \"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\" );\n log.info( \"Ran \" + num_samples + \" samples. Avg Time = \" + ( total / num_samples ) + \n \", Min Time = \" + min + \", Max Time = \" + max );\n log.info( \"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\" ); \n }", "@NonNull\n StreamedHttpRequest toStreamHttpRequest();", "public interface AudioDownloadClient {\n\n @GET(\"uc?export=download\")\n @Streaming\n Call<ResponseBody> downloadAudio(@Query(\"id\") String id);\n}", "public interface FastTransportable extends Transportable\n{\n// Stream unique identifier\n// public final static long SUID = ..;\n\n// Bisogna far generare in maniera automatica questi due metodi\n// Serializza l'oggetto\n public void writeObject( Container.ContainerOutputStream cos ) throws SerializationException;\n// inizializza l'istanza dell'oggetto\n public void readObject( Container.ContainerInputStream cis ) throws SerializationException;\n\n// ...insieme a questo, dipende dal tipo effettivo dell'oggetto.\n public int sizeOf(); // dimensione dell'oggetto.\n\n}", "public static void main(String[] args) throws InterruptedException, ExecutionException {\n BlockingQueue<String> msgQueue = new LinkedBlockingQueue<String>(100);\n BlockingQueue<Event> eventQueue = new LinkedBlockingQueue<Event>(100);\n\n /** Declare the host you want to connect to, the endpoint, and authentication (basic auth or oauth) */\n Hosts hosebirdHosts = new HttpHosts(Constants.STREAM_HOST);\n StatusesFilterEndpoint hosebirdEndpoint = new StatusesFilterEndpoint();\n // Optional: set up some followings and track terms\n List<Long> followings = Lists.newArrayList(1234L, 566788L);\n List<String> terms = Lists.newArrayList(\"twitter\", \"api\");\n hosebirdEndpoint.followings(followings);\n hosebirdEndpoint.trackTerms(terms);\n\n // These secrets should be read from a config file\n Authentication hosebirdAuth = new OAuth1(apiKey, apiKeySecret, accessToken, accessTokenSecret);\n\n\n ClientBuilder builder = new ClientBuilder()\n .name(\"Hosebird-Client-01\") // optional: mainly for the logs\n .hosts(hosebirdHosts)\n .authentication(hosebirdAuth)\n .endpoint(hosebirdEndpoint)\n .processor(new StringDelimitedProcessor(msgQueue))\n .eventMessageQueue(eventQueue); // optional: use this if you want to process client events\n\n Client hosebirdClient = builder.build();\n // Attempts to establish a connection.\n hosebirdClient.connect();\n\n String bootstrapServers = \"127.0.0.1:9092\";\n\n // Create Producer properties\n Properties properties = new Properties();\n properties.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);\n properties.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n properties.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());\n // Create producer\n KafkaProducer<String, String> producer = new KafkaProducer<String, String>(properties);\n\n int count = 0;\n // on a different thread, or multiple different threads....\n while (!hosebirdClient.isDone() && count < 10) {\n String msg = msgQueue.take();\n System.out.println(\"\\n\\nTwiter message (\"+count+\")\\n\");\n System.out.println(msg);\n // create producer record\n ProducerRecord<String, String> record =\n new ProducerRecord<String, String>(\"twiter-producer\", msg);\n producer.send(record).get();\n count++;\n }\n\n producer.flush();\n producer.close();\n // hosebirdClient.stop();\n\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path( \"/{source}/{sink}\" )\n public Response maximumflow(@PathParam(\"source\") long source,\n @PathParam(\"sink\") long sink) {\n JSONObject obj = new org.json.JSONObject();\n obj.put(\"source-id\",source);\n obj.put(\"sink-id\", sink);\n obj.put(\"maxflow\", this.getMaxFlow(source,sink));\n return Response.ok(obj.toString(), MediaType.APPLICATION_JSON)\n .header(\"X-Stream\", \"true\") //Enables large and huge operations in server to avoid crashing.\n .build();\n }", "abstract AbstractStreamingAnalyticsConnection createStreamsConnection()\n throws IOException;", "@Test\n public void testHTTPSPublisher() throws Exception {\n setCarbonHome();\n logger.info(\"Test case for HTTPS output publisher.\");\n SiddhiManager siddhiManager = new SiddhiManager();\n siddhiManager.setExtension(\"xml-output-mapper\", XMLSinkMapper.class);\n String inStreamDefinition = \"Define stream FooStream (message String,method String,headers String);\"\n + \"@sink(type='http',publisher.url='https://localhost:8009/abc',method='{{method}}',\"\n + \"headers='{{headers}}',\"\n + \"@map(type='xml', \"\n + \"@payload('{{message}}'))) \"\n + \"Define stream BarStream (message String,method String,headers String);\";\n String query = (\n \"@info(name = 'query') \"\n + \"from FooStream \"\n + \"select message,method,headers \"\n + \"insert into BarStream;\"\n );\n SiddhiAppRuntime siddhiAppRuntime = siddhiManager\n .createSiddhiAppRuntime(inStreamDefinition + query);\n InputHandler fooStream = siddhiAppRuntime.getInputHandler(\"FooStream\");\n siddhiAppRuntime.start();\n HttpsServerListenerHandler lst = new HttpsServerListenerHandler(8009);\n lst.run();\n fooStream.send(new Object[]{payload, \"POST\", \"'Name:John','Age:23'\"});\n while (!lst.getServerListener().isMessageArrive()) {\n Thread.sleep(10);\n }\n String eventData = lst.getServerListener().getData();\n Assert.assertEquals(eventData, expected);\n siddhiAppRuntime.shutdown();\n lst.shutdown();\n }", "default void refreshStream() {}", "@Test(timeout = 10000)\r\n public void slowConsumer() throws Exception {\r\n ModuleURN instanceURN = new ModuleURN(PROVIDER_URN, \"mymodule\");\r\n Object [] data = {\"item1\", \"item2\", \"item3\", \"item4\"};\r\n DataFlowID flowID = mManager.createDataFlow(new DataRequest[]{\r\n new DataRequest(CopierModuleFactory.INSTANCE_URN, data),\r\n new DataRequest(instanceURN),\r\n new DataRequest(BlockingModuleFactory.INSTANCE_URN)\r\n });\r\n //wait until copier is done emitting all the data\r\n DataFlowInfo flowInfo;\r\n do {\r\n Thread.sleep(100);\r\n flowInfo = mManager.getDataFlowInfo(flowID);\r\n } while(flowInfo.getFlowSteps()[0].getNumEmitted() < 4);\r\n \r\n for(int i = 0; i < data.length; i++) {\r\n //wait for the data to get delivered\r\n BlockingModuleFactory.getLastInstance().getSemaphore().acquire();\r\n //verify the flow info for the last step\r\n flowInfo = mManager.getDataFlowInfo(flowID);\r\n assertFlowStep(flowInfo.getFlowSteps()[2], BlockingModuleFactory.INSTANCE_URN,\r\n false, 0, 0, null, true, i + 1, 0, null, BlockingModuleFactory.INSTANCE_URN, null);\r\n //verify the jmx flow queue size attribute value\r\n if(i < data.length - 1) {\r\n assertEquals(data.length - 1 - i,\r\n getMBeanServer().getAttribute(instanceURN.toObjectName(),\r\n SimpleAsyncProcessor.ATTRIB_PREFIX + flowID));\r\n }\r\n //consume the data\r\n assertEquals(data[i], BlockingModuleFactory.getLastInstance().getNextData());\r\n }\r\n //verify that the queue size is now zero.\r\n assertEquals(0, getMBeanServer().getAttribute(\r\n instanceURN.toObjectName(),\r\n SimpleAsyncProcessor.ATTRIB_PREFIX + flowID));\r\n //cancel data flow\r\n mManager.cancel(flowID);\r\n }", "@Test\n public void testChunkedOutputToChunkInput() throws Exception {\n final ChunkedInput<String> input = target().path(\"test\").request().get(new javax.ws.rs.core.GenericType<ChunkedInput<String>>() {});\n int counter = 0;\n String chunk;\n while ((chunk = input.read()) != null) {\n Assert.assertEquals((\"Unexpected value of chunk \" + counter), \"test\", chunk);\n counter++;\n } \n Assert.assertEquals(\"Unexpected numbed of received chunks.\", 3, counter);\n }", "default <T> EagerFutureStream<T> sync(Function<EagerReact,EagerFutureStream<T>> react){\n\t\t EagerReact r =SequentialElasticPools.eagerReact.nextReactor().withAsync(false);\n\t\t return react.apply( r)\n\t\t\t\t \t.onFail(e->{ SequentialElasticPools.eagerReact.populate(r); throw e;})\n\t\t\t\t \t.peek(i->SequentialElasticPools.eagerReact.populate(r));\n\t\t \t\t\t\t \t\n\t}", "private Response buildStream(final File asset, final String range) throws Exception {\n if (range == null) {\n StreamingOutput streamer = new StreamingOutput() {\n @Override\n public void write(final OutputStream output) throws IOException, WebApplicationException {\n\n final FileChannel inputChannel = new FileInputStream(asset).getChannel();\n final WritableByteChannel outputChannel = Channels.newChannel(output);\n try {\n inputChannel.transferTo(0, inputChannel.size(), outputChannel);\n } finally {\n // closing the channels\n inputChannel.close();\n outputChannel.close();\n }\n }\n\n };\n return Response.ok(streamer).header(HttpHeaders.CONTENT_LENGTH, asset.length()).build();\n }\n\n final int chunk_size = 1024 * 1024;\n String[] ranges = range.split(\"=\")[1].split(\"-\");\n final int from = Integer.parseInt(ranges[0]);\n /**\n * Chunk media if the range upper bound is unspecified. Chrome sends \"bytes=0-\"\n */\n int to = chunk_size + from;\n if (to >= asset.length()) {\n to = (int) (asset.length() - 1);\n }\n if (ranges.length == 2) {\n to = Integer.parseInt(ranges[1]);\n }\n\n final String responseRange = String.format(\"bytes %d-%d/%d\", from, to, asset.length());\n final RandomAccessFile raf = new RandomAccessFile(asset, \"r\");\n raf.seek(from);\n\n final int len = to - from + 1;\n final MediaStreamer streamer = new MediaStreamer(len, raf);\n Response.ResponseBuilder res = Response.status(Status.PARTIAL_CONTENT).entity(streamer)\n .header(\"Accept-Ranges\", \"bytes\")\n .header(\"Content-Range\", responseRange)\n .header(HttpHeaders.CONTENT_LENGTH, streamer.getLenth())\n .header(HttpHeaders.LAST_MODIFIED, new Date(asset.lastModified()));\n return res.build();\n }", "public final void run() {\n AppMethodBeat.i(108148);\n if (q.a(cVar2.aBx(), jSONObject2, (com.tencent.mm.plugin.appbrand.s.q.a) cVar2.aa(com.tencent.mm.plugin.appbrand.s.q.a.class)) == b.FAIL_SIZE_EXCEED_LIMIT) {\n aVar2.BA(\"convert native buffer parameter fail. native buffer exceed size limit.\");\n AppMethodBeat.o(108148);\n return;\n }\n String CS = j.CS(jSONObject2.optString(\"url\"));\n Object opt = jSONObject2.opt(\"data\");\n String optString = jSONObject2.optString(FirebaseAnalytics.b.METHOD);\n if (bo.isNullOrNil(optString)) {\n optString = \"GET\";\n }\n if (TextUtils.isEmpty(CS)) {\n aVar2.BA(\"url is null\");\n AppMethodBeat.o(108148);\n } else if (URLUtil.isHttpsUrl(CS) || URLUtil.isHttpUrl(CS)) {\n byte[] bArr = new byte[0];\n if (opt != null && d.CK(optString)) {\n if (opt instanceof String) {\n bArr = ((String) opt).getBytes(Charset.forName(\"UTF-8\"));\n } else if (opt instanceof ByteBuffer) {\n bArr = com.tencent.mm.plugin.appbrand.r.d.q((ByteBuffer) opt);\n }\n }\n synchronized (d.this.ioA) {\n try {\n if (d.this.ioA.size() >= d.this.ioB) {\n aVar2.BA(\"max connected\");\n ab.i(\"MicroMsg.AppBrandNetworkRequest\", \"max connected mRequestTaskList.size():%d,mMaxRequestConcurrent:%d\", Integer.valueOf(d.this.ioA.size()), Integer.valueOf(d.this.ioB));\n }\n } finally {\n while (true) {\n }\n AppMethodBeat.o(108148);\n }\n }\n } else {\n aVar2.BA(\"request protocol must be http or https\");\n AppMethodBeat.o(108148);\n }\n }", "static <T> EagerFutureStream<T> eagerFutureStreamFrom(Stream<CompletableFuture<T>> stream) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false)\n\t\t\t\t\t\t\t\t\t.fromStream(stream);\n\t}", "public interface EagerFutureStream<U> extends FutureStream<U>, EagerToQueue<U> {\n\t/* \n\t * Convert this stream into an async / sync stream\n\t * \n\t *\t@param async true if aysnc stream\n\t *\t@return\n\t * @see com.aol.simple.react.stream.traits.ConfigurableStream#withAsync(boolean)\n\t */\n\tEagerFutureStream<U> withAsync(boolean async);\n\t/* \n\t * Change task executor for the next stage of the Stream\n\t * \n\t * <pre>\n\t * {@code\n\t * EagerFutureStream.of(1,2,3,4)\n\t * \t\t\t\t\t.map(this::loadFromDb)\n\t * \t\t\t\t\t.withTaskExecutor(parallelBuilder().getExecutor())\n\t * \t\t\t\t\t.map(this::processOnDifferentExecutor)\n\t * \t\t\t\t\t.toList();\n\t * }\n\t * </pre>\n\t * \n\t *\t@param e New executor to use\n\t *\t@return Stream ready for next stage definition\n\t * @see com.aol.simple.react.stream.traits.ConfigurableStream#withTaskExecutor(java.util.concurrent.Executor)\n\t */\n\tEagerFutureStream<U> withTaskExecutor(Executor e);\n\n\t/* \n\t * Change the Retry Executor used in this stream for subsequent stages\n\t * <pre>\n\t * {@code\n\t * List<String> result = new EagerReact().react(() -> 1)\n\t\t\t\t.withRetrier(executor)\n\t\t\t\t.capture(e -> error = e)\n\t\t\t\t.retry(serviceMock).block();\n\t * \n\t * }\n\t * </pre>\n\t * \n\t * \n\t *\t@param retry Retry executor to use\n\t *\t@return Stream \n\t * @see com.aol.simple.react.stream.traits.ConfigurableStream#withRetrier(com.nurkiewicz.asyncretry.RetryExecutor)\n\t */\n\tEagerFutureStream<U> withRetrier(RetryExecutor retry);\n\n\t\n\tEagerFutureStream<U> withWaitStrategy(Consumer<CompletableFuture> c);\n\n\t\n\n\tEagerFutureStream<U> withLazyCollector(LazyResultConsumer<U> lazy);\n\n\t/* \n\t * Change the QueueFactory type for the next phase of the Stream.\n\t * Default for EagerFutureStream is an unbounded blocking queue, but other types \n\t * will work fine for a subset of the tasks (e.g. an unbonunded non-blocking queue).\n\t * \n\t * <pre>\n\t * {@code\n\t * List<Collection<String>> collected = EagerFutureStream\n\t\t\t\t.react(data)\n\t\t\t\t.withQueueFactory(QueueFactories.boundedQueue(1))\n\t\t\t\t.onePer(1, TimeUnit.SECONDS)\n\t\t\t\t.batchByTime(10, TimeUnit.SECONDS)\n\t\t\t\t.limit(15)\n\t\t\t\t.toList();\n\t * }\n\t * </pre>\n\t *\t@param queue Queue factory to use for subsequent stages\n\t *\t@return Stream\n\t * @see com.aol.simple.react.stream.traits.ConfigurableStream#withQueueFactory(com.aol.simple.react.async.QueueFactory)\n\t */\n\tEagerFutureStream<U> withQueueFactory(QueueFactory<U> queue);\n\n\tEagerFutureStream<U> withErrorHandler(\n\t\t\tOptional<Consumer<Throwable>> errorHandler);\n\n\tEagerFutureStream<U> withSubscription(Continueable sub);\n\n\t/*\n\t * Synchronous version of then (executed on completing thread, without involving an Executor)\n\t * \n\t * React to new events with the supplied function on the supplied\n\t * Executor\n\t * \n\t * @param fn Apply to incoming events\n\t * \n\t * @param service Service to execute function on\n\t * \n\t * @return next stage in the Stream\n\t */\n\tdefault <R> EagerFutureStream<R> thenSync(final Function<U, R> fn){\n\t\t return (EagerFutureStream<R>)FutureStream.super.thenSync(fn);\n\t }\n\t/* \n\t * Execute subsequent stages on the completing thread (until async called)\n\t * 10X faster than async execution.\n\t * Use async for blocking IO or distributing work across threads or cores.\n\t * Switch to sync for non-blocking tasks when desired thread utlisation reached\n\t * \n\t *\t@return Version of FutureStream that will use sync CompletableFuture methods\n\t * @see com.aol.simple.react.stream.traits.SimpleReactStream#sync()\n\t */\n\tdefault EagerFutureStream<U> sync(){\n\t\treturn (EagerFutureStream<U>)FutureStream.super.sync();\n\t}\n\t/* \n\t * Execute subsequent stages by submission to an Executor for async execution\n\t * 10X slower than sync execution.\n\t * Use async for blocking IO or distributing work across threads or cores.\n\t * Switch to sync for non-blocking tasks when desired thread utlisation reached\n\t *\n\t * \n\t *\t@return Version of FutureStream that will use async CompletableFuture methods\n\t * @see com.aol.simple.react.stream.traits.SimpleReactStream#async()\n\t */\n\tdefault EagerFutureStream<U> async(){\n\t\treturn (EagerFutureStream<U>)FutureStream.super.async();\n\t}\n\n\t\n\t/**\n\t * Convert between an Eager and Lazy future stream,\n\t * can be used to take advantages of each approach during a single Stream\n\t * \n\t * @return A LazyFutureStream from this EagerFutureStream\n\t */\n\tdefault LazyFutureStream<U> convertToLazyStream(){\n\t\treturn new LazyReact(getTaskExecutor()).withRetrier(getRetrier()).fromStream((Stream)getLastActive().stream());\n\t}\n\t/* \n\t * Apply a function to all items in the stream.\n\t * <pre>\n\t * {@code\n\t * EagerFutureStream.sequentialBuilder().react(()->1,()->2,()->3)\n\t\t \t\t\t\t\t\t\t\t\t .map(it->it+100) //add 100\n\t\t \t\t\t\t\t\t\t\t\t .toList();\n\n\t * }\n\t * //results in [100,200,300]\n\t * </pre>\n\t *\t@param mapper Function to be applied to all items in the Stream\n\t *\t@return\n\t * @see com.aol.simple.react.stream.traits.FutureStream#map(java.util.function.Function)\n\t */\n\tdefault <R> EagerFutureStream<R> map(Function<? super U, ? extends R> mapper) {\n\t\treturn (EagerFutureStream<R>)FutureStream.super.map(mapper);\n\t}\n\t\n\t/**\n\t * @return a Stream that batches all completed elements from this stream\n\t * since last read attempt into a collection\n\t */\n\tdefault EagerFutureStream<Collection<U>> chunkSinceLastRead() {\n\t\treturn (EagerFutureStream<Collection<U>>) FutureStream.super\n\t\t\t\t.chunkSinceLastRead();\n\t}\n\n\t/**\n\t * Break a stream into multiple Streams based of some characteristic of the\n\t * elements of the Stream\n\t * \n\t * e.g.\n\t * <pre>\n\t * {@code \n\t * Queue<Integer> evenQueue = QueueFactories.unboundedQueue().build();\n\t * Queue<Integer> oddQueue = QueueFactories.unboundedQueue().build()\n\t * EagerFutureStream.of(10,20,25,30,41,43)\n\t * \t\t\t\t\t .shard(ImmutableMap.of(\"even\",evenQueue,\"odd\",oddQueue),element-> element==0? \"even\" : \"odd\");\n\t * \n\t * \n\t * Stream<Integer> evenStream = evenQueue.stream();\n\t * }\n\t * </pre>\n\t * \n\t * \n\t * results in 2 Streams \"even\": 10,20,30 \"odd\" : 25,41,43\n\t * \n\t * @param shards\n\t * Map of Queue's keyed by shard identifier\n\t * @param sharder\n\t * Function to split split incoming elements into shards\n\t * @return Map of new sharded Streams\n\t */\n\tdefault <K> Map<K, EagerFutureStream<U>> shard(Map<K, Queue<U>> shards,\n\t\t\tFunction<U, K> sharder) {\n\t\tMap map = FutureStream.super.shard(shards, sharder);\n\t\treturn (Map<K, EagerFutureStream<U>>) map;\n\t}\n\n\t/**\n\t * Cancel the CompletableFutures in this stage of the stream and the initial\n\t * phase\n\t */\n\tdefault void cancel() {\n\t\tcancelOriginal();\n\t\tFutureStream.super.cancel();\n\n\t}\n\n\t/**\n\t * Cancel the original tasks that populated the EagerFuturestream\n\t */\n\tvoid cancelOriginal();\n\n\t/**\n\t * Can be used to debounce (accept a single data point from a unit of time)\n\t * data. This drops data. For a method that slows emissions and keeps data\n\t * @see LazyFutureStream#onePer(long, TimeUnit)\n\t * \n\t * <pre>\n\t * {@code \n\t * \n\t * \t\t\tEagerFutureStream.of(1,2,3,4,5,6)\n\t * \t\t\t\t\t\t\t.debounce(1000,TimeUnit.SECONDS)\n\t * \t\t\t\t\t\t\t.toList();\n\t * //[1] - as all events will be passed through in < 1000 seconds, only 1 will be allowed\n\t * }\n\t * \n\t * \n\t * </pre>\n\t * \n\t * @param time\n\t * Time from which to accept only one element\n\t * @param unit\n\t * Time unit for specified time\n\t * @return Next stage of stream, with only 1 element per specified time\n\t * windows\n\t */\n\tdefault EagerFutureStream<U> debounce(long time, TimeUnit unit) {\n\t\tlong[] last = {0l};\n\t\treturn this.filter(next-> {synchronized(last){\n\t\t\t\t\tif(System.nanoTime()-last[0]>unit.toNanos(time)){ \n\t\t\t\t\t\tlast[0]= System.nanoTime(); \n\t\t\t\t\treturn true;\n\t\t\t\t\t} \n\t\t\t\t\treturn false;}\n\t\t});\n\t\t\n\t\t\n\t}\n\t\n\t/**\n\t * Return a Stream with the same values as this Stream, but with all values\n\t * omitted until the provided stream starts emitting values. Provided Stream\n\t * ends the stream of values from this stream.\n\t <pre>\n\t {@code \n\t * \t\t\tEagerFutureStream.react(()->loadNext(1),()->loadNext(2),()->3,()->4,()->loadNext(4))\n\t * \t\t\t\t\t\t\t .skipUntil(EagerFutureStream.react(()->loadFromDb()))\n\t * \t\t\t\t\t\t\t .toList();\n\t * }\n\t * </pre>\n\t * @param s\n\t * Stream that will start the emission of values from this stream\n\t * @return Next stage in the Stream but with all values skipped until the\n\t * provided Stream starts emitting\n\t */\n\tdefault <T> EagerFutureStream<U> skipUntil(FutureStream<T> s) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.skipUntil(s);\n\t}\n\n\t/**\n\t * Return a Stream with the same values, but will stop emitting values once\n\t * the provided Stream starts to emit values. e.g. if the provided Stream is\n\t * asynchronously refreshing state from some remote store, this stream can\n\t * proceed until the provided Stream succeeds in retrieving data.\n\t * \n\t * <pre>\n\t * {@code \n\t * \t\t\tEagerFutureStream.react(()->loadNext(1),()->loadNext(2),()->3,()->4,()->loadNext(4))\n\t * \t\t\t\t\t\t\t .takeUntil(EagerFutureStream.react(()->loadFromDb()))\n\t * \t\t\t\t\t\t\t .toList();\n\t * }\n\t * \n\t * </pre>\n\t * \n\t * @param s\n\t * Stream that will stop the emission of values from this stream\n\t * @return Next stage in the Stream but will only emit values until provided\n\t * Stream starts emitting values\n\t */\n\tdefault <T> EagerFutureStream<U> takeUntil(FutureStream<T> s) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.takeUntil(s);\n\t}\n\n\t/**\n\t * Allows clients to control the emission of data for the next phase of the\n\t * Stream. The user specified function can delay, drop, or change elements\n\t * \n\t * @param fn\n\t * Function takes a supplier, which can be used repeatedly to get\n\t * the next value from the Stream. If there are no more values, a\n\t * ClosedQueueException will be thrown. This function should\n\t * return a Supplier which returns the desired result for the\n\t * next element (or just the next element).\n\t * @return Next stage in Stream\n\t */\n\tdefault EagerFutureStream<U> control(Function<Supplier<U>, Supplier<U>> fn) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.control(fn);\n\t}\n\t/* \n\t * Batch the elements in the Stream by a combination of Size and Time\n\t * If batch exceeds max size it will be split\n\t * If batch exceeds max time it will be split\n\t * Excludes Null values (neccessary for timeout handling)\n\t * \n\t * <pre>\n\t * {@code\n\t * assertThat(react(()->1,()->2,()->3,()->4,()->5,()->{sleep(100);return 6;})\n\t\t\t\t\t\t.batchBySizeAndTime(30,60,TimeUnit.MILLISECONDS)\n\t\t\t\t\t\t.toList()\n\t\t\t\t\t\t.get(0)\n\t\t\t\t\t\t,not(hasItem(6)));\n\t\t}\n\t * </pre>\n\t * \n\t * <pre>\n\t * {@code\n\t * \t\n\t\tassertThat(of(1,2,3,4,5,6).batchBySizeAndTime(3,10,TimeUnit.SECONDS).toList().get(0).size(),is(3));\n\n\t * }</pre>\n\t * \n\t *\t@param size Max batch size\n\t *\t@param time Max time length\n\t *\t@param unit time unit\n\t *\t@return batched stream\n\t * @see com.aol.simple.react.stream.traits.FutureStream#batchBySizeAndTime(int, long, java.util.concurrent.TimeUnit)\n\t */\n\t@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tdefault EagerFutureStream<List<U>> batchBySizeAndTime(int batchSize,long time, TimeUnit unit) { \n\t\tint size = this.getLastActive().list().size();\n\t\tList[] list = {new ArrayList<U>()};\n\t\tint[] count = {0};\n\t\tSimpleTimer[] timer = {new SimpleTimer()};\n\t\treturn (EagerFutureStream)this.map(next-> { \n\t\t\t\tsynchronized(timer){\n\t\t\t\t\tcount[0]++;\n\t\t\t\t\tif(unit.toNanos(time)-timer[0].getElapsedNanoseconds()>0 && list[0].size()+1<batchSize){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\t\n\t\t\t\t\t} else{\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\t timer[0] = new SimpleTimer();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(count[0]==size){\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t\treturn new ArrayList();\n\t\t\t\t}\n\t\t\t}\t).filter(l->l.size()>0);\n\t}\n\t/**\n\t * Organise elements in a Stream into a Collections based on the time period they pass through this stage\n\t * This version uses locks - for a lock free implementation choose \n\t * @see LazyFutureStream#batchByTime(long, TimeUnit)\n\t * \n\t * Will always include the next value over the batch time in current batch (again @see LazyFutureStream#batchByTime(long, TimeUnit)\n\t * for a more powerful alternative that does not).\n\t * \n\t * @param time Time period during which all elements should be collected\n\t * @param unit Time unit during which all elements should be collected\n\t * @return Stream of Lists\n\t */\n\t@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tdefault EagerFutureStream<Collection<U>> batchByTime(long time, TimeUnit unit) {\n\t\n\t\tint size = this.getLastActive().list().size();\n\t\tList[] list = {new ArrayList<U>()};\n\t\tint[] count = {0};\n\t\tSimpleTimer[] timer = {new SimpleTimer()};\n\t\treturn (EagerFutureStream)this.map(next-> { \n\t\t\t\tsynchronized(timer){\n\t\t\t\t\tcount[0]++;\n\t\t\t\t\tif(unit.toNanos(time)-timer[0].getElapsedNanoseconds()>0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\t timer[0] = new SimpleTimer();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(count[0]==size){\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t\treturn new ArrayList();\n\t\t\t\t}\n\t\t\t}\t).filter(l->l.size()>0);\n\t\t\n\t}\n\t\n\t/**\n\t * Batch elements into a Stream of collections with user defined function\n\t * \n\t * @param fn\n\t * Function takes a supplier, which can be used repeatedly to get\n\t * the next value from the Stream. If there are no more values, a\n\t * ClosedQueueException will be thrown. This function should\n\t * return a Supplier which creates a collection of the batched\n\t * values\n\t * @return Stream of batched values\n\t */\n\tdefault <C extends Collection<U>> EagerFutureStream<C> batch(\n\t\t\tFunction<Supplier<U>, Supplier<C>> fn) {\n\t\treturn (EagerFutureStream<C>) FutureStream.super.batch(fn);\n\t}\n\n\t/**\n\t * \n\t * Batch the elements in this stream into Lists of specified size\n\t * <pre>\n\t * {@code\n\t * EagerFutureStream.of(1,2,3,4,5,6)\n\t * \t\t\t\t\t.batchBySize(3)\n\t * \t\t\t\t\t.toList();\n\t *\n\t * // [[1,2,3],[4,5,6]]\n\t * }\n\t *\n\t * </pre>\n\t * @param size\n\t * Size of lists elements should be batched into\n\t * @return Stream of Lists\n\t */\n\tdefault EagerFutureStream<List<U>> batchBySize(int size) {\n\t\treturn batchBySize(size,()->new ArrayList<>());\n\n\t}\n\t\n\n\t/**\n\t * Batch the elements in this stream into Collections of specified size The\n\t * type of Collection is determined by the specified supplier\n\t * \n\t * <pre>\n\t * {@code \n\t * \t\tEagerFutureStream.of(1,1,1,1,1,1)\n\t * \t\t\t\t\t\t.batchBySize(3,()->new TreeSet<>())\n\t * \t\t\t\t\t\t.toList()\n\t * \n\t * //[[1],[1]]\n\t * }\n\t * \n\t * </pre>\n\t * @param size\n\t * Size of batch\n\t * @param supplier\n\t * Create the batch holding collection\n\t * @return Stream of Collections\n\t */\n\tdefault <C extends Collection<U>> EagerFutureStream<C> batchBySize(int size,\n\t\t\tSupplier<C> supplier) {\n\t\tQueue<U> queue = toQueue();\n\t\tFunction<Supplier<U>, Supplier<Optional<C>>> fn = new BatchBySize<U,C>(size,this.getSubscription(),queue, supplier)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.liftOptional();\n\t\t \n\t\tEagerFutureStream<C> stream = this.async() \n\t\t\t\t\t\t\t\t\t\t\t.map(u-> {synchronized(queue){return fn.apply(()-> queue.poll(1,TimeUnit.MICROSECONDS)).get();}})\n\t\t\t\t\t\t\t\t\t\t\t.filter(Optional::isPresent)\n\t\t\t\t\t\t\t\t\t\t\t.map(Optional::get);\n\t\t if(this.isAsync())\n\t\t\t\treturn stream.async();\n\t\t\treturn stream;\n\n\t}\n\n\t/**\n\t * Introduce a random delay between events in a stream Can be used to\n\t * prevent behaviour synchronizing within a system\n\t * EagerFutureStreams will batch results before jittering\n\t * \n\t * For a better implementation see @see LazyFutureStream#jitter(long)\n\t * \n\t * <pre>\n\t * {@code\n\t * \n\t * EagerFutureStream.parallelCommonBuilder()\n\t\t\t\t\t\t.of(IntStream.range(0, 100))\n\t\t\t\t\t\t.map(it -> it*100)\n\t\t\t\t\t\t.jitter(10l)\n\t\t\t\t\t\t.peek(System.out::println)\n\t\t\t\t\t\t.block();\n\t * \n\t * }\n\t\n\t * </pre>\n\t * @param jitterInNanos\n\t * Max number of nanos for jitter (random number less than this\n\t * will be selected)/\n\t * @return Next stage in Stream with jitter applied\n\t */\n\tdefault EagerFutureStream<U> jitter(long jitterInNanos) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.jitter(jitterInNanos);\n\t}\n\n\t/**\n\t * Apply a fixed delay before emitting elements to the next phase of the\n\t * Stream. Note this doesn't neccessarily imply a fixed delay between\n\t * element creation (although it may do). e.g.\n\t * \n\t * <pre>\n\t * {@code\n\t \tEagerFutureStream.of(1,2,3,4)\n\t \t\t\t\t\t.fixedDelay(1,TimeUnit.hours);\n\t \t}\n\t * </pre>\n\t * Will emit 1 on start, then 2 after an hour, 3 after 2 hours and so on.\n\t * \n\t * However all 4 numbers will be populated in the Stream immediately.\n\t \n\t <pre>\n\t {@code \n\t \tLazyFutureStream.of(1,2,3,4)\n\t \t\t\t\t\t.withQueueFactories(QueueFactories.boundedQueue(1))\n\t \t\t\t\t\t.fixedDelay(1,TimeUnit.hours);\n\t \t}\n\t \t</pre>\n\t \n\t * Will populate each number in the Stream an hour apart.\n\t * \n\t * @param time\n\t * amount of time between emissions\n\t * @param unit\n\t * TimeUnit for emissions\n\t * @return Next Stage of the Stream\n\t */\n\tdefault EagerFutureStream<U> fixedDelay(long time, TimeUnit unit) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.fixedDelay(time, unit);\n\t}\n\n\t/**\n\t * Slow emissions down, emiting one element per specified time period\n\t * \n\t * <pre>\n\t * {@code \n\t * \t\tEagerFutureStream.of(1,2,3,4,5,6)\n\t * \t\t\t\t\t\t .onePer(1000,TimeUnit.NANOSECONDS)\n\t * \t\t\t\t\t\t .toList();\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * @param time\n\t * Frequency period of element emission\n\t * @param unit\n\t * Time unit for frequency period\n\t * @return Stream with emissions slowed down by specified emission frequency\n\t */\n\tdefault EagerFutureStream<U> onePer(long time, TimeUnit unit) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.onePer(time, unit);\n\n\t}\n\n\t/**\n\t * Allows x (specified number of) emissions with a time period before\n\t * stopping emmissions until specified time has elapsed since last emission\n\t * \n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1,2,3,4,5,6)\n\t * \t\t\t\t .xPer(6,100000000,TimeUnit.NANOSECONDS)\n\t * \t\t\t\t .toList();\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * \n\t * @param x\n\t * Number of allowable emissions per time period\n\t * @param time\n\t * Frequency time period\n\t * @param unit\n\t * Frequency time unit\n\t * @return Stream with emissions slowed down by specified emission frequency\n\t */\n\tdefault FutureStream<U> xPer(int x, long time, TimeUnit unit) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.xPer(x, time, unit);\n\t}\n\n\t\n\n\t/**\n\t * Similar to zip and withLatest, except will always take the latest from\n\t * either Stream (merged with last available from the other). By contrast\n\t * zip takes new / latest values from both Streams and withLatest will\n\t * always take the latest from this Stream while taking the last available\n\t * value from the provided stream.\n\t * \n\t * <pre>\n\t * {@code\n\t * EagerFutureStream.of(1,2,3,4,5,6)\n\t * \t\t\t\t .combineLatest(react(()->3,()->value()))\n\t * \t\t\t\t .toList();\n\t * }\n\t * </pre>\n\t * @param s\n\t * Stream to merge with\n\t * @return Stream of Tuples with the latest values from either stream\n\t */\n\tdefault <T> EagerFutureStream<Tuple2<U, T>> combineLatest(FutureStream<T> s) {\n\t\treturn (EagerFutureStream<Tuple2<U, T>>) FutureStream.super\n\t\t\t\t.combineLatest(s);\n\t}\n\n\t/**\n\t * \n\t * Similar to zip and combineLatest, except will always take the latest from\n\t * this Stream while taking the last available value from the provided\n\t * stream. By contrast zip takes new / latest values from both Streams and\n\t * combineLatest takes the latest from either Stream (merged with last\n\t * available from the other).\n\t * \n\t * <pre>\n\t * {@code\n\t * EagerFutureStream.of(1,2,3,4,5,6)\n\t * \t\t\t\t\t.withLatest(of(30,40,50,60,70,80,90,100,110,120,140))\n\t\t\t\t\t\t.toList();\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * \n\t * @param s\n\t * Stream to merge with\n\t * @return Stream of Tuples with the latest values from this stream\n\t */\n\tdefault <T> EagerFutureStream<Tuple2<U, T>> withLatest(FutureStream<T> s) {\n\t\treturn (EagerFutureStream<Tuple2<U, T>>) FutureStream.super\n\t\t\t\t.withLatest(s);\n\t}\n\n\t/**\n\t * Return first Stream out of provided Streams that starts emitted results \n\t * \n\t * <pre>\n\t * {@code \n\t * \t EagerFutureStream.firstOf(stream1, stream2, stream3)\n\t\t\t\t\t\t.peek(System.out::println)\n\t\t\t\t\t\t.map(this::saveData)\n\t\t\t\t\t\t.block();\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * \n\t * @param futureStreams Streams to race\n\t * @return First Stream to start emitting values\n\t */\n\tstatic <U> EagerFutureStream<U> firstOf(\n\t\t\tEagerFutureStream<U>... futureStreams) {\n\t\treturn (EagerFutureStream<U>) FutureStream.firstOf(futureStreams);\n\t}\n\n\t/*\n\t * React to new events with the supplied function on the supplied\n\t * Executor\n\t * \n\t * @param fn Apply to incoming events\n\t * \n\t * @param service Service to execute function on\n\t * \n\t * @return next stage in the Stream\n\t */\n\tdefault <R> EagerFutureStream<R> then(final Function<U, R> fn,\n\t\t\tExecutor service) {\n\t\treturn (EagerFutureStream<R>) FutureStream.super.then(fn, service);\n\t}\n\n\t/**\n\t * Can only be used on Eager Streams\n\t * \n\t * Applies a function to this phase independent on the main flow.\n\t * Convenience over taking a reference to this phase and splitting it.\n\t * \n\t * \n\t * @param fn\n\t * Function to be applied to each completablefuture on completion\n\t * @return This phase in Stream\n\t */\n\tdefault EagerFutureStream<U> doOnEach(final Function<U, U> fn) {\n\t\treturn (EagerFutureStream) FutureStream.super.doOnEach(fn);\n\t}\n\n\t/*\n\t * Non-blocking asyncrhonous application of the supplied function.\n\t * Equivalent to map from Streams / Seq apis.\n\t * \n\t * @param fn Function to be applied asynchronously\n\t * \n\t * @return Next stage in stream\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#then(java.util.function\n\t * .Function)\n\t */\n\tdefault <R> EagerFutureStream<R> then(final Function<U, R> fn) {\n\t\treturn (EagerFutureStream) FutureStream.super.then(fn);\n\t}\n\tdefault List<EagerFutureStream<U>> copy(final int times){\n\t\treturn (List)FutureStream.super.copySimpleReactStream(times);\n\t\t\n\t}\n\t/*\n\t * Merge two simple-react Streams, by merging the Stream of underlying\n\t * futures - not suitable for merging infinite Streams - use \n\t * see LazyFutureStream#switchOnNext for infinite Streams\n\t * \n\t * <pre>\n\t * {@code \n\t * List<String> result = \tEagerFutureStream.of(1,2,3)\n\t * \t\t\t\t\t\t\t\t\t\t\t .merge(LazyFutureStream.of(100,200,300))\n\t\t\t\t\t\t\t\t\t\t\t\t .map(it ->it+\"!!\")\n\t\t\t\t\t\t\t\t\t\t\t\t .toList();\n\n\t\tassertThat(result,equalTo(Arrays.asList(\"1!!\",\"2!!\",\"3!!\",\"100!!\",\"200!!\",\"300!!\")));\n\t * \n\t * }\n\t * </pre>\n\t * \n\t * @param s Stream to merge\n\t * \n\t * @return Next stage in stream\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#merge(com.aol.simple.\n\t * react.stream.traits.SimpleReactStream)\n\t */\n\t@Override\n\tdefault FutureStream<U> merge(SimpleReactStream<U>... streams) {\n\t\treturn (FutureStream)FutureStream.super.merge(streams);\t\t\n\t}\n\t/**\n\t * Merges this stream and the supplied Streams into a single Stream where the next value\n\t * is the next returned across any of the involved Streams\n\t * \n\t * <pre>\n\t * {@code\n\t * \tLazyFutureStream<Integer> fast = ... // [1,2,3,4,5,6,7..]\n\t * \tEagerFutureStream<Integer> slow = ... // [100,200,300,400,500,600..]\n\t * \n\t * LazyFutureStream<Integer> merged = fast.switchOnNext(slow); //[1,2,3,4,5,6,7,8,100,9,10,11,12,13,14,15,16,200..] \n\t * }</pre>\n\t * \n\t * \n\t * @param streams\n\t * @return\n\t */\n\tdefault <R> EagerFutureStream<R> switchOnNext(FutureStream<?>... streams){\n\t\treturn (EagerFutureStream)merge((SimpleReactStream[])streams);\n\t}\n\t/*\n\t * Define failure handling for this stage in a stream. Recovery function\n\t * will be called after an excption Will be passed a\n\t * SimpleReactFailedStageException which contains both the cause, and the\n\t * input value.\n\t * \n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1, \"a\", 2, \"b\", 3)\n\t \t\t\t.cast(Integer.class)\n\t \t\t\t.onFail(e -> -1)\n\t \t\t\t.toList();\n\t * \n\t * }\n\t * </pre>\n\t * \n\t * \n\t * @param fn Recovery function\n\t * \n\t * @return Next stage in stream\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#onFail(java.util.function\n\t * .Function)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> onFail(\n\t\t\tfinal Function<? extends SimpleReactFailedStageException, U> fn) {\n\t\treturn (EagerFutureStream) FutureStream.super.onFail(fn);\n\t}\n\n\t/*\n\t * Handle failure for a particular class of exceptions only\n\t * \n\t * \n\t * <pre>\n\t * {@code \n\t * new EagerReact().react(()->1,()->2)\n\t\t\t.then(this::throwException)\n\t\t\t.onFail(IOException.class, this::recoverIO)\n\t\t\t.onFail(RuntimeException.class, this::recoverGeneral)\n\t\t\t.toList();\n\t * }\n\t * </pre>\n\t * @param exceptionClass Class of exceptions to handle\n\t * \n\t * @param fn recovery function\n\t * \n\t * @return recovered value\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#onFail(java.lang.Class,\n\t * java.util.function.Function)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> onFail(\n\t\t\tClass<? extends Throwable> exceptionClass,\n\t\t\tfinal Function<? extends SimpleReactFailedStageException, U> fn) {\n\t\treturn (EagerFutureStream) FutureStream.super\n\t\t\t\t.onFail(exceptionClass, fn);\n\t}\n\n\t/*\n\t * Capture non-recoverable exception\n\t * \n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1, \"a\", 2, \"b\", 3, null)\n\t * \t\t\t\t .capture(e -> logger.error(e))\n\t\t\t\t\t\t .cast(Serializable.class)\n\t\t\t\t\t\t .toList()\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * @param errorHandler Consumer that captures the exception\n\t * \n\t * @return Next stage in stream\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#capture(java.util.function\n\t * .Consumer)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> capture(\n\t\t\tfinal Consumer<? extends Throwable> errorHandler) {\n\t\treturn (EagerFutureStream) FutureStream.super.capture(errorHandler);\n\t}\n\n\t/*\n\t * \n\t * <pre>\n\t * {@code\n\t * EagerFutureStream.sequentialCommonBuilder().react(()->1,()->2,()->3)\n\t\t \t\t\t\t\t\t\t\t\t .map(it->it+100)\n\t\t \t\t\t\t\t\t\t\t\t .allOf(c-> HashTreePMap.singleton(\"numbers\",c))\n\t\t \t\t\t\t\t\t\t\t\t .block();\n\t * \n\t * }\n\t * </pre>\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#allOf(java.util.function\n\t * .Function)\n\t */\n\t@Override\n\tdefault <T, R> EagerFutureStream<R> allOf(final Function<List<T>, R> fn) {\n\t\treturn (EagerFutureStream) FutureStream.super.allOf(fn);\n\t}\n\n\t/*\n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#peek(java.util.function\n\t * .Consumer)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> peek(final Consumer<? super U> consumer) {\n\t\treturn (EagerFutureStream) FutureStream.super.peek(consumer);\n\t}\n\n\t/*\n\t * <pre>\n\t * {@code \n\t * List<String> result = new EagerReact()\n\t\t\t\t\t\t\t\t.<Integer> react(() -> 1, () -> 2, () -> 3)\n\t\t\t\t\t\t\t\t.then(it -> \"*\" + it)\n\t\t\t\t\t\t\t\t.filter(it -> it.startsWith(\"*\"))\n\t\t\t\t\t\t\t\t.block();\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#filter(java.util.function\n\t * .Predicate)\n\t */\n\tdefault EagerFutureStream<U> filter(final Predicate<? super U> p) {\n\t\treturn (EagerFutureStream) FutureStream.super.filter(p);\n\t}\n\n\t/*\n\t * <pre>\n\t * {@code\n\t * \n\t * List<String> titles = new EagerReact().fromStream(Stream.of(query(\"Hello, world!\")))\n\t\t\t\t\n\t\t\t\t\t\t\t\t.flatMap(Collection::stream)\n\t\t\t\t\t\t\t\t.peek(System.out::println)\n\t\t\t\t\t\t\t\t.<String>then(url -> getTitle(url))\n\t\t\t\t\t\t\t\t.filter(Objects::nonNull)\n\t\t\t\t\t\t\t\t.filter(Predicates.take(5))\n\t\t\t\t\t\t\t\t.peek(title -> saveTitle(title) )\n\t\t\t\t\t\t\t\t.peek(System.out::println)\n\t\t\t\t\t\t\t\t.block();\n\t * }\n\t * </pre>\n\t * \n\t * (non-Javadoc)\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.FutureStreamImpl#flatMap(java.util.function\n\t * .Function)\n\t */\n\t@Override\n\tdefault <R> EagerFutureStream<R> flatMap(\n\t\t\tFunction<? super U, ? extends Stream<? extends R>> flatFn) {\n\n\t\treturn (EagerFutureStream) FutureStream.super.flatMap(flatFn);\n\t}\n\t/**\n\t * Perform a flatMap operation where the CompletableFuture type returned is flattened from the resulting Stream\n\t * If in async mode this operation is performed asyncrhonously\n\t * If in sync mode this operation is performed synchronously\n\t * \n\t * <pre>\n\t * {@code \n\t * assertThat( new EagerReact()\n\t\t\t\t\t\t\t\t\t\t.of(1,2,3)\n\t\t\t\t\t\t\t\t\t\t.flatMapCompletableFuture(i->CompletableFuture.completedFuture(i))\n\t\t\t\t\t\t\t\t\t\t.block(),equalTo(Arrays.asList(1,2,3)));\n\t * }\n\t * </pre>\n\t * In this example the result of the flatMapCompletableFuture is 'flattened' to the raw integer values\n\t * \n\t * \n\t * @param flatFn flatMap function\n\t * @return Flatten Stream with flatFn applied\n\t */\n\tdefault <R> EagerFutureStream<R> flatMapCompletableFuture(\n\t\t\tFunction<U, CompletableFuture<R>> flatFn) {\n\t\treturn (EagerFutureStream) FutureStream.super.flatMapCompletableFuture(flatFn);\n\t}\n\t/**\n\t * Perform a flatMap operation where the CompletableFuture type returned is flattened from the resulting Stream\n\t * This operation is performed synchronously\n\t * \n\t * <pre>\n\t * {@code \n\t * assertThat( new EagerReact()\n\t\t\t\t\t\t\t\t\t\t.of(1,2,3)\n\t\t\t\t\t\t\t\t\t\t.flatMapCompletableFutureSync(i->CompletableFuture.completedFuture(i))\n\t\t\t\t\t\t\t\t\t\t.block(),equalTo(Arrays.asList(1,2,3)));\n\t * }\n\t * </pre>\n\t * In this example the result of the flatMapCompletableFuture is 'flattened' to the raw integer values\n\t * \n\t * \n\t * @param flatFn flatMap function\n\t * @return Flatten Stream with flatFn applied\n\t */\n\tdefault <R> EagerFutureStream<R> flatMapCompletableFutureSync(\n\t\t\tFunction<U, CompletableFuture<R>> flatFn) {\n\t\t\n\t\treturn (EagerFutureStream) FutureStream.super.flatMapCompletableFutureSync(flatFn);\n\t}\n\n\n\t/*\n\t * <pre>\n\t * {@code\n\t * \t\tList<String> results = LazyFutureStream.sequentialCommonBuilder()\n\t\t\t\t\t\t\t\t\t\t\t\t .withRetrier(retrier)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.react(() -> \"new event1\", () -> \"new event2\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.retry(this::unreliable)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.onFail(e -> \"default\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t.peek(System.out::println)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.capture(Throwable::printStackTrace)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.block();\n\t * \n\t * }\n\t * </pre>\n\t * \n\t * (non-Javadoc)\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.FutureStreamImpl#retry(java.util.function\n\t * .Function)\n\t */\n\t@Override\n\tdefault <R> EagerFutureStream<R> retry(Function<U, R> fn) {\n\n\t\treturn (EagerFutureStream) FutureStream.super.retry(fn);\n\t}\n\n\t/*\n\t * <pre>\n\t * {@code \n\t * Set<Integer> result = new EagerReact()\n\t\t\t\t\t\t\t\t.<Integer> react(() -> 1, () -> 2, () -> 3, () -> 5)\n\t\t\t\t\t\t\t\t.then( it -> it*100)\n\t\t\t\t\t\t\t\t.allOf(Collectors.toSet(), it -> it.size())\n\t\t\t\t\t\t\t\t.first();\n\t\t\t\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * \n\t * (non-Javadoc)\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.FutureStreamImpl#allOf(java.util.stream.Collector\n\t * , java.util.function.Function)\n\t */\n\t@Override\n\tdefault <T, R> EagerFutureStream<R> allOf(Collector collector,\n\t\t\tFunction<T, R> fn) {\n\n\t\treturn (EagerFutureStream) FutureStream.super.allOf(collector, fn);\n\t}\n\n\t/* \n\t * <pre>\n\t * {@code \n\t * \t\t\t\tnew EagerReact().react(() -> 1)\n\t * \t\t\t\t\t\t\t\t.then(this::load)\n\t\t\t\t\t\t\t\t\t.anyOf(this::process)\n\t\t\t\t\t\t\t\t\t.first();\n\t * \n\t * }\n\t * \n\t * </pre>\n\t * \n\t *\t\n\t * @see com.aol.simple.react.stream.traits.FutureStream#anyOf(java.util.function.Function)\n\t */\n\tdefault <R> EagerFutureStream<R> anyOf(Function<U, R> fn) {\n\n\t\treturn (EagerFutureStream) FutureStream.super.anyOf(fn);\n\t}\n\n\tEagerFutureStream<U> withLastActive(StreamWrapper streamWrapper);\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.FutureStreamImpl#fromStream(java.util.stream\n\t * .Stream)\n\t */\n\t@Override\n\tdefault <R> EagerFutureStream<R> fromStream(Stream<R> stream) {\n\t\treturn (EagerFutureStream) FutureStream.super.fromStream(stream);\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.FutureStreamImpl#fromStreamCompletableFuture\n\t * (java.util.stream.Stream)\n\t */\n\t@Override\n\tdefault <R> EagerFutureStream<R> fromStreamOfFutures(\n\t\t\tStream<CompletableFuture<R>> stream) {\n\n\t\treturn (EagerFutureStream) FutureStream.super\n\t\t\t\t.fromStreamOfFutures(stream);\n\t}\n\n\t/*\n\t * Take the first (maxSize) completed results from this stage of the Stream\n\t * as input to the next stage. e.g.\n\t * \n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(()>loadSlow(),()>loadMedium(),()>loadFast())\n\t * \t\t\t\t.limit(2)\n\t * }\n\t * //[loadFast, loadMedium]\n\t * </pre>\n\t * will take the results from loadMedium and loadFast()\n\t * \n\t * \n\t * @param maxSize The size of the subsequent Stream\n\t * \n\t * @return EagerFutureStream\n\t * \n\t * @see org.jooq.lambda.Seq#limit(long)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> limit(long maxSize) {\n\t\treturn fromStream(toQueue().stream().limit(maxSize));\n\t}\n\n\t/**\n\t * Perform a limit operation on the underlying Stream of Futures\n\t * In contrast to EagerFutureStream#limit this removes entries basaed on their\n\t * start position\n\t * \n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(()>loadSlow(),()>loadMedium(),()>loadFast())\n\t * \t\t\t\t.limitFutures(2)\n\t * }\n\t * \n\t * //[loadSlow, loadMedium]\n\t * </pre>\n\t * \n\t * \n\t * \n\t * @param maxSize The size of the subsequent Stream\n\t * @return limited Stream\n\t */\n\tdefault EagerFutureStream<U> limitFutures(long maxSize) {\n\n\t\tStreamWrapper lastActive = getLastActive();\n\t\tStreamWrapper limited = lastActive.withList(lastActive.stream()\n\t\t\t\t.limit(maxSize).collect(Collectors.toList()));\n\t\treturn this.withLastActive(limited);\n\n\t}\n\t/*\n\t * Skip the first (n) completed results from this stage of the Stream\n\t * \n\t * e.g.\n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(()>loadSlow(),()>loadMedium(),()>loadFast())\n\t * \t\t\t\t.skip(2)\n\t * }\n\t * \n\t * //[loadSlow]\n\t * </pre>\n\t * \n\t * will take the results from loadSlow()\n\t * \n\t * @param n number of Elements to skip\n\t * \n\t * @return EagerFutureStream\n\t * \n\t * @see org.jooq.lambda.Seq#skip(long)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> skip(long n) {\n\t\treturn fromStream(toQueue().stream().skip(n));\n\t}\n\n\t/**\n\t * In contast to EagerFutureStream#skip skipFutures will skip the first n entries\n\t * of the underlying Stream of Futures.\n * <pre>\n\t * {@code \n\t * EagerFutureStream.of(()>loadSlow(),()>loadMedium(),()>loadFast())\n\t * \t\t\t\t.skip(2)\n\t * }\n\t * \n\t * //[loadFast]\n\t * </pre>\t \n\n\n\t * \n\t * @param n\n\t * @return\n\t */\n\tdefault EagerFutureStream<U> skipFutures(long n) {\n\t\tStreamWrapper lastActive = getLastActive();\n\t\tStreamWrapper limited = lastActive.withList(lastActive.stream().skip(n)\n\t\t\t\t.collect(Collectors.toList()));\n\t\treturn this.withLastActive(limited);\n\t}\n\n\t/*\n\t * Cast all elements in this stream to specified type. May throw {@link\n\t * ClassCastException}.\n\t * \n\t * <pre>\n\t * EagerFutureStream.of(1, \"a\", 2, \"b\", 3).cast(Integer.class)\n\t * </pre>\n\t * will throw a ClassCastException\n\t * \n\t * @param type Type to cast to\n\t * \n\t * @return LazyFutureStream\n\t * \n\t * @see\n\t * com.aol.simple.react.stream.traits.FutureStream#cast(java.lang.Class)\n\t */\n\t@Override\n\tdefault <U> EagerFutureStream<U> cast(Class<U> type) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.cast(type);\n\t}\n\n\t/**\n\t * Keep only those elements in a stream that are of a given type.\n\t * \n\t * \n\t * <pre>\n\t * EagerFutureStream.of(1, \"a\", 2, \"b\", 3).ofType(Integer.class)\n\t * \n\t * gives a Stream of (1,2,3)\n\t * \n\t * EagerFutureStream.of(1, \"a\", 2, \"b\", 3).ofType(String.class)\n\t * \n\t * gives a Stream of (\"a\",\"b\")\n\t * </pre>\n\t * @see com.aol.simple.react.stream.traits.FutureStream#ofType(java.lang.Class)\n\t */\n\t@Override\n\tdefault <U> EagerFutureStream<U> ofType(Class<U> type) {\n\t\treturn (EagerFutureStream<U>) FutureStream.super.ofType(type);\n\t}\n\n\t\n\n\t/**\n\t * Concatenate two streams.\n\t * \n\t * <pre>\n\t * {@code \n\t * // (1, 2, 3, 4, 5, 6) \n\t * EagerFutureStream.of(1, 2,3).concat(Stream.of(4, 5, 6))\n\t * \n\t * \n\t * }\n\t * </pre>\n\t *\n\t * @see #concat(Stream[])\n\t */\n\t@SuppressWarnings({ \"unchecked\" })\n\t@Override\n\tdefault EagerFutureStream<U> concat(Stream<U> other) {\n\t\tif (other instanceof SimpleReactStream)\n\t\t\treturn (EagerFutureStream) merge((SimpleReactStream) other);\n\t\treturn fromStream(FutureStream.super.concat(other));\n\t}\n\n\n\t/**\n\t * Concatenate two streams.\n\t * \n\t * <pre> {@code \n\t * // (1, 2, 3, 4) EagerFutureStream.of(1, 2, 3).concat(4)\n\t * }\n\t *</pre>\n\t * @see #concat(Stream[])\n\t */\n\tdefault EagerFutureStream<U> concat(U other) {\n\t\treturn fromStream(FutureStream.super.concat(other));\n\t}\n\n\t/**\n\t * Concatenate two streams.\n\t * \n\t * <pre>\n\t * {@code \n\t * // (1, 2, 3, 4, 5, 6) EagerFutureStream.of(1, 2, 3).concat(4, 5, 6)\n\t * }\n\t *</pre>\n\t * @see #concat(Stream[])\n\t */\n\t@SuppressWarnings({ \"unchecked\" })\n\tdefault EagerFutureStream<U> concat(U... other) {\n\t\treturn (EagerFutureStream<U>) concat( EagerFutureStream\n\t\t\t\t.of(other));\n\t}\n\n\t\n\t \n\t/**\n\t * Returns a limited interval from a given Stream.\n\t * \n\t * <pre>\n\t * {@code \n\t * // (4, 5) EagerFutureStream.of(1, 2, 3, 4, 5, 6).sliceFutures(3, 5)\n\t * }\n\t *</pre>\n\t * @see #slice(long, long)\n\t */\n\n\tdefault EagerFutureStream<U> sliceFutures(long from, long to) {\n\t\tList noType = Seq.seq(getLastActive().stream()).slice(from, to)\n\t\t\t\t.collect(Collectors.toList());\n\t\treturn fromListCompletableFuture(noType);\n\t}\n\n\t/**\n\t * Returns a limited interval from a given Stream.\n\t * \n\t * <pre>\n\t * {@code \n\t * // (4, 5) EagerFutureStream.of(1, 2, 3, 4, 5, 6).slice(3, 5)\n\t * \n\t * }</pre>\n\t *\n\t * @see #slice(Stream, long, long)\n\t */\n\n\t@Override\n\tdefault EagerFutureStream<U> slice(long from, long to) {\n\n\t\treturn fromStream(FutureStream.super.slice(from, to));\n\t}\n\n\t/**\n\t * Zip two streams into one.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (tuple(1, \"a\"), tuple(2, \"b\"), tuple(3, \"c\")) EagerFutureStream.of(1,\n\t * 2, 3).zip(EagerFutureStream.of(\"a\", \"b\", \"c\"))\n\t * \n\t *}</pre>\n\t * @see #zip(Stream, Stream)\n\t */\n\t@Override\n\tdefault <R> EagerFutureStream<Tuple2<U, R>> zip(Seq<R> other) {\n\t\treturn fromStream(FutureStream.super.zip(other));\n\t}\n\n\t/**\n\t * Zip two streams into one using a {@link BiFunction} to produce resulting\n\t * values.\n\t * <pre>\n\t * <code>\n\t * (\"1:a\", \"2:b\", \"3:c\") \n\t * \n\t * EagerFutureStream.of(1, 2,3).zip(EagerFutureStream.of(\"a\", \"b\", \"c\"), (i, s) &gt; i + \":\" + s)\n\t * </code>\n\t * </pre>\n\t *\n\t * @see #zip(Seq, BiFunction)\n\t */\n\tdefault <T, R> EagerFutureStream<R> zip(Seq<T> other,\n\t\t\tBiFunction<U, T, R> zipper) {\n\t\t// non-blocking via Queue\n\t\treturn fromStream(FutureStream.super.zip(other, zipper));\n\t}\n\n\t/**\n\t * Zip two Streams, zipping against the underlying futures of this stream\n\t * \n\t * @param other\n\t * @return\n\t */\n\tdefault <R> EagerFutureStream<Tuple2<U,R>> zipFutures(Stream<R> other) {\n\t\treturn (EagerFutureStream<Tuple2<U,R>>)FutureStream.super.zipFutures(other);\n\n\t}\n\t/**\n\t * Zip two Streams, zipping against the underlying futures of both Streams\n\t * Placeholders (Futures) will be populated immediately in the new zipped Stream and results\n\t * will be populated asyncrhonously\n\t * \n\t * @param other Another FutureStream to zip Futures with\n\t * @return New Sequence of CompletableFutures\n\t */\n\tdefault <R> EagerFutureStream<Tuple2<U,R>> zipFutures(FutureStream<R> other) {\n\t\treturn (EagerFutureStream<Tuple2<U,R>>)FutureStream.super.zipFutures(other);\n\n\t}\n\n\t/**\n\t * Zip this Stream with an index, but Zip based on the underlying tasks, not completed results.\n\t * \n\t * e.g.\n\t * two functions that return method name, but take varying lengths of time.\n\t * <pre>\n\t * <code>\n\t * EagerFutureStream.react(()-&gt;takesALotOfTime(),()-&gt;veryQuick()).zipWithIndex();\n\t * \n\t * [[\"takesALotOfTime\",0],[\"veryQuick\",1]]\n\t * \n\t * Where as with standard zipWithIndex you would get a new Stream ordered by completion\n\t * \n\t * [[\"veryQuick\",0],[\"takesALotOfTime\",1]]\n\t * </code>\n\t * </pre>\n\t * @see #zipWithIndex(Stream)\n\t */\n\tdefault EagerFutureStream<Tuple2<U,Long>> zipFuturesWithIndex() {\n\n\t\tSeq seq = Seq.seq(getLastActive().stream().iterator()).zipWithIndex();\n\t\tSeq<Tuple2<CompletableFuture<U>,Long>> withType = (Seq<Tuple2<CompletableFuture<U>,Long>>)seq;\n\t\tStream futureStream = fromStreamOfFutures((Stream)withType.map(t -> t.v1.thenApply(v -> \n\t\t\t\t\t\t\tTuple.tuple(t.v1.join(),t.v2))));\n\t\treturn (EagerFutureStream<Tuple2<U,Long>>)futureStream;\n\t\t\n\t}\n\n\t/**\n\t * Zip a Stream with a corresponding Stream of indexes.\n\t * \n\t * <pre>\n\t * {@code \n\t * // (tuple(\"a\", 0), tuple(\"b\", 1), tuple(\"c\", 2))\n\t * EagerFutureStream.of(\"a\", \"b\", \"c\").zipWithIndex()\n\t * \n\t *}</pre>\n\t * @see #zipWithIndex(Stream)\n\t */\n\tdefault EagerFutureStream<Tuple2<U, Long>> zipWithIndex() {\n\t\treturn fromStream(FutureStream.super.zipWithIndex());\n\t}\n\n\t/**\n\t * Scan a stream to the left.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (\"\", \"a\", \"ab\", \"abc\") EagerFutureStream.of(\"a\", \"b\",\n\t * \"c\").scanLeft(\"\", (u, t) &gt; u + t)\n\t * }</pre>\n\t * \n\t */\n\t@Override\n\tdefault <T> EagerFutureStream<T> scanLeft(T seed,\n\t\t\tBiFunction<T, ? super U, T> function) {\n\t\treturn fromStream(FutureStream.super.scanLeft(seed, function));\n\t}\n\n\t/**\n\t * Scan a stream to the right.\n\t * \n\t * <pre>\n\t * {@code \n\t * // (\"\", \"c\", \"cb\", \"cba\") EagerFutureStream.of(\"a\", \"b\",\n\t * \"c\").scanRight(\"\", (t, u) &gt; u + t)\n\t * }</pre>\n\t */\n\t@Override\n\tdefault <R> EagerFutureStream<R> scanRight(R seed,\n\t\t\tBiFunction<? super U, R, R> function) {\n\t\t Seq<R> stream = FutureStream.super.scanRight(seed, function);\n\t\t if(stream instanceof FutureStream)\n\t\t\t return (EagerFutureStream<R>)stream;\n\t\treturn fromStream(stream);\n\t}\n\n\t/**\n\t * Reverse a stream.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (3, 2, 1) EagerFutureStream.of(1, 2, 3).reverse()\n\t * }</pre>\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> reverse() {\n\t\treturn fromStream(FutureStream.super.reverse());\n\t}\n\t/**\n\t * Reversed, operating on the underlying futures.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (3, 2, 1) EagerFutureStream.of(1, 2, 3).reverse()\n\t * }</pre>\n\t * \n\t * @return\n\t */\n\tdefault EagerFutureStream<U> reverseFutures() {\n\t\tStreamWrapper lastActive = getLastActive();\n\t\tListIterator<CompletableFuture> it = lastActive.list().listIterator();\n\t\tList<CompletableFuture> result = new ArrayList<>();\n\t\twhile(it.hasPrevious())\n\t\t\tresult.add(it.previous());\n\t\t\n\t\tStreamWrapper limited = lastActive.withList( result);\n\t\treturn this.withLastActive(limited);\n\t\t\n\t}\n\n\t\n\t\n\t/**\n\t * Shuffle a stream\n\t * <pre>\n\t * {@code \n\t * \n\t * // e.g. (2, 3, 1) EagerFutureStream.of(1, 2, 3).shuffle()\n\t * \n\t * }</pre>\n\t * \n\t */\n\t@Override\n\tdefault EagerFutureStream<U> shuffle() {\n\t\treturn fromStream(FutureStream.super.shuffle());\n\t}\n\n\t/**\n\t * Shuffle a stream using specified source of randomness\n\t * <pre>\n\t * {@code \n\t * \n\t * // e.g. (2, 3, 1) EagerFutureStream.of(1, 2, 3).shuffle(new Random())\n\t * \n\t * }</pre>\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> shuffle(Random random) {\n\t\treturn fromStream(FutureStream.super.shuffle(random));\n\t}\n\n\t/**\n\t * Returns a stream with all elements skipped for which a predicate\n\t * evaluates to true.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (3, 4, 5) EagerFutureStream.of(1, 2, 3, 4, 5).skipWhile(i &gt; i &lt;\n\t * 3)\n\t * \n\t *}</pre>\n\t * @see #skipWhile(Stream, Predicate)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> skipWhile(Predicate<? super U> predicate) {\n\t\treturn fromStream(FutureStream.super.skipWhile(predicate));\n\t}\n\n\t/**\n\t * Returns a stream with all elements skipped for which a predicate\n\t * evaluates to false.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (3, 4, 5) EagerFutureStream.of(1, 2, 3, 4, 5).skipUntil(i &gt; i == 3)\n\t * \n\t *}</pre>\n\t * @see #skipUntil(Stream, Predicate)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> skipUntil(Predicate<? super U> predicate) {\n\t\treturn fromStream(FutureStream.super.skipUntil(predicate));\n\t}\n\n\t/**\n\t * Returns a stream limited to all elements for which a predicate evaluates\n\t * to true.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (1, 2) EagerFutureStream.of(1, 2, 3, 4, 5).limitWhile(i -&gt; i &lt;\n\t * 3)\n\t * \n\t * }</pre>\n\t * @see #limitWhile(Stream, Predicate)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> limitWhile(Predicate<? super U> predicate) {\n\t\treturn fromStream(FutureStream.super.limitWhile(predicate));\n\t}\n\n\t/**\n\t * Returns a stream limited to all elements for which a predicate evaluates\n\t * to false.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (1, 2) EagerFutureStream.of(1, 2, 3, 4, 5).limitUntil(i &gt; i == 3)\n\t * \n\t *}</pre>\n\t * @see #limitUntil(Stream, Predicate)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> limitUntil(Predicate<? super U> predicate) {\n\t\treturn fromStream(FutureStream.super.limitUntil(predicate));\n\t}\n\n\t/**\n * Cross join 2 streams into one.\n * <p>\n * <pre>{@code \n * // (tuple(1, \"a\"), tuple(1, \"b\"), tuple(2, \"a\"), tuple(2, \"b\"))\n * LazyFutureStream.of(1, 2).crossJoin(LazyFutureStream.of(\"a\", \"b\"))\n * }</pre>\n */\n\tdefault <T> EagerFutureStream<Tuple2<U, T>> crossJoin(Stream<T> other) {\n\t return (EagerFutureStream)FutureStream.super.crossJoin(other);\n\t}\n\t\n\t/**\n * Produce this stream, or an alternative stream from the\n * {@code value}, in case this stream is empty.\n */\n\tdefault EagerFutureStream<U> onEmpty(U value){\n\t\t\n\t\treturn (EagerFutureStream)FutureStream.super.onEmpty(value);\n\t}\n\t/**\n * Produce this stream, or an alternative stream from the\n * {@code supplier}, in case this stream is empty.\n */\n\tdefault EagerFutureStream<U> onEmptyGet(Supplier<U> supplier){\n\t\treturn (EagerFutureStream)FutureStream.super.onEmptyGet(supplier);\n\t}\n\t/**\n * Produce this stream, or an alternative stream from the\n * {@code supplier}, in case this stream is empty.\n */\n\tdefault <X extends Throwable> EagerFutureStream<U> onEmptyThrow(Supplier<X> supplier) {\n\t\t\treturn (EagerFutureStream)FutureStream.super.onEmptyThrow(supplier);\n\t}\n /**\n * Inner join 2 streams into one.\n * <p>\n * <pre>{@code \n * // (tuple(1, 1), tuple(2, 2))\n * EagerFutureStream.of(1, 2, 3).innerJoin(Seq.of(1, 2), t -> Objects.equals(t.v1, t.v2))\n * }</pre>\n */\n default <T> EagerFutureStream<Tuple2<U, T>> innerJoin(Stream<T> other, BiPredicate<U, T> predicate) {\n \treturn (EagerFutureStream)FutureStream.super.innerJoin(other,predicate);\n \n }\n\n /**\n * Left outer join 2 streams into one.\n * <p>\n * <pre>{@code\n * // (tuple(1, 1), tuple(2, 2), tuple(3, null))\n * EagerFutureStream.of(1, 2, 3).leftOuterJoin(Seq.of(1, 2), t -> Objects.equals(t.v1, t.v2))\n * }</pre>\n */\n default <T> EagerFutureStream<Tuple2<U, T>> leftOuterJoin(Stream<T> other, BiPredicate<U, T> predicate) {\n\n \treturn (EagerFutureStream)FutureStream.super.leftOuterJoin(other,predicate);\n }\n\n /**\n * Right outer join 2 streams into one.\n * <p>\n * <pre> {@code \n * // (tuple(1, 1), tuple(2, 2), tuple(null, 3))\n * EagerFutureStream.of(1, 2).rightOuterJoin(Seq.of(1, 2, 3), t -> Objects.equals(t.v1, t.v2))\n * }</pre>\n */\n default <T> EagerFutureStream<Tuple2<U, T>> rightOuterJoin(Stream<T> other, BiPredicate<U, T> predicate) {\n return (EagerFutureStream)FutureStream.super.rightOuterJoin(other,predicate);\n }\n \n\t\n\t\n\t/**\n\t * Returns a stream with a given value interspersed between any two values\n\t * of this stream.\n\t * <pre>\n\t * {@code \n\t * \n\t * // (1, 0, 2, 0, 3, 0, 4) EagerFutureStream.of(1, 2, 3, 4).intersperse(0)\n\t * \n\t *}</pre>\n\t * @see #intersperse(Stream, Object)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> intersperse(U value) {\n\t\treturn fromStream(FutureStream.super.intersperse(value));\n\t}\n\n\t\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.jooq.lambda.Seq#distinct()\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> distinct() {\n\t\treturn fromStream(toQueue().stream().distinct());\n\t}\n\t/**\n\t * Create a sliding view over this Stream\n\t * \n\t * <pre>\n\t * {@code \n\t * //futureStream of [1,2,3,4,5,6]\n\t *\t\t \n\t * List<List<Integer>> list = futureStream.sliding(2)\n\t\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\n\t\n\t\tassertThat(list.get(0),hasItems(1,2));\n\t\tassertThat(list.get(1),hasItems(2,3));\n\t * }\n\t * </pre>\n\t * @param size\n\t * Size of sliding window\n\t * @return Stream with sliding view over data in this stream\n\t */\n\t@Override\n\tdefault EagerFutureStream<List<U>> sliding(int size){\n\t\treturn (EagerFutureStream)FutureStream.super.sliding(size);\n\t}\n\t/**\n\t * Create a sliding view over this Stream\n\t * \n\t * <pre>\n\t * {@code \n\t * //futureStream of [1,2,3,4,5,6,7,8]\n\t *\t\t \n\t * List<List<Integer>> list = futureStream.sliding(3,2)\n\t\t\t\t\t\t\t\t\t.collect(Collectors.toList());\n\t\t\n\t\n\t\tassertThat(list.get(0),hasItems(1,2,3));\n\t\tassertThat(list.get(1),hasItems(3,4,5));\n\t * }\n\t * </pre>\n\t * @param size\n\t * Size of sliding window\n\t * @return Stream with sliding view over data in this stream\n\t */\n\t@Override\n\tdefault EagerFutureStream<List<U>> sliding(int size, int increment){\n\t\treturn (EagerFutureStream)FutureStream.super.sliding(size,increment);\n\t}\n\t/**\n\t * Duplicate a Stream into two equivalent LazyFutureStreams, underlying\n\t * Stream of Futures is duplicated\n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1, 2, 3).duplicate()\n\t * \n\t * results in\n\t * \n\t * tuple((1,2,3),(1,2,3))\n\t * }</pre>\n\t * Care should be taken not to use this method with infinite streams!\n\t * \n\t * @return Two equivalent Streams\n\t * \n\t * @see #duplicate()\n\t */\n\n\tdefault Tuple2<EagerFutureStream<U>, EagerFutureStream<U>> duplicateFutures() {\n\t\t// unblocking impl\n\t\tStream stream = getLastActive().stream();\n\t\tTuple2<Seq<CompletableFuture<U>>, Seq<CompletableFuture<U>>> duplicated = Seq\n\t\t\t\t.seq((Stream<CompletableFuture<U>>) stream).duplicate();\n\t\tTuple2 dup =new Tuple2(fromStreamOfFutures(duplicated.v1),\n\t\t\t\tfromStreamOfFutures(duplicated.v2));\n\t\n\t\treturn (Tuple2<EagerFutureStream<U>,EagerFutureStream<U>>) dup;\n\t}\n\t/**\n\t * Duplicate a Stream into two equivalent LazyFutureStreams, Streams are duplicated as results\n\t * of Futures are populated\n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1, 2, 3).duplicate()\n\t * \n\t * results in\n\t * \n\t * tuple((1,2,3),(1,2,3))\n\t * }</pre>\n\t * Care should be taken not to use this method with infinite streams!\n\t * \n\t * @return Two equivalent Streams\n\t * \n\t * @see #duplicate()\n\t */\n\t@Override\n\tdefault Tuple2<Seq<U>, Seq<U>> duplicate() {\n\n\t\tList<EagerFutureStream<U>> duplicated = this.copy(2);\n\t\treturn new Tuple2(fromStream(duplicated.get(0)), fromStream(duplicated.get(1)));\n\t}\n\t/**\n\t * UnsupportedOperation for EagerFutureStreams\n\t * Requires ability to support infinite Streams\n\t * \n\t * \n\t * @return throws UnsupportedOperationException\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> cycle(){\n\t\tthrow new UnsupportedOperationException(\"cycle not supported for EagerFutureStreams\");\n\t}\n\t\n\n\t/**\n\t * Partition a stream into two given a predicate. (Operates on results, not\n\t * futures)\n\t * Can't change the return type in Seq to incorporate EagerFutureStream - see partitionFutureStream instead.\n\t * \n\t * <pre>\n\t * {@code \n\t * // tuple((1, 3, 5), (2, 4, 6)) \n\t * EagerFutureStream.of(1, 2, 3, 4, 5,6).partition(i -> i % 2 != 0)\n\t * }</pre>\n\t *\n\t * @see #partition(Stream, Predicate)\n\t */\n\t@Override\n\tdefault Tuple2<Seq<U>, Seq<U>> partition(Predicate<? super U> predicate) {\n\t\tTuple2<Seq<U>, Seq<U>> partitioned = FutureStream.super\n\t\t\t\t.partition(predicate);\n\t\treturn new Tuple2(fromStream(partitioned.v1),\n\t\t\t\tfromStream(partitioned.v2));\n\t}\n\n\t/**\n\t * Partition an EagerFutureStream into two EagerFutureStreams given a\n\t * predicate.\n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1, 2, 3, 4, 5, 6).partition(i -> i % 2 != 0)\n\t * \n\t * results in\n\t * \n\t * tuple((1, 3, 5), (2, 4, 6))\n\t * }</pre>\n\t * @param predicate\n\t * Predicate to split Stream\n\t * @return EagerFutureStream\n\t * @see #partition(Predicate)\n\t */\n\tdefault Tuple2<EagerFutureStream<U>, EagerFutureStream<U>> partitionFutureStream(\n\t\t\tPredicate<? super U> predicate) {\n\t\tTuple2 partition = partition(predicate);\n\t\treturn (Tuple2<EagerFutureStream<U>, EagerFutureStream<U>>) partition;\n\t}\n\n\t/**\n\t * Split a stream at a given position. (Operates on futures)\n\t * <pre>\n\t * {@code \n\t * // tuple((1, 2, 3), (4, 5, 6))\n\t * EagerFutureStream.of(1, 2, 3, 4, 5,6).splitAt(3)\n\t * \n\t * }</pre>\n\t * @return \n\t * \n\t *\n\t * @see #splitAt(Stream, long)\n\t */\n\tdefault Tuple2<EagerFutureStream<U>, EagerFutureStream<U>> splitAtFutures(\n\t\t\tlong position) {\n\t\tStream stream = getLastActive().stream();\n\t\tTuple2<Seq<CompletableFuture<U>>, Seq<CompletableFuture<U>>> split = Seq\n\t\t\t\t.seq((Stream<CompletableFuture<U>>) stream).splitAt(position);\n\n\t\treturn new Tuple2(\n\t\t\t\tfromListCompletableFuture(split.v1.collect(Collectors.toList())),\n\t\t\t\tfromListCompletableFuture(split.v2.collect(Collectors.toList())));\n\t}\n\n\t/**\n\t * Split a EagerFutureStream at a given position.\n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1, 2, 3, 4, 5, 6).splitAt(3)\n\t * \n\t * results in tuple((1, 2, 3), (4, 5, 6))\n\t * }</pre>\n\t * \n\t * @see #splitAt(long)\n\t */\n\tdefault Tuple2<Seq<U>, Seq<U>> splitAt(long position) {\n\t\t// blocking impl\n\n\t\tTuple2<Seq<U>, Seq<U>> split = FutureStream.super.splitAt(position);\n\t\treturn new Tuple2(fromStream(split.v1), fromStream(split.v2));\n\t}\n\t\n\t/**\n\t * Split a EagerFutureStream at a given position. Return type is an EagerFutureStream\n\t * <pre>\n\t * {@code \n\t * EagerFutureStream.of(1, 2, 3, 4, 5, 6).splitAtFutureStream(3)\n\t * \n\t * results in tuple((1, 2, 3), (4, 5, 6))\n\t * }</pre>\n\t * \n\t * @see #splitAt(long)\n\t */\n\tdefault Tuple2<EagerFutureStream<U>, EagerFutureStream<U>> splitAtFutureStream(\n\t\t\tlong position) {\n\t\tTuple2 split = splitAt(position);\n\t\treturn (Tuple2<EagerFutureStream<U>, EagerFutureStream<U>>) split;\n\t}\n\n\t/* \n\t * Convert a List of CompletableFutures into an EagerFutureStream\n\t * \n\t *\t@param list List of CompletableFutures\n\t *\t@return EagerFutureStream\n\t * @see com.aol.simple.react.stream.traits.SimpleReactStream#fromListCompletableFuture(java.util.List)\n\t */\n\tdefault <R> EagerFutureStream<R> fromListCompletableFuture(\n\t\t\tList<CompletableFuture<R>> list) {\n\n\t\treturn (EagerFutureStream) FutureStream.super\n\t\t\t\t.fromListCompletableFuture(list);\n\t}\n\n\t/**\n\t * Split a stream at the head.\n\t * \n\t * <pre>\n\t * {@code \n\t * // tuple(1, (2, 3, 4, 5, 6)) \n\t * EagerFutureStream.of(1, 2, 3, 4, 5, 6).splitHead(3)\n\t * }</pre>\n\t *\n\t * @see #splitAt(Stream, long)\n\t */\n\t@Override\n\tdefault Tuple2<Optional<U>, Seq<U>> splitAtHead() {\n\t\t// blocking\n\t\tTuple2<Optional<U>, Seq<U>> split = FutureStream.super.splitAtHead();\n\t\treturn new Tuple2(split.v1, fromStream(split.v2));\n\t}\n\n\t/**\n\t * SplitAtHead but return type is EagerFutureStream\n\t * \n\t * @return\n\t * @see #splitAtHead()\n\t */\n\tdefault Tuple2<Optional<U>, EagerFutureStream<U>> splitAtHeadFutureStream() {\n\t\tTuple2 split = splitAtHead();\n\t\treturn split;\n\t}\n\n\n\n\n\t/* \n\t *\t@return Convert to standard JDK 8 Stream\n\t * @see com.aol.simple.react.stream.traits.FutureStream#stream()\n\t */\n\t@Override\n\tdefault Stream<U> stream() {\n\t\treturn FutureStream.super.stream();\n\t}\n\t/* \n\t *\t@return New version of this stream converted to execute asynchronously and in parallel\n\t * @see com.aol.simple.react.stream.traits.FutureStream#parallel()\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> parallel(){\n\t\treturn this.withAsync(true).withTaskExecutor(EagerReact.parallelBuilder().getExecutor());\n\t}\n\t/* \n\t *\t@return New version of this stream converted to execute synchronously and sequentially\n\t * @see com.aol.simple.react.stream.traits.FutureStream#sequential()\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> sequential(){\n\t\treturn this.withAsync(false).withTaskExecutor(EagerReact.sequentialBuilder().getExecutor());\n\t}\n\n\n\n\n\t\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.jooq.lambda.Seq#unordered()\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> unordered() {\n\t\treturn this;\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.jooq.lambda.Seq#onClose(java.lang.Runnable)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> onClose(Runnable closeHandler) {\n\n\t\treturn (EagerFutureStream)FutureStream.super.onClose(closeHandler);\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.jooq.lambda.Seq#sorted()\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> sorted() {\n\t\treturn (EagerFutureStream<U>)fromStream(FutureStream.super.sorted());\n\t}\n\n\t/*\n\t * (non-Javadoc)\n\t * \n\t * @see org.jooq.lambda.Seq#sorted(java.util.Comparator)\n\t */\n\t@Override\n\tdefault EagerFutureStream<U> sorted(Comparator<? super U> comparator) {\n\t\treturn (EagerFutureStream<U>)fromStream(FutureStream.super.sorted(comparator));\n\t}\n\n\t/**\n\t * Give a function access to the current stage of a SimpleReact Stream\n\t * \n\t * @param consumer\n\t * Consumer that will recieve current stage\n\t * @return Self (current stage)\n\t */\n\tdefault EagerFutureStream<U> self(Consumer<FutureStream<U>> consumer) {\n\t\treturn (com.aol.simple.react.stream.traits.EagerFutureStream<U>)FutureStream.super.self(consumer);\n\t}\n\t\n\t/**\n\t * Merge two reactive dataflows with one and another.\n\t * \n\t * @param s1\n\t * Reactive stage builder to merge\n\t * @param s2\n\t * Reactive stage builder to merge\n\t * @return Merged dataflow\n\t */\n\t@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tpublic static <R> FutureStream<R> merge(EagerFutureStream s1, EagerFutureStream s2) {\n\t\tList merged = Stream\n\t\t\t\t.of(s1.getLastActive().list(), s2.getLastActive().list())\n\t\t\t\t.flatMap(Collection::stream).collect(Collectors.toList());\n\t\treturn (FutureStream<R>) s1.withLastActive(new StreamWrapper(merged));\n\t}\n\n\n\t/**\n\t * Construct an EagerFutureStream Stream from specified array, that will run in parallel\n\t * on the common Parallel executor service (by default the Common ForkJoinPool) see ThreadPools#setUseCommon \n\t * to change to a different pool\n\t * \n\t * @param array\n\t * Values to react to\n\t * @return Next SimpleReact stage\n\t */\n\tpublic static <U> EagerFutureStream<U> parallel(U... array) {\n\t\treturn EagerReact.parallelCommonBuilder().from(Arrays.asList(array));\n\t}\n\n\t\n\t/**\n\t * Create a 'free threaded' asynchronous stream that runs on the supplied CompletableFutures executor service (unless async operator invoked\n\t * , in which it will switch to the common 'free' thread executor)\n\t * Subsequent tasks will be executed synchronously unless the async() operator is invoked.\n\t * \n\t * @see Stream#of(Object)\n\t */\n\tstatic <T> EagerFutureStream<T> eagerFutureStreamFrom(Stream<CompletableFuture<T>> stream) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false)\n\t\t\t\t\t\t\t\t\t.fromStream(stream);\n\t}\n\t/**\n\t * Create a 'free threaded' asynchronous stream that runs on the supplied CompletableFutures executor service (unless async operator invoked\n\t * , in which it will switch to the common 'free' thread executor)\n\t * Subsequent tasks will be executed synchronously unless the async() operator is invoked.\n\t * \n\t * @see Stream#of(Object)\n\t */\n\tstatic <T> EagerFutureStream<T> eagerFutureStream(CompletableFuture<T> value) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false)\n\t\t\t\t\t\t\t\t\t.fromStream(Stream.of(value));\n\t}\n\t/**\n\t * Create a 'free threaded' asynchronous stream that runs on a single thread (not current)\n\t * The supplier will be executed asyncrhonously, subsequent tasks will be executed synchronously unless the async() operator\n\t * is invoked.\n\t * \n\t * @see Stream#of(Object)\n\t */\n\tstatic <T> EagerFutureStream<T> eagerFutureStream(CompletableFuture<T>... values) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false)\n\t\t\t\t\t\t\t\t\t.fromStream(Stream.of(values));\n\t}\n\n\t\n\t/**\n\t * Create a 'free threaded' asynchronous stream that runs on a single thread (not current)\n\t * The supplier will be executed asyncrhonously, subsequent tasks will be executed synchronously unless the async() operator\n\t * is invoked.\n\t * \n\t * @see Stream#of(Object)\n\t */\n\tstatic <T> EagerFutureStream<T> react(Supplier<T> value) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false).react(value);\n\t}\n\n\t/**\n\t * Create a 'free threaded' asynchronous stream that runs on a single thread (not current)\n\t * The supplier will be executed asyncrhonously, subsequent tasks will be executed synchronously unless the async() operator is invoked.\n\t * @see Stream#of(Object[])\n\t */\n\t@SafeVarargs\n\tstatic <T> EagerFutureStream<T> react(Supplier<T>... values) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false).react(values);\n\t}\n\t/**\n\t * Create a sequential synchronous stream that runs on the current thread\n\t * @see Stream#of(Object)\n\t * \n\t */\n\tstatic <T> EagerFutureStream<T> of(T value) {\n\t\treturn eagerFutureStream((Stream) Stream.of(value));\n\t}\n\n\t/**\n\t * Create a sequential synchronous stream that runs on the current thread\n\t * @see Stream#of(Object[])\n\t * \n\t */\n\t@SafeVarargs\n\tstatic <T> EagerFutureStream<T> of(T... values) {\n\t\treturn eagerFutureStream((Stream) Stream.of(values));\n\t}\n\t/**\n\t * Create a sequential synchronous stream that runs on the current thread\n\t * @see Stream#of(Object)\n\t * \n\t */\n\tstatic <T> EagerFutureStream<T> ofThread(T value) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false).of(value);\n\t}\n\n\t/**\n\t * Create a sequential synchronous stream that runs on the current thread\n\t * @see Stream#of(Object[])\n\t * \n\t */\n\t@SafeVarargs\n\tstatic <T> EagerFutureStream<T> ofThread(T... values) {\n\t\treturn new EagerReact(ThreadPools.getSequential(),new AsyncRetryExecutor(ThreadPools.getSequentialRetry()),false).of(values);\n\t}\n\n\t/**\n\t * @see Stream#empty()\n\t */\n\tstatic <T> EagerFutureStream<T> empty() {\n\t\treturn eagerFutureStream((Stream) Seq.empty());\n\t}\n\n\t/**\n\t * Wrap a Stream into a Sequential synchronous FutureStream that runs on the current thread \n\t */\n\tstatic <T> EagerFutureStream<T> eagerFutureStream(Stream<T> stream) {\n\t\tif (stream instanceof FutureStream)\n\t\t\treturn (EagerFutureStream<T>) stream;\n\t\tEagerReact er = new EagerReact(\n\t\tThreadPools.getCurrentThreadExecutor(), RetryBuilder.getDefaultInstance()\n\t\t.withScheduler(ThreadPools.getSequentialRetry()),false);\n\t\t\n\t\treturn new EagerFutureStreamImpl<T>(er,\n\t\t\t\tstream.map(CompletableFuture::completedFuture)).sync();\n\t}\n\n\t/**\n\t * Wrap an Iterable into a FutureStream that runs on the current thread\n\t * \n\t * \n\t */\n\tstatic <T> EagerFutureStream<T> eagerFutureStreamFromIterable(Iterable<T> iterable) {\n\t\treturn eagerFutureStream(iterable.iterator());\n\t}\n\n\t/**\n\t * Wrap an Iterator into a FutureStream that runs on the current thread\n\t * \n\t */\n\tstatic <T> EagerFutureStream<T> eagerFutureStream(Iterator<T> iterator) {\n\t\treturn eagerFutureStream(StreamSupport.stream(\n\t\t\t\tspliteratorUnknownSize(iterator, ORDERED), false));\n\t}\n\n\n\t\n\n}", "@Test\n public void testStreamingFunction() throws Exception {\n setFunctionLocation(\"encode-1.0.0-boot\");\n setFunctionBean(\"com.acme.Encode\");\n process = processBuilder.start();\n\n Function<Flux<Integer>, Flux<?>[]> fn = FunctionProxy.create(Function.class, connect(), Integer.class);\n\n Flux<?>[] result = fn.apply(Flux.just(1, 1, 1, 0, 0, 0, 0, 1, 1));\n\n assertThat(result.length, CoreMatchers.equalTo(1));\n StepVerifier.create((Flux<Integer>) result[0])\n .expectNext(3, 1)\n .expectNext(4, 0)\n .expectNext(2, 1)\n .verifyComplete();\n }", "public void syncStream() {\n JCudaDriver.cuStreamSynchronize(stream);}", "@Ignore\n @Test\n public void testPerformanceFromTfm() throws JAXBException, ClassNotFoundException, Exception\n {\n int num_messages = 20000; \n int num_samples = 10;\n \n long total = 0;\n long min = Long.MAX_VALUE;\n long max = Long.MIN_VALUE;\n \n for( int i = 0; i < num_samples; i++ )\n {\n long proc_time = sendTfmFlightMsgs( num_messages );\n total = total + proc_time;\n min = Math.min( min, proc_time );\n max = Math.max( max, proc_time );\n }\n \n log.info( \"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\" );\n log.info( \"Ran \" + num_samples + \" samples. Avg Time = \" + ( total / num_samples ) + \n \", Min Time = \" + min + \", Max Time = \" + max );\n log.info( \"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\" ); \n }", "public interface DownLoadService {\n\n @Streaming\n @GET\n Observable<ResponseBody> downloadFilm(@Url String url);\n\n}", "@Test\n void receivesWithSmallPrefetch() {\n // Arrange\n final String secondPartitionId = \"2\";\n final AtomicBoolean isActive = new AtomicBoolean(true);\n final EventHubProducerAsyncClient producer = toClose(builder.buildAsyncProducerClient());\n\n final Disposable producerEvents = toClose(getEvents(isActive)\n .flatMap(event -> producer.send(event, new SendOptions().setPartitionId(secondPartitionId)))\n .subscribe(\n sent -> {\n },\n error -> logger.error(\"Error sending event\", error),\n () -> logger.info(\"Event sent.\")));\n\n final int prefetch = 5;\n final int backpressure = 3;\n final int batchSize = 10;\n final EventHubConsumerAsyncClient consumer = toClose(builder\n .prefetchCount(prefetch)\n .buildAsyncConsumerClient());\n\n // Act & Assert\n try {\n StepVerifier.create(consumer.receiveFromPartition(secondPartitionId, EventPosition.latest()), prefetch)\n .expectNextCount(prefetch)\n .thenRequest(backpressure)\n .expectNextCount(backpressure)\n .thenRequest(batchSize)\n .expectNextCount(batchSize)\n .thenRequest(batchSize)\n .expectNextCount(batchSize)\n .thenAwait(Duration.ofSeconds(1))\n .thenCancel()\n .verify(TIMEOUT);\n } finally {\n isActive.set(false);\n }\n }", "int getServerProcessingIterations();", "public interface EagerReactive {\n\t/**\n\t * Add a value to an simple-react Async.Adapter (Queue / Topic /Signal) if present\n\t * Returns the Adapter wrapped in an Optional\n\t * \n\t * @see Pipes#register(Object, com.aol.simple.react.async.Adapter)\n\t * \n\t * @param key : identifier for registered Queue\n\t * @param value : value to add to Queue\n\t */\n\tdefault <K,V> Optional<Adapter<V>> enqueue(K key,V value){\n\t\tOptional<Adapter<V>> queue = Pipes.get(key);\n\t\tqueue.map(adapter -> adapter.offer(value));\n\t\n\t\treturn queue;\n\t\t\n\t\t\n\t}\n\t\n\t\n\t/**\n\t * \n\t * Generate a sequentially executing single-threaded a EagerFutureStream that executes all tasks directly without involving\n\t * a task executor between each stage (unless async operator invoked). A preconfigured EagerReact builder that will be supplied as\n\t * input to the function supplied. The user Function should create a EagerFutureStream with any\n\t * business logic stages predefined. This method will handle elastic scaling and pooling of Executor\n\t * services. User code should call a terminal op on the returned EagerFutureStream\n\t * \n\t * \n\t * @param react Function that generates a EagerFutureStream from a EagerReact builder\n\t * @return Generated EagerFutureStream\n\t */\n\tdefault <T> EagerFutureStream<T> sync(Function<EagerReact,EagerFutureStream<T>> react){\n\t\t EagerReact r =SequentialElasticPools.eagerReact.nextReactor().withAsync(false);\n\t\t return react.apply( r)\n\t\t\t\t \t.onFail(e->{ SequentialElasticPools.eagerReact.populate(r); throw e;})\n\t\t\t\t \t.peek(i->SequentialElasticPools.eagerReact.populate(r));\n\t\t \t\t\t\t \t\n\t}\n\t\n\t/**\n\t * Switch EagerFutureStream into execution mode suitable for IO (reuse ioReactors task executor)\n\t * \n\t * @param stream to convert to IO mode\n\t * @return EagerFutureStream in IO mode\n\t */\n\tdefault <T> EagerFutureStream<T> switchToIO(EagerFutureStream<T> stream){\n\t\tEagerReact react = EagerReactors.ioReact;\n\t\treturn stream.withTaskExecutor(react.getExecutor()).withRetrier(react.getRetrier());\n\t}\n\t/**\n\t * Switch EagerFutureStream into execution mode suitable for CPU bound execution (reuse cpuReactors task executor)\n\t * \n\t * @param stream to convert to CPU bound mode\n\t * @return EagerFutureStream in CPU bound mode\n\t */\n\tdefault <T> EagerFutureStream<T> switchToCPU(EagerFutureStream<T> stream){\n\t\tEagerReact react = EagerReactors.cpuReact;\n\t\treturn stream.withTaskExecutor(react.getExecutor()).withRetrier(react.getRetrier());\n\t}\n\t/**\n\t * @return Stream builder for IO Bound Streams\n\t */\n\tdefault OptimizedEagerReact ioStream(){\n\t\treturn new OptimizedEagerReact(EagerReactors.ioReact);\n\t}\n\t/**\n\t * @return Stream builder for CPU Bound Streams\n\t */\n\tdefault OptimizedEagerReact cpuStream(){\n\t\treturn new OptimizedEagerReact(EagerReactors.cpuReact);\n\t}\n\t/**\n\t * Generate a multi-threaded EagerFutureStream that executes all tasks via \n\t * a task executor between each stage (unless sync operator invoked). \n\t * A preconfigured EagerReact builder that will be supplied as\n\t * input to the function supplied. The user Function should create a EagerFutureStream with any\n\t * business logic stages predefined. This method will handle elastic scaling and pooling of Executor\n\t * services. User code should call a terminal op on the returned EagerFutureStream\n\t * \n\t * \n\t * @param react Function that generates a EagerFutureStream from a EagerReact builder\n\t * @return Generated EagerFutureStream\n\t */\n\tdefault <T> EagerFutureStream<T> async(Function<EagerReact,EagerFutureStream<T>> react){\n\t\t EagerReact r =ParallelElasticPools.eagerReact.nextReactor().withAsync(true);\n\t\treturn react.apply( r)\n\t\t\t\t\t.onFail(e->{ SequentialElasticPools.eagerReact.populate(r); throw e;})\n\t\t\t\t\t.peek(i->SequentialElasticPools.eagerReact.populate(r));\n\t\t \t\n\t}\n\t\n\t\n\t\n}", "@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\tdefault EagerFutureStream<Collection<U>> batchByTime(long time, TimeUnit unit) {\n\t\n\t\tint size = this.getLastActive().list().size();\n\t\tList[] list = {new ArrayList<U>()};\n\t\tint[] count = {0};\n\t\tSimpleTimer[] timer = {new SimpleTimer()};\n\t\treturn (EagerFutureStream)this.map(next-> { \n\t\t\t\tsynchronized(timer){\n\t\t\t\t\tcount[0]++;\n\t\t\t\t\tif(unit.toNanos(time)-timer[0].getElapsedNanoseconds()>0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t} else{\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\t timer[0] = new SimpleTimer();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(count[0]==size){\n\t\t\t\t\t\tlist[0].add(next);\n\t\t\t\t\t\t\n\t\t\t\t\t\tList<U> result = list[0];\n\t\t\t\t\t\tlist[0] = new ArrayList<U>();\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t\treturn new ArrayList();\n\t\t\t\t}\n\t\t\t}\t).filter(l->l.size()>0);\n\t\t\n\t}", "public abstract void enableStreamFlow();", "@Override\n public void init(StreamGraph graph, Config config) {\n graph.setDefaultSerde(new NoOpSerde<>());\n\n // Inputs\n // Messages come from WikipediaConsumer so we know the type is WikipediaFeedEvent\n MessageStream<WikipediaFeedEvent> wikipediaEvents = graph.getInputStream(WIKIPEDIA_STREAM_ID);\n MessageStream<WikipediaFeedEvent> wiktionaryEvents = graph.getInputStream(WIKTIONARY_STREAM_ID);\n MessageStream<WikipediaFeedEvent> wikiNewsEvents = graph.getInputStream(WIKINEWS_STREAM_ID);\n\n // Output (also un-keyed)\n OutputStream<WikipediaStatsOutput> wikipediaStats =\n graph.getOutputStream(STATS_STREAM_ID, new JsonSerdeV2<>(WikipediaStatsOutput.class));\n\n // Merge inputs\n MessageStream<WikipediaFeedEvent> allWikipediaEvents =\n MessageStream.mergeAll(ImmutableList.of(wikipediaEvents, wiktionaryEvents, wikiNewsEvents));\n\n // Parse, update stats, prepare output, and send\n allWikipediaEvents\n .map(WikipediaParser::parseEvent)\n .window(Windows.tumblingWindow(Duration.ofSeconds(10), WikipediaStats::new,\n new WikipediaStatsAggregator(), WikipediaStats.serde()), \"statsWindow\")\n .map(this::formatOutput)\n .sendTo(wikipediaStats);\n }", "public interface NetworkApi {\n\t@GET\n\t@Streaming\n\tCall<ResponseBody> download(@Url String url, @Header(\"Range\") String rangeDownload, @Header(\"Connection\") String connection);\n}", "public final static void main(String[] args) throws Exception {\n \n ThreadFactory threadFactory =\n new VerboseThreadFactory(log, Executors.defaultThreadFactory());\n \n ThreadPoolExecutor executor = (ThreadPoolExecutor)\n (MAX_THREADS == Integer.MAX_VALUE\n ? Executors.newCachedThreadPool(threadFactory)\n : Executors.newFixedThreadPool(MAX_THREADS, threadFactory));\n \n AsynchronousChannelProvider provider =\n AsynchronousChannelProvider.provider();\n \n AsynchronousChannelGroup group =\n provider.openAsynchronousChannelGroup(executor);\n \n log.log(Level.INFO, \"ChannelGroup is a {0}\", group.getClass());\n \n startSignal = new CountDownLatch(NUM_CLIENTS);\n doneSignal = new CountDownLatch(NUM_CLIENTS);\n \n log.log(Level.INFO,\n \"Prestarting {0,number,integer} threads\", NUM_THREADS);\n \n executor.setCorePoolSize(NUM_THREADS);\n executor.prestartAllCoreThreads();\n \n log.log(Level.INFO,\n \"Connecting {0,number,integer} clients\", NUM_CLIENTS);\n \n Set<EchoClient> clients = new HashSet<EchoClient>(NUM_CLIENTS);\n \n for (int i = 0; i < NUM_CLIENTS; ++i) {\n EchoClient client = new EchoClient(group);\n clients.add(client);\n client.connect();\n }\n \n startSignal.await();\n \n log.info(\"Starting test\");\n startTime = System.nanoTime();\n \n for (EchoClient client : clients)\n client.start();\n \n doneSignal.await();\n \n long ops = NUM_CLIENTS * NUM_MSGS * 2;\n long elapsed = System.nanoTime() - startTime;\n log.log(Level.INFO, \"Bytes read: {0} written:{1}\",\n new Object[] {\n totalBytesRead.get(),\n totalBytesWritten.get()\n });\n log.log(Level.INFO, \"{0} ops in {1} seconds = {2} ops/sec\",\n new Object[] {\n ops,\n TimeUnit.NANOSECONDS.toSeconds(elapsed),\n TimeUnit.SECONDS.toNanos(ops) / elapsed\n });\n \n group.shutdown();\n log.info(\"Awaiting group termination\"); \n if (! group.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Forcing group termination\");\n group.shutdownNow();\n if (! group.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Group could not be forcibly terminated\");\n }\n }\n if (group.isTerminated())\n log.info(\"Group terminated\");\n \n log.info(\"Terminating executor\");\n executor.shutdown();\n log.info(\"Awaiting executor termination\"); \n if (! executor.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Forcing executor termination\");\n executor.shutdownNow();\n if (! executor.awaitTermination(5, TimeUnit.SECONDS)) {\n log.warning(\"Executor could not be forcibly terminated\");\n }\n }\n if (executor.isTerminated())\n log.info(\"Executor terminated\");\n }", "public static void main(String[] args){ new ThreadPoolBlockingServer().processRequests(); }", "@Test(dataProvider = \"uris\")\n void testWithCustomSubscriber(String uri) throws Exception {\n HttpClient client = HttpClient.newBuilder().sslContext(sslContext).build();\n\n Map<HttpRequest, String> requests = new HashMap<>();\n for (int i=0;i<CONCURRENT_REQUESTS; i++) {\n HttpRequest request = HttpRequest.newBuilder(URI.create(uri + \"?\" + i))\n .build();\n requests.put(request, BODIES[i]);\n }\n\n // initial connection to seed the cache so next parallel connections reuse it\n client.sendAsync(HttpRequest.newBuilder(URI.create(uri)).build(), discard(null)).join();\n\n // will reuse connection cached from the previous request ( when HTTP/2 )\n CompletableFuture.allOf(requests.keySet().parallelStream()\n .map(request -> client.sendAsync(request, CustomSubscriber.handler))\n .map(cf -> cf.thenCompose(ConcurrentResponses::assert200ResponseCode))\n .map(cf -> cf.thenCompose(response -> assertbody(response, requests.get(response.request()))))\n .toArray(CompletableFuture<?>[]::new))\n .join();\n }", "public interface OutgoingStream<T> {\n\n /**\n * Publish a single message.\n *\n * @param message The message to publish.\n * @return A CompletionStage that will be redeemed successfully when the message is published, or with an error\n * otherwise.\n */\n CompletionStage<Void> publish(T message);\n\n /**\n * Create a subscriber which will publish all the messages it receives to the outgoing stream.\n * <p/>\n * If this is an enveloped outgoing stream (ie, where T is of type Envelope&lt;M&gt;), then the envelopes will be\n * acked.\n *\n * @return The subscriber.\n */\n Flow.Subscriber<T> subscriber();\n\n /**\n * Create a processor which will publish all the messages it receives, and emit an Ack for each message that it\n * successfully publishes, in the order that it receives the messages.\n * <p/>\n * If this is an enveloped outgoing stream (ie, where T is of type Envelope&lt;M&gt;), then the acks emitted will be\n * the ones returned from the envelope.\n *\n * @return The processor.\n */\n Flow.Processor<T, Ack> processor();\n\n /**\n * Create a copy of this stream that publishes to the given topic name.\n */\n OutgoingStream<T> withTopic(String topic);\n}", "public void streamSubscriberStart(ISubscriberStream stream);", "public interface StreamSource {\n\n /**\n * Gets new streams. This should be called only if one of the streams \n * is dead. \n * @throws TransportException\n */\n void connect() throws TransportException;\n \n /**\n * Closes streams and underlying connections. \n * @throws TransportException\n */\n void disconnect() throws TransportException;\n \n /**\n * @return the stream to which we write outbound messages. \n * @throws TransportException\n */\n OutputStream getOutboundStream() throws TransportException;\n\n /**\n * @return the stream to which we expect the remote server to send messages. \n * @throws TransportException\n */\n InputStream getInboundStream() throws TransportException;\n \n}", "int batchSize();", "default <T> EagerFutureStream<T> async(Function<EagerReact,EagerFutureStream<T>> react){\n\t\t EagerReact r =ParallelElasticPools.eagerReact.nextReactor().withAsync(true);\n\t\treturn react.apply( r)\n\t\t\t\t\t.onFail(e->{ SequentialElasticPools.eagerReact.populate(r); throw e;})\n\t\t\t\t\t.peek(i->SequentialElasticPools.eagerReact.populate(r));\n\t\t \t\n\t}", "public interface ProgressRequestListener {\n void onRequestProgress(int pro, long contentLength, boolean done);\n}", "public static void main(String[] args) throws Exception {\n\n ManagedChannel channel = NettyChannelBuilder.forAddress(\"localhost\", 6565)\n .sslContext(GrpcSslContexts.forClient().trustManager(new File(\"ca.crt\")).build())\n .build();\n\n SubscriptionServiceGrpc.SubscriptionServiceStub helloServiceStub = SubscriptionServiceGrpc\n .newStub(channel)\n .withCallCredentials(CallCredentialsHelper.basicAuth(\"sai\", \"sai123\"));\n\n long start = System.currentTimeMillis();\n SubscriptionRequest rq = SubscriptionRequest.newBuilder().setId(\"Sai\")\n .setSubscriptionScheme(SubscriptionScheme.newBuilder()\n .setSubscriptionTimeInSeconds(10).build()).setTopic(\"foo\").build();\n helloServiceStub.subscribe(rq,\n new StreamObserver<>() {\n @Override\n public void onNext(SubscriptionResponse helloResponse) {\n System.out.println(\" --- \" + helloResponse.getDataJson());\n }\n\n @Override\n public void onError(Throwable throwable) {\n System.out.println(\" ***** On Error **** \"+throwable);\n }\n\n @Override\n public void onCompleted() {\n long end = System.currentTimeMillis();\n System.out.println((end - start) / 1000);\n System.exit(0);\n }\n });\n Thread.sleep(10000000);\n }", "private static AInput<ByteBuffer> export(final Consumer<StreamFinishedEvent> listener,\n final AInput<ByteBuffer> stream) {\n return AInputProxyFactory.createProxy(Vat.current(), CountingInput.countIfNeeded(stream, listener));\n }", "public interface StreamAlgorithm{\n \n \n /**\n * Return the stream content-length. If the content-length wasn't parsed,\n * return -1.\n */\n public int contentLength();\n \n \n /**\n * Return the stream header length. The header length is the length between\n * the start of the stream and the first occurance of character '\\r\\n' .\n */\n public int headerLength();\n \n \n /**\n * Allocate a <code>ByteBuffer</code>\n * @param useDirect allocate a direct <code>ByteBuffer</code>.\n * @param useView allocate a view <code>ByteBuffer</code>.\n * @param size the size of the newly created <code>ByteBuffer</code>.\n * @return a new <code>ByteBuffer</code>\n */\n public ByteBuffer allocate(boolean useDirect, boolean useView, int size);\n \n \n /**\n * Before parsing the bytes, initialize and prepare the algorithm.\n * @param byteBuffer the <code>ByteBuffer</code> used by this algorithm\n * @return <code>ByteBuffer</code> used by this algorithm\n */\n public ByteBuffer preParse(ByteBuffer byteBuffer);\n \n \n /**\n * Parse the <code>ByteBuffer</code> and try to determine if the bytes\n * stream has been fully read from the <code>SocketChannel</code>.\n * @paran byteBuffer the bytes read.\n * @return true if the algorithm determines the end of the stream.\n */\n public boolean parse(ByteBuffer byteBuffer);\n \n \n /**\n * After parsing the bytes, post process the <code>ByteBuffer</code> \n * @param byteBuffer the <code>ByteBuffer</code> used by this algorithm\n * @return <code>ByteBuffer</code> used by this algorithm\n */\n public ByteBuffer postParse(ByteBuffer byteBuffer); \n \n \n /**\n * Recycle the algorithm.\n */\n public void recycle();\n \n \n /**\n * Rollback the <code>ByteBuffer</code> to its previous state in case\n * an error as occured.\n */\n public ByteBuffer rollbackParseState(ByteBuffer byteBuffer); \n \n \n /**\n * The <code>Handler</code> associated with this algorithm.\n */\n public Handler getHandler();\n\n \n /**\n * Set the <code>SocketChannel</code> used by this algorithm\n */\n public void setSocketChannel(SocketChannel socketChannel);\n \n \n /**\n * Set the <code>port</code> this algorithm is used.\n */\n public void setPort(int port);\n \n \n /**\n * Return the port\n */\n public int getPort();\n \n \n /**\n * Return the class responsible for handling OP_READ.\n */\n public Class getReadTask(SelectorThread selectorThread);\n}", "@Override\n public final boolean isStreaming() {\n return false;\n }", "List<ObjectMessage> getObjects(long stream, long version, ObjectType... types);", "public static void testHighLevelApi() {\n TestApplication.AppTest app = TestApplication.create(new MapConfig());\n CollectionStream<String> input1 = CollectionStream.of(\"1\", \"2\", \"4\");\n MessageStream<String> stream = app\n .getInputStream(input1)\n .map(s -> \"processed \" + s);\n StreamAssert.that(stream).containsInAnyOrder(Arrays.asList(\"processed 1\", \"processed 2\", \"processed 4\"));\n\n app.run();\n }", "private void execute(List<Pair<Integer, Stream<byte[], GenericRecord>>> streams) throws Exception {\n Runtime.getRuntime().addShutdownHook(new Thread(() -> {\n isDone.set(true);\n printAggregatedStats(cumulativeRecorder);\n }));\n\n ExecutorService executor = Executors.newFixedThreadPool(flags.numThreads);\n try {\n final long numRecordsForThisThread = flags.numEvents / flags.numThreads;\n final long numBytesForThisThread = flags.numBytes / flags.numThreads;\n final double writeRateForThisThread = flags.writeRate / flags.numThreads;\n for (int i = 0; i < flags.numThreads; i++) {\n final int idx = i;\n final List<Stream<byte[], GenericRecord>> logsThisThread = streams\n .stream()\n .filter(pair -> pair.getLeft() % flags.numThreads == idx)\n .map(pair -> pair.getRight())\n .collect(Collectors.toList());\n executor.submit(() -> {\n try {\n if (flags.prometheusEnable) {\n writeWithPrometheusMonitor(\n logsThisThread,\n writeRateForThisThread,\n numRecordsForThisThread,\n numBytesForThisThread);\n } else {\n write(\n logsThisThread,\n writeRateForThisThread,\n numRecordsForThisThread,\n numBytesForThisThread);\n }\n } catch (Exception e) {\n log.error(\"Encountered error at writing records\", e);\n isDone.set(true);\n System.exit(-1);\n }\n });\n }\n log.info(\"Started {} write threads\", flags.numThreads);\n startTime = System.currentTimeMillis();\n reportStats();\n } finally {\n executor.shutdown();\n if (!executor.awaitTermination(5, TimeUnit.SECONDS)) {\n executor.shutdownNow();\n }\n streams.forEach(streamPair -> streamPair.getRight().closeAsync());\n }\n }", "@Test\n public void testHTTPSPublisherWithLogSink() throws Exception {\n setCarbonHome();\n logger.info(\"Test case for HTTPS output publisher with log sink.\");\n SiddhiManager siddhiManager = new SiddhiManager();\n siddhiManager.setExtension(\"xml-output-mapper\", XMLSinkMapper.class);\n String inStreamDefinition = \"Define stream FooStream (message String,method String,headers String);\"\n + \"@sink(type='log')\"\n + \"@sink(type='http',publisher.url='https://localhost:8009/abc',method='{{method}}',\"\n + \"headers='{{headers}}',\"\n + \"@map(type='xml', \"\n + \"@payload('{{message}}'))) \"\n + \"Define stream BarStream (message String,method String,headers String);\";\n String query = (\n \"@info(name = 'query') \"\n + \"from FooStream \"\n + \"select message,method,headers \"\n + \"insert into BarStream;\"\n );\n SiddhiAppRuntime siddhiAppRuntime = siddhiManager\n .createSiddhiAppRuntime(inStreamDefinition + query);\n InputHandler fooStream = siddhiAppRuntime.getInputHandler(\"FooStream\");\n siddhiAppRuntime.start();\n HttpsServerListenerHandler lst = new HttpsServerListenerHandler(8009);\n lst.run();\n fooStream.send(new Object[]{payload, \"POST\", \"'Name:John','Age:23'\"});\n while (!lst.getServerListener().isMessageArrive()) {\n Thread.sleep(10);\n }\n String eventData = lst.getServerListener().getData();\n Assert.assertEquals(eventData, expected);\n siddhiAppRuntime.shutdown();\n lst.shutdown();\n }", "public void streamClosed(boolean inStream) throws IOException {\n if (!isGet) {\n if ((!inStream) && (!isDone)) {\n // to deal with outputstream in put operation\n\n boolean more = true;\n\n if ((privateOutput != null) && (privateOutput.size() <= 0)) {\n byte[] headerArray = OBEXHelper.createHeader(requestHeaders, false);\n if (headerArray.length <= 0)\n more = false;\n }\n // If have not sent any data so send all now\n if (replyHeaders.responseCode == -1) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n }\n\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x02);\n }\n\n /*\n * According to the IrOBEX specification, after the final put, you\n * only have a single reply to send. so we don't need the while\n * loop.\n */\n while (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n\n sendRequest(0x82);\n }\n isDone = true;\n } else if ((inStream) && (isDone)) {\n // how to deal with input stream in put stream ?\n isDone = true;\n }\n } else {\n isValidateConnected = false;\n if ((inStream) && (!isDone)) {\n\n // to deal with inputstream in get operation\n // Have not sent any data so send it all now\n\n if (replyHeaders.responseCode == -1) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n }\n\n while (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n if (!sendRequest(0x83)) {\n break;\n }\n }\n while (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x83, null, replyHeaders, privateInput);\n }\n isDone = true;\n } else if ((!inStream) && (!isDone)) {\n // to deal with outputstream in get operation\n // part of the data may have been sent in continueOperation.\n\n boolean more = true;\n\n if ((privateOutput != null) && (privateOutput.size() <= 0)) {\n byte[] headerArray = OBEXHelper.createHeader(requestHeaders, false);\n if (headerArray.length <= 0)\n more = false;\n }\n\n if (privateInput == null) {\n privateInput = new PrivateInputStream(this);\n }\n if ((privateOutput != null) && (privateOutput.size() <= 0))\n more = false;\n\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x03);\n }\n sendRequest(0x83);\n // parent.sendRequest(0x83, null, replyHeaders, privateInput);\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n\n }\n }\n }", "public static JavaStreamingContext processStream() throws SparkException {\n SparkConf streamingConf = new SparkConf().setMaster(\"local[2]\").setAppName(\"voting\");\r\n streamingConf.set(\"spark.streaming.stopGracefullyOnShutdown\", \"true\");\r\n\r\n // create a Spark Java streaming context, with stream batch interval\r\n JavaStreamingContext jssc = new JavaStreamingContext(streamingConf, Durations.milliseconds(1000));\r\n\r\n // set checkpoint for demo\r\n jssc.checkpoint(System.getProperty(\"java.io.tmpdir\"));\r\n\r\n jssc.sparkContext().setLogLevel(Level.OFF.toString()); // turn off Spark logging\r\n\r\n // set up receive data stream from kafka\r\n final Set<String> topicsSet = new HashSet<>(Arrays.asList(topic));\r\n final Map<String, String> kafkaParams = new HashMap<>();\r\n kafkaParams.put(\"metadata.broker.list\", broker);\r\n\r\n // create a Discretized Stream of Java String objects\r\n // as a direct stream from kafka (zookeeper is not an intermediate)\r\n JavaPairInputDStream<String, String> rawDataLines =\r\n KafkaUtils.createDirectStream(\r\n jssc,\r\n String.class,\r\n String.class,\r\n StringDecoder.class,\r\n StringDecoder.class,\r\n kafkaParams,\r\n topicsSet\r\n );\r\n\r\n JavaDStream<String> lines = rawDataLines.map((Function<Tuple2<String, String>, String>) Tuple2::_2);\r\n System.out.println(lines);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n return jssc;\r\n }", "private StreamObserver<JobResultsRequestWrapper> getJobResultsRequestWrapperStreamObserver(CoordinationProtos.NodeEndpoint foreman,\n ResponseSender sender,\n String queryId) {\n final JobResultsServiceGrpc.JobResultsServiceStub stub = getJobResultsServiceStub(foreman, queryId);\n Pointer<StreamObserver<JobResultsRequestWrapper>> streamObserverInternal = new Pointer<>();\n\n Context.current().fork().run( () -> {\n MethodDescriptor<JobResultsRequestWrapper, JobResultsResponse> jobResultsMethod =\n JobResultsRequestUtils.getJobResultsMethod(allocator);\n\n ClientCall<JobResultsRequestWrapper, JobResultsResponse> clientCall =\n stub.getChannel().newCall(jobResultsMethod, stub.getCallOptions());\n\n streamObserverInternal.value = ClientCalls.asyncBidiStreamingCall(clientCall,\n getResponseObserver(foreman, sender, queryId));\n });\n return streamObserverInternal.value;\n }", "static public void callForeachRDD (org.apache.spark.streaming.api.java.JavaDStream<byte[]> jdstream, org.apache.spark.streaming.api.python.PythonTransformFunction pfunc) { throw new RuntimeException(); }", "public Result index() {\n F.Promise<Response> profilePromise = serviceClient.fakeRemoteCallMedium(\"profile\");\n F.Promise<Response> graphPromise = serviceClient.fakeRemoteCallMedium(\"graph\");\n F.Promise<Response> feedPromise = serviceClient.fakeRemoteCallSlow(\"feed\");\n F.Promise<Response> inboxPromise = serviceClient.fakeRemoteCallSlow(\"inbox\");\n F.Promise<Response> adsPromise = serviceClient.fakeRemoteCallFast(\"ads\");\n F.Promise<Response> searchPromise = serviceClient.fakeRemoteCallFast(\"search\");\n\n // Convert each Promise into a Pagelet which will be rendered as HTML as soon as the data is available.\n Pagelet profile = Pagelet.fromHtmlPromise(profilePromise.map(views.html.helpers.module::apply), \"profile\");\n Pagelet graph = Pagelet.fromHtmlPromise(graphPromise.map(views.html.helpers.module::apply), \"graph\");\n Pagelet feed = Pagelet.fromHtmlPromise(feedPromise.map(views.html.helpers.module::apply), \"feed\");\n Pagelet inbox = Pagelet.fromHtmlPromise(inboxPromise.map(views.html.helpers.module::apply), \"inbox\");\n Pagelet ads = Pagelet.fromHtmlPromise(adsPromise.map(views.html.helpers.module::apply), \"ads\");\n Pagelet search = Pagelet.fromHtmlPromise(searchPromise.map(views.html.helpers.module::apply), \"search\");\n\n // Compose all the pagelets into an HtmlStream\n HtmlStream body = HtmlStreamHelper.fromInterleavedPagelets(profile, graph, feed, inbox, ads, search);\n\n // Render the streaming template immediately\n return ok(HtmlStreamHelper.toChunks(views.stream.withBigPipe.apply(body)));\n }", "static <T> EagerFutureStream<T> eagerFutureStream(Iterator<T> iterator) {\n\t\treturn eagerFutureStream(StreamSupport.stream(\n\t\t\t\tspliteratorUnknownSize(iterator, ORDERED), false));\n\t}", "public interface Stream {\n /**\n * The mediator of multiple Streams.\n */\n public interface StreamsMediator {\n /**\n * Allows the switching to another Stream.\n * @param streamKind The {@link StreamKind} of the stream to switch to.\n */\n default void switchToStreamKind(@StreamKind int streamKind) {}\n\n /**\n * Request the immediate refresh of the contents of the active stream.\n */\n default void refreshStream() {}\n\n /**\n * Disable the follow button, used in case of an error scenario.\n */\n default void disableFollowButton() {}\n }\n /** Called when the Stream is no longer needed. */\n default void destroy() {}\n\n /** Returns the section type for this stream. */\n @StreamKind\n int getStreamKind();\n\n /**\n * @param scrollState Previous saved scroll state to restore to.\n */\n void restoreSavedInstanceState(FeedScrollState scrollState);\n\n /**\n * Notifies that the header count has changed. Headers are views added to the Recyclerview\n * that the stream should not delete.\n *\n * @param newHeaderCount The new number of headers.\n */\n void notifyNewHeaderCount(int newHeaderCount);\n\n /**\n * @param listener A {@link ContentChangedListener} which activates when the content changes\n * while the stream is bound.\n */\n void addOnContentChangedListener(ContentChangedListener listener);\n\n /**\n * @param listener A previously added {@link ContentChangedListener} to be removed. Will no\n * longer trigger after removal.\n */\n void removeOnContentChangedListener(ContentChangedListener listener);\n\n /**\n * Allow the container to trigger a refresh of the stream.\n *\n * <p>Note: this will assume {@link RequestReason.MANUAL_REFRESH}.\n */\n void triggerRefresh(Callback<Boolean> callback);\n\n /**\n * @return Whether the placeholder is shown.\n */\n boolean isPlaceholderShown();\n\n /**\n * Called when the placeholder is shown and the first batch of articles are about to show.\n */\n void hidePlaceholder();\n\n /** Whether activity logging is enabled for this feed. */\n default boolean isActivityLoggingEnabled() {\n return false;\n }\n\n /** Whether the stream has unread content */\n default ObservableSupplier<Boolean> hasUnreadContent() {\n ObservableSupplierImpl<Boolean> result = new ObservableSupplierImpl<>();\n result.set(false);\n return result;\n }\n\n /** Returns the last content fetch time. */\n default long getLastFetchTimeMs() {\n return 0;\n }\n\n /**\n * Binds the feed to a particular view, manager, and scope.\n * When bound, the feed actively updates views and content. Assumes that whatever\n * views currently shown by manager are headers.\n * @param view The {@link RecyclerView} to which the feed is bound.\n * @param manager The {@link FeedListContentManager} to which we should make updates to.\n * @param savedInstanceState A previously saved instance state to restore to after loading\n * content.\n * @param surfaceScope The {@link FeedSurfaceScope} that is hosting the renderer.\n * @param renderer The {@link HybridListRenderer} that is rendering the feed.\n * @param reliabilityLogger Logger for feed reliability.\n * @param headerCount The number of headers in the RecyclerView that the feed shouldn't touch.\n */\n void bind(RecyclerView view, FeedListContentManager manager, FeedScrollState savedInstanceState,\n FeedSurfaceScope surfaceScope, HybridListRenderer renderer,\n @Nullable FeedReliabilityLogger reliabilityLogger, int headerCount);\n\n /**\n * Unbinds the feed. Stops this feed from updating the RecyclerView.\n *\n * @param shouldPlaceSpacer Whether this feed should place a spacer at the end to\n * prevent abrupt scroll jumps.\n * @param switchingStream Whether another feed is going to be bound right after this.\n */\n void unbind(boolean shouldPlaceSpacer, boolean switchingStream);\n\n /**\n * Whether this stream supports alternate sort options.\n */\n default boolean supportsOptions() {\n return false;\n }\n\n /**\n * Returns a value that uniquely identifies the state of the Stream's content. If this value\n * changes, then scroll state won't be restored.\n */\n String getContentState();\n\n /**\n * Interface users can implement to know when content in the Stream has changed content on\n * screen.\n */\n interface ContentChangedListener {\n /**\n * Called by Stream when content being shown has changed. This could be new cards being\n * created, the content of a card changing, etc...\n * @param feedContents the list of feed contents after the change. Null if the contents are\n * not available.\n */\n void onContentChanged(@Nullable List<FeedContent> feedContents);\n }\n}", "private void requestLiveStreaming() throws IOException {\n\n String targetCamCode = dis.readUTF();\n\n Cam targetCam = CamRegister.findRegisteredCam(targetCamCode);\n\n try {\n DataOutputStream targetDos = new DataOutputStream(targetCam.getCamSocket().getOutputStream());\n\n targetDos.writeInt(LIVE_STREAMING_COMMAND);\n targetDos.writeUTF(camClient.getCamCode());\n targetDos.flush();\n\n dos.writeInt(SUCCESS_CODE);\n dos.flush();\n\n } catch (Exception e) {\n e.printStackTrace();\n dos.writeInt(NOT_FOUND_CODE);\n dos.flush();\n }\n }", "@Override\n public StreamObserver<LongGreetRequest> longGreet(StreamObserver<LongGreetResponse> responseObserver) {\n\n //This will tell how i am going to handle the stream of client request\n StreamObserver<LongGreetRequest> requestStreamObserver = new StreamObserver<LongGreetRequest>() {\n\n String result = \"\";\n\n //This is to handle each stream of request msg\n @Override\n public void onNext(LongGreetRequest value) {\n //Going to concatenate each request value\n System.out.println(\"Received message from client as \"+value.getGreeting().getFirstName());\n result += \"Hello \" + value.getGreeting().getFirstName() + \"! \";\n }\n\n //This is to handle if client sends error\n @Override\n public void onError(Throwable t) {\n\n }\n\n //This is to handle when client is done, what should i do\n @Override\n public void onCompleted() {\n System.out.println(\"Sending final response as client is done\");\n //as client done, setting the result to response observer object\n responseObserver.onNext(LongGreetResponse.newBuilder().setResult(result).build());\n //complete the response\n responseObserver.onCompleted();\n }\n };\n\n return requestStreamObserver;\n }", "public synchronized void requestStream(Query q) {\n // if this user has already registered a query\n if (!streams.containsKey(q)) {\n Closeable stream = factory.getStream(q);\n streams.put(q, stream);\n counts.put(q, 0);\n }\n counts.put(q, counts.get(q) + 1);\n if (sheduledRemovals.containsKey(q)) {\n sheduledRemovals.remove(q);\n }\n }", "static PipelineResult runIngestionPipeline(IngestionPipelineOptions options) {\n Pipeline pipeline = Pipeline.create(options);\n long startTime =\n IngestionPipelineOptions.calculatePipelineStart(\n options.getStartTime(), options.getDuration(), 1, Clock.systemUTC());\n PCollection<DataShare> dataShares =\n pipeline\n .apply(new FirestoreReader(startTime))\n // Ensure distinctness of data shares based on document path\n .apply(\n Distinct.<Document, String>withRepresentativeValueFn(\n // Not using a lambda here as Beam has trouble inferring a coder\n new SerializableFunction<Document, String>() {\n @Override\n public String apply(Document document) {\n return document.getName();\n }\n }))\n .apply(ParDo.of(new ConstructDataSharesFn()));\n processDataShares(dataShares).apply(\"SerializePacketHeaderSig\", ParDo.of(new BatchWriterFn()));\n return pipeline.run();\n }", "int getServerWorkIterations();", "void requestRateLimited();", "private void startAggTradesEventStreaming(String symbol) {\r\n\t\tBinanceApiClientFactory factory = BinanceApiClientFactory.newInstance();\r\n\t\tBinanceApiWebSocketClient client = factory.newWebSocketClient();\r\n\r\n\t\t/*\r\n\t\t * static void startAggTradeEventListener(BinanceApiClientFactory factory,\r\n\t\t * String symbol, ExchangeApiCallback<AggTradeEvent> callback) {\r\n\t\t * BinanceApiWebSocketClient client = factory.newWebSocketClient();\r\n\t\t * client.onAggTradeEvent(symbol, (AggTradeEvent event) -> { if (event == null)\r\n\t\t * { startAggTradeEventListener(factory, symbol, callback); } else {\r\n\t\t * callback.onResponse(event); } }); }\r\n\t\t */\r\n\r\n\t\tclient.onAggTradeEvent(symbol.toLowerCase(), response -> {\r\n\r\n\t\t\tif (response == null) {\r\n\t\t\t\tstartAggTradesEventStreaming(symbol);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tLong aggregatedTradeId = response.getAggregatedTradeId();\r\n\t\t\tAggTrade updateAggTrade = aggTradesCache.get(aggregatedTradeId);\r\n\t\t\tif (updateAggTrade == null) {\r\n\t\t\t\t// new agg trade\r\n\t\t\t\tupdateAggTrade = new AggTrade();\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * Duration tickDuration = Duration.ofSeconds(1); Long tickIndex = new\r\n\t\t\t * Long(this.aggTradeTicksCashe.size()); List<AggTrade> listAggTrade = null;\r\n\t\t\t * \r\n\t\t\t * if (aggTradeTicksCashe.isEmpty()) { listAggTrade = new\r\n\t\t\t * CopyOnWriteArrayList<AggTrade>(); aggTradeTicksCashe.put( tickIndex,\r\n\t\t\t * listAggTrade ); } else { listAggTrade =\r\n\t\t\t * this.aggTradeTicksCashe.get(tickIndex); }\r\n\t\t\t * \r\n\t\t\t * ZonedDateTime tradeTimestamp =\r\n\t\t\t * ZonedDateTime.ofInstant(Instant.ofEpochMilli(updateAggTrade.getTradeTime()),\r\n\t\t\t * ZoneId.systemDefault()); ZonedDateTime tickEndTime =\r\n\t\t\t * tradeTimestamp.plus(tickDuration);\r\n\t\t\t * \r\n\t\t\t * if (!tradeTimestamp.isBefore(tickEndTime)) { // new tick ++tickIndex;\r\n\t\t\t * listAggTrade = new CopyOnWriteArrayList<AggTrade>(); aggTradeTicksCashe.put(\r\n\t\t\t * tickIndex, listAggTrade ); } // Store the updated agg trade in the current\r\n\t\t\t * tick cache listAggTrade.add(updateAggTrade);\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * List<Tick> ticks = null; Long tickIndex = 0L; List<AggTrade> listAggTrade =\r\n\t\t\t * new CopyOnWriteArrayList<AggTrade>(); this.aggTradeTicksCashe = new\r\n\t\t\t * HashMap<Long, List<AggTrade>>();\r\n\t\t\t */\r\n\r\n\t\t\tupdateAggTrade.setTradeTime(response.getEventTime());\r\n\t\t\tupdateAggTrade.setAggregatedTradeId(aggregatedTradeId);\r\n\t\t\tupdateAggTrade.setPrice(response.getPrice());\r\n\t\t\tupdateAggTrade.setQuantity(response.getQuantity());\r\n\t\t\tupdateAggTrade.setFirstBreakdownTradeId(response.getFirstBreakdownTradeId());\r\n\t\t\tupdateAggTrade.setLastBreakdownTradeId(response.getLastBreakdownTradeId());\r\n\t\t\tupdateAggTrade.setBuyerMaker(response.isBuyerMaker());\r\n\r\n\t\t\t// Store the updated agg trade in the cache\r\n\t\t\taggTradesCache.put(aggregatedTradeId, updateAggTrade);\r\n\r\n\t\t\t/*\r\n\t\t\t * Build ticks and Series\r\n\t\t\t */\r\n\r\n\t\t\tLong trendAnalysisTimeFrame = 5L; // perform a trend analysis using last 5 seconds time frame\r\n\r\n\t\t\tZonedDateTime tickEndTime = ZonedDateTime.ofInstant(Instant.ofEpochMilli(response.getEventTime()), // lastTradeEventTime\r\n\t\t\t\t\tZoneId.systemDefault());\r\n\t\t\tZonedDateTime tickStartTime = tickEndTime.minusSeconds(trendAnalysisTimeFrame);\r\n\t\t\t/*\r\n\t\t\t * ZonedDateTime tickStartTime = ZonedDateTime.now(ZoneId.systemDefault());\r\n\t\t\t * ZonedDateTime tickEndTime = tickStartTime; Iterator<Long>\r\n\t\t\t * aggTradesCacheIterator = aggTradesCache.keySet().iterator(); while\r\n\t\t\t * (aggTradesCacheIterator.hasNext()) { AggTrade aggTrade =\r\n\t\t\t * aggTradesCache.get(aggTradesCacheIterator.next()); ZonedDateTime\r\n\t\t\t * tradeTimestamp =\r\n\t\t\t * ZonedDateTime.ofInstant(Instant.ofEpochMilli(aggTrade.getTradeTime()),ZoneId.\r\n\t\t\t * systemDefault()); if ( tradeTimestamp.isBefore(tickStartTime)) tickStartTime\r\n\t\t\t * = tradeTimestamp; if ( tradeTimestamp.isAfter(tickEndTime)) tickEndTime =\r\n\t\t\t * tradeTimestamp; }\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * // Building the empty ticks List<Tick> ticks = buildEmptyTicks(tickStartTime,\r\n\t\t\t * tickEndTime);\r\n\t\t\t * \r\n\t\t\t * Iterator<Long> aggTradesCacheIterator = aggTradesCache.keySet().iterator();\r\n\t\t\t * while (aggTradesCacheIterator.hasNext()) { AggTrade aggTrade =\r\n\t\t\t * aggTradesCache.get(aggTradesCacheIterator.next()); ZonedDateTime tradeTime =\r\n\t\t\t * ZonedDateTime.ofInstant(Instant.ofEpochMilli(aggTrade.getTradeTime()),\r\n\t\t\t * ZoneId.systemDefault());\r\n\t\t\t * \r\n\t\t\t * if ( tradeTime.isAfter(tickStartTime) && tradeTime.isBefore(tickEndTime)) {\r\n\t\t\t * // Filling the ticks with trades for (Tick tick : ticks) { if\r\n\t\t\t * (tick.inPeriod(tradeTime)) { Double price = new Double(aggTrade.getPrice());\r\n\t\t\t * Double quantity = new Double(aggTrade.getQuantity()); Double amount = price *\r\n\t\t\t * quantity; tick.addTrade( amount, price); } } } } // Removing still empty\r\n\t\t\t * ticks removeEmptyTicks(ticks);\r\n\t\t\t * \r\n\t\t\t * // Build time series TimeSeries series = new BaseTimeSeries(symbol, ticks);\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * if( realTimeChart != null ) { List<Integer> xData = new\r\n\t\t\t * CopyOnWriteArrayList<Integer>(); List<Double> yData = new\r\n\t\t\t * CopyOnWriteArrayList<Double>(); List<Double> errorBars = new\r\n\t\t\t * CopyOnWriteArrayList<Double>();\r\n\t\t\t * \r\n\t\t\t * for( int x: realTimeChart.getxData() ) { xData.add(x); } for( double y:\r\n\t\t\t * realTimeChart.getyData() ) { yData.add(y); } for( double e:\r\n\t\t\t * realTimeChart.getErrorBars() ) { errorBars.add(e); }\r\n\t\t\t * //xData.add(xData.size()+1); xData.add(50); xData.remove(0); yData.add(new\r\n\t\t\t * Double(response.getPrice())); yData.remove(0); //errorBars.add(0.0);\r\n\t\t\t * //errorBars.remove(0);\r\n\t\t\t * \r\n\t\t\t * realTimeChart.updateData(xData, yData, errorBars); }\r\n\t\t\t */\r\n\r\n\t\t\t/*\r\n\t\t\t * Log AggTrade into database\r\n\t\t\t */\r\n\t\t\tstoreAggTradeCache(symbol, updateAggTrade);\r\n\t\t\t// System.out.println(updateAggTrade);\r\n\t\t});\r\n\t}", "public interface StreamListener {\n\n default void onNextEntry(CorfuStreamEntries results) {\n onNext(results);\n }\n\n /**\n * A corfu update can/may have multiple updates belonging to different streams.\n * This callback will return those updates as a list grouped by their Stream UUIDs.\n *\n * Note: there is no order guarantee within the transaction boundaries.\n *\n * @param results is a map of stream UUID -> list of entries of this stream.\n */\n void onNext(CorfuStreamEntries results);\n\n /**\n * Callback to indicate that an error or exception has occurred while streaming or that the stream is\n * shutting down. Some exceptions can be handled by restarting the stream (TrimmedException) while\n * some errors (SystemUnavailableError) are unrecoverable.\n * @param throwable\n */\n void onError(Throwable throwable);\n}", "@Test\n public void testGetStreams_2_1_20()\n throws OpenDataException, IOException, ReaperException, ClassNotFoundException, InterruptedException {\n CompositeData streamSession = makeCompositeData_2_1_20();\n\n // compare the test payload with an actual payload grabbed from a 2.1.20 ccm node\n URL url = Resources.getResource(\"repair-samples/stream-report-2-1-20.txt\");\n String ref = Resources.toString(url, Charsets.UTF_8);\n assertEquals(ref.replaceAll(\"\\\\s\", \"\"), streamSession.toString().replaceAll(\"\\\\s\", \"\"));\n\n // init the stream manager\n ICassandraManagementProxy proxy = (ICassandraManagementProxy) mock(\n Class.forName(\"io.cassandrareaper.management.jmx.JmxCassandraManagementProxy\"));\n\n AppContext cxt = new AppContext();\n cxt.config = TestRepairConfiguration.defaultConfig();\n cxt.managementConnectionFactory = mock(JmxManagementConnectionFactory.class);\n when(cxt.managementConnectionFactory.connectAny(Mockito.anyList())).thenReturn(proxy);\n HostConnectionCounters connectionCounters = mock(HostConnectionCounters.class);\n when(cxt.managementConnectionFactory.getHostConnectionCounters()).thenReturn(connectionCounters);\n when(connectionCounters.getSuccessfulConnections(any())).thenReturn(1);\n ClusterFacade clusterFacadeSpy = Mockito.spy(ClusterFacade.create(cxt));\n Mockito.doReturn(\"dc1\").when(clusterFacadeSpy).getDatacenter(any(), any());\n when(proxy.getCurrentStreams()).thenReturn(ImmutableSet.of(streamSession));\n\n // do the actual pullStreams() call, which should succeed\n List<StreamSession> result = StreamService\n .create(() -> clusterFacadeSpy)\n .listStreams(Node.builder().withHostname(\"127.0.0.1\").withCluster(Cluster.builder().withJmxPort(7199)\n .withSeedHosts(ImmutableSet.of(\"127.0.0.1\")).withName(\"test\").build()).build());\n\n verify(proxy, times(1)).getCurrentStreams();\n assertEquals(1, result.size());\n }", "@Test\n public void testServerTask(){\n for(Double current : sampleLatLngs.keySet()) {\n tmp = current;\n try {\n runTestOnUiThread(new Runnable() {\n @Override\n public void run() {\n try {\n byte[] returnedMessage = new ServerTask().execute(URL, String.valueOf(tmp), String.valueOf(sampleLatLngs.get(tmp)), \"N/A\", \"N/A\", \"N/A\").get();\n ByteArrayInputStream in = new ByteArrayInputStream(returnedMessage);\n ObjectInputStream is = new ObjectInputStream(in);\n Message convertedMessage = (Message) is.readObject();\n ensureMessageArraySizes(convertedMessage);\n } catch (Exception e) {\n assertFalse(\"Reached an exception: \" + e.getMessage(), true);\n }\n }\n });\n } catch (Throwable throwable) {\n assertFalse(\"Reached an exception: \" + throwable.getMessage(), true);\n }\n }\n }", "void uploadStarted(StreamingStartEvent event);", "private void downloadRange() throws IOException{\n HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(urlString).openConnection();\n httpURLConnection.setConnectTimeout(CONNECT_TIMEOUT);\n httpURLConnection.setReadTimeout(READ_TIMEOUT);\n httpURLConnection.setRequestProperty(\"Range\", \"bytes=\" + range.getStart() + \"-\" + range.getEnd());\n int responseCode = httpURLConnection.getResponseCode();\n InputStream inputStream = null;\n for (int i = 1 ; i <= MAX_RETRIES ; i++) {\n try {\n inputStream = httpURLConnection.getInputStream();\n break;\n }catch (SocketTimeoutException e){\n if (i == MAX_RETRIES){\n //TODO find how to stop all threads\n System.err.println(\"got timeout exception. shutting down...\");\n System.exit(1);\n }\n }\n }\n System.out.println(\"DEBUG: Range: start:\" + range.getStart() + \" end: \" + range.getEnd() + \" Response code: \" + responseCode);\n// httpURLConnection.setRequestMethod(\"GET\");\n int lastChunkSize = range.getLength().intValue() % CHUNK_SIZE;\n int i = 0;\n long rangeLength = range.getLength();\n int chunkSize = CHUNK_SIZE;\n long rangesum = range.getStart();\n int part = (int) Math.ceil(rangeLength / (double) CHUNK_SIZE); //calculate how many times we need to iterate to read X chunks in the given range\n //inputStream.skip(range.getStart());\n int getSize = chunkSize;\n while(true) {\n try {\n byte[] byteChunk = new byte[CHUNK_SIZE];\n //jump to the right place in the range to read the next chunk\n //check whether are there enough tokens to read the chunk\n if (limitDownload) {\n tokenBucket.take(CHUNK_SIZE);\n }\n //case: last chunk is smaller than chunk_size\n// if (lastChunkSize != 0 && i == (part - 1)) {\n// chunkSize = lastChunkSize;\n// }\n if (fileSize == range.getStart() + (CHUNK_SIZE * i) + (rangeLength % CHUNK_SIZE)) {\n chunkSize = (int) rangeLength % CHUNK_SIZE;\n byteChunk = new byte[chunkSize];\n }\n //reDo the read operation if the operation reads less than the bytes it should read\n int output = inputStream.read(byteChunk, 0, chunkSize);\n if (range.getEnd() < rangesum) {\n break;\n } else if (output == -1) {\n break;\n } else if (output != chunkSize) {\n int output1 = inputStream.read(byteChunk, output, chunkSize - output);\n if (output1 != chunkSize - output) {\n inputStream.read(byteChunk, output, chunkSize - output - output1);\n }\n }\n outQueue.add(new Chunk(byteChunk, range.getStart() + (CHUNK_SIZE * i), chunkSize));\n i++;\n rangesum += 4096;\n } catch (SocketTimeoutException e){\n System.err.println(\"got timeout exception. shutting down...\");\n System.exit(1);\n }\n }\n\n System.out.println(\"finished download\");\n }", "@Override\n\t public void run() {\n\t\t int counter = 0; //搞500条\n\t String Result=\"\";\n\t JSONObject resObj = new JSONObject();\n\t\t while(true){ //模拟实际情况,不断循环,异步过程,不可能是同步过程\n\t\t\t counter++;\n\t\t\t\n\t\t\t System.out.println(\"product:\"+counter +\"--num:\" + counter++);\n//\t\t\t logger.info(\"product:\"+userLog);\n//\t\t\t producer.send(new KeyedMessage<Integer, String>(topic, userLog));//send是核心代码\n\n\t\t\t HttpClient httpClient = new HttpClient();\n\t\t\t\n\t\t\t\t\thttpClient.getParams().setSoTimeout(100);\n\t\t\t\t\thttpClient.getParams().setConnectionManagerTimeout(100);\n\t\t\t\t\thttpClient.getHttpConnectionManager().getParams().setSoTimeout(100);\n\t\t\t\t\t\n\t\t GetMethod getMethod = new GetMethod(\"http://120.92.3.242:8086/platform/api/server/gmservers\"); \t\n//\t\t\t GetMethod getMethod = new GetMethod(\"http://192.168.0.124:8080/platform/api/server/gmservers\"); \t\n//\t\t\t\tPostMethod postMethod = new PostMethod(\"http://192.168.0.124:8080/platform/api/server/gmservers\");\n//\t\t\t\tHttpMethodParams param = postMethod.getParams();\n//\t\t\t\tparam.setContentCharset(\"UTF-8\");\n\t\t\t\t//另外设置http client的重试次数,默认是3次;当前是禁用掉(如果项目量不到,这个默认即可)\n//\t\t\t\tparam.setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(0, false));\n//\t\t\t\tint statuscode = httpClient.executeMethod(postMethod);\n//\t\t\t\tResult = postMethod.getResponseBodyAsString();\n\t\t\t try {\n\t\t\t \t//执行getMethod\n\t\t\t \tLong startTime = System.currentTimeMillis();\n\t\t\t \tint statusCode = httpClient.executeMethod(getMethod);\n\t\t\t \tLong endTime = System.currentTimeMillis();\n\t\t\t\t\tLong executeTime = endTime - startTime;\n\t\t\t \tSystem.out.println(statusCode);\n\t\t\t \tlogger_kafka.info(\"----\"+statusCode +\"执行时间--\"+executeTime);\n\t\t\t \tif (statusCode != HttpStatus. SC_OK) {\n\t\t\t \tSystem.err.println(\"Method failed: \"\n\t\t\t \t+ getMethod.getStatusLine());\n\t\t\t \t\n\t\t\t \t}\n\t\t\t \t//读取内容\n\t\t\t \tbyte[] responseBody = getMethod.getResponseBody();\n\t\t\t \t//处理内容\n\t\t\t \tSystem.out.println (new String(responseBody));\n\t\t\t \tlogger_kafka.info(\"结果----\"+new String(responseBody));\n\t\t\t \t} catch (HttpException e) {\n\t\t\t \t//发生致命的异常,可能是协议不对或者返回的内容有问题\n\t\t\t \tSystem.out.println(\"Please check your provided http address!\");\n\t\t\t \te.printStackTrace();\n\t\t\t \t} catch (IOException e) {\n\t\t\t \t//发生网络异常\n\t\t\t \te.printStackTrace();\n\t\t\t \t} finally {\n\t\t\t \t//释放连接\n\t\t\t \tgetMethod.releaseConnection();\n\t\t\t \t}\n\t\t\t \n\t\t\t if(0 == counter%500){\n\t\t\t\t counter = 0;\n\t\t\t\t try {\n\t\t\t\t\t Thread.sleep(100000);\n\t\t\t\t } catch (InterruptedException e) {\n\t\t\t\t\t // TODO Auto-generated catch block\n\t\t\t\t\t e.printStackTrace();\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }", "@Override\n public void compute(Iterable<IMessage<LongWritable,Text>> messages) {\n\t\t{\n\t\t\t// LOAD QUERY AND INITIALIZE LUCENE\n\t\t\tint count=0;\n\t\t\tint localecount=0;\n\t\t\tif(getSuperstep() == 0){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tWriter vertexWriter = new BufferedWriter(new OutputStreamWriter(\n\t\t\t\t new FileOutputStream(\"/home/abhilash/SuccinctSubgraphFilesRerun/Sub\"+getSubgraph().getSubgraphId() + \"VertexData\" ), \"utf-8\"));\n\t\t\t\t\tWriter edgeWriter = new BufferedWriter(new OutputStreamWriter(\n\t\t\t\t new FileOutputStream(\"/home/abhilash/SuccinctSubgraphFilesRerun/Sub\"+getSubgraph().getSubgraphId() + \"edgeData\" ), \"utf-8\"));\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tfor(IVertex<MapValue, MapValue, LongWritable, LongWritable> v : getSubgraph().getLocalVertices()) {\n//\t\t\t\t\tcount++;\n//\t\t\t\t\tif(count==1000) {\n//\t\t\t\t\t\tbreak;\n//\t\t\t\t\t}\n\t\t\t\t\tvertexWriter.write(getSubgraph().getSubgraphId().toString()+\"#\" + v.getValue().get(\"patid\") + \"@\" + v.getValue().get(\"country\") + \"$\" + v.getValue().get(\"nclass\") + \"|\\n\" );\n\t\t\t\t\tvertexWriter.flush();\n\t\t\t\t\tlocalecount=0;\n//\t\t\t\t\tArrayList<Long> localSinkArray = new ArrayList<>();\n\t\t\t\t\tArrayList<Long> remoteSinkArray = new ArrayList<>();\n\t\t\t\t\tStringBuilder str = new StringBuilder();\n\t\t\t\t\tfor(IEdge<MapValue, LongWritable, LongWritable> e:v.getOutEdges()) {\n\t\t\t\t\t\t\n\t\t\t\n//\t\t\t\t\t\tSystem.out.println(\"STR:\" + str.toString());\n\t\t\t\t\t\tif(!getSubgraph().getVertexById(e.getSinkVertexId()).isRemote()) {\n\t\t\t\t\t\t\tif(localecount==0) {\n\t\t\t\t\t\t\t\tstr.append(e.getSinkVertexId().get());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tstr.append(\":\").append(e.getSinkVertexId().get());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlocalecount++;\n//\t\t\t\t\t\t\tlocalSinkArray.add(e.getSinkVertexId().get());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tremoteSinkArray.add(e.getSinkVertexId().get());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tStringBuilder remoteStr = new StringBuilder();\n\t\t\t\t\tint rcount=0;\n\t\t\t\t\tfor(long rsink:remoteSinkArray) {\n\t\t\t\t\t\tif(rcount==0) {\n\t\t\t\t\t\t\tremoteStr.append(rsink);\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tremoteStr.append(\":\").append(rsink);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trcount++;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(localecount==0) {\n\t\t\t\t\t\tedgeWriter.write(getSubgraph().getSubgraphId().toString()+\"#\" + v.getVertexId() + \"@\" + localecount + \"%\" + remoteStr.toString() + \"|\\n\" );\n\t\t\t\t\t}else {\n\t\t\t\t\t\tif(rcount==0) {\n\t\t\t\t\t\t\tedgeWriter.write(getSubgraph().getSubgraphId().toString()+\"#\" + v.getVertexId() + \"@\" + localecount + \"%\" + str.toString() + \"|\\n\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tedgeWriter.write(getSubgraph().getSubgraphId().toString()+\"#\" + v.getVertexId() + \"@\" + localecount + \"%\" +str.toString()+\":\"+ remoteStr.toString() + \"|\\n\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tedgeWriter.flush();\n\t\t\t\t}\n\t\t\t\tvertexWriter.close();\n\t\t\t\tedgeWriter.close();\n\t\t\t}catch(Exception e) {\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\n\n\t\t}\n\t\t\n\t\t\t\tvoteToHalt();\n\n \t\n \t\n }", "List<Transfer> requestDownloads(Leecher leecher);", "Observable<SubscribeRequest> getSubscribeRequestStream();", "@Override public void onStreamUpdate(final Set<Long> updatedChunks) {\n }", "public interface Http2Client extends Closeable {\n\n /**\n * connect to remote address asynchronously\n * @return CompletableFuture contains {@link Void}\n */\n CompletableFuture<Void> connect();\n\n /**\n * send http request to remote address asynchronously\n * @param request http2 request\n * @return CompletableFuture contains response\n */\n CompletableFuture<HttpResponse> sendRequest(HttpRequest request);\n\n /**\n * send http request to remote address asynchronously,\n * and not wait far response\n * @param request http2 request\n * @return CompletableFuture contains nothing\n */\n CompletableFuture<Void> sendRequestOneWay(HttpRequest request);\n\n /**\n * send server-push ack to remote address asynchronously\n * @param pushAck server-push ack\n * @param streamId http2 streamId\n * @return CompletableFuture contains nothing\n */\n CompletableFuture<Void> sendPushAck(HttpPushAck pushAck, int streamId);\n}", "public static void main(String[] args) {\n\t\tSparkConf sparkConf = JavaRDDSparkContextMain.sparkConf(\"Spark Streaming Cient\", \"local[*]\");\n\t JavaStreamingContext streamingContext = new JavaStreamingContext(sparkConf, new Duration(1000));\n\t\tSystem.out.println(\"-----streamingContext: \" + streamingContext);\n\t\t\n\t\t// need linux install nc command\n\t\t// CentOS: yum -y install nmap-ncat; nc -lk 9999 \n\t\t// input string streaming to Iterator<String>\n\t\tJavaReceiverInputDStream<String> streamingLine = streamingContext.socketTextStream(\"192.168.1.105\", 9999);\n\t\t\n\t\tJavaDStream<String> streamingWords = streamingLine.flatMap(input -> {\n\t\t\tString[] wordArray = input.split(\" \");\n\t\t\tList<String> wordList = Arrays.asList(wordArray);\n\t\t\treturn wordList.iterator();\n\t\t});\n\t\t\n\t\tSystem.out.println(\"-----print streamingWords: \");\n\t\tstreamingWords.print();\n\t\t\n\t\t// \n\t\tJavaPairDStream<String, Integer> wordTuple = streamingWords.mapToPair(word -> {\n\t\t\tTuple2<String, Integer> tuple2 = new Tuple2<String, Integer>(word, 1);\n\t\t\treturn tuple2;\n\t\t});\n\t\tSystem.out.println(\"-----wordTuple count: \" + wordTuple.count() + \", wordTuple: \" + wordTuple);\n\t\twordTuple.print();\n\t\t\n\t\t// work count \n\t\tJavaPairDStream<String, Integer> wordCount = wordTuple.reduceByKey((v1, v2) -> {\n\t\t\treturn v1 + v2;\n\t\t});\n\t\tSystem.out.println(\"-----wordCount count: \" + wordCount.count() + \", wordCount: \" + wordCount);\n\t\twordCount.print();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"-----streamingWords: \" + streamingWords.toString());\n\t\tstreamingContext.start();\n\t\t\n\t\t\n\t\ttry{\n\t\t\t// streamingContext.awaitTermination();\n\t\t\t\n\t\t\tThread.sleep(1000 * 30);\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tstreamingContext.stop();\n\t\tstreamingContext.close();\n\n\t}", "private static void streamServerService(ManagedChannel channel) {\n CalculatorServiceGrpc.CalculatorServiceBlockingStub calculatorClient = newBlockingStub(channel);\n\n //Create a Greet Request\n Calculator.PrimeNumberDecompositionRequest primedDecompositionRequest = Calculator.PrimeNumberDecompositionRequest\n .newBuilder()\n .setNumber(567890 )\n .build();\n\n //Call the RPC and get back a GreetResponse\n calculatorClient.primeNumberDecomposition(primedDecompositionRequest)\n .forEachRemaining(primeNumberDecompositionResponse -> {\n System.out.println(primeNumberDecompositionResponse.getPrimeFactor());\n });\n\n }", "@Test\n public void testSummingUpTwoAsyncStreamsOfIntegers() throws Exception {\n FunctionalReactives<Integer> fr1 =\n FunctionalReactives.createAsync(\n aSubscribableWillAsyncFireIntegerOneToFive() //one async stream of Integers\n );\n FunctionalReactives<Integer> fr2 =\n fr1.fromAnother(\n aSubscribableWillAsyncFireIntegerOneToFive() //another async stream of Integers\n );\n\n FunctionalReactives<Void> fr =\n fr1.zipStrict(fr2, new Function2<Integer, Integer, Integer>() {\n @Override\n public Optional<Integer> apply(Integer input1, Integer input2) {\n return Optional.of(input1 + input2);\n }\n })\n .forEach(println()); //print out reaction results each in a line\n\n fr.start(); //will trigger Subscribable.doSubscribe()\n fr.shutdown(); //will trigger Subscribable.unsubscribe() which in above case will await for all the integers scheduled\n\n //Reaction walk through:\n // Source1: 1 -> 2 -> 3 -> 4 -> 5 -> |\n // Source2: 1 -> 2 -> 3 -> 4 -> 5 -> |\n // Print sum of two sources: 2 -> 4 -> 6 -> 8 -> 10 ->|\n\n }", "public void postTasks(int numThreads) {\n final String URL = \"http://localhost:7070/rest/load\";\n System.out.println(\"Starting POST requests...\");\n long startTime = System.currentTimeMillis();\n\n // Testing for 10000 data\n // Test for entire dataset use : Records.size()\n System.out.println(\"Number of Records to be written: \" + Records.size());\n System.out.println(\"Number of Threads: \" + numThreads);\n\n Client client = ClientBuilder.newClient();\n WebTarget webTarget = client.target(URL);\n Stat stat = new Stat();\n final PostRecord postRecord = new PostRecord(webTarget, stat);\n\n ExecutorService pool = Executors.newFixedThreadPool(numThreads);\n\n List<Stat> listStat = new ArrayList<>();\n\n for (Record record : Records) {\n pool.submit(() -> listStat.add(postRecord.doPost(record)));\n\n }\n\n pool.shutdown();\n\n try {\n pool.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n // Stats\n long endTime = System.currentTimeMillis();\n System.out.println(\"Time Taken: \" + (endTime-startTime));\n statsOutput(startTime, endTime ,stat,numThreads, listStat);\n\n }", "public void example() {\n KStream<String, String> kStream = streamsBuilder().stream(\"TOPIC1\",\n Consumed.with(Serdes.String(), Serdes.String()));\n KGroupedStream<String, String> groupedStream = kStream.groupByKey();\n KTable<String, Long> totalCount = groupedStream.count();\n KTable<String, Long> windowedCount = groupedStream.count();\n groupedStream.count();\n }", "private void twitterStream(ServerAccess sa, String search, String geocode, \r\n int max) throws IOException {\r\n final TwitterStream twitterStream = \r\n new TwitterStreamFactory(getAuth()).getInstance();\r\n final Count count = new Count(max);\r\n \r\n final StatusListener listener = new StatusListener() {\r\n @Override\r\n public void onStatus(Status status) {\r\n count.increment();\r\n try {\r\n sa.addTweet(new TweetEntity(status, search));\r\n } catch (UnsupportedEncodingException ex) {\r\n }\r\n try {\r\n sa.addUser(new UserEntity(status.getUser()));\r\n } catch (UnsupportedEncodingException ex) {\r\n }\r\n \r\n if (Abort.getInstance().abort() || count.isMax()) {\r\n Abort.getInstance().setAbort(false);\r\n twitterStream.shutdown();\r\n }\r\n }\r\n\r\n @Override\r\n public void onDeletionNotice(StatusDeletionNotice statusDeletionNotice) {\r\n //System.out.println(\"Got a status deletion notice id:\" + statusDeletionNotice.getStatusId());\r\n }\r\n\r\n @Override\r\n public void onTrackLimitationNotice(int numberOfLimitedStatuses) {\r\n //System.out.println(\"Got track limitation notice:\" + numberOfLimitedStatuses);\r\n }\r\n\r\n @Override\r\n public void onScrubGeo(long userId, long upToStatusId) {\r\n //System.out.println(\"Got scrub_geo event userId:\" + userId + \" upToStatusId:\" + upToStatusId);\r\n }\r\n\r\n @Override\r\n public void onStallWarning(StallWarning warning) {\r\n //System.out.println(\"Got stall warning:\" + warning);\r\n }\r\n\r\n @Override\r\n public void onException(Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n };\r\n twitterStream.addListener(listener);\r\n FilterQuery filterquery = new FilterQuery();\r\n //filterquery.count(500);\r\n //String[] searchwords = {\"voetbal\", \"tennis\", \"basketbal\"};\r\n //filterquery.track(searchwords);\r\n final List<String> alts = relations.get(search);\r\n final String[] altsGeo = new String[alts.size()];\r\n for (int i = 0; i < alts.size(); i++) {\r\n altsGeo[i] = alts.get(i) + \" \" + geocode;\r\n }\r\n filterquery.track(altsGeo);\r\n twitterStream.filter(filterquery);\r\n twitterStream.sample();\r\n }" ]
[ "0.6139767", "0.5744872", "0.5633851", "0.56075585", "0.55311227", "0.55311227", "0.55311227", "0.55311227", "0.5504327", "0.5394378", "0.533977", "0.52958995", "0.52564853", "0.5240074", "0.5238983", "0.52011704", "0.51719725", "0.51602125", "0.50903714", "0.5080419", "0.50635564", "0.5060768", "0.4974004", "0.49727434", "0.4963827", "0.49549493", "0.4951074", "0.4947549", "0.49280828", "0.4908928", "0.48866993", "0.48804608", "0.48618057", "0.48350316", "0.48120683", "0.47899732", "0.4775735", "0.4765707", "0.47619927", "0.47556946", "0.47553357", "0.47455955", "0.47262353", "0.47259492", "0.47254094", "0.4722449", "0.4722437", "0.47144032", "0.47080874", "0.47013268", "0.46688038", "0.46650094", "0.466386", "0.46636796", "0.46582255", "0.4652585", "0.46478635", "0.46441433", "0.46381256", "0.46348622", "0.46343032", "0.4630861", "0.46194845", "0.4612274", "0.460675", "0.45903888", "0.4588355", "0.4583407", "0.45822075", "0.45759973", "0.45748597", "0.4571838", "0.4565839", "0.45630813", "0.45615506", "0.4560702", "0.45599008", "0.45560572", "0.45535824", "0.45484537", "0.45471993", "0.45461172", "0.45452946", "0.45442018", "0.4542921", "0.45324528", "0.45311272", "0.45227805", "0.45211542", "0.45113283", "0.4508393", "0.44996896", "0.44967455", "0.44937387", "0.4491187", "0.4490597", "0.4488987", "0.44872752", "0.44819927", "0.4474437" ]
0.6633838
0
TODO Autogenerated method stub
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Handles creation of MediaPlayer object and plays audio.
public void play() { this.mediaPlayer = new MediaPlayer(file); this.mediaPlayer.setVolume(volume); // Listener for end of media. mediaPlayer.setOnEndOfMedia(() -> { this.mediaPlayer.stop(); }); mediaPlayer.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void startPlaying() {\n try {\n mPlayer = new MediaPlayer();\n try {\n mPlayer.setDataSource(audioFile.getAbsolutePath());\n mPlayer.prepare();\n mPlayer.start();\n } catch (IOException e) {\n Log.e(LOG_TAG, \"prepare() failed\");\n }\n showTimer(false);\n } catch (Exception e) {\n logException(e, \"MicManualFragment_startPlaying()\");\n }\n\n }", "public void play(){\n Log.d(TAG, \"startAudio: called\");\n if(mMediaPlayer!=null){\n\n mMediaPlayer.start();\n mProgressBar.setProgress(mMediaPlayer.getCurrentPosition());\n mProgressBar.setMax(mMediaPlayer.getDuration());\n\n // updating progress bar\n seekHandler.postDelayed(updateSeekBar, 5);\n }\n }", "public void playMedia() {\n\t\tif (MainActivity.mPlayer == null) {\n\t\t\tMainActivity.mPlayer = new MediaPlayer();\n\t\t\tMainActivity.mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n\t\t\tMainActivity.currentSong = song;\n\t\t\tMainActivity.currentAlbum = album;\n\t\t}\n\t\tif (!MainActivity.currentSong.getTitleKey().equals(song.getTitleKey())) {\n\t\t\tMainActivity.currentSong = song;\n\t\t\tMainActivity.currentAlbum = album;\n\t\t\tMainActivity.mPlayer.reset();\n\t\t}\n\n\t\ttitle = song.getTitle();\n\t\talbumTitle = album.getAlbum();\n\t\talbumArt = album.getAlbumArt();\n\n\t\ttry {\n\t\t\tMainActivity.mPlayer.setDataSource(this, song.getUri());\n\t\t\tMainActivity.mPlayer.prepare();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (SecurityException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalStateException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\tLog.i(TAG, e.getMessage(), e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\tMainActivity.mPlayer.setOnPreparedListener(new OnPreparedListener() {\n\t\t\t@Override\n\t\t\tpublic void onPrepared(MediaPlayer mp) {\n\t\t\t\tmp.start();\n\t\t\t}\n\t\t});\n\t\tMainActivity.mPlayer.setOnCompletionListener(new OnCompletionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\t\t\t\tnext();\n\t\t\t}\n\n\t\t});\n\n\t\tnew Handler(getMainLooper()).post(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tupdateMainActivity();\n\t\t\t\tupdateNowPlaying();\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void onPrepared(MediaPlayer mp) {\n playMedia();\n }", "private void setupPlayer() {\n player = MediaPlayer.create(MediaPlayerActivity.this, R.raw.byte_music);\n updateState(MediaPlayerState.STATE_PREPARED);\n }", "@Override\n public void onPrepared(MediaPlayer mp) {\n Log.d(TAG, \"onPrepared: GOTTING CALLED\");\n playMedia();\n }", "@Override\r\n\tpublic void start() {\n\t\tmediaPlayer.start();\r\n\t}", "public void play() {\n\t\ttry {\n\t\t\tthis.mMediaPlayer.start();\n\t\t\tLog.w(\"AUDIO PLAYER\", \"just started playing\");\n\t\t} catch (IllegalStateException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.isPlaying = true;\n\t\tthis.incrementPlaybackTime();\n\t}", "private void play()\n {\n if(AudioDetector.getInstance().isNoAudio())\n {\n return;\n }\n\n stop();\n musicPlayer.play();\n }", "protected void startMediaPlayer() {\n\n Log.i(LOG_TAG, \"startMediaPlayer\");\n\n // If media player is pause or playing, just play\n if (mpState.equals(RadioPlayerService.MP_PAUSED)) {\n // Play!!!\n mediaPlayer.start();\n radioStation.setPlaying(true);\n playingTimeRunning = true;\n setMPState(RadioPlayerService.MP_PLAYING);\n sendStatus();\n\n //Retrieve meta data from server\n if (radioStation.getListenType().equals(\"0\") || radioStation.getListenType().equals(\"1\")) {\n refreshMetadata(radioStation.getListenUrl());\n }\n\n } else if (mpState.equals(RadioPlayerService.MP_PLAYING)) {\n //We are already playing, well do nothing\n\n } else if (mpState.equals(RadioPlayerService.MP_ERROR)) {\n\n //Media player should be reset\n\n } else {\n //Because prepareAsync() can take too long if radio station server isn't reachable, check for it\n setMPState(RadioPlayerService.MP_CONNECTING);\n mediaPlayer.prepareAsync();\n sendStatus();\n }\n\n }", "@Override\n\tpublic void onPrepared(MediaPlayer mp) {\n\t\tmp.start();\n\t}", "@Override\n public void onClick(View v) {\n if(mMediaPlayer==null){\n mMediaPlayer=new MediaPlayer();\n mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n try {\n mMediaPlayer.setDataSource(getPath());\n mMediaPlayer.prepare();\n mMediaPlayer.start();\n } catch (IllegalArgumentException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (SecurityException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IllegalStateException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n } else {\n mMediaPlayer.release();\n mMediaPlayer = null;\n }\n }", "public void playSound() {\n\t\tmediaPlayer.play();\n\t}", "public void play() {\n\t\tint requestStatus = mAudioManager.requestAudioFocus(\n\t\t\t\tmAudioFocusListener, AudioManager.STREAM_MUSIC,\n\t\t\t\tAudioManager.AUDIOFOCUS_GAIN);\n\n\t\tif (DEBUG)\n\t\t\tLog.d(TAG, \"Starting playback: audio focus request status = \"\n\t\t\t\t\t+ requestStatus);\n\n\t\tif (requestStatus != AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {\n\t\t\treturn;\n\t\t}\n\n\t\tmAudioManager.registerMediaButtonEventReceiver(new ComponentName(this\n\t\t\t\t.getPackageName(), MediaButtonIntentReceiver.class.getName()));\n\n\t\tif (mPlayer.isInitialized()) {\n\t\t\t// if we are at the end of the song, go to the next song first\n\t\t\tlong duration = mPlayer.duration();\n\t\t\tif (mRepeatMode != REPEAT_CURRENT && duration > 2000\n\t\t\t\t\t&& mPlayer.position() >= duration - 2000) {\n\t\t\t\tgotoNext(true);\n\t\t\t}\n\n\t\t\tmPlayer.start();\n\t\t\t// make sure we fade in, in case a previous fadein was stopped\n\t\t\t// because\n\t\t\t// of another focus loss\n\t\t\tmMediaplayerHandler.removeMessages(FADEDOWN);\n\t\t\tmMediaplayerHandler.sendEmptyMessage(FADEUP);\n\n\t\t\tif (!mIsSupposedToBePlaying) {\n\t\t\t\tmIsSupposedToBePlaying = true;\n\t\t\t\tnotifyChange(EVENT_PLAYSTATE_CHANGED);\n\t\t\t}\n\n\t\t\tupdateNotification();\n\t\t} else if (mPlayListLen <= 0) {\n\t\t\t// This is mostly so that if you press 'play' on a bluetooth headset\n\t\t\t// without every having played anything before, it will still play\n\t\t\t// something.\n\t\t\tshuffleAll();\n\t\t}\n\t}", "public void initMediaPlayer() {\n mMediaPlayer.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);\n mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n mMediaPlayer.setOnPreparedListener(this);\n mMediaPlayer.setOnCompletionListener(this);\n mMediaPlayer.setOnErrorListener(this);\n }", "private void play() {\n /** Memanggil File MP3 \"indonesiaraya.mp3\" */\n try {\n mp.prepare();\n } catch (IllegalStateException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n /** Menjalankan Audio */\n mp.start();\n\n /** Penanganan Ketika Suara Berakhir */\n mp.setOnCompletionListener(new OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n stateAwal();\n }\n });\n }", "public void onPrepared(MediaPlayer player) {\n player.start(); \n }", "@Override\r\n\tpublic void newMedia(MediaPlayer mediaPlayer)\r\n\t{\n\r\n\t}", "public interface MediaPlayer {\n void play(String audioType, String fileName);\n}", "private void to(){\n\tmediaPlayer = new android.media.MediaPlayer();\n\ttry{\n\t mediaPlayer.setDataSource(sdPath);\n\t mediaPlayer.prepare();\n\t mediaPlayer.start();\n\t Thread.sleep(1000);\n\t}\n\tcatch(Exception e){}\n }", "public void playMusic() {\n\t\tthis.music.start();\n\t}", "@Override\n public void onPrepared(MediaPlayer mediaPlayer) {\n\n }", "private void playSound() {\n if (isFlashOn) {\n mp = MediaPlayer.create(this, R.raw.light_switch_off);\n } else {\n mp = MediaPlayer.create(this, R.raw.light_switch_on);\n }\n mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n\n @Override\n public void onCompletion(MediaPlayer mp) {\n // TODO Auto-generated method stub\n mp.release();\n }\n });\n mp.start();\n }", "public void onPrepared(MediaPlayer player) {\n //player.start();\n }", "private void startPlaying() {\n if (null == curRecordingFileName)\n return;\n Log.e(TAG, \"Start playing file: \" + curRecordingFileName);\n mPlayer = new MediaPlayer();\n try {\n mPlayer.setDataSource(curRecordingFileName);\n mPlayer.prepare();\n mPlayer.start();\n } catch (IOException e) {\n Log.e(TAG, \"Couldn't prepare and start MediaPlayer\");\n }\n\n }", "private void start() {\n\t\t// 开启播放器\n\t\tmCurrentMediaPlayer.start();\n\t\tsetState(STARTED);\n\n\t\t// 开启计时心跳\n\t\tmHandler.postDelayed(mUpdateTimeTask, 500);\n\t\tif (mPlayerEngineListener != null) {\n\t\t\tmPlayerEngineListener.onTrackStart();\n\t\t}\n\t\t// 开启频谱\n\t\t// mHandler.postDelayed(mSetFxAndUI, 500);\n\t\t// setupVisualizerFxAndUI();\n\n\t\tLog.i(this.getClass().getSimpleName(), \" music player : started...\");\n\t}", "public interface MediaPlayer {\n public void play(String audioType, String fileName);\n}", "public interface MediaPlayer {\n public void play(String audioType, String fileName);\n}", "@Override\r\n\tpublic void play(String audioType, String fileName) {\n\t\tif(audioType.equals(\"mp3\")) {\r\n\t\t\tSystem.out.println(\"Playing mp3\");\r\n\t\t\t\r\n\t\t}else if(audioType.equals(\"mp4\") || audioType.equals(\"vlc\")) {\r\n\t\t\tmediaAdpater = new MediaAdapter(audioType);\r\n\t\t\tmediaAdpater.play(audioType, fileName);\r\n\t\t}\r\n\t\t\r\n\t}", "private void prepareMediaPlayer(int id) {\n if (mediaPlayer != null) {\n mediaPlayer.stop();\n mediaPlayer.release();\n }\n mediaPlayer = MediaPlayer.create(this, id);\n mediaPlayer.start();\n if (true)\n return;\n mediaPlayer = new MediaPlayer();\n\n AssetFileDescriptor fileDescriptor = getResources().openRawResourceFd(id);\n try {\n mediaPlayer.stop();\n mediaPlayer.setDataSource(fileDescriptor.getFileDescriptor(),\n fileDescriptor.getStartOffset(), fileDescriptor.getLength());\n fileDescriptor.close();\n mediaPlayer.prepare();\n mediaPlayer.start();\n } catch (Exception e) {\n Log.e(\"Main\", \"On Error: \" + e.getMessage());\n }\n }", "@Override\n protected Void doInBackground(String... params) {\n mediaPlayer = new MediaPlayer();\n mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n try {\n mediaPlayer.setDataSource(url_music);\n // Log.e(\"songs url\", url_music);\n\n } catch (IllegalArgumentException e) {\n // Toast.makeText(getActivity(), \"You might not set the URI correctly!\", Toast.LENGTH_LONG).show();\n } catch (SecurityException e) {\n // Toast.makeText(getActivity(), \"You might not set the URI correctly!\", Toast.LENGTH_LONG).show();\n } catch (IllegalStateException e) {\n // Toast.makeText(getActivity(), \"You might not set the URI correctly!\", Toast.LENGTH_LONG).show();\n } catch (IOException e) {\n //e.printStackTrace();\n }\n try {\n mediaPlayer.prepare();\n } catch (IllegalStateException e) {\n //Toast.makeText(mContext, \"You might not set the URI correctly!\", Toast.LENGTH_SHORT).show();\n //cc.showToast(\"You might not set the URI correctly!\");\n } catch (IOException e) {\n // Toast.makeText(mContext, \"You might not set the URI correctly!\", Toast.LENGTH_SHORT).show();\n //cc.showToast(\"You might not set the URI correctly!\");\n }\n\n return null;\n }", "public void play() {\n\n\t\tString[] args = new String[] { recordingsPath };\n\t\tGst.init(\"AudioPlayer\", args);\n\n\t\tplaybin = new PlayBin2(\"AudioPlayer\");\n\t\tplaybin.setVideoSink(ElementFactory.make(\"fakesink\", \"videosink\"));\n\t\tplaybin.setInputFile(new File(gui.getSelectedPlayItem()));\n\n\t\tplaybin.play();\n\n\t}", "private void setUpSound() {\n\t\tAssetManager am = getActivity().getAssets();\n\t\t// activity only stuff\n\t\tgetActivity().setVolumeControlStream(AudioManager.STREAM_MUSIC);\n\n\t\tAudioManager audioManager = (AudioManager) getActivity().getSystemService(Context.AUDIO_SERVICE);\n\t\tsp = new SPPlayer(am, audioManager);\n\t}", "public void start() {\n setPlayerState(State.STARTED);\n mMediaPlayer.start();\n notifyPlaying();\n }", "private void handlePlayRequest() {\n LogHelper.d(TAG, \"handlePlayRequest: mState=\" + mPlayback.getState());\n\n mDelayedStopHandler.removeCallbacksAndMessages(null);\n if (!mServiceStarted) {\n LogHelper.v(TAG, \"Starting service\");\n // The MusicService needs to keep running even after the calling MediaBrowser\n // is disconnected. Call startService(Intent) and then stopSelf(..) when we no longer\n // need to play media.\n startService(new Intent(getApplicationContext(), MusicService.class));\n mServiceStarted = true;\n }\n\n if (!mMediaSession.isActive()) {\n mMediaSession.setActive(true);\n }\n\n if (QueueHelper.isIndexPlayable(mCurrentIndexOnQueue, mPlayingQueue)) {\n updateMetadata();\n mPlayback.play(mPlayingQueue.get(mCurrentIndexOnQueue));\n }\n }", "public void run()\n\t{\t\t\t\t\n\t\tif (player!=null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tplayer.play();\t\t\t\t\n\t\t\t}\n\t\t\tcatch (JavaLayerException ex)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"Problem playing audio: \"+ex);\n\t\t\t}\t\t\t\n\t\t}\n\t}", "public void play() {\n\t\tif(currentPlayingItem==null) return;\n\t\tif(!mediaPlayer.isPlaying()) mediaPlayer.start();\n\t\tupdateNotification();\n\t\tsendBroadcast(new Intent(\"com.andreadec.musicplayer.playpausechanged\"));\n\t}", "public void preparePlayer() {\n player.start();\n state = PlaybackStateCompat.STATE_PLAYING;\n Intent onPreparedIntent = new Intent(\"MEDIA_PLAYER_PREPARED\");\n LocalBroadcastManager.getInstance(this).sendBroadcast(onPreparedIntent);\n // set AUTO so when the song ends - it will start the next song automatically\n action = AUTO;\n }", "public void playSelectSong() {\n isStart = false;\n if (getCurrentSong() == 0) {\n audioList.get(getCurrentSong()).setSelect(true);\n playListAdapter.notifyItemChanged(getCurrentSong());\n }\n isPauseResume = false;\n if (player != null) {\n player.stopMedia();\n }\n if (!isDestroyed()) {\n playAudio(audioList.get(getCurrentSong()).getData());\n }\n /*new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n if (!isDestroyed()) {\n playAudio(audioList.get(getCurrentSong()).getData());\n }\n }\n }, DELAY_TIME);*/\n }", "public void playback() {\n\t\ttry {\n\t\t\tplaySound.load(audioFileName, currFrame);\n\t\t} catch (UnsupportedAudioFileException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (LineUnavailableException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tfastForward = false;\n\t\tsoundThread = null;\n\t\tsoundThread = new Thread(new sound());\n\t\tsoundThread.start();\n\t\tvideoThread = null;\n\t\tvideoThread = new Thread(new video());\n\t\tvideoThread.start();\n\t}", "private void playSound() {\n\t\tif (controllerVars.isLoaded() && !controllerVars.isPlays()) {\n\t\t\tcontrollerVars.getSoundPool().play(controllerVars.getSoundID(), controllerVars.getVolume(), controllerVars.getVolume(), 1, 0, 1f);\n\t\t\tcontrollerVars.COUNTER++;\n\t\t\t//Toast.makeText(act, \"Played sound\", Toast.LENGTH_SHORT).show();optional Playing message \n\t\t\tcontrollerVars.setPlays(true);\n\t\t\tonComplete(controllerVars.getMediaPlayer().getDuration());\n\t\t}\n\t\t//controllerVars.getMediaPlayer().start();\n\t\t//controllerVars.setPlays(true);\n\t}", "public void playAudio() {\n\n }", "public void onPrepared(MediaPlayer mp) {\n\t\t\t\tmp.start();\n\t\t\t}", "public void initializePlayer() {\n radioPlayer = new MediaPlayer();\n\n isPaused = true;\n\n radioPlayer.setWakeMode(owner.getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);\n radioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n radioPlayer.setOnErrorListener(this);\n radioPlayer.setOnCompletionListener(this);\n radioPlayer.setOnInfoListener(this);\n }", "protected void playTheSound(int position) {\n if (mp != null) {\n mp.reset();\n mp.release();\n }\n mp = MediaPlayer.create(this, sons[position]);\n mp.start();\n }", "void startMusic(AudioTrack newSong);", "public abstract String playMedia ();", "private void clickSound() {// this function Plays a sound when a button is clicked.\n\t\tif (mp != null) {\n\t\t\tmp.release();\n\t\t}\n\t\tmp = MediaPlayer.create(getApplicationContext(), R.raw.music2);\n\t\tmp.start();// media player is started\n\t}", "public Sound(Context context) {\r\n\t\tthis.mp = MediaPlayer.create(context, R.raw.baby);\r\n\t\r\n\t}", "private void playSound(@NonNull final String path, @Nullable AssetFileDescriptor assetFileDescriptor) {\n\t\tif (mMode == PLAY_SINGLE) {\n\t\t\tstopAll();\n\t\t}\n\n\t\t// sound already playing\n\t\tif (mMediaMap.containsKey(path)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// stop all currently playing sounds\n\t\tif (mMode == PLAY_SINGLE_CONTINUE) {\n\t\t\tstopAll();\n\t\t}\n\n\t\t// init media player\n\t\tMediaPlayer mediaPlayer;\n\t\ttry {\n\t\t\tmediaPlayer = new MediaPlayer();\n\t\t\tmMediaMap.put(path, mediaPlayer);\n\n\t\t\t// data source\n\t\t\tif (assetFileDescriptor != null) {\n\t\t\t\tmediaPlayer.setDataSource(assetFileDescriptor.getFileDescriptor(), assetFileDescriptor.getStartOffset(), assetFileDescriptor.getLength());\n\t\t\t} else {\n\t\t\t\tmediaPlayer.setDataSource(path);\n\t\t\t}\n\n\t\t\tmediaPlayer.prepareAsync();\n\t\t} catch (@NonNull IllegalArgumentException | IllegalStateException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n\t\t// play sound\n\t\tmediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {\n\t\t\t@Override\n\t\t\tpublic void onPrepared(@NonNull MediaPlayer mediaPlayer) {\n\t\t\t\tmediaPlayer.start();\n\t\t\t}\n\t\t});\n\n\t\t// release media player\n\t\tmediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n\t\t\t@Override\n\t\t\tpublic void onCompletion(@Nullable MediaPlayer mediaPlayer) {\n\t\t\t\tmMediaMap.remove(path);\n\t\t\t\tif (mediaPlayer != null) {\n\t\t\t\t\tmediaPlayer.release();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public void start() {\n \tif (mediaChangedListener != null) {\n \t\tmediaChangedListener.onStarted();\n \t}\n mMediaPlayer.start();\n }", "public void play() {\n\t\tmusic.play();\n\t\tsyncPosition();\n\t}", "@Override\n\tpublic void play(String audioType, String fileName) {\n\t\tif(audioType.equalsIgnoreCase(\"mp3\")) {\n\t\t\tSystem.out.println(\"Playing mp3 file name : \"+ fileName);\n\t\t}\n\t\telse if ((audioType.equalsIgnoreCase(\"vlc\")) ||(audioType.equalsIgnoreCase(\"mp4\"))) {\n\t\t\tmediaAdapter = new MediaAdapter(audioType);\n\t\t\tmediaAdapter.play(audioType, fileName);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Invalid media type : \" + audioType + \" not supported.\");\n\t\t}\n\t}", "public void start() {\n ToneControl control = null;\n try {\n myPlayer = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);\n // do the preliminary set-up:\n myPlayer.realize();\n // set a listener to listen for the end of the tune:\n myPlayer.addPlayerListener(this);\n // get the ToneControl object in order to set the tune data:\n control = (ToneControl) myPlayer.getControl(\"ToneControl\");\n control.setSequence(myTune);\n // set the volume to the highest possible volume:\n VolumeControl vc = (VolumeControl) myPlayer\n .getControl(\"VolumeControl\");\n vc.setLevel(100);\n } catch (Exception e) {\n // the music isn't necessary, so we ignore exceptions.\n }\n }", "public void createNewPlayer(ArrayList<MediaItem> itemList) {\n // eliminate the old player\n if (this.player != null) {\n this.player.dispose();\n }\n // Check the Playlist\n if (this.playlist == null) {\n // Generate a new playlist\n this.playlist = new Playlist(itemList, this.eventBus);\n }\n\n // Establish a player for the first song and play it.\n this.player = new MediaPlayer(this.playlist.getCurrentMedia());\n initPlay(); // recursive method\n }", "private void initMediaPlayer(MediaPlayer mediaPlayer, int startTimeInDefaultTimeUnit, float volume) throws IOException {\n mediaPlayer.prepare();\n mediaPlayer.setVolume(0, 0);\n mediaPlayer.start();\n mediaPlayer.pause();\n mediaPlayer.seekTo(startTimeInDefaultTimeUnit);\n mediaPlayer.setVolume(volume, volume);\n }", "public void mp3(View view) {\n mp1 = MediaPlayer.create(this, R.raw.heyjude);\n mp1.setLooping(false);\n mp1.setVolume(100, 100);\n mp1.start();\n }", "public void play() {\n if (audio != null) {\n audio.play(sfxVolume);\n }\n }", "private void startMusic() {\r\n final Format input1 = new AudioFormat(AudioFormat.MPEGLAYER3);\r\n final Format input2 = new AudioFormat(AudioFormat.MPEG);\r\n final Format output = new AudioFormat(AudioFormat.LINEAR);\r\n PlugInManager.addPlugIn(\r\n \"com.sun.media.codec.audio.mp3.JavaDecoder\",\r\n new Format[]{input1, input2},\r\n new Format[]{output},\r\n PlugInManager.CODEC\r\n );\r\n try {\r\n final File f = new File(\"support_files//tetris.mp3\");\r\n myPlayer = Manager.createPlayer(new MediaLocator(f.toURI().toURL()));\r\n } catch (final NoPlayerException | IOException e) {\r\n e.printStackTrace();\r\n }\r\n if (myPlayer != null) {\r\n myPlayer.start();\r\n }\r\n }", "public final void play() {\n\t\tinitialize();\n\t\tstartPlay();\n\t\tendPlay();\n\t}", "@Override\r\n\t\t\t\tpublic void onCompletion (MediaPlayer theMediaPlayer) \r\n\t\t\t\t{\n\t\t\t\t\t// 11/03/2017 ECU check if any looping is needed\r\n\t\t\t\t\t// -------------------------------------------------------------\r\n\t\t\t\t\tif (loopCounter <= 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// ---------------------------------------------------------\r\n\t\t\t\t\t\t// 11/03/2017 ECU everything done so just check on the global \r\n\t\t\t\t\t\t// media player\r\n\t\t\t\t\t\t// ---------------------------------------------------------\r\n\t\t\t\t\t\t// 10/03/2017 ECU check if the global media player needs to be\r\n\t\t\t\t\t\t// 'resumed'\r\n\t\t\t\t\t\t// 15/03/2019 ECU whether there is a 'paused' media or not\r\n\t\t\t\t\t\t// it is necessary to release the resources\r\n\t\t\t\t\t\t// used in this class\r\n\t\t\t\t\t\t// ---------------------------------------------------------\r\n\t\t\t\t\t\tif (mediaPlayerPaused)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// -----------------------------------------------------\r\n\t\t\t\t\t\t\t// 10/03/2017 ECU the global media player needs to be resumed\r\n\t\t\t\t\t\t\t// -----------------------------------------------------\r\n\t\t\t\t\t\t\tMusicPlayer.playOrPause (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\t// ---------------------------------------------------------\r\n\t\t\t\t\t\t// 04/09/2017 ECU make sure the resources are released\r\n\t\t\t\t\t\t// 05/09/2017 ECU changed to use the local method\r\n\t\t\t\t\t\t// 15/03/2019 ECU changed to always release resources\r\n\t\t\t\t\t\t// ---------------------------------------------------------\r\n\t\t\t\t\t\tstop ();\r\n\t\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// ---------------------------------------------------------\r\n\t\t\t\t\t\t// 11/03/2017 ECU check about loops\r\n\t\t\t\t\t\t// ---------------------------------------------------------\r\n\t\t\t\t\t\tmediaPlayer.seekTo (theLoopPosition);\r\n\t\t\t\t\t\tmediaPlayer.start ();\r\n\t\t\t\t\t\t// ---------------------------------------------------------\r\n\t\t\t\t\t\t// 11/03/2017 ECU decrement the loop counter\r\n\t\t\t\t\t\t// ---------------------------------------------------------\r\n\t\t\t\t\t\tloopCounter--;\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}", "public static void startMusic()\r\n\t{\r\n\t\tif ( musicPlayer == null )\r\n\t\t\tmusicPlayer = new MusicPlayer( \"Music2.mid\" );\r\n\t\telse\r\n\t\t\tmusicPlayer.play();\r\n\t}", "@Override\r\n\tpublic void opening(MediaPlayer mediaPlayer)\r\n\t{\n\r\n\t}", "@Override\r\n\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\t\t\t\tmMediaPlaer.start();\r\n\t\t\t}", "public interface MediaPlayer {\n public void play();\n}", "public void play(View v) {\n if (player == null)\n player = MediaPlayer.create(this, R.raw.bensound_evolution);\n player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n stopPlayer();\n }\n });\n player.start();\n }", "public void playerStarted () {\n this.setState(STATE.MEDIA_RUNNING);\n\n // Send status notification to JavaScript\n sendStatusChange(MEDIA_DURATION, null, null);\n }", "public MusicPlayer(Context context) {\r\n\t\tmediaPlayer = new MediaPlayer();\r\n mContext = context;\r\n mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() {\r\n @Override\r\n public boolean onError(MediaPlayer mp, int what, int extra) {\r\n mediaPlayer.stop();\r\n mediaPlayer.release();\r\n mediaPlayer = null;\r\n return true;\r\n }\r\n });\r\n\t}", "public void initMusicPlayer() {\n PatariSingleton.getInstance().getMediaPlayer().setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);\n PatariSingleton.getInstance().getMediaPlayer().setAudioStreamType(AudioManager.STREAM_MUSIC);\n PatariSingleton.getInstance().getMediaPlayer().setOnPreparedListener(this);\n PatariSingleton.getInstance().getMediaPlayer().setOnCompletionListener(this);\n PatariSingleton.getInstance().getMediaPlayer().setOnErrorListener(this);\n PatariSingleton.getInstance().getMediaPlayer().setOnBufferingUpdateListener(this);\n try {\n if (wifiLock != null && wifiLock.isHeld()) {\n wifiLock.release();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n try {\n wifiLock = ((WifiManager) getApplication().getApplicationContext().getSystemService(Context.WIFI_SERVICE)).createWifiLock(WifiManager.WIFI_MODE_FULL, \"mylock\");\n wifiLock.acquire();\n } catch (Exception e) {\n e.printStackTrace();\n }\n IS_PROGRESS = false;\n }", "@Override\n\t\t\tpublic boolean onError(MediaPlayer mp, int what, int extra) {\n\t\t\t\tif(null != player){\n\t\t\t\t\tplayer.release();\n\t\t\t\t\tplayer = null;\n\t\t\t\t}\n\t\t\t\tMusic m = listMusic.get(currentId);\n\t\t\t\tString url = m.getUrl();\n\t\t\t\tUri mUri = Uri.parse(url);\n\t\t\t\tplayer = new MediaPlayer();\n\t\t\t\tplayer.reset();\n\t\t\t\tplayer.setAudioStreamType(AudioManager.STREAM_MUSIC);\n\t\t\t\ttry {\n\t\t\t\t\tplayer.setDataSource(getApplicationContext(),mUri);\n\t\t\t\t\tplayer.prepare();\n\t\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (SecurityException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tplayer.start();\n\t\t\t\treturn false;\n\t\t\t}", "public void play() {\n\t\tint focusRequestResult = mAudioManager.requestAudioFocus(mOuterEventsListener, AudioManager.STREAM_MUSIC,\n\t\t\t\tAudioManager.AUDIOFOCUS_GAIN);\n\n\t\tif (PrefManager.isIgnoreAudioFocus()\n\t\t\t\t|| focusRequestResult == AudioManager.AUDIOFOCUS_REQUEST_GRANTED) {\n\t\t\tinternalPlay();\n\t\t} else {\n\t\t\terror(Error.AUDIO_FOCUS_ERROR);\n\t\t}\n\t}", "public interface MediaPlayer {\r\n\r\n public void play(String mediaType,String fileName);\r\n}", "public void createPlayer() {\n mainHandler = new Handler();\n videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);\n trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);\n player = ExoPlayerFactory.newSimpleInstance(this, trackSelector);\n }", "@Override\n\t\tpublic void run() {\n\t\t\tmFiles = DataSourceManager.getSongFileList(currentAlbumPath);\n\t\t\tif (mFiles == null || mFiles.length == 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (mPlayPos < 0 || mPlayPos > mFiles.length -1) {\n\t\t\t\tmPlayPos = 0;\n\t\t\t}\n\t\t\t/*Message msg = mMediaplayerHandler.obtainMessage(PREPARE_PLAY);\n\t\t\tif (msg == null) {\n\t\t\t\tmsg = new Message();\n\t\t\t\tmsg.what = PREPARE_PLAY;\n\t\t\t\t\n\t\t\t}\n\t\t\tBundle data = new Bundle();\n\t\t\tdata.putString(MSG_PLAY_PATH, mFiles[mPlayPos]);\n\t\t\tdata.putInt(MSG_PLAY_POSITION, mSeek);\n\t\t\tmsg.setData(data);\n\t\t\tmMediaplayerHandler.sendMessage(msg);*/\n\t\t\t\n\t\t\tsendHandlerInitialized(mFiles[mPlayPos], false);\n\t\t}", "public void prepare() {\n\t\tthis.mMediaPlayer = new MediaPlayer();\n\t\ttry {\n\t\t\tthis.mMediaPlayer.reset();\n\t\t\tthis.mMediaPlayer.setDataSource(this.resourceURL);\n\t\t\tthis.mMediaPlayer.setOnPreparedListener(this);\n\t\t\tthis.mMediaPlayer.prepareAsync();\n\t\t\tthis.subject.notifyBuffering();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void gameSound(int attack){\n switch (attack){\n case 1:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_lightattack);\n break;\n case 2:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_strongattack);\n break;\n case 3:\n mediaPlayer = MediaPlayer.create(Activity_Game.this, R.raw.sound_brutalattack);\n break;\n }\n mediaPlayer.start();\n }", "@Override\n\t\tpublic void onLoaded(String arg0) {\n\t\t\t\tplayer.play();\n\t\t}", "public void start() {\n AudioPlayer.player.start(cas);\n playing = true;\n }", "public void playerUpdate(Player player, String event, Object eventData) {\n if (event.equals(PlayerListener.END_OF_MEDIA)) {\n if ((!myShouldPause) && (!myGamePause)) {\n try {\n myPlayer.start();\n } catch (Exception e) {\n // the music isn't necessary, so we ignore exceptions.\n }\n }\n }\n }", "public void playAudio() {\n\t\tmusic[currentSong].stop();\n\t\tcurrentSong++;\n\t\tcurrentSong %= music.length;\n\t\tmusic[currentSong].play();\n\t}", "private void releaseMediaPlayer() {\n if (mediaPlayer != null) {\n // Regardless of the current state of the media player, release its resources\n // because we no longer need it.\n mediaPlayer.release();\n }\n\n // Set the media player back to null. For our code, we've decided that\n // setting the media player to null is an easy way to tell that the media player\n // is not configured to play an audio file at the moment.\n mediaPlayer = null;\n\n }", "@Override\n public void handle(ForwardEvent event) {\n if (isPlayerAlive()) {\n player.dispose();\n }\n playlist.next();\n player = new MediaPlayer(playlist.getCurrentMedia());\n initPlay();\n }", "@Override\r\n public void handleMediaEvent(MediaEvent event) {\r\n if(running){\r\n try {\r\n Media media = event.getSource();\r\n String pluginName = media.getPluginName();\r\n Map<String,Object> location = SharedLocationService.getLocation(media.getPluginLocationId());\r\n switch(event.getEventType()){\r\n case PLAYER_PLAY:\r\n Map<String,Object> playerData = media.getNowPlayingData();\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"action\",event.getEventType().toString().toLowerCase());\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"type\",((MediaPlugin.ItemType)playerData.get(\"ItemType\")).toString().toLowerCase());\r\n if ((MediaPlugin.ItemType)playerData.get(\"ItemType\") == MediaPlugin.ItemType.AUDIO) {\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"title\",(String)playerData.get(MediaPlugin.ItemDetails.TITLE.toString()));\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"title artist\",(String)playerData.get(MediaPlugin.ItemDetails.TITLE_ARTIST.toString()));\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"album\",(String)playerData.get(MediaPlugin.ItemDetails.ALBUM.toString()));\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"album artist\",(String)playerData.get(MediaPlugin.ItemDetails.ALBUM_ARTIST.toString()));\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"duration\",playerData.get(MediaPlugin.ItemDetails.DURATION.toString()).toString());\r\n } else {\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"title\",(String)playerData.get(MediaPlugin.ItemDetails.TITLE.toString()));\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"duration\",playerData.get(MediaPlugin.ItemDetails.DURATION.toString()).toString());\r\n }\r\n break;\r\n case PLAYER_PAUSE:\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"action\",event.getEventType().toString().toLowerCase());\r\n break;\r\n case PLAYER_STOP:\r\n publishMediaItem((String)location.get(\"floorname\"),(String)location.get(\"name\"),pluginName,\"action\",event.getEventType().toString().toLowerCase());\r\n break;\r\n }\r\n } catch (Exception ex) {\r\n LOG.error(\"Could not publish to broker: {}\", ex.getMessage(), ex);\r\n }\r\n }\r\n }", "public void PlaySound(Context context) {\r\n\t\tif (!this.mp.isPlaying()) {\r\n\t\t\tmp.start();\r\n\t\t}\r\n\t}", "private void play() {\n\t\tlog.finest(\"Playing sound\");\n\t\ttone.trigger();\n\t}", "public void start(StarObjectClass self){ \r\n \t\tStarCLEMediaPlayer mediaplayer = (StarCLEMediaPlayer)WrapAndroidClass.GetAndroidObject(self,\"AndroidObject\");\r\n \t\tif( mediaplayer == null )\r\n \t\t\treturn;\r\n \t\tmediaplayer.start(); \t\t\r\n \t}", "@Override\r\n\tpublic void onPrepared(MediaPlayer mp) {\n\t\tLog.v(LOGTAG, \"onPrepared Called\");\r\n\t\tvideoWidth = mp.getVideoWidth();\r\n\t\tvideoHeight = mp.getVideoHeight();\r\n\t\tif (videoWidth > currentDisplay.getWidth()\r\n\t\t\t\t|| videoHeight > currentDisplay.getHeight()) {\r\n\t\t\tfloat heightRatio = (float) videoHeight\r\n\t\t\t\t\t/ (float) currentDisplay.getHeight();\r\n\t\t\tfloat widthRatio = (float) videoWidth\r\n\t\t\t\t\t/ (float) currentDisplay.getWidth();\r\n\t\t\tif (heightRatio > 1 || widthRatio > 1) {\r\n\t\t\t\tif (heightRatio > widthRatio) {\r\n\t\t\t\t\tvideoHeight = (int) Math.ceil((float) videoHeight\r\n\t\t\t\t\t\t\t/ (float) heightRatio);\r\n\t\t\t\t\tvideoWidth = (int) Math.ceil((float) videoWidth\r\n\t\t\t\t\t\t\t/ (float) heightRatio);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvideoHeight = (int) Math.ceil((float) videoHeight\r\n\t\t\t\t\t\t\t/ (float) widthRatio);\r\n\t\t\t\t\tvideoWidth = (int) Math.ceil((float) videoWidth\r\n\t\t\t\t\t\t\t/ (float) widthRatio);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//surfaceView.setLayoutParams(new LinearLayout.LayoutParams(videoWidth,videoHeight));\r\n\t\tif (playURI!=null) {\r\n\t\t\tmp.start();\r\n\t\t}\r\n\t\t\r\n\r\n\t\tmediaController.setMediaPlayer(this);\r\n\t\tmediaController.setAnchorView(this\r\n\t\t\t\t.findViewById(R.id.videoView02));\r\n\t\tmediaController.setEnabled(true);\r\n\t\tmediaController.show(3000);\r\n\t}", "@Override\n\t\t\tpublic void onClick(View v){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tm.setDataSource(outputFile);\n\t\t\t\t\tm.prepare();\n\t\t\t\t\tm.start();\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Playing Audio\",\n\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\n\t\t\t\t\t// Making the notification pop up\n\t\t\t\t\tmBuilder.setSmallIcon(R.drawable.ic_launcher)\n\t\t\t\t\t\t\t.setContentTitle(\"Audio\")\n\t\t\t\t\t\t\t.setContentText(\"Audio is playing\");\n\t\t\t\t\tNotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\t\t\t\t\tnotificationManager.notify(1, mBuilder.build());\n\t\t\t\t\t\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}", "@Override\n public void run() {\n if (mPlayer != null) {\n if (!mPlayer.isPlaying())\n mPlayer.play();\n }\n }", "public static void playSound(Activity a, int index) {\n MediaPlayer mp = new MediaPlayer();\n mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n mp.reset(); // fix bug app show warning \"W/MediaPlayer: mediaplayer went away with unhandled events\"\n mp.release();\n mp = null;\n }\n });\n try {\n String []listMusic = a.getAssets().list(AppConstant.ASSETSMUSIC);\n AssetFileDescriptor afd = a.getAssets().openFd(\"music\"\n + System.getProperty(\"file.separator\") + listMusic[index]);\n mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());\n afd.close();\n mp.prepare();\n } catch (IOException e) {\n e.printStackTrace();\n }\n mp.start();\n }", "public void play() {\n\t\ttry {\n\t\t\taudioInput = AudioSystem.getAudioInputStream(this.music);\n\t\t\tclip.open(audioInput);\n\t\t\tclip.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void playSong() {\n player.reset();\n Song playedSong;\n //get the right song\n if (shuffle) {\n int newSong = shuffleIndexes.get(songPosn);\n playedSong = songs1.get(newSong);\n } else {\n playedSong = songs1.get(songPosn);\n }\n songTitle = playedSong.getSongName();\n Uri uri = Uri.parse(playedSong.getSongLocation());\n try {\n player.setDataSource(getApplicationContext(), uri);\n } catch (Exception e) {\n Log.e(\"MUSIC SERVICE\", \"Error setting data source\", e);\n }\n state = PlaybackStateCompat.STATE_PLAYING;\n player.prepareAsync();\n showNotification();\n }", "@Override\n public void playStart() {\n }", "public void onPlay(OoyalaSkinLayout skinLayout, Object object) {\n player.addObserver(MainActivity.this);\r\n playerLayoutController.onResume(MainActivity.this, this);\r\n\r\n if (player.setEmbedCode(EMBED)) {\r\n //Uncomment for autoplay\r\n player.play();\r\n } else {\r\n Log.e(\"ooyala player\", \"Asset Failure\");\r\n }\r\n }", "private void startPlay() {\n isPlaying = true;\n isPaused = false;\n playMusic();\n }", "@Override\n\tpublic void play(String audioType, String fileName) {\n\t\tif (audioType.equalsIgnoreCase(\"vlc\")){\n\t\t\tadvanceMediaPlayer.playVlc(fileName);\n\t\t} else if (audioType.equalsIgnoreCase(\"mp4\")){\n\t\t\tadvanceMediaPlayer.playMp4(fileName);\n\t\t}\n\t}", "public void start()\n\t{\n\t\tString name = getAudioFileName();\n\t\ttry\n\t\t{\t\t\t\n\t\t\tInputStream in = getAudioStream();\n\t\t\tAudioDevice dev = getAudioDevice();\n\t\t\tplay(in, dev);\n\t\t}\n\t\tcatch (JavaLayerException ex)\n\t\t{\n\t\t\tsynchronized (System.err)\n\t\t\t{\n\t\t\t\tSystem.err.println(\"Unable to play \"+name);\n\t\t\t\tex.printStackTrace(System.err);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tPowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);\n\t\twakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKE_LOCK_TAG);\n\t\t\n\t\t// Initialize the telephony manager\n\t\ttelephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);\n\t\tphoneStateListener = new MusicPhoneStateListener();\n\t\tnotificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\t\t\tnotificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL, \"Music Player\", NotificationManager.IMPORTANCE_LOW);\n\t\t\tnotificationManager.createNotificationChannel(notificationChannel);\n\t\t}\n\t\t\n\t\t// Initialize pending intents\n\t\tquitPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.quit\"), 0);\n\t\tpreviousPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.previous\"), 0);\n\t\tplaypausePendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.playpause\"), 0);\n\t\tnextPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(\"com.andreadec.musicplayer.next\"), 0);\n\t\tpendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP), PendingIntent.FLAG_UPDATE_CURRENT);\n\t\t\n\t\t// Read saved user preferences\n\t\tpreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\t\t\t\t\n\t\t// Initialize the media player\n\t\tmediaPlayer = new MediaPlayer();\n\t\tmediaPlayer.setOnCompletionListener(this);\n\t\tmediaPlayer.setWakeMode(this, PowerManager.PARTIAL_WAKE_LOCK); // Enable the wake lock to keep CPU running when the screen is switched off\n\t\t\n\t\tplayMode = preferences.getInt(Preferences.PREFERENCE_PLAY_MODE, Preferences.DEFAULT_PLAY_MODE);\n\t\ttry { // This may fail if the device doesn't support bass boost\n\t\t\tbassBoost = new BassBoost(1, mediaPlayer.getAudioSessionId());\n\t\t\tbassBoost.setEnabled(preferences.getBoolean(Preferences.PREFERENCE_BASSBOOST, Preferences.DEFAULT_BASSBOOST));\n\t\t\tsetBassBoostStrength(preferences.getInt(Preferences.PREFERENCE_BASSBOOSTSTRENGTH, Preferences.DEFAULT_BASSBOOSTSTRENGTH));\n\t\t\tbassBoostAvailable = true;\n\t\t} catch(Exception e) {\n\t\t\tbassBoostAvailable = false;\n\t\t}\n\t\trandom = new Random(System.nanoTime()); // Necessary for song shuffle\n\t\t\n\t\tshakeListener = new ShakeListener(this);\n\t\tif(preferences.getBoolean(Preferences.PREFERENCE_SHAKEENABLED, Preferences.DEFAULT_SHAKEENABLED)) {\n\t\t\tshakeListener.enable();\n\t\t}\n\t\t\n\t\ttelephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); // Start listen for telephony events\n\t\t\n\t\t// Inizialize the audio manager\n\t\taudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);\n\t\tmediaButtonReceiverComponent = new ComponentName(getPackageName(), MediaButtonReceiver.class.getName());\n\t\taudioManager.registerMediaButtonEventReceiver(mediaButtonReceiverComponent);\n\t\taudioManager.requestAudioFocus(null, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN);\n\t\t\n\t\t// Initialize remote control client\n icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);\n Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);\n mediaButtonIntent.setComponent(mediaButtonReceiverComponent);\n PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, 0);\n\n remoteControlClient = new RemoteControlClient(mediaPendingIntent);\n remoteControlClient.setTransportControlFlags(RemoteControlClient.FLAG_KEY_MEDIA_PLAY_PAUSE | RemoteControlClient.FLAG_KEY_MEDIA_PREVIOUS | RemoteControlClient.FLAG_KEY_MEDIA_NEXT);\n audioManager.registerRemoteControlClient(remoteControlClient);\n\t\t\n\t\tupdateNotification();\n\t\t\n\t\tIntentFilter intentFilter = new IntentFilter();\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.quit\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.previous\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.previousNoRestart\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.playpause\");\n\t\tintentFilter.addAction(\"com.andreadec.musicplayer.next\");\n\t\tintentFilter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);\n broadcastReceiver = new BroadcastReceiver() {\n @Override\n public void onReceive(Context context, Intent intent) {\n \tString action = intent.getAction();\n\n switch(action) {\n case \"com.andreadec.musicplayer.quit\":\n sendBroadcast(new Intent(\"com.andreadec.musicplayer.quitactivity\"));\n sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));\n stopSelf();\n return;\n case \"com.andreadec.musicplayer.previous\":\n previousItem(false);\n break;\n case \"com.andreadec.musicplayer.previousNoRestart\":\n previousItem(true);\n break;\n case \"com.andreadec.musicplayer.playpause\":\n playPause();\n break;\n case \"com.andreadec.musicplayer.next\":\n nextItem();\n break;\n case AudioManager.ACTION_AUDIO_BECOMING_NOISY:\n if(preferences.getBoolean(Preferences.PREFERENCE_STOPPLAYINGWHENHEADSETDISCONNECTED, Preferences.DEFAULT_STOPPLAYINGWHENHEADSETDISCONNECTED)) {\n pause();\n }\n break;\n }\n }\n };\n registerReceiver(broadcastReceiver, intentFilter);\n \n if(!isPlaying()) {\n \tloadLastSong();\n }\n \n startForeground(NOTIFICATION_ID, notification);\n\t}", "private void play() {\n MediaQueueItem item = mQueue.get(0);\n if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PENDING\n || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {\n mCurItemId = item.getItemId();\n if (mCallback != null) {\n if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PENDING) {\n mCallback.onNewItem(item.getUri());\n }\n mCallback.onStart();\n }\n item.setState(MediaItemStatus.PLAYBACK_STATE_PLAYING);\n }\n }", "public void launch() {\n if (volume == 0f) {\n return;\n }\n MediaPlayer launch = MediaPlayer.create(context, R.raw.fire);\n launch.setVolume(volume, volume);\n launch.start();\n launch.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n mediaPlayer.reset();\n mediaPlayer.release();\n }\n });\n }" ]
[ "0.7138442", "0.7076031", "0.7051618", "0.70356196", "0.700807", "0.6863251", "0.68626636", "0.67841625", "0.6760159", "0.6730862", "0.669861", "0.6695306", "0.66621697", "0.664766", "0.6622954", "0.6606448", "0.64965504", "0.64924616", "0.64260936", "0.64257026", "0.6412461", "0.64085835", "0.64079624", "0.63945234", "0.639427", "0.6379515", "0.6371128", "0.6371128", "0.6366623", "0.63660264", "0.63244843", "0.63162065", "0.6311904", "0.63051724", "0.6296894", "0.6279359", "0.6273634", "0.6261757", "0.6241817", "0.62385714", "0.6238486", "0.62376094", "0.62296325", "0.62265444", "0.6215424", "0.6202809", "0.62009543", "0.6200839", "0.6189622", "0.61836", "0.6171681", "0.6157991", "0.614912", "0.61476964", "0.6142579", "0.6142151", "0.61227816", "0.6111376", "0.6111108", "0.60975486", "0.6092772", "0.60848457", "0.6083156", "0.6081788", "0.60784817", "0.6062436", "0.60623896", "0.6061255", "0.6047627", "0.603996", "0.60151994", "0.6014382", "0.6010036", "0.5997761", "0.59956104", "0.5984171", "0.59745264", "0.5970548", "0.5967753", "0.5966288", "0.5958264", "0.59504086", "0.59404635", "0.5935935", "0.5930123", "0.5929403", "0.592428", "0.59231627", "0.5921347", "0.5911612", "0.5910202", "0.5908403", "0.59028965", "0.58864796", "0.5879354", "0.58722353", "0.5870068", "0.5868831", "0.586289", "0.5861263" ]
0.693359
5
Stops playing of media.
public void stop() { if (this.mediaPlayer != null && mediaPlayer.getStatus().equals(MediaPlayer.Status.PLAYING)) { this.mediaPlayer.stop(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stop()\n {\n mediaPlayer.stop();\n }", "private void stop()\n {\n mPlayer.stop();\n mPlayer = MediaPlayer.create(this, audioUri);\n }", "public void stop() {\n mMediaPlayer.stop();\n setPlayerState(State.STOPPED);\n notifyPlaying();\n }", "public void stopPlaying() {\n seq.stop();\n }", "public void stop() {\n\t\tstop(!playing);\n\t}", "private void stop()\n\t\t{\n\t\t\tif (mMediaPlayer != null)\n\t\t\t{\n\t\t\t\tmMediaPlayer.stop();\n\t\t\t\tmMediaPlayer.reset();\n\t\t\t}\n\t\t}", "public void stopMedia() {\n\t\tif (videoviewer.getCurrentPosition() != 0) {\n\t\t\t\n\t\t\tplaytogglebutton.setChecked(true);\n\t\t\t\n\t\t\tvideoviewer.pause();\n\t\t\tvideoviewer.seekTo(0);\n\t\t\ttimer.cancel();\n\n\t\t\ttimeElapsed.setText(countTime(videoviewer.getCurrentPosition()));\n\t\t\tprogressBar.setProgress(0);\n\t\t}\n\t}", "public void stopPlaying()\n {\n player.stop();\n }", "public void stopPlaying() {\n \t\tisPlaying = false;\n \t}", "public void stop() {\n AudioPlayer.player.stop(cas);\n playing = false;\n }", "private void stopPlaying() {\n Log.e(TAG, \"Stop playing file: \" + curRecordingFileName);\n if (null != mPlayer) {\n if (mPlayer.isPlaying())\n mPlayer.stop();\n mPlayer.release();\n mPlayer = null;\n }\n\n }", "public void stop() {\n\t\tmusic.stop();\n\t}", "public void stopPlaying() {\n if ((this.state == STATE.MEDIA_RUNNING) || (this.state == STATE.MEDIA_PAUSED)) {\n if (player != null) {\n player.stop();\n LOG.d(LOG_TAG, \"stopPlaying is calling stopped\");\n player = null;\n }\n }\n else {\n LOG.d(LOG_TAG, \"MultiPlayer Error: stopPlaying() called during invalid state: \" + this.state.ordinal());\n sendErrorStatus(MEDIA_ERR_NONE_ACTIVE);\n }\n }", "@Override\n protected void onStop() {\n mediaPlayer.release();\n super.onStop();\n }", "public void stopSong() {\n\t\tStatus status = mediaview.getMediaPlayer().getStatus();\n\t\t\n\t\tif (status == Status.PLAYING) {\n\t\t\tmediaview.getMediaPlayer().stop();\n\t\t\tplaying = false;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t}", "@Override\n\tpublic void stop() {\n\t\tif (player != null) {\n\t\t\tplayer.close();\n\n\t\t\tpauseLocation = 0;\n\t\t\tsetSongTotalLenght(0);\n\t\t}\n\t}", "public void stopPlayThread() {\n ms.stop();\n }", "private void stopAudio() {\r\n // stop playback if possible here!\r\n }", "public void stop() {\n\t\tplaybin.stop();\n\t}", "public void stop()\n {\n if(AudioDetector.getInstance().isNoAudio() || musicPlayer == null)\n {\n return;\n }\n\n\n musicPlayer.stop();\n }", "private void stop()\r\n {\r\n player.stop();\r\n }", "public void stop() {\n if (playingClip != null)\n playingClip.stop();\n }", "public void StopSound() {\r\n\t\tif (this.mp.isPlaying()) {\r\n\t\t\tmp.pause();\r\n\t\t}\r\n\t}", "protected void stopTheSound(){\n mp.stop();\n }", "public void stop() {\n\t\tsound.stop();\n\t}", "public void stop() {\n try {\n mIsIdle = true;\n mIsLooping = false;\n if (mCurPlayer != null) \n {\n mCurPlayer.stop(); \n Thread.sleep(100);\n// mCurPlayer.setMediaTime(0);\n mIsPlaying = false;\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public void stop() {\n\t\tif (player == null)\n\t\t\treturn;\n\t\t\n\t\tif (listener != null)\n\t\t\tlistener.setLooping(false);\n\t\t\n\t\t// This will invoke playbackFinished, which will decrement currentlyPlaying\n\t\t// and set player to null.\n\t\tplayer.stop();\n\t}", "private void stopVideoPlayer() {\r\n\t\tmediaSrc.stopStream();\r\n\t\tmediaSrc.setObserver(null);\r\n\t\tplayer.setVisible(false);\r\n\t}", "public void stopVideo() {\n try {\n texture.getSurfaceTexture().release();\n nodeMediaPlayer.reset();\n nodeMediaPlayer.prepare();\n nodeMediaPlayer.stop();\n nodeMediaPlayer.release();\n nodeMediaPlayer = null;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void stop(){ player.stop();}", "public void stop(){\n Log.d(TAG, \"stop: called\");\n if(mMediaPlayer!=null){\n mMediaPlayer.stop();\n FilePlayerDialog.isPlaying = false;\n seekHandler.removeCallbacksAndMessages(null);\n }\n }", "public static void stopMusic() {\n\t\tcurrentMusic.stop();\n\t}", "@Override\r\n\tpublic void stopped(MediaPlayer mediaPlayer)\r\n\t{\n\r\n\t}", "public void stopPlaying(){\r\n\t\tsongsToPlay.clear();\r\n\t\tselectedPreset = -1;\r\n\t\tselectedSource = \"\";\r\n\t\ttry{\r\n\t\t\tplayer.stop();\r\n\t\t}catch(Exception e){\r\n\t\t\tSystem.err.println(\"ERROR: BASICPLAYER STOP CODE HAS FAULTED.\");\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void stopSong()\n {\n JSoundsMainWindowViewController.iAmPlaying = true;\n JSoundsMainWindowViewController.iAmPausing = false;\n JSoundsMainWindowViewController.iAmResuming = false;\n \n MusicPlayerControl.stopSong();\n }", "public void stopPlayback() {\n if (mMediaPlayer != null) {\n mMediaPlayer.stop();\n mMediaPlayer.release();\n mMediaPlayer = null;\n if (mHudViewHolder != null) {\n mHudViewHolder.setMediaPlayer(null);\n }\n setCurrentState(STATE_IDLE);\n mTargetState = STATE_IDLE;\n mAudioManager.abandonAudioFocus(null);\n }\n }", "public void stop(StarObjectClass self){ \r\n \t\tStarCLEMediaPlayer mediaplayer = (StarCLEMediaPlayer)WrapAndroidClass.GetAndroidObject(self,\"AndroidObject\");\r\n \t\tif( mediaplayer == null )\r\n \t\t\treturn;\r\n \t\tmediaplayer.stop();\r\n \t}", "public void destroy() {\n // Stop any play or record\n if (this.player != null) {\n if ((this.state == STATE.MEDIA_RUNNING) || (this.state == STATE.MEDIA_PAUSED)) {\n this.player.stop();\n }\n this.player = null;\n }\n }", "public void stop()\n {\n audioClip.stop();\n }", "private void stop() {\n MediaQueueItem item = mQueue.get(0);\n if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING\n || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {\n if (mCallback != null) {\n mCallback.onStop();\n }\n item.setState(MediaItemStatus.PLAYBACK_STATE_FINISHED);\n }\n }", "public void stopSound() {\n metaObject.stopSound();\n }", "@Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n stopMusic();\n }", "public void stop() { \r\n timer.stop(); \r\n if (midi) \r\n sequencer.stop(); \r\n else \r\n clip.stop(); \r\n play.setText(\"Play\"); \r\n playing = false; \r\n }", "@Override\n public void onDismiss() {\n try {\n if (mediaPlayer.isPlaying()) {\n\n mediaPlayer.stop();\n mediaPlayer.reset();\n mediaPlayer.release();\n }\n\n\n } catch (RuntimeException ddfuh) {\n ddfuh.printStackTrace();\n }\n }", "public void stopPlayBack() {\n\t\tif (android.os.Environment.getExternalStorageState().equals(\n\t\t\t\tandroid.os.Environment.MEDIA_MOUNTED)) {\n\t\t\tif (mPlayer.isPlaying())\n\t\t\t\tmPlayer.stop();\n\t\t} else {\n\t\t\tToast.makeText(mContext, \"sdcard not available\", Toast.LENGTH_LONG).show();\n\t\t}\n\t}", "@Override\n protected void onStop() {\n super.onStop();\n releaseMediaPlayer();\n }", "public synchronized void stop() {\n if(running) {\n this.running = false;\n try {\n this.soundThread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }", "public void stop() {\n mCurrentPlayer.reset();\n mIsInitialized = false;\n }", "public void stop() {\n mediaController.getTransportControls().stop();\n }", "public void stopSound(){\n p.stop(as);\n }", "public void stopAudio() {\n\t\tif(audioStream != null ) {\n\t\t\tAudioPlayer.player.stop(audioStream);\n\t\t}\n\t}", "public void stopPlaying() {\n\t\tpbrLoading.setVisibility(View.GONE);\n\t\tisPlaying = false;\n\t\tupdateView();\n\t}", "public void onStop() {\n LOG.mo8825d(\"[onStop]\");\n if (this.mMediaPlayer != null) {\n if (this.mMediaPlayer.isPlaying()) {\n this.mMediaPlayer.stop();\n }\n this.mMediaPlayer.release();\n this.mMediaPlayer = null;\n }\n super.onStop();\n }", "private void stopPlayback() {\n // stop player service using intent\n Intent intent = new Intent(mActivity, PlayerService.class);\n intent.setAction(ACTION_STOP);\n mActivity.startService(intent);\n LogHelper.v(LOG_TAG, \"Stopping player service.\");\n }", "public void stop() {\n if (started && thread != null) {\n stopRequested = true;\n thread.interrupt();\n if (audio != null) {\n audio.stop();\n }\n }\n }", "private void stop() {\n Log.i(\"TTS\", \"Stopping\");\n mSpeechQueue.clear();\n \n nativeSynth.stop();\n mIsSpeaking = false;\n if (mPlayer != null) {\n try {\n mPlayer.stop();\n } catch (IllegalStateException e) {\n // Do nothing, the player is already stopped.\n }\n }\n Log.i(\"TTS\", \"Stopped\");\n }", "public synchronized void stopSound() {\r\n running = false;\r\n }", "@Override\n protected void onDestroy() {\n \tsuper.onDestroy();\n \t\n \tif(mediaPlayer!=null){\n \t\t\n \t\tmediaPlayer.stop();\n \t\tmediaPlayer=null;\n \t}\n }", "@Override\n protected void onStop() {\n super.onStop();\n // when the activity is stopped, release the media player resources because we won't\n // be playing any more sounds.\n releaseMediaPlayer();\n }", "@Override\n protected void onDestroy() {\n Log.v(\"MediaPlayer\", \"onDestroy\");\n super.onDestroy();\n if (mp.isPlaying()) {\n mp.stop();\n }\n mp.release();\n }", "@Override\n public void stopSound(){\n gameMusic.stop();\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tif (mMediaPlayer.isPlaying()) {\n\t\t\tmMediaPlayer.stop();\n\t\t}\n\t}", "public static void playerStop() {\n\t\tif(playing){\n\t\t\tPlayer.stop();\n\t\t\tmicroseconds = 0;\n\t\t\tplaying = false;\n\t\t\tif (sim!=null) sim.stop();\n\t\t}\n\t}", "@Override\n protected void onPause() {\n super.onPause();\n if(mediaPlayer != null)\n {\n mediaPlayer.stop();\n if(isFinishing())\n {\n mediaPlayer.stop();\n mediaPlayer.release();\n }\n }\n }", "public void stop()\n\t{\n\t\ttry\n\t\t{\n\t\t\tstopPlayer();\n\t\t}\n\t\tcatch (JavaLayerException ex)\n\t\t{\n\t\t\tSystem.err.println(ex);\n\t\t}\n\t}", "public void playerStopped ( int perf ) {\n LOG.d(LOG_TAG, \"stopPlaying is calling stopped\");\n this.setState(STATE.MEDIA_STOPPED);\n\n // Send status notification to JavaScript\n sendStatusChange(MEDIA_DURATION, null, null);\n }", "@Override\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tMediaPlayUtil.getInstance().stop();\n\t\tMediaPlayUtil.getInstance().release();\n\t}", "public void dispose() {\n if (mediaPlayer.isPlaying())\n mediaPlayer.stop();\n mediaPlayer.release();\n }", "public void stop() {\n aVideoAnalyzer.stop();\n }", "@Override\n public void onCompletion(MediaPlayer mp) {\n stopMedia();\n //stop the service\n stopSelf();\n }", "@Override\n protected void onStop() {\n super.onStop();\n stopMusic();\n }", "public static void stop() {\r\n\r\n if (soundLoop!=null)\r\n {\r\n soundLoop.stop();\r\n }\r\n }", "void stopMusic();", "@Override\n public void onBackPressed() {\n if(mediaPlayer != null && mediaPlayer.isPlaying()){\n mediaPlayer.stop();\n }\n\n super.onBackPressed();\n }", "public static void stopMusic()\n\t{\n\t\tif (music != null && currentMusicFile != -1)\n\t\t{\n\t\t\tmusic.get(currentMusicFile).stop();\n\t\t\tcurrentMusicFile = -1;\n\t\t}\n\t}", "public void stopBackgroundMusic()\n {\n background.stop();\n }", "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)\n private void stopAudio() {\n //stop audio\n playBtn.setImageDrawable(getActivity().getResources().getDrawable(R.drawable.sharp_play_arrow_black_36, null));\n playerHeader.setText(\"Stopped\");\n isPlaying = false;\n mediaPlayer.stop();\n bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);\n seekBarHandler.removeCallbacks(updateSeekBar);\n }", "private void stopPlayer() {\n if (player != null) {\n player.release();\n Toast.makeText(this, \"player released\", Toast.LENGTH_SHORT);\n player = null;\n }\n }", "@Override\n public void playStop() {\n }", "public void stop() {\n SystemClock.sleep(500);\n\n releaseAudioTrack();\n }", "public void stopPlayback(){\n \n \n if(getPlayMode()!=PlayMode.PLAYBACK){\n return;\n }\n setPlayMode(PlayMode.WAITING);\n playerControlPanel.setVisible(false);\n increasePlaybackSpeedMenuItem.setEnabled(false);\n decreasePlaybackSpeedMenuItem.setEnabled(false);\n rewindPlaybackMenuItem.setEnabled(false);\n togglePlaybackDirectionMenuItem.setEnabled(false);\n \n try {\n if(motionInputStream!=null){\n motionInputStream.close();\n motionInputStream=null;\n }\n if(fileInputStream!=null){\n fileInputStream.close();\n fileInputStream=null;\n }\n } catch (IOException ignore) {\n ignore.printStackTrace();\n }\n setTitleAccordingToState();\n }", "@Override\n\tpublic void onDestroy() {\n\t\tsuper.onDestroy();\n\t\tMediaPlayUtil.getInstance().release();\n\t\tMediaPlayUtil.getInstance().stop();\n\n\t}", "private void detener() {\n player.stop();\n player.release();\n player = null;\n }", "public void stop() {\n pause();\n if (isInPreviewMode) {\n isInPreviewMode = false;\n }\n seekTo(0, new OnCompletionListener() {\n @Override\n public void onComplete() {\n //no-op\n }\n });\n }", "@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tif(ani.hasStarted())\n\t\t\t\t\t{\n\t\t\t\t\t\tani.cancel();\n\t\t\t\t\t}\n\t\t\t\t\tif(mediaPlayer.isPlaying())\n\t\t\t\t\t{\n\t\t\t\t\t\tmediaPlayer.stop();\n\t\t\t\t\t\tmediaPlayer.release();\n\t\t\t\t\t}\n\t\t\t\t\tfinish();\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}", "public void stop() {\n synchronized (mLock) {\n //if (!mRunning)\n //{\n // throw new IllegalStateException(\"CameraStreamer is already stopped\");\n //} // if\n \t\n \tLog.d(TAG, \"Stop\");\n \t\n mRunning = false;\n if (mMJpegHttpStreamer != null) {\n mMJpegHttpStreamer.stop();\n mMJpegHttpStreamer = null;\n } // if\n \n if (mCamera != null) {\n mCamera.release();\n mCamera = null;\n } // if\n } // synchronized\n mLooper.quit();\n }", "@Override\r\n\t\t\tpublic void onCompletion(MediaPlayer mp) {\n\r\n\t\t\t\tmPlaying = false;\r\n\t\t\t\tstatus.setText(\"Stop Play\");\r\n\t\t\t}", "private void releaseMediaPlayer() {\n if (mMymedia != null) {// Regardless of the current state of the media player, release its resources\n // because we no longer need it.\n mMymedia.release();\n // Set the media player back to null. For our code, we've decided that\n // setting the media player to null is an easy way to tell that the media player\n // is not configured to play an audio file at the moment.\n mMymedia = null;\n am.abandonAudioFocus(afChangeListener);\n }\n }", "public static void stopSound() {\n if(mAudioManager != null) {\n mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, originalVolume, 0);\n }\n if (mp != null) {\n mp.stop();\n Log.d(TAG, \"Stop Sound\");\n }\n }", "@Override\n public void onStop() {\n Log.d(TAG, \"MediaSessionCallback: onStop()\");\n // In onDestroy(), the player will be released. If you are using ExoPlayer, you will\n // need to manually release the player.\n getActivity().finish();\n }", "public void stop() { \r\n\t if (remoteControlClient != null) {\r\n\t remoteControlClient\r\n\t .setPlaybackState(RemoteControlClient.PLAYSTATE_STOPPED);\r\n\t } \r\n\t }", "@Override\n public void onCompletion(MediaPlayer mp) {\n mp4.stop();\n Game_video_feed.this.finish();\n }", "public void StopMusic();", "public void stopped()\n {\n super.stopped();\n muteControl.stop();\n }", "public void onClick(View v) {\n if (mPlayer != null && mPlayer.isPlaying()) {\n mPlayer.stop();\n }\n }", "public void stopStreaming() {\n phoneCam.stopStreaming();\n }", "@Override\n protected void onStop()\n {\n super.onStop();\n ukuleleMediaPlayer.release();\n ipuMediaPlayer.release();\n }", "public void finishSong() {\n mp.finish();\n trackPlaying = false;\n }", "public void stoppedPlaying(int timecode) {\n if ((file != null) && (duration > -1)) {\n\n // Only want to monkey with the file if it WAS playing, but isn't\n // any more.\n if (wasPlaying) {\n\n // Now just degrade from starting point to stopping point...\n degrade(startPoint, timecode, duration);\n }\n }\n\n wasPlaying = false;\n }", "public void stop() {\n synchronized (lock) {\n isRunning = false;\n if (rawAudioFileOutputStream != null) {\n try {\n rawAudioFileOutputStream.close();\n } catch (IOException e) {\n Log.e(TAG, \"Failed to close file with saved input audio: \" + e);\n }\n rawAudioFileOutputStream = null;\n }\n fileSizeInBytes = 0;\n }\n }" ]
[ "0.89140207", "0.83474505", "0.81199306", "0.81196636", "0.8104921", "0.8063549", "0.80177", "0.79679525", "0.78956294", "0.78617775", "0.78560936", "0.7829152", "0.77960086", "0.77484524", "0.772534", "0.7612563", "0.76014", "0.757871", "0.75729895", "0.756366", "0.75175923", "0.75084674", "0.75028574", "0.7486886", "0.74811524", "0.7462512", "0.74161756", "0.74099463", "0.7398237", "0.73722696", "0.7367996", "0.73527133", "0.73511666", "0.7318426", "0.7290014", "0.7256992", "0.72559744", "0.7241268", "0.72402066", "0.7231811", "0.72128886", "0.7198874", "0.71835446", "0.7180336", "0.71691585", "0.7167336", "0.71605206", "0.71514595", "0.7105424", "0.7096115", "0.70779526", "0.7071756", "0.7071299", "0.7066317", "0.7049706", "0.7047266", "0.7042854", "0.70343935", "0.7031304", "0.7015035", "0.7009807", "0.6989116", "0.69746643", "0.6970576", "0.6955952", "0.69549936", "0.69505715", "0.6914232", "0.6907875", "0.6893085", "0.68841994", "0.6880666", "0.6871415", "0.68578255", "0.6856714", "0.6851609", "0.6851304", "0.68454283", "0.6824366", "0.6819626", "0.6797651", "0.67853487", "0.67851985", "0.6751998", "0.67372", "0.67327166", "0.6722394", "0.66968584", "0.6687265", "0.66554403", "0.6608269", "0.66045237", "0.66037136", "0.65951484", "0.65928996", "0.65862256", "0.65756595", "0.65623343", "0.65614873", "0.65572083" ]
0.8421612
1
Checks status of the media.
public boolean poll() { if (this.mediaPlayer == null) { return false; } return mediaPlayer.getStatus().equals(MediaPlayer.Status.PLAYING); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkAvailability(Media media) {\n\t\t return false;\n\t }", "public boolean isValid() {\n return media.isValid();\n }", "private void statusCheck() {\n\t\tif(status.equals(\"waiting\")) {if(waitingPlayers.size()>1) status = \"ready\";}\n\t\tif(status.equals(\"ready\")) {if(waitingPlayers.size()<2) status = \"waiting\";}\n\t\tif(status.equals(\"start\")) {\n\t\t\tif(players.size()==0) status = \"waiting\";\n\t\t}\n\t\tview.changeStatus(status);\n\t}", "boolean hasMediaFile();", "VideoStatus getStatus();", "private static boolean mediaExists(String url){\n try {\n /* Do not follow redirects */\n HttpURLConnection.setFollowRedirects(false);\n \n /* Open a connection to the media */\n HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();\n \n /* Use a head only request to just retrieve metadata */\n con.setRequestMethod(\"HEAD\");\n \n /* If a response code of 200 (okay) is received, the media is available */\n return (con.getResponseCode() == HttpURLConnection.HTTP_OK);\n } catch (Exception e) {\n /* Media unavailabe, return false */\n return false;\n }\n }", "private void checkStatus() {\n\t\tif(mApp.isTwitterAuthorized()){\n\t\t\t((ImageButton)findViewById(R.id.fs_share_twitter))\n\t\t\t\t\t.setImageResource(R.drawable.ic_twitter);\n\t\t}else{\n\t\t\t((ImageButton)findViewById(R.id.fs_share_twitter))\n\t\t\t\t\t.setImageResource(R.drawable.ic_twitter_disabled);\n\t\t}\n\t\t// Lo mismo para Facebook\n\t\tif(mApp.isFacebookAuthorized()){\n\t\t\t((ImageButton)findViewById(R.id.fs_share_facebook))\n\t\t\t\t\t.setImageResource(R.drawable.ic_facebook);\n\t\t}else{\n\t\t\t((ImageButton)findViewById(R.id.fs_share_facebook))\n\t\t\t\t\t.setImageResource(R.drawable.ic_facebook_disabled);\n\t\t}\n\t}", "private void checkStatus()\n {\n // If the last command failed\n if(!project.getLastCommandStatus())\n {\n view.alert(\"Error: \" + project.getLastCommandStatusMessage());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tCommand lastCmd = project.getLastCommand();\n\t\t\tif (lastCmd != null && lastCmd.hasOptionalState())\n\t\t\t{\n\t\t\t\tview.loadFromJSON(lastCmd.getOptionalState());\n\t\t\t\tview.onUpdate(project.getProjectSnapshot(), false);\n\t\t\t}\n\t\t}\n }", "boolean isSetStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "boolean hasStatus();", "private void checkPlayProgress() {\n\n if (playState == PLAY_STATE_PLAYING) {\n sendPosition();\n\n Runnable notification = new Runnable() {\n public void run() {\n checkPlayProgress();\n }\n };\n\n // keep updating while playing\n handler.postDelayed(notification, UPDATE_DELAY);\n }\n }", "public boolean isValid()\r\n {\r\n //Override this method in MediaItem object\r\n return getSemanticObject().getBooleanProperty(swb_valid,false);\r\n }", "boolean hasStatusChanged();", "public boolean checkStatus() {\r\n return isTiling;\r\n }", "@Test\n\tpublic void checkStatus() {\n\t\tclient.execute(\"1095C-16-111111\");\n\t}", "public void checkCam(Camera cam) {\n\t\t\t\n\t\t\tLog.e(\"DownloaderManager \", \"checkCam\");\n\t\t\t\n\t\t\ttempCamera = cam;\n\t\t\t\n\t\t\tif (!isRTMP(tempCamera.getAddress())){\n\t\t\t\n\t\t\t\t//check if camera is online\n\t\t\t\thttpControler.checkCamOnline(tempCamera.getAddress(), cameraStatus);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//rtmpControler.startDownloading(tempCamera, newFrameHandler);\n\t\t\t\trtmpControler.checkCamOnline(tempCamera.getAddress(), cameraStatus);\n\t\t\t}\n\t\t}", "boolean isValidStatus();", "public boolean checkComplete(){\n return Status;\n }", "@Override\r\n public Status getStatus() {\n if (message != null) {\r\n return Status.BROKEN;\r\n }\r\n // has the file been parsed yet\r\n if (url == null) {\r\n return Status.NOTCONNECTED;\r\n }\r\n return Status.CONNECTED;\r\n }", "public String getStatus()\n\t\t{\n\t\t\tElement statusElement = XMLUtils.findChild(mediaElement, STATUS_ELEMENT_NAME);\n\t\t\treturn statusElement == null ? null : statusElement.getTextContent();\n\t\t}", "boolean isAllMedia();", "@java.lang.Override\n public boolean hasStatus() {\n return status_ != null;\n }", "@java.lang.Override\n public boolean hasStatus() {\n return status_ != null;\n }", "private void checkPlaying() {\n playPauseButton.check(matches(isCompletelyDisplayed()));\n resetButton.check(matches(not(isDisplayed())));\n stopButton.check(matches(isCompletelyDisplayed()));\n\n playPauseButton.check(matches(withCompoundDrawable(R.drawable.ic_pause)));\n stopButton.check(matches(withCompoundDrawable(R.drawable.ic_stop)));\n\n checkReminder(true);\n\n // TODO: Check timeView's color state.\n }", "protected static boolean ok(int status) {\n return (status >= 200 && status < 300);\n }", "public abstract void handlerCheckState(int status, Object attach);", "public boolean verifyAndSetStatus() {\n if (status == FINISHED) {\n // No further checks needed\n return false;\n }\n \n if (Float.compare(estimation, 0f) <= 0) {\n if (status == READY_FOR_ESTIMATION) {\n return false;\n } else {\n status = READY_FOR_ESTIMATION;\n return true;\n }\n } else {\n // If no sprint was yet assigned, we must be in state\n // READY_FOR_SPRINT, otherwise in state IN_SPRINT\n if (sprint == null) {\n if (status == READY_FOR_SPRINT) {\n return false;\n } else {\n status = READY_FOR_SPRINT;\n return true;\n }\n } else {\n if (status == IN_SPRINT) {\n return false;\n } else {\n status = IN_SPRINT;\n return true;\n }\n }\n }\n }", "boolean getStatus();", "boolean getStatus();", "boolean getStatus();", "@Override\r\n\tpublic void mediaParsedChanged(MediaPlayer mediaPlayer, int newStatus)\r\n\t{\n\r\n\t}", "@Override\n public int checkStatus(){\n return InputOutputController.STATUS_READY;\n }", "public boolean isSetStatus() {\n return this.status != null;\n }", "public boolean isSetStatus() {\n return this.status != null;\n }", "public boolean isSetStatus() {\n return this.status != null;\n }", "public boolean isSetStatus() {\n return this.status != null;\n }", "public boolean isSetStatus() {\n return this.status != null;\n }", "private boolean checkPhoneStatusOK() {\n return true;\n }", "public void verifyPermission() {\n Permissions.check(this/*context*/, Manifest.permission.WRITE_EXTERNAL_STORAGE, null, new PermissionHandler() {\n @Override\n public void onGranted() {\n addVideoInFolder();\n setupExoPlayer();\n settingListener();\n }\n\n @Override\n public void onDenied(Context context, ArrayList<String> deniedPermissions) {\n super.onDenied(context, deniedPermissions);\n verifyPermission();\n }\n });\n\n }", "private void checkState() {\n\tstate=Environment.getExternalStorageState();\n // now cheak what state is if we can access to sd card or not\n if (state.equals(Environment.MEDIA_MOUNTED))//MEDIA_MOUNTED it mean we can read and write\n {\t\n\t CanR=CanW=true;\n }\n else if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY))\n { // read but not write\n \t\n\t\tCanW=false;\n\t\tCanR=true;}\n\t\telse \n\t\t\t//it can't read or write\n\t\t{\n\t\tCanR=CanW=false;}\n\t\n}", "private void checkState() {\n\tstate = Environment.getExternalStorageState();\n\t\t\n\t\tif(state.equals(Environment.MEDIA_MOUNTED)){\n\t\t\t//read and write\n\t\tcanRead.setText(\"true\");\n\t\t\tcanWrite.setText(\"true\");\n\t\t\tcanW = canR = true;\n\t\t\t\n\t\t}else if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)){\n\t\t\t// read only \n\t\t\tcanRead.setText(\"true\");\n\t\t\tcanWrite.setText(\"false\");\n\t\t\tcanW = false;\n\t\t\tcanR = true;\n\n\t\t}else {\n\t\t\tcanWrite.setText(\"false\");\n\t\t\tcanRead.setText(\"false\");\n\t\t\tcanW = canR = false;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public void checkProgress() {\n\t\tupdateBitfield();\n\t\tlog(\"Checking progress...\");\n\t\tFileInfo[] fileinfo = files.getFiles();\n\t\tfor (int i = 0; i < fileinfo.length; i++) {\n\t\t\tFileInfo info = fileinfo[i];\n\t\t\tRandomAccessFile file = info.getFileAcces();\n\t\t\ttry {\n\t\t\t\tif (file.length() > 0L) {\n\t\t\t\t\tint pieceIndex = (int) (info.getFirstByteOffset() / files.getPieceSize());\n\t\t\t\t\tint lastPieceIndex = pieceIndex + info.getPieceCount();\n\t\t\t\t\tfor (; pieceIndex < lastPieceIndex; pieceIndex++) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (files.getPiece(pieceIndex).checkHash()) {\n\t\t\t\t\t\t\t\t// log(\"Progress Check: Have \" + pieceIndex);\n\t\t\t\t\t\t\t\tif (torrentStatus == STATE_DOWNLOAD_DATA) {\n\t\t\t\t\t\t\t\t\tbroadcastHave(pieceIndex);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfiles.havePiece(pieceIndex);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t\tlog(\"Checking progress done\");\n\t}", "public boolean isStatusOk() {\r\n return STATUS_OK.equals(this.status);\r\n }", "public Boolean getStatus() {return status;}", "private static void checkStatus() {\n\r\n\t\tDate date = new Date();\r\n\t\tSystem.out.println(\"Checking at :\"+date.toString());\r\n\t\tString response = \"\";\r\n\t\ttry {\r\n\t\t\tresponse = sendGET(GET_URL_COVAXIN);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t//System.out.println(response.toString());\r\n\t\tArrayList<Map> res = formatResponse(response);\r\n\r\n\t\tres = checkAvailability(res);\r\n\t\tif(res.size()>0)\r\n\t\t\tnotifyUser(res);\r\n\t\t//System.out.println(emp.toString());\r\n\t}", "@Override\n public int status() {\n if (currentLoad <= maxLoad && currentLoad >= 0.6 * maxLoad) return GOOD;\n if (currentLoad < 0.6 * maxLoad && currentLoad >= 0.1 * maxLoad) return CHECK;\n else return BAD;\n }", "boolean hasVideo();", "private boolean open(final int status) {\n return Objects.equals(status, 0);\n }", "public boolean isOK() {\r\n return getPayload().getString(\"status\").equals(\"ok\");\r\n }", "@Override\n\t\t\tpublic boolean onError(MediaPlayer mp, int what, int extra) {\n\t\t\t\tLog.d(\"Error in Video playing\",\"\"+what);\n\t\t\t\treturn true;\n\t\t\t}", "public boolean updateDocumentImportStatus(ImagingDocument imgDoc, int status, Environment env) {\n\t\tPreparedStatement stmt = null;\n\t\tConnection connection = DataSourceUtils.getConnection(dataSource);\n\t\tboolean updateOK = false;\n\t\t\n\t\ttry {\n\t\t\tstmt = connection.prepareStatement(SQL_UEWI_UPDATE_IMPORTSTATUS);\n\t\t\tif (Environment.DEV.equals(env) || Environment.TEST.equals(env)) {\n\t\t\t\tstatus = status + 30;\n\t\t\t}\n\t\t\tstmt.setInt(1, status);\n\t\t\tstmt.setString(2, imgDoc.getLegacyDocId());\n\t\t\tint rowAffected = stmt.executeUpdate();\n\t\t\tupdateOK = (rowAffected == 1);\n\t\t\tconnection.commit();\n\t\t\tconnection.close();\n\t\t\tstmt.close();\n\t\t} catch (SQLException e) {\n\t\t\tLOGGER.error(\"Cannot update record status !\", e);\n\t\t}\n\t\t\n\t\treturn updateOK;\n\t}", "public boolean hasMediaAssetFileHolder() {\n return mediaAssetFileHolder_ != null;\n }", "boolean checkAudioRecord() {\n try {\n audioRecord = new AudioRecord(\n audioBundle.getInt(AudioSettings.AUDIO_BUNDLE_KEYS[0]),\n audioBundle.getInt(AudioSettings.AUDIO_BUNDLE_KEYS[1]),\n audioBundle.getInt(AudioSettings.AUDIO_BUNDLE_KEYS[2]),\n audioBundle.getInt(AudioSettings.AUDIO_BUNDLE_KEYS[3]),\n audioBundle.getInt(AudioSettings.AUDIO_BUNDLE_KEYS[4]));\n MainActivity.logger(context.getString(R.string.audio_check_4));\n // need to start reading buffer to trigger an exception\n audioRecord.startRecording();\n short buffer[] = new short[audioBundle.getInt(AudioSettings.AUDIO_BUNDLE_KEYS[4])];\n int audioStatus = audioRecord.read(buffer, 0, audioBundle.getInt(AudioSettings.AUDIO_BUNDLE_KEYS[4]));\n\n // check for error on pre 6.x and 6.x API\n if(audioStatus == AudioRecord.ERROR_INVALID_OPERATION\n || audioStatus == AudioRecord.STATE_UNINITIALIZED) {\n MainActivity.logger(context.getString(R.string.audio_check_6) + audioStatus);\n // audioStatus == 0(uninitialized) is an error, does not throw exception\n MainActivity.logger(context.getString(R.string.audio_check_5));\n return false;\n }\n }\n catch(Exception e) {\n MainActivity.logger(context.getString(R.string.audio_check_7));\n MainActivity.logger(context.getString(R.string.audio_check_9));\n return false;\n }\n // no errors\n if (audioRecord != null) {\n audioRecord.stop();\n audioRecord.release();\n }\n MainActivity.logger(context.getString(R.string.audio_check_8));\n return true;\n }", "private boolean canRead() {\n\t\treturn fileStatus;\n\t}", "public boolean getStatus(){\r\n\t\treturn status;\r\n\t}", "@java.lang.Override\n public boolean hasMediaBundle() {\n return mediaAssetCase_ == 2;\n }", "public boolean getOnlineStatus(int status) throws android.os.RemoteException;", "private boolean checkExecution() {\n if (!checkPhoneStatusOK()) {\n return false;\n }\n if (!checkBatteryLevelOK()) {\n return false;\n }\n return true;\n }", "public void status_wait(UploadHandle h) throws Exception {\n \tStatusHandler sturl = (StatusHandler) h;\n String status = \"NA\";\n Integer time_check = 0;\n while(time_check < sturl.timeout && !status.equals(\"SUCCESS\"))\n {\n HttpResponse response = client.get(new URI(sturl.status_url));\n String statusxml = this.read_http_entity(response.getEntity());\n Document doc = this.db.parse(new ByteArrayInputStream(statusxml.getBytes(\"UTF-8\")));\n XPathExpression status_xpath = this.xPath.compile(\"//step[@id='\"+sturl.step.toString()+\"']/@status\");\n NodeList nodeList = (NodeList)status_xpath.evaluate(doc, XPathConstants.NODESET);\n for(int i=0; i<nodeList.getLength(); i++)\n {\n Node childNode = nodeList.item(i);\n status = childNode.getNodeValue();\n }\n Thread.sleep(1 * 1000);\n time_check++;\n }\n if(time_check == sturl.timeout) { throw new InterruptedException(\"Unable to check for completed upload status.\"); }\n }", "private void processCurrentMediaError(Exception ex){\n logger.error(Thread.currentThread().getName() + \" can't open [\" + streamSpec.getAudioMedias().get(0) + \"], skipping file\", ex);\n consumeMedia(0);\n frameIterator = SilentMediaReader.getInstance();\n updateCurrentMedia(null);\n status = Status.PLAYING_SILENCE;\n for (StreamListener listener : streamListeners) {\n listener.mediaChanged();\n }\n }", "@Override\n public void run() {\n synchronized (this) {\n status = Status.PLAYING;\n }\n //every iteration pulls a new frame from the media reader\n while (true) {\n try {\n synchronized (this) {\n checkForStatusChanges();\n }\n } catch (Exception ex) {\n logger.error(Thread.currentThread().getName() + \" exception while updating media reader\", ex);\n cleanup();\n return;\n }\n try {\n if (frameIterator != null) {\n dataReader.readData(frameIterator, frameStorage);\n }\n } catch (InterruptedException ex) {\n logger.debug(Thread.currentThread().getName() + \" processor interrupted while reading data\", ex);\n cleanup();\n return;\n } catch (Exception ex) {\n logger.error(Thread.currentThread().getName() + \" exception while reading data\", ex);\n }\n if (Thread.currentThread().isInterrupted()) {\n cleanup();\n return;\n }\n }\n }", "public boolean hasMediaAssetFileHolder() {\n return instance.hasMediaAssetFileHolder();\n }", "private void getStatus() {\n\t\t\n\t}", "boolean isStatusSuspensao();", "boolean isNotAllMedia();", "public boolean getStatus() {\n return status_;\n }", "public boolean getStatus() {\n return status_;\n }", "public boolean getStatus() {\n return status_;\n }", "@java.lang.Override\n public boolean hasMediaBundle() {\n return mediaAssetCase_ == 2;\n }", "public String getStatus() {\n if (this.getSize()==0)\n return \"Error\";\n else\n return \"Ok\";\n }", "private void updateStatus(@NonNull MediaTaskStatus newStatus) {\n if (mStatus != newStatus) {\n mStatus = newStatus;\n mChanged = true;\n }\n }", "public boolean getStatus() {\n return status_;\n }", "public boolean getStatus() {\n return status_;\n }", "public boolean getStatus() {\n return status_;\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "public boolean hasStatus() {\n return result.hasStatus();\n }", "private void checkFileStatus() throws CustomException, IOException\n\t{\n\t\t//For all .mgf files\n\t\tfor (int i=0; i<mgfFiles.size(); i++)\n\t\t{\n\n\t\t\tString resultFileName = \n\t\t\t\t\tmgfFiles.get(i).substring(0,mgfFiles.get(i).lastIndexOf(\".\"))+\"_Results.csv\";\n\t\t\t//TODO: Cannot write files if checking for file. \n\t\t\t/*\n\t\t\tif (isFileUnlocked(resultFileName))\n\t\t\t\tthrow new CustomException(\"Please close \"+resultFileName, null);\n\t\t\t */\n\t\t}\n\n\t}" ]
[ "0.7323723", "0.6880129", "0.63076293", "0.6300736", "0.6211982", "0.6172703", "0.57801926", "0.5776898", "0.5736603", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.5689503", "0.56448156", "0.56229955", "0.5574844", "0.5574276", "0.5564858", "0.5558816", "0.5531022", "0.5529773", "0.5524022", "0.54933405", "0.54849404", "0.5421356", "0.5421356", "0.54167676", "0.541443", "0.54114515", "0.54110587", "0.53878295", "0.53878295", "0.53878295", "0.537821", "0.5350098", "0.53481907", "0.53481907", "0.53481907", "0.53481907", "0.53481907", "0.5320991", "0.53021026", "0.5294933", "0.5266016", "0.5258211", "0.52384746", "0.52336013", "0.523104", "0.52299106", "0.5221344", "0.5217761", "0.5214015", "0.52060264", "0.5205991", "0.5202796", "0.5199628", "0.51966286", "0.51932967", "0.5168205", "0.51637757", "0.51584685", "0.5155126", "0.5150088", "0.513239", "0.51319176", "0.51227176", "0.51216054", "0.511316", "0.5112618", "0.5112618", "0.5112618", "0.51122934", "0.5109811", "0.51067686", "0.51063824", "0.51063824", "0.51063824", "0.51037407", "0.51037407", "0.51037407", "0.51037407", "0.5103734" ]
0.5676963
31
Sets the volume for the player.
public void setVolume(double volume) { if (this.mediaPlayer == null) { return; } this.mediaPlayer.setVolume(volume); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setVolume(double volume)\n {\n mediaPlayer.setVolume(volume);\n }", "public void setVolume(float volume) {\n mediaPlayer.setVolume(volume, volume);\n }", "public void setVolume(int volume);", "public void setVolume(int v) {\n volume = v;\n }", "void volume(double volume) {\n execute(\"player.volume = \" + volume);\n }", "public void setVolume(int volume) {\n mBundle.putInt(KEY_VOLUME, volume);\n }", "void setVolume(float volume);", "public abstract SoundPlayer setVolume(int volume);", "public void setVolume(float volume) {\n }", "public void setVolume(Float volume) throws DynamicCallException, ExecutionException {\n call(\"setVolume\", volume).get();\n }", "@Override\r\n\tpublic void setVolume(float volume) {\n\t\t\r\n\t}", "public void setVolume(final int volume) {\r\n\t\tthis.volume = volume;\r\n\t}", "public Builder setVolume(int value) {\n bitField0_ |= 0x00000008;\n volume_ = value;\n onChanged();\n return this;\n }", "public void setVolume(float volume) {\r\n\t\tthis.volume = volume;\r\n\t}", "public static void setPlayerVolume(Player player, byte volume) {\n\t\tplugin.playerVolume.put(player.getName(), volume);\n\t\tNoteBlockAPI.setPlayerVolume(player, volume);\n\t}", "public void setVolume(double value) {\n this.volume = value;\n }", "public void setVolume(int volume) {\n\t\tthis.volume = volume;\n\t}", "public void setVolume(int level);", "@Override\n\t\tpublic void setVolume(int volume) {\n\t\t\tif(volume>RemoteControl.MAX_VOLUME) {\n\t\t\t\tthis.volume = RemoteControl.MAX_VOLUME;\n\t\t\t}else if(volume<RemoteControl.MIN_VOLUME) {\n\t\t\t\tthis.volume = RemoteControl.MIN_VOLUME;\n\t\t\t}else {\n\t\t\t\tthis.volume = volume;\n\t\t\t}\n\t\t\tSystem.out.println(\"현재 오디오 볼륨은 \"+this.volume);\n\t\t}", "@Override\r\n\t\tpublic void dmr_setVolume(int volume) throws RemoteException {\n\t\t\tint flag = 4097;\r\n\t\t\tmAmanager.setStreamVolume(AudioManager.STREAM_MUSIC, volume,\r\n\t\t\t\t\tflag);\r\n\t\t\tUtils.printLog(TAG, \"soundManager.setVolume\" + volume);\r\n\t\t}", "public void setVolume(int v) {\n\t\tif (On) {\n\t\t\tif (v < 0 || v > 5) {\n\t\t\t\tSystem.out.println(\"New volume not within range!\");\n\t\t\t} else {\n\t\t\t\tVolume = v;\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Radio off ==> No adjustment possible\");\n\n\t\t}\n\t}", "public void changeVolume(double volume){\n\t\tsynth.changeVolume(volume);\n\t}", "@Override\n \tpublic void onSetVolume(double arg0) {\n \t}", "public void adjustVolume(double volume) {\n try {\n controller.setGain(volume);\n this.volume = volume;\n } catch (BasicPlayerException e) {\n e.printStackTrace();\n }\n }", "public Future<Void> setVolume(Float volume) throws DynamicCallException, ExecutionException{\n return call(\"setVolume\", volume);\n }", "public void setVolume(float value){\n\t\tgainControl.setValue(value);\n\t}", "public void setVolumeProgress(Double volumeProgress) {\n this.volumeProgress = volumeProgress;\n }", "@Test\n public void setVolume() {\n final int volume = 16;\n\n getApplicationHandler().setVolume(volume, true);\n\n assertTrue(getApplicationHandler().getVolume() == volume);\n expandPanel();\n onView(withId(R.id.vli_seek_bar)).check(matches(withProgress(volume)));\n onView(withId(R.id.vli_volume_text)).check(matches(withText(String.valueOf(volume))));\n }", "@Override\n\t\t\tpublic void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) {\n\t\t\t\tmediaPlayer.setVolume(arg1, arg1);\n\t\t\t}", "public void setVolume(StarObjectClass self,float leftVolume, float rightVolume){ \r\n \t\tStarCLEMediaPlayer mediaplayer = (StarCLEMediaPlayer)WrapAndroidClass.GetAndroidObject(self,\"AndroidObject\");\r\n \t\tif( mediaplayer == null )\r\n \t\t\treturn;\r\n \t\tmediaplayer.setVolume(leftVolume,rightVolume);\r\n \t}", "@SuppressWarnings(\"unchecked\")\n\tpublic void setEffectsVolume(float volume){\n\t\tvolume = volume / 100;\n\t\tif (volume < 0){\n\t\t\tvolume = 0;\n\t\t}\t\n\t\tif (volume > 1){\n\t\t\tvolume = 1;\n\t\t}\n\t\t\n\t\tthis.mLeftVolume = this.mRightVolume = volume;\n\t\t\n\t\t// change the volume of playing sounds\n\t\tIterator<?> iter = this.mSoundIdStreamIdMap.entrySet().iterator();\n\t\twhile (iter.hasNext()){\n\t\t\tMap.Entry<Integer, Integer> entry = (Map.Entry<Integer, Integer>)iter.next();\n\t\t\tthis.mSoundPool.setVolume(entry.getValue(), mLeftVolume, mRightVolume);\n\t\t}\n\t}", "public static void setMusicVolume(int volume)\n\t{\n\t\tPreconditions.checkArgument(volume >= 0, \"Music volume was less than zero: %s\", volume);\n\t\tPreconditions.checkArgument(volume <= 100, \"Music volume was greater than 100: %s\", volume);\n\t\t\n\t\tmusicVolume = volume;\n\t}", "public void mute() {\n\t\tif (isMute) {\n\t\t\tplaybin.setVolume(0);\n\t\t\tisMute = false;\n\t\t} else {\n\t\t\tplaybin.setVolume(volume);\n\t\t\tisMute = true;\n\t\t}\n\t}", "public void setVolume(byte newVolume){\r\n\t\tvolume = newVolume > 10 ? 10 : newVolume;\r\n\t}", "public void setSoundVolume(float soundVolume) {\n _soundVolume = soundVolume;\n }", "public void start() {\n this.pause = false;\n super.setVolume(this.currentVolumeValue, this.currentVolumeValue);\n super.start();\n if(PlayerEngineImpl.this.isFadeVolume) {\n this.handler.removeCallbacks(this.volumeRunnable);\n this.currentVolumeValue = Math.max(0.0F, this.currentVolumeValue);\n this.handler.post(this.volumeRunnable);\n } else {\n super.setVolume(1.0F, 1.0F);\n }\n }", "void changeVolume(int newVolume) {\n if (newVolume < 0) {\n throw new IllegalArgumentException(\"Invalid volume\");\n }\n this.volume = newVolume;\n }", "public void increaseVolume() {\r\n\t\tvolume++;\r\n\t}", "public void setVolume(float newVolume) {\n\t\tthis.volume = newVolume;\n\t}", "protected void enableActionSetVolume()\n {\n Action action = new Action(\"SetVolume\");\n action.addInputParameter(new ParameterRelated(\"Value\", iPropertyVolume));\n iDelegateSetVolume = new DoSetVolume();\n enableAction(action, iDelegateSetVolume);\n }", "public void increaseVolume()\r\n {\r\n volume++;\r\n }", "public void adjustVolume(MediaDevice device, int volume) {\n ThreadUtils.postOnBackgroundThread(() -> {\n device.requestSetVolume(volume);\n });\n }", "public void updateVolume() {\n\t\tMixer.Info[] mixerInfos = AudioSystem.getMixerInfo();\n\n\t\tfor (Mixer.Info mixerInfo : mixerInfos) {\n\t\t\tMixer mixer = AudioSystem.getMixer(mixerInfo);\n\t\t\tLine.Info[] lineInfos = mixer.getTargetLineInfo();\n\n\t\t\tfor (Line.Info lineInfo : lineInfos) {\n\t\t\t\ttry {\n\t\t\t\t\tLine line = mixer.getLine(lineInfo);\n\t\t\t\t\tline.open();\n\t\t\t\t\tif (line.isControlSupported(FloatControl.Type.VOLUME)) {\n\t\t\t\t\t\tFloatControl volumeControl = (FloatControl) line.getControl(FloatControl.Type.VOLUME);\n\t\t\t\t\t\tvolumeControl.setValue((float) volume);\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void updateVolume(){\r\n if(currentLoop0) backgroundMusicLoop0.gainControl.setValue(Window.musicVolume);\r\n else backgroundMusicLoop1.gainControl.setValue(Window.musicVolume);\r\n }", "public void setVolume(float volume) {\n\t alSourcef(musicSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(reverseSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(flangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(revFlangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(wahSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(revWahSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(wahFlangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(revWahFlangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(distortSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(revDistortSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(distortFlangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(revDistortFlangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(wahDistortSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(revWahDistortSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(wahDistortFlangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t alSourcef(revWahDistortFlangeSourceIndex, AL_GAIN, volume / 100.0f);\n\t}", "@JsAccessible\n public void onVolumeChanged(double volume, boolean muted) {\n volumeChangedListeners.forEach(listener -> listener.accept(muted));\n }", "public static void setSoundEffectVolume(int volume)\n\t{\n\t\tPreconditions.checkArgument(volume >= 0, \"Sound effect volume was less than zero: %s\", volume);\n\t\tPreconditions.checkArgument(volume <= 100, \"Sound effect volume was greater than 100: %s\", volume);\n\t\t\n\t\tsoundEffectVolume = volume;\n\t}", "public void resetVolume() {\n\t\tthis.volume = defaultVolume;\n\t}", "public void setVolume(int level) {\n if(level >= 0 && level <= 100) {\n int checkSum = 0x07^0x01^0x00^0x44^level^level; \n String hexLevel = Integer.toHexString(level);\n if(hexLevel.length() == 1)\n hexLevel = \"0\" + hexLevel;\n String hexCheckSum = Integer.toHexString(checkSum);\n if(hexCheckSum.length() == 1)\n hexCheckSum = \"0\" + hexCheckSum;\n sendHexCommand(\"07 01 00 44 \" + hexLevel + \" \" + hexLevel + \" \"+\n hexCheckSum, 20);\n lastVolumeChange = System.currentTimeMillis();\n }\n }", "void setRemainingVolume(int newRemainingVolume) throws Exception;", "@Override\r\n\tpublic void changeVolume(int volume) {\n\t\tSystem.out.println(\"볼륨을 조절하다\");\r\n\t}", "@Test\n public void changeVolume() throws TimeoutException {\n final int volume = 16;\n expandPanel();\n\n onView(withId(R.id.vli_seek_bar)).perform(ViewActions.slideSeekBar(volume));\n\n onView(withId(R.id.vli_seek_bar)).check(matches(withProgress(volume)));\n onView(withId(R.id.vli_volume_text)).check(matches(withText(String.valueOf(volume))));\n\n getConnectionHandlerManager().waitForMethodHandled(Application.SetVolume.METHOD_NAME, 10000);\n assertTrue(\"applicationHandler volume: \"+ getApplicationHandler().getVolume()\n + \" != \" + volume, getApplicationHandler().getVolume() == volume);\n }", "public void enablePropertyVolume()\n {\n iPropertyVolume = new PropertyUint(new ParameterUint(\"Volume\"));\n addProperty(iPropertyVolume);\n }", "ModuleComponent volume();", "public void mute() {\n this.tv.setVolume(0);\r\n }", "@Override\n\tpublic void volume() {\n\t\tsolido.volume = (solido.areaBase * altura) / 3;\n\t}", "public void volumeUp() {\n\t\tvolume = volume + 10;\n\t\tplaybin.setVolumePercent(volume);\n\t}", "void setFluidContents(int volume);", "public void setVolumeSize(Integer volumeSize) {\n this.volumeSize = volumeSize;\n }", "Double volume() {\n return execute(\"player.volume\");\n }", "@Override\n\t\t\tpublic void onProgressChanged(SeekBar seekBar, int progress,\n\t\t\t\t\tboolean fromUser) {\n\t\t\t\tfloat set = (float) progress/100;\n\t\t\t\tLog.v(\"set\", set+\"\");\n\t\t\t\tmMediaPlayer[0].setVolume(set,set);\n\t\t\t}", "public void play() {\n if (audio != null) {\n audio.play(sfxVolume);\n }\n }", "public void playNewVolume(float volume) {\n\t\tif(!playing()) {\n\t\t\tplay(1f, volume, false);\n\t\t\treturn;\n\t\t}\n\t\tstop();\n\t\tfloat loc = (System.currentTimeMillis() - start) / 1000f;\n\t\tif(!music)\n\t\t\tsound.playAsSoundEffect(1.0f, volume * SoundStore.get().getSoundVolume(), false);\n\t\telse\n\t\t\tsound.playAsMusic(1.0f, volume * SoundStore.get().getSoundVolume(), false);\n\t\tloc = (System.currentTimeMillis() - start) / 1000f;\n \t\tboolean b = sound.setPosition(loc);\n\t}", "private void playVideo(float volume) {\n }", "public void increseVolume() {\n\t\tvolume++;\n\t\tSystem.out.println(\"MobilePhone当前音量为:\"+volume);\n\t}", "public static void setMasterVolume(float masterVolume){\r\n\t\tif(masterVolume <= 1.0f && masterVolume >= 0.0f){\r\n\t\t\tSound.masterVolume = masterVolume;\r\n\t\t}else if(masterVolume < 0.0f){\r\n\t\t\tSound.masterVolume = 0.0f;\r\n\t\t}else{\r\n\t\t\tSound.masterVolume = 1.0f;\r\n\t\t}\r\n\t\tSound.masterVolumeStorage = Sound.masterVolume;\r\n\t}", "@Override\n public void onSetVolume(int result) {\n Log.d(\"DLNA\", \"onSetVolume result:\" + result);\n }", "public boolean setPropertyVolume(long aValue)\n {\n return setPropertyUint(iPropertyVolume, aValue);\n }", "@FXML protected void VolumeButtonClicked(ActionEvent event) {\n if (music.getShouldPlaySFX()){\r\n MusicPlayer music2 = new MusicPlayer();\r\n music2.playSFX(MusicPlayer.Track.adjustSound);\r\n }\r\n\r\n music.setShouldPlay(!music.getShouldPlay());\r\n }", "public byte getVolume(){\r\n\t\treturn volume;\r\n\t}", "public Conserve(double pVolume) {\n\t\tthis.volume = pVolume;\n\t}", "public boolean setPropertyVolume(long aValue);", "public int getVolume() {\r\n\t\treturn volume;\r\n\t}", "int getVolume() {\n return this.volume;\n }", "public int getVolume() {\n return volume_;\n }", "@Override\n public void setAudioVolumeInsideVolumeSeekBar(int i) {\n float currentVolume = 1.0f;\n if (i < PlayerConstants.MaxProgress) {\n currentVolume = (float)(1.0f - (Math.log(PlayerConstants.MaxProgress - i) / Math.log(PlayerConstants.MaxProgress)));\n }\n setAudioVolume(currentVolume);\n //\n }", "public int getVolume() {\n return volume_;\n }", "@Override\n\tpublic void onClick(View v) {\n\t\tMainMusic.setVolume(0,0);\n\t\t\n\t}", "public int getVolume() {\n return volume;\n }", "public double getVolume() {\n return volume;\n }", "public double getVolume() { return volume; }", "public static void setKeyClickVolume(int vol) {\r\n\t\tButton.keys.setKeyClickVolume(vol);\r\n\t}", "protected void enableActionVolume()\n {\n Action action = new Action(\"Volume\");\n action.addOutputParameter(new ParameterRelated(\"Value\", iPropertyVolume));\n iDelegateVolume = new DoVolume();\n enableAction(action, iDelegateVolume);\n }", "public void enablePropertyVolumeUnity()\n {\n iPropertyVolumeUnity = new PropertyUint(new ParameterUint(\"VolumeUnity\"));\n addProperty(iPropertyVolumeUnity);\n }", "public float getVolume()\n {\n return volume;\n }", "public static void setSoundEffectsVolume(final double sfxVolume) {\n if (sfxVolume >= 0 && sfxVolume <= 1) {\n SoundEffect.sfxVolume = sfxVolume;\n }\n }", "public void decreaseVolume()\r\n {\r\n volume--;\r\n }", "public void toggle() {\n if (volume == 1f) {\n volume = 0f;\n }\n else if (volume == 0f) {\n volume = 1f;\n }\n\n }", "public static void halfVolume() {\n volume = 50;\n System.out.println(\"Volume: \" + volume);\n//end of modifiable zone(JavaCode)........E/30cff6a1-f5dd-43b9-94cb-285201f52ee7\n }", "public void setStorageVolumeInfo(VPlexStorageVolumeInfo volumeInfo) {\n storageVolumeInfo = volumeInfo;\n }", "public int getVolume() {\n\t\treturn this.volume;\n\t}", "public void setVolumeHandling(int volumeHandling) {\n mBundle.putInt(KEY_VOLUME_HANDLING, volumeHandling);\n }", "public static void setVolume(Music backgroundMusic) {\n\t\tbackgroundMusic.setVolume((Assets.musicAdjusterBounds.x - 410) / 250);\n\t\tif ((Assets.musicAdjusterBounds.x - 410) / 250 < 0) {\n\t\t\tbackgroundMusic.setVolume(0);\n\t\t\tAssets.musicAdjusterBounds.x = 410;\n\t\t}\n\t}", "public void play()\n {\n this.mediaPlayer = new MediaPlayer(file);\n this.mediaPlayer.setVolume(volume);\n\n // Listener for end of media.\n mediaPlayer.setOnEndOfMedia(() -> {\n this.mediaPlayer.stop();\n });\n\n mediaPlayer.play();\n }", "public double getVolume()\n {\n return this.volume;\n }", "public void volumeDown() {\n\t\tvolume = volume - 10;\n\t\tplaybin.setVolumePercent(volume);\n\t}", "@Override\r\n\tpublic void volumeUp() {\n\t\tSystem.out.println(\"ig tv volume on\");\r\n\r\n\t}", "public Volume()\n {\n setImage(\"volumeOn.png\");\n GreenfootImage volumeOn = getImage();\n volumeOn.scale(70,70);\n setImage(volumeOn);\n soundtrack.playLoop();\n }", "public void launch() {\n if (volume == 0f) {\n return;\n }\n MediaPlayer launch = MediaPlayer.create(context, R.raw.fire);\n launch.setVolume(volume, volume);\n launch.start();\n launch.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mediaPlayer) {\n mediaPlayer.reset();\n mediaPlayer.release();\n }\n });\n }", "public int getVolume() {\n return mBundle.getInt(KEY_VOLUME);\n }" ]
[ "0.81986195", "0.8034366", "0.78606826", "0.78514856", "0.7845462", "0.7791433", "0.7760199", "0.7649277", "0.75804424", "0.75653404", "0.75474864", "0.7497932", "0.74971384", "0.749516", "0.74713016", "0.74704796", "0.7463295", "0.7443852", "0.73646164", "0.73634404", "0.72441506", "0.7046057", "0.69616216", "0.6944935", "0.69428325", "0.69310063", "0.6916524", "0.68877494", "0.6873206", "0.6803927", "0.6746756", "0.6726684", "0.66828597", "0.6656487", "0.6630797", "0.6614776", "0.66032636", "0.6591825", "0.6581461", "0.6581262", "0.6580863", "0.6567706", "0.6567212", "0.6554127", "0.6508677", "0.64618105", "0.6415128", "0.6383861", "0.63687545", "0.63293105", "0.63158953", "0.6309262", "0.6309193", "0.6284379", "0.6271953", "0.6271122", "0.62545174", "0.62149775", "0.6194817", "0.6176809", "0.6165438", "0.6164673", "0.6160262", "0.611925", "0.60738266", "0.6064548", "0.60226583", "0.59853965", "0.5981122", "0.5977777", "0.5970846", "0.59703207", "0.5969665", "0.59592503", "0.5945029", "0.5942479", "0.59340197", "0.5930544", "0.59294957", "0.5915927", "0.58966815", "0.58629686", "0.5838428", "0.58336365", "0.58234173", "0.58079284", "0.58055145", "0.5804437", "0.5795927", "0.5792422", "0.5788964", "0.57874095", "0.57866424", "0.57697535", "0.57620347", "0.57546914", "0.57512814", "0.5737538", "0.57072216", "0.5706623" ]
0.79155236
2
Initializes and allocates the matrices buffer
public Camera(int boardWidth, int boardLength) { super(); instance = this; // TODO: improve camera init int longerSide = Math.max(boardWidth, boardLength); this.minPitch = 5; this.maxPitch = 89; this.rotation = 0; this.pitch = 20; this.distance = longerSide * 0.9f; this.minDistance = longerSide * 0.1f; this.maxDistance = 1.5f * longerSide; this.center = new Vector3f(); this.center.x = (boardWidth - 1) / 2f; this.center.z = (boardLength - 1) / 2f; this.boardLength = boardLength; this.boardWidth = boardWidth; this.space = this.maxDistance - this.minDistance; zoom(0f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Matrix() {\n\tmatrix = new Object[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "public Matrix() {\n matrix = new double[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "public void initializeIOBuffers(){\n for(int i=0; i<outputBuffer.length; i++){\n outputBuffer[i] = new LinkedBlockingQueue();\n inputBuffer[i] = new LinkedBlockingQueue();\n }\n }", "private void initializeBuffers()\n\t{\n\t\t// format vertex data so it can be passed to openGL\n\t\tFloatBuffer vertexBuffer = \n\t\t\t\tUtility.floatArrayToBuffer(mesh.vertexData);\n\t\t \n\t // create a buffer object and store the vertex data there\n\t\tvertexBufferObject = glGenBuffers();\n\t\tglBindBuffer(GL_ARRAY_BUFFER, vertexBufferObject);\n\t\tglBufferData(GL_ARRAY_BUFFER, vertexBuffer, GL_STATIC_DRAW);\n\t\tglBindBuffer(GL_ARRAY_BUFFER, 0);\n\t\t\n\t\t// format index data so it can be passed to openGL\n\t\tShortBuffer indexDataBuffer = \n\t\t\t\tUtility.shortArrayToBuffer(mesh.indexData);\n\t\t\n\t\t// create a buffer object and store the index data there\n\t\tindexBufferObject = glGenBuffers();\n\t\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBufferObject);\n\t\tglBufferData(GL_ELEMENT_ARRAY_BUFFER, indexDataBuffer, GL_STATIC_DRAW);\n\t\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\t}", "private void initializeBuffers(){\n if(isDiskBufferEnabled){\n this.persistenceService = PersistenceService.getService();\n this.synonymyBuffer = persistenceService.getMapDatabase(WIKIDATA_SYNONYMY_BUFFER);\n this.hypernymyBuffer = persistenceService.getMapDatabase(WIKIDATA_HYPERNYMY_BUFFER);\n this.askBuffer = persistenceService.getMapDatabase(WIKIDATA_ASK_BUFFER);\n } else {\n this.synonymyBuffer = new ConcurrentHashMap<>();\n this.hypernymyBuffer = new ConcurrentHashMap<>();\n this.askBuffer = new ConcurrentHashMap<>();\n }\n }", "public void createPointers() {\n int matrixByteSize = rows * cols * Sizeof.DOUBLE;\n\n deviceMPtr = new CUdeviceptr();\n cuMemAlloc(deviceMPtr, matrixByteSize);\n cuMemcpyHtoD(deviceMPtr, Pointer.to(matrix), matrixByteSize);\n\n matrixPointer = Pointer.to(deviceMPtr);\n rowPointer = Pointer.to(new int[]{rows});\n columnPointer = Pointer.to(new int[]{cols});\n sizePointer = Pointer.to(new int[]{rows * cols});\n }", "public void reAllocate() {\n\t\tmat_ = new double[n_][hbw_ + 1];\n\t}", "protected void initBuffer() throws IOException {\n if (buf != null) {\r\n Util.disposeDirectByteBuffer(buf);\r\n }\r\n // this check is overestimation:\r\n int size = bufferNumLength << Main.log2DataLength;\r\n assert (size > 0);\r\n if (Main.debug) { System.out.println(\"Allocating direct buffer of \"+bufferNumLength+\" ints.\"); }\r\n buf = ByteBuffer.allocateDirect(size).order(Main.byteOrder);\r\n buf.clear();\r\n }", "abstract void allocateBuffers();", "public Matrix(){\r\n\t\t\r\n\t\t//dim = dimension; for now, only 3-dim. matrices are being handled\r\n\t\tmat = new int[dim][dim];\r\n\t\t\r\n\t\tfor(int rowi = 0; rowi < dim; rowi++ )\r\n\t\t\tfor (int coli = 0; coli < dim; coli++)\r\n\t\t\t\tmat[rowi][coli]=0;\r\n\t}", "Matrix(){\n matrixVar = new double[1][1];\n rows = 1;\n columns = 1;\n }", "@Override\n\tpublic void initialize(int nodeCount, int patternCount, int matrixCount, boolean integrateCategories) {\n\n this.nodeCount = nodeCount;\n this.patternCount = patternCount;\n this.matrixCount = matrixCount;\n\n this.integrateCategories = integrateCategories;\n\n if (integrateCategories) {\n partialsSize = patternCount * stateCount * matrixCount;\n } else {\n partialsSize = patternCount * stateCount;\n }\n\n partials = new double[2][nodeCount][];\n// storedPartials = new double[2][nodeCount][];\n\n currentMatricesIndices = new int[nodeCount];\n storedMatricesIndices = new int[nodeCount];\n\n currentPartialsIndices = new int[nodeCount];\n storedPartialsIndices = new int[nodeCount];\n\n// states = new int[nodeCount][];\n\n for (int i = 0; i < nodeCount; i++) {\n partials[0][i] = null;\n partials[1][i] = null;\n\n// states[i] = null;\n }\n\n matrixSize = stateCount * stateCount;\n\n matrices = new double[2][nodeCount][matrixCount * matrixSize];\n }", "@Override\n public void initMatMemory(boolean[][] mat, int[] memory) {\n\n initMemory(memory);\n }", "public Matrix33() {\r\n // empty\r\n }", "public void initialize() {\n\t\tnumRows = gridConfig.getNumRows();\n\t\tnumCols = gridConfig.getNumCols();\n\t\tgridCellCount = numRows * numCols;\n\t\tcreateMaps();\n\t\tsetCurrSimulationMap();\n\t\tcellWidth = SIZE / numCols;\n\t\tcellHeight = SIZE / numRows;\n\t\tcurrentGrid = new Cell[numRows][numCols];\n\t\tnewGrid = new Cell[numRows][numCols];\n\t\tempty(currentGrid);\n\t\tempty(newGrid);\n\t\tsetShapes();\n\t\tsetInitialStates();\n\t}", "public void initialize() {\n\t\tmaze = new Block[width][height];\n\t\tborder();\n\t}", "private void initialise() {\n \thashFamily = new Hash[this.r];\n for(int i= 0; i < this.r;i++)\n {\n \tthis.hashFamily[i] = new Hash(this.s * 2);\n }\n this.net = new OneSparseRec[this.r][this.s *2];\n for(int i = 0 ; i < this.r; i++)\n \tfor(int j =0 ; j< this.s * 2 ; j++)\n \t\tthis.net[i][j] = new OneSparseRec();\n \n }", "Matrix()\n {\n x = new Vector();\n y = new Vector();\n z = new Vector();\n }", "public void initializeBuffers(){\r\n\t\ttry {\r\n\t\t\tif(_socket == null) {\r\n\t\t\t\t_connectedSocket = false;\r\n\t\t\t\tthrow(new IOException(\"Cannot initialize connections before socket has been initialized.\"));\r\n\t\t\t}\r\n\t\t\t// Obter printer e reader para o socket\r\n\t\t\t_out = new PrintWriter(_socket.getOutputStream(), true);\r\n\t\t\t_in = new BufferedReader(new InputStreamReader(_socket.getInputStream()));\r\n\t\t\t_outputStream = _socket.getOutputStream();\r\n\t\t\t_connected = true;\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Nao se conseguiram inicializar os buffers para ler da conexao: \" + e.toString());\r\n\t\t\t_connected = false;\r\n\t\t\t//System.exit(1);\r\n\t\t}\r\n\t\r\n\r\n\t}", "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}", "private void initMatrixCursor() {\n // if (mMatrixCursor != null) mMatrixCursor.close();\n mMatrixCursor = new MatrixCursor(BIND_PROJECTION, LIST_CAPACITY);\n mMatrixCursor.addRow(new String[] {\n \"1\", getResources().getString(R.string.voicemail), \"\", \"\", \"\", \"\"\n });\n mQueryTimes = SPEED_DIAL_MIN;\n }", "private void initMatrix(Canvas canvas) {\n\t\tint height = canvas.getHeight();\n\t\tint width = canvas.getWidth();\n\t\tchar[][] matrix = canvas.getMatrix();\n\n\t\tif (matrix == null) {\n\t\t\tmatrix = new char[width][height];\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\t\tmatrix[i][j] = SPACE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcanvas.setMatrix(matrix);\n\t\t}\n\t}", "public void allocArrays() {\n Preconditions.checkState(needsAllocArrays(), \"Arrays already allocated\");\n int expectedSize = this.modCount;\n this.table = newTable(Hashing.closedTableSize(expectedSize, 1.0d));\n this.entries = newEntries(expectedSize);\n this.elements = new Object[expectedSize];\n }", "public void initBuffers(VrState state);", "public void createPointersNoBackingArray() {\n int matrixByteSize = rows * cols * Sizeof.DOUBLE;\n\n deviceMPtr = new CUdeviceptr();\n cuMemAlloc(deviceMPtr, matrixByteSize);\n\n matrixPointer = Pointer.to(deviceMPtr);\n rowPointer = Pointer.to(new int[]{rows});\n columnPointer = Pointer.to(new int[]{cols});\n sizePointer = Pointer.to(new int[]{rows * cols});\n }", "public void init(float[] bias_inp, float[] bias_out,\n float[] bias_memin, float[] weight_memout,\n float outputbias) {\n cloneWeightMatrix();\n }", "private static void buffer() {\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t\tByteBuffer mBuffer=ByteBuffer.allocate(10240000);\n\t\tSystem.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n// mBuffer.clear();\n System.out.println(\"bafor\"+Runtime.getRuntime().freeMemory());\n\t}", "public void setBonesAsMatrices(@EntityInstance int i,\n @NonNull Buffer matrices, @IntRange(from = 0, to = 255) int boneCount,\n @IntRange(from = 0) int offset) {\n int result = nSetBonesAsMatrices(mNativeObject, i, matrices, matrices.remaining(), boneCount, offset);\n if (result < 0) {\n throw new BufferOverflowException();\n }\n }", "private void init() {\r\n\tlocals = new float[maxpoints * 3];\r\n\ti = new float[] {1, 0, 0};\r\n\tj = new float[] {0, 1, 0};\r\n\tk = new float[] {0, 0, 1};\r\n\ti_ = new float[] {1, 0, 0};\r\n\tk_ = new float[] {0, 0, 1};\r\n }", "protected void doInit()\r\n/* 131: */ {\r\n/* 132:194 */ this.tmpBuf = new byte[32];\r\n/* 133:195 */ engineReset();\r\n/* 134: */ }", "private void mkMesh()\n\t{\n\t\t/* this initialises the the two FloatBuffer objects */\n\t\n\t\tfloat vertices[] = {\n\t\t\t-0.5f, -0.5f, 0.0f,\t\t// V1 - bottom left\n\t\t\t-0.5f, 0.5f, 0.0f,\t\t// V2 - top left\n\t\t\t 0.5f, -0.5f, 0.0f,\t\t// V3 - bottom right\n\t\t\t 0.5f, 0.5f, 0.0f\t\t\t// V4 - top right\n\t\t\t};\n\t\tfloat texture[] = { \t\t\n\t\t\t// Mapping coordinates for the vertices\n\t\t\t0.0f, 1.0f,\t\t// top left\t\t(V2)\n\t\t\t0.0f, 0.0f,\t\t// bottom left\t(V1)\n\t\t\t1.0f, 1.0f,\t\t// top right\t(V4)\n\t\t\t1.0f, 0.0f\t\t// bottom right\t(V3)\n\t\t\t};\n\t\t/* cache the number of floats in the vertices data */\n\t\tvertexCount = vertices.length;\n\t\t\n\t\t// a float has 4 bytes so we allocate for each coordinate 4 bytes\n\t\tByteBuffer byteBuffer = ByteBuffer.allocateDirect(vertices.length * 4);\n\t\tbyteBuffer.order(ByteOrder.nativeOrder());\n\t\t\n\t\t// allocates the memory from the byte buffer\n\t\tvertexBuffer = byteBuffer.asFloatBuffer();\n\t\t\n\t\t// fill the vertexBuffer with the vertices\n\t\tvertexBuffer.put(vertices);\n\t\t\n\t\t// set the cursor position to the beginning of the buffer\n\t\tvertexBuffer.position(0);\n\t\t\n\t\tbyteBuffer = ByteBuffer.allocateDirect(texture.length * 4);\n\t\tbyteBuffer.order(ByteOrder.nativeOrder());\n\t\ttextureBuffer = byteBuffer.asFloatBuffer();\n\t\ttextureBuffer.put(texture);\n\t\ttextureBuffer.position(0);\n\t}", "protected GamaMatrix(final IScope scope, final List objects, final ILocation preferredSize, final IType contentsType) {\r\n\t\tif ( preferredSize != null ) {\r\n\t\t\tnumRows = (int) preferredSize.getY();\r\n\t\t\tnumCols = (int) preferredSize.getX();\r\n\t\t} else if ( objects == null || objects.isEmpty() ) {\r\n\t\t\tnumRows = 1;\r\n\t\t\tnumCols = 1;\r\n\t\t} else if ( GamaMatrix.isFlat(objects) ) {\r\n\t\t\tnumRows = 1;\r\n\t\t\tnumCols = objects.size();\r\n\t\t} else {\r\n\t\t\tnumCols = objects.size();\r\n\t\t\tnumRows = ((List) objects.get(0)).size();\r\n\t\t}\r\n\t\tthis.type = Types.MATRIX.of(contentsType);\r\n\t}", "private void initCostMatrix(int[][] costMatrix) {\n if (costMatrix.length != costMatrix[0].length) {\n throw new Errors.MatrixColumnsNotEqualToRows();\n }\n _matrix = new int[costMatrix.length][costMatrix.length];\n for (int i = 0; i < costMatrix.length; i++) {\n _matrix[i] = Arrays.copyOf(costMatrix[i], costMatrix[i].length);\n }\n }", "public PMVMatrix(boolean useBackingArray) {\n projectFloat = new ProjectFloat();\n \n // I Identity\n // T Texture\n // P Projection\n // Mv ModelView\n // Mvi Modelview-Inverse\n // Mvit Modelview-Inverse-Transpose\n if(useBackingArray) {\n matrixBufferArray = new float[6*16];\n matrixBuffer = null;\n // matrixBuffer = FloatBuffer.wrap(new float[12*16]);\n } else {\n matrixBufferArray = null;\n matrixBuffer = Buffers.newDirectByteBuffer(6*16 * Buffers.SIZEOF_FLOAT);\n matrixBuffer.mark();\n }\n \n matrixIdent = slice2Float(matrixBuffer, matrixBufferArray, 0*16, 1*16); // I\n matrixTex = slice2Float(matrixBuffer, matrixBufferArray, 1*16, 1*16); // T\n matrixPMvMvit = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 4*16); // P + Mv + Mvi + Mvit \n matrixPMvMvi = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 3*16); // P + Mv + Mvi\n matrixPMv = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 2*16); // P + Mv\n matrixP = slice2Float(matrixBuffer, matrixBufferArray, 2*16, 1*16); // P\n matrixMv = slice2Float(matrixBuffer, matrixBufferArray, 3*16, 1*16); // Mv\n matrixMvi = slice2Float(matrixBuffer, matrixBufferArray, 4*16, 1*16); // Mvi\n matrixMvit = slice2Float(matrixBuffer, matrixBufferArray, 5*16, 1*16); // Mvit\n \n if(null != matrixBuffer) {\n matrixBuffer.reset();\n } \n ProjectFloat.gluMakeIdentityf(matrixIdent);\n \n vec3f = new float[3];\n matrixMult = new float[16];\n matrixTrans = new float[16];\n matrixRot = new float[16];\n matrixScale = new float[16];\n matrixOrtho = new float[16];\n matrixFrustum = new float[16];\n ProjectFloat.gluMakeIdentityf(matrixTrans, 0);\n ProjectFloat.gluMakeIdentityf(matrixRot, 0);\n ProjectFloat.gluMakeIdentityf(matrixScale, 0);\n ProjectFloat.gluMakeIdentityf(matrixOrtho, 0);\n ProjectFloat.gluMakeZero(matrixFrustum, 0);\n \n matrixPStack = new ArrayList<float[]>();\n matrixMvStack= new ArrayList<float[]>();\n \n // default values and mode\n glMatrixMode(GL_PROJECTION);\n glLoadIdentity();\n glMatrixMode(GL_MODELVIEW);\n glLoadIdentity();\n glMatrixMode(GL.GL_TEXTURE);\n glLoadIdentity();\n setDirty();\n update();\n }", "protected void aInit()\n {\n \ta_available=WindowSize;\n \tLimitSeqNo=WindowSize*2;\n \ta_base=1;\n \ta_nextseq=1;\n }", "protected SimpleMatrix() {}", "public void initialize() {\n grow(0);\n }", "private void init() {\n mMemoryCache = new LruCache<String, Bitmap>(DEFAULT_MEM_CACHE_SIZE) {\n /**\n * Measure item size in kilobytes rather than units which is more\n * practical for a bitmap cache\n */\n @Override\n protected int sizeOf(String key, Bitmap bitmap) {\n final int bitmapSize = getBitmapSize(bitmap) / 1024;\n return bitmapSize == 0 ? 1 : bitmapSize;\n }\n };\n }", "public void SetMatrixToZeros() {\n \n\t/*\n\tinputs--\n\t*/\n\t\n\t/*\n\toutputs--\n\t*/\n\t\n\tthis.mat_f_m[0][0] = 0;\t this.mat_f_m[0][1] = 0;\tthis.mat_f_m[0][2] = 0;\t this.mat_f_m[0][3] = 0;\n\tthis.mat_f_m[1][0] = 0;\t this.mat_f_m[1][1] = 0;\tthis.mat_f_m[1][2] = 0;\t this.mat_f_m[1][3] = 0;\n\tthis.mat_f_m[2][0] = 0;\t this.mat_f_m[2][1] = 0;\tthis.mat_f_m[2][2] = 0;\t this.mat_f_m[2][3] = 0;\n\tthis.mat_f_m[3][0] = 0;\t this.mat_f_m[3][1] = 0;\tthis.mat_f_m[3][2] = 0;\t this.mat_f_m[3][3] = 0;\t\n \n }", "Matrix(int rows, int columns) {\n try {\n if (rows < 1 || columns < 1) {\n throw zeroSize;\n }\n this.rows = rows;\n this.columns = columns;\n matrix = new int[rows][columns];\n\n for (int rw = 0; rw < rows; rw++) {\n for (int col = 0; col < columns; col++) {\n matrix[rw][col] = (int) Math.floor(Math.random() * 100);\n }\n }\n }\n catch (Throwable zeroSize) {\n zeroSize.printStackTrace();\n }\n\n }", "public void loadMatrixIO() {\n qMatrixFile = new FileIO(\"qMatrix.txt\");\n sMatrixFile = new FileIO(\"sMatrix.txt\");\n\n }", "@Override\n\tpublic void init () {\n\t\tframeBuffers = new FrameBuffer[getPassQuantity()];\n\t\tpassShaderProviders = new ShaderProvider[getPassQuantity()];\n\n\t\tfor (int i = 0; i < getPassQuantity(); i++) {\n\t\t\tinit(i);\n\t\t}\n\t}", "public static void initializeMemory(){\n\t\tif(memory == null){\n\t\t\tmemory = new TreeMap<String,String>();\n\t\t\tfor(int i=0;i<2048;i++){\n\t\t\t\tmemory.put(Utility.decimalToHex(i, 3), null);\n\t\t\t}\n\t\t\tmemory_fmbv = new int[256];\n\t\t\tfor(int i:memory_fmbv){\n\t\t\t\tmemory_fmbv[i] = 0;\n\t\t\t}\n\t\t}\n\t\tif(diskJobStorage == null){\n\t\t\tdiskJobStorage = new TreeMap<String,DiskSMT>();\n\t\t}\n\t}", "public JCudaMatrix(int rows, int cols) {\n this.rows = rows;\n this.cols = cols;\n disposers.entrySet().stream().filter(e -> !e.getKey().keep).collect(Collectors.toList())\n .forEach(e -> disposers.remove(e.getKey()).run());\n createPointersNoBackingArray();\n disposers.put(this, this::dispose);\n }", "void fillMatrixFromQuaternion(DoubleBuffer matrix, double m_x, double m_y, double m_z, double m_w)\n\t{\t\t\n\t\t// First row\n\t\tmatrix.put(1.0 - 2.0 * ( m_y * m_y + m_z * m_z ));\n\t\tmatrix.put(2.0 * (m_x * m_y + m_z * m_w));\n\t\tmatrix.put(2.0 * (m_x * m_z - m_y * m_w));\n\t\tmatrix.put(0.0);\n\t\t\n\t\t// Second row\n\t\tmatrix.put(2.0 * ( m_x * m_y - m_z * m_w ));\n\t\tmatrix.put(1.0 - 2.0 * ( m_x * m_x + m_z * m_z ));\n\t\tmatrix.put(2.0 * (m_z * m_y + m_x * m_w ));\n\t\tmatrix.put(0.0);\n\n\t\t// Third row\n\t\tmatrix.put(2.0 * ( m_x * m_z + m_y * m_w ));\n\t\tmatrix.put(2.0 * ( m_y * m_z - m_x * m_w ));\n\t\tmatrix.put(1.0 - 2.0 * ( m_x * m_x + m_y * m_y ));\n\t\tmatrix.put(0.0);\n\n\t\t// Fourth row\n\t\tmatrix.put(0.0);\n\t\tmatrix.put(0.0);\n\t\tmatrix.put(0.0);\n\t\tmatrix.put(1.0);\n\t\t\n\t\tmatrix.flip();\n\t}", "void makeZero(){\n nnz = 0;\n for(int i=0; i<this.matrixSize; i++){\n this.rows[i] = new List();\n }\n }", "@Override\n public boolean initialize(int nNodeCount, int nPatternCount, int nMatrixCount, boolean bIntegrateCategories, boolean bUseAmbiguities) {\n\n this.m_nNodes = nNodeCount;\n this.m_nPatterns = nPatternCount;\n this.m_nMatrices = nMatrixCount;\n\n this.m_bIntegrateCategories = bIntegrateCategories;\n\n if (bIntegrateCategories) {\n m_nPartialsSize = nPatternCount * m_nStates * nMatrixCount;\n } else {\n m_nPartialsSize = nPatternCount * m_nStates;\n }\n\n m_fPartials = new double[2][nNodeCount][];\n\n m_iCurrentMatrices = new int[nNodeCount];\n m_iStoredMatrices = new int[nNodeCount];\n\n m_iCurrentPartials = new int[nNodeCount];\n m_iStoredPartials = new int[nNodeCount];\n\n //m_iCurrentStates = new int[nNodeCount];\n m_iStoredStates = new int[nNodeCount];\n\n m_iStates = new int[nNodeCount][];\n\n for (int i = 0; i < nNodeCount; i++) {\n m_fPartials[0][i] = null;\n m_fPartials[1][i] = null;\n\n m_iStates[i] = null;\n }\n\n //m_nMatrixSize = (m_nStates+1) * (m_nStates+1);\n m_nMatrixSize = m_nStates * m_nStates;\n\n m_fMatrices = new double[2][nNodeCount][nMatrixCount * m_nMatrixSize];\n \n \tm_nTopOfStack = 0;\n \tm_nOperation = new int[nNodeCount]; // #nodes\n \tm_nNode1 = new int[nNodeCount];// #nodes\n \tm_nNode2 = new int[nNodeCount];// #nodes\n \tm_nNode3 = new int[nNodeCount];// #nodes\n\n m_fRootPartials = new double[m_nPatterns * m_nStates];\n m_fPatternLogLikelihoods = new double[m_nPatterns];\n m_nPatternWeights = new int[m_nPatterns];\n return true;\n }", "public void initBufferStrategy() {\n // Triple-buffering\n createBufferStrategy(3);\n bufferStrategy = getBufferStrategy();\n }", "@SuppressWarnings(\"unchecked\")\n private void init(int capacity) {\n buffer = (T[]) new Object[capacity];\n head = 0;\n entries = 0;\n }", "static public void init() {\r\n\t\t\r\n\t\t\r\n\t\tfor(int i=MeshFrame.HEIGHT; i>=HeightScale;i-=HeightScale){\r\n\t\t\tGL11.glBegin(GL11.GL_TRIANGLE_STRIP);\r\n\t\t\tfor (int j = 0; j <= MeshFrame.WIDTH; j+=WidthScale) {\r\n\t\t\t\tGL11.glVertex3f(j, i, 0);\r\n\t\t\t\tGL11.glVertex3f(j, i-HeightScale, 0);\r\n\t\t\t}\r\n\t\t\tGL11.glEnd();\r\n\t\t\t\r\n\t\t}\t\t\r\n\t\t\r\n\t}", "public LdpcMatrix(int width, int height) {\r\n this.width = width;\r\n this.height = height;\r\n this.matrix = new byte[height][width];\r\n populate(matrix);\r\n }", "@Before\n public void setUp() throws Exception {\n myM = new Matrix();\n /** matrix1 = new int[4][4];\n for (int i = 0; i < matrix1.length; i++) {\n for (int j = 0; j < matrix1[0].length; j++) {\n if( i == j) {\n matrix1[i][j] = 1;\n }\n }\n }\n matrix2 = new int[6][6];\n for (int i = 0; i < matrix2.length; i++) {\n for (int j = 0; j < matrix2[0].length; j++) {\n matrix2[i][j] = i;\n }\n }\n matrix3 = new int[3][4];\n for (int i = 0; i < matrix3.length; i++) {\n for (int j = 0; j < matrix3[0].length; j++) {\n if( i == j) {\n matrix3[i][j] = 1;\n }\n\n }\n } **/\n }", "public void initState() {\n\n\t\tdouble bsc_p = 0.09; // TODO : doit dependre du souffle !?\n\t\tfor (int i=0; i<n; i++) lambda[i] = 0;\n\t\taddBSCnoise(lambda, bsc_p); \n\t\t// lambda: log likelihood ratio\n\t\tcalc_q0(lambda);\n\n\t\t// initialization of beta\n\t\tfor (int i = 0; i <= m - 1; i++) {\n\t\t\tfor (int j = 0; j <= row_weight[i] - 1; j++) {\n\t\t\t\tbeta[i][j] = 0.0;\n\t\t\t}\n\t\t}\t\t\n\n\t}", "public static int[][] initializeMatrix(int version) {\n\t\t\n\t\tfinal int SIZE = QRCodeInfos.getMatrixSize(version);\n\t\tint[][] matrix = new int[SIZE][SIZE];\n\t\t\n\t\tfor (int i = 0; i < SIZE; ++i) {\n\t\t\tArrays.fill(matrix[i], 0);\n\t\t}\n\t\t\n\t\treturn matrix;\n\t}", "private void initMatDef() {\n matDef = manager.getAssetFolder().getFileObject(getMatDefName());\n\n //try to read from classpath if not in assets folder and store in a virtual filesystem folder\n if (matDef == null || !matDef.isValid()) {\n try {\n fs = FileUtil.createMemoryFileSystem();\n matDef = fs.getRoot().createData(name, \"j3md\");\n OutputStream out = matDef.getOutputStream();\n InputStream in = JmeSystem.getResourceAsStream(\"/\" + getMatDefName());\n if (in != null) {\n int input = in.read();\n while (input != -1) {\n out.write(input);\n input = in.read();\n }\n in.close();\n }\n out.close();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n }", "private void initializeGrid()\n {\n \t\n // initialize grid as a 2D ARRAY OF THE APPROPRIATE DIMENSIONS\n \tgrid = new int [NUM_ROWS][NUM_COLS];\n\n\n //INITIALIZE ALL ELEMENTS OF grid TO THE VALUE EMPTY\n \tfor(int row = 0; row < NUM_ROWS; row++){\n \t\tfor(int col = 0; col < NUM_COLS; col++){\n \t\t\tgrid[row][col] = EMPTY;\n \t\t}\n \t}\n }", "public void pushMatrix() {\n buffer(() -> kernelStack = kernelStack.extend(kernel.get().asArray()));\n }", "public Matrix(int M, int N) {\n this.M = M;\n this.N = N;\n data = new double[M][N];\n }", "public void init() {\n createVertexShader(vertexShader(true));\n createFragmentShader(fragShader.SHADER_STRING);\n\n /* Binds the code and checks that everything has been done correctly. */\n link();\n\n createUniform(\"worldMatrix\");\n createUniform(\"modelMatrix\");\n createUniform(\"normalMatrix\");\n\n /* Initialization of the shadow map matrix uniform. */\n createUniform(\"directionalShadowMatrix\");\n\n /* Create uniform for material. */\n createMaterialUniform(\"material\");\n createUniform(\"texture_sampler\");\n /* Initialization of the light's uniform. */\n createUniform(\"camera_pos\");\n createUniform(\"specularPower\");\n createUniform(\"ambientLight\");\n createPointLightListUniform(\"pointLights\", LightModel.MAX_POINTLIGHT);\n createSpotLightUniformList(\"spotLights\", LightModel.MAX_SPOTLIGHT);\n createDirectionalLightUniform(\"directionalLight\");\n createUniform(\"shadowMapSampler\");\n createUniform(\"bias\");\n }", "public Matrix(int nrOfRows, int nrOfCols) {\n this.nrOfRows = nrOfRows;\n this.nrOfCols = nrOfCols;\n inner = new BigInteger[nrOfRows][nrOfCols];\n }", "public void setBuffers(KType[][] newBuffers) {\n // Check they're all the same size, except potentially the last one\n int totalLen = 0;\n for (int i = 0; i < newBuffers.length - 1; i++) {\n final int currLen = newBuffers[i].length;\n assert currLen == newBuffers[i + 1].length;\n totalLen += currLen;\n }\n buffers = newBuffers;\n blockLen = newBuffers[0].length;\n elementsCount = totalLen;\n }", "public void resetBuffer(){\n bufferSet = false;\n init();\n }", "public Matrix(int rows, int cols) {\n this.rows = rows;\n this.cols = cols;\n data = new double[rows][cols];\n }", "private void initGameMatrix() {\n double matrixTileHeight = this.fieldPane.getMaxHeight() / 11;\n double matrixTileWidth = this.fieldPane.getMaxWidth() / 11;\n\n for (int i = 0; i < this.fieldPane.getMaxWidth(); i += matrixTileWidth) {\n for (int j = 0; j < this.fieldPane.getMaxHeight(); j += matrixTileHeight) {\n Rectangle2D r = new Rectangle2D(j, i, matrixTileWidth, matrixTileHeight);\n gameMatrix.add(r);\n }\n }\n }", "public int[][] initMatrix(int n)\n {\n\t// create an empty 2d array and return it! Simple stuff here.\n\t int[][] retMatrix = new int[n][n];\n\t return retMatrix;\n }", "private void resetMatrix() {\n mSuppMatrix.reset();\n setImageViewMatrix(getDrawMatrix());\n checkMatrixBounds();\n }", "public Matrix(double[][] now) {\n\t\tmatrix = now;\n\t}", "private static void init() {\n\t\t// TODO Auto-generated method stub\n\t\tviewHeight = VIEW_HEIGHT;\n\t\tviewWidth = VIEW_WIDTH;\n\t\tfwidth = FRAME_WIDTH;\n\t\tfheight = FRAME_HEIGHT;\n\t\tnMines = N_MINES;\n\t\tcellSize = MINE_SIZE;\n\t\tnRows = N_MINE_ROW;\n\t\tnColumns = N_MINE_COLUMN;\n\t\tgameOver = win = lost = false;\n\t}", "Matrix(int r,int c)\n {\n this.r=r;\n this.c=c;\n arr=new int[r][c];\n }", "public static void createArrays() {\n\t\tinitArrays();\n\t\tcreateNodeTable();\n\t\tcreateEdgeTables();\n\t\t// Helper.Time(\"Read File\");\n\t\tcreateOffsetTable();\n\t}", "private void initializeAll() {\n initialize(rows);\n initialize(columns);\n initialize(boxes);\n }", "protected DenseMatrix()\n\t{\n\t}", "public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}", "private void initialize() {\r\n // init hidden layers\r\n for (int i = 0; i < neurons.length; i++) {\r\n for (int j = 0; j < neurons[i].length; j++) {\r\n // create neuron\r\n Neuron n = new Neuron(i, bias, this);\r\n neurons[i][j] = n;\r\n Log.log(Log.DEBUG, \"Adding Layer \" + (i + 1) + \" Neuron \" + (j + 1));\r\n }\r\n }\r\n }", "@SuppressWarnings(\"unchecked\")\n\t\tvoid init() {\n\t\t\tsetNodes(offHeapService.newArray(JudyIntermediateNode[].class, NODE_SIZE, true));\n\t\t}", "protected void aInit()\r\n {\r\n \t\t//state_sender = STATE_WAIT_FOR_CALL_0_FROM_ABOVE;\r\n \t\tpacketBufferAry = new Packet[LimitSeqNo];\r\n \t\twindow_base = FirstSeqNo;\r\n \t\tnext_seq_num = FirstSeqNo;\r\n \t\tSystem.out.println(\"|aInit| : window_base: \"+Integer.toString(window_base));\r\n \t\tSystem.out.println(\"|aInit| : next_seq_num: \"+Integer.toString(next_seq_num)); \t\t\r\n }", "public JCudaMatrix(double[] matrixArray, int rows, int cols) {\n matrix = matrixArray;\n this.rows = rows;\n this.cols = cols;\n disposers.entrySet().stream().filter(e -> !e.getKey().keep).collect(Collectors.toList())\n .forEach(e -> disposers.remove(e.getKey()).run());\n createPointers();\n disposers.put(this, this::dispose);\n }", "public void createBufferObjects(GL gl) {\n int[] vboIds = new int[2];\r\n GL11 gl11 = (GL11) gl;\r\n gl11.glGenBuffers(2, vboIds, 0);\r\n mVertexBufferObjectId = vboIds[0];\r\n mElementBufferObjectId = vboIds[1];\r\n\r\n // Upload the vertex data\r\n gl11.glBindBuffer(GL11.GL_ARRAY_BUFFER, mVertexBufferObjectId);\r\n mVertexByteBuffer.position(0);\r\n gl11.glBufferData(GL11.GL_ARRAY_BUFFER, mVertexByteBuffer.capacity(), mVertexByteBuffer, GL11.GL_STATIC_DRAW);\r\n\r\n gl11.glBindBuffer(GL11.GL_ELEMENT_ARRAY_BUFFER, mElementBufferObjectId);\r\n mIndexBuffer.position(0);\r\n gl11.glBufferData(GL11.GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer.capacity() * CHAR_SIZE, mIndexBuffer, GL11.GL_STATIC_DRAW);\r\n\r\n // We don't need the in-memory data any more\r\n mVertexBuffer = null;\r\n mVertexByteBuffer = null;\r\n mIndexBuffer = null;\r\n }", "public void populateMatrices(Matrix arrayOfMatrices[]){\n String[] rows;\n String[] columns;\n matrixCounter=0;\n try{ \n br = new BufferedReader(new FileReader(\"E:\\\\NUST\\\\6th Semester\\\\Advanced Programming - AP\\\\Labs\\\\Advanced Programming Lab-1\\\\src\\\\pk\\\\edu\\\\nust\\\\seecs\\\\bscs2\\\\advancedprogramming\\\\lab1\\\\matrices.txt\") );\n br.readLine(); //skipping first line that explains the format of matrices\n while( (currentLine = br.readLine()) != null){ \n if (currentLine.trim().length() > 0){ \n //parse the string. Get the rows and columns. Count length of rows and columns. ADD DELETE FEATURE\n rows = currentLine.split(\";\"); //get rows of current matrix\n currentMatrixRows = rows.length;\n columns = rows[0].split(\"\\\\s\"); //get each element of current row\n currentMatrixColumns = columns.length;\n //call the Matrix parameterized constructor to create a matrix of dimenstions currentMatrixRows x currentMatrixColumns\n arrayOfMatrices[matrixCounter] = new Matrix(currentMatrixRows, currentMatrixColumns); \n \n for(int i=0; i< rows.length; i++){\n columns = rows[i].split(\"\\\\s\"); //get each element of current row \n if(columns.length != currentMatrixColumns){\n System.out.println(\"INVALID MATRIX ENTERED. NUMBER OF COLUMNS IN EVERY ROW SHOULD BE EQUAL.\");\n System.exit(0); \n }\n for(int j=0; j< columns.length ; j++){ \n arrayOfMatrices[matrixCounter].setMatrixElement(i, j, Integer.parseInt(columns[j]) );\n }\n }\n //matrices.add(temp);\n totalMatrices++;\n //arrayOfMatrices[matrixCounter].toString();\n matrixCounter++;\n \n }\n } \n }catch(IOException e){\n e.printStackTrace(); \n }finally{ \n try{\n if(br!=null)\n br.close();\n }catch(IOException e){\n e.printStackTrace();\n }\n } \n \n \n// for(int i=0; i<totalMatrices;i++){\n// arrayOfMatrices[i] = new Matrix(2,3);\n// }\n }", "public static int[][] init() {\n int[][] arr={\n {0,1,0,1,0,0,0},\n {0,0,1,0,0,1,0},\n {1,0,0,1,0,1,0},\n {0,0,1,0,0,1,0},\n {0,0,1,1,0,1,0},\n {1,0,0,0,0,0,0}\n };\n return arr;\n }", "public TransformationMatrix() {\n\t\ta11 = 1; a12 = 0; a13 = 0; a14 = 0;\n\t\ta21 = 0; a22 = 1; a23 = 0; a24 = 0;\n\t\ta31 = 0; a32 = 0; a33 = 1; a34 = 0;\n\t}", "public void initIdentity() \r\n\t{\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = 0.0f;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\t}", "public void pushMatrix()\n\t{\n\t\tmats.push( new Matrix4f( mat ) );\n\t}", "private void resetBuffer() {\n baos.reset();\n }", "public Map(){\n this.matrix = new int[10][10];\n }", "public Matrix( int a ) {\n\tmatrix = new Object[a][a];\n }", "public Matrix(Matrix bb){\r\n\t\tthis.nrow = bb.nrow;\r\n\t\tthis.ncol = bb.ncol;\r\n\t\tthis.matrix = bb.matrix;\r\n\t\tthis.index = bb.index;\r\n this.dswap = bb.dswap;\r\n \t}", "protected void initialize() {\n \tm_cameraThread = new CameraThread();\n \tm_cameraThread.start();\n \tm_onTarget = false;\n \tm_moving = false;\n \tm_desiredYaw = Gyro.getYaw();\n \t\n \t\n \tcount = 0;\n }", "private void initMatrix() {\n\t\ttry {\n\t\t\tRandom random = new Random();\n\t\t\tfor (int row=0; row<_numRows; ++row) {\n\t\t\t\tfor (int column=0; column<_numColumns; ++column) {\n\t\t\t\t\t// generate alive cells, with CHANCE_OF_ALIVE chance\n\t\t\t\t\tboolean value = (random.nextInt(100) < CHANCE_OF_ALIVE);\n\t\t\t\t\t_matrix.setCellValue(row, column, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// This is not supposed to happend because we use only legal row and column numbers\n\t\t}\n\t}", "final protected void prepareVertexBuffer() {\n vertexReference = new VectorQD[calculateVertexNumber()];\n vertexBuffer = new VectorQD[vertexReference.length];\n for (int i = 0; i < vertexBuffer.length; i++) {\n vertexBuffer[i] = new VectorQD();\n }\n }", "public void reset() {\n _oldColorBuffer = _oldNormalBuffer = _oldVertexBuffer = _oldInterleavedBuffer = null;\n Arrays.fill(_oldTextureBuffers, null);\n }", "@Override\n public void loadBuffer(final Tuple3d origin, final ByteBuffer buffer) {\n this.loadGpuBuffer(origin);\n buffer.put(this.gpuBuffer);\n this.gpuBuffer.rewind();\n }", "public IBuffer newBuffer();", "private void initializeLists() {\n\t\tif (tiles == null) {\n\t\t\ttiles = new ArrayList<Tile>(gridSize * gridSize);\n\t\t} else {\n\t\t\t// Be sure to clean up old tiles\n\t\t\tfor (int i = 0; i < tiles.size(); i++) {\n\t\t\t\ttiles.get(i).freeBitmap();\n\t\t\t\ttiles = new ArrayList<Tile>(gridSize * gridSize);\n\t\t\t}\n\t\t}\n\t\ttileViews = new ArrayList<TileView>(gridSize * gridSize);\n\t\ttableRow = new ArrayList<TableRow>(gridSize);\n\n\t\tfor (int row = 0; row < gridSize; row++) {\n\t\t\ttableRow.add(new TableRow(context));\n\t\t}\n\n\t}", "public Matrix(int x, int y) {\n\t\tnrow=x;\n\t\tncol=y;\n\t\tmat = new int[x][y];\n\t\t\n\n\t}", "public void resetMMatrix() {\n Matrix.setIdentityM(mModelMatrix, 0);\n }", "public Matrix(int n) {\n\t\tsize = n;\n\t\tm = new int[size][size];\n\t}", "public BufferManager(Configuration configuration)\n {\n logger = configuration.getLogger (\"jacorb.orb.buffermanager\");\n\n try\n {\n this.time = configuration.getAttributeAsInteger(\"jacorb.bufferManagerMaxFlush\", 0);\n this.maxManagedBufferSize = configuration.getAttributeAsInteger(\"jacorb.maxManagedBufSize\", 22);\n this.threshold = configuration.getAttributeAsInteger(\"jacorb.bufferManagerThreshold\", 20);\n }\n catch (ConfigurationException ex)\n {\n logger.error (\"Error configuring the BufferManager\", ex);\n throw new INTERNAL (\"Unable to configure the BufferManager\");\n }\n \n try\n {\n expansionPolicy = (BufferManagerExpansionPolicy)\n configuration.getAttributeAsObject (\"jacorb.buffermanager.expansionpolicy\",\n DefaultExpansionPolicy.class.getName ());\n if (expansionPolicy instanceof Configurable)\n {\n ((Configurable)expansionPolicy).configure (configuration);\n }\n }\n catch (ConfigurationException e)\n {\n this.expansionPolicy = null;\n }\n \n bufferPool = initBufferPool(configuration, maxManagedBufferSize);\n \n // Partly prefill the cache with some buffers.\n int sizes [] = new int [] {1023, 2047};\n \n for (int i = 0; i < sizes.length; i++)\n {\n for( int min = 0; min < 10; min++ )\n {\n int position = calcLog(sizes[i]) - MIN_CACHE ;\n storeBuffer(position, new byte[sizes[i]]);\n }\n }\n \n if ( time > 0)\n {\n if (reaper != null)\n {\n // this is the case when\n // the BufferManager is re-configured\n reaper.dispose();\n }\n \n // create new reaper\n reaper = new Reaper(time);\n reaper.setName (\"BufferManager MaxCache Reaper\");\n reaper.setDaemon (true);\n reaper.start();\n }\n }", "public abstract void initialize (org.apache.spark.sql.expressions.MutableAggregationBuffer buffer) ;", "public Matrix(int m, int n) {\n this.m = m;\n this.n = n;\n data = new double[m][n];\n }", "public void rebuildMesh(float initX, float initY, float initZ) {\r\n VBOColorHandle = glGenBuffers();\r\n VBOVertexHandle = glGenBuffers();\r\n VBOTextureHandle = glGenBuffers();\r\n int height;\r\n FloatBuffer VertexPositionData = BufferUtils.createFloatBuffer(CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE * 72);\r\n FloatBuffer VertexColorData = BufferUtils.createFloatBuffer(CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE * 72);\r\n FloatBuffer VertexTextureData = BufferUtils.createFloatBuffer(CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE * 72);\r\n for (float x = -initX; x < -initX + CHUNK_SIZE; x++) {\r\n for (float z = -initZ; z < -initZ + CHUNK_SIZE; z++) {\r\n height = (int) (((sNoise.getNoise((int)x + (int)initX/2, (int)z + (int)initZ/2)) + 1) / 2 * 10) + 5;\r\n for (float y = 0; y <= height; y++) {\r\n VertexPositionData.put(createCube((float)(initX + x * CUBE_LENGTH), (float)(initY + y * CUBE_LENGTH), (float)(initZ + z * CUBE_LENGTH)));\r\n VertexColorData.put(createCubeVertexCol(getCubeColor(blocks[(int) x + (int)initX][(int) y][(int) z + (int)initZ])));\r\n VertexTextureData.put(createTexCube((float) 0, (float) 0, blocks[(int) x + (int)initX][(int) y][(int) z + (int)initZ]));\r\n }\r\n if (height < 11) {\r\n for (float y = height; y < 11; y++) {\r\n VertexPositionData.put(createCube((float)(initX + x * CUBE_LENGTH), (float)(initY + y * CUBE_LENGTH), (float)(initZ + z * CUBE_LENGTH)));\r\n VertexColorData.put(createCubeVertexCol(getCubeColor(blocks[(int) x + (int)initX][(int) y][(int) z + (int)initZ])));\r\n VertexTextureData.put(createTexCube((float) 0, (float) 0, blocks[(int) x + (int)initX][(int) y][(int) z + (int)initZ]));\r\n }\r\n }\r\n }\r\n }\r\n VertexColorData.flip();\r\n VertexPositionData.flip();\r\n VertexTextureData.flip();\r\n glBindBuffer(GL_ARRAY_BUFFER, VBOVertexHandle);\r\n glBufferData(GL_ARRAY_BUFFER, VertexPositionData, GL_STATIC_DRAW);\r\n glBindBuffer(GL_ARRAY_BUFFER, 0);\r\n glBindBuffer(GL_ARRAY_BUFFER, VBOColorHandle);\r\n glBufferData(GL_ARRAY_BUFFER, VertexColorData, GL_STATIC_DRAW);\r\n glBindBuffer(GL_ARRAY_BUFFER, 0);\r\n glBindBuffer(GL_ARRAY_BUFFER, VBOTextureHandle);\r\n glBufferData(GL_ARRAY_BUFFER, VertexTextureData, GL_STATIC_DRAW);\r\n glBindBuffer(GL_ARRAY_BUFFER, 0);\r\n }" ]
[ "0.65014076", "0.6386697", "0.63263637", "0.6318051", "0.617232", "0.6089018", "0.6081976", "0.6077547", "0.6047171", "0.6002671", "0.5995915", "0.5946239", "0.59334487", "0.58927906", "0.5783133", "0.5767666", "0.5749003", "0.5743227", "0.5607087", "0.55956525", "0.55929327", "0.55917525", "0.55840987", "0.5572648", "0.5569462", "0.5568349", "0.55674845", "0.5530761", "0.55028075", "0.54944044", "0.549089", "0.54828364", "0.5476523", "0.5461784", "0.54350966", "0.5426512", "0.5407842", "0.5391817", "0.53880936", "0.5366884", "0.5355623", "0.53385764", "0.53307146", "0.531678", "0.5308866", "0.5304677", "0.5288243", "0.5280078", "0.5271766", "0.5241606", "0.5240852", "0.5234058", "0.52239835", "0.52237827", "0.5219454", "0.52180743", "0.5201451", "0.5200987", "0.5199154", "0.5199032", "0.51913065", "0.51839703", "0.5173525", "0.51601744", "0.51563334", "0.5154615", "0.51131004", "0.51076525", "0.5102164", "0.5079924", "0.5077735", "0.506529", "0.50645703", "0.50550115", "0.50538886", "0.5049374", "0.5046353", "0.5044608", "0.5044131", "0.5042583", "0.50363815", "0.5035077", "0.50347215", "0.5027456", "0.50248975", "0.5023778", "0.5020384", "0.50197244", "0.50183576", "0.50166607", "0.50124866", "0.5006575", "0.50021416", "0.49995804", "0.49947366", "0.49916247", "0.4988905", "0.49873355", "0.4976956", "0.49698937", "0.49696255" ]
0.0
-1
creates a new camera with default board width
public Camera() { this(1, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Camera(int boardWidth, int boardLength) {\r\n super();\r\n instance = this;\r\n\r\n // TODO: improve camera init\r\n int longerSide = Math.max(boardWidth, boardLength);\r\n this.minPitch = 5;\r\n this.maxPitch = 89;\r\n this.rotation = 0;\r\n this.pitch = 20;\r\n this.distance = longerSide * 0.9f;\r\n this.minDistance = longerSide * 0.1f;\r\n this.maxDistance = 1.5f * longerSide;\r\n this.center = new Vector3f();\r\n this.center.x = (boardWidth - 1) / 2f;\r\n this.center.z = (boardLength - 1) / 2f;\r\n this.boardLength = boardLength;\r\n this.boardWidth = boardWidth;\r\n this.space = this.maxDistance - this.minDistance;\r\n zoom(0f);\r\n }", "private void createCamera() {\n camera = getCameraInstance();\n // Setting the right parameters in the camera\n SetCameraParameters();\n // Create our Preview view and set it as the content of our activity.\n camera_preview = new CameraPreview(this, camera);\n // Adding the camera preview after the FrameLayout and before the mainact_btn_InOutAct\n // as a separated element.\n InOut_cameraLayout.addView(camera_preview, 0);\n }", "private void configureCamera(int width, int height)\n {\n mCameraId = CAMERA_FACE_BACK;\n ///Configure camera output surfaces\n setupCameraOutputs(mWidth, mHeight);\n }", "private void openCamera(int desiredWidth, int desiredHeight) {\n if (mCamera != null) {\n throw new RuntimeException(\"camera already initialized\");\n }\n\n android.hardware.Camera.CameraInfo info = new android.hardware.Camera.CameraInfo();\n\n // Try to find a front-facing camera (e.g. for videoconferencing).\n int numCameras = android.hardware.Camera.getNumberOfCameras();\n for (int i = 0; i < numCameras; i++) {\n android.hardware.Camera.getCameraInfo(i, info);\n if (info.facing == android.hardware.Camera.CameraInfo.CAMERA_FACING_BACK) {\n mCamera = android.hardware.Camera.open(i);\n break;\n }\n }\n if (mCamera == null) {\n// Log.d(TAG, \"No front-facing camera found; opening default\");\n mCamera = android.hardware.Camera.open(); // opens first back-facing camera\n }\n if (mCamera == null) {\n throw new RuntimeException(\"Unable to open camera\");\n }\n\n android.hardware.Camera.Parameters parms = mCamera.getParameters();\n\n CameraUtils.choosePreviewSize(parms, desiredWidth, desiredHeight);\n\n // Give the camera a hint that we're recording video. This can have a big\n // impact on frame rate.\n parms.setRecordingHint(true);\n\n // leave the frame rate set to default\n mCamera.setParameters(parms);\n\n int[] fpsRange = new int[2];\n android.hardware.Camera.Size mCameraPreviewSize = parms.getPreviewSize();\n parms.getPreviewFpsRange(fpsRange);\n String previewFacts = mCameraPreviewSize.width + \"x\" + mCameraPreviewSize.height;\n if (fpsRange[0] == fpsRange[1]) {\n previewFacts += \" @\" + (fpsRange[0] / 1000.0) + \"fps\";\n } else {\n previewFacts += \" @[\" + (fpsRange[0] / 1000.0) +\n \" - \" + (fpsRange[1] / 1000.0) + \"] fps\";\n }\n// TextView text = (TextView) findViewById(R.id.cameraParams_text);\n// text.setText(previewFacts);\n\n mCameraPreviewWidth = mCameraPreviewSize.width;\n mCameraPreviewHeight = mCameraPreviewSize.height;\n\n\n// AspectFrameLayout layout = (AspectFrameLayout) findViewById(R.id.cameraPreview_afl);\n\n Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).getDefaultDisplay();\n\n if(display.getRotation() == Surface.ROTATION_0) {\n mCamera.setDisplayOrientation(90);\n// layout.setAspectRatio((double) mCameraPreviewHeight / mCameraPreviewWidth);\n } else if(display.getRotation() == Surface.ROTATION_270) {\n// layout.setAspectRatio((double) mCameraPreviewHeight/ mCameraPreviewWidth);\n mCamera.setDisplayOrientation(180);\n } else {\n // Set the preview aspect ratio.\n// layout.setAspectRatio((double) mCameraPreviewWidth / mCameraPreviewHeight);\n }\n }", "private void setupCamera(int width, int height) {\n CameraManager cameraManager = (CameraManager) getSystemService(CAMERA_SERVICE);\n try {\n if (cameraManager == null) return;\n for (String cameraId : cameraManager.getCameraIdList()) {\n CameraCharacteristics cc = cameraManager.getCameraCharacteristics(cameraId);\n if (cc.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK) {\n continue;\n }\n mCameraId = cameraId;\n\n int deviceOrientation = getWindowManager().getDefaultDisplay().getRotation();\n mTotalRotation = CameraUtils.calculateTotalRotation(cc, deviceOrientation);\n StreamConfigurationMap map = cc.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n\n int finalWidth = width;\n int finalHeight = height;\n boolean swapDimensions = mTotalRotation == 90 || mTotalRotation == 270;\n if (swapDimensions) {\n finalHeight = width;\n finalWidth = height;\n }\n mPreviewSize = CameraUtils.chooseOptimalSize(map.getOutputSizes(SurfaceTexture.class), finalWidth, finalHeight);\n mVideoSize = CameraUtils.chooseOptimalSize(map.getOutputSizes(MediaRecorder.class), finalWidth, finalHeight);\n return;\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public Camera() {\n\t\treset();\n\t}", "private void setupCamera(final int camera) {\n try {\n // mPreview = new CamPreview(this, camera, CamPreview.LayoutMode.NoBlank);// .FitToParent);\n } catch (Exception e) {\n Toast.makeText(this, R.string.cannot_connect_to_camera, Toast.LENGTH_LONG).show();\n finish();\n return;\n }\n\n RelativeLayout.LayoutParams previewLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n Display display = getWindowManager().getDefaultDisplay();\n DisplayMetrics outMetrics = new DisplayMetrics();\n display.getMetrics(outMetrics);\n\n int width = outMetrics.widthPixels;\n int height = outMetrics.heightPixels;\n\n previewLayoutParams.height = width;\n previewLayoutParams.width = width;\n\n // Un-comment below line to specify the position.\n // mPreview.setCenterPosition(width / 2, height / 2);\n\n // previewParent.addView(mPreview, 0, previewLayoutParams);\n\n\n }", "public void setupCamera() {\r\n p.camera(width/2.0f, height/2.0f, cameraZ,\r\n width/2.0f, height/2.0f, 0, 0, 1, 0);\r\n\r\n if(isTiling) {\r\n float mod=1f/10f;\r\n p.frustum(width*((float)tileX/(float)tileNum-.5f)*mod,\r\n width*((tileX+1)/(float)tileNum-.5f)*mod,\r\n height*((float)tileY/(float)tileNum-.5f)*mod,\r\n height*((tileY+1)/(float)tileNum-.5f)*mod,\r\n cameraZ*mod, 10000);\r\n }\r\n\r\n }", "public static void setCameraFrame() {\n\t\tCAMERA.src = VERTICES[CAMERA.v];\n\t\tVector zc = CAMERA.src.d.scale(-1).normalized();\n\t\tCAMERA.zAxis = zc;\n\t\tVector xc = MathUtils.cross(CAMERA.src.d, new Vector(0, 1, 0)).normalized();\n\t\tCAMERA.xAxis = xc;\n\t\tVector yc = MathUtils.cross(zc, xc).normalized();\n\t\tCAMERA.yAxis = yc;\n\t\t\n\t\tSystem.out.println(\"***** just set camera: \" + CAMERA.toString());\n\t}", "public GameController(int width, int height) {\n\n // YOUR CODE HERE\n }", "protected void createCameraPreview() {\n try {\n SurfaceTexture texture = textureView.getSurfaceTexture();\n assert texture != null;\n texture.setDefaultBufferSize(imageDimension.getWidth(), imageDimension.getHeight());\n Surface surface = new Surface(texture);\n captureRequestBuilder = cameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);\n captureRequestBuilder.addTarget(surface);\n cameraDevice.createCaptureSession(Collections.singletonList(surface), new CameraCaptureSession.StateCallback(){\n @Override\n public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) {\n if (null == cameraDevice) {\n return;\n }\n cameraCaptureSessions = cameraCaptureSession;\n updatePreview();\n }\n @Override\n public void onConfigureFailed(@NonNull CameraCaptureSession cameraCaptureSession) {\n Toast.makeText(MainActivity.this, \"Configuration change\", Toast.LENGTH_SHORT).show();\n }\n }, null);\n } catch (CameraAccessException e) {\n Toast.makeText(MainActivity.this, \"Camera Surface failed to load.\", Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }", "public void configureCamera(){\n try{\n camera = Camera.open(findBackFacingCamera());\n } catch (Exception e){}\n\n if(camera != null) {\n cameraView = new CameraView(this.getApplicationContext(), camera);\n FrameLayout camera_view = (FrameLayout)findViewById(R.id.CameraView);\n camera_view.addView(cameraView);\n }\n }", "public static Camera open() { \n return new Camera(); \n }", "@Override\n public Camera setupCamera() {\n mCamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);\n try {\n Camera.Parameters parameters = mCamera.getParameters();\n parameters.setPreviewSize(mWidth, mHeight);\n parameters.setPreviewFormat(mFormat);\n mCamera.setDisplayOrientation(90);\n for (Camera.Size size : parameters.getSupportedPreviewSizes()) {\n Log.d(TAG, \"SIZE:\" + size.width + \"x\" + size.height);\n }\n for (Integer format : parameters.getSupportedPreviewFormats()) {\n Log.d(TAG, \"FORMAT:\" + format);\n }\n\n List<int[]> fps = parameters.getSupportedPreviewFpsRange();\n for (int[] count : fps) {\n Log.d(TAG, \"T:\");\n for (int data : count) {\n Log.d(TAG, \"V=\" + data);\n }\n }\n mCamera.setParameters(parameters);\n } catch (Exception e) {\n e.printStackTrace();\n }\n if (mCamera != null) {\n mWidth = mCamera.getParameters().getPreviewSize().width;\n mHeight = mCamera.getParameters().getPreviewSize().height;\n }\n return mCamera;\n }", "Camera getCamera();", "private void setupCamera(int width, int height) {\n CameraManager cameraManager = (CameraManager) mActivity.getSystemService(Context.CAMERA_SERVICE);\n\n if (cameraManager == null) {\n return;\n }\n\n try {\n for (String cameraId : cameraManager.getCameraIdList()) {\n // get camera characteristics\n CameraCharacteristics cameraCharacteristics = cameraManager.getCameraCharacteristics(cameraId);\n\n Integer currentCameraId = cameraCharacteristics.get(CameraCharacteristics.LENS_FACING);\n if (currentCameraId == null) {\n // The return value of that key could be null if the field is not set.\n return;\n }\n if (currentCameraId != mRokidCameraParamCameraId.getParam()) {\n // if not desired Camera ID, skip\n continue;\n }\n int deviceOrientation = mActivity.getWindowManager().getDefaultDisplay().getRotation();\n mTotalRotation = CameraDeviceUtils.sensorToDeviceRotation(cameraCharacteristics, deviceOrientation, ORIENTATIONS);\n\n mImageReader = ImageReader.newInstance(mSizeImageReader.getSize().getWidth(), mSizeImageReader.getSize().getHeight(), mImageFormat, mMaxImages);\n mImageReader.setOnImageAvailableListener(mOnImageAvailableListener, mBackgroundHandler);\n\n // Check if auto focus is supported\n int[] afAvailableModes = cameraCharacteristics.get(\n CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES);\n if (afAvailableModes.length == 0 ||\n (afAvailableModes.length == 1\n && afAvailableModes[0] == CameraMetadata.CONTROL_AF_MODE_OFF)) {\n mAutoFocusSupported = false;\n } else {\n mAutoFocusSupported = true;\n }\n\n mCameraId = cameraId;\n return;\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "protected void createCameraPreview() {\n try {\n SurfaceTexture texture = mCameraTextureView.getSurfaceTexture();\n assert texture != null;\n texture.setDefaultBufferSize(mImageDimension.getWidth(), mImageDimension.getHeight());\n Surface surface = new Surface(texture);\n mCaptureRequestBuilder = mCameraDevice.\n createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW);\n mCaptureRequestBuilder.addTarget(surface);\n mCameraDevice.createCaptureSession(Collections.singletonList(surface),\n new CameraCaptureSession.StateCallback() {\n @Override\n public void onConfigured(@NonNull CameraCaptureSession cameraCaptureSession) {\n //The camera is already closed\n if (null == mCameraDevice) {\n return;\n }\n // When the session is ready, we start displaying the preview.\n mCameraCaptureSessions = cameraCaptureSession;\n updatePreview();\n }\n\n @Override\n public void onConfigureFailed(@NonNull CameraCaptureSession cameraCaptureSession) {\n Toast.makeText(CameraActivity.this, \"Configuration change\",\n Toast.LENGTH_SHORT).show();\n }\n }, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "void cameraSetup();", "public void initializeCamera(){\n mCamera = Camera.open();\n\n Camera.Parameters parameters = mCamera.getParameters();\n parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);\n\n List<Camera.Size> previewSizes = parameters.getSupportedPreviewSizes();\n // Get the supported preview size closest to the requested dimensions:\n Camera.Size previewSize = previewSizes.get(previewSizes.size() - 1); // getOptimalPreviewSize(previewSizes, width, height);\n width = previewSize.width;\n height = previewSize.height;\n Log.d(TAG, \"width: \" + width + \" , height: \" + height);\n nPixels = width * height;\n pixels = new int[nPixels];\n setSize(width, height);\n parameters.setPreviewSize(width, height);\n\n mCamera.setParameters(parameters);\n\n int dataBufferSize=(int)(height * width * (ImageFormat.getBitsPerPixel(parameters.getPreviewFormat())/8.0));\n\n mCamera.addCallbackBuffer(new byte[dataBufferSize]);\n mCamera.setPreviewCallbackWithBuffer(this);\n }", "private void configureCamera() {\n float fHeight = cam.getFrustumTop() - cam.getFrustumBottom();\n float fWidth = cam.getFrustumRight() - cam.getFrustumLeft();\n float fAspect = fWidth / fHeight;\n float yDegrees = 45f;\n float near = 0.02f;\n float far = 20f;\n cam.setFrustumPerspective(yDegrees, fAspect, near, far);\n\n flyCam.setMoveSpeed(5f);\n\n cam.setLocation(new Vector3f(2f, 4.7f, 0.4f));\n cam.setRotation(new Quaternion(0.348f, -0.64f, 0.4f, 0.556f));\n }", "private void setCamera() {\n\t\tCamera.CameraInfo cameraInfo = new Camera.CameraInfo();\n\t\tint cameraCount = Camera.getNumberOfCameras();\n\t\tLog.i(TAG, \"count = \" + cameraCount);\n\t\tLog.i(TAG, \"isBack = \" + isBack);\n\t\tint id = 0;\n\n\t\tfor (int camIdx = 0; camIdx < cameraCount; camIdx++) {\n\t\t\tCamera.getCameraInfo(camIdx, cameraInfo);\n\t\t\tLog.i(TAG, \"cameraInfoFacing = \" + cameraInfo.facing);\n\t\t\tif (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK\n\t\t\t\t\t&& isBack) {\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT\n\t\t\t\t\t&& !isBack){\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (mCamera != null) {\n\t\t\tCamera.Parameters cameraParameters = mCamera.getParameters();\n\t\t\tDisplay display = getActivity().getWindowManager().getDefaultDisplay();\n\t\t\tPoint size = new Point();\n\t\t\tdisplay.getSize(size);\n\t\t\tint screenWidth = size.x;\n\t\t\tint width = Integer.MAX_VALUE;\n\t\t\tint height = 0;\n\t\t\tLog.i(TAG, \"SCREENWIDTH: \" + screenWidth);\n\t\t\tList<Camera.Size> sizes = cameraParameters.getSupportedPreviewSizes();\n\t\t\tfor (Camera.Size cSize : sizes) {\n\t\t\t\tif (cSize.width >= screenWidth && cSize.width <= width) {\n\t\t\t\t\twidth = cSize.width;\n\t\t\t\t\theight = cSize.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tLog.i(TAG, \"Width: \" + width + \" HEIGHT: \" + height);\n\n\t\t\tif (mPreview != null) {\n\t\t\t\tmPreview.switchCamera(mCamera, id, width, height);\n\t\t\t} else {\n\t\t\t\tmPreview = new CameraPreview(getActivity(), mCamera, id, width, height);\n\t\t\t\tFrameLayout preview = (FrameLayout) view\n\t\t\t\t\t\t.findViewById(R.id.camera_preview);\n\t\t\t\tpreview.addView(mPreview);\n\t\t\t}\n\t\t\tmCamera.startPreview();\n\t\t}\n\t}", "@Override\n protected Camera getCamera() {\n return Camera.createForPositionAndAngles(new ThreeDoubleVector(31.0, 7.0, 5.5), 0.0, 0.7);\n\n // Camera for orientation curve interpolation presentation\n// return Camera.createForPositionAndAngles(new ThreeDoubleVector(54.5, 10.0, 2.5), -0.5, 0.3);\n }", "public void setCameraWidth(float width) {\n setValueInTransaction(PROP_CAMERA_WIDTH, width);\n }", "private void setCamera() {\n\t\tVector viewTranslation = controller.getCameraPosition();\n\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\t\tGL11.glMatrixMode(GL11.GL_PROJECTION);\n\t\tGL11.glLoadIdentity();\n\n\t\tfloat whRatio = (float) windowWidth / (float) windowHeight;\n\t\tGLU.gluPerspective(controller.getFOV(), whRatio, 1, 100000);\n\t\tGLU.gluLookAt((float) viewTranslation.x, (float) viewTranslation.y,\n\t\t\t\t(float) controller.getCameraDistance(), (float) viewTranslation.x,\n\t\t\t\t(float) viewTranslation.y, 0, 0, 1, 0);\n\n\t\tGL11.glMatrixMode(GL11.GL_MODELVIEW);\n\t\tGL11.glLoadIdentity();\n\t}", "protected CameraInstance createCameraInstance() {\n CameraInstance cameraInstance = new CameraInstance(getContext());\n cameraInstance.setCameraSettings(cameraSettings);\n return cameraInstance;\n }", "@Override\r\n\tpublic Board createBoard(long width, long height)\r\n\t{\r\n\t\treturn new Board(width, height);\r\n\t}", "public Camera() {\n\t\tMatrix.setIdentityM(viewMatrix, 0);\n\t\tMatrix.setIdentityM(projectionMatrix, 0);\n\t\tcomputeReverseMatrix();\n\t}", "public WinScreen()\r\n { \r\n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\r\n super(1500, 500, 1); \r\n\r\n prepare();\r\n }", "@Override\n public void resize(int width, int height) {\n camera.viewportWidth = width/25;\n camera.viewportHeight = height/25;\n camera.update();\n }", "private Camera() {\n viewport = new Rectangle();\n dirtyAreas = new ArrayList<Rectangle>();\n renderedAreas = new ArrayList<Rectangle>();\n fullUpdate = false;\n dirtyAreaCounter = 0;\n }", "public void Makeboard() {\r\n\r\n Normalboard(new Point2(20, 300));\r\n Normalboard(new Point2(224, 391));\r\n Stingboard(new Point2(156, 209));\r\n Leftlboard(new Point2(88, 482));\r\n Rightboard(new Point2(292, 573));\r\n Regenerateboard(new Point2(360, 118));\r\n\r\n }", "@Override\n\tpublic void onCameraViewStarted(int width, int height) {\n\n\n\n\t\tmRgbaT = new Mat(width, height, CvType.CV_8UC4); // NOTE width,width is NOT a typo\n\n\t}", "private Camera getCameraInstance() {\r\n Camera camera = null;\r\n try {\r\n camera = Camera.open();\r\n } catch (Exception e) {\r\n // cannot get camera or does not exist\r\n }\r\n Camera.Parameters params = camera.getParameters();\r\n\r\n List<Size> sizes = params.getSupportedPictureSizes();\r\n int w = 0, h = 0;\r\n for (Size size : sizes) {\r\n if (size.width > w || size.height > h) {\r\n w = size.width;\r\n h = size.height;\r\n }\r\n\r\n }\r\n params.setPictureSize(w, h);\r\n\r\n\r\n if (params.getSupportedFocusModes().contains(\r\n Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {\r\n params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);\r\n }\r\n params.setPictureFormat(ImageFormat.JPEG);\r\n params.setJpegQuality(100);\r\n camera.setParameters(params);\r\n\r\n\r\n return camera;\r\n }", "public void prepareCamera() {\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);\n\n autoFocusHandler = new Handler();\n mCamera = getCameraInstance();\n\n /* Instance barcode scanner */\n scanner = new ImageScanner();\n scanner.setConfig(0, Config.X_DENSITY, 3);\n scanner.setConfig(0, Config.Y_DENSITY, 3);\n\n mPreview = new CameraPreview(this, mCamera, previewCb, autoFocusCB);\n\n cameraPreview.addView(mPreview);\n\n }", "private void initPreview(int width, int height) {\n if (camera!=null && previewHolder.getSurface()!=null) {\n try {\n camera.setPreviewDisplay(previewHolder);\n }\n catch (Throwable t) {\n Log.e(\"PreviewDemo-surfaceCallback\",\n \"ExceptionsetPreviewDisplay()\", t);\n // Toast.makeText(PreviewDemo.this, t.getMessage(), Toast.LENGTH_LONG).show();\n }\n\n if (!cameraConfigured) {\n Camera.Parameters parameters=camera.getParameters();\n Camera.Size size=getBestPreviewSize(width, height,\n parameters);\n\n if (size!=null) {\n parameters.setPreviewSize(size.width, size.height);\n camera.setParameters(parameters);\n cameraConfigured=true;\n }\n }\n }\n }", "private void setupCameraOutputs(int width, int height) {\n MLog.d(TAG, \"setupCameraOutputs()\" +\n \" width: \" + width +\n \" height: \" + height);\n\n Activity activity = getActivity();\n CameraManager manager =\n (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE);\n Point displaySize = new Point();\n activity.getWindowManager().getDefaultDisplay().getSize(displaySize);\n int rotatedPreviewWidth = width;\n int rotatedPreviewHeight = height;\n int screenWidth = displaySize.x;\n int screenHeight = displaySize.y;\n // screenWidth: 720 screenHeight: 1280\n MLog.d(TAG, \"setupCameraOutputs()\" +\n \" screenWidth: \" + screenWidth +\n \" screenHeight: \" + screenHeight);\n\n try {\n for (String cameraId : manager.getCameraIdList()) {\n MLog.d(TAG, \"setupCameraOutputs()\" +\n \" cameraId: \" + cameraId);\n if (TextUtils.isEmpty(cameraId)) {\n continue;\n }\n\n mCameraId = cameraId;\n\n //获取某个相机(摄像头特性)\n CameraCharacteristics characteristics\n = manager.getCameraCharacteristics(cameraId);\n\n // 检查支持\n int deviceLevel = characteristics.get(\n CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);\n if (deviceLevel == CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY) {\n\n }\n\n // We don't use a front facing camera in this sample.\n Integer facing = characteristics.get(CameraCharacteristics.LENS_FACING);\n if (facing != null && facing == CameraCharacteristics.LENS_FACING_FRONT) {\n continue;\n }\n\n // 获取StreamConfigurationMap,它是管理摄像头支持的所有输出格式和尺寸\n StreamConfigurationMap map = characteristics.get(\n CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n if (map == null) {\n continue;\n }\n\n // 拍照时使用最大的宽高\n // For still image captures, we use the largest available size.\n Size largest = Collections.max(\n Arrays.asList(map.getOutputSizes(ImageFormat.JPEG)),\n //Arrays.asList(map.getOutputSizes(TextureView.class)),// 不能这样使用\n new CompareSizesByArea());\n // ImageFormat.JPEG largest.getWidth(): 3264 largest.getHeight(): 2448\n // ImageFormat.YV12 largest.getWidth(): 960 largest.getHeight(): 720\n // ImageFormat.YUV_420_888 largest.getWidth(): 960 largest.getHeight(): 720\n MLog.d(TAG, \"setupCameraOutputs() \" + printThis() +\n \" largest.getWidth(): \" + largest.getWidth() +\n \" largest.getHeight(): \" + largest.getHeight());\n\n /***\n * 实时帧数据获取类\n * 由于获取实时帧所以选用YV12或者YUV_420_888两个格式,暂时不采用JPEG格式\n * 在真机显示的过程中,不同的数据格式所设置的width和height需要注意,否侧视频会很卡顿\n * YV12:width 720, height 960\n * YUV_420_888:width 720, height 960\n * JPEG:获取帧数据不能用 ImageFormat.JPEG 格式,否则你会发现预览非常卡的,\n * 因为渲染 JPEG 数据量过大,导致掉帧,所以预览帧请使用其他编码格式\n *\n * 输入相机的尺寸必须是相机支持的尺寸,这样画面才能不失真,TextureView输入相机的尺寸也是这个\n */\n /*mImageReader = ImageReader.newInstance(\n largest.getWidth(),\n largest.getHeight(),\n ImageFormat.YUV_420_888,\n *//*maxImages*//*5);// ImageFormat.JPEG, 2\n mImageReader.setOnImageAvailableListener(\n mOnImageAvailableListener,\n mBackgroundHandler);*/\n\n // Find out if we need to swap dimension to get the preview size relative to sensor\n // coordinate.\n int displayRotation = activity.getWindowManager().getDefaultDisplay().getRotation();\n // noinspection ConstantConditions\n mSensorOrientation = characteristics.get(\n CameraCharacteristics.SENSOR_ORIENTATION);\n MLog.d(TAG, \"setupCameraOutputs() \" + printThis() +\n \" displayRotation: \" + displayRotation +\n \" mSensorOrientation: \" + mSensorOrientation);\n boolean swappedDimensions = false;\n switch (displayRotation) {\n // 竖屏\n case Surface.ROTATION_0:\n case Surface.ROTATION_180:\n if (mSensorOrientation == 90 || mSensorOrientation == 270) {\n swappedDimensions = true;\n }\n break;\n // 横屏\n case Surface.ROTATION_90:\n case Surface.ROTATION_270:\n if (mSensorOrientation == 0 || mSensorOrientation == 180) {\n swappedDimensions = true;\n }\n break;\n default:\n Log.e(TAG, \"Display rotation is invalid: \" + displayRotation);\n break;\n }\n\n if (swappedDimensions) {\n rotatedPreviewWidth = height;\n rotatedPreviewHeight = width;\n screenWidth = displaySize.y;\n screenHeight = displaySize.x;\n }\n\n if (screenWidth > MAX_PREVIEW_WIDTH) {\n screenWidth = MAX_PREVIEW_WIDTH;\n }\n\n if (screenHeight > MAX_PREVIEW_HEIGHT) {\n screenHeight = MAX_PREVIEW_HEIGHT;\n }\n\n // Danger, W.R.! Attempting to use too large a preview size could exceed the camera\n // bus' bandwidth limitation, resulting in gorgeous previews but the storage of\n // garbage capture data.\n mPreviewSize = chooseOptimalSize(\n map.getOutputSizes(SurfaceTexture.class),\n rotatedPreviewWidth,\n rotatedPreviewHeight,\n screenWidth,\n screenHeight,\n largest);\n // mPreviewSize.getWidth(): 960 mPreviewSize.getHeight(): 720\n MLog.d(TAG, \"setupCameraOutputs()\" +\n \" mPreviewSize.getWidth(): \" + mPreviewSize.getWidth() +\n \" mPreviewSize.getHeight(): \" + mPreviewSize.getHeight());\n\n // We fit the aspect ratio of TextureView to the size of preview we picked.\n int orientation = getResources().getConfiguration().orientation;\n // 横屏\n if (orientation == Configuration.ORIENTATION_LANDSCAPE) {\n mTextureView.setAspectRatio(\n mPreviewSize.getWidth(), mPreviewSize.getHeight());\n } else {\n mTextureView.setAspectRatio(\n mPreviewSize.getHeight(), mPreviewSize.getWidth());\n }\n\n // Check if the flash is supported.\n Boolean available = characteristics.get(\n CameraCharacteristics.FLASH_INFO_AVAILABLE);\n mFlashSupported = available == null ? false : available;\n return;\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n } catch (NullPointerException e) {\n // Currently an NPE is thrown when the Camera2API is used but not supported on the\n // device this code runs.\n Camera2Fragment.ErrorDialog.newInstance(getString(R.string.camera_error))\n .show(getChildFragmentManager(), FRAGMENT_DIALOG);\n }\n }", "public void getCameraInstance() {\n newOpenCamera();\n }", "@Override\n public void resize(int width, int height) {\n float camWidth = tileMap.tileWidth * 10.0f * cameraDistance;\n\n //for the height, we just maintain the aspect ratio\n float camHeight = camWidth * ((float)height / (float)width);\n\n cam.setToOrtho(false, camWidth, camHeight);\n uiCam.setToOrtho(false, 10,6);\n cam.position.set(cameraPosition);\n\n uiCam.update();\n cam.update();\n }", "public static Camera getCameraInstance(){\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {\n return Camera.open(0); // This is the line the error occurs\n } else {\n return Camera.open();\n }\n }", "public RobotContainer() {\n // Configure the button bindings\n configureButtonBindings();\n\n CameraServer.getInstance().startAutomaticCapture().setResolution(320, 240);\n }", "@JsConstructor\n public ScreenSpaceCameraController(Scene scene) {}", "@Override\n public void onCameraViewStarted(int width, int height) {\n mRgba = new Mat(height, width, CvType.CV_8UC4);\n mRgbaF = new Mat(width, height, CvType.CV_8UC4);\n mRgbaT = new Mat(width, height, CvType.CV_8UC4);\n Log.i(TAG, \"height : \" + height);\n Log.i(TAG, \"width : \" + width);\n //Log.i(TAG, \"mOpenCvCameraView size (w,h):\" + mOpenCvCameraView.getWidth() + \" - \" + mOpenCvCameraView.getHeight());\n }", "public void resize (int width, int height) \n\t{ \n\t\tcamera.viewportWidth = (Constants.VIEWPORT_HEIGHT / height) *\n\t\t\twidth;\n\t\tcamera.update();\n\t\tcameraGUI.viewportHeight = Constants.VIEWPORT_GUI_HEIGHT;\n\t\tcameraGUI.viewportWidth = (Constants.VIEWPORT_GUI_HEIGHT\n\t\t\t\t/ (float)height) * (float)width;\n\t\tcameraGUI.position.set(cameraGUI.viewportWidth / 2,\n\t\t\t\tcameraGUI.viewportHeight / 2, 0);\n\t\tcameraGUI.update();\n\t}", "public GameBoard (int height, int width)\n {\n mHeight = height;\n mWidth = width;\n }", "private void oldOpenCamera() {\n try {\n mCamera = Camera.open(); // attempt to get a Camera instance\n mCamera.setPreviewCallbackWithBuffer(this);\n Log.i(TAG, \"Instance created\");\n } catch (Exception e) {\n Log.e(TAG, \"Error getting Camera instance: \" + e.getMessage());\n }\n }", "public pr3s1()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(1280, 720, 1); \n prepare();\n }", "private void setUpAndConfigureCamera() {\n\t\t// Open and configure the camera\n\t\tmCamera = selectAndOpenCamera();\n\n\t\tCamera.Parameters param = mCamera.getParameters();\n\n\t\t// Smaller images are recommended because some computer vision operations are very expensive\n\t\tList<Camera.Size> sizes = param.getSupportedPreviewSizes();\n\t\tCamera.Size s = sizes.get(closest(sizes,640,360));\n\t\tparam.setPreviewSize(s.width,s.height);\n\t\tmCamera.setParameters(param);\n\n\t\t// start image processing thread\n\n\t\t// Start the video feed by passing it to mPreview\n\t\tmPreview.setCamera(mCamera);\n\t}", "public void init(Camera cam);", "public void startCamera()\n {\n startCamera(null);\n }", "public Board() {\n\t\tintializeBoard(_RowCountDefault, _ColumnCountDefault, _CountToWinDefault);\n\t}", "public void surfaceCreated(SurfaceHolder holder) {\n try {\n \tCamera.Parameters parameters = getOptimalPreviewSize(mCamera);\n \t\n \tthis.setLayoutParams(getLayoutParams(parameters.getPreviewSize()));\n \n parameters.setFlashMode(Camera.Parameters.FLASH_MODE_AUTO);\n \n parameters.setWhiteBalance(Camera.Parameters.WHITE_BALANCE_AUTO);\n \n parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);\n\n mCamera.setDisplayOrientation(90);\n \n mCamera.setParameters(parameters);\n mCamera.setPreviewDisplay(holder);\n mCamera.startPreview();\n } catch (IOException e) {\n Log.d(\"CameraView\", \"Error setting camera preview: \" + e.getMessage());\n }\n }", "void initializeCamera() {\n camera_linear = (LinearLayout) findViewById(R.id.camera_linear);\n //The preview frame is overlayed on the layout which shows the camera view.\n preview = (FrameLayout) findViewById(R.id.camera_preview);\n //Get an instance of the phone's camera.\n mCamera = cameraRecorder.getCameraInstance();\n //Find content fort the camera preview frame using the instance of the camera initialized.\n mPreview = new CameraPreview(getApplicationContext(), mCamera);\n //Apply the camera previes content from the camera to the preview frame itself.\n preview.addView(mPreview);\n }", "private void openCamera() {\n CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);\n try {\n String cameraId = manager.getCameraIdList()[0];\n CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId);\n StreamConfigurationMap map = characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n assert map != null;\n imageDimension = map.getOutputSizes(SurfaceTexture.class)[0];\n // Add permission for camera and let user grant the permission\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE}, REQUEST_CAMERA_PERMISSION);\n return;\n }\n manager.openCamera(cameraId, stateCallback, null);\n } catch (CameraAccessException e) {\n Toast.makeText(this, \"Camera failed to open.\", Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }", "private void openCamera() {\n CameraManager manager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);\n try {\n String mCameraId = manager.getCameraIdList()[0];\n CameraCharacteristics characteristics = manager.getCameraCharacteristics(mCameraId);\n StreamConfigurationMap map = characteristics.\n get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);\n assert map != null;\n mImageDimension = map.getOutputSizes(SurfaceTexture.class)[0];\n // Add permission for camera and let user grant the permission\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=\n PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE) !=\n PackageManager.PERMISSION_GRANTED) {\n\n ActivityCompat.requestPermissions(CameraActivity.this, new\n String[]{Manifest.permission.CAMERA,\n Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_CAMERA_PERMISSION);\n }\n manager.openCamera(mCameraId, mStateCallback, null);\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "public Camera(){\n // servoPan = new Servo(PAN);\n servoTilt = new Servo(TILT);\n }", "public Game(){\n\t\tDimension size = new Dimension(width * scale, height * scale);\n\t\tsetPreferredSize(size);\n\t\t\n\t\tscreen = new Screen(width, height);//instantiated the new screen\n\t\t\n\t\tframe = new JFrame();\n\t\t\n\t}", "public void surfaceCreated(SurfaceHolder holder) {\n Log.i(TAG, \"surface created\");\n if (mCamera != null) {\n final Camera.Parameters params = mCamera.getParameters();\n final List<Camera.Size> sizes = params.getSupportedPreviewSizes();\n final int screenWidth = ((View) getParent()).getWidth();\n int minDiff = Integer.MAX_VALUE;\n Camera.Size bestSize = null;\n\n /*\n * Impostazione dimensione frame a seconda delle dimensioni ottimali e dell'orientamento\n */\n if (getResources().getConfiguration().orientation\n == Configuration.ORIENTATION_LANDSCAPE) {\n for (Camera.Size size : sizes) {\n final int diff = Math.abs(size.width - screenWidth);\n if (diff < minDiff) {\n minDiff = diff;\n bestSize = size;\n }\n }\n } else {\n mCamera.setDisplayOrientation(90);\n for (Camera.Size size : sizes) {\n final int diff = Math.abs(size.height - screenWidth);\n if (Math.abs(size.height - screenWidth) < minDiff) {\n minDiff = diff;\n bestSize = size;\n }\n }\n }\n\n final int previewWidth = bestSize.width;\n final int previewHeight = bestSize.height;\n mHeight = previewHeight;\n mWidth = previewWidth;\n\n ViewGroup.LayoutParams layoutParams = getLayoutParams();\n layoutParams.height = previewHeight;\n layoutParams.width = previewWidth;\n setLayoutParams(layoutParams);\n\n // FORMATO PREVIEW\n params.setPreviewFormat(ImageFormat.NV21);\n params.setPreviewSize(previewWidth, previewHeight);\n params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);\n\n mCamera.setParameters(params);\n\n //buffer di uscita\n int size = previewWidth * previewHeight *\n ImageFormat.getBitsPerPixel(params.getPreviewFormat()) / 8;\n setupCallback(size);\n\n // Esecuzione preview\n try {\n mCamera.setPreviewDisplay(holder);\n mCamera.startPreview();\n Log.i(TAG, \"preview started\");\n } catch (IOException e) {\n Log.e(TAG, \"Error setting camera preview: \" + e.getMessage());\n }\n\n }\n }", "private void createPlayers() {\n\tGlobal.camera_player1 = new Camera(new OrthographicCamera());\n\tGlobal.camera_player2 = new Camera(new OrthographicCamera());\n\tGlobal.camera_ui = new OrthographicCamera();\n\tGlobal.player1 = new Plane(Global.player1_respawn.x,\n\t\tGlobal.player1_respawn.y, 0, new Planetype(PlaneTypes.F35),\n\t\tEntityType.PLAYER1);\n\tGlobal.player2 = new Plane(Global.player2_respawn.x,\n\t\tGlobal.player2_respawn.y, 0, new Planetype(PlaneTypes.F35),\n\t\tEntityType.PLAYER2);\n }", "public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }", "private void createCameraSource() {\n Context ctx = getApplicationContext();\n Point displaySize = new Point();\n getWindowManager().getDefaultDisplay().getRealSize(displaySize);\n\n // dummy detector saving the last frame in order to send it to Microsoft in case of face detection\n ImageFetchingDetector imageFetchingDetector = new ImageFetchingDetector();\n\n // We need to provide at least one detector to the camera :x\n FaceDetector faceDetector = new FaceDetector.Builder(ctx).build();\n faceDetector.setProcessor(\n new LargestFaceFocusingProcessor.Builder(faceDetector, new FaceTracker(imageFetchingDetector))\n .build());\n\n BarcodeDetector barcodeDetector = new BarcodeDetector.Builder(ctx).build();\n //barcodeDetector.setProcessor(new BarcodeDetectionProcessor());\n barcodeDetector.setProcessor(\n new FirstFocusingProcessor<Barcode>(barcodeDetector, new BarcodeTracker())\n );\n\n TextRecognizer textRecognizer = new TextRecognizer.Builder(ctx).build();\n textRecognizer.setProcessor(new OcrDetectionProcessor());\n // TODO: Check if the TextRecognizer is operational.\n\n MultiDetector multiDetector = new MultiDetector.Builder()\n .add(imageFetchingDetector)\n .add(faceDetector)\n .add(barcodeDetector)\n .add(textRecognizer)\n .build();\n\n mCameraSource = new CameraSource.Builder(ctx, multiDetector)\n .setFacing(CameraSource.CAMERA_FACING_BACK)\n .setAutoFocusEnabled(true)\n .setRequestedFps(5.0f)\n .setRequestedPreviewSize(displaySize.y, displaySize.x)\n .build();\n }", "private void openCamera(int width, int height) {\n setupCamera(width, height);\n configureTransform(width, height);\n Activity activity = mActivity;\n CameraManager cameraManager = (CameraManager) mActivity.getSystemService(Context.CAMERA_SERVICE);\n try {\n if (ContextCompat.checkSelfPermission(mActivity, Manifest.permission.CAMERA) ==\n PackageManager.PERMISSION_GRANTED) {\n // connect the camera\n // TODO: add comments\n cameraManager.openCamera(mCameraId, mStateCallback, mBackgroundHandler);\n }\n } catch (CameraAccessException e) {\n e.printStackTrace();\n }\n }", "private void createCameraSource() {\n\n int facing = CameraSource.CAMERA_FACING_FRONT;\n\n // If there's no existing cameraSource, create one.\n if (cameraSource == null) {\n cameraSource = new CameraSource(this, graphicOverlay);\n }\n\n CameraSource.setFacing(facing);\n cameraSource.setMachineLearningFrameProcessor(\n new FaceDetectorProcessor(this, defaultOptions));\n }", "public WorldScene makeScene() {\r\n WorldScene scene = this.getEmptyScene();\r\n //make the image to draw \\/ \\/\r\n WorldImage cell = new EmptyImage();\r\n\r\n if (this.allCellsFlooded()) {\r\n cell = this.drawWin();\r\n }\r\n else if (this.currTurn >= this.maxTurn) {\r\n cell = this.drawLose();\r\n }\r\n else {\r\n cell = this.drawBoard();\r\n }\r\n\r\n //place the image on the scene \\/ \\/\r\n scene.placeImageXY(cell, 100, 200);\r\n\r\n return scene;\r\n }", "RasPiBoard createRasPiBoard();", "public Player(int width, int height)\n {\n this.width = width;\n this.height = height;\n createImage();\n }", "public PersonalBoard(int width, int height){\n super(width, height);\n this.rand = new Random();\n }", "public GameController(int width, int height) {\n\n this.width=width;\n this.height=height;\n model = new GameModel(width,height);\n view = new GameView(model,this);\n }", "Board() {\n\t\tswitch (Board.boardType) {\n\t\tcase Tiny:\n\t\t\tthis.dimensions = TinyBoard; break;\n\t\tcase Giant:\n\t\t\tthis.dimensions = GiantBoard; break;\n\t\tdefault:\n\t\t\tthis.dimensions = StandardBoard; break;\n\t\t}\n\t\tboard = new Square[dimensions.x][dimensions.y];\n\t\tinit();\n\t}", "protected WorldController() {\n\t\tthis(new Rectangle(0,0,DEFAULT_WIDTH,DEFAULT_HEIGHT), \n\t\t\t\tnew Vector2(0,DEFAULT_GRAVITY));\n\t}", "public void restoreCamera() {\r\n float mod=1f/10f;\r\n p.camera(width/2.0f, height/2.0f, cameraZ,\r\n width/2.0f, height/2.0f, 0, 0, 1, 0);\r\n p.frustum(-(width/2)*mod, (width/2)*mod,\r\n -(height/2)*mod, (height/2)*mod,\r\n cameraZ*mod, 10000);\r\n }", "@Override\r\n\tpublic void surfaceCreated(SurfaceHolder holder) {\n\t\tinitialCamera();\r\n\t}", "private Camera getCameraInstance() {\n Camera c = null;\n try {\n c = Camera.open(); // attempt to get a Camera instance\n\n Camera.Parameters params = c.getParameters();\n List<Camera.Size> sizes = params.getSupportedPictureSizes();\n\n // set the second lowest resolution for taking snapshots\n params.setPictureSize(sizes.get(sizes.size() - 2).width, sizes.get(sizes.size() - 2).height);\n\n c.setParameters(params);\n } catch (Exception e) {\n // Camera is not available (in use or does not exist)\n }\n return c;\n }", "public static Studio createStudio()\n\t{\n\t\tStudio studio = new Studio();\n\n\t\t// the scene\n\t\tSceneObjectContainer scene = new SceneObjectContainer(\"the scene\", null, studio);\n\n\t\t// start by defining the camera so that we can calculate, from the shutter model, what is in focus and then place something there\n\t\t\n\t\t// define the camera\n\t\t//\n\t\t// Note that the view direction and basis Vector3Ds of the detector are chosen such that\n\t\t// the x, y, z axes form a LEFT-handed coordinate system.\n\t\t// The reason is that, in the photo, the positive x direction is then to the right,\n\t\t// the positive y direction is upwards, and the camera looks in the positive z direction.\n\t\tint\n\t\tpixelsX = 640,\n\t\tpixelsY = 480;\n\t\t\n\t\t\n\t\t// the camera-frame scene\n\t\tEditableSceneObjectCollection cameraFrameScene = new EditableSceneObjectCollection(\"camera-frame scene\", false, scene, studio);\n//\t\tif(LORENTZ_WINDOW)\n//\t\t{\n//\t\t\tcameraFrameScene.addSceneObject(new EditableParametrisedPlane(\n//\t\t\t\t\"Lorentz window\",\t// description\n//\t\t\t\tshutterPlanePoint,\t// pointOnPlane\n//\t\t\t\tbeta,\t// normal\n//\t\t\t\tnew LorentzTransformInterface(\n//\t\t\t\t\t\tbeta,\n//\t\t\t\t\t\tCoordinateSystemType.GLOBAL_BASIS,\n//\t\t\t\t\t\t0.96,\t// transmission coefficient\n//\t\t\t\t\t\tfalse\t// shadow-throwing?\n//\t\t\t\t\t),\t// SurfaceProperty\n//\t\t\t\tcameraFrameScene,\t// parent,\n//\t\t\t\tnull\t// studio\n//\t\t\t\t));\n//\t\t}\n\t\t\n\t\tEditableRelativisticAnyFocusSurfaceCamera camera = new EditableRelativisticAnyFocusSurfaceCamera(\n\t\t\t\t\"Camera\",\n\t\t\t\tnew Vector3D(0, 0, 0),\t// centre of aperture\n\t\t\t\tnew Vector3D(0, 0, 1),\t// viewDirection\n\t\t\t\tnew Vector3D(0, 1, 0),\t// top direction vector\n\t\t\t\t20,\t// horiontalViewAngle in degrees; 2*MyMath.rad2deg(Math.atan(2./10.)) gives same view angle as in previous version\n\t\t\t\tSpaceTimeTransformationType.LORENTZ_TRANSFORMATION,\n\t\t\t\t(BETA_0?new Vector3D(0, 0, 0):beta),\t// beta\n\t\t\t\tpixelsX, pixelsY,\t// logical number of pixels\n\t\t\t\tExposureCompensationType.EC0,\t// exposure compensation +0\n\t\t\t\t1000,\t// maxTraceLevel\n\t\t\t\tnew EditableParametrisedPlane(\n\t\t\t\t\t\t\"focussing plane\",\n\t\t\t\t\t\tnew Vector3D(0, 0, FOCUSSING_DISTANCE),\t// point on plane\n\t\t\t\t\t\tnew Vector3D(0, 0, 1),\t// normal to plane\n\t\t\t\t\t\tSurfaceColour.BLACK_SHINY,\n\t\t\t\t\t\tscene,\n\t\t\t\t\t\tstudio\n\t\t\t\t),\t// focusScene,\n\t\t\t\tcameraFrameScene,\t//cameraFrameScene,\n\t\t\t\tAPERTURE_SIZE,\t// aperture size\n\t\t\t\tTEST?QualityType.BAD:QualityType.GREAT,\t// blur quality\n\t\t\t\tTEST?QualityType.NORMAL:QualityType.GOOD\t// QualityType.GREAT\t// anti-aliasing quality\n\t\t);\n\n\t\t// the reference shutter model\n\t\tFixedPointSurfaceShutterModel shutterModel = new FixedPointSurfaceShutterModel(beta);\t\t\n\t\tcamera.setShutterModel(shutterModel);\n\t\t\n\t\t// the standard scene objects\n\t\tscene.addSceneObject(SceneObjectClass.getChequerboardFloor(scene, studio));\t// the checkerboard floor\n\t\tscene.addSceneObject(SceneObjectClass.getSkySphere(scene, studio));\t// the sky\n\n\t\t// the cylinder lattice from TIMInteractiveBits's populateSceneRelativisticEdition method\n\t\tdouble cylinderRadius = 0.02;\n\n\t\t// a cylinder lattice...\n\t\tscene.addSceneObject(new EditableCylinderLattice(\n\t\t\t\t\"cylinder lattice\",\n\t\t\t\t-1.5, 1.5, 4,\t// x_min, x_max, no of cylinders => cylinders at x=-1.5, -0.5, +0.5, +1.5\n\t\t\t\t-1.5, 1.5, 4,\t// y_min, y_max, no of cylinders => cylinders at y=-1.5, -0.5, +0.5, +1.5\n\t\t\t\t-1, 10, 12, // z_min, z_max, no of cylinders => cylinders at z=-1, 0, 1, 2, ..., 10\n\t\t\t\tcylinderRadius,\n\t\t\t\tscene,\n\t\t\t\tstudio\n\t\t\t\t));\t\t\n\n\t\t// Tim's head\n\t\t// scene.addSceneObject(new EditableTimHead(\"Tim's head\", new Vector3D(0, 0, 10), scene, studio));\n\n\t\t// the Ninky Nonk Silhouette\n\t\tscene.addSceneObject(new EditableNinkyNonkSilhouette(scene, studio));\n\n\n\t\tstudio.setScene(scene);\n\t\tstudio.setLights(LightSource.getStandardLightsFromBehind());\n\t\tstudio.setCamera(camera);\n\n\t\treturn studio;\n\t}", "static private Screen createScreen() {\n Screen test = new Screen();\n //These values below, don't change\n test.addWindow(1,1,64, 12);\n test.addWindow(66,1,64,12);\n test.addWindow(1,14,129,12);\n test.setWidthAndHeight();\n test.makeBoarders();\n test.setWindowsType();\n test.draw();\n return test;\n }", "public Board() {\r\n\t\tthis.size = 4;\r\n\t\tthis.gameBoard = createBoard(4);\r\n\t\tthis.openTiles = 16;\r\n\t\tthis.moves = 0;\r\n\t\tthis.xValues = new boolean[4][4];\r\n\t\tthis.yValues = new boolean[4][4];\r\n\t\tthis.complete = false;\r\n\t}", "public ReflectedCamera(Camera camera) {\n this(camera, true);\n }", "Board() {\n this.cardFactory = new CardFactory(this);\n }", "public void create() {\n\t\trandomUtil = new RandomUtil();\n\t\t// create the camera using the passed in viewport values\n\t\tcamera = new OrthographicCamera(viewPortWidth, viewPortHeight);\n\t\tbatch.setProjectionMatrix(camera.combined);\n\t\tdebugRender = new Box2DDebugRenderer(true, false, false, false, false, true);\n\t\ttestWorld = new TestWorld(assetManager.blockManager(), new Vector2(0, 0f));\n\t\ttestWorld.genWorld(debugUtil);\n\t\ttestWorld.setCamera(getCamera());\n\t\tplayer.createBody(testWorld.getWorld(), BodyType.DynamicBody);\n\t\ttestWorld.getPlayers().add(player);\n\t\tworldParser = new WorldParser(testWorld, \"Test World\");\n\t\tworldParser = new WorldParser(testWorld, \"Test Write\");\n\t\tworldParser.parseWorld();\n\t\twriter = new WorldWriter(\"Test Write\", testWorld);\n\t}", "public CaptureImage()\r\n\t{\r\n\t\tSystem.loadLibrary(Core.NATIVE_LIBRARY_NAME);\r\n\t\tcapturedFrame = new Mat();\r\n\t\tprocessedFrame = new Mat();\r\n\t\tboard = new byte[32];\r\n\t\tfor (int i=0;i<board.length;i++){\r\n\t\t\tboard[i] = 0;\r\n\t\t}\r\n\t\tcaptured = new byte[12];\r\n\t}", "public CameraSubsystem() {\n\t\t// TODO Auto-generated constructor stub\t\t\n\t\tnetworkTableValues.put(\"area\", (double) 0);\n\t\tnetworkTableValues.put(\"centerX\", (double) 0);\n\t\tnetworkTableValues.put(\"centerY\", (double) 0);\n\t\tnetworkTableValues.put(\"width\", (double) 0);\n\t\tnetworkTableValues.put(\"height\", (double) 0);\n\t\t\n\t\tcoordinates.put(\"p1x\", (double) 0);\n\t\tcoordinates.put(\"p1y\", (double) 0);\n\t\tcoordinates.put(\"p2x\", (double) 0);\n\t\tcoordinates.put(\"p2y\", (double) 0);\n\t\tcoordinates.put(\"p3x\", (double) 0);\n\t\tcoordinates.put(\"p3y\", (double) 0);\n\t\tcoordinates.put(\"p4x\", (double) 0);\n\t\tcoordinates.put(\"p4y\", (double) 0);\n\n\t\t\n\t}", "public Pj3dCamera Camera()\r\n\t{\r\n\t\tPj3dCamera cam = new Pj3dCamera(this);\r\n\t\treturn cam;\r\n\t}", "public void setSize(int w, int h){\n this.width = w;\n this.height = h;\n ppuX = (float)width / CAMERA_WIDTH;\n ppuY = (float)height / CAMERA_HEIGHT;\n }", "MainBoard createMainBoard();", "private void setTheScene()\n {\n board.setLocalRotation(Quaternion.IDENTITY);\n board.rotate(-FastMath.HALF_PI, -FastMath.HALF_PI, 0);\n board.setLocalTranslation(0, 0, -3);\n\n cam.setLocation(new Vector3f(0, 0, 10));\n cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y);\n }", "private void setCamera(GL2 gl, GLU glu)\n {\n Boundary bc = simulation.getBoundary();\n int w = (int) (bc.getMaxSize(0)-bc.getMinSize(0));\n int h = (int) (bc.getMaxSize(1)-bc.getMinSize(1));\n\n gl.glViewport(0, 0, w, h);\n\n\n gl.glMatrixMode(GL2.GL_PROJECTION);\n gl.glLoadIdentity();\n //opening angle, ratio of height and width, near and far\n glu.gluPerspective(80.0, 1,0.1,3*( bc.getMaxSize(2)-bc.getMinSize(2)));\n\n gl.glTranslatef(0.5f*(float) bc.getMinSize(0),-0.5f*(float) bc.getMinSize(1),1.5f*(float) bc.getMinSize(2));\n // gl.glTranslatef(0.5f*(float) (bc.getMaxSize(0)+bc.getMinSize(0)),0.5f*(float)(bc.getMaxSize(1)+ bc.getMinSize(1)),(float) -(bc.getMaxSize(2)-bc.getMinSize(2)));\n\n }", "public void surfaceCreated(SurfaceHolder holder) {\n\t\tthis.camera = Camera.open();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tcamera.setDisplayOrientation(90);\r\n\t\t\tcamera.setPreviewDisplay(holder);\r\n\t\t} catch (IOException e) {\r\n\t\t\tcamera.release();\r\n\t\t\tcamera = null;\r\n\t\t\tToast.makeText(this.getContext(), \"Error \"+e.toString(), Toast.LENGTH_LONG).show();\r\n\t\t}\r\n\t\t\t\t\t\t\r\n\t}", "public void adjustCameraParameters() {\n SortedSet<Size> sizes = this.mPreviewSizes.sizes(this.mAspectRatio);\n if (sizes == null) {\n this.mAspectRatio = chooseAspectRatio();\n sizes = this.mPreviewSizes.sizes(this.mAspectRatio);\n }\n Size chooseOptimalSize = chooseOptimalSize(sizes);\n Size last = this.mPictureSizes.sizes(this.mAspectRatio).last();\n if (this.mShowingPreview) {\n this.mCamera.stopPreview();\n }\n this.mCameraParameters.setPreviewSize(chooseOptimalSize.getWidth(), chooseOptimalSize.getHeight());\n this.mCameraParameters.setPictureSize(last.getWidth(), last.getHeight());\n this.mCameraParameters.setRotation(calcCameraRotation(this.mDisplayOrientation));\n setAutoFocusInternal(this.mAutoFocus);\n setFlashInternal(this.mFlash);\n this.mCamera.setParameters(this.mCameraParameters);\n if (this.mShowingPreview) {\n this.mCamera.startPreview();\n }\n }", "@Override\n\tpublic void resize(int width, int height) {\n\t\tviewCamera.viewportWidth = width;\n\t\tviewCamera.viewportHeight = height;\n\t\tviewCamera.position.set(0, 0, 0);\n\t\tviewCamera.update();\n\n\t\tVector3 min = MIN_BOUND.cpy();\n\t\tVector3 max = new Vector3(MAX_BOUND.x - width, MAX_BOUND.y - height, 0);\n\t\tviewCamera.project(min, 0, 0, width, height);\n\t\tviewCamera.project(max, 0, 0, width, height);\n\t\tbounds = new BoundingBox(min, max);\n\t\t// do a pan to reset camera position\n\t\tpan(min);\n\t}", "@Override\n\tpublic EngineOptions onCreateEngineOptions() {\n\t\t\n\t\t// Device properties & dimensions\n\t\tDisplay display = getWindowManager().getDefaultDisplay();\n\t\tPoint size = new Point();\n\t\tdisplay.getSize(size);\n\t\tint width = size.x;\n\t\tint height = size.y;\n\t\t\n\t\tCAMERA_WIDTH = width;\n\t\tCAMERA_HEIGHT = height;\n\t\t\n\t\tfinal Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);\n\n\t\treturn new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);\n\t}", "@Override\n public void init() {\n startCamera();\n }", "@Override\n\tpublic void surfaceCreated(SurfaceHolder holder) {\n\t\tLog.e(TAG,\"Surface Created\");\n\t\tcamera = Camera.open();\n\t}", "public PlayerWL() {\n super();\n rotateYAxis = 0;\n positionZ = 0;\n positionX = 0;\n camera = new PerspectiveCamera(true);\n camera.getTransforms().addAll(\n new Rotate(0, Rotate.Y_AXIS),\n new Rotate(-10, Rotate.X_AXIS),\n new Translate(0, 0, 0));\n cameraGroup = new Group(camera);\n camera.setRotationAxis(new Point3D(0, 1, 0));\n }", "public CameraManager(HardwareMap hardwareMap) {\n int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier(\"cameraMonitorViewId\", \"id\", hardwareMap.appContext.getPackageName());\n phoneCam = OpenCvCameraFactory.getInstance().createInternalCamera(OpenCvInternalCamera.CameraDirection.BACK, cameraMonitorViewId);\n pipeline = new CvPipeline();\n phoneCam.setPipeline(pipeline);\n }", "public abstract Matrix4f getCameraMatrix();", "@Override\r\n\tpublic void surfaceCreated(SurfaceHolder holder) \r\n\t{\n\t\t if (mCamera != null)\r\n\t\t {\r\n\t\t\t Parameters params = mCamera.getParameters();\r\n\t mCamera.setParameters(params);\r\n\t Log.i(\"Surface\", \"Created\");\r\n\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t Toast.makeText(getApplicationContext(), \"Camera not available!\",\r\n\t Toast.LENGTH_LONG).show();\r\n\r\n\t finish();\r\n\t }\r\n\t}", "private void init()\n {\n batch = new SpriteBatch();\n \n camera = new OrthographicCamera(Constants.VIEWPORT_WIDTH, Constants.VIEWPORT_HEIGHT);\n camera.position.set(0, 0, 0);\n camera.update();\n \n cameraGui = new OrthographicCamera(Constants.VIEWPORT_GUI_WIDTH, Constants.VIEWPORT_GUI_HEIGHT);\n cameraGui.position.set(0, 0, 0);\n cameraGui.setToOrtho(true); // flip y-axis\n cameraGui.update();\n \n cameraBg = new OrthographicCamera(Constants.VIEWPORT_GUI_WIDTH, Constants.VIEWPORT_GUI_HEIGHT);\n cameraBg.position.set(0, 0, 0);\n //cameraBg.setToOrtho(true);\n cameraBg.update();\n \n b2Debug = new Box2DDebugRenderer();\n }", "public wall() { //default constructor makes a 10x10 square extending right and down from the pixel located at 5,5\r\n x = 5;\r\n y = 5;\r\n height = 10;\r\n width = 10;\r\n }", "void createPlanetSurface(int width, int height) {\r\n\t\trenderer.surface = new PlanetSurface();\r\n\t\trenderer.surface.width = width;\r\n\t\trenderer.surface.height = height;\r\n\t\trenderer.surface.computeRenderingLocations();\r\n\t\tui.allocationPanel.buildings = renderer.surface.buildings;\r\n\t}", "public RobotWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(800, 600, 1); \n prepare();\n }", "public void setCameraPreviewSize(int width, int height) {\n Log.d(TAG, \"setCameraPreviewSize\");\n mIncomingWidth = width;\n mIncomingHeight = height;\n mIncomingSizeUpdated = true;\n }" ]
[ "0.67915684", "0.64111626", "0.63647306", "0.6363759", "0.63456273", "0.6298079", "0.6294579", "0.60722536", "0.6056207", "0.60507417", "0.6041617", "0.6035811", "0.60208005", "0.6013644", "0.59605396", "0.5958584", "0.59551257", "0.59340423", "0.591561", "0.59148467", "0.59018916", "0.58950216", "0.5885502", "0.5844353", "0.58378065", "0.58317554", "0.5818374", "0.581533", "0.5802072", "0.57799", "0.57612777", "0.57591784", "0.5729303", "0.572504", "0.5719005", "0.57143456", "0.569456", "0.5689582", "0.56771535", "0.5667218", "0.56620085", "0.5646428", "0.5616438", "0.56119305", "0.5606477", "0.5604264", "0.5592702", "0.5590845", "0.5579511", "0.5567567", "0.55651456", "0.55531794", "0.55529803", "0.55464613", "0.5526052", "0.55226505", "0.5522131", "0.55210876", "0.5505735", "0.55050427", "0.5503965", "0.5499094", "0.54943216", "0.5490768", "0.5473733", "0.54631686", "0.54618686", "0.5456721", "0.54537183", "0.54533696", "0.5439906", "0.5435828", "0.5435138", "0.54312027", "0.54085386", "0.53828406", "0.5382828", "0.537654", "0.5366853", "0.5362362", "0.53593963", "0.5357259", "0.53495514", "0.5348168", "0.534679", "0.5334308", "0.53309304", "0.5329432", "0.53259194", "0.5317883", "0.5301585", "0.5301501", "0.5296484", "0.52832884", "0.5280563", "0.52792", "0.5269079", "0.5263591", "0.52624774", "0.5261021" ]
0.67944545
0
sets the dimensions of the map to the given values
public void setMapDimensions(int boardWidth, int boardLength) { int longerSide = Math.max(boardWidth, boardLength); this.distance = longerSide * 0.9f; this.minDistance = longerSide * 0.1f; this.maxDistance = 1.5f * longerSide; this.center = new Vector3f(); this.center.x = (boardWidth - 1) / 2f; this.center.z = (boardLength - 1) / 2f; this.boardLength = boardLength; this.boardWidth = boardWidth; this.space = this.maxDistance - this.minDistance; zoom(0f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setDimension(double width, double height);", "@Override\n\tpublic void setDimensions() {\n\t\t\n\t}", "public void set_map(int[][] map) \n\t{\n\t\tthis.map = map;\n\t}", "public void setDimensions(Vector3f dimensions);", "public void setDimension(String key, Dimension value) {\n\t\tif (value != null && !value.equals(getDefault(key)))\n\t\t\tinternal.setProperty(key, value.width + \" \" + value.height);\n\t\telse\n\t\t\tinternal.remove(key);\n\t}", "void setDimension(Dimension dim);", "public void setDimensions(Dimension d) {\r\n dimensions = d;\r\n }", "@Test\n\tpublic void testSetDimensions() {\n\t\tExplorer explore = new Explorer();\n\t\texplore.setDimensions(3, 3);\n\t\tassertTrue(explore.getHeight() == 3);\n\t\tassertTrue(explore.getWidth() == 3);\n\t}", "public void updateDimensions() {\n }", "@Override\r\n\tpublic void setDimensions(int width, int height) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tthis.maze = new int[width][height];\r\n\t\t\r\n\t}", "void setDimensions(double w, double h, double d) {\n width = w;\n height = h;\n d = depth;\n }", "public GameSettingBuilder setMapSize(int mapSize) {\n this.mapSize = mapSize;\n return this;\n }", "public Map(){\n this.matrix = new int[10][10];\n }", "protected void setLevelSize(int w, int h) {\n\t\twidth = w;\n\t\theight = h;\n\n\t\t// build it\n\t\tlevelTiled = new ArrayList<ArrayList<ArrayList<Integer>>>();\n\t\tlevelTyp = new HashMap<String, TYPE>();\n\n\t\t// run over\n\t\tfor (int i = 0; i < w; i++) {\n\t\t\tlevelTiled.add(new ArrayList<ArrayList<Integer>>());\n\t\t\tfor (int j = 0; j < h; j++) {\n\t\t\t\tlevelTiled.get(i).add(new ArrayList<Integer>());\n\t\t\t}\n\t\t}\n\t}", "public void setDim(int a, int b){\n\t\twidth = a; \n\t\theight = b;\n\t}", "public void dim(int value) {\n\n\t}", "public Map(int size_pixels, double size_meters) {\n this.init(size_pixels, size_meters);\n\n // for public accessor\n this.size_meters = size_meters;\n }", "public boolean SetMapSize(int size) {\n\t\tm_mapSize = size; \n\t\treturn true;\n\t}", "public void setDimX (int value)\n {\n m_dim_x = value;\n }", "@Override\r\n\tpublic void setDimension() {\n\r\n\t}", "@Override\r\n\tpublic void setDimension() {\n\r\n\t}", "public Dimension getMapSize() {\n \t\treturn new Dimension(15, 13);\n \t}", "private void calculateMapSize() {\n calculateMapSize(true);\n }", "@Override\n public QuadHolder setValues(final Map<Var, Node> values) {\n this.values = values;\n return this;\n }", "public void set_map(int[][] map, Random_map_generator generator) \n\t{\n\t\tthis.start_edge_coord_x = generator.get_start_x();\n\t\tthis.start_edge_coord_y = generator.get_start_y();\n\t\tthis.end_edge_coord_x = generator.get_end_x();\n\t\tthis.end_edge_coord_y = generator.get_end_y();\n\t\tthis.random_map = true;\n\t\tthis.map = map;\n\t\tif ((map[1][2] == 0) && (map[2][2] == 0)) \n\t\t{\n\t\t\tmap[1][2] = SCORE_AREA;\n\t\t\tmap[2][2] = TUITION_AREA;\n\t\t}\n\t\telse if ((map[1][14] == 0) && (map[2][14] == 0)) \n\t\t{\n\t\t\tmap[1][14] = SCORE_AREA;\n\t\t\tmap[2][14] = TUITION_AREA;\n\t\t}\n\t\telse if ((map[10][2] == 0) && (map[11][2] == 0)) \n\t\t{\n\t\t\tmap[10][2] = SCORE_AREA;\n\t\t\tmap[11][2] = TUITION_AREA;\n\t\t}\n\t\telse if ((map[10][14] == 0) && (map[11][14] == 0)) \n\t\t{\n\t\t\tmap[10][14] = SCORE_AREA;\n\t\t\tmap[11][14] = TUITION_AREA;\n\t\t}\n\t}", "void setMap(Map aMap);", "void setSize(Dimension size);", "public static int getMapWidth() {\r\n\t\treturn 7;\r\n\t}", "public abstract void setSize(Dimension d);", "private void fillMap() {\n\t\tObject tile = new Object();\n\t\tfor(int x = 0; x < map.length; x++) {\n\t\t\tfor(int y = 0; y < map.length; y++) {\n\t\t\t\tmap[x][y] = tile;\n\t\t\t}\n\t\t}\n\t}", "public void populateMap(int playerNumber){\n\t\tint factor = 1;\n\t\t\n\t\t\n\t}", "private void updateSize() {\n double width = pane.getWidth();\n double height = pane.getHeight();\n\n if(oldWidth == 0) {\n oldWidth = width;\n }\n if(oldHeight == 0) {\n oldHeight = height;\n }\n\n double oldHvalue = pane.getHvalue();\n double oldVvalue = pane.getVvalue();\n if(Double.isNaN(oldVvalue)) {\n oldVvalue = 0;\n }\n if(Double.isNaN(oldHvalue)) {\n oldHvalue = 0;\n }\n\n pane.setVmax(height);\n pane.setHmax(width);\n\n if(grow) {\n renderMapGrow(width, height, curZoom);\n } else {\n renderMap(width, height, curZoom);\n }\n\n pane.setVvalue((height/oldHeight)*oldVvalue);\n pane.setHvalue((width/oldWidth)*oldHvalue);\n\n oldWidth = width;\n oldHeight = height;\n }", "@Override\n\tpublic void setResolution(Dimension size) {\n\n\t}", "public Map(Dimension dim){\r\n\t\tthis.dim = dim;\r\n\t\tinitiateMap();\r\n\t\tcreateWorldMap();\r\n\t}", "public MapPanel(MapObject[][] map, int pixels_per_grid) {\n \tthis.map = map.clone();\n \tif (pixels_per_grid == 0)\n \t\tthis.pixels_per_grid = GRID_SIZE;\n \telse\n \t\tthis.pixels_per_grid = pixels_per_grid;\n }", "public void setInitMap(int size,String[][] text) {\n\t\tfor(int i=0;i<this.size;i++) {\n\t\t\tfor(int j=0;j<this.size;j++) {\n\t\t\t\tthis.map[i][j] = text[i][j];\n\t\t\t\tif(map[i][j].equals(\"p\")) {\n\t\t\t\t\tsetPlayer(i,j,map[i][j]);\n\t\t\t\t}\n\t\t\t\telse if(map[i][j].equals(\"h\")||map[i][j].equals(\"s\")||map[i][j].equals(\"H\")||map[i][j].equals(\"c\")) {\n\t\t\t\t\tsetEnemy(i,j,map[i][j]);\n\t\t\t\t}\n\t\t\t\telse if(!(map[i][j].equals(\" \")||map[i][j].equals(\"*\"))){\n\t\t\t\t\tsetItemList(i,j,map[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "private void createMapOfFourthType() {\n\n this.typeOfMap=4;\n matrixOfSquares[0][0] = createSquare( ColorOfFigure_Square.RED, true,0,0);\n matrixOfSquares[0][1] = createSquare( ColorOfFigure_Square.BLUE, true,0,1);\n matrixOfSquares[0][2] = createSquare(true, ColorOfFigure_Square.BLUE, true,0,2);\n matrixOfSquares[0][3] = null;\n matrixOfSquares[1][0] = createSquare(true, ColorOfFigure_Square.RED, true,1,0);\n matrixOfSquares[1][1] = createSquare( ColorOfFigure_Square.PURPLE, true,1,1);\n matrixOfSquares[1][2] = createSquare( ColorOfFigure_Square.PURPLE, true,1,2);\n matrixOfSquares[1][3] = createSquare( ColorOfFigure_Square.YELLOW, true,1,3);\n matrixOfSquares[2][0] = createSquare( ColorOfFigure_Square.GREY, true,2,0);\n matrixOfSquares[2][1] = createSquare( ColorOfFigure_Square.GREY, true,2,1);\n matrixOfSquares[2][2] = createSquare( ColorOfFigure_Square.GREY, true,2,2);\n matrixOfSquares[2][3] = createSquare(true, ColorOfFigure_Square.YELLOW, true,2,3);\n }", "@Before\n public void setDimension() {\n this.view.setDimension(new Dimension(WITDH, HEIGHT));\n }", "public Map(){\r\n map = new Square[0][0];\r\n }", "public void setSize(Dimension d) {\n\n\t}", "@Override\n protected int mapSize() {\n return left.size()+right.size()-hidden.size();\n }", "public void setDimensions(double newWidth, double newHeight) {\n this.width = newWidth;\n this.height = newHeight;\n }", "protected void setSize(Dimension dim) {}", "public void setBoardDimensions(int i, int j) {\n\tcols = i;\n\trows = j;\n\tboard.init(i, j);\n\tgb.init();\n\tvalidate();\n }", "public MSGeneratorMap(int size,double entropy){\n this.SIZE=size;\n this.board=initBoard();\n this.NUMBOMBS = (int)Math.floor(entropy*SIZE*SIZE);\n }", "protected int askForMapWidth() {return myManager.getMapWidth();}", "public void setDimension(String dimension)\r\n/* 282: */ {\r\n/* 283:351 */ this.dimension = dimension;\r\n/* 284: */ }", "void setDimension(Dimension[] dimension)\n\t\t{\n\t\t\td = dimension;\n\t\t}", "public static int DimNum() {\n\t\treturn root_map.size();\n\t}", "public static Map<Integer, List<Integer>> getZoomLevelsDict(String slideRef, Object... varargs) {\n\t\t// setting the default values when arguments' values are omitted\n\t\tString sessionID = null;\n\t\tInteger minNumberOfTiles = 0;\n\t\tif (varargs.length > 0) {\n\t\t\tif (!(varargs[0] instanceof String) && varargs[0] != null) {\n\t\t\t\tif (PMA.logger != null) {\n\t\t\t\t\tPMA.logger.severe(\"getZoomLevelsDict() : Invalid argument\");\n\t\t\t\t}\n\t\t\t\tthrow new IllegalArgumentException(\"...\");\n\t\t\t}\n\t\t\tsessionID = (String) varargs[0];\n\t\t}\n\t\tif (varargs.length > 1) {\n\t\t\tif (!(varargs[1] instanceof Integer) && varargs[1] != null) {\n\t\t\t\tif (PMA.logger != null) {\n\t\t\t\t\tPMA.logger.severe(\"getZoomLevelsDict() : Invalid argument\");\n\t\t\t\t}\n\t\t\t\tthrow new IllegalArgumentException(\"...\");\n\t\t\t}\n\t\t\tminNumberOfTiles = (Integer) varargs[1];\n\t\t}\n\t\t// Obtain a map with the number of tiles per zoom level.\n\t\t// Information is returned as (x, y, n) lists per zoom level, with\n\t\t// x = number of horizontal tiles,\n\t\t// y = number of vertical tiles,\n\t\t// n = total number of tiles at specified zoom level (x * y)\n\t\t// Use min_number_of_tiles argument to specify that you're only interested in\n\t\t// zoom levels that include at least a given number of tiles\n\t\tList<Integer> zoomLevels = new ArrayList<Integer>();\n\t\tIntStream.range(0, getMaxZoomLevel(slideRef, sessionID) + 1).forEach(n -> {\n\t\t\tzoomLevels.add(n);\n\t\t});\n\t\tList<List<Integer>> dimensions = new ArrayList<>();\n\t\tfor (int z : zoomLevels) {\n\t\t\tif (getNumberOfTiles(slideRef, z, sessionID).get(2) > minNumberOfTiles) {\n\t\t\t\tdimensions.add(getNumberOfTiles(slideRef, z, sessionID));\n\t\t\t}\n\t\t}\n\t\tList<Integer> zoomLevelsSubList = (List<Integer>) zoomLevels.subList(zoomLevels.size() - dimensions.size(),\n\t\t\t\tzoomLevels.size());\n\t\tMap<Integer, List<Integer>> d = new HashMap<>();\n\t\tfor (int i = 0; i < zoomLevelsSubList.size() && i < dimensions.size(); i++) {\n\t\t\td.put(zoomLevelsSubList.get(i), dimensions.get(i));\n\t\t}\n\t\treturn d;\n\t}", "@Updatable\n @CollectionMax(10)\n public Map<String, String> getDimensions() {\n if (dimensions == null) {\n dimensions = new HashMap<>();\n }\n\n return dimensions;\n }", "public IntMap(int size){\r\n hashMask=size-1;\r\n indexMask=(size<<1)-1;\r\n data=new int[size<<1];\r\n }", "public pacman(int size_of_map) {\n this.positionX = (this.positionY = 0);\n this.size_of_map = size_of_map;\n }", "public void setUp()\n {\n map = new Map(5, 5, null);\n }", "private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}", "void setWindowSize(int s);", "public static Integer getMapWidth() {\n\t\treturn MAPWIDTH;\n\t}", "Dimension getDimensions();", "@Override\n public int getSize() {\n return map.size();\n }", "public MapGrid(){\n\t\tthis.cell = 25;\n\t\tthis.map = new Node[this.width][this.height];\n\t}", "private void updateBounds(final float[] values) {\n if (getDrawable() != null) {\n mBounds.set(values[Matrix.MTRANS_X],\n values[Matrix.MTRANS_Y],\n getDrawable().getIntrinsicWidth() * values[Matrix.MSCALE_X] + values[Matrix.MTRANS_X],\n getDrawable().getIntrinsicHeight() * values[Matrix.MSCALE_Y] + values[Matrix.MTRANS_Y]);\n }\n }", "public CountingMap( Map<K, Integer> map ) {\n this.map = map;\n }", "private void createMapOfThirdType(){\n\n this.typeOfMap=3;\n matrixOfSquares[0][0] = createSquare( ColorOfFigure_Square.RED, true,0,0);\n matrixOfSquares[0][1] = createSquare( ColorOfFigure_Square.BLUE, true,0,1);\n matrixOfSquares[0][2] = createSquare(true, ColorOfFigure_Square.BLUE, true,0,2);\n matrixOfSquares[0][3] = createSquare( ColorOfFigure_Square.GREEN, true,0,3);\n matrixOfSquares[1][0] = createSquare(true, ColorOfFigure_Square.RED, true,1,0);\n matrixOfSquares[1][1] = createSquare( ColorOfFigure_Square.PURPLE, true,1,1);\n matrixOfSquares[1][2] = createSquare( ColorOfFigure_Square.YELLOW, true,1,2);\n matrixOfSquares[1][3] = createSquare( ColorOfFigure_Square.YELLOW, true,1,3);\n matrixOfSquares[2][0] = createSquare( ColorOfFigure_Square.GREY, true,2,0);\n matrixOfSquares[2][1] = createSquare( ColorOfFigure_Square.GREY, true,2,1);\n matrixOfSquares[2][2] = createSquare( ColorOfFigure_Square.YELLOW, true,2,2);\n matrixOfSquares[2][3] = createSquare(true, ColorOfFigure_Square.YELLOW, false,2,3);\n\n }", "public double[] setMapBounds(double ulLon, double ulLat, double lrLon, double lrLat)\n/* 154: */ {\n/* 117:182 */ int x_min = 2147483647;\n/* 118:183 */ int y_min = 2147483647;\n/* 119:184 */ int x_max = -2147483648;\n/* 120:185 */ int y_max = -2147483648;\n/* 121:186 */ int mapZoomMax = 20;\n/* 122: */\n/* 123:188 */ x_max = Math.max(x_max, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 124:189 */ x_max = Math.max(x_max, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 125:190 */ y_max = Math.max(y_max, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 126:191 */ y_max = Math.max(y_max, MercatorProj.LatToY(lrLat, mapZoomMax));\n/* 127:192 */ x_min = Math.min(x_min, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 128:193 */ x_min = Math.min(x_min, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 129:194 */ y_min = Math.min(y_min, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 130:195 */ y_min = Math.min(y_min, MercatorProj.LatToY(lrLat, mapZoomMax));\n /* x_max= (int)(Math.max(ulLon,lrLon)*1000000);\n x_min= (int)(Math.min(ulLon,lrLon)*1000000);\n y_max= (int)(Math.max(ulLat,lrLat)*1000000);\n y_min= (int)(Math.min(ulLat,lrLat)*1000000);*/\n/* 134:199 */ int height = Math.max(0, this.mapPanel.getHeight());\n/* 135:200 */ int width = Math.max(0, this.mapPanel.getWidth());\n/* 136:201 */ int newZoom = mapZoomMax;\n/* 137:202 */ int x = x_max - x_min;\n/* 138:203 */ int y = y_max - y_min;\n/* 139:204 */ while ((x > width) || (y > height))\n/* 140: */ {\n/* 141:205 */ newZoom--;\n/* 142:206 */ x >>= 1;\n/* 143:207 */ y >>= 1;\n/* 144: */ }\n/* 145:209 */ x = x_min + (x_max - x_min)/2;\n/* 146:210 */ y = y_min + (y_max - y_min)/2;\n/* 147:211 */ int z = 1 << mapZoomMax - newZoom;\n/* 148:212 */ x /= z;\n/* 149:213 */ y /= z;\n /* int Cx=256;\n int Cy=256;\n //Cx>>=(newZoom);\n //Cy>>=(newZoom);\n double x1=((x*(width/2))/Cx);\n double y1=((y*(height/2))/Cy);\n x=(int) x1;\n y=(int) y1;\n x >>=(newZoom-this.mapPanel.zoom);\n y >>=(newZoom-this.mapPanel.zoom);\n //x = x+156;\n //y = y-137;*/\n x=x/10000;\n y=y/10000;\n /* 150:214 */ this.mapPanel.setZoom(new Point((int)x, (int)y), newZoom);\n double[] res = { this.mapPanel.zoom, this.mapPanel.centerX, this.mapPanel.centerY,x,y, newZoom, z };\n traceln(Arrays.toString(res));\n traceln( x_max+\",\"+x_min+\",\"+y_max+\",\"+y_min+\",x:\"+x+\",y:\"+y+\",z:\"+z+\",nZomm:\"+newZoom);\n // this.mapPanel.getBounds().getX()setBounds( (int)ulLon,(int)ulLat, (int)width,(int)height);\n return res;\n\n/* 167: */ }", "public void setFrameSize();", "@Test\n public void mapSize() {\n check(MAPSIZE);\n query(MAPSIZE.args(MAPENTRY.args(1, 2)), 1);\n }", "public void InitMap() {\n for (int i=0; i<m_mapSize; i++) {\n SetColour(i, null);\n }\n }", "public void setMap2D(FXMap map);", "public void setViewportDims(float width, float height) {\n\t\tthis.viewportDims[0] = width;\n\t\tthis.viewportDims[1] = height;\n\t\tthis.viewportRatio = width / height;\n\t}", "private void updateDimensions()\n\t{\n\t\tthis.drawer.setSprite(this.drawer.getSprite().withDimensions(\n\t\t\t\tgetMaster().getDimensions()));\n\t\tthis.lastDimensions = getMaster().getDimensions();\n\t}", "static int[][] unite4arrays(Map<Integer, int[][]> map, int size) {\n int sqrt = (int) Math.sqrt( map.keySet().size());\n int[][] result = new int[size * sqrt][size * sqrt];\n for (int i = 0; i < map.keySet().size(); i++) {\n\n for (int x = 0; x < size; x++) {\n for (int y = 0; y < size; y++) {\n result[x + size * (i % sqrt)][y + size * (i / sqrt)] = map.get(i)[x][y];\n }\n }\n\n }\n return result;\n }", "@Override\r\n \tpublic void setMap(Map m) {\n \t\t\r\n \t}", "private void initArrayHeightAndWidth() {\n\n\t\theight = 0;\n\t\twidth = 0;\n\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(mapFile));\n\t\t\tString line = br.readLine();\n\t\t\t// get length of map\n\t\t\twidth = line.length();\n\t\t\t// get height of map\n\t\t\twhile (line != null) {\n\t\t\t\theight += 1;\n\t\t\t\tline = br.readLine();\n\t\t\t}\n\t\t\tbr.close();\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\theight_on_display = (height - 1) * 35;\n\t\twidth_on_display = (width - 1) * 35;\n\t\tmapElementStringArray = new String[height][width];\n\t\tmapElementArray = new MapElement[height][width];\n\n\t}", "int getDimensionsCount();", "public void setSize(Dimension size) {\r\n this.size = size;\r\n }", "private void calculateMapSize(boolean calculate) {\n if (!calculate) {\n mapWidth = 100;\n mapHeight = 100;\n return;\n }\n\n// if (playerTracking.isEmpty()) {\n// return;\n// }\n//\n// // Get the lowest and highest values of each player\n// Point low = new Point(0, 0), high = new Point(0, 0);\n// for (Player p : playerTracking) {\n// if (p.getLowestX() < low.X) {\n// low.X = p.getLowestX();\n// }\n// if (p.getLowestY() < low.Y) {\n// low.Y = p.getLowestY();\n// }\n// if (p.getHighestX() > high.X) {\n// high.X = p.getHighestX();\n// }\n// if (p.getHighestY() > high.Y) {\n// high.Y = p.getHighestY();\n// }\n// }\n//\n// // Calucate the actual size of the map\n// mapWidth = (int) (high.X - low.X);\n// mapHeight = (int) (high.Y - low.Y);\n//\n// // Get the highest and override the other\n// if (mapWidth > mapHeight) {\n// mapHeight = mapWidth;\n// } else {\n// mapWidth = mapHeight;\n// }\n//\n// // Add a border of 10px to each side\n// mapWidth += 20;\n// mapHeight += 20;\n }", "public GameObject setDimensions(Dimension d) {\n\t\tdimensions.width = d.width;\n\t\tdimensions.height = d.height;\n\t\treturn this;\n\t}", "private void setDimenstions(String line) throws Exception {\n\t\tScanner dimensions = new Scanner(line);\n\n\t\tsetWidth((short) (2 + Short.parseShort(dimensions.next())));\n\t\tsetHeight((short) (2 + Short.parseShort(dimensions.next())));\n\n\t\tdimensions.close();\n\t}", "private static Map<DiscreteState,Double> createMap(int vectSize, int mapSize) {\n\t\tMap<DiscreteState,Double> map = new HashMap<DiscreteState,Double>();\n\t\tint n = (int) Math.min(mapSize, Math.pow(2, vectSize));\n\t\twhile (map.size() < n) {\n\t\t\tdouble[] addition = new double[vectSize];\n\t\t\tfor (int i = 0; i < vectSize; i++) addition[i] = Math.round(Math.random());\n\t\t\tmap.put(new DiscreteState(addition), Math.random());\n\t\t}\n\t\treturn map;\n\t}", "public XYPoint getMapSize();", "public void initSize() {\n WIDTH = 320;\n //WIDTH = 640;\n HEIGHT = 240;\n //HEIGHT = 480;\n SCALE = 2;\n //SCALE = 1;\n }", "void setSize(float w, float h) {\n _w = w;\n _h = h;\n }", "void setStats(double newWidth, double newHeight) {\n width = newWidth;\n height = newHeight;\n }", "@Override\n\tpublic void setWidthAndHeight(int width, int height) {\n\t\t\n\t}", "private void resetFValue(){\r\n int length = _map.get_mapSize();\r\n for(int i=0;i<length;i++){\r\n _map.get_grid(i).set_Fnum(10000);\r\n }\r\n }", "private void buildMap(int count, char type, String typeName) {\r\n\t\tfor (int i = 1; i <= count; i++) {\r\n\t\t\toriginalMaps.add(new MapType(\"map_\" + type + i, typeName, \"colony/map_\" + type + i));\r\n\t\t}\r\n\t}", "public void setDimensionFromCubicMesh(){\r\n\t\t\r\n\t\t\r\n\t}", "public void setMap(int idRoom, int x, int y, Stack<AuxiliarElement> cjtElem, String nameRoom, int[][] doors, int[][] windows){ \r\n int key = sequence.getValue();\r\n sequence.increase();\r\n Map map = new Map(x, y, idRoom, nameRoom, doors, windows);\r\n map.setCjtElement(cjtElem);\r\n cjtMap.put(key, map);\r\n }", "private void updateViewBounds() \r\n {\r\n assert !sim.getMap().isEmpty() : \"Visualiser needs simulator whose a map has at least one node\"; \r\n \r\n \r\n viewMinX = minX * zoomFactor;\r\n viewMinY = minY * zoomFactor;\r\n \r\n viewMaxX = maxX * zoomFactor;\r\n viewMaxY = maxY * zoomFactor;\r\n \r\n \r\n double marginLength = zoomFactor * maxCommRange;\r\n \r\n \r\n // Set the size of the component\r\n int prefWidth = (int)Math.ceil( (viewMaxX - viewMinX) + (marginLength * 2) );\r\n int prefHeight = (int)Math.ceil( (viewMaxY - viewMinY) + (marginLength * 2) );\r\n setPreferredSize( new Dimension( prefWidth, prefHeight ) );\r\n \r\n \r\n // Adjust for margin lengths \r\n viewMinX -= marginLength;\r\n viewMinY -= marginLength;\r\n \r\n viewMaxX += marginLength;\r\n viewMaxY += marginLength;\r\n }", "void setCustomDimension2(String customDimension2);", "public void setSize(float width, float height);", "@SuppressWarnings(\"unused\")\n private void setPadding(final JSONArray args, final CallbackContext callbackContext) throws JSONException {\n JSONObject padding = args.getJSONObject(1);\n int left = padding.getInt(\"left\");\n int top = padding.getInt(\"top\");\n int bottom = padding.getInt(\"bottom\");\n int right = padding.getInt(\"right\");\n map.setPadding(left, top, right, bottom);\n this.sendNoResult(callbackContext);\n }", "public static void registerDimensions()\r\n\t{\r\n\t\t//DimensionManager.registerDimension(2, THEFUTURE);\r\n\t}", "public Map(int levelWidth, int levelHeight, ArrayList<Planet> planets, ArrayList<Entity> enemies, Player player, Camera camera)\n {\n this.levelWidth = levelWidth;\n this.levelHeight = levelHeight;\n\n double levelSizeRatio = (double)(levelWidth) / levelHeight;\n\n this.mapHeight = defaultMapHeight;\n this.mapWidth = (int)(mapHeight * levelSizeRatio);\n\n this.scale = ((double)(mapHeight)) / levelHeight;\n\n this.topLeftX = defaultTopLeftX;\n this.topLeftY = defaultTopLeftY;\n\n this.planets = planets;\n this.enemies = enemies;\n this.player = player;\n this.camera = camera;\n }", "private void setDimensions() {\n IPhysicalVolume physVol_parent = getModule().getGeometry().getPhysicalVolume();\n ILogicalVolume logVol_parent = physVol_parent.getLogicalVolume();\n ISolid solid_parent = logVol_parent.getSolid();\n Box box_parent;\n if (Box.class.isInstance(solid_parent)) {\n box_parent = (Box) solid_parent;\n } else {\n throw new RuntimeException(\"Couldn't cast the module volume to a box!?\");\n }\n _length = box_parent.getXHalfLength() * 2.0;\n _width = box_parent.getYHalfLength() * 2.0;\n\n }", "void setWidth(int width);", "void setWidth(int width);", "private void setUpMap() {\n if (points.size()>2) {\n drawCircle();\n }\n\n\n }", "private void fillMap(Grid tablero) { // reads the board and fill auxiliary map\n for (int i = 0; i < 10; i++) {\n for (int j = 0; j < 10; j++) {\n if (tablero.getCell(i, j) == 0) {\n Cell c = new Cell(i, j);\n ArrayList<Integer> elements = fillDomain();\n map.put(c, elements);\n } else {\n Cell c = new Cell(i, j);\n ArrayList<Integer> elements = new ArrayList<>();\n elements.add(tablero.getCell(i, j));\n map.put(c, elements);\n }\n }\n }\n }", "protected void setDimension(int _dimension) {\r\n if (_dimension <= 0) {\r\n _dimension = 1;\r\n }\r\n this.dimension = _dimension;\r\n //this.data = new float[_dimension];\r\n this.data = new float[_dimension * 2];\r\n }" ]
[ "0.6570268", "0.64455473", "0.6323524", "0.6270616", "0.61788434", "0.6171761", "0.61540145", "0.60983956", "0.6074646", "0.60267997", "0.5981356", "0.5906301", "0.5895114", "0.5824184", "0.57863617", "0.5784708", "0.5775579", "0.57247686", "0.57193637", "0.5703722", "0.5703722", "0.5703561", "0.5699521", "0.5688625", "0.56853944", "0.5665597", "0.5654221", "0.5625902", "0.56095463", "0.5604566", "0.55933934", "0.55845577", "0.5578871", "0.5537602", "0.5521512", "0.5509807", "0.54774994", "0.54670554", "0.54570025", "0.5427577", "0.54261166", "0.54251075", "0.54186475", "0.54181576", "0.54164356", "0.5410137", "0.54045", "0.5390624", "0.53826696", "0.53808117", "0.53776926", "0.5368665", "0.53615797", "0.5354797", "0.53534144", "0.53196454", "0.5316389", "0.531252", "0.5310276", "0.5308933", "0.5308844", "0.5303455", "0.52832174", "0.52749574", "0.5264383", "0.5259049", "0.52570873", "0.52564037", "0.5253645", "0.52496725", "0.52431124", "0.5238856", "0.5238106", "0.52365255", "0.5231956", "0.52280784", "0.52279747", "0.522413", "0.52125096", "0.51937133", "0.51912427", "0.5184612", "0.51792055", "0.51710075", "0.5164676", "0.5163334", "0.5156284", "0.5149331", "0.5146683", "0.51414615", "0.5139702", "0.51390857", "0.51387686", "0.51378864", "0.5136861", "0.5127823", "0.5127823", "0.512674", "0.51259017", "0.5124109" ]
0.66207653
0
returns the instance of this camera
public static Camera getInstance() { return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Camera getInstance() {\n return INSTANCE;\n }", "public CameraInstance getCameraInstance() {\n return cameraInstance;\n }", "public void getCameraInstance() {\n newOpenCamera();\n }", "public static Camera open() { \n return new Camera(); \n }", "Camera getCamera();", "public Pj3dCamera Camera()\r\n\t{\r\n\t\tPj3dCamera cam = new Pj3dCamera(this);\r\n\t\treturn cam;\r\n\t}", "private Camera getCameraInstance() {\r\n Camera camera = null;\r\n try {\r\n camera = Camera.open();\r\n } catch (Exception e) {\r\n // cannot get camera or does not exist\r\n }\r\n Camera.Parameters params = camera.getParameters();\r\n\r\n List<Size> sizes = params.getSupportedPictureSizes();\r\n int w = 0, h = 0;\r\n for (Size size : sizes) {\r\n if (size.width > w || size.height > h) {\r\n w = size.width;\r\n h = size.height;\r\n }\r\n\r\n }\r\n params.setPictureSize(w, h);\r\n\r\n\r\n if (params.getSupportedFocusModes().contains(\r\n Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {\r\n params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);\r\n }\r\n params.setPictureFormat(ImageFormat.JPEG);\r\n params.setJpegQuality(100);\r\n camera.setParameters(params);\r\n\r\n\r\n return camera;\r\n }", "public Camera getCamera() { return (Camera)CameraSet.elementAt(0); }", "private Camera getCameraInstance() {\n Camera c = null;\n try {\n c = Camera.open(); // attempt to get a Camera instance\n\n Camera.Parameters params = c.getParameters();\n List<Camera.Size> sizes = params.getSupportedPictureSizes();\n\n // set the second lowest resolution for taking snapshots\n params.setPictureSize(sizes.get(sizes.size() - 2).width, sizes.get(sizes.size() - 2).height);\n\n c.setParameters(params);\n } catch (Exception e) {\n // Camera is not available (in use or does not exist)\n }\n return c;\n }", "public static Camera getCameraInstance() {\n Camera c = null;\n try {\n c = Camera.open();\n } catch (Exception e) {\n }\n return c;\n }", "@Override\n protected Camera getCamera() {\n return Camera.createForPositionAndAngles(new ThreeDoubleVector(31.0, 7.0, 5.5), 0.0, 0.7);\n\n // Camera for orientation curve interpolation presentation\n// return Camera.createForPositionAndAngles(new ThreeDoubleVector(54.5, 10.0, 2.5), -0.5, 0.3);\n }", "public Camera2D getCamera()\r\n\t{\r\n\t\treturn _Camera;\r\n\t}", "public static Camera getCameraInstance() {\n Camera c = null;\n try {\n c = Camera.open(nextCam); // attempt to get a Camera instance\n } catch (Exception e) {\n // Camera is not available (in use or does not exist)\n }\n return c; // returns null if camera is unavailable\n }", "public Camera getCamera() {\n return getValue(PROP_CAMERA);\n }", "protected CameraInstance createCameraInstance() {\n CameraInstance cameraInstance = new CameraInstance(getContext());\n cameraInstance.setCameraSettings(cameraSettings);\n return cameraInstance;\n }", "public OrthographicCamera getCamera() {\n\t\treturn cam;\n\t}", "public OrthographicCamera getCamera() {\n\t\treturn this.camera;\n\t}", "public static Camera getCameraInstance() {\n int backCameraId;\n Camera cam = null;\n try {\n backCameraId = findBackFacingCamera();// COMMENTED OUT FOR THE SAKE OF TESTING\n cam = Camera.open(backCameraId);\n }\n catch (Exception e) {\n Log.d(\"ERROR\", \"Failed to get camera: \"+ e.getMessage());\n }\n return cam;\n }", "public static CameraManager get() {\n\t\treturn cameraManager;\n\t}", "public static Camera getCameraInstance(){\n Camera c = null;\n try {\n c = Camera.open(); // attempt to get a Camera instance\n }\n catch (Exception e){\n // Camera is not available (in use or does not exist)\n }\n return c; // returns null if camera is unavailable\n }", "public static Camera getCameraInstance(){\n Camera c = null;\n try {\n c = Camera.open(); // attempt to get a Camera instance\n }\n catch (Exception e){\n // Camera is not available (in use or does not exist)\n }\n return c; // returns null if camera is unavailable\n }", "public static Camera getCameraInstance(){\n\t Camera c = null;\n\t try {\n\t \tLog.d(TAG, \"not null\");\n\t c = Camera.open(); // attempt to get a Camera instance\n\t }\n\t catch (Exception e){\n\t // Camera is not available (in use or does not exist)\n\t }\n\t return c; // returns null if camera is unavailable\n\t}", "public Camera getCam() {\n return this.cam;\n }", "public Camera() {\r\n this(1, 1);\r\n }", "private void getCamera() {\n if (camera == null) {\n try {\n camera = Camera.open();\n params = camera.getParameters();\n } catch (RuntimeException e) {\n\n }\n }\n }", "public static Camera getCameraInstance(){\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {\n return Camera.open(0); // This is the line the error occurs\n } else {\n return Camera.open();\n }\n }", "public Camera() {\n\t\tMatrix.setIdentityM(viewMatrix, 0);\n\t\tMatrix.setIdentityM(projectionMatrix, 0);\n\t\tcomputeReverseMatrix();\n\t}", "public org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.Camera getCamera(int index) {\n return camera_.get(index);\n }", "private static Camera getCameraInstance(int cameraId) {\n Camera c = null;\n try {\n c = Camera.open(cameraId);\n }\n catch (Exception e) {\n // Camera is not available (in use or does not exist)\n Log.w(LOG_TAG, \"Camera is not available: \" + e.getMessage());\n }\n return c;\n }", "public Camera() {\n\t\treset();\n\t}", "public int[] getCamera() {\n\t\treturn camera;\n\t}", "public Matrix4f getCameraMatrix() {\n\t\treturn mCameraMatrix;\n\t}", "private void oldOpenCamera() {\n try {\n mCamera = Camera.open(); // attempt to get a Camera instance\n mCamera.setPreviewCallbackWithBuffer(this);\n Log.i(TAG, \"Instance created\");\n } catch (Exception e) {\n Log.e(TAG, \"Error getting Camera instance: \" + e.getMessage());\n }\n }", "public abstract Matrix4f getCameraMatrix();", "public Mat4x4 getMatView() {\n Mat4x4 matCameraRotX = MatrixMath.matrixMakeRotationX(cameraRot.getX());\n Mat4x4 matCameraRotY = MatrixMath.matrixMakeRotationY(cameraRot.getY());\n Mat4x4 matCameraRotZ = MatrixMath.matrixMakeRotationZ(cameraRot.getZ());\n Mat4x4 matCameraRotXY = MatrixMath.matrixMultiplyMatrix(matCameraRotX, matCameraRotY);\n Mat4x4 matCameraRot = MatrixMath.matrixMultiplyMatrix(matCameraRotXY, matCameraRotZ);\n matCamera = calculateMatCamera(up, target, matCameraRot);\n matView = MatrixMath.matrixQuickInverse(matCamera);\n return matView;\n }", "org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.Camera getCamera(int index);", "public java.util.List<org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.Camera> getCameraList() {\n return camera_;\n }", "public CameraAnimation getCameraAnimation() {\n\t\treturn this.animation;\n\t}", "private Camera() {\n viewport = new Rectangle();\n dirtyAreas = new ArrayList<Rectangle>();\n renderedAreas = new ArrayList<Rectangle>();\n fullUpdate = false;\n dirtyAreaCounter = 0;\n }", "public Point getCameraPosition() {\n\t\treturn new Point(cameraPosition.x, cameraPosition.y, cameraPosition.z);\n\t}", "public static Camera getCameraInstance(int cameraId) {\n Camera c = null;\n try {\n c = Camera.open(cameraId); // attempt to get a Camera instance\n\n } catch (Exception e) {\n // Camera is not available (in use or does not exist)\n }\n return c; // returns null if camera is unavailable\n }", "@SuppressLint(\"NewApi\")\n\tpublic static Camera getCameraInstance(int cameraId)\n {\n Log.d(\"tag\", \"getCameraInstance\");\n Camera c = null;\n try\n {\n c = Camera.open(cameraId); // attempt to get a Camera instance\n }\n catch (Exception e)\n {\n // Camera is not available (in use or does not exist)\n e.printStackTrace();\n Log.e(\"tag\", \"Camera is not available\");\n }\n return c; // returns null if camera is unavailable\n }", "public SVector3d getPositionCam() {\n\t\treturn transCamera;\n\t}", "public interface Camera {\n Vector3f getPosition();\n\n float getYaw();\n\n float getPitch();\n\n float getRoll();\n}", "private boolean _getCamera(){\n\n\t\ttry {\n\n\t\t\t// instantiate flash light object depending on SDK version\n\t\t\tif (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n\t\t\t\t_flash = new FlashLight_Pre_Marshmallow();\n\t\t\t}else{\n\t\t\t\t_flash = new FlashLight_Post_Marshmallow(_main);\n\t\t\t}\n\n\t\t\t// open the flash\n\t\t\t_flash.open();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tL.e(TAG, \"Camera Error : Couldn't get the camera, it may be used by another app !\");\n\t\t\tL.e(TAG, \"Camera Error : \" + e.getMessage());\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public Camera setupCamera() {\n mCamera = Camera.open(Camera.CameraInfo.CAMERA_FACING_BACK);\n try {\n Camera.Parameters parameters = mCamera.getParameters();\n parameters.setPreviewSize(mWidth, mHeight);\n parameters.setPreviewFormat(mFormat);\n mCamera.setDisplayOrientation(90);\n for (Camera.Size size : parameters.getSupportedPreviewSizes()) {\n Log.d(TAG, \"SIZE:\" + size.width + \"x\" + size.height);\n }\n for (Integer format : parameters.getSupportedPreviewFormats()) {\n Log.d(TAG, \"FORMAT:\" + format);\n }\n\n List<int[]> fps = parameters.getSupportedPreviewFpsRange();\n for (int[] count : fps) {\n Log.d(TAG, \"T:\");\n for (int data : count) {\n Log.d(TAG, \"V=\" + data);\n }\n }\n mCamera.setParameters(parameters);\n } catch (Exception e) {\n e.printStackTrace();\n }\n if (mCamera != null) {\n mWidth = mCamera.getParameters().getPreviewSize().width;\n mHeight = mCamera.getParameters().getPreviewSize().height;\n }\n return mCamera;\n }", "private CameraManager() {\n }", "@Override\n public CameraControlInternal getCameraControlInternal() {\n return mCameraControlInternal;\n }", "public static CameraFragment newInstance() {\n CameraFragment fragment = new CameraFragment();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }", "public Camera(){\n // servoPan = new Servo(PAN);\n servoTilt = new Servo(TILT);\n }", "public org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.CameraOrBuilder getCameraOrBuilder(\n int index) {\n return camera_.get(index);\n }", "private Camera selectAndOpenCamera() {\n\t\tCamera.CameraInfo info = new Camera.CameraInfo();\n\t\tint numberOfCameras = Camera.getNumberOfCameras();\n\n\t\tint selected = -1;\n\n\t\tfor (int i = 0; i < numberOfCameras; i++) {\n\t\t\tCamera.getCameraInfo(i, info);\n\n\t\t\tif( info.facing == Camera.CameraInfo.CAMERA_FACING_BACK ) {\n\t\t\t\tselected = i;\n\t\t\t\tflipHorizontal = false;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// default to a front facing camera if a back facing one can't be found\n\t\t\t\tselected = i;\n\t\t\t\tflipHorizontal = true;\n\t\t\t}\n\t\t}\n\n\t\tif( selected == -1 ) {\n\t\t\tdialogNoCamera();\n\t\t\treturn null; // won't ever be called\n\t\t} else {\n\t\t\treturn Camera.open(selected);\n\t\t}\n\t}", "public void openCamera() {\n \n\n }", "protected boolean isActive() {\n return cameraInstance != null;\n }", "public static SingletonTextureFactory getInstance(){\n\t\treturn instance;\n\t}", "public FlyByCamera getFlyByCamera() {\n return flyCam;\n }", "public ReflectedCamera(Camera camera) {\n this(camera, true);\n }", "public java.util.List<? extends org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.CameraOrBuilder> \n getCameraOrBuilderList() {\n return camera_;\n }", "public void onCamera();", "public ViewerManager2 getPlayer() {\n return this.player;\n }", "public VideoCapture()\n {\n \n nativeObj = VideoCapture_0();\n \n return;\n }", "public static LauncherFrame getInstance() {\n return instance;\n }", "public org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.Camera getCamera(int index) {\n if (cameraBuilder_ == null) {\n return camera_.get(index);\n } else {\n return cameraBuilder_.getMessage(index);\n }\n }", "public static OImaging getInstance() {\n return (OImaging) App.getInstance();\n }", "@SuppressWarnings(\"unchecked\")\n @Nullable\n protected static <T extends OpenCvCamera> T getCamera(String cameraId) {\n if (internalCamera != null && cameraId.equals(internalCameraId)) return (T) internalCamera;\n else if (externalCameras.containsKey(cameraId)) return (T) externalCameras.get(cameraId);\n else {\n Log.e(LOGGING_TAG, \"Tried to find camera with id \" + cameraId + \" but no camera with that id was registered.\");\n return null;\n }\n }", "void initCameraManager(){\n\t\tcameraManager = new CameraManager(getApplication());\n\t}", "public Coord getCameraPosition() {\n if(internalNative == null) {\n if(internalLightweightCmp != null) {\n return internalLightweightCmp.getCenter();\n } \n // TODO: Browser component\n return new Coord(0, 0);\n }\n return new Coord(internalNative.getLatitude(), internalNative.getLongitude());\n }", "public int switchCamera() {\n return mRtcEngine.switchCamera();\n }", "protected Camera interceptCamera (LightProperties lp) {\n\t\treturn lp.camera;\n\t}", "private void newOpenCamera() {\n if (mThread == null) {\n mThread = new CameraHandlerThread();\n }\n\n synchronized (mThread) {\n mThread.openCamera();\n }\n }", "public Vector2 getCameraPosition()\n {\n\n Vector2 tmpVector = new Vector2(camera.position.x/camera.zoom - Gdx.graphics.getWidth()/2, camera.position.y/camera.zoom - Gdx.graphics.getHeight()/2);\n return tmpVector;\n }", "public static VideoChunkProviderFactory getInstance()\r\n {\r\n return ourInstance;\r\n }", "public interface ICamera {\n}", "private void setCamera() {\n\t\tCamera.CameraInfo cameraInfo = new Camera.CameraInfo();\n\t\tint cameraCount = Camera.getNumberOfCameras();\n\t\tLog.i(TAG, \"count = \" + cameraCount);\n\t\tLog.i(TAG, \"isBack = \" + isBack);\n\t\tint id = 0;\n\n\t\tfor (int camIdx = 0; camIdx < cameraCount; camIdx++) {\n\t\t\tCamera.getCameraInfo(camIdx, cameraInfo);\n\t\t\tLog.i(TAG, \"cameraInfoFacing = \" + cameraInfo.facing);\n\t\t\tif (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK\n\t\t\t\t\t&& isBack) {\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t} else if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT\n\t\t\t\t\t&& !isBack){\n\t\t\t\ttry {\n\t\t\t\t\tLog.i(TAG, \"SETTING mCamera\");\n\t\t\t\t\tmCamera = Camera.open(camIdx);\n\t\t\t\t\tid = camIdx;\n\t\t\t\t} catch (RuntimeException e) {\n\t\t\t\t\tLog.e(TAG,\n\t\t\t\t\t\t\t\"Camera failed to open: \" + e.getLocalizedMessage());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (mCamera != null) {\n\t\t\tCamera.Parameters cameraParameters = mCamera.getParameters();\n\t\t\tDisplay display = getActivity().getWindowManager().getDefaultDisplay();\n\t\t\tPoint size = new Point();\n\t\t\tdisplay.getSize(size);\n\t\t\tint screenWidth = size.x;\n\t\t\tint width = Integer.MAX_VALUE;\n\t\t\tint height = 0;\n\t\t\tLog.i(TAG, \"SCREENWIDTH: \" + screenWidth);\n\t\t\tList<Camera.Size> sizes = cameraParameters.getSupportedPreviewSizes();\n\t\t\tfor (Camera.Size cSize : sizes) {\n\t\t\t\tif (cSize.width >= screenWidth && cSize.width <= width) {\n\t\t\t\t\twidth = cSize.width;\n\t\t\t\t\theight = cSize.height;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tLog.i(TAG, \"Width: \" + width + \" HEIGHT: \" + height);\n\n\t\t\tif (mPreview != null) {\n\t\t\t\tmPreview.switchCamera(mCamera, id, width, height);\n\t\t\t} else {\n\t\t\t\tmPreview = new CameraPreview(getActivity(), mCamera, id, width, height);\n\t\t\t\tFrameLayout preview = (FrameLayout) view\n\t\t\t\t\t\t.findViewById(R.id.camera_preview);\n\t\t\t\tpreview.addView(mPreview);\n\t\t\t}\n\t\t\tmCamera.startPreview();\n\t\t}\n\t}", "public static CardView getInstance() {\n if (null == instance) instance = new CardView();\n return instance;\n }", "public static DisplayDevice getInstance(){\t\t\r\n\t\treturn instance;\r\n\t}", "public int getCameraCount() {\n return camera_.size();\n }", "public void configureCamera(){\n try{\n camera = Camera.open(findBackFacingCamera());\n } catch (Exception e){}\n\n if(camera != null) {\n cameraView = new CameraView(this.getApplicationContext(), camera);\n FrameLayout camera_view = (FrameLayout)findViewById(R.id.CameraView);\n camera_view.addView(cameraView);\n }\n }", "boolean useCamera2();", "public static Ambulancia get_instance() {\n if (instance == null)\n instance = new Ambulancia();\n return instance;\n }", "public PlayerWL() {\n super();\n rotateYAxis = 0;\n positionZ = 0;\n positionX = 0;\n camera = new PerspectiveCamera(true);\n camera.getTransforms().addAll(\n new Rotate(0, Rotate.Y_AXIS),\n new Rotate(-10, Rotate.X_AXIS),\n new Translate(0, 0, 0));\n cameraGroup = new Group(camera);\n camera.setRotationAxis(new Point3D(0, 1, 0));\n }", "private void createCamera() {\n camera = getCameraInstance();\n // Setting the right parameters in the camera\n SetCameraParameters();\n // Create our Preview view and set it as the content of our activity.\n camera_preview = new CameraPreview(this, camera);\n // Adding the camera preview after the FrameLayout and before the mainact_btn_InOutAct\n // as a separated element.\n InOut_cameraLayout.addView(camera_preview, 0);\n }", "public static Arm getInstance() {\n if (instance == null) {\n instance = new Arm();\n }\n return instance;\n }", "public static VisionTable getInstance() {\r\n\t\treturn instance;\r\n\t}", "public CameraManager(HardwareMap hardwareMap) {\n int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier(\"cameraMonitorViewId\", \"id\", hardwareMap.appContext.getPackageName());\n phoneCam = OpenCvCameraFactory.getInstance().createInternalCamera(OpenCvInternalCamera.CameraDirection.BACK, cameraMonitorViewId);\n pipeline = new CvPipeline();\n phoneCam.setPipeline(pipeline);\n }", "public boolean hasCamera() {\n return mCamera != null;\n }", "public static Light getInstance() {\n\treturn INSTANCE;\n }", "private Surface getPreviewSurface() {\n return surface_texture;\n }", "org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.CameraOrBuilder getCameraOrBuilder(\n int index);", "public void obtainCameraOrFinish() {\n mCamera = getCameraInstance();\n if (mCamera == null) {\n Toast.makeText(VideoCapture.getSelf(), \"Fail to get Camera\", Toast.LENGTH_LONG).show();\n VideoCapture.getSelf().finish();\n }\n }", "public static FaceDetection getInstance()\n\t{\n\t\treturn SingletonHolder.INSTANCE;\n\t}", "public static FloorFacade getInstance(){\n if(self == null){\n \tself = new FloorFacade();\n }\n return self;\n }", "public static RockboxWidgetProvider getInstance()\n {\n return mInstance;\n }", "@Override\n\tpublic boolean isCameraRelated() {\n\t\treturn true;\n\t}", "@Override\n public void init() {\n startCamera();\n }", "public void init(Camera cam);", "public Camera open(int cameraId) {\r\n Camera camera = null;\r\n try {\r\n if (mMethodOpenLevel9 != null) {\r\n Object[] argList = new Object[1];\r\n argList[0] = cameraId;\r\n camera = (Camera) mMethodOpenLevel9.invoke(null, argList);\r\n }\r\n } catch (Exception e) {\r\n Log.w(LOG_TAG, \"CameraHideMethods:mMethodOpenLevel9()\", e);\r\n }\r\n\r\n return camera;\r\n }", "public static GameController getInstance() {\n\t\treturn INSTANCE; \n\t}", "public static synchronized ChoseActivity getInstance() {\n return mInstance;\n }", "public void camera360() {\n\n }" ]
[ "0.8439786", "0.8409811", "0.81496966", "0.80453455", "0.7926923", "0.7925838", "0.7849765", "0.78159577", "0.7803298", "0.77753925", "0.7728759", "0.76593345", "0.75766706", "0.75545126", "0.74741864", "0.7447071", "0.74245393", "0.7398891", "0.7378463", "0.7239851", "0.7239851", "0.7208711", "0.7111479", "0.70733577", "0.70456654", "0.6933872", "0.6891647", "0.6676462", "0.658447", "0.6525307", "0.6482709", "0.64723027", "0.62533164", "0.6251317", "0.6212307", "0.62095726", "0.61213255", "0.6115743", "0.6108297", "0.6093299", "0.6073703", "0.60660094", "0.60538936", "0.60291004", "0.6028458", "0.60185647", "0.6006014", "0.5988242", "0.5980014", "0.5979392", "0.5951183", "0.59464586", "0.59310746", "0.59100133", "0.58857024", "0.58634526", "0.5858274", "0.58412313", "0.5819946", "0.58001196", "0.57995325", "0.579291", "0.5784838", "0.5773418", "0.57558477", "0.5739214", "0.5738316", "0.57322115", "0.57239", "0.5721342", "0.57122344", "0.57039547", "0.5680634", "0.567634", "0.5654467", "0.5641187", "0.5629623", "0.56260717", "0.56166834", "0.56118214", "0.5611464", "0.5594666", "0.5590447", "0.5588474", "0.5580518", "0.5579207", "0.5578195", "0.55746555", "0.5573519", "0.5571828", "0.5566738", "0.55664474", "0.5550822", "0.55401826", "0.5538563", "0.55384654", "0.5535798", "0.551668", "0.5508353", "0.5504095" ]
0.876207
0
used for moving the camera on the field
public void translateX(float dx) { this.center.x += Math.cos(Math.toRadians(-rotation)) * dx; this.center.z += Math.sin(Math.toRadians(-rotation)) * dx; if (this.center.x > (this.boardWidth - ((this.boardWidth / 2f) * percentZoom))) { this.center.x = (this.boardWidth - ((this.boardWidth / 2f) * percentZoom)); } else if (this.center.x < (this.boardWidth / 2f) * percentZoom) { this.center.x = (this.boardWidth / 2f) * percentZoom; } if (this.center.z > this.boardLength - ((this.boardLength / 2f) * percentZoom)) { this.center.z = this.boardLength - ((this.boardLength / 2f) * percentZoom); } else if (this.center.z < (this.boardLength / 2f) * percentZoom) { this.center.z = (this.boardLength / 2f) * percentZoom; } changed = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void moveCamera() {\n\n\t}", "public void moveCam() {\n float x = this.cam_bind_x; //current pos the camera is binded to\n float y = this.cam_bind_y;\n\n //this amazing camera code is from: https://stackoverflow.com/questions/24047172/libgdx-camera-smooth-translation\n Vector3 target = new Vector3(x+MathUtils.cos(Global.m_angle)*20,y+MathUtils.sin(Global.m_angle)*20,0);\n final float speed = 0.1f, ispeed=1.0f-speed;\n\n Vector3 cameraPosition = cam.position;\n cameraPosition.scl(ispeed);\n target.scl(speed);\n cameraPosition.add(target);\n cam.position.set(cameraPosition);\n\n this.updateCam();\n\n }", "private void moveCamera(float tpf) {\n //Place the camera at the node\n this.getCamera().setLocation(cameraNode.getLocalTranslation().multLocal(1,0,1).add(0, 2, 0));\n cameraNode.lookAt(cam.getDirection().mult(999999), new Vector3f(0,1,0)); //Makes the gun point\n if (im.up) {\n cameraNode.move(getCamera().getDirection().mult(tpf).mult(10));\n }\n else if (im.down) {\n cameraNode.move(getCamera().getDirection().negate().mult(tpf).mult(10));\n }\n if (im.right) {\n cameraNode.move(getCamera().getLeft().negate().mult(tpf).mult(10));\n }\n else if (im.left) {\n cameraNode.move(getCamera().getLeft().mult(tpf).mult(10));\n }\n }", "public void updateCamera() {\n\t}", "public void processCamera() {\n\t\tif (Mario.getX() > 300) {\n\t\t\tlevelCompound.move(-Mario.xVel, 0);\n\t\t\tPhysics.moveHitboxes(-Mario.xVel, 0);\n\t\t\tPhysics.moveEnemies(-Mario.xVel, 0);\n\t\t\tMario.setLocation(299, Mario.getY());\n\n\t\t\tlevelCompound.move(-3, 0);\n\t\t\tPhysics.moveHitboxes(-3, 0);\n\t\t\tPhysics.moveEnemies(-3, 0);\n\t\t}\n\t}", "private void changeCameraPosition() {\n yPosition = mPerspectiveCamera.position.y;\n if (isMovingUp) {\n yPosition += 0.1;\n if (yPosition > 20)\n isMovingUp = false;\n } else {\n yPosition -= 0.1;\n if (yPosition < 1)\n isMovingUp = true;\n }\n\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n mPerspectiveCamera.update();\n }", "public void moveCamera(int dX, int dY) {\n cameraX += dX;\n cameraY += dY;\n reposition();\n }", "@Override\n public void onCameraMoveStarted(int i) {\n\n }", "private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}", "public static void setCameraFrame() {\n\t\tCAMERA.src = VERTICES[CAMERA.v];\n\t\tVector zc = CAMERA.src.d.scale(-1).normalized();\n\t\tCAMERA.zAxis = zc;\n\t\tVector xc = MathUtils.cross(CAMERA.src.d, new Vector(0, 1, 0)).normalized();\n\t\tCAMERA.xAxis = xc;\n\t\tVector yc = MathUtils.cross(zc, xc).normalized();\n\t\tCAMERA.yAxis = yc;\n\t\t\n\t\tSystem.out.println(\"***** just set camera: \" + CAMERA.toString());\n\t}", "@Override\n\tpublic void shiftCamera() {\n\t\t\n\t}", "public void update() {\n\t\tupdateCamera();\n\t}", "private void adjustCameraPosition() {\n if (upward) {\n\n if (tilt<90) {\n tilt ++;\n zoom-=0.01f;\n } else {\n upward=false;\n }\n\n } else {\n if (tilt>0) {\n tilt --;\n zoom+=0.01f;\n } else {\n upward=true;\n }\n }\n }", "public void move(Camera camera) {\n stormCloud.setPosition(0, camera.getPositionY() - 387 * 2);\n cloudRectangle.setPosition(stormCloud.getX(),stormCloud.getY());\n }", "public void updateCamera(int x, int y) {\n gc.getCamera().setPosition(x, y);\n\n // DOWN\n if (gc.getCamera().getY() > gc.getHeight()\n - gc.getCamera().getViewportSizeY()) {\n gc.getCamera().setY(gc.getHeight()\n - gc.getCamera().getViewportSizeY());\n }\n\n // RIGHT\n if (gc.getCamera().getX() > gc.getWidth()\n - gc.getCamera().getViewportSizeX()) {\n gc.getCamera().setX(gc.getWidth()\n - gc.getCamera().getViewportSizeX());\n }\n\n // LEFT\n if (gc.getCamera().getX() < 0) {\n gc.getCamera().setX(0);\n }\n\n // UP\n if (gc.getCamera().getY() < 0) {\n gc.getCamera().setY(0);\n }\n }", "public void cameraUpdate(float delta) {\n Vector3 vPosition = cam.position;\n\n // a + (b-a) * trail amount \n // target\n // a = the current cam position\n //b the current player posistion\n\n\n //determines which player the camera follows\n if (Gdx.input.isKeyJustPressed(Input.Keys.SPACE)) {\n nCurrentPlayer = nCurrentPlayer * -1;\n }\n if (nCurrentPlayer > 0) {\n vPosition.x = cam.position.x + (bplayer.getPosition().x * PPM - cam.position.x) * 0.1f;\n vPosition.y = cam.position.y + (bplayer.getPosition().y * PPM - cam.position.y) * 0.1f;\n } else {\n vPosition.x = cam.position.x + (bplayer2.getPosition().x * PPM - cam.position.x) * 0.1f;\n vPosition.y = cam.position.y + (bplayer2.getPosition().y * PPM - cam.position.y) * 0.1f;\n }\n cam.position.set(vPosition);\n cam.update();\n }", "private void setCamera() {\n\t\tVector viewTranslation = controller.getCameraPosition();\n\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\t\tGL11.glMatrixMode(GL11.GL_PROJECTION);\n\t\tGL11.glLoadIdentity();\n\n\t\tfloat whRatio = (float) windowWidth / (float) windowHeight;\n\t\tGLU.gluPerspective(controller.getFOV(), whRatio, 1, 100000);\n\t\tGLU.gluLookAt((float) viewTranslation.x, (float) viewTranslation.y,\n\t\t\t\t(float) controller.getCameraDistance(), (float) viewTranslation.x,\n\t\t\t\t(float) viewTranslation.y, 0, 0, 1, 0);\n\n\t\tGL11.glMatrixMode(GL11.GL_MODELVIEW);\n\t\tGL11.glLoadIdentity();\n\t}", "private void myMoveCamera(final CameraUpdate cameraUpdate, final CallbackContext callbackContext) {\n map.moveCamera(cameraUpdate);\n callbackContext.success();\n }", "private void myMoveCamera(CameraPosition cameraPosition, final CallbackContext callbackContext) {\n CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);\n this.myMoveCamera(cameraUpdate, callbackContext);\n }", "public void updatePlayer() {\n if(this.hasCam) {\n this.camDir.set(cam.getDirection()).multLocal(0.3f);\n this.camLeft.set(cam.getLeft()).multLocal(0.2f);\n //initialize the walkDirection value so it can be recalculated\n walkDirection.set(0,0,0);\n if (this.left) {\n this.walkDirection.addLocal(this.camLeft);\n }\n if (this.right) {\n this.walkDirection.addLocal(this.camLeft.negate());\n }\n if (this.up) {\n this.walkDirection.addLocal(this.camDir);\n }\n if (this.down) {\n this.walkDirection.addLocal(this.camDir.negate());\n }\n this.mobControl.setWalkDirection(this.walkDirection);\n //player.get\n cam.setLocation(this.mobControl.getPhysicsLocation().add(0,1.5f,0));\n this.setRootPos(this.mobControl.getPhysicsLocation().add(0,-0.75f,0));\n this.setRootRot(this.camDir, this.camLeft);\n }\n // If the actor control does not have ownership of cam, do nothing\n }", "private void move() {\n\t\t\tx += Math.PI/12;\n\t\t\thead.locY = intensity * Math.cos(x) + centerY;\n\t\t\thead.yaw = spinYaw(head.yaw, 3f);\n\t\t\t\t\t\n\t\t\tPacketHandler.teleportFakeEntity(player, head.getId(), \n\t\t\t\tnew Location(player.getWorld(), head.locX, head.locY, head.locZ, head.yaw, 0));\n\t\t}", "@SuppressWarnings(\"unused\")\n private void moveCamera(JSONArray args, CallbackContext callbackContext) throws JSONException {\n this.updateCameraPosition(\"moveCamera\", args, callbackContext);\n }", "private void configureCamera() {\n float fHeight = cam.getFrustumTop() - cam.getFrustumBottom();\n float fWidth = cam.getFrustumRight() - cam.getFrustumLeft();\n float fAspect = fWidth / fHeight;\n float yDegrees = 45f;\n float near = 0.02f;\n float far = 20f;\n cam.setFrustumPerspective(yDegrees, fAspect, near, far);\n\n flyCam.setMoveSpeed(5f);\n\n cam.setLocation(new Vector3f(2f, 4.7f, 0.4f));\n cam.setRotation(new Quaternion(0.348f, -0.64f, 0.4f, 0.556f));\n }", "public void handleCamera(){\n CameraIsScrolling = true;\n //if the camera is scrolling, scroll the camera\n if(CameraIsScrolling){\n mainCamera.position.set(mainCamera.position.x + CameraScrollSpeed, mainCamera.position.y, mainCamera.position.z);\n mainCamera.update();\n }\n\n }", "public void runProjectionMotion(){\n\t\tpos.setLocation(pos.getX() + vel[0]/5, pos.getY() - vel[1]/5);\r\n\t\tvel[1]-=gravity;\r\n\t}", "@Override\n public void onMove(float x, float y) {\n }", "@Override\n public void onCameraMoveStarted(int reason) {}", "public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}", "private void moveRight(){\n if(getXFromCamera() > -10 && getXFromCamera() < 10){\n getWorld().moveCamera(speed);\n }\n setGlobalLocation(getGlobalX() + speed, getGlobalY());\n animationSpeedRight();\n }", "public void setCameraPos(CamPos in){\r\n\t\tresolveCamPos(in);\r\n\t\tpan_servo.setAngle(cur_pan_angle);\r\n\t\ttilt_servo.setAngle(cur_tilt_angle);\r\n\t\t\r\n\t\t\r\n\t}", "private void move() {\n acceleration.accelerate(velocity, position);\r\n }", "public void move(TrackerState state) {\n\t\t\n\t\tcurrentPosition[0] = state.devicePos[0];\n\t\tcurrentPosition[1] = state.devicePos[1];\n\t\tcurrentPosition[2] = state.devicePos[2];\n\t\t\n\t\tboolean processMove = false;\n\t\t\n\t\tboolean isWheel = (state.actionType == TrackerState.TYPE_WHEEL);\n\t\tboolean isZoom = (isWheel || state.ctrlModifier);\n\t\t\n\t\tif (isZoom) {\n\t\t\t\n\t\t\tdirection[0] = 0;\n\t\t\tdirection[1] = 0;\n\t\t\t\n\t\t\tif (isWheel) {\n\t\t\t\tdirection[2] = state.wheelClicks * 0.1f;\n\t\t\t\t\n\t\t\t} else if (state.ctrlModifier) {\n\t\t\t\tdirection[2] = (currentPosition[1] - startPosition[1]);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tdirection[2] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif (direction[2] != 0) {\n\t\t\t\t\n\t\t\t\tdirection[2] *= 16;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tinVector.x = startViewMatrix.m02;\n\t\t\t\tinVector.y = startViewMatrix.m12;\n\t\t\t\tinVector.z = startViewMatrix.m22;\n\t\t\t\tinVector.normalize();\n\t\t\t\tinVector.scale(direction[2]);\n\t\t\t\t\n\t\t\t\tpositionVector.add(inVector);\n\t\t\t\t\n\t\t\t\t// stay above the floor\n\t\t\t\tif (positionVector.y > 0) {\n\t\t\t\t\tdestViewMatrix.set(startViewMatrix);\n\t\t\t\t\tdestViewMatrix.setTranslation(positionVector);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\tdirection[0] = -(startPosition[0] - currentPosition[0]);\n\t\t\tdirection[1] = -(currentPosition[1] - startPosition[1]);\n\t\t\tdirection[2] = 0;\n\t\t\t\n\t\t\tfloat Y_Rotation = direction[0];\n\t\t\tfloat X_Rotation = direction[1];\n\t\t\t\n\t\t\tif( ( Y_Rotation != 0 ) || ( X_Rotation != 0 ) ) {\n\t\t\t\t\n\t\t\t\tdouble theta_Y = -Y_Rotation * Math.PI;\n\t\t\t\tdouble theta_X = -X_Rotation * Math.PI;\n\t\t\t\t\n\t\t\t\tdata.viewpointTransform.getTransform(startViewMatrix);\n\t\t\t\tstartViewMatrix.get(positionVector);\n\t\t\t\t\n\t\t\t\tpositionVector.x -= centerOfRotation.x;\n\t\t\t\tpositionVector.y -= centerOfRotation.y;\n\t\t\t\tpositionVector.z -= centerOfRotation.z;\n\t\t\t\t\n\t\t\t\tif (theta_Y != 0) {\n\n\t\t\t\t\trot.set(0, 1, 0, (float)theta_Y);\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (theta_X != 0) {\n\t\t\t\t\t\n\t\t\t\t\tvec.set(positionVector);\n\t\t\t\t\tvec.normalize();\n\t\t\t\t\tfloat angle = vec.angle(Y_AXIS);\n\t\t\t\t\t\n\t\t\t\t\tif (angle == 0) {\n\t\t\t\t\t\tif (theta_X > 0) {\n\t\t\t\t\t\t\trightVector.x = startViewMatrix.m00;\n\t\t\t\t\t\t\trightVector.y = startViewMatrix.m10;\n\t\t\t\t\t\t\trightVector.z = startViewMatrix.m20;\n\t\t\t\t\t\t\trightVector.normalize();\n\t\t\t\t\t\t\trot.set(rightVector.x, 0, rightVector.z, (float)theta_X);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trot.set(0, 0, 1, 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ((theta_X + angle) < 0) {\n\t\t\t\t\t\t\ttheta_X = -(angle - 0.0001f);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvec.y = 0;\n\t\t\t\t\t\tvec.normalize();\n\t\t\t\t\t\trot.set(vec.z, 0, -vec.x, (float)theta_X);\n\t\t\t\t\t}\n\t\t\t\t\tmtx.set(rot);\n\t\t\t\t\tmtx.transform(positionVector);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpositionPoint.x = positionVector.x + centerOfRotation.x;\n\t\t\t\tpositionPoint.y = positionVector.y + centerOfRotation.y;\n\t\t\t\tpositionPoint.z = positionVector.z + centerOfRotation.z;\n\t\t\t\t\n\t\t\t\t// don't go below the floor\n\t\t\t\tif (positionPoint.y > 0) {\n\t\t\t\t\t\n\t\t\t\t\tmatrixUtils.lookAt(positionPoint, centerOfRotation, Y_AXIS, destViewMatrix);\n\t\t\t\t\tmatrixUtils.inverse(destViewMatrix, destViewMatrix);\n\t\t\t\t\t\n\t\t\t\t\tprocessMove = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (processMove) {\n\t\t\t\n\t\t\tboolean collisionDetected = \n\t\t\t\tcollisionManager.checkCollision(startViewMatrix, destViewMatrix);\n\t\t\t\n\t\t\tif (!collisionDetected) {\n\t\t\t\tAV3DUtils.toArray(destViewMatrix, array);\n\t\t\t\tChangePropertyTransientCommand cptc = new ChangePropertyTransientCommand(\n\t\t\t\t\tve, \n\t\t\t\t\tEntity.DEFAULT_ENTITY_PROPERTIES, \n\t\t\t\t\tViewpointEntity.VIEW_MATRIX_PROP,\n\t\t\t\t\tarray,\n\t\t\t\t\tnull);\n\t\t\t\tcmdCntl.execute(cptc);\n\t\t\t\tif (statusManager != null) {\n\t\t\t\t\tstatusManager.fireViewMatrixChanged(destViewMatrix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tstartPosition[0] = currentPosition[0];\n\t\tstartPosition[1] = currentPosition[1];\n\t\tstartPosition[2] = currentPosition[2];\n\t}", "void cameraSetup();", "private void moveCameraToPosWithinBoardBounds(float x, float y) {\n // the camera position is the center coordinate of the displayed area --> cam.viewport.../2\n cam.position.x = MathUtils.clamp(x,\n cam.viewportWidth/2 - (cam.viewportWidth/2)*(1-getZoomFactor()),\n cam.viewportWidth/2 + (cam.viewportWidth/2)*(1-getZoomFactor()));\n cam.position.y = MathUtils.clamp(cam.viewportHeight-y,\n cam.viewportHeight/2 - (cam.viewportHeight/2)*(1-getZoomFactor()),\n cam.viewportHeight/2 + (cam.viewportHeight/2)*(1-getZoomFactor()));\n cam.update();\n }", "public void offsetCamera(Location offset){\n //updateCoordinateToScreenPosition();\n xCameraOffset = offset.getX();\n yCameraOffset = offset.getY();\n }", "private void updateView(){\n \n camera.updateView();\n }", "public void move() {\n\t\tthis.move(velocity.x, velocity.y);\n\t}", "public void updateCamera(Camera cam, double distance) {\r\n camera = cam;\r\n screenDistance = distance;\r\n }", "public void move() {\n float diffX = cDestination.getX() - getCenterX();\n float diffY = cDestination.getY() - getCenterY();\n\n float newX = cPosition.getX() + cSpeed * Math.signum(diffX);\n float newY = cPosition.getY() + cSpeed * Math.signum(diffY);\n\n cPosition.setX(newX);\n cPosition.setY(newY);\n }", "@Override\n public boolean keyDown(int keycode) {\n Entity playerCharacter = engine.getEntitiesFor(Family.all(MainCharacterComponent.class).get()).first();\n PositionComponent position = playerCharacter.getComponent(PositionComponent.class);\n\n RenderSystem renderSys = engine.getSystem(RenderSystem.class);\n Integer camMaxX = renderSys.mapWidth; // - (int)renderSys.camera.viewportWidth/2;\n Integer camMaxY = renderSys.mapHeight; // - (int)renderSys.camera.viewportHeight/2;\n Integer pcMaxY = renderSys.mapWidth; //+(int)(renderSys.camera.viewportHeight/2);\n Integer pcMaxX = renderSys.mapHeight; //+(int)(renderSys.camera.viewportWidth/2);\n\n\n CameraComponent cameraPosition = renderSys.getCameraComponent();\n\n\n //TODO fix camera positioning code after testing.\n if(keycode == Input.Keys.LEFT) {\n //pcWalkDirection = \"LEFT\";\n //camera.translate(-1,0);\n position.direction = \"LEFT\";\n if (position.x > 0) {\n Moving.LEFT = true;\n }\n else {\n Moving.LEFT = false;\n position.x = 0;\n }\n }\n if(keycode == Input.Keys.RIGHT) {\n //pcWalkDirection = \"RIGHT\";\n //camera.translate(1,0);\n position.direction = \"RIGHT\";\n if (position.x < pcMaxX-1) {\n Moving.RIGHT = true;\n }\n else {\n Moving.RIGHT = false;\n position.x = pcMaxX-1;\n }\n }\n if(keycode == Input.Keys.UP) {\n //pcWalkDirection = \"UP\";\n //camera.translate(0, 1);\n position.direction = \"UP\";\n if (position.y < pcMaxY-1) {\n Moving.UP = true;\n }\n else {\n Moving.UP = false;\n position.y = pcMaxY-1;\n }\n }\n if(keycode == Input.Keys.DOWN) {\n //pcWalkDirection = \"DOWN\";\n //camera.translate(0,-1);\n position.direction = \"DOWN\";\n if (position.y > 0) {\n Moving.DOWN = true;\n }\n else {\n Moving.DOWN = false;\n position.y = 0;\n }\n }\n if(keycode == Input.Keys.NUM_1)\n //tiledMap.getLayers().get(0).setVisible(!tiledMap.getLayers().get(0).isVisible());\n if(keycode == Input.Keys.NUM_2)\n //tiledMap.getLayers().get(1).setVisible(!tiledMap.getLayers().get(1).isVisible());\n if(keycode == Input.Keys.ESCAPE) {\n Gdx.app.exit();\n\n }\n return false;\n }", "private void moveCameraWithinBoardBounds(float deltaX, float deltaY) {\n // zoom factor is incorporated to make (absolute) camera movement slower when zoomed in\n // so it's always the same visual velocity\n float newX = cam.position.x - deltaX*getZoomFactor();\n float newY = cam.position.y + deltaY*getZoomFactor();\n moveCameraToPosWithinBoardBounds(newX, cam.viewportHeight-newY);\n }", "public void updateCam()\r\n {\n \ttry{\r\n \tSystem.out.println();\r\n \tNIVision.IMAQdxGrab(curCam, frame, 1);\r\n \tif(curCam == camCenter){\r\n \t\tNIVision.imaqDrawLineOnImage(frame, frame, NIVision.DrawMode.DRAW_VALUE, new Point(320, 0), new Point(320, 480), 120);\r\n \t}\r\n server.setImage(frame);}\n \tcatch(Exception e){}\r\n }", "@Override\n\tpublic void pan(Vector3 delta) {\n\t\t// keep camera within borders\n\t\tfloat x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x);\n\t\tfloat y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y);\n\t\tfloat z = Utils.between(viewCamera.position.z + delta.z, bounds.min.z, bounds.max.z);\n\t\tviewCamera.position.set(x, y, z);\n\t\tviewCamera.update();\n\t}", "public void move(){\n\t\t\n\t}", "@Override\n\tpublic void pan(Vector2 delta) {\n\t\t// keep camera within borders\n\t\tfloat x = Utils.between(viewCamera.position.x + delta.x, bounds.min.x, bounds.max.x);\n\t\tfloat y = Utils.between(viewCamera.position.y + delta.y, bounds.min.y, bounds.max.y);\n\t\tviewCamera.position.set(x, y, 0);\n\t\tviewCamera.update();\n\t}", "public void actionPerformed(ActionEvent ae){\n\t\ttarget.moveCameraBRU(target.getVVec().normalize(0.2f));\r\n\t\t// set V vec to 1.0 length\r\n\t\ttarget.getVVec().normalize(1.0f);\r\n\t}", "public double update() {\n\t\t double time=System.currentTimeMillis();\n\t\t boolean update=false;\n\t\t \n\t\t// Keyboard handling\n\t\tif (scene.ready) {\n\t\t\tif (command==KeyEvent.VK_D) \n\t\t\t\tcamera.y_rot=camera.y_rot+0.02;\n\t\t\tif (command==KeyEvent.VK_A)\n\t\t\t\tcamera.y_rot=camera.y_rot-0.02;\n\t\t\tif (command==KeyEvent.VK_Q)\n\t\t\t\tcamera.z_rot=camera.z_rot-0.02;\n\t\t\tif (command==KeyEvent.VK_E)\n\t\t\t\tcamera.z_rot=camera.z_rot+0.02;\n\t\t\tif (command==KeyEvent.VK_R)\n\t\t\t\tcamera.x_rot=camera.x_rot+0.02;\n\t\t\tif (command==KeyEvent.VK_F)\n\t\t\t\tcamera.x_rot=camera.x_rot-0.02;\n\n\t\t\tif (command==KeyEvent.VK_W)\n\t\t\t\tcamera.translateWithRespectToView(0,0,250);\n\t\t\tif (command==KeyEvent.VK_S)\n\t\t\t\tcamera.translateWithRespectToView(0,0,-250);\n\t\t\tif (command==KeyEvent.VK_Z)\n\t\t\t\tcamera.translateWithRespectToView(-250,0,0);\n\t\t\tif (command==KeyEvent.VK_X)\n\t\t\t\tcamera.translateWithRespectToView(250,0,0);\n\t\t\tif (command==KeyEvent.VK_T)\n\t\t\t\tcamera.translateWithRespectToView(0,250,0);\n\t\t\tif (command==KeyEvent.VK_G)\n\t\t\t\tcamera.translateWithRespectToView(0,-250,0);\n\n\t\t\tif (command==KeyEvent.VK_J)\n\t\t\t\tvobject[0].rotate(0,-0.01,0);\n\t\t\tif (command==KeyEvent.VK_L)\n\t\t\t\tvobject[0].rotate(0,0.01,0);\n\t\t\tif (command==KeyEvent.VK_I)\n\t\t\t\tvobject[0].rotate(0.01,0.0,0);\n\t\t\tif (command==KeyEvent.VK_K)\n\t\t\t\tvobject[0].rotate(-0.01,0,0);\n\t\t\tif (command==KeyEvent.VK_U)\n\t\t\t\tvobject[0].rotate(0,0.00,-0.01);\n\t\t\tif (command==KeyEvent.VK_O)\n\t\t\t\tvobject[0].rotate(0.0,0,0.01);\n\n\t\t\tif (command==KeyEvent.VK_1) \n\t\t\t{scene.dot_field= !scene.dot_field;}\n\t\t\tif (command==KeyEvent.VK_2)\n\t\t\t{scene.wireframe= !scene.wireframe;}\n\t\t\tif (command==KeyEvent.VK_3)\n\t\t\t{scene.solid_poly= !scene.solid_poly;}\n\t\t\tif (command==KeyEvent.VK_4)\n\t\t\t{scene.hidden_face= !scene.hidden_face;}\n\t\t\tif (command==KeyEvent.VK_5)\n\t\t\t{scene.simple_shaded= !scene.simple_shaded;}\n\t\t\tif (command==KeyEvent.VK_6)\n\t\t\t{scene.z_sorted= !scene.z_sorted;}\n\t\t\tif (command==KeyEvent.VK_7)\n\t\t\t{scene.gouraud_shaded= !scene.gouraud_shaded;}\n\t\t\tif (command==KeyEvent.VK_8)\n\t\t\t{scene.fullstats= !scene.fullstats;}\n\n\t\t\tif (command==KeyEvent.VK_0 && scene.ready)\n\t\t\t{worldgrid.diamondSquare(1,roughness,1); \n\t\t\t}\n\n\t\t\tif (command==KeyEvent.VK_9) \n\t\t\t{scene.surface= !scene.surface;}\n\n\t\t\tif (command==KeyEvent.VK_P && scene.ready) {\n\t\t\t\t//Planet myplanet=new Planet(60);\n\t\t\t\tmyplanet.Iterate(0.1,1,1);\n\t\t\t\t//myplanet.scale(2000);\n\t\t\t\tvobject[0]=myplanet;\n\t\t\t}\n\n\t\t\tcommand=0;\n\t\t}\n\n\t\t// generic\n\n\t\tif (!scene.surface) {\t\n\t\t\tif (!scene.test) {\n\t\t\t\tvobject[0].rotate(0.000,0.002,0.000);\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvobject[0].rotate(0.008,0.005,0.01);\n\t\t\t}\n\t\t}\n\n\n\t\n\t\tif ((first_time) && (scene.surface)) {foreThoughtThread.start(); first_time=false; }\n\t\tupdateLighting();\n\t\treturn tick_time_seconds;\n\t}", "public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }", "@Override\n public void simpleUpdate(float tpf) {\n listener.setLocation(cam.getLocation());\n listener.setRotation(cam.getRotation());\n }", "public void move() {\r\n\t\tsetY(getY() + 134);\r\n\t\tmyImage = myImage.getScaledInstance(100, 300, 60);\r\n\r\n\t}", "public void move()\n\t{\n\t\tx = x + frogVelocityX;\n\t}", "public void camera360() {\n\n }", "public void move() {\r\n posX += movementX;\r\n posY += movementY;\r\n anchorX += movementX;\r\n anchorY += movementY;\r\n }", "@Override\n public void move() {\n this.point.x += vector.x * getCurrentSpeed();\n this.point.y += vector.y * getCurrentSpeed();\n }", "public void move() {\n this.pposX = this.posX;\n this.pposY = this.posY;\n this.posX = newPosX;\n this.posY = newPosY;\n }", "public interface Camera extends GameObject {\n\n public static final byte FORWARDS = 0x0;\n public static final byte LEFT = 0x1;\n public static final byte BACKWARDS = 0x2;\n public static final byte RIGHT = 0x3;\n\n /**\n * The default camera controls.\n */\n public static final byte[] DEFAULT_CAMERA_CONTROLLER = {\n Keys.KEY_W, Keys.KEY_A, Keys.KEY_S, Keys.KEY_D\n };\n\n /**\n * @return the position of the <code>Camera</code> in the world\n */\n public abstract ReadableVector3f getPosition();\n\n /**\n * @param deltaX the change along the X axis\n * @param deltaY the change along the Y axis\n * @param deltaZ the change along the Z axis\n */\n public abstract void translate(float deltaX, float deltaY, float deltaZ);\n\n public abstract void translate(ReadableVector3f delta);\n\n /**\n * @param position the new position of the <code>Camera</code>\n */\n public abstract void setPosition(ReadableVector3f position);\n}", "public void onCamera();", "@Override\n\t\t\t\tpublic void drag(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer) {\n\t\t\t\t\tgameObject.moveBy(x-gameObject.getWidth()/2, y-gameObject.getHeight()/2);\n\t\t\t\t}", "protected void updateCameraPosition() {\n if (!mIsMapStatic && mMap != null && mMapConfiguration != null && mIsMapLoaded) {\n updateCameraPosition(mMapConfiguration.getCameraPosition());\n }\n }", "public void move() {\n\t\tthis.hero.setPF(1);\n\t\tthis.hero.setState(this.hero.getMoved());\n\t}", "public void move()\n {\n x = x + unitVector.getValue(1)*speed;\n y = y + unitVector.getValue(2)*speed;\n }", "public void move() {\n\t\tdouble xv = 0;\r\n\t\tdouble yv = 0;\r\n\t\t//this method allows the entity to hold both up and down (or left and right) and not move. gives for smooth direction change and movement\r\n\t\tif (moveRight) {\r\n\t\t\txv+=getSpeed();\r\n\t\t\torientation = Orientation.EAST;\r\n\t\t}\r\n\t\tif (moveLeft) {\r\n\t\t\txv-=getSpeed();\r\n\t\t\torientation = Orientation.WEST;\r\n\t\t}\r\n\t\tif (moveUp)\r\n\t\t\tyv-=getSpeed();\r\n\t\tif (moveDown)\r\n\t\t\tyv+=getSpeed();\r\n\t\tif (!doubleEquals(xv,0) || !doubleEquals(yv,0)) {\r\n\t\t\t((Player)this).useMana(0.1);\r\n\t\t\tImageIcon img = new ImageIcon(\"lib/assets/images/fireball.png\");\r\n\t\t\tBufferedImage image = new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB);\r\n\t\t\tGraphics g = image.getGraphics();\r\n\t\t\tg.drawImage(img.getImage(), 0, 0, image.getWidth(), image.getHeight(), null);\r\n\t\t\tColor n = loop[ind%loop.length];\r\n\t\t\tind++;\r\n\t\t\timage = ImageProcessor.scaleToColor(image, n);\r\n\t\t\t//PopMessage.addPopMessage(new PopMessage(image,getX(),getY()));\r\n\t\t}\r\n\t\telse\r\n\t\t\t((Player)this).useMana(-0.1);\r\n\t\tmove(xv,yv);\r\n\t}", "private void move()\n\t{\n\t\tif(moveRight)\n\t\t{\n\t\t\tif(position.getX() + speedMovement <= width)\n\t\t\t{\n\t\t\t\tposition.setX(position.getX() +speedMovement+speedBoost);\n\t\t\t\tmoveRight = false;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\t\n\t\tif(moveLeft)\n\t\t{\n\t\t\tif(position.getX() - speedMovement > 0)\n\t\t\t{\n\t\t\t\tposition.setX(position.getX() -speedMovement - speedBoost + gravitationalMovement);\n\t\t\t\tmoveLeft = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * If a gravitational field is pushing the ship, set the movement accordingly\n\t\t */\n\t\tif(gravitationalMovement>0)\n\t\t{\n\t\t\tif(position.getX()+gravitationalMovement <= width)\n\t\t\t\tposition.setX(position.getX() + gravitationalMovement);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(position.getX() + gravitationalMovement > 0)\n\t\t\t\tposition.setX(position.getX() + gravitationalMovement);\n\t\t}\n\t}", "public void move() {\n float xpos = thing.getX(), ypos = thing.getY();\n int xdir = 0, ydir = 0;\n if (left) xdir -= SPEED; if (right) xdir += SPEED;\n if (up) ydir -= SPEED; if (down) ydir += SPEED;\n xpos += xdir; ypos += ydir;\n\n VeggieCopter game = thing.getGame();\n int w = game.getWindowWidth(), h = game.getWindowHeight();\n int width = thing.getWidth(), height = thing.getHeight();\n if (xpos < 1) xpos = 1; if (xpos + width >= w) xpos = w - width - 1;\n if (ypos < 1) ypos = 1; if (ypos + height >= h) ypos = h - height - 1;\n thing.setPos(xpos, ypos);\n }", "public void setupCamera() {\r\n p.camera(width/2.0f, height/2.0f, cameraZ,\r\n width/2.0f, height/2.0f, 0, 0, 1, 0);\r\n\r\n if(isTiling) {\r\n float mod=1f/10f;\r\n p.frustum(width*((float)tileX/(float)tileNum-.5f)*mod,\r\n width*((tileX+1)/(float)tileNum-.5f)*mod,\r\n height*((float)tileY/(float)tileNum-.5f)*mod,\r\n height*((tileY+1)/(float)tileNum-.5f)*mod,\r\n cameraZ*mod, 10000);\r\n }\r\n\r\n }", "public void move()\n {\n xPosition = xPosition + xSpeed;\n yPosition = yPosition + ySpeed;\n draw();\n if (xPosition >= rightBound - diameter)\n {\n xSpeed = -(xSpeed);\n\n }\n else\n {\n }\n if (xPosition <= leftBound)\n {\n xSpeed = -(xSpeed);\n\n }\n else\n {\n }\n if (yPosition <= upBound)\n {\n ySpeed = -(ySpeed);\n\n }\n else\n {\n }\n if (yPosition >= lowBound - diameter)\n {\n ySpeed = -(ySpeed);\n\n }\n else \n {\n }\n\n }", "public void Move()\n {\n this.x += this.speed;\n\n //Cutoff the position\n if (this.x <= 2)\n {\n this.x = 2;\n }\n else if (this.x >= GameConstants.SCREEN_WIDTH - 2 * this.imageWidth)\n {\n this.x = GameConstants.SCREEN_WIDTH - 2 * this.imageWidth;\n }\n }", "public void centerCameraOn(GameObject thing) {\r\n\t\tthis.cameraX = (int)(thing.getX() - Game.WIDTH / 2);\r\n\t\tthis.cameraY = (int) (thing.getY() - Game.HEIGHT / 2);\r\n\t}", "public void move() {\n\t\tmoveX();\n\t\tmoveY();\n\t}", "public void move() {\n\r\n\t}", "@Override\n public void setCamera (GL2 gl, GLU glu, GLUT glut) {\n glu.gluLookAt(0, 0, 2.5, // from position\n 0, 0, 0, // to position\n 0, 1, 0); // up direction\n }", "public void move()\r\n\t{\r\n\t\tmoveHor(xVel);\r\n\t\tmoveVert(yVel);\r\n\t}", "private void move() {\n\t\t\tangle += Math.PI/24;\n\t\n\t\t\tcow.locX = Math.sin(angle) * 2.5 + player.getLocation().getX();\n\t\t\tcow.locZ = Math.cos(angle) * 2.5 + player.getLocation().getZ();\n\t\t\t\n\t\t\tLocation loc = new Location(player.getWorld(), cow.locX, player.getLocation().getY() + 1.5, cow.locZ);\n\t\t\tloc.setDirection(player.getLocation().subtract(loc).toVector()); //Look at the player\n\t\t\t\n\t\t\tPacketHandler.teleportFakeEntity(player, cow.getId(), loc);\n\t\t}", "public void move()\n {\n double angle = Math.toRadians( getRotation() );\n int x = (int) Math.round(getX() + Math.cos(angle) * WALKING_SPEED);\n int y = (int) Math.round(getY() + Math.sin(angle) * WALKING_SPEED);\n setLocation(x, y);\n }", "public void restoreCamera() {\r\n float mod=1f/10f;\r\n p.camera(width/2.0f, height/2.0f, cameraZ,\r\n width/2.0f, height/2.0f, 0, 0, 1, 0);\r\n p.frustum(-(width/2)*mod, (width/2)*mod,\r\n -(height/2)*mod, (height/2)*mod,\r\n cameraZ*mod, 10000);\r\n }", "public void move() {\n\tupdateSwapTime();\n\tupdateAttackTime();\n\n\tif (enemyNear) {\n\t if (moved) {\n\t\tstopMove();\n\t\tmoved = false;\n\t }\n\t} else {\n\t if (!moved) {\n\t\tcontinueMove();\n\t\tmoved = true;\n\t }\n\n\t x += dx;\n\t y += dy;\n\n\t if (x < speed) {\n\t\tx = speed;\n\t\tdx = (-1) * dx;\n\t }\n\n\t if (y < speed) {\n\t\ty = speed;\n\t\tdy = (-1) * dy;\n\t }\n\n\t if (x > MapSize.getSIZE().getWidth() - 40) {\n\t\tx = MapSize.getSIZE().getWidth() - 40;\n\t\tdx = (-1) * dx;\n\t }\n\n\t if (y > MapSize.getSIZE().getHeight() - 40) {\n\t\ty = MapSize.getSIZE().getHeight() - 40;\n\t\tdy = (-1) * dy;\n\t }\n\t}\n }", "public void move() {\n\t\tx+= -1;\n\t\tif (x < 0) {\n\t\t\tx = (processing.width - 1);\n\t\t}\n\t\ty+= 1;\n\t\tif (y > processing.height-1)\n\t\t\ty=0;\n\t}", "@Override\n\tpublic void update() {\n\t\tmouseMove(gm.mouseY);\n\t\tmoveCollider();\n\t}", "void updatePosition() {\n\t\t\n\t\tcoords.x = body.getPosition().x*Simulation.meterToPixel;\n\t\tcoords.y = body.getPosition().y*Simulation.meterToPixel;\n\t\tspeed.x = body.m_linearVelocity.x;\n\t\tspeed.y = body.m_linearVelocity.y;\n\t}", "public void updateFireVector(){\n\t\tdouble difX = owner.getMouseX() - owner.getMidX();\n\t\tdouble difY = owner.getMouseY() - owner.getMidY();\n\t\tdouble magnitude = Math.pow(difX * difX + difY * difY, .5);\n//\t\tdouble newFireX = difX / magnitude;\n//\t\tdouble newFireY = difY / magnitude;\n//\t\tif(Math.abs(newFireX - fireX) > Math.abs(minChange)){\n//\t\t\tfireX = newFireX;\n//\t\t}\n//\t\tif(Math.abs(newFireY - fireY) > Math.abs(minChange)){\n//\t\t\tfireY = newFireY;\n//\t\t}\n\t\tfireX = difX / magnitude;\n\t\tfireY = difY / magnitude;\n//\t\tif(fireX < 0){\n//\t\t\tfacingRight = -1;\n//\t\t}\n//\t\telse{\n//\t\t\tfacingRight = 1;\n//\t\t}\n//\t\tSystem.out.println(fireX);\n//\t\tSystem.out.println(fireY);\n//\t\tSystem.out.println();\n\t}", "@Override\n public void movement() {\n if (isAlive()) {\n //Prüfung ob A oder die linke Pfeiltaste gedrückt ist\n if (Keyboard.isKeyDown(KeyEvent.VK_LEFT) || Keyboard.isKeyDown(KeyEvent.VK_A)) {\n //Änder die X Position um den speed wert nach link (verkleinert sie)\n setPosX(getPosX() - getSpeed());\n //Prüft ob der Spieler den linken Rand des Fensters erreicht hat\n if (getPosX() <= 0) {\n //Setzt die X Position des Spielers an den Rand des Fensters zurück\n setPosX(0);\n }\n }\n //Prüfung ob D oder die rechte Pfeiltaste gedrückt ist\n if (Keyboard.isKeyDown(KeyEvent.VK_RIGHT) || Keyboard.isKeyDown(KeyEvent.VK_D)) {\n //Änder die X Position um den speed wert nach rechts (vergrößert sie)\n setPosX(getPosX() + getSpeed());\n //Prüft ob der Spieler den rechten Rand des Fensters erreicht hat\n if (getPosX() >= Renderer.getWindowSizeX() - getWight() - 7) {\n //Setzt die X Position des Spielers an den Rand des Fensters zurück\n setPosX(Renderer.getWindowSizeX() - getWight() - 7);\n }\n }\n //Aktualsiert die Hitbox\n setBounds();\n }\n }", "public void toggleCamera() {\n\t\tif (map != null && map.getCameraPosition().zoom != MBDefinition.DEFAULT_ZOOM && carLatLng!=null) {\n\t\t\tmap.moveCamera(CameraUpdateFactory.newLatLngZoom(carLatLng, MBDefinition.DEFAULT_ZOOM));\n\t\t} else if (map != null && carMarker != null && pickupMarker != null) {\n\t\t\tLatLngBounds.Builder builder = new LatLngBounds.Builder();\n\n\t\t\tbuilder.include(carMarker.getPosition());\n\t\t\tbuilder.include(pickupMarker.getPosition());\n\n\t\t\tLatLngBounds bounds = builder.build();\n\n\t\t\tint padding = 150; // offset from edges of the map in pixels\n\t\t\tCameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);\n\t\t\tmap.moveCamera(cu);\n\t\t}\n\t}", "public void moveForward()\r\n\t{\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] -= Math.sin(Math.toRadians(heading-90))*distance; \r\n\t\t\tthis.loc[2] -= Math.cos(Math.toRadians(heading-90))*distance;\r\n\t\t}\r\n\t}", "void move() {\n\t\tif (reachedEdge()) {\n\t\t\tvelocityX = velocityX * -1;\n\t\t\ty = y + 50;\n\t\t}\n\t\tif (reachedLeft()) {\n\t\t\tvelocityX = velocityX * -1;\n\t\t\ty = y + 50;\n\t\t}\n\n\t\tx = x + velocityX;\n\t}", "public void move(){\n super.move();\n if(getX() >= Main.WIDTH - getWidth() * 1.5) {\n setDirection(-1);\n } else if(getX() <= 50) {\n setDirection(1);\n }\n }", "void onMove();", "public void move() { \n\t\tSystem.out.println(\"MOVING\");\n\t\tswitch(direction) {\n\t\t\tcase NORTH: {\n\t\t\t\tyloc -= ySpeed;\n\t\t\t}\n\t\t\tcase SOUTH: {\n\t\t\t\tyloc+= xSpeed;\n\t\t\t}\n\t\t\tcase EAST: {\n\t\t\t\txloc+= xSpeed;\n\t\t\t}\n\t\t\tcase WEST: {\n\t\t\t\txloc-= xSpeed;\n\t\t\t}\n\t\t\tcase NORTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase NORTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc+=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc+= ySpeed;\n\t\t\t}\n\t\t}\n\t}", "public void move(){\n x+=xDirection;\n y+=yDirection;\n }", "@Override\n public void onMove(boolean absolute) {\n \n }", "@Override\n public void update(double delta) {\n model.rotateXYZ(0,(1 * 0.001f),0);\n\n float acceleration = 0.1f;\n float cameraSpeed = 1.5f;\n\n // Left - right\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_A) == GLFW_PRESS)\n speedz+= (speedz < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_A) == GLFW_RELEASE)\n speedz-= (speedz-acceleration > 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_D) == GLFW_PRESS)\n speedz-= (speedz > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_D) == GLFW_RELEASE)\n speedz+= (speedz+acceleration < 0) ? acceleration : 0;\n\n // Forward - backward\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_W) == GLFW_PRESS)\n speedx+= (speedx < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_W) == GLFW_RELEASE)\n speedx-= (speedx > 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_S) == GLFW_PRESS)\n speedx-= (speedx > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_S) == GLFW_RELEASE)\n speedx+= (speedx+acceleration < 0) ? acceleration : 0;\n\n // up - down\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_Q) == GLFW_PRESS)\n speedy+= (speedy < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_Q) == GLFW_RELEASE)\n speedy-= (speedy > 0.1) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_E) == GLFW_PRESS)\n speedy-= (speedy > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_E) == GLFW_RELEASE)\n speedy+= (speedy < 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_TAB) == GLFW_PRESS) {\n speedz = 0;\n speedx = 0;\n }\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_R) == GLFW_PRESS) {\n debugCameraObject.eyePos.x = 0;\n debugCameraObject.eyePos.y = 0;\n debugCameraObject.eyePos.z = 0;\n }\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_T) == GLFW_PRESS) {\n showSkybox = !showSkybox;\n }\n\n\n debugCameraObject.processKeyboard(DebugCamera.CameraMovement.RIGHT, (float) (speedz * delta));\n debugCameraObject.processKeyboard(DebugCamera.CameraMovement.FORWARD, (float) (speedx * delta));\n }", "@Override\n public void render(float delta) {\n Gdx.gl.glClearColor(255,255,255,0);\n Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);\n\n // 2)Input handling\n input();\n\n // 3)Update system\n\n // 3.1)---> Update Cam\n cam.update();\n game.batch.setProjectionMatrix(cam.combined);\n\n // 4)Draw\n game.batch.begin();\n draw();\n game.batch.end();\n\n\n // 3.2)---> Update Game\n\n update();\n }", "@Override\r\n\tpublic void moveTo(float x, float y) {\n\t\t\r\n\t}", "public void update(float deltaTime) {\n\t\tif (m_motionMode == NvCameraMotionType.DUAL_ORBITAL) {\n\t Transform xfm = m_xforms[NvCameraXformType.MAIN];\n\t Transform xfs = m_xforms[NvCameraXformType.SECONDARY];\n//\t xfm.m_rotate += xfm.m_rotateVel*deltaTime;\n\t VectorUtil.linear(xfm.m_rotate, xfm.m_rotateVel, deltaTime, xfm.m_rotate);\n//\t xfs.m_rotate += xfs.m_rotateVel*deltaTime;\n\t VectorUtil.linear(xfs.m_rotate, xfs.m_rotateVel, deltaTime, xfs.m_rotate);\n//\t xfm.m_translate += xfm.m_translateVel * deltaTime;\n\t VectorUtil.linear(xfm.m_translate, xfm.m_translateVel, deltaTime, xfm.m_translate);\n\n\t updateMats(NvCameraXformType.MAIN);\n\t updateMats(NvCameraXformType.SECONDARY);\n\t } else {\n\t Transform xf = m_xforms[NvCameraXformType.MAIN];\n//\t xf.m_rotate += xf.m_rotateVel*deltaTime;\n\t VectorUtil.linear(xf.m_rotate, xf.m_rotateVel, deltaTime, xf.m_rotate);\n\t Vector3f transVel;\n\t if (m_motionMode == NvCameraMotionType.FIRST_PERSON) {\n\t // obviously, this should clamp to [-1,1] for the mul, but we don't care for sample use.\n\t xf.m_translateVel.x = xf.m_maxTranslationVel * (m_xVel_kb+m_xVel_gp);\n\t xf.m_translateVel.z = xf.m_maxTranslationVel * (m_zVel_mouse+m_zVel_kb+m_zVel_gp);\n//\t transVel = nv.vec3f(nv.transpose(xf.m_rotateMat) * \n//\t nv.vec4f(-xf.m_translateVel.x, xf.m_translateVel.y, xf.m_translateVel.z, 0.0f));\n\t xf.m_rotateMat.transpose();\n\t transVel = new Vector3f(-xf.m_translateVel.x, xf.m_translateVel.y, xf.m_translateVel.z);\n\t VectorUtil.transformNormal(transVel, xf.m_rotateMat, transVel);\n\t xf.m_rotateMat.transpose();\n\t } else {\n\t transVel = xf.m_translateVel;\n\t }\n\n//\t xf.m_translate += transVel * deltaTime;\n\t VectorUtil.linear(xf.m_translate, transVel, deltaTime, xf.m_translate);\n\t updateMats(NvCameraXformType.MAIN);\n\t }\n\t}", "public void update() {\n z += speed; // increase z by speed\n if (z > 750) { z = -5000; reset(); } // if beyond the camera, reset() and start again\n transparency = z<-2500?map(z, -5000, -2500, 0, 255):255; // far away slowly increase the transparency, within range is fully opaque\n }", "@Override\n\t\t\t\tpublic void drag(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer) {\n\t\t\t\t\tgameObject.moveBy(x-gameObject.getWidth()/2, 0);\n\t\t\t\t}", "public void move(Player player, OrthographicCamera camera) {\n\t\tif(Gdx.input.isKeyPressed(Keys.DPAD_LEFT)) {\n\t\t\tplayer.position.x -= Gdx.graphics.getDeltaTime() * player.speed;\n\t\t\tplayer.sprite = player.sprites[1];\n\t\t\tcamera.translate(-Gdx.graphics.getDeltaTime() * player.speed, 0, 0);\n\t\t\t}\n\t\tif(Gdx.input.isKeyPressed(Keys.DPAD_RIGHT)) { \n\t\t\tplayer.position.x += Gdx.graphics.getDeltaTime() * player.speed;\n\t\t\tplayer.sprite = player.sprites[3];\n\t\t\tcamera.translate(Gdx.graphics.getDeltaTime() * player.speed, 0, 0);\n\t\t}\n\t\tif(Gdx.input.isKeyPressed(Keys.DPAD_UP)) { \n\t\t\tplayer.position.y += Gdx.graphics.getDeltaTime() * player.speed;\n\t\t\tplayer.sprite = player.sprites[0];\n\t\t\tcamera.translate(0, Gdx.graphics.getDeltaTime() * player.speed, 0);\n\t\t}\n\t\tif(Gdx.input.isKeyPressed(Keys.DPAD_DOWN)) { \n\t\t\tplayer.position.y -= Gdx.graphics.getDeltaTime() * player.speed;\n\t\t\tplayer.sprite = player.sprites[2];\n\t\t\tcamera.translate(0, -Gdx.graphics.getDeltaTime() * player.speed, 0);\n\t\t}\n\t\tcamera.update();\n\t}", "public void move();", "public void move();", "@Override\n public void move(){\n setDirectionSpeed(180, 7);\n this.moveTowardsAPoint(target.getCenterX(), target.getCenterY());\n }", "@Override\n\t\t\t\tpublic void drag(com.badlogic.gdx.scenes.scene2d.InputEvent event, float x, float y, int pointer) {\n\t\t\t\t\tgameObject.moveBy(0,y-gameObject.getHeight()/2);\n\t\t\t\t}", "public void strafeLeft(){\r\n\t\t//Following the camera:\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] -= Math.sin(Math.toRadians(heading))*distance; \r\n\t\t\tthis.loc[2] -= Math.cos(Math.toRadians(heading))*distance;\r\n\t\t}\r\n\t}" ]
[ "0.82445204", "0.78238297", "0.77807117", "0.7613817", "0.75441927", "0.7458527", "0.73839575", "0.7167776", "0.7094363", "0.70748293", "0.7055969", "0.70389557", "0.70197254", "0.6996539", "0.6951302", "0.6865575", "0.68354005", "0.68131864", "0.67879146", "0.67759436", "0.6770866", "0.6748417", "0.67280364", "0.6713065", "0.6684364", "0.6682154", "0.66689783", "0.6650499", "0.6647928", "0.6638289", "0.66329056", "0.66161495", "0.6576249", "0.65517837", "0.65485615", "0.65419805", "0.6538424", "0.651991", "0.65112346", "0.64988697", "0.64932007", "0.64894617", "0.6484175", "0.64788896", "0.6476803", "0.6464489", "0.6451913", "0.6446781", "0.64428276", "0.6432302", "0.6432096", "0.64316696", "0.6399431", "0.639347", "0.63867563", "0.6379147", "0.63699293", "0.636959", "0.6360032", "0.63458735", "0.63441527", "0.6342762", "0.6341329", "0.63321143", "0.6330212", "0.63266176", "0.63265", "0.6322929", "0.6320904", "0.63188046", "0.6317226", "0.630402", "0.6288285", "0.62819225", "0.62731093", "0.6257976", "0.62548685", "0.6250933", "0.62485033", "0.62448937", "0.624305", "0.62407523", "0.6234212", "0.623178", "0.6224091", "0.6222667", "0.62122816", "0.62051535", "0.61847496", "0.6184449", "0.61838704", "0.61831236", "0.6182648", "0.6171583", "0.6161769", "0.6161176", "0.6160327", "0.6160327", "0.6158351", "0.6151989", "0.613849" ]
0.0
-1
Used for the movement of the camera on the Y Axis
public void translateY(float dy) { this.center.x -= Math.sin(Math.toRadians(rotation)) * dy; this.center.z -= Math.cos(Math.toRadians(rotation)) * dy; if (this.center.z > this.boardLength - ((this.boardLength / 2f) * percentZoom)) { this.center.z = this.boardLength - ((this.boardLength / 2f) * percentZoom); } else if (this.center.z < (this.boardLength / 2f) * percentZoom) { this.center.z = (this.boardLength / 2f) * percentZoom; } if (this.center.x > ((this.boardWidth - ((this.boardWidth / 2f) * percentZoom)))) { this.center.x = (this.boardWidth - ((this.boardWidth / 2f) * percentZoom)); } else if (this.center.x < (this.boardWidth / 2f) * percentZoom) { this.center.x = (this.boardWidth / 2f) * percentZoom; } changed = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getYPos() {\r\n\t\treturn this.cameraY;\r\n\t}", "public void moveY() {\n\t\tsetY( getY() + getVy() );\n\t}", "public void setFrameY(double aY) { double y = _y + aY - getFrameY(); setY(y); }", "public void reverseDirectionY()\n\t{\n\t\t\n\t\tvy = -vy;\n\t}", "void setY(int newY) {\n this.yPos = newY;\n }", "double getPositionY();", "double getPositionY();", "double getPositionY();", "public void updateYPosition(){\r\n if (centerY + speedY >= 630) {\r\n centerY = 630;\r\n\r\n rect1= new FloatRect (centerX,centerY,80,110);\r\n }else if(!collide){\r\n\r\n centerY += speedY;\r\n\r\n rect1= new FloatRect (centerX,centerY,80,110);\r\n }\r\n else if((jumped && collide && Keyboard.isKeyPressed (Keyboard.Key.W )&& collidedTop)){\r\n speedY=-20;\r\n centerY +=speedY;\r\n }\r\n }", "public void moveY(int dir) { velocity.add(PVector.mult(up, speed * dir)); }", "public void reverseYVelocity() {\n yVelocity = -yVelocity + 50;\n this.normalizeVelocity(this.xVelocity, this.yVelocity);\n }", "@Override\n public void update(){\n super.update();\n if(getPositionY() < -2.f){\n setAngleXYDeltaTheta(0.0f);\n setAngleXY(0.0f);\n setPositionY(1.0f);\n setDy(0.0f);\n setDx(0.0f);\n setInPlay(true);\n }\n }", "public void setMovementY(int directionY) {\r\n movementY = directionY;\r\n }", "void setY(int y) {\n position = position.setY(y);\n }", "public void moveVertical(int y)\n {\n wall.moveVertical(y);\n roof.moveVertical(y);\n window.moveVertical(y);\n }", "public float screenYtoGame(final int y, final Camera camera){\n return (y / camera.getScaling() + camera.getViewportPosY())*2 - camera.getScreenPosY();\n }", "public final MotionUpdateEvent setY(double y) {\n pos.setY(y);\n return this;\n }", "public void setYPosition(int newY) {\n this.yPosition = newY;\n }", "public double getDeltaY() {\n return deltaY;\n }", "public double getDeltaY() {\n return deltaY;\n }", "public void setYPosition(double y)\n\t{\n\t\tthis.yPosition = y;\n\t}", "public void updateCamera(int x, int y) {\n gc.getCamera().setPosition(x, y);\n\n // DOWN\n if (gc.getCamera().getY() > gc.getHeight()\n - gc.getCamera().getViewportSizeY()) {\n gc.getCamera().setY(gc.getHeight()\n - gc.getCamera().getViewportSizeY());\n }\n\n // RIGHT\n if (gc.getCamera().getX() > gc.getWidth()\n - gc.getCamera().getViewportSizeX()) {\n gc.getCamera().setX(gc.getWidth()\n - gc.getCamera().getViewportSizeX());\n }\n\n // LEFT\n if (gc.getCamera().getX() < 0) {\n gc.getCamera().setX(0);\n }\n\n // UP\n if (gc.getCamera().getY() < 0) {\n gc.getCamera().setY(0);\n }\n }", "public void setY(double y)\r\n\t{\t\r\n\t\tvirtualDxfPoint.setTransformationY(y);\r\n\t\tAnchor.setY(y);\r\n\t}", "public void reverseY()\r\n {\r\n\t if(moveY < 0)\r\n\t\t moveY = moveY * (-1);\r\n\t else if(moveY > 0)\r\n\t\t moveY = moveY * (-1);\r\n }", "private void moveRight(){\n if(getXFromCamera() > -10 && getXFromCamera() < 10){\n getWorld().moveCamera(speed);\n }\n setGlobalLocation(getGlobalX() + speed, getGlobalY());\n animationSpeedRight();\n }", "@Override\n\tpublic void input(float delta) // testing camera\n\t{\n\t\tif(Input.getKey(Input.KEY_LEFT))\n\t\t\tgetTransform().rotate(yAxis, (float)Math.toRadians(-2));\n\t\tif(Input.getKey(Input.KEY_RIGHT))\n\t\t\tgetTransform().rotate(yAxis, (float)Math.toRadians(2));\n\t\t\n\t\t}", "void moveY(float y) {\n _y += y;\n }", "public void moveY(double y) {\n this.y += y;\n }", "public void setYPos(int y) {\n // from MoveEventHandler\n // convert to real y coord\n // y = yP * (ymaxR - yminr) / (ymaxP - yminP)\n double tmp = config.getMaximumRealY() + (y - config.getMaximumPixelY())*(config.getMaximumRealY() - config.getMinimumRealY())/(config.getMaximumPixelY() - config.getMinimumPixelY());\n ypos.setText(formatter.format(tmp));\n }", "public double getDeltaY() {\n return deltaY;\n }", "public float getYComponent() {\n return this.vy;\n }", "int getDeltaY() {\n return deltaY;\n }", "public void updateYLoc();", "public void setY(int y){ yPosition = y; }", "double getYPosition();", "double deltaY() {\n return Math.sin(Math.toRadians(this.theta)) * this.length;\n }", "public void setY(int value)\n\t{\n\t\tgetWorldPosition().setY(value);\n\t}", "public void setPositionY(float y) {\n\t\tthis.position.set(this.position.x, y, 0);\n\t}", "public void moveVertical(int dir)\n\t{\n\t\tyCoord += 90*dir;\n\t\tplayerPoint.setLocation(xCoord+45,yCoord+45);\n\t}", "default void setY(double y)\n {\n getAxis().setY(y);\n }", "@Override\n\tpublic void setY(int y) {\n\t\tyPos = y;\n\t}", "public void setYCoordinates(double newY) { this.yCoordinates = newY; }", "public void setVelocityY(double y) {\n\t\tvelocity.setY(y);\n\t}", "public void moveY(boolean isDown){\n if(isDown){\n this.y += velocity[1];\n } else{\n this.y -= velocity[1];\n }\n }", "private void changeCameraPosition() {\n yPosition = mPerspectiveCamera.position.y;\n if (isMovingUp) {\n yPosition += 0.1;\n if (yPosition > 20)\n isMovingUp = false;\n } else {\n yPosition -= 0.1;\n if (yPosition < 1)\n isMovingUp = true;\n }\n\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n mPerspectiveCamera.update();\n }", "public void setY(int y) {\n collider.setLocation((int) collider.getX(), y);\n }", "public void setY(double value) {\n origin.setY(value);\n }", "void setPlayerYRelative(int y) {\n }", "public void setY(float y) {\r\n\t\tthis.y = y;\r\n\t}", "public float setRotationY(float hand_positionX, float r_mapY_start) {\n r_yStart = r_mapY_start - ((270.0f / (1200.0f-100.0f)) * (hand_positionX-100.0f));\n return r_yStart;\n}", "public void setY(float y) {\n this.y = y;\n }", "public void setY(float y){\n hitBox.offsetTo(hitBox.left,y);\n //this.y=y;\n }", "@Override\r\n\tpublic void setY(float y) {\n\t\t\r\n\t}", "public int getMovementY() {\r\n return movementY;\r\n }", "public void setY(int y){\n\t\tthis.y_location = y;\n\t}", "public void follow() {\n\n\t\t// moves y position\n\t\tif (centerY < StartingClass.MIDDLE_Y - 100) {\n\t\t\tcenterY += MOVEMENT_SPEED;\n\t\t} else {\n\t\t\tisMovingY = false;\n\t\t}\n\t}", "@Override\n\tpublic float getY() {\n\t\treturn lilyPosY;\n\t}", "private double yPos(double yMetres){\r\n\t\treturn -yMetres*14+canvas.getHeight();\r\n\t}", "@Override\n\tpublic void setY(float y) {\n\n\t}", "public void moveDown() {\n if (ycoor <= Game.heightOfGameBoard - movingSpeed) {\n ycoor = ycoor + movingSpeed;\n }\n\n }", "public void setY(float y){\n this.y = y;\n }", "public void moveY(int deltaY) {\n\t\tmScrollTop = mScrollTop + deltaY;\n\t\tif (mScrollTop > 0) {\n\t\t\tmScrollTop = 0;\n\t\t}\n\t\tif (mScrollTop < mBottomBound) {\n\t\t\tmScrollTop = mBottomBound;\n\t\t}\n\t\tinvalidate();\n\t}", "public void translateY(float y) {\n if (collides((int) x, (int) (this.y + y))) return;\n this.y += y;\n this.model.setY(this.y);\n }", "public int getY(){ return yPosition; }", "public double getPositionY() {\n return positionY_;\n }", "public double getPositionY() {\n return positionY_;\n }", "public double getPositionY() {\n return positionY_;\n }", "public void rotY(float angleRad) {\n float rotY = cameraRot.getY();\n rotY += angleRad;\n cameraRot.setY(rotY);\n }", "public int getUserPlaneY() {\r\n\t\treturn levelManager.getUserPlaneY();\r\n\t}", "public int getYPos();", "public void setY(Float y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.Y = y;\n\t}", "boolean yDelta(Player player)\n {\n yPos += yVec;\n if(yPos <0)\n {\n yPos = 0;\n reflectY();\n return false;\n }\n else if( (xPos >player.xPos) &&(xPos <player.xPos +250)&& (yPos == player.yPos-15))\n {\n \n reflectY();\n return false;\n }\n else if(yPos> 760)\n {\n yPos = 760;\n reflectY();\n return true;\n }\n \n return false;\n }", "public float getPosY(){return py;}", "public double getNewYPosition() {\n return newPosY;\n }", "protected float getY(float y) {\r\n\t\treturn this.getHeight() - ((y - viewStart.y) * parent.pixelsPerUnit);\r\n\t}", "double getMapPositionY();", "public void setY(int newY)\r\n {\r\n yCoord = newY;\r\n }", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "public void setY(int y) {\r\n\t\tthis.y = y;\r\n\t}", "@Override\n \t\t\t\tpublic void doRotateY() {\n \n \t\t\t\t}", "public void SetY2()\n\t{\n\t\tdouble h;\n\t\th = Math.pow(this.length, 2) - Math.pow((this.length/2), 2);\n\t\th = Math.sqrt(h);\n\t\tthis.y[2] = this.y[0] - h;\n\t}", "public void moveCam() {\n float x = this.cam_bind_x; //current pos the camera is binded to\n float y = this.cam_bind_y;\n\n //this amazing camera code is from: https://stackoverflow.com/questions/24047172/libgdx-camera-smooth-translation\n Vector3 target = new Vector3(x+MathUtils.cos(Global.m_angle)*20,y+MathUtils.sin(Global.m_angle)*20,0);\n final float speed = 0.1f, ispeed=1.0f-speed;\n\n Vector3 cameraPosition = cam.position;\n cameraPosition.scl(ispeed);\n target.scl(speed);\n cameraPosition.add(target);\n cam.position.set(cameraPosition);\n\n this.updateCam();\n\n }", "public double getPositionY() {\n return positionY_;\n }", "public double getPositionY() {\n return positionY_;\n }", "public double getPositionY() {\n return positionY_;\n }", "public int getY()\n {\n return yaxis;\n }", "public int deltaY() {\n\t\treturn _deltaY;\n\t}", "public void yDelta(float y_delta)\n {\n super.setY(super.getY() + y_delta);\n }", "public void setCurrentYPosition(int y) {\n\t\tthis.currentYPosition = y;\n\t\tthis.currentXPosition = this.floats.leftIntersectionPoint(this.box.getAbsoluteX()\n\t\t\t\t+ this.box.marginLeft + this.box.paddingLeft, this.box.getAbsoluteY() + y\n\t\t\t\t+ this.box.marginTop + this.box.paddingTop, this.currentRowMaxWidth, this.box);\n\t}", "public void setY(int y){\r\n\t\tthis.y = y;\r\n\t}", "public float getY() {\n return pos.y;\n }", "@Override\n public double getLocationY() {\n return myMovable.getLocationY();\n }", "@Override\n\tpublic void setY(float y) \n\t{\n\t\t_y = y;\n\t}", "int getY() {\n return yPos;\n }", "public int worldToViewportY(double y) {\n return (int)(0.5 + yMargin + yViewport + (y - yWindow) * yScaleFactor);\n }", "@Override\n public void updatePosition(float deltaTime) {\n if (isBeingRotated || isBeginMoved) return;\n // prevent overshooting when camera is not updated.\n deltaTime = Math.min(deltaTime, 0.5f);\n\n Vector3f eyeDir = new Vector3f(eyeOffset);\n GLFWWindow window = game.window();\n int width = window.getWidth();\n int height = window.getHeight();\n\n // correction for toolbar\n int corrMouseYPos = (int) mouseYPos;\n int corrMouseXPos = (int) mouseXPos;\n\n // x movement\n if (corrMouseXPos < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(corrMouseXPos) * deltaTime;\n eyeDir.normalize(value).cross(getUpVector());\n focus.add(eyeDir.x, eyeDir.y, 0);\n\n } else {\n int xInv = width - corrMouseXPos;\n if (xInv < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(xInv) * deltaTime;\n eyeDir.normalize(value).cross(getUpVector());\n focus.sub(eyeDir.x, eyeDir.y, 0);\n }\n }\n\n eyeDir.set(eyeOffset);\n // y movement\n if (corrMouseYPos < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(corrMouseYPos) * deltaTime;\n eyeDir.normalize(value);\n focus.sub(eyeDir.x, eyeDir.y, 0);\n\n } else {\n int yInv = height - corrMouseYPos;\n if (yInv < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(yInv) * deltaTime;\n eyeDir.normalize(value);\n focus.add(eyeDir.x, eyeDir.y, 0);\n }\n }\n }", "public void setY(int y) {\n\t\tthis.y = y;\n\t}", "public void setY(int y) {\n\t\tthis.y = y;\n\t}" ]
[ "0.76422435", "0.721276", "0.71143156", "0.69737476", "0.6841893", "0.68066704", "0.68066704", "0.68066704", "0.67822915", "0.6770947", "0.6762303", "0.6702309", "0.6696047", "0.66760457", "0.663013", "0.6609322", "0.6607407", "0.65869725", "0.6571978", "0.6571978", "0.65549874", "0.65440893", "0.6538751", "0.65364", "0.6535676", "0.65270436", "0.6525922", "0.6521706", "0.6520652", "0.6515645", "0.6506857", "0.64871424", "0.6487033", "0.6480798", "0.6462175", "0.6460014", "0.6448679", "0.6446192", "0.64304096", "0.6429483", "0.6416543", "0.64164543", "0.63977784", "0.6393106", "0.63925695", "0.63915503", "0.6387465", "0.63873106", "0.6379323", "0.63784087", "0.63481736", "0.63464105", "0.6338353", "0.63360196", "0.63195753", "0.63160795", "0.630982", "0.63062644", "0.6304778", "0.63023645", "0.62842184", "0.6275315", "0.627261", "0.6256172", "0.6254373", "0.62537134", "0.62537134", "0.62453806", "0.62451535", "0.62448263", "0.62305576", "0.6229335", "0.622254", "0.621837", "0.62164503", "0.62122196", "0.62097293", "0.62064546", "0.62002665", "0.62002665", "0.62002665", "0.62002665", "0.6194428", "0.61933404", "0.6185699", "0.618392", "0.618392", "0.618392", "0.6183359", "0.6175905", "0.6171523", "0.6162978", "0.61627835", "0.6162768", "0.6160047", "0.6159723", "0.6155415", "0.61548924", "0.6154116", "0.61520696", "0.61520696" ]
0.0
-1
Overridden to build in the center translation. Nothing more.
@Override protected Matrix4f genViewMatrix() { // refreshes the position position = calcPosition(); // calculate the camera's coordinate system Vector3f[] coordSys = genCoordSystem(position.subtract(center)); Vector3f right, up, forward; forward = coordSys[0]; right = coordSys[1]; up = coordSys[2]; // we move the world, not the camera Vector3f position = this.position.negate(); return genViewMatrix(forward, right, up, position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void center() {\n if (autoCenter) {\n animateTranslationX();\n animateTranslationY();\n }\n }", "private void updateTranslationfromCenterAnchor(Pose pose, int teapotId) {\n float poseX = pose.tx();\n float poseZ = pose.tz();\n\n float anchorPoseX = globalCenterPose.tx();\n float anchorPoseZ = globalCenterPose.tz();\n\n float[] translate = new float[3];\n\n if (poseX > anchorPoseX) {\n translate[0] = poseX - anchorPoseX;\n } else {\n translate[0] = -(anchorPoseX - poseX);\n }\n\n if (poseZ > anchorPoseZ) {\n translate[2] = poseZ - anchorPoseZ;\n } else {\n translate[2] = -(anchorPoseZ - poseZ);\n }\n\n teapotTranslations[teapotId] = translate;\n }", "private void updateTranslated() {\r\n\r\n\tfloat[] dp = new float[3];\r\n\tTools3d.subtract(p, _p, dp);\r\n\r\n\tfor (int i = 0; i < npoints * 3; i+= 3) {\r\n\t // translate by adding the amount local origin has moved by\r\n\t ps[i] += dp[0];\r\n\t ps[i + 1] += dp[1];\r\n\t ps[i + 2] += dp[2];\r\n\t}\r\n\t\r\n\t// reset bounding box and clear dirty flag\r\n\tbox.setBB();\r\n\tdirtyT = false;\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n }", "@Override\n public void updateCenter(int newX, int newY) {\n Point oldCenter = wrappedPolygon.getCenterPoint();\n wrappedPolygon.translate(newX - oldCenter.x, newY - oldCenter.y);\n }", "private void translate()\r\n\t{\r\n\t\tLocale locale = Locale.getDefault();\r\n\t\t\r\n\t\tString language = locale.getLanguage();\r\n\t\t\r\n\t\ttranslate(language);\r\n\t}", "public void alignCenter() {\n\t\ttop.middle();\n\t}", "abstract void translate(double x, double y, double z);", "public void translate(float theX, float theY) {\n\t}", "protected abstract Node createCenterContent();", "public void justifyCenter() {\n\t\tleft.center();\n\t}", "@FXML\n public void translation(){\n double x = Double.parseDouble(translation_x.getText());\n double y = Double.parseDouble(translation_y.getText());\n double z = Double.parseDouble(translation_z.getText());\n\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n t1.getTetraeder()[0].setPoint(A[0]+x,A[1]+y,A[2]+z);\n t1.getTetraeder()[1].setPoint(B[0]+x,B[1]+y,B[2]+z);\n t1.getTetraeder()[2].setPoint(C[0]+x,C[1]+y,C[2]+z);\n t1.getTetraeder()[3].setPoint(D[0]+x,D[1]+y,D[2]+z);\n\n redraw();\n }", "private String centerText(String toCenter, int length, char spacer) {\n // Do fancy centering\n StringBuilder sb = new StringBuilder();\n int noOfSpaces = (toCenter.length() > length) ? 0 : (length - toCenter.length()) / 2;\n Stream.generate(() -> spacer).limit(noOfSpaces).forEach(sb::append);\n sb.append(toCenter);\n return sb.toString();\n }", "private float[] getTranslationVector(float centerX, float centerY,\n int bitmapXLength, int bitmapYLength,\n float constant){\n return new float[]{\n -(centerX * constant) + (bitmapXLength/2),\n -(centerY * constant) + (bitmapYLength/2)\n };\n }", "public void translate(float amountX, float amountY) {\n\t\tthis.center.add(amountX, amountY);\n\t}", "public abstract Vector computeCenter();", "public void apply() {\n\t\tglTranslated(0, 0, -centerDistance);\n\t\tglRotated(pitch, 1, 0, 0);\n\t\tglRotated(yaw, 0, 0, 1);\n\t\tglScaled(scale, scale, scale);\n\n\t\tglTranslated(-pos.get(0), -pos.get(1), -pos.get(2));\n\t}", "public void displayCenter(String text, int x, int y) {\n\t\tgc.setFont(vector); //set the font of the text\n\t\tgc.setFill(Color.WHITE); //set the color of the text \n\t\tgc.setTextAlign(TextAlignment.CENTER); //set text alignment to center \n\t\tgc.fillText(text, x, y); //draw the text \n\t}", "protected void positionCenter() {\n\t\tlog(\"Positioning on center of line.\");\n\t\tdouble offset = -lineWidth / 2;\n\t\tbindTransition(getPilot().travelComplete(offset), LineFinderState.FINISH);\n\t}", "public void center() {\n\t\tif(parent != null) {\n\t\t\tfloat parMidWidth = parent.getWidth() / 2f;\n\t\t\tfloat parMidHeight = parent.getHeight() / 2f;\n\t\t\tfloat midWidth = width / 2f;\n\t\t\tfloat midHeight = height / 2f;\n\t\t\t\n\t\t\tfloat newX = parent.getX() + (parMidWidth - midWidth);\n\t\t\tfloat newY = parent.getY() + (parMidHeight - midHeight);\n\t\t\t\n\t\t\tposition = new Vec2f(newX, newY);\n\t\t\tfindPosRatios();\n\t\t}\n\t}", "public void translateCenter(int dx, int dy) {\r\n this.center.move(dx, dy);\r\n }", "public abstract WordEntry manualTranslate(String text, String from, String to);", "public void centerText() {\r\n int theHeight = window.getGraphPanelHeight() / 2;\r\n int theWidth = window.getGraphPanelWidth() / 2;\r\n int writingHeight = textShape.getHeight() / 2;\r\n int writingWidth = textShape.getWidth() / 2;\r\n textShape.setY(theHeight - writingHeight);\r\n textShape.setX(theWidth - writingWidth);\r\n }", "public void translate() {\n for (Ball b: balls) {\n b.translate(balls);\n }\n }", "private void updateLabel() {\n\t\tString translation = lp.getString(key);\n\t\tsetText(translation);\n\n\t}", "public void setCenter() {\n\t\tthis.isCenter = true;\n\t}", "private void translate(final double w, final double h, final double z) {\n mesh.setTranslation(0, w / 2, h / 2 + z);\n }", "public void translate(int x, int y);", "ILoLoString translate();", "public Translation() {\n\n this(0, 0, 0);\n }", "@Override\n\tpublic void onCenterChanged(GeoPoint center) {\n\t}", "public String getTranslation()\n {\n StringBuilder aminoAcid = new StringBuilder();\n Map<String, String> codToAa = Map.ofEntries(\n entry(\"ATA\", \"I\"), entry(\"ATC\", \"I\"), entry(\"ATT\", \"I\"), entry(\"ATG\", \"M\"),\n entry(\"ACA\", \"T\"), entry(\"ACC\", \"T\"), entry(\"ACG\", \"T\"), entry(\"ACT\", \"T\"),\n entry(\"AAC\", \"N\"), entry(\"AAT\", \"N\"), entry(\"AAA\", \"K\"), entry(\"AAG\", \"K\"),\n entry(\"AGC\", \"S\"), entry(\"AGT\", \"S\"), entry(\"AGA\", \"R\"), entry(\"AGG\", \"R\"),\n entry(\"CTA\", \"L\"), entry(\"CTC\", \"L\"), entry(\"CTG\", \"L\"), entry(\"CTT\", \"L\"),\n entry(\"CCA\", \"P\"), entry(\"CCC\", \"P\"), entry(\"CCG\", \"P\"), entry(\"CCT\", \"P\"),\n entry(\"CAC\", \"H\"), entry(\"CAT\", \"H\"), entry(\"CAA\", \"Q\"), entry(\"CAG\", \"Q\"),\n entry(\"CGA\", \"R\"), entry(\"CGC\", \"R\"), entry(\"CGG\", \"R\"), entry(\"CGT\", \"R\"),\n entry(\"GTA\", \"V\"), entry(\"GTC\", \"V\"), entry(\"GTG\", \"V\"), entry(\"GTT\", \"V\"),\n entry(\"GCA\", \"A\"), entry(\"GCC\", \"A\"), entry(\"GCG\", \"A\"), entry(\"GCT\", \"A\"),\n entry(\"GAC\", \"D\"), entry(\"GAT\", \"D\"), entry(\"GAA\", \"E\"), entry(\"GAG\", \"E\"),\n entry(\"GGA\", \"G\"), entry(\"GGC\", \"G\"), entry(\"GGG\", \"G\"), entry(\"GGT\", \"G\"),\n entry(\"TCA\", \"S\"), entry(\"TCC\", \"S\"), entry(\"TCG\", \"S\"), entry(\"TCT\", \"S\"),\n entry(\"TTC\", \"F\"), entry(\"TTT\", \"F\"), entry(\"TTA\", \"L\"), entry(\"TTG\", \"L\"),\n entry(\"TAC\", \"Y\"), entry(\"TAT\", \"Y\"), entry(\"TAA\", \"_\"), entry(\"TAG\", \"_\"),\n entry(\"TGC\", \"C\"), entry(\"TGT\", \"C\"), entry(\"TGA\", \"_\"), entry(\"TGG\", \"W\")\n );\n try\n {\n for (int i = 0; i < this.sequence.length(); i += 3)\n {\n aminoAcid.append(codToAa.get(this.sequence.substring(i, i + 3)));\n }\n }\n catch (StringIndexOutOfBoundsException ignored)\n {\n }\n return aminoAcid.toString();\n }", "public void translate(float x, float y);", "public void translate(double x, double y, double z){\n \n \tMatrix trans = new Matrix();\n \ttrans.identity();\n \ttrans.set(1,4,x);\n \ttrans.set(2,4,y);\n \ttrans.set(3,4,x);\n \tthis.leftMultiply(trans);\n\n /* this doesn't work yet\n this.temp.identity();\n temp.set(1,4,x);\n temp.set(2,4,y);\n temp.set(3,4,x);\n this.leftMultiply(temp); */\n }", "private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }", "static Posn translate ( Posn p, double dx, double dy ) {\n\t// return .... ;\n\t// Take stock\n\t// return ... p ... dx ... dy ; // <- We know this from Posn p\n\t// return new Posn ( ... p.x ... p.y ... dx ... dy ); // <- We know this from Posn translate\n\t// return new Posn ( ... p.x ... p.y ... dx ... dy, ... p.x ... p.y ... dx ... dy );\t\n\treturn new Posn ( p.x + dx, p.y + dy );\t\n }", "private Point[] transformCoordinateSystem(Point[] objectPosition, Point newCenter) {\n\t\tPoint[] transformedObjectPosition = objectPosition;\n\t\tfor(int i = 0; i < objectPosition.length; i++) {\n\t\t\t// Move location to coordinate system with center in origo \n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\tobjectPosition[i].x - newCenter.x,\n\t\t\t\tobjectPosition[i].y - newCenter.y\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn transformedObjectPosition;\n\t}", "private void centerOnLatLon(Point2D newCenter){\n Point2D currentCenter = getCenterLatLon();\n double dx = currentCenter.getX() - newCenter.getX();\n double dy = currentCenter.getY() - newCenter.getY();\n panMapCoords(dx, dy);\n }", "void setCenter() {\n\t\tLine line02 = new Line(myParent, new PVector(), new PVector());\n\t\tLine line13 = new Line(myParent, new PVector(), new PVector());\n\t\tline02.set(point[0].position, point[2].position);\n\t\tline13.set(point[1].position, point[3].position);\n\t\tif (line02.intersects_at(line13) != null) // if two points are on each\n\t\t\t\t\t\t\t\t\t\t\t\t\t// other\n\t\t\tcenter.set(line02.intersects_at(line13));\n\t}", "public Vector2f getCenter(Transform t) {\n\t\treturn new Vector2f(center.x * t.scale.x, center.y * t.scale.y).add(t.position);\n\t}", "public void smartCenter() {\n WebPlot p = getPrimaryPlot();\n if (p==null) return;\n\n if (isWcsSync()) {\n wcsSyncCenter(computeWcsSyncCenter());\n }\n else if (p.containsAttributeKey(WebPlot.FIXED_TARGET)) {\n Object o = p.getAttribute(WebPlot.FIXED_TARGET);\n if (o instanceof ActiveTarget.PosEntry) {\n ActiveTarget.PosEntry entry = (ActiveTarget.PosEntry) o;\n ImageWorkSpacePt ipt = p.getImageWorkSpaceCoords(entry.getPt());\n if (ipt!=null && p.pointInPlot(entry.getPt())) centerOnPoint(ipt);\n else simpleImageCenter();\n }\n } else {\n simpleImageCenter();\n }\n }", "public abstract WordEntry autoTranslate(String text, String to);", "public void applyI18n(){\n if (lastLocale != null && \n lastLocale == I18n.getCurrentLocale()) {\n return;\n }\n lastLocale = I18n.getCurrentLocale();\n \n strHelpLabel= I18n.getString(\"label.help1\")+ version;\n strHelpLabel+=I18n.getString(\"label.help2\");\n strHelpLabel+=I18n.getString(\"label.help3\");\n strHelpLabel+=I18n.getString(\"label.help4\");\n strHelpLabel+=I18n.getString(\"label.help5\");\n strHelpLabel+=I18n.getString(\"label.help6\");\n strHelpLabel+=I18n.getString(\"label.help7\");\n strHelpLabel+=I18n.getString(\"label.help8\");\n helpLabel.setText(strHelpLabel);\n }", "private void alignCenter(int newWidth) {\n for (Shape child : shape.getChildren()) {\n GraphicsAlgorithm ga = child.getGraphicsAlgorithm();\n int diff = (newWidth - ga.getWidth()) / 2;\n gaService.setLocation(ga, ga.getX() + diff, ga.getY());\n }\n }", "public ILoLoString translate() {\n return this.ribosome(new MtLoString(), new MtLoLoString(), false); \n }", "public Point2D.Double getTextCenter() {\n\t\treturn new Point2D.Double(_parent.getTxtLocPinX(), _parent.getTxtLocPinY());\n\t}", "@Override\n public void translate(double x, double y, double z) {\n GL11.glTranslated(x, y, z);\n }", "public void centerSelection() {\n RenderContext myrc = (RenderContext) rc; if (myrc == null) return;\n Set<String> sel = myrc.filterEntities(getRTParent().getSelectedEntities());\n if (sel != null && sel.size() > 0) {\n Iterator<String> it = sel.iterator();\n\twhile (it.hasNext()) { \n\t String ent = it.next(); Point2D point = entity_to_wxy.get(ent);\n\t if (last_shft_down) entity_to_wxy.put(ent, new Point2D.Double(point.getX(),m_wy)); \n\t else if (last_ctrl_down) entity_to_wxy.put(ent, new Point2D.Double(m_wx,point.getY()));\n\t else entity_to_wxy.put(ent, new Point2D.Double(m_wx,m_wy));\n\t transform(ent); \n\t}\n getRTComponent().render();\n }\n }", "private void updatePosition (float newCenterX, float newCenterY) {\n centerX = newCenterX;\n centerY = newCenterY;\n\n atomSpriteBoundary.left = centerX - spriteLength/2;\n atomSpriteBoundary.right = centerX + spriteLength/2;\n atomSpriteBoundary.top = centerY - spriteHeight/2;\n atomSpriteBoundary.bottom = centerY + spriteHeight/2;\n }", "public void renderCenterBlock(int cons, int side, int end)\r\n/* 143: */ {\r\n/* 144:135 */ if (cons == 0)\r\n/* 145: */ {\r\n/* 146:136 */ this.context.setTex(end);\r\n/* 147:137 */ doubleBox(63, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 148:138 */ return;\r\n/* 149: */ }\r\n/* 150:139 */ if (cons == 3)\r\n/* 151: */ {\r\n/* 152:140 */ this.context.setTexFlags(1773);\r\n/* 153:141 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 154:142 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 155:143 */ return;\r\n/* 156: */ }\r\n/* 157:144 */ if (cons == 12)\r\n/* 158: */ {\r\n/* 159:145 */ this.context.setTexFlags(184365);\r\n/* 160:146 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 161:147 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 1.0F);\r\n/* 162:148 */ return;\r\n/* 163: */ }\r\n/* 164:149 */ if (cons == 48)\r\n/* 165: */ {\r\n/* 166:150 */ this.context.setTexFlags(187200);\r\n/* 167:151 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 168:152 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 169:153 */ return;\r\n/* 170: */ }\r\n/* 171:155 */ this.context.setTex(end);\r\n/* 172:156 */ doubleBox(0x3F ^ cons, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F);\r\n/* 173:157 */ if ((cons & 0x1) > 0)\r\n/* 174: */ {\r\n/* 175:158 */ this.context.setTexFlags(1773);\r\n/* 176:159 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 177:160 */ doubleBox(60, 0.375F, 0.0F, 0.375F, 0.625F, 0.375F, 0.625F);\r\n/* 178: */ }\r\n/* 179:162 */ if ((cons & 0x2) > 0)\r\n/* 180: */ {\r\n/* 181:163 */ this.context.setTexFlags(1773);\r\n/* 182:164 */ this.context.setTex(end, end, side, side, side, side);\r\n/* 183:165 */ doubleBox(60, 0.375F, 0.625F, 0.375F, 0.625F, 1.0F, 0.625F);\r\n/* 184: */ }\r\n/* 185:167 */ if ((cons & 0x4) > 0)\r\n/* 186: */ {\r\n/* 187:168 */ this.context.setTexFlags(184365);\r\n/* 188:169 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 189:170 */ doubleBox(51, 0.375F, 0.375F, 0.0F, 0.625F, 0.625F, 0.375F);\r\n/* 190: */ }\r\n/* 191:172 */ if ((cons & 0x8) > 0)\r\n/* 192: */ {\r\n/* 193:173 */ this.context.setTexFlags(184365);\r\n/* 194:174 */ this.context.setTex(side, side, end, end, side, side);\r\n/* 195:175 */ doubleBox(51, 0.375F, 0.375F, 0.625F, 0.625F, 0.625F, 1.0F);\r\n/* 196: */ }\r\n/* 197:177 */ if ((cons & 0x10) > 0)\r\n/* 198: */ {\r\n/* 199:178 */ this.context.setTexFlags(187200);\r\n/* 200:179 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 201:180 */ doubleBox(15, 0.0F, 0.375F, 0.375F, 0.375F, 0.625F, 0.625F);\r\n/* 202: */ }\r\n/* 203:182 */ if ((cons & 0x20) > 0)\r\n/* 204: */ {\r\n/* 205:183 */ this.context.setTexFlags(187200);\r\n/* 206:184 */ this.context.setTex(side, side, side, side, end, end);\r\n/* 207:185 */ doubleBox(15, 0.625F, 0.375F, 0.375F, 1.0F, 0.625F, 0.625F);\r\n/* 208: */ }\r\n/* 209: */ }", "public Coordinate translateLeft(Coordinate center) {\r\n int newY = center.getX() + center.getY() - x;\r\n int newX = y + center.getX() - center.getY();\r\n return new Coordinate(newX, newY);\r\n }", "public void translate(Point p){\n a.translate(p);\n b.translate(p);\n c.translate(p);\n }", "public ILoLoString translate() {\n return new MtLoLoString(); \n }", "@Override\r\n\tpublic void translate(float vx, float vy) {\n\t\t\r\n\t}", "public native vector kbGetMapCenter();", "private void recenter(PlayerMapObjectInterface target) {\n\n\t}", "public void doLocalization() {\r\n\t\tdoLocalization(0);\r\n\t\t//do localization like it's in the corner 0\r\n\t\tnavigation.turnTo(0);\r\n\t}", "public void drawCenteredText(String text, int x, int y);", "public Vector3f getCurrentTranslation() {\n long currentTimeMillis = System.currentTimeMillis();\n\n if (currentTimeMillis > finishTimeMillis) {\n return finishTranslation;\n } else {\n float percent = ((float)(currentTimeMillis-startTimeMillis)) / ((float)(finishTimeMillis-startTimeMillis));\n Vector3f interpolatedTranslation = new Vector3f();\n interpolatedTranslation.interpolate(startTranslation, finishTranslation, percent);\n return interpolatedTranslation;\n }\n }", "public void panCenterTo(Coordinate coord) {\n \t\tpanCenterTo(coord, tweening);\n \t}", "public Vector2D getArithmeticCenter()\n\t{\n\t\tif (size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tVector2D center = Vector2D.ZERO;\n\n\t\tfor (Unit unit : this)\n\t\t{\n\t\t\tcenter = center.add(Vector2DMath.toVector(unit.getPosition()));\n\t\t}\n\t\tcenter = center.scale(1.0f / size());\n\n\t\treturn center;\n\t}", "private void animatePlacardViewToCenter() {\n CALayer welcomeLayer = placardView.getLayer();\n\n // Create a keyframe animation to follow a path back to the center.\n CAKeyframeAnimation bounceAnimation = new CAKeyframeAnimation(\"position\");\n bounceAnimation.setRemovedOnCompletion(false);\n\n double animationDuration = 1.5;\n\n // Create the path for the bounces.\n UIBezierPath bouncePath = new UIBezierPath();\n\n CGPoint centerPoint = getCenter();\n double midX = centerPoint.getX();\n double midY = centerPoint.getY();\n double originalOffsetX = placardView.getCenter().getX() - midX;\n double originalOffsetY = placardView.getCenter().getY() - midY;\n double offsetDivider = 4;\n\n boolean stopBouncing = false;\n\n // Start the path at the placard's current location.\n bouncePath.move(new CGPoint(placardView.getCenter().getX(), placardView.getCenter().getY()));\n bouncePath.addLine(new CGPoint(midX, midY));\n\n // Add to the bounce path in decreasing excursions from the center.\n while (!stopBouncing) {\n CGPoint excursion = new CGPoint(midX + originalOffsetX / offsetDivider, midY + originalOffsetY\n / offsetDivider);\n bouncePath.addLine(excursion);\n bouncePath.addLine(centerPoint);\n\n offsetDivider += 4;\n animationDuration += 1 / offsetDivider;\n if (Math.abs(originalOffsetX / offsetDivider) < 6 && Math.abs(originalOffsetY / offsetDivider) < 6) {\n stopBouncing = true;\n }\n }\n\n bounceAnimation.setPath(bouncePath.getCGPath());\n bounceAnimation.setDuration(animationDuration);\n\n // Create a basic animation to restore the size of the placard.\n CABasicAnimation transformAnimation = new CABasicAnimation(\"transform\");\n transformAnimation.setRemovedOnCompletion(true);\n transformAnimation.setDuration(animationDuration);\n transformAnimation.setToValue(NSValue.valueOf(CATransform3D.Identity()));\n\n // Create an animation group to combine the keyframe and basic\n // animations.\n CAAnimationGroup group = new CAAnimationGroup();\n\n group.setDelegate(new CAAnimationDelegateAdapter() {\n /**\n * Animation delegate method called when the animation's finished:\n * restore the transform and reenable user interaction.\n */\n @Override\n public void didStop(CAAnimation anim, boolean flag) {\n placardView.setTransform(CGAffineTransform.Identity());\n setUserInteractionEnabled(true);\n }\n });\n group.setDuration(animationDuration);\n group.setTimingFunction(new CAMediaTimingFunction(CAMediaTimingFunctionName.EaseIn));\n\n group.setAnimations(new NSArray<CAAnimation>(bounceAnimation, transformAnimation));\n\n // Add the animation group to the layer.\n welcomeLayer.addAnimation(group, \"animatePlacardViewToCenter\");\n\n // Set the placard view's center and transformation to the original\n // values in preparation for the end of the animation.\n placardView.setCenter(centerPoint);\n placardView.setTransform(CGAffineTransform.Identity());\n }", "public void translate( double[] d ) {\n setValid( false );\n position.translate( d );\n }", "public java.lang.String getStudent_languageCenter() {\n\t\treturn _primarySchoolStudent.getStudent_languageCenter();\n\t}", "public void paint(MapCanvas canvas, Point insertPoint) {\n Graphics2D graphics = null;\n if ((this.text != null) && (insertPoint != null) && (canvas != null) && \n ((graphics = canvas.graphics) != null)) {\n Font curFont = graphics.getFont();\n Color curColor = graphics.getColor();\n AffineTransform curTransForm = graphics.getTransform();\n try {\n TextStyle style = this.getTextStyle();\n FontMetrics fontMetrics = this.textFont.setCanvas(canvas);\n int textHeight = fontMetrics.getHeight();\n int x = insertPoint.x;\n int y = insertPoint.y;\n int textWidth = fontMetrics.stringWidth(this.text);\n// if ((style.orientation == TextStyle.Orientation.VerticalDn) || \n// (style.orientation == TextStyle.Orientation.VerticalUp)) {\n// if (style.hAlign == TextStyle.Horizontal.Center) {\n// y -= textWidth/2;\n// } else if (style.hAlign == TextStyle.Horizontal.Right) {\n// y -= textWidth;\n// }\n//\n// if (style.vAlign == TextStyle.Vertical.Middle) {\n// x += textHeight/2;\n// } else if (style.vAlign == TextStyle.Vertical.Top) {\n// x += textHeight;\n// }\n// } else {\n if (style.hAlign == TextStyle.Horizontal.Center) {\n x -= textWidth/2;\n } else if (style.hAlign == TextStyle.Horizontal.Right) {\n x -= textWidth;\n }\n\n if (style.vAlign == TextStyle.Vertical.Middle) {\n y += textHeight/2;\n } else if (style.vAlign == TextStyle.Vertical.Top) {\n y += textHeight;\n }\n //} \n float rotate = style.orientation.rotate;\n if (rotate != 0.0f) {\n AffineTransform transform = new AffineTransform();\n transform.translate(0.0d, 0.0d);\n transform.rotate(rotate, insertPoint.x, insertPoint.y);\n graphics.transform(transform);\n }\n \n graphics.drawString(this.text, x, y - fontMetrics.getDescent());\n } catch (Exception exp) {\n LOGGER.log(Level.WARNING, \"{0}.paint Error:\\n {1}\",\n new Object[]{this.getClass().getSimpleName(), exp.getMessage()});\n } finally {\n if (curFont != null) {\n graphics.setFont(curFont);\n }\n if (curColor != null) {\n graphics.setColor(curColor);\n }\n if (curTransForm != null) {\n graphics.setTransform(curTransForm);\n }\n }\n }\n }", "public void translate(double Tx, double Ty, double Tz) {\r\n\t\tthis.set(MatrixMult(this, getTranslateInstance(Tx, Ty, Tz)));\r\n\t}", "private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }", "@SuppressWarnings(\"unused\")\n private void setCenter(JSONArray args, CallbackContext callbackContext) throws JSONException {\n double lat, lng;\n\n lat = args.getDouble(1);\n lng = args.getDouble(2);\n\n LatLng latLng = new LatLng(lat, lng);\n CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLng(latLng);\n this.myMoveCamera(cameraUpdate, callbackContext);\n }", "public void translate(double tx, double ty)\r\n\t{\r\n\t\t// is this a real translation?\r\n\t\tif (tx > 0)\r\n\t\t{\r\n\t\t\t// yes, we're moving down through the plot\r\n\t\t\twmf.setWindowOrg((int) -tx, (int) -ty);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// no, we're resetting, set the offset to zero\r\n\t\t\twmf.setWindowOrg(0, 0);\r\n\t\t}\r\n\t}", "private BuildTranslations () {\n\t\tthrow new UnsupportedOperationException();\n\t}", "@Override\n\tpublic void setCenterView() {\n\n\t}", "public LocalizerOld(OdometerOld left, OdometerOld right, OdometerOld center) {\n this.left = left;\n this.right = right;\n this.center = center;\n\n robotPosition = new Point();\n\n robotPosition.x = 0;\n robotPosition.y = 0;\n robotAngle = 0;\n\n lastResetAngle = 0;\n }", "void onTranslation(Sentence sentence);", "private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }", "public void displayTranslated(float x, float y, float angleDegrees) {\n /*\n pushMatrix();\n translate(x, y);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n popMatrix();\n shape(fullCar);\n */\n pushMatrix();\n translate(x, y);\n rotate(radians(angleDegrees));\n shape(fullCar);\n popMatrix();\n xCord = (int)x;\n yCord = (int)y;\n }", "@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tbtTranslate.setEnabled(false);\r\n\t\t\t\tbtTranslate.setText(\"正在翻译..\");\r\n\t\t\t\tString re = Languages.translate(taResult.getText());\r\n\t\t\t\tif(\"\"==re || null==re){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\ttaTranslate.setText(re);\r\n\t\t\t\tbtTranslate.setEnabled(true);\r\n\t\t\t\tbtTranslate.setText(\"翻译\");\r\n\t\t\t}", "protected void build_transforms()\n {\n goniometer_rotation = tof_calc.makeEulerRotation( phi, chi, -omega );\n\n goniometer_rotation_inverse = \n tof_calc.makeEulerRotationInverse( phi, chi, -omega );\n }", "public void setOrigin(){\n // draw X-axis\n graphics2D.draw(new Line2D.Double(leftMiddle, rightMiddle));\n\n // draw string \"+X\" and \"-X\"\n graphics2D.drawString(\"+X\", (int) rightMiddle.getX() - 10, (int) rightMiddle.getY() - 5);\n graphics2D.drawString(\"-X\", (int) leftMiddle.getX() + 10, (int) leftMiddle.getY() + 10);\n\n // draw Y-axis\n graphics2D.draw(new Line2D.Double(topMiddle, bottomMiddle));\n\n // draw string \"+Y\" and \"-Y\"\n graphics2D.drawString(\"+Y\", (int) topMiddle.getX() + 5, (int) topMiddle.getY() + 10);\n graphics2D.drawString(\"-Y\", (int) bottomMiddle.getX() - 15, (int) bottomMiddle.getY());\n\n }", "void translate(Sentence sentence);", "public void postTranslate(float tx, float ty, float tz) {\n float[] t = {\n 1, 0, 0, tx,\n 0, 1, 0, ty,\n 0, 0, 1, tz,\n 0, 0, 0, 1};\n \n matrix = mulMM(matrix, t);\n }", "private void addTranslations() {\n addTranslation(\"org.argouml.uml.diagram.ui.FigNote\",\n \"org.argouml.uml.diagram.static_structure.ui.FigComment\");\n addTranslation(\"org.argouml.uml.diagram.static_structure.ui.FigNote\",\n \"org.argouml.uml.diagram.static_structure.ui.FigComment\");\n addTranslation(\"org.argouml.uml.diagram.state.ui.FigState\",\n \"org.argouml.uml.diagram.state.ui.FigSimpleState\");\n addTranslation(\"org.argouml.uml.diagram.ui.FigCommentPort\",\n \"org.argouml.uml.diagram.ui.FigEdgePort\");\n addTranslation(\"org.tigris.gef.presentation.FigText\",\n \"org.argouml.uml.diagram.ui.ArgoFigText\");\n addTranslation(\"org.tigris.gef.presentation.FigLine\",\n \"org.argouml.gefext.ArgoFigLine\");\n addTranslation(\"org.tigris.gef.presentation.FigPoly\",\n \"org.argouml.gefext.ArgoFigPoly\");\n addTranslation(\"org.tigris.gef.presentation.FigCircle\",\n \"org.argouml.gefext.ArgoFigCircle\");\n addTranslation(\"org.tigris.gef.presentation.FigRect\",\n \"org.argouml.gefext.ArgoFigRect\");\n addTranslation(\"org.tigris.gef.presentation.FigRRect\",\n \"org.argouml.gefext.ArgoFigRRect\");\n addTranslation(\n \"org.argouml.uml.diagram.deployment.ui.FigMNodeInstance\",\n \"org.argouml.uml.diagram.deployment.ui.FigNodeInstance\");\n addTranslation(\"org.argouml.uml.diagram.ui.FigRealization\",\n \"org.argouml.uml.diagram.ui.FigAbstraction\");\n }", "public static Transform newTranslation(float tx, float ty, float tz){\n return new Transform(new float[][]{{1.0f, 0.0f, 0.0f, tx},\n {0.0f, 1.0f, 0.0f, ty},\n {0.0f, 0.0f, 1.0f, tz},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }", "public void updateTranslationAnimation() {\n\t\tif (target == null)\n\t\t\treturn;\n\t\t\n\t\tfinal float\n\t\t\t// Declare the distance to the target position.\n\t\t\tdeltaX = target.x - this.x(),\n\t\t\tdeltaY = target.y - this.y(),\n\t\t\t// Declare the new coordinates for the SwipeTile to use.\n\t\t\tnewX = this.x() + (deltaX * translationDamping),\n\t\t\tnewY = this.y() + (deltaY * translationDamping);\n\t\t\n\t\t// Set the SwipeTile to the new-coordinates.\n\t\tsetPosition(newX, newY);\n\t}", "public void translateX(float dx) {\r\n this.center.x += Math.cos(Math.toRadians(-rotation)) * dx;\r\n this.center.z += Math.sin(Math.toRadians(-rotation)) * dx;\r\n if (this.center.x > (this.boardWidth - ((this.boardWidth / 2f) * percentZoom))) {\r\n this.center.x = (this.boardWidth - ((this.boardWidth / 2f) * percentZoom));\r\n } else if (this.center.x < (this.boardWidth / 2f) * percentZoom) {\r\n this.center.x = (this.boardWidth / 2f) * percentZoom;\r\n }\r\n if (this.center.z > this.boardLength - ((this.boardLength / 2f) * percentZoom)) {\r\n this.center.z = this.boardLength - ((this.boardLength / 2f) * percentZoom);\r\n } else if (this.center.z < (this.boardLength / 2f) * percentZoom) {\r\n this.center.z = (this.boardLength / 2f) * percentZoom;\r\n }\r\n changed = true;\r\n }", "private void centerRegion() {\r\n\t\tthis.addComponent(BorderLayout.CENTER, mp);\r\n\t}", "public void translate(int i, int j) {\n\t\t\n\t}", "public void update() {\n\t\tactSX=parent.actSX*scaleX;\n\t\tactSY=parent.actSY*scaleY;\n\t\tw=posW*actSX;\n\t\th=posH*actSY;\n\t\tswitch (align) {\n\t\tcase DEFAULT:\n\t\t\tx=parent.x+posX*actSX;\n\t\t\ty=parent.y+posY*actSY;\n\t\t\tbreak;\n\t\tcase TOPRIGHT:\n\t\t\tx=parent.x+parent.w-(posX+posW)*actSX;\n\t\t\ty=parent.y+posY*actSY;\n\t\t\tbreak;\n\t\tcase BOTTOMLEFT:\n\t\t\tx=parent.x+posX*actSX;\n\t\t\ty=parent.y+parent.h-(posY+posH)*actSY;\n\t\t\tbreak;\n\t\tcase BOTTOMRIGHT:\n\t\t\tx=parent.x+parent.w-(posX+posW)*actSX;\n\t\t\ty=parent.y+parent.h-(posY+posH)*actSY;\n\t\t\tbreak;\n\t\tcase CENTEREDX:\n\t\t\tx=parent.x+parent.w/2-w/2+posX*actSX;\n\t\t\ty=parent.y+posY*actSY;\n\t\t\tbreak;\n\t\tcase CENTEREDY:\n\t\t\tx=parent.x+posX*actSX;\n\t\t\ty=parent.y+parent.h/2-h/2+posY*actSY;\n\t\t\tbreak;\n\t\tcase CENTEREDXY:\n\t\t\tx=parent.x+parent.w/2-w/2+posX*actSX;\n\t\t\ty=parent.y+parent.h/2-h/2+posY*actSY;\n\t\t\tbreak;\n\t\t}\n\t}", "public static void SetCenter(int center) //set the center fret when needed\n\t{\n\t\tif(center==0)\n\t\t\tSfret=Efret=Center=1;\n\t\tif(center==15)\n\t\t\tSfret=Efret=Center=14;\n\t}", "public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}", "public void translate(int x, int y){\n a.translate(x, y);\n b.translate(x, y);\n c.translate(x, y);\n }", "@Override\n public void translate(double x, double y) {\n graphicsEnvironmentImpl.translate(canvas, x, y);\n }", "public void translate() {\r\n this.x += dx;\r\n this.y += dy;\r\n }", "void localizationChaneged();", "private double centerY() {\n return (piece.boundingBox().getHeight() % 2) / 2.0;\n }", "public void translate() {\n\t\tif(!init)\r\n\t\t\treturn; \r\n\t\ttermPhraseTranslation.clear();\r\n\t\t// document threshold: number of terms / / 8\r\n//\t\tdocThreshold = (int) (wordKeyList.size() / computeAvgTermNum(documentTermRelation) / 8.0);\r\n\t\t//\t\tuseDocFrequency = true;\r\n\t\tint minFrequency=1;\r\n\t\temBkgCoefficient=0.5;\r\n\t\tprobThreshold=0.001;//\r\n\t\titerationNum = 20;\r\n\t\tArrayList<Token> tokenList;\r\n\t\tToken curToken;\r\n\t\tint j,k;\r\n\t\t//p(w|C)\r\n\r\n\t\tint[] termValues = termIndexList.values;\r\n\t\tboolean[] termActive = termIndexList.allocated;\r\n\t\ttotalCollectionCount = 0;\r\n\t\tfor(k=0;k<termActive.length;k++){\r\n\t\t\tif(!termActive[k])\r\n\t\t\t\tcontinue;\r\n\t\t\ttotalCollectionCount +=termValues[k];\r\n\t\t}\r\n\t\t\r\n\t\t// for each phrase\r\n\t\tint[] phraseFreqKeys = phraseFrequencyIndex.keys;\r\n\t\tint[] phraseFreqValues = phraseFrequencyIndex.values;\r\n\t\tboolean[] states = phraseFrequencyIndex.allocated;\r\n\t\tfor (int phraseEntry = 0;phraseEntry<states.length;phraseEntry++){\r\n\t\t\tif(!states[phraseEntry]){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (phraseFreqValues[phraseEntry] < minFrequency)\r\n\t\t\t\tcontinue;\r\n\t\t\ttokenList=genSignatureTranslation(phraseFreqKeys[phraseEntry]); // i is phrase number\r\n\t\t\tfor (j = 0; j <tokenList.size(); j++) {\r\n\t\t\t\tcurToken=(Token)tokenList.get(j);\r\n\t\t\t\tif(termPhraseTranslation.containsKey(curToken.getIndex())){\r\n\t\t\t\t\tIntFloatOpenHashMap old = termPhraseTranslation.get(curToken.getIndex());\r\n\t\t\t\t\tif(old.containsKey(phraseFreqKeys[phraseEntry])){\r\n\t\t\t\t\t\tSystem.out.println(\"aha need correction\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\told.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight()); //phrase, weight\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tIntFloatOpenHashMap newPhrase = new IntFloatOpenHashMap();\r\n\t\t\t\t\tnewPhrase.put(phraseFreqKeys[phraseEntry], (float) curToken.getWeight());\r\n\t\t\t\t\ttermPhraseTranslation.put(curToken.getIndex(), newPhrase);\r\n\t\t\t\t}\r\n\t\t\t\t//\t\t\t\toutputTransMatrix.add(i,curToken.getIndex(),curToken.getWeight());\r\n\t\t\t\t//\t\t\t\toutputTransTMatrix.add(curToken.getIndex(), i, curToken.getWeight());\r\n\t\t\t\t//TODO termPhrase exists, create PhraseTerm\r\n\t\t\t}\r\n\t\t\ttokenList.clear();\r\n\t\t}\r\n\r\n\t}", "private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }", "public void setCenter(Point newCenter) {\n\t\tPoint oldCenter = getCenter();\n\t\tmove(newCenter.x - oldCenter.x, newCenter.y - oldCenter.y);\n\t}", "public void translate( Vector3f t )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( t );\n\t\tmat.mul( opMat );\n\t}", "public void setCenter(Point center) {\r\n this.center = center;\r\n }", "private Point2D getCenterLatLon(){\n Point2D.Double result = new Point2D.Double();\n Point2D.Double screenCenter = new Point2D.Double();\n screenCenter.x = getWidth()/2; //contentpane width/height\n screenCenter.y = getHeight()/2;\n try{\n transform.inverseTransform(screenCenter,result); //transform to lat/lon using the current transform\n } catch (NoninvertibleTransformException e) {\n throw new RuntimeException(e);\n }\n return result;\n }", "public void centerMapOnPoint(int targetX, int targetY) {\n\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n int baseX = (int) (map.getWidth() * TileDataRegister.TILE_WIDTH * scale) / 2;\n\n int x = baseX + (targetY - targetX) * scaledWidth / 2;\n x -= viewPortWidth * 0.5;\n int y = (targetY + targetX) * scaledHeight / 2;\n y -= viewPortHeight * 0.5;\n\n currentXOffset = -x;\n currentYOffset = -y;\n\n gameChanged = true;\n }", "public void initGC(){\n\n gc.translate(-map.getwX(),-map.getwY());\n\n// gc.translate((map.getWinWidth()/2-map.getwX()),(map.getWinHeight()/2-map.getwY()));\n }" ]
[ "0.62578154", "0.61647856", "0.59555244", "0.5848222", "0.5815946", "0.58086663", "0.575339", "0.5675392", "0.5657997", "0.564886", "0.56441355", "0.55614406", "0.5550501", "0.55361295", "0.55301476", "0.55254054", "0.5427843", "0.54272", "0.54184425", "0.54138565", "0.54131794", "0.5381029", "0.5377325", "0.5375484", "0.5369197", "0.53664404", "0.5352715", "0.53417355", "0.5315642", "0.5306001", "0.52780205", "0.52725303", "0.52594286", "0.52460206", "0.52394736", "0.5231401", "0.5230456", "0.52287537", "0.5225877", "0.5195212", "0.5187448", "0.5187199", "0.5184508", "0.51707935", "0.51697034", "0.51691496", "0.51471806", "0.51405084", "0.5117817", "0.5108339", "0.5099175", "0.50908566", "0.50897783", "0.5089475", "0.50857866", "0.5075036", "0.50745124", "0.50731647", "0.50721556", "0.5071937", "0.5070645", "0.5066484", "0.5065919", "0.5065615", "0.5063191", "0.5055391", "0.5053448", "0.5053231", "0.50462043", "0.5042628", "0.50424224", "0.50422794", "0.50407374", "0.50380325", "0.5031453", "0.50285834", "0.50250894", "0.5025017", "0.502405", "0.50232977", "0.5022264", "0.5016803", "0.50083333", "0.50034624", "0.5002902", "0.49981248", "0.4996659", "0.49830797", "0.49790874", "0.49768558", "0.49766698", "0.4970611", "0.49637845", "0.49559987", "0.49554247", "0.4938489", "0.49353746", "0.49347535", "0.49345082", "0.49336693", "0.49309543" ]
0.0
-1
Calculates the camera's position based on the angles and the distance from space origin (+upOffset).
private Vector3f calcPosition() { float y = (float) (distance * Math.sin(Math.toRadians(pitch))); float xzDistance = (float) (distance * Math.cos(Math.toRadians(pitch))); float x = (float) (xzDistance * Math.sin(Math.toRadians(rotation))); float z = (float) (xzDistance * Math.cos(Math.toRadians(rotation))); return new Vector3f(x + center.x, y + center.y, z + center.z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void adjustCameraPosition() {\n if (upward) {\n\n if (tilt<90) {\n tilt ++;\n zoom-=0.01f;\n } else {\n upward=false;\n }\n\n } else {\n if (tilt>0) {\n tilt --;\n zoom+=0.01f;\n } else {\n upward=true;\n }\n }\n }", "private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}", "private Vector3f calculateVectorDirectionBetweenEyeAndCenter() {\n\t\tVector3f br = new Vector3f();\n\n\t\tbr.x = player.getPosition().x - camera.getPosition().x;\n\t\tbr.y = player.getPosition().y - camera.getPosition().y;\n\t\tbr.z = player.getPosition().z - camera.getPosition().z;\n\n\t\treturn br;\n\t}", "private Mat4x4 calculateMatCamera(Vec4df up, Vec4df target, Mat4x4 transform) {\n lookDirection = MatrixMath.matrixMultiplyVector(transform, target);\n target = MatrixMath.vectorAdd(origin, lookDirection);\n return MatrixMath.matrixPointAt(origin, target, up);\n }", "private void calculateCameraPosition(float hDistance, float vDistance)\n\t{\n\t\tfloat theta=player.getRotY()+angleAroundPlayer;\n\t\tfloat offsetX=hDistance*(float)Math.sin(Math.toRadians(theta));\n\t\tfloat offsetZ=hDistance*(float)Math.cos(Math.toRadians(theta));\n\t\t\n\t\t//calculate camera position\n\t\tposition.x=player.getPosition().x-offsetX;\n\t\tposition.z=player.getPosition().z-offsetZ;\n\t\tposition.y=player.getPosition().y+vDistance;\n\t}", "public Point getCameraOffset() {\n Point offset = new Point(getPlayer().getCenterX() - screenWidthMiddle,\n getPlayer().getCenterY() - screenHeightMiddle);\n reboundCameraOffset(offset, EnumSet.of(Direction.LEFT, Direction.RIGHT));\n // we want to add these offsets to the player's x and y, so invert them\n offset.x = -offset.x;\n offset.y = -offset.y;\n return offset;\n }", "public Camera(Vector position, Vector lookPosition, Vector upVector,\r\n\t\t\t\t double screenDistance, double screenWidth) {\r\n\t\tthis.position = position;\r\n\t\tthis.direction = Vector.vecSubtract(lookPosition, position).normalized();\r\n\t\tthis.screenWidth = screenWidth;\r\n\t\tthis.rightDirection = Vector.crossProduct(this.direction, upVector).normalized();\r\n\t\tthis.upDirection = Vector.crossProduct(this.rightDirection, this.direction).normalized();\r\n\t\tRay ray = new Ray(position, direction);\r\n\t\tthis.screenCenter = ray.getPointAtDistance(screenDistance);\r\n\t\t}", "@Override\n protected Camera getCamera() {\n return Camera.createForPositionAndAngles(new ThreeDoubleVector(31.0, 7.0, 5.5), 0.0, 0.7);\n\n // Camera for orientation curve interpolation presentation\n// return Camera.createForPositionAndAngles(new ThreeDoubleVector(54.5, 10.0, 2.5), -0.5, 0.3);\n }", "private Vector3f calculateUpVectorOfCameraPosition(Vector3f orthVector) {\n\n\t\tVector3f interimResult = new Vector3f();\n\t\tinterimResult.x = calculateVectorDirectionBetweenEyeAndCenter().y * orthVector.z\n\t\t\t\t- calculateVectorDirectionBetweenEyeAndCenter().z * orthVector.y;\n\t\tinterimResult.y = calculateVectorDirectionBetweenEyeAndCenter().z * orthVector.x\n\t\t\t\t- calculateVectorDirectionBetweenEyeAndCenter().x * orthVector.z;\n\t\tinterimResult.z = calculateVectorDirectionBetweenEyeAndCenter().x * orthVector.y\n\t\t\t\t- calculateVectorDirectionBetweenEyeAndCenter().y * orthVector.x;\n\n\t\tVector3f normalVector = new Vector3f();\n\t\tnormalVector.x = calculateVectorDirectionBetweenEyeAndCenter().z * interimResult.y\n\t\t\t\t- calculateVectorDirectionBetweenEyeAndCenter().y * interimResult.z;\n\t\tnormalVector.y = calculateVectorDirectionBetweenEyeAndCenter().x * interimResult.z\n\t\t\t\t- calculateVectorDirectionBetweenEyeAndCenter().z * interimResult.x;\n\t\tnormalVector.z = calculateVectorDirectionBetweenEyeAndCenter().y * interimResult.x\n\t\t\t\t- calculateVectorDirectionBetweenEyeAndCenter().x * interimResult.y;\n\n\t\tnormalVector = normalVector.normalize();\n\n\t\treturn normalVector;\n\t}", "public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}", "public void setCameraAngles(float x, float y, float z, float w) {\n\t\tthis.qx=x;\n\t\tthis.qy=y;\n\t\tthis.qz=z;\n\t\tthis.qw=w;\n\t}", "private void calculateLocation()\r\n\t{\r\n\t\tdouble leftAngleSpeed \t= this.angleMeasurementLeft.getAngleSum() / ((double)this.angleMeasurementLeft.getDeltaT()/1000); //degree/seconds\r\n\t\tdouble rightAngleSpeed \t= this.angleMeasurementRight.getAngleSum() / ((double)this.angleMeasurementRight.getDeltaT()/1000); //degree/seconds\r\n\r\n\t\tdouble vLeft\t= (leftAngleSpeed * Math.PI * LEFT_WHEEL_RADIUS ) / 180 ; //velocity of left wheel in m/s\r\n\t\tdouble vRight\t= (rightAngleSpeed * Math.PI * RIGHT_WHEEL_RADIUS) / 180 ; //velocity of right wheel in m/s\t\t\r\n\t\tdouble w \t\t= (vRight - vLeft) / WHEEL_DISTANCE; //angular velocity of robot in rad/s\r\n\t\t\r\n\t\tDouble R \t= new Double(( WHEEL_DISTANCE / 2 ) * ( (vLeft + vRight) / (vRight - vLeft) ));\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\tdouble ICCx = 0;\r\n\t\tdouble ICCy = 0;\r\n\r\n\t\tdouble W_xResult \t\t= 0;\r\n\t\tdouble W_yResult \t\t= 0;\r\n\t\tdouble W_angleResult \t= 0;\r\n\t\t\r\n\t\tdouble E_xResult \t\t= 0;\r\n\t\tdouble E_yResult \t\t= 0;\r\n\t\tdouble E_angleResult \t= 0;\r\n\t\t\r\n\t\t//short axe = 0;\r\n\t\t\r\n\t\tdouble deltaT = ((double)this.angleMeasurementLeft.getDeltaT())/1000;\r\n\t\t\r\n\t\t// Odometry calculations\r\n\t\tif (R.isNaN()) \t\t\t\t//robot don't move\r\n\t\t{\r\n\t\t\tW_xResult\t\t= this.pose.getX();\r\n\t\t\tW_yResult\t\t= this.pose.getY();\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse if (R.isInfinite()) \t//robot moves straight forward/backward, vLeft==vRight\r\n\t\t{ \r\n\t\t\tW_xResult\t\t= this.pose.getX() + vLeft * Math.cos(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_yResult\t\t= this.pose.getY() + vLeft * Math.sin(this.pose.getHeading()) * deltaT;\r\n\t\t\tW_angleResult \t= this.pose.getHeading();\r\n\t\t} \r\n\t\telse \r\n\t\t{\t\t\t\r\n\t\t\tICCx = this.pose.getX() - R.doubleValue() * Math.sin(this.pose.getHeading());\r\n\t\t\tICCy = this.pose.getY() + R.doubleValue() * Math.cos(this.pose.getHeading());\r\n\t\t\r\n\t\t\tW_xResult \t\t= Math.cos(w * deltaT) * (this.pose.getX()-ICCx) - Math.sin(w * deltaT) * (this.pose.getY() - ICCy) + ICCx;\r\n\t\t\tW_yResult \t\t= Math.sin(w * deltaT) * (this.pose.getX()-ICCx) + Math.cos(w * deltaT) * (this.pose.getY() - ICCy) + ICCy;\r\n\t\t\tW_angleResult \t= this.pose.getHeading() + w * deltaT;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)W_xResult, (float)W_yResult);\r\n\t\tthis.pose.setHeading((float)W_angleResult);\r\n\t\t\r\n\t\t// Conversion to grads\r\n\t\tW_angleResult = W_angleResult/Math.PI*180;\r\n\t\t\r\n\t\t// Get the heading axe\r\n\t\t//axe = getHeadingAxe();\r\n\t\tgetHeadingAxe();\r\n\t\t\r\n\t\t// Verify the coordinates and the heading angle\r\n\t\tif (Po_Corn == 1)\r\n\t\t{\r\n\t\t\tswitch (Po_CORNER_ID)\r\n\t\t\t{\r\n\t\t\t\tcase 0:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0;\r\n\t\t\t\t\tPo_ExpAng = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 1:\r\n\t\t\t\t\tE_xResult = 1.8;\r\n\t\t\t\t\tE_yResult = 0.11;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tE_xResult = 1.6;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.45;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 4:\r\n\t\t\t\t\tE_xResult = 1.5;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.3;\r\n\t\t\t\t\tPo_ExpAng = 90;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 6:\r\n\t\t\t\t\tE_xResult = 0.3;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 180;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tE_xResult = 0;\r\n\t\t\t\t\tE_yResult = 0.6;\r\n\t\t\t\t\tPo_ExpAng = 270;\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tE_angleResult = W_angleResult;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tint block = 0;\r\n\t\t\t// white = 0, black = 2, grey = 1\r\n\t\t\tif ((lineSensorLeft == 0) && (lineSensorRight == 0) && (block == 0)) \t// Robot moves on the black line\r\n\t\t\t{\r\n\t\t\t\tswitch (Po_CORNER_ID)\t\t\t\t\t\t\t\t// Even numbers - x, Odd numbers - y\r\n\t\t\t\t{\r\n\t\t\t\tcase 0: \r\n\t\t\t\t\tif (this.pose.getX() < 1.6)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0;\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\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 1: \r\n\t\t\t\t\tif (this.pose.getY() < 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.8;\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\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 2:\r\n\t\t\t\t\tif (this.pose.getX() > 1.65)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\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\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 3:\r\n\t\t\t\t\tif (this.pose.getY() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 1.5; \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\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 4: \r\n\t\t\t\t\tif (this.pose.getX() > 0.4)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.3;\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\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 5:\r\n\t\t\t\t\tif (this.pose.getY() < 0.5)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0.3;\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\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 6: \r\n\t\t\t\t\tif (this.pose.getX() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_yResult = 0.6;\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\tE_angleResult = W_angleResult;\r\n\t\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 7:\r\n\t\t\t\t\tif (this.pose.getY() > 0.1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tE_angleResult = Po_ExpAng;\r\n\t\t\t\t\t\tE_xResult = 0;\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\tE_angleResult = W_angleResult; \r\n\t\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tdefault: \r\n\t\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 2)) || ((lineSensorLeft == 2) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_W)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_W;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_W))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_W;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse if(((lineSensorLeft == 0) && (lineSensorRight == 1)) || ((lineSensorLeft == 1) && (lineSensorRight == 0)))\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\t\r\n\t \tif (W_angleResult >= TRSH_G)\r\n\t \t{\r\n\t \t\tE_angleResult = TRSH_G;\r\n\t \t}\r\n\t \telse if (W_angleResult >= (360 - TRSH_G))\r\n\t \t{\r\n\t \t\tE_angleResult = 360 - TRSH_G;\r\n\t \t}\r\n\t \telse\r\n\t \t{\r\n\t \t\tE_angleResult = W_angleResult;\r\n\t \t}\r\n\t \t\r\n\t \t// test\r\n\t \tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tE_xResult = W_xResult;\r\n\t\t\t\tE_yResult = W_yResult;\r\n\t\t\t\tE_angleResult = W_angleResult;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tLCD.drawString(\"AngRs: \" + (E_angleResult), 0, 7);\r\n\t\t\r\n\t\t// Conversion to rads\r\n\t\tW_angleResult = W_angleResult*Math.PI/180;\r\n\t\tE_angleResult = E_angleResult*Math.PI/180;\r\n\t\t\r\n\t\tif ((Po_CORNER_ID == 3) && (100*this.pose.getY() < 45))\r\n\t\t{\r\n\t\t\tE_angleResult = 3*Math.PI/180;;\r\n\t\t}\r\n\t\t\r\n\t\tthis.pose.setLocation((float)E_xResult, (float)E_yResult);\r\n\t\tthis.pose.setHeading((float)E_angleResult);\r\n\t\t\r\n\t\t/*\r\n\t\t// Integration deviation correction\r\n\t\tthis.pose.setLocation((float)(W_xResult), (float)(W_yResult + (0.01*22.4)/175));\r\n\t\tthis.pose.setHeading((float)((W_angleResult + 14/175)*Math.PI/180));\r\n\t\t*/\r\n\t}", "private void changeCameraPosition() {\n yPosition = mPerspectiveCamera.position.y;\n if (isMovingUp) {\n yPosition += 0.1;\n if (yPosition > 20)\n isMovingUp = false;\n } else {\n yPosition -= 0.1;\n if (yPosition < 1)\n isMovingUp = true;\n }\n\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n mPerspectiveCamera.update();\n }", "public void offsetCamera(Location offset){\n //updateCoordinateToScreenPosition();\n xCameraOffset = offset.getX();\n yCameraOffset = offset.getY();\n }", "public Coord getCameraPosition() {\n if(internalNative == null) {\n if(internalLightweightCmp != null) {\n return internalLightweightCmp.getCenter();\n } \n // TODO: Browser component\n return new Coord(0, 0);\n }\n return new Coord(internalNative.getLatitude(), internalNative.getLongitude());\n }", "private void setOrigin() {\n Hep3Vector origin = VecOp.mult(CoordinateTransformations.getMatrix(), _sensor.getGeometry().getPosition());\n // transform to p-side\n Polygon3D psidePlane = this.getPsidePlane();\n Translation3D transformToPside = new Translation3D(VecOp.mult(-1 * psidePlane.getDistance(),\n psidePlane.getNormal()));\n this._org = transformToPside.translated(origin);\n }", "public PinholeCamera(Point cameraPosition, Vec towardsVec, Vec upVec, double distanceToPlain) {\n\t\tthis.cameraPosition = cameraPosition;\n\n\t\tthis.upVec = upVec.normalize();\n\t\tthis.rightVec = towardsVec.normalize().cross(upVec).normalize();\n\n\t\tthis.distanceToPlain = distanceToPlain;\n\t\tthis.plainCenterPoint = cameraPosition.add(towardsVec.normalize().mult(distanceToPlain));\n\t}", "private Vec2 calculatePos() {\n\t\tNetTransformComponent transform = actor.getEntity().getNetTransform();\n\t\tif (transform != null) {\n\t\t\tVec2 screenPos = scene.getCamera()\n\t\t\t\t\t.getScreenCoordinates(Vec3.add(transform.getPosition(), new Vec3(-2.0f, 3.25f, 0.0f)));\n\t\t\tVec2 result = new Vec2(screenPos.getX(), screenPos.getY());\n\t\t\treturn result;\n\t\t}\n\n\t\treturn new Vec2(0.0f, 0.0f);\n\t}", "public Vector2 getCameraPosition()\n {\n\n Vector2 tmpVector = new Vector2(camera.position.x/camera.zoom - Gdx.graphics.getWidth()/2, camera.position.y/camera.zoom - Gdx.graphics.getHeight()/2);\n return tmpVector;\n }", "@Override\r\n protected Matrix4f genViewMatrix() {\r\n\r\n // refreshes the position\r\n position = calcPosition();\r\n\r\n // calculate the camera's coordinate system\r\n Vector3f[] coordSys = genCoordSystem(position.subtract(center));\r\n Vector3f right, up, forward;\r\n forward = coordSys[0];\r\n right = coordSys[1];\r\n up = coordSys[2];\r\n\r\n // we move the world, not the camera\r\n Vector3f position = this.position.negate();\r\n\r\n return genViewMatrix(forward, right, up, position);\r\n }", "public SVector3d getPositionCam() {\n\t\treturn transCamera;\n\t}", "public Point getCameraPosition() {\n\t\treturn new Point(cameraPosition.x, cameraPosition.y, cameraPosition.z);\n\t}", "private void setCamera() {\n\t\tVector viewTranslation = controller.getCameraPosition();\n\n\t\tGL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\t\tGL11.glMatrixMode(GL11.GL_PROJECTION);\n\t\tGL11.glLoadIdentity();\n\n\t\tfloat whRatio = (float) windowWidth / (float) windowHeight;\n\t\tGLU.gluPerspective(controller.getFOV(), whRatio, 1, 100000);\n\t\tGLU.gluLookAt((float) viewTranslation.x, (float) viewTranslation.y,\n\t\t\t\t(float) controller.getCameraDistance(), (float) viewTranslation.x,\n\t\t\t\t(float) viewTranslation.y, 0, 0, 1, 0);\n\n\t\tGL11.glMatrixMode(GL11.GL_MODELVIEW);\n\t\tGL11.glLoadIdentity();\n\t}", "public double getOffset(){\n\t\tdouble percentHeight = networkTableValues.get(\"height\")/cameraHeightPixel;\n\t\t//Get the height of the frame in inches\n\t\tdouble cameraHeightInches = networkTableValues.get(\"height\")/percentHeight;\n\t\t//Get the width of the frame in inches\n\t\tdouble cameraWidthInches = cameraHeightInches*(cameraWidthPixel/cameraHeightPixel);\n\t\t//Get the distanceFromTower from the camera to the goal\n\t\tdistanceFromTower = (cameraWidthInches/2)/Math.tan(cameraFOV*(Math.PI/180));\n\t\t//Get the distanceFromTower from the camera to the base of the tower\n\t\tdouble horizontalDistance = Math.sqrt(Math.pow(distanceFromTower, 2) - Math.pow(towerHeight, 2));\n\t\t//Get offset in inches\n\t\tdouble distanceFromCenterInches = (networkTableValues.get(\"centerX\") / cameraWidthPixel)*cameraWidthInches;\n\t\tdouble offset = Math.atan((distanceFromCenterInches/distanceFromTower)*(180/Math.PI));\n\t\t\n\t\tSystem.out.println(\"OFFSET: \" + offset);\n\t\treturn offset;\n\t}", "public Camera(Point3D p0, Vector vUp, Vector vTo) {\n\t\t_vTo = vTo.normalized();\n\t\t_vUp = vUp.normalized();\n\t\tif (!isZero(_vUp.dotProduct(_vTo)))\n\t\t\tthrow new IllegalArgumentException(\"Vup and Vto must be orthogonal\");\n\t\t_p0 = p0;\n\t\t_vRight = _vTo.crossProduct(_vUp).normalize();\n\t}", "private void resolveCamPos(CamPos in){\r\n\t\tcurCamPos = in;\r\n\t\t\r\n\t\tswitch(in){\r\n\t\tcase DRIVE_FWD:\r\n\t\t\tcur_pan_angle = DRIVE_FWD_PAN_ANGLE;\r\n\t\t\tcur_tilt_angle = DRIVE_FWD_TILT_ANGLE;\r\n\t\t\tbreak;\r\n\t\tcase DRIVE_REV:\r\n\t\t\tcur_pan_angle = DRIVE_REV_PAN_ANGLE;\r\n\t\t\tcur_tilt_angle = DRIVE_REV_TILT_ANGLE;\r\n\t\t\tbreak;\t\t\t\r\n\t\tcase SHOOT:\r\n\t\t\tcur_pan_angle = SHOOT_PAN_ANGLE;\r\n\t\t\tcur_tilt_angle = SHOOT_TILT_ANGLE;\r\n\t\t\tbreak;\r\n\t\tcase CLIMB:\r\n\t\t\tcur_pan_angle = CLIMB_PAN_ANGLE;\r\n\t\t\tcur_tilt_angle = CLIMB_TILT_ANGLE;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"Warning - commanded camera position \" + in.name() + \" is not recognized!\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t}", "protected abstract void calcOrigin();", "private void updatePosition() {\n\t\tfor (int i = 0; i < encoders.length; i++) {\n\t\t\tdRot[i] = (encoders[i].get() - lastEncPos[i]) / this.cyclesPerRev;\n\t\t\tdPos[i] = dRot[i] * wheelDiameter * Math.PI;\n\t\t\tlastEncPos[i] = encoders[i].get();\n\t\t}\n\t\t\n\t\tdLinearPos = (dPos[0] + dPos[1]) / 2;\n\t\t\n\t\tposition[2] = Math.toRadians(gyro.getAngle()) + gyroOffset;\n\t\tposition[0] += dLinearPos * Math.sin(position[2]);\n\t\tposition[1] += dLinearPos * Math.cos(position[2]);\n\t}", "private void moveCamera(float tpf) {\n //Place the camera at the node\n this.getCamera().setLocation(cameraNode.getLocalTranslation().multLocal(1,0,1).add(0, 2, 0));\n cameraNode.lookAt(cam.getDirection().mult(999999), new Vector3f(0,1,0)); //Makes the gun point\n if (im.up) {\n cameraNode.move(getCamera().getDirection().mult(tpf).mult(10));\n }\n else if (im.down) {\n cameraNode.move(getCamera().getDirection().negate().mult(tpf).mult(10));\n }\n if (im.right) {\n cameraNode.move(getCamera().getLeft().negate().mult(tpf).mult(10));\n }\n else if (im.left) {\n cameraNode.move(getCamera().getLeft().mult(tpf).mult(10));\n }\n }", "@Override\n public void updatePosition(float deltaTime) {\n if (isBeingRotated || isBeginMoved) return;\n // prevent overshooting when camera is not updated.\n deltaTime = Math.min(deltaTime, 0.5f);\n\n Vector3f eyeDir = new Vector3f(eyeOffset);\n GLFWWindow window = game.window();\n int width = window.getWidth();\n int height = window.getHeight();\n\n // correction for toolbar\n int corrMouseYPos = (int) mouseYPos;\n int corrMouseXPos = (int) mouseXPos;\n\n // x movement\n if (corrMouseXPos < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(corrMouseXPos) * deltaTime;\n eyeDir.normalize(value).cross(getUpVector());\n focus.add(eyeDir.x, eyeDir.y, 0);\n\n } else {\n int xInv = width - corrMouseXPos;\n if (xInv < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(xInv) * deltaTime;\n eyeDir.normalize(value).cross(getUpVector());\n focus.sub(eyeDir.x, eyeDir.y, 0);\n }\n }\n\n eyeDir.set(eyeOffset);\n // y movement\n if (corrMouseYPos < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(corrMouseYPos) * deltaTime;\n eyeDir.normalize(value);\n focus.sub(eyeDir.x, eyeDir.y, 0);\n\n } else {\n int yInv = height - corrMouseYPos;\n if (yInv < SCREEN_MOVE_BORDER_SIZE) {\n float value = positionToMovement(yInv) * deltaTime;\n eyeDir.normalize(value);\n focus.add(eyeDir.x, eyeDir.y, 0);\n }\n }\n }", "private void rotateAround() {\n if (camPathAngle < Constants.FULL_ROTATION) {\n camPathAngle++;\n } else {\n swapCount++;\n camPathAngle = 0;\n }\n mPerspectiveCamera.position.set(xPosition, yPosition, zPosition);\n if (swapCount % 2 == 0) {\n mPerspectiveCamera.rotate(Vector3.Y, camPathAngle);\n } else {\n mPerspectiveCamera.rotate(Vector3.X, camPathAngle);\n }\n mPerspectiveCamera.lookAt(new Vector3(0, 0, 0));\n mPerspectiveCamera.update();\n }", "@Override\n public void onDrawFrame(GL10 gl10) {\n glClear(GL_COLOR_BUFFER_BIT);\n\n Location drawCameraLocation;\n\n //Don't draw until camera location is known\n if (mCurrentCameraLocation == null && mNewCameraLocation == null) {\n //Log.d(LOG_TAG, \"onDraw 1\");\n return;\n } else if (mCurrentCameraLocation == null && mNewCameraLocation != null) {\n //Log.d(LOG_TAG, \"onDraw 2\");\n mCurrentCameraLocation = mNewCameraLocation;\n drawCameraLocation = mCurrentCameraLocation;\n } else if (mCurrentCameraLocation != null && mNewCameraLocation != null && mTargetCameraLocation == null) {\n //Log.d(LOG_TAG, \"onDraw 3\");\n\n float distance = mNewCameraLocation.distanceTo(mCurrentCameraLocation);\n\n ///Increment step to target location when new camera location\n // is greater than 1.5 meters from current location\n if (distance > 1.5f) {\n mTargetCameraLocation = mNewCameraLocation;\n }\n\n drawCameraLocation = mCurrentCameraLocation;\n }\n\n //Provide increment location (if necessary) for smooth changes in camera positions\n else if (mCurrentCameraLocation != null && mTargetCameraLocation != null) {\n //Log.d(LOG_TAG, \"onDraw 4\");\n float cameraDistance = mCurrentCameraLocation.distanceTo(mTargetCameraLocation);\n\n\n float x = (float) mCameraStep / TOTALCAMERASTEPS;\n //float y = (float)Math.pow(x,3)*(x*(6*x-15)+10);\n //float y = (float)Math.pow(x,2)*(3-2*x); //smoothstep\n float y = x;\n\n float incDistance = y * cameraDistance;\n float bearing = mCurrentCameraLocation.bearingTo(mTargetCameraLocation);\n\n bearing = (bearing + 360) % 360;\n\n drawCameraLocation = calculateDestinationLocation(mCurrentCameraLocation, bearing, incDistance);\n drawCameraLocation.setAccuracy(mTargetCameraLocation.getAccuracy());\n\n mCameraStep++;\n\n if (mCameraStep == TOTALCAMERASTEPS) {\n //mCurrentCameraLocation = mTargetCameraLocation;\n mCurrentCameraLocation = drawCameraLocation;\n mTargetCameraLocation = null;\n mCameraStep = 0;\n }\n } else {//Never should come to this\n Log.d(LOG_TAG, \"onDraw 5\");\n\n drawCameraLocation = mCurrentCameraLocation;\n }\n\n /*\n setLookAtM(viewMatrix, 0, viewValues[0], viewValues[1], viewValues[2]\n , viewValues[3], viewValues[4], viewValues[5]\n , viewValues[6], viewValues[7], viewValues[8]);\n */\n\n multiplyMM(viewMatrix, 0, rotationMatrix, 0, modelSensorMatrix, 0);\n // Multiply the view and projection matrices together.\n multiplyMM(viewProjectionMatrix, 0, projectionMatrix, 0, viewMatrix, 0);\n\n\n //Process each image texture with drawCameraLocation\n for (ImageTexture it : mImageTextures) {\n\n\n if (it == null) {\n return;\n }\n\n double ItAngle;\n double distance = drawCameraLocation.distanceTo(it.mLocation);\n\n\n\n /*\n if (distance > (drawCameraLocation.getAccuracy() /0.68f))\n {\n ItAngle = (drawCameraLocation.bearingTo(it.mLocation) + 360) % 360;\n it.rotateAroundCamera((float) ItAngle );\n\n Log.d(LOG_TAG, \"onDrawFrame: distance = \" + distance + \" > \" + (drawCameraLocation.getAccuracy() /0.68f) + \", ItAngle = \" +ItAngle );\n }\n //Within accuracy radius\n else {\n distance = 4;\n }\n\n */\n\n ItAngle = (drawCameraLocation.bearingTo(it.mLocation) + 360) % 360;\n\n\n if (distance != 0 || ItAngle != 0.0f) {\n it.rotateAroundCamera((float) ItAngle);\n it.moveFromToCamera((float) -distance * 0.79f);\n }\n\n\n Log.d(LOG_TAG, \"onDrawFrame: distance = \" + distance + \" > \" + (drawCameraLocation.getAccuracy() / 0.68f) + \", ItAngle = \" + ItAngle);\n Log.d(LOG_TAG, \"onDrawFrame: drawCameraLocation = \" + drawCameraLocation.getLatitude() + \", \" + drawCameraLocation.getLongitude()\n + \" \" + it.mLocation.getLatitude() + \", \" + it.mLocation.getLongitude());\n\n\n String debugStr = \"Camera: \" + String.format(\"%5.6f\", drawCameraLocation.getLatitude()) + \", \" + String.format(\"%5.6f\", drawCameraLocation.getLongitude())\n + \"\\nAccuracy: \" + String.format(\"%5.7f\", drawCameraLocation.getAccuracy()) + \", Z: \" + String.format(\"%3.1f\", mAzimuth)\n //+ \"\\nImage: \" + String.format(\"%5.7f\",it.mLocation.getLatitude()) + \", \" + String.format(\"%5.7f\",it.mLocation.getLongitude())\n + \"\\nDistance: \" + String.format(\"%5.5f\", distance) + \", ItAngle: \" + String.format(\"%3.7f\", it.mCameraRotationAngle);\n\n\n float[] modelMatrix = it.calculateModelMatrix();\n multiplyMM(modelViewProjectionMatrix, 0, viewProjectionMatrix, 0, modelMatrix, 0);\n mTextureShaderProgram.useProgram();\n mTextureShaderProgram.setUniforms(modelViewProjectionMatrix, it.mTextureId, it.opacity);//every object sets its own mvpMatrix, texture, and alpha values\n it.bindData(mTextureShaderProgram);\n it.draw();\n }\n }", "public interface Camera {\n Vector3f getPosition();\n\n float getYaw();\n\n float getPitch();\n\n float getRoll();\n}", "public Camera(Point3D _p0, Vector _vTo, Vector _vUp, double _aperture, double _focusDistance) {\n if (_vTo.dotProduct(_vUp) != 0)\n throw new IllegalArgumentException(\"The vectors are not orthogonal to each other\");\n if (_aperture < 0)\n throw new IllegalArgumentException(\"The aperture size cannot be negative\");\n if (_focusDistance < 0)\n throw new IllegalArgumentException(\"Distance cannot be negative\");\n this._p0 = new Point3D(_p0);\n this._vTo = new Vector(_vTo.normalized());\n this._vUp = new Vector(_vUp.normalized());\n this._vRight = this._vTo.crossProduct(this._vUp).normalized();\n this._aperture = _aperture;\n this._focusDistance = _focusDistance;\n }", "public Camera(Point3D _p0, Vector _vTo, Vector _vUp) {\n this(_p0, _vTo, _vUp, 0, 0);\n }", "public void cameraUpdate(float delta) {\n Vector3 vPosition = cam.position;\n\n // a + (b-a) * trail amount \n // target\n // a = the current cam position\n //b the current player posistion\n\n\n //determines which player the camera follows\n if (Gdx.input.isKeyJustPressed(Input.Keys.SPACE)) {\n nCurrentPlayer = nCurrentPlayer * -1;\n }\n if (nCurrentPlayer > 0) {\n vPosition.x = cam.position.x + (bplayer.getPosition().x * PPM - cam.position.x) * 0.1f;\n vPosition.y = cam.position.y + (bplayer.getPosition().y * PPM - cam.position.y) * 0.1f;\n } else {\n vPosition.x = cam.position.x + (bplayer2.getPosition().x * PPM - cam.position.x) * 0.1f;\n vPosition.y = cam.position.y + (bplayer2.getPosition().y * PPM - cam.position.y) * 0.1f;\n }\n cam.position.set(vPosition);\n cam.update();\n }", "public void setCameraPos(CamPos in){\r\n\t\tresolveCamPos(in);\r\n\t\tpan_servo.setAngle(cur_pan_angle);\r\n\t\ttilt_servo.setAngle(cur_tilt_angle);\r\n\t\t\r\n\t\t\r\n\t}", "public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }", "private double[] getPositionOfSpaceObject(CTS_SpaceObject obj) {\n\t\tif (obj == null) {\n\t\t\t//System.out.println(\"null obj passed to getPositionOfSpaceObject!\");\n\t\t\treturn null;\n\t\t}\n\t\tdouble azimuth = obj.getAzimuth();\n\t\tdouble altitude = obj.getAltitude();\n\t\tif (altitude < 0 || altitude > 90) {\n\t\t\treturn null;\n\t\t}\n\t\tdouble radAlt = toRadians(altitude);\n\t\tdouble r = VIEWING_AREA_WIDTH / 2;\n\t\tdouble x_val, y_val, distanceFromCenter;\n\t\tdistanceFromCenter = abs(r*cos(radAlt));\n\t\t// x_val, y_val are coords relative to the center of the viewing area\n\t\t// being considered 0,0 on the Cartesian plane\n\t\tx_val = distanceFromCenter*(sin(toRadians(azimuth)));\n\t\ty_val = distanceFromCenter*(cos(toRadians(azimuth)));\n\t\t// view_x, view_y are the actual JavaFX coordinates to draw at\n\t\tdouble view_x = 0, view_y = 0;\n\t\tif (azimuth < 90) {\n\t\t\tview_x = x_val + 299;\n\t\t\tview_y = max(0,(299-y_val));\n\t\t} else if (azimuth < 180) {\n\t\t\tview_x = x_val + 299;\n\t\t\tview_y = min(599,(299-y_val));\n\t\t} else if (azimuth < 270) {\n\t\t\tview_x = max(0,(299+x_val));\n\t\t\tview_y = min(599,(299-y_val));\n\t\t} else {\n\t\t\tview_x = max(0,(299+x_val));\n\t\t\tview_y = max(0,(299-y_val));\n\t\t}\n\t\tdouble[] retval = { view_x, view_y};\n\t\treturn retval;\n\t}", "@Override\n public void setCamera (GL2 gl, GLU glu, GLUT glut) {\n glu.gluLookAt(0, 0, 2.5, // from position\n 0, 0, 0, // to position\n 0, 1, 0); // up direction\n }", "public void moveCam() {\n float x = this.cam_bind_x; //current pos the camera is binded to\n float y = this.cam_bind_y;\n\n //this amazing camera code is from: https://stackoverflow.com/questions/24047172/libgdx-camera-smooth-translation\n Vector3 target = new Vector3(x+MathUtils.cos(Global.m_angle)*20,y+MathUtils.sin(Global.m_angle)*20,0);\n final float speed = 0.1f, ispeed=1.0f-speed;\n\n Vector3 cameraPosition = cam.position;\n cameraPosition.scl(ispeed);\n target.scl(speed);\n cameraPosition.add(target);\n cam.position.set(cameraPosition);\n\n this.updateCam();\n\n }", "public double getdAdjusted(double pitch_angle, double yaw_angle){\n double distance_d = Constants.DELTA_H / Math.tan(Math.toRadians(Constants.ANGLE_I + pitch_angle)); // This is the distance from\n // the CAMERA to the centre\n // of target\n double side_d = distance_d / Math.tan(Math.toRadians(90-yaw_angle));\n double distance_d_adjusted = Math.sqrt(Math.pow(side_d,2) + Math.pow(distance_d + Constants.LENGTH_E_C,2)); \n\n // double distance_d_adjusted = Math.sqrt((Math.pow(distance_d, 2)) + (Math.pow(Constants.LENGTH_E_C, 2))\n // - ((2 * distance_d * Constants.LENGTH_E_C) * Math.cos(Math.toRadians(180 - yaw_angle)))); // This is the\n // // distance from the\n // // CENTRE OF ROBOT (E)\n // // to centre of target\n\n this.distance_d = distance_d;\n this.side_d = side_d;\n this.distance_d_adjusted = distance_d_adjusted;\n\n return distance_d_adjusted;\n }", "public Vector3d getOrigin() { return mOrigin; }", "private void lookAt(Bot bot) {\n\t\t// http://www.gamefromscratch.com/post/2012/11/18/GameDev-math-recipes-Rotating-to-face-a-point.aspx\n\t\tdesiredDirection = Math.atan2(bot.getY() - sens.getYPos(), bot.getX() - sens.getXPos()) * (180 / Math.PI);\n\t\tfixDirections();\n\t}", "godot.wire.Wire.Vector3 getOrigin();", "@Override\n public void update(double delta) {\n model.rotateXYZ(0,(1 * 0.001f),0);\n\n float acceleration = 0.1f;\n float cameraSpeed = 1.5f;\n\n // Left - right\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_A) == GLFW_PRESS)\n speedz+= (speedz < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_A) == GLFW_RELEASE)\n speedz-= (speedz-acceleration > 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_D) == GLFW_PRESS)\n speedz-= (speedz > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_D) == GLFW_RELEASE)\n speedz+= (speedz+acceleration < 0) ? acceleration : 0;\n\n // Forward - backward\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_W) == GLFW_PRESS)\n speedx+= (speedx < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_W) == GLFW_RELEASE)\n speedx-= (speedx > 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_S) == GLFW_PRESS)\n speedx-= (speedx > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_S) == GLFW_RELEASE)\n speedx+= (speedx+acceleration < 0) ? acceleration : 0;\n\n // up - down\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_Q) == GLFW_PRESS)\n speedy+= (speedy < cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_Q) == GLFW_RELEASE)\n speedy-= (speedy > 0.1) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_E) == GLFW_PRESS)\n speedy-= (speedy > -cameraSpeed) ? acceleration : 0;\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_E) == GLFW_RELEASE)\n speedy+= (speedy < 0) ? acceleration : 0;\n\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_TAB) == GLFW_PRESS) {\n speedz = 0;\n speedx = 0;\n }\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_R) == GLFW_PRESS) {\n debugCameraObject.eyePos.x = 0;\n debugCameraObject.eyePos.y = 0;\n debugCameraObject.eyePos.z = 0;\n }\n if(glfwGetKey(this.mainWindow.id(),GLFW_KEY_T) == GLFW_PRESS) {\n showSkybox = !showSkybox;\n }\n\n\n debugCameraObject.processKeyboard(DebugCamera.CameraMovement.RIGHT, (float) (speedz * delta));\n debugCameraObject.processKeyboard(DebugCamera.CameraMovement.FORWARD, (float) (speedx * delta));\n }", "private void configureCamera() {\n float fHeight = cam.getFrustumTop() - cam.getFrustumBottom();\n float fWidth = cam.getFrustumRight() - cam.getFrustumLeft();\n float fAspect = fWidth / fHeight;\n float yDegrees = 45f;\n float near = 0.02f;\n float far = 20f;\n cam.setFrustumPerspective(yDegrees, fAspect, near, far);\n\n flyCam.setMoveSpeed(5f);\n\n cam.setLocation(new Vector3f(2f, 4.7f, 0.4f));\n cam.setRotation(new Quaternion(0.348f, -0.64f, 0.4f, 0.556f));\n }", "public Mat4x4 getMatView() {\n Mat4x4 matCameraRotX = MatrixMath.matrixMakeRotationX(cameraRot.getX());\n Mat4x4 matCameraRotY = MatrixMath.matrixMakeRotationY(cameraRot.getY());\n Mat4x4 matCameraRotZ = MatrixMath.matrixMakeRotationZ(cameraRot.getZ());\n Mat4x4 matCameraRotXY = MatrixMath.matrixMultiplyMatrix(matCameraRotX, matCameraRotY);\n Mat4x4 matCameraRot = MatrixMath.matrixMultiplyMatrix(matCameraRotXY, matCameraRotZ);\n matCamera = calculateMatCamera(up, target, matCameraRot);\n matView = MatrixMath.matrixQuickInverse(matCamera);\n return matView;\n }", "public AlignByCamera ()\n\t{\n\t\trequires(Subsystems.transmission);\n\t\trequires(Subsystems.goalVision);\n\n\t\tthis.motorRatio = DEFAULT_ALIGNMENT_SPEED;\n\t}", "private void adjustEViewPosition() {\n double aVec[] = theRocket.getCoordSys().getPositionVec();\n CoordSys eViewSys = new CoordSys();\n eViewSys.setZAxis(VMath.normalize(aVec));\n\n aVec = VMath.vecMultByScalar(aVec, 2.5);\n eViewSys.setPositionAsVec(aVec);\n\n double[] zAxis = VMath.normalize(eViewSys.zAxis().getVectorForm());\n double[] yAxis = VMath.normalize(theRocket.getCoordSys().yAxis().getVectorForm());\n double[] xAxis = VMath.normalize(VMath.crossprd(yAxis, zAxis));\n yAxis = VMath.crossprd(zAxis, xAxis);\n eViewSys.setXAxis(xAxis);\n eViewSys.setYAxis(yAxis);\n eViewSys.setZAxis(zAxis);\n\n eViewSys.xRotate(180);\n eViewSys.zRotate(-90);\n eView.setViewingCoordSys(eViewSys);\n }", "public void getDistance() {\n projDistance = 2 * sin(toRadians(launchAngle)) * getVelocity() / 9.8 * cos(toRadians(launchAngle)) * getVelocity();\n }", "private void calculateMovement() {\r\n \tmovementY = (int)(movementSpeed * Math.sin(Math.toRadians(movementDirection - 90)));\r\n \tmovementX = (int)(movementSpeed * Math.cos(Math.toRadians(movementDirection - 90)));\r\n }", "public position convertToPosition(){\n\t\tdouble x = r * Math.cos(theta);\n\t\tdouble y = r * Math.sin(theta);\n\t\treturn new position(x, y);\n\t}", "private void setCamera(GL2 gl, GLU glu)\n {\n Boundary bc = simulation.getBoundary();\n int w = (int) (bc.getMaxSize(0)-bc.getMinSize(0));\n int h = (int) (bc.getMaxSize(1)-bc.getMinSize(1));\n\n gl.glViewport(0, 0, w, h);\n\n\n gl.glMatrixMode(GL2.GL_PROJECTION);\n gl.glLoadIdentity();\n //opening angle, ratio of height and width, near and far\n glu.gluPerspective(80.0, 1,0.1,3*( bc.getMaxSize(2)-bc.getMinSize(2)));\n\n gl.glTranslatef(0.5f*(float) bc.getMinSize(0),-0.5f*(float) bc.getMinSize(1),1.5f*(float) bc.getMinSize(2));\n // gl.glTranslatef(0.5f*(float) (bc.getMaxSize(0)+bc.getMinSize(0)),0.5f*(float)(bc.getMaxSize(1)+ bc.getMinSize(1)),(float) -(bc.getMaxSize(2)-bc.getMinSize(2)));\n\n }", "public Vector3d screenToModelPointVector(Vector2i pos)\n {\n double adjustedX = pos.getX() - getViewOffset().getX();\n double adjustedY = pos.getY() - getViewOffset().getY();\n // get the percentage of the screen for the positions\n // then use that to get the angles off of the viewer\n // Intersect those with the earth to get the actual selection points.\n double fromXpct = adjustedX / getViewportWidth() - 0.5;\n double fromYpct = adjustedY / getViewportHeight() - 0.5;\n double fromXAngleChange = -fromXpct * myHalfFOVx * 2.;\n double fromYAngleChange = -fromYpct * myHalfFOVy * 2.;\n return rotateDir(fromXAngleChange, fromYAngleChange).getNormalized();\n }", "private Vec3 getLightPosition() {\r\n\t\tdouble elapsedTime = getSeconds() - startTime;\r\n\t\tfloat x = 5.0f * (float) (Math.sin(Math.toRadians(elapsedTime * 50)));\r\n\t\tfloat y = 2.7f;\r\n\t\tfloat z = 5.0f * (float) (Math.cos(Math.toRadians(elapsedTime * 50)));\r\n\t\treturn new Vec3(x, y, z);\r\n\r\n\t\t//return new Vec3(5f,3.4f,5f); // use to set in a specific position for testing\r\n\t}", "@Override\r\n default Vector3 getOrigin() {\r\n return Vector3.fromXYZ(getOrgX(), getOrgY(), getOrgZ());\r\n }", "public static NewMovement create(PosRotScale originLoc, float ex, float ey,float ez, int duration) {\n\n/*\n\t\tVector3 posO = new Vector3();\n\t\toriginObject.transform.getTranslation(posO);\n\t\t\n\t\tQuaternion orotation = new Quaternion();\n\t\toriginObject.transform.getRotation(orotation,true); //existing rotation\n\t\t\n\t\t//first we create a matrix for the destination location reusing the same rotation\n\t\t Vector3 destination_loc = new Vector3(ex,ey,ez);\n\t\t Vector3 destination_scale = new Vector3(1,1,1);\n\t\t// Matrix4 destination = new Matrix4(destination_loc,orotation,destination_scale);\n\t\t \n\t\t //the difference is the new movement\n\t\tMatrix4 oldloc = originObject.transform.cpy();\n\t\t\n\t\t Gdx.app.log(logstag, \"_____________________________________________destination_loc:\"+destination_loc.x+\",\"+destination_loc.y+\",\"+destination_loc.z);\n\t\t\t\n\t\t Vector3 destination_loc2 = destination_loc.mul(oldloc);\n\t\t \n\t\t Gdx.app.log(logstag, \"________________________=______destination_loc:\"+destination_loc2.x+\",\"+destination_loc2.y+\",\"+destination_loc2.z);\n\t\t\t\n\t\t\t\n\t\tMatrix4 destinationmatrix = new Matrix4().setTranslation(destination_loc2);\n\t\t\n\t\t*/\n\t\t Vector3 destination_loc = new Vector3(ex,ey,ez);\n\t\t \n\t\treturn create( originLoc, destination_loc, duration);\n\t\t\n\t}", "private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}", "public float getPosition(){\n\t\treturn (float)cFrame + interpol;\n\t}", "protected void setupRotationOrigin()\n\t{\n\t\tthis.currentRotationAxis = new Point2D.Double(getOriginX(), getOriginY());\n\t\tupdateDefaultMomentMass();\n\t\tthis.currentMomentMass = this.defaultMomentMass;\n\t\t\n\t\t//changeRotationAxisTo(new Point2D.Double(0, 0));\n\t}", "private double getDistance() {\n\t\tfinal double h2 = 86.7;\n\t\t// h1: height of top of camera\n\t\tfinal double h1 = 17.6;\n\n\t\t// a1: angle of camera (relative to chasis)\n\t\tfinal double a1 = 36.175;\n\t\t// a2: angle of target relative to a1\n\t\tfinal double a2 = ty.getDouble(0.0);\n\n\t\t// distance: distance from camera to base of target\n\t\tfinal double distance = ((h2 - h1) / Math.tan(Math.toRadians(a1 + a2)));\n\n\t\tfinal double d = Math.sqrt(Math.pow(h2 - h1, 2) + Math.pow(distance, 2));\n\t\tSmartDashboard.putNumber(\"Py Distance\", d);\n\n\t\treturn (distance);\n\n\t}", "public void runProjectionMotion(){\n\t\tpos.setLocation(pos.getX() + vel[0]/5, pos.getY() - vel[1]/5);\r\n\t\tvel[1]-=gravity;\r\n\t}", "static float calculateNewPosition(float a, float deltaTime, float v, float x0) {\n return x0\n + (a * deltaTime * deltaTime / 2 + v * deltaTime)\n * (Utility.sensorType == Sensor.TYPE_GYROSCOPE ? GYROSCOPE_MOVEMENT_COEFF : GRAVITY_MOVEMENT_COEFF);\n }", "DMatrix3C getOffsetRotation();", "public void updateRenderCameraPose(TangoPoseData cameraPose) {\n float[] rotation = cameraPose.getRotationAsFloats();\n float[] translation = cameraPose.getTranslationAsFloats();\n Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);\n // Conjugating the Quaternion is need because Rajawali uses left handed convention for\n // quaternions.\n getCurrentCamera().setRotation(quaternion.conjugate());\n getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);\n }", "public static Vector3 getDeltaPositionFromRotation(float rotationYaw, float rotationPitch)\n {\n return new Vector3(rotationYaw, rotationPitch);\n }", "private void animateYaw(float yawDeg, long durationMs) {\n\n // Get current orientation.\n QuatF currentOrientation = mOrionVideoView.getViewingRotation();\n\n // Create a vector showing where in the sphere the user is currently looking at.\n Vec3F lookingAt = Vec3F.AXIS_FRONT.rotate(currentOrientation.conjugate());\n\n // Get current yaw offset with respective to content 'front' direction in rads.\n float currentYawRad = lookingAt.getYaw();\n\n // Convert target yaw angle from degrees to radians.\n float newYawRad = (float) (Math.PI / 180.0f * yawDeg);\n\n // Android ValueAnimators can only be run in the UI thread, hence any excessive\n // load will make animations stutter, especially after a few seconds of inactivity\n // when the device begins to throttle the CPU. You can observe this most easily with\n // a pulsating or rotating animation: leave the device alone for a moment and\n // keep watching an animated object - if the animation is first smooth, and after\n // a few seconds starts to stutter, try touching the screen (e.g. pan a little)\n // and observe if the animation now becomes smooth again.\n\n // If this becomes a problem, you can try to use a background thread and a custom\n // animator for making the animations smoother. Another option is to upgrade to\n // Orion360 SDK Pro, which has built-in support for many animations and performs\n // them with C++ code in the GL thread, in sync with frame rendering at 60 fps.\n\n // Setup camera animator.\n mCameraAnimator = ValueAnimator.ofFloat(currentYawRad, newYawRad);\n mCameraAnimator.setRepeatCount(0);\n mCameraAnimator.setRepeatMode(ValueAnimator.RESTART);\n mCameraAnimator.setDuration(durationMs);\n mCameraAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n\n @Override\n public void onAnimationUpdate(final ValueAnimator animation) {\n\n // Rotate the camera to the desired yaw angle. Notice that each\n // animation step will get the yaw angle from the camera animator,\n // but pitch and roll will be checked again at each animation step,\n // hence allowing user control for these angles during the animation.\n float animatedValue = (Float) animation.getAnimatedValue();\n float yawDeg = (float) (animatedValue * 180.0f / Math.PI);\n setYaw(yawDeg);\n\n }\n });\n mCameraAnimator.start();\n }", "public float getBaseHorizontalViewAngle() {\n \treturn mCamera.getParameters().getHorizontalViewAngle();\n }", "private void getNextPosition() {\n \n if (turnLeft) {\n angleSpeed += angleMoveSpeed;\n if (angleSpeed > maxAngleSpeed) {\n angleSpeed = maxAngleSpeed;\n }\n angle += angleSpeed;\n \n if (angle > 360) {\n angle = angle - 360 + angleSpeed;\n }\n \n if (forward)\n {\n speed += moveSpeed;\n if (speed > maxSpeed)\n {\n speed = maxSpeed;\n }\n } else if (backwards)\n {\n speed -= moveSpeed;\n if (speed < -maxSpeed)\n {\n speed = -maxSpeed;\n }\n }\n }\n //moving in negative x direction\n if (turnRight) {\n angleSpeed -= angleMoveSpeed;\n if (angleSpeed < -maxAngleSpeed) {\n angleSpeed = -maxAngleSpeed;\n }\n angle += angleSpeed;\n \n if (angle < -360) {\n angle = angle + 360 - angleSpeed;\n }\n \n if (backwards)\n {\n speed -= moveSpeed;\n if (speed < -maxSpeed)\n {\n speed = -maxSpeed;\n }\n } else if (forward)\n {\n speed += moveSpeed;\n if (speed > maxSpeed)\n {\n speed = maxSpeed;\n }\n }\n }\n \n //moving in positive y direction\n if (backwards) {\n speed += moveSpeed;\n if (speed > maxSpeed) {\n speed = maxSpeed;\n }\n }\n //moving in negative y direction\n if (forward) {\n speed -= moveSpeed;\n if (speed < -maxSpeed) {\n speed = -maxSpeed;\n }\n }\n \n //not moving forward or backwards direction\n if (isNotMoving()) {\n //stop moving in the x direction\n if (speed > 0) {\n speed -= stopSpeed;\n if (speed < 0) {\n speed = 0;\n }\n }\n else if (speed < 0) {\n speed += stopSpeed;\n if (speed > 0) {\n speed = 0;\n }\n }\n \n if (isNotTurning()) {\n //stop moving in the y direction\n if (angleSpeed > 0) {\n angleSpeed -= stopSpeed;\n if (angleSpeed < 0) {\n angleSpeed = 0;\n }\n }\n else if (angleSpeed < 0) {\n angleSpeed += stopSpeed;\n if (angleSpeed > 0) {\n angleSpeed = 0;\n }\n }\n } \n }\n }", "public void mygluLookAt(\n double eX, double eY, double eZ,\n double cX, double cY, double cZ,\n double upX, double upY, double upZ) {\n\n double[] F = new double[3];\n double[] UP = new double[3];\n double[] s = new double[3];\n double[] u = new double[3];\n\n F[0] = cX-eX;\n F[1] = cY-eY;\n F[2] = cZ-eZ;\n UP[0] = upX;\n UP[1] = upY;\n UP[2] = upZ;\n normalize(F);\n normalize(UP);\n crossProd(F, UP, s);\n crossProd(s, F, u);\n\n double[] M = new double[16];\n\n // Switching to row-major order\n M[0] = s[0];\n M[4] = u[0];\n M[8] = -F[0];\n M[12] = 0;\n M[1] = s[1];\n M[5] = u[1];\n M[9] = -F[1];\n M[13] = 0;\n M[2] = s[2];\n M[6] = u[2];\n M[10] = -F[2];\n M[14] = 0;\n M[3] = 0;\n M[7] = 0;\n M[11] = 0;\n M[15] = 1;\n\n projection.multiply(M);\n projection.translate((float)-eX, (float)-eY, (float)-eZ);\n }", "public void moveForward()\r\n\t{\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] -= Math.sin(Math.toRadians(heading-90))*distance; \r\n\t\t\tthis.loc[2] -= Math.cos(Math.toRadians(heading-90))*distance;\r\n\t\t}\r\n\t}", "public float getPos() {\n return ((spos-xpos))/(sposMax-sposMin);// * ratio;\n }", "org.auvua.utils.protobuffer.AUVprotocol.AUVState.Telemetry.CameraLocation getAuvLoc();", "public void recalculateCamDist(Camera camera)\n\t{\n\t\tthis.camDist = Vector3f.sub(camera.getPosition(), getPosition(), null).lengthSquared();\n\t}", "public void findRobotPosition(){\n targetVisible = false;\n for (VuforiaTrackable trackable : allTrackables) {\n if (((VuforiaTrackableDefaultListener)trackable.getListener()).isVisible()) {\n telemetry.addData(\"Visible Target\", trackable.getName());\n targetVisible = true;\n\n // Get the position of the visible target and put the X & Y position in visTgtX and visTgtY\n // We will use these for determining bearing and range to the visible target\n OpenGLMatrix tgtLocation = trackable.getLocation();\n VectorF tgtTranslation = tgtLocation.getTranslation();\n visTgtX = tgtTranslation.get(0) / mmPerInch;\n visTgtY = tgtTranslation.get(1) / mmPerInch;\n //telemetry.addData(\"Tgt X & Y\", \"{X, Y} = %.1f, %.1f\", visTgtX, visTgtY);\n\n // getUpdatedRobotLocation() will return null if no new information is available since\n // the last time that call was made, or if the trackable is not currently visible.\n OpenGLMatrix robotLocationTransform = ((VuforiaTrackableDefaultListener)trackable.getListener()).getUpdatedRobotLocation();\n if (robotLocationTransform != null) {\n lastLocation = robotLocationTransform;\n }\n break;\n }\n }\n\n // Provide feedback as to where the robot is located (if we know).\n if (targetVisible) {\n // express position (translation) of robot in inches.\n VectorF translation = lastLocation.getTranslation();\n //telemetry.addData(\"Pos (in)\", \"{X, Y, Z} = %.1f, %.1f, %.1f\",\n // translation.get(0) / mmPerInch, translation.get(1) / mmPerInch, translation.get(2) / mmPerInch);\n\n // express the rotation of the robot in degrees.\n Orientation rotation = Orientation.getOrientation(lastLocation, EXTRINSIC, XYZ, DEGREES);\n //telemetry.addData(\"Rot (deg)\", \"{Roll, Pitch, Heading} = %.0f, %.0f, %.0f\", rotation.firstAngle, rotation.secondAngle, rotation.thirdAngle);\n\n // Robot position is defined by the standard Matrix translation (x and y)\n robotX = translation.get(0)/ mmPerInch;\n robotY = translation.get(1)/ mmPerInch;\n\n // Robot bearing (in +vc CCW cartesian system) is defined by the standard Matrix z rotation\n robotBearing = rotation.thirdAngle;\n\n // target range is based on distance from robot position to the visible target\n // Pythagorean Theorum\n targetRange = Math.sqrt((Math.pow(visTgtX - robotX, 2) + Math.pow(visTgtY - robotY, 2)));\n\n // target bearing is based on angle formed between the X axis to the target range line\n // Always use \"Head minus Tail\" when working with vectors\n targetBearing = Math.toDegrees(Math.atan((visTgtY - robotY)/(visTgtX - robotX)));\n\n // Target relative bearing is the target Heading relative to the direction the robot is pointing.\n // This can be used as an error signal to have the robot point the target\n relativeBearing = targetBearing - robotBearing;\n // Display the current visible target name, robot info, target info, and required robot action.\n\n telemetry.addData(\"Robot\", \"[X]:[Y] (Heading) [%5.0fin]:[%5.0fin] (%4.0f°)\",\n robotX, robotY, robotBearing);\n telemetry.addData(\"Target\", \"[TgtRange] (TgtBearing):(RelB) [%5.0fin] (%4.0f°):(%4.0f°)\",\n targetRange, targetBearing, relativeBearing);\n }\n else {\n telemetry.addData(\"Visible Target\", \"none\");\n }\n }", "private void setCameraView() {\n double bottomBoundary = mUserPosition.getLatitude() - .1;\n double leftBoundary = mUserPosition.getLongitude() - .1;\n double topBoundary = mUserPosition.getLatitude() + .1;\n double rightBoundary = mUserPosition.getLongitude() + .1;\n\n mMapBoundary = new LatLngBounds(\n new LatLng(bottomBoundary, leftBoundary),\n new LatLng(topBoundary, rightBoundary)\n );\n\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(mMapBoundary, 500,500,1));\n }", "private void updatePos() {\n var ballBounds = ball.getMesh().getRelativeRectangleBounds().getBounds2D();\n var hookBallBounds = hook.getHookBall().getMesh().getRelativeRectangleBounds().getBounds2D();\n var ballCenter = new Vector2(ballBounds.getCenterX(), ballBounds.getCenterY());\n var hookBallCenter = new Vector2(hookBallBounds.getCenterX(), hookBallBounds.getCenterY());\n fullDirection = hookBallCenter.subtracted(ballCenter);\n var oposDir = ballCenter.subtracted(hookBallCenter).normalized();\n oposDir.multiplyBy(hookBallBounds.getWidth() / 2);\n hookBallCenter.add(oposDir);\n direction = hookBallCenter.subtracted(ballCenter);\n getTransform().setPosition(ballCenter);\n getTransform().setRotation(GeometryHelper.vectorToAngle(hookBallCenter.subtracted(ballCenter)));\n getTransform().translate(0, -GameSettings.ROPE_HEIGHT / 2 - 1);\n }", "protected void updateCameraPosition() {\n if (!mIsMapStatic && mMap != null && mMapConfiguration != null && mIsMapLoaded) {\n updateCameraPosition(mMapConfiguration.getCameraPosition());\n }\n }", "@Override\n public Vector getFacingVector() {\n double[] rotation = {Math.cos(this.rot), Math.sin(this.rot)};\n Vector v = new Vector(rotation);\n v = VectorUtil.direction(v);\n Vector w = VectorUtil.direction(this.getR());\n v.plus(w);\n return v;\n }", "private void setupCamera(GL gl) {\r\n\t\tgl.glMatrixMode(GL.GL_MODELVIEW);\r\n\t\t// If there's a rotation to make, do it before everything else\r\n\t\tgl.glLoadIdentity();\r\n if (rotationMatrix == null) {\r\n\t\t\trotationMatrix = new double[16];\r\n\t\t\tgl.glGetDoublev(GL.GL_MODELVIEW, rotationMatrix, 0);\r\n\t\t}\r\n\t\tif (nextRotationAxis != null) {\r\n\t\t\tgl.glRotated(nextRotationAngle, nextRotationAxis.x, nextRotationAxis.y, nextRotationAxis.z);\r\n\t\t\tnextRotationAngle = 0;\r\n\t\t\tnextRotationAxis = null;\r\n\t\t}\r\n\t\tgl.glMultMatrixd(rotationMatrix, 0);\r\n\t\tgl.glGetDoublev(GL.GL_MODELVIEW, rotationMatrix, 0);\r\n\t\t// Move the objects according to the camera (instead of moving the camera)\r\n\t\tif (zoom != 0) {\r\n\t\t\tdouble[] oldMatrix = new double[16];\r\n\t\t\tgl.glGetDoublev(GL.GL_MODELVIEW, oldMatrix, 0);\r\n\t\t\tgl.glLoadIdentity();\r\n\t\t\tgl.glTranslated(0, 0, zoom);\r\n\t\t\tgl.glMultMatrixd(oldMatrix, 0);\r\n\t\t}\r\n\t}", "public static void setCameraFrame() {\n\t\tCAMERA.src = VERTICES[CAMERA.v];\n\t\tVector zc = CAMERA.src.d.scale(-1).normalized();\n\t\tCAMERA.zAxis = zc;\n\t\tVector xc = MathUtils.cross(CAMERA.src.d, new Vector(0, 1, 0)).normalized();\n\t\tCAMERA.xAxis = xc;\n\t\tVector yc = MathUtils.cross(zc, xc).normalized();\n\t\tCAMERA.yAxis = yc;\n\t\t\n\t\tSystem.out.println(\"***** just set camera: \" + CAMERA.toString());\n\t}", "void getPosRelPoint(double px, double py, double pz, DVector3 result);", "void updateStepCoordiantes(){\n if(xIncreasing) {\n lat = lat + STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat + STEP_LENGTH*yCompMotion*degToMRatio;\n }\n else{\n lat = lat - STEP_LENGTH * yCompMotion * degToMRatio;\n displayLat = displayLat - STEP_LENGTH*yCompMotion*degToMRatio;\n }\n if(yIncreasing) {\n lon = lon + STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon + STEP_LENGTH*xCompMotion*degToMRatio;\n }\n else{\n lon = lon - STEP_LENGTH * xCompMotion * degToMRatio;\n dispalyLon= dispalyLon - STEP_LENGTH*xCompMotion*degToMRatio;\n }\n }", "private Point extractVectorFromAngle(int arg) {\n double theta = Math.toRadians( 2* (double)arg );\n double dx = Cell.move_dist * Math.cos(theta);\n double dy = Cell.move_dist * Math.sin(theta);\n return new Point(dx, dy);\n }", "public Camera(float loc[],float dir[]){\n this.loc=loc;\n this.dir=normalize(dir);\n }", "godot.wire.Wire.Vector2 getOrigin();", "public AlignByCamera (double motorRatio)\n\t{\n\t\trequires(Subsystems.transmission);\n\t\trequires(Subsystems.goalVision);\n\n\t\tthis.motorRatio = motorRatio;\n\t}", "public abstract Vector4fc rotateAbout(float angle, float x, float y, float z);", "public abstract Vec2 doorPosition();", "private int computeMoveCameraPadding() {\n \t\tPoint dim = this.getScreenDim();\n \t\tint min = Math.min( dim.x, dim.y );\n \t\treturn (int) (CAMERA_MOVE_BOUNDS_PADDING * min);\n \t}", "private synchronized void updatePose(Move event) {\n\t\tfloat angle = event.getAngleTurned() - angle0;\n\t\tfloat distance = event.getDistanceTraveled() - distance0;\n\t\tdouble dx = 0, dy = 0;\n\t\tdouble headingRad = (Math.toRadians(heading));\n\n\t\tif (event.getMoveType() == Move.MoveType.TRAVEL\n\t\t\t\t|| Math.abs(angle) < 0.2f) {\n\t\t\tdx = (distance) * (float) Math.cos(headingRad);\n\t\t\tdy = (distance) * (float) Math.sin(headingRad);\n\t\t} else if (event.getMoveType() == Move.MoveType.ARC) {\n\t\t\tdouble turnRad = Math.toRadians(angle);\n\t\t\tdouble radius = distance / turnRad;\n\t\t\tdy = radius\n\t\t\t\t\t* (Math.cos(headingRad) - Math.cos(headingRad + turnRad));\n\t\t\tdx = radius\n\t\t\t\t\t* (Math.sin(headingRad + turnRad) - Math.sin(headingRad));\n\t\t}\n\t\tx += dx;\n\t\ty += dy;\n\t\theading = normalize(heading + angle); // keep angle between -180 and 180\n\t\tangle0 = event.getAngleTurned();\n\t\tdistance0 = event.getDistanceTraveled();\n\t\tcurrent = !event.isMoving();\n\t}", "@Test\n\tpublic void testConstructor() {\n\t\tCamera camera=new Camera(new Point3D(0, 0, 0), new Vector(0, 1, 0), new Vector(0, 0, 1));\n\t\tassertEquals(0, camera.get_upVector().dotProduct(camera.get_toVector()),0 );\n\t\tassertEquals(0, camera.getRightVector().dotProduct(camera.get_toVector()),0 );\n\t\tassertEquals(0, camera.getRightVector().dotProduct(camera.get_upVector()),0 );\n\t}", "@Override\n\tpublic void moveCamera() {\n\n\t}", "@SuppressWarnings(\"unused\")\n private void getCameraPosition(final JSONArray args, final CallbackContext callbackContext) throws JSONException {\n CameraPosition camera = map.getCameraPosition();\n JSONObject json = new JSONObject();\n JSONObject latlng = new JSONObject();\n latlng.put(\"lat\", camera.target.latitude);\n latlng.put(\"lng\", camera.target.longitude);\n json.put(\"target\", latlng);\n json.put(\"zoom\", camera.zoom);\n json.put(\"tilt\", camera.tilt);\n json.put(\"bearing\", camera.bearing);\n json.put(\"hashCode\", camera.hashCode());\n \n callbackContext.success(json);\n }", "private static VectorD calculateScreenOffset(\n TransformationStorage playerPos\n ) {\n VectorD dim = new VectorD(Constants.GAME_WIDTH, Constants.GAME_HEIGHT);\n return dim\n .multiplicate(DIM_REDUCTION)\n .diff(\n Engine\n .get()\n .getGameState()\n .getCursorFollow()\n .multiplicate(MOUSE_POS_REDUCTION)\n )\n .diff(playerPos.getPosition());\n }", "public void updatePlayer() {\n if(this.hasCam) {\n this.camDir.set(cam.getDirection()).multLocal(0.3f);\n this.camLeft.set(cam.getLeft()).multLocal(0.2f);\n //initialize the walkDirection value so it can be recalculated\n walkDirection.set(0,0,0);\n if (this.left) {\n this.walkDirection.addLocal(this.camLeft);\n }\n if (this.right) {\n this.walkDirection.addLocal(this.camLeft.negate());\n }\n if (this.up) {\n this.walkDirection.addLocal(this.camDir);\n }\n if (this.down) {\n this.walkDirection.addLocal(this.camDir.negate());\n }\n this.mobControl.setWalkDirection(this.walkDirection);\n //player.get\n cam.setLocation(this.mobControl.getPhysicsLocation().add(0,1.5f,0));\n this.setRootPos(this.mobControl.getPhysicsLocation().add(0,-0.75f,0));\n this.setRootRot(this.camDir, this.camLeft);\n }\n // If the actor control does not have ownership of cam, do nothing\n }", "void turnToDir(float angle) { \n float radian = radians(angle);\n _rotVector.set(cos(radian), sin(radian));\n _rotVector.setMag(1);\n }", "public void strafeLeft(){\r\n\t\t//Following the camera:\r\n\t\tif(loc[1] > 1)\r\n\t\t{\r\n\t\t\tthis.loc[0] -= Math.sin(Math.toRadians(heading))*distance; \r\n\t\t\tthis.loc[2] -= Math.cos(Math.toRadians(heading))*distance;\r\n\t\t}\r\n\t}", "public Vector3f getOrigin() {\r\n\t\treturn new Vector3f(mOrigin);\r\n\t}" ]
[ "0.6698852", "0.6475992", "0.6407772", "0.6376467", "0.6323903", "0.62933636", "0.61445916", "0.5978607", "0.5963646", "0.5889375", "0.58871067", "0.5834587", "0.58342344", "0.5829995", "0.5812167", "0.57651687", "0.57181877", "0.57111377", "0.5650822", "0.5647328", "0.5607336", "0.5588541", "0.5582812", "0.5568869", "0.5513856", "0.54999584", "0.5495189", "0.54624337", "0.5450934", "0.538611", "0.53837806", "0.5363459", "0.53616273", "0.53567994", "0.53511465", "0.5318993", "0.5314374", "0.5310349", "0.5296346", "0.52894485", "0.52724904", "0.5265875", "0.5246128", "0.5245613", "0.5243973", "0.5231206", "0.5224672", "0.520767", "0.5200995", "0.5188439", "0.5186023", "0.51760507", "0.5156803", "0.51544327", "0.5152643", "0.5150449", "0.5141695", "0.51153415", "0.5096303", "0.5095074", "0.5080843", "0.50634944", "0.5028864", "0.50267", "0.50168085", "0.50161403", "0.5002621", "0.5000328", "0.49956125", "0.49954045", "0.49940944", "0.49918365", "0.49839967", "0.4980614", "0.49790296", "0.4975486", "0.4969952", "0.49645084", "0.49624404", "0.496116", "0.49601653", "0.49511483", "0.49505588", "0.4945395", "0.49394184", "0.49392316", "0.49335808", "0.49323368", "0.4928316", "0.49263906", "0.49260536", "0.49145338", "0.49103388", "0.49014333", "0.48807856", "0.48801783", "0.487113", "0.4865113", "0.4864259", "0.4862281" ]
0.660843
1
return the center point of the camera
public Vector3f getCenter() { return center; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Vector3f getCenterOfProjection() {\n\t\treturn mCenterOfProjection;\n\t}", "public final Vector getCenter() {\n\t\treturn (center == null) ? computeCenter() : center;\n\t}", "public Point getCenter() {\n \treturn new Point(x+width/2,y+height/2);\n }", "Point getCenter();", "Point getCenter();", "public Coord3d getCenter() {\n return new Coord3d((xmin + xmax) / 2, (ymin + ymax) / 2, (zmin + zmax) / 2);\n }", "public PointF getCenter() {\n return center;\n }", "public Vector3D getCenter() {\n return center;\n }", "public Point getCenter() {\n return new Point((int) getCenterX(), (int) getCenterY());\n }", "public Location3D getCenter() {\n\t\treturn new Location3D(world, lowPoint.getBlockX() + getXSize() / 2, lowPoint.getBlockY() + getYSize() / 2, lowPoint.getBlockZ() + getZSize() / 2);\n\t}", "public Vector2 getCenter() {\n\t\treturn new Vector2(position.x + size / 4f, position.y + size / 4f);\n\t}", "public final Point getCenterPointOnScreen() {\n\t\treturn Calculations.tileToScreen(getLocalRegionX(), getLocalRegionY(),\n\t\t\t\t0.5D, 0.5D, 0);\n\t}", "public Vector3f getSphereCenter() {\n\t\tfloat[] arr = getMinMax();\n\t\t\n\t\treturn new Vector3f((arr[0]+arr[1])/2,(arr[2]+arr[3])/2,(arr[4]+arr[5])/2);\n\t}", "public Point getCenter() {\r\n\t\treturn center;\r\n\t}", "public Point2D.Float getCenter() {\r\n\t\treturn center;\r\n\t}", "public Point getCenter() {\r\n return this.center;\r\n }", "public Point getCenter() {\n return center;\n }", "public Coords getCenter()\r\n {\r\n return new Coords(Math.round(x + width / 2), Math.round(y + height / 2));\r\n }", "public Point getCenter() {\n return location.center();\n }", "public final Point getCenterPointOnScreen() {\n return bot.getManagers().getCalculations().tileToScreen(localRegionX, localRegionY,\n 0.5D, 0.5D, 0);\n }", "public Coordinate getCenter() {\n return center;\n }", "public Vector2 getCenter() {\n return center;\n }", "PVector _getCenter() {\n PVector cen = new PVector(_hitboxCenter.x, _hitboxCenter.y);\n cen.rotate(_rotVector.heading() - _front);\n cen.x += _x;\n cen.y += _y;\n return cen;\n }", "public Location getCenter() {\n return new Location(location.getWorld(), (float) getRectangle().getCenterX(), (float) getRectangle().getCenterY());\n }", "public void centerCameraOn(GameObject thing) {\r\n\t\tthis.cameraX = (int)(thing.getX() - Game.WIDTH / 2);\r\n\t\tthis.cameraY = (int) (thing.getY() - Game.HEIGHT / 2);\r\n\t}", "public int getCenterX() {\n\t\t\treturn (int) origin.x + halfWidth;\n\t\t}", "public FPointType calculateCenter() {\n fRectBound = getBounds2D();\n FPointType fptCenter = new FPointType();\n fptCenter.x = fRectBound.x + fRectBound.width / 2.0f;\n fptCenter.y = fRectBound.y + fRectBound.height / 2.0f;\n calculate(fptCenter);\n \n rotateRadian = 0.0f;\n \n return fptCenter;\n }", "private Point2D getCenterLatLon(){\n Point2D.Double result = new Point2D.Double();\n Point2D.Double screenCenter = new Point2D.Double();\n screenCenter.x = getWidth()/2; //contentpane width/height\n screenCenter.y = getHeight()/2;\n try{\n transform.inverseTransform(screenCenter,result); //transform to lat/lon using the current transform\n } catch (NoninvertibleTransformException e) {\n throw new RuntimeException(e);\n }\n return result;\n }", "public Vec3d getCenter() {\n\t\treturn set;\n\t}", "public Vect3d getCenter (){\r\n Vect3d v = new Vect3d();\r\n v.x = (min.x + max.x) / 2;\r\n v.y = (min.y + max.y) / 2;\r\n v.z = (min.z + max.z) / 2;\r\n return v;\r\n }", "public LatLng getCenter() {\n return center;\n }", "final public Vector2 getCenter()\n\t{\n\t\treturn center;\n\t}", "public GJPoint2D center();", "public Point getCameraPosition() {\n\t\treturn new Point(cameraPosition.x, cameraPosition.y, cameraPosition.z);\n\t}", "public double getCenter() {\n return 0.5 * (lo + hi);\n }", "public double getCenterX() {\n\t\treturn centerX;\n\t}", "public Vector2 getCenter() {\n return new Vector2(rectangle.centerX(), rectangle.centerY());\n }", "public Point2D getCentre() {\n return new Point2D.Float(centreX, centreY);\n }", "public Point getCenterPx(){\n\t\tint centerX = images[0].getWidth()/2;\n\t\tint centerY = images[0].getHeight()/2;\n\t\tPoint centerPx = new Point(centerX,centerY);\n\t\treturn centerPx;\n\t}", "public Coord getCameraPosition() {\n if(internalNative == null) {\n if(internalLightweightCmp != null) {\n return internalLightweightCmp.getCenter();\n } \n // TODO: Browser component\n return new Coord(0, 0);\n }\n return new Coord(internalNative.getLatitude(), internalNative.getLongitude());\n }", "public double getCenterX()\n {\n return mainVBox.getTranslateX() + (mainVBox.getWidth() / 2);\n }", "public Vector3D getCentrePosition()\n\t{\n\t\treturn centrePosition;\n\t}", "public double getCenterX() { return centerX.get(); \t}", "public Point2D.Double GetCentrePoint() {\n \t\treturn new Point2D.Double(centrePoint.getX(), centrePoint.getY());\n \t}", "public int getCenter() {\n\t\t\treturn center;\n\t\t}", "public Point centeroid ()\r\n {\r\n return new Point ((v1.getX()+v2.getX()+v3.getX())/3,(v1.getY()+v2.getY()+v3.getY())/3);\r\n }", "public double[] getCenter() {\n return this.center;\n }", "private PointF getCenterOfCropRect() {\n return new PointF(\n cropRect.centerX(),\n cropRect.centerY());\n }", "public Point getCentrePoint()\n\t\t{\n\t\t\tif(shape.equals(\"circle\") || shape.equals(\"ellipse\"))\n\t\t\t\treturn new Point((int)((Ellipse2D)obj).getCenterX(),(int)((Ellipse2D)obj).getCenterY());\n\t\t\tif(shape.equals(\"poly\"))\n\t\t\t{\n\t\t\t\tint xtot = 0;\n\t\t\t\tint ytot = 0;\n\t\t\t\tfor(int i=0; i < coords.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif((i % 2) == 0)\n\t\t\t\t\t\txtot += coords[i];\n\t\t\t\t\telse\n\t\t\t\t\t\tytot += coords[i];\n\t\t\t\t}\n\t\t\t\treturn new Point((xtot*2)/coords.length,(ytot*2)/coords.length);\n\t\t\t}else\n\t\t\t{\n\t\t\t\treturn new Point((int)((Rectangle)obj).getCenterX(),(int)((Rectangle)obj).getCenterY());\n\t\t\t}\n\t\t}", "public Vector2f getCenter(Transform t) {\n\t\treturn new Vector2f(center.x * t.scale.x, center.y * t.scale.y).add(t.position);\n\t}", "public float getCenterX() {\n return cPosition.getX() + (float) cFishSizeX / 2;\n }", "public Point2D getGraphViewCenter() {\n \n \t\t// be explicit\n \t\treturn (graphViewCenterX != null && graphViewCenterY != null) ? new Point2D.Double(\n \t\t\t\tgraphViewCenterX.doubleValue(), graphViewCenterY.doubleValue())\n \t\t\t\t: null;\n \t}", "public float getCentreX() {\n return centreX;\n }", "public ViewPosition getCenterPosition() {\n\t\treturn null;\n\t}", "public static int getCenter() {\n\t\treturn Center;\n\t}", "public abstract Vector computeCenter();", "public Vec2 getCenter()\n {\n int numTriangles = numPoints - 2;\n\n // Calculate the average midpoint of each composite triangle\n Vec2 averageMidpoint = new Vec2(0, 0);\n float area = 0;\n for (int i=0; i<numTriangles; i++)\n {\n Triangle t = new Triangle(points[0], points[i+1], points[i+2]);\n Vec2 triangleMidpoint = t.getCenter();\n float triangleArea = t.getArea();\n\n averageMidpoint.addX(triangleMidpoint.getX() * triangleArea);\n averageMidpoint.addY(triangleMidpoint.getY() * triangleArea);\n\n area += triangleArea;\n\n// Color color;\n// if (i==0) color = Color.GREEN;\n// else color = Color.ORANGE;\n// SumoGame.ADD_DEBUG_DOT(points[0].getX(), points[0].getY(), 5, color);\n// SumoGame.ADD_DEBUG_DOT(points[i+1].getX(), points[i+1].getY(), 5, color);\n// SumoGame.ADD_DEBUG_DOT(points[i+2].getX(), points[i+2].getY(), 5, color);\n// SumoGame.ADD_DEBUG_DOT(triangleMidpoint.getX(), triangleMidpoint.getY(), triangleArea/2000, color);\n }\n\n averageMidpoint.div(area);\n\n// SumoGame.ADD_DEBUG_DOT(averageMidpoint.getX(), averageMidpoint.getY(), 20, Color.RED);\n\n return averageMidpoint;\n }", "public double getCenterX() {\n return this.getLayoutSlot().getX() + (int) (this.getLayoutSlot().getWidth() / 2);\n }", "public Point getCameraOffset() {\n Point offset = new Point(getPlayer().getCenterX() - screenWidthMiddle,\n getPlayer().getCenterY() - screenHeightMiddle);\n reboundCameraOffset(offset, EnumSet.of(Direction.LEFT, Direction.RIGHT));\n // we want to add these offsets to the player's x and y, so invert them\n offset.x = -offset.x;\n offset.y = -offset.y;\n return offset;\n }", "public final float exactCenterX() {\n return (left + right) * 0.5f;\n }", "public Point2D.Double getImageCenter();", "public SVector3d getPositionCam() {\n\t\treturn transCamera;\n\t}", "public Vector2 getCameraPosition()\n {\n\n Vector2 tmpVector = new Vector2(camera.position.x/camera.zoom - Gdx.graphics.getWidth()/2, camera.position.y/camera.zoom - Gdx.graphics.getHeight()/2);\n return tmpVector;\n }", "private int getMidPoint(int cordinate)\n {\n int mid_point = ((cordinate + Player.getWidth_of_box()) / 2);\n return mid_point;\n }", "public void center() {\n\t\tif(parent != null) {\n\t\t\tfloat parMidWidth = parent.getWidth() / 2f;\n\t\t\tfloat parMidHeight = parent.getHeight() / 2f;\n\t\t\tfloat midWidth = width / 2f;\n\t\t\tfloat midHeight = height / 2f;\n\t\t\t\n\t\t\tfloat newX = parent.getX() + (parMidWidth - midWidth);\n\t\t\tfloat newY = parent.getY() + (parMidHeight - midHeight);\n\t\t\t\n\t\t\tposition = new Vec2f(newX, newY);\n\t\t\tfindPosRatios();\n\t\t}\n\t}", "public ImageWorkSpacePt findCurrentCenterPoint() {\n WebPlot plot= getPrimaryPlot();\n\n\n int screenW= plot.getScreenWidth();\n int screenH= plot.getScreenHeight();\n int sw= getScrollWidth();\n int sh= getScrollHeight();\n int cX;\n int cY;\n if (screenW<sw) {\n cX= screenW/2;\n }\n else {\n int scrollX = getScrollX();\n cX= scrollX+sw/2- wcsMarginX;\n }\n\n if (screenH<sh) {\n cY= screenH/2;\n }\n else {\n int scrollY = getScrollY();\n cY= scrollY+sh/2- wcsMarginY;\n }\n\n ScreenPt pt= new ScreenPt(cX,cY);\n\n return plot.getImageWorkSpaceCoords(pt);\n }", "public final native LatLng getCenter() /*-{\n return this.getCenter();\n }-*/;", "public Point2D getLeftCenterPoint()\n {\n double x = mainVBox.getTranslateX();\n double y = mainVBox.getTranslateY() + (mainVBox.getHeight() / 2);\n return new Point2D(x, y);\n }", "public Vector3d getCurrentCollisionCenter() {\r\n return new Vector3d(collisionCenter.x + currentPosition.x, collisionCenter.y + currentPosition.y, collisionCenter.z + currentPosition.z);\r\n }", "public LatLng getCentrePos() {\n double lat = 0;\n double lon = 0;\n for (int i=0; i<newHazards.size(); i++) {\n lat += frags.get(i).getHazard().getLatitude();\n lon += frags.get(i).getHazard().getLongitude();\n }\n return new LatLng(lat / newHazards.size(), lon / newHazards.size());\n }", "public int getXCenter() {\n return getXOrigin() + panelWidth/2;\n }", "public int getCenterX(){\r\n return centerX;\r\n }", "public EastNorth getCenter() {\n\t\treturn null;\n\t}", "double[] circleCentre()\n\t{\n\t\tdouble toOriginLength = Math.sqrt(originX*originX + originY*originY);\n\t\tdouble toCentreLength = toOriginLength + radius;\n\t\t\n\t\tdouble[] centrePoint = new double[2];\n\t\t\n\t\tcentrePoint[0] = (toCentreLength * originX)/toOriginLength;\n\t\tcentrePoint[1] = (toCentreLength * originY)/toOriginLength;\n\t\t\n\t\treturn centrePoint;\n\t}", "public Point getCenterOfRotation() {\r\n\t\treturn centerOfRotation;\r\n\t}", "public Line2D.Double\ncenterAtMidPt()\n{\n\tPoint2D midPt = this.getMidPt();\n\treturn new Line2D.Double(\n\t\tgetX1() - midPt.getX(),\n\t\tgetY1() - midPt.getY(),\n\t\tgetX2() - midPt.getX(),\n\t\tgetY2() - midPt.getY());\n}", "public int centerX() {\n return mRect.centerX();\n }", "private double centerX() {\n return (piece.boundingBox().getWidth() % 2) / 2.0;\n }", "public Point2D getTopCenterPoint()\n {\n double x = mainVBox.getTranslateX() + (mainVBox.getWidth() / 2);\n double y = mainVBox.getTranslateY();\n return new Point2D(x, y);\n }", "public Point getLocation() {\r\n\t\treturn this.center;\r\n\t}", "private Point findCenter(MatOfPoint2f triangle) {\n\t\t// Find moments for the triangle.\n\t\tMoments moments = Imgproc.moments(triangle);\n\t\t\n\t\t// Create point and set x, and y positions.\n\t\tPoint center = new Point();\n\t\tcenter.x = moments.get_m10() / moments.get_m00();\n\t\tcenter.y = moments.get_m01() / moments.get_m00();\n\t\t\n\t\t// Return the found center point.\n\t\treturn center;\n\t}", "private Point findCenter(MatOfPoint2f triangle) {\n\t\t// Find moments for the triangle.\n\t\tMoments moments = Imgproc.moments(triangle);\n\t\t\n\t\t// Create point and set x, and y positions.\n\t\tPoint center = new Point();\n\t\tcenter.x = moments.get_m10() / moments.get_m00();\n\t\tcenter.y = moments.get_m01() / moments.get_m00();\n\t\t\n\t\t// Return the found center point.\n\t\treturn center;\n\t}", "public final int centerX() {\n return (left + right) >> 1;\n }", "@NotNull\n public Location<World> getCenterBlock() {\n int centerX = getMinChunk().getX() + 16;\n int centerZ = getMinChunk().getZ() + 16;\n return Tungsten.INSTANCE.getIslandWorld().getLocation(centerX * 16, 86, centerZ * 16);\n }", "public Vector2 getMousePosition() {\n\t\tif (camera == null)\n\t\t\treturn new Vector2(0,0);\n\t\tfloat mx = Program.mouse.getX(), my = Program.mouse.getY();\n\t\tfloat xPercent = mx/Program.DISPLAY_WIDTH, yPercent = my/Program.DISPLAY_HEIGHT;\n\t\tfloat x = camera.getX() + camera.getWidth() * xPercent,\n\t\t\t y = camera.getY() + camera.getHeight() * yPercent;\n\t\treturn new Vector2(x,y);\n\t}", "public Vector2D getArithmeticCenter()\n\t{\n\t\tif (size() == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tVector2D center = Vector2D.ZERO;\n\n\t\tfor (Unit unit : this)\n\t\t{\n\t\t\tcenter = center.add(Vector2DMath.toVector(unit.getPosition()));\n\t\t}\n\t\tcenter = center.scale(1.0f / size());\n\n\t\treturn center;\n\t}", "protected void calculateMinMaxCenterPoint() {\n\t\tfinal ImagePlus imp = c.getImage();\n\t\tfinal int w = imp.getWidth(), h = imp.getHeight();\n\t\tfinal int d = imp.getStackSize();\n\t\tfinal Calibration cal = imp.getCalibration();\n\t\tmin = new Point3d();\n\t\tmax = new Point3d();\n\t\tcenter = new Point3d();\n\t\tmin.x = w * (float) cal.pixelHeight;\n\t\tmin.y = h * (float) cal.pixelHeight;\n\t\tmin.z = d * (float) cal.pixelDepth;\n\t\tmax.x = 0;\n\t\tmax.y = 0;\n\t\tmax.z = 0;\n\n\t\tfloat vol = 0;\n\t\tfor (int zi = 0; zi < d; zi++) {\n\t\t\tfinal float z = zi * (float) cal.pixelDepth;\n\t\t\tfinal ImageProcessor ip = imp.getStack().getProcessor(zi + 1);\n\n\t\t\tfinal int wh = w * h;\n\t\t\tfor (int i = 0; i < wh; i++) {\n\t\t\t\tfinal float v = ip.getf(i);\n\t\t\t\tif (v == 0) continue;\n\t\t\t\tvol += v;\n\t\t\t\tfinal float x = (i % w) * (float) cal.pixelWidth;\n\t\t\t\tfinal float y = (i / w) * (float) cal.pixelHeight;\n\t\t\t\tif (x < min.x) min.x = x;\n\t\t\t\tif (y < min.y) min.y = y;\n\t\t\t\tif (z < min.z) min.z = z;\n\t\t\t\tif (x > max.x) max.x = x;\n\t\t\t\tif (y > max.y) max.y = y;\n\t\t\t\tif (z > max.z) max.z = z;\n\t\t\t\tcenter.x += v * x;\n\t\t\t\tcenter.y += v * y;\n\t\t\t\tcenter.z += v * z;\n\t\t\t}\n\t\t}\n\t\tcenter.x /= vol;\n\t\tcenter.y /= vol;\n\t\tcenter.z /= vol;\n\n\t\tvolume = (float) (vol * cal.pixelWidth * cal.pixelHeight * cal.pixelDepth);\n\n\t}", "public Location getCenterLocation() \n\t{\n\t\treturn factoryLocation;\n\t}", "public void centerOn(float x, float y) {\r\n\t\tposx_ = x - w() / 2;\r\n\t\tposy_ = y - h() / 2;\r\n\t}", "@Override\n\tpublic float getCenterOfRotationX() {\n\t\treturn 0.25f;\n\t}", "public Point2D centerOfMass() \n {\n double cx = 0, cy = 0;\n double area = areaUnsigned();\n double factor = 0;\n for (Line2D line : lines) \n {\n factor = line.getP1().getX() * line.getP2().getY() - line.getP2().getX() * line.getP1().getY();\n cx += (line.getP1().getX() + line.getP2().getX()) * factor;\n cy += (line.getP1().getY() + line.getP2().getY()) * factor;\n }\n area *= 6.0d;\n factor = 1 / area;\n cx *= factor;\n cy *= factor;\n return new Point2D.Double(cx, cy);\n }", "public Point getAbsPosition() {\n return Game.getMap().TFMapCoordinateToMapCenter(position);\n }", "private static PointF touchCenter(MotionEvent event) {\n return new PointF((event.getX(0) + event.getX(1)) / 2.0f,\n (event.getY(0) + event.getY(1)) / 2.0f);\n }", "public InhomogeneousPoint3D getSuggestedCenterValue() {\n return mSuggestedCenterValue;\n }", "public void centerCanvasAt(float x, float y)\n\t{\n\t\tcameraX = x;\n\t\tcameraY = y;\n\n\t\tupdateCurrentSheetCameraValues();\n\n\t\trenderer.updateMvpMatrix();\n\t\tloadAllVisibleChunks(true, true);\n\t\trequestRender();\n\t}", "public Position getMidPoint() {\n return midPoint;\n }", "private Point getCentreCoordinate(Point t)\n {\n \treturn new Point (t.x + Constants.cell_length /2f, t.y, t.z+Constants.cell_length/2f );\n }", "public int getXPos() {\r\n\t\treturn this.cameraX;\r\n\t}", "private int get_x() {\n return center_x;\n }", "public Vector getCentroid() {\n return centroid;\n }" ]
[ "0.7851578", "0.78493917", "0.7763106", "0.7727215", "0.7727215", "0.7653343", "0.76285905", "0.7605947", "0.75982404", "0.757711", "0.7540031", "0.7526155", "0.7503696", "0.74780774", "0.74614143", "0.74383736", "0.74275124", "0.73963463", "0.7384628", "0.73778063", "0.73475516", "0.7327733", "0.72699517", "0.7265648", "0.7246849", "0.72299767", "0.722905", "0.72175133", "0.7198633", "0.7176825", "0.71692514", "0.71586925", "0.7152393", "0.7092139", "0.7078142", "0.7054957", "0.7053883", "0.7053062", "0.70228416", "0.70030695", "0.69840974", "0.69755244", "0.6968369", "0.6958001", "0.6935562", "0.69229066", "0.6916675", "0.6903026", "0.6877792", "0.6870791", "0.6849847", "0.68490106", "0.6819816", "0.6790803", "0.6773628", "0.67621446", "0.67302936", "0.6728751", "0.6725318", "0.6707269", "0.6699101", "0.6685567", "0.6669943", "0.6659728", "0.66593874", "0.662056", "0.6613468", "0.66003174", "0.6594526", "0.6585222", "0.6582721", "0.65785986", "0.65677774", "0.65642625", "0.65631104", "0.6543035", "0.6518809", "0.64956033", "0.6464024", "0.6463973", "0.6425363", "0.6425363", "0.6361517", "0.631526", "0.6310104", "0.6277533", "0.6271654", "0.6235328", "0.6232024", "0.6220362", "0.6215543", "0.6206518", "0.618367", "0.6155153", "0.6136311", "0.61241555", "0.61233586", "0.6110507", "0.6107211", "0.61040914" ]
0.76215667
7
return the distance of this camera
public float getDistance() { return distance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getDistance() {\n\t\tfinal double h2 = 86.7;\n\t\t// h1: height of top of camera\n\t\tfinal double h1 = 17.6;\n\n\t\t// a1: angle of camera (relative to chasis)\n\t\tfinal double a1 = 36.175;\n\t\t// a2: angle of target relative to a1\n\t\tfinal double a2 = ty.getDouble(0.0);\n\n\t\t// distance: distance from camera to base of target\n\t\tfinal double distance = ((h2 - h1) / Math.tan(Math.toRadians(a1 + a2)));\n\n\t\tfinal double d = Math.sqrt(Math.pow(h2 - h1, 2) + Math.pow(distance, 2));\n\t\tSmartDashboard.putNumber(\"Py Distance\", d);\n\n\t\treturn (distance);\n\n\t}", "private double distance() {\n\t\tdouble dist = 0;\n\t\tdist = Math.sqrt(Math.abs((xOrigin - x) * (xOrigin - x) + (yOrigin - y) * (yOrigin - y)));\n\t\treturn dist;\n\t}", "public Vector3D getDistance()\n\t{\n\t\treturn distance;\n\t}", "public final float getDistance() {\n return distance;\n }", "public double getDistance() {\n\t\t// miles = miles/hr * s / (s/hr)\n\t\treturn (double)speed/10.0 * duration / 3600.0;\n\t}", "public double getDistance()\n {\n return Math.abs(getDifference());\n }", "public float getDistance();", "public float getDistance()\n {\n return distance_slider.getValue() / DISTANCE_SCALE_FACTOR;\n }", "public double getDistance(){\n\t\treturn this.distance;\n\t}", "public double getDistance(){\r\n\t\treturn Math.sqrt(\r\n\t\t\t\t(\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t\t, 2 )\r\n\t )\r\n\t\t\t\t+ (\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterY()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterY()\r\n\t\t\t\t\t, 2 )\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}", "public float getDistance() {\n shouldUpdateDistance = true;\n if (shouldUpdateDistance) {\n distance = getDistance(createSuggestedWindowFilter());\n shouldUpdateDistance = false;\n }\n return distance;\n }", "public double getDistance() {\n\t\treturn distance;\n\t}", "public double getDistance() {\n\t\treturn distance;\n\t}", "public float getDistance() {\n return distance;\n }", "public void getDistance() {\n projDistance = 2 * sin(toRadians(launchAngle)) * getVelocity() / 9.8 * cos(toRadians(launchAngle)) * getVelocity();\n }", "public double distance() {\n return distance;\n }", "public double distance() {\n return distance;\n }", "public float getDistance() {\n return distance;\n }", "public double getDistance() {\r\n return this.distance;\r\n }", "public double getDistanceToTarget() {\n if (!Config.isVisionInstalled) {\n return 0;\n }\n double distanceToVisionTarget =\n Config.visionDistanceConstant * (Config.fieldVisionTargetHeight-Config.limelightMountingHeight) /\n Math.tan(Math.toRadians(limelight.getTy() + Config.limelightMountingAngle));\n\n //now we can convert the new values into a new distance\n return distanceToVisionTarget;\n }", "public double getDistance() {\n return distance;\n }", "public double getDistance() {\n return this.distance;\n }", "public double getDist() {\n return distance;\n }", "public float getDistance(){\n\t\t\treturn s1.start.supportFinal.dot(normal);\n\t\t}", "public Long calculateDistanceVision() {\n return this.getVision() + lazyPlayboardActor.get().getCarte().getCarte().getValue(this.point).getVisionAdvantage();\n }", "public float getDistanceFromBirth() {\n double dx = location.x - birthLocation.x;\n double dy = location.y - birthLocation.y;\n return (float) Math.sqrt(dx * dx + dy * dy);\n }", "public double getDistance() { \n\t\treturn Math.pow(input.getAverageVoltage(), exp) * mul; \n\t}", "public double distance() {\n \tif (dist == -1) {\n \t\tdist = distance(vertex1, vertex2);\n \t}\n \n \treturn dist;\n }", "double getDistance();", "public int getDistance() {\r\n\t\treturn distance;\r\n\t}", "public int getDistance() {\r\n\t\treturn distance;\r\n\t}", "public float getTheDistance(){\n\t\t\n\t\tdistance = sonic.getDistance();\n\t\tSystem.out.println(\"value:\"+ distance);\n\t\t//considering the test results we see after 23 cm we see the +1cm precision and below 23cm we see + 5cm range \n\t\tif (distance<=25){\n\t\treturn (distance-7);\n\t\t}\n\t\telse{return (distance-3);}\n\t}", "public int distance() {\n return distance;\n }", "public Dimension2D getDistance() {\n\t\treturn distance;\n\t}", "public int getDistance() {\n\t\treturn distance;\n\t}", "public double getDistance () {\n return distance;\n }", "public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }", "public double distance(){\n return DistanceTraveled;\n }", "@Override\r\n public double getOriginDistance()\r\n {\r\n double distance=Math.sqrt(\r\n Math.pow(origin.getYCoordinate(), 2)+Math.pow(origin.getYCoordinate(), 2));\r\n return distance;\r\n }", "public int getDistance() {\n return distance;\n }", "public int getDistance() {\n return distance;\n }", "private float getDistance(SXRNode object)\n {\n float x = object.getTransform().getPositionX();\n float y = object.getTransform().getPositionY();\n float z = object.getTransform().getPositionZ();\n return (float) Math.sqrt(x * x + y * y + z * z);\n }", "double getDistanceInMiles();", "public double getDist(){\n double dist=0;\n double DA = 0;\n double minDist = this.getMotors()[0].getTargetPosition();\n for(int i =0;i<this.getMotors().length;i++) {\n double current = this.getMotors()[i].getCurrentPosition();\n double target = this.getMotors()[i].getTargetPosition();\n DA = Math.abs(target) - Math.abs(current);\n dist = target - current;\n if(Math.abs(DA)<Math.abs(minDist)){\n minDist = dist;\n }\n }\n return (minDist);\n }", "public double ComputeDistance(){ \n\t\tdouble lat1 = this.depAirportCity.getLatDegs() + (double)(this.depAirportCity.getLatMins())/60; \n\t\tdouble lon1 = this.depAirportCity.getLongDegs() + (double)(this.depAirportCity.getLongMins())/60;\n\t\tdouble lat2 = this.arrAirportCity.getLatDegs() + (double)(this.arrAirportCity.getLatMins())/60; \n\t\tdouble lon2 = this.arrAirportCity.getLongDegs() + (double)(this.arrAirportCity.getLongMins())/60;\n\t\t\n\t\tdouble distance = Haversine.getMiles(lat1, lon1, lat2, lon2);\n\t\treturn distance;\n\t}", "public Distance getDistance() {\n return distance;\n }", "public double getDistance() {\n\n final int R = 6371; // Radius of the earth\n double lat1 = latitude;\n double lon1 = longitude;\n double lat2 = 41.917715; //lat2, lon2 is location of St.Charles, IL\n double lon2 = -88.266027;\n double el1=0,el2 = 0;\n double latDistance = Math.toRadians(lat2 - lat1);\n double lonDistance = Math.toRadians(lon2 - lon1);\n double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2))\n * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double distance = R * c * 1000; // convert to meters\n\n double height = el1 - el2;\n\n distance = Math.pow(distance, 2) + Math.pow(height, 2);\n\n return Math.sqrt(distance);\n }", "double distance (double px, double py);", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "public float distanceToMouse() { \n PVector temp = new PVector(p.mouseX, p.mouseY);\n return pos.dist(temp);\n }", "public double getDistance(Player player) {\n\t\tdouble distanceFromPlayer1Perspective = player2.xPosition() - player1.xPosition();\n\t\tdouble distanceFromPlayer2Perspective = player1.xPosition() - player2.xPosition();\n\t\treturn player.equals(player1) ? distanceFromPlayer1Perspective : distanceFromPlayer2Perspective;\n\t}", "public int getTotalDistance() {\n return totalDistance;\n }", "public double getDistanceFromSource()\n {\n return distanceFromSource;\n }", "public double getDistanceTotale() {\n\t\treturn distanceTotale;\n\t}", "public double calcDistance(Planet p){\n\t\treturn(Math.sqrt((this.xxPos-p.xxPos)*(this.xxPos-p.xxPos)\n\t\t\t+(this.yyPos-p.yyPos)*(this.yyPos-p.yyPos)));\n\t}", "public int drivenDistance() {\n return (int) Math.round(rightMotor.getTachoCount() / DISTANCE_RATIO);\n }", "public double getDragDistanceFromCursorPressedEvent() {\r\n\t\tif ((this.lastChangedEvent != null) && (this.lastPressedEvent != null)) {\r\n\t\t\treturn lastChangedEvent.getPosition().distance(\r\n\t\t\t\t\tlastPressedEvent.getPosition());\r\n\t\t}\r\n\r\n\t\treturn Double.NaN;\r\n\t}", "public void calcDistance() {\n if (DataManager.INSTANCE.getLocation() != null && location.getLength() == 2) {\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n double dLat = Math.toRadians(location.getLatitude() - DataManager.INSTANCE.getLocation().getLatitude()); // deg2rad below\n double dLon = Math.toRadians(location.getLongitude() - DataManager.INSTANCE.getLocation().getLongitude());\n double a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(Math.toRadians(location.getLatitude()))\n * Math.cos(Math.toRadians(location.getLatitude()))\n * Math.sin(dLon / 2)\n * Math.sin(dLon / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double d = KM_IN_RADIUS * c; // Distance in km\n distance = (float) d;\n } else distance = null;\n }", "public int getDistance(){\n if (distance == 0) {\n int tourDistance = 0;\n // Loop through our tour's cities\n for (int cityIndex=0; cityIndex < tourSize(); cityIndex++) {\n // Get city we're travelling from\n City fromCity = getCity(cityIndex);\n // City we're travelling to\n City destinationCity;\n // Check we're not on our tour's last city, if we are set our \n // tour's final destination city to our starting city\n if(cityIndex+1 < tourSize()){\n destinationCity = getCity(cityIndex+1);\n }\n else{\n destinationCity = getCity(0);\n }\n // Get the distance between the two cities\n tourDistance += fromCity.distanceTo(destinationCity);\n }\n distance = tourDistance;\n }\n return distance;\n }", "@Override\n\tpublic int getDistanceFrom(final SabrePlayer other) {\n\t\tGuard.ArgumentNotNull(other, \"other\");\n\t\t\n\t\tif (!isOnline() || !other.isOnline()) {\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tLocation myLocation = bukkitPlayer.getLocation();\n\t\tLocation otherLocation = other.getBukkitPlayer().getLocation();\n\t\tint dx = otherLocation.getBlockX() - myLocation.getBlockX();\n\t\tint dz = otherLocation.getBlockZ() - myLocation.getBlockZ();\n\t\t\n\t\treturn (int)Math.sqrt(Math.pow(dx, 2) + Math.pow(dz, 2));\n\t}", "public int getClientViewDistance ( ) {\n\t\treturn extract ( handle -> getClientViewDistance ( ) );\n\t}", "public double distance(Point other) {\n\n // Define delta-X and delta-Y.\n double deltaX = this.x - other.x;\n double deltaY = this.y - other.y;\n\n // Calculate distance and return.\n return Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n }", "public double getDistance(Point3D point){\n return _position.distance(point);\n }", "public float getViewDistance() { return viewDistance; }", "public double calcDistance(Planet p){\n\t\tdouble dx = p.xxPos - this.xxPos;\n\t\tdouble dy = p.yyPos - this.yyPos ;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\n\t}", "public double getRadius() {\n return getCenter().distance(new Coord3d(xmin, ymin, zmin));\n }", "public float Distance(Vector to){\n return Math.abs(Substract(this,to,new Vector(to.axis.length)).Magnitude());\n }", "public float distance(Vector3 other){\r\n\t\treturn (float)Math.sqrt(Math.pow(this.x-other.x,2) + Math.pow(this.y-other.y,2) + Math.pow(this.z-other.z,2));\r\n\t}", "public double calcDistance(Planet p){\n\t\t\tdouble dx = this.xxPos - p.xxPos;\n\t\t\tdouble dy = this.yyPos - p.yyPos;\n\t\treturn Math.sqrt(dx*dx + dy*dy);\n\t}", "public double calcDistance(Planet p){\n\t\tdouble dx=-(xxPos-p.xxPos);\n\t\tdouble dy=-(yyPos-p.yyPos);\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}", "public double distancia(Pixel pixel) {\r\n\t\tdouble distX = this.xDouble - pixel.xDouble;\r\n\t\tdouble distY = this.yDouble - pixel.yDouble;\r\n\t\tdouble val = distX * distX + distY * distY;\r\n\t\tif (val != 0)\r\n\t\t\treturn Math.sqrt(val);\r\n\t\treturn 0;\r\n\t}", "public double distance(double x, double y);", "public double distance(AndroidDoveFlockModel otherDove)\n {\n return (Math.sqrt(Math.pow(otherDove.getX()-getX(),2) +\n Math.pow(otherDove.getY()-getY(),2)));\n }", "public double distanceTo(MC_Location loc)\n\t {\n\t\t // If dimensions are different, instead of throwing an exception just treat different dimensions as 'very far away'\n\t\t if(loc.dimension != dimension) return Double.MAX_VALUE/2; // don't need full max value so reducing so no basic caller wrap-around.\n\t\t \n\t\t // Pythagoras...\n\t\t double dx = x - loc.x;\n\t\t double dy = y - loc.y;\n\t\t double dz = z - loc.z;\n\t\t return Math.sqrt(dx*dx + dy*dy + dz*dz);\n\t }", "public double calculateDistance(LatLng other) {\n return Math.sqrt( (this.x - other.x) * (this.x - other.x) + (this.y - other.y) * (this.y - other.y) );\n }", "public int getTotDistance(){\r\n\t \treturn this.totDistance;\r\n\t }", "public double calDistance()\n {\n double closest = poly[0].getD();\n\n for(int i = 1; i < sides; i++)\n {\n if(closest > poly[i].getD())\n {\n closest = poly[i].getD();\n }\n }\n this.distance = closest;\n\n return closest;\n }", "public float getMagnitude() {\n return (float) Math.sqrt(Math.pow(latComponent, 2) + Math.pow(longComponent, 2));\n }", "public void recalculateCamDist(Camera camera)\n\t{\n\t\tthis.camDist = Vector3f.sub(camera.getPosition(), getPosition(), null).lengthSquared();\n\t}", "public double calcDistance(Planet p){\n double sq_dis = (xxPos - p.xxPos) * (xxPos - p.xxPos) + (yyPos - p.yyPos) * (yyPos - p.yyPos);\n double distance = Math.sqrt(sq_dis);\n return distance;\n }", "public double getDistanceMoyenne() {\n\t\treturn getDistanceTotale () / 12;\n\t}", "public float getDist() {\n return JniConstraintType.pinJointGetDist(nativeAddress);\n }", "public double distance(Point other) {\r\n double dx = this.x - other.getX();\r\n double dy = this.y - other.getY();\r\n return Math.sqrt((dx * dx) + (dy * dy));\r\n }", "public final double getDistanceSquared() {\n\t\tdouble sum = 0;\n\t\tfor (int i = 0; i < position.length; i++)\n\t\t\tsum += position[i] * position[i] * calibration[i] * calibration[i];\n\t\treturn sum;\n\t}", "public double calcDistance (Planet pIn){\n\t\tdouble dis;\n\t\tdouble dx = xxPos - pIn.xxPos;\n\t\tdouble dy = yyPos - pIn.yyPos;\n\t\tdis = Math.sqrt(dx*dx + dy*dy);\n\t\treturn dis;\n\t}", "public double distance(Point other) {\n return Math.sqrt(((this.x - other.getX()) * (this.x - other.getX()))\n + ((this.y - other.getY()) * (this.y - other.getY())));\n }", "double distanceTo(Point2D that) {\r\n double dx = this.x - that.x;\r\n double dy = this.y - that.y;\r\n return Math.sqrt(dx*dx + dy*dy);\r\n }", "public double getPredictedDistance() {\r\n return predictedDistance;\r\n }", "public static double getDistance(CUELocation camera, CUELocation point) {\n //mean earth radius\n int earthRadius = 6371000;\n double diffLat = camera.getLatitudeRadians()-point.getLatitudeRadians();\n double diffLng = camera.getLongitudeRadians()-point.getLongitudeRadians();\n\n double a = Math.sin(diffLat/2) * Math.sin(diffLat/2) +\n Math.cos(camera.getLatitudeRadians()) * Math.cos(point.getLatitudeRadians()) *\n Math.sin(diffLng/2) * Math.sin(diffLng/2);\n\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1.0-a));\n\n return earthRadius*c;\n }", "private float distanceTo(BasicEvent event) {\n final float dx = event.x - location.x;\n final float dy = event.y - location.y;\n// return Math.abs(dx)+Math.abs(dy);\n return distanceMetric(dx, dy);\n// dx*=dx;\n// dy*=dy;\n// float distance=(float)Math.sqrt(dx+dy);\n// return distance;\n }", "public double distance(Point b){\n return Math.sqrt((b.x-this.x)*(b.x-this.x) + (b.y-this.y)*(b.y-this.y));\n }", "public double distance(Point other) {\n double newX = this.x - other.getX();\n double newY = this.y - other.getY();\n return Math.sqrt((newX * newX) + (newY * newY));\n }", "public float distanceTo(YUV yuv){\n//\t\treturn (float)Math.sqrt((u-yuv.u)*(u-yuv.u) + (v-yuv.v)*(v-yuv.v));\n\t\treturn (float)Math.sqrt((u-yuv.u)*(u-yuv.u) + (v-yuv.v)*(v-yuv.v) + (y-yuv.y)*(y-yuv.y));\n\t}", "public double calcDistance(final Move otherPoint) {\r\n \r\n final double x = this.currentMove.getX();\r\n final double y = this.currentMove.getY();\r\n \r\n final double x2 = otherPoint.getX();\r\n final double y2 = otherPoint.getY();\r\n \r\n final double distx = Math.abs(x2 - x);\r\n final double disty = Math.abs(y2 - y);\r\n \r\n return Math.sqrt((distx * distx) + (disty * disty));\r\n }", "public double distance(Point p){\n\t\treturn (this.minus(p)).magnitude(); //creates a vector between the two points and measures its magnitude\n\t}", "public double getOffset(){\n\t\tdouble percentHeight = networkTableValues.get(\"height\")/cameraHeightPixel;\n\t\t//Get the height of the frame in inches\n\t\tdouble cameraHeightInches = networkTableValues.get(\"height\")/percentHeight;\n\t\t//Get the width of the frame in inches\n\t\tdouble cameraWidthInches = cameraHeightInches*(cameraWidthPixel/cameraHeightPixel);\n\t\t//Get the distanceFromTower from the camera to the goal\n\t\tdistanceFromTower = (cameraWidthInches/2)/Math.tan(cameraFOV*(Math.PI/180));\n\t\t//Get the distanceFromTower from the camera to the base of the tower\n\t\tdouble horizontalDistance = Math.sqrt(Math.pow(distanceFromTower, 2) - Math.pow(towerHeight, 2));\n\t\t//Get offset in inches\n\t\tdouble distanceFromCenterInches = (networkTableValues.get(\"centerX\") / cameraWidthPixel)*cameraWidthInches;\n\t\tdouble offset = Math.atan((distanceFromCenterInches/distanceFromTower)*(180/Math.PI));\n\t\t\n\t\tSystem.out.println(\"OFFSET: \" + offset);\n\t\treturn offset;\n\t}", "public void calculateDistance() {\n SensorEventListener mSensorEventListener = new SensorEventListener() {\n @Override\n public void onSensorChanged(SensorEvent sensorEvent) {\n mAngle = (Math.acos(sensorEvent.values[2] / 9.8)) * (180/Math.PI) - 5;\n mAngle = Math.toRadians(mAngle);\n mDistance = mHeight * Math.tan(mAngle);\n }\n\n @Override\n public void onAccuracyChanged(Sensor sensor, int i) {\n\n }\n };\n mSensorManager.registerListener(mSensorEventListener, mAccelerometer,\n SensorManager.SENSOR_DELAY_UI);\n\n // Calculating the distance.\n mDistance = mHeight * Math.tan(mAngle);\n // Rounding it up to 2 decimal places\n DecimalFormat df = new DecimalFormat(\"#.##\");\n mDistance = Double.valueOf(df.format(mDistance));\n String distanceString = Double.toString(mDistance);\n\n // Update the distance TextView\n TextView distanceView = (TextView) findViewById(R.id.distanceText);\n String text = distanceString + \" cm\";\n distanceView.setText(text);\n distanceView.setTextSize(36);\n }", "protected float getDistance(float distance) {\r\n\t\treturn distance * parent.pixelsPerUnit;\r\n\t}", "@JsProperty(name = \"surfaceDistance\")\n public native double surfaceDistance();", "public double mag()\n {\n return (Math.sqrt(this.x*this.x + this.y*this.y));\n }" ]
[ "0.79712796", "0.7579387", "0.7420422", "0.73125124", "0.72638965", "0.7251535", "0.72276175", "0.7204808", "0.71896774", "0.71695936", "0.71418834", "0.71367157", "0.71367157", "0.7119741", "0.7114464", "0.7083866", "0.7083866", "0.7059785", "0.7046333", "0.70404696", "0.7008809", "0.7007079", "0.6931562", "0.69195604", "0.68954915", "0.68932074", "0.68874484", "0.6882711", "0.6880969", "0.6859071", "0.6859071", "0.6853004", "0.68250376", "0.6824172", "0.6820058", "0.6796641", "0.67961735", "0.6789811", "0.6747184", "0.6733331", "0.6733331", "0.6710183", "0.66668165", "0.660719", "0.6590612", "0.65718853", "0.65410393", "0.6534689", "0.65133584", "0.65125084", "0.6473862", "0.64379674", "0.6394426", "0.6388263", "0.6330223", "0.6266849", "0.62595284", "0.62535596", "0.6250221", "0.6230469", "0.62290907", "0.62255245", "0.6222122", "0.6219273", "0.6211641", "0.6196261", "0.61960745", "0.6196022", "0.618877", "0.6180679", "0.6175127", "0.61665195", "0.6166025", "0.6165238", "0.6162161", "0.61484253", "0.6118196", "0.60992604", "0.6060435", "0.6037498", "0.6016117", "0.6004048", "0.60018873", "0.6001801", "0.599889", "0.5994397", "0.5993765", "0.59832704", "0.5965768", "0.5959629", "0.5944305", "0.59442765", "0.5933981", "0.59334666", "0.59287643", "0.59287536", "0.5925537", "0.59233594", "0.5913728", "0.59052575" ]
0.71325815
13
get the percentage how far the camera is zoomed out
public float getPercentZoom() { return percentZoom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calculateBasicRatio() {\n if (mLastZoomRatio == DEFAULT_VALUE) {\n if(isAngleCamera()){\n mBasicZoomRatio = 1.6f;\n }else{\n mBasicZoomRatio = ZOOM_UNSUPPORTED_DEFAULT_VALUE;\n }\n } else {\n mBasicZoomRatio = mLastZoomRatio;\n }\n //modify by bv liangchangwei for fixbug 3518\n }", "int getMinZoom();", "public float getCurrentRatio(){\n return mCurZoomRatio;\n }", "public double getCameraZoom() {\n\t\treturn cameraZoom;\n\t}", "int getMaximumZoomlevel();", "public float getCurZoomRatio(){\n if(mCurZoomRatio<1.0f){\n mCurZoomRatio = ZOOM_UNSUPPORTED_DEFAULT_VALUE;\n }\n return mCurZoomRatio;\n }", "int getZoomPref();", "public float getZoom() {\n if(internalNative != null) {\n return internalNative.getZoom();\n } else {\n if(internalLightweightCmp != null) {\n return internalLightweightCmp.getZoomLevel();\n }\n // TODO: Browser component\n return 7;\n } \n }", "public double getFacteurZoom()\n\t{\n \treturn facteurZoom;\n }", "private double resolution(int zoom) {\n\t\treturn this.initialResolution / (Math.pow(2, zoom));\r\n\t}", "public synchronized float getZoom()\r\n {\r\n return zoom;\r\n }", "public int getZoom() {\n return P_SCALE;\n }", "public double getZoomFactor()\r\n {\r\n return zoomFactor;\r\n }", "@Override\n public String getZoomLevel(){\n if(mAppUi.isZoomSwitchSupport() && isAngleCamera()){\n return String.format(Locale.ENGLISH, PATTERN, getAngleRatio(mLastZoomRatio));\n }\n //add by huangfei for zoom switch end\n\n return String.valueOf(mLastZoomRatio == DEFAULT_VALUE\n ? \"1.0\" : String.format(Locale.ENGLISH, PATTERN, mLastZoomRatio));\n }", "public int zoom() {\n double sizex = scale * getWidth();\n double sizey = scale * getHeight();\n for (int zoom = 0; zoom <= 32; zoom++, sizex *= 2, sizey *= 2)\n if (sizex > world.east() || sizey > world.north())\n return zoom;\n return 32;\n }", "private int getScale(){\n Display display = ((WindowManager) Objects.requireNonNull(getContext())\n .getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();\n\n int width = display.getWidth();\n Double val = (double) width / 360d;\n val = val * 100d;\n return val.intValue();\n }", "public void updateZoom() {\n camera.zoom = zoomLevel;\n }", "public float getMeasuredSizeCorrectedByPerspective() {\n float scale = getPerspectiveScaleFactor(location);\n if (scale <= 0) {\n return averageEventDistance;\n }\n return averageEventDistance / scale;\n }", "public double getZoom() {\n return curZoom;\n }", "public long getZoomLevel()\r\n {\r\n return myZoomLevel;\r\n }", "private void adjustCameraPosition() {\n if (upward) {\n\n if (tilt<90) {\n tilt ++;\n zoom-=0.01f;\n } else {\n upward=false;\n }\n\n } else {\n if (tilt>0) {\n tilt --;\n zoom+=0.01f;\n } else {\n upward=true;\n }\n }\n }", "public double getZoom() {\n return mZoom;\n }", "public int getZoomLevel() {\r\n\t\tif ( getOutput() == null ) { return 0; }\r\n\t\tDouble dataZoom = getOutput().getData().getZoomLevel();\r\n\t\tif ( dataZoom == null ) {\r\n\t\t\treturn 1;\r\n\t\t} else {\r\n\t\t\treturn (int) (dataZoom * 100);\r\n\t\t}\r\n\t}", "protected float getMotionFactor() {\n\t\treturn super.getMotionFactor();\n\t}", "public double getZoom() {\n return this.zoom;\n }", "public int getMaxZoom() {\n if(internalNative == null) {\n if(internalLightweightCmp != null) {\n return internalLightweightCmp.getMaxZoomLevel();\n } else {\n // TODO: Browser component\n return 20;\n }\n }\n return internalNative.getMaxZoom();\n }", "public float getZoom() {\n return zoom;\n }", "public float getZoom() {\n return zoom;\n }", "public float getPan() { return pan; }", "public double getWidthInDeg();", "public float getViewportRatio() {\n\t\treturn viewportRatio;\n\t}", "private double normaliseViewingTime() {\n return this.averageViewingTime / (double) this.content.getViewLength();\n }", "public double getResolution() {\n return resolution;\n }", "@Override\n public void onCameraChange(CameraPosition cameraPosition) {\n if (cameraPosition.zoom >= MINIMUM_ZOOM_LEVEL_FOR_DATA) {\n refreshVisibleNDBCStations();\n } else {\n Toast.makeText(getActivity().getApplicationContext(),\n R.string.divesite_map_zoom_view_data,\n Toast.LENGTH_SHORT).show();\n }\n }", "public double getZoom() {\n\treturn zoom;\n}", "public int getAbsWidthViewport() {\n return Math.abs((int)(0.5 + widthViewport));\n }", "public double getAspect ()\r\n {\r\n return (double) getLength() / (double) getThickness();\r\n }", "public void zoomToBounds(double ulLon, double ulLat, double lrLon, double lrLat)\n/* 116: */ {\n/* 117:182 */ int x_min = 2147483647;\n/* 118:183 */ int y_min = 2147483647;\n/* 119:184 */ int x_max = -2147483648;\n/* 120:185 */ int y_max = -2147483648;\n/* 121:186 */ int mapZoomMax = 20;\n/* 122: */\n/* 123:188 */ x_max = Math.max(x_max, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 124:189 */ x_max = Math.max(x_max, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 125:190 */ y_max = Math.max(y_max, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 126:191 */ y_max = Math.max(y_max, MercatorProj.LatToY(lrLat, mapZoomMax));\n/* 127:192 */ x_min = Math.min(x_min, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 128:193 */ x_min = Math.min(x_min, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 129:194 */ y_min = Math.min(y_min, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 130:195 */ y_min = Math.min(y_min, MercatorProj.LatToY(lrLat, mapZoomMax));\n/* 131: */\n/* 132: */\n/* 133: */\n/* 134:199 */ int height = Math.max(0, this.mapPanel.getHeight());\n/* 135:200 */ int width = Math.max(0, this.mapPanel.getWidth());\n/* 136:201 */ int newZoom = mapZoomMax;\n/* 137:202 */ int x = x_max - x_min;\n/* 138:203 */ int y = y_max - y_min;\n/* 139:204 */ while ((x > width) || (y > height))\n/* 140: */ {\n/* 141:205 */ newZoom--;\n/* 142:206 */ x >>= 1;\n/* 143:207 */ y >>= 1;\n/* 144: */ }\n/* 145:209 */ x = x_min + (x_max - x_min) / 2;\n/* 146:210 */ y = y_min + (y_max - y_min) / 2;\n/* 147:211 */ int z = 1 << mapZoomMax - newZoom;\n/* 148:212 */ x /= z;\n/* 149:213 */ y /= z;\n/* 150:214 */ this.mapPanel.setZoom(new Point(x, y), newZoom);\n/* 151: */ }", "public Double getGraphViewZoomLevel() {\n \n \t\t// lets be explicit\n \t\treturn (graphViewZoom != null) ? graphViewZoom : null;\n \t}", "@JavascriptInterface\n public int getZoom() {\n return this.mWebViewFragment.getMapSettings()\n .getZoom();\n }", "public int getMinZoom() {\n if(internalNative == null) {\n if(internalLightweightCmp != null) {\n return internalLightweightCmp.getMinZoomLevel();\n } else {\n // TODO: Browser component\n return 1;\n }\n }\n return internalNative.getMinZoom();\n }", "int getVerticalResolution();", "public void zoomToAreaOfInterest() {\n Envelope aoe = context.getViewport().getBounds();\n if (aoe.getWidth() == 0) {\n aoe.expandBy(.001, 0);\n }\n\n if (aoe.getHeight() == 0) {\n aoe.expandBy(0, .001);\n }\n Rectangle2D rect = new Rectangle2D.Double(aoe.getMinX(), aoe.getMinY(),\n aoe.getWidth(), aoe.getHeight());\n getCamera().animateViewToCenterBounds(rect, true, 0);\n }", "@Override\n public void onCameraIdle() {\n double CameraLat = GMap.getCameraPosition().target.latitude;\n double CameraLong = GMap.getCameraPosition().target.longitude;\n if (CameraLat <= 13.647080 || CameraLat >= 13.655056) {\n GMap.animateCamera(CameraUpdateFactory.newLatLng(mapbounds.getCenter()));\n }\n if (CameraLong <= 100.490774 || CameraLong >= 100.497254) {\n GMap.animateCamera(CameraUpdateFactory.newLatLng(mapbounds.getCenter()));\n }\n\n }", "public Integer getMaxzoom() {\n return maxzoom;\n }", "public double getZoomY(double aspectQuotient) {\n return Math.min(mZoom, mZoom / aspectQuotient);\n }", "private float getRoughPixelSize() {\n\n\t\tfloat size = 380; // mm\n\t\tfloat pixels = getHeight();\n\t\treturn pixels > 0 ? size / pixels : 0;\n\n\t}", "private void computeRatio() {\n int i;\n int i2;\n int i3;\n boolean z = false;\n if (CameraSettings.getStrictAspectRatio(this.mRenderWidth, this.mRenderHeight) > -1 || !CameraSettings.isNearAspectRatio(this.mCameraWidth, this.mCameraHeight, this.mRenderWidth, this.mRenderHeight)) {\n int i4 = this.mCameraWidth;\n int i5 = this.mCameraHeight;\n switch (this.mTargetRatio) {\n case 0:\n this.mIsFullScreen = false;\n this.mIsRatio16_9 = false;\n if (!CameraSettings.isAspectRatio4_3(i4, i5)) {\n this.mNeedCropped = true;\n if (i4 * 4 > i5 * 3) {\n int i6 = (int) (((float) i5) * 0.75f);\n this.mScaleX = ((float) i6) / ((float) i4);\n i4 = i6;\n } else {\n int i7 = (int) ((((float) i4) * 4.0f) / 3.0f);\n this.mScaleY = ((float) i7) / ((float) i5);\n i5 = i7;\n }\n } else {\n this.mNeedCropped = false;\n this.mScaleX = 1.0f;\n this.mScaleY = 1.0f;\n }\n if (CameraSettings.sCroppedIfNeeded) {\n this.mIsFullScreen = true;\n this.mNeedCropped = true;\n this.mIsRatio16_9 = true;\n i = (int) ((((float) i4) * 16.0f) / 9.0f);\n this.mScaleX *= 0.75f;\n } else {\n i = i5;\n }\n if (b.isPad()) {\n this.mIsFullScreen = true;\n break;\n }\n break;\n case 1:\n this.mIsRatio16_9 = true;\n this.mIsFullScreen = true;\n if (!CameraSettings.isAspectRatio16_9(i4, i5)) {\n this.mNeedCropped = true;\n if (i4 * 16 <= i5 * 9) {\n int i8 = (int) ((((float) i4) * 16.0f) / 9.0f);\n this.mScaleY = ((float) i8) / ((float) i5);\n int i9 = i8;\n i2 = i4;\n i3 = i9;\n if (b.isPad()) {\n this.mIsRatio16_9 = false;\n this.mNeedCropped = true;\n i3 = (int) (((float) i3) * 0.75f);\n this.mScaleY *= 0.75f;\n }\n i = i3;\n i4 = i2;\n break;\n } else {\n i2 = (int) ((((float) i5) * 9.0f) / 16.0f);\n this.mScaleX = ((float) i2) / ((float) i4);\n }\n } else {\n this.mNeedCropped = false;\n this.mScaleX = 1.0f;\n this.mScaleY = 1.0f;\n i2 = i4;\n }\n i3 = i5;\n if (b.isPad()) {\n }\n i = i3;\n i4 = i2;\n case 2:\n this.mIsFullScreen = false;\n this.mIsRatio16_9 = false;\n this.mNeedCropped = true;\n if (i4 != i5) {\n this.mScaleX = 1.0f;\n this.mScaleY = ((float) i4) / ((float) i5);\n i = i4;\n break;\n }\n default:\n i = i5;\n break;\n }\n this.mWidth = i4;\n this.mHeight = i;\n } else if (!(this.mCameraWidth == 0 || this.mCameraHeight == 0)) {\n if (this.mRenderWidth == 0 || this.mRenderHeight == 0 || this.mRenderWidth * this.mCameraHeight == this.mRenderHeight * this.mCameraWidth) {\n this.mNeedCropped = false;\n this.mScaleX = 1.0f;\n this.mScaleY = 1.0f;\n this.mWidth = this.mCameraWidth;\n this.mHeight = this.mCameraHeight;\n } else {\n this.mNeedCropped = true;\n if (this.mCameraWidth * this.mRenderHeight > this.mCameraHeight * this.mRenderWidth) {\n this.mHeight = this.mCameraHeight;\n this.mWidth = (this.mCameraHeight * this.mRenderWidth) / this.mRenderHeight;\n this.mScaleX = ((float) this.mWidth) / ((float) this.mCameraWidth);\n this.mScaleY = 1.0f;\n } else {\n this.mWidth = this.mCameraWidth;\n this.mHeight = (this.mCameraWidth * this.mRenderHeight) / this.mRenderWidth;\n this.mScaleX = 1.0f;\n this.mScaleY = ((float) this.mHeight) / ((float) this.mCameraHeight);\n }\n }\n if ((((float) this.mRenderHeight) / ((float) this.mRenderWidth)) - (((float) Util.sWindowHeight) / ((float) Util.sWindowWidth)) < 0.1f) {\n z = true;\n }\n this.mIsFullScreen = z;\n }\n updateRenderSize();\n updateRenderRect();\n }", "protected abstract void onScalePercentChange(int zoom);", "float rawDepthToMeters(int depthValue) {\n\t if (depthValue < 2047) {\n\t return (float)(1.0 / ((double)(depthValue) * -0.0030711016 + 3.3309495161));\n\t }\n\t return 0.0f;\n\t}", "private void setZoomLevel() {\n final float oldMaxScale = photoView.getMaximumScale();\n photoView.setMaximumScale(oldMaxScale *2);\n photoView.setMediumScale(oldMaxScale);\n }", "@Override\n public void onProgressChanged(SeekBar seekBar, int progress,\n boolean fromUser) {\n progressValue =progress;\n Camera.Parameters params = mCamera.getParameters();\n params.setZoom(progress);\n mCamera.setParameters(params);\n }", "private void adjustZoomFactor(){\n switch(zoomLevel){\n case 0:zoomFactor = 39; break;\n case 1:zoomFactor = 37; break;\n case 2:zoomFactor = 35; break;\n case 3:zoomFactor = 33; break;\n case 4:zoomFactor = 31; break;\n case 5:zoomFactor = 29; break;\n case 6:zoomFactor = 27; break;\n case 7:zoomFactor = 25; break;\n case 8:zoomFactor = 23; break;\n case 9:zoomFactor = 21; break;\n case 10:zoomFactor = 20; break;\n case 11:zoomFactor = 18; break;\n case 12:zoomFactor = 16; break;\n case 13:zoomFactor = 14; break;\n case 14:zoomFactor = 12; break;\n case 15:zoomFactor = 10; break;\n case 16:zoomFactor = 8; break;\n case 17:zoomFactor = 6; break;\n case 18:zoomFactor = 4; break;\n case 19:zoomFactor = 2; break;\n case 20:zoomFactor = 0; break;\n }\n }", "public double getHeightInDeg();", "public float getResolution() {\n return resolution;\n }", "private void checkForZoomOut(){\n if(checkOut == 1){\n zoomLevel--;\n adjustZoomFactor();\n checkOut = 0;\n checkIn = 1;\n } else{\n checkOut = 1;\n checkIn = 0;\n }\n }", "public float getRadiusCorrectedForPerspective() {\n float scale = 1 / getPerspectiveScaleFactor(location);\n return radius * scale;\n }", "private float m80085a() {\n ViewConfiguration mViewConfiguration = this.f64325a.getMViewConfiguration();\n C7573i.m23582a((Object) mViewConfiguration, \"mViewConfiguration\");\n return (float) mViewConfiguration.getScaledMaximumFlingVelocity();\n }", "private static float m590o(Context context) {\r\n DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();\r\n Point point = new Point(displayMetrics.widthPixels, displayMetrics.heightPixels);\r\n return ((float) point.y) / ((float) point.x);\r\n }", "public final Vector2f getResolution() {\r\n return settings.getResolution();\r\n }", "public double getScaleToFitWindow() throws FOPException {\n final Dimension extents = this.previewArea.getViewport()\n .getExtentSize();\n return getScaleToFit(extents.getWidth() - 2 * BORDER_SPACING,\n extents.getHeight() - 2 * BORDER_SPACING);\n }", "public int getAbsHeightViewport() {\n return Math.abs((int)(0.5 + heightViewport));\n }", "public float getZoomToFit() {\n setContentWorkDimensions();\n \n double zoomToFitWidth = 1.0 * getWidth() / (flippedDimensions() ? contentWorkHeight : contentWorkWidth);\n double zoomToFitHeight = 1.0 * getHeight() / (flippedDimensions() ? contentWorkWidth : contentWorkHeight);\n \n float zoomToFit = (float) Math.min(zoomToFitWidth, zoomToFitHeight);\n if (debug) Log.d(TAG, \"getZoomToFit() zoomToFit: \" + zoomToFit + \", \" + contentWorkWidth + \"x\" + contentWorkHeight);\n return zoomToFit;\n }", "public float getStaticPictureFps();", "@Override // com.master.cameralibrary.CameraViewImpl\n public AspectRatio getAspectRatio() {\n return this.mAspectRatio;\n }", "public boolean canZoomOut() {\n\treturn getZoom() > getMinZoom();\n}", "public void updateScale()\n {\n // get scale from world presenter\n s2 = (cam.getScale());\n //Convert to English Miles if appropriate\n if( !SettingsScreen.getUnits() ) s2 *= 0.60934;\n s1 = s2/2;\n repaint();\n }", "public final int getZoom() {\r\n return zoom;\r\n }", "public double dimensionsToMeters() {\n\t\tdouble heightMeters = heightInInches / 39.370;\n\t\tdouble widthMeters = widthInInches / 39.370;\n\n\t\treturn areaInMeters = heightMeters * widthMeters;\n\t}", "public float getPixelSize() {\n\n\t\tfloat pixelSize = 0;\n\t\tfloat zoom = getFloat(ADACDictionary.ZOOM);\n\n\t\t// Get calibration factor (CALB)\n\t\tString calString = extrasMap.get(ExtrasKvp.CALIB_KEY);\n\n\t\t// Some wholebody images have height > width. Typically 1024x512.\n\t\t// Crocodile eats the biggest.\n\t\tshort height = getHeight();\n\t\tshort width = getWidth();\n\t\tshort dim = height > width ? height : width;\n\n\t\tif (dim > 0 && calString != null) {\n\n\t\t\ttry {\n\n\t\t\t\tfloat cal = Float.parseFloat(calString);\n\n\t\t\t\t// Now calculate the pixel size\n\t\t\t\tpixelSize = (1024 * cal) / (dim * zoom);\n\n\t\t\t} catch (NumberFormatException e) {\n\n\t\t\t\tlogger.log(\"Unable to parse calibration factor\");\n\t\t\t\tpixelSize = getRoughPixelSize();\n\n\t\t\t}\n\t\t} else {\n\t\t\tpixelSize = getRoughPixelSize();\n\t\t}\n\n\t\treturn pixelSize;\n\n\t}", "public int delta()\r\n\t{\r\n\t\treturn smooth ? (resolution / fps) : duration;\r\n\t}", "private double getSatelliteSemiEyeWidth() {\r\n double ret = 0D;\r\n\r\n ret = Math.toDegrees(Math.acos(rhoE / rhoS));\r\n return ret;\r\n }", "Controls () {\n \n barX = 40;\n barWidth = 15;\n \n minY = 40;\n maxY = minY + height/3 - sliderHeight/2;\n \n minZoomValue = height - height;\n maxZoomValue = height; // 300 percent\n valuePerY = (maxZoomValue - minZoomValue) / (maxY - minY);\n \n sliderWidth = 25;\n sliderHeight = 10;\n sliderX = (barX + (barWidth/2)) - (sliderWidth/2); \n sliderValue = minZoomValue; \n sliderY = minY; \n }", "public Integer getZoom() {\n return zoom;\n }", "public Integer getZoom() {\n return zoom;\n }", "public abstract float getYdpi();", "void find_it () {\n xt = 210; yt = 105; fact = 50.0;\n if (viewflg != VIEW_FORCES) zoom_slider_pos_y = 50;\n current_part.spanfac = (int)(2.0*fact*current_part.aspect_rat*.3535);\n xt1 = xt + current_part.spanfac;\n yt1 = yt - current_part.spanfac;\n xt2 = xt - current_part.spanfac;\n yt2 = yt + current_part.spanfac;\n \n }", "private int verticalZoomToPixel() {\r\n\t\tint graphH = getGraphHeight() * getChannelCount()\r\n\t\t\t\t- verticalZoomHandleHeight;\r\n\t\tint middleY = getGraphTop(0) + graphH / 2;\r\n\t\tif (currVerticalZoom == 1.0) return middleY;\r\n\t\tgraphH -= 2 * verticalZoomHandleSnap;\r\n\r\n\t\tdouble normalizedRes; // in range -maxVerticalZoom...+maxVerticalZoom\r\n\t\tif (currVerticalZoom < 1)\r\n\t\t\tnormalizedRes = -1.0 / currVerticalZoom + 1.0;\r\n\t\telse\r\n\t\t\tnormalizedRes = currVerticalZoom - 1.0;\r\n\t\t// S*ystem.out.println(\"currRes=\"+currVerticalZoom+\"\r\n\t\t// normalized=\"+normalizedRes);\r\n\t\tint diff = (int) Math.round(graphH * normalizedRes\r\n\t\t\t\t/ (2 * maxVerticalZoom));\r\n\t\tif (diff < 0)\r\n\t\t\treturn Math.min(middleY - diff + verticalZoomHandleSnap,\r\n\t\t\t\t\tgetGraphHeight() * getChannelCount()\r\n\t\t\t\t\t\t\t- verticalZoomHandleHeight);\r\n\t\telse if (diff == 0)\r\n\t\t\treturn middleY;\r\n\t\telse\r\n\t\t\treturn Math.max(middleY - diff - verticalZoomHandleSnap,\r\n\t\t\t\t\tgetGraphTop(0));\r\n\t}", "public float getDCM();", "public void checkCameraLimits()\n {\n //Daca camera ar vrea sa mearga prea in stanga sau prea in dreapta (Analog si pe verticala) ea e oprita (practic cand se intampla acest lucru Itemul asupra caruia se incearca centrarea nu mai e in centrul camerei )\n\n if(xOffset < 0 )\n xOffset = 0;\n else if( xOffset > refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth())\n xOffset =refLinks.GetMap().getWidth()* Tile.TILE_WIDTH - refLinks.GetWidth();\n if(yOffset<0)\n yOffset = 0;\n if(yOffset > refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight())\n {\n yOffset = refLinks.GetMap().getHeight()*Tile.TILE_HEIGHT - refLinks.GetHeight();\n }\n }", "double getPerimetro();", "public void zoomToFactor(double d) {\n\t\t\n\t}", "private void onScroll(double wheelDelta, Point2D mousePoint) {\n double zoomFactor = Math.exp(wheelDelta * zoomIntensity);\n\n Bounds innerBounds = zoomNode.getLayoutBounds();\n Bounds viewportBounds = getViewportBounds();\n\n // calculate pixel offsets from [0, 1] range\n double valX = this.getHvalue() * (innerBounds.getWidth() - viewportBounds.getWidth());\n double valY = this.getVvalue() * (innerBounds.getHeight() - viewportBounds.getHeight());\n scaleValue = scaleValue * zoomFactor;\n \n // calculate minimum zoom\n if(Math.max(target.getLayoutBounds().getWidth()*scaleValue, target.getLayoutBounds().getHeight()*scaleValue) < minViewPortSize) {\n\n \tscaleValue = minViewPortSize / Math.max(target.getLayoutBounds().getWidth(), target.getLayoutBounds().getHeight());\n updateScale();\n this.layout();\n \n } else if(scaleValue > zoom_max) {\n \tscaleValue = zoom_max;\n \tupdateScale();\n this.layout();\n }else {\n \tupdateScale();\n this.layout();\n\n // convert target coordinates to zoomTarget coordinates\n Point2D posInZoomTarget = target.parentToLocal(zoomNode.parentToLocal(mousePoint));\n\n // calculate adjustment of scroll position\n Point2D adjustment = target.getLocalToParentTransform().deltaTransform(posInZoomTarget.multiply(zoomFactor - 1));\n\n // convert back to [0, 1] range\n Bounds updatedInnerBounds = zoomNode.getBoundsInLocal();\n this.setHvalue((valX + adjustment.getX()) / (updatedInnerBounds.getWidth() - viewportBounds.getWidth()));\n this.setVvalue((valY + adjustment.getY()) / (updatedInnerBounds.getHeight() - viewportBounds.getHeight()));\n }\n }", "public double getRangeInches(){\r\n\t\t return uSensor.getRangeInches();\r\n\t\t}", "@Override\n\tprotected float getDrawRatioX(){\n\t\treturn getWidth() / (float)getDefaultTODA() * getRatioOnScreen();\n\t}", "boolean allowZoom();", "public final float mo9235c(DisplayMetrics displayMetrics) {\n return 100.0f / ((float) displayMetrics.densityDpi);\n }", "public double getAsDpi() {\n\t\tif (units != 1 || pixelsxUnitX != pixelsxUnitY)\n\t\t\treturn -1;\n\t\treturn ((double) pixelsxUnitX) * 0.0254;\n\t}", "@Override\n\tpublic void mouseWheelMoved(MouseWheelEvent e) {\n\t\tratio += ratio / (-e.getUnitsToScroll() * 10);\n\t\tif (ratio < 50.0 / current_image.getWidth()) {\n\t\t\tratio = 50.0 / current_image.getWidth();\n\t\t}\n\t\tif (ratio < 50.0 / current_image.getHeight()) {\n\t\t\tratio = 50.0 / current_image.getHeight();\n\t\t}\n\t\tint prew = w;\n\t\tint preh = h;\n\t\tw = (int) (current_image.getWidth() * ratio);\n\t\th = (int) (current_image.getHeight() * ratio);\n\t\tif (w < Monitor_Width) { // centers x\n\t\t\tx = (Monitor_Width - w) / 2;\n\t\t} else { // centers around h/2\n\t\t\tx -= (w - prew) / 2;\n\t\t\tif (x > 0)\n\t\t\t\tx = 0;\n\t\t\tif (x < Monitor_Width - w)\n\t\t\t\tx = Monitor_Width - w;\n\t\t}\n\t\tif (h < Monitor_Height) { // centers y\n\t\t\ty = (Monitor_Height - h) / 2;\n\t\t} else { // centers around h/2\n\t\t\ty -= (h - preh) / 2;\n\t\t\tif (y > 0)\n\t\t\t\ty = 0;\n\t\t\tif (y < Monitor_Height - h)\n\t\t\t\ty = Monitor_Height - h;\n\t\t}\n\t}", "public native double getYResolution() throws MagickException;", "public float getTheDistance(){\n\t\t\n\t\tdistance = sonic.getDistance();\n\t\tSystem.out.println(\"value:\"+ distance);\n\t\t//considering the test results we see after 23 cm we see the +1cm precision and below 23cm we see + 5cm range \n\t\tif (distance<=25){\n\t\treturn (distance-7);\n\t\t}\n\t\telse{return (distance-3);}\n\t}", "double getRatio();", "public void zoomOut() {\n if (scale > 0.05) {\n double scaleFactor = (scale - 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale -= 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n }", "public double getPreviousZoomLevel() {\n\tfor (int i = 1; i < zoomLevels.length; i++)\n\t\tif (zoomLevels[i] >= zoom)\n\t\t\treturn zoomLevels[i - 1];\n\treturn getMinZoom();\n}", "public double getOffset(){\n\t\tdouble percentHeight = networkTableValues.get(\"height\")/cameraHeightPixel;\n\t\t//Get the height of the frame in inches\n\t\tdouble cameraHeightInches = networkTableValues.get(\"height\")/percentHeight;\n\t\t//Get the width of the frame in inches\n\t\tdouble cameraWidthInches = cameraHeightInches*(cameraWidthPixel/cameraHeightPixel);\n\t\t//Get the distanceFromTower from the camera to the goal\n\t\tdistanceFromTower = (cameraWidthInches/2)/Math.tan(cameraFOV*(Math.PI/180));\n\t\t//Get the distanceFromTower from the camera to the base of the tower\n\t\tdouble horizontalDistance = Math.sqrt(Math.pow(distanceFromTower, 2) - Math.pow(towerHeight, 2));\n\t\t//Get offset in inches\n\t\tdouble distanceFromCenterInches = (networkTableValues.get(\"centerX\") / cameraWidthPixel)*cameraWidthInches;\n\t\tdouble offset = Math.atan((distanceFromCenterInches/distanceFromTower)*(180/Math.PI));\n\t\t\n\t\tSystem.out.println(\"OFFSET: \" + offset);\n\t\treturn offset;\n\t}", "public double[] setMapBounds(double ulLon, double ulLat, double lrLon, double lrLat)\n/* 154: */ {\n/* 117:182 */ int x_min = 2147483647;\n/* 118:183 */ int y_min = 2147483647;\n/* 119:184 */ int x_max = -2147483648;\n/* 120:185 */ int y_max = -2147483648;\n/* 121:186 */ int mapZoomMax = 20;\n/* 122: */\n/* 123:188 */ x_max = Math.max(x_max, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 124:189 */ x_max = Math.max(x_max, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 125:190 */ y_max = Math.max(y_max, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 126:191 */ y_max = Math.max(y_max, MercatorProj.LatToY(lrLat, mapZoomMax));\n/* 127:192 */ x_min = Math.min(x_min, MercatorProj.LonToX(ulLon, mapZoomMax));\n/* 128:193 */ x_min = Math.min(x_min, MercatorProj.LonToX(lrLon, mapZoomMax));\n/* 129:194 */ y_min = Math.min(y_min, MercatorProj.LatToY(ulLat, mapZoomMax));\n/* 130:195 */ y_min = Math.min(y_min, MercatorProj.LatToY(lrLat, mapZoomMax));\n /* x_max= (int)(Math.max(ulLon,lrLon)*1000000);\n x_min= (int)(Math.min(ulLon,lrLon)*1000000);\n y_max= (int)(Math.max(ulLat,lrLat)*1000000);\n y_min= (int)(Math.min(ulLat,lrLat)*1000000);*/\n/* 134:199 */ int height = Math.max(0, this.mapPanel.getHeight());\n/* 135:200 */ int width = Math.max(0, this.mapPanel.getWidth());\n/* 136:201 */ int newZoom = mapZoomMax;\n/* 137:202 */ int x = x_max - x_min;\n/* 138:203 */ int y = y_max - y_min;\n/* 139:204 */ while ((x > width) || (y > height))\n/* 140: */ {\n/* 141:205 */ newZoom--;\n/* 142:206 */ x >>= 1;\n/* 143:207 */ y >>= 1;\n/* 144: */ }\n/* 145:209 */ x = x_min + (x_max - x_min)/2;\n/* 146:210 */ y = y_min + (y_max - y_min)/2;\n/* 147:211 */ int z = 1 << mapZoomMax - newZoom;\n/* 148:212 */ x /= z;\n/* 149:213 */ y /= z;\n /* int Cx=256;\n int Cy=256;\n //Cx>>=(newZoom);\n //Cy>>=(newZoom);\n double x1=((x*(width/2))/Cx);\n double y1=((y*(height/2))/Cy);\n x=(int) x1;\n y=(int) y1;\n x >>=(newZoom-this.mapPanel.zoom);\n y >>=(newZoom-this.mapPanel.zoom);\n //x = x+156;\n //y = y-137;*/\n x=x/10000;\n y=y/10000;\n /* 150:214 */ this.mapPanel.setZoom(new Point((int)x, (int)y), newZoom);\n double[] res = { this.mapPanel.zoom, this.mapPanel.centerX, this.mapPanel.centerY,x,y, newZoom, z };\n traceln(Arrays.toString(res));\n traceln( x_max+\",\"+x_min+\",\"+y_max+\",\"+y_min+\",x:\"+x+\",y:\"+y+\",z:\"+z+\",nZomm:\"+newZoom);\n // this.mapPanel.getBounds().getX()setBounds( (int)ulLon,(int)ulLat, (int)width,(int)height);\n return res;\n\n/* 167: */ }", "public double resolution(final Slit slit) {\n return getEffectiveWavelength() / resolution.get(getGrismNumber());\n }", "public int getZoomLevel() {\n return this.zoomLevel;\n }", "private float m80086a() {\n ViewConfiguration mViewConfiguration = this.f64326a.getMViewConfiguration();\n C7573i.m23582a((Object) mViewConfiguration, \"mViewConfiguration\");\n return (float) mViewConfiguration.getScaledMinimumFlingVelocity();\n }", "@JSProperty(\"maxZoom\")\n double getMaxZoom();" ]
[ "0.6754022", "0.66387254", "0.6601013", "0.6550856", "0.65082073", "0.64677393", "0.64083064", "0.6240594", "0.6188973", "0.60849077", "0.6080179", "0.60586196", "0.60350335", "0.6032371", "0.6021666", "0.6019527", "0.59854835", "0.59767294", "0.5898544", "0.5889463", "0.5888123", "0.5867792", "0.58574075", "0.5832852", "0.57526696", "0.5718936", "0.5715515", "0.57136583", "0.5701896", "0.5687263", "0.56872165", "0.56177723", "0.56123286", "0.5611385", "0.55996114", "0.5594166", "0.5562936", "0.5530381", "0.5519967", "0.55054694", "0.550345", "0.5502687", "0.54956096", "0.54906", "0.54867285", "0.54695326", "0.5467853", "0.54669154", "0.54445326", "0.54233456", "0.5418909", "0.541829", "0.54182315", "0.541559", "0.5410345", "0.5407624", "0.538362", "0.53835416", "0.5376891", "0.5374978", "0.5365117", "0.53637516", "0.53446174", "0.5342036", "0.53332686", "0.5329337", "0.5325126", "0.53188497", "0.53170013", "0.53169125", "0.53087807", "0.5294086", "0.52843267", "0.528319", "0.528319", "0.5268294", "0.52570194", "0.5255052", "0.5252514", "0.52493185", "0.52476776", "0.52473134", "0.5239661", "0.522668", "0.52194995", "0.52134013", "0.5205751", "0.5196395", "0.5195146", "0.51941985", "0.5188577", "0.5179176", "0.51737624", "0.5162775", "0.516194", "0.51607656", "0.5160568", "0.51566356", "0.51548094", "0.51488435" ]
0.64549315
6
returns the distance between the closest and the farthest possible camera
public float getSpace() { return space; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private double getDistance() {\n\t\tfinal double h2 = 86.7;\n\t\t// h1: height of top of camera\n\t\tfinal double h1 = 17.6;\n\n\t\t// a1: angle of camera (relative to chasis)\n\t\tfinal double a1 = 36.175;\n\t\t// a2: angle of target relative to a1\n\t\tfinal double a2 = ty.getDouble(0.0);\n\n\t\t// distance: distance from camera to base of target\n\t\tfinal double distance = ((h2 - h1) / Math.tan(Math.toRadians(a1 + a2)));\n\n\t\tfinal double d = Math.sqrt(Math.pow(h2 - h1, 2) + Math.pow(distance, 2));\n\t\tSmartDashboard.putNumber(\"Py Distance\", d);\n\n\t\treturn (distance);\n\n\t}", "Execution getClosestDistance();", "public double getDist(){\n double dist=0;\n double DA = 0;\n double minDist = this.getMotors()[0].getTargetPosition();\n for(int i =0;i<this.getMotors().length;i++) {\n double current = this.getMotors()[i].getCurrentPosition();\n double target = this.getMotors()[i].getTargetPosition();\n DA = Math.abs(target) - Math.abs(current);\n dist = target - current;\n if(Math.abs(DA)<Math.abs(minDist)){\n minDist = dist;\n }\n }\n return (minDist);\n }", "public double getDistance(Player player) {\n\t\tdouble distanceFromPlayer1Perspective = player2.xPosition() - player1.xPosition();\n\t\tdouble distanceFromPlayer2Perspective = player1.xPosition() - player2.xPosition();\n\t\treturn player.equals(player1) ? distanceFromPlayer1Perspective : distanceFromPlayer2Perspective;\n\t}", "public static double getDistance(CUELocation camera, CUELocation point) {\n //mean earth radius\n int earthRadius = 6371000;\n double diffLat = camera.getLatitudeRadians()-point.getLatitudeRadians();\n double diffLng = camera.getLongitudeRadians()-point.getLongitudeRadians();\n\n double a = Math.sin(diffLat/2) * Math.sin(diffLat/2) +\n Math.cos(camera.getLatitudeRadians()) * Math.cos(point.getLatitudeRadians()) *\n Math.sin(diffLng/2) * Math.sin(diffLng/2);\n\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1.0-a));\n\n return earthRadius*c;\n }", "public void recalculateCamDist(Camera camera)\n\t{\n\t\tthis.camDist = Vector3f.sub(camera.getPosition(), getPosition(), null).lengthSquared();\n\t}", "public double getDistance() { \n\t\treturn Math.pow(input.getAverageVoltage(), exp) * mul; \n\t}", "public void getDistance() {\n projDistance = 2 * sin(toRadians(launchAngle)) * getVelocity() / 9.8 * cos(toRadians(launchAngle)) * getVelocity();\n }", "public double getDistanceToTarget() {\n if (!Config.isVisionInstalled) {\n return 0;\n }\n double distanceToVisionTarget =\n Config.visionDistanceConstant * (Config.fieldVisionTargetHeight-Config.limelightMountingHeight) /\n Math.tan(Math.toRadians(limelight.getTy() + Config.limelightMountingAngle));\n\n //now we can convert the new values into a new distance\n return distanceToVisionTarget;\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 }", "private float getDistance(SXRNode object)\n {\n float x = object.getTransform().getPositionX();\n float y = object.getTransform().getPositionY();\n float z = object.getTransform().getPositionZ();\n return (float) Math.sqrt(x * x + y * y + z * z);\n }", "Execution getFarthestDistance();", "public float[] checkDistanceCamera(CameraPosition posCamera){\n float[] results = new float[1];\n Location.distanceBetween(posItaly.latitude,posItaly.longitude,posCamera.target.latitude,posCamera.target.longitude,results);\n return results;\n }", "public float getDistance() {\n shouldUpdateDistance = true;\n if (shouldUpdateDistance) {\n distance = getDistance(createSuggestedWindowFilter());\n shouldUpdateDistance = false;\n }\n return distance;\n }", "public float getTheDistance(){\n\t\t\n\t\tdistance = sonic.getDistance();\n\t\tSystem.out.println(\"value:\"+ distance);\n\t\t//considering the test results we see after 23 cm we see the +1cm precision and below 23cm we see + 5cm range \n\t\tif (distance<=25){\n\t\treturn (distance-7);\n\t\t}\n\t\telse{return (distance-3);}\n\t}", "public double calDistance()\n {\n double closest = poly[0].getD();\n\n for(int i = 1; i < sides; i++)\n {\n if(closest > poly[i].getD())\n {\n closest = poly[i].getD();\n }\n }\n this.distance = closest;\n\n return closest;\n }", "public double getDistance(){\n return sensor.getVoltage()*100/2.54 - 12;\n }", "public Long calculateDistanceVision() {\n return this.getVision() + lazyPlayboardActor.get().getCarte().getCarte().getValue(this.point).getVisionAdvantage();\n }", "public float getDistance();", "public float getDistanceToCompensate ( long fps, float attachedAnchorY) {\n float distanceToCompensate = 0;\n if (moveOtherObjects){\n distanceToCompensate =\n (float) (defaultYCoordinateAsPerctangeOfScreen * screen_length) - attachedAnchorY;\n distanceToCompensate /= fps;\n }\n return distanceToCompensate;\n }", "public double getDistance(){\r\n\t\treturn Math.sqrt(\r\n\t\t\t\t(\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t\t, 2 )\r\n\t )\r\n\t\t\t\t+ (\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterY()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterY()\r\n\t\t\t\t\t, 2 )\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}", "public double getDistance()\n {\n return Math.abs(getDifference());\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}", "double getDistance();", "public float getDistanceTo(DoGMaximum target)\n \t{\n \t\tif (target == null)\n \t\t\treturn Float.NaN;\n \t\t\n \t\tfloat difference = 0;\n \t\t\n\t\tdifference += Math.pow(this.x - target.x,2); \n\t\tdifference += Math.pow(this.y - target.y,2);\n\t\tdifference += Math.pow(this.z - target.z,2);\n\t\tdifference += Math.pow(this.sigma - target.sigma,2); \t\t\n \t\t\n\t\treturn (float)Math.sqrt(difference);\n \t}", "public float getDistance(){\n\t\t\treturn s1.start.supportFinal.dot(normal);\n\t\t}", "public double getMaxSourceDistance();", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "public void calcDistance() {\n if (DataManager.INSTANCE.getLocation() != null && location.getLength() == 2) {\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n double dLat = Math.toRadians(location.getLatitude() - DataManager.INSTANCE.getLocation().getLatitude()); // deg2rad below\n double dLon = Math.toRadians(location.getLongitude() - DataManager.INSTANCE.getLocation().getLongitude());\n double a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(Math.toRadians(location.getLatitude()))\n * Math.cos(Math.toRadians(location.getLatitude()))\n * Math.sin(dLon / 2)\n * Math.sin(dLon / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double d = KM_IN_RADIUS * c; // Distance in km\n distance = (float) d;\n } else distance = null;\n }", "private double distance() {\n\t\tdouble dist = 0;\n\t\tdist = Math.sqrt(Math.abs((xOrigin - x) * (xOrigin - x) + (yOrigin - y) * (yOrigin - y)));\n\t\treturn dist;\n\t}", "public float getDistanceFromBirth() {\n double dx = location.x - birthLocation.x;\n double dy = location.y - birthLocation.y;\n return (float) Math.sqrt(dx * dx + dy * dy);\n }", "public static int closest( List<Camera.Size> sizes , int width , int height ) {\n\t\tint best = -1;\n\t\tint bestScore = Integer.MAX_VALUE;\n\n\t\tfor( int i = 0; i < sizes.size(); i++ ) {\n\t\t\tCamera.Size s = sizes.get(i);\n\n\t\t\tint dx = s.width-width;\n\t\t\tint dy = s.height-height;\n\n\t\t\tint score = dx*dx + dy*dy;\n\t\t\tif( score < bestScore ) {\n\t\t\t\tbest = i;\n\t\t\t\tbestScore = score;\n\t\t\t}\n\t\t}\n\n\t\treturn best;\n\t}", "private float distanceMoyenne(DMatchVector bestMatches){\n\n float DM=0.0f;\n for(int i=0;i<bestMatches.size();i++){\n\n DM+=bestMatches.get(i).distance();\n }\n\n DM=DM/bestMatches.size();\n return DM;\n\n }", "private double getDistance(double initX, double initY, double targetX, double targetY) {\n\t\treturn Math.sqrt(Math.pow((initX - targetX), 2) + Math.pow((initY - targetY), 2));\n\t}", "public void computeOptimalDir(CameraPlacementProblem problem)\n {\n \tint i, maxX = problem.getMaxX();\n \tint j, maxY = problem.getMaxY();\n \tint pos, maxTiles, angle, angleBest, goodCov;\n\n \tArrayList<Camera> cameraTestList = new ArrayList<Camera>();\n\n \t//Clear previous list\n \toptimalDir.clear();\n\n \tCameraPlacementResult result = null;\n \tCameraPlacementResult testResult = null;\n\n \t//Result of all previous cameras together in cameraList\n\t\tresult = CameraPlacement.evaluatePlacement(problem, cameraList);\n\n \t// iteratively walk along bottom wall (Must do all ext/int walls respectively)\n\t\tfor (pos = 1; pos < maxX; pos += posIncre)\n\t\t{\n\t\t\t//Quick check if current location is valid (saves time)\n\t\t\tif (!isValid(pos, 1))\n\t\t\t\tbreak;\n\n\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\tmaxTiles = 0;\n\t\t\tangleBest = 0;\n\n\t\t\t// Now iteratively through each possible angle \n\t\t\t//Increments of: 10 degrees\n\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t{\n\t\t\t\t//Create new testCamera\n\t\t\t\tCamera testCamera = new Camera(new Pointd(pos, 1), angle);\n\t\t\t\t\n\t\t\t\t//Initialize goodCov\n\t\t\t\tgoodCov = 0;\n\t\t\t\t\n\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\t//Result of newly created camera, alone\n\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\t//Compute total good Coverage by camera (# tiles covered that were prev uncovered)\n\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\n\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t{\n\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\tangleBest = angle;\n\t\t\t\t}\n\n\t\t\t\t//And clear single camera from testList\n\t\t\t\tcameraTestList.clear();\n\t\t\t}\n\n\t\t\tif (maxTiles > 0)\n\t\t\t{\n\t\t\t\t//Concatentate bestInfo into double array\n\t\t\t\tint[] info = new int[4];\n\t\t\t\tinfo[0] = angleBest;\n\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\tinfo[2] = pos;\n\t\t\t\tinfo[3] = 1;\n\n\t\t\t\t//Add tp optimalDir\n\t\t\t\toptimalDir.add(info);\n\t\t\t}\n\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t}\n\n\t\t// iteratively walk along top wall (Must do all ext/int walls respectively)\n\t\tfor (pos = 1; pos < maxX; pos += posIncre)\n\t\t{\n\t\t\tif (!isValid(pos, maxY - 1))\n\t\t\t\tbreak;\n\n\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\tmaxTiles = 0;\n\t\t\tangleBest = 0;\n\n\t\t\t// Now iteratively through each possible angle \n\t\t\t//Increments of: 10 degrees\n\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t{\n\t\t\t\tCamera testCamera = new Camera(new Pointd(pos, maxY - 1), angle);\n\t\t\t\t\n\t\t\t\t//Initialize goodCov\n\t\t\t\tgoodCov = 0;\n\n\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t{\n\n\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\tangleBest = angle;\n\t\t\t\t}\n\n\t\t\t\t//And clear single camera from testList\n\t\t\t\tcameraTestList.clear();\n\t\t\t}\n\n\t\t\tif (maxTiles > 0)\n\t\t\t{\n\t\t\t\tint[] info = new int[4];\n\t\t\t\tinfo[0] = angleBest;\n\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\tinfo[2] = pos;\n\t\t\t\tinfo[3] = maxY - 1;\n\n\t\t\t\t//Add tp optimalDir\n\t\t\t\toptimalDir.add(info);\n\t\t\t}\n\n\n\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t}\n\t\t\n\t\t// iteratively walk along left wall (Must do all ext/int walls respectively)\n\t\tfor (pos = 1; pos < maxY; pos += posIncre)\n\t\t{\n\n\t\t\tif (!isValid(1, pos))\n\t\t\t\tbreak;\n\n\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\tmaxTiles = 0;\n\t\t\tangleBest = 0;\n\t\t\t// Now iteratively through each possible angle \n\t\t\t//Increments of: 10 degrees\n\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t{\n\t\t\t\t//Create new testCamera\n\t\t\t\tCamera testCamera = new Camera(new Pointd(1, pos), angle);\n\t\t\t\t\n\t\t\t\t//Initialize goodCov\n\t\t\t\tgoodCov = 0;\n\n\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t{\n\n\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\tangleBest = angle;\t\n\n\t\t\t\t}\n\n\t\t\t\t//And clear single camera from testList\n\t\t\t\tcameraTestList.clear();\n\t\t\t}\n\n\t\t\t//coverageDir.add(coverageMatrix);\n\n\t\t\tif (maxTiles > 0)\n\t\t\t{\n\t\t\t\tint[] info = new int[4];\n\t\t\t\tinfo[0] = angleBest;\n\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\tinfo[2] = 1;\n\t\t\t\tinfo[3] = pos;\n\n\t\t\t\t//Add tp optimalDir\n\t\t\t\toptimalDir.add(info);\n\t\t\t}\n\n\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t}\n\n\t\t// iteratively walk along right wall (Must do all ext/int walls respectively)\n\t\tfor (pos = 1; pos < maxY; pos += posIncre)\n\t\t{\n\n\t\t\tif (!isValid(maxX - 1, pos))\n\t\t\t\tbreak;\n\n\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\tmaxTiles = 0;\n\t\t\tangleBest = 0;\n\t\t\t// Now iteratively through each possible angle \n\t\t\t//Increments of: 10 degrees\n\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t{\n\t\t\t\t//Create new testCamera\n\t\t\t\tCamera testCamera = new Camera(new Pointd(maxX - 1, pos), angle);\n\t\t\t\t\n\t\t\t\t//Initialize goodCov\n\t\t\t\tgoodCov = 0;\n\n\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t{\n\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\tangleBest = angle;\n\t\t\t\t}\n\n\t\t\t\t//And clear single camera from testList\n\t\t\t\tcameraTestList.clear();\n\t\t\t}\n\n\t\t\t//coverageDir.add(coverageMatrix);\n\n\t\t\tif (maxTiles > 0)\n\t\t\t{\n\t\t\t\tint[] info = new int[4];\n\t\t\t\tinfo[0] = angleBest;\n\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\tinfo[2] = maxX - 1;\n\t\t\t\tinfo[3] = pos;\n\n\t\t\t\t//Add tp optimalDir\n\t\t\t\toptimalDir.add(info);\n\t\t\t}\n\n\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t}\n\n\t\t//================================================\n\t\t// Now need to do interior walls:/\n\t\t//================================================\n\t\t\n\t\tArrayList<Wall> interiorWalls = problem.getInteriorWalls();\n\t\tIterator intWallItr = interiorWalls.iterator();\n\n\t\twhile (intWallItr.hasNext())\n\t\t{\n\n\t\t\tWall wall = (Wall) intWallItr.next();\n\n\t\t\t//If vertical int wall\n\t\t\tif (wall.start.x == wall.end.x) \n\t\t\t{\n\t\t\t\t//For left side of wall\n\t\t\t\tfor (pos = (int) wall.start.y; pos <= wall.end.y; pos += posIncre)\n\t\t\t\t{\n\n\t\t\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\t\t\tmaxTiles = 0;\n\t\t\t\t\tangleBest = 0;\n\t\t\t\t\t// Now iteratively through each possible angle \n\t\t\t\t\t//Increments of: 10 degrees\n\t\t\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Create new testCamera\n\t\t\t\t\t\tCamera testCamera = new Camera(new Pointd(wall.start.x, pos), angle);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Initialize goodCov\n\t\t\t\t\t\tgoodCov = 0;\n\n\t\t\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\t\t\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\t\t\tangleBest = angle;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//And clear single camera from testList\n\t\t\t\t\t\tcameraTestList.clear();\n\t\t\t\t\t}\n\n\t\t\t\t\t//coverageDir.add(coverageMatrix);\n\n\t\t\t\t\tif (maxTiles > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint[] info = new int[4];\n\t\t\t\t\t\tinfo[0] = angleBest;\n\t\t\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\t\t\tinfo[2] = (int) wall.start.x;\n\t\t\t\t\t\tinfo[3] = pos;\n\n\t\t\t\t\t\toptimalDir.add(info);\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//Add tp optimalDir\n\t\t\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t\t\t}\n\n\t\t\t\t//Now for right side of wall\n\t\t\t\tfor (pos = (int) wall.start.y; pos <= wall.end.y; pos += posIncre)\n\t\t\t\t{\n\n\t\t\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\t\t\tmaxTiles = 0;\n\t\t\t\t\tangleBest = 0;\n\t\t\t\t\t// Now iteratively through each possible angle \n\t\t\t\t\t//Increments of: 10 degrees\n\t\t\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Create new testCamera\n\t\t\t\t\t\tCamera testCamera = new Camera(new Pointd(wall.start.x + 1, pos), angle);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Initialize goodCov\n\t\t\t\t\t\tgoodCov = 0;\n\n\t\t\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\t\t\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\t\t\tangleBest = angle;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//And clear single camera from testList\n\t\t\t\t\t\tcameraTestList.clear();\n\t\t\t\t\t}\n\n\t\t\t\t\t//coverageDir.add(coverageMatrix);\n\n\t\t\t\t\tif (maxTiles > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint[] info = new int[4];\n\t\t\t\t\t\tinfo[0] = angleBest;\n\t\t\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\t\t\tinfo[2] = (int) wall.start.x + 1;\n\t\t\t\t\t\tinfo[3] = pos;\n\n\t\t\t\t\t\t//Add tp optimalDir\n\t\t\t\t\t\toptimalDir.add(info);\n\t\t\t\t\t}\n\n\n\t\t\t\n\t\t\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Else horizontal wall\n\t\t\telse\n\t\t\t{\n\t\t\t\t//For bottom side of wall\n\t\t\t\tfor (pos = (int) wall.start.x; pos <= wall.end.x; pos += posIncre)\n\t\t\t\t{\n\n\t\t\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\t\t\tmaxTiles = 0;\n\t\t\t\t\tangleBest = 0;\n\t\t\t\t\t// Now iteratively through each possible angle \n\t\t\t\t\t//Increments of: 10 degrees\n\t\t\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Create new testCamera\n\t\t\t\t\t\tCamera testCamera = new Camera(new Pointd(pos, wall.start.y), angle);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Initialize goodCov\n\t\t\t\t\t\tgoodCov = 0;\n\n\t\t\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\t\t\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\t\t\tangleBest = angle;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//And clear single camera from testList\n\t\t\t\t\t\tcameraTestList.clear();\n\t\t\t\t\t}\n\n\t\t\t\t\t//coverageDir.add(coverageMatrix);\n\n\t\t\t\t\tif (maxTiles > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint[] info = new int[4];\n\t\t\t\t\t\tinfo[0] = angleBest;\n\t\t\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\t\t\tinfo[2] = pos;\n\t\t\t\t\t\tinfo[3] = (int) wall.start.y;\n\n\t\t\t\t\t\t//Add tp optimalDir\n\t\t\t\t\t\toptimalDir.add(info);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t\t\t}\n\n\t\t\t\t//Now for top side of wall\n\t\t\t\tfor (pos = (int) wall.start.x; pos <= wall.end.x; pos += posIncre)\n\t\t\t\t{\n\n\t\t\t\t\t//int[][] coverageMatrix = preCompute(problem);\n\t\t\t\t\tmaxTiles = 0;\n\t\t\t\t\tangleBest = 0;\n\t\t\t\t\t// Now iteratively through each possible angle \n\t\t\t\t\t//Increments of: 10 degrees\n\t\t\t\t\tfor (angle = 0; angle < 360; angle += angleIncre)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Create new testCamera\n\t\t\t\t\t\tCamera testCamera = new Camera(new Pointd(pos, wall.start.y + 1), angle);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Initialize goodCov\n\t\t\t\t\t\tgoodCov = 0;\n\n\t\t\t\t\t\tcameraTestList.add(testCamera);\n\n\t\t\t\t\t\ttestResult = CameraPlacement.evaluatePlacement(problem, cameraTestList);\n\n\t\t\t\t\t\tgoodCov = computeGoodCoverage(result, testResult, problem);\n\n\t\t\t\t\t\t// If current cam angles covers ANY tiles add to dummy matrix\n\t\t\t\t\t\tif (goodCov > 0 && testResult.numIllegalPlacements == 0 && goodCov > maxTiles) \n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t//update maxTiles (minus any overlap present), and angleBest\n\t\t\t\t\t\t\tmaxTiles = goodCov;\n\t\t\t\t\t\t\tangleBest = angle;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//And clear single camera from testList\n\t\t\t\t\t\tcameraTestList.clear();\n\t\t\t\t\t}\n\n\t\t\t\t\t//coverageDir.add(coverageMatrix);\n\n\t\t\t\tif (maxTiles > 0)\n\t\t\t\t{\n\t\t\t\t\tint[] info = new int[4];\n\t\t\t\t\tinfo[0] = angleBest;\n\t\t\t\t\tinfo[1] = maxTiles;\n\t\t\t\t\tinfo[2] = pos;\n\t\t\t\t\tinfo[3] = (int) wall.start.y + 1;\n\n\t\t\t\t\t//Add tp optimalDir\n\t\t\t\t\toptimalDir.add(info);\n\t\t\t\t}\n\n\t\t\t\t\t//System.out.println(\"fin. with pos: \" + pos);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\n\t\t//for (j = 0; j < optimalDir.size(); j++)\n\t\t//\tSystem.out.println(\"[ \" + optimalDir.get(j)[0] + \" \" + optimalDir.get(j)[1] + \" \" + optimalDir.get(j)[2] + \" \" + optimalDir.get(j)[3] + \" ]\");\n }", "private double distanceResult(double preLng, double preLat, double nextLng, double nextLat) {\n\t\treturn Math.sqrt((preLng - nextLng) * (preLng - nextLng) + (preLat - nextLat) * (preLat - nextLat));\n\t}", "private double getHeuristic(MapLocation current, MapLocation goal) {\n\t\treturn Math.max(Math.abs(current.x - goal.x), Math.abs(current.y - goal.y));\n\t}", "public final float isoSurfaceDistance(double cur, float[] val, boolean[] flag) {\n \t\n \tif (cur==0) return 0;\n \t\n s = 0;\n dist = 0;\n \n for (int n=0; n<6; n+=2) {\n\t\t\tif (flag[n] && flag[n+1]) {\n\t\t\t\ttmp = Numerics.max(val[n], val[n+1]); // Take the largest distance (aka closest to current point) if both are across the boundariy\n\t\t\t\ts = cur/(cur+tmp);\n\t\t\t\tdist += 1.0/(s*s);\n\t\t\t} else if (flag[n]) {\n\t\t\t\ts = cur/(cur+val[n]); // Else, take the boundariy point\n\t\t\t\tdist += 1.0/(s*s);\n\t\t\t} else if (flag[n+1]) {\n\t\t\t\ts = cur/(cur+val[n+1]);\n\t\t\t\tdist += 1.0/(s*s);\n\t\t\t}\n\t\t}\n\t\t// triangular (tetrahedral?) relationship of height in right triangles gives correct distance\n tmp = Math.sqrt(1.0/dist);\n\n // The larger root\n return (float)tmp;\n }", "public double[] getTargetDistanceFromCenter()\n\t{\n\t\t// watch for no valid target, in which case give no displacement\n\t\tdouble[] distance = new double[2];\n\t\tif (currentBestTarget != null)\n\t\t{\n\t\t\t// x increases to right, but y increased downwards, so invert y\n\t\t\tdistance[0] = (currentBestTarget.centerX - IMAGE_WIDTH/2.0 ) / (IMAGE_WIDTH/2);\n\t\t\tdistance[1] = -(currentBestTarget.centerY - IMAGE_HEIGHT/2.0) / (IMAGE_HEIGHT/2);\n\t\t}\n\t\treturn distance;\n\t}", "public double getOffset(){\n\t\tdouble percentHeight = networkTableValues.get(\"height\")/cameraHeightPixel;\n\t\t//Get the height of the frame in inches\n\t\tdouble cameraHeightInches = networkTableValues.get(\"height\")/percentHeight;\n\t\t//Get the width of the frame in inches\n\t\tdouble cameraWidthInches = cameraHeightInches*(cameraWidthPixel/cameraHeightPixel);\n\t\t//Get the distanceFromTower from the camera to the goal\n\t\tdistanceFromTower = (cameraWidthInches/2)/Math.tan(cameraFOV*(Math.PI/180));\n\t\t//Get the distanceFromTower from the camera to the base of the tower\n\t\tdouble horizontalDistance = Math.sqrt(Math.pow(distanceFromTower, 2) - Math.pow(towerHeight, 2));\n\t\t//Get offset in inches\n\t\tdouble distanceFromCenterInches = (networkTableValues.get(\"centerX\") / cameraWidthPixel)*cameraWidthInches;\n\t\tdouble offset = Math.atan((distanceFromCenterInches/distanceFromTower)*(180/Math.PI));\n\t\t\n\t\tSystem.out.println(\"OFFSET: \" + offset);\n\t\treturn offset;\n\t}", "public double getDistance() {\n\t\t// miles = miles/hr * s / (s/hr)\n\t\treturn (double)speed/10.0 * duration / 3600.0;\n\t}", "public double distanceTo(MC_Location loc)\n\t {\n\t\t // If dimensions are different, instead of throwing an exception just treat different dimensions as 'very far away'\n\t\t if(loc.dimension != dimension) return Double.MAX_VALUE/2; // don't need full max value so reducing so no basic caller wrap-around.\n\t\t \n\t\t // Pythagoras...\n\t\t double dx = x - loc.x;\n\t\t double dy = y - loc.y;\n\t\t double dz = z - loc.z;\n\t\t return Math.sqrt(dx*dx + dy*dy + dz*dz);\n\t }", "private Vector3f calculateVectorDirectionBetweenEyeAndCenter() {\n\t\tVector3f br = new Vector3f();\n\n\t\tbr.x = player.getPosition().x - camera.getPosition().x;\n\t\tbr.y = player.getPosition().y - camera.getPosition().y;\n\t\tbr.z = player.getPosition().z - camera.getPosition().z;\n\n\t\treturn br;\n\t}", "private void calculateCameraPosition(float hDistance, float vDistance)\n\t{\n\t\tfloat theta=player.getRotY()+angleAroundPlayer;\n\t\tfloat offsetX=hDistance*(float)Math.sin(Math.toRadians(theta));\n\t\tfloat offsetZ=hDistance*(float)Math.cos(Math.toRadians(theta));\n\t\t\n\t\t//calculate camera position\n\t\tposition.x=player.getPosition().x-offsetX;\n\t\tposition.z=player.getPosition().z-offsetZ;\n\t\tposition.y=player.getPosition().y+vDistance;\n\t}", "double getDistanceInMiles();", "public double calcDistance(Planet p){\n double sq_dis = (xxPos - p.xxPos) * (xxPos - p.xxPos) + (yyPos - p.yyPos) * (yyPos - p.yyPos);\n double distance = Math.sqrt(sq_dis);\n return distance;\n }", "long closest(double lon, double lat) {\n return kdTreeForNearestNeighbor.nearest(lon, lat);\n }", "@Override\n\tpublic int getDistanceFrom(final SabrePlayer other) {\n\t\tGuard.ArgumentNotNull(other, \"other\");\n\t\t\n\t\tif (!isOnline() || !other.isOnline()) {\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tLocation myLocation = bukkitPlayer.getLocation();\n\t\tLocation otherLocation = other.getBukkitPlayer().getLocation();\n\t\tint dx = otherLocation.getBlockX() - myLocation.getBlockX();\n\t\tint dz = otherLocation.getBlockZ() - myLocation.getBlockZ();\n\t\t\n\t\treturn (int)Math.sqrt(Math.pow(dx, 2) + Math.pow(dz, 2));\n\t}", "public double getFurthermostDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMax = 0.0;\n\t\t\tPoint centroid = centroid();\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}\n\t\t\t}\n\t\t\treturn distanceMax;\n\t\t}", "public float getMeasuredSizeCorrectedByPerspective() {\n float scale = getPerspectiveScaleFactor(location);\n if (scale <= 0) {\n return averageEventDistance;\n }\n return averageEventDistance / scale;\n }", "public double getMaxDistance()\n\t{\n\t // Make sure it went some distance\n\t\tif(xPosList.size() > 0)\n\t\t{\n\t\t\treturn this.xPosList.get(xPosList.size() - 1);\n\t\t}\n\n\t\treturn 0;\n\t}", "public float distanceTo(YUV yuv){\n//\t\treturn (float)Math.sqrt((u-yuv.u)*(u-yuv.u) + (v-yuv.v)*(v-yuv.v));\n\t\treturn (float)Math.sqrt((u-yuv.u)*(u-yuv.u) + (v-yuv.v)*(v-yuv.v) + (y-yuv.y)*(y-yuv.y));\n\t}", "public float getRadiusCorrectedForPerspective() {\n float scale = 1 / getPerspectiveScaleFactor(location);\n return radius * scale;\n }", "public int compareDistance(Route r2) {\n return this.distance - r2.distance;\n }", "public float getDistance()\n {\n return distance_slider.getValue() / DISTANCE_SCALE_FACTOR;\n }", "double distance (double px, double py);", "public int getDistance(){\n if (distance == 0) {\n int tourDistance = 0;\n // Loop through our tour's cities\n for (int cityIndex=0; cityIndex < tourSize(); cityIndex++) {\n // Get city we're travelling from\n City fromCity = getCity(cityIndex);\n // City we're travelling to\n City destinationCity;\n // Check we're not on our tour's last city, if we are set our \n // tour's final destination city to our starting city\n if(cityIndex+1 < tourSize()){\n destinationCity = getCity(cityIndex+1);\n }\n else{\n destinationCity = getCity(0);\n }\n // Get the distance between the two cities\n tourDistance += fromCity.distanceTo(destinationCity);\n }\n distance = tourDistance;\n }\n return distance;\n }", "private double getDistance(Vector2i tile, Vector2i goal) {\n\t\t double dx = tile.getX() - goal.getX();\n\t\t double dy = tile.getY() - goal.getY();\n\t\t return Math.sqrt(dx * dx + dy *dy); //distance \n\t }", "public double getClosestDistance(){\n\t\t\tdouble distance;\n\t\t\tdouble distanceMin = Double.MAX_VALUE;\n\t\t\tPoint centroid = centroid();\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}\n\t\t\t}\n\t\t\treturn distanceMin;\n\t\t}", "double getSquareDistance();", "public double calcDistance(Planet p){\n\t\treturn(Math.sqrt((this.xxPos-p.xxPos)*(this.xxPos-p.xxPos)\n\t\t\t+(this.yyPos-p.yyPos)*(this.yyPos-p.yyPos)));\n\t}", "private float distanceTo(BasicEvent event) {\n final float dx = event.x - location.x;\n final float dy = event.y - location.y;\n// return Math.abs(dx)+Math.abs(dy);\n return distanceMetric(dx, dy);\n// dx*=dx;\n// dy*=dy;\n// float distance=(float)Math.sqrt(dx+dy);\n// return distance;\n }", "private double getDistance(Vector2i tile, Vector2i goal) {\r\n\t\tdouble dx = tile.getX() - goal.getX();\r\n\t\tdouble dy = tile.getY() - goal.getY();\r\n\t\treturn Math.sqrt((dx * dx) + (dy * dy));\r\n\t}", "private double[] getGoalPointAtLookaheadDistance(\n double[] initialPointOfLine, double[] finalPointOfLine, double[] nearestPoint) {\n\n // TODO: use lookahead distance proportional to robot max speed -> 0.5 * getRobotMaxSpeed()\n return Geometry.getPointAtDistance(\n initialPointOfLine, finalPointOfLine, nearestPoint, lookaheadDistance);\n }", "private Point findTrailingPt() {\n\t\tPoint farthestPt = new Point(getDisplayXs()[0], getDisplayYs()[0]);\n\t\tfor (int i = 0; i < getDisplayXs().length; i++) {\n\t\t\tPoint nextPt = new Point(getDisplayXs()[i], getDisplayYs()[i]);\n\t\t\tPoint centerOfMass = Controller.flowArrow.findCenterOfMass();\n\t\t\tif (farthestPt.distance(centerOfMass) < nextPt.distance(centerOfMass)) {\n\t\t\t\tfarthestPt = nextPt; // update fartestPt\n\t\t\t}\n\t\t}\n\t\treturn farthestPt;\n\t}", "public float getDistance() {\r\n return distance;\r\n }", "private void getDistance() {\n\n float dist = 0;\n Location location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n while (location==null) { //If we don't know where we are right now\n Toast.makeText(this, \"No last known location. Aborting...\", \n Toast.LENGTH_LONG).show();\n location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n\n createPositions();\n\n dist = location.distanceTo(mPositions.get(0).toLocation());\n distanceList.add(dist);\n\n dist = mPositions.get(0).toLocation().distanceTo(mPositions.get(1).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(1).toLocation().distanceTo(mPositions.get(2).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(2).toLocation().distanceTo(mPositions.get(3).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(3).toLocation().distanceTo(mPositions.get(4).toLocation());\n distanceList.add(dist);\n \n }", "public Vector3D getDistance()\n\t{\n\t\treturn distance;\n\t}", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "public double ComputeDistance(){ \n\t\tdouble lat1 = this.depAirportCity.getLatDegs() + (double)(this.depAirportCity.getLatMins())/60; \n\t\tdouble lon1 = this.depAirportCity.getLongDegs() + (double)(this.depAirportCity.getLongMins())/60;\n\t\tdouble lat2 = this.arrAirportCity.getLatDegs() + (double)(this.arrAirportCity.getLatMins())/60; \n\t\tdouble lon2 = this.arrAirportCity.getLongDegs() + (double)(this.arrAirportCity.getLongMins())/60;\n\t\t\n\t\tdouble distance = Haversine.getMiles(lat1, lon1, lat2, lon2);\n\t\treturn distance;\n\t}", "public double getMaximumDistance() {\n double l = 0;\n int stop = getDistanceEnd();\n\n calculateDistances();\n\n for (int i = 0; i < stop; i++) {\n l = Math.max(l, distances[i]);\n }\n\n return l;\n }", "public final float getDistance() {\n return distance;\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 }", "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}", "public float getDistance() {\n return distance;\n }", "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 }", "private void calcularDistanciaRecorrer(){\r\n\t\tfloat diferenciax = siguientePunto.x - posicion.x;\r\n\t\tfloat diferenciay = siguientePunto.y - posicion.y;\r\n\t\tdistanciaRecorrer = (float) Math.sqrt(diferenciax*diferenciax+diferenciay*diferenciay);\r\n\t}", "public float getDistance() {\n return distance;\n }", "public double calcDistance(Planet p){\n\t\tdouble dx=-(xxPos-p.xxPos);\n\t\tdouble dy=-(yyPos-p.yyPos);\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}", "private static int predictDistance(Position source, Position target) {\n int x = source.getX() - target.getX();\n int y = source.getY() - target.getY();\n int c = (int)Math.ceil(Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)));\n return c;\n }", "double getDistance(Point p);", "public double getDistance() {\n\n final int R = 6371; // Radius of the earth\n double lat1 = latitude;\n double lon1 = longitude;\n double lat2 = 41.917715; //lat2, lon2 is location of St.Charles, IL\n double lon2 = -88.266027;\n double el1=0,el2 = 0;\n double latDistance = Math.toRadians(lat2 - lat1);\n double lonDistance = Math.toRadians(lon2 - lon1);\n double a = Math.sin(latDistance / 2) * Math.sin(latDistance / 2)\n + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2))\n * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double distance = R * c * 1000; // convert to meters\n\n double height = el1 - el2;\n\n distance = Math.pow(distance, 2) + Math.pow(height, 2);\n\n return Math.sqrt(distance);\n }", "private double getDistance(float x, float y, float x1, float y1) {\n double distanceX = Math.abs(x - x1);\n double distanceY = Math.abs(y - y1);\n return Math.sqrt(distanceX * distanceX + distanceY * distanceY);\n }", "public int getAbsoluteDistance() {\r\n\t\t\treturn Math.abs(distance);\r\n\t\t}", "@Override\r\n public double getOriginDistance()\r\n {\r\n double distance=Math.sqrt(\r\n Math.pow(origin.getYCoordinate(), 2)+Math.pow(origin.getYCoordinate(), 2));\r\n return distance;\r\n }", "public double calcDistance(Planet p){\n\t\tdouble dx = p.xxPos - this.xxPos;\n\t\tdouble dy = p.yyPos - this.yyPos ;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\n\t}", "float getFocusDistancePref(boolean is_target_distance);", "public double getDragDistanceFromCursorPressedEvent() {\r\n\t\tif ((this.lastChangedEvent != null) && (this.lastPressedEvent != null)) {\r\n\t\t\treturn lastChangedEvent.getPosition().distance(\r\n\t\t\t\t\tlastPressedEvent.getPosition());\r\n\t\t}\r\n\r\n\t\treturn Double.NaN;\r\n\t}", "public int getClientViewDistance ( ) {\n\t\treturn extract ( handle -> getClientViewDistance ( ) );\n\t}", "public Vector2 getDistance(Vector2 start, Vector2 destinatin, Vector2 offset) {\r\n if(this.grid.contains(start, offset)) {\r\n if(this.grid.contains(destinatin, offset)) {\r\n // Get Start Rectangle with scene offset\r\n Rectangle current = this.grid.getRectAtPosition(start, offset);\r\n Rectangle destination = grid.getRectAtPosition(destinatin, offset);\r\n int xA = (destination.getX() - current.getX()) / 48;\r\n int yA = (destination.getY() - current.getY()) / 48;\r\n return new Vector2(xA, yA);\r\n }\r\n }\r\n return null;\r\n }", "public double calcDistance(Planet p){\n\t\t\tdouble dx = this.xxPos - p.xxPos;\n\t\t\tdouble dy = this.yyPos - p.yyPos;\n\t\treturn Math.sqrt(dx*dx + dy*dy);\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate D getClosestDirection()\n\t{\n\t\tdouble minDistance = Double.MAX_VALUE;\n\t\tIDirection minDir = direction.getClass().getEnumConstants()[0];\n\t\tfor (IDirection dir : direction.getClass().getEnumConstants())\n\t\t{\n\t\t\tdouble temp = calculateNewDistance(dir);\n\t\t\tif (temp < minDistance)\n\t\t\t{\n\t\t\t\tminDir = dir;\n\t\t\t\tminDistance = temp;\n\t\t\t}\n\t\t}\n\t\treturn (D) minDir;\n\t}", "public float distanceToMouse() { \n PVector temp = new PVector(p.mouseX, p.mouseY);\n return pos.dist(temp);\n }", "public final int getMaxLinkDistance() {\n\t\tint r = 0;\n\t\tlockMe(this);\n\t\tr = maxLinkDistance;\n\t\tunlockMe(this);\n\t\treturn r;\n\t}", "public static int getFurthestViewableBlock(int distance)\r\n {\r\n return distance * 16 - 16;\r\n }", "public double getFinalDistance(){\n return valori.get(end_node);\n }", "public static double getDistanceOnScreen(Vector2F v1, Vector2F v2) {\n\t\tfloat vector1 = v1.xPos - v2.xPos;\n\t\tfloat vector2 = v2.yPos - v2.yPos;\n\t\treturn Math.sqrt(vector1 * vector1 + vector2 * vector2);\n\t}", "final static double getMaxVelocity(double distance) {\n final double decelTime = Math.max(1, Math.ceil(\n //sum of 0... decelTime, solving for decelTime\n //using quadratic formula, then simplified a lot\n Math.sqrt(distance + 1) - 0.5));\n\n final double decelDist = (decelTime) * (decelTime - 1);\n // sum of 0..(decelTime-1)\n // * Rules.DECELERATION*0.5;c\n\n return ((decelTime - 1) * 2) + ((distance - decelDist) / decelTime);\n }", "public int drivenDistance() {\n return (int) Math.round(rightMotor.getTachoCount() / DISTANCE_RATIO);\n }", "private double calcDistance(RenderedImage other) {\n\t\t// Calculate the signature for that image.\n\t\tColor[][] sigOther = calcSignature(other);\n\t\t// There are several ways to calculate distances between two vectors,\n\t\t// we will calculate the sum of the distances between the RGB values of\n\t\t// pixels in the same positions.\n\t\tdouble dist = 0;\n\t\tfor (int x = 0; x < 5; x++)\n\t\t\tfor (int y = 0; y < 5; y++) {\n\t\t\t\tint r1 = signature[x][y].getRed();\n\t\t\t\tint g1 = signature[x][y].getGreen();\n\t\t\t\tint b1 = signature[x][y].getBlue();\n\t\t\t\tint r2 = sigOther[x][y].getRed();\n\t\t\t\tint g2 = sigOther[x][y].getGreen();\n\t\t\t\tint b2 = sigOther[x][y].getBlue();\n\t\t\t\tdouble tempDist = Math.sqrt((r1 - r2) * (r1 - r2) + (g1 - g2)\n\t\t\t\t\t\t* (g1 - g2) + (b1 - b2) * (b1 - b2));\n\t\t\t\tdist += tempDist;\n\t\t\t}\n\t\treturn dist;\n\t}", "public Point getCameraOffset() {\n Point offset = new Point(getPlayer().getCenterX() - screenWidthMiddle,\n getPlayer().getCenterY() - screenHeightMiddle);\n reboundCameraOffset(offset, EnumSet.of(Direction.LEFT, Direction.RIGHT));\n // we want to add these offsets to the player's x and y, so invert them\n offset.x = -offset.x;\n offset.y = -offset.y;\n return offset;\n }" ]
[ "0.7463696", "0.66511416", "0.65244204", "0.6451511", "0.6417933", "0.6390298", "0.6375521", "0.6343751", "0.6301657", "0.62868994", "0.6274668", "0.6246391", "0.62437546", "0.61661714", "0.6163618", "0.6145017", "0.6095391", "0.6092709", "0.60530883", "0.6017314", "0.6012642", "0.59789085", "0.595966", "0.594896", "0.59459126", "0.5945259", "0.5933942", "0.5911668", "0.5871496", "0.58593553", "0.5833446", "0.5814696", "0.5806836", "0.5802794", "0.57921475", "0.5788655", "0.5750703", "0.57149005", "0.57005954", "0.5678434", "0.5672709", "0.5654493", "0.564457", "0.5622131", "0.5619806", "0.5617472", "0.5615686", "0.56135225", "0.5600149", "0.55867", "0.5585969", "0.5584256", "0.5584105", "0.5583207", "0.5577063", "0.55700636", "0.55653363", "0.5561982", "0.5560091", "0.5552645", "0.5546048", "0.5543573", "0.55425876", "0.55281144", "0.55272216", "0.55222064", "0.55203503", "0.5518843", "0.5514337", "0.55136967", "0.54931784", "0.5488109", "0.5480898", "0.5470622", "0.5467905", "0.54639703", "0.5455216", "0.54486585", "0.5441767", "0.54385316", "0.5432541", "0.5420671", "0.5416385", "0.54113245", "0.5400988", "0.5400194", "0.53995585", "0.53989035", "0.53831697", "0.5380581", "0.5378229", "0.53652894", "0.53622335", "0.53607535", "0.5354688", "0.5348966", "0.53443927", "0.53443325", "0.53342956", "0.5330727", "0.53290474" ]
0.0
-1
Register JAXRS application components.
public JerseyInitializer() { this.register(new JacksonJsonProvider(ObjectMapperFactory.create())); this.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true); this.property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true); this.packages(true, "com.hh.resources"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MyDemoApplication(){\n\t\t//System.out.println(\"hi\");\n\t\t/*register(RequestContextFilter.class);\n\t\tregister(RestServiceUsingJersey.class);\n\t\tregister(ServiceYearImpl.class);\n\t\tregister(YearDaoImpl.class);\n\t\tregister(JacksonFeature.class);*/\n\t\t\n\t\t/**\n\t\t * Register JAX-RS application components.\n\t\t */\n\t\t\n\t\t\t\n\t packages(\"com.reporting.webapi\");\n\n\t\t\t// register features\n\t\t\tEncodingFilter.enableFor(this, GZipEncoder.class);\t\t\n\t\t\t\n\t\n\n\t}", "@Override\n public void run(Configuration configuration, Environment environment) throws Exception {\n environment.jersey().register(new AdminRESTAPI());\n environment.jersey().register(new ProfessorRESTAPI());\n environment.jersey().register(new StudentRESTAPI());\n }", "@Override\n\tprotected void registerResources(final ApplicationFactory appFactory, final AppConfiguration configuration, final Environment environment) {\n\t\t\n\t\t/** Inject the book repository into the book resources **/\n\t\tfinal BookRepository bookRepository = appFactory.database().repos(Book.class);\n\t\tenvironment.jersey().register(new BookResource(bookRepository));\n\t}", "public RestApplication() {\n\t\tsingletons.add(new UtilResource());\n\t\tsingletons.add(new StudentResource());\n\t}", "@Override\n public void register() {\n }", "@Bean\n public ServletRegistrationBean resteasyServlet() {\n final ServletRegistrationBean registrationBean = new ServletRegistrationBean();\n registrationBean.setServlet(new HttpServletDispatcher());\n registrationBean.setName(RestCoreConstant.RESTEASY_NAME.getValue());\n registrationBean.addUrlMappings(apiUrlMappingPrefix + \"/*\");\n registrationBean.addInitParameter(RestCoreConstant.RESTEASY_APPLICATION.getValue(),\n RestCoreConstant.RESTEASY_APPLICATION_VALUE.getValue());\n return registrationBean;\n }", "@Override\r\n\tpublic void register() {\n\t\t\r\n\t}", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n\n }", "protected void registerObjectMapper() {\n\n ObjectMapper mapper = JacksonMapperRegistry.get();\n\n // create JsonProvider to provide custom ObjectMapper\n JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider(mapper, JacksonJaxbJsonProvider.DEFAULT_ANNOTATIONS);\n //provider.setMapper(mapper);\n\n register(provider);\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n }", "public Object register(HttpServletRequest req);", "@Override\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\t\n\t}", "public interface IApplicationWs {\n\n\tString INSTANCE_PATH_PREFIX = \"/instance/\";\n\tString OPTIONAL_INSTANCE_PATH = \"{instancePath:(\" + INSTANCE_PATH_PREFIX + \"[^/]+?)?}\";\n\tString PATH = \"/\" + UrlConstants.APP + \"/{name}\";\n\n\n\t/**\n\t * Performs an action on an instance of an application.\n\t * @param applicationName the application name\n\t * @param action see {@link ApplicationAction}\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @param applyToAllChildren only makes sense when instancePath is not null\n\t * <p>\n\t * True to apply this action to all the children too, false to apply it only to this instance.\n\t * </p>\n\t *\n\t * @return a response\n\t */\n\t@POST\n\t@Path( \"/{action}\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tResponse perform( @PathParam(\"name\") String applicationName, @PathParam(\"action\") String action, @PathParam(\"instancePath\") String instancePath, boolean applyToAllChildren );\n\n\n\t/**\n\t * Adds a new instance.\n\t * @param applicationName the application name\n\t * @param parentInstancePath the path of the parent instance (optional, null to consider the application as the root)\n\t * @param instance the new instance\n\t * @return a response\n\t */\n\t@POST\n\t@Path( \"/add\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tResponse addInstance( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String parentInstancePath, Instance instance );\n\n\n\t/**\n\t * Lists the paths of the children of an instance.\n\t * @param applicationName the application name\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @return a non-null list\n\t */\n\t@GET\n\t@Path( \"/children\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Instance> listChildrenInstances( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String instancePath );\n\n\n\t/**\n\t * Lists the paths of the children of an instance.\n\t * @param applicationName the application name\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @return a non-null list\n\t */\n\t@GET\n\t@Path( \"/all-children\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Instance> listAllChildrenInstances( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String instancePath );\n\n\n\t/**\n\t * Finds possible components under a given instance.\n\t * <p>\n\t * This method answers the question: what can we deploy on this instance?\n\t * </p>\n\t *\n\t * @param applicationName the application name\n\t * @param instancePath the instance path (optional, null to consider the application as the root)\n\t * @return a non-null list of components names\n\t */\n\t@GET\n\t@Path( \"/possibilities\" + OPTIONAL_INSTANCE_PATH )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Component> findPossibleComponentChildren( @PathParam(\"name\") String applicationName, @PathParam(\"instancePath\") String instancePath );\n\n\n\t/**\n\t * Lists the available components in this application.\n\t * @param applicationName the application name\n\t * @return a non-null list of components\n\t */\n\t@GET\n\t@Path( \"/components\" )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Component> listComponents( @PathParam(\"name\") String applicationName );\n\n\n\t/**\n\t * Finds possible parent instances for a given component.\n\t * <p>\n\t * This method answers the question: where could I deploy such a component?\n\t * </p>\n\t *\n\t *\n\t * @param applicationName the application name\n\t * @return a non-null list of instances paths\n\t */\n\t@GET\n\t@Path(\"/component/{componentName}\")\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<String> findPossibleParentInstances( @PathParam(\"name\") String applicationName, @PathParam(\"componentName\") String componentName );\n\n\n\t/**\n\t * Creates an instance from a component name.\n\t * @param applicationName the application name\n\t * @return a response\n\t */\n\t@GET\n\t@Path(\"/component/{componentName}/new\")\n\t@Produces( MediaType.APPLICATION_JSON )\n\tInstance createInstanceFromComponent( @PathParam(\"name\") String applicationName, @PathParam(\"componentName\") String componentName );\n}", "public static void configure(ConqueryConfig config, ResourceConfig jersey) {\n\t\t((DefaultServerFactory)config.getServerFactory()).setRegisterDefaultExceptionMappers(false);\n\t\t// Register custom mapper\n\t\tjersey.register(new JsonValidationExceptionMapper());\n\t\t// default Dropwizard's exception mappers\n\t\tjersey.register(new LoggingExceptionMapper<Throwable>() {});\n\t\tjersey.register(new JsonProcessingExceptionMapper(true));\n\t\tjersey.register(new EarlyEofExceptionMapper());\n\t\t//allow cross origin\n\t\tif(config.getApi().isAllowCORSRequests())\n\t\t\tjersey.register(CORSResponseFilter.class);\n\t\t//disable all browser caching if not expressly wanted\n\t\tjersey.register(CachingFilter.class);\n\t}", "protected void registerApplicationBeans(ApplicationModel applicationModel, ScopeBeanFactory beanFactory) {\n// beanFactory.registerBean(MetadataReportInstance.class);\n// beanFactory.registerBean(RemoteMetadataServiceImpl.class);\n }", "public JerseyConfig() {\n\t\tregister(StudentService.class);\n\t\tregister(PromotionService.class);\n\t\tregister(GroupService.class);\n\t\tregister(RoleService.class);\n\t\tregister(RightService.class);\n\t\tregister(AccountService.class);\n\t\tregister(TimesheetService.class);\n\t\tthis.configureSwagger();\n\t}", "public void register(){\n }", "public void registerSerializer(ExtensionRegistry registry) {\n // Register and map Rest Binding\n registry.registerSerializer(Binding.class, RestConstants.QNAME_BINDING, this);\n registry.registerDeserializer(Binding.class, RestConstants.QNAME_BINDING, this);\n registry.mapExtensionTypes(Binding.class, RestConstants.QNAME_BINDING, RestBinding.class);\n\n // Register and map Rest Operation\n registry.registerSerializer(BindingOperation.class, RestConstants.QNAME_OPERATION, this);\n registry.registerDeserializer(BindingOperation.class, RestConstants.QNAME_OPERATION, this);\n registry.mapExtensionTypes(BindingOperation.class, RestConstants.QNAME_OPERATION, RestOperation.class);\n\n // Register and map Rest Address\n registry.registerSerializer(Port.class, RestConstants.QNAME_ADDRESS, this);\n registry.registerDeserializer(Port.class, RestConstants.QNAME_ADDRESS, this);\n registry.mapExtensionTypes(Port.class, RestConstants.QNAME_ADDRESS, RestAddress.class);\n }", "@Decorator\n@RegisterRestClient\n@RegisterProvider(BookService.TracingActivator.class)\n@Path(\"/books\")\n@Consumes(APPLICATION_JSON)\n@Produces(APPLICATION_JSON)\npublic interface BookService {\n @GET\n Response findAll();\n\n @GET\n @Path(\"/{id}\")\n Response findById(@PathParam(\"id\") final Long id);\n\n @POST\n Response create(final JsonObject book);\n\n @DELETE\n @Path(\"/{id}\")\n Response delete(@PathParam(\"id\") final Long id);\n\n\n // workaround cause ClientTracingRegistrar requires to use ClientAPI and not @RegisterProvider\n @Dependent\n class TracingActivator implements ClientRequestFilter, ClientResponseFilter {\n private final ClientRequestFilter request;\n private final ClientResponseFilter response;\n\n public TracingActivator() {\n request = create(\"org.apache.geronimo.microprofile.opentracing.microprofile.client.CdiOpenTracingClientRequestFilter\", ClientRequestFilter.class);\n response = create(\"org.apache.geronimo.microprofile.opentracing.microprofile.client.CdiOpenTracingClientResponseFilter\", ClientResponseFilter.class);\n }\n\n @Override\n public void filter(final ClientRequestContext requestContext) throws IOException {\n if (request != null) {\n request.filter(requestContext);\n }\n }\n\n @Override\n public void filter(final ClientRequestContext requestContext, final ClientResponseContext responseContext) throws IOException {\n if (response != null) {\n response.filter(requestContext, responseContext);\n }\n }\n\n private static <T> T create(final String fnq, final Class<T> type) {\n try {\n return type.cast(CDI.current().select(Thread.currentThread().getContextClassLoader().loadClass(fnq)).get());\n } catch (final ClassNotFoundException e) {\n return null;\n }\n }\n }\n}", "@Bean\n public ServletContextListener resteasyBootstrap() {\n return new ResteasyBootstrap();\n }", "@Override\n protected void register(ExtendedHttpService service, FilterProxy<? extends Filter> filter)\n throws ServletException, NamespaceException {\n service.registerFilter(\"/\", filter, null, null);\n }", "static void register() {\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n super.addResourceHandlers(registry);\n }", "@POST\n @Path(\"register\")\n @Produces(MediaType.APPLICATION_JSON)\n public JAXResult register(UserBE user){\n return null;\n }", "@Component(modules = {ApplicationModule.class,HttpModule.class})\npublic interface ApplicationComponent {\n\n MyApp getApplication();\n\n NewsApi getNetEaseApi();\n\n JanDanApi getJanDanApi();\n\n Context getContext();\n\n}", "@Override\r\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tsuper.addResourceHandlers(registry);\r\n\t}", "public CustomApplication() \n {\n packages(\"com.SApp.Ticket.tools\");\n// register(LoggingFilter.class);\n \n //Register Auth Filter here\n register(AuthenticationFilter.class);\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n super.addResourceHandlers(registry);\n }", "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(co.matisses.web.mbean.BaruApplicationMBean.class);\n resources.add(co.matisses.web.mbean.ImagenProductoMBean.class);\n resources.add(co.matisses.web.rest.ClienteWebFacadeREST.class);\n resources.add(co.matisses.web.rest.DepartamentoSAPFacadeREST.class);\n resources.add(co.matisses.web.rest.EmpaqueVentaFacadeREST.class);\n resources.add(co.matisses.web.rest.EmpleadoFacadeREST.class);\n resources.add(co.matisses.web.rest.FacturaSAPFacadeREST.class);\n resources.add(co.matisses.web.rest.ItemInventarioFacadeREST.class);\n resources.add(co.matisses.web.rest.MercadoLibreREST.class);\n resources.add(co.matisses.web.rest.MunicipioFacadeREST.class);\n resources.add(co.matisses.web.rest.NotaCreditoFacadeREST.class);\n resources.add(co.matisses.web.rest.OperacionCajaFacadeREST.class);\n resources.add(co.matisses.web.rest.POSSessionValidatorREST.class);\n resources.add(co.matisses.web.rest.SocioDeNegociosFacadeREST.class);\n resources.add(co.matisses.web.rest.TarjetaCreditoSAPFacadeREST.class);\n resources.add(co.matisses.web.rest.TipoDocumentoREST.class);\n resources.add(co.matisses.web.rest.VentaPOSFacadeREST.class);\n resources.add(co.matisses.web.rest.regalos.ConsultaProductosREST.class);\n resources.add(co.matisses.web.rest.regalos.ContactoREST.class);\n resources.add(co.matisses.web.rest.regalos.FiltrosProductoREST.class);\n resources.add(co.matisses.web.rest.regalos.ListaRegalosREST.class);\n resources.add(co.matisses.web.rest.regalos.ListaRegalosSessionValidatorREST.class);\n }", "private void configureServices(Environment environment){\n DaoCountry country = new DaoCountry(hibernateBundle.getSessionFactory());\n DaoAddress address = new DaoAddress(hibernateBundle.getSessionFactory());\n\n environment.jersey().register(new ServiceCountry(country));\n environment.jersey().register(new ServiceAddress(address));\n }", "public interface IResteasyService {\r\n\t\r\n\t/**\r\n\t * Service name inside OSGi namespace service registration.\r\n\t */\r\n\tpublic static final String SERVICE_NAME = ResteasyService.class.getName();\r\n\r\n\t/**\r\n\t * Add a SingletonResource.\r\n\t * @param resource\r\n\t */\r\n\tpublic void addSingletonResource(Object resource);\r\n\t\r\n\t/**\r\n\t * Remove a SingletonResource.\r\n\t * @param clazz\r\n\t */\r\n\tpublic void removeSingletonResource(Class<?> clazz);\r\n\r\n}", "@Path(\"/api/khy\")\n@Produces(\"application/json\")\npublic interface LegaliteDysRESTApis {\n\n @POST\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n @Path(\"/belge-durum-guncelle\")\n SimpleResponse belgeDurumGuncelle(BelgeDurumuModel belgeDurum);\n\n @POST\n @Consumes(\"application/json\")\n @Produces(\"application/json\")\n @Path(\"/belge-al\")\n SimpleResponse belgeGonder(BelgeAlRestModel request);\n}", "@Produces(MediaType.APPLICATION_JSON)\n@Path(\"/stores/{store_id}/register\")\npublic interface RegisterResource {\n\n /**\n * GET endpoint for <code>Register</code> entity with given id.\n * \n * @param registerId <code>Register</code> entity id\n * @return <code>Response</code> object which holds response status \n * code and representation of <code>Register</code> entity\n */\n @GET\n @Path(\"/{register_id}\")\n Response getRegisterById(@PathParam(\"register_id\") Long registerId);\n\n /**\n * Creates endpoint for <code>Register</code> entity.\n * \n * @param registerDto <code>Register</code> data transfer object to which request\n * payload will be mapped to\n * @param storeId <code>Store</code> id to which <code>Register</code> entity\n * relates to\n * @param uriInfo an object that provides access to application and request URI\n * information\n * @return <code>Response</code> object which holds representation of saved\n * <code>Register</code> entity, response status code and URI of\n * newly created entity\n */\n @POST\n @Consumes(MediaType.APPLICATION_JSON)\n Response create(@Valid @NotNull RegisterDTO registerDto, @PathParam(\"store_id\") Long storeId, @Context UriInfo uriInfo);\n\n /**\n * Update endpoint for <code>Register</code> entity.\n * \n * @param registerDto <code>Register</code> data transfer object to which request\n * payload data will be mapped to\n * @param registerId id of <code>Register</code> entity to be updated\n * @return <code>Response</code> object containing representation of \n * updated <code>Store</code> entity and response status code\n */\n @PUT\n @Path(\"/{register_id}\")\n @Consumes(MediaType.APPLICATION_JSON)\n Response update(@Valid @NotNull RegisterDTO registerDto, @PathParam(\"store_id\") Long storeId, @PathParam(\"register_id\") Long registerId);\n\n /**\n * Delete endpoint for <code>Register</code> entity.\n * \n * @param registerId id of <code>Register</code> entity to be deleted\n * @return <code>Response</code> object containing response status code\n */\n @DELETE\n @Path(\"/{register_id}\")\n Response delete(@PathParam(\"register_id\") Long registerId);\n\n}", "public boolean registerApplication(Application application);", "void register(String name, Object bean);", "@GET\n\t@Path( \"/components\" )\n\t@Produces( MediaType.APPLICATION_JSON )\n\tList<Component> listComponents( @PathParam(\"name\") String applicationName );", "protected void registerServlets(ServletContextHandler handler) {\n\t}", "@Override\n protected void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"swagger-ui.html\")\n .addResourceLocations(\"classpath:/META-INF/resources/\");\n \n registry.addResourceHandler(\"/webjars/**\")\n .addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n }", "@Component(modules = {ApplicationModule.class, HttpModule.class})\npublic interface ApplicationComponent {\n MyApp getApplication();\n\n ApiService getApiService();\n\n Context getContext();\n\n}", "@Override\n\t\tpublic void registerResource(FlexoResource<?> resource, InJarResourceImpl serializationArtefact) {\n\t\t\tregisterResource(resource);\n\t\t}", "public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry)\n/* */ {\n/* 48 */ if (!ADFRuntime.getRuntime().isClientSide())\n/* */ {\n/* 50 */ return;\n/* */ }\n/* */ \n/* 53 */ ADFConfigHelper.initConfig();\n/* 54 */ ADFConfigHelper.initLog4j();\n/* 55 */ ADFBeanDefinitionRegistryRegister scanner = new ADFBeanDefinitionRegistryRegister(registry);\n/* 56 */ Class[] typeClasses = { InternalBeanInstantiationAwareBeanPostProcessor.class, InternalBeanPosterProcessor.class, ApplicationStartedListener.class, ApplicationContextBeansAware.class };\n/* */ \n/* 58 */ scanner.register(typeClasses);\n/* */ \n/* */ \n/* 61 */ scanner.register(new Class[] { BeanAdditionalPropertyGenerator.class });\n/* */ \n/* */ \n/* 64 */ ADFClassPathBeanDefinitionScanner classPathBeanDefinitionScanner = new ADFClassPathBeanDefinitionScanner(registry, true);\n/* */ \n/* 66 */ if (StringUtils.isNotEmpty(\"com.jnj.adf.grid,com.jnj.adf.client.api\"))\n/* */ {\n/* 68 */ String[] basePackages = \"com.jnj.adf.grid,com.jnj.adf.client.api\".split(\",\");\n/* 69 */ classPathBeanDefinitionScanner.scan(basePackages);\n/* */ }\n/* */ }", "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(CorsFilter.class);\n resources.add(ExceptionHandler.class);\n resources.add(org.glassfish.jersey.server.wadl.internal.WadlResource.class);\n resources.add(BaseResource.class);\n resources.add(CustomerResource.class);\n }", "private void addRestResourceClasses(Set<Class<?>> resources) {\r\n resources.add(br.edu.femass.controleestagio.webservice.EstagioService.class);\r\n resources.add(br.edu.femass.controleestagio.webservice.Filter.class);\r\n resources.add(br.edu.femass.controleestagio.webservice.LoginService.class);\r\n }", "@Inject\n public MachineMonkeyRestApiImpl() {\n }", "static public void register () { QueryEngineRegistry.addFactory( factory ); }", "public void registerStompEndpoints(StompEndpointRegistry registry) {\r\n\t\tLog.info(\"WebSocketConfig : registerStompEndpoints : start\");\r\n\t\tregistry.addEndpoint(\"/ws\").withSockJS();\r\n\t\tLog.info(\"WebSocketConfig : registerStompEndpoints : end\");\r\n\t}", "@Remote\npublic interface IApplicationsResource {\n\n public List<ApplicationTO> getApplications();\n\n public String createApplication(ApplicationTO applicationTO);\n\n public ApplicationTO getApplication(String id) throws EntityNotFoundException;\n\n public void updateApplication(ApplicationTO applicationTO, String id) throws EntityNotFoundException;\n\n public void deleteApplication(String id) throws EntityNotFoundException;\n\n public Response restCreateApplication(ApplicationTO applicationTO);\n\n public Response restUpdateApplication(ApplicationTO applicationTO, String id) throws EntityNotFoundException;\n\n public Response restDeleteApplication(String id) throws EntityNotFoundException;\n}", "public void registerWithServer();", "public static synchronized void registerResourceProvider(ServletContext sc, ResourceProvider rp) {\n\t\tgetResourceProviderSet(sc).add(rp);\n\t\tSystem.out.println(\"ResourceServlet: \" + rp.getClass().getName() + \" registered as resource provider\");\n\t}", "@Bean\r\n public ServletRegistrationBean servletRegistrationBean() {\r\n FacesServlet servlet = new FacesServlet();\r\n ServletRegistrationBean reg = new ServletRegistrationBean(servlet, \"*.xhtml\");\r\n return reg;\r\n }", "@Singleton\n@Component (modules = {\n PagoPaAPIModule.class,\n NetModule.class,\n LogModule.class\n})\npublic interface PagoPaAPIComponent {\n PagoPaAPI getPagoPaAPI();\n}", "public Register() {\n \n initComponents();\n \n }", "<V> IBeanRuntime<V> registerExternalBean(V externalBean);", "Retrofit register(String identity, Retrofit retrofit);", "@Override\n public void onStartup(ServletContext container) {\n AnnotationConfigWebApplicationContext rootContext =\n new AnnotationConfigWebApplicationContext();\n rootContext.register(ApplicationConfig.class);\n rootContext.setConfigLocation(\"example.spring\");\n\n // Manage the lifecycle of the root application context\n container.addListener(new ContextLoaderListener(rootContext));\n container.addListener(new RequestContextListener());\n\n // The following line is required to avoid having jersey-spring3 registering it's own Spring root context.\n container.setInitParameter(\"contextConfigLocation\", \"\");\n\n }", "public void initApplicationContext()\r\n/* 32: */ throws BeansException\r\n/* 33: */ {\r\n/* 34:103 */ super.initApplicationContext();\r\n/* 35:104 */ registerHandlers(this.urlMap);\r\n/* 36: */ }", "public void registerComponents(XStream xstream) {\n\t\tfor(Converter converter : converters) {\n\t\t\txstream.registerConverter(converter);\n\t\t\tlogger.debug(\"registered Xstream converter for {}\", converter.getClass().getName());\n\t\t}\n\n\t\tfor(SingleValueConverter converter : singleValueConverters) {\n\t\t\txstream.registerConverter(converter);\n\t\t\tlogger.debug(\"registered Xstream converter for {}\", converter.getClass().getName());\n\t\t}\n\t}", "@Override\n public void registerStompEndpoints(StompEndpointRegistry registry) {\n registry.addEndpoint(\"/messages\").withSockJS();\n }", "public static void main(final String[] args) throws Exception {\n Resource.setDefaultUseCaches(false);\n Integer SERVER_PORT = Integer.parseInt(ManejadorPropiedades.leerPropiedad(\"app_cfg.properties\", \"app.port\"));\n String SERVER_HOST = ManejadorPropiedades.leerPropiedad(\"app_cfg.properties\", \"app.host\");\n String CONTEXT_PATH = ManejadorPropiedades.leerPropiedad(\"app_cfg.properties\", \"app.context_path\");\n \n final Server server = new Server(SERVER_PORT);\n System.setProperty(AppConfig.SERVER_PORT, SERVER_PORT.toString());\n System.setProperty(AppConfig.SERVER_HOST, SERVER_HOST);\n System.setProperty(AppConfig.CONTEXT_PATH, CONTEXT_PATH);\n \n\n // Configuring Apache CXF servlet and Spring listener \n final ServletHolder servletHolder = new ServletHolder(new CXFServlet());\n final ServletContextHandler context = new ServletContextHandler();\n context.setContextPath(\"/\");\n context.addServlet(servletHolder, \"/\" + CONTEXT_PATH + \"/*\");\n context.addEventListener(new ContextLoaderListener());\n context.setInitParameter(\"contextClass\", AnnotationConfigWebApplicationContext.class.getName());\n context.setInitParameter(\"contextConfigLocation\", AppConfig.class.getName());\n \n FilterHolder filterHolder = context.addFilter(CrossOriginFilter.class,\"/*\",EnumSet.allOf(DispatcherType.class));\n filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_ORIGINS_PARAM,\"*\");\n filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_HEADERS_PARAM,\"Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin\");\n filterHolder.setInitParameter(CrossOriginFilter.ALLOWED_METHODS_PARAM,\"GET,PUT,POST,DELETE,OPTIONS\");\n filterHolder.setInitParameter(CrossOriginFilter.PREFLIGHT_MAX_AGE_PARAM,\"5184000\");\n filterHolder.setInitParameter(CrossOriginFilter.ALLOW_CREDENTIALS_PARAM,\"true\");\n\n\n // Configuring Swagger as static web resource\n final ServletHolder swaggerHolder = new ServletHolder(new DefaultServlet());\n final ServletContextHandler swagger = new ServletContextHandler();\n swagger.setContextPath(\"/swagger\");\n swagger.addServlet(swaggerHolder, \"/*\");\n swagger.setResourceBase(new ClassPathResource(\"/webapp\").getURI().toString());\n\n final HandlerList handlers = new HandlerList();\n handlers.addHandler(swagger);\n handlers.addHandler(context);\n\n server.setHandler(handlers);\n server.start();\n server.join();\n }", "void register(final Bean bean);", "public void registerRenders() {\n }", "public Configuration() {\n\t\tpackages(\"apiservice.services\");\n\t\tregister(CORSFilter.class);\n\t\tregister(AuthenticationFilter.class);\n\t}", "@Override\n public void registerStompEndpoints(StompEndpointRegistry registry) {\n registry.addEndpoint(\"/boot-websocket\").withSockJS();\n }", "@Override\n public void onStartup(ServletContext sc) throws ServletException {\n AnnotationConfigWebApplicationContext rootApplicationContext = new AnnotationConfigWebApplicationContext();\n rootApplicationContext.register(RootAppConfig.class);\n sc.addListener(new ContextLoaderListener(rootApplicationContext));\n \n //kreiraj web application kontekst koji se vezuje za dispatcher servlet\n AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext();\n webApplicationContext.register(MvcConfig.class);\n \n //konfigurisanje dispatcher servlet-a\n ServletRegistration.Dynamic dispatcher = sc\n .addServlet(\"dispatcher\", new DispatcherServlet(webApplicationContext));\n dispatcher.addMapping(\"/\");\n dispatcher.setLoadOnStartup(1);\n }", "@ApplicationScope\n@Component(modules = {AppModule.class})\npublic interface AppComponent {\n\n void inject(MyApplication application);\n\n Application application();\n\n Gson gson();\n\n OkHttpClient okHttpClient();\n\n}", "@Singleton\n@Component(modules = {ContextModule.class, BusModule.class, GithubModule.class, GankModule.class, ZhiHuModule.class, RssModule.class})\npublic interface AppComponent {\n Context getContext();\n GankService getGankService();\n ZhiHuService getZhiHuService();\n RssService getRssService();\n EventBus getBus();\n}", "@Override\n public void onStartup(ServletContext servletContext) {\n AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();\n rootContext.register(AppConfig.class);\n\n // Manage the lifecycle of the application context\n servletContext.addListener(new ContextLoaderListener(rootContext));\n\n\n // Register and map the Spring Data Rest dispatcher servlet (must be before DispatcherServlet, why???):\n ServletRegistration.Dynamic rest = servletContext.addServlet(\"rest\", RepositoryRestDispatcherServlet.class);\n rest.setLoadOnStartup(1);\n rest.addMapping(\"/api/*\");\n\n\n // Create Dispatcher context\n AnnotationConfigWebApplicationContext dispatcherContext = new AnnotationConfigWebApplicationContext();\n dispatcherContext.register(MvcConfig.class);\n\n\n // Register and map the dispatcher servlet:\n ServletRegistration.Dynamic dispatcher = servletContext.addServlet(\"dispatcher\", new DispatcherServlet(dispatcherContext));\n dispatcher.setLoadOnStartup(1);\n dispatcher.addMapping(\"/\");\n dispatcher.setMultipartConfig(getMultipartConfigElement());\n }", "@Override\n public void onStartup(final ServletContext servletContext) throws ServletException {\n super.onStartup(servletContext);\n\n final MessageDispatcherServlet servlet = new MessageDispatcherServlet();\n servlet.setContextClass(AnnotationConfigWebApplicationContext.class);\n servlet.setTransformWsdlLocations(true);\n\n final ServletRegistration.Dynamic dispatcher =\n servletContext.addServlet(DISPATCHER_SERVLET_NAME, servlet);\n dispatcher.setLoadOnStartup(1);\n dispatcher.addMapping(DISPATCHER_SERVLET_MAPPING);\n }", "@Singleton\n@Component(modules = {AppModule.class, ProviderModule.class})\npublic interface AppComponent {\n Retrofit provideRetrofit();\n BaseApplication providesApplication();\n\n}", "@Override\n\tpublic void registerComponents(Context arg0, Glide arg1) {\n\n\t}", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/static/**\").addResourceLocations(\"/static/\");\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n // swagger\n// registry.addResourceHandler(\"swagger-ui.html\").addResourceLocations(\"classpath:/META-INF/resources/\");\n// registry.addResourceHandler(\"/webjars/**\").addResourceLocations(\"classpath:/META-INF/resources/webjars/\");\n \n }", "@Component(modules = AppModule.class)\npublic interface AppComponent\n{\n MemeHomeComponent add(MemeHomeModule memeHomeModule);\n CreateMemeComponent add(CreateMemeModule createMemeModule);\n SmartSearchComponent add(SmartSearchModule smartSearchModule);\n}", "public abstract void register();", "@Autowired\r\n\tpublic RegisterImpl(RestTemplateBuilder restTemplateBuilder, @Value(\"${applicationserver.rest.url}\") String applicationServerUrl) {\r\n\t\tthis.restTemplate = restTemplateBuilder.build();\r\n\t\tthis.applicationServerUrl = applicationServerUrl;\r\n\t}", "public RestServlet() {}", "public interface SensorAPI {\n\n /**\n * Get the sensor output API.\n *\n * @return the API\n */\n @Path(\"sensorOutputs\")\n SensorOutputAPI sensorOutputs();\n\n /**\n * Get the device API.\n *\n * @return the API\n */\n @Path(\"device\")\n DeviceAPI devices();\n\n /**\n * Get the platform API.\n *\n * @return the API\n */\n @Path(\"platforms\")\n PlatformAPI platforms();\n\n /**\n * JAX-RS interface for the sensor output resource.\n */\n interface SensorOutputAPI {\n /**\n * Get the outputs of the device\n *\n * @param device the device\n *\n * @return the outputs\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceSensorOutputs/{device}\")\n List<JsonSensorOutput> byDevice(@PathParam(\"device\") int device);\n }\n\n /**\n * JAX-RS interface for the device resource.\n */\n interface DeviceAPI {\n /**\n * Get the children of the device.\n *\n * @param device the device\n *\n * @return the children\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getChildrenOfDevice/{device}\")\n List<JsonDevice> childrenOf(@PathParam(\"device\") int device);\n\n /**\n * Get the SensorML description of the device.\n *\n * @param id the id\n *\n * @return the SensorML description\n */\n @GET\n @Produces(MediaType.APPLICATION_XML)\n @Path(\"getDeviceAsSensorML/{device}\")\n String getSensorML(@PathParam(\"device\") int id);\n\n /**\n * Get the list of all devices.\n *\n * @return the devices\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllActiveDevicesFast\")\n List<JsonDevice> all();\n\n /**\n * Get the device.\n *\n * @param device the id\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDevice/{device}\")\n JsonDevice byId(@PathParam(\"device\") int device);\n\n /**\n * Get all device categories.\n *\n * @return the device categories\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllDeviceCategories\")\n List<JsonType> types();\n\n /**\n * Get the device.\n *\n * @param urn the URN\n *\n * @return the device\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getDeviceByUrn/{urn}\")\n JsonDevice byURN(@PathParam(\"urn\") String urn);\n }\n\n /**\n * JAX-RS interface for the platform resource.\n */\n interface PlatformAPI {\n /**\n * Get all platforms.\n *\n * @return the platforms\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllRootItems\")\n List<JsonDevice> all();\n\n /**\n * Get all platform types.\n *\n * @return the platform types\n */\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n @Path(\"getAllPlatformTypes\")\n List<JsonType> types();\n }\n\n}", "@Singleton @Component(modules = {ApplicationModule.class, ApiModule.class})\npublic interface ApplicationComponent {\n Context getContext();\n Bus getBus();\n TRApi getTRApi();\n\n void inject(ZhihuApplication zhihuApplication);\n\n void inject(BaseNewActivity baseNewActivity);\n}", "public Boolean register(HttpServletRequest request) throws Exception;", "RestApplicationModel createRestApplicationModel();", "public interface IUserService {\n\n @GET\n @Path(\"detail\")\n @Produces(ContentType.APPLICATION_JSON_UTF8)\n public UserInfoResponse getUserDetail(@QueryParam(\"id\") Integer id);\n\n @POST\n @Path(\"search\")\n @Consumes(ContentType.APPLICATION_FORM_URLENCODED_UTF8)\n @Produces(ContentType.APPLICATION_JSON_UTF8)\n public SearchUserResponse searchUser(@FormParam(\"\") SearchUserRequest request) throws Exception;\n\n @POST\n @Path(\"create\")\n @Consumes(ContentType.APPLICATION_JSON_UTF8)\n @Produces(ContentType.APPLICATION_JSON_UTF8)\n public ServiceResponse createUser(CreateUserRequest request) throws Exception;\n\n @POST\n @Path(\"modify\")\n @Consumes(ContentType.APPLICATION_JSON_UTF8)\n @Produces(ContentType.APPLICATION_JSON_UTF8)\n public ServiceResponse modifyUser(ModifyUserRequest request) throws Exception;\n}", "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(org.olanto.translate.service.rest.myclass.class);\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\")\n .addResourceLocations(\"/resources/\");\n }", "public void registerApplication(org.thethingsnetwork.management.proto.HandlerOuterClass.ApplicationIdentifier request,\n io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver);", "@Singleton\n@Component(modules = {AppModule.class, RetrofitModule.class})\npublic interface AppComponent {\n Context getContext();\n KyApiService getKyApiService();\n WyApiService getWyApiService();\n OpApiService getOpApiService();\n ToutiaoVideoApiService getToutiaoVideoApiService();\n LiveApiService getLiveApiService();\n CloudMusicApiService getCloudMusicApiService();\n}", "public void registerRenderers() {\n\n\t}", "@Override\n\tpublic void registerStompEndpoints(StompEndpointRegistry registry) {\n\t\tregistry.addEndpoint(\"/messages\");\n\n\t\t// Register additional fallback handling using sock-js\n\t\t// (http://myserver.com/ws/rest/messages)\n\t\tregistry.addEndpoint(\"/messages\").withSockJS();\n\n\t}", "@Singleton\n@Component(modules = {AppModule.class, AppClientModule.class})\npublic interface AppComponent {\n Application getApplication();\n MainViewInteraction getWeatherInteractor();\n}", "void registerProvider(@Observes\n @Initialized(ApplicationScoped.class)\n @Priority(PLATFORM_BEFORE + 5) Object event,\n BeanManager bm) {\n SecurityCdiExtension security = bm.getExtension(SecurityCdiExtension.class);\n\n if (security.securityBuilder().hasProvider(JwtAuthProviderService.PROVIDER_NAME)) {\n return;\n }\n\n // JAX-RS extension to get to applications to see if we are needed\n JaxRsCdiExtension jaxrs = bm.getExtension(JaxRsCdiExtension.class);\n boolean notNeeded = jaxrs.applicationsToRun()\n .stream()\n .map(JaxRsApplication::applicationClass)\n .flatMap(Optional::stream)\n .map(clazz -> clazz.getAnnotation(LoginConfig.class))\n .filter(Objects::nonNull)\n .map(LoginConfig::authMethod)\n .noneMatch(\"MP-JWT\"::equals);\n\n if (notNeeded) {\n return;\n }\n\n security.securityBuilder()\n .addProvider(JwtAuthProvider.create(config), JwtAuthProviderService.PROVIDER_NAME);\n }", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n //registry.addResourceHandler(\"/css/**\")\n // .addResourceLocations(\"/WEB-INF/css/\");\n registry.addResourceHandler(\"/js/**\")\n .addResourceLocations(\"/WEB-INF/js/\");\n }", "@Inject\n public JaxRsApplicationUriNamingStrategy(BeanContext beanContext) {\n this.contextPath = normalizeContextPath(\n beanContext.getBeanDefinition(Application.class)\n .stringValue(ApplicationPath.class)\n .orElse(\"/\")\n );\n }", "@Override\r\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tregistry.addResourceHandler(\"/resources/**\")\r\n\t\t\t\t.addResourceLocations(\"/resources/\");\r\n\t}", "@Override\n public void addResourceHandlers(ResourceHandlerRegistry registry) {\n registry.addResourceHandler(\"/resources/**\").addResourceLocations(\"/resources/\");\n }", "public void registerRenderer() {}", "public void registerRenderer() {}", "public CalculadoraRESTfulWS() {\n }", "public static void registerEcorePackages() {\n\t\tInjector injector = new MMapDslStandaloneSetup().createInjectorAndDoEMFRegistration();\n\n\t\t// obtain a resourceset from the injector\n\t\tXtextResourceSet resSet = injector.getInstance(XtextResourceSet.class);\n\n\t\t// Associate the \"mindmap\" extension with the XMI resource format\n\t\tResource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(\"requirements\", new XMIResourceFactoryImpl());\n\t\t\n\t\t// Initialize the model\n\t\tMindmapPackage.eINSTANCE.eClass();\n\n\t\t// Initialize the model\n\t\tRequirementsPackage.eINSTANCE.eClass();\n\t\t\n\t\t// Retrieve the default factory singleton\n // MindmapFactory factory = MindmapFactory.eINSTANCE;\t\t\n\n // Initialize the EMFTVM package \n\t\torg.eclipse.m2m.atl.emftvm.EmftvmPackage.eINSTANCE.eClass();\n\t\t\n\t\t// Associate the \"emftvm\" extension with the EMFTVM resource format\n\t\tResource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(\"emftvm\", new EMFTVMResourceFactoryImpl());\n\t}", "@Override\r\n\tpublic void addResourceHandlers(ResourceHandlerRegistry registry) {\n\t\tWebMvcConfigurer.super.addResourceHandlers(registry);\r\n\t}", "void inject(BaseApplication application);", "private void registerAdapter(RoutingContext routingContext) {\n LOGGER.debug(\"Info: registerAdapter method started;\");\n JsonObject requestJson = routingContext.getBodyAsJson();\n HttpServerRequest request = routingContext.request();\n HttpServerResponse response = routingContext.response();\n String instanceID = request.getHeader(HEADER_HOST);\n requestJson.put(JSON_INSTANCEID, instanceID);\n JsonObject authInfo = (JsonObject) routingContext.data().get(\"authInfo\");\n requestJson.put(JSON_CONSUMER, authInfo.getString(JSON_CONSUMER));\n requestJson.put(JSON_PROVIDER, authInfo.getString(JSON_PROVIDER));\n Future<JsonObject> brokerResult = managementApi.registerAdapter(requestJson, databroker);\n brokerResult.onComplete(brokerResultHandler -> {\n if (brokerResultHandler.succeeded()) {\n LOGGER.info(\"Success: Registering adapter\");\n handleSuccessResponse(response, ResponseType.Created.getCode(),\n brokerResultHandler.result().toString());\n } else if (brokerResult.failed()) {\n LOGGER.error(\"Fail: Bad request\" + brokerResultHandler.cause().getMessage());\n processBackendResponse(response, brokerResultHandler.cause().getMessage());\n }\n });\n }", "private void addRestResourceClasses(Set<Class<?>> resources) {\n resources.add(rest.RmiApiResource.class);\n }" ]
[ "0.56961167", "0.56371444", "0.55240506", "0.5383549", "0.53485596", "0.533471", "0.5278166", "0.52412015", "0.51728314", "0.5143332", "0.5021059", "0.49723786", "0.4966339", "0.49658027", "0.49453917", "0.4944462", "0.49208793", "0.4895118", "0.4879816", "0.48329723", "0.4829242", "0.48229575", "0.48206922", "0.47909382", "0.47786734", "0.47668383", "0.4765202", "0.47283834", "0.47268167", "0.47237682", "0.46814358", "0.46689355", "0.46549037", "0.46497527", "0.4625899", "0.46201143", "0.46127364", "0.46120447", "0.45880693", "0.45810536", "0.45722714", "0.45370415", "0.45367426", "0.45247656", "0.4520646", "0.4517446", "0.45098203", "0.4506887", "0.4491447", "0.44886044", "0.44837615", "0.44752824", "0.44693795", "0.44649875", "0.44630224", "0.44521925", "0.4431144", "0.44298282", "0.44257814", "0.44102162", "0.44084245", "0.44037765", "0.44002357", "0.437953", "0.43786463", "0.4374124", "0.43717796", "0.43650937", "0.43638197", "0.43613183", "0.43610072", "0.43496054", "0.43492973", "0.43491513", "0.4343388", "0.43398067", "0.43391937", "0.43351412", "0.43299735", "0.4317053", "0.4311486", "0.43112874", "0.43093014", "0.4309081", "0.43078986", "0.43032658", "0.43014866", "0.42918053", "0.42852414", "0.42844573", "0.4284072", "0.4276331", "0.4275681", "0.4275681", "0.42742544", "0.42668024", "0.426598", "0.4255903", "0.42558563", "0.42531833" ]
0.51882994
8
TODO Autogenerated method stub
@Override public void onClick( DialogInterface dialog, int which) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void run() { super.run(); try { has_newVersion = hasServerVersion(); newVerName = getNewVersionURL(); if (has_newVersion) { handler.sendEmptyMessage(Const.NEWVERSION); } } catch (NameNotFoundException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override protected void onUserLeaveHint() { super.onUserLeaveHint(); notification.showNotification(); moveTaskToBack(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override public void onClick(DialogInterface dialog, int which) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
@Override protected void onResume() { super.onResume(); // 保存周期 // editor.putInt("cycle", cycl[timeCycle.getSelectedItemPosition()]); // editor.commit(); // boolean isIP = Util.isIpv4(ip.getText().toString()); // if(isIP==false) // { // new // AlertDialog.Builder(Set.this).setTitle("提示").setMessage("IP地址不合法,请重新输入!") // .setCancelable(false) // .setPositiveButton("确定", new DialogInterface.OnClickListener() { // @Override // public void onClick(DialogInterface dialog, int which) { // // TODO Auto-generated method stub // dialog.dismiss(); // ip.setText(""); // } // }).create().show(); // } // else // { // editor.putString("server_ip", ip.getText().toString()); // editor.commit(); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
ignore errors but hide progress
@Override public void onNewsReceiveError() { setProgressBarIndeterminateVisibility(false); // reset fetcher task mFetcherTask = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void hideProgress() {\n\n if(null != mErrorTextView) {\n mErrorTextView.setVisibility(View.GONE);\n }\n }", "void hideProgress();", "@Override\n\tpublic void hideProgress() {\n\t\twaitDialog(false);\n\t}", "public void hideProgressDialog() {\r\n\t\trunOnUiThread(new Runnable() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (progress.isShowing())\r\n\t\t\t\t\t\tprogress.dismiss();\r\n\t\t\t\t} catch (Throwable e) {\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@Override\r\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(MainActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\r\n hideProgress();\r\n }", "void hideQueuingBuildProgress();", "void hideProgress() {\n removeProgressView();\n removeScreenshotView();\n }", "private void hideProgress() {\n if (dialogProgress != null) {\n dialogProgress.dismiss();\n dialogProgress = null;\n }\n }", "void hideModalProgress();", "@Override\n public void onError(List<String> errors) {\n DialogUtils.showLong(context, errors.get(0));\n progressBar.setVisibility(View.INVISIBLE);\n }", "private void hideProgress() {\n \tif(mProgress!=null){\n \t\tmProgress.dismiss();\n \tmProgress=null;\n \t}\n }", "@Override\n public void hideProgressBar() {\n MainActivity.sInstance.hideProgressBar();\n }", "@Override\n public void onError(Throwable arg0, boolean arg1) {\n hideLoading();\n System.out.println(arg0.getMessage());\n }", "@Override\n public void onError(Throwable arg0, boolean arg1) {\n hideLoading();\n System.out.println(arg0.getMessage());\n }", "@Override\n\tpublic void hideProgress() {\n\t\tprogress.dismiss();\n\t}", "@Override\n public void hideLoading() {\n if (progressDialog!=null && progressDialog.isShowing()){\n progressDialog.dismiss();\n }\n }", "public void hideProgress() {\n // if (progressDialog != null && progressDialog.isShowing())\n try {\n progressDialog.dismiss();\n } catch (Exception e) {\n\n }\n }", "private void hideProgressIndicator() {\n setProgressBarIndeterminateVisibility(false);\n setProgressBarIndeterminate(false);\n }", "@Override\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tprogressBar.setVisibility(View.GONE);\n\t\t\t\t\t}", "void showProgress();", "@Override\n public void showProgress() {\n\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisibility(View.GONE);\n }", "public static void hideProgressDialog() {\n try {\n if (PROGRESS_DIALOG != null) {\n PROGRESS_DIALOG.dismiss();\n }\n } catch(Exception ignored) {}\n }", "public void hideProgress() {\n search_progress.setVisibility(View.GONE);\n img_left_action.setAlpha(0.0f);\n img_left_action.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(img_left_action, \"alpha\", 0.0f, 1.0f).start();\n }", "private void hideProgressDialogWithTitle() {\n progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progressDialog.dismiss();\n }", "public void hideDownloadProgressDialog()\n {\n if(mDownloadProgress != null)\n {\n mDownloadProgress.dismiss();\n }\n mDownloadProgress = null;\n }", "public static void showIndeterminateProgress(int id) {\n showProgress(id, 0, 0, true);\n }", "@Override\n\t\t\t\t\t\t\t\t\tpublic void downLoadFaild(String errorInfo) {\n\t\t\t\t\t\t\t\t\t\tupdate.setEnabled(true);\n\t\t\t\t\t\t\t\t\t\tprogressBar_downLoad.setVisibility(View.INVISIBLE);\n\t\t\t\t\t\t\t\t\t\tToast.makeText(mContext,\n\t\t\t\t\t\t\t\t\t\t\t\tR.string.about_error,\n\t\t\t\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT)\n\t\t\t\t\t\t\t\t\t\t\t\t.show();\n\t\t\t\t\t\t\t\t\t}", "public void goneProgress(){\n mProgressBar.setVisibility(View.GONE);\n }", "public void hideProgress() {\n if (progressDialog != null && progressDialog.isShowing())\n progressDialog.dismiss();\n }", "@Override\n\tpublic void showProgress() {\n\t\twaitDialog(true);\n\t}", "private void showNothing(){\n errorTextView.setVisibility(View.INVISIBLE);\n errorButton.setVisibility(View.INVISIBLE);\n errorButton.setEnabled(false);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.INVISIBLE);\n }", "protected void hideNotify() {\n try {\n myJump.systemPauseThreads();\n } catch (Exception oe) {\n myJump.errorMsg(oe);\n }\n }", "private void hideDialog() {\n if (progressDialog.isShowing())\n progressDialog.dismiss();\n }", "@Override\n public void onCancelled(DatabaseError databaseError) {\n DialogManager.hideProgress();\n\n }", "@Override\n public void hideProgressBar() {\n if (getActivity() != null) {\n getActivity().runOnUiThread(() -> {\n if (progressBarLayout != null && progressBar != null) {\n progressBar.setVisibility(View.GONE);\n progressBarLayout.setVisibility(View.GONE);\n }\n });\n }\n }", "@Override\n\t protected void onPostExecute(String error_message) {\n\t // dismiss the dialog after the file was downloaded\n\t \tif(progressBar.getProgress()<100){\n\t \t\tif(error_message!=null)\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Please enter valid Url\", Toast.LENGTH_SHORT).show();\n\t\t \telse\n\t\t\t\tToast.makeText(getApplicationContext(), \"Download Failled\", Toast.LENGTH_SHORT).show();\n\t \t}\n\t \telse {\n\t\t\tshowPdf();\n\t \t}\n\t\t\turlView.setVisibility(View.VISIBLE);\n\t\t\tprogressLayout.setVisibility(View.GONE);\n\n\t }", "public boolean loadProgress() {\n return false;\n }", "@Override\n public void showProgressSync() {\n }", "public void showProgressDialog() {\n showProgressDialog(null);\n }", "@Override\n public void onFailure(@NonNull Exception e) {\n if (progressDialog.isShowing()) {\n progressDialog.dismiss();\n }\n\n showErrorMessageDialogue(\"Some error just happened. \" +\n \"Please try again in a little bit.\");\n\n }", "private void showError() {\n errorTextView.setVisibility(View.VISIBLE);\n errorButton.setVisibility(View.VISIBLE);\n errorButton.setEnabled(true);\n recyclerView.setVisibility(View.INVISIBLE);\n progressBar.setVisibility(View.INVISIBLE);\n noFavoriteMoviesTextView.setVisibility(View.INVISIBLE);\n }", "public void infoProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourInfoBinding.tourInfoProgress.getVisibility() != View.GONE) {\n tabTourInfoBinding.tourInfoProgress.setVisibility(View.GONE);\n }\n if (tabTourInfoBinding.tourInfoLayout.getVisibility() != View.VISIBLE) {\n tabTourInfoBinding.tourInfoLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }", "public void showLoadingError() {\n showError(MESSAGE_LOADING_ERROR);\n }", "public void invalidSkip() {\n JOptionPane.showMessageDialog(frame, \"Invalid skip\", \"Invalid skip\", JOptionPane.ERROR_MESSAGE);\n\n }", "public void setProgress( boolean onOff );", "private void startProgressBar() {\n\t b_buscar.setVisibility(View.GONE);\n\t // wi_progreso.setVisibility(View.VISIBLE);\n\t ly_progreso.setVisibility(View.VISIBLE);\n\t}", "@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n progress.dismiss();\n }", "public void showLoadingError() {\n System.out.println(\"Duke has failed to load properly.\");\n }", "void onShowProgress();", "@Override\n\t\t\tpublic void onLoadingFailed(String imageUri, View view, FailReason failReason) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "@Override\n public void onError(String method, String errorInfo) {\n hideLoading();\n }", "private void progressStuff() {\n cd = new ConnectionDetector(getActivity());\n parser = new JSONParser();\n progress = new ProgressDialog(getActivity());\n progress.setMessage(getResources().getString(R.string.loading));\n progress.setIndeterminate(false);\n progress.setCancelable(true);\n // progress.show();\n }", "public void dissMissDialog(){\r\n if (dialog != null && dialog.isShowing()\r\n && dialog.getContext() != null) {\r\n try {\r\n dialog.dismiss();\r\n\r\n if(mCallback != null){\r\n mCallback.onProgressDissmiss();\r\n }\r\n\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }", "private void hideLoadingAndUpdate() {\n image.setVisibility(View.VISIBLE);\n loadingBar.setVisibility(View.INVISIBLE);\n shareBtn.setVisibility(shareBtnVisibility);\n\n }", "public void displayProgress(String message) {\n }", "@Override\r\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\r\n\r\n //and displaying error message\r\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\r\n }", "@Override\n public void onError(int errorCode, String errorString) {\n ((StockTradeDetailActivity)mContext).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mExtraInfoProgressBar_II.setVisibility(View.GONE);\n showExtraInfoPrompt(mExtraInfoDataPromptViewII, EXTRA_INFO_STATUS_ERROR);\n }\n });\n }", "@Override\n public void hiddenLoading() {\n Log.i(Tag, \"hiddenLoading\");\n }", "public void setStateToInProgress() {\n progressBar.setIndeterminate(true);\n progressBarLabel.setText(\"Simulation is in progress...\");\n openFolderButton.setVisible(false);\n }", "@Override\n public void disableProgressBar() {\n et_log_email.setEnabled(true);\n et_log_password.setEnabled(true);\n acb_login.setVisibility(View.VISIBLE);\n acb_register.setVisibility(View.VISIBLE);\n\n //Disable progressbar\n pb_login.setVisibility(View.GONE);\n }", "@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }", "@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }", "@Override\n public void onError(Throwable e) {\n uiHelper.dismissLoadingDialog();\n }", "void displayUserTakenError(){\n error.setVisible(true);\n }", "private void hideComputation() {\r\n\t\tshiftLeftSc.hide();\r\n\t\tshiftRowSc.hide();\r\n\t\ttmpMatrix.hide();\r\n\t\ttmpText.hide();\r\n\t}", "@Override\n public void hideProgressIndicator() {\n ProgressDialogFragment.dismissDialog(getChildFragmentManager());\n }", "@Override\n\t\t\tpublic void onLoadingCancelled(String imageUri, View view) {\n\t\t\t\tif (progressbar != null)\n\t\t\t\t\tprogressbar.setVisibility(View.GONE);\n\t\t\t}", "void showTarProgressMessage(String msg);", "public void showProgress(boolean show) {\n \t}", "@Override\n public void onError(int errorCode, String errorString) {\n mExtraInfoProgressBar_II.setVisibility(View.GONE);\n showExtraInfoPrompt(mExtraInfoDataPromptViewII, EXTRA_INFO_STATUS_ERROR);\n }", "@Override\n public void onError(int errorCode, String errorString) {\n mExtraInfoProgressBar_II.setVisibility(View.GONE);\n showExtraInfoPrompt(mExtraInfoDataPromptViewII, EXTRA_INFO_STATUS_ERROR);\n }", "@Override\n public void onError(int errorCode, String errorString) {\n mExtraInfoProgressBar_II.setVisibility(View.GONE);\n showExtraInfoPrompt(mExtraInfoDataPromptViewII, EXTRA_INFO_STATUS_ERROR);\n }", "@Override\n public void onError(int errorCode, String errorString) {\n mExtraInfoProgressBar_II.setVisibility(View.GONE);\n showExtraInfoPrompt(mExtraInfoDataPromptViewII, EXTRA_INFO_STATUS_ERROR);\n }", "public void hideProgressDialog() {\n if (mProgressDialog != null) {\n mProgressDialog.dismiss();\n }\n }", "void showModalProgress();", "@Override\n public void esconderBarraProgresso(){\n progressbar.setVisibility(View.GONE);\n listView.setVisibility(View.VISIBLE);\n }", "@Override\n\tpublic void hide() {\n\t\tmDismissed = true;\n\t\tremoveShowCallback();\n\t\tlong diff = System.currentTimeMillis() - mStartTime;\n\t\tif (diff >= mShowTime || mStartTime == -1) {\n\t\t\t// The progress spinner has been shown long enough\n\t\t\t// OR was not shown yet. If it wasn't shown yet,\n\t\t\t// it will just never be shown.\n\t\t\tsuper.hide();\n\t\t} else {\n\t\t\t// The progress spinner is shown, but not long enough,\n\t\t\t// so put a delayed message in to hide it when its been\n\t\t\t// shown long enough.\n\t\t\tif (!mPostedHide) {\n\t\t\t\tpostDelayed(mDelayedHide, mShowTime - diff);\n\t\t\t\tmPostedHide = true;\n\t\t\t}\n\t\t}\n\t}", "@Override\n protected void onPreExecute() {\n dialog= ProgressDialog.show(DetailsActivity.this, \"Please wait...\",\"Your connection speed is bad\", true);\n dialog.setCancelable(true);\n dialog.setOnCancelListener(new DialogInterface.OnCancelListener(){\n public void onCancel(DialogInterface dialog) {\n task.cancel(true);\n finish();\n }\n });\n }", "public void dismissProgressBar() {\n\t\tmProgressBarVisible = false;\n\t\tif (getView() != null) {\n\t\t\tLinearLayout progressLayout = (LinearLayout) getView()\n\t\t\t\t\t.findViewById(R.id.severity_list_progress_layout);\n\t\t\tif (progressLayout != null) {\n\t\t\t\tprogressLayout.setVisibility(View.GONE);\n\t\t\t}\n\t\t\tProgressBar listProgress = (ProgressBar) getView().findViewById(\n\t\t\t\t\tR.id.severity_list_progress);\n\t\t\tlistProgress.setProgress(0);\n\t\t}\n\t}", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n protected void onPreExecute() {\n mProgressbar.setVisibility(View.VISIBLE);\n }", "void hideMainLoadingWheel();", "private void showSpinerProgress() {\n dialog.setMessage(\"Loading\");\n//\n// dialog.setButton(ProgressDialog.BUTTON_POSITIVE, \"YES\", new DialogInterface.OnClickListener() {\n// @Override\n// public void onClick(DialogInterface dialog, int which) {\n//\n// }\n// });\n\n //thiet lap k the huy - co the huy\n dialog.setCancelable(false);\n\n //show dialog\n dialog.show();\n Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n dialog.dismiss();\n }\n }, 20000000);\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\n public void onFailure(@NonNull Exception exception) {\n progressDialog.dismiss();\n\n //and displaying error message\n Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();\n }", "@Override\r\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n progress.dismiss();\r\n }", "private void showProgressIndicator() {\n setProgressBarIndeterminateVisibility(true);\n setProgressBarIndeterminate(true);\n }", "protected void dismissLoading()\n {\n progressBar.dismiss();\n }", "public void showError() {\n mapView.setVisibility(View.GONE);\n loadingLayout.setVisibility(View.GONE);\n errorLayout.setVisibility(View.VISIBLE);\n\n }", "private void dismissProgressIndication() {\n if (mProgressDialog != null && mProgressDialog.isShowing()) {\n try{\n mProgressDialog.dismiss(); // safe even if already dismissed\n }catch(Exception e){\n Log.i(TAG, \"dismiss exception: \" + e);\t\n }\n mProgressDialog = null;\n }\n }", "public void removeProgressListener() {\n this.listener = new SilentProgressListener();\n }", "public void setKeepProgressBar(boolean flag) {\r\n this.keepProgressBar = flag;\r\n }", "@Override\n public void run() {\n waitDialog.dismiss();\n\n //show an error dialog\n\n\n }", "public void showProgress() {\n img_left_action.setVisibility(View.GONE);\n search_progress.setAlpha(0.0f);\n search_progress.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(search_progress, \"alpha\", 0.0f, 1.0f).start();\n }", "public void onError(ErrorObject errorObject) {\n IntercomArticleActivity.this.intercomErrorView.setVisibility(0);\n IntercomArticleActivity.this.loadingView.setVisibility(8);\n IntercomArticleActivity.this.scrollView.setVisibility(8);\n }", "@Override\n\tpublic void producidoErrorAlCargarInfo(String error) {\n\t\tpanelCargando.setVisibility(View.GONE);\n\t}" ]
[ "0.7662462", "0.75564975", "0.7256243", "0.69738173", "0.69490725", "0.6842599", "0.67724353", "0.6668524", "0.66561455", "0.6641868", "0.6627382", "0.6587151", "0.6562315", "0.6562315", "0.65614426", "0.6519674", "0.6514578", "0.65005445", "0.64761025", "0.64494556", "0.64388037", "0.64105546", "0.6392906", "0.63536227", "0.6331406", "0.6315106", "0.6292451", "0.62465906", "0.62314314", "0.6224526", "0.6191604", "0.6156283", "0.6153839", "0.61385405", "0.61373067", "0.6136432", "0.6135878", "0.6130428", "0.61245936", "0.61058605", "0.61005247", "0.60595345", "0.6009193", "0.6003609", "0.5999101", "0.59666246", "0.59514195", "0.5951285", "0.59473056", "0.59407085", "0.5930684", "0.58825654", "0.5860655", "0.5850413", "0.5834442", "0.58267224", "0.5826479", "0.5821872", "0.5801141", "0.5800656", "0.5799927", "0.57890904", "0.5784628", "0.5784628", "0.5784628", "0.5779927", "0.5776433", "0.5769019", "0.5765501", "0.5760126", "0.5758214", "0.57578254", "0.57578254", "0.57578254", "0.57578254", "0.57464623", "0.5741924", "0.57402337", "0.5740083", "0.5736485", "0.57276744", "0.57248896", "0.5722916", "0.5719964", "0.57177484", "0.57158047", "0.57158047", "0.57158047", "0.57158047", "0.57158047", "0.5705407", "0.5704194", "0.5692725", "0.5687518", "0.56852734", "0.568489", "0.5683221", "0.56764656", "0.5675347", "0.5673307", "0.5670727" ]
0.0
-1
CREATE AN ARRAY FROM THE TERMINAL Add elements to the array from the terminal until the user enters nothing
public static void main(String[] args) { Scanner scanner = new Scanner(System.in); ArrayList<Integer> arrayList = new ArrayList<>(); System.out.println("pleas enter a element "); String input = scanner.nextLine(); while (!input.equals("exit")){ arrayList.add(Integer.parseInt(input)); input =scanner.nextLine(); } System.out.println(arrayList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int[] takeInput() {\n System.out.println(\"Enter size of arrays : \");\n int size = scn.nextInt();\n\n // declaring arrays \n int[] arrays = new int[size];\n\n // taking input from user\n for (int i = 0; i < arrays.length; i++) {\n System.out.println(\"Enter elements at \" + i);\n arrays[i] = scn.nextInt();\n }\n\n return arrays;\n }", "private void readFromConsole(){\n Scanner cin = new Scanner(System.in);\n\n if(cin.hasNext()){\n number = cin.nextInt();\n }\n array = new long[number];\n\n for(int num = 0; num < number; num++){\n if(cin.hasNext()){\n array[num] = cin.nextLong();\n }\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tint[] array= {13};\n\t\t//array[1]=12;\n\t\t\n\t\tSystem.out.println(array.length);\n\n\t Scanner scan=new Scanner(System.in);\n\t System.out.println(\"How many element do you want to store inside an array\");\n\t \n\t int size =scan.nextInt();\n\t \n\t int[] numbers=new int[size];\n\t \n\t for(int i=0; i<numbers.length; i++ ) {\n\t \n\t\t numbers[i]=scan.nextInt();}\n\t \n\t \n {System.out.println(\"Display all elements from an array\");\t \n\t\t \n\t\t \n\t\t \n\t \n\n}}", "public static int[] input() {\n System.out.println(\"Enter size of array: \");\r\n Scanner sc = new Scanner(System.in);\r\n int n = sc.nextInt();\r\n int a[] = new int[n];\r\n for (int i = 0; i < n; i++) { //This forloop will help to store array \r\n a[i] = sc.nextInt();\r\n }\r\n return a;\r\n\r\n }", "public static void main(String[] args) {\n Scanner scan =new Scanner(System.in);\n System.out.println(\"How many names want to storage\");\n int size = scan.nextInt();\n scan.nextLine();// if we are don't give thise line it will not running again again\n String[] nameStorage = new String[size];\n\n for (int index =0; index<size;index++){\n\n System.out.println(\"Please enter a name\");\n nameStorage[index] = scan.nextLine();\n }\n System.out.println(Arrays.toString(nameStorage));\n\n}", "public static double[][] insertArray(int number) {\n double[][] array = new double[number][number];\n System.out.println(number + \"*\" + number);\n System.out.println(\"Enter all the elements: \");\n Scanner scanner1 = new Scanner(System.in);\n while (true) {\n if (!scanner1.hasNextLine()) break;\n for (int i = 0; i < array.length; i++) {\n String[] line = scanner1.nextLine().trim().split(\" \");\n for (int j = 0; j < line.length; j++) {\n array[i][j] = Double.parseDouble(line[j]);\n }\n }\n break;\n }\n objectives=array.clone();\n return array;\n }", "private void createArray() {\n\t\tdata = new Integer[userInput];\n\t\tRandom rand = new Random();\n\n\t\t// load the array with random numbers\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\tdata[i] = rand.nextInt(maximumNumberInput);\n\t\t}\n\n\t\t// copy the array to the sorting method\n\t\tinsertionData = data.clone();\n\t\tquickData = data.clone();\n\n\t}", "private static ArrayList<Double> manualInput() {\n\t\tArrayList<Double> lineData = new ArrayList<Double>();\n\t\t// Cumulative data\n\t\tArrayList<Double> cumData = new ArrayList<Double>();\n\t\tSystem.out.println(MANUAL_MSG);\n\t\tin = new Scanner(System.in);\n\t\twhile (true) {\n\t\t\tString line = in.nextLine();\n\t\t\ttry {\n\t\t\t\tlineData = strToArrList(line);\n\t\t\t\tcumData.addAll(lineData);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\treturn cumData;\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n \n int[] numeros = {56, 89, 87, 56, 45};\n \n System.out.print(\"Array no ordenado: \");\n Impresion(numeros);//impresión del array no ordenado\n System.out.println(\"\");\n System.out.println(\"\");\n \n shell(numeros);//llamada del metodo shell\n \n System.out.print(\"Array ordenado: \");\n Impresion(numeros);//impresión del array ordenado\n System.out.println(\"\");\n \n \n }", "public static String[] createArray(int arraySize) {\n\n\t\t\n\n\t\tScanner scan = new Scanner(System.in);\n\n\t\tString[] myArray = new String[arraySize];\n\n\t\tfor (int i = 0; i < myArray.length; i++) {\n\t\t\t\n\t\t\tSystem.out.println(\"Enter some cars #\"+(i+1));\n\t\t\tmyArray[i] = scan.next();\n\t\t}\n\n\t\treturn myArray;\n\n\t}", "public static int[] readArrayFromConsole() {\n\t\tScanner input = new Scanner(System.in);\n\n\t\t// Getting the Array size from the user\n\t\tSystem.out.print(\"How many numbers do you want to enter? \");\n\t\tint arraySize = input.nextInt();\n\n\t\tint[] rstArray = new int[arraySize];\n\n\t\tfor (int i = 0; i < arraySize; i++) {\n\t\t\tSystem.out.print(\"Enter value for position [\" + i + \"]: \");\n\t\t\trstArray[i] = input.nextInt();\n\t\t}\n\n\t\t// close the user input\n\t\tinput.close();\n\n\t\t// Display the result(rst) Array\n\t\treturn rstArray;\n\t}", "int[] takeNumberFromUser() {\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter size of numbers\");\n\t\tint size = scan.nextInt();\n\t\tint[] input = new int[size];\n\t\tfor (int index = 0; index < input.length; index++) {\t\t//taking array element as input on console\n\t\t\tinput[index] = scan.nextInt();\n\t\t}\n\t\tscan.close();\n\t\treturn input; // returning input array\n\t}", "public void getInput(){\n\t\tScanner scan= new Scanner(System.in);\n\t\t//Get the range\n\t\tif(scan.hasNext()){\n\t\t\tcount=Integer.parseInt(scan.nextLine()); \n\t\t}\n\t\t//Initialize the array\n\t\tpeople = new People[count];\n\t\t//Get the array elements\n\t\tint i=0;\n\t\twhile(i<count){\n\t\t\tString lin[] = scan.nextLine().split(\" \");\n\t\t\tpeople[i] = new People(Integer.parseInt(lin[0]), Double.parseDouble(lin[1]));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint arraySize;\n\t\tscanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the no of elements you want to read for Array:\");\n\t\tarraySize = scanner.nextInt();\n\t\tif(arraySize == 0) {\n\t\t\tSystem.out.println(\"You can't Read elements as Array Size is 0\");\n\t\t}else {\n\t\t\tnoArray = new int[arraySize];\n\t\t\tgetArrayElements();\n\t\t\tRemoveDuplicate();\n\t\t\tdisplayArrayElements();\n\t\t}\n\t\tscanner.close();\n\t}", "public static void main(String args[]) {\n Scanner in = new Scanner(System.in);\n int as = in.nextInt();\n int arr[] = new int[as];\n for (int i = 0; i< as ; i++)\n {\n arr[i] = in.nextInt();\n }\n separate(as, arr);\n for (int i = 0; i< as ; i++)\n {\n System.out.print(arr[i] + \" \");\n }\n }", "public static void main(String args[]){\n\t\t\tScanner scan = new Scanner(System.in);\r\n\t\t\tint t = 0;\r\n\t\t\twhile(t-->0){\r\n\t\t\t\tString s = scan.next();\r\n\t\t\t\tchar c = scan.next().charAt(0);\r\n\t\t\t\tint n = scan.nextInt();\r\n\t\t\t\tSystem.out.println(n);\r\n\t\t\t}\r\n\t\t\tInteger arr[] = new Integer[10];\r\n\t\t//\tArrays.fill(arr, 1);\r\n\t\t\tfor(int i=0;i<10;i++) arr[i] = i+1;\r\n\t\t//\tString s = String.valueOf(arr);\r\n\t\t\tSystem.out.println(Arrays.toString(arr));\r\n\t\t\tCollections.rotate(Arrays.asList(arr),2);\r\n\t\t\tSystem.out.println(Arrays.toString(arr));\r\n\t\t\t}", "public void takeInput() {\n Scanner sc = new Scanner(System.in);\n int polynomial[];\n System.out.println(\"Enter no. of inputs:\");\n int n = sc.nextInt();\n System.out.println(\"Enter polynomial coefficients:\\n(0 if no coefficient is present)\");\n polynomial = new int[n];\n System.out.println(\"Enter data: \");\n \n for (int i = 0; i < n; i++) {\n polynomial[i] = sc.nextInt();\n }\n \n setPolynomialCoefficientArray(polynomial);\n }", "public static void main(String[] args) {\n\t\tScanner scannerObj = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter a size of array :: \");\n\t\tint size = scannerObj.nextInt();\n\t\tint[] array = new int[size];\n\t\tSystem.out.println(\"Please enter the elements of array :: \"); \n\t\t\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tarray [i] = scannerObj.nextInt();\n\t\t}\n\t\tprintArray(array);\n\t\tmoveEven(array);\n\t\tprintArray(array);\n\n\t}", "public static void main(String[] args) {\n final int SORT_MAX_SIZE = 16;\n\n\n int length = getUserInput(1, SORT_MAX_SIZE, \"Enter array length: \");\n int[] arr = new int[length];\n\n for (int i = 0; i < arr.length; i++) {\n arr[i] = getUserInput(1, 99, \"\\tarray[\" + i + \"] = \");\n }\n\n System.out.println(isPrimeArrayIter(arr, length) ? \"\\tPrime Array using iteration\" : \"\\tNot a Prime Array using \" +\n \"iteration\");\n System.out.println(isPrimeArrayRecur(arr, length) ? \"\\tPrime Array using recursion\" : \"\\tNot a Prime Array using \" +\n \"recursion\");\n //wait for user to press enter\n new Scanner(System.in).hasNextLine();\n }", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int size = in.nextInt();\n int[] a = new int[100];\n for (int i = 0; i < size; i++) {\n int j = in.nextInt();\n a[j] = a[j] + 1;\n }\n\n for(int n : a){\n System.out.print(n+\" \");\n }\n System.out.println(\"\");\n }", "private static int[] getInputs(int n) {\n Scanner s = new Scanner(System.in);\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n System.out.print(i + \". element: \");\n arr[i] = s.nextInt();\n }\n // after inputing n elements, close the scanner\n s.close();\n return arr;\n }", "public static void main(String[] args) {\n\t\t\n\t\tint[] arr = takeInput();\n\t\tpushZeroesAtEndInArray(arr);\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tSystem.out.println(arr[i] + \" \");\n\t\t\t\n\t\t}\n\t}", "public static void main(String[] args) \r\n\t{\r\n\t\t\r\n\t\tScanner sc = new Scanner( System.in);\r\n\t\tSystem.out.println(\"Enter The Size\");\r\n\t\tint size = sc.nextInt();\r\n\t\tint array[]=new int[size];\r\n\t\t\r\n\t\tfor(int i=0;i<size;i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Enter the value at\"+ (i+1)+\" \");\r\n\t\t\tarray[i]=sc.nextInt();\r\n\t\t}\r\n\t\tfor(int i=0;i<size;i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(array[i]);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\r\n \t try{\r\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n String input=br.readLine();\r\n int N=Integer.parseInt(input);\r\n input=br.readLine();\r\n String[] values=input.split(\" \");\r\n int ints[]=genArray(values);\r\n printArray(ints);\r\n }\r\n catch(Exception e){\r\n \r\n }\r\n }", "public static void main(String[] args) throws IOException {\n\n System.out.println(\"Size: \" + ARRAY_STORAGE.size());\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n\n while (true) {\n try {\n System.out.print(\"Введите одну из команд - (list | save uuid | delete uuid | get uuid | update uuid | clear | exit): \");\n String[] params = reader.readLine().trim().toLowerCase().split(\" \");\n if (params.length < 1 || params.length > 2) {\n System.out.println(\"Неверная команда.\");\n continue;\n }\n if (params.length == 2) {\n params[1] = params[1].intern();\n }\n switch (params[0]) {\n case \"list\":\n printAll();\n break;\n case \"size\":\n System.out.println(ARRAY_STORAGE.size());\n break;\n case \"save\":\n Resume r = new Resume(params[1]);\n ARRAY_STORAGE.save(r);\n printAll();\n break;\n case \"delete\":\n ARRAY_STORAGE.delete(params[1]);\n printAll();\n break;\n case \"update\":\n r = new Resume(params[1]);\n ARRAY_STORAGE.update(r);\n printAll();\n break;\n case \"get\":\n System.out.println(ARRAY_STORAGE.get(params[1]));\n break;\n case \"clear\":\n ARRAY_STORAGE.clear();\n printAll();\n break;\n case \"exit\":\n return;\n default:\n System.out.println(\"Неверная команда.\");\n break;\n }\n } catch (ArrayIndexOutOfBoundsException e) {\n System.out.println(\"При вводе команды необходимо через пробел дописывать uuid. Попробуйте еще раз!\");\n }\n }\n }", "public static void main(String[] args) {\n\t\tScanner kb = new Scanner(System.in);\r\n\t\tSystem.out.print(\"Input the length of the array: \");\r\n\t\tint n = kb.nextInt();\r\n\t\tint A[] = new int[n],index = 0;\r\n\t\tboolean check = false;\r\n\t\tfor (int i = 0;i < n;i++) \r\n\t\t\t{\r\n\t\t\t\tA[i] = kb.nextInt();\r\n\t\t\t\tif ((A[i] == 10) && (!check)) index = i;\r\n\t\t\t}\r\n\t\tint B[] = Arrays.copyOf(A, index);\r\n\t\tSystem.out.println(Arrays.toString(B));\r\n\t}", "public void set_array(String type){\n while (true){\n\n General_imp construct = new General_imp();\n\n construct.print_type( type);\n String ans = construct.input();\n if (ans.equals(\"EXIT\"))\n break;\n setatribs(ans, type);\n }\n }", "private static int[] enterNumbers() {\n\t\tint[] numbers = new int[2];\n\t\tSystem.out.print(\"Geben Sie die erste Zahl ein: \");\n\t\tnumbers[0] = readInt();\n\t\tSystem.out.print(\"Geben Sie die zweite Zahl ein: \");\n\t\tnumbers[1] = readInt();\n\t\treturn numbers;\n\t}", "public static void main(String[] args) {\n Scanner inp = new Scanner(System.in);\n System.out.println(\"Enter size and number:\");\n int size = inp.nextInt(),\n n = inp.nextInt();\n\n int[] arr = new int[size];\n System.out.println(\"Enter numbers:\");\n for(int i=0 ; i <=size-1; i++){\n arr[i]=inp.nextInt();\n }\n\n add_to_r(arr, n);\n\n\n }", "public static int[] nhapMang() {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Nhap so luong phan tu: \");\n int n = Integer.parseInt(scanner.nextLine());\n int[] arr = new int[n];\n for (int i = 0; i < n; i++) {\n arr[i] = Integer.parseInt(scanner.nextLine());\n }\n return arr;\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tScanner s=new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the number of elements you want to store\");\n\t\tint n= s.nextInt();\n\t\tint a[]=new int[10];\n\t\tint i;\n\t\tSystem.out.println(\"Enter numbers\");\n\t\tfor( i=0;i<=n;i++)\n\t\t{\n\t\t\t\n\t\t\ta[i]=s.nextInt();\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.print(\"numbers are\");\n\t\tfor(i=0;i<=n;i++)\n\t\t{\n\t\t\tSystem.out.println(a[i]);\n\t\t}\n\t}", "public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.println(\"Entre com a sequência\");\n String string = input.next();\n int x[] = toArray(string);\n printArray(x);\n v(x);\n }", "public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n s.useLocale(Locale.ENGLISH);\n System.out.print(\"\\n\\nLECTURA I ESCRIPTURA D'UN ARRAY DE NÚMEROS\\n\\n\");\n // Reade the length of the array\n System.out.print(\"Dimensió ? \");\n int n = s.nextInt();\n // Create the array, allocate enough memory for n elements\n double[] a = new double[n];\n // Read n numbers and store them in the array\n for (int i = 0; i < n; i++) {\n System.out.printf(\"a[%d]= \", i);\n a[i] = s.nextDouble();\n }\n // Write all the elements of the array\n System.out.print(\"\\nArray = \");\n for (int i = 0; i < n; i++) {\n System.out.printf(\"'%f' \", a[i]);\n }\n System.out.print(\"\\n\\n\");\n }", "public static int[] getArr(){\n Scanner sc = new Scanner(System.in);\n System.out.print(\"Enter five random numbers to place in array: \");\n String input = sc.nextLine();\n String[] stringArr = input.split(\" \");\n int maxSize = 5;\n //final int SIZE = stringArr.length;\n int[] intArr = new int[maxSize];\n\n //populate array in sequence//\n for (int i = 0; i < maxSize; i++){\n intArr[i] = Integer.parseInt(stringArr[i]);\n }\n sc.close();\n return intArr;\n }", "public static int[] populateArray(int [] array) {\n int userInput;\n System.out.println(\"Enter 10 integers: \");\n for(int i = 0; i < array.length; i++){\n Scanner input = new Scanner(System.in);\n userInput = CheckInput.getInt();\n array[i] = userInput;\n }\n return array;\n }", "public String[] addItemToTodo(int index){\n String [] todoList = new String[index];\n for(int count = 0; count < todoList.length; count++){\n\n Scanner userInput = new Scanner(System.in);\n System.out.print(\"Enter todo\" + count + \" : \");\n String input = userInput.nextLine();\n\n todoList[count] = input;\n }\n return todoList;\n }", "public static void main(String[] args) {\n\t\tint[] arr = takeInput();\n//\t\tprintArray(arr);\n\t\tprintStartEndArray(arr);\n\t}", "public static void main(String[] args) {\nint a[]=new int[4];\r\nSystem.out.println(\"enter array values\" );\r\n\r\nScanner sc=new Scanner(System.in);\r\na[0]=sc.nextInt();\r\na[1]=sc.nextInt();\r\na[2]=sc.nextInt();\r\na[3]=sc.nextInt();\r\n\r\n\r\n\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter size of array: \");\n\t\tint[] numbers = new int[input.nextInt()];\n\t\tfor (int i = 0; i < numbers.length; i++) {\n\t\t\tSystem.out.println(\"Please enter number\");\n\t\t\tnumbers[i] = input.nextInt();\n\t\t}\n\t\tSystem.out.println(\"Please enter size of sub array: \");\n\t\tint[][] result = partitionArray(numbers, input.nextInt());\n\t\tSystem.out.println(Arrays.deepToString(result));\n\t}", "public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint k;\n\t\twhile (true) {\n\t\t\tString[] arr = s.nextLine().split(\" \");\n\t\t\tif (arr[0].equals(\"0\"))\n\t\t\t\tbreak;\n\t\t\tk = Integer.parseInt(arr[0]);\n\t\t\tint[] A = new int[k];\n\t\t\tfor (int i = 1; i < arr.length; i++) {\n\t\t\t\tA[i - 1] = Integer.parseInt(arr[i]);\n\t\t\t}\n\t\t\tgo(0, 0, A, k);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.exit(0);\n\t}", "public static void main(String[] args) throws Exception {\n int arreglo[] = new int [3];\n String nombres[] = new String[5];\n Scanner nom = new Scanner(System.in);\n arreglo[1] = 1;\n nombres[2] = \"Mau\";\n System.out.println(arreglo[1] + nombres[2]);\n\n for (int i = 0; i < 5; i++){\n System.out.println(\"Escribe tu nombre: \");\n nombres[i] = nom.nextLine();\n System.out.println(nombres[i]);\n }\n }", "private static double[] getInputs() {\n\t\tdouble[] inputs = new double[SIZE];\n\t\tint counter = 0;\n\t\t\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tSystem.out.print(\"Enter the \" + (counter + 1) + \" value: \");\n\t\t\t\tsc = new Scanner(System.in);\n\t\t\t\tdouble value = sc.nextDouble();\n\t\t\t\tinputs[counter] = value;\n\t\t\t\tcounter += 1;\n\t\t\t} catch (InputMismatchException e) {\n\t\t\t\tSystem.out.println(\"Invalid datatype \" + e + \" please try again!\");\n\t\t\t}\n\t\t} while (counter != SIZE);\n\t\t\n\t\t//sc.close();\n\t\treturn inputs;\n\t}", "private static Integer[] readInputFromUser(Scanner in) {\n\t\tInteger[] array = null;\n\t\t/**\n\t\t * Accept the quantity of the data along with actual data.\n\t\t */\n\t\tSystem.out.print(\"Please enter number of integers you want to input:\");\n\t\tint s = in.nextInt();\n\t\tarray = new Integer[s];\n\t\tSystem.out.print(\"Please enter Integers:\");\n\n\t\tfor (int i = 0; i < s; i++) {\n\t\t\tarray[i] = in.nextInt();\n\t\t}\n\t\tSystem.out.println(\"Input Array: \" + Arrays.toString(array));\n\t\treturn array;\n\t}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int[] array = Arrays.stream(scanner.nextLine().split(\" \"))\n .mapToInt(Integer::parseInt).toArray();\n int pivotIndex = scanner.nextInt();\n moveThePivot(array, pivotIndex);\n Arrays.stream(array).forEach(e -> System.out.print(e + \" \"));\n }", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n \n // size of array\n int len = scanner.nextInt();\n int[] arr = new int[len];\n \n // elements of array\n for (int i = 0; i < arr.length; i++) {\n arr[i] = scanner.nextInt();\n }\n \n int sum = 0;\n for (int num : arr) {\n sum += num;\n }\n System.out.println(sum);\n }", "public static void main(String[] args) {\n\r\n\t\tSystem.out.println(\"Introduce el numero de valores:\");\r\n\r\n\t\tint n = readEqui(0, Equivalencias.MAYOR);\r\n\r\n\t\t// Declarar array\r\n\r\n\t\tint[] miarray = new int[n];\r\n\r\n\t\t// Rellenar array\r\n\r\n\t\trellenararray(miarray);\r\n\r\n\t\tSystem.out.println();\r\n\r\n\t\tSystem.out.println(\"Array original:\");\r\n\r\n\t\t// Mostrar array\r\n\r\n\t\tmostrararray(miarray);\r\n\r\n\t\t// Ordenar array\r\n\r\n\t\tburbuja(miarray);\r\n\r\n\t\tSystem.out.println();\r\n\r\n\t\t// Mostrar array ordenado\r\n\r\n\t\tSystem.out.println(\"Array ordenado:\");\r\n\r\n\t\tmostrararray(miarray);\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"enter the size of array\");\r\n\t\tScanner console = new Scanner(System.in);\r\n\t\tint n = console.nextInt();\r\n\t\tint arr[] = new int[n];\r\n\t\tfor (int x = 0; x < arr.length; x++) {\r\n\t\t\tSystem.out.println(\"Enter the value to be inserted into array\");\r\n\t\t\tarr[x] = console.nextInt();\r\n\t\t}\r\n\t\tconsole.close();\r\n\t\tfor(int i=0;i<n-1;i++){\r\n\t\t\tint min=i;\r\n\t\t\tfor(int j=i+1;j<n;j++){\r\n\t\t\t\tif (arr[j]<arr[min])\r\n\t\t\t\t{\r\n\t\t\t\t\tmin=j;\r\n\t\t\t\t\tint temp=arr[min];\r\n\t\t\t\t\tarr[min]=arr[i];\r\n\t\t\t\t\tarr[i]=temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int x:arr){\r\n\t\t\tSystem.out.print(x+\" \");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Please input the length of the array.\");\n\t\t\n\t\tint num = sc.nextInt();\n\t\t\n\t\tint [] array = new int[num];\n\t\t\n\t\tint i = 0;\n\t\t\n\t\tfor (i = 0; i < array.length; i++){\n\t\t\tSystem.out.println(\"Please input value for element \" +(i +1));\n\t\t\tarray[i] = sc.nextInt();\n\t\t}\n\t\t\n\t\tint [] array2 = new int[num];\n\t\t\n\t\tfor (int j = 0; j < array.length; j++){\n\t\t\tarray2[(num - 1) - j] = array[j];\n\t\t}\n\t\t\n\t\tSystem.out.println(\"These are the contents of your array: \");\n\t\tfor (int k = 0; k < array.length; k++){\n\t\t\tSystem.out.print(array[k]);\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"And these are the contents of your second array: \");\n\t\tfor (int l = 0; l < array2.length; l++){\n\t\t\tSystem.out.print(array2[l]);\n\t\t}\n\t}", "private static void printEmptyArray() {\n // String = sir de caractere\n // \"temp\" -> 't' 'e' 'm' 'p'\n\n // create empty array with size 3\n String[] names = new String[3];\n names[0] = \"ana\";\n names[1] = \"alex\";\n names[2] = \"paul\";\n// names[3] = \"gabi\"; // index out of bounds\n\n // CTRL + D = duplicate line\n System.out.println(names[0]);\n System.out.println(names[1]);\n System.out.println(names[2]);\n\n // save alex from the array to a variable\n // array name [ index of alex]\n String alexName = names[1];\n System.out.println(\"item at index 1 = \" + alexName);\n }", "public static void main(String[] args) {\n\t\t// Declaracion del array\n\t\tint[] unArray;\n\n\t\t// Reservamos memoria para 10 enteros\n\t\tunArray = new int[10];\n\n\t\t// Iniciamos los elementos del array\n\t\tunArray[0] = 100;// 1º elemento\n\t\tunArray[1] = 200;// 2º elemento\n\t\tunArray[2] = 300;\n\t\tunArray[3] = 400;\n\t\tunArray[4] = 500;\n\t\tunArray[5] = 600;\n\t\tunArray[6] = 700;\n\t\tunArray[7] = 800;\n\t\tunArray[8] = 900;\n\t\tunArray[9] = 1000;\n\t\t// sacamos los indices del arry\n\t\tSystem.out.println(\"El numero en la primera posicion es \" + unArray[0]);\n\t\tSystem.out.println(\"El numero en la segunda posicion es \" + unArray[1]);\n\t\tSystem.out.println(\"El numero en la tercera posicion es \" + unArray[2]);\n\t\tSystem.out.println(\"El numero en la cuatra posicion es \" + unArray[3]);\n\t\tSystem.out.println(\"El numero en la quinta posicion es \" + unArray[4]);\n\t\tSystem.out.println(\"El numero en la sexta posicion es \" + unArray[5]);\n\t\tSystem.out.println(\"El numero en la setima posicion es \" + unArray[6]);\n\t\tSystem.out.println(\"El numero en la octava posicion es \" + unArray[7]);\n\t\tSystem.out.println(\"El numero en la novena posicion es \" + unArray[8]);\n\t\tSystem.out.println(\"El numero en la decima posicion es \" + unArray[9]);\n\t}", "public static void fillArray(int[] array)\r\n {\r\n //Create a local scanner object\r\n Scanner sc = new Scanner(System.in);\r\n \r\n //Prompt user to enter the number of values within the array\r\n System.out.println(\"Enter \" + array.length + \" values\");\r\n \r\n //Loop through array and assign a value to each individual element\r\n for (int n=0; n < array.length; ++n) \r\n {\r\n \r\n System.out.println(\"Enter a value for element \" + n + \":\");\r\n \r\n array[n] = sc.nextInt();\r\n \r\n \r\n \r\n }\r\n \r\n \r\n }", "public static void main(String[] args) {\n String asNombres[]=new String[TAMA];\r\n //CAPTURAR 5 NNOMBRES \r\n Scanner sCaptu = new Scanner (System.in);\r\n for (int i = 0; i < TAMA; i++) {\r\n System.out.println(\"Tu nombre :\");\r\n asNombres[i]=sCaptu.nextLine();\r\n }\r\n for (String asNombre : asNombres) {\r\n System.out.println(\"Nombre: \" + asNombre);\r\n \r\n }\r\n //CREAR UNA COPIA DEL ARREGLO\r\n /*String asCopia[]=asNombre;//Esto no funciona\r\n asNombre[0]=\"HOLA MUNDO\";\r\n System.out.println(asCopia[0]);*/\r\n \r\n String asCopia[]=new String[TAMA];\r\n for (int i = 0; i < TAMA; i++) {\r\n asCopia[i]=asNombres[i];\r\n \r\n }\r\n asNombres[0]=\"HOLA MUNDO\";\r\n System.out.println(\"Nombre = \" + asNombres[0]);\r\n System.out.println(\"Copia = \" + asCopia[0]);\r\n }", "public static void main(String[] args) {\n\t\tString movies[] = new String[3];\n\t\t\n\n\t\t\tScanner scan = new Scanner(System.in);\n System.out.println(\"enter movie 1\");\n movies[0]= scan.nextLine();\n System.out.println(\"enter movie 2\");\n movies[1]= scan.nextLine();\n System.out.println(\"enter movie 3\");\n movies[2]= scan.nextLine();\n // System.out.printf(\"Enter movie %d\",i);\n for(int i=0; i<movies.length;i++)\n \t System.out.println(movies[i]);\n\t}", "public static String[][] takeStdInput() {\n // contains all of the faces in order of acceptance\n final String[] faces = new String[] { \"front\", \"right\", \"back\", \"left\", \"top\", \"bottom\" };\n\n sc = new Scanner(System.in);\n\n // final array of colors for any given cube\n final String[][] inputArray = new String[Puzzle.NUM_OF_CUBES][Cube.NUM_OF_FACES];\n // System.out.println(Arrays.toString(inputArray));\n String[] cubeArray = new String[Cube.NUM_OF_FACES];\n for (int i = 0; i < Puzzle.NUM_OF_CUBES; i++) {\n cubeArray = new String[Cube.NUM_OF_FACES];\n System.out.println(\"Enter cube #\" + (i + 1));\n\n for (int j = 0; j < Cube.NUM_OF_FACES; j++) {\n System.out.print(\"Enter \" + faces[j] + \" face: \");\n cubeArray[j] = sc.nextLine();\n // if input is not a proper color of misspelled, prompt again and overwrite\n // array entry\n while (!isValidString(cubeArray[j]) || containsElement(cubeArray[j], cubeArray, j)) {\n System.out.println(\"Invalid input, try again.\");\n System.out.print(\"Enter \" + faces[j] + \" face: \");\n cubeArray[j] = sc.nextLine();\n }\n inputArray[i] = cubeArray;\n }\n }\n return inputArray;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(\"enter the length of array\");\r\n\t\tint len=s.nextInt();\r\n\t\tSystem.out.println(\"array element\");\r\n\t\tint[] a=new int[len] ;\r\n\t\t//System.out.println(a);\r\n\t\tint ind=0;\r\n\t\tfor(int i=0;i<len;i++) {\r\n\t\t\ta[i]=s.nextInt();\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(\"enter the NUM\");\r\n\t\tint num=s.nextInt();\r\n\t\trepeat(a,len,num);\r\n\t\t\r\n\r\n}", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Enter the limit of the array\");\r\n\t\tint lm = sc.nextInt();\r\n\t\tint a[] =new int [lm];\r\n\t\tSystem.out.println(\"Enter the elements in the array\");\r\n\t\tfor(int i=0;i<lm;i++) {\r\n\t\t\t\r\n\t\t\t a[i] = sc.nextInt() ;\r\n\t\t}\r\n \r\n int b[] = a.clone();\r\n \r\n System.out.println(\"The elements in a array is :\");\r\n for(int i=0;i<a.length;i++)\r\n {\r\n \t System.out.println(a[i]+ \" \");\r\n }\r\n \r\n System.out.println(\"The elements in b array is :\");\r\n for(int i=0;i<b.length;i++)\r\n {\r\n \t System.out.println(b[i]+ \" \");\r\n }\r\n\t}", "public static void ingresar(int[] x) {\n int i;\n Scanner entrada = new Scanner(System.in);\n for (i = 0; i < N; i++) {\n System.out.println(\"Ingrese un numero para la celda \" + i);\n x[i] = entrada.nextInt();\n \n }\n \n }", "public void makeArray() {\r\n for (int i = 0; i < A.length; i++) {\r\n A[i] = i;\r\n }\r\n }", "private void createArray()\r\n\t{\r\n\t\tscorers = new String[NUMBER_OF_ENTRIES];\r\n\t\tfor(int i = 0; i < NUMBER_OF_ENTRIES; i += 2)\r\n\t\t{\r\n\t\t\tscorers[i] = \"[NULL]\";\r\n\t\t\tscorers[i + 1] = String.valueOf(-1);\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\n\t\t for(int j=1;j<=weekDay.length;j++) {\n Scanner scan=new Scanner(System.in);\n System.out.println(\"Please enter day \"+j+\" of the week\");\n weekDay[j]=scan.nextLine();\n System.out.println(weekDay[j]);}\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tScanner input=new Scanner(System.in);\n\t\tint[] array=new int[3];\n\t\tSystem.out.print(\"Enter input number: \");\n\t\tfor(int i=0;i< array.length;i++) {\n\t\t\tarray[i]=input.nextInt();\n\t\t}\n\t\tint temp=array[0];\n\t\tarray[0]=array[array.length-1];\n\t\tarray[array.length-1]=temp;\n\t\tSystem.out.print(\"New array after swapping the first and last elements: \"+\"[\");\n\t\tfor(int i=0;i<array.length;i++) {\n\t\t\tif(i==array.length-1) {\n\t\t\t\tSystem.out.print(array[i]);\n\t\t\t}else \n\t\t\tSystem.out.print(array[i]+\",\");\n\t\t}\n\t\tSystem.out.print(\"]\");\n\t}", "private static String[] collectInput() {\n\t\tString command = sc.next();\n\t\tString i = sc.next();\n\t\tString destination = sc.next();\n\t\treturn new String[] { command, destination };\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"Enter size of string array\");\r\n\t\tScanner sc=new Scanner(System.in);\r\n\t\tn=sc.nextInt();\r\n\t\tarr= new String[n];\r\n\t\tSystem.out.println(\"Enter elements of string array\");\r\n\t\t\r\n\t\tfor(int i=0;i<n;i++){\r\n\t\t\tarr[i]=sc.next();\r\n\t\t}\r\n\t\t\r\n\t\tSearchArray s=new SearchArray();\r\n\t\ts.search_array();\r\n\t}", "private void createLinesArray()\n {\n //This will iterate through the lines array\n for (int i = 0; i < lines.length; i++)\n {\n //Stop at end-of-File\n if (mapScanner.hasNextLine())\n {\n //Add the current line to the lines array\n lines[i] = mapScanner.nextLine();\n }\n }\n }", "Array createArray();", "public static void main(String[] args) {\n\t\r\n\t\t\r\n\t\tScanner lector=new Scanner(System.in);\r\n\t\tchar[] X=new char[3];\r\n\t\t\r\n\t\t \r\n\t\t\t\r\n\t\tfor(char i=0;i<3;i++) {\r\n\t\t\tSystem.out.println(\"Ingrse el valor de la posicion :\"+ i);\r\n\t\t\tchar n=lector.next().charAt(0);\r\n\t\t\t\r\n\t\tX[i]=n;\r\n\t\t\t\r\n\t\t}//recorrido el vector lleno\r\n\t\tfor(char i=0;i<3;i++) {\r\n\t\t\tSystem.out.println(\"el valor de la posicion :\"+ i);\r\n\t\t\tSystem.out.println(X[i]);\r\n\t\t}\r\n\t}", "public void saveInput() \n {\n for (int i = 0; i < 10; i++) \n userInput[i] = textFields[i].getText(); \n }", "public static void main(String[] args) {\n\t\tScanner entrada = new Scanner(System.in);\r\n\t\tint selector=entrada.nextInt();\r\n \t vuelo[] vuelos = new vuelo[10];\r\n \t aeropuertos[] aeropuerto= new aeropuertos[5];\r\nSystem.out.println(\"bienvenido a control de vuelos\");\r\nSystem.out.println(\"que desea hacer?\");\r\nSystem.out.println(\"1: mostrar lista de aeropuertos\");\r\nSystem.out.println(\"2: mostrar lista de vuelos\");\r\n selector=entrada.nextInt();\r\n switch (selector) {\r\n case 1:\r\n \t for(int i =0;i<vuelos.length;i++) {\r\n \t\t System.out.println(aeropuerto[i]);\r\n \t }\r\n }\r\n}", "public static void main(String[] args) {\n Scanner kb=new Scanner(System.in);\n System.out.println(\"Enter the number of elements in array\");\n int n=kb.nextInt();\n int arr[]=new int[n];\n for(int i=0;i<n;i++)\n {\n System.out.println(\"Enter the number\");\n arr[i]=kb.nextInt();\n \n }\n \n System.out.println(\"Enter the amount of rotation\");\n int rotation= kb.nextInt();\n for(int i=rotation;i<n;i++)\n {\n System.out.println(arr[i]);\n }\n for(int i=0;i<rotation;i++)\n {\n System.out.println(arr[i]);\n }\n \n \n \n \n }", "public static void main(String[] args) {\n\n\t\tString myStrings[] = { \"Apple\", \"Orange\", \"Lemon\" };\n\n\t\tSystem.out.println(myStrings[0]);\n\t\tSystem.out.println(myStrings[1]);\n\t\tSystem.out.println(myStrings[2]);\n\n\t\tString[] newArray = new String[10]; // (0 to 9) I can add 10 array value\n\n\t\tSystem.out.println(\"\\n\");\n\n\t\tnewArray[0] = \"Zero\";\n\t\tnewArray[1] = \"One\";\n\t\tnewArray[2] = \"Two\";\n\t\tnewArray[3] = \"Three\";\n\n\t\tSystem.out.println(newArray[0]);\n\t\tSystem.out.println(newArray[1]);\n\t\tSystem.out.println(newArray[2]);\n\t\tSystem.out.println(newArray[3]);\n\n\t}", "public static void main(String[] args) {\n ArrayList<Integer> items = new ArrayList<>();\n items.add(1);\n items.add(2);\n items.add(3);\n items.add(4);\n items.add(5);\n items.add(6);\n items.add(7);\n items.add(8);\n\n\n printArray(items);\n }", "OrderedIntList ()\n\t{\tScanner scanner = new Scanner(System.in);\n\t\tarray1 = new int[10];\n count = 0;\n \n System.out.println (\"degug on? Enter y or n \");\n String result = scanner.nextLine();\n debug = result.charAt(0) == 'y';\n\t}", "public static void main(String[] args) {\n System.out.println(\"Enter no of array elements\");\n Scanner s=new Scanner(System.in);\n int a=s.nextInt();\n int[] arr =new int[a];\n\n System.out.println(\"Enter array elements\");\n for(int i=0;i<arr.length;i++)\n {\n arr[i]=s.nextInt();\n }\n\n\n int sum=0;\n for(int i=0;i<a;i++)\n {\n sum=sum+arr[i];\n }\n System.out.println(\"Sum of array elements \"+sum);\n }", "public static void main(String[] args) {\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter length of the array :\");\n\t\tint length = input.nextInt();\n\t\tint [] array = new int [length];\n\t\tSystem.out.println(\"Enter numbers of the array and split them with space :\");\n\t\tfor (int index = 0; index < array.length; index++)\n\t\t\tarray [index] = input.nextInt();\n\t\t\n\t\tReorderArrays reor = new ReorderArrays();\n\t\treor.Reorder(array, length);\n\t\tfor (int index = 0; index < array.length; index++)\n//\t\t\tSystem.out.printf(\"%-2d\", array[index]);\n\t\t\tSystem.out.printf(\"%d\\t\", array[index]);\n\t}", "public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint n = scn.nextInt();\n\t\tint[] arr = new int[n];\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tarr[i] = scn.nextInt();\n\t\t}\n\t\tSystem.out.println(val(arr));\n\t}", "public static void main(String[] args) {\n\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint n = sc.nextInt();\r\n\t\tint arr[] = new int[n];\r\n\t\tfor(int i = 0; i < n ; i++) {\r\n\t\t\tarr[i] = sc.nextInt();\r\n\t\t}\r\n\t\t\r\n\t\tint new_length = n;\r\n\t\tfor(int i = 0; i < new_length ; i++) {\r\n\t\t\tfor(int j = i+1 ; j < new_length ; j++) {\r\n\t\t\t\tif(arr[i] == arr[j]) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr[j] = arr[ new_length-1];\r\n \r\n\t\t\t\t\t new_length--;\r\n \r\n j--;\r\n \r\n\t\t\t\t\tint arr1[] = Arrays.copyOf(arr, new_length);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < new_length ; i++) {\r\n\t\t\tSystem.out.println(arr[i]);\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n System.out.println(\"Quantidade total de números no array vai ser...\");\n int n = scan.nextInt();\n int[] unsorted = new int[n];\n for (int i = 0; i < n; i++) {\n System.out.println(\"Digite um número: \");\n unsorted[i] = scan.nextInt();\n }\n scan.close();\n System.out.println(\"-----------------\");\n\n bubbleSort(unsorted);\n }", "public static void main(String[ ] argv) {\n if(argv.length == 0){\n System.out.printf(\"sem argumentos!\\n\");\n }\n\n else{\n System.out.println (\"\\nmostrando o array \\n\");\n \n \n for(int i = 0;i < argv.length;i++){\n System.out.printf(\"\\narray na posiçao: %d eh %s\\n \",i+1,argv[i]);\n \n }\n System.out.printf(\"\\ntotal do array: %d\\n\",argv.length);\n}\n \n }", "public static void main(String[] args) {\n\t\tRandom random = new Random();\n\t\tScanner scan = new Scanner(System.in);\n\t\tint n = scan.nextInt();\n//\t\tSystem.out.print(n);\n\t\tint[] lotto = new int[6];\n\t\tString str = \"[\";\n\t\t\n\t\tfor(int i=0; i<n; i++) {\n\t\t\tfor(int j=0; j<6; j++) {\n\t\t\t\tlotto[i] = random.nextInt(45)+1;\n\t\t\t\tif (j == 5) {\n\t\t\t\t\tstr += String.valueOf(lotto[i])+\"\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstr += String.valueOf(lotto[i])+\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr += \"]\";\n\t\t\t\n\t\t\tSystem.out.println((i+1) + \"번째 : \" + str);\n\t\t\tstr = \"[\";\n\t\t}\n\t}", "public static void main(String[] args) {\r\n Scanner s = new Scanner(System.in);\r\n int length = Integer.parseInt(s.nextLine());\r\n int[] arr = new int[length];\r\n for (int i=0; i<length; i++)\r\n {\r\n arr[i] = s.nextInt();\r\n }\r\n quickSort(arr, 0, length-1);\r\n// printArray(arr);\r\n }", "public static void main(String[] args) {\n\t\tint nums[] = readArrayFromConsole();\n\n\t\t// \n\t\tSystem.out.println(\"\\nInitial Array: \" + Arrays.toString(nums));\n\t\tnums = breakArray(nums);\n\t\tSystem.out.println(\"Sorted Array: \" + Arrays.toString(nums));\n\t}", "public static void main(String[] args) throws Exception {\n Scanner scn=new Scanner (System.in);\r\n int n=scn.nextInt(); \r\n int[] arr=new int[n];\r\n for(int i=0;i<n;i++){\r\n arr[i]=scn.nextInt();\r\n }\r\n System.out.println(lis(arr));\r\n }", "public static void Main()\n\t{\n\t\tdouble[] p = new double[100];\n\t\tint m;\n\t\tint n;\n\t\tint i;\n\t\tint j;\n\t\tString tempVar = ConsoleInput.scanfRead();\n\t\tif (tempVar != null)\n\t\t{\n\t\t\tm = Integer.parseInt(tempVar);\n\t\t}\n\t\tfor (i = 0;i < m;i++)\n\t\t{\n//C++ TO JAVA CONVERTER TODO TASK: The memory management function 'malloc' has no equivalent in Java:\n\t\t\tp[i] = (double)malloc(100 * (Double.SIZE / Byte.SIZE));\n\t\t}\n\t\tfor (i = 0;i < m;i++)\n\t\t{\n\t\t\tString tempVar2 = ConsoleInput.scanfRead();\n\t\t\tif (tempVar2 != null)\n\t\t\t{\n\t\t\t\tn = Integer.parseInt(tempVar2);\n\t\t\t}\n\t\t\tfor (j = 0;j < n;j++)\n\t\t\t{\n\t\t\t\tString tempVar3 = ConsoleInput.scanfRead();\n\t\t\t\tif (tempVar3 != null)\n\t\t\t\t{\n\t\t\t\t\tp[i] + j = tempVar3;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.printf(\"%.5lf\\n\",s(p[i], n));\n\n\t\t}\n\t}", "public PilaEnterosArray() {\n\t\ttop = -1;\n\t}", "public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\n\t System.out.print(\"Enter the Number : \");\n int a=s.nextInt();\n int arr[]=new int[a];\n for(int i=0;i<a;i++)\n {\n \t arr[i]=s.nextInt();\n }\n \n System.out.print(\"Output : \"+(arr[0]+arr[1]));\n s.close();\n\t}", "public static void main(String[] args) {\n\t\tString Str[]=new String[100];\n\t\tint dig[]=new int[100];\n\t\tint choice;\n\t\tint n = 0,m = 0;\n\t\t\n\t\tSystem.out.println(\"Press 1 for String Array or Press 2 for Integer Array\\n\");\n\t\tScanner input1=new Scanner(System.in);\n\t\tScanner input2=new Scanner(System.in);\n\t\tScanner input3=new Scanner(System.in);\n\t\tScanner input4=new Scanner(System.in);\n\t\tScanner input5=new Scanner(System.in);\n\t\t\n\t\tchoice=input3.nextInt();\n\t\t\n\t\tswitch(choice) {\n\t\tcase 1:\n\t\t\tSystem.out.println(\"Enter the length of string array\\n\");\n\t\t\tn=input4.nextInt();\n\t\t\tSystem.out.println(\"Enter the string array\\n\");\n\t\t\tfor(int i=0;i<n;i++) {\n\t\t\t\tStr[i]=input1.nextLine();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tSystem.out.println(\"Enter the length of integer array\\n\");\n\t\t\tm=input5.nextInt();\n\t\t\tSystem.out.println(\"Enter the integer array\\n\");\n\t\t\tfor(int i=0;i<m;i++)\n\t\t\t{\n\t\t\t\tdig[i]=input2.nextInt();\n\t\t\t}\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"Invalid Input\");\n\t\t}\n\t\t\n\t\tif(choice==1)\n\t\t{\n\t\t\tfor(int i=n-1;i>=0;i--)\n\t\t\t{\n\t\t\t\tSystem.out.println(Str[i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if(choice==2)\n\t\t{\n\t\t\tfor(int i=m-1;i>=0;i--)\n\t\t\t{\n\t\t\t\tSystem.out.println(dig[i]);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tint [] Num = {1,2,3,4,5};\n\t\tint [] newNum = new int[10];\n//\t\tfor(int i=0;i<Num.length;i++) {\n//\t\t\tnewNum[i] = Num[i];\n//\t\t}\n//\t\tnewNum = Num;\n\t\tSystem.arraycopy(Num,0, newNum,0,Num.length);\n\t\tSystem.out.println(newNum);\n\t}", "private void declareArray() {\n\t\twriter.println();\n\t\twriter.println(\"; array of 52 for variables:\");\n\t\twriter.print(variables + \" dw\");\n\t\tfor (int i = 0; i < 51; i++) {\n\t\t\twriter.print(\" 0,\");\n\t\t}\n\t\twriter.println(\" 0\");\n\t}", "public static void main(String args[]) {\n \n Scanner in=new Scanner(System.in);\n int s=in.nextInt();\n \n int arr[]=new int[s];\n \n for(int i=0;i<s;i++)\n {\n arr[i]=in.nextInt();\n }\n fun(s,arr);\n \n}", "public static void main(String[] args) {\n\n\t\tScanner sc=new Scanner(System.in);\n\t\t int i,j,col,row;\n\t\t System.out.println(\"Enter the rows : \");\n\t\t row=sc.nextInt();\n\t\t \n\t\t System.out.println(\"Enter the cols : \");\n\t\t col=sc.nextInt();\n\t\t \n\t\t int[][] arr=new int[row][col];\n\t\t \n\t\t System.out.println(\"Enter the elements in the array : \");\n\t\t \n\t\t for(i=0;i<row;i++)\n\t\t {\n\t\t\t for(j=0;j<col;j++)\n\t\t\t {\n\t\t\t\t arr[i][j]=sc.nextInt();\n\t\t\t }\n\t\t }\n\t\t \n\t\t for(i=0;i<row;i++)\n\t\t {\n\t\t\t for(j=0;j<col;j++)\n\t\t\t {\n\t\t\t\t //arr[i][j]=sc.nextInt();\n\t\t\t\t\n\t\t\t\t System.out.print(arr[i][j]+\" \");\n\t\t\t\t\n\t\t\t }\n\t\t\t System.out.println();\n\t\t }\n\t}", "public static void createArrayOfEvens(){\n\n int[] evens = new int[10];\n\n for (int i = 0; i < evens.length; i++) {\n evens[i] = (i + 1) * 2;\n }\n\n System.out.println(evens);\n\n for (int i = 0; i < evens.length; i++) {\n System.out.println(i + \": \" + evens[i]);\n }\n }", "public static void main(String[] args) {\n fillArrayWithValues();\n }", "public static void main(String[] args) {\n\r\n\t\tScanner scan = new Scanner (System.in);\r\n\r\n\t\tint n;\r\n\t\tSystem.out.println(\"Please enter the amount of names you are inputting\");\r\n\t\tn = Integer.parseInt(scan.nextLine());\r\n\t\tString[] names = new String[n];\r\n\r\n\t\tSystem.out.println(\"Please enter the names one by one\");\r\n\t\tfor (int i = 0; i<n; i++)\t\t\t\r\n\t\t\tnames[i] = scan.nextLine();\t\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\tfor(int i = 0; i<n; i++)\r\n\t\t\tSystem.out.println(names[i]);\t\r\n\t\t\r\n\t\tfor(int i = n - 1; i>=0; i--)\r\n\t\t\tSystem.out.println(names[i]);\r\n\r\n\r\n\r\n\r\n\r\n\t}", "public static void main(String[] args) {\n\n\t\tScanner ler = new Scanner(System.in);\n\t\t\n\t\tint x;\n\t\tint vetor[] = new int[5];\n\t\t\n\t\tfor(x=0;x<5;x++) {\n\t\t\tSystem.out.print(\"Digite um número: \");\n\t\t\tvetor[x] = ler.nextInt();\n\t\t}\n\t\t\n\t\tfor(x=0;x<5;x++) {\n\t\t\tSystem.out.println(vetor[x]);\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String[] str = new String[3];\n for (int i = 0; i < 3; i++) {\n str[i] = sc.nextLine();\n }\n for (int j = 2; j >= 0; j--) {\n System.out.println(str[j]);\n }\n }", "public abstract void startArray();", "public static void main(String[] args) \n\t{\n\t\tint i = 0;\n\t\tint continuar = 0; \n\t\templeados = new Empleado[20];\n\t\ts = new Scanner(System.in);\n\t\t\n\t\twhile (continuar == 0)\n\t\t{\n\t\t\tString opc = \"\";\n\t\t\tSystem.out.println(\"Ingrese los datos del nuevo empleado: \");\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"El empleado es un vendedor o un administrativo ?\");\n\t\t\tSystem.out.println(\"Ingrese una V o una A respectivamente\");\n\t\t\ts.nextLine();\n\t\t\topc = s.nextLine();\n\t\t\tif (opc.equals(\"V\") || opc.equals(\"v\"))\n\t\t\t{\n\t\t\t\tVendedor vend = new Vendedor();\n\t\t\t\tEmpresa.cargaVendedor(vend);\n\t\t\t\templeados[i] = vend;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAdministrativo admin = new Administrativo();\n\t\t\t\tEmpresa.cargaAdministrativo(admin);\n\t\t\t\templeados[i] = admin;\n\t\t\t}\n\t\t\ti++;\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Quiere seguir ingresando personas ?\");\n\t\t\t\tSystem.out.println(\"0-Si \");\n\t\t\t\tSystem.out.println(\"1-No\");\n\t\t\t\tcontinuar = Integer.parseInt(s.nextLine());\n\t\t\t}while (continuar != 0 && continuar != 1);\n\t\t\t\n\t\t\tEmpresa.mostrarDatos(i);\n\t\t}\n\t\t\n\t\t\n\t\ts.close();\n\t}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int length = in.nextInt();\n ArrayList<Integer> array = new ArrayList<Integer>();\n for (int i = 0; i < length; i++) {\n array.add(in.nextInt());\n }\n int num_queries = in.nextInt();\n String instr = \"\";\n int index, temp;\n for (int i = 0; i < num_queries; i++){\n instr = in.next();\n index = in.nextInt();\n if (instr.equals(\"Insert\")) {\n temp = in.nextInt();\n array.add(index,temp);\n } else if (instr.equals(\"Delete\")) {\n array.remove(index);\n }\n }\n for (int i = 0; i < length; i++) {\n System.out.print(array.get(i));\n System.out.print(\" \");\n }\n }", "void addcontact()\n {\n Scanner sc=new Scanner(System.in);\n System.out.print(\"Please enter the name:\");\n name[i]=sc.nextLine();\n System.out.print(\"Please enter the contact:\");\n PhoneNo[i++]=sc.nextLine();\n }", "public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n // System.out.println(\"How many names would like to output: \");\n String linesString = scan.nextLine().trim();\n int lines = Integer.parseInt(linesString);\n String[] names = new String[lines];\n for(int i = 0; i < lines; i++) {\n\t// System.out.println(\"Please enter name \" + (i+1) + \":\");\n names[i] = scan.nextLine();\n }\n for(int i = 0; i < lines; i++) {\n System.out.println(\"Hello, \" + names[i] + \"!\");\n }\n \n\n }" ]
[ "0.64329296", "0.6418267", "0.6328941", "0.629666", "0.6290755", "0.6197232", "0.61648446", "0.6155081", "0.61075944", "0.6085303", "0.60827667", "0.6061707", "0.6000015", "0.5999443", "0.5945535", "0.59404296", "0.5875513", "0.58712626", "0.5834676", "0.5810679", "0.5808572", "0.58019453", "0.5800501", "0.5798427", "0.57941186", "0.5782628", "0.57693064", "0.57461804", "0.5746152", "0.57311505", "0.573016", "0.572183", "0.5719622", "0.570975", "0.57097226", "0.5702806", "0.5699114", "0.56802076", "0.56598413", "0.56465644", "0.563797", "0.5633594", "0.56328", "0.56050247", "0.5589115", "0.5588547", "0.5563596", "0.55635935", "0.556293", "0.55608886", "0.55427426", "0.5535607", "0.5528583", "0.5528475", "0.55183244", "0.5508463", "0.5505446", "0.54796255", "0.54760796", "0.5473418", "0.5461636", "0.54227656", "0.5418094", "0.5417274", "0.5412654", "0.5393144", "0.5384997", "0.53848976", "0.53826934", "0.53696257", "0.5364872", "0.53639674", "0.5358568", "0.5357974", "0.53537387", "0.534561", "0.53421456", "0.53302944", "0.53243273", "0.5313436", "0.5306405", "0.5301756", "0.530166", "0.53007156", "0.5299636", "0.52968466", "0.5296643", "0.52961516", "0.5290201", "0.5289622", "0.528015", "0.52789164", "0.5277518", "0.5276673", "0.52670693", "0.5264732", "0.52639747", "0.52611643", "0.5254723", "0.5243396" ]
0.60907507
9
Created by Administrator on 2017/8/9.
public interface SplashView { void onCheckLogin(boolean isLogin); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "public final void mo51373a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n protected void initialize() {\n\n \n }", "Petunia() {\r\n\t\t}", "public contrustor(){\r\n\t}", "public void mo6081a() {\n }", "public Pitonyak_09_02() {\r\n }", "public void mo55254a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "private TMCourse() {\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "public void designBasement() {\n\t\t\r\n\t}", "public void autoDetails() {\n\t\t\r\n\t}", "public void mo12930a() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void verarbeite() {\n\t\t\r\n\t}", "public void create() {\n\t\t\n\t}", "private UsineJoueur() {}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void poetries() {\n\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void create() {\n\n\t}", "protected void mo6255a() {\n }", "private void init() {\n\n\t}", "private static void oneUserExample()\t{\n\t}", "@Override\n void init() {\n }", "private void getStatus() {\n\t\t\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void create() {\n\r\n\t}", "private Singletion3() {}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void mo1531a() {\n }", "public void mo9848a() {\n }", "private ReportGenerationUtil() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n public void init() {\n }", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void mo21877s() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "protected Doodler() {\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}" ]
[ "0.62658614", "0.6120614", "0.5841633", "0.5831579", "0.5830393", "0.5805522", "0.5763946", "0.5743277", "0.5740511", "0.57393867", "0.5732114", "0.5732114", "0.57198036", "0.5714254", "0.57118565", "0.5693828", "0.56911665", "0.5690636", "0.5690636", "0.56858087", "0.56746095", "0.5646273", "0.56012815", "0.55958617", "0.55958617", "0.55958617", "0.55958617", "0.55958617", "0.55958617", "0.55958617", "0.5579345", "0.55749303", "0.5574187", "0.55406964", "0.5539701", "0.553571", "0.5520503", "0.55165213", "0.5516151", "0.55130035", "0.55026114", "0.5493925", "0.5491826", "0.5488043", "0.54632896", "0.5460024", "0.5456252", "0.5454018", "0.5443101", "0.54287094", "0.54260665", "0.5416968", "0.5411402", "0.5406625", "0.5406625", "0.5406625", "0.5406625", "0.5406625", "0.5406625", "0.5400568", "0.5398551", "0.53943753", "0.53900564", "0.538668", "0.53779006", "0.53694373", "0.5363274", "0.5360445", "0.53581446", "0.5354603", "0.53530437", "0.53524166", "0.53443736", "0.53371525", "0.5335902", "0.5334372", "0.5327717", "0.5325755", "0.5325253", "0.53201425", "0.5317095", "0.5313844", "0.5309518", "0.5309518", "0.53090745", "0.5308623", "0.5307281", "0.5304154", "0.5298734", "0.52978235", "0.5293986", "0.52938837", "0.52869695", "0.52869695", "0.52869695", "0.52869695", "0.52869695", "0.5282459", "0.52792734", "0.52778125", "0.52764726" ]
0.0
-1
checks if a specific move is generated at the current board position
private boolean moveExists(int move) { int[] board = mGame.getBoard(); int piece = board[move & Move.SQUARE_MASK]; int side = piece >> Piece.SIDE_SHIFT & 1; if (side != mGame.getCurrentSide()) { return false; } if ((piece & Piece.DEAD_FLAG) != 0) { return false; } MoveArray moves = MoveGenerator.generateMoves(mGame); int[] mv = moves.getMoves(); int size = moves.size(); for (int i = 0; i < size; i++) { if(mv[i] == move) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkMove(int move)\n\t{\n\t\tif (columns[move] < 6)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public abstract boolean validMove(ChessBoard board, Square from, Square to);", "boolean isValidMove(int col);", "boolean legalMove(Move mov) {\n if (mov == null || !validSquare(mov.toIndex())\n || !validSquare(mov.fromIndex())) {\n throw new IllegalArgumentException(\"Illegal move\");\n }\n PieceColor from = get(mov.fromIndex());\n PieceColor to = get(mov.toIndex());\n if (!mov.isJump() && jumpPossible()) {\n return false;\n }\n if (from != _whoseMove) {\n return false;\n } else if (mov.isJump()) {\n return checkJump(mov, false);\n } else if (from == BLACK && row(mov.fromIndex()) == '1') {\n return false;\n } else if (from == WHITE && row(mov.fromIndex()) == '5') {\n return false;\n } else if (mov.isLeftMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Right\");\n } else if (mov.isRightMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Left\");\n } else if (from == BLACK) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.fromIndex() - mov.toIndex() == SIDE\n || mov.fromIndex() - mov.toIndex() == SIDE - 1\n || mov.fromIndex() - mov.toIndex() == SIDE + 1;\n } else {\n return mov.fromIndex() - mov.toIndex() == SIDE && to == EMPTY;\n }\n } else if (from == WHITE) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.toIndex() - mov.fromIndex() == SIDE\n || mov.toIndex() - mov.fromIndex() == SIDE + 1\n || mov.toIndex() - mov.fromIndex() == SIDE - 1;\n } else {\n return mov.toIndex() - mov.fromIndex() == SIDE && to == EMPTY;\n }\n }\n return false;\n }", "private boolean hasPossibleMove()\n {\n for(int i=0; i<FieldSize; ++i)\n {\n for(int j=1; j<FieldSize; ++j)\n {\n if(field[i][j] == field[i][j-1])\n return true;\n }\n }\n for(int j=0; j<FieldSize; ++j)\n {\n for(int i=1; i<FieldSize; ++i)\n {\n if(field[i][j] == field[i-1][j])\n return true;\n }\n }\n return false;\n }", "private boolean isThereValidMove() {\n\t\treturn true;\n\t}", "public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }", "private boolean isLegalMove(String move) {\n\t\tString[] moveParts = move.split(\";\");\n\n\t\tint fromRow = Integer.parseInt(moveParts[0].charAt(0) + \"\");\n\t\tint fromCol = Integer.parseInt(moveParts[0].charAt(1) + \"\");\n\n\t\tint toRow = Integer.parseInt(moveParts[1].charAt(0) + \"\");\n\t\tint toCol = Integer.parseInt(moveParts[1].charAt(1) + \"\");\n\n\t\tint minRow = Math.min(fromRow, toRow);\n\t\tint minCol = Math.min(fromCol, toCol);\n\n\t\tint maxRow = Math.max(fromRow, toRow);\n\t\tint maxCol = Math.max(fromCol, toCol);\n\n\t\tint piece = board[fromRow][fromCol];//Integer.parseInt(moveParts[2]);\n\t\tint pieceType = Math.abs(piece);\n\t\tint team = Math.round(Math.signum(piece));\n\n\t\tif (team == Math.round(Math.signum(board[toRow][toCol]))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (toRow < 0 || toRow > 7 && toCol < 0 && toCol > 7) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (team > 0) { // WHITE\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isWhiteCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else { //BLACK\n\t\t\tint enpassantBackup = enpassantCol;\n\t\t\tint[][] boardBackup = deepCopyBoard();\n\t\t\tapplyConvertedMove(move);\n\t\t\tboolean check = isBlackCheck();\n\t\t\tboard = boardBackup;\n\t\t\tenpassantCol = enpassantBackup;\n\t\t\tif (check) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (pieceType == 1) { //Pawn\n\t\t\treturn ((board[toRow][toCol] != 0 && toRow == fromRow + team && (toCol == fromCol + 1 || toCol == fromCol - 1)) || (toCol == fromCol && board[toRow][toCol] == 0 && ((toRow == fromRow + team) || (((fromRow == 1 && team == 1) || (fromRow == 6 && team == -1)) ? toRow == fromRow + 2*team && board[fromRow + team][fromCol] == 0 : false))));\n\t\t} else if (pieceType == 2) { //Rook\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (pieceType == 3) { //Knight\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy == 5;\n\t\t} else if (pieceType == 4) { //Bishop\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\tint m = dy/dx;\n\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && board[i][startCol + m*(i - minRow)] != 7) return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else if (pieceType == 5) { //Queen\n\t\t\tif (toRow == fromRow) {\n\t\t\t\tfor (int i = minCol + 1; i < maxCol; i++) {\n\t\t\t\t\tif (board[toRow][i] != 0 && Math.abs(board[toRow][i]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else if (toCol == fromCol) {\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][toCol] != 0 && Math.abs(board[i][toCol]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tint dx = toRow - fromRow;\n\t\t\t\tint dy = toCol - fromCol;\n\t\t\t\tif (dy != dx && dy != -dx) return false;\n\t\t\t\tint m = dy/dx;\n\t\t\t\tint startCol = (m < 0 ? maxCol : minCol);\n\t\t\t\tfor (int i = minRow + 1; i < maxRow; i++) {\n\t\t\t\t\tif (board[i][startCol + m*(i - minRow)] != 0 && Math.abs(board[i][startCol + m*(i - minRow)]) != 7) return false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else if (pieceType == 6) { //King\n\t\t\tint dx = toRow - fromRow;\n\t\t\tint dy = toCol - fromCol;\n\t\t\treturn dx*dx + dy*dy <= 2;\n\t\t}\n\n\t\treturn false;\n\t}", "public abstract boolean canMove(Board board, Spot from, Spot to);", "boolean isLegal(String move) {\n int[][] theStatusBoard;\n if (_playerOnMove == ORANGE) {\n theStatusBoard = _orangeStatusBoard;\n } else {\n theStatusBoard = _violetStatusBoard;\n }\n Pieces thispiece = new Pieces();\n String piecename = move.substring(0, 1);\n int col = getCoordinate(move.substring(1, 2));\n int row = getCoordinate(move.substring(2, 3));\n int ori = Integer.parseInt(move.substring(3, 4));\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n if (row + depth - 1 > 13 || col + length - 1 > 13) {\n System.out.println(\"Your move makes your piece out of the board, try again!\");\n return false;\n }\n\n boolean has1 = false;\n boolean no2 = true;\n\n int i, j;\n for (i = 0; i < depth; i++) {\n for (j = 0; j < length; j++) {\n if (finalPositions[i][j] == 1) {\n if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 1) {\n has1 = true;\n } else if (theStatusBoard[15 - (row + depth - i)][col + j + 1] == 2) {\n return false;\n }\n }\n }\n }\n System.out.println(\"has1: \" + has1);\n return has1;\n }", "private boolean isValidMove(int position) {\n\t\tif( !(position >= 0) || !(position <= 8) ) return false;\n\n\t\treturn gameBoard[position] == 0;\n\t}", "@Override\n public boolean isValidMove(Move move) {\n if (board[move.oldRow][move.oldColumn].isValidMove(move, board))\n return true;\n //player will not be in check\n //move will get player out of check if they are in check\n return false;\n }", "private static boolean canMove() {\n return GameManager.getCurrentTurn();\r\n }", "boolean isValidMove(int move)\n\t{\n\t\treturn move >= 0 && move <= state.size() - 1 && state.get(move) == 0;\n\t}", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "private boolean isMove() {\n return this.getMoves().size() != 0;\n }", "private boolean isPlayer1Move(int move) {\n return ((move < 5) || (move == 10));\n }", "public boolean isValidMove(int toRow,int toCol){\n //Stayed in the same spot\n if(myRow == toRow && myCol == toCol){\n return false;\n }\n //if the xy coordinate we are moving to is outside the board\n if(toRow < 0 || toRow > 11 || toCol < 0 || toCol > 11){\n return false;\n }\n return true;\n }", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "private static boolean checkInBoard(\n \t\t\tde.fhhannover.inform.hnefatafl.vorgaben.Move currentMove,\n \t\t\tBoard board) {\n \t\tif (currentMove.getFromCell().getCol() > boardSize\n \t\t\t\t|| currentMove.getFromCell().getCol() < 0 ||\n \n \t\t\t\tcurrentMove.getToCell().getCol() > boardSize\n \t\t\t\t|| currentMove.getToCell().getCol() < 0 ||\n \n \t\t\t\tcurrentMove.getFromCell().getRow() > boardSize\n \t\t\t\t|| currentMove.getFromCell().getRow() < 0 ||\n \n \t\t\t\tcurrentMove.getToCell().getRow() > boardSize\n \t\t\t\t|| currentMove.getToCell().getRow() < 0) {\n \t\t\tif (gamelog)\n \t\t\t\tGameLog.logDebugEvent(\"Move außerhalb vom Board\");\n \t\t\treturn false;\n \t\t}\n \n \t\telse\n \t\t\treturn true;\n \t}", "@Override\n\tpublic boolean canMoveTo(Integer row, Integer col, ChessBoard board) {\n\t\tif((0<=(this.row - row)<=1 && 0<=(this.col - col)<=1) && (1==(this.row - row) || (this.col - col)==1));\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t\tfor(int i=0; i<=1 i++) {\n\t\t\tfor(int j=0, j<=1, j++) {\n\t\t\t\tif((i=0) && (j=0))\n\t\t\t\t\t\tcontinue;\n\t\t\t\tboard.pieceAt(row, col);\n\t\t\t}\n\t\t}\n\t\tboard.pieceAt(row, col)\n\t\t\n\t\telse if()\n\t}\n\n\t@Override\n\tpublic void moveTo(Integer row, Integer col) {\n\t\t\n\t\t\n\t}\n\n\t@Override\n\tpublic PieceType getType() {\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}\n}", "@Override\n\tpublic boolean move(int col, int row, piece[][] board) {\n\t\treturn false;\n\t}", "public boolean checkMove(int x, int y, int move){\r\n\t\tif (move == -1) {\r\n\t\t\treturn true;\r\n\t\t}else if ((x < 1) || (y < 1) || (x > this.size) || (y > this.size) || (move < 1) || (move > this.size)){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\tif (getXValues()[x][move] || getYValues()[y][move]) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}return true;\r\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX());\r\n int y = Math.abs(from.getY() - to.getY());\r\n // to check if the move is 1unit vertically or horizontally\r\n if (x + y == 1) {\r\n return true;\r\n }else if (x == y && x == 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }", "boolean checkMove(int row, int col, int dir) {\r\n\t\tint dimRow = board.getDimRow();\r\n\t\tint dimCol = board.getDimCol();\r\n\r\n\t\tif (row == 0 && dir == Ship.UP) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (row == 0 && dir == Ship.LEFT_UP) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (row == 0 && dir == Ship.RIGHT_UP) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (col == 0 && dir == Ship.LEFT) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (col == 0 && dir == Ship.LEFT_UP) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (col == 0 && dir == Ship.LEFT_DOWN) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (row == dimRow - 1 && dir == Ship.DOWN) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (row == dimRow - 1 && dir == Ship.LEFT_DOWN) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (row == dimRow - 1 && dir == Ship.RIGHT_DOWN) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (col == dimCol - 1 && dir == Ship.RIGHT) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (col == dimCol - 1 && dir == Ship.RIGHT_UP) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (col == dimCol - 1 && dir == Ship.RIGHT_DOWN) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\r\n\t}", "public boolean isValidMove(Move move, IChessPiece[][] board) {\n\t\tif(!super.isValidMove(move, board)){\n\t\t\treturn false;\n\t\t}\n\t\tif(Math.abs(move.fromRow-move.toRow)>1 || Math.abs(move.fromColumn-move.toColumn)>1){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean isMovePossible(int boardIndex, int markIndex) throws IllegalArgumentException;", "@Override\n public boolean isValidMove(Tile target, Board board) {\n if (target == null || board == null) {\n throw new NullPointerException(\"Arguments for the isValidMove method can not be null.\");\n }\n // current and target tiles have to be on a diagonal (delta between row and col index have to be identical)\n int currentCol = this.getTile().getCol();\n int currentRow = this.getTile().getRow();\n int targetCol = target.getCol();\n int targetRow = target.getRow();\n\n int deltaRow = Math.abs(currentRow - targetRow);\n int deltaCol = Math.abs(currentCol - targetCol);\n int minDelta = Math.min(deltaCol, deltaRow);\n\n boolean sameDiagonal = deltaCol == deltaRow;\n\n // check if there are pieces between the tiles\n boolean noPiecesBetween = true;\n // Directions -- (Up and to the left) , -+ (Up and to the right), ++, +-\n if (targetRow < currentRow && targetCol < currentCol) { // --\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n\n } else if (targetRow > currentRow && targetCol < currentCol) { // +-\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow > currentRow && targetCol > currentCol) { // ++\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow < currentRow && targetCol > currentCol) { // -+\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n }\n\n return sameDiagonal && noPiecesBetween;\n }", "private boolean anyMove (int x,int y, OthelloPiece colour){\n boolean valid = false;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_1,colour)) valid=true;\n return (valid);\n }", "public boolean isRealMove(Movement movement, Board board, String turn) {\n\n\t\tList<Square> squares = getSquares(board, movement);\n\t\tIterator<Square> i = squares.iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tSquare square = i.next();\n\t\t\tif (!square.isEmpty()) {\n\t\t\t\tPiece p = square.getPieza();\n\t\t\t\tif (p != null) {\n\t\t\t\t\tif (turn.equals(square.getPieza().getColor())) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse { //it is different color\n\t\t\t\t\t\tif ((square.getHorizontal()+square.getVertical()).equals(movement.getDestiny())) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "private boolean isNextMoveEnPassentCapture(Move move)\r\n\t{\r\n\t\tif (!(move.capture instanceof Pawn)) return false;\r\n\t\tif (Math.abs(move.from.coordinate.x - move.to.coordinate.x) != 1) return false;\r\n\t\tif (Math.abs(move.from.coordinate.y - move.to.coordinate.y) != 1) return false;\r\n\t\tif (!move.to.isEmpty()) return false;\r\n\t\treturn true;\r\n\t}", "public boolean canMove() {\n ArrayList<Location> valid = canMoveInit();\n if (valid == null || valid.isEmpty()) {\n return false;\n }\n ArrayList<Location> lastCross = crossLocation.peek();\n for (Location loc : valid) {\n Actor actor = (Actor) getGrid().get(loc);\n if (actor instanceof Rock && actor.getColor().equals(Color.RED)) {\n next = loc;\n isEnd = true;\n return false;\n }\n if (!lastCross.contains(loc)) {\n lastCross.add(loc);\n next = loc;\n ArrayList<Location> nextCross = new ArrayList<>();\n nextCross.add(next);\n nextCross.add(last);\n crossLocation.push(nextCross);\n return probabilityAdd();\n }\n }\n next = lastCross.get(1);\n crossLocation.pop();\n return probabilitySub();\n }", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }", "public boolean isMovePossible(int boardIndex) throws IllegalArgumentException;", "public boolean checkMove(location start_pos, location end_pos, chess[][] board){\n // move in vertical direction or horizontal direction\n if(start_pos.getY() == end_pos.getY() || start_pos.getX() == end_pos.getX() ){\n // Distance is greater than zero\n if(!isStay(start_pos, end_pos)){\n return !isChessOnWay(start_pos, end_pos, board);\n }\n }\n return false;\n }", "boolean findMove(int row, int col, int[][] someStatusBoard) {\n String leftPieces;\n if (_playerOnMove == ORANGE) {\n leftPieces = Game._orangePieces;\n } else {\n leftPieces = Game._violetPieces;\n }\n String trialMove = \"\";\n int numleftPieces = leftPieces.length();\n int l, ori;\n for (l = 0; l < numleftPieces; l++) {\n for (ori = 0; ori < 8; ori++) {\n String piecename = leftPieces.substring(l, l + 1);\n Pieces thispiece = new Pieces();\n int[][] initialPositions = thispiece.getInitialPositions(piecename);\n int[][] finalPositions = thispiece.processPositions(initialPositions, ori);\n int depth = finalPositions.length;\n int length = finalPositions[0].length;\n\n int m, n;\n for (m = 0; m < depth; m++) {\n for (n = 0; n < length; n++) {\n if (finalPositions[m][n] == 1) {\n int newCol = col - 1 - n;\n int newRow = 15 - row - depth;\n if (newCol >= 0 && newRow >= 0) {\n trialMove = piecename + changeBack(newCol) + changeBack(newRow) + ori;\n System.out.println(newCol);\n System.out.println(newRow);\n System.out.println(trialMove);\n if (isLegal(trialMove)) {\n return true;\n }\n }\n }\n }\n }\n }\n }\n return false;\n }", "boolean canMove(Tile t);", "boolean canMove(Color player) {\n int[][] myStatusBoard;\n if (_playerOnMove == ORANGE) {\n myStatusBoard = _orangeStatusBoard;\n } else {\n myStatusBoard = _violetStatusBoard;\n }\n if (Game._totalMoves < 2) {\n return true;\n }\n int i, j;\n for (i = 0; i < 16; i++) {\n for (j = 0; j < 16; j++) {\n if (myStatusBoard[i][j] == 1) {\n if (findMove(i, j, myStatusBoard)) {\n return true;\n }\n }\n }\n }\n return false;\n }", "public boolean isValidMove(Point orig, Point dest){ \r\n Color playerColor = model.getCurrentPlayer().getColor();\r\n // Validate all point between board limits\r\n if(!isValidPosition(orig) || !isValidPosition(dest)) return false;\r\n // Check for continue move starting piece\r\n if(model.getCheckPiece() != null && !model.getCheckPiece().equals(orig)) return false;\r\n // Validate origin piece to player color\r\n if((isRed(playerColor) && !isRed(orig)) || (isBlack(playerColor) && !isBlack(orig))) return false;\r\n // Only can move to empty Black space\r\n if(!isEmpty(dest)) return false;\r\n // If current player have obligatory eats, then need to eat\r\n if(obligatoryEats(playerColor) && !moveEats(orig,dest)) return false;\r\n // Check move direction and length\r\n int moveDirection = orig.getFirst() - dest.getFirst(); // Direction in Rows\r\n int rLength = Math.abs(moveDirection); // Length in Rows\r\n int cLength = Math.abs(orig.getSecond() - dest.getSecond()); // Length in Columns\r\n int mLength;\r\n // Only acepts diagonal movements in 1 or 2 places (1 normal move, 2 eats move)\r\n if ((rLength == 1 && cLength == 1) || (rLength == 2 && cLength == 2)){\r\n mLength = rLength;\r\n } else {\r\n return false;\r\n }\r\n // 1 Place movement\r\n if (mLength == 1){ \r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n // 2 Places movement need checks if eats rivals\r\n if (mLength == 2){\r\n // Compute mid point\r\n Point midPoint = getMidPoint(orig, dest);\r\n // Check move\r\n if ((isRed(orig) && isBlack(midPoint)) || (isBlack(orig) && isRed(midPoint))){\r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n }\r\n return false;\r\n }", "@Override\n public boolean canMove(int destinationX, int destinationY) {\n int differenceX = Math.abs(destinationX - this.boardCoordinates.x);\n int differenceY = Math.abs(destinationY - this.boardCoordinates.y);\n\n return (destinationX == this.boardCoordinates.x && differenceY == 1) ||\n (destinationY == this.boardCoordinates.y && differenceX == 1) ||\n (differenceX == differenceY && differenceX == 0); //we're handling start=finish coordinates separately\n }", "boolean isMoveFinished(int tick);", "@Test\n public void isValidMoveTest() {\n\n //get the board of the enemy with the method getBoard() from enemyGameBoard\n board = enemyGameBoard.getBoard();\n\n //Try two times for a existing point on the board\n assertTrue(enemyGameBoard.isValidMove(1,1));\n assertTrue(enemyGameBoard.isValidMove(2,4));\n\n //Try two times for a non-existing point on the board\n assertFalse(enemyGameBoard.isValidMove(15,5)); // x-value outside the board range\n assertFalse(enemyGameBoard.isValidMove(5,11)); // y-value outside the board range\n\n //hit a water field\n enemyGameBoard.makeMove(2, 3, false);\n assertTrue(board[2][3].equals(EnemyGameBoard.WATER_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(2,3));\n\n //hit a ship field\n enemyGameBoard.makeMove(5, 4, true);\n assertTrue(board[5][4].equals(EnemyGameBoard.SHIP_HIT));\n\n //try isValidMove() on the already hit water field\n assertFalse(enemyGameBoard.isValidMove(5,4));\n }", "@Override\r\n\tpublic boolean movement(BoardCells[][] chessBoard, Piece targetPiece, int fromX,int fromY,int toX,int toY) {\t\t\r\n\t\t//DEBUG -- System.out.println(\"\"+fromX+fromY+\" \"+toX+toY);\r\n\t\t\r\n\t\tif(fromY == toY){\t\t\t\r\n\t\t\tif(fromX > toX) {\r\n\t\t\t\tfor(int i = fromX-1; i>toX; i--) {\r\n\t\t\t\t\tif(chessBoard[8-fromY][i].getPiece() != null) {\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t} else if (fromX < toX) {\r\n\t\t\t\tfor(int i = fromX+1; i<toX; i++) {\r\n\t\t\t\t\tif(chessBoard[8-fromY][i].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(getPieceID().equals(\"bR\")) {\r\n\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"bKc\")) {\r\n\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"bK\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(getPieceID().equals(\"wR\")) {\r\n\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"wKc\")) {\r\n\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"wK\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\tif(fromX == toX) {\t\t\t\t\r\n\t\t\tif(fromY > toY) {\t\r\n\t\t\t\tfor(int i = fromY-1; i>toY; i--) {\r\n\t\t\t\t\tif(chessBoard[8-i][toX].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} else if (fromY < toY) {\t\t\t\t\r\n\t\t\t\tfor(int i = fromY+1; i<toY; i++) {\t\t\t\t\t\r\n\t\t\t\t\tif(chessBoard[8-i][toX].getPiece() != null) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\t\t\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(getPieceID().equals(\"bR\")) {\r\n\t\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"bKc\")) {\r\n\t\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"bK\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(getPieceID().equals(\"wR\")) {\r\n\t\t\t\t\tfor(int i = 0; i<9 ;i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j<9; j++){\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece() != null) {\r\n\t\t\t\t\t\t\tif(chessBoard[8-i][j].getPiece().getPieceID().equals(\"wKc\")) {\r\n\t\t\t\t\t\t\t\t//Piece king = chessBoard[8-i][j].getPiece();\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//DEBUG -- System.out.println(king.getPieceID()+color+\" \"+king );\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tchessBoard[8-i][j].getPiece().setPieceID(\"wK\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\r\n\t\t\treturn true;\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn false;\t\t\r\n\t}", "public static boolean isBasicMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\t/*Checking if coordinates are OK*/\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*Checks if the tile is empty*/\r\n\t\t\t\tif (player==1){/*Checks if player is red*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==1){/*Checks if in tile there is soldier red */\r\n\t\t\t\t\t\tif(fromRow==toRow-1&&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally upward*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\tif (board[fromRow][fromCol]==2){/*Checks if in tile there is queen red*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif (player==-1){/*Checks if player is blue*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-1){/*Checks if in tile there is soldier blue */\r\n\t\t\t\t\t\tif(fromRow==toRow+1&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally down*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-2){/*Checks if in tile there is queen blue*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public boolean isValidMove(int value){\n if (value == HIT || value == MISS) {\n System.out.println(\"Already shot here\");\n return false;\n }\n return true;\n }", "public static boolean isMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\tif (board[toRow][toCol]==0){/*is the target slot ia emtey*/\r\n\t\t\tif (player==1){\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){ /*is the starting slot is red player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther no eating jump?*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is this is legal move*/\r\n\t\t\t\t\t\t\t\tans = 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}\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tif (player==-1){\r\n\t\t\t\tif (board[fromRow][fromCol]==-1||board[fromRow][fromCol]==-2){/*is the starting slot is blue player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther are no eating move*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the move is legal*/\r\n\t\t\t\t\t\t\t\tans = 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}\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public static boolean validMove(String move, Person p, Board building )\n {\n Room[][] map = building.getMap();\n move = move.toLowerCase().trim();\n switch (move) {\n case \"n\":\n if (p.getxLoc() > 0)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()-1][p.getyLoc()].getName());\n map[p.getxLoc()-1][p.getyLoc()].enterRoom(p,building);\n return true;\n }\n else\n {\n return false;\n }\n case \"e\":\n if (p.getyLoc()< map[p.getyLoc()].length -1)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()][p.getyLoc() + 1].getName());\n map[p.getxLoc()][p.getyLoc() + 1].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n\n case \"s\":\n if (p.getxLoc() < map.length - 1)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()+1][p.getyLoc()].getName());\n map[p.getxLoc()+1][p.getyLoc()].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n\n case \"w\":\n if (p.getyLoc() > 0)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()][p.getyLoc()-1].getName());\n map[p.getxLoc()][p.getyLoc()-1].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n default:\n break;\n\n }\n return true;\n }", "char isValidMove(Move move) {\n char isVal = 'V';\n if (move.row >= 0 && move.row < this.boardSize) {\n if (move.col >= 0 && move.col < this.boardSize) {\n if (this.board[move.row][move.col] != ' ') {\n isVal = 'O'; // returns 'O' if the position is already occupied\n }\n } else {\n isVal = 'C'; // returns 'C' if invalid column is selected\n }\n } else {\n isVal = 'R'; // returns 'R' if invalid row is selected\n }\n return isVal;\n }", "private boolean validMove(int xi, int yi, int xf, int yf) {\n\t\tPiece prevP = pieceAt(xi, yi);\n\t\tPiece nextP = pieceAt(xf, yf);\n\n\t\tif (prevP.isKing()) {\n\t\t\tif (((xf - xi) == 1 || (xi - xf) == 1) && ((yf - yi) == 1 || (yi - yf) == 1)) \n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t} else \n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (prevP.isFire()) \n\t\t{\n\t\t\tif (((xf - xi) == 1 || (xi - xf) == 1) && (yf - yi) == 1) \n\t\t\t{\n\t\t\t\tif (nextP != null && !nextP.isFire()) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\telse if ((xf - xi) == 2 && (yf - yi) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi+1, yi+1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} \n\t\t\telse if ((xi - xf) == 2 && (yf - yi) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi-1, yi+1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else \n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else \n\t\t{\n\t\t\tif (((xf - xi) == 1 || (xi - xf) == 1) && (yi - yf) == 1) \n\t\t\t{\n\t\t\t\tif (nextP != null && nextP.isFire()) \n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} \n\t\t\telse if ((xf - xi) == 2 && (yi - yf) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi+1, yi-1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} \n\t\t\telse if ((xi - xf) == 2 && (yi - yf) == 2) \n\t\t\t{\n\t\t\t\tPiece pBetween = pieceAt(xi-1, yi-1);\n\t\t\t\tif (pBetween != null && prevP.side() != pBetween.side()) \n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean canMove();", "private boolean validNormalMove(int newX, int newY){\n\n // checks if the new position is out of range or not and if it is then it is occupied or not\n if (!getBoard().outOfRange(newX, newY) && !getBoard().occupied(newX, newY))\n return true;\n // false if in range, occupied , but piece of the same color\n else if(!getBoard().outOfRange(newX, newY) && getBoard().occupied(newX, newY) && (getBoard().getPiece(newX, newY).getColour() == this.getColour()))\n return false ;\n\n // true if in range, occupied and in the piece of the same color\n // note that in general the Move object will be set to false but after the if statement the occupied will be set to true\n else if(!getBoard().outOfRange(newX, newY) && getBoard().occupied(newX, newY)\n && (getBoard().getPiece(newX, newY).getColour() != this.getColour()))\n return true ;\n\n else\n return false;\n }", "public boolean isLegalMove (int row, int col, BoardModel board, int side) {\n\t\t\n\t\tboolean valid = false;\n\t\t//look if the position is valid\n\t\tif(board.getBoardValue(row, col) == 2) {\n\t\t\t//look for adjacent position\n\t\t\tfor(int[] surround : surroundingCoordinates(row, col)) {\n\t\t\t\t//the adjacent poision has to be of the opponent\n\t\t\t\tif(board.getBoardValue(surround[0], surround[1]) == getOpponent(side)){\n\t\t\t\t\t//now check if we come across with a color of ourselves\n\t\t\t\t\tint row_diff = surround[0] - row;\n\t\t\t\t\tint col_diff = surround[1] - col;\t\t\t\t\t\n\t\t\t\t\tif(!valid && checkNext((row+row_diff), (col+col_diff), row_diff, col_diff, side, board) ){\n\t\t\t\t\t\tvalid = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn valid;\n\t}", "private void checkMove(Tile[][] chessBoard, int pawnX, int pawnY, int direction) {\r\n\t\tUnit unit = chessBoard[pawnX][pawnY+direction].getPiece();\r\n\t\tif (unit == null) {\r\n\t\t\tMoves move = new Moves(pawnX, pawnY+direction);\r\n\t\t\tinsertMove(move, moveList);\r\n\t\t}\r\n\t}", "private static boolean isMoveValid( int x, int y ){\n int path[] = new int[8];\n for( int distance = 1; distance < 8; distance ++ ){\n checkPath( path, 0, x + distance, y, distance );\n checkPath( path, 1, x + distance, y + distance, distance );\n checkPath( path, 2, x, y + distance, distance );\n checkPath( path, 3, x - distance, y, distance );\n checkPath( path, 4, x - distance, y - distance, distance );\n checkPath( path, 5, x, y - distance, distance );\n checkPath( path, 6, x + distance, y - distance, distance );\n checkPath( path, 7, x - distance, y + distance, distance );\n }\n for( int i = 0; i < 8; i++ ){\n if( path[ i ] > 1 ){\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean canMoveTo(int x, int y, Board board) {\n \n if (x > this.x && y > this.y){ //move up to the right\n if(lowCh(\"uright\",xt+1,yt+1,x,y,board) == true)\n {\n return canTake(x,y,board) == true;\n }else{\n return false;\n }\n } else if (x > this.x && y < this.y){ //move down to the right\n if(lowCh(\"dright\",xt+1,yt-1,x,y,board) == true)\n {\n return canTake(x,y,board) == true;\n }else{\n return false;\n }\n } else if (x < this.x && y > this.y){ //move up to the left\n if (lowCh(\"uleft\",xt-1,yt+1,x,y,board) == true)\n {\n return canTake(x,y,board) == true;\n }else{\n return false;\n }\n } else if (x < this.x && y < this.y){ //move down to the left\n if (lowCh(\"dleft\",xt-1,yt-1,x,y,board) == true)\n {\n return canTake(x,y,board) == true;\n }else{\n return false;\n }\n } else {\n return false;\n }\n }", "private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private boolean isNextMoveRochade(Move move)\r\n\t{\r\n\t\tif (!(move.from.piece instanceof King)) return false;\r\n\t\tint xDiffAbs = Math.abs(move.to.coordinate.x - move.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}", "private boolean isLastMoveRochade()\r\n\t{\r\n\t\tMove lastMove = getLastMove();\r\n\t\tif (lastMove == null) return false;\r\n\t\tPiece king = lastMove.to.piece;\r\n\t\tif (!(king instanceof King)) return false;\r\n\t\t\r\n\t\tint y = king.getColor().equals(Color.WHITE) ? 0 : 7;\r\n\t\tif (lastMove.to.coordinate.y != y) return false;\r\n\t\t\r\n\t\tint xDiffAbs = Math.abs(lastMove.to.coordinate.x - lastMove.from.coordinate.x); \r\n\t\treturn xDiffAbs == 2;\r\n\t}", "public boolean isValidMove(Coordinates coordinates) {\n if (grid[coordinates.getRow()][coordinates.getColumn()].getSymbol() != 'X' &&\n grid[coordinates.getRow()][coordinates.getColumn()].getSymbol() != 'O') {\n return true;\n }\n\n return false;\n }", "public static boolean validPos(String moveTo)\n\t{\n\t\tfor(int rows = 0; rows < 8; rows++)\n\t\t{\n\t\t\tfor(int cols = 0; cols < 8; cols++)\n\t\t\t{\n\t\t\t\tif(posMap[rows][cols].equals(moveTo))\n\t\t\t\t{\t\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public boolean checkCapture(Move move, Piece board[][]) {\n\n if (board[move.getEnd_column()][move.getEnd_row()] != null) {\n if (board[move.getEnd_column()][move.getEnd_row()].getColor() == getColor()) {\n return false;\n }\n //adds the taken piece to move-object\n move.setTakenPiece(board[move.getEnd_column()][move.getEnd_row()]);\n }\n\n return true;\n }", "public final boolean isMoving() {\r\n\t\treturn moveStart > 0;\r\n\t}", "boolean isLegal(Move move) {\n int c = move.getCol0();\n int r = move.getRow0();\n int[] vector = move.unit();\n Piece p;\n for(int i = 0; i <= vector[2]; i++) {\n p = get(c, r);\n if (p != null && p.side() != _turn) {\n return false;\n }\n }\n return true;\n\n }", "public boolean isValidMovement(Board chessBoard, Position destination){\n Position distance = Position.manhattanDistance(getPosition(), destination);\n Boolean slope1 = distance.file == 2 && distance.rank == 1;\n Boolean slope2 = distance.file == 1 && distance.rank == 2;\n return slope1 || slope2;\n }", "public boolean isValidMove(Move move) {\n if (this.gameStarted && isSpaceFree(move) && isPlayerTurn(move)) {\n return true; \n }\n return false; \n }", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "public boolean isMoveLegal(int x, int y) {\n\t\tif (rowSize <= x || colSize <= y || x < 0 || y < 0) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") is\r\n\t\t\t// out of range!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else if (!(matrix[x][y] == 0)) {\r\n\t\t\t// System.out.print(\"Position (\" + (x + 1) + \", \" + (y + 1) + \") has\r\n\t\t\t// been occupied!\\n\");\r\n\t\t\treturn false;\r\n\t\t} else\r\n\t\t\treturn true;\r\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to){\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX()); \r\n int y = Math.abs(from.getY() - to.getY()); \r\n if(( x == 2 && y == 1 ) || ( x == 1 && y == 2 )){\r\n return true; \r\n }\r\n\r\n return false;\r\n }", "public void checkMoveOrPass(){\n if (this.xTokens.size() > 0) {\n this.diceRoller = false;} \n else { //if no tokens to move, pass and let player roll dice\n this.turn++;\n //System.out.println(\"next turn player \" + this.players[currentPlayer].getColor());\n }\n this.currentPlayer = this.xPlayers.get(this.turn % this.xPlayers.size());\n }", "public boolean hasValidMove(int role){\n\t\tfor(int i = 0; i < boardsize; ++i){\r\n\t\t\tfor(int j = 0; j < boardsize ; ++j){\r\n\t\t\t\t//search for an empty place first\r\n\t\t\t\tif(board[i][j] == -1){\r\n\t\t\t\t\tif(isValidCell(i,j,role)){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = from.getX() - to.getX();\r\n int y = from.getY() - to.getY();\r\n \r\n if (x < 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n } \r\n return true;\r\n }\r\n else if(x > 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n }\r\n return true;\r\n }\r\n else if( x > 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n }\r\n return true; \r\n }\r\n else if (x < 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n } \r\n return true;\r\n }\r\n\r\n return false;\r\n }", "private boolean canMove(String direction) {\n\t\tif (currentPiece.getLocation() == null) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor (Loc loc : currentPiece.getLocation()) {\n\t\t\tLoc nextPoint = nextPoint(loc, direction);\n\t\t\tif (nextPoint == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// if there's someone else's piece blocking you\n\t\t\tif ((new Loc(nextPoint.row, nextPoint.col).isOnBoard())\n\t\t\t\t\t&& boardTiles[nextPoint.row][nextPoint.col] != backgroundColor && !isMyPiece(nextPoint)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean checkLine(Move move, Piece board[][]) {\n // check straight line\n if ((move.getEnd_row() - move.getStart_row()) != 0 && (move.getEnd_column() - move.getStart_column()) != 0) {\n return false;\n }\n \n int rdirection, cdirection;\n\n // Test moving the piece. Returns true if move is possible. Returns false if piece collides with another.\n if (move.getStart_row() == move.getEnd_row()) {\n cdirection = (move.getEnd_column() - move.getStart_column()) / Math.abs((move.getEnd_column() - move.getStart_column()));\n int current_column = move.getStart_column() + cdirection;\n while (current_column != move.getEnd_column()) {\n if (board[current_column][move.getStart_row()] != null && current_column != move.getEnd_column()) {\n return false;\n }\n current_column += cdirection;\n }\n } else {\n rdirection = (move.getEnd_row() - move.getStart_row()) / Math.abs((move.getEnd_row() - move.getStart_row()));\n int current_row = move.getStart_row() + rdirection;\n while (current_row != move.getEnd_row()) {\n if (board[move.getStart_column()][current_row] != null && current_row != move.getEnd_row()) {\n return false;\n }\n current_row += rdirection;\n }\n }\n return true;\n }", "boolean isValid(int xPos, int yPos, int destX, int destY) {\r\n\t\tboolean valid = false;\r\n\t\t\r\n\t\t//Moves White\r\n\t\tif(this.color == \"Weiß\"){\r\n\t\t//Moving 2 Tiles\r\n\t\tif (firstMove == true && destY - yPos == -2 && destX == xPos) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving 1 Tile\r\n\t\tif (destX == xPos && destY - yPos == -1) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving Diagonal if enemy is there\r\n\t\tif ((destX == xPos + 1 || destX == xPos-1) && destY == yPos -1){\r\n\t\t\tvalid = isValidLoop(destX, destY, valid);\r\n\t\t}\r\n\t\treturn valid;\r\n\t\t} \r\n\t\t\r\n\t\t//Moves Black\r\n\t\telse {\r\n\t\t//Moving 2 Tiles\r\n\t\tif (firstMove == true && destY - yPos == 2 && destX == xPos) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving 1 Tile\r\n\t\tif (destX == xPos && destY - yPos == 1) {\r\n\t\t\tvalid = true;\r\n\t\t\tthis.firstMove = false;\r\n\t\t}\r\n\t\t//Moving Diagonal\r\n\t\tif ((destX == xPos + 1 || destX == xPos-1) && destY == yPos +1){\r\n\t\t\tvalid = isValidLoop(destX, destY,valid);\r\n\t\t}\r\n\t\t}\r\n\t\treturn valid;\r\n\t}", "boolean checkLegalMove(int posx, int posy) {\n\t\tBoolean bool;\n\t\tint change;\n\t\tchange = curPlayer > 1 ? (change = 1) : (change = -1);\n\t\tif (kingJumping(posx, posy, change)){\n\t\t\tbool = true;\n\t\t} else if (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\tSystem.out.println(\"Normal move\");\n\t\t\tbool = true;\n\t\t} else if (jump(posx, posy, prevPiece) && (prevPosX == posx + (change * 2) && (prevPosY == posy - 2 || prevPosY == posy + 2))) {\n\t\t\tbool = true;\n\t\t} else if (((JLabel)prevComp).getIcon().equals(Playboard.rKing) || ((JLabel)prevComp).getIcon().equals(Playboard.bKing) || ((JLabel)prevComp).getIcon().equals(Playboard.blackSKing) || ((JLabel)prevComp).getIcon().equals(Playboard.redSKing)){\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1)){\n\t\t\t\tbool = true;\n\t\t\t} else\n\t\t\t\tbool = false;\n\t\t} else if (prevPiece == 4 && (prevPosX == posx + 1 || prevPosX == posx -1) && (prevPosY == posy - 1 || prevPosY == posy +1)) { // King moves\n\t\t\tchange *= (-1);\n\t\t\tif (prevPosX == posx + change && (prevPosY == posy - 1 || prevPosY == posy + 1))\n\t\t\t\tbool = true;\n\t\t\telse\n\t\t\t\tbool = false;\n\t\t} else {\n\t\t\tbool = false;\n\t\t}\n\t\treturn bool;\n\t}", "boolean makeMove();", "@Override\r\n\tpublic boolean possibleMove(int x, int y) {\n\t\tif (this.sameColor(Board.getPiece(x, y)) == true) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (Math.abs(this.getY() - y) == 2 && Math.abs(this.getX() - x) == 1\r\n\t\t\t\t|| Math.abs(this.getY() - y) == 1 && Math.abs(this.getX() - x) == 2) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "private boolean canMoveUp()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length ; column++ ) {\n for ( int row = 1; row < grid.length; row++ ) {\n // looks at tile directly above the current tile\n int compare = row-1;\n if ( grid[row][column] != 0 ) {\n if ( grid[compare][column] == 0 || grid[row][column] ==\n grid[compare][column] ) {\n return true;\n }\n }\n }\n } \n return false;\n }", "public boolean isMoving() {\n\t\treturn moveProgress > 0;\n\t}", "boolean canMoveTo(Vector2d position);", "private boolean checkMoveOthers(Pieces piece, Coordinates from, Coordinates to) {\n\t\t\t\t\n\t\t/* \n\t\t *il pedone: \n\t\t * -può andare dritto sse davanti a se non ha pedine\n\t\t * -può andare obliquo sse in quelle posizioni ha una pedina avversaria da mangiare\n\t\t * \n\t\t */\n\t\tif (piece instanceof Pawn) {\n\t\t\tif (from.getY() == to.getY()) {\n\t\t\t\tif(chessboard.at(to) == null)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(chessboard.at(to) == 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\t\n\t\t//il cavallo salta le pedine nel mezzo\n\t\tif (piece instanceof Knight)\n\t\t\treturn true;\n\t\t\n\t\t//Oltre non andranno il: cavallo, il re ed il pedone.\n\t\t/*\n\t\t *Calcolo le posizioni che intercorrono tra il from ed il to escluse \n\t\t *ed per ogni posizione verifico se è vuota\n\t\t *-se in almeno una posizione c'è una pedina(non importa il colore), la mossa non è valida\n\t\t *-altrimenti, la strada è spianata quindi posso effettuare lo spostamento \n\t\t */\n\t\tArrayList<Coordinates> path = piece.getPath(from, to);\n\t\tfor (Coordinates coordinate : path) {\n\t\t\tif ( chessboard.at(coordinate) != null ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = Math.abs(from.getX() - to.getX());\r\n int y = Math.abs(from.getY() - to.getY());\r\n if((from.getX() - to.getX()) > 0 || (from.getY() - to.getY()) > 0){\r\n if ((x == 0 && y >= 1)) {\r\n for(int i = 1; i <= y-1; i++){\r\n if(board.getBox(from.getX(), from.getY() - i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((x >= 1 && y == 0)){\r\n for(int i = 1; i <= x-1; i++){\r\n if(board.getBox(from.getX() - i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }else if((from.getX() - to.getX()) < 0 || (from.getY() - to.getY()) < 0){\r\n if (x == 0 && (from.getY() - to.getY()) <= -1) {\r\n for(int i = y-1; i > 0; i--){\r\n if(board.getBox(from.getX(), from.getY() + i).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }else if((from.getX() - to.getX()) <= -1 && y == 0){\r\n for(int i = x-1; i > 0; i--){\r\n if(board.getBox(from.getX() + i, from.getY()).getPiece() != null){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "public boolean validMove(int row, int col) {\n // kijken of de rij en kolom leeg zijn\n if (board2d[row][col] != 0) {\n return false;\n }\n return true;\n }", "public boolean isMove(int dir){\n\t if(0> dir && dir > 3){\n\t\tSystem.out.println(\"direction is failed\");\t \n\t\treturn false;\n\t }\n\t if(dir == 0 ){\n\t\tif(0<= (this.y-1) && (this.y-1)<=5)\n\t\t return true;\n\t }else if(dir == 1){\n\t\tif(0<= (this.y+1) && (this.y+1)<=5)\n\t\t return true;\n\t }else if(dir == 2){\n\t\tif(0<= (this.x+1) && (this.x+1)<=5)\n\t\t return true;\n\t }else if(dir == 3){\n\t\tif(0<= (this.x-1) && (this.x-1)<=5)\n\t\t return true;\n\t }\n\t return false;\n\t}", "@Override\n\tpublic boolean isLegalMove(Square newPosition) {\n\t\treturn false;\n\t}", "@Override\r\n boolean isValidSpecialMove(final int newX, final int newY) {\r\n int xDisplacement = newX - getXLocation();\r\n int yDisplacement = newY - getYLocation();\r\n if (isValidRookMove(xDisplacement, yDisplacement)) {\r\n // Total number of steps the piece has to take.\r\n //Either x = 0 or y = 0.\r\n int steps = Math.max(Math.abs(xDisplacement),\r\n Math.abs(yDisplacement));\r\n int xDirection = xDisplacement / steps;\r\n int yDirection = yDisplacement / steps;\r\n // Check for obstacles in path of Rook.\r\n for (int i = 1; i < steps; i++) {\r\n ChessSquare squareToCheck = getCurrentBoard().getSquaresList()\r\n [getXLocation() + i * xDirection]\r\n [getYLocation() + i * yDirection];\r\n if (squareToCheck.getIsOccupied()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n return false;\r\n\r\n }", "@Override\n\tpublic boolean testMove(int xEnd, int yEnd, board b){\n return (xEnd == x - 1 && yEnd == y - 1) || (xEnd == x - 1 && yEnd == y) || (xEnd == x - 1 && yEnd == y + 1) || (xEnd == x && yEnd == y - 1) || (xEnd == x && yEnd == y + 1) || (xEnd == x + 1 && yEnd == y - 1) || (xEnd == x + 1 && yEnd == y) || (xEnd == x + 1 && yEnd == y + 1);\n\t}", "public boolean hasActualMove(AttackNamesies name) {\n return this.moves.hasMove(name);\n }", "public boolean attemptMove(Move move, int color) {\n //ArrayList<Move> jumps = canJump(color);\n //make sure the to and from values don't go out of bounds\n if (move.xFrom > 7 || move.yFrom > 7 || move.xTo > 7 || move.yTo > 7 ||\n \tmove.xFrom < 0 || move.yFrom < 0 || move.xTo < 0 || move.yTo < 0 ){\n// System.out.println(\"out of bounds\");\n return false;\n }\n int stateOfFrom = gameState.getStateOfSquare(move.xFrom, move.yFrom);\n int stateOfTo = gameState.getStateOfSquare(move.xTo, move.yTo);\n \n\n //if there in no piece in the \"from\" location return false\n if (stateOfFrom == 0){\n// System.out.println(\"no piece at 'from'\");\n return false;\n }\n \n //if there is a piece in the \"to\" location return false\n if (!(stateOfTo == 0)){\n// System.out.println(\"'to' is not empty\");\n return false;\n }\n \n //if the \"from\" piece is not the correct color return false\n if (!(gameState.getStateOfSquare(move.xFrom, move.yFrom)%2 == color))\n {\n// System.out.println(\"that is not your piece\");\n return false;\n }\n \n //check if the \"from\" piece is moving in the right direction\n \n /*if (jumps.isEmpty() == false) //if there are jumps.\n {\n System.out.println(\"there are jumps\");\n //for every possible jump\n for (int i=0; i<jumps.size(); i++){\n \t//if this move matches a possible jump then it is valid\n \tSystem.out.println(\"is this jump \"+ i + \"?\");\n \tif ((move.xFrom == jumps.get(i).xFrom)&&\n \t\t\t(move.yFrom == jumps.get(i).yFrom)&&\n \t\t\t(move.xTo == jumps.get(i).xTo)&&\n \t\t\t(move.yTo == jumps.get(i).yTo)){\n \t\tSystem.out.println(\"yes\");\n \t\treturn true;\n \t}\n \telse{\n \t\tSystem.out.println(\"there are possible jumps\");\n \t}\n \t\t\n \t\n }\n //return false;\n \n //handle jumps\n }\n */\n //moving diagonally\n else{\n if (move.xTo == move.xFrom + 1 || move.xTo == move.xFrom - 1){\n //if (stateOfFrom >= 3) \n //if piece is king it can move both forward and back\n if (stateOfFrom >= 3 && (move.yTo == move.yFrom + 1 || move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n //red can only move up\n else if(color == 0 && (move.yTo == move.yFrom + 1)){\n \treturn true;\n }\n //black can only move down\n else if(color == 1 && (move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n else{\n// System.out.println(\"wrong way\");\n return false;\n }\n }\n else{\n// System.out.println(\"too far away\");\n return false;\n }\n }\n //return true;\n \n \n }", "public boolean canMoveTo(int x, int y) {\n for (Cell c : this.board) {\n if (c.x == x && c.y == y) {\n return !c.isFlooded;\n }\n }\n return false;\n }", "private boolean isSpaceFree(Move move) {\n int moveX = move.getMoveX(); \n int moveY = move.getMoveY(); \n if (boardState[moveX][moveY] == 'X' || boardState[moveX][moveY] == 'O') {\n return false; \n }\n return true; \n }", "boolean isMoving();", "boolean doMove();", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "public boolean isValidMove(int startRow, int startColumn, int endRow, int endColumn, Tile[][] board) {\n\n\t\tif (validRook(startRow, startColumn, endRow, endColumn, board) || validBish(startRow, startColumn, endRow, endColumn, board)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private boolean makeMove(Move move) {\n\n // Moving piece from Cell\n Piece sourcePiece = move.getStart().getCurrentPiece();\n\n // Valid Move? Calling Piece actual implementation\n if (!sourcePiece.canMove(board, move.getStart(), move.getEnd())) {\n System.out.println(\"Invalid Move, sourcePiece is \" + sourcePiece);\n }\n\n // Killed other player Piece?\n Piece destPiece = move.getEnd().getCurrentPiece();\n if (destPiece != null) {\n destPiece.setKilled(true);\n move.setPieceKilled(destPiece);\n }\n\n // castling?\n if (sourcePiece instanceof King\n && sourcePiece.isCastlingMove()) {\n move.setCastlingMove(true);\n }\n\n // Store the Move\n movesPlayed.add(move);\n\n // If move is VALID, set piece=null at start cell and new piece at dest cell\n move.getEnd().setCurrentPiece(sourcePiece);\n move.getStart().setCurrentPiece(null);\n\n // Game Win or not\n if (destPiece instanceof King) {\n if (move.getPlayedBy().isWhiteSide()) {\n this.setStatus(GameStatus.WHITE_WIN);\n } else {\n this.setStatus(GameStatus.BLACK_WIN);\n }\n\n }\n\n return true;\n }", "public boolean isValidMove(Move m) {\n // Ensure from and to make sense\n if (board[m.from] != currentPlayer || board[m.to] != 0)\n return false;\n\n // NOTE: Checking validity in this way is inefficient\n\n // Get current available moves\n ArrayList<Move> moves = new ArrayList<Move>();\n getMoves(moves);\n\n // Find the move among the set of available moves\n boolean found = moves.contains(m);\n\n return found;\n }", "private boolean isValidMove(int i, int j) {\n\t\tint rowDelta = Math.abs(i - row);\n\t\tint colDelta = Math.abs(j - col);\n\n\t\tif ((rowDelta == 1) && (colDelta == 0)) {\n\t\t\tinvalidMoveLbl.setVisible(false);\n\t\t\treturn true;\n\t\t}\n\t\tif ((colDelta == 1) && (rowDelta == 0)) {\n\t\t\tinvalidMoveLbl.setVisible(false);\n\t\t\treturn true;\n\t\t}\n\t\tinvalidMoveLbl.setVisible(true);\n\t\treturn false;\n\t}", "private boolean isValidMove(int pressedHole) {\n return getPlayerHole(pressedHole).getKorgools() != 0;\n }" ]
[ "0.75180966", "0.74976325", "0.7489511", "0.7487422", "0.74137604", "0.7386298", "0.73517996", "0.7292272", "0.7287333", "0.7279617", "0.72437143", "0.7229284", "0.71639913", "0.7159369", "0.7159318", "0.7150294", "0.7120763", "0.71168584", "0.70783305", "0.70779485", "0.70398086", "0.70329046", "0.70260465", "0.70159906", "0.7010969", "0.7010442", "0.7007168", "0.70027703", "0.6997892", "0.69857734", "0.6976527", "0.6974119", "0.6956488", "0.69497305", "0.6938994", "0.6935338", "0.6923668", "0.69005734", "0.68972474", "0.68968827", "0.68888396", "0.68884146", "0.6883904", "0.68731767", "0.68708473", "0.6870261", "0.6869997", "0.68598765", "0.68584377", "0.68537635", "0.68378896", "0.6837506", "0.681864", "0.6812552", "0.67994094", "0.6799036", "0.67985564", "0.6797919", "0.6787138", "0.67782736", "0.6765767", "0.676485", "0.67621166", "0.6761866", "0.6757267", "0.6750969", "0.67506886", "0.67479724", "0.67456603", "0.6744114", "0.67421204", "0.6735486", "0.67325187", "0.67263937", "0.67261213", "0.672575", "0.67252684", "0.67222905", "0.6720787", "0.67203623", "0.671715", "0.670179", "0.66990614", "0.66970205", "0.66963184", "0.6695353", "0.66940814", "0.66890514", "0.668543", "0.66839117", "0.6682265", "0.6681917", "0.66813356", "0.66785634", "0.6677278", "0.6663014", "0.66616505", "0.66558784", "0.6653327", "0.66480327" ]
0.7724079
0
/ renamed from: X.AIK
public interface AIK { ColorStateList AGZ(AnonymousClass7R3 r1); float AL0(AnonymousClass7R3 r1); float APW(AnonymousClass7R3 r1); float AQJ(AnonymousClass7R3 r1); float AQL(AnonymousClass7R3 r1); float ATV(AnonymousClass7R3 r1); void AdX(); void Add(AnonymousClass7R3 r1, Context context, ColorStateList colorStateList, float f, float f2, float f3); void AxT(AnonymousClass7R3 r1); void BFN(AnonymousClass7R3 r1); void BgA(AnonymousClass7R3 r1, ColorStateList colorStateList); void BhK(AnonymousClass7R3 r1, float f); void Bin(AnonymousClass7R3 r1, float f); void Bjy(AnonymousClass7R3 r1, float f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void kk12() {\n\n\t}", "public interface C24717ak {\n}", "void mo1942k();", "@Override\n\tpublic void startIBK() {\n\t\talgo.algoIBK();\n\t}", "private void getAI(){\n\n }", "public void mo21786K() {\n }", "public void mo38117a() {\n }", "void mo1940i();", "protected void mo6255a() {\n }", "public void mo6081a() {\n }", "void mo27575a();", "public interface IKataSolution\n extends IKataCommonSolution {\n\n public enum ACTION {\n TURN_LEFT, TURN_RIGHT, FORWARD, STAY\n }\n\n public enum ORIENTATION {\n UP (270), DOWN(90), LEFT(0), RIGHT(180);\n public int angle;\n ORIENTATION (int _angle) {\n angle = _angle;\n }\n public ORIENTATION moveLeft () {\n switch (this) {\n case UP: return LEFT;\n case DOWN: return RIGHT;\n case LEFT: return DOWN;\n case RIGHT: return UP;\n }\n return this;\n }\n public ORIENTATION moveRight () {\n switch (this) {\n case UP: return RIGHT;\n case DOWN: return LEFT;\n case LEFT: return UP;\n case RIGHT: return DOWN;\n }\n return this;\n }\n }\n\n public enum ITEM {\n EMPTY, PLANT, ANIMAL, END\n }\n\n public abstract class Animal {\n /**\n * Number of plants the animal ate\n */\n public int points;\n /**\n * Method to react to changing environmental conditions\n *\n * @param orientation animal's current orientation\n * @param view item currently in front of animal\n * @return action to do\n */\n public abstract ACTION react (ORIENTATION orientation, ITEM view);\n }\n\n /**\n * Factory method for an animal\n *\n * @param count count of animals to create\n * @param lastGeneration array of 'Animal' from last generation\n * @return array of 'Animal' instances\n */\n public abstract Animal[] createGeneration (int count, Animal[] lastGeneration);\n\n /**\n * If true, last generation will be visualized\n */\n public boolean visualizeLastGeneration ();\n\n /**\n * Defines how many generations of evolution should be tested\n * (minimum is 100, maximum is 10000)\n *\n * @return count of generations to test\n */\n public int countOfGenerations ();\n}", "public abstract void mo2624j();", "public void func_70295_k_() {}", "int getAtk();", "void mo41083a();", "public interface C21597a {\n }", "private USI_ADRC() {}", "public interface HawkToBrainComp {\n /**\n * Every kind of personality will have a designated response in the form of IDK(I don't know)\n * This method allows the Hawker can use this method and an equals method to the response to determine\n * if the AI didn't have a response available for the User.\n * @return returns the IDK response of the Personality\n */\n public String getIDKReply();\n\n /**\n * Send a conventional grammar into this method and receive a response from the AI Personality\n * @param conventional_Grammar to be determined\n */\n public String requestResponce(String conventional_Grammar);\n}", "void mo57278c();", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "void kiemTraThangHopLi() {\n }", "void mo3194r();", "public interface C1361a {\n /* renamed from: ix */\n Info mo7564ix();\n }", "public void mo4359a() {\n }", "public void mo21782G() {\n }", "void mo21072c();", "public interface C0094dk {\n /* renamed from: a */\n boolean mo1311a(KeyEvent keyEvent);\n}", "public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}", "public abstract String mo41086i();", "void mo38026a();", "public void mo9848a() {\n }", "public interface C2672h {\n /* renamed from: a */\n void mo1927a(NLPResponseData nLPResponseData);\n\n /* renamed from: a */\n void mo1931a(C2848p c2848p);\n\n /* renamed from: a */\n void mo1932a(String str);\n\n /* renamed from: b */\n void mo1933b(int i);\n\n /* renamed from: b */\n void mo1934b(String str);\n\n /* renamed from: c */\n void mo1935c(String str);\n\n /* renamed from: i */\n void mo1940i();\n\n /* renamed from: j */\n void mo1941j();\n\n /* renamed from: k */\n void mo1942k();\n\n /* renamed from: l */\n void mo1943l();\n}", "public interface axk\r\n/* */ {\r\n/* */ @Nullable\r\n/* */ bji f(el paramel);\r\n/* */ \r\n/* */ blc a_(el paramel);\r\n/* */ \r\n/* */ byw b(el paramel);\r\n/* */ \r\n/* */ default int K() {\r\n/* 27 */ return 15;\r\n/* */ }\r\n/* */ }", "public void mo44053a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo21784I() {\n }", "public interface C19490tZ {\n boolean AiL(C17090pf r1);\n\n void BfK(C17090pf r1, C06270Ok r2, C73233Ja r3);\n}", "public abstract void mo27385c();", "private static void cajas() {\n\t\t\n\t}", "public interface C13719g {\n}", "private USI_KICKO() {}", "@Hide\n private final zzs zzahx() {\n }", "public AddAVKSupport(){\n }", "public interface C19588a {\n }", "public abstract String mo9238av();", "public interface C8843g {\n}", "public interface C38172a {\n /* renamed from: A */\n void mo21580A(Intent intent);\n\n String name();\n }", "void mo28306a();", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "public void redibujarAlgoformers() {\n\t\t\n\t}", "public static void m2518a() {\n aje.m2409a(\"TinkMac\", new akc());\n aiq.m2375a(f1953b);\n }", "public interface OpenSSLKeyHolder {\n /* renamed from: a */\n OpenSSLKey mo134201a();\n}", "public final void a(com.tencent.mm.plugin.game.c.ai r12, java.lang.String r13, int r14, int r15) {\n /*\n r11 = this;\n if (r12 == 0) goto L_0x000a;\n L_0x0002:\n r0 = r12.nmz;\n r0 = com.tencent.mm.sdk.platformtools.bi.cC(r0);\n if (r0 == 0) goto L_0x0010;\n L_0x000a:\n r0 = 8;\n r11.setVisibility(r0);\n L_0x000f:\n return;\n L_0x0010:\n r11.mAppId = r13;\n r11.niV = r15;\n r0 = r12.nmz;\n r7 = r0.iterator();\n L_0x001a:\n r0 = r7.hasNext();\n if (r0 == 0) goto L_0x000f;\n L_0x0020:\n r0 = r7.next();\n r4 = r0;\n r4 = (com.tencent.mm.plugin.game.c.k) r4;\n if (r4 == 0) goto L_0x001a;\n L_0x0029:\n r5 = new com.tencent.mm.plugin.game.d.e$a$a;\n r5.<init>();\n r0 = r4.nlz;\n switch(r0) {\n case 1: goto L_0x004a;\n case 2: goto L_0x00e3;\n default: goto L_0x0033;\n };\n L_0x0033:\n r0 = 2;\n if (r14 != r0) goto L_0x001a;\n L_0x0036:\n r0 = r11.mContext;\n r1 = 10;\n r2 = 1002; // 0x3ea float:1.404E-42 double:4.95E-321;\n r3 = r4.nlw;\n r4 = r4.nlr;\n r6 = com.tencent.mm.plugin.game.model.ap.CD(r4);\n r4 = r13;\n r5 = r15;\n com.tencent.mm.plugin.game.model.ap.a(r0, r1, r2, r3, r4, r5, r6);\n goto L_0x001a;\n L_0x004a:\n r0 = r4.nlx;\n if (r0 == 0) goto L_0x001a;\n L_0x004e:\n r11.e(r11);\n r0 = r11.DF;\n r1 = com.tencent.mm.R.i.djD;\n r2 = 1;\n r6 = r0.inflate(r1, r11, r2);\n r0 = com.tencent.mm.R.h.cxP;\n r0 = r6.findViewById(r0);\n r0 = (android.widget.TextView) r0;\n r1 = com.tencent.mm.R.h.cxR;\n r1 = r6.findViewById(r1);\n r1 = (android.widget.TextView) r1;\n r2 = com.tencent.mm.R.h.cxO;\n r2 = r6.findViewById(r2);\n r2 = (com.tencent.mm.plugin.game.widget.EllipsizingTextView) r2;\n r3 = 2;\n r2.setMaxLines(r3);\n r3 = com.tencent.mm.R.h.cxQ;\n r3 = r6.findViewById(r3);\n r3 = (android.widget.ImageView) r3;\n r8 = r11.mContext;\n r9 = r4.nlv;\n r10 = r0.getTextSize();\n r8 = com.tencent.mm.pluginsdk.ui.d.i.b(r8, r9, r10);\n r0.setText(r8);\n r0 = r11.mContext;\n r8 = r4.nlx;\n r8 = r8.fpg;\n r9 = r1.getTextSize();\n r0 = com.tencent.mm.pluginsdk.ui.d.i.b(r0, r8, r9);\n r1.setText(r0);\n r0 = r11.mContext;\n r1 = r4.nlx;\n r1 = r1.nkL;\n r8 = r2.getTextSize();\n r0 = com.tencent.mm.pluginsdk.ui.d.i.b(r0, r1, r8);\n r2.setText(r0);\n r0 = r4.nlx;\n r0 = r0.nkM;\n r0 = com.tencent.mm.sdk.platformtools.bi.oN(r0);\n if (r0 != 0) goto L_0x00dd;\n L_0x00b9:\n r0 = com.tencent.mm.plugin.game.d.e.aSC();\n r1 = r4.nlx;\n r1 = r1.nkM;\n r2 = r5.aSD();\n r0.a(r3, r1, r2);\n L_0x00c8:\n r0 = new com.tencent.mm.plugin.game.ui.f$a;\n r1 = r4.nlw;\n r2 = r4.nlx;\n r2 = r2.nkN;\n r3 = r4.nlr;\n r0.<init>(r1, r2, r3);\n r6.setTag(r0);\n r6.setOnClickListener(r11);\n goto L_0x0033;\n L_0x00dd:\n r0 = 8;\n r3.setVisibility(r0);\n goto L_0x00c8;\n L_0x00e3:\n r0 = r4.nly;\n if (r0 == 0) goto L_0x001a;\n L_0x00e7:\n r11.e(r11);\n r0 = r11.DF;\n r1 = com.tencent.mm.R.i.djE;\n r2 = 1;\n r3 = r0.inflate(r1, r11, r2);\n r0 = com.tencent.mm.R.h.cOG;\n r0 = r3.findViewById(r0);\n r0 = (android.widget.TextView) r0;\n r1 = com.tencent.mm.R.h.cOI;\n r1 = r3.findViewById(r1);\n r1 = (android.widget.TextView) r1;\n r2 = com.tencent.mm.R.h.cOH;\n r2 = r3.findViewById(r2);\n r2 = (android.widget.ImageView) r2;\n r6 = r11.mContext;\n r8 = r4.nlv;\n r9 = r0.getTextSize();\n r6 = com.tencent.mm.pluginsdk.ui.d.i.b(r6, r8, r9);\n r0.setText(r6);\n r0 = r11.mContext;\n r6 = r4.nly;\n r6 = r6.fpg;\n r8 = r1.getTextSize();\n r0 = com.tencent.mm.pluginsdk.ui.d.i.b(r0, r6, r8);\n r1.setText(r0);\n r0 = r4.nly;\n r0 = r0.nkM;\n r0 = com.tencent.mm.sdk.platformtools.bi.oN(r0);\n if (r0 != 0) goto L_0x016f;\n L_0x0135:\n r0 = r4.nly;\n r0 = r0.npS;\n r1 = 1;\n if (r0 != r1) goto L_0x0167;\n L_0x013c:\n r0 = 1;\n r5.nDa = r0;\n r0 = com.tencent.mm.R.g.bCF;\n r5.nDd = r0;\n L_0x0143:\n r0 = com.tencent.mm.plugin.game.d.e.aSC();\n r1 = r4.nly;\n r1 = r1.nkM;\n r5 = r5.aSD();\n r0.a(r2, r1, r5);\n L_0x0152:\n r0 = new com.tencent.mm.plugin.game.ui.f$a;\n r1 = r4.nlw;\n r2 = r4.nly;\n r2 = r2.nkN;\n r5 = r4.nlr;\n r0.<init>(r1, r2, r5);\n r3.setTag(r0);\n r3.setOnClickListener(r11);\n goto L_0x0033;\n L_0x0167:\n r0 = 1;\n r5.hFJ = r0;\n r0 = com.tencent.mm.R.g.bCE;\n r5.nDd = r0;\n goto L_0x0143;\n L_0x016f:\n r0 = 8;\n r2.setVisibility(r0);\n goto L_0x0152;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.mm.plugin.game.ui.f.a(com.tencent.mm.plugin.game.c.ai, java.lang.String, int, int):void\");\n }", "public interface C0136c {\n }", "interface C1403bj {\n /* renamed from: iS */\n C1458cs mo7613iS();\n\n /* renamed from: jh */\n C1436ck mo7614jh();\n}", "void mo88524c();", "public void xuat() {\n\n\t}", "public interface C0385a {\n }", "public void mo2740a() {\n }", "void mo21070b();", "void mo57275a();", "abstract public String getImageKey();", "public abstract VKRequest mo118418h();", "void mo80452a();", "public void mo12628c() {\n }", "public void mo55254a() {\n }", "public abstract void mo20158a(GameIndex gameIndex);", "void mo10148a();", "private final void asx() {\n /*\n r12 = this;\n r0 = r12.cFE;\n if (r0 == 0) goto L_0x0073;\n L_0x0004:\n r1 = r12.cxs;\n if (r1 == 0) goto L_0x0073;\n L_0x0008:\n r1 = r12.ayL;\n if (r1 != 0) goto L_0x000d;\n L_0x000c:\n goto L_0x0073;\n L_0x000d:\n r2 = 0;\n if (r1 == 0) goto L_0x0027;\n L_0x0010:\n r1 = r1.Km();\n if (r1 == 0) goto L_0x0027;\n L_0x0016:\n r1 = r1.aar();\n if (r1 == 0) goto L_0x0027;\n L_0x001c:\n r3 = r0.getName();\n r1 = r1.get(r3);\n r1 = (java.util.ArrayList) r1;\n goto L_0x0028;\n L_0x0027:\n r1 = r2;\n L_0x0028:\n if (r1 == 0) goto L_0x0051;\n L_0x002a:\n r1 = (java.lang.Iterable) r1;\n r1 = kotlin.collections.u.Z(r1);\n if (r1 == 0) goto L_0x0051;\n L_0x0032:\n r3 = new com.iqoption.deposit.light.perform.DepositPerformLightFragment$setPresets$items$1;\n r3.<init>(r12);\n r3 = (kotlin.jvm.a.b) r3;\n r1 = kotlin.sequences.n.b(r1, r3);\n if (r1 == 0) goto L_0x0051;\n L_0x003f:\n r3 = new com.iqoption.deposit.light.perform.DepositPerformLightFragment$setPresets$items$2;\n r3.<init>(r0);\n r3 = (kotlin.jvm.a.b) r3;\n r1 = kotlin.sequences.n.f(r1, r3);\n if (r1 == 0) goto L_0x0051;\n L_0x004c:\n r1 = kotlin.sequences.n.f(r1);\n goto L_0x0052;\n L_0x0051:\n r1 = r2;\n L_0x0052:\n r3 = r12.asr();\n if (r1 == 0) goto L_0x0059;\n L_0x0058:\n goto L_0x005d;\n L_0x0059:\n r1 = kotlin.collections.m.emptyList();\n L_0x005d:\n r4 = r12.bub;\n if (r4 == 0) goto L_0x006d;\n L_0x0061:\n r5 = 0;\n r6 = 0;\n r7 = 1;\n r8 = 0;\n r9 = 0;\n r10 = 19;\n r11 = 0;\n r2 = com.iqoption.core.util.e.a(r4, r5, r6, r7, r8, r9, r10, r11);\n L_0x006d:\n r3.c(r1, r2);\n r12.d(r0);\n L_0x0073:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.deposit.light.perform.c.asx():void\");\n }", "void mo28194a();", "public final void mo51373a() {\n }", "void mo21076g();", "public interface C10724a {\n /* renamed from: a */\n void mo25616a(Context context);\n }", "void atterir();", "void mo12638c();", "public abstract void mo2162i();", "abstract String mo1748c();", "void mo1639a(ayl ayl);", "public interface C3183a {\n}", "public void mo12930a() {\n }", "public void mo5382o() {\n }", "public void mo21880v() {\n }", "void mo67924c();", "@Override\n\tpublic void boostingIBK() {\n\t\talgo.boostingIBK();\n\t}", "C1458cs mo7613iS();", "public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }", "void mo88521a();", "@Override\n public void iCGAbsAc(int icgAbsAc, int timestamp) {\n }", "void mo1637a();", "private Aliyun() {\n\t\tsuper();\n\t}", "public interface C9714a {\n /* renamed from: ad */\n void mo9058ad(String str, int i);\n\n /* renamed from: h */\n void mo9075h(String str, int i, int i2);\n\n /* renamed from: ml */\n void mo21050ml(int i);\n\n void onDataAvailable(String str, int i, int i2);\n }", "public final void mo92082N() {\n }", "void mo37810a();" ]
[ "0.64508796", "0.59632313", "0.59581673", "0.5887503", "0.56812704", "0.56658036", "0.5641655", "0.562068", "0.56177497", "0.5614061", "0.5542611", "0.55131125", "0.54889977", "0.5478367", "0.54658884", "0.54327166", "0.5431946", "0.5428598", "0.54218125", "0.5416157", "0.54148483", "0.54109377", "0.5400105", "0.53832626", "0.53826475", "0.53540516", "0.5349958", "0.5348204", "0.5347638", "0.53475577", "0.53416926", "0.53339255", "0.53338975", "0.5332317", "0.5329569", "0.5329032", "0.5329032", "0.5329032", "0.5329032", "0.5329032", "0.5329032", "0.5329032", "0.5324524", "0.53172725", "0.5313637", "0.53115785", "0.52998704", "0.5298203", "0.5289948", "0.5286781", "0.52808416", "0.5280346", "0.52801853", "0.5280076", "0.52737933", "0.5272627", "0.5271653", "0.526556", "0.5248535", "0.5240729", "0.5238341", "0.5236302", "0.5232925", "0.5224842", "0.5224232", "0.5224111", "0.5219576", "0.52110314", "0.5209359", "0.52077496", "0.5207718", "0.52032304", "0.5199243", "0.51972055", "0.51920575", "0.51899636", "0.51821554", "0.51802397", "0.5175447", "0.5171464", "0.5169317", "0.51691306", "0.51681554", "0.516091", "0.516033", "0.51556295", "0.51550263", "0.51465905", "0.51441634", "0.5143872", "0.514131", "0.51412094", "0.5129669", "0.5126181", "0.5124433", "0.51227564", "0.51205915", "0.51200235", "0.5117498", "0.5114532" ]
0.5744667
4
Creates a new instance of IncompleteGammaFunctionFraction
public IncompleteGammaFunctionFraction(double a) { alpha = a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getGamma();", "public float getGamma();", "public baconhep.TTau.Builder clearNSignalGamma() {\n fieldSetFlags()[8] = false;\n return this;\n }", "public baconhep.TTau.Builder setPuppiGammaIso(float value) {\n validate(fields()[18], value);\n this.puppiGammaIso = value;\n fieldSetFlags()[18] = true;\n return this; \n }", "public Expression getGammaValue();", "public void setPuppiGammaIso(java.lang.Float value) {\n this.puppiGammaIso = value;\n }", "public baconhep.TTau.Builder clearPuppiGammaIso() {\n fieldSetFlags()[18] = false;\n return this;\n }", "public double getNewGammaValue() {\r\n\t\treturn newGammaValue;\r\n\t}", "public FireflyOptimization(int population, int generations, double alpha, double beta0, double gamma){\n this(population, generations, alpha, beta0, gamma, 0.98, 0.05);\n }", "public Fraction()\n {\n }", "Fraction () {\n this (0, 1);\n }", "public Fitter() {\n this.alpha = -1.0; // reflection coefficient\n this.gamma = 2.0; // expansion coefficient\n this.beta = 0.5; // contraction coefficient\n this.maxError = 1.0E-10; // maximum error tolerance\n }", "public static double gamma(double x) {\n double sgngam, q, z, y, p1, q1;\n int ip, p;\n double[] pp = {1.60119522476751861407E-4, 1.19135147006586384913E-3, 1.04213797561761569935E-2, 4.76367800457137231464E-2, 2.07448227648435975150E-1, 4.94214826801497100753E-1, 9.99999999999999996796E-1};\n double[] qq = {-2.31581873324120129819E-5, 5.39605580493303397842E-4, -4.45641913851797240494E-3, 1.18139785222060435552E-2, 3.58236398605498653373E-2, -2.34591795718243348568E-1, 7.14304917030273074085E-2, 1.00000000000000000320};\n sgngam = 1;\n q = Math.abs(x);\n if(q>33.0) {\n if(x<0.0) {\n p = (int) Math.floor(q);\n ip = Math.round(p);\n if(ip%2==0) {\n sgngam = -1;\n }\n z = q-p;\n if(z>0.5) {\n p = p+1;\n z = q-p;\n }\n z = q*Math.sin(Math.PI*z);\n z = Math.abs(z);\n z = Math.PI/(z*gammastirf(q));\n } else {\n z = gammastirf(x);\n }\n y = sgngam*z;\n return y;\n }\n z = 1;\n while(x>=3) {\n x = x-1;\n z = z*x;\n }\n while(x<0) {\n if(x>-0.000000001) {\n y = z/((1+0.5772156649015329*x)*x);\n return y;\n }\n z = z/x;\n x = x+1;\n }\n while(x<2) {\n if(x<0.000000001) {\n y = z/((1+0.5772156649015329*x)*x);\n return y;\n }\n z = z/x;\n x = x+1.0;\n }\n if(x==2) {\n y = z;\n return y;\n }\n x = x-2.0;\n p1 = pp[0];\n for(int i = 1; i<7; i++) {\n p1 = pp[i]+p1*x;\n }\n q1 = qq[0];\n for(int i = 1; i<8; i++) {\n q1 = qq[i]+q1*x;\n }\n return z*p1/q1;\n }", "public double getGamma()\n {\n return gamma;\n }", "public PQR() {}", "public java.lang.Float getPuppiGammaIso() {\n return puppiGammaIso;\n }", "public java.lang.Float getPuppiGammaIso() {\n return puppiGammaIso;\n }", "public double getGamma() throws Exception\n\t{\n\t\tif(gammaValue >= 1000)\n\t\t{\n\t\t\tthrow new Exception(\"UNTRUE GAMMA VALUE\");\n\t\t}\n\t\treturn gammaValue;\n\t}", "private BigFractionUtils() {\n }", "public double getGamma() {\r\n return gamma;\r\n }", "private static double gcf(double a, double x) {\r\n double gammcf;\r\n double gln;\r\n int i;\r\n double an, b, c, d, del, h;\r\n \r\n gln = gammln(a);\r\n b = x + 1.0 - a;\r\n c = 1.0/FPMIN;\r\n d = 1.0/b;\r\n h = d;\r\n \r\n for(i = 1; i <= ITMAX; i++) //iterate to convergence\r\n {\r\n an = -i*(i - a);\r\n b += 2.0; //Set up for evaluating continued\r\n d = an*d + b; //fraction by modified Lentz's method with b_0 = 0.\r\n if(Math.abs(d) < FPMIN) {\r\n d = FPMIN;\r\n }\r\n c = b + an/c;\r\n if(Math.abs(c) < FPMIN) {\r\n c = FPMIN;\r\n }\r\n d = 1.0/d;\r\n del = d*c;\r\n h *= del;\r\n \r\n if(Math.abs(del - 1.0) < EPS) {\r\n break;\r\n }\r\n }\r\n if (i > ITMAX){\r\n // nerror(\"a too large, ITMAX too small in continued fraction gamma function\");\r\n }\r\n return gammcf = Math.exp(-x + a*Math.log(x) - (gln))*h; //Put factors in front\r\n \r\n }", "public Fraction() {\n this.numerator = 0;\n this.denominator = 1;\n }", "public Fraction()\r\n {\r\n this.numerator = 0;\r\n this.denominator = 1;\r\n }", "InverseGammaMixture getInverseGammaMixture() {\n int n = priorComponentsInput.get().size();\n InverseGammaMixture igm = new InverseGammaMixture(n);\n for (int c = 0; c < n; c++) {\n igm.setWeight(c, priorComponentsInput.get().get(c).getWeight());\n igm.setAlpha(c, priorComponentsInput.get().get(c).getAlpha());\n igm.setBeta(c, priorComponentsInput.get().get(c).getBeta());\n }\n return igm;\n }", "public baconhep.TTau.Builder clearPuppiGammaIsoNoLep() {\n fieldSetFlags()[21] = false;\n return this;\n }", "public Fraction(){\n numerator = 0;\n denominator = 1;\n }", "public Fraction(){\n\t\n\t\tsetFraction(0,1);\n }", "public Fraction(Fraction fraction) {\n if (fraction == null) {\n throw new PizzaException(\"fraction can't be null\");\n } else {\n this.NUMERATOR = fraction.NUMERATOR;\n this.DENOMINATOR = fraction.DENOMINATOR;\n }\n }", "public baconhep.TTau.Builder setPuppiGammaIsoNoLep(float value) {\n validate(fields()[21], value);\n this.puppiGammaIsoNoLep = value;\n fieldSetFlags()[21] = true;\n return this; \n }", "public abstract Graphomat getGraphomat(Fraction f);", "private B_NotaFiscal geraNF(C_Fatura fatura) {\n\t\tdouble valor = fatura.getValorMensal();\n\t\tdouble imposto = 0;\n\t\tif(valor < 200) {\n\t\t\timposto = valor * 0.03;\n\t\t}\n\t\telse if(valor > 200 && valor <= 1000) {\n\t\t\timposto = valor * 0.06;\n\t\t}\n\t\telse {\n\t\t\timposto = valor * 0.07;\n\t\t}\n\t\t\n\t\tB_NotaFiscal nf = new B_NotaFiscal(valor, imposto);\n\t\treturn nf;\n\t}", "public boolean hasNSignalGamma() {\n return fieldSetFlags()[8];\n }", "public void setGamma(double value) {\r\n this.gamma = value;\r\n }", "public void gammaCorrect(double gamma) {\n\n\t\tdouble inverseGamma = 1.0 / gamma;\n\t\tthis.r = Math.pow(r, inverseGamma);\n\t\tthis.g = Math.pow(g, inverseGamma);\n\t\tthis.b = Math.pow(b, inverseGamma);\n\n\t}", "public float getGamma() {\n\t\treturn gamma;\n\t}", "public PartialSigmaChargeDescriptor() { \n peoe = new GasteigerMarsiliPartialCharges();\n }", "public double getGamma() {\n return this.gamma;\n }", "public baconhep.TTau.Builder setNSignalGamma(long value) {\n validate(fields()[8], value);\n this.nSignalGamma = value;\n fieldSetFlags()[8] = true;\n return this; \n }", "public ArrayOfFraction()\r\n\t{\r\n\t\ta=new Fraction [2];\r\n\t\tn=0;\r\n\t}", "public Fraction(){\n\t\tthis.numer = 1;\n\t\tthis.denom = 1;\n\t}", "public void setGamma(float gamma) {\n\t\tthis.gamma = gamma;\n\t}", "FloatValue createFloatValue();", "FloatValue createFloatValue();", "void unsetFractional();", "public NFA(){}", "public void setPuppiGammaIsoNoLep(java.lang.Float value) {\n this.puppiGammaIsoNoLep = value;\n }", "public boolean hasPuppiGammaIso() {\n return fieldSetFlags()[18];\n }", "public Egrga() {\r\n\t}", "private FunctionBasis(FunctionBasis existing) {\n\t this.fs = existing.fs;\n\t setParameters(new double[existing.getNumberOfParameters()]);\n\t}", "double [] calcGamma(){\n\t\t\tgamma = new double [N];\n\t\t\tdouble [] gammaParam = new double [noLiveSites];\n\t\t\tint liveSite = 0;\n\t\t\tfor (int i = 0; i < N; i ++){\n\t\t\t\tgamma[i] = 1.0;\n\t\t\t\tif(aliveLattice[i]){\n\t\t\t\t\tdouble phi_i = 1.0 - fracDeadNbors[i];\n\t\t\t\t\tgammaParam[liveSite] = 1-phi_i*(1-alpha[i]);\n\t\t\t\t\tgamma[i] = gammaParam[liveSite];\n\t\t\t\t\tliveSite += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdouble ave = MathTools.mean(gammaParam);\n\t\t\tdouble var = MathTools.variance(gammaParam);\n\t\t\tdouble [] ret = new double [2];\n\t\t\tret[0] = ave;\n\t\t\tret[1] = var;\n\t\t\treturn ret;\n\t\t}", "public Fraction(int numerator){\n this.numerator = numerator;\n this.denominator = 1;\n }", "void unsetFractionalMinimum();", "private static FXForwardTrade createFxForwardTrade() {\n\n Counterparty counterparty = new SimpleCounterparty(ExternalId.of(Counterparty.DEFAULT_SCHEME, \"COUNTERPARTY\"));\n BigDecimal tradeQuantity = BigDecimal.valueOf(1);\n LocalDate tradeDate = LocalDate.of(2014, 7, 11);\n OffsetTime tradeTime = OffsetTime.of(LocalTime.of(0, 0), ZoneOffset.UTC);\n SimpleTrade trade = new SimpleTrade(createFxForwardSecurity(), tradeQuantity, counterparty, tradeDate, tradeTime);\n trade.setPremium(0.00);\n trade.setPremiumDate(LocalDate.of(2014, 7, 25));\n trade.setPremiumCurrency(Currency.GBP);\n\n FXForwardTrade fxForwardTrade = new FXForwardTrade(trade);\n\n return fxForwardTrade;\n }", "public PghModulo() {\r\n }", "public Gaussian() {\r\n this(1, 0, 1);\r\n }", "public Function() {\r\n\r\n\t}", "public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.HasCard createHasCard(de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Slot alpha, de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Card omega);", "public BennuDAOFuncional() {\n }", "@NonNull\n public Builder setInitialAlpha(@FloatRange(from = 0.0, to = 1.0) float initialAlpha) {\n mImpl.setInitialAlpha(initialAlpha);\n mFingerprint.recordPropertyUpdate(1, Float.floatToIntBits(initialAlpha));\n return this;\n }", "public double breitWigner(double arg, double a, double gamma){ \r\n return (2. * gamma / Math.PI) / (4. * Math.pow(arg - a, 2.) + gamma * gamma);\r\n }", "public final Statistic newInstance() {\n Statistic s = new Statistic();\n s.myNumMissing = myNumMissing;\n s.firstx = firstx;\n s.max = max;\n s.min = min;\n s.myConfidenceLevel = myConfidenceLevel;\n s.myJsum = myJsum;\n s.myValue = myValue;\n s.setName(getName());\n s.num = num;\n s.sumxx = sumxx;\n s.moments = Arrays.copyOf(moments, moments.length);\n if (getSaveOption()) {\n s.save(getSavedData());\n s.setSaveOption(true);\n }\n return (s);\n }", "public void setNewGammaValue(double newGammaValue) {\r\n\t\tthis.newGammaValue = newGammaValue;\r\n\t}", "float getEmpty();", "public ExtendedGB<C> \n extGB( List<GenPolynomial<C>> F ) {\n return extGB(0,F); \n }", "public Fraction(int numerator) {\n this.numerator = numerator;\n this.denominator = 1;\n }", "public XMLFourierPolynomial(File XMLInputFile, long[] G) throws FunctionException{\r\n\t\tsuper(G);\r\n\t\tmaxAlpha = new long[G.length];\r\n\t\tfor (int i=0; i<G.length; i++) maxAlpha[i] = -1;\r\n\t\tparser = new XMLParser(XMLInputFile, polynomials, G); // will set terms according to the XML input\r\n\t\tpolynomials = parser.polynomials;\r\n\t\tif (polynomials == null || polynomials.isEmpty())\r\n\t\t\tthrow new FunctionException(\"The XML must contain at least one polynomial.\");\r\n\t\tisRandom = parser.runId.equalsIgnoreCase(\"random\");\r\n\t\tmaxAlpha = parser.maxAlpha;\r\n\t}", "public Gov() {\n }", "public static Gng init() {\n return new Gng();\n }", "public PopulationFilter(int nr)\n { \n super();\n inhabitants = nr;\n }", "public Fraction() {\n\t\tsetNumerator(0);\n\t\tsetDenominator(1);\n\t}", "public Fraction getInvalidNumberAttribute();", "public java.lang.Float getPuppiGammaIsoNoLep() {\n return puppiGammaIsoNoLep;\n }", "public FunctionBipolar()\r\n\t{\r\n\t\tsuper(-1, 1, true);\r\n\t}", "private static FXForwardSecurity createFxForwardSecurity() {\n\n Currency payCurrency = Currency.GBP;\n Currency recCurrency = Currency.USD;\n\n double payAmount = 1_000_000;\n double recAmount = 1_600_000;\n\n ZonedDateTime forwardDate = DateUtils.getUTCDate(2019, 2, 4);\n\n ExternalId region = ExternalSchemes.currencyRegionId(Currency.GBP);\n\n FXForwardSecurity fxForwardSecurity = new FXForwardSecurity(payCurrency, payAmount, recCurrency, recAmount, forwardDate, region);\n\n return fxForwardSecurity;\n }", "int getDefaultFractionCounter();", "public Function()\n {}", "public java.lang.Float getPuppiGammaIsoNoLep() {\n return puppiGammaIsoNoLep;\n }", "public QuadCurve () {\n }", "private static double gammq(double a, double x) {\r\n double gamser, gammcf;\r\n \r\n //cout <<\"a \" << a<< \" x \"<<x<<endl;\r\n if(x < 0.0 || a <= 0.0){\r\n // nerror(\"Invalid arguments in routine gammq\");\r\n }\r\n if( x < (a + 1.0)){\t//use the series representation\r\n gamser = gser(a, x);\r\n return 1.0 - gamser;\t\t//and take its complement\r\n } else {\r\n gammcf = gcf(a, x); //use the continued fraction representation\r\n return gammcf;\r\n }\r\n }", "public Fraction(int numerator, int denominator) {\n\n //won't allow you to set the denominator equal to 0 because dividing by a 0 gives you an error\n if (denominator == 0) {\n throw new PizzaException(\"denominator can't be 0\");\n } else {\n //finding the GCD value depending on num and den\n int gcd = findGCD(numerator, denominator);\n\n //numerator/gcd and denominator/gcd give a reduced form and initialize them\n numerator = numerator / gcd;\n denominator = denominator / gcd;\n\n // if they both are negatives\n //Convert them to positive\n if (numerator < 0 && denominator < 0) {\n numerator = Math.abs(numerator);\n denominator = Math.abs(denominator);\n }\n //move the negative sign to the top for comparison reason\n else if (numerator > 0 && denominator < 0) {\n numerator = -numerator;\n denominator = Math.abs(denominator);\n }\n //set the final value for numerator and constructor\n this.NUMERATOR = numerator;\n this.DENOMINATOR = denominator;\n }\n\n }", "boolean isSetFractionalMinimum();", "public BondPartialPiChargeDescriptor() { \n \tpepe = new GasteigerPEPEPartialCharges();\n }", "@Test\n\tpublic void testConstructors(){\n\t\tassertTrue(\"Didn't intialize correctly\", new Fraction().toString().equals(\"1/1\"));\n\t\tassertTrue(\"Didn't intialize correctly\",new Fraction(4,3).toString().equals(\"4/3\"));\n\t\tassertFalse(\"Didn't intialize correctly\",new Fraction(0,0).toString().equals(\"0/0\"));\n\t}", "public DoubleExponentialSmoothingModel( double alpha,\n double gamma )\n {\n if ( alpha < 0.0 || alpha > 1.0 )\n throw new IllegalArgumentException(\"DoubleExponentialSmoothingModel: Invalid smoothing constant, \" + alpha + \" - must be in the range 0.0-1.0.\");\n \n if ( gamma < 0.0 || gamma > 1.0 )\n throw new IllegalArgumentException(\"DoubleExponentialSmoothingModel: Invalid smoothing constant, gamma=\" + gamma + \" - must be in the range 0.0-1.0.\");\n \n slopeValues = new DataSet();\n \n this.alpha = alpha;\n this.gamma = gamma;\n }", "public boolean getPerformGammaCorrection() {\n/* 178 */ return this.performGammaCorrection;\n/* */ }", "public Fraction getFraction() {\n return fraction;\n }", "boolean isSetFractional();", "public native boolean gammaImage(String gamma) throws MagickException;", "@Override\n public Object clone() throws CloneNotSupportedException {\n return new Fraction (getNumerator(), getDenominator());\n }", "public FiberCompressiveForceCosPennationCurve() {\n this(opensimSimulationJNI.new_FiberCompressiveForceCosPennationCurve__SWIG_0(), true);\n }", "public FibonacciHeap() {}", "private Gng() {\n }", "public Fletcher32() {\n }", "public DifferentialEvolution(){\n this(100,100);\n }", "public double getCurrentAlphaFraction() {\n return alphaFraction;\n }", "public void setNSignalGamma(java.lang.Long value) {\n this.nSignalGamma = value;\n }", "public List<GenPolynomial<C>> \n minimalGB(List<GenPolynomial<C>> Gp) { \n if ( Gp == null || Gp.size() <= 1 ) {\n return Gp;\n }\n // remove zero polynomials\n List<GenPolynomial<C>> G\n = new ArrayList<GenPolynomial<C>>( Gp.size() );\n for ( GenPolynomial<C> a : Gp ) { \n if ( a != null && !a.isZERO() ) { // always true in GB()\n // already positive a = a.abs();\n G.add( a );\n }\n }\n if ( G.size() <= 1 ) {\n return G;\n }\n // remove top reducible polynomials\n GenPolynomial<C> a;\n List<GenPolynomial<C>> F;\n F = new ArrayList<GenPolynomial<C>>( G.size() );\n while ( G.size() > 0 ) {\n a = G.remove(0);\n if ( red.isTopReducible(G,a) || red.isTopReducible(F,a) ) {\n // drop polynomial \n if ( debug ) {\n System.out.println(\"dropped \" + a);\n List<GenPolynomial<C>> ff;\n ff = new ArrayList<GenPolynomial<C>>( G );\n ff.addAll(F);\n a = red.normalform( ff, a );\n if ( !a.isZERO() ) {\n System.out.println(\"error, nf(a) \" + a);\n }\n }\n } else {\n F.add(a);\n }\n }\n G = F;\n if ( G.size() <= 1 ) {\n return G;\n }\n // reduce remaining polynomials\n int len = G.size();\n int i = 0;\n while ( i < len ) {\n a = G.remove(0);\n //System.out.println(\"doing \" + a.length());\n a = red.normalform( G, a );\n G.add( a ); // adds as last\n i++;\n }\n return G;\n }", "public abstract String getFraction();", "float mo98968c(C29296g gVar);", "public ExtendedGB<C> \n extGB( int modv, \n List<GenPolynomial<C>> F ) {\n throw new UnsupportedOperationException(\"extGB not implemented in \" \n + this.getClass().getSimpleName());\n }" ]
[ "0.57390374", "0.5663484", "0.5569923", "0.5531115", "0.540574", "0.53654146", "0.53397006", "0.5332428", "0.52579904", "0.52543235", "0.5177779", "0.5151055", "0.5128965", "0.5048209", "0.5029808", "0.49875727", "0.49770218", "0.4970374", "0.49326456", "0.49272203", "0.49225196", "0.4891749", "0.48831624", "0.4878688", "0.48692828", "0.48678282", "0.48443836", "0.48383152", "0.48167533", "0.4815672", "0.47995058", "0.47939822", "0.47824267", "0.4766239", "0.47583386", "0.47500998", "0.4735543", "0.47192618", "0.46696106", "0.46692365", "0.46660048", "0.4641745", "0.4641745", "0.46223065", "0.46035755", "0.45854598", "0.458219", "0.4580232", "0.45783198", "0.4573952", "0.45389587", "0.45132142", "0.4506624", "0.44956094", "0.4468803", "0.44648048", "0.44621983", "0.4459583", "0.44279808", "0.4426932", "0.44071326", "0.43961483", "0.43958023", "0.4367627", "0.43598688", "0.43592158", "0.43270215", "0.43202737", "0.4315509", "0.43150246", "0.43019253", "0.42966834", "0.42928165", "0.42894447", "0.42826125", "0.42793348", "0.4269941", "0.4254908", "0.42501372", "0.42440885", "0.42439064", "0.4240241", "0.42363146", "0.42348543", "0.4231425", "0.4226053", "0.42144075", "0.41959137", "0.41945344", "0.41922492", "0.41818708", "0.41816816", "0.41783223", "0.4172904", "0.4153646", "0.41516384", "0.41496098", "0.41457424", "0.4144812", "0.4135555" ]
0.75246555
0
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { String[] numbers = {"2", "4", "6", "8","10"}; View v = inflater.inflate(R.layout.fragment_my_fragment1, container, false); final Spinner spin = (Spinner)v.findViewById(R.id.mySpinner); ArrayAdapter<String> stringArrayAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_dropdown_item, numbers); spin.setAdapter(stringArrayAdapter); Button myButton = (Button)v.findViewById(R.id.myButton); myButton.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View v) { String text = spin.getSelectedItem().toString(); mListener.onNumberSelected(Integer.parseInt(text)); } }); return v; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.wallpager_layout, null);\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_invit_friends, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_zhuye, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_posts, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n return inflater.inflate(R.layout.ilustration_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_sow_drug_cost_per_week, container, false);\n\n db = new DataBaseAdapter(getActivity());\n hc = new HelperClass();\n pop = new FeedSowsFragment();\n\n infltr = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n parent = (LinearLayout) v.findViewById(R.id.layout_for_add);\n tvTotalCost = (TextView) v.findViewById(R.id.totalCost);\n\n getData();\n setData();\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_stream_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_event, container, false);\n\n\n\n\n\n\n\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_feed, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.screen_select_list_student, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_overall, container, false);\n mNamesLayout = (LinearLayout) rootView.findViewById(R.id.fragment_overall_names_layout);\n mOverallView = (OverallView) rootView.findViewById(R.id.fragment_overall_view);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n\n\n view = inflater.inflate(R.layout.fragment_earning_fragmant, container, false);\n ini(view);\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n super.onCreateView(inflater, container, savedInstanceState);\n final View rootview = inflater.inflate(R.layout.activity_email_frag, container, false);\n ConfigInnerElements(rootview);\n return rootview;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n\t\t\tBundle savedInstanceState) {\n\t\trootView = inflater.inflate(R.layout.fragment_attack_armor, container, false);\r\n\r\n\t\tfindInterfaceElements();\r\n\t\taddRangeSelector();\r\n\t\tupdateHeadings();\r\n\t\tsetListeners();\r\n\r\n\t\tsetFromData();\r\n\r\n\t\treturn rootView;\r\n\t}", "@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View initLayout(LayoutInflater inflater) {\n\t\tView view = inflater.inflate(R.layout.frag_customer_all, null);\r\n\t\treturn view;\r\n\t}", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_fore_cast, container, false);\r\n initView();\r\n mainLayout.setVisibility(View.GONE);\r\n apiInterface = RestClinet.getClient().create(ApiInterface.class);\r\n loadData();\r\n return view;\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_friend, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_detail, container, false);\n image = rootView.findViewById(R.id.fr_image);\n name = rootView.findViewById(R.id.fr_name);\n phoneNumber = rootView.findViewById(R.id.fr_phone_number);\n email = rootView.findViewById(R.id.fr_email);\n street = rootView.findViewById(R.id.fr_street);\n city = rootView.findViewById(R.id.fr_city);\n state = rootView.findViewById(R.id.fr_state);\n zipcode = rootView.findViewById(R.id.fr_zipcode);\n dBrith = rootView.findViewById(R.id.date_brith);\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_pm25, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_kkbox_playlist, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_feed_pager, container, false);\n\n// loadData();\n\n findViews(rootView);\n\n setViews();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n layout = (FrameLayout) inflater.inflate(R.layout.fragment_actualites, container, false);\n\n relLayout = (RelativeLayout) layout.findViewById(R.id.relLayoutActus);\n\n initListView();\n getXMLData();\n\n return layout;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.frag_post_prayer_video, container, false);\n setCustomDesign();\n setCustomClickListeners();\n return rootView;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\treturn inflater.inflate(R.layout.lf_em4305_fragment, container, false);\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_recordings, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_category, container, false);\n initView(view);\n bindRefreshListener();\n loadParams();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_cm_box_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_layout12, container, false);\n\n iniv();\n\n init();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_details, container, false);\n //return inflater.inflate(R.layout.fragment_details, container, false);\n getIntentValues();\n initViews();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_mem_body_blood, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_qiugouxiaoxi, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_coll_blank, container, false);\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_attendance_divide, container, false);\n\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,\n @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.visualization_fragment, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_category_details_page, container, false);\n initializeAll();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }", "protected int getLayoutResId() {\n return R.layout.activity_fragment;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_quizs, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n role = getArguments().getInt(\"role\");\n rootview = inflater.inflate(R.layout.fragment_application, container, false);\n layout = rootview.findViewById(R.id.patentDetails);\n progressBar = rootview.findViewById(R.id.progressBar);\n try {\n run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return rootview;\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.fragment_zhu, null);\n\t\tinitView();\n\t\tinitData();\n\t\treturn view;\n\t}", "@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)\n\t\t{\n\t\t\tView rootView = inflater.inflate(R.layout.maimfragment, container, false);\n\t\t\treturn rootView;\n\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n return inflater.inflate(R.layout.fragment__record__week, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_porishongkhan, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dashboard, container, false);\n resultsRv = view.findViewById(R.id.db_results_rv);\n resultText = view.findViewById(R.id.db_search_empty);\n progressBar = view.findViewById(R.id.db_progressbar);\n lastVisitText = view.findViewById(R.id.db_last_visit);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(getLayoutId(), container, false);\n init(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_service_summery, container, false);\n tvVoiceMS = v.findViewById(R.id.tvVoiceValue);\n tvDataMS = v.findViewById(R.id.tvdataValue);\n tvSMSMS = v.findViewById(R.id.tvSMSValue);\n tvVoiceFL = v.findViewById(R.id.tvVoiceFLValue);\n tvDataBS = v.findViewById(R.id.tvDataBRValue);\n tvTotal = v.findViewById(R.id.tvTotalAccountvalue);\n return v;\n }", "@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_clan_rank_details, container, false);\r\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_star_wars_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View inflate = inflater.inflate(R.layout.fragment_lei, container, false);\n\n initView(inflate);\n initData();\n return inflate;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_quotation, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wode_ragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n\n\n\n\n\n return inflater.inflate(R.layout.fragment_appoint_list, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n if (rootView == null) {\n rootView = inflater.inflate(R.layout.fragment_ip_info, container, false);\n initView();\n }\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_offer, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_rooms, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_img_eva, container, false);\n\n getSendData();\n\n initView(view);\n\n initData();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_project_collection, container, false);\n ButterKnife.bind(this, view);\n fragment = this;\n initView();\n getCollectionType();\n // getCategoryList();\n initBroadcastReceiver();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_yzm, container, false);\n initView(view);\n return view;\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n\t\tmainLayout = inflater.inflate(R.layout.fragment_play, container, false);\r\n\t\treturn mainLayout;\r\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_invite_request, container, false);\n initialiseVariables();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n getLocationPermission();\n return inflater.inflate(R.layout.centrum_fragment, container, false);\n\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_habit_type_details, container, false);\n\n habitTitle = rootView.findViewById(R.id.textViewTitle);\n habitReason = rootView.findViewById(R.id.textViewReason);\n habitStartDate = rootView.findViewById(R.id.textViewStartDate);\n habitWeeklyPlan = rootView.findViewById(R.id.textViewWeeklyPlan);\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_information_friends4, container, false);\n\n if (getArguments() != null) {\n FriendsID = getArguments().getString(\"keyFriends\");\n }\n\n return v;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_post_details, container, false);\n\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hotel, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view=inflater.inflate(R.layout.fragment_bus_inquiry, container, false);\n initView();\n initData();\n initDialog();\n getDataFromNet();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_weather, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_srgl, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_ground_detail_frgment, container, false);\n init();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_book_appointment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_wheretogo, container, false);\n ids();\n setup();\n click();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n binding = DataBindingUtil\n .inflate(inflater, R.layout.fragment_learning_leaders, container, false);\n init();\n\n return rootView;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_end_game_tab, container, false);\n\n setupWidgets();\n setupTextFields(view);\n setupSpinners(view);\n\n // Inflate the layout for this fragment\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.memoir_fragment, container, false);\n\n getUserIdFromSharedPref();\n configureUI(view);\n configureSortSpinner();\n configureFilterSpinner();\n\n networkConnection = new NetworkConnection();\n new GetAllMemoirTask().execute();\n\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_jadwal, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_delivery_detail, container, false);\n initialise();\n\n\n\n return view;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_4, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_all_product, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_group_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment06_7, container, false);\n initView(view);\n setLegend();\n setXAxis();\n setYAxis();\n setData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_downloadables, container, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.movie_list_fragment, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_like, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_hall, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_unit_main, container, false);\n TextView mTxvBusinessAassistant = (TextView) view.findViewById(R.id.txv_business_assistant);\n TextView mTxvCardINformation = (TextView) view.findViewById(R.id.txv_card_information);\n RelativeLayout mRelOfficialWebsite = (RelativeLayout) view.findViewById(R.id.rel_official_website);\n RelativeLayout mRelPictureAblum = (RelativeLayout) view.findViewById(R.id.rel_picture_album);\n TextView mTxvQrCodeCard = (TextView) view.findViewById(R.id.txv_qr_code_card);\n TextView mTxvShareCard = (TextView) view.findViewById(R.id.txv_share_card);\n mTxvBusinessAassistant.setOnClickListener(this.mOnClickListener);\n mTxvCardINformation.setOnClickListener(this.mOnClickListener);\n mRelOfficialWebsite.setOnClickListener(this.mOnClickListener);\n mRelPictureAblum.setOnClickListener(this.mOnClickListener);\n mTxvQrCodeCard.setOnClickListener(this.mOnClickListener);\n mTxvShareCard.setOnClickListener(this.mOnClickListener);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_moviespage, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_s, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_overview, container, false);\n\n initOverviewComponents(view);\n registerListeners();\n initTagListener();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_bahan_ajar, container, false);\n initView(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n root = (ViewGroup) inflater.inflate(R.layout.money_main, container, false);\n context = getActivity();\n initHeaderView(root);\n initView(root);\n\n getDate();\n initEvetn();\n return root;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.fragment_historical_event, parent, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_event_details, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_video, container, false);\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n v= inflater.inflate(R.layout.fragment_post_contacts, container, false);\n this.mapping(v);\n return v;\n }", "@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_measures, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_feed, container, false);\n findViews(view);\n return view;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_surah_list, container, false);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_data_binded, container, false);\n }" ]
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.6625158", "0.66195583", "0.66164845", "0.6608733", "0.6596594", "0.65928894", "0.6585293", "0.65842897", "0.65730995", "0.6571248", "0.6569152", "0.65689117", "0.656853", "0.6566686", "0.65652984", "0.6553419", "0.65525705", "0.65432084", "0.6542382", "0.65411425", "0.6538022", "0.65366334", "0.65355957", "0.6535043", "0.65329415", "0.65311074", "0.65310687", "0.6528645", "0.65277404", "0.6525902", "0.6524516", "0.6524048", "0.65232015", "0.65224624", "0.65185034", "0.65130377", "0.6512968", "0.65122765", "0.65116245", "0.65106046", "0.65103024", "0.6509013", "0.65088093", "0.6508651", "0.6508225", "0.6504662", "0.650149", "0.65011525", "0.6500686", "0.64974767", "0.64935696", "0.6492234", "0.6490034", "0.6487609", "0.6487216", "0.64872116", "0.6486594", "0.64861935", "0.6486018", "0.6484269", "0.648366", "0.6481476", "0.6481086", "0.6480985", "0.6480396", "0.64797544", "0.647696", "0.64758915", "0.6475649", "0.6474114", "0.6474004", "0.6470706", "0.6470275", "0.64702207", "0.6470039", "0.6467449", "0.646602", "0.6462256", "0.64617974", "0.6461681", "0.6461214" ]
0.0
-1
TODO Autogenerated method stub
public void run() { f.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Constants used in the model
public interface ModelConstants { // elements @Deprecated public final static String ACQUISITION_STRATEGY = "acquisition-strategy"; public final static String DATASOURCE = "datasource"; public final static String HISTORY_LEVEL = "history-level"; public final static String JOB_ACQUISITION = "job-acquisition"; public final static String JOB_ACQUISITIONS = "job-acquisitions"; public final static String JOB_EXECUTOR = "job-executor"; public final static String PROCESS_ENGINE = "process-engine"; public final static String PROCESS_ENGINES = "process-engines"; public final static String PROPERTY = "property"; public final static String PROPERTIES = "properties"; public final static String CONFIGURATION = "configuration"; public final static String PLUGINS = "plugins"; public final static String PLUGIN = "plugin"; public final static String PLUGIN_CLASS = "class"; // attributes public final static String DEFAULT = "default"; public final static String NAME = "name"; public final static String THREAD_POOL_NAME = "thread-pool-name"; /** The name of our subsystem within the model. */ public static final String SUBSYSTEM_NAME = "camunda-bpm-platform"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Constants\n{\n\tString EMAIL = \"email\";\n\tString RECORD_ID = \"_id\";\n\tString ENTRY_DATE = \"entryDate\";\n\tString DATE_FORMAT = \"yyyy-MM-dd'T'HH:mm:ssXXX\";\n\tString LEADS = \"leads\";\n}", "public interface DublinCoreConstants {\n \n /** Creates a new instance of Class */\n public static int DC_TITLE = 0;\n public static int DC_CREATOR = 1;\n public static int DC_SUBJECT = 2;\n public static int DC_DATE = 3;\n public static int DC_TYPE= 4;\n public static int DC_FORMAT= 5;\n public static int DC_IDENTIFIER = 6;\n public static int DC_COLLECTION = 7;\n public static int DC_COVERAGE = 8;\n \n public static int SUPPORTED_NUMBER = 9;\n \n public static final String[] DC_FIELDS = {\"title\",\"creator\",\"subject\",\"date\",\"type\",\"format\",\"identifier\",\"collection\",\"coverage\"};\n public static final String DC_NAMESPACE = \"dc:\";\n \n}", "public interface Constants {\n\t\n\t/** The Constant SPACE_CHAR of type Character of one empty space. */\n\tstatic final char SPACE_CHAR = ' ';\n\t\n\t/** The Constant LETTER_O of type Character which holds mark X. */\n\tstatic final char LETTER_O = 'O';\n\t\n\t/** The Constant LETTER_X of type Character which holds mark O. */\n\tstatic final char LETTER_X = 'X';\n}", "public interface Constants {\n\n String CURRENT_SCORE = \"CURRENT_SCORE\";\n\n String HIGH_SCORES = \"HIGH_SCORES\";\n\n String DB_WRITER = \"DB_WRITER\";\n\n String DB_READER = \"DB_READER\";\n\n String DB_HELPER = \"DB_HELPER\";\n\n\n}", "public interface UUCConstants {\n\t\n\n\tpublic String SERVICE_NAME = \"uuc.service.name\";\n\t\n\tpublic String SERVICE_ID = \"uuc.service.id\";\n\t\n\tpublic String SERVICE_URI = \"uuc.service.url\";\n\n\tpublic String USER_ID = \"uuc.user.id\";\n\t\n\tpublic String USER_NAME = \"uuc.user.name\";\n\t\n\tpublic String USER_EMAIL = \"uuc.user.email\";\n\t\n\tpublic String USER_GROUP=\"uuc.user.group\";\n\t\n\tpublic String USER_TITLE = \"uuc.user.title\";\n\t\n\tpublic String USER_LEVEL = \"uuc.user.level\";\n\t\n\tpublic String USER_PHOTO = \"uuc.user.photo\";\n\t\n\tpublic String USER_PHONE = \"uuc.user.phone\";\n\t\n\tpublic String USER_PASSWORD=\"uuc.user.password\";\n\t\n\tpublic String USER_EMPLOYEE_ID = \"uuc.user.employeeid\";\n}", "private LabelUtilsConstants() {}", "public interface Constants {\n\n /**\n * 资源路径\n */\n String CONTENT_RESOURCES_PATH = \"content\";\n\n /**\n * 名师头像地址\n */\n String TEACHER_HEADE_IMG_PATH = \"teacher\";\n\n /**\n * 证书保存地址\n */\n String CERTIFICATE_IMG_PATH = \"certificate\";\n\n\n /**\n * 舞谱上传地址目录\n */\n String DANCE_BOOK_PATH = \"dance_book\";\n}", "private ApplicationConstants(){\n\t\t//not do anything \n\t}", "private VolumeDataConstants() {\r\n \r\n }", "public static int[] getConstArray(){\n return new int[]{NAME, PHONE, EMAIL, DATE, TIME, DATE_TIME, URL, PRICE, PHOTO, ITEM_LIST, PRICE_LIST, TEXT, MESSAGE, NUMBER, DECIMAL, DROPDOWN, CHECKBOX, RATING, SUBJECT};\n }", "public interface Constants {\n\tpublic interface Paths { \n\t\tfinal String ELASTIC_PUSH_CONTROLLER_PATH = \"/elastic\" ; \n\t\tfinal String SAVE_TRANSACTION = \"/save\"; \n\t\tfinal String SAVE_TARGETS = \"/saveTargets\";\n\t\tfinal String SAVE_FEEDBACK = \"/saveFeedback\"; \n\t\tfinal String SAVE_FEEDBACK_RESPONSE = \"/v1/saveFeedback\"; \n\t}\n\t\n\tpublic static String SUCCESS= \"success\";\n\tpublic static int UNAUTHORIZED_ID = 401;\n\tpublic static int SUCCESS_ID = 200;\n\tpublic static int FAILURE_ID = 320;\n\tpublic static String UNAUTHORIZED = \"Invalid credentials. Please try again.\";\n\tpublic static String PROCESS_FAIL = \"Process failed, Please try again.\";\n\n}", "private LevelConstants() {\n\t\t\n\t}", "public interface ApplicationConstants {\n\n\t/**\n\t * SQL_CONSTANTS contains data base related properties\n\t * \n\t * @author prajwalnayak\n\t *\n\t */\n\tpublic interface SQL_CONSTANTS {\n\t\tstatic final String JDBC_DRIVER = \"com.mysql.jdbc.Driver\";\n\t\tstatic final String DB_URL = \"jdbc:mysql://localhost/EMP\";\n\t\tstatic final String USER = \"username\";\n\t\tstatic final String PASSWORD = \"password\";\n\t}\n}", "public interface JCConstants {\n /**\n *\n */\n public final static String[] OP_LEFT = new String[] {\n \"\", \"(\"};\n public final static String[] OP_COMPARE = new String[] {\n \"\", \" = \", \" > \", \" >= \", \" < \", \" <= \", \" <> \", \" LIKE \",\" 包含 \"};\n public final static String[] OP_RIGHT = new String[] {\n \"\", \")\"};\n public final static String[] OP_CONN = new String[] {\n \"\", \"并且\", \"或者\"};\n\n public static final String[] COL_NAMES = {\n \"左(\", \"比较项目\", \"比较符\", \"比较值\", \"右)\", \"连接符\"};\n\n public static final String FILE_NAME = \"wizard.xml\";\n public static final String COBJ_ROOT_NAME = \"BaseConditionObjects\";\n\n public static final int DEFAULT_ROW_HEIGHT = 20;\n\n public static final String COLUMN_NAME_PREFIX=\"Column_\";\n}", "public interface ProductTypeConstants {\n // 商品类型 1: 网课; 2: 图书\n Integer NETWORK_COURSE = 1;\n Integer BOOK = 2;\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}", "public interface BaseConstant {\n\n //=======数据来源=========//\n /**\n * 微信公众号\n */\n Integer SOURCE_TYPE_WECHAT=1;\n /**\n * 后台\n */\n Integer SOURCE_TYPE_WEB=2;\n /**\n * APP\n */\n Integer SOURCE_TYPE_APP=3;\n //=======数据来源end=========//\n}", "public Constants() {\n }", "public interface ExtraConstant {\n\n String SERVER_CONFIG = \"server_config\"; // 需要服务器配置的数据\n /********************* 图片预览 ********************/\n String PREVIEW_IMAGE_DATA = \"preview_image_data\";//图片预览\n String PREVIEW_IMAGE_POSITION = \"preview_image_position\";//图片预览默认的显示位置\n String IS_ACTIVITY_INIT = \"is_activity_init\"; // 是否初始化\n String ACTIVITY_CONFIG = \"activity_config\";\n String TOKEN_ENTITY = \"token_entity\"; // 登录标识\n String USER_INFO = \"user_bean\"; // 用户信息\n String WEB_URL = \"web_url\"; // 网页地址\n String WEB_IS_ANALYSIS = \"web_is_analysis\"; // 是否统计\n String RIGHT_CUSTOM_TYPE = \"right_custom_type\"; // 右上角显示在线客服类型\n String CUSTOMDIALOG_TYPE = \"customdialog_type\"; // 自定义弹窗类型\n String EXTRA_VERSION = \"extra_version\";//版本\n String NEED_UPDATE = \"need_update\"; // 是否需要更新\n\n String REPAYMENT_TYPE = \"repayment_type\"; // 代偿模式\n\n}", "public String toString() {\n return super.toString() + \" (\" + constants.size() + \" constants)\";\n }", "private Constants() {\n }", "private Constants() {\n }", "public interface Constants {\r\n\r\n\tpublic final static int UP = 1000;\r\n\tpublic final static int DOWN = 1001;\r\n\tpublic final static int RIGHT = 1002;\r\n\tpublic final static int LEFT = 1003;\r\n\t\r\n\t\r\n\tpublic final static int EMPTY = 0;\r\n\tpublic final static int ROAD = 1;\r\n\tpublic final static int TOWER = 2;\r\n\tpublic final static int NPC = 3;\r\n\tpublic final static int NPC_GENERATOR = 4;\r\n\tpublic final static int CASTLE = 5;\r\n\tpublic final static int LANDSCAPE = 6;\r\n\t\r\n\tpublic final static int LANDSCAPE_TREE_1 = 61;\r\n\tpublic final static int LANDSCAPE_TREE_2 = 62;\r\n\tpublic final static int LANDSCAPE_TREE_3 = 63;\r\n\t\r\n\tpublic final static int FIELD_END = 7;\r\n\t\r\n}", "private Constants() {\n\n }", "public interface SQL_CONSTANTS {\n\t\tstatic final String JDBC_DRIVER = \"com.mysql.jdbc.Driver\";\n\t\tstatic final String DB_URL = \"jdbc:mysql://localhost/EMP\";\n\t\tstatic final String USER = \"username\";\n\t\tstatic final String PASSWORD = \"password\";\n\t}", "public interface ModelViewConstant {\n\n interface MODEL {\n String\n EXCEPTION = \"exception\",\n PAGE = \"page\",\n LOCALISED_PAGE = \"localisedPage\",\n LANGUAGE = \"language\";\n\n }\n\n interface VIEW {\n String\n ERROR = \"errors/error\",\n PAGE = \"page\",\n INDEX = \"index\";\n }\n\n interface PROJECTION {\n String\n WITH_LOCALISED_PAGES = \"with-localised-pages\";\n }\n\n}", "public interface Constants {\r\n\r\n /**\r\n * The maximum number of Prizes allowed\r\n */\r\n int NUMBER_OF_PRIZES = 10;\r\n /**\r\n * The maximum number of students\r\n */\r\n int NUMBER_OF_STUDENTS = 1000;\r\n /**\r\n * The maximum number of topics a student can undertake\r\n */\r\n int NUMBER_OF_TOPICS = 40;\r\n}", "public interface CustomerConstants {\r\n\r\n int CUST_ID_SIZE = 5;\r\n int EMAIL_SIZE = 30;\r\n int FIRST_NAME_SIZE = 15;\r\n int LAST_NAME_SIZE = 15;\r\n}", "public ConstantProduct() {\n constProperty = \"constant\";\n constProperty2 = \"constant2\";\n }", "public interface Constants {\r\n public static final String APPLE_PRODUCT_CODE = \"APP1456\";\r\n public static final String ORANGE_PRODUCT_CODE = \"ORG3456\";\r\n public static final Double APPLE_PRODUCT_PRICE = 0.60;\r\n public static final Double ORANGE_PRODUCT_PRICE = 0.25;\r\n public static final int MAGIC_NUMBER_ZERO = 0;\r\n public static final int MAGIC_NUMBER_TWO = 2;\r\n public static final int MAGIC_NUMBER_THREE = 3;\r\n public static final int MAGIC_NUMBER_FIVE = 5;\r\n public static final int MAGIC_NUMBER_SEVEN = 7;\r\n public static final int MAGIC_NUMBER_NINE = 9;\r\n}", "public interface MyConstants {\n String ISPROCTECTED =\"isProctected\";\n String SAFENUMBER = \"safenumber\";\n String SIMNUMBER = \"simnumber\";\n String SPFILE = \"config\";\n String PASSWORD = \"password\";\n String ISSETUP = \"isSetup\";\n}", "public interface Constants {\n\n String KEY_BOOK_INFO = \"key_book_info\";\n\n}", "public interface Constants {\n String API_LINK_TEXT = \"API_LINK\";\n String USER_ID = \"user_id\";\n String MAPS_KEY = \"AIzaSyBgktirlOODUO9zWD-808D7zycmP7smp-Y\";\n String NEWS_API = \"https://newsapi.org/v1/articles?source=national-geographic&sortBy=top&apiKey=79a22c366b984f11b09d11fb9476d33b\";\n}", "public interface Constants {\n /**\n * String representation for the name of the preferences object storing\n * the Parabank connection settings.\n */\n String PREFS_PARABANK = \"parabankConnectionSettings\";\n\n /**\n * String representation for the key within the Parabank preferences\n * object which stores the protocol for the HTTP requests.\n */\n @Deprecated\n String PREFS_PARABANK_PROTOCOL = \"protocol\";\n\n /**\n * String representation for the key within the Parabank preferences\n * object which stores the host for the HTTP requests.\n */\n String PREFS_PARABANK_HOST = \"host\";\n\n /**\n * String representation for the key within the Parabank preferences\n * object which stores the port for the HTTP requests.\n */\n String PREFS_PARABANK_PORT = \"port\";\n\n /**\n * String representation for key within the {@link android.content.Intent}\n * object which stores the {@link com.parabank.parasoft.app.android.adts.User}\n * object data.\n */\n String INTENT_USER = \"user\";\n String INTENT_PARABANK_URI = \"parabankConnection\";\n}", "public interface PaperDbConstants {\n String UNIVERSAL_TYPE = \"universal_flavor_type\";\n String PAPER_ACCESS_TOKEN = \"paper_access_token\";\n\n\n String LIVE = \"LIVE\";\n String DEV = \"DEV\";\n\n String LOGIN_CREDENTIALS = \"logininfo\";\n\n}", "private Constants() {\n\t\tthrow new AssertionError();\n\t}", "private Constants(){\n }", "public interface MyConstants {\n\n //ALL_PREFS\n TinyDB db = TinyDB.getInstance();\n String PREF_TRACKER_APP = \"PREF_TRACKER_APP\";\n String PREF_EMAIL = \"PREF_EMAIL\";\n String PREF_PASSWORD = \"PREF_PASSWORD\";\n String PREF_MOBILE_NUMBER = \"PREF_MOBILE_NUMBER\";\n\n //ALL_VARIABLES\n String LOCATION_TIME = \"time\";\n String POWER = \"power\";\n String LATITUDE = \"latitude\";\n String LONGITUDE = \"longitude\";\n String ALTITUDE = \"altitude\";\n String BEARING = \"bearing\";\n String SPEED = \"speed\";\n String PROVIDER = \"provider\";\n String ACCURACY = \"accuracy\";\n String ELAPSED_REAL_TIME_NANOS = \"elapsedRealtimeNanos\";\n String BEARING_ACCURACY_DEGREES = \"getBearingAccuracyDegrees\";\n String SPEED_ACCURACY_METER_PER_SECOND = \"getSpeedAccuracyMetersPerSecond\";\n String VERTICAL_ACCURACY_METERS = \"getVerticalAccuracyMeters\";\n}", "public interface Constants {\n int STATE_AGREE = 1;\n int STATE_DISAGREE = 2;\n}", "public interface IssueConstants {\n static final String VIEW_ID = \"net.refractions.udig.issues.view.issues\"; //$NON-NLS-1$\n static final String ISSUES_LIST_EXTENSION_ID = \"net.refractions.udig.issues.issuesList\"; //$NON-NLS-1$\n static final String ISSUES_EXTENSION_ID = \"net.refractions.udig.issues.issue\"; //$NON-NLS-1$\n static final String EXTENSION_CLASS_ATTR = \"class\"; //$NON-NLS-1$\n\n}", "public interface MessageConstants {\n public static String WRONG_DATA=\"Wrong data!!!Try again:\";\n public static String INPUT_ADDRESS=\"Input address: \";\n public static String INPUT_PHONE=\"Input phone nummber:\";\n public static String INPUT_NICKNAMME=\"Input nickname:\";\n public static String Input_EMAIL=\"Input email:\";\n}", "private Constantes() {\r\n\t\t// No way\r\n\t}", "private USBConstant() {\r\n\r\n\t}", "public interface PhotoConstants {\n String ADDRESS_GET_PHOTO = \"PhotoConstants:ADDRESS_GET_PHOTO\";\n\n String PARAM_ACTION = \"PARAM_ACTION\";\n String PARAM_ACTION_GET = \"PARAM_ACTION_GET\";\n\n String PARAM_SOURCE_URL = \"sourceUrl\";\n String PARAM_CACHE_URI = \"cacheUri\";\n String PARAM_IS_CIRCLE = \"isCircle\";\n String PARAM_IS_SYNC = \"isSync\";\n String PARAM_SUCCESS = \"success\";\n}", "String getConstant();", "public interface LevelConstants {\n\t// ===========================================================\n\t// Constants\n\t// ===========================================================\n\n\tString TAG_LEVEL = \"level\";\n\tString TAG_LEVEL_ATTRIBUTE_NAME = \"name\";\n\tString TAG_LEVEL_ATTRIBUTE_UID = \"uid\";\n\tString TAG_LEVEL_ATTRIBUTE_WIDTH = \"width\";\n\tString TAG_LEVEL_ATTRIBUTE_HEIGHT = \"height\";\n\n\t// ===========================================================\n\t// Methods\n\t// ===========================================================\n}", "public interface Constants\r\n{\r\n\tfinal public static double EPSILON = 0.0001;\r\n\tfinal public static int LEFT_BUTTON = MouseEvent.BUTTON1;\r\n\tfinal public static int RIGHT_BUTTON = MouseEvent.BUTTON3;\r\n\tfinal public static double SMALL_EPSILON = 0.0000000001;\r\n}", "public interface IActivityConstants {\n\n public static final int ADD_UNIT_REQ_CODE = 1;\n\n public static final String METRIC_KEY = \"METRIC\";\n\n public static final String KNOT_KEY = \"KNOT\";\n\n public static final String BEUA_KEY = \"BEUAFORT\";\n\n public static final String INPUT_KEY = \"INPUT\";\n\n}", "@SuppressWarnings(\"unused\")\npublic interface Constants {\n /**\n * Extra data key. Used with intent or some others.\n */\n class Extras {\n public static final String TAG = \"ext_tag\";\n public static final String FLAG = \"ext_flag\";\n public static final String DATA = \"ext_data0\";\n public static final String DATA_1 = \"ext_data1\";\n public static final String DATA_2 = \"ext_data2\";\n public static final String DATA_3 = \"ext_data3\";\n public static final String DATA_4 = \"ext_data4\";\n public static final String DATA_5 = \"ext_data5\";\n public static final String DATA_6 = \"ext_data6\";\n public static final String DATA_7 = \"ext_data7\";\n public static final String DATA_8 = \"ext_data8\";\n public static final String GRADE_INFO = \"ext_grade_info\";\n public static final String MEMBER_VP_INFO = \"ext_member_vp_info\";\n public static final String MEMBER_VP_POSITION = \"ext_member_vp_position\";\n }\n\n\n}", "public interface ConstantsKey {\n// Values\n String TEXT_FONT_STYLE_NAME=\"WorkSans_Regular.ttf\";\n// Urls\n String BASE_URL=\"http://test.code-apex.com/codeapex_project/index.php/api/user/\";\n String BASEURL =\"baseurl\" ;\n// Keys\n}", "public interface FeedParserConstants {\n\tpublic static final String TITLE = \"title\";\n\tpublic static final String DESCRIPTION = \"description\";\n\tpublic static final String CHANNEL = \"channel\";\n\tpublic static final String COPYRIGHT = \"copyright\";\n\tpublic static final String LINK = \"link\";\n\tpublic static final String AUTHOR = \"creator\";\n\tpublic static final String ITEM = \"item\";\n\tpublic static final String PUB_DATE = \"pubDate\";\n\tpublic static final String CONTENT = \"encoded\";\n}", "public interface METHODS {\n public static int TIME = 0;\n public static int DISTANCE= 1;\n public static int STEPS = 2;\n public static int ACHIEVEMENTS = 3;\n }", "public interface Constants {\n int BYTES_PER_FLOAT = 4;\n}", "public interface Constant {\r\n\r\n String BASE_NAME = \"com.sslyxhz.entropy\";\r\n\r\n // Girl Photo\r\n String EXTRA_URL = BASE_NAME + \".EXTRA_URL\";\r\n String EXTRA_DESC = BASE_NAME + \".EXTRA_DESC\";\r\n\r\n // TypeDataFragment\r\n String EXTRA_TAG_NAME = BASE_NAME + \".EXTRA_TAG_NAME\";\r\n int TYPE_ITEM_GANK = 21; // 一般类型\r\n int TYPE_ITEM_WELFARE = 22; // 福利\r\n}", "public interface ObjectPropConstants {\n\n /**\n * A property key for models used to store the last-modified time stamp.\n * <p>\n * Type: A time stamp, encoded using ISO 8601. (Can be parsed using {@code java.time.Instant}.)\n * </p>\n */\n String MODEL_FILE_LAST_MODIFIED = \"tcs:modelFileLastModified\";\n /**\n * A property key for the orientation of a vehicle on a path.\n * <p>\n * Type: String (any string - details currently not specified)\n * </p>\n *\n * @deprecated Will be removed.\n */\n @Deprecated\n @ScheduledApiChange(when = \"5.0\", details = \"Will be removed.\")\n String PATH_TRAVEL_ORIENTATION = \"tcs:travelOrientation\";\n /**\n * A property key for {@link VisualLayout} instances used to provide a hint for which\n * {@link LocationTheme} implementation should be used for rendering locations in the\n * visualization client.\n * <p>\n * Type: String (the fully qualified class name of an implementation of {@link LocationTheme})\n * </p>\n *\n * @deprecated The theme to be used is now set directly via configuration.\n */\n @Deprecated\n @ScheduledApiChange(when = \"5.0\", details = \"Will be removed.\")\n String LOCATION_THEME_CLASS = \"tcs:locationThemeClass\";\n /**\n * A property key for {@link LocationType} instances used to provide a hint for the visualization\n * how locations of the type should be visualized.\n * <p>\n * Type: String (any element of {@link LocationRepresentation})\n * </p>\n */\n String LOCTYPE_DEFAULT_REPRESENTATION = \"tcs:defaultLocationTypeSymbol\";\n /**\n * A property key for {@link Location} instances used to provide a hint for the visualization how\n * the locations should be visualized.\n * <p>\n * Type: String (any element of {@link LocationRepresentation})\n * </p>\n */\n String LOC_DEFAULT_REPRESENTATION = \"tcs:defaultLocationSymbol\";\n /**\n * A property key for {@link Vehicle} instances to store a preferred initial position to be used\n * by simulating communication adapter, for example.\n * <p>\n * Type: String (any name of a {@link Point} existing in the same model.\n * </p>\n * \n * @deprecated Use vehicle driver-specific properties to specify the vehicle's initial position.\n */\n @Deprecated\n @ScheduledApiChange(when = \"5.0\", details = \"Will be removed.\")\n String VEHICLE_INITIAL_POSITION = \"tcs:initialVehiclePosition\";\n /**\n * A property key for {@link VisualLayout} instances used to provide a hint for which\n * {@link VehicleTheme} implementation should be used for rendering vehicles in the visualization\n * client.\n * <p>\n * Type: String (the fully qualified class name of an implementation of {@link VehicleTheme})\n * </p>\n *\n * @deprecated The theme to be used is now set directly via configuration.\n */\n @Deprecated\n @ScheduledApiChange(when = \"5.0\", details = \"Will be removed.\")\n String VEHICLE_THEME_CLASS = \"tcs:vehicleThemeClass\";\n}", "public static Constants getConstants() {\n return constants;\n }", "private Constants() {\n throw new AssertionError();\n }", "@DefaultLocale(\"fr\")\n@Generate(format={\"com.google.gwt.i18n.rebind.format.PropertiesFormat\"},locales={\"en\"})\npublic interface I18nConsts extends Constants {\n\t@DefaultStringArrayValue({\"France\",\"Espagne\",\"Belgique\"})\n\tString[] countries();\n}", "public interface Constants {\n String NA = \"NA\";\n String ARG_USERS=\"user\";\n String SENDER_ID =\"fro9SbG2Eic:APA91bHzUBA35xjcDP7TXu5uG3JetLMENHfJpfKnRjS02-y8W4n1ZonIn9HYNAwjV8F3uiOAV2gXparORINEEps3t0kCZHI2rutU33DaUlDeGJYrKDK_fG9HCdXAq1gNHtfmfqHGDBve\" ;\n}", "public interface ResponseConstants {\n\n String Bad_Request = \"The request was invalid or cannot be otherwise served\";\n String Authentication_failed = \"The request failed due to invalid credentials\";\n String Not_Found = \"No information available or the requested URL was not found on the server\";\n String Internal_Server_Error = \"Something is broken\";\n String Bad_Gateway = \"Oxford Dictionaries API is down or being upgraded\";\n String Service_Unavailable = \"The Oxford Dictionaries API servers are up, but overloaded with requests. Please try again later\";\n String Gateway_timeout = \"The Oxford Dictionaries API servers are up, but the request couldn’t be serviced due to some failure within our stack. Please try again later\";\n\n}", "public interface TextConstant {\n String INPUT_INFO_DATA = \"input.string.data\";\n String INPUT_LAST_NAME=\"input.last.name.date\";\n String INPUT_FIRST_NAME = \"input.first.name.data\";\n String WRONG_INPUT_DATA = \"input.wrong.data\";\n String INPUT_LOGIN_DATA = \"input.login.data\";\n}", "private FTConfigConstants() {\n }", "public interface Constants extends ShareConstants {\n String FASTDEX_DIR = \"fastdex\";\n String PATCH_DIR = \"patch\";\n String TEMP_DIR = \"temp\";\n String DEX_DIR = \"dex\";\n String OPT_DIR = \"opt\";\n String RES_DIR = \"res\";\n}", "public interface Constants {\n\n //前端显示描述类内容最长字符串长度\n int MAX_LIST_CONTEXT_LENGTH = 60;\n\n //描述内容最大长度\n int MAX_CONTEXT_LENGTH = 3000;\n\n //评论内容最大长度\n int MAX_COMMENT_LENGTH = 500;\n\n //获取更多评论记录数\n int MAX_MORE_COMMENT_NUM = 100;\n\n //上传文件名字最大长度\n int MAX_FILE_NAME_LENGTH = 30;\n\n //同一作业连续发送提醒交作业通知间隔秒数\n int MIN_SECONDS_WARNSUB = 21600;\n\n //口语作业最多支持单词数\n int MAX_VOICE_WORK_WORDS = 15;\n\n //作业发布最长延迟天数\n int MAX_PUBLISH_WORK_EXDAYS = 60;\n\n // 课外作业\n int WORK_TYPE_EXTRA_WORK = 8;\n\n //板书类型\n int WORK_TYPE_VOICE_WORK = 7;\n\n //板书类型\n int WORK_TYPE_BLACKBOARD_PUBLISH = 6;\n\n //网络课件类型\n int WORK_TYPE_COURSE_REAPPEAR = 5;\n\n //电子作业\n int WORK_TYPE_EXERCISE_WORK = 4;\n\n //同步课堂作业\n int WORK_TYPE_SYNCLASS_WORK = 3;\n\n //同步课堂作业\n int WORK_TYPE_MAGIC_WORK = 2;\n\n //同步课堂作业\n int WORK_TYPE_GUIDANCE_WORK = 1;\n\n //我的课件\n int COURSEWARE_BELONG_TYPE_MY_APPEAR = 1;\n\n //发布的课件\n int COURSEWARE_BELONG_TYPE_COURSE_APPEAR = 3;\n\n //用户类型\n String TEACHER_TYPE = \"1\";\n\n String STUDENT_TYPE = \"2\";\n\n int WORK_TYPE = 1;\n\n int BLACKBOARD_TYPE = 2;\n\n //乐观锁机制尝试次数\n int OPTIMISTIC_LOCK_TRY_TIMES = 10;\n\n //提分宝作业评分描述10\n String MAGIC_WORK_SCORE_CONTEXT10 = \"恭喜你!继续保持,清华北大在等你哦!\";\n\n //提分宝作业评分描述9\n String MAGIC_WORK_SCORE_CONTEXT9 = \"哇噢!可以挑战清华北大了!\";\n\n //提分宝作业评分描述8\n String MAGIC_WORK_SCORE_CONTEXT8 = \"你好聪明,加油冲击重点大学吧!\";\n\n //提分宝作业评分描述7\n String MAGIC_WORK_SCORE_CONTEXT7 = \"太棒了,可以挑战一本大学啦!\";\n\n //提分宝作业评分描述6\n String MAGIC_WORK_SCORE_CONTEXT6 = \"再次挑战,稍微努力下就能二本大学啦!\";\n\n //提分宝作业评分描述5\n String MAGIC_WORK_SCORE_CONTEXT5 = \"再多练练就可以上大学啦!\";\n /**提分宝数据统计前端页面分数描述*/\n //提分宝作业评分描述10\n String STATISTICS_SCORE_CONTEXT10 = \"清华北大\";\n //提分宝作业评分描述9\n String STATISTICS_SCORE_CONTEXT9 = \"重点大学\";\n //提分宝作业评分描述8\n String STATISTICS_SCORE_CONTEXT8 = \"一本大学\";\n //提分宝作业评分描述7\n String STATISTICS_SCORE_CONTEXT7 = \"二本大学\";\n //提分宝作业评分描述6\n String STATISTICS_SCORE_CONTEXT6 = \"三本大学\";\n //提分宝作业评分描述5\n String STATISTICS_SCORE_CONTEXT5 = \"挑战完成\";\n\n\n\n //提醒交作业通知标题\n String WARNSUB_TITLE = \"作业提醒\";\n\n //提醒查看教师发布的板书、网络课件通知标题\n String WARNVIEW_BLACKBOARD_TITLE = \"新板书\";\n String WARNVIEW_COURSEWARE_TITLE = \"新课件\";\n\n //提醒交作业通知内容\n String WARNSUB_CONTENT = \"赶快交作业,老师都着急啦!\";\n\n String GUIDANCE_WORK_NAME = \"预习作业\";\n String MAGIC_WORK_NAME = \"提分宝作业\";\n String SYNCLASS_WORK_NAME = \"同步课堂作业\";\n String EXERCISE_WORK_NAME = \"电子作业\";\n String VOICE_WORK_NAME = \"口语作业\";\n String BLACKBOARD_WORK_NAME = \"板书\";\n String COURSEWARE_WORK_NAME = \"网络课件\";\n String EXTRA_WORK_NAME = \"课外作业\";\n\n String WARN_SUB_WORK_BUSY = \"您太忙碌啦,请休息一会儿,稍后再试\";\n\n // 页面最初加载的评论数\n int MIN_COMMENT_NUM = 4;\n\n // 数字的正则表达式\n final String NUMBER_EXPR = \"^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$\";\n\n // indentifyId\n String IDENTIFY_SCHOOL_MANAGER = \"SCHOOL_MANAGER\";\n String IDENTIFY_TEACHER = \"TEACHER\";\n String IDENTIFY_STUDENT = \"STUDENT\";\n String IDENTIFY_PARENT=\"PARENT\";\n\n final int MAX_STUDENT_NUMBER_FOR_PUBLIC = 1000;\n\n //出题数\n int MAGIC2_WORK_QUEST_NUM = 8;\n //最大衍生题号sort\n int MAGIC2_WORK_MAX_SORT = 5;\n\n //错误率\n double MAGIC2_WORK_WRONG_QUEST_NUM = 0.2;\n\n //默认题目初始平均用时\n final long MAGIC2_WORK_QUEST_AVGTIME = 30000;\n //默认作业时间\n final long DEFAULT_WORK_TIME = 300000;\n}", "public interface Constants {\n\n final public static String TAG = \"[PracticalTest02Var04]\";\n\n final public static boolean DEBUG = true;\n\n final public static String EMPTY_STRING = \"\";\n\n final public static String QUERY_ATTRIBUTE = \"query\";\n\n final public static String SCRIPT_TAG = \"script\";\n final public static String SEARCH_KEY = \"wui.api_data =\\n\";\n\n final public static String CURRENT_OBSERVATION = \"current_observation\";\n\n}", "private LoggerConstants() {\n\t\tsuper();\n\t}", "@Test\n\tpublic void testPublicConstants() {\n\t\tip = new ImagePlus();\n\t\tassertEquals(0,ImagePlus.GRAY8);\n\t\tassertEquals(1,ImagePlus.GRAY16);\n\t\tassertEquals(2,ImagePlus.GRAY32);\n\t\tassertEquals(3,ImagePlus.COLOR_256);\n\t\tassertEquals(4,ImagePlus.COLOR_RGB);\n\t}", "private CommonUIConstants()\n {\n }", "public String getConstantTableName(){\n return CONSTANT_TABLE_NAME;\n }", "public interface UserConstants {\n String TYPE_AUTH_QQ = \"qq\";\n String TYPE_AUTH_WX = \"wx\";\n String TYPE_AUTH_WB = \"wb\";\n String REG_ILLEGAL = \"[`~!@#$^&*()=|{}':;',\\\\[\\\\].<>/?~!@#¥……&*()—|{}【】‘;:”“'。,、?]\";\n\n String NCODE = \"86\";\n\n String FROM = \"whaleyVR\";\n\n\n int THIRD_ERROR = 1097;\n\n int THIRD_CANCEL = 2889;\n int THIRD_INSTALL = 3054;\n int THIRD_WEIBO = 5650;\n //====================================event====================================//\n String EVENT_LOGIN_SUCCESS = \"login_success\";\n String EVENT_SIGN_OUT = \"sign_out\";\n String EVENT_UPATE_NAME = \"update_name\";\n String EVENT_UPATE_AVATAR = \"update_avatar\";\n String EVENT_LOGIN_CANCEL = \"login_cancel\";\n}", "public interface STConstant {\n\n /** The base resource path for this application. */\n String BASE_RES_PATH = \"/com/sandy/stocktracker/\" ;\n\n /** The date format used for NSE EOD dates in the CSV files. */\n SimpleDateFormat DATE_FMT = new SimpleDateFormat( \"dd-MMM-yyyy\" ) ;\n\n /** The time format used for ITD title displays and general time displays. */\n SimpleDateFormat TIME_FMT = new SimpleDateFormat( \"HH:mm:ss\" ) ;\n\n /** The the expanded time format. */\n SimpleDateFormat DATE_TIME_FMT = new SimpleDateFormat( \"dd-MMM-yyyy HH:mm:ss\" ) ;\n\n /** The prefix for drop values indicating the drop value as scrip name. */\n String DROP_VAL_SCRIP = \"SCRIP:\" ;\n\n /** The application config key against which the install directory is specified. */\n String CFG_KEY_INSTALL_DIR = \"pluto.install.dir\" ;\n\n /** The application config key against which biz start hour is specified. */\n String CFG_KEY_NSE_BIZ_START_HR = \"nse.business.start.time\" ;\n\n /** The application config key against which biz end hour is specified. */\n String CFG_KEY_NSE_BIZ_END_HR = \"nse.business.end.time\" ;\n\n /** The number of days for which to show old news. */\n String CFG_KEY_NUM_OLD_DAYS_NEWS = \"news.display.num.days\" ;\n}", "public interface Constants {\n final public static String TAG = \"[PracticalTest02Var03]\";\n\n final public static boolean DEBUG = true;\n\n final public static String WEB_SERVICE_ADDRESS = \"http://services.aonaware.com/DictService/DictService.asmx/Define\";\n\n final public static String EMPTY_STRING = \"\";\n\n final public static String QUERY_ATTRIBUTE = \"word\";\n\n final public static String SCRIPT_TAG = \"WordDefinition\";\n final public static String SEARCH_KEY = \"wui.api_data =\\n\";\n\n final public static String CURRENT_OBSERVATION = \"current_observation\";\n}", "private RBACConstants() {\r\n }", "public interface Constant {\n\n String JWT_SECRET = \"jwtsecret\";\n\n long EXP_TIME_LENGTH = 86400000;\n}", "public interface Constant {\n\n enum Column {\n BEAUTY(\"BEAUTY\", \"福利\", R.string.beauty, R.id.nav_beauty),\n ANDROID(\"ANDROID\", \"Android\", R.string.android, R.id.nav_android),\n IOS(\"IOS\", \"iOS\", R.string.ios, R.id.nav_ios),\n JS(\"JAVASCRIPT\", \"前端\", R.string.js, R.id.nav_web),\n APP(\"APP\", \"App\", R.string.app, R.id.nav_app),\n EXCITED(\"EXCITED\", \"瞎推荐\", R.string.excited, R.id.nav_excited),\n OTHERS(\"OTHERS\", \"拓展资源\", R.string.others, R.id.nav_others),\n FAVORITE(\"FAVORITE\", \"Collections\", R.string.favorite, R.id.nav_favorite);\n //SEARCH_RESULTS(\"SEARCH_RESULTS\", \"search_results\", R.string.nav_search, 0);\n\n private final String id;\n private final String apiName;\n private final int strId;\n private final int resId;\n\n Column(String id, String apiName, int strId, int resId) {\n this.id = id;\n this.apiName = apiName;\n this.strId = strId;\n this.resId = resId;\n }\n\n @Override\n public String toString() {\n return id;\n }\n\n public String getId() {\n return id;\n }\n\n public String getApiName() {\n return apiName;\n }\n\n public int getStrId() {\n return strId;\n }\n\n public int getResId() {\n return resId;\n }\n }\n\n}", "public interface Constant {\n String INDEX_URL=\"https://raw.githubusercontent.com/sujit0892/meeting/master/meeting-xml/index.xml\";\n String MEETING_TAG=\"meeting\";\n String NAME_TAG=\"name\";\n String VENUE_TAG=\"venue\";\n String START_DATE=\"start-date\";\n String XML_URL=\"url\";\n String END_DATE=\"end-date\";\n String DESCRIPTION_TAG=\"description\";\n\n}", "private CellManagerConstants() { \r\n throw new AssertionError();\r\n }", "public interface KeyValueConst {\n\n String PUBLIC_KEY = \"PublicKey\";\n String PRIVATE_KEY = \"PrivateKey\";\n}", "public interface Constants {\n public static final int CASE_ZERO = 0;\n public static final int CASE_ONE = 1;\n\n}", "public interface Constants {\r\n\r\n String ID = \"id\";\r\n String CREATED_AT = \"created_at\";\r\n String UPDATED_AT = \"updated_at\";\r\n String CREATED_BY = \"created_by\";\r\n String MODIFIED_BY = \"modified_by\";\r\n String DESCRIPTION = \"description\";\r\n String START_DATE = \"start_date\";\r\n String END_DATE = \"end_date\";\r\n String PLACE_HOLDER = \"{}\";\r\n String EMPTY = \"\";\r\n\r\n\r\n String USER_DETAIL = \"user_details\";\r\n\r\n String FILE_LOCATION = \"C:\\\\BVN\";\r\n String FILE_LOCATION_DECRYPTED = \"C:\\\\BVN\\\\decrypted\";\r\n String FILE_LOCATION_ENCRYPTED = \"C:\\\\BVN\\\\encrypted\";\r\n\r\n String ERROR_MESSAGE = \"Unable to process action, please try again\";\r\n\r\n String AGENT_ID_IS_REQUIRED = \"Agent Id is required\";\r\n String BRANCH_ID_IS_REQUIRED = \"Branch Id is required\";\r\n\r\n String SECRET_KEY = \"aeskey\";\r\n String IV = \"iv\";\r\n String USERNAME = \"username\";\r\n\r\n}", "public interface ServiceConstants {\n\n String TASK_JSON = \"TASK_JSON\";\n String TASK_IDENTIFIER = \"TASK\";\n String TRIGGER_IDENTIFIER = \"TRIGGER\";\n String DEFAULT_GROUP_ID = \"DEFAULT_GROUP\";\n String TASK_ID = \"TASK_ID\";\n String TOPIC_NAME_CACHE_PROPERTY = \"topic_name_by_task_type\";\n String PRODUCER_PROPERTIES_CACHE = \"kafka_producer_properties\";\n String REQUEST_CONSUMER_PROPERTIES_CACHE = \"request_consumer_properties_cache\";\n}", "public interface RestConstants {\n\n /**\n * Base for rest api requests\n */\n String BASE = \"/api\";\n\n /**\n * end-point for calculating an area\n */\n String CALCULATE_AREA = \"/area\";\n /**\n * end-point for calculating a volume\n */\n String CALCULATE_VOLUME = \"/volume\";\n /**\n * end-point for calculating a light to area ratio\n */\n String CALCULATE_LIGHT_TO_AREA = \"/light-area\";\n /**\n * end-point for calculating an energy to volume ratio\n */\n String CALCULATE_ENERGY_TO_VOLUME = \"/energy-volume\";\n /**\n * end-point for finding rooms above provided norm\n */\n String GET_ROOMS_ABOVE_ROOM = \"/norm-check\";\n /**\n * end-point for calculating penalty for rooms above norm\n */\n String CALCULATE_PENALTY = \"/penalty\";\n}", "public interface Constant {\n //api 说明\n //\n String API= \"/api\";\n\n String AJAXLOGIN =\"ajaxLogin\";\n\n String SAVE = \"register\";\n\n String FORGOT = \"forgot\";\n\n String SUCCESS = \"操作成功\";\n\n String FAIL = \"操作失败\";\n\n //说明\n String LOGIN_SUCCESS = \"登陆成功\";\n\n String PARMS_ERROR = \"参数错误\";\n\n String LOGIN_ERROR= \"账号或密码错误\";\n\n String SAVE_SUCCESS= \"保存成功\";\n\n String SAVE_ERROR= \"保存失败\";\n\n String GET_SUCCESS = \"获取详情成功\";\n\n String GET_ERROR = \"获取详情失败\";\n\n String REGISTER_SUCCESS= \"注册成功\";\n\n String REGISTER_ERROR= \"注册失败\";\n\n}", "public interface Constants {\n String PATH_SEPARATOR = \"/\";\n String ROOT_DIRECTORY_SYMBOL = \"/\";\n String COMMAND_OPTION_PREFIX = \"-\";\n String SESSION_CLEAR = \"session clear\";\n}", "public interface LibraryConstant {\n\n public interface LanguageConstant {\n\n public static String JAVA=\"JAVA\";\n public static String C=\"C\";\n public static String CPP=\"C++\";\n }\n\n public interface StyleConstant {\n\n //pre-defined Styles\n\n public static final String NORMAL=\"NORMAL\";\n public static final String BOLD=\"BOLD\";\n public static final String ITALIC=\"ITALIC\";\n public static final String UNDERLINE=\"UNDERLINE\";\n public static final String SUPERSCRIPT=\"SUPERSCRIPT\";\n public static final String SUBSCRIPT=\"SUBSCRIPT\";\n\n\n }\n}", "public int getConstantCount() {\r\n return EnthalpyVapour.CONSTANT_COUNT;\r\n }", "public interface EnumsKeyConstants {\n\n /*客户状态*/\n static final String CSTM_STATE = \"CSTM_STATE\";\n\n interface CSTMSTATE {\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*正常*/\n static final String NORMAL = \"01\";\n\n /*停用*/\n static final String BLOCKUP = \"02\";\n\n /*冻结*/\n static final String FROZEN = \"03\";\n }\n\n /*短信类型*/\n static final String SMS_TYPE = \"SMS_TYPE\";\n\n interface SMSTYPE {\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*验证码*/\n static final String VERCODE = \"01\";\n\n /*通知*/\n static final String NOTICE = \"02\";\n\n /*营销*/\n static final String MARKETING = \"03\";\n\n /*未知*/\n static final String UNKNOWN = \"04\";\n }\n\n /*模板类型*/\n static final String SMODEL_TYPE = \"SMODEL_TYPE\";\n\n interface SMODELTYPE {\n /*验证码*/\n static final String VERCODE = \"01\";\n\n /*通知&订单*/\n static final String NOTICE = \"02\";\n }\n\n /*审核状态*/\n static final String AUDIT_STATE = \"AUDIT_STATE\";\n\n interface AUDITSTATE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*审核中*/\n static final String ING = \"01\";\n\n /*审核通过*/\n static final String ED = \"02\";\n\n /*审核驳回*/\n static final String DF = \"03\";\n\n }\n\n /*运营商类型*/\n static final String OPERATOR_TYPE = \"OPERATOR_TYPE\";\n\n interface OPERATORTYPE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*移动*/\n static final String MOBILE = \"01\";\n\n /*电信*/\n static final String TELECOM = \"02\";\n\n /*联通*/\n static final String UNICOM = \"03\";\n }\n\n /*通道状态*/\n static final String CHANNEL_STATE = \"CHANNEL_STATE\";\n\n interface CHANNELSTATE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*可用*/\n static final String ENABLE = \"01\";\n\n /*禁用*/\n static final String DISABLE = \"02\";\n }\n\n /*短信发送状态*/\n static final String SMSSEND_STATE = \"SMSSEND_STATE\";\n\n interface SMSSENDSTATE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*成功*/\n static final String SUCCESS = \"01\";\n\n /*失败*/\n static final String FAILURE = \"02\";\n\n /*未知*/\n static final String UNKNOWN = \"03\";\n\n /*无效*/\n static final String INVALID = \"04\";\n\n /*其他*/\n static final String OTHER = \"05\";\n }\n\n /*短息接收状态*/\n static final String SMSDELIV_STATE = \"SMSDELIV_STATE\";\n\n interface SMSDELIVSTATE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*收到*/\n static final String DELIV = \"01\";\n\n /*未收到*/\n static final String UNDELIV = \"02\";\n }\n\n /*批次单状态*/\n static final String BATCH_STATE = \"BATCH_STATE\";\n\n interface BATCHSTATE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*等待发送*/\n static final String WAIT = \"01\";\n\n /*发送中*/\n static final String ING = \"02\";\n\n /*完成*/\n static final String FINISH = \"03\";\n\n /*已撤回*/\n static final String REVOKE = \"04\";\n\n /*已驳回*/\n static final String REJECT = \"05\";\n }\n\n /*适用范围类型*/\n static final String USEAGE_TYPE = \"USEAGE_TYPE\";\n\n interface USEAGETYPE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*通用*/\n static final String PUB = \"01\";\n\n /*个人*/\n static final String PRI = \"02\";\n }\n\n /*是否发送*/\n static final String SMSSEND_CODE = \"SMSSEND_CODE\";\n\n interface SMSSENDCODE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*发送*/\n static final String SEND = \"01\";\n\n /*不发送*/\n static final String DESEND = \"02\";\n }\n\n /*短信数量增减类型*/\n static final String ACCOUNT_TYPE = \"ACCOUNT_TYPE\";\n\n interface ACCNTTYPE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*充值*/\n static final String ADDITION = \"01\";\n\n /*消费*/\n static final String SUBTRACTION = \"02\";\n\n }\n\n /*充值单审核状态*/\n static final String RECHARGE_STATE = \"RECHARGE_STATE\";\n\n interface RECHARGESTATE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*成功*/\n static final String SUCCESS = \"01\";\n\n /*失败*/\n static final String FAILURE = \"02\";\n\n /*确认中*/\n static final String COMFIRM = \"03\";\n\n /*已取消*/\n static final String CANCEL = \"04\";\n\n }\n\n /*手机号是否在黑名单中*/\n static final String REPLY_BLACK = \"REPLY_BLACK\";\n\n interface REPLYBLACK{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*不在黑名单中*/\n static final String NOTINT = \"01\";\n\n /*在黑名单中*/\n static final String INT = \"02\";\n\n\n }\n /*逻辑删除enable*/\n static final String DELETE_ENABLE = \"DELETE_ENABLE\";\n\n interface DELETEENABLE{\n\n /*已删除*/\n static final Integer DELETE = 0;\n\n /*未删除*/\n static final Integer UNDELE = 1;\n\n\n }\n /*适用范围 模板 通用,个人*/\n static final String SUIT_RANGE = \"SUIT_RANGE\";\n\n interface SUITRANGE{\n\n /*初始化状态*/\n static final String INIT = \"00\";\n\n /*通用*/\n static final String COMMON = \"01\";\n\n /*个人*/\n static final String PERSONAL = \"02\";\n\n\n }\n\n /*使用場景 01 平台 , 02 接口*/\n static final String USE_TYPE = \"USE_TYPE\";\n\n interface USETYPE{\n\n /*平台*/\n static final String PLTFC = \"01\";\n\n /*接口*/\n static final String INTFC = \"02\";\n }\n\n /* 提醒类型 */\n static final String REMIND_TYPE = \"REMIND_TYPE\";\n\n interface REMINDTYPE{\n /* 未知 */\n static final String UNKNOWN = \"00\";\n /* 短信数量 */\n static final String SMS_NUM = \"01\";\n /* 发送频率*/\n static final String SEND_RATE = \"02\";\n }\n\n /* 阈值类型 */\n static final String THRESHOLD_TYPE = \"THRESHOLD_TYPE\";\n\n interface THRESHOLDTYPE {\n /* 未知 */\n static final String UNKNOWN = \"00\";\n /* 小于 */\n static final String LESS_THAN = \"01\";\n /* 等于*/\n static final String EQUAL = \"02\";\n /* 大于*/\n static final String GREATER_THAN = \"03\";\n }\n\n /* 客户类型 */\n static final String CSTM_TYPE = \"CSTM_TYPE\";\n\n interface CSTMTYPE{\n /* 未知 */\n static final String UNKNOWN = \"00\";\n /* 个人 */\n static final String PERSON = \"01\";\n /* 企业*/\n static final String COMPANY = \"02\";\n }\n\n /* 支付状态 */\n static final String PAY_TYPE = \"PAY_TYPE\";\n\n interface PAYTYPE{\n /* 审核中 */\n static final String UNPAY = \"01\";\n /* 通过 */\n static final String PAY = \"02\";\n /* 驳回 */\n static final String REJECT = \"03\";\n /* 已取消 */\n static final String CANCEL = \"04\";\n }\n\n /* 任务状态 */\n static final String TASK_STATE = \"TASK_STATE\";\n\n interface TASKSTATE{\n /* 待发送 */\n static final String WAIT_SEND = \"01\";\n /* 已发送 */\n static final String SEND = \"02\";\n /* 成功 */\n static final String SUCCESS = \"03\";\n /* 失败 */\n static final String FAIL = \"04\";\n }\n\n /* 收款账户 */\n static final String PAY_ACCOUNT = \"PAY_ACCOUNT\";\n\n interface PAYACCOUNT{\n /* 个人账户 */\n static final String PRIVATE = \"01\";\n /* 对公账户 */\n static final String PUBLIC = \"02\";\n }\n\n}", "@Override\n public boolean isConstant() {\n return false;\n }", "public interface ValidationConstants {\n\n public int VALIDATION_FIELD_EMPTY = 1;\n public int VALIDATION_FIELD_INVALID = 2;\n\n /*** Regex ***/\n String REGEX_EMAIL_VALID = \"^[A-Z0-9a-z\\\\._%+-]+@([A-Za-z0-9-]+\\\\.)+[A-Za-z]{2,4}$\";\n\n}", "public abstract interface SummaryConstants\n{\n public static final Font FONT = new Font(\"Verdana\", 1, 12);\n public static final Color BACKGROUND_COLOR = new Color(205, 220, 242);\n public static final Color FOREGROUND_COLOR = new Color(6, 22, 157);\n}", "public interface KeyValueConstants {\n String HARDWARE_NAME = \"hardwareName\";\n String HARDWARE_TYPE = \"HardwareType\";\n String SOFTWARE_ID = \"SoftwareId\";\n String SOFTWARE_COUNT = \"SoftwareCount\";\n String SOFTWARE_DETAILS = \"SoftwareDetails\";\n String HARDWARE_TYPE_ID = \"Type\";\n String HARDWARE_TYPE_NAME = \"HardwareType\";\n String RESOURCE_NAME = \"ResourceName\";\n String RESOURCE_TYPE = \"ResourceType\";\n String ADMIN_NAME = \"AdminName\";\n String REQUESTED_ON=\"RequestedOn\";\n String REQUESTED_TILL=\"RequestedTill\";\n String MAC_ID = \"MacId\";\n String HARDWARE_BRAND = \"HardwareBrand\";\n String AVAILABILITY = \"Availablity\";\n String DESCRIPTION = \"Description\";\n String REQUESTED_BY = \"RequestedBy\";\n String USER_ID = \"UserId\";\n String REQUEST_ID = \"RequestId\";\n String HARDWARE_PENDING_REQUEST_OBJECT = \"hardwarePendingRequestObject\";\n String BRAND = \"Brand\";\n String MODEL = \"Model\";\n String HARDWARE_DETAILS = \"HardwareDetails\";\n String HARDWARE_ID = \"HardwareId\";\n String FIRST_NAME = \"FirstName\";\n String USER_NAME = \"UserName\";\n String FULLNAME = \"FullNAme\";\n String COUNT = \"Count\";\n String RESOURCE_CATEGORY = \"ResourceCategory\";\n String RESOURCE_CATEGORY_ID = \"ResourceCategoryId\";\n String REQUESTED_RESOURCE = \"RequestedResource\";\n String ASSIGNED_TO = \"AssignedTo\";\n String ASSIGNED_FROM_DATE = \"AssignedFromDate\";\n String ASSIGNED_TO_DATE = \"AssignedToDate\";\n String RESOURCE_TITLE = \"RequestTitle\";\n String REQUEST_STATUS = \"RequestStatus\";\n String LICENCE_KEY = \"LicenceKey\";\n String SOFTWARE_KEY_ID = \"SoftwareKeyId\";\n String ASSIGNED_BY = \"AssignedBy\";\n String RESOURCE_ID = \"ResourceId\";\n String ASSIGNED_ON = \"AssignedOn\";\n String SOFTWARE_TYPE = \"SoftwareType\";\n}", "public interface WebConstants {\n\n String REQUEST_ATTR_ORIGIN_IP = \"ORIGIN_IP\";\n\n String USER_LOGIN_STATUS = \"USER_LOGIN_STATUS\";\n}", "public interface Constants {\n String NA = \"NA\";\n}", "public interface Constants {\n int SERVER_PORT = 6001;\n String LOCALHOST = \"127.0.0.1\";\n\n String DEFAULT_PHONE_NUMBER = \"+380965354234\";\n\n}", "public interface TriggerUtilConstants {\n\n public static final int DEFAULT_MAX_BUFFERS = 1000;\n public static final int DEFAULT_BUFFER_BLEN = 32000;\n}", "protected NConstants() {\n }", "public Constant (int value){\r\n this.value = value;\r\n\r\n }", "public List<String> getConstants() {\n return constants;\n }", "@Override\n\tpublic InterpreteConstants constant() {\n\t\treturn null;\n\t}", "public interface Constants {\n\n String IMAGE_DOWNLOAD_LINK = \"http://appsculture.com/vocab/images/\";\n\n}" ]
[ "0.6867221", "0.6573128", "0.65363044", "0.652824", "0.65025616", "0.64590436", "0.64568365", "0.6435496", "0.64059865", "0.63642436", "0.6350485", "0.63494563", "0.63444763", "0.6335827", "0.63275915", "0.6306507", "0.62823", "0.62711716", "0.6259183", "0.62545323", "0.6253423", "0.6253423", "0.6250478", "0.62445205", "0.6243882", "0.6227674", "0.62200737", "0.6205265", "0.6189743", "0.6167453", "0.6132743", "0.6100308", "0.6078335", "0.6062351", "0.60409594", "0.6031664", "0.602935", "0.6028398", "0.6020394", "0.6016126", "0.6012288", "0.60018474", "0.59973586", "0.59939665", "0.5979804", "0.5977279", "0.5975687", "0.59639496", "0.5954853", "0.59458953", "0.5940539", "0.5929172", "0.5916979", "0.59142566", "0.5911643", "0.589504", "0.5889643", "0.58834314", "0.5877186", "0.5871048", "0.5868489", "0.586792", "0.58663976", "0.58657897", "0.58648854", "0.58592725", "0.5837263", "0.58352965", "0.5828793", "0.582833", "0.5822392", "0.5810745", "0.58034766", "0.5803237", "0.57961506", "0.57929176", "0.5789705", "0.5784333", "0.57837784", "0.5779284", "0.57675314", "0.57630277", "0.57618", "0.57465273", "0.5734835", "0.57292897", "0.572679", "0.572577", "0.5717582", "0.5706919", "0.5700978", "0.56992054", "0.56956077", "0.5679545", "0.56766206", "0.567053", "0.5665794", "0.5657144", "0.5637312", "0.5631634" ]
0.7478877
0
TODO Autogenerated method stub
public static void main(String[] args) { FileInputStream s=null; FileOutputStream b=null; byte buffer[]=new byte[1000]; int t; try{ s=new FileInputStream("dir/01.txt"); //用t来一个一个接受字节,每个汉字占2个字节。 /*while((t=s.read())!=-1) { System.out.println((char)t); }*/ b=new FileOutputStream("dir/02.txt"); //先放在缓存区里,然后一股脑儿输出 t=s.read(buffer,0,buffer.length); for(int i=0;i<buffer.length;i++) System.out.print((char)buffer[i]); b.write(buffer); } catch(IOException e){ System.out.println(e.getMessage()); } finally{ try{ s.close(); } catch(IOException e){ } try{ b.close(); } catch(IOException e){ } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.about, 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 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 // 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 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 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 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 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\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\n if (item.getItemId() == 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 // 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\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\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.7904975", "0.78056985", "0.77671826", "0.77275974", "0.7632173", "0.7622138", "0.75856143", "0.7531176", "0.7488386", "0.74576557", "0.74576557", "0.74391466", "0.7422802", "0.7403698", "0.7392229", "0.73873955", "0.73796785", "0.737091", "0.73627585", "0.7356357", "0.73460615", "0.73415256", "0.73305213", "0.7329754", "0.7326127", "0.731949", "0.73171073", "0.7314056", "0.7304481", "0.7304481", "0.73022866", "0.72986156", "0.7293808", "0.7287263", "0.72836643", "0.72815806", "0.72789687", "0.72602886", "0.72602886", "0.72602886", "0.7259816", "0.7259814", "0.72502047", "0.7225156", "0.7219905", "0.7217096", "0.72046524", "0.72012514", "0.7201042", "0.71939653", "0.71857035", "0.71786326", "0.7169012", "0.7167622", "0.7154164", "0.71538347", "0.7136608", "0.7135137", "0.7135137", "0.7129952", "0.7129347", "0.71241516", "0.7123588", "0.7123425", "0.71223265", "0.71175927", "0.71175927", "0.71175927", "0.71175927", "0.71171945", "0.71171755", "0.71165764", "0.7114952", "0.71124375", "0.7109778", "0.7109144", "0.7105842", "0.71002746", "0.70984215", "0.7096018", "0.709392", "0.709392", "0.70864546", "0.7083677", "0.708144", "0.70804363", "0.70738995", "0.7068429", "0.7061805", "0.7060801", "0.7060423", "0.7051581", "0.7037953", "0.7037953", "0.70359737", "0.7035605", "0.7035605", "0.7033388", "0.70312315", "0.7029681", "0.70192695" ]
0.0
-1
Handle navigation view item clicks here.
@SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.dashboard) { // Handle the camera action final List<ProjectsModel> storedProjectsModels = ProjectsModel.getAllProjects(); if (storedProjectsModels.size() > 0) { // means we have projects and need to show the dash board with the projects Intent i = new Intent(getApplication(), DashboardActivity.class); // moves to the fine aligment screen i.putExtra("projectId", storedProjectsModels.get(0).projectId); startActivity(i); } else { // means we don't have any projects and need to show the empty dashboard Intent i = new Intent(getApplication(), EmptyDashboardActivity.class); // moves to the fine aligment screen startActivity(i); } } else if (id == R.id.projects) { Intent i = new Intent(getApplication(), projectSelectionMainFragment.class); // moves to the fine aligment screen startActivity(i); } else if (id == R.id.news) { } else if (id == R.id.support) { } else if (id == R.id.tutorials) { } else if (id == R.id.about_section) { } else if (id == R.id.installationGuide) { Intent i = new Intent(getApplication(), InstallationGuideActivity.class); // moves to the fine aligment screen startActivity(i); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "void onDialogNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }", "@Override\r\n\tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n\t\tLog.d(\"SomeTag\", \"Get click event at position: \" + itemPosition);\r\n\t\tswitch (itemPosition) {\r\n\t\tcase 1:\r\n\t\t\tIntent i = new Intent();\r\n\t\t\ti.setClass(getApplicationContext(), MainActivity.class);\r\n\t\t\tstartActivity(i);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\tcase 2 :\r\n\t\t\tIntent intent = new Intent(this,WhiteListActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }", "@Override\n\tpublic void rightNavClick() {\n\t\t\n\t}", "@Override\n public void OnItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}", "@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\thandleClick(position);\n\t\t\t}", "@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }", "@Override\n public void onItemClick(int pos) {\n }", "@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }", "private void handleNavClick(View view) {\n final String label = ((TextView) view).getText().toString();\n if (\"Logout\".equals(label)) {\n logout();\n }\n if (\"Profile\".equals(label)) {\n final Intent intent = new Intent(this, ViewProfileActivity.class);\n startActivity(intent);\n }\n if (\"Search\".equals(label)){\n final Intent intent = new Intent(this, SearchActivity.class);\n startActivity(intent);\n }\n if (\"Home\".equals(label)) {\n final Intent intent = new Intent(this, HomeActivity.class);\n startActivity(intent);\n }\n }", "void onMenuItemClicked();", "@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}", "@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}", "@Override\n public void onItemClick(View view, String data) {\n }", "abstract public void onSingleItemClick(View view);", "@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }", "@Override\n public void itemClick(int pos) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n TextView textView = (TextView)view;\n switch(textView.getText().toString()){\n case \"NavBar\":\n Intent nav = new Intent(this, NavDrawerActivity.class);\n startActivity(nav);\n break;\n }\n\n //Toast.makeText(MainActivity.this,\"Go to \" + textView.getText().toString() + \" page.\",Toast.LENGTH_LONG).show();\n }", "@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onItemClick(Nson parent, View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }", "@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }", "@Override\n\t\tpublic void onClick(View view) {\n\t\t\tif (iOnItemClickListener != null) {\n\t\t\t\tiOnItemClickListener.onItemClick(view, null, getAdapterPosition());\n\t\t\t}\n\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "public void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n public void onItemOfListClicked(Object o) {\n UserProfileFragmentDirections.ActionUserProfileFragmentToEventProfileFragment action = UserProfileFragmentDirections.actionUserProfileFragmentToEventProfileFragment((MyEvent) o);\n navController.navigate(action);\n }", "@Override\n public void onClick(View view) {\n if(mFrom.equals(NetConstants.BOOKMARK_IN_TAB)) {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), NetConstants.G_BOOKMARK_DEFAULT,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n else {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), mFrom,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "void onLinkClicked(@Nullable ContentId itemId);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:\n Intent homeIntent = new Intent(this, MainActivity.class);\n startActivity(homeIntent);\n break;\n case R.id.send_email:\n Intent mailIntent = new Intent(this, ContactActivity.class);\n startActivity(mailIntent);\n break;\n case R.id.send_failure_ticket:\n Intent ticketIntent = new Intent(this, TicketActivity.class);\n startActivity(ticketIntent);\n break;\n case R.id.position:\n Intent positionIntent = new Intent(this, LocationActivity.class);\n startActivity(positionIntent);\n break;\n case R.id.author:\n UrlRedirect urlRed = new UrlRedirect(this.getApplicationContext(),getString(R.string.linkedinDeveloper));\n urlRed.redirect();\n break;\n default:\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main_activity);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@SuppressWarnings(\"ConstantConditions\")\n public void onItemClicked(@NonNull Item item) {\n getView().openDetail(item);\n }", "void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n startNavigation();\n }", "void onItemClick(int position);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_logs) {\n startActivity(new Intent(this, LogView.class));\n } else if (id == R.id.nav_signOut) {\n signOut();\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tpresenter.onItemClicked(position);\n\t}", "@Override\n public void onClick(View view) {\n listener.onMenuButtonSelected(view.getId());\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.addEventFragment);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "void clickItem(int uid);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_categories) {\n Intent intent = new Intent(getApplicationContext(), CategoryActivity.class);\n startActivity(intent, compat.toBundle());\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"category\");\n\n } else if (id == R.id.nav_top_headlines) {\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"home\");\n Intent intent = new Intent(getApplicationContext(), HomeActivity.class);\n startActivity(intent, compat.toBundle());\n } else if (id == R.id.nav_search) {\n // Do nothing\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }", "public void onItemClick(View view, int position) {\n\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}", "void onClick(View item, View widget, int position, int which);", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n Intent intent;\n switch(item.getItemId()){\n case R.id.nav_home:\n finish();\n intent = new Intent(this, NavigationActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_calendar:\n finish();\n intent = new Intent(this, EventHome.class);\n startActivity(intent);\n return true;\n case R.id.nav_discussion:\n return true;\n case R.id.nav_settings:\n intent = new Intent(this, SettingsActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_app_blocker:\n intent = new Intent(this, AppBlockingActivity.class);\n startActivity(intent);\n return true;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case R.id.nav_home:\n break;\n\n case R.id.nav_favourites:\n\n if (User.getInstance().getUser() == null) {\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }\n\n Intent intent = new Intent(getApplicationContext(), PlaceItemListActivity.class);\n startActivity(intent);\n\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonRgtRgtMenuClick(v);\n\t\t\t}", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "public void menuClicked(MenuItem menuItemSelected);", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}" ]
[ "0.7882029", "0.7235578", "0.6987005", "0.69458413", "0.6917864", "0.6917864", "0.6883472", "0.6875181", "0.68681556", "0.6766498", "0.67418456", "0.67207", "0.6716157", "0.6713947", "0.6698189", "0.66980195", "0.66793925", "0.66624063", "0.66595167", "0.6646381", "0.6641224", "0.66243863", "0.6624042", "0.66207093", "0.6602551", "0.6602231", "0.6599443", "0.65987265", "0.65935796", "0.6585869", "0.658491", "0.65811735", "0.65765643", "0.65751576", "0.65694076", "0.6561757", "0.65582377", "0.65581614", "0.6552827", "0.6552827", "0.6549224", "0.65389794", "0.65345114", "0.65337104", "0.652419", "0.652419", "0.6522521", "0.652146", "0.6521068", "0.6519354", "0.65165275", "0.65159816", "0.65028816", "0.6498054", "0.6498054", "0.64969087", "0.64937705", "0.6488544", "0.64867324", "0.64866185", "0.64865905", "0.6484047", "0.6481108", "0.6474686", "0.64628965", "0.64551884", "0.6446893", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64386237", "0.643595", "0.64356565", "0.64329195", "0.6432562", "0.6429554", "0.64255124", "0.64255124", "0.64121485", "0.64102405", "0.64095175", "0.64095175", "0.64094734", "0.640727", "0.64060104", "0.640229", "0.6397359", "0.6392996", "0.63921124", "0.63899696", "0.63885015", "0.63885015", "0.63873845", "0.6368818", "0.6368818", "0.63643163", "0.63643163", "0.63643163", "0.6358884" ]
0.0
-1
Creates a new instance of UndirectedEdge.
public UndirectedEdge(VType from, VType to) { // TODO: Add your code here super(from,to); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public UndirectedEdge() {\n \tthis(null,null);\n\t}", "@DisplayName(\"Add undirected edge\")\n @Test\n public void testAddEdgeUndirected() {\n graph.addEdge(new Edge(3, 4));\n List<Integer> l0 = new ArrayList<>();\n l0.add(0);\n List<Integer> l1 = new ArrayList<>();\n l1.add(4);\n Assertions.assertEquals(l0.get(0), graph.getNeighbours(4).get(0));\n Assertions.assertEquals(l1.get(0), graph.getNeighbours(0).get(0));\n }", "public Edge() {}", "public void makeUndirected(Position ep) throws InvalidPositionException;", "public void drawUndirectedEdge(String label1, String label2) {\n }", "public static GraphEdge createGraphEdgeForEdge() {\n GraphEdge graphEdge = new GraphEdge();\n\n for (int i = 0; i < 2; i++) {\n GraphNode childNode = new GraphNode();\n childNode.setPosition(AccuracyTestHelper.createPoint(20 * i, 10));\n childNode.setSize(AccuracyTestHelper.createDimension(40, 12));\n graphEdge.addContained(childNode);\n }\n graphEdge.addWaypoint(AccuracyTestHelper.createDiagramInterchangePoint(100, 100));\n graphEdge.addWaypoint(AccuracyTestHelper.createDiagramInterchangePoint(250, 200));\n\n // create a Relationship\n Relationship relationship = new IncludeImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(relationship);\n\n graphEdge.setSemanticModel(semanticModel);\n\n return graphEdge;\n }", "private Shape createEdge() {\n\t\tEdge edge = (Edge)shapeFactory.getShape(ShapeFactory.EDGE);\n\t\tEdgeLabel edgeLabel = (EdgeLabel) shapeFactory.getShape(ShapeFactory.EDGE_LABEL);\n\t\tedgeLabel.setEdge(edge);\n\t\tedge.setEdgeLabel(edgeLabel);\n\t\tshapes.add(edgeLabel);\n\t\tadd(edgeLabel);\n\t\treturn edge;\n\t}", "EdgeLayout createEdgeLayout();", "public void addUndirectedEdge(int v1, int v2) {\r\n addUndirectedEdge(v1, v2, null);\r\n }", "public Edge(int from, int to) {\n this(from, to, null);\n }", "Edge inverse() {\n return bond.inverse().edge(u, v);\n }", "Edge createEdge(Vertex src, Vertex tgt, boolean directed);", "public Edge()\r\n {\r\n }", "public void addUndirectedEdge(int v1, int v2) {\n addUndirectedEdge(v1, v2, null);\n }", "public void addUndirectedEdge(int v1, int v2) {\n addUndirectedEdge(v1, v2, null);\n }", "public DirectedEdge(int from, int to, double weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public WeightedEdge(){\n\t\t\n\t}", "Edge(Vertex u, Vertex v) {\n From = u;\n To = v;\n\n }", "public Edge()\n {\n start = -1;\n end = -1;\n capacity = -1;\n }", "public Builder() {\n this(Graphs.<N, E>createUndirected());\n }", "public Enumeration undirectedEdges();", "public HalfEdge(int q) { end = q; }", "public Edge(int start, int end, int weight) {\n this.start = start;\n this.end = end;\n this.weight = weight;\n }", "public Edge build() {\n Utilities.checkArgument(this.first != null, \"First vertex cannot be null\");\n Utilities.checkArgument(this.cost != null, \"Cost of edge cannot be null\");\n\n return new Edge(this.first, this.second, this.cost);\n }", "public Edge(Node from, Node to) {\n fromNode = from;\n toNode = to;\n }", "public void removeEdge(int start, int end);", "public Edge(){\n\t\tvertices = null;\n\t\tnext = this;\n\t\tprev = this;\n\t\tpartner = null;\n\t\tweight = 0;\n\t}", "public Builder clearEdge() {\n if (edgeBuilder_ == null) {\n edge_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n } else {\n edgeBuilder_.clear();\n }\n return this;\n }", "Edge(Node from,Node to, int length){\n this.source=from;\n this.destination=to;\n this.weight=length;\n }", "private AdjListEdge createEdge(Edge e) {\n\t\t// check if present\n\t\tif (edges.get(e.getIndex()) != null) return edges.get(e.getIndex());\n\t\t\n\t\tAdjListVertex uThis = vertices.get(e.getFirstVertex().getIndex());\n\t\tAdjListVertex vThis = vertices.get(e.getSecondVertex().getIndex());\n\t\tAdjListEdge eThis = new AdjListEdge(uThis, vThis, e.getIndex());\n\t\tedges.set(e.getIndex(), eThis);\n\t\tllEdges.add(eThis);\n\t\t\n\t\tnotifyEdgeCreated(eThis);\n\t\treturn eThis;\n\t}", "public Edge(int start, int end, int weight) {\n this.startVertex = start;\n this.endVertex = end;\n this.weight = weight;\n }", "public static <N, E> ImmutableUndirectedGraph<N, E> copyOf(UndirectedGraph<N, E> graph) {\n return new Builder<N, E>(graph).build();\n }", "public void addEdge(int u, int v, double w) {\n\t\t\n\t}", "protected Edge makeEdge(Node p_a, Node p_b) {\n\t\tif(!isDirectedGraph && p_a.hashCode() > p_b.hashCode()) {\n\t\t\treturn new Edge(p_b, p_a);\n\t\t} else {\n\t\t\treturn new Edge(p_a, p_b);\n\t\t}\n\t}", "public GraphEdge(GraphNode u, GraphNode v, char busLine) {\n\t\t\tstart = u;\t\t\t\n\t\t\tend = v;\n\t\t\tthis.busLine = busLine;\n\t\t}", "public void addEdge(int start, int end);", "public void makeEdge(char start,char end,int distance){\n\n Edge e = new Edge(start,end,distance);\n adjList[getIdx(start)].addFirst(e);\n //undirected graph add two edges in opposite direction\n e = new Edge(end,start,distance);\n adjList[getIdx(end)].addFirst(e);\n numEdges++;\n }", "@Override\n\tprotected Node newNode() {\n\t\treturn new SVGOMFETurbulenceElement();\n\t}", "public Edge revert (){\n\t\treturn new Edge(dst, src);\n\t}", "public Edge(int from, int to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public Edge(int from, int to, Integer weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public GraphEdge(GraphNode u, GraphNode v, char busLine){\r\n first = u;\r\n second = v;\r\n this.busLine = busLine;\r\n }", "TEdge createTEdge();", "public GraphEdge()\r\n {\r\n cost = 1.0;\r\n indexFrom = -1;\r\n indexTo = -1;\r\n }", "public static de.hpi.msd.salsa.serde.avro.Edge.Builder newBuilder(de.hpi.msd.salsa.serde.avro.Edge other) {\n return new de.hpi.msd.salsa.serde.avro.Edge.Builder(other);\n }", "private S2EdgeUtil() {}", "private void createNullVertex(int x, int y, DefaultGraphCell dad){\n\t\t\tDefaultGraphCell v = new DefaultGraphCell(\"\");\n\t\t\tnullnodes.add(v);\n\t\t\tDefaultPort port = new DefaultPort();\n\t\t\tv.add(port);\n\t\t\tport.setParent(v);\n\t\t\tint width = DEFAULT_NULL_SIZE.width;\n\t\t\tint height = DEFAULT_NULL_SIZE.height;\n\t\t\tGraphConstants.setBounds(v.getAttributes(), new\n\t\t\t\t\t Rectangle2D.Double(x-width/2,y,width,height));\n\t\t\tGraphConstants.setGradientColor(v.getAttributes(), Color.black);\n\t\t\tGraphConstants.setOpaque(v.getAttributes(), true);\n\t\t\tinsertEdge(getDefaultPort(dad), getDefaultPort(v));\n\t\t}", "@Override protected void onPreExecute() { g = new UndirectedGraph(10); }", "public ListenableUndirectedWeightedGraph(WeightedGraph<V, E> base)\r\n/* */ {\r\n/* 81 */ super((UndirectedGraph)base);\r\n/* */ }", "public static de.hpi.msd.salsa.serde.avro.Edge.Builder newBuilder() {\n return new de.hpi.msd.salsa.serde.avro.Edge.Builder();\n }", "public abstract void removeEdge(int from, int to);", "public Edge(Node from, Node to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public void addUndirectedEdge(int vertexOne, int vertexTwo) {\n\t\tGraphNode first = nodeList.get(vertexOne - 1);\n\t\tGraphNode second = nodeList.get(vertexTwo - 1);\n\t\tfirst.getNeighbors().add(second);//Neighbour of first is second. Store it.\n\t\tsecond.getNeighbors().add(first);//Neighbour of second is first. Store it.\n\t\tSystem.out.println(first.getNeighbors());\n\t\tSystem.out.println(second.getNeighbors());\n\t}", "@DisplayName(\"Delete undirected edges\")\n @Test\n public void testDeleteEdgeUndirected() {\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertEquals(1, graph.getNeighbours(0).size());\n Assertions.assertEquals(1, graph.getNeighbours(1).size());\n }", "private void constructMirrorEdge(Edge edge) {\n MirrorEdge mirrorEdge = new MirrorEdge();\n mirrorEdge.original = edge;\n mirrorEdge.source = edge.source();\n mirrorEdge.target = edge.target();\n directEdgeMap.put(edge, mirrorEdge);\n }", "public Edge(int w, int s, int e) {\n\t\tweight = w;\n\t\tstartVertex = s;\n\t\tendVertex = e;\n\t}", "public Edge(Edge other) {\n __isset_bitfield = other.__isset_bitfield;\n this.vertexOrigin = other.vertexOrigin;\n this.vertexDestiny = other.vertexDestiny;\n if (other.isSetDescription()) {\n this.description = other.description;\n }\n this.weight = other.weight;\n this.isDirected = other.isDirected;\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\r\n \tmyAdjLists[v1].add(new Edge(v1, v2, edgeInfo));\r\n \tmyAdjLists[v2].add(new Edge(v2, v1, edgeInfo));\r\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n //your code here\n \taddEdge(v1, v2, edgeInfo);\n \taddEdge(v2, v1, edgeInfo);\n \t\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "public void testAddEdge() {\n System.out.println(\"addEdge\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n graph.addVertex(new Integer(i));\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertTrue(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertFalse(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n }", "public Edge(int w, Object a, Object b){\n\t\tweight = w;\n\t\tvertices = new VertexPair(a, b);\n\t\tpartner = null;\n\t\tnext = this;\n\t\tprev = this;\n\t}", "private IEdge<S> createEdge(final S symbol_, final Integer state_)\n\t{\n\t\treturn new Edge<>(symbol_, state_);\n\t}", "@Override\n\tpublic Graph<String> emptyInstance() {\n\t\treturn new ConcreteEdgesGraph();\n\t}", "TripleGraph createTripleGraph();", "public static de.hpi.msd.salsa.serde.avro.Edge.Builder newBuilder(de.hpi.msd.salsa.serde.avro.Edge.Builder other) {\n return new de.hpi.msd.salsa.serde.avro.Edge.Builder(other);\n }", "public void addEdge(int start, int end, double weight);", "public HalfEdge(String s, int q) { label1 = s; end = q; }", "public Edge(Object vertex1, Object vertex2, int w){\n v1 = vertex1;\n v2 = vertex2;\n weight = w;\n }", "@Test\n public void testEdgeReverse() {\n Edge<Integer, String> target = new Edge<>(1, 2, \"hello\");\n Edge<Integer, String> reverse = target.reverse();\n assertNotNull(reverse);\n assertEquals(Integer.valueOf(2), reverse.getFrom());\n assertEquals(Integer.valueOf(1), reverse.getTo());\n }", "public Edge(wVertex argTarget, double argWeight) \r\n {\r\n target = argTarget;\r\n weight = argWeight;\r\n }", "protected EdgeView createEdgeView(Object cell) {\r\n \r\n \t\t\t\tif (cell instanceof Edge || cell instanceof JmtEdge) {\r\n \t\t\t\t\t// System.out.println(\"Lato personalizzato\");\r\n \t\t\t\t\treturn new JmtEdgeView(cell, mediator);\r\n \t\t\t\t} else {\r\n \t\t\t\t\treturn new JmtEdgeView(cell, mediator);\r\n \t\t\t\t}\r\n \t\t\t}", "public Node(Edge edge) {\n this.edge = edge;\n }", "public Edge3D(I3DVertex start, I3DVertex end) {\r\n\t\tthis.start = start;\r\n\t\tthis.end = end;\r\n\t}", "public Edge(Vertex in_pointOne, Vertex in_pointTwo){\n\t\tthis.pointOne = in_pointOne;\n\t\tthis.pointTwo = in_pointTwo;\n\t}", "public Edge getResidualEdge () {\r\n return new Edge(from,to,(capacity - flow));\r\n }", "public static void convertToWebgraphUndirected() {\n\t\tObjectArrayList<File> list = Utilities.getUndirectedGraphList(LoadMethods.ASCII);\n\t\tUtilities.outputLine(\"Converting \" + list.size() + \" undirected graphs...\", 1);\n\n\t\tint k = 0;\n\t\tfor (File f : list) {\n\t\t\t\n\t\t\tgraph.Undir g = Undir.load(f.getPath(), GraphTypes.ADJLIST, LoadMethods.ASCII);\n\t\t\tString output = \"Undirected/\" + f.getName();\n\n\t\t\tif (output.lastIndexOf('.') >= 0) {\n\t\t\t\toutput = output.substring(0, output.lastIndexOf('.'));\n\t\t\t}\n\t\t\tUtilities.output(++k + \" - \" + f.getPath(), 1);\n\t\t\tg.exportAsWebgraph(output);\n\t\t\tUtilities.outputLine(\" => \" + Utilities.webGraphPath + output, 1);\n\t\t}\n\t}", "public EdgeOperation(T t1, T t2) {\n\t\tthis.t1 = t1;\n\t\tthis.t2 = t2;\n\t}", "public Edge(Vertex<VV> from, Vertex<VV> to)\r\n {\r\n this.from = from;\r\n this.to = to;\r\n from.addEdge(this);\r\n to.addEdge(this);\r\n }", "private Class<?> unedge(Class<?> cls) {\n if (!Edge.class.isAssignableFrom(cls)) return cls;\n ParameterizedType edge = getEdgeType(cls);\n return getEdgeTypeArgument(edge);\n }", "private void addUndirectedEdge(int i, int j) {\n\t\tNode first = nodeList.get(i-1);\r\n\t\tNode second = nodeList.get(j-1);\r\n//\t\tSystem.out.println(first.name);\r\n//\t\tSystem.out.println(second.name);\r\n\t\tfirst.getNeighbors().add(second);//Neighbour of first is second. Store it.\r\n\t\tsecond.getNeighbors().add(first);\r\n\t}", "private Edge(String graphId, String id, short direction, Node start, Node end)\n\t\t\tthrows DisJException {\n\t\tthis(graphId, id, true, direction, IConstants.MSGFLOW_FIFO_TYPE, IConstants.MSGDELAY_LOCAL_FIXED,\n\t\t\t\tIConstants.MSGDELAY_SEED_DEFAULT, start, end);\n\t}", "public static void addEdge(int u, int v, int w){\n Edge obj1 = new Edge(v,w);\n Edge obj2 = new Edge(u,w);\n (adj.get(u)).add(obj1);\n (adj.get(v)).add(obj2);\n }", "public Edge(int i, int w) {\n\t\tthis.i = i;\n\t\tthis.w = i;\n\t}", "void removeEdge(int x, int y);", "DsmlNonUML createDsmlNonUML();", "public Edge(L source,L target,Integer weight) {\r\n \tsou=source;\r\n \ttar=target;\r\n \twei=weight;\r\n \tcheckRep();\r\n }", "public void crossEdge(Edge e) {}", "public\nNuc2D(NucNode nuc)\nthrows Exception\n{\n\tsuper (nuc);\n}", "public Edge(int x, int y) {\n\t\tsuper(x, y);\n\t\tthis.x2 = x;\n\t\tthis.y2 = y;\n\t}", "public Builder(GraphConfig config) {\n this(Graphs.<N, E>createUndirected(config));\n }", "public static Edge createEntity(EntityManager em) {\n Edge edge = new Edge()\n .description(DEFAULT_DESCRIPTION);\n // Add required entity\n Stone from = StoneResourceIntTest.createEntity(em);\n em.persist(from);\n em.flush();\n edge.setFrom(from);\n // Add required entity\n Stone to = StoneResourceIntTest.createEntity(em);\n em.persist(to);\n em.flush();\n edge.setTo(to);\n return edge;\n }", "public Edge(int sv, int dv, int d) // constructor\n {\n srcVert = sv;\n destVert = dv;\n distance = d;\n }", "public static void MakeDirectedNoCycle(graphUndir G) {\r\n\r\n\t\tfor (int i = 0; i < G.Adj.size(); i++) {\r\n\t\t\tG.Adj.elementAt(i).color = \"grey\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\t\t\tfor (int j = 0; j < G.Adj.elementAt(i).next.size(); j++) {\r\n\t\t\t\tif (G.Adj.elementAt(i).next.elementAt(j).color == \"white\") {\r\n\t\t\t\t\tG.Adj.elementAt(i).next.elementAt(j).color = \"grey\";\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).next.elementAt(j).color);\r\n\t\t\t\t} else if (G.Adj.elementAt(i).next.elementAt(j).color == \"black\") {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is rempved from \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).name);\r\n\t\t\t\t\tG.Adj.elementAt(i).next.remove(j);\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tG.Adj.elementAt(i).color = \"black\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\r\n\t\t}\r\n\r\n\t}", "public DirectedEdge(Graph g, Vertex v1, Vertex v2){\n\t\tsuper(g, v1, v2);\n\t\tthis.source = v1;\n\t}", "public Edge createEdge(String description, int sourceId, int destId, int weight) throws SQLException {\n\t\tVertex source = findVertById(sourceId);\n\t\tVertex destination = findVertById(destId);\n\t\tEdge newEdge = new Edge(description, weight, destination, source);\n\t\treturn rDb.createEdge(newEdge);\n\t}", "boolean addEdge(V v, V w);", "public Edge(int source, int dest, int weight){\n\t\tthis.source = source;\n\t\tthis.dest = dest;\n\t\tthis.weight = weight;\n\t}", "public Edge(DomainClass source, DomainClass target, EdgeType type, Direction direction) {\n this.source = source;\n this.target = target;\n this.type = type;\n this.direction = direction;\n }", "private Edge(int index1, int index2, float crease, boolean inFace) {\n this.index1 = index1;\n this.index2 = index2;\n this.crease = crease;\n this.inFace = inFace;\n }" ]
[ "0.82221264", "0.6145191", "0.5891266", "0.5799515", "0.57061917", "0.56973636", "0.5577595", "0.55174536", "0.5467738", "0.545049", "0.5446338", "0.54436636", "0.5440309", "0.54239744", "0.54239744", "0.5335314", "0.5321748", "0.5287859", "0.527644", "0.526134", "0.5233802", "0.52022797", "0.51970893", "0.51964784", "0.5177162", "0.5166006", "0.5153425", "0.51276153", "0.51166725", "0.50820214", "0.5071758", "0.5023997", "0.50044566", "0.49899232", "0.49871743", "0.49798942", "0.49708632", "0.49676192", "0.49552244", "0.49509352", "0.49499565", "0.4946318", "0.4946273", "0.49433362", "0.4910267", "0.49032292", "0.48903406", "0.48889378", "0.48722744", "0.48562366", "0.4838772", "0.48367286", "0.48338115", "0.48323247", "0.4824797", "0.48184228", "0.4806026", "0.48028558", "0.48012373", "0.4797621", "0.47943285", "0.47919682", "0.47604805", "0.4758063", "0.47540128", "0.4751521", "0.4739983", "0.47315902", "0.47270045", "0.47128275", "0.47012994", "0.4682625", "0.46810842", "0.4675785", "0.4671632", "0.4667923", "0.46517074", "0.46473053", "0.4646027", "0.46450692", "0.46395957", "0.46241605", "0.46124378", "0.46099874", "0.4606156", "0.460305", "0.4600627", "0.45995766", "0.45940176", "0.45908156", "0.45883113", "0.4586182", "0.45838633", "0.45797727", "0.4576966", "0.45747203", "0.45704564", "0.4570129", "0.4566432", "0.45612067" ]
0.6534788
1
Creates a new instance of UndirectedEdge.
public UndirectedEdge() { this(null,null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public UndirectedEdge(VType from, VType to) {\n\t\t// TODO: Add your code here\n\t\tsuper(from,to);\n\t}", "@DisplayName(\"Add undirected edge\")\n @Test\n public void testAddEdgeUndirected() {\n graph.addEdge(new Edge(3, 4));\n List<Integer> l0 = new ArrayList<>();\n l0.add(0);\n List<Integer> l1 = new ArrayList<>();\n l1.add(4);\n Assertions.assertEquals(l0.get(0), graph.getNeighbours(4).get(0));\n Assertions.assertEquals(l1.get(0), graph.getNeighbours(0).get(0));\n }", "public Edge() {}", "public void makeUndirected(Position ep) throws InvalidPositionException;", "public void drawUndirectedEdge(String label1, String label2) {\n }", "public static GraphEdge createGraphEdgeForEdge() {\n GraphEdge graphEdge = new GraphEdge();\n\n for (int i = 0; i < 2; i++) {\n GraphNode childNode = new GraphNode();\n childNode.setPosition(AccuracyTestHelper.createPoint(20 * i, 10));\n childNode.setSize(AccuracyTestHelper.createDimension(40, 12));\n graphEdge.addContained(childNode);\n }\n graphEdge.addWaypoint(AccuracyTestHelper.createDiagramInterchangePoint(100, 100));\n graphEdge.addWaypoint(AccuracyTestHelper.createDiagramInterchangePoint(250, 200));\n\n // create a Relationship\n Relationship relationship = new IncludeImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(relationship);\n\n graphEdge.setSemanticModel(semanticModel);\n\n return graphEdge;\n }", "private Shape createEdge() {\n\t\tEdge edge = (Edge)shapeFactory.getShape(ShapeFactory.EDGE);\n\t\tEdgeLabel edgeLabel = (EdgeLabel) shapeFactory.getShape(ShapeFactory.EDGE_LABEL);\n\t\tedgeLabel.setEdge(edge);\n\t\tedge.setEdgeLabel(edgeLabel);\n\t\tshapes.add(edgeLabel);\n\t\tadd(edgeLabel);\n\t\treturn edge;\n\t}", "EdgeLayout createEdgeLayout();", "public void addUndirectedEdge(int v1, int v2) {\r\n addUndirectedEdge(v1, v2, null);\r\n }", "public Edge(int from, int to) {\n this(from, to, null);\n }", "Edge inverse() {\n return bond.inverse().edge(u, v);\n }", "Edge createEdge(Vertex src, Vertex tgt, boolean directed);", "public Edge()\r\n {\r\n }", "public void addUndirectedEdge(int v1, int v2) {\n addUndirectedEdge(v1, v2, null);\n }", "public void addUndirectedEdge(int v1, int v2) {\n addUndirectedEdge(v1, v2, null);\n }", "public DirectedEdge(int from, int to, double weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public WeightedEdge(){\n\t\t\n\t}", "Edge(Vertex u, Vertex v) {\n From = u;\n To = v;\n\n }", "public Edge()\n {\n start = -1;\n end = -1;\n capacity = -1;\n }", "public Builder() {\n this(Graphs.<N, E>createUndirected());\n }", "public Enumeration undirectedEdges();", "public HalfEdge(int q) { end = q; }", "public Edge(int start, int end, int weight) {\n this.start = start;\n this.end = end;\n this.weight = weight;\n }", "public Edge build() {\n Utilities.checkArgument(this.first != null, \"First vertex cannot be null\");\n Utilities.checkArgument(this.cost != null, \"Cost of edge cannot be null\");\n\n return new Edge(this.first, this.second, this.cost);\n }", "public Edge(Node from, Node to) {\n fromNode = from;\n toNode = to;\n }", "public void removeEdge(int start, int end);", "public Edge(){\n\t\tvertices = null;\n\t\tnext = this;\n\t\tprev = this;\n\t\tpartner = null;\n\t\tweight = 0;\n\t}", "public Builder clearEdge() {\n if (edgeBuilder_ == null) {\n edge_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000002);\n onChanged();\n } else {\n edgeBuilder_.clear();\n }\n return this;\n }", "Edge(Node from,Node to, int length){\n this.source=from;\n this.destination=to;\n this.weight=length;\n }", "private AdjListEdge createEdge(Edge e) {\n\t\t// check if present\n\t\tif (edges.get(e.getIndex()) != null) return edges.get(e.getIndex());\n\t\t\n\t\tAdjListVertex uThis = vertices.get(e.getFirstVertex().getIndex());\n\t\tAdjListVertex vThis = vertices.get(e.getSecondVertex().getIndex());\n\t\tAdjListEdge eThis = new AdjListEdge(uThis, vThis, e.getIndex());\n\t\tedges.set(e.getIndex(), eThis);\n\t\tllEdges.add(eThis);\n\t\t\n\t\tnotifyEdgeCreated(eThis);\n\t\treturn eThis;\n\t}", "public Edge(int start, int end, int weight) {\n this.startVertex = start;\n this.endVertex = end;\n this.weight = weight;\n }", "public static <N, E> ImmutableUndirectedGraph<N, E> copyOf(UndirectedGraph<N, E> graph) {\n return new Builder<N, E>(graph).build();\n }", "public void addEdge(int u, int v, double w) {\n\t\t\n\t}", "protected Edge makeEdge(Node p_a, Node p_b) {\n\t\tif(!isDirectedGraph && p_a.hashCode() > p_b.hashCode()) {\n\t\t\treturn new Edge(p_b, p_a);\n\t\t} else {\n\t\t\treturn new Edge(p_a, p_b);\n\t\t}\n\t}", "public GraphEdge(GraphNode u, GraphNode v, char busLine) {\n\t\t\tstart = u;\t\t\t\n\t\t\tend = v;\n\t\t\tthis.busLine = busLine;\n\t\t}", "public void addEdge(int start, int end);", "public void makeEdge(char start,char end,int distance){\n\n Edge e = new Edge(start,end,distance);\n adjList[getIdx(start)].addFirst(e);\n //undirected graph add two edges in opposite direction\n e = new Edge(end,start,distance);\n adjList[getIdx(end)].addFirst(e);\n numEdges++;\n }", "@Override\n\tprotected Node newNode() {\n\t\treturn new SVGOMFETurbulenceElement();\n\t}", "public Edge revert (){\n\t\treturn new Edge(dst, src);\n\t}", "public Edge(int from, int to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public Edge(int from, int to, Integer weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public GraphEdge(GraphNode u, GraphNode v, char busLine){\r\n first = u;\r\n second = v;\r\n this.busLine = busLine;\r\n }", "TEdge createTEdge();", "public GraphEdge()\r\n {\r\n cost = 1.0;\r\n indexFrom = -1;\r\n indexTo = -1;\r\n }", "public static de.hpi.msd.salsa.serde.avro.Edge.Builder newBuilder(de.hpi.msd.salsa.serde.avro.Edge other) {\n return new de.hpi.msd.salsa.serde.avro.Edge.Builder(other);\n }", "private S2EdgeUtil() {}", "private void createNullVertex(int x, int y, DefaultGraphCell dad){\n\t\t\tDefaultGraphCell v = new DefaultGraphCell(\"\");\n\t\t\tnullnodes.add(v);\n\t\t\tDefaultPort port = new DefaultPort();\n\t\t\tv.add(port);\n\t\t\tport.setParent(v);\n\t\t\tint width = DEFAULT_NULL_SIZE.width;\n\t\t\tint height = DEFAULT_NULL_SIZE.height;\n\t\t\tGraphConstants.setBounds(v.getAttributes(), new\n\t\t\t\t\t Rectangle2D.Double(x-width/2,y,width,height));\n\t\t\tGraphConstants.setGradientColor(v.getAttributes(), Color.black);\n\t\t\tGraphConstants.setOpaque(v.getAttributes(), true);\n\t\t\tinsertEdge(getDefaultPort(dad), getDefaultPort(v));\n\t\t}", "@Override protected void onPreExecute() { g = new UndirectedGraph(10); }", "public ListenableUndirectedWeightedGraph(WeightedGraph<V, E> base)\r\n/* */ {\r\n/* 81 */ super((UndirectedGraph)base);\r\n/* */ }", "public static de.hpi.msd.salsa.serde.avro.Edge.Builder newBuilder() {\n return new de.hpi.msd.salsa.serde.avro.Edge.Builder();\n }", "public abstract void removeEdge(int from, int to);", "public Edge(Node from, Node to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public void addUndirectedEdge(int vertexOne, int vertexTwo) {\n\t\tGraphNode first = nodeList.get(vertexOne - 1);\n\t\tGraphNode second = nodeList.get(vertexTwo - 1);\n\t\tfirst.getNeighbors().add(second);//Neighbour of first is second. Store it.\n\t\tsecond.getNeighbors().add(first);//Neighbour of second is first. Store it.\n\t\tSystem.out.println(first.getNeighbors());\n\t\tSystem.out.println(second.getNeighbors());\n\t}", "@DisplayName(\"Delete undirected edges\")\n @Test\n public void testDeleteEdgeUndirected() {\n graph.deleteEdge(new Edge(0, 1));\n Assertions.assertEquals(1, graph.getNeighbours(0).size());\n Assertions.assertEquals(1, graph.getNeighbours(1).size());\n }", "private void constructMirrorEdge(Edge edge) {\n MirrorEdge mirrorEdge = new MirrorEdge();\n mirrorEdge.original = edge;\n mirrorEdge.source = edge.source();\n mirrorEdge.target = edge.target();\n directEdgeMap.put(edge, mirrorEdge);\n }", "public Edge(int w, int s, int e) {\n\t\tweight = w;\n\t\tstartVertex = s;\n\t\tendVertex = e;\n\t}", "public Edge(Edge other) {\n __isset_bitfield = other.__isset_bitfield;\n this.vertexOrigin = other.vertexOrigin;\n this.vertexDestiny = other.vertexDestiny;\n if (other.isSetDescription()) {\n this.description = other.description;\n }\n this.weight = other.weight;\n this.isDirected = other.isDirected;\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\r\n \tmyAdjLists[v1].add(new Edge(v1, v2, edgeInfo));\r\n \tmyAdjLists[v2].add(new Edge(v2, v1, edgeInfo));\r\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n //your code here\n \taddEdge(v1, v2, edgeInfo);\n \taddEdge(v2, v1, edgeInfo);\n \t\n }", "public void addUndirectedEdge(int v1, int v2, Object edgeInfo) {\n//your code here\n Edge edge1 = new Edge(v1, v2, edgeInfo);\n Edge edge2 = new Edge(v2, v1, edgeInfo);\n if(!adjLists[v1].contains(edge1)){\n adjLists[v1].addLast(edge1);\n }\n if(!adjLists[v2].contains(edge2)){\n adjLists[v2].addLast(edge2);\n }\n }", "public void testAddEdge() {\n System.out.println(\"addEdge\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n graph.addVertex(new Integer(i));\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertTrue(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertFalse(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n }", "public Edge(int w, Object a, Object b){\n\t\tweight = w;\n\t\tvertices = new VertexPair(a, b);\n\t\tpartner = null;\n\t\tnext = this;\n\t\tprev = this;\n\t}", "private IEdge<S> createEdge(final S symbol_, final Integer state_)\n\t{\n\t\treturn new Edge<>(symbol_, state_);\n\t}", "@Override\n\tpublic Graph<String> emptyInstance() {\n\t\treturn new ConcreteEdgesGraph();\n\t}", "TripleGraph createTripleGraph();", "public static de.hpi.msd.salsa.serde.avro.Edge.Builder newBuilder(de.hpi.msd.salsa.serde.avro.Edge.Builder other) {\n return new de.hpi.msd.salsa.serde.avro.Edge.Builder(other);\n }", "public void addEdge(int start, int end, double weight);", "public HalfEdge(String s, int q) { label1 = s; end = q; }", "public Edge(Object vertex1, Object vertex2, int w){\n v1 = vertex1;\n v2 = vertex2;\n weight = w;\n }", "@Test\n public void testEdgeReverse() {\n Edge<Integer, String> target = new Edge<>(1, 2, \"hello\");\n Edge<Integer, String> reverse = target.reverse();\n assertNotNull(reverse);\n assertEquals(Integer.valueOf(2), reverse.getFrom());\n assertEquals(Integer.valueOf(1), reverse.getTo());\n }", "public Edge(wVertex argTarget, double argWeight) \r\n {\r\n target = argTarget;\r\n weight = argWeight;\r\n }", "protected EdgeView createEdgeView(Object cell) {\r\n \r\n \t\t\t\tif (cell instanceof Edge || cell instanceof JmtEdge) {\r\n \t\t\t\t\t// System.out.println(\"Lato personalizzato\");\r\n \t\t\t\t\treturn new JmtEdgeView(cell, mediator);\r\n \t\t\t\t} else {\r\n \t\t\t\t\treturn new JmtEdgeView(cell, mediator);\r\n \t\t\t\t}\r\n \t\t\t}", "public Node(Edge edge) {\n this.edge = edge;\n }", "public Edge3D(I3DVertex start, I3DVertex end) {\r\n\t\tthis.start = start;\r\n\t\tthis.end = end;\r\n\t}", "public Edge(Vertex in_pointOne, Vertex in_pointTwo){\n\t\tthis.pointOne = in_pointOne;\n\t\tthis.pointTwo = in_pointTwo;\n\t}", "public Edge getResidualEdge () {\r\n return new Edge(from,to,(capacity - flow));\r\n }", "public static void convertToWebgraphUndirected() {\n\t\tObjectArrayList<File> list = Utilities.getUndirectedGraphList(LoadMethods.ASCII);\n\t\tUtilities.outputLine(\"Converting \" + list.size() + \" undirected graphs...\", 1);\n\n\t\tint k = 0;\n\t\tfor (File f : list) {\n\t\t\t\n\t\t\tgraph.Undir g = Undir.load(f.getPath(), GraphTypes.ADJLIST, LoadMethods.ASCII);\n\t\t\tString output = \"Undirected/\" + f.getName();\n\n\t\t\tif (output.lastIndexOf('.') >= 0) {\n\t\t\t\toutput = output.substring(0, output.lastIndexOf('.'));\n\t\t\t}\n\t\t\tUtilities.output(++k + \" - \" + f.getPath(), 1);\n\t\t\tg.exportAsWebgraph(output);\n\t\t\tUtilities.outputLine(\" => \" + Utilities.webGraphPath + output, 1);\n\t\t}\n\t}", "public EdgeOperation(T t1, T t2) {\n\t\tthis.t1 = t1;\n\t\tthis.t2 = t2;\n\t}", "public Edge(Vertex<VV> from, Vertex<VV> to)\r\n {\r\n this.from = from;\r\n this.to = to;\r\n from.addEdge(this);\r\n to.addEdge(this);\r\n }", "private Class<?> unedge(Class<?> cls) {\n if (!Edge.class.isAssignableFrom(cls)) return cls;\n ParameterizedType edge = getEdgeType(cls);\n return getEdgeTypeArgument(edge);\n }", "private void addUndirectedEdge(int i, int j) {\n\t\tNode first = nodeList.get(i-1);\r\n\t\tNode second = nodeList.get(j-1);\r\n//\t\tSystem.out.println(first.name);\r\n//\t\tSystem.out.println(second.name);\r\n\t\tfirst.getNeighbors().add(second);//Neighbour of first is second. Store it.\r\n\t\tsecond.getNeighbors().add(first);\r\n\t}", "private Edge(String graphId, String id, short direction, Node start, Node end)\n\t\t\tthrows DisJException {\n\t\tthis(graphId, id, true, direction, IConstants.MSGFLOW_FIFO_TYPE, IConstants.MSGDELAY_LOCAL_FIXED,\n\t\t\t\tIConstants.MSGDELAY_SEED_DEFAULT, start, end);\n\t}", "public static void addEdge(int u, int v, int w){\n Edge obj1 = new Edge(v,w);\n Edge obj2 = new Edge(u,w);\n (adj.get(u)).add(obj1);\n (adj.get(v)).add(obj2);\n }", "public Edge(int i, int w) {\n\t\tthis.i = i;\n\t\tthis.w = i;\n\t}", "void removeEdge(int x, int y);", "DsmlNonUML createDsmlNonUML();", "public Edge(L source,L target,Integer weight) {\r\n \tsou=source;\r\n \ttar=target;\r\n \twei=weight;\r\n \tcheckRep();\r\n }", "public void crossEdge(Edge e) {}", "public\nNuc2D(NucNode nuc)\nthrows Exception\n{\n\tsuper (nuc);\n}", "public Edge(int x, int y) {\n\t\tsuper(x, y);\n\t\tthis.x2 = x;\n\t\tthis.y2 = y;\n\t}", "public Builder(GraphConfig config) {\n this(Graphs.<N, E>createUndirected(config));\n }", "public static Edge createEntity(EntityManager em) {\n Edge edge = new Edge()\n .description(DEFAULT_DESCRIPTION);\n // Add required entity\n Stone from = StoneResourceIntTest.createEntity(em);\n em.persist(from);\n em.flush();\n edge.setFrom(from);\n // Add required entity\n Stone to = StoneResourceIntTest.createEntity(em);\n em.persist(to);\n em.flush();\n edge.setTo(to);\n return edge;\n }", "public Edge(int sv, int dv, int d) // constructor\n {\n srcVert = sv;\n destVert = dv;\n distance = d;\n }", "public static void MakeDirectedNoCycle(graphUndir G) {\r\n\r\n\t\tfor (int i = 0; i < G.Adj.size(); i++) {\r\n\t\t\tG.Adj.elementAt(i).color = \"grey\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\t\t\tfor (int j = 0; j < G.Adj.elementAt(i).next.size(); j++) {\r\n\t\t\t\tif (G.Adj.elementAt(i).next.elementAt(j).color == \"white\") {\r\n\t\t\t\t\tG.Adj.elementAt(i).next.elementAt(j).color = \"grey\";\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).next.elementAt(j).color);\r\n\t\t\t\t} else if (G.Adj.elementAt(i).next.elementAt(j).color == \"black\") {\r\n\t\t\t\t\tSystem.out\r\n\t\t\t\t\t\t\t.println(G.Adj.elementAt(i).next.elementAt(j).name\r\n\t\t\t\t\t\t\t\t\t+ \" is rempved from \"\r\n\t\t\t\t\t\t\t\t\t+ G.Adj.elementAt(i).name);\r\n\t\t\t\t\tG.Adj.elementAt(i).next.remove(j);\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tG.Adj.elementAt(i).color = \"black\";\r\n\t\t\tSystem.out.println(G.Adj.elementAt(i).name + \" is \"\r\n\t\t\t\t\t+ G.Adj.elementAt(i).color);\r\n\r\n\t\t}\r\n\r\n\t}", "public DirectedEdge(Graph g, Vertex v1, Vertex v2){\n\t\tsuper(g, v1, v2);\n\t\tthis.source = v1;\n\t}", "public Edge createEdge(String description, int sourceId, int destId, int weight) throws SQLException {\n\t\tVertex source = findVertById(sourceId);\n\t\tVertex destination = findVertById(destId);\n\t\tEdge newEdge = new Edge(description, weight, destination, source);\n\t\treturn rDb.createEdge(newEdge);\n\t}", "boolean addEdge(V v, V w);", "public Edge(int source, int dest, int weight){\n\t\tthis.source = source;\n\t\tthis.dest = dest;\n\t\tthis.weight = weight;\n\t}", "public Edge(DomainClass source, DomainClass target, EdgeType type, Direction direction) {\n this.source = source;\n this.target = target;\n this.type = type;\n this.direction = direction;\n }", "private Edge(int index1, int index2, float crease, boolean inFace) {\n this.index1 = index1;\n this.index2 = index2;\n this.crease = crease;\n this.inFace = inFace;\n }" ]
[ "0.6534788", "0.6145191", "0.5891266", "0.5799515", "0.57061917", "0.56973636", "0.5577595", "0.55174536", "0.5467738", "0.545049", "0.5446338", "0.54436636", "0.5440309", "0.54239744", "0.54239744", "0.5335314", "0.5321748", "0.5287859", "0.527644", "0.526134", "0.5233802", "0.52022797", "0.51970893", "0.51964784", "0.5177162", "0.5166006", "0.5153425", "0.51276153", "0.51166725", "0.50820214", "0.5071758", "0.5023997", "0.50044566", "0.49899232", "0.49871743", "0.49798942", "0.49708632", "0.49676192", "0.49552244", "0.49509352", "0.49499565", "0.4946318", "0.4946273", "0.49433362", "0.4910267", "0.49032292", "0.48903406", "0.48889378", "0.48722744", "0.48562366", "0.4838772", "0.48367286", "0.48338115", "0.48323247", "0.4824797", "0.48184228", "0.4806026", "0.48028558", "0.48012373", "0.4797621", "0.47943285", "0.47919682", "0.47604805", "0.4758063", "0.47540128", "0.4751521", "0.4739983", "0.47315902", "0.47270045", "0.47128275", "0.47012994", "0.4682625", "0.46810842", "0.4675785", "0.4671632", "0.4667923", "0.46517074", "0.46473053", "0.4646027", "0.46450692", "0.46395957", "0.46241605", "0.46124378", "0.46099874", "0.4606156", "0.460305", "0.4600627", "0.45995766", "0.45940176", "0.45908156", "0.45883113", "0.4586182", "0.45838633", "0.45797727", "0.4576966", "0.45747203", "0.45704564", "0.4570129", "0.4566432", "0.45612067" ]
0.82221264
0
Returns the source of that edge.
@Override public VType getSource() { // TODO: Add your code here return super.from; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Vertex getSource() {\n return source;\n }", "@Override\n public Vertex getSource() {\n return sourceVertex;\n }", "ElementCircuit getSource();", "public Node getSource() {\n return this.source;\n }", "public Node source() {\n\t\treturn _source;\n\t}", "public EndpointID source() {\r\n\t\treturn source_;\r\n\t}", "public Node source() {\n return source;\n }", "public URI getSource() {\n return source;\n }", "public Object getSource() {\n\t\treturn source;\n\t}", "public Object getSource() {\n\t\treturn source;\n\t}", "@Override\n\tpublic Square getSource() {\n\t\treturn (Square) super.getSource();\n\t}", "public TCSObjectReference<Point> getSourcePoint() {\n if (hops.isEmpty()) {\n return null;\n }\n else {\n return hops.get(0);\n }\n }", "public String getSourceNode() {\n return sourceNode;\n }", "@Override\n\tpublic EList<SourceRef> getSource() {\n\t\treturn adaptee.getSource();\n\t}", "public Object getSource() {\n return source;\n }", "Node getSourceNode();", "public Object getSource() {return source;}", "public static Shape findSourceShape(Edge edge) {\n\t\tShape shape = null;\n\t\tEdge currentEdge = edge;\n\t\twhile (shape == null) {\n\t\t\tif (currentEdge.getSource() instanceof JoinPoint) {\n\t\t\t\tcurrentEdge = (Edge) ((JoinPoint)currentEdge.getSource()).getSource();\n\t\t\t} else {\n\t\t\t\tshape = currentEdge.getSource();\n\t\t\t}\n\t\t}\n\t\treturn shape;\n\t}", "public Object getSource()\n {\n return this;\n }", "public Object getSource()\n {\n return this;\n }", "public String getSource() {\n\t\treturn (String) _object.get(\"source\");\n\t}", "public SourceIF source() {\n\t\treturn this.source;\n\t}", "public String getSource() {\n return mSource;\n }", "public String getSource() {\n return this.source;\n }", "public int getSource() {\n\t\treturn source;\n\t}", "public ContractionVertex<RoadNode> getSourceCHNode() {\r\n return sourceCHNode;\r\n }", "public Town getSource() {\r\n\t\treturn this.source;\r\n\t}", "protected Source getSource() {\r\n return source;\r\n }", "public String getSource() {\r\n return Source;\r\n }", "public int getSource(){\r\n\t\treturn this.source;\r\n\t}", "public IEventCollector getSource();", "final RenderedImage getSource() {\n return sources[0];\n }", "public HarvestSource getSource() {\n\t\treturn source;\n\t}", "public Object getSource() { return this.s; }", "public String getSource(){\n\t\treturn source.getEvaluatedValue();\n\t}", "public OMCollection getSource() {\r\n return IServer.associationHasSource().dr(this).range();\r\n }", "public Byte getSource() {\r\n return source;\r\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\r\n return source;\r\n }", "public abstract Object getSource();", "public T getSource() {\n return source;\n }", "public String getSource() {\n Object ref = source_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n source_ = s;\n }\n return s;\n }\n }", "public Uri getSourceUri() {\n return sourceUri;\n }", "public String getSource() {\n\t\treturn this.uri.toString();\n\t}", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public String getSource() {\n return source;\n }", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n }\n }", "@Override\n \tpublic String getSource() {\n \t\tif (super.source != refSource) {\n \t\t\tif (refSource == null) {\n \t\t\t\trefSource = super.source;\n \t\t\t} else {\n \t\t\t\tsuper.source = refSource;\n \t\t\t}\n \t\t}\n \t\treturn refSource;\n \t}", "public Actor getSource()\r\n\t{\r\n\t\treturn sourceActor;\t\r\n\t}", "@objid (\"4e37aa68-c0f7-4404-a2cb-e6088f1dda62\")\n Instance getSource();", "public abstract Source getSource();", "public String getSource() {\n\n return source;\n }", "public String getSource() {\n Object ref = source_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n source_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }", "public String getSource();", "@java.lang.Override\n public java.lang.String getSource() {\n java.lang.Object ref = source_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n source_ = s;\n return s;\n }\n }", "public edu.umich.icpsr.ddi.FileTxtType.Source.Enum getSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_default_attribute_value(SOURCE$30);\n }\n if (target == null)\n {\n return null;\n }\n return (edu.umich.icpsr.ddi.FileTxtType.Source.Enum)target.getEnumValue();\n }\n }", "public noNamespace.SourceType getSource()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n noNamespace.SourceType target = null;\r\n target = (noNamespace.SourceType)get_store().find_element_user(SOURCE$0, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target;\r\n }\r\n }", "@Override\r\n\tpublic E getSingleSourcePredecessor(E key) {\r\n\t\tif(containsVertex(key) && vertices.get(key).getPredecessor() != null) {\r\n\t\t\treturn vertices.get(key).getPredecessor().getElement();\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "State getSource();", "public String getSourceFigNodeId() {\n return sourceFigNodeId;\n }", "public Object getSourceReference() { return this._sourceRef; }", "public Optional<String> getSource() {\n\t\treturn Optional.ofNullable(_source);\n\t}", "public edu.umich.icpsr.ddi.FileTxtType.Source xgetSource()\n {\n synchronized (monitor())\n {\n check_orphaned();\n edu.umich.icpsr.ddi.FileTxtType.Source target = null;\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_store().find_attribute_user(SOURCE$30);\n if (target == null)\n {\n target = (edu.umich.icpsr.ddi.FileTxtType.Source)get_default_attribute_value(SOURCE$30);\n }\n return target;\n }\n }", "public Edge getEdgeReference(Node sourceNode) {\r\n\t\t\t\r\n\t\tEdge edgeReference = null;\r\n\t\tfor (Edge to: edges)\r\n\t\t{\r\n\t\t\tif (to.getDestinationNode().getLabel().equals(sourceNode.getLabel()))\r\n\t\t\t{\r\n\t\t\t\tedgeReference = to;\r\n\t\t\t\tbreak;\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn edgeReference;\r\n\t}", "public Edge<V> getEdge(V source, V target);", "public String getSource ();", "public Widget getSource() {\n\t\treturn _source;\n\t}", "String getSource();", "public Vertex getFrom() {\r\n\r\n return from;\r\n }", "Edge getEdge();", "public NativeEntity getSourceEntity() \n\t{\n\treturn fSource;\n\t}", "@OutVertex\n ActionTrigger getSource();", "public StrColumn getSource() {\n return delegate.getColumn(\"source\", DelegatingStrColumn::new);\n }", "@Override\n\tpublic String getSource() {\n\t\treturn source;\n\t}", "public java.lang.String getSource() {\r\n return localSource;\r\n }", "public String getSource(){\r\n\t\treturn selectedSource;\r\n\t}", "public InteractionSource getSource ();", "public BufferedImage getSourceImage() { \r\n return m_source;\r\n }", "public long getSource()\r\n { return src; }", "@Override\n public edge_data getEdge(int src, int dest) {\n if (!nodes.containsKey(src)) return null;\n node_data sourceNode = nodes.get(src);\n return ((NodeData) sourceNode).getEdge(dest);\n }", "@Override\n public String getSource() {\n return this.src;\n }", "@Override\n public abstract SourcePoint getSourcePoint();", "public String getSource() {\n return JsoHelper.getAttribute(jsObj, \"source\");\n }", "public File getSource() {\n return source;\n }", "public String getSource() {\n/* 312 */ return getValue(\"source\");\n/* */ }", "public String get_source() {\n\t\treturn source;\n\t}", "java.lang.String getAssociatedSource();", "java.lang.String getSource();", "java.lang.String getSource();", "public Mat getSource() {\n return this.source;\n }", "public String getSourceAttribute() {\n return sourceAttribute;\n }", "public Element lookupSourceOrOutput()\n {\n for (Element e: Element.values())\n if (e.sourceOf == this || this.sourceOf == e)\n return e;\n\n return null;\n }", "private Edge getKernelEdge(Edge edge){\n\t\tif (edge.getGraph() != null && (edge.getGraph().isLhs() || edge.getGraph().isRhs())) {\n\t\t\tRule rule = edge.getGraph().getRule();\n\t\t\treturn rule.getMultiMappings().getOrigin(edge);\n\t\t}\n\t\treturn null;\n\t}", "@java.lang.Override\n public com.google.protobuf.ByteString\n getSourceBytes() {\n java.lang.Object ref = source_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n source_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public FVEventHandler getSrc() {\n\t\treturn src;\n\t}", "public com.google.protobuf.ByteString\n getSourceBytes() {\n Object ref = source_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b =\n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n source_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }", "public com.google.protobuf.ByteString\n getSourceBytes() {\n java.lang.Object ref = source_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n source_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }" ]
[ "0.76032174", "0.7363153", "0.7307688", "0.72457063", "0.70245206", "0.69584423", "0.68928695", "0.6882938", "0.68238354", "0.68238354", "0.6806287", "0.6805406", "0.67674124", "0.6759237", "0.67475283", "0.6736403", "0.6714401", "0.6610855", "0.6603948", "0.6603948", "0.6601446", "0.65620506", "0.65540785", "0.65185297", "0.64920837", "0.6488453", "0.6469949", "0.6467136", "0.64668334", "0.6447874", "0.64473593", "0.64370227", "0.64363176", "0.64359045", "0.64295566", "0.6420739", "0.6415879", "0.6413004", "0.6410965", "0.6410513", "0.6409239", "0.64005166", "0.6379243", "0.6374068", "0.63680524", "0.63680524", "0.63680524", "0.6355685", "0.63471484", "0.63433367", "0.63352424", "0.63226247", "0.6318147", "0.6314767", "0.62850374", "0.62850374", "0.6281299", "0.6276046", "0.6273992", "0.62637407", "0.6253601", "0.62518936", "0.6243857", "0.62426287", "0.6211768", "0.6208266", "0.6206838", "0.62061507", "0.6190684", "0.6176603", "0.61645454", "0.61410457", "0.6137952", "0.6133386", "0.6129133", "0.6124201", "0.6117411", "0.61127627", "0.61117446", "0.61019284", "0.6094615", "0.60929877", "0.6087464", "0.6080953", "0.6077051", "0.6071922", "0.60669893", "0.60643524", "0.60278296", "0.60260504", "0.59986365", "0.59986365", "0.5998414", "0.59973365", "0.599388", "0.59870034", "0.59869766", "0.5975291", "0.59689426", "0.59585345" ]
0.61913276
68
Returns the target of that edge
@Override public VType getTarget() { // TODO: Add your code here return super.to; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@InVertex\n Object getTarget();", "public Node getTarget() {\n return target;\n }", "public Point getTarget()\n\t{\n\t\treturn this.target;\n\t}", "@Override\n public Vertex getTarget() {\n return targetVertex;\n }", "public Point getTarget() {\n\t\treturn _target;\n\t}", "public DNode getTo() { return targetnode; }", "public Node target() {\n return target;\n }", "public Spatial getTarget() {\r\n return target;\r\n }", "public AstNode getTarget() {\n return target;\n }", "N getTarget();", "public EntityID getTarget() {\n\t\treturn target.getValue();\n\t}", "public Living getTarget();", "Object getTarget();", "Object getTarget();", "public Contig getTarget() { return target; }", "public Object getTarget()\n {\n return __m_Target;\n }", "public String getTarget()\r\n\t{\r\n\t\treturn _target;\r\n\t}", "Attribute getTarget();", "public Edge<V> getEdge(V source, V target);", "public Target getTarget() {\n\t\treturn target;\n\t}", "public Target getTarget() {\n\t\treturn target;\n\t}", "public Target getTarget() {\n\t\treturn target;\n\t}", "public Target getTarget() {\n return target;\n }", "TrgPlace getTarget();", "public String getTarget() {\n return this.target;\n }", "State getTarget();", "String getTarget() {\r\n return this.target;\r\n }", "String getTarget();", "String getTarget();", "public Target getTarget() {\n\n return target;\n }", "public String getTarget() {\n return target;\n }", "public String getTarget() {\n return target;\n }", "public Entity getmTarget() {\n return mTarget;\n }", "public ObjectSequentialNumber getTarget() {\n return target;\n }", "public ContractionVertex<RoadNode> getTargetCHNode() {\r\n return targetCHNode;\r\n }", "public EObject getTarget() {\n\t\treturn adaptee.getTarget();\n\t}", "public OMCollection getTarget() {\r\n return IServer.associationHasTarget().dr(this).range();\r\n }", "public GameEntity getTarget() {\r\n\t\tif(mode == RadarMode.LOCKED) return currentTarget; else return null;\r\n\t}", "@objid (\"19651663-f981-4f11-802a-d5d7cbd6f88a\")\n Instance getTarget();", "public DvEHRURI getTarget() {\n return target;\n }", "public com.commercetools.api.models.common.Reference getTarget() {\n return this.target;\n }", "public Mob getTarget() {\r\n return target.get();\r\n }", "int getTargetPos();", "public Player getTarget() {\n return target;\n }", "public java.lang.String getTarget() {\n return target;\n }", "public Object getDestination() {\n/* 339 */ return this.peer.getTarget();\n/* */ }", "Edge getEdge();", "public Town getTargetVertex(Town sourceVertex) {\r\n\t\tfor(Town town: vertices) {\r\n\t\t\tif(!town.equals(sourceVertex)) {\r\n\t\t\t\treturn town;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public Name getTarget() {\n\t\treturn getSingleName();\n\t}", "java.lang.String getTarget();", "java.lang.String getTarget();", "public double getTargetNodeFlow(){\n return this.targetNodeFlow;\n }", "public StateID GetTarget()\n {\n return targetID;\n }", "private Edge getKernelEdge(Edge edge){\n\t\tif (edge.getGraph() != null && (edge.getGraph().isLhs() || edge.getGraph().isRhs())) {\n\t\t\tRule rule = edge.getGraph().getRule();\n\t\t\treturn rule.getMultiMappings().getOrigin(edge);\n\t\t}\n\t\treturn null;\n\t}", "public int getTargetPos() {\n return targetPos_;\n }", "public int getTargetPos() {\n return targetPos_;\n }", "public synchronized double getTarget()\n {\n final String funcName = \"getTarget\";\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.API);\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.API, \"=%f\", setPoint);\n }\n\n return setPoint;\n }", "com.google.protobuf.ByteString getTargetBytes();", "public TargetEight targetEight() {\n if (_targetEight == null)\n _targetEight = new TargetEight(this, Keys.SOURCE_EIGHT__FK_SOURCE_EIGHT_TARGET);\n\n return _targetEight;\n }", "public RaceCar getTarget() {\n return target;\n }", "public Entity.ID getTargetID() {\n return targetID;\n }", "public String getAbstractTarget(int targetId) {\r\n \tString abs = \"\";\r\n \tfor (String edge :jungCompleteGraph.getOutEdges(targetId)){\r\n \t\t\tif(edge.contains(\"http://dbpedia.org/ontology/abstract\")){\r\n \t\t\t\tabs = getURI(jungCompleteGraph.getDest(edge)); \r\n \t\t\t}\r\n \t\t}\r\n \treturn abs;\r\n }", "public Edge<E, V> getUnderlyingEdge();", "LabeledEdge getLabeledEdge();", "private Point getEnd() {\n if (goal == null) {\n if (target == null) {\n return null;\n }\n return target.getPosition();\n } else {\n return goal;\n }\n }", "public ReferenceType getTargetElement();", "private Target getTarget() {\n Address targetAddress = GenericAddress.parse(mIp);\n CommunityTarget target = new CommunityTarget();\n target.setCommunity(new OctetString(mCommunity));\n target.setAddress(targetAddress);\n target.setRetries(2);\n target.setTimeout(15000);\n target.setVersion(mVersion);\n return target;\n }", "public long getTargetId() {\n return targetId;\n }", "private Vector2 findTarget() \r\n\t{\r\n\t\tVector2 tempVector = new Vector2(1,1);\r\n\t\ttempVector.setLength(Constants.RANGEDSPEED); //TODO make so it can be changed when level difficulty increases\r\n\t\ttempVector.setAngle(rotation + 90);\r\n\t\treturn tempVector;\r\n\t}", "public Integer getTargetID()\r\n\t\t{ return mapping.getTargetId(); }", "E getEdge(int id);", "public Long getTargetId() {\r\n return targetId;\r\n }", "public T getOffspring(T target) {\r\n if (target == tree[0]) {\r\n return null;\r\n }\r\n\r\n int tarIndex = (getIndex(target) - 1) / 2;\r\n try {\r\n return tree[tarIndex];\r\n }\r\n catch (ElementNotFoundException exception) {\r\n System.out.println(\"The parent does not exist\");\r\n return null;\r\n }\r\n }", "public Integer getTargetId() {\n\t\treturn targetId;\n\t}", "public int getTargetArgIndex() {\n\t\treturn this.targetArgIndex;\n\t}", "public Object getTarget() {\n return this.endpoints;\n }", "public double getTargetX() {\n return m_targetX;\n }", "public PhineasHoverListener getInnerListener()\n\t{\n\t\treturn target;\n\t}", "public Object getTargetObject() {\n return targetObject;\n }", "private mxCell getEdge(Microtuble m){\n\t\tmxCell edge = null;\n\t\tfor (mxCell cell : graph.getEdgeToCellMap().values()){\n\t\t\tMicrotuble mt = (Microtuble) cell.getValue();\n\t\t\tif (mt.equals(m)){\n\t\t\t\tedge = cell;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn edge;\n\t}", "public Node getTargetSpace()\n {\n return _targetSpace;\n }", "public static String getSingleTarget(PathConnectionType element, String elementName)\n\t{\n\t\tStringBuilder error = new StringBuilder(); \n\t\tboolean hasError = false;\n\t\tString target = null; \n\t\t\n\t\tif (element.getTarget() == null){\n\t\t\terror.append(elementName + \" (\"+ element.getId() + \") must have a Target attribute\").append(\"\\n\"); \n\t\t\thasError = true; \n\t\t}\n\t\telse if (element.getTarget().size() < 1)\n\t\t{\n\t\t\terror.append(elementName + \" (\"+ element.getId() + \") must have a single target\").append(\"\\n\"); \n\t\t\thasError = true; \n\t\t\t \n\t\t}\n\t\telse if (element.getTarget().size() > 1)\n\t\t{\n\t\t\terror.append(elementName + \" (\"+ element.getId() + \") cannot have more than one target\").append(\"\\n\"); \n\t\t\thasError = true; \n\t\t\t \n\t\t}\n\t\telse\n\t\t{\t\n\t\t\ttarget = ((ScenarioElementType) element.getTarget().get(0)).getId();\n\t\t\tif (checkForMultipleIDs(target) == false)\n\t\t\t{\n\t\t\t\terror.append(elementName + \" (\"+ element.getId() + \") has multiple targets \" + target).append(\"\\n\"); \n\t\t\t\thasError = true; \n\t\t\t}\n\t\t}\n\t\t\n\t\tif (hasError){\n\t\t\tSystem.out.println(error.toString()); \n\t\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn target; \n\t\t}\n\t}", "private Target getMatchingTarget(Element targetElement)\n {\n String targetName = targetElement.getAttribute(\"name\").getValue();\n\n for (Target target : targets)\n {\n String label = target.getName();\n\n if (label.equals(targetName))\n {\n return target;\n }\n }\n\n return null;\n }", "String targetGraph();", "public Integer getCurrentTarget()\n\t{\n\t\treturn _currentTarget;\n\t}", "public static Shape findDestShape(Edge edge) {\n\t\tShape shape = null;\n\t\tEdge currentEdge = edge;\n\t\twhile (shape == null) {\n\t\t\tif (currentEdge.getDest() instanceof JoinPoint) {\n\t\t\t\tcurrentEdge = (Edge) ((JoinPoint)currentEdge.getDest()).getDest();\n\t\t\t} else {\n\t\t\t\tshape = currentEdge.getDest();\n\t\t\t}\n\t\t}\n\t\treturn shape;\n\t}", "public String targetId() {\n return this.targetId;\n }", "public Edge getEdge(int source, int dest) {\r\n Edge target =\r\n new Edge(source, dest, Double.POSITIVE_INFINITY);\r\n for (Edge edge : edges[source]) {\r\n if (edge.equals(target))\r\n return edge; // Desired edge found, return it.\r\n }\r\n return target; // Desired edge not found.\r\n }", "Target target();", "IfcCartesianTransformationOperator getMappingTarget();", "public Balloon acquireTarget() {\r\n\r\n\t\tBalloon closest = null;\r\n\t\tfloat closestDistance = 1000;\r\n\t\tif (balloons != null) {\r\n\t\t\tfor (Balloon balloons : balloons) {\r\n\t\t\t\tif (isInRange(balloons) && findDistance(balloons) < closestDistance && balloons.getHiddenHealth() > 0) {\r\n\t\t\t\t\tclosestDistance = findDistance(balloons);\r\n\t\t\t\t\tclosest = balloons;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (closest != null) {\r\n\t\t\t\ttargeted = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn closest;\r\n\r\n\t}", "public V getDestination() {\r\n\r\n\t\tV result = null;\r\n\t\tif ((counter <= links.size()) && (counter > 0)) {\r\n\t\t\tresult = succNodes.get(counter - 1);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public String getTarget() {\n return JsoHelper.getAttribute(jsObj, \"target\");\n }", "Variable getTargetVariable();", "public double getEdge()\n {\n return this.edge;\n }", "VertexType getOtherVertexFromEdge( EdgeType r, VertexType oneVertex );", "@OutVertex\n ActionTrigger getSource();", "public TCSObjectReference<Point> getDestinationPoint() {\n if (hops.isEmpty()) {\n return null;\n }\n else {\n return hops.get(hops.size() - 1);\n }\n }", "Ontology getTargetOntology();", "protected Edge getEdge() {\r\n\t\treturn (Edge)getModel();\r\n\t}" ]
[ "0.7486547", "0.7331168", "0.72561705", "0.7140433", "0.7139151", "0.7121221", "0.70727557", "0.7006426", "0.70053166", "0.6969802", "0.6966144", "0.68603367", "0.68185073", "0.68185073", "0.68182206", "0.6701767", "0.66977435", "0.66961765", "0.66944987", "0.66940075", "0.66940075", "0.66940075", "0.6640726", "0.6637249", "0.66358453", "0.6626138", "0.65573466", "0.6544402", "0.6544402", "0.6539556", "0.6539514", "0.6539514", "0.6519093", "0.6516391", "0.6512649", "0.6492367", "0.64611924", "0.64518255", "0.64447016", "0.6420307", "0.63980776", "0.6394346", "0.635725", "0.6336987", "0.62558526", "0.62533844", "0.6245815", "0.6227266", "0.6217406", "0.62163496", "0.62163496", "0.617053", "0.61573315", "0.61569905", "0.6156289", "0.61488795", "0.6096355", "0.60611516", "0.6060753", "0.6036116", "0.6031782", "0.60109293", "0.59833705", "0.59822387", "0.59600997", "0.59136516", "0.5892479", "0.5891882", "0.5890306", "0.58858895", "0.5877249", "0.5866122", "0.5863509", "0.58549196", "0.5846077", "0.5842762", "0.5835321", "0.5818174", "0.58067954", "0.5787574", "0.5786148", "0.5782635", "0.5780103", "0.5778587", "0.5775818", "0.57707053", "0.5753557", "0.5749712", "0.57480055", "0.5736342", "0.57360685", "0.57203865", "0.57184935", "0.57126516", "0.5709714", "0.56970906", "0.56953216", "0.5691921", "0.5679127", "0.5663819" ]
0.58995295
66
Returns string representation of UndirectedEdge.
@Override public String toString(){ return this.from+"----"+this.to; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String edgeString()\n {\n Iterator<DSAGraphEdge<E>> iter = edgeList.iterator();\n String outputString = \"\";\n DSAGraphEdge<E> edge = null;\n while (iter.hasNext())\n {\n edge = iter.next();\n outputString = (outputString + edge.getLabel() + \", \");\n }\n return outputString;\n }", "private String edgesLeavingVertexToString() {\n \n //make empty string\n String s = \"\";\n \n //for loop to go through all vertices; \n for (int j = 0; j < arrayOfVertices.length; j++) {\n \n //if it has any edges...\n if (arrayOfVertices[j].getDegree() > 0) {\n \n //go through its edges\n for (int k = 0; k < arrayOfVertices[j].getDegree(); k++) {\n \n //declare an array list\n ArrayList<Vertex> newArrayList = \n arrayOfVertices[j].getAdjacent();\n \n //add to string: the vertex itself + space + edge + line break\n s += j + \" \" + newArrayList.get(k).getID() + \"\\n\"; \n \n } \n } \n }\n \n //add -1, -1 after all the edges\n s += \"-1 -1\";\n \n return s; \n }", "public String getEdges(){\n double Lx = super.getCentre().x - (this.length / 2);\r\n double Rx = super.getCentre().x + (this.length / 2);\r\n double Dy = super.getCentre().y - (this.width / 2);\r\n double Uy = super.getCentre().y + (this.width / 2);\r\n Point UL = new Point(Lx, Uy);\r\n Point UR = new Point(Rx, Uy);\r\n Point DL = new Point(Lx, Dy);\r\n Point DR = new Point(Rx, Dy);\r\n Point[] Edges = {DL, UL, UR, DR};\r\n this.edge = Edges;\r\n return Arrays.toString(Edges);\r\n }", "public UndirectedEdge() {\n \tthis(null,null);\n\t}", "public abstract String edgeToStringWithNoProb(int nodeSrc, int nodeDst, Set<String> relations);", "public String toString(){\n String string = \"\" + nrVertices;\n for(DEdge edge : edges){\n string += \"\\n\" + (edge.getVertex1()) + \" \" + (edge.getVertex2());\n }\n return string;\n }", "@Override\r\n\tpublic String toString() {\r\n\t\tStringBuilder out = new StringBuilder();\r\n\t\tMap<Integer,Integer> tmp;\r\n\t\tout.append(\"{\");\r\n\t\tfor(int i = 0; i < edges.length; i++) {\r\n\t\t\ttmp = edges[i];\r\n\t\t\tif (tmp == null) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tfor(Map.Entry entry : tmp.entrySet()) {\r\n\t\t\t\t\tif ((int)entry.getValue() == -1) {\r\n\t\t\t\t\tout.append(\"(\" + i + \",\" + entry.getKey() + \")\" + \",\");\r\n\t\t\t\t} else{\r\n\t\t\t\t\tout.append(\"(\" + i + \",\" + entry.getKey() + \",\" + entry.getValue() + \")\" + \",\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (out.length() > 2) {\r\n\t\tout.setLength(out.length() - 2);\r\n\t\tout.append(\")\");\r\n\t\t}\r\n\r\n\t\tout.append(\"}\");\r\n\t\treturn out.toString();\r\n\t}", "String getEdges();", "@Override\n public String toString(){\n return \"Edge {\" + this.xyz.getX() + \",\" + this.xyz.getY() + \",\" + this.xyz.getZ() + \"} with facing \" + this.face;\n }", "public Enumeration undirectedEdges();", "public String getBack(){\n String str = \"\";\n if( !this.isEmpty() ){\n MyDoubleNode<Type> aux = this.end;\n while(aux != null){\n str += aux.value.toString() + \" \";\n aux = aux.prev;\n }\n }\n return str;\n }", "public String toString() {\n \tStringBuilder s = new StringBuilder();\n \ts.append(V + \" vertices, \" + E + \" edges \" + NEWLINE);\n \tfor(int v = 0; v < V; v++) {\n \t\ts.append(v + \": \");\n \t\tfor(int w : adj[v]) {\n \t\t\ts.append(w + \" \");\n \t\t}\n \t\ts.append(NEWLINE);\n \t}\n \t\n \treturn s.toString();\n }", "public String toString() \n {\n String NEWLINE = System.getProperty(\"line.separator\");\n StringBuilder s = new StringBuilder();\n for (int v = 0; v < V; v++) \n {\n s.append(v + \": \");\n for (DirectedEdge e : adj[v]) \n {\n \tif(e.online)\n \t{\n \t\ts.append(e + \" \");\n \t}\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public abstract String rawGraphToString();", "String getIdEdge();", "public abstract String edgeToStringWithTraceId(int nodeSrc, int nodeDst, int traceId, Set<String> relations);", "public void drawUndirectedEdge(String label1, String label2) {\n }", "public String toString() {\n\t\tString s = \"\";\n\t\t// Loop through all the vertices and add their neighbors to a string\n\t\tfor (int i = 0; i < this.vertices.size(); i++) {\n\t\t\ts += this.vertices.get(i).toString() + \": \" + this.vertices.get(i).getNeighbors() + \"\\n\\n\";\n\t\t}\n\t\ts += \"Number of Total Edges: \" + this.actualTotalEdges;\n\t\treturn s;\n\t}", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(ver + \" vertices, \" + edg + \" edges \" + NEWLINE);\n for (int v = 0; v < ver; v++) {\n s.append(String.format(\"%d: \", v));\n for (int w : adj[v]) {\n s.append(String.format(\"%d \", w));\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public String toString() {\n\t\tif(this.start != null && this.end != null){\n\t\t\tString s1 = (\"\\n\\nEdge: \" + this.edgeId + \"\\nReliable: \" + this.isReliable\n\t\t\t\t+ \"\\nMessage Flow Type: \" + this.msgFlowType\n\t\t\t\t+ \"\\nDelay type: \"\n\t\t\t\t+ this.delayType + \"\\nNode 1: \" + this.start.getNodeId()\n\t\t\t\t+ \"\\nNode 2: \" + this.end.getNodeId());\n\t\t\treturn s1;\n\t\t\t\n\t\t}else{\t\t\n\t\t\tString s2 = (\"\\n\\nEdge: \" + this.edgeId + \"\\nReliable: \" + this.isReliable\n\t\t\t\t+ \"\\nMessage Flow Type: \" + this.msgFlowType\n\t\t\t\t+ \"\\nNum Message Entered: \" + \"\\nDelay type: \"\n\t\t\t\t+ this.delayType);\n\t\t\treturn s2;\n\t\t}\t\t\n\t}", "public String descriptor() {\n\t\treturn \"edge\";\n\t}", "Edge inverse() {\n return bond.inverse().edge(u, v);\n }", "public abstract String edgeToStringWithCnt(int nodeSrc, int nodeDst, int cnt, Set<String> relations);", "public String toString() {\n \t\t\tString string = \"\";\n \t\t\tfor (Node n : neighbors) {\n \t\t\t\tstring += n.shortName()+\" \";\n \t\t\t}\n \t\t\treturn \"Neighbours: \"+string;\n \t\t}", "@Override\n\tpublic String toString() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"node:\\n\").append(nodeJo);\n\t\tsb.append(\"\\nedges:\\n\").append(edgesJa);\n\t\treturn sb.toString();\n\t}", "public abstract String edgeToStringWithDaikonInvs(int nodeSrc, int nodeDst, DaikonInvariants daikonInvs,\n Set<String> relations);", "public String toString() {\n\t\treturn \"[\" + left + \",\" + right + \")\";\n\t}", "public abstract String edgeToStringWithProb(int nodeSrc, int nodeDst, double prob, Set<String> relations);", "@Override\n public String toString() {\n String str = \"graph [\\n\";\n\n Iterator<Node<E>> it = iterator();\n\n //Node display\n while(it.hasNext()){\n Node n = it.next();\n\n str += \"\\n\\tnode [\";\n str += \"\\n\\t\\tid \" + n;\n str += \"\\n\\t]\";\n }\n\n //Edge display\n it = iterator();\n\n while(it.hasNext()){\n Node n = it.next();\n\n Iterator<Node<E>> succsIt = n.succsOf();\n while(succsIt.hasNext()){\n Node succN = succsIt.next();\n\n str += \"\\n\\tedge [\";\n str += \"\\n\\t\\tsource \" + n;\n str += \"\\n\\t\\ttarget \" + succN;\n str += \"\\n\\t\\tlabel \\\"Edge from node \" + n + \" to node \" + succN + \" \\\"\";\n str += \"\\n\\t]\";\n }\n }\n\n str += \"\\n]\";\n\n return str;\n }", "public String toString(){\n\t\treturn vertex.toString();\n\t}", "@Override\n public String toString()\n {\n String builder = new String();\n \tfor (V vertex : graph.keySet()){\n \t\tString strVertex = vertex.toString();\n \t\tbuilder = builder + strVertex + \": \";\n \t\tArrayList <V> edges = graph.get(vertex);\n \t\tint degree = edges.size();\n \t\tint i = 0;\n \t\tif (degree > 0){\n \t\t\twhile (i < degree -1){\n \t\t\t\tString strEdge = edges.get(i).toString();\n \t\t\t\tbuilder = builder + strEdge + \", \";\n \t\t\t\ti++;\n \t\t\t}\n \t\tString strEdge = edges.get(i).toString();\n \t\tbuilder = builder + strEdge + \"\\n\";\n\n \t\t}\n \t\telse{\n \t\t\tstrVertex = vertex.toString();\n \t\t\tbuilder = builder + strVertex + \": \\n\";\n \t\t}\n\n \t}\n \treturn builder;\n }", "public Edge<E, V> getUnderlyingEdge();", "public String toString() {\n\t\t\n\t\tString temp = new String();\n\t\tfor(int i=0; i<grad.length; i++) {\n\t\t\ttemp += grad[i] + \" \";\n\t\t}\n\t\t\n\t\treturn temp;\n\t}", "public String toString(){\n String s = \"\";\n s += \"\\t\";\n \n for (int i = 0; i < n; i++){\n // adding vertices for columns\n s += vertices[i] + \"\\t\";\n }\n \n s += \"\\n\";\n \n for (int i = 0; i < n; i++){\n s += vertices[i] + \"\\t\"; // vertex for row\n for (int j = 0; j < n; j++){\n s += edges[j][i] + \"\\t\"; // adding edges across row\n }\n s += \"\\n\";\n }\n \n return s;\n }", "@DisplayName(\"Add undirected edge\")\n @Test\n public void testAddEdgeUndirected() {\n graph.addEdge(new Edge(3, 4));\n List<Integer> l0 = new ArrayList<>();\n l0.add(0);\n List<Integer> l1 = new ArrayList<>();\n l1.add(4);\n Assertions.assertEquals(l0.get(0), graph.getNeighbours(4).get(0));\n Assertions.assertEquals(l1.get(0), graph.getNeighbours(0).get(0));\n }", "public String toString() \n\t{\n\t\tString toReturn = \"\";\n\t\t\n\t\t\n\t\tfor(Vertex v : vertices) \n\t\t{\n\t\t\tHashMap<Vertex, Integer> E = getEdges(v);\n\t\t\t\n\t\t\tif(!E.isEmpty())\n\t\t\t{\n\t\t\t\ttoReturn = toReturn + v + \"(\";\n\t\t\t\tfor(Vertex edge : E.keySet()) \n\t\t\t\t{\n\t\t\t\t\ttoReturn = toReturn + edge.getName() + \", \";\n\t\t\t\t}\n\t\t\t\ttoReturn = toReturn.trim().substring(0, toReturn.length() - 2);\n\t\t\t\ttoReturn = toReturn + \")\\n\";\n\t\t\t}\n\t\t\telse {toReturn = toReturn + v + \"[]\\n\";}\n\t\t}\n\t\treturn toReturn;\n\t}", "public String toString() {\n StringBuilder s = new StringBuilder();\n String NEWLINE = System.getProperty(\"line.separator\");\n s.append(vertices + \" \" + NEWLINE);\n for (int v = 0; v < vertices; v++) {\n s.append(String.format(\"%d: \", v));\n for (Map.Entry<Integer, Integer> e : adjacent(v).entrySet()) {\n s.append(String.format(\"%d (%d) \", e.getKey(), e.getValue()));\n }\n s.append(NEWLINE);\n }\n return s.toString();\n }", "public String toString()\r\n\t{\r\n\t\tString str = \"\";\r\n\t\t\r\n\t\tSortedSet<String> sortedVertices = new TreeSet<String>(this.getVertices());\r\n\t\t\r\n\t\tstr += \"Vertices: \" + sortedVertices.toString() + \"\\nEdges:\\n\";\r\n\t\t\r\n\t\tfor(String vertex : sortedVertices)\r\n\t\t{\r\n\t\t\tif(this.dataMap.containsKey(vertex))\r\n\t\t\t{\r\n\t\t\t\tHashMap<String,Integer> adjMap = this.adjacencyMap.get(vertex);\r\n\t\t\t\t\r\n\t\t\t\tSortedSet<String> sortedKeys = new TreeSet<String>(adjMap.keySet());\r\n\t\t\t\t\r\n\t\t\t\tstr += \"Vertex(\" + vertex + \")--->{\";\r\n\t\t\t\tfor(String adj : sortedKeys)\r\n\t\t\t\t{\r\n\t\t\t\t\tstr += adj +\"=\"+ adjMap.get(adj) +\", \";\r\n\t\t\t\t}\r\n\t\t\t\tstr = str.trim();\r\n\t\t\t\t\r\n\t\t\t\tif(!sortedKeys.isEmpty())\r\n\t\t\t\t{\r\n\t\t\t\t\tStringBuilder s = new StringBuilder(str);\r\n\t\t\t\t\ts.deleteCharAt(str.length()-1);\r\n\t\t\t\t\tstr = s.toString();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tstr+=\"}\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn str;\r\n\t}", "public Enumeration directedEdges();", "final public edge rev_edge(final edge e) {\r\n return rev_edge_v3(e);\r\n }", "Edge getEdge();", "public String toString(){\r\n String result = \"[ \";\r\n result = result + vertex + \" ]\";\r\n return result;\r\n }", "@Override\n\t\tpublic String toString() {\n\t\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\t\tif (prev != null) {\n\t\t\t\tstringBuilder.append(prev.elementE);\n\t\t\t}else {\n\t\t\t\tstringBuilder.append(\"null\");\n\t\t\t}\n\t\t\tstringBuilder.append(\"_\").append(elementE).append(\"_\");\n\t\t\tif (next != null) {\n\t\t\t\tstringBuilder.append(next.elementE);\n\t\t\t}else {\n\t\t\t\tstringBuilder.append(\"null\");\n\t\t\t}\n\t\t\treturn stringBuilder.toString();\n\t\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"(Triangle \"+verts+\")\" ;\n\t}", "public double getEdge()\n {\n return this.edge;\n }", "public String toString() {\n\t\treturn \"NearestNeighbourhood\";\n\t}", "public void printEdge(){\n\t\tint count = 0;\n\t\tSystem.out.print(\"\\t\");\n\t\tfor(Edge e: edgeArray){\n\t\t\tif(count > 5){\n\t\t\t\tSystem.out.println();\n\t\t\t\tcount = 0;\n\t\t\t\tSystem.out.print(\"\\t\");\n\t\t\t}\n\t\t\tcount ++;\n\t\t\tSystem.out.printf(\"%s (%d) \", e.getVertex().getRecord(), e.getCost());\n\t\t}\n\t\tSystem.out.println();\n\t}", "@Override\n public String toString()\n {\n StringBuilder sb = new StringBuilder();\n\n for(Vertex vertex: vertices)\n {\n sb.append(\"V: \" + vertex.toString() + '\\n');\n\n for(Edge edge: connections.get(vertex))\n {\n sb.append(\" -> \" + edge.other(vertex).toString() + \" (\" + edge.getWeight() + \")\\n\");\n }\n }\n\n return sb.toString();\n }", "public static void convertToAsciiUndirected() {\n\t\tObjectArrayList<File> list = Utilities.getUndirectedGraphList(LoadMethods.WEBGRAPH);\n\t\tUtilities.outputLine(\"Converting \" + list.size() + \" undirected graphs...\", 1);\n\n\t\tint k = 0;\n\t\tfor (File f : list) {\n\t\t\tgraph.Undir g = Undir.load(f.getPath().substring(0, f.getPath().lastIndexOf('.')), GraphTypes.WEBGRAPH);\n\t\t\tString output = \"Undirected/\" + f.getName().substring(0, f.getName().lastIndexOf('.')) + \".txt\";\n\t\t\tUtilities.output(++k + \" - \" + f.getPath(), 1);\n\t\t\tg.exportAsAscii(output);\n\t\t\tUtilities.outputLine(\" => \" + Utilities.adjGraphPath + output, 1);\n\t\t}\n\t}", "public String toString() {\n String type = \"TYPE: Edge Piece\\n\";\n String[] strColors = colorsAsString(colors);\n String color = \"Color: [\" + strColors[0] + \",\" + strColors[1] + \"]\\n\";;\n String slot;\n switch (loc) {\n case 1 :\n slot = \"Front top\";\n break;\n case 2 :\n slot = \"Front bottom\";\n break;\n case 3 :\n slot = \"Front right\";\n break;\n case 4 :\n slot = \"Front left\";\n break;\n case 5 :\n slot = \"Back top\";\n break;\n case 6 :\n slot = \"Back bottom\";\n break;\n case 7 :\n slot = \"Back left on green side\";\n break;\n case 8 :\n slot = \"Back right on green side\";\n break;\n case 9 :\n slot = \"Top right\";\n break;\n case 10 :\n slot = \"Top left\";\n break;\n case 11 :\n slot = \"Bottom right\";\n break;\n default :\n slot = \"Bottom left\";\n }\n String location = \"Location: \" + slot + \"\\n\";\n String oriented = \"Yes\";\n if (orient == -1) {\n oriented = \"No\";\n }\n String orientation = \"Oriented? \" + oriented + \"\\n\";\n String solved = \"Solved? \" + solved() + \"\\n \";\n return type + color + location + orientation + solved;\n }", "String toStringBackwards();", "public String toString() {\n if (this.weight == null) {\n return \"<\" + this.from + \",\" + this.to + \">\";\n } else {\n return \"<\" + this.from + \",\" + this.to + \",\" + this.weight + \">\";\n } // if/else\n }", "@Override\n public String toString() {\n return String.format(\"(%d->%d|%.6f)\", from, to, weight);\n }", "public String toString()\n\t{\n\t\tString answer;\n\t\t//if the size not 0, indent 9 spaces to make room for the \"(null)<--\" that backwards will print\n\t\tif (size() != 0)\n\t\t\tanswer = \" \";\n\t\telse\n\t\t\tanswer = \"\";\n\n\t\tDLLNode cursor = head;\n\t\twhile (cursor != null)\n\t\t{\n\t\t\tanswer = answer + cursor.data + \"-->\";\n\t\t\tcursor = cursor.next;\n\t\t}\n\n\t\tanswer = answer + \"(null)\";\n\t\treturn answer;\n\t}", "@Override\n public String toString()\n {\n String s = \"\";\n \t\tEnumeration<DownCable> dCables = this.downCables.elements();\n \t\tint i = 0;\n \t\twhile(dCables.hasMoreElements()) {\n \t\t\t\tif(i > 0){\n \t\t\t\t\t s += \" \";\n \t\t\t\t}\n s += dCables.nextElement().toString();\n i++;\n }\n return s;\n }", "public String toString() {\r\n\t\tString s = \"\";\r\n\t\t\r\n\t\tfor ( IntNode i = this; i!= null; i = i.link ) {\r\n\t\t\tif (i.link == null)\r\n\t\t\t\ts = s + i.data;\r\n\t\t\telse\r\n\t\t\t\ts = s + i.data + \"->\";\r\n\t\t} // end for\r\n\t\t\r\n\t\treturn s;\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"(relation \" +\n\t\t\t\t(this.source != null ? this.source.getId() : \"nil\") + \" \" +\n\t\t\t\tthis.name.toString() + \" \" +\n\t\t\t\t(this.dest != null ? this.dest.toString() : \"nil\") + \")\";\n\t}", "public void outIncidentEdges() {\r\n\t\tfor (int i = 0; i < currentVertex.outList.size(); i++) {\r\n\t\t\tSystem.out.print(currentVertex.outList.get(i).edge + \" \");\r\n\t\t}\r\n\t\tprintLine();\r\n\t}", "public String toString () {\n StringBuffer s = new StringBuffer();\n for (V v: dag.keySet()) s.append(\"\\n \" + v + \" -> \" + dag.get(v));\n return s.toString(); \n }", "@Override\n public final String toString() {\n final StringBuilder nodes = new StringBuilder();\n nodes.append(this.sizeNodes()).append(\" Nodes: {\");\n final StringBuilder edges = new StringBuilder();\n edges.append(this.sizeEdges()).append(\" Edges: {\");\n for (final Node<N> node : this.getNodes()) {\n nodes.append(node.toString()).append(',');\n }\n for (final Edge<N, E> edge : this.getEdges()) {\n edges.append(edge.toString()).append(',');\n }\n final String newLine = System.getProperty(\"line.separator\");\n nodes.append('}').append(newLine).append(edges).append('}').append(newLine);\n return nodes.toString();\n }", "public String toString(){\n String result = \"\";\n LinearNode<T> trav = front;\n while (trav != null){\n result += trav.getElement();\n trav = trav.getNext();\n }\n return result;\n }", "public String toString() {\r\n\t\treturn \"Ogirin=\"+this.getOrigin().toString()+\", Direction=\"+this.getDirection().toString();\r\n\t}", "public String stringify(GraphSprite graph) {\n String result = \"\";\n \n boolean isDirected = !(graph.getGraph() instanceof UndirectedGraph);\n \n if(isDirected) {\n result += \"digraph \";\n }\n else {\n result += \"graph \";\n }\n result += \"cazgraph {\\n\";\n \n \n Set<String> usedUndirectedEdges = new HashSet<>();\n \n for(String id : graph.getVertexIDs()) {\n \n result += \"\\\"\" + id + \"\\\";\\n\";\n \n for(String edgeID : graph.getEdges(id)) {\n if(isDirected) {\n result += \"\\\"\" + id + \"\\\"\" + \" -> \" + \"\\\"\" + edgeID + \"\\\";\\n\";\n }\n else {\n String edge1 = \"\\\"\" + id + \"\\\"\" + \" -> \" + \"\\\"\" + edgeID + \"\\\";\\n\";\n String edge2 = \"\\\"\" + edgeID + \"\\\"\" + \" -- \" + \"\\\"\" + id + \"\\\";\\n\";\n \n if(!usedUndirectedEdges.contains(edge1) && !usedUndirectedEdges.contains(edge2)) {\n usedUndirectedEdges.add(edge1);\n usedUndirectedEdges.add(edge2);\n \n result += edge1;\n }\n }\n }\n }\n \n \n result += \"}\";\n return result;\n }", "@Override\n public String toString() {\n String str = head.getValue() + \"->\";\n Node holder = head.getNext();\n for (int i = 2; i < size(); i++) {\n str = str + holder.getValue() + \"->\";\n holder = holder.getNext();\n }\n str = str + tail.getValue();\n return str;\n }", "public String toString() {\n \treturn (\"From: \" + vertex1.minToString() + \" To: \"\n \t\t\t+ vertex2.minToString()\n \t\t\t+ \" Distance: \" + distance());\n }", "private String toString2(BinaryNode<E> t) {\n if (t == null) return \"\";\n StringBuilder sb = new StringBuilder();\n sb.append(toString2(t.left));\n sb.append(t.element.toString() + \" \");\n sb.append(toString2(t.right));\n return sb.toString();\n }", "public Enumeration edges();", "public SimpleEdge getEdge() {\n return edge;\n }", "public String backwards()\n\t{\n\t\tString answer = \"\";\n\t\tDLLNode cursor = tail;\n\t\twhile (cursor != null)\n\t\t{\n\t\t\tanswer = \"<--\" + cursor.data + answer;\n\t\t\tcursor = cursor.prev;\n\t\t}\n\n\t\tanswer = \"(null)\" + answer;\n\t\treturn answer;\n\t}", "public String toStringRev() {\n String res= \"[\";\n // invariant: res = \"[s0, s1, .., sk\" where sk is the object after node n\n for (Node n = sentinel.pred; n != sentinel; n= n.pred) {\n if (n != sentinel.pred)\n res= res + \", \";\n res= res + n.data;\n }\n return res + \"]\";\n }", "@Override\r\n public String toString() {\r\n \r\n StringBuilder sb = new StringBuilder();\r\n HTreeNode listrunner = getHeadNode();\r\n while (listrunner != null) {\r\n sb.append(listrunner.getCharacter());\r\n //no comma after the final element\r\n if (listrunner.getNext() != null) {\r\n sb.append(',');\r\n sb.append(' ');\r\n }\r\n listrunner = listrunner.getNext();\r\n }\r\n return sb.toString();\r\n }", "public String toString() {\n String s = \"\";\n for (Vertex v : mVertices.values()) {\n s += v + \": \";\n for (Vertex w : mAdjList.get(v)) {\n s += w + \" \";\n }\n s += \"\\n\";\n }\n return s;\n }", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder(\"WeightedGraph: \");\n for (int i = 0; i < getSize(); i++) {\n sb.append(getVertex(i) + \"[\" + i + \"]:{\");\n for (Edge e : neighbors.get(i)) {\n sb.append(\"{\" + e.getVert1() + \",\" + e.getVert2() + \",\" + ((WeightedEdge) e).getWeight() + \"}\");\n }\n sb.append(\"\\n\");\n }\n return sb.toString();\n }", "public String toString() {\n\t\treturn \"Triangle with side1 = \" +side1+ \", side2 = \" +side2+ \", side3 = \" +side3;\n\t}", "public String toString()\n\t{\n\t \n\t\tString str = vertexName + \": \" ;\n\t\tfor(int i = 0 ; i < adjacencyList.size(); i++)\n\t\t\tstr = str + adjacencyList.get(i).vertexName + \" \";\n\t\treturn str ;\n\t\t\n\t}", "public String toString() {\r\n\t\tStringBuilder buffer = new StringBuilder();\r\n\t\t\r\n\t\tbuffer.append(\"<\" + xmltag + \" subgraph=\\\"\" + subgraph + \"\\\">\" + newline);\r\n\t\t\r\n\t\tfor (Variable currentVariable : variables) {\r\n\t\t\tbuffer.append(\"\\t\\t\\t\\t\\t\" + currentVariable);\r\n\t\t}\r\n\t\t\r\n\t\tbuffer.append(\"\\t\\t\\t\\t</\" + xmltag + \">\" + newline);\r\n\t\t\r\n\t\treturn buffer.toString();\r\n\t}", "public String toString(){\n\t\treturn leftValue + \":\" +rightValue;\t\t\t\r\n\t}", "LabeledEdge getLabeledEdge();", "public String toString() {\n\t\tif(left == this && right == this) {\n\t\t\treturn getElementString();\n\t\t}\n\t\telse {\n\t\t\tif(right.right == right && right.noBranchBit == true) {\n\t\t\t\treturn \"(\" + left.toString() + \")\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn \"(\" + left.toString() + \" && \" + right.toString() + \")\";\n\t\t\t}\n\t\t}\n\t}", "public ArrayList<NonDirectionalEdge> getNonDirectionalEdges() {\n return selectedNonDirectionalEdges;\n }", "private String getName()\r\n\t{\r\n\t return edgeType.getName();\r\n\t}", "@Override\n public String toString(){\n return \"(\" + t + \", \" + u + \")\";\n }", "public String toString() {\r\n\t\tString cad = \"\";\r\n\t\tfor (int i = 0; i < nodes_.size(); i++) {\r\n\t\t\tcad += nodes_.get(i).getVal() + \" - \";\r\n\t\t}\r\n\t\treturn cad;\r\n\t}", "@Test\n public void testEdgeReverse() {\n Edge<Integer, String> target = new Edge<>(1, 2, \"hello\");\n Edge<Integer, String> reverse = target.reverse();\n assertNotNull(reverse);\n assertEquals(Integer.valueOf(2), reverse.getFrom());\n assertEquals(Integer.valueOf(1), reverse.getTo());\n }", "public String getForward(){\n String str = \"\";\n if( !this.isEmpty() ){\n MyDoubleNode<Type> aux = this.start;\n while(aux != null){\n str += aux.value.toString() + \" \";\n aux = aux.next;\n }\n }\n return str;\n }", "@Override\n public String toString() {\n\treturn ByteUtils.toHexString(toByteArray(), true);\n }", "@Override\n\tpublic String toString() {\n StringBuffer buf = new StringBuffer();\n\n// for (int i = 0; i < units.size(); i++) {\n// buf.append(\"\\nUnit \" + i + \": \" + units.get(i));\n// }\n\n buf.append(\"Connected components: \" );\n List<List<Node>> components = GraphUtils.connectedComponents(graph);\n\n for (int i = 0; i < components.size(); i++) {\n buf.append(\"\\n\" + i + \": \");\n buf.append(components.get(i));\n }\n\n buf.append(\"\\nGraph = \" );\n buf.append(graph);\n\n return buf.toString();\n }", "public String toString() {\n\t\tStringBuilder temp = new StringBuilder();\n\n\t\tfor (int index = 0; index < verticesNum; index++) {\n\t\t\tif(list[index] == null)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\ttemp.append(\"node:\");\n\t\t\ttemp.append(index);\n\t\t\ttemp.append(\": \");\n\t\t\ttemp.append(list[index].toString());\n\t\t\ttemp.append(\"\\n\");\n\t\t}\n\n\t\treturn temp.toString();\n\t}", "public String revealAllRelationshipsInW() {\n\t\tString w = \"\";\n\t\tif (this.numWVertices > 0) {\n\t\t\tfor (int i = 0; i < this.numWVertices; i++) {\n\t\t\t\t// find w_i and print it with all its neighbors\n\t\t\t\tw += \"w\" + i + \": \" + this.vertices.get(i).getNeighbors() + \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn w;\n\t}", "@Override\n public String toString() {\n // | <M,C,B> |\n // | Depth = d |\n // -----------\n return \"\\n ----------- \\n\" + \"| <\" + this.state[0] + \",\" + this.state[1] + \",\" + this.state[2] + \"> |\\n\"\n + \"| Depth = \" + this.depth + \" |\\n\" + \" ----------- \\n\";\n }", "public String toString() {\n\treturn triangles.toString(); \n }", "public String toString() {\n\t\tNode current = top;\n\t\tStringBuilder s = new StringBuilder();\n\t\twhile (current != null) {\n\t\t\ts.append(current.value + \" \");\n\t\t\tcurrent = current.next;\n\t\t}\n\n\t\treturn s.toString();\n\t}", "static String makeEdge(String id,\n String source,\n String target,\n String relationship,\n int causal) {\n return format(EDGE_FMT, id, source, target, relationship, causal);\n }", "@Override\n public String toString() {\n if(a != -1) {\n return String.format(\"#%08X\", toARGB());\n } else {\n return String.format(\"#%06X\", toARGB() & 0xFFFFFF);\n }\n }", "public String toString()\n {\n return id() + location().toString() + direction().toString();\n }", "public String getColorString() {\n return left.toString() + \", \" + right.toString();\n }", "int getReverseEdgeKey();", "public String getSlackRepresentationOfBoard() {\n String boardBorders[] = {\"```| \",\n \" | \",\n \" | \",\n \" |\\n|---+---+---|\\n| \",\n \" | \",\n \" | \",\n \" |\\n|---+---+---|\\n| \",\n \" | \",\n \" | \",\n \" |```\"};\n int boardBordersIndex = 0;\n StringBuilder boardString = new StringBuilder();\n for(int row = 0; row < BOARD_SIZE; row ++ ){\n for(int col = 0; col <BOARD_SIZE; col ++ ){\n boardString.append( boardBorders[boardBordersIndex] );\n boardString.append( getTokenAsCharFromBoardPosition(row, col, boardBordersIndex+1));\n boardBordersIndex++;\n }\n }\n boardString.append( boardBorders[boardBordersIndex] );\n return boardString.toString();\n }", "public String toString() {\n\t\treturn \"Road from \" + getLeave() + \" to \" + getArrive() + \" with toll \" + getToll();\n\t}", "@Override\n\tpublic String toString() {\n\t\tString out = new String();\n\t\tfor (int i = 0; i < this.maxNumVertices; i++) {\n\t\t\tfor (int j = 0; j < this.maxNumVertices; j++) {\n\t\t\t\tout = out + this.reachabilityMatrix[i][j] + \" \";\n\t\t\t}\n\t\t\tout = out + \"\\n\";\n\t\t}\n\t\treturn out;\n\t}", "public String toString(){\n String string = new String();\n for(int i = 0; i < axis.length; i++){\n string += axis[i];\n if(i != (axis.length - 1)){\n string += \" / \";\n }\n }\n return string;\n }" ]
[ "0.6706524", "0.65978575", "0.6546591", "0.6374156", "0.6162231", "0.60681707", "0.6062523", "0.603629", "0.6000234", "0.59346646", "0.5864952", "0.5840486", "0.58262634", "0.58127636", "0.5808368", "0.57325804", "0.5732469", "0.5720584", "0.57091975", "0.5703023", "0.56778365", "0.5582784", "0.5548867", "0.5548278", "0.55339676", "0.5501784", "0.5485031", "0.5483707", "0.5469297", "0.5441592", "0.54404306", "0.54350114", "0.54134387", "0.5407852", "0.5400611", "0.53957605", "0.53917354", "0.53901196", "0.53572655", "0.5353684", "0.5337674", "0.53115296", "0.5307149", "0.5282859", "0.52742356", "0.526379", "0.5261964", "0.5251296", "0.5229717", "0.52190787", "0.5202784", "0.5199085", "0.51910335", "0.5173022", "0.5172291", "0.51671106", "0.516258", "0.51606345", "0.5145427", "0.5145377", "0.514334", "0.51422995", "0.5138483", "0.5131979", "0.51193774", "0.5115804", "0.51068616", "0.5093225", "0.5084928", "0.5081067", "0.50754523", "0.5072171", "0.50627804", "0.5053723", "0.50523543", "0.50518656", "0.5050292", "0.50410914", "0.5034627", "0.5032426", "0.5032312", "0.5031264", "0.5029775", "0.5029573", "0.501962", "0.50105417", "0.49980226", "0.49967918", "0.49953023", "0.49934962", "0.49843374", "0.49834985", "0.4982995", "0.49812716", "0.49716347", "0.4968882", "0.49625644", "0.49601448", "0.4959224", "0.49519208", "0.49507797" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { ListNode head = new ListNode(1); ListNode n2 = new ListNode(3); ListNode n3 = new ListNode(4); ListNode n4 = new ListNode(2); ListNode n5 = new ListNode(5); ListNode n6 = new ListNode(6); ListNode n7 = new ListNode(6); head.next = n2; n2.next = n6; n6.next = n3; n3.next = n4; n4.next = n5; n5.next = n7; RemoveLinkedListElements slt = new RemoveLinkedListElements(); PrintListNode res = new PrintListNode(); int val = n6.val; res.print(slt.removeElements_1(head, 4)); res.print(slt.removeElements_bb(head, 4)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
post: constructs an empty tree
public IntTree() { overallRoot = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void makeEmpty()\n {\n root = nil;\n }", "public void makeEmpty() {\r\n\t\troot = null;\r\n\t\tleftChild = null;\r\n\t\trightChild= null;\r\n\t}", "public void makeEmpty( )\r\n\t{\r\n\t\troot = null;\r\n\t}", "public void makeEmpty() {\r\n\t\troot = null;\r\n\t}", "public void makeEmpty() {\n\t\troot = null;\n\t}", "public void makeEmpty() {\n root = null;\n }", "public Tree() // constructor\n\t{ root = null; }", "public TreeBuilder() {\n\t\troot = null;\n\t}", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "public void createTree() {\n\t\taddNodeToParent(nodeMap);\n\t}", "public Tree(){\n root = null;\n }", "public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }", "private void buildRoot() {\n this.root = new GPRootTreeNode(this.tree);\n }", "public void makeEmpty(){\n deleteAll(root);\n root = null;\n numItems = 0;\n }", "public KdTree() {\n root = null;\n }", "public RBTree() {\r\n\t\troot = null;\r\n\t}", "public RedBlackTree()\n { \n \t root = null;\n }", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public ExpressionTree()\n\t\t{\n\t root = null;\n\t\t}", "public void postorder()\r\n {\r\n postorder(root);\r\n }", "public TreeNode buildTree(int[] inorder, int[] postorder) {\n if(inorder.length == 0){\n return null;\n }\n TreeNode result = getRoot(inorder,postorder,0,inorder.length - 1,inorder.length-1);\n return result;\n }", "public BinaryTree(){\r\n root = null;\r\n }", "public BinaryTree() {\n root = null;\n }", "public BinaryTree() {\n root = null;\n }", "public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }", "public KdTree() {\n root = null;\n n = 0;\n }", "public TreeNode buildTree(int[] inorder, int[] postorder) {\n if(inorder.length==0 || postorder.length==0)\n return null;\n return build(inorder, postorder, 0, inorder.length-1, 0, postorder.length-1);\n }", "public BinaryTree()\n\t{\n\t\troot = null;\n\t}", "private BinaryTree<Character> constructTree(){\n if(pq.size() == 1) return pq.poll().data;\n if(pq.size() == 0) return null;\n // Poll the lowest two trees, combine them, then stick them back in the queue.\n Helper<BinaryTree<Character>> temp0 = pq.poll(), temp1 = pq.poll(),\n result = new Helper<>(temp0.priority + temp1.priority, new BinaryTree<>(temp0.data, null , temp1.data));\n pq.add(result);\n // Call again to keep constructing.\n return constructTree();\n }", "private void CreateTree()\r\n\t{\r\n\r\n\t\t//sample nodes which are not identical\r\n\t\ta = new Node(1);\r\n\t\ta.left = new Node(3);\r\n\t\ta.left.left = new Node(5);\r\n\t\ta.right = new Node(2);\r\n\r\n\r\n\t\tb = new Node(2);\r\n\t\tb.left = new Node(1);\r\n\t\tb.right = new Node(3);\r\n\t\tb.right.right = new Node(7);\r\n\t\tb.left.right = new Node(4);\r\n\r\n\t\t//sample nodes which are identical\r\n\t\ta1 = new Node(1);\r\n\t\ta1.left = new Node(3);\r\n\t\ta1.left.left = new Node(5);\r\n\t\ta1.right = new Node(2);\r\n\r\n\r\n\t\tb1 = new Node(1);\r\n\t\tb1.left = new Node(3);\r\n\t\tb1.right = new Node(2);\r\n\t\tb1.left.left = new Node(5); \r\n\t}", "public RBTree() {\r\n\t\t// well its supposed just create a new Red Black Tree\r\n\t\t// Maybe create a new one that does a array of Objects\r\n\t}", "public TernaryTree() {\n root = null;\n\n }", "public KdTree() {\n size = 0;\n }", "public void postorder()\n {\n postorder(root);\n }", "public void postorder()\n {\n postorder(root);\n }", "public KdTree()\n {\n root = null;\n size = 0;\n }", "public BST() {\r\n root = null;\r\n }", "public TreeImpl(T dato) {\r\n\t\traiz = new NodeImpl<T>(dato, null);// El null dice que es raiz\r\n\t}", "public EmptyBinarySearchTree()\n {\n\n }", "BinaryTree()\n\t{\n\t\troot = null;\t\t\t\t\t\t// at starting root is equals to null\n\t}", "public BSearchTree() {\n\t\tthis.overallRoot = null;\n\t}", "private BinaryTree() {\n root = new Node(0);\n }", "public ObjectBinaryTree() {\n root = null;\n }", "public KdTree() {\n this.root = null;\n this.size = 0;\n }", "void resetTreeForQueries() {\n\t\t_queryTree = new Tree(_tree);\n\t\tif(DEBUG) {\n\t\t\tSystem.out.printf(\"\\nquery tree structure:\\n%s\\n\",_queryTree.getLongInfo());\n\t\t}\n\t}", "public BinaryTree() {\n count = 0;\n root = null;\n }", "public static void build ()\r\n {\r\n lgt.insert(1);\r\n lgt.insert(2);\r\n lgt.insert(5);\r\n \r\n lgt.findRoot();\r\n lgt.insert(3);\r\n \r\n lgt.findRoot();\r\n lgt.insert(4);\r\n \r\n lgt.insert(6);\r\n lgt.findParent();\r\n lgt.insert(7);\r\n \r\n }", "public KdTree() \r\n\t{\r\n\t}", "public BinaryTree() {\r\n\t\troot = null;\r\n\t\tcount = 0;\r\n\t}", "public TreeNode() {\n // do nothing\n }", "public BST()\r\n\t{\r\n\t\troot = null;\r\n\t}", "BinarySearchTree() {\n this.root = null;\n }", "private void initTree(E data, TernaryTree<E> leftTree, TernaryTree<E> middleTree, TernaryTree<E> rightTree) {\n /**\n * We have to create a new node here for the case where one of the input trees\n * is this. If we simply set node = new TernaryNode..., and one of the input\n * trees is this, then we lose all of the subchildren of one of the input trees!\n **/\n TernaryNode<E> newRoot = new TernaryNode<>(data);\n\n // if it's empty, then why add it?\n if (leftTree != null && !leftTree.isEmpty()) {\n newRoot.setLeftChild(leftTree.root);\n }\n\n if (middleTree != null && !middleTree.isEmpty()) {\n // if the middle tree is the same as the left tree, then we should create\n // a copy\n if (middleTree == leftTree) {\n newRoot.setMiddleChild(leftTree.root.copy());\n } else {\n newRoot.setMiddleChild(middleTree.root);\n }\n }\n\n if (rightTree != null && !rightTree.isEmpty()) {\n // same idea here, except that we need to check the left and the middle\n if (rightTree == leftTree) {\n newRoot.setRightChild(leftTree.root.copy());\n } else if (rightTree == middleTree) {\n newRoot.setRightChild(middleTree.root.copy());\n } else {\n newRoot.setRightChild(rightTree.root);\n }\n }\n\n // okay, now we can set this tree's root to the newRoot\n root = newRoot;\n\n /**\n * For the next three if-statements, we only clear the tree if the input tree is\n * not the same as this, otherwise we'd be clearing this!\n */\n if (leftTree != null && leftTree != this) {\n leftTree.clear();\n }\n\n if (middleTree != null && middleTree != this) {\n middleTree.clear();\n }\n\n if (rightTree != null && rightTree != this) {\n rightTree.clear();\n }\n }", "public void postorder() {\n\t\tpostorder(root);\n\t}", "public MyTreeSet()\r\n {\r\n root = null;\r\n }", "public void recomputeTree() {\n\t\tsuperRoot = factory.createTreeNode(null, this);\n\t\tlayoutToTree.put(null, superRoot);\n\t\tcreateTrees(context.getNodes());\n\t}", "public TreeNode()\r\n\t\t{\r\n\t\t\thead = null; //no data so set head to null\r\n\t\t}", "@Before\n public void prepareTree() {\n tree = new TreeNode();\n nodeOne = new TreeNode();\n nodeTwo = new TreeNode();\n nodeThree = new TreeNode();\n }", "public RBTree() {\n\t\troot = null;\n\t\tdrawer = new RBTreeDrawer();\n\t}", "private void createRootNode()\r\n {\r\n root = new Node(\"root\", null);\r\n Node.clear();\r\n }", "public NamedTree()\r\n {\r\n head = null;\r\n }", "public void clear() {\n tree.clear();\n }", "public TwoFourTree()\r\n\t{\r\n\t\troot = new TreeNode(); //assign the root to a new tree node\r\n\t}", "private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}", "public LinkedBinaryTree() { // constructs an empty binary tree\n\n }", "public KdTree() \n\t {\n\t\t \n\t }", "public BSTree2(){\n root = null;\n }", "public BinaryTree() {\n\t}", "public void preTraverse() {\n // ensure not an empty tree\n while (root != null) {\n \n }\n }", "FractalTree() {\r\n }", "public BST() {\n\t\troot = null;\n\t}", "public void preorder()\r\n {\r\n preorder(root);\r\n }", "bst()\n\t{\n\t\troot = null;\n\t\tnodecount = 0;\n\t}", "public void postOrder() {\n postOrder(root);\n }", "public LinkedBinaryTree() {\n\t\t root = null;\n\t}", "public BinaryTree()\n {\n //this is the constructor for the BinaryTree object\n data = null;\n left = null;\n right = null;\n }", "private void initTree()\n {\n String currSpell;\n Node tempNode;\n String currString;\n Gestures currGest;\n for(int spellInd = 0; spellInd < SpellLibrary.spellList.length; spellInd++)\n {\n //Start casting a new spell from the root node\n tempNode = root;\n currSpell = SpellLibrary.spellList[spellInd];\n for(int currCharInd =0; currCharInd < currSpell.length(); currCharInd++)\n {\n currString = currSpell.substring(0,currCharInd+1);\n currGest = Gestures.getGestureByChar(currString.charAt(currString.length()-1));\n if(tempNode.getChild(currGest) == null) //Need to add a new node!\n {\n tempNode.addChild(currGest,new Node(currString));\n debug_node_number++;\n }\n //Walk into the existing node\n tempNode = tempNode.getChild(currGest);\n }\n\n }\n }", "public TreeNode buildTree(int[] inorder, int[] postorder) {\n return buildTreeRecursive(inorder, 0, inorder.length, postorder, 0, postorder.length);\n }", "public AVLTree() { \n super();\n // This acts as a sentinel root node\n // How to identify a sentinel node: A node with parent == null is SENTINEL NODE\n // The actual tree starts from one of the child of the sentinel node !.\n // CONVENTION: Assume right child of the sentinel node holds the actual root! and left child will always be null.\n \n }", "private Node constructParsedTree(Node[] nodes) {\n int rootIndex = 0;\n for (int i = 0; i < nodes.length; i++) {\n if (nodes[i].getFather() > 0)\n nodes[nodes[i].getFather() - 1].addChild(nodes[i]);\n else\n rootIndex = i;\n }\n return nodes[rootIndex];\n }", "public MorseCodeTree()\r\n\t{\r\n\t\tbuildTree();\r\n\t}", "@Generated(hash = 1311440767)\r\n public synchronized void resetTrees() {\r\n trees = null;\r\n }", "public void clear() {\n\t\tthis.root = new Node();\n\t}", "private void buildBinaryTree() {\n log.info(\"Constructing priority queue\");\n Huffman huffman = new Huffman(cache.vocabWords());\n huffman.build();\n\n log.info(\"Built tree\");\n\n }", "public static TreeNode buildTree_043(int[] inorder, int[] postorder) {\n if (inorder == null || postorder == null || inorder.length != postorder.length) {\n return null;\n }\n\n return constructTree(inorder, postorder, 0, inorder.length - 1, 0, postorder.length - 1);\n }", "public TreeNode reconstruct(int[] pre) {\n if (pre == null || pre.length == 0) {\n return null;\n }\n return buildBST(pre, 0, pre.length - 1);\n }", "protected PhraseTree() {}", "public AVLTree() {\r\n\r\n\r\n this.root = new AVLTreeNode(9);\r\n Delete(9);\r\n }", "public BinaryTree(){}", "private Node constructInternal(List<Node> children){\r\n\r\n // Base case: root found\r\n if(children.size() == 1){\r\n return children.get(0);\r\n }\r\n\r\n // Generate parents\r\n boolean odd = children.size() % 2 != 0;\r\n for(int i = 1; i < children.size(); i += 2){\r\n Node left = children.get(i-1);\r\n Node right = children.get(i);\r\n Node parent = new Node(Utility.SHA512(left.hash + right.hash), left, right);\r\n children.add(parent);\r\n }\r\n\r\n // If the number of nodes is odd, \"inherit\" the remaining child node (no hash needed)\r\n if(odd){\r\n children.add(children.get(children.size() - 1));\r\n }\r\n return constructInternal(children);\r\n }", "public JdbTree() {\r\n this(new Object [] {});\r\n }", "public KdTree() {\n }", "public HtmlTree()\n {\n // do nothing\n }", "public SegmentTree() {}", "public void preorder() {\n\t\tpreorder(root);\n\t}", "public AVLTree() {\n\t\tthis.root = null;\n\t}", "public BST() {\n this.root = null;\n }", "public TreeNode() {\n }", "public BinaryTree()\n {\n this.root = null;\n this.actualNode = null;\n this.altMode = false;\n this.deepestRight = null;\n }", "public BinarySearchTree() {\n root = null;\n size = 0;\n }" ]
[ "0.69569147", "0.6955827", "0.69515795", "0.68762326", "0.68712467", "0.6858413", "0.68163675", "0.6814261", "0.6744828", "0.6729575", "0.667739", "0.6609902", "0.66050464", "0.65896267", "0.6580334", "0.6529961", "0.65025735", "0.6491872", "0.64774084", "0.64734167", "0.6466493", "0.64576507", "0.6432028", "0.6398666", "0.6398666", "0.6382895", "0.6376971", "0.6375905", "0.6360607", "0.6346246", "0.6345222", "0.63279253", "0.63272", "0.6310051", "0.63087887", "0.63087887", "0.62962204", "0.6283534", "0.62672555", "0.6260541", "0.62423617", "0.6240553", "0.6237622", "0.62361485", "0.6201538", "0.6200745", "0.62001294", "0.6198634", "0.6184021", "0.61816555", "0.61815995", "0.6161268", "0.61462206", "0.6143329", "0.6140354", "0.61347455", "0.61333257", "0.61281794", "0.6126602", "0.61249936", "0.6116816", "0.61044115", "0.6099393", "0.60992706", "0.60874736", "0.6086207", "0.60719734", "0.6068319", "0.6066875", "0.6065806", "0.60630053", "0.60032487", "0.60026515", "0.5996955", "0.5991332", "0.5984085", "0.5982773", "0.5981959", "0.5980955", "0.5974326", "0.5965578", "0.5963853", "0.5962428", "0.59591204", "0.5956766", "0.59552807", "0.59500235", "0.5945819", "0.5936921", "0.5935336", "0.5915943", "0.59145576", "0.59124196", "0.5909785", "0.58992517", "0.5891434", "0.58862466", "0.5885032", "0.5883707", "0.58794785", "0.5875459" ]
0.0
-1
pre : max > 0 post: constructs a sequential tree with given number of nodes
public IntTree(int max) { if (max <= 0) { throw new IllegalArgumentException("max: " + max); } overallRoot = buildTree(1, max); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "private IntTreeNode buildTree(int n, int max) {\r\n if (n > max) {\r\n return null;\r\n } else {\r\n return new IntTreeNode(n, buildTree(2 * n, max),\r\n buildTree(2 * n + 1, max));\r\n }\r\n }", "private IntTreeNode buildTree(int n, int max) {\n if (n > max) {\n return null;\n } else {\n return new IntTreeNode(n, buildTree(2 * n, max),\n buildTree(2 * n + 1, max));\n }\n }", "node GrowthTreeGen(int maxdepth){\n\t\tint i;\n\t\tbyte a;\n\t\tnode t, p;\n\t\tif(maxdepth == 0) // to the limit then choose a terminal\n\t\t{\n\t\t\ti = IRandom(0, gltcard - 1);\n\t\t\tt = new node(glterminal[i].name, VOIDVALUE);\n\t\t\treturn t;\n\t\t} \n\t\telse // choosing from function and terminal\n\t\t {\n\t\t\ti = IRandom(0, gltermcard - 1);\n\t\t\tt = new node(glterm[i].name, VOIDVALUE);\n\t\t\tif(glterm[i].arity > 0) // if it is function\n\t\t\t{\n\t\t\t\tt.children = GrowthTreeGen(maxdepth - 1);\n\t\t\t\tp = t.children;\n\t\t\t\tfor(a = 1; a < glterm[i].arity; a++) {\n\t\t\t\t\tp.sibling = GrowthTreeGen(maxdepth - 1);\n\t\t\t\t\tp = p.sibling;\n\t\t\t\t}\n\t\t\t\tp.sibling = null;\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t}", "public BuildTree createBuildTree(int maxElements) {\n BuildTree buildTree = new BuildTree();\n createBuildTree(0, buildTree, maxElements);\n return buildTree;\n }", "int[][] constructTree(ArrayList<Integer> arr, int n)\n {\n int x = (int)(Math.ceil(Math.log(n)/Math.log(2))); // Height of the tree\n\n int max_size = 2 * (int)Math.pow(2, x) - 1;\n int[][] tree = new int[max_size][4];\n\n build(tree, 0, n - 1, 1, arr);\n return tree;\n }", "public static void createTree(SuccessorGenerator generator, GameState initialState)\n {\n LinkedList<GameState> currentLevel = new LinkedList<GameState>();\n currentLevel.add(initialState);\n Player currentPlayer = Player.PLAYER_MAX;\n \n int level = 0;\n while(true)\n {\n LinkedList<GameState> nextLevel = new LinkedList<GameState>();\n \n /*Gerando todas as ações possíveis para o nível atual.*/\n for(GameState state : currentLevel)\n {\n generator.generateSuccessors(state, currentPlayer);\n \n for(int i = 0; i < state.getChildren().size(); i++)\n {\n GameState successorState = state.getChildren().get(i);\n nextLevel.add(successorState);\n }\n }\n System.out.println(\"Expandindo nível \"+(level++)+\" com \"+nextLevel.size()+\" estados.\");\n \n /*Alternando jogadores*/\n currentPlayer = (currentPlayer == Player.PLAYER_MAX)?\n Player.PLAYER_MIN:\n Player.PLAYER_MAX; \n \n /*Busca termina quando todos os estados foram explorados*/\n if(nextLevel.isEmpty()) break;\n \n currentLevel.clear();\n currentLevel.addAll(nextLevel);\n }\n \n }", "private Node CreateTree() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tQueue<Node> q = new LinkedList<>();\n\t\tint item = sc.nextInt();\n\t\tNode nn = new Node();\n\t\tnn.val = item;\n\t\troot = nn;\n\t\tq.add(nn);\n\t\twhile (!q.isEmpty()) {\n\t\t\tNode rv = q.poll();\n\t\t\tint c1 = sc.nextInt();\n\t\t\tint c2 = sc.nextInt();\n\t\t\tif (c1 != -1) {\n\t\t\t\tNode node = new Node();\n\t\t\t\tnode.val = c1;\n\t\t\t\trv.left = node;\n\t\t\t\tq.add(node);\n\t\t\t}\n\t\t\tif (c2 != -1) {\n\t\t\t\tNode node = new Node();\n\t\t\t\tnode.val = c2;\n\t\t\t\trv.right = node;\n\t\t\t\tq.add(node);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\n\t}", "public static void build ()\r\n {\r\n lgt.insert(1);\r\n lgt.insert(2);\r\n lgt.insert(5);\r\n \r\n lgt.findRoot();\r\n lgt.insert(3);\r\n \r\n lgt.findRoot();\r\n lgt.insert(4);\r\n \r\n lgt.insert(6);\r\n lgt.findParent();\r\n lgt.insert(7);\r\n \r\n }", "public IntTree(int numberOfNodes) {\r\n assert numberOfNodes >= 0;\r\n \r\n // x = change(x)\r\n overallRoot = buildTree(1, numberOfNodes);\r\n }", "public IntTree(int numberOfNodes) {\n assert numberOfNodes >= 0;\n \n overallRoot = buildTree(1, numberOfNodes);\n }", "@Test\n public void whenAddNineNodesOnDifferentLevelsThenResultNineNodesFromBottomToTop() {\n tree.addChild(nodeOne, \"1\");\n tree.addChild(new TreeNode(), \"1\");\n tree.addChild(new TreeNode(), \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeOne.addChild(new TreeNode(), \"2\");\n nodeOne.addChild(new TreeNode(), \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n nodeTwo.addChild(new TreeNode(), \"3\");\n nodeTwo.addChild(new TreeNode(), \"3\");\n assertThat(tree.getChildren().toString(), is(\"[3, 3, 3, 2, 2, 2, 1, 1, 1]\"));\n }", "private void buildTree(int n, double x, double y, double a, double branchLength) {\n tree = new ArrayList<>();\n populateTree(n, x, y, a, branchLength);\n }", "public static Node[] initTree(int[] arr){\n int i;\n Node[] tree = new Node[n];\n Node node;\n for(i = 0; i < n; i++){\n node = new Node();\n node.data = arr[i];\n tree[i] = node;\n }\n tree[0].data = arr[0];\n tree[1].data = arr[1];\n tree[2].data = arr[2];\n tree[3].data = arr[3];\n tree[4].data = arr[4];\n tree[5].data = arr[5];\n tree[6].data = arr[6];\n\n tree[0].parent = null;\n tree[0].left = tree[1];\n tree[0].right = tree[2];\n\n tree[1].parent = tree[0];\n tree[1].left = null;\n tree[1].right = tree[3];\n\n tree[2].parent = tree[0];\n tree[2].left = tree[4];\n tree[2].right = null;\n \n tree[3].parent = tree[1];\n tree[3].left = null;\n tree[3].right = null;\n\n tree[4].parent = tree[2];\n tree[4].left = tree[5];\n tree[4].right = tree[6];\n\n tree[5].parent = tree[4];\n tree[5].left = null;\n tree[5].right = null;\n\n tree[6].parent = tree[4];\n tree[6].left = null;\n tree[6].right = null;\n\n root = tree[0];\n return tree; \n }", "private Node constructParsedTree(Node[] nodes) {\n int rootIndex = 0;\n for (int i = 0; i < nodes.length; i++) {\n if (nodes[i].getFather() > 0)\n nodes[nodes[i].getFather() - 1].addChild(nodes[i]);\n else\n rootIndex = i;\n }\n return nodes[rootIndex];\n }", "static TreeNode createTree(TreeNode root, int[] arr, int index) {\r\n\t\t\r\n\t\tif (index < arr.length) {\r\n\t\t\tTreeNode tmp = null;\r\n\t\t\tif (arr[index]>=0) {\r\n\t\t\t\ttmp = new TreeNode(arr[index]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttmp = null;\r\n\t\t\t}\r\n\t\t\troot= tmp;\r\n\t\t\t\r\n\t\t\tif (root != null) {\r\n\t\t\t\troot.left = createTree(tmp.left,arr,index*2+1);\r\n\t\t\t\troot.right = createTree(tmp.right,arr,index*2+2);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn root;\r\n\t}", "static TreeNode createTree(TreeNode root, int[] arr, int index) {\r\n\t\t\r\n\t\tif (index < arr.length) {\r\n\t\t\tTreeNode tmp = null;\r\n\t\t\tif (arr[index]>=0) {\r\n\t\t\t\ttmp = new TreeNode(arr[index]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttmp = null;\r\n\t\t\t}\r\n\t\t\troot= tmp;\r\n\t\t\t\r\n\t\t\tif (root != null) {\r\n\t\t\t\troot.left = createTree(tmp.left,arr,index*2+1);\r\n\t\t\t\troot.right = createTree(tmp.right,arr,index*2+2);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn root;\r\n\t}", "public Tree(int x[]){\n\t\tint n = x.length;\n\t\tif(n == 0)\n\t\t\treturn;\n\t\tTreeNode nodes[] = new TreeNode[n];\n\t\tfor(int i=0; i < n; i++)\n\t\t\tnodes[i] = x[i] != -10 ? (new TreeNode(x[i])) : null;\n\t\troot = nodes[0];\n\t\tfor(int i=0; i < n; i++){\n\t\t\tTreeNode curr = nodes[i];\n\t\t\tif(curr == null)\n\t\t\t\tcontinue;\n\t\t\tint lc = 2*i+1;\n\t\t\tint rc = 2*i+2;\n\t\t\tif(lc < n)\n\t\t\t\tcurr.left = nodes[lc];\n\t\t\tif(rc < n)\n\t\t\t\tcurr.right = nodes[rc];\n\t\t}\n\t}", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "abstract AbstractTree<T> maximize(int maxOperationsCount);", "public abstract int getMaxChildren();", "public static Node createLargeTree() {\n final int dcCount = 2;\n final int rackCount = 6;\n final int snCount = 6;\n final int hdCount = 12;\n\n int id = 0;\n // root\n Node root = new Node();\n root.setName(\"root\");\n root.setId(id++);\n root.setType(Types.ROOT);\n root.setSelection(Selection.STRAW);\n // DC\n List<Node> dcs = new ArrayList<Node>();\n for (int i = 1; i <= dcCount; i++) {\n Node dc = new Node();\n dcs.add(dc);\n dc.setName(\"dc\" + i);\n dc.setId(id++);\n dc.setType(Types.DATA_CENTER);\n dc.setSelection(Selection.STRAW);\n dc.setParent(root);\n // racks\n List<Node> racks = new ArrayList<Node>();\n for (int j = 1; j <= rackCount; j++) {\n Node rack = new Node();\n racks.add(rack);\n rack.setName(dc.getName() + \"rack\" + j);\n rack.setId(id++);\n rack.setType(StorageSystemTypes.RACK);\n rack.setSelection(Selection.STRAW);\n rack.setParent(dc);\n // storage nodes\n List<Node> sns = new ArrayList<Node>();\n for (int k = 1; k <= snCount; k++) {\n Node sn = new Node();\n sns.add(sn);\n sn.setName(rack.getName() + \"sn\" + k);\n sn.setId(id++);\n sn.setType(StorageSystemTypes.STORAGE_NODE);\n sn.setSelection(Selection.STRAW);\n sn.setParent(rack);\n // hds\n List<Node> hds = new ArrayList<Node>();\n for (int l = 1; l <= hdCount; l++) {\n Node hd = new Node();\n hds.add(hd);\n hd.setName(sn.getName() + \"hd\" + l);\n hd.setId(id++);\n hd.setType(StorageSystemTypes.DISK);\n hd.setWeight(100);\n hd.setParent(sn);\n }\n sn.setChildren(hds);\n }\n rack.setChildren(sns);\n }\n dc.setChildren(racks);\n }\n root.setChildren(dcs);\n return root;\n }", "@Test\n\tpublic void testBuildTree() {\n\t\tTree<Integer> tree = new Tree<Integer> ();\n\t\t//add first level children, 1\n\t\tNode<Integer> root = tree.getRoot();\n\t\troot.addChild(new Node<Integer>());\n\t\tNode<Integer> c1 = root.getFirstChild();\n\t\tassertTrue(c1.getData() == null);\n\t\t//add second level children, 3\n\t\tc1.addChild(new Node<Integer> ());\n\t\tc1.addChild(new Node<Integer> ());\n\t\tc1.addChild(new Node<Integer> ());\n\t\tassertTrue(c1.countChildren() == 3);\n\t\t//add third level children, 3 * 3\n\t\tint[][] leafData = {\n\t\t\t\t{8,7,2},\n\t\t\t\t{9,1,6},\n\t\t\t\t{2,4,1}\n\t\t};\n\t\tNode<Integer> c2 = c1.getFirstChild();\n\t\tint i = 0;\n\t\twhile (c2 != null) {\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][0]));\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][1]));\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][2]));\n\t\t\tc2 = c2.next();\n\t\t\ti++;\n\t\t}\n\t\tassertTrue(tree.countDepth() == 3);\n\t\tNode<Integer> leaf = root;\n\t\twhile (leaf.countChildren() > 0) {\n\t\t\tleaf = leaf.getFirstChild();\n\t\t}\n\t\tassertTrue(leaf.getData() == 8);\t\t\t\n\t}", "node FullTreeGen(int maxdepth){\n\t\tint i;\n\t\tbyte a;\n\t\tnode t, p;\n\t\tif(maxdepth == 0) // to the limit then choose a terminal\n\t\t{\n\t\t\ti = IRandom(0, gltcard - 1);\n\t\t\tt = new node(glterminal[i].name, VOIDVALUE);\n\t\t\treturn t;\n\t\t} \n\t\telse // choosing from function\n\t\t{\n\t\t\ti = IRandom(0, glfcard - 1);\n\t\t\tt = new node(glfunction[i].name, VOIDVALUE);\n\t\t\tt.children = FullTreeGen(maxdepth - 1);\n\t\t\tp = t.children;\n\t\t\tfor(a = 1; a < glfunction[i].arity; a++) {\n\t\t\t\tp.sibling = FullTreeGen(maxdepth - 1);\n\t\t\t\tp = p.sibling;\n\t\t\t}\n\t\t\tp.sibling = null;\n\t\t\treturn t;\n\t\t}\n\t}", "public Node(int numberChildren){\n board = new Board();\n children = new Node[numberChildren];\n }", "public List<TreeNode> generateTrees(int n) {\n return helper(1, n);\n }", "public static Node construct(Integer[] arr){\r\n Node root = null;\r\n Stack<Node> st = new Stack<>();\r\n \r\n for(int i=0; i<arr.length; i++){\r\n Integer data = arr[i];\r\n if(data != null){\r\n Node nn = new Node(data);\r\n if(st.size()==0){\r\n root = nn;\r\n st.push(nn);\r\n }\r\n else{\r\n st.peek().children.add(nn);\r\n st.push(nn);\r\n }\r\n }\r\n else{ //if data is equal to NULL\r\n st.pop();\r\n }\r\n }\r\n return root;\r\n }", "public TtreeNode() {\n\t numberOfNodes++;\n\t }", "public static void main(String[] args) \n\t{\n\t\ttree x = new tree(0);\n\t\t\n\t\ttreenode r = x.root;\n\t\t\n//\t\ttreenode c = r;\n//\t\tfor(int i =1;i<=4;i++)\n//\t\t{\n//\t\t\tfor(int j=0;j<=8;j=j+4)\n//\t\t\t{\n//\t\t\t\ttreenode n = new treenode(i+j);\n//\t\t\t\tif(j==0)\n//\t\t\t\t{\n//\t\t\t\t\tr.child.add(n);\n//\t\t\t\t\tc = n;\n//\t\t\t\t}\n//\t\t\t\telse\n//\t\t\t\t{\n//\t\t\t\t\tc.child.add(n);\n//\t\t\t\t\tc = n;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\ttreenode c1 = r;\n\t\ttreenode c2 = r;\n\t\ttreenode c3 = r;\n\t\ttreenode c4 = r;\n\t\tfor(int i=1;i<13;i++)\n\t\t{\n\t\t\ttreenode n = new treenode(i);\n\t\t\tif(i%4==1)\n\t\t\t{\n\t\t\t\tc1.child.add(n);\n\t\t\t\tc1 = n;\n\t\t\t}\n\t\t\tif(i%4==2)\n\t\t\t{\n\t\t\t\tc2.child.add(n);\n\t\t\t\tc2 = n;\n\t\t\t}\n\t\t\tif(i%4==3)\n\t\t\t{\n\t\t\t\tc3.child.add(n);\n\t\t\t\tc3 = n;\n\t\t\t}\n\t\t\tif(i%4==0)\n\t\t\t{\n\t\t\t\tc4.child.add(n);\n\t\t\t\tc4 = n;\n\t\t\t}\n\t\t}\n\t\tx.traverse(r);\n\t}", "public List<TreeNode> generateTrees(int n) {\n if(n==0) return new ArrayList<TreeNode>();\n return generate(1, n);\n }", "private void CreateTree()\r\n\t{\r\n\r\n\t\t//sample nodes which are not identical\r\n\t\ta = new Node(1);\r\n\t\ta.left = new Node(3);\r\n\t\ta.left.left = new Node(5);\r\n\t\ta.right = new Node(2);\r\n\r\n\r\n\t\tb = new Node(2);\r\n\t\tb.left = new Node(1);\r\n\t\tb.right = new Node(3);\r\n\t\tb.right.right = new Node(7);\r\n\t\tb.left.right = new Node(4);\r\n\r\n\t\t//sample nodes which are identical\r\n\t\ta1 = new Node(1);\r\n\t\ta1.left = new Node(3);\r\n\t\ta1.left.left = new Node(5);\r\n\t\ta1.right = new Node(2);\r\n\r\n\r\n\t\tb1 = new Node(1);\r\n\t\tb1.left = new Node(3);\r\n\t\tb1.right = new Node(2);\r\n\t\tb1.left.left = new Node(5); \r\n\t}", "public IntTree(int max) {\r\n if (max <= 0) {\r\n throw new IllegalArgumentException(\"max: \" + max);\r\n }\r\n overallRoot = buildTree(1, max);\r\n }", "static binaryTreeNode levelorderConstruct(int[] keys){\n binaryTreeNode head = new binaryTreeNode(keys[0]);\n int count = 1;\n binaryTreeNode temp;\n List<binaryTreeNode> l = new ArrayList<>();\n temp = head;\n while(count < keys.length){\n if(temp.lnode == null){\n temp.lnode = new binaryTreeNode(keys[count]);\n count++;\n l.add(temp.lnode);\n } else if(temp.rnode == null){\n temp.rnode = new binaryTreeNode(keys[count]);\n count++;\n l.add(temp.rnode);\n temp = l.remove(0);\n }\n }\n return head;\n }", "private void constructBSTree(Node<T> u, int n, String lr) {\n\t\tn++;\n\t\taddToPT(n, lr + \" \" + u.x.toString());\n\t\telements.add(u.x);\n\t\tif (u.left != nil)\n\t\t\tconstructBSTree(u.left, n, lr + \"L\");\n\t\tif (u.right != nil)\n\t\t\tconstructBSTree(u.right, n, lr + \"R\");\n\t}", "private Node makeTree(Node currentNode, DataNode dataNode,\r\n\t\t\tint featureSubsetSize, int height) {\n\r\n\t\tif (dataNode.labels.size() < this.traineeDataSize / 25 || height > 7) {\r\n\t\t\treturn new Node(majority(dataNode));\r\n\t\t}\r\n\t\telse{\r\n\r\n\t\t\tEntropyCalculation e1 = new EntropyCalculation();\r\n\r\n\t\t\tNode n = e1.maxGainedElement(dataNode.features, dataNode.labels, featureSubsetSize); //new\r\n\r\n\r\n\t\t\tif(e1.zeroEntropy){\r\n\r\n\t\t\t\tcurrentNode = new Node(dataNode.labels.get(0));\r\n\r\n\t\t\t\t/*currentNode.attribute = dataNode.features;\r\n\t\t\t\tcurrentNode.decision = dataNode.labels;\r\n\t\t\t\tcurrentNode.nodeValue = dataNode.labels.get(0);*/\r\n\r\n\t\t\t\treturn currentNode;\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\tcurrentNode = new Node();\r\n\r\n\t\t\t\tcurrentNode.featureIndexColumn = n.featureIndexColumn;\r\n\t\t\t\tcurrentNode.featureIndexRow = n.featureIndexRow;\r\n\r\n\t\t\t\tcurrentNode.attribute = dataNode.features;\r\n\t\t\t\tcurrentNode.decision = dataNode.labels;\r\n\r\n\t\t\t\tcurrentNode.nodeValue = dataNode.features.get(currentNode.featureIndexRow).get(currentNode.featureIndexColumn);\r\n\r\n\t\t\t\tcurrentNode.leftChild = new Node();\r\n\t\t\t\tcurrentNode.rightChild = new Node();\r\n\r\n\t\t\t\tDataNode leftNode = new DataNode();\r\n\t\t\t\tDataNode rightNode = new DataNode();\r\n\r\n\t\t\t\tfor (int i = 0; i < dataNode.features.size(); i++) {\r\n\r\n\t\t\t\t\tif(currentNode.nodeValue >= dataNode.features.get(i).get(currentNode.featureIndexColumn)) {\r\n\r\n\t\t\t\t\t\tleftNode.features.add(dataNode.features.get(i));\r\n\t\t\t\t\t\tleftNode.labels.add(dataNode.labels.get(i));\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\trightNode.features.add(dataNode.features.get(i));\r\n\t\t\t\t\t\trightNode.labels.add(dataNode.labels.get(i));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif((leftNode.labels.isEmpty() || rightNode.labels.isEmpty()) && height == 0){\r\n\t\t\t\t\tSystem.out.println(\"Ghapla\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcurrentNode.leftChild = makeTree(currentNode.leftChild, leftNode, featureSubsetSize, height+1);\r\n\r\n\t\t\t\tcurrentNode.rightChild = makeTree(currentNode.rightChild, rightNode, featureSubsetSize, height+1);\r\n\r\n\t\t\t\treturn currentNode;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static Node constructTree() {\n\n Node node2 = new Node(2, null, null);\n Node node8 = new Node(8, null, null);\n Node node12 = new Node(12, null, null);\n Node node17 = new Node(17, null, null);\n\n Node node6 = new Node(6, node2, node8);\n Node node15 = new Node(15, node12, node17);\n\n //Root Node\n Node node10 = new Node(10, node6, node15);\n\n return node10;\n }", "public void createNode()\r\n\t{\r\n\t\tTreeNode first=new TreeNode(1);\r\n\t\tTreeNode second=new TreeNode(2);\r\n\t\tTreeNode third=new TreeNode(3);\r\n\t\tTreeNode fourth=new TreeNode(4);\r\n\t\tTreeNode fifth=new TreeNode(5);\r\n\t\tTreeNode sixth=new TreeNode(6);\r\n\t\tTreeNode seventh=new TreeNode(7);\r\n\t\tTreeNode eight=new TreeNode(8);\r\n\t\tTreeNode nine=new TreeNode(9);\r\n\t\troot=first;\r\n\t\tfirst.left=second;\r\n\t\tfirst.right=third;\r\n\t\tsecond.left=fourth;\r\n\t\tthird.left=fifth;\r\n\t\tthird.right=sixth;\r\n\t\tfifth.left=seventh;\r\n\t\tseventh.right=eight;\r\n\t\teight.left=nine;\r\n\t\t\r\n\t}", "public TreeNode(){ this(null, null, 0);}", "static SimpleTreeNode getTree(int[] values) {\n\n if(values.length>0) {\n\n SimpleTreeNode root = new SimpleTreeNode(values[0]);\n Queue<SimpleTreeNode> queue = new LinkedList<>();\n\n queue.add(root);\n\n boolean done = false;\n int index = 1;\n\n while (!done) {\n\n SimpleTreeNode node = queue.element();\n int childCount = node.getChildCount();\n\n if(childCount==0) {\n node.add(new SimpleTreeNode(values[index++]));\n queue.add((SimpleTreeNode)node.getChildAt(0));\n } else if(childCount==1) {\n node.add(new SimpleTreeNode(values[index++]));\n queue.add((SimpleTreeNode)node.getChildAt(1));\n } else {\n queue.remove();\n }\n\n done = (index == values.length);\n }\n\n return root;\n } else {\n return null;\n }\n }", "private TreeNode buildTree(int[] preorder, int[] inorder, int[] preIndex, int[] inIndex, int target) {\n if (inIndex[0] >= inorder.length || inorder[inIndex[0]] == target) {\n return null;\n }\n TreeNode root = new TreeNode(preorder[preIndex[0]]);\n //preorder, advance the index by 1 sice we already finish the root;\n preIndex[0]++;\n root.left = buildTree(preorder, inorder, preIndex, inIndex, root.val);\n //after finishing left subtree, we can advance the index by 1\n inIndex[0]++;\n root.right = buildTree(preorder, inorder, preIndex, inIndex, target);\n return root;\n }", "public static TreeNode mkTree(String str) {\n\n int[] arr = StrToIntArray(str);\n TreeNode[] nodes = new TreeNode[arr.length + 1];\n for (int i = 1; i < nodes.length; i++) {\n if (arr[i - 1] != Integer.MAX_VALUE) {\n nodes[i] = new TreeNode(arr[i - 1]);\n } else {\n nodes[i] = null;\n }\n }\n\n TreeNode node = null;\n for (int i = 1; i < nodes.length / 2; i++) {\n node = nodes[i];\n if (node == null) continue;\n node.left = nodes[2 * i];\n node.right = nodes[2 * i + 1];\n }\n return nodes[1];\n }", "@Override\n\tpublic TreeNode buildTree(String[] exp) {\n\t\tStack<TreeNode> stk = new Stack<TreeNode>();\n\t\tTreeNode tmpL, tmpR, tmpRoot;\n\t\tint i;\n\n\t\tfor(String s: exp) {\n\t\t\tif(s.equals(EMPTY))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\ttry {\n\t\t\t\ti = Integer.parseInt(s);\n\t\t\t\tstk.push(new TreeNode(EMPTY + i));\n\t\t\t}\n\t\t\tcatch (NumberFormatException n) {\n\t\t\t\ttmpR = stk.pop();\n\t\t\t\ttmpL = stk.pop();\n\t\t\t\ttmpRoot = new TreeNode(s, tmpL, tmpR);\n\t\t\t\tstk.push(tmpRoot);\n\t\t\t}\n\t\t}\n\n\t\treturn stk.pop();\n\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 }", "private HuffmanNode buildTree(int n) {\r\n \tfor (int i = 1; i <= n; i++) {\r\n \t\tHuffmanNode node = new HuffmanNode();\r\n \t\tnode.left = pQueue.poll();\r\n \t\tnode.right = pQueue.poll();\r\n \t\tnode.frequency = node.left.frequency + node.right.frequency;\r\n \t\tpQueue.add(node);\r\n \t}\r\n return pQueue.poll();\r\n }", "private static Node buildSmallerTree() {\n\t\tNode root = createNode(10);\n\t\troot.leftChild = createNode(25);\n\t\troot.rightChild = createNode(25);\n\t\troot.leftChild.leftChild = createNode(13);\n\t\troot.rightChild.rightChild = createNode(7);\n\t\troot.leftChild.rightChild = createNode(27);\n\t\t\n\t\treturn root;\n\t}", "public static void createTreeFromTraversals() {\n int[] preorder = {9, 2, 1, 0, 5, 3, 4, 6, 7, 8};\n int[] inorder = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n Tree tree = new Tree();\n tree.head = recur(preorder, inorder, 0, 0, inorder.length-1);\n tree.printPreOrder();\n System.out.println();\n tree.printInOrder();\n System.out.println();\n }", "public TreeNode buildTree(ArrayList<TreeNode> nodes){\n // if empty arraylist\n if (nodes.size() == 0){\n return null;\n }\n // else\n TreeNode root = nodes.get(0);\n // Structure the tree\n for (int i = 0; i < nodes.size(); i++){\n if ((2*i+1) < nodes.size()){\n nodes.get(i).left = nodes.get(2*i+1);\n } else {\n nodes.get(i).left = null;\n }\n if ((2*i+2) < nodes.size()){\n nodes.get(i).right = nodes.get(2*i+2);\n } else {\n nodes.get(i).right = null;\n }\n }\n \n return root;\n }", "public static Node buildRandomTree() {\n\t\tNode root = createNode(15);\n\t\troot.leftChild = createNode(10);\n\t\troot.rightChild = createNode(4);\n\t\troot.leftChild.leftChild = createNode(25);\n\t\troot.leftChild.leftChild.rightChild = createNode(27);\n\t\troot.leftChild.leftChild.leftChild = createNode(13);\n\t\troot.leftChild.rightChild = createNode(25);\n\t\troot.leftChild.rightChild.rightChild = createNode(7);\n\t\t\n\t\treturn root;\n\t}", "public static void main(String[] args) {\n\n\n\t\tArrayList<Node> N = new ArrayList<Node>();\n\t\t\n\t\t/*\n\t\t * ##### Encoding Model 2 ###### \n\t\t */\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the privilege nodes\n\t\t */\n\t\tfor(int i=1; i<7; i++)\n\t\t{\n\t\t\tN.add(new Node(\"p\"+i, 1));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the exploit nodes\t\t \n\t\t */\n\t\tfor(int i=1; i<8; i++)\n\t\t{\n\t\t\tN.add(new Node(\"e\"+i, 2));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the child nodes\n\t\t */\n\t\tfor(int i=1; i<12; i++)\n\t\t{\n\t\t\tN.add(new Node(\"c\"+i, 0));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Assigning the children and parent(s) for each node according to model 2\n\t\t */\n\t\t\n\t\tArrayList<Node> nil = new ArrayList<Node>();\n\t\t\n\t\tN.get(0).setParents(nil);\n\t\tN.get(0).addChild(N.get(6));\n\t\t\n\t\tN.get(6).addParent(N.get(0));\n\t\tN.get(6).addChild(N.get(1));\n\t\tN.get(6).addChild(N.get(13));\n\t\tN.get(6).addChild(N.get(14));\n\t\t\n\t\tN.get(1).addParent(N.get(6));\n\t\tN.get(1).addChild(N.get(7));\n\t\tN.get(1).addChild(N.get(8));\n\t\t\n\t\tN.get(7).addParent(N.get(1));\n\t\tN.get(7).addChild(N.get(15));\n\t\tN.get(7).addChild(N.get(2));\n\t\t\n\t\tN.get(2).addParent(N.get(7));\n\t\tN.get(2).addChild(N.get(10));\t\t\n\t\t\n\t\tN.get(8).addParent(N.get(1));\n\t\tN.get(8).addChild(N.get(16));\n\t\tN.get(8).addChild(N.get(3));\n\t\t\n\t\tN.get(3).addParent(N.get(8));\n\t\tN.get(3).addChild(N.get(9));\n\t\t\n\t\tN.get(10).addParent(N.get(2));\n\t\tN.get(10).addChild(N.get(5));\n\t\tN.get(10).addChild(N.get(19));\n\t\tN.get(10).addChild(N.get(20));\n\t\t\n\t\tN.get(9).addParent(N.get(3));\n\t\tN.get(9).addChild(N.get(4));\n\t\tN.get(9).addChild(N.get(17));\n\t\tN.get(9).addChild(N.get(18));\n\t\t\n\t\tN.get(4).addParent(N.get(9));\n\t\tN.get(4).addChild(N.get(12));\n\t\t\n\t\tN.get(5).addParent(N.get(10));\n\t\tN.get(5).addChild(N.get(11));\n\t\t\n\t\tN.get(12).addParent(N.get(4));\n\t\tN.get(12).addChild(N.get(22));\n\t\tN.get(12).addChild(N.get(23));\n\t\t\n\t\tN.get(11).addParent(N.get(5));\n\t\tN.get(11).addChild(N.get(21));\n\t\tN.get(11).addChild(N.get(23));\n\t\t\n\t\tN.get(13).addParent(N.get(6));\n\t\tN.get(14).addParent(N.get(6));\n\t\tN.get(15).addParent(N.get(7));\n\t\tN.get(16).addParent(N.get(8));\n\t\tN.get(17).addParent(N.get(9));\n\t\tN.get(18).addParent(N.get(9));\n\t\tN.get(19).addParent(N.get(10));\n\t\tN.get(20).addParent(N.get(10));\n\t\tN.get(21).addParent(N.get(11));\n\t\tN.get(22).addParent(N.get(12));\n\t\tN.get(23).addParent(N.get(11));\n\t\tN.get(23).addParent(N.get(12));\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the C,I,A values for each node\n\t\t */\n\t\t\n\t\tN.get(0).setImpacts(4, 4, 4);\n\t\tN.get(1).setImpacts(1, 2, 3);\n\t\tN.get(2).setImpacts(2, 2, 1);\n\t\tN.get(3).setImpacts(1, 2, 1);\n\t\tN.get(4).setImpacts(1, 1, 1);\n\t\tN.get(5).setImpacts(3, 2, 3);\n\t\tN.get(13).setImpacts(3,3,3);\n\t\tN.get(14).setImpacts(3,3,3);\n\t\tN.get(15).setImpacts(3,3,3);\n\t\tN.get(16).setImpacts(3,3,3);\n\t\tN.get(17).setImpacts(3,3,3);\n\t\tN.get(18).setImpacts(3,3,3);\n\t\tN.get(19).setImpacts(3,3,3);\n\t\tN.get(20).setImpacts(3,3,3);\n\t\tN.get(21).setImpacts(3,3,3);\n\t\tN.get(22).setImpacts(3,3,3);\n\t\tN.get(23).setImpacts(2,2,1);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * This block helps see the setup of the whole tree. \n\t\t * Comment out if not required to see the parent children relationship of each node.\n\t\t */\n\t\t\n\t\tfor(int i=0; i<24; i++)\n\t\t{\n\t\t\tSystem.out.println(\"\\n\\n\" + N.get(i).getName() + \" < C=\" + N.get(i).getImpactC() + \", I=\" + N.get(i).getImpactI() + \", A=\" + N.get(i).getImpactA() + \" >\" );\n\t\t\tSystem.out.println(\"Parents: \");\n\t\t\tfor(int j=0; j<N.get(i).getParents().size(); j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getParents().get(j).getName() + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nChildren: \");\n\t\t\tfor(int k=0; k<N.get(i).getChildren().size(); k++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getChildren().get(k).getName() + \" \");\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * Calling the method which will perform the C,I,A impact analysis \n\t\t */\n\t\t\n\t\t//Node n = new Node(); //Commented out as extended Main to Node and declared impactAnalysis() as static \n\t\t\n\t\tImpactAnalyzer ia = new ImpactAnalyzer();\n\t\tia.analyze(2, 2, 1, N);\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n // int m = sc.nextInt();\n int n = sc.nextInt();\n Tree[] tree = new Tree[n];\n for (int i = 0; i < n; i++) {\n tree[i] = new Tree(i + 1, sc.nextInt());\n }\n // System.out.println(Arrays.toString(tree));\n\n // Arrays.sort(tree,(a,b)->b.num-a.num);\n StringBuilder sb = new StringBuilder();\n int first = 0;\n\n boolean shibai = false;\n\n while (first < n) {\n while (first < n && tree[first].num == 0) {\n first++;\n }\n int idx = first + 1;\n out:\n while (idx < n) {\n while (idx < n && tree[idx].num == 0) {\n idx++;\n\n }\n while (idx < n && first < n && tree[idx].num > 0 && tree[first].num > 0) {\n\n sb.append(tree[first].type)\n .append(\" \")\n .append(tree[idx].type)\n .append(\" \");\n tree[idx].num--;\n tree[first].num--;\n if (tree[first].num == 0) {\n first++;\n break out;\n }\n }\n }\n// System.out.println(Arrays.toString(tree));\n// System.out.println(idx);\n if (idx > n - 1) {\n if (tree[first].num == 0) break;\n if (tree[first].num == 1) {\n sb.append(tree[first].type);\n break;\n } else {\n System.out.println(\"-\");\n shibai = true;\n break;\n }\n }\n }\n\n// while (true){\n// if(tree[0].num==1){\n// sb.append(tree[0].type);\n// break;\n// }\n// if(tree[1].num==0){\n// System.out.println(\"-\");\n// shibai=true;\n// break;\n// }\n// while (tree[1].num>0){\n// sb.append(tree[0].type).append(\" \").append(tree[1].type).append(\" \");\n// tree[0].num--;\n// tree[1].num--;\n// }\n// //System.out.println(sb.toString());\n// // System.out.println(Arrays.toString(tree));\n// // Arrays.sort(tree,(a,b)->b.num-a.num);\n//\n// }\n if (!shibai) {\n System.out.println(sb.toString());\n }\n\n\n }", "private Node constructInternal(List<Node> children){\r\n\r\n // Base case: root found\r\n if(children.size() == 1){\r\n return children.get(0);\r\n }\r\n\r\n // Generate parents\r\n boolean odd = children.size() % 2 != 0;\r\n for(int i = 1; i < children.size(); i += 2){\r\n Node left = children.get(i-1);\r\n Node right = children.get(i);\r\n Node parent = new Node(Utility.SHA512(left.hash + right.hash), left, right);\r\n children.add(parent);\r\n }\r\n\r\n // If the number of nodes is odd, \"inherit\" the remaining child node (no hash needed)\r\n if(odd){\r\n children.add(children.get(children.size() - 1));\r\n }\r\n return constructInternal(children);\r\n }", "public int createSpanningTree() {\n\n\t\treturn primMST(edges);\n\t}", "private Node(int c) {\n this.childNo = c; // Construct a node with c children.\n }", "protected void makeTheTree(){\n\n structure.getRootNode().branchList.add(structure.getNode11());\n structure.getRootNode().branchList.add(structure.getNode12());\n structure.getRootNode().branchList.add(structure.getNode13());\n\n structure.getNode11().branchList.add(structure.getNode111());\n structure.getNode11().branchList.add(structure.getNode112());\n structure.getNode11().branchList.add(structure.getNode113());\n\n structure.getNode13().branchList.add(structure.getNode131());\n\n structure.getNode112().branchList.add(structure.getNode1121());\n\n }", "public static TreeNode buildTreeFromArray(Integer[] values) {\n if(values == null || values.length == 0) {\n return null;\n }\n\n TreeNode root = new TreeNode(values[0]);\n Queue<TreeNode> tree = new LinkedList<>();\n tree.add(root);\n\n for (int i = 0; i < (values.length) / 2; i++) {\n if(values[i] != null) {\n TreeNode currentParent = tree.poll();\n if (values[(i * 2) + 1] != null) {\n TreeNode left = new TreeNode(values[(i * 2) + 1]);\n currentParent.setLeft(left);\n tree.add(left);\n }\n if (values[(i * 2) + 2] != null) {\n TreeNode right = new TreeNode(values[(i * 2) + 2]);\n currentParent.setRight(right);\n tree.add(right);\n }\n }\n }\n return root;\n }", "public RoutingTree(int size){\r\n\t\tthis.routes = new Route[size];\r\n\t}", "private PersistentLinkedList<T> pop() {\n //the latest element won't become empty\n int index = this.treeSize - 1;\n Node<T> newRoot = new Node<>(branchingFactor);\n\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n ArrayList<Node<T>> newNodes = new ArrayList<>();\n newNodes.add(newRoot);\n ArrayList<Integer> newNodesIndices = new ArrayList<>();\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData traverseData = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, index, b));\n currentNode = traverseData.currentNode;\n currentNewNode = traverseData.currentNewNode;\n newNodes.add(currentNewNode);\n newNodesIndices.add(index / b);\n index = traverseData.index;\n }\n newNodesIndices.add(index);\n\n for (int i = 0; i < branchingFactor && i < index; i++) {\n currentNewNode.set(i, currentNode.get(i));\n }\n currentNewNode.set(index, null);\n\n if (index == 0) {\n int latestIndex = newNodes.size() - 2;\n newNodes.get(latestIndex).set(newNodesIndices.get(latestIndex), null);\n\n for (int i = latestIndex; i > 0; i--) {\n if (newNodesIndices.get(i) == 0) {\n newNodes.get(i - 1).set(newNodesIndices.get(i - 1), null);\n } else {\n break;\n }\n }\n }\n\n if (newNodes.size() > 1) {\n int nonNullChildren = 0;\n for (Node<T> child : newRoot.children) {\n if (child != null) {\n nonNullChildren++;\n }\n }\n if (nonNullChildren == 1) { //need new root\n newRoot = newRoot.get(0);\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth - 1,\n this.base / branchingFactor, this.treeSize - 1, unusedTreeIndices,\n indexCorrespondingToTheFirstElement, indexCorrespondingToTheLatestElement);\n }\n }\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth, this.base,\n this.treeSize - 1, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }", "public static TreeNode getTree() {\n\t\tTreeNode a = new TreeNode(\"a\", 314);\n\t\tTreeNode b = new TreeNode(\"b\", 6);\n\t\tTreeNode c = new TreeNode(\"c\", 271);\n\t\tTreeNode d = new TreeNode(\"d\", 28);\n\t\tTreeNode e = new TreeNode(\"e\", 0);\n\t\tTreeNode f = new TreeNode(\"f\", 561);\n\t\tTreeNode g = new TreeNode(\"g\", 3);\n\t\tTreeNode h = new TreeNode(\"h\", 17);\n\t\tTreeNode i = new TreeNode(\"i\", 6);\n\t\tTreeNode j = new TreeNode(\"j\", 2);\n\t\tTreeNode k = new TreeNode(\"k\", 1);\n\t\tTreeNode l = new TreeNode(\"l\", 401);\n\t\tTreeNode m = new TreeNode(\"m\", 641);\n\t\tTreeNode n = new TreeNode(\"n\", 257);\n\t\tTreeNode o = new TreeNode(\"o\", 271);\n\t\tTreeNode p = new TreeNode(\"p\", 28);\n\t\t\n\t\ta.left = b; b.parent = a;\n\t\tb.left = c; c.parent = b;\n\t\tc.left = d;\t d.parent = c;\n\t\tc.right = e; e.parent = c;\n\t\tb.right = f; f.parent = b;\n\t\tf.right = g; g.parent = f;\n\t\tg.left = h; h.parent = g;\n\t\ta.right = i; i.parent = a;\n\t\ti.left = j; j.parent = i;\n\t\ti.right = o; o.parent = i;\n\t\tj.right = k; k.parent = j;\n\t\to.right = p; p.parent = o;\n\t\tk.right = n; n.parent = k;\n\t\tk.left = l; l.parent = k;\n\t\tl.right = m; m.parent = l;\n\t\t\n\t\td.childrenCount = 0;\n\t\te.childrenCount = 0;\n\t\tc.childrenCount = 2;\n\t\tb.childrenCount = 6;\n\t\tf.childrenCount = 2;\n\t\tg.childrenCount = 1;\n\t\th.childrenCount = 0;\n\t\tl.childrenCount = 1;\n\t\tm.childrenCount = 0;\n\t\tn.childrenCount = 0;\n\t\tk.childrenCount = 3;\n\t\tj.childrenCount = 4;\n\t\to.childrenCount = 1;\n\t\tp.childrenCount = 0;\n\t\ti.childrenCount = 7;\n\t\ta.childrenCount = 15;\n\t\t\n\t\treturn a;\n\t}", "public static void main(String[] args) {\n// TreeNode node1 = new TreeNode(0);\n// TreeNode node2l = new TreeNode(3);\n// TreeNode node2r = new TreeNode(5);\n//// TreeNode node3l = new TreeNode(2);\n// TreeNode node3r = new TreeNode(2);\n//// TreeNode node4l = new TreeNode(4);\n// TreeNode node4r = new TreeNode(1);\n//\n// node1.left = node2l;\n// node1.right = node2r;\n//// node2l.left = node3l;\n// node2l.right = node3r;\n// node3r.right = node4r;\n//\n\n int[] nums = {3, 2, 1, 6, 0, 5};\n\n }", "public int numTrees () { throw new RuntimeException(); }", "public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n Map<Integer, Set<Integer>> map = new HashMap<Integer,Set<Integer>>();\n int[] valArr = new int[n];\n int[] colArr = new int[n];\n for(int i =0;i<n;i++){\n valArr[i] = scan.nextInt();\n }\n for(int i =0;i<n;i++){\n colArr[i] = scan.nextInt();\n }\n for(int i=0;i<n-1;i++){\n //10^10 / 1024/ 1024/1024, 10GB\n int a = scan.nextInt()-1;\n int b = scan.nextInt()-1;\n \n //Tree[] treeArr = new Tree[n];\n if(map.containsKey(a)){\n map.get(a).add(b);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(b);\n map.put(a,set);\n }\n //case 1-2, 2-1\n if(map.containsKey(b)){\n map.get(b).add(a);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(a);\n map.put(b,set);\n } \n }\n Set<Integer> visited = new HashSet<Integer>();\n Tree root =buildTree(map,0,0,valArr,colArr);\n return root;\n }", "private void gameTree(MinimaxNode<GameState> currentNode, int depth, int oIndex){\n currentNode.setNodeIndex(oIndex); \n if (depth == 0) {\n return;\n }\n else{\n if (currentNode.getState().isDead(oIndex)){ //checks to see if current player is dead, if so, just skips their moves\n int newIndex = (oIndex + 1) % currentNode.getState().getNrPlayers();\n/* if(oIndex == 3){\n newIndex = 0;\n }\n else{\n newIndex = oIndex + 1;\n }*/\n gameTree(currentNode, depth-1, newIndex);\n }\n else{\n //this if statement sets up chance nodes, if the target has been met it will create 5 children nodes with randomly generated new target postitions \n if(!currentNode.getState().hasTarget()){\n currentNode.setChanceNode();\n for(int i = 1; i <= 5; i++){\n try{\n GameState newState = (GameState)currentNode.getState().clone();\n newState.chooseNextTarget();\n MinimaxNode<GameState> childNode = new MinimaxNode(newState);\n childNode.setProbability(0.2);\n currentNode.addChild(childNode); \n }\n catch (CloneNotSupportedException e){\n System.out.println(\"Clone not excepted\");\n }\n \n }\n for (int i = 0; i < currentNode.getNumberOfChildren(); i++){\n gameTree(currentNode.getChildren().get(i), depth, oIndex);\n }\n\n }\n else{\n List<Integer> options = new ArrayList();\n for (int i = 1; i <= 4; i++) {\n if (currentNode.getState().isLegalMove(oIndex, i)){\n options.add(i);\n }\n }\n for (int i = 0; i < options.size(); i++){\n try{\n GameState newState = (GameState)currentNode.getState().clone();\n newState.setOrientation(oIndex, options.get(i));\n newState.updatePlayerPosition(oIndex);\n MinimaxNode<GameState> childNode = new MinimaxNode(newState);\n currentNode.addChild(childNode);\n }\n catch (CloneNotSupportedException e){\n System.out.println(\"Clone not excepted\");\n }\n }\n int newIndex = (oIndex + 1) % currentNode.getState().getNrPlayers();\n /* if(oIndex == 3){\n newIndex = 0;\n }\n else{\n newIndex = oIndex + 1;\n }*/\n for (int i = 0; i < currentNode.getNumberOfChildren(); i++){\n gameTree(currentNode.getChildren().get(i), depth-1, newIndex);\n }\n } \n } \n }\n }", "public static TreeNode buildTree01() {\n\t\t\n\t\tTreeNode root = new TreeNode(5);\n\t\t\n\t\troot.left = new TreeNode(4);\n\t\troot.left.left = new TreeNode(11);\n\t\troot.left.left.left = new TreeNode(7);\n\t\troot.left.left.right = new TreeNode(2);\n\t\t\n\t\troot.right = new TreeNode(8);\n\t\troot.right.left = new TreeNode(13);\n\t\troot.right.right = new TreeNode(4);\n\t\troot.right.right.right = new TreeNode(1);\n\t\t\n\t\treturn root;\n\t}", "private Node buildIntraGroupTree(int groupId, int index) {\n Set<Integer> executorsHostingTask = getExecutorsHostingTask(groupId);\n List<Integer> executorIds = rotateList(\n new ArrayList<>(executorsHostingTask), index);\n\n if (executorIds.size() == 0) {\n return null;\n }\n // sort the taskIds to make sure everybody creating the same tree\n Collections.sort(executorIds);\n // now check weather root is part of this group\n int rootExecutor = logicalPlan.getWorkerForForLogicalId(root);\n if (executorIds.contains(rootExecutor)) {\n // move the executor to 0\n executorIds.remove(new Integer(rootExecutor));\n executorIds.add(0, rootExecutor);\n }\n\n int execLevel = 0;\n // create the root of the tree\n Node rootNode = createTreeNode(groupId, executorIds.get(0), index);\n rootNode.setExecLevel(execLevel);\n // now lets create the tree\n Queue<Node> queue = new LinkedList<>();\n Node current = rootNode;\n int i = 1;\n while (i < executorIds.size()) {\n if (current.getChildren().size() < intraNodeDegree) {\n // create a tree node and add it to the current node as a child\n Node e = createTreeNode(groupId, executorIds.get(i), index);\n current.addChild(e);\n e.setParent(current);\n e.setExecLevel(execLevel);\n queue.add(e);\n i++;\n } else {\n execLevel++;\n // the current node is filled, lets move to the next\n current = queue.poll();\n }\n }\n\n if (execLevel > maxLevelsAtExecutor) {\n maxLevelsAtExecutor = execLevel;\n }\n\n return rootNode;\n }", "int maxDepth();", "private Node createLevelOrder(Stack s, Node root, int i, int n) {\n if (i < n) {\n // store temporary Node\n root = new Node(s.getArray()[i]);\n\n // recurse on left then right\n root.setLeft(createLevelOrder(s, root.getLeft(), 2 * i + 1, n));\n root.setRight(createLevelOrder(s, root.getRight(), 2 * i + 2, n));\n }\n return root;\n }", "TreeNode generateBinaryTree(int[] arr) {\n\n if (arr.length == 0) {\n\n return null;\n }\n return buildNode(arr, 0, 1, 2);\n }", "public static TreeNode buildTree() {\n\t\t\n\t\tTreeNode root = new TreeNode(1);\n\t\t\n\t\tTreeNode left = new TreeNode(2);\n\t\tleft.left = new TreeNode(4);\n\t\tleft.right = new TreeNode(5);\n\t\tleft.right.right = new TreeNode(8);\n\t\t\n\t\tTreeNode right = new TreeNode(3);\n\t\tright.left = new TreeNode(6);\n\t\tright.right = new TreeNode(7);\n\t\tright.right.left = new TreeNode(9);\n\t\t\n\t\troot.left = left;\n\t\troot.right = right;\n\t\t\n\t\treturn root;\n\t}", "public static TreeNode generateBinaryTree3() {\n // Nodes\n TreeNode root = new TreeNode(1);\n TreeNode rootLeft = new TreeNode(2);\n TreeNode rootLeftLeft = new TreeNode(3);\n TreeNode rootLeftLeftLeft = new TreeNode(4);\n TreeNode rootRight = new TreeNode(5);\n TreeNode rootRightRight = new TreeNode(6);\n TreeNode rootRightRightRight = new TreeNode(7);\n // Edges\n root.left = rootLeft;\n rootLeft.left = rootLeftLeft;\n rootLeftLeft.left = rootLeftLeftLeft;\n root.right = rootRight;\n rootRight.right = rootRightRight;\n rootRightRight.right = rootRightRightRight;\n\n // Return root\n return root;\n }", "private void seed(List<T> items){\n for(T item: items) {\n Node<T> newNode = new Node<T>(item);\n this.count++;\n if(this.root == null){\n this.root = newNode;\n } else {\n Node temp = this.root;\n newNode.next = temp;\n this.root = newNode;\n }\n }\n\n }", "private void constructBSTPTree(Node<T> u, int n) {\n\t\tn++;\n\t\taddToPT(n, u.x);\n\t\tSystem.out.printf(\"%d: %s \", n, u.x);\n\t\tif (u.left != nil)\n\t\t\tconstructBSTPTree(u.left, n);\n\t\tif (u.right != nil)\n\t\t\tconstructBSTPTree(u.right, n);\n\t}", "private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}", "private static BigInteger singleTree(int n) {\n \tif (T[n] != null) {\n \t\treturn T[n];\n \t}\n \tBigInteger ret = BigInteger.ZERO;\n \tfor (int i = 1; i < n; i++) {\n \t\tret = ret.add(binomial(n, i).multiply(BigInteger.valueOf(n - i).pow(n - i))\n \t\t\t\t .multiply(BigInteger.valueOf(i).pow(i)));\n \t}\n \treturn T[n] = ret.divide(BigInteger.valueOf(n));\n }", "public BTreeNode(int t){\n T = t;\n isLeaf = true;\n key = new int[2*T-1];\n c = new BTreeNode[2*T];\n n=0; \n }", "private ITree.Node createNode(int i) {\n if (i < currentSize) {\n ITree.Node node = new ITree.Node(this.elements[i]);\n node.setLeftNode(createNode(this.leftChild(i)));\n node.setRightNode(createNode(this.rightChild(i)));\n\n return node;\n }\n return null;\n }", "protected int numChildren() {\r\n return 3;\r\n }", "public abstract int getNumChildren();", "private BSTNode linkedListToTree (Iterator iter, int n) {\n // TODO Your code here\n \tint leftlenght,rightlength;\n \tdouble LenOfleft = n/2;\n \tleftlenght = (int)java.lang.Math.floor(LenOfleft);\n \trightlength = n - leftlenght -1;\n \t\n \t//linkedListToTree(iter,leftlenght);\n \t//Object item = iter.next();\n \t//linkedListToTree(iter,rightlength);\n \t\n return new BSTNode(linkedListToTree(iter,leftlenght),iter.next(),linkedListToTree(iter,rightlength)) ;\n }", "public static TreeNode buildTreeFromList(int... values) {\n TreeNode root = null;\n for(int val: values) {\n root = insert(root, val);\n }\n return root;\n }", "public static void InitLattice(int maxLevel)\n\t{\n\t\ttheArray = new Node[maxLevel][maxLevel];\n\t\tfor (int r = 0; r < maxLevel; r++) {\n\t\t\tfor (int c = 0; c < maxLevel -r; c++)\n\t\t\t{\n\t\t\t\ttheArray[r][c] = new Node();\n\t\t\t\ttheArray[r][c].item = 0; \n } \n }\n\t\troot = theArray[0][0];\n }", "public static void createBST(int[] keys) {\n\t\tcounter = 0;\r\n\t\tTreeNode root = null;\r\n\t\t// System.out.println(keys.length);\r\n\t\tSet<Integer> set = new LinkedHashSet<Integer>();\r\n\t\tfor (int i = 0; i < keys.length; i++) {\r\n\t\t\tset.add(keys[i]);\r\n\t\t}\r\n\t\tint index = 0;\r\n\t\tint[] keys1 = new int[set.size()];\r\n\t\tfor (int i : set) {\r\n\t\t\t// System.out.println(i);\r\n\t\t\tkeys1[index++] = i;\r\n\t\t}\r\n\t\tfor (int i : keys1) {\r\n\t\t\tif (root != null) {\r\n\r\n\t\t\t\tinsert(root, i);\r\n\t\t\t} else {\r\n\r\n\t\t\t\t// create root node for BST.\r\n\t\t\t\troot = new TreeNode(null, 2, null);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(counter);\r\n\t\t}\r\n\r\n\t}", "public static Node constructTree(int[] preorder, int[] isLeaf)\r\n {\r\n // pIndex stores index of next unprocessed key in preorder sequence\r\n // start with the root node (at 0'th index)\r\n // Using Atomicint as Integer is passed by value in Java\r\n AtomicInteger pIndex = new AtomicInteger(0);\r\n return construct(preorder, isLeaf, pIndex);\r\n }", "public KdTree() {\n size = 0;\n }", "public void ids (String input, int limit)\r\n\t\t{\r\n\t\t\tNode root_ids= new Node (input);\r\n\t\t\tNode current = new Node(root_ids.getState());\r\n\t\t\t\r\n\t\t\tArrayList<String> visited = new ArrayList<String>();\r\n\t\t\tArrayList<String> children = new ArrayList<String>();\r\n\t\t\tStack<Node> stack_dfs = new Stack<Node>();\r\n\t\t\t\r\n\t\t\tint nodes_popped = 0;\r\n\t\t\tint stack_max_size = 0;\r\n\t\t\tint stack_max_total = 0;\r\n\t\t\tint depth = 0;\r\n\t\t\t\r\n\t\t\tcurrent.cost = 0;\r\n\t\t\tcurrent.depth = 0;\r\n\t\t\t\r\n\t\t\tgoal_ids = isGoal(current.getState());\r\n\t\t\t\r\n\t\t\twhile(depth <= limit)\r\n\t\t\t{\r\n\t\t\t\tif (goal_ids == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Clear the visited array for backtracking purposes\r\n\t\t\t\tvisited.clear();\r\n\t\t\t\t\r\n\t\t\t\twhile(!goal_ids)\r\n\t\t\t\t{\r\n\t\t\t\t\tvisited.add(current.getState());\r\n\t\t\t\t\tchildren = Successor.findChildren(current.getState());\r\n\t\t\t\t\r\n\t\t\t\t\t// Depth limit check. This loop never runs if the node depth is greater then the limit\r\n\t\t\t\t\tif (current.getDepth() < limit)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (String a : children)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (visited.contains(a))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tNode nino = new Node(a);\r\n\t\t\t\t\t\t\tcurrent.children_nodes.add(nino);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tint cost = isCost(current.getState(), nino.getState());\r\n\t\t\t\t\t\t\tnino.cost = cost;\r\n\t\t\t\t\t\t\tnino.parent = current;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Repeated state check\r\n\t\t\t\t\t\t\tif (!stack_dfs.contains(nino))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tstack_dfs.add(nino);\r\n\t\t\t\t\t\t\t\tstack_max_size++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (current.getDepth() >= limit - 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tint copy = stack_max_size;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (copy > stack_max_total)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tstack_max_total = copy;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tdepth++;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// If there is no solution found at the depth limit, return no solution\r\n\t\t\t\t\tif (stack_dfs.empty() == true)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSolution.noSolution(limit);\t\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tcurrent = stack_dfs.pop();\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Set depth of node so it can be checked in next iteration\r\n\t\t\t\t\tcurrent.setDepth(current.parent.getDepth() + 1);\r\n\t\t\t\t\tnodes_popped++;\r\n\t\t\t\t\tstack_max_size--;\r\n\t\t\t\t\tgoal_ids = isGoal(current.getState());\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\tgoal_ids = false;\r\n\t\t\tSystem.out.println(\"IDS Solved!!\");\r\n\t\t\t\r\n\t\t\tif (stack_max_total > stack_max_size)\r\n\t\t\t{\r\n\t\t\t\tstack_max_size = stack_max_total;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSolution.performSolution(current, root_ids, nodes_popped, stack_max_size);\r\n\t\t}", "public TreeNode constructMaximumBinaryTree2(int[] nums) {\n if (nums == null) return null;\n return build(nums, 0, nums.length - 1);\n }", "public TreeNodeImpl(N value) {\n this.value = value;\n }", "private void buildSkiTree(SkiNode head) {\n\t\tupdateNextNode(head, head.i - 1, head.j, 0);\n\t\tupdateNextNode(head, head.i, head.j - 1, 1);\n\t\tupdateNextNode(head, head.i + 1, head.j, 2);\n\t\tupdateNextNode(head, head.i, head.j + 1, 3);\n\t}", "@Test\n public void testLargeTree() {\n BPlusTree<Integer, Integer> tree = new BPlusTree<Integer, Integer>();\n ArrayList<Integer> numbers = new ArrayList<Integer>(100000);\n for (int i = 0; i < 100000; i++) {\n numbers.add(i);\n }\n Collections.shuffle(numbers);\n for (int i = 0; i < 100000; i++) {\n tree.insert(numbers.get(i), numbers.get(i));\n }\n testTreeInvariants(tree);\n int depth = treeDepth(tree.root);\n assertTrue(depth < 11);\n }", "public int[] createTree(int[] input) {\n int[] bit = new int[input.length + 1];\n for (int i = 0; i < input.length; i++) {\n update(bit, input[i], i);\n }\n return bit;\n }", "private BinaryTree<Character> constructTree(){\n if(pq.size() == 1) return pq.poll().data;\n if(pq.size() == 0) return null;\n // Poll the lowest two trees, combine them, then stick them back in the queue.\n Helper<BinaryTree<Character>> temp0 = pq.poll(), temp1 = pq.poll(),\n result = new Helper<>(temp0.priority + temp1.priority, new BinaryTree<>(temp0.data, null , temp1.data));\n pq.add(result);\n // Call again to keep constructing.\n return constructTree();\n }", "List<TreeNodeDTO> genTree(boolean addNodeSize, boolean addRootNode, List<Long> disabledKeys);", "public void buildMaxHeap(){\n\t\tfor(int i = (n-2)/2 ; i >= 0; i--){\n\t\t\tmaxHeapfy(i);\n\t\t}\n\t}", "private void makePrioQ()\n\t{\n\t\tprioQ = new PrioQ();\n\t\t\n\t\tfor(int i = 0; i < canonLengths.length; i++)\n\t\t{\n\t\t\tif(canonLengths[i] == 0)\n\t\t\t\tcontinue;\n\t\t\tNode node = new Node(i, canonLengths[i]);\n\t\t\tprioQ.insert(node);\n\t\t}\n\t}", "public void RecursiveExpansion() throws TreeTooBigException {\r\n int transIndex; //Index to count transitions\r\n int[] newMarkup; //markup used to create new node\r\n boolean aTransitionIsEnabled = false; //To check for deadlock\r\n //Attribute used for assessing whether a node has occured before\r\n boolean repeatedNode = false; \r\n \r\n boolean allOmegas = false;\r\n \r\n boolean[] enabledTransitions = \r\n tree.dataLayer.getTransitionEnabledStatusArray(markup);\r\n\r\n //For each transition\r\n for (int i = 0; i < enabledTransitions.length; i++) {\r\n if (enabledTransitions[i] == true) {\r\n //Set transArray of to true for this index\r\n transArray[i] = true;\r\n \r\n //System.out.println(\"\\n Transition \" + i + \" Enabled\" );\r\n aTransitionIsEnabled = true;\r\n \r\n //print (\"\\n Old Markup is :\", markup);//debug\r\n \r\n //Fire transition to produce new markup vector\r\n newMarkup = fire(i);\r\n \r\n //print (\"\\n New Markup is :\", newMarkup);//debug\r\n \r\n //Check for safeness. If any of places have > 1 token set variable.\r\n for (int j = 0; j < newMarkup.length; j++) {\r\n if (newMarkup[j] > 1 || newMarkup[j] == -1) {\r\n tree.moreThanOneToken = true;\r\n break;\r\n }\r\n } \r\n \r\n //Create a new node using the new markup vector and attach it to\r\n //the current node as a child.\r\n children[i] = \r\n new myNode(newMarkup, this, tree, depth + 1);\r\n \r\n /* Now need to (a) check if any omegas (represented by -1) need to \r\n * be inserted in the markup vector of the new node, and (b) if the \r\n * resulting markup vector has appeared anywhere else in the tree. \r\n * We must do (a) before (b) as we need to know if the new node \r\n * contains any omegas to be able to compare it with existing nodes. \r\n */ \r\n allOmegas = children[i].InsertOmegas();\r\n \r\n //check if the resulting markup vector has occured anywhere else in the tree\r\n repeatedNode = (tree.root).FindMarkup(children[i]);\r\n \r\n if (tree.nodeCount >= Pipe.MAX_NODES && !tree.tooBig) {\r\n tree.tooBig = true;\r\n throw new TreeTooBigException();\r\n }\r\n \r\n if (!repeatedNode && !allOmegas) {\r\n children[i].RecursiveExpansion();\r\n }\r\n }\r\n }\r\n \r\n if (!aTransitionIsEnabled) {\r\n System.err.println(\"No transition enabled\");\r\n if (!tree.noEnabledTransitions || tree.pathToDeadlock.length < depth-1) {\r\n RecordDeadlockPath();\r\n tree.noEnabledTransitions = true;\r\n } else {\r\n System.err.println(\"Deadlocked node found, but path is not shorter\"\r\n + \" than current path.\");\r\n }\r\n } else {\r\n //System.out.println(\"Transitions enabled.\");\r\n }\r\n }", "protected void createTree() {\n\n\t\tint nextPlayer = opponent;\n\n\t\tQueue<Node> treeQueue = new LinkedList<Node>();\n\t\tWinChecker winCheck = new WinChecker();\n\n\t\ttreeQueue.add(parent);\n\n\t\twhile (!treeQueue.isEmpty()) {\n\t\t\tNode currentNode = treeQueue.poll();\n\n\t\t\tif (currentNode.getMove().Row != -1\n\t\t\t\t\t&& currentNode.getMove().Col != -1) {\n\t\t\t\tgb.updateBoard(currentNode.getMove());\n\n\t\t\t\tif (winCheck.getWin(gb) >= 0) {\n\t\t\t\t\tgb.revertBoard(currentNode.getMove());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tgb.revertBoard(currentNode.getMove());\n\t\t\t}\n\n\t\t\t// Restricting the depth to which we will create the tree\n\t\t\tif (currentNode.getPly() > 2) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tfor (List<Hexagon> tempList : this.gb.getBoard()) {\n\t\t\t\tfor (Hexagon tempHex : tempList) {\n\n\t\t\t\t\tif (tempHex == null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tempHex.getValue() == EMPTY) {\n\n\t\t\t\t\t\tif (currentNode.getPly() % 2 == 0) {\n\t\t\t\t\t\t\tnextPlayer = opponent;\n\t\t\t\t\t\t} else if (currentNode.getPly() % 2 == 1) {\n\t\t\t\t\t\t\tnextPlayer = player;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tMove nextMove = new Move(nextPlayer, false,\n\t\t\t\t\t\t\t\ttempHex.getRow(), tempHex.getColumn());\n\n\t\t\t\t\t\tNode newNode = new Node(currentNode.getPly() + 1,\n\t\t\t\t\t\t\t\tnextMove);\n\t\t\t\t\t\tnewNode.setParent(currentNode);\n\n\t\t\t\t\t\tcurrentNode.children.add(newNode);\n\n\t\t\t\t\t\ttreeQueue.add(newNode);\n\t\t\t\t\t\ttempHex.setValue(EMPTY);\n\t\t\t\t\t}// End of if statement\n\n\t\t\t\t}// End of inner ForLoop\n\t\t\t}// End of outer ForLoop\n\n\t\t\t// currentNode.printChildren();\n\n\t\t}// End of While Loop\n\n\t}", "public static int numTrees(int n) {\n return helper(1,n);\n }", "public BinaryTree generateTree(int height) {\n\t\tList<Double> randomNums = new ArrayList<>();\n\t\tint numNodes = (int) (Math.pow(2, height)) - 1;\n\t\tfor (int i = 0; i < numNodes; i++) {\n\t\t\tdouble randomNum = Math.round(Math.random() * 100 * 100) / 100;\n\t\t\t// no duplicate numbers\n\t\t\twhile (randomNums.contains(randomNum)) {\n\t\t\t\trandomNum = Math.round(Math.random() * 100 * 100) / 100;\n\t\t\t}\n\t\t\trandomNums.add(randomNum);\n\t\t}\n\t\treturn new BinaryTree(randomNums);\n\t}", "public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n int[] arrayNode = new int[n + 1];\n for (int i = 1; i <= n; i++) {\n arrayNode[i] = scan.nextInt();\n }\n\n Color[] arrayColor = new Color[n + 1];\n for (int i = 1; i <= n; i++) {\n if (scan.nextInt() == 0) {\n arrayColor[i] = Color.RED;\n } else {\n arrayColor[i] = Color.GREEN;\n }\n }\n\n List<Integer>[] adjacentsList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n adjacentsList[i] = new ArrayList<Integer>();\n }\n\n for (int i = 0; i < n - 1; i++) {\n int x = scan.nextInt();\n int y = scan.nextInt();\n\n adjacentsList[x].add(y);\n adjacentsList[y].add(x);\n }\n\n scan.close();\n\n List<Integer>[] childrenList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n childrenList[i] = new ArrayList<Integer>();\n }\n\n int[] depths = new int[n + 1];\n boolean[] visited = new boolean[n + 1];\n\n Queue<Integer> queue = new LinkedList<Integer>();\n depths[1] = 0;\n queue.offer(1);\n while (!queue.isEmpty()) {\n int head = queue.poll();\n\n if (visited[head]) {\n continue;\n }\n visited[head] = true;\n\n for (int adjacent : adjacentsList[head]) {\n if (!visited[adjacent]) {\n childrenList[head].add(adjacent);\n depths[adjacent] = depths[head] + 1;\n queue.offer(adjacent);\n }\n }\n }\n\n Tree[] nodes = new Tree[n + 1];\n for (int i = 1; i <= n; i++) {\n if (childrenList[i].isEmpty()) {\n nodes[i] = new TreeLeaf(arrayNode[i], arrayColor[i], depths[i]);\n } else {\n nodes[i] = new TreeNode(arrayNode[i], arrayColor[i], depths[i]);\n }\n }\n for (int i = 1; i <= n; i++) {\n for (int child : childrenList[i]) {\n ((TreeNode) nodes[i]).addChild(nodes[child]);\n }\n }\n return nodes[1];\n }", "public int numTrees(int n) {\n if(n == 0 || n == 1 || n == 2)\n return n;\n int[] c = new int[n + 1];\n c[2] = 2;\n c[3] = 5;\n for(int i = 4; i < n + 1; i++){\n for(int j = 2; j < i; j++)\n c[i] += 2 * (c[j]);\n }\n return c[n];\n }", "public Tree(List<E> values, boolean d)\n {\n debug = d;\n Node empty = new Node(null, null, null);\n Deque<Node> worklist = new ArrayDeque<>();\n int size = values.size();\n int leafCount = nextPowerOf2(size);\n int i;\n \n for(i = 0; i < size; i++)\n if (values.get(i) == null)\n System.out.println(\"ignoring null value\");\n else\n worklist.addLast(new Node(values.get(i), null, null));\n\n for(; i < leafCount; i++)\n worklist.addLast(empty);\n \n while (worklist.size() > 1)\n {\n if (debug)\n {\n System.out.println(\"\\n worklist length = \" + worklist.size());\n System.out.println(\"worklist = \" + worklist);\n }\n Node n1 = worklist.pollFirst();\n Node n2 = worklist.pollFirst();\n \n if (n1 == empty)\n worklist.addLast(n2);\n else if (n2 == empty)\n worklist.addLast(n1);\n else if (n1.compareTo(n2) < 0)\n worklist.addLast(new Node(n1.value, n1.promote(), n2));\n else\n worklist.addLast(new Node(n2.value, n1, n2.promote()));\n }\n \n root = worklist.pollFirst();\n if (root.value == null)\n root = null;\n }" ]
[ "0.70973307", "0.6751411", "0.66854113", "0.64451873", "0.6424889", "0.6381877", "0.6303501", "0.62664574", "0.62151986", "0.6209923", "0.62042654", "0.6175858", "0.6171591", "0.6152238", "0.6146272", "0.61250675", "0.61250675", "0.612282", "0.60971236", "0.60964537", "0.60915256", "0.6070151", "0.6067518", "0.60631716", "0.60611975", "0.6034824", "0.6015568", "0.60086465", "0.60024565", "0.5975105", "0.59528863", "0.5915818", "0.5902475", "0.5882151", "0.58801305", "0.58539", "0.5832408", "0.58254975", "0.582288", "0.58185333", "0.5798954", "0.5774012", "0.5758395", "0.57484746", "0.5734374", "0.5731797", "0.57267475", "0.5724582", "0.5717613", "0.5713419", "0.5710256", "0.5707343", "0.5707102", "0.57041013", "0.570112", "0.5690503", "0.5687148", "0.56812996", "0.56797796", "0.5673447", "0.56612545", "0.56503415", "0.56399816", "0.56246376", "0.5616528", "0.56165045", "0.56144047", "0.56110555", "0.5602067", "0.5599575", "0.5597541", "0.55952877", "0.5589444", "0.55833614", "0.55828893", "0.5580518", "0.5575581", "0.5574375", "0.55631685", "0.5550758", "0.55442744", "0.5540472", "0.5537287", "0.5536227", "0.5533807", "0.5528032", "0.5527583", "0.552461", "0.5523391", "0.55135584", "0.5506418", "0.550125", "0.5500879", "0.5499186", "0.54954875", "0.5494366", "0.5483997", "0.548349", "0.54726654", "0.5466541" ]
0.5873476
35
IntTree methods from class post: returns a sequential tree with n as its root unless n is greater than max, in which case it returns an empty tree
private IntTreeNode buildTree(int n, int max) { if (n > max) { return null; } else { return new IntTreeNode(n, buildTree(2 * n, max), buildTree(2 * n + 1, max)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private IntTreeNode buildTree(int n, int max) {\r\n if (n > max) {\r\n return null;\r\n } else {\r\n return new IntTreeNode(n, buildTree(2 * n, max),\r\n buildTree(2 * n + 1, max));\r\n }\r\n }", "public IntTree(int max) {\r\n if (max <= 0) {\r\n throw new IllegalArgumentException(\"max: \" + max);\r\n }\r\n overallRoot = buildTree(1, max);\r\n }", "public IntTree(int max) {\n if (max <= 0) {\n throw new IllegalArgumentException(\"max: \" + max);\n }\n overallRoot = buildTree(1, max);\n }", "abstract AbstractTree<T> maximize(int maxOperationsCount);", "private Node CreateTree() {\n\t\tScanner sc = new Scanner(System.in);\n\t\tQueue<Node> q = new LinkedList<>();\n\t\tint item = sc.nextInt();\n\t\tNode nn = new Node();\n\t\tnn.val = item;\n\t\troot = nn;\n\t\tq.add(nn);\n\t\twhile (!q.isEmpty()) {\n\t\t\tNode rv = q.poll();\n\t\t\tint c1 = sc.nextInt();\n\t\t\tint c2 = sc.nextInt();\n\t\t\tif (c1 != -1) {\n\t\t\t\tNode node = new Node();\n\t\t\t\tnode.val = c1;\n\t\t\t\trv.left = node;\n\t\t\t\tq.add(node);\n\t\t\t}\n\t\t\tif (c2 != -1) {\n\t\t\t\tNode node = new Node();\n\t\t\t\tnode.val = c2;\n\t\t\t\trv.right = node;\n\t\t\t\tq.add(node);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\n\t}", "private static BigInteger singleTree(int n) {\n \tif (T[n] != null) {\n \t\treturn T[n];\n \t}\n \tBigInteger ret = BigInteger.ZERO;\n \tfor (int i = 1; i < n; i++) {\n \t\tret = ret.add(binomial(n, i).multiply(BigInteger.valueOf(n - i).pow(n - i))\n \t\t\t\t .multiply(BigInteger.valueOf(i).pow(i)));\n \t}\n \treturn T[n] = ret.divide(BigInteger.valueOf(n));\n }", "public GeneralTreeOfInteger() {\n root = null;\n count = 0;\n }", "public IntTree() {\n overallRoot = null;\n }", "public abstract int getMaxChildren();", "public IntTree(int numberOfNodes) {\n assert numberOfNodes >= 0;\n \n overallRoot = buildTree(1, numberOfNodes);\n }", "node GrowthTreeGen(int maxdepth){\n\t\tint i;\n\t\tbyte a;\n\t\tnode t, p;\n\t\tif(maxdepth == 0) // to the limit then choose a terminal\n\t\t{\n\t\t\ti = IRandom(0, gltcard - 1);\n\t\t\tt = new node(glterminal[i].name, VOIDVALUE);\n\t\t\treturn t;\n\t\t} \n\t\telse // choosing from function and terminal\n\t\t {\n\t\t\ti = IRandom(0, gltermcard - 1);\n\t\t\tt = new node(glterm[i].name, VOIDVALUE);\n\t\t\tif(glterm[i].arity > 0) // if it is function\n\t\t\t{\n\t\t\t\tt.children = GrowthTreeGen(maxdepth - 1);\n\t\t\t\tp = t.children;\n\t\t\t\tfor(a = 1; a < glterm[i].arity; a++) {\n\t\t\t\t\tp.sibling = GrowthTreeGen(maxdepth - 1);\n\t\t\t\t\tp = p.sibling;\n\t\t\t\t}\n\t\t\t\tp.sibling = null;\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t}", "protected final IntervalNode treeMax() {\n\tIntervalNode x = this;\n\twhile(x.right != IntervalNode.nullIntervalNode) {\n\t x = x.right;\n\t}\n\treturn(x);\n }", "abstract AbstractTree<T> maximize();", "public IntTree(int numberOfNodes) {\r\n assert numberOfNodes >= 0;\r\n \r\n // x = change(x)\r\n overallRoot = buildTree(1, numberOfNodes);\r\n }", "public BuildTree createBuildTree(int maxElements) {\n BuildTree buildTree = new BuildTree();\n createBuildTree(0, buildTree, maxElements);\n return buildTree;\n }", "int[][] constructTree(ArrayList<Integer> arr, int n)\n {\n int x = (int)(Math.ceil(Math.log(n)/Math.log(2))); // Height of the tree\n\n int max_size = 2 * (int)Math.pow(2, x) - 1;\n int[][] tree = new int[max_size][4];\n\n build(tree, 0, n - 1, 1, arr);\n return tree;\n }", "public Node getPartialTree(int minData, int maxData) {\r\n\t\t\tNode ret = new Node(data.get(minData));\r\n\t\t\t\r\n\t\t\t//if not a leaf, add children\r\n\t\t\tif (!isLeaf()) {\r\n\t\t\t\tret.addChild(children.get(minData));\r\n\t\t\t\tret.addChild(children.get(minData + 1));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//add next children/data\r\n\t\t\tfor (int i = minData + 1; i <= maxData; i++) {\r\n\t\t\t\tret.addData(data.get(i));\r\n\t\t\t\tif (!isLeaf())\r\n\t\t\t\t\tret.addChild(children.get(i + 1));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}", "int maxDepth();", "int getMax_depth();", "public int findMaxValueWithoutRecursion() {\n\t\tQueue<XTreeNode<Integer>> collectedNodes = new LinkedList<>();\n\t\tcollectedNodes.add( (XTreeNode<Integer>) this );\n\n\t\tint maxValue = Integer.MIN_VALUE;\n\t\twhile( !collectedNodes.isEmpty() ) {\n\t\t\tXTreeNode<Integer> node = collectedNodes.poll();\n\t\t\tmaxValue = node.getData() > maxValue ? node.getData() : maxValue;\n\n\t\t\tif( node.getLeftChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getLeftChild() );\n\t\t\t}\n\t\t\tif( node.getRightChild() != null ) {\n\t\t\t\tcollectedNodes.add( node.getRightChild() );\n\t\t\t}\n\t\t}\n\t\treturn maxValue;\n\t}", "int getTemporaryMaxDepth();", "static TreeNode createTree(TreeNode root, int[] arr, int index) {\r\n\t\t\r\n\t\tif (index < arr.length) {\r\n\t\t\tTreeNode tmp = null;\r\n\t\t\tif (arr[index]>=0) {\r\n\t\t\t\ttmp = new TreeNode(arr[index]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttmp = null;\r\n\t\t\t}\r\n\t\t\troot= tmp;\r\n\t\t\t\r\n\t\t\tif (root != null) {\r\n\t\t\t\troot.left = createTree(tmp.left,arr,index*2+1);\r\n\t\t\t\troot.right = createTree(tmp.right,arr,index*2+2);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn root;\r\n\t}", "static TreeNode createTree(TreeNode root, int[] arr, int index) {\r\n\t\t\r\n\t\tif (index < arr.length) {\r\n\t\t\tTreeNode tmp = null;\r\n\t\t\tif (arr[index]>=0) {\r\n\t\t\t\ttmp = new TreeNode(arr[index]);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttmp = null;\r\n\t\t\t}\r\n\t\t\troot= tmp;\r\n\t\t\t\r\n\t\t\tif (root != null) {\r\n\t\t\t\troot.left = createTree(tmp.left,arr,index*2+1);\r\n\t\t\t\troot.right = createTree(tmp.right,arr,index*2+2);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn root;\r\n\t}", "node FullTreeGen(int maxdepth){\n\t\tint i;\n\t\tbyte a;\n\t\tnode t, p;\n\t\tif(maxdepth == 0) // to the limit then choose a terminal\n\t\t{\n\t\t\ti = IRandom(0, gltcard - 1);\n\t\t\tt = new node(glterminal[i].name, VOIDVALUE);\n\t\t\treturn t;\n\t\t} \n\t\telse // choosing from function\n\t\t{\n\t\t\ti = IRandom(0, glfcard - 1);\n\t\t\tt = new node(glfunction[i].name, VOIDVALUE);\n\t\t\tt.children = FullTreeGen(maxdepth - 1);\n\t\t\tp = t.children;\n\t\t\tfor(a = 1; a < glfunction[i].arity; a++) {\n\t\t\t\tp.sibling = FullTreeGen(maxdepth - 1);\n\t\t\t\tp = p.sibling;\n\t\t\t}\n\t\t\tp.sibling = null;\n\t\t\treturn t;\n\t\t}\n\t}", "static SimpleTreeNode getTree(int[] values) {\n\n if(values.length>0) {\n\n SimpleTreeNode root = new SimpleTreeNode(values[0]);\n Queue<SimpleTreeNode> queue = new LinkedList<>();\n\n queue.add(root);\n\n boolean done = false;\n int index = 1;\n\n while (!done) {\n\n SimpleTreeNode node = queue.element();\n int childCount = node.getChildCount();\n\n if(childCount==0) {\n node.add(new SimpleTreeNode(values[index++]));\n queue.add((SimpleTreeNode)node.getChildAt(0));\n } else if(childCount==1) {\n node.add(new SimpleTreeNode(values[index++]));\n queue.add((SimpleTreeNode)node.getChildAt(1));\n } else {\n queue.remove();\n }\n\n done = (index == values.length);\n }\n\n return root;\n } else {\n return null;\n }\n }", "static int downToZero(Node root) {\n /*\n * Write your code here.\n */\n Queue<Node> queue = new PriorityQueue<>();\n queue.add(root);\n int min = 100001;\n while (!queue.isEmpty()){\n Node current = queue.poll();\n if(current.value <= 4){\n if (current.value == 4){\n min = current.depth + 3;\n return min;\n }\n min = current.depth+current.value;\n return min;\n }\n Node toAdd1 = new Node(current.value-1, current.depth+1);\n queue.add(toAdd1);\n for(int i = 2; i<=Math.sqrt(current.value); i++){\n if(current.value%i==0){\n Node toAdd = new Node(current.value/i, current.depth+1);\n queue.add(toAdd);\n }\n }\n }\n return min;\n }", "public int findMax(){\n\t\tif(root==nil){\n\t\t\treturn 0;\n\t\t}\n\t\tNode temp = root;\n\t\twhile(temp.right != nil){\n\t\t\ttemp = temp.right;\n\t\t}\n\t\treturn temp.id;\n\t}", "public TreeNode constructMaximumBinaryTree2(int[] nums) {\n if (nums == null) return null;\n return build(nums, 0, nums.length - 1);\n }", "public int createSpanningTree() {\n\n\t\treturn primMST(edges);\n\t}", "private IntTreeNode add(IntTreeNode root, int value) {\n if (root == null) {\n root = new IntTreeNode(value);\n } else if (value <= root.data) {\n root.left = add(root.left, value);\n } else {\n root.right = add(root.right, value);\n\t}\n return root;\n }", "public static int numTrees(int n) {\n return helper(1,n);\n }", "public static Node[] initTree(int[] arr){\n int i;\n Node[] tree = new Node[n];\n Node node;\n for(i = 0; i < n; i++){\n node = new Node();\n node.data = arr[i];\n tree[i] = node;\n }\n tree[0].data = arr[0];\n tree[1].data = arr[1];\n tree[2].data = arr[2];\n tree[3].data = arr[3];\n tree[4].data = arr[4];\n tree[5].data = arr[5];\n tree[6].data = arr[6];\n\n tree[0].parent = null;\n tree[0].left = tree[1];\n tree[0].right = tree[2];\n\n tree[1].parent = tree[0];\n tree[1].left = null;\n tree[1].right = tree[3];\n\n tree[2].parent = tree[0];\n tree[2].left = tree[4];\n tree[2].right = null;\n \n tree[3].parent = tree[1];\n tree[3].left = null;\n tree[3].right = null;\n\n tree[4].parent = tree[2];\n tree[4].left = tree[5];\n tree[4].right = tree[6];\n\n tree[5].parent = tree[4];\n tree[5].left = null;\n tree[5].right = null;\n\n tree[6].parent = tree[4];\n tree[6].left = null;\n tree[6].right = null;\n\n root = tree[0];\n return tree; \n }", "public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n Map<Integer, Set<Integer>> map = new HashMap<Integer,Set<Integer>>();\n int[] valArr = new int[n];\n int[] colArr = new int[n];\n for(int i =0;i<n;i++){\n valArr[i] = scan.nextInt();\n }\n for(int i =0;i<n;i++){\n colArr[i] = scan.nextInt();\n }\n for(int i=0;i<n-1;i++){\n //10^10 / 1024/ 1024/1024, 10GB\n int a = scan.nextInt()-1;\n int b = scan.nextInt()-1;\n \n //Tree[] treeArr = new Tree[n];\n if(map.containsKey(a)){\n map.get(a).add(b);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(b);\n map.put(a,set);\n }\n //case 1-2, 2-1\n if(map.containsKey(b)){\n map.get(b).add(a);\n }else{\n Set<Integer> set = new HashSet<Integer>();\n set.add(a);\n map.put(b,set);\n } \n }\n Set<Integer> visited = new HashSet<Integer>();\n Tree root =buildTree(map,0,0,valArr,colArr);\n return root;\n }", "private static Node buildSmallerTree() {\n\t\tNode root = createNode(10);\n\t\troot.leftChild = createNode(25);\n\t\troot.rightChild = createNode(25);\n\t\troot.leftChild.leftChild = createNode(13);\n\t\troot.rightChild.rightChild = createNode(7);\n\t\troot.leftChild.rightChild = createNode(27);\n\t\t\n\t\treturn root;\n\t}", "public interface Tree {\n\n //查找节点\n Node find(int val);\n\n //插入新节点\n boolean insert(int val);\n\n //中序遍历\n void infixOrder(Node current);\n\n //前序遍历\n void preOrder(Node current);\n\n //后序遍历\n void postOrder(Node current);\n\n //找到最大值\n Node findMax();\n\n //找到最小值\n Node findMin();\n\n //删除节点\n boolean delete(int val);\n\n}", "private int deleteMax() {\n int ret = heap[0];\n heap[0] = heap[--size];\n\n // Move root back down\n int pos = 0;\n while (pos < size / 2) {\n int left = getLeftIdx(pos), right = getRightIdx(pos);\n\n // Compare left and right child elements and swap accordingly\n if (heap[pos] < heap[left] || heap[pos] < heap[right]) {\n if (heap[left] > heap[right]) {\n swap(pos, left);\n pos = left;\n } else {\n swap(pos, right);\n pos = right;\n }\n } else {\n break;\n }\n }\n\n return ret;\n }", "private int first_leaf() { return n/2; }", "private static int minDepthNoRecursion(TreeNode root) {\r\n\t\treturn Math.min(maxDepthNoRecursion(root, true), maxDepthNoRecursion(root, false)); \r\n\t}", "public static TreeNode<Integer> createBST(int[] array) {\n return createBST(array, 0, array.length - 1);\n }", "public Tree(int x[]){\n\t\tint n = x.length;\n\t\tif(n == 0)\n\t\t\treturn;\n\t\tTreeNode nodes[] = new TreeNode[n];\n\t\tfor(int i=0; i < n; i++)\n\t\t\tnodes[i] = x[i] != -10 ? (new TreeNode(x[i])) : null;\n\t\troot = nodes[0];\n\t\tfor(int i=0; i < n; i++){\n\t\t\tTreeNode curr = nodes[i];\n\t\t\tif(curr == null)\n\t\t\t\tcontinue;\n\t\t\tint lc = 2*i+1;\n\t\t\tint rc = 2*i+2;\n\t\t\tif(lc < n)\n\t\t\t\tcurr.left = nodes[lc];\n\t\t\tif(rc < n)\n\t\t\t\tcurr.right = nodes[rc];\n\t\t}\n\t}", "public TreeNode buildBTree (Integer[] inArray, int root) {\n\tTreeNode rv = null;\n\tint leftIndex = root * 2;\n\tint rightIndex = root * 2 +1;\n\t\n\tif (inArray.length >= root && inArray[root-1] != null) { // if root points to a valid value\n\t\trv = new TreeNode(inArray[root-1]);\n\t\tif (inArray.length >= leftIndex && inArray[leftIndex-1] != null)\n\t\t\trv.left = buildBTree(inArray,leftIndex);\n\t\tif (inArray.length >= rightIndex && inArray[rightIndex-1] != null)\n\t\t\trv.right = buildBTree(inArray,rightIndex);\n\t}\n\t\n\treturn rv;\n}", "public int\ngetNodeIndexMax();", "private static int utopianTree( int n )\n\t{\n\t\tint height = 1;\n\t\twhile( n > 0 )\n\t\t{\n\t\t\tif( n > 0 )\n\t\t\t{\n\t\t\t\theight *= 2;\n\t\t\t\tn--;\n\t\t\t}\n\t\t\tif( n > 0 )\n\t\t\t{\n\t\t\t\theight++;\n\t\t\t\tn--;\n\t\t\t}\n\t\t}\n\t\treturn height;\n\t}", "private TreeNode buildTree(int[] preorder, int[] inorder, int[] preIndex, int[] inIndex, int target) {\n if (inIndex[0] >= inorder.length || inorder[inIndex[0]] == target) {\n return null;\n }\n TreeNode root = new TreeNode(preorder[preIndex[0]]);\n //preorder, advance the index by 1 sice we already finish the root;\n preIndex[0]++;\n root.left = buildTree(preorder, inorder, preIndex, inIndex, root.val);\n //after finishing left subtree, we can advance the index by 1\n inIndex[0]++;\n root.right = buildTree(preorder, inorder, preIndex, inIndex, target);\n return root;\n }", "public interface Tree<T extends Comparable<T>> {\n public boolean isEmpty();\n\n public int size();\n\n public T min();\n\n public T max();\n\n public boolean contains(T element);\n\n public boolean add(T element);\n\n public boolean remove(T element);\n\n public Iterator<T> traverse(TreeTraversalOrder order);\n}", "public TreeNode buildTree(int[] inorder, int[] postorder) {\n if(inorder.length == 0){\n return null;\n }\n TreeNode result = getRoot(inorder,postorder,0,inorder.length - 1,inorder.length-1);\n return result;\n }", "private Node buildIntraGroupTree(int groupId, int index) {\n Set<Integer> executorsHostingTask = getExecutorsHostingTask(groupId);\n List<Integer> executorIds = rotateList(\n new ArrayList<>(executorsHostingTask), index);\n\n if (executorIds.size() == 0) {\n return null;\n }\n // sort the taskIds to make sure everybody creating the same tree\n Collections.sort(executorIds);\n // now check weather root is part of this group\n int rootExecutor = logicalPlan.getWorkerForForLogicalId(root);\n if (executorIds.contains(rootExecutor)) {\n // move the executor to 0\n executorIds.remove(new Integer(rootExecutor));\n executorIds.add(0, rootExecutor);\n }\n\n int execLevel = 0;\n // create the root of the tree\n Node rootNode = createTreeNode(groupId, executorIds.get(0), index);\n rootNode.setExecLevel(execLevel);\n // now lets create the tree\n Queue<Node> queue = new LinkedList<>();\n Node current = rootNode;\n int i = 1;\n while (i < executorIds.size()) {\n if (current.getChildren().size() < intraNodeDegree) {\n // create a tree node and add it to the current node as a child\n Node e = createTreeNode(groupId, executorIds.get(i), index);\n current.addChild(e);\n e.setParent(current);\n e.setExecLevel(execLevel);\n queue.add(e);\n i++;\n } else {\n execLevel++;\n // the current node is filled, lets move to the next\n current = queue.poll();\n }\n }\n\n if (execLevel > maxLevelsAtExecutor) {\n maxLevelsAtExecutor = execLevel;\n }\n\n return rootNode;\n }", "public Node findMax(){\n if(root!=null){ // มี node ใน tree\n return findMax(root); // Call the recursive version\n }\n else{\n return null;\n }\n }", "private static int maxDepthNoRecursion(TreeNode root) {\r\n\t\treturn Math.max(maxDepthNoRecursion(root, true), maxDepthNoRecursion(root, false)); \r\n\t}", "@Override\n public TreeNode<E> tree_maximum() {\n return tree_maximum(root);\n }", "public static Node constructTree() {\n\n Node node2 = new Node(2, null, null);\n Node node8 = new Node(8, null, null);\n Node node12 = new Node(12, null, null);\n Node node17 = new Node(17, null, null);\n\n Node node6 = new Node(6, node2, node8);\n Node node15 = new Node(15, node12, node17);\n\n //Root Node\n Node node10 = new Node(10, node6, node15);\n\n return node10;\n }", "private A deleteLargest(int subtree) {\n return null; \n }", "private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}", "public BinarySearchTree(Integer data) {\n\t\troot = new TreeNode(data);\n\t\tlength++;\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 }", "public TreeNode<T> getMaxElement(){\n TreeNode<T> t = this;\n while(t.right != null){\n t = t.right;\n }\n return t;\n }", "private static void maxHeapify(int arr[], int n, int i) {\n int largest = i; // Initialize largest as root.\n int l = 2 * i + 1; // left = 2*i + 1\n int r = 2 * i + 2; // right = 2*i + 2\n\n // If left child is larger than root.\n if (l < n && arr[l] > arr[largest]) {\n largest = l;\n }\n // If right child is larger than largest so far \n if (r < n && arr[r] > arr[largest]) {\n largest = r;\n }\n // If largest is not root.\n if (largest != i) {\n int swap = arr[i];\n arr[i] = arr[largest];\n arr[largest] = swap;\n\n // Recursively heapify the affected sub-tree.\n maxHeapify(arr, n, largest);\n }\n }", "public List<TreeNode> generateTrees(int n) {\n if(n==0) return new ArrayList<TreeNode>();\n return generate(1, n);\n }", "public List<TreeNode> generateTrees(int n) {\n return helper(1, n);\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n // int m = sc.nextInt();\n int n = sc.nextInt();\n Tree[] tree = new Tree[n];\n for (int i = 0; i < n; i++) {\n tree[i] = new Tree(i + 1, sc.nextInt());\n }\n // System.out.println(Arrays.toString(tree));\n\n // Arrays.sort(tree,(a,b)->b.num-a.num);\n StringBuilder sb = new StringBuilder();\n int first = 0;\n\n boolean shibai = false;\n\n while (first < n) {\n while (first < n && tree[first].num == 0) {\n first++;\n }\n int idx = first + 1;\n out:\n while (idx < n) {\n while (idx < n && tree[idx].num == 0) {\n idx++;\n\n }\n while (idx < n && first < n && tree[idx].num > 0 && tree[first].num > 0) {\n\n sb.append(tree[first].type)\n .append(\" \")\n .append(tree[idx].type)\n .append(\" \");\n tree[idx].num--;\n tree[first].num--;\n if (tree[first].num == 0) {\n first++;\n break out;\n }\n }\n }\n// System.out.println(Arrays.toString(tree));\n// System.out.println(idx);\n if (idx > n - 1) {\n if (tree[first].num == 0) break;\n if (tree[first].num == 1) {\n sb.append(tree[first].type);\n break;\n } else {\n System.out.println(\"-\");\n shibai = true;\n break;\n }\n }\n }\n\n// while (true){\n// if(tree[0].num==1){\n// sb.append(tree[0].type);\n// break;\n// }\n// if(tree[1].num==0){\n// System.out.println(\"-\");\n// shibai=true;\n// break;\n// }\n// while (tree[1].num>0){\n// sb.append(tree[0].type).append(\" \").append(tree[1].type).append(\" \");\n// tree[0].num--;\n// tree[1].num--;\n// }\n// //System.out.println(sb.toString());\n// // System.out.println(Arrays.toString(tree));\n// // Arrays.sort(tree,(a,b)->b.num-a.num);\n//\n// }\n if (!shibai) {\n System.out.println(sb.toString());\n }\n\n\n }", "private int getMax(TreeNode root) {\n\t\twhile(root.right!=null)\n\t\t\troot=root.right;\n\t\treturn root.val;\n\t}", "private PersistentLinkedList<T> pop() {\n //the latest element won't become empty\n int index = this.treeSize - 1;\n Node<T> newRoot = new Node<>(branchingFactor);\n\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n ArrayList<Node<T>> newNodes = new ArrayList<>();\n newNodes.add(newRoot);\n ArrayList<Integer> newNodesIndices = new ArrayList<>();\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData traverseData = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, index, b));\n currentNode = traverseData.currentNode;\n currentNewNode = traverseData.currentNewNode;\n newNodes.add(currentNewNode);\n newNodesIndices.add(index / b);\n index = traverseData.index;\n }\n newNodesIndices.add(index);\n\n for (int i = 0; i < branchingFactor && i < index; i++) {\n currentNewNode.set(i, currentNode.get(i));\n }\n currentNewNode.set(index, null);\n\n if (index == 0) {\n int latestIndex = newNodes.size() - 2;\n newNodes.get(latestIndex).set(newNodesIndices.get(latestIndex), null);\n\n for (int i = latestIndex; i > 0; i--) {\n if (newNodesIndices.get(i) == 0) {\n newNodes.get(i - 1).set(newNodesIndices.get(i - 1), null);\n } else {\n break;\n }\n }\n }\n\n if (newNodes.size() > 1) {\n int nonNullChildren = 0;\n for (Node<T> child : newRoot.children) {\n if (child != null) {\n nonNullChildren++;\n }\n }\n if (nonNullChildren == 1) { //need new root\n newRoot = newRoot.get(0);\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth - 1,\n this.base / branchingFactor, this.treeSize - 1, unusedTreeIndices,\n indexCorrespondingToTheFirstElement, indexCorrespondingToTheLatestElement);\n }\n }\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth, this.base,\n this.treeSize - 1, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }", "public void testFindMax() {\r\n assertNull(tree.findMax());\r\n tree.insert(\"apple\");\r\n tree.insert(\"bagel\");\r\n assertEquals(\"bagel\", tree.findMax());\r\n tree.remove(\"bagel\");\r\n assertEquals(\"apple\", tree.findMax());\r\n }", "static int findMaxforN(TreeNode root, int N) \n\t{ \n\t // Base cases \n\t if (root == null) \n\t return -1; \n\t /*if (root.key == N) \n\t return N; \n\t else if (root.key> N) \n return root.key; \n\t return root.key < N?findMaxforN(root.right, N):findMaxforN(root.left, N);*/\n\t if (root.key >= N) \n\t return root.key; \n\t return root.key < N?findMaxforN(root.right, N):findMaxforN(root.left, N);\n\t}", "AVLTreeNode Max() {\r\n\r\n AVLTreeNode current = root;\r\n\r\n /* loop down to find the leftmost leaf */\r\n while (current.right != null)\r\n current = current.right;\r\n\r\n return current;\r\n\r\n\r\n }", "public int numTrees(int n) {\n if(n == 0 || n == 1 || n == 2)\n return n;\n int[] c = new int[n + 1];\n c[2] = 2;\n c[3] = 5;\n for(int i = 4; i < n + 1; i++){\n for(int j = 2; j < i; j++)\n c[i] += 2 * (c[j]);\n }\n return c[n];\n }", "public static Node buildRandomTree() {\n\t\tNode root = createNode(15);\n\t\troot.leftChild = createNode(10);\n\t\troot.rightChild = createNode(4);\n\t\troot.leftChild.leftChild = createNode(25);\n\t\troot.leftChild.leftChild.rightChild = createNode(27);\n\t\troot.leftChild.leftChild.leftChild = createNode(13);\n\t\troot.leftChild.rightChild = createNode(25);\n\t\troot.leftChild.rightChild.rightChild = createNode(7);\n\t\t\n\t\treturn root;\n\t}", "public int[] createTree(int[] input) {\n int[] bit = new int[input.length + 1];\n for (int i = 0; i < input.length; i++) {\n update(bit, input[i], i);\n }\n return bit;\n }", "private HuffmanNode buildTree(int n) {\r\n \tfor (int i = 1; i <= n; i++) {\r\n \t\tHuffmanNode node = new HuffmanNode();\r\n \t\tnode.left = pQueue.poll();\r\n \t\tnode.right = pQueue.poll();\r\n \t\tnode.frequency = node.left.frequency + node.right.frequency;\r\n \t\tpQueue.add(node);\r\n \t}\r\n return pQueue.poll();\r\n }", "public ArrayList<Integer> max(int index)\n\t{\n\t\tArrayList<Integer> array2 = new ArrayList<Integer>();\n\t\tif(4*index + 3 >= size )\n\t\t{\n\t\t\tarray2.add(0);\n\t\t\treturn array2;\n\t\t}\n\n\t\tint maxIndex;\n\t\tint maxIndex2;\n\t\tint max = 0;\n\n\t\tif(4*index + 6 < size)\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t\tmaxIndex = grandChildMax(4*(index)+3, 4*index + 4);\n\t\t\t\tmaxIndex2 = grandChildMax(4*(index)+5, 4*index + 6);\n\t\t\t\tmax = grandChildMax(maxIndex, maxIndex2);\n\t\t\t\tarray2.add(max);\n\t\t\t\treturn array2;\n\t\t\t\n\t\t}\n\t\tif(4*index+5 < size)\n\t\t{\n\n\t\t\tmaxIndex = grandChildMax(4*(index)+3, 4*index + 4);\n\t\t\tmax = grandChildMax(maxIndex, 4*index+5);\n\t\t\tarray2.add(max);\n\t\t\treturn array2;\n\n\n\t\t}\n\t\tif(4*index+4 < size)\n\t\t{\n\t\t\t\tmaxIndex = grandChildMax(4*(index)+3, 4*(index)+4);\n\t\t\t\tmax = grandChildMax(maxIndex, 2*index+2);\n\n\t\t\t\tarray2.add(0, max) ;\n\t\t\t\tarray2.add(1, 0);\n\t\t\t\treturn array2;\n\t\t}\n\n\n\n\t\tif(4*index + 3 < size)\n\t\t{\n\t\t\t\tmax = grandChildMax(4*index+3, 2*index + 2);\n\t\t\t\tarray2.add(0, max) ;\n\t\t\t\tarray2.add(1, 0);\n\t\t\t\treturn array2;\n\t\t\t\n\t\t}\n\n\t\treturn array2;\n\n\t}", "public int numTrees () { throw new RuntimeException(); }", "public int solution(Tree T) {\n if(T == null)\n {\n return 0;\n\n }\n //Check if the tree has no children\n if(T.l == null && T.r == null)\n {\n return 0;\n }\n\n\n AtomicInteger leftSide = new AtomicInteger(0);\n AtomicInteger rightSide = new AtomicInteger(0);\n\n if(T.l != null) traverseTree(T.l, 0, true, leftSide);\n if(T.r != null) traverseTree(T.r, 0, false, rightSide);\n\n\n if(leftSide.intValue() > rightSide.intValue())\n {\n return leftSide.intValue();\n }\n else{\n return rightSide.intValue();\n }\n\n }", "public UnionFind(int max) {\n\n _parent = new int[max];\n _rank = new int[max];\n\n for (int i = 0; i < max; i++) {\n _parent[i] = i;\n }\n }", "public static TreeNode buildTreeFromArray(Integer[] values) {\n if(values == null || values.length == 0) {\n return null;\n }\n\n TreeNode root = new TreeNode(values[0]);\n Queue<TreeNode> tree = new LinkedList<>();\n tree.add(root);\n\n for (int i = 0; i < (values.length) / 2; i++) {\n if(values[i] != null) {\n TreeNode currentParent = tree.poll();\n if (values[(i * 2) + 1] != null) {\n TreeNode left = new TreeNode(values[(i * 2) + 1]);\n currentParent.setLeft(left);\n tree.add(left);\n }\n if (values[(i * 2) + 2] != null) {\n TreeNode right = new TreeNode(values[(i * 2) + 2]);\n currentParent.setRight(right);\n tree.add(right);\n }\n }\n }\n return root;\n }", "public int numTrees(int n) {\n long now = 1;\n for (int i = 0; i < n; i++) {\n now *= 2*n-i;\n now /= i+1;\n }\n return (int)(now/(n+1));\n }", "@Test\n\tpublic void testBuildTree() {\n\t\tTree<Integer> tree = new Tree<Integer> ();\n\t\t//add first level children, 1\n\t\tNode<Integer> root = tree.getRoot();\n\t\troot.addChild(new Node<Integer>());\n\t\tNode<Integer> c1 = root.getFirstChild();\n\t\tassertTrue(c1.getData() == null);\n\t\t//add second level children, 3\n\t\tc1.addChild(new Node<Integer> ());\n\t\tc1.addChild(new Node<Integer> ());\n\t\tc1.addChild(new Node<Integer> ());\n\t\tassertTrue(c1.countChildren() == 3);\n\t\t//add third level children, 3 * 3\n\t\tint[][] leafData = {\n\t\t\t\t{8,7,2},\n\t\t\t\t{9,1,6},\n\t\t\t\t{2,4,1}\n\t\t};\n\t\tNode<Integer> c2 = c1.getFirstChild();\n\t\tint i = 0;\n\t\twhile (c2 != null) {\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][0]));\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][1]));\n\t\t\tc2.addChild(new Node<Integer> (leafData[i][2]));\n\t\t\tc2 = c2.next();\n\t\t\ti++;\n\t\t}\n\t\tassertTrue(tree.countDepth() == 3);\n\t\tNode<Integer> leaf = root;\n\t\twhile (leaf.countChildren() > 0) {\n\t\t\tleaf = leaf.getFirstChild();\n\t\t}\n\t\tassertTrue(leaf.getData() == 8);\t\t\t\n\t}", "private Node findLargestNodeIn(Node n) {\n if (n != null) {\n while (n.rightChild != null) {\n n = n.rightChild;\n }\n }\n return n;\n }", "@Test\n public void testLargeTree() {\n BPlusTree<Integer, Integer> tree = new BPlusTree<Integer, Integer>();\n ArrayList<Integer> numbers = new ArrayList<Integer>(100000);\n for (int i = 0; i < 100000; i++) {\n numbers.add(i);\n }\n Collections.shuffle(numbers);\n for (int i = 0; i < 100000; i++) {\n tree.insert(numbers.get(i), numbers.get(i));\n }\n testTreeInvariants(tree);\n int depth = treeDepth(tree.root);\n assertTrue(depth < 11);\n }", "public BinarySearchTree(int data) {\n root = new Node(data, null, null);\n }", "public TreeNode buildTree(int[] inorder, int[] postorder) {\n if(inorder.length==0 || postorder.length==0)\n return null;\n return build(inorder, postorder, 0, inorder.length-1, 0, postorder.length-1);\n }", "public int numTrees(int n) {\n if (n==0) return 1;\n int[] dp = new int[n+1];\n dp[0] = dp[1] = 1;\n for (int i=2;i<=n;i++) {\n for (int j=1;j<=i;j++) {\n dp[i] += dp[j-1] * dp[i-j];\n }\n }\n return dp[n];\n }", "public int numTrees(int n) {\n int[] dp = new int[n+1];\n dp[0] = 1;\n dp[1] = 1;\n for (int i=2; i<=n; i++) {\n for (int j=0; j<i; j++) {\n dp[i] = dp[i] + dp[j]*dp[i-j-1];\n }\n }\n \n return dp[n];\n }", "private int helper(TreeNode root, int[] globalMax) {\r\n\t\tif (root == null) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t// Step 1\r\n\t\tint left = helper(root.left, globalMax);\r\n\t\tint right = helper(root.right, globalMax);\r\n\t\t// Step 2\r\n\t\tleft = left < 0 ? 0 : left;\r\n\t\tright = right < 0 ? 0 : right;\r\n\t\tglobalMax[0] = Math.max(globalMax[0], root.key + left + right);\r\n\t\t// Step 3\r\n\t\treturn Math.max(left, right) + root.key;\r\n\t}", "public int findMaxValue(Node root) {\n if(root == null) {\n return Integer.MIN_VALUE;\n }\n int output = (int)root.getData();\n int leftOutput = findMaxValue(root.getLeftChildNode());\n int rightOutput = findMaxValue(root.getRightChildNode());\n if(leftOutput > output){\n output = leftOutput;\n }\n if(rightOutput > output) {\n output = rightOutput;\n }\n return output;\n\n }", "public Node max() {\n\t\tNode x = root;\n\t\tif (x == null) return null;\n\t\twhile (x.getRight() != null)\n\t\t\tx = x.getRight();\n\t\treturn x;\n\t}", "public E deleteMax() {\r\n\t\tE max = null;\r\n\t\tif (currentIndex > 0) { // replace the root of heap with the last element on the last level\r\n\t\t\tmax = heap.get(0); // save current max\r\n\t\t\t\r\n\t\t\theap.set(0, heap.get(currentIndex - 1));\r\n\t\t\theap.remove(currentIndex - 1);\r\n\t\t\tcurrentIndex--;\r\n\t\t\t\r\n\t\t\theapifyDown(0); // re-heapify\r\n\t\t}\r\n\t\treturn max; // if tree is empty, returns null\r\n\t}", "void insert(int value){\r\n\t\tNode node = new Node(value);\r\n\t\t \r\n\t\tif( this.root == null ) {\r\n\t\t\tthis.root = node ;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t \r\n\t\tNode tempNode = this.root , parent = this.root;\r\n\t\t\r\n\t\twhile( tempNode != null ) {\r\n\t\t\tparent = tempNode;\r\n\t\t\tif( node.value >= tempNode.value ) {\r\n\t\t\t\ttempNode = tempNode.right;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttempNode = tempNode.left ;\r\n\t\t\t}\r\n\t\t}\r\n\t\t \r\n\t\tif( node.value < parent.value ) {\r\n\t\t\tparent.left = node ;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tparent.right = node ;\r\n\t\t}\r\n\t}", "TreeNode generateBinaryTree(int[] arr) {\n\n if (arr.length == 0) {\n\n return null;\n }\n return buildNode(arr, 0, 1, 2);\n }", "private List<TreeNode> helper(int m, int n) {\n\t\t//System.out.println(\"== \" + m + \" \" + n + \"== \");\n\t\tList<TreeNode> result = new ArrayList<TreeNode>();\n\t\tif (m > n) {\n\t\t\t/* MUST add null \n\t\t\t * Cannot do nothing because foreach loop cannot find it if nothing inside \n\t\t\t */\n\t\t\tresult.add(null);\n\t\t} else if (m == n) {\n\t\t\tTreeNode node = new TreeNode(m);\n\t\t\tresult.add(node);\n\t\t} else {\n\t\t\tfor (int i = m; i <= n; i++) {\n\t\t\t\t//System.out.println(\"m, n, i : \" + m + \" \" + n + \" - \" + i);\n\t\t\t\tList<TreeNode> ls = helper(m, i - 1);\n\t\t\t\tList<TreeNode> rs = helper(i + 1, n);\n\t\t\t\t\n\t\t\t\tfor(TreeNode l: ls){\n\t\t\t\t\tfor(TreeNode r: rs){\n\t\t\t\t\t\tTreeNode node = new TreeNode(i);\n\t\t\t\t\t\tnode.left =l;\n\t\t\t\t\t\tnode.right=r;\n\t\t\t\t\t\tresult.add(node);\n\t\t\t\t\t\t//System.out.println(\">>>>>>>\");\n\t\t\t\t\t\t//node.printBFS();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public static TreeNode buildTree() {\n\t\t\n\t\tTreeNode root = new TreeNode(1);\n\t\t\n\t\tTreeNode left = new TreeNode(2);\n\t\tleft.left = new TreeNode(4);\n\t\tleft.right = new TreeNode(5);\n\t\tleft.right.right = new TreeNode(8);\n\t\t\n\t\tTreeNode right = new TreeNode(3);\n\t\tright.left = new TreeNode(6);\n\t\tright.right = new TreeNode(7);\n\t\tright.right.left = new TreeNode(9);\n\t\t\n\t\troot.left = left;\n\t\troot.right = right;\n\t\t\n\t\treturn root;\n\t}", "private ITree.Node createNode(int i) {\n if (i < currentSize) {\n ITree.Node node = new ITree.Node(this.elements[i]);\n node.setLeftNode(createNode(this.leftChild(i)));\n node.setRightNode(createNode(this.rightChild(i)));\n\n return node;\n }\n return null;\n }", "public Node getMax() {\n Node current = root;\n while (current.right != null) {\n current = current.right;\n }\n return current;\n }", "public static Node construct(Integer[] arr){\r\n Node root = null;\r\n Stack<Node> st = new Stack<>();\r\n \r\n for(int i=0; i<arr.length; i++){\r\n Integer data = arr[i];\r\n if(data != null){\r\n Node nn = new Node(data);\r\n if(st.size()==0){\r\n root = nn;\r\n st.push(nn);\r\n }\r\n else{\r\n st.peek().children.add(nn);\r\n st.push(nn);\r\n }\r\n }\r\n else{ //if data is equal to NULL\r\n st.pop();\r\n }\r\n }\r\n return root;\r\n }", "public static void main(String[] args){\n\n// BinaryTree binaryTree = new BinaryTree(1);\n// binaryTree.insert(\"L\", 2);\n// binaryTree.insert(\"LL\", 4);\n// binaryTree.insert(\"LR\", 5);\n// binaryTree.insert(\"R\", 3);\n// binaryTree.getHeight(binaryTree.root);\n// System.out.println(binaryTree.maxDiameter);\n\n Scanner in = new Scanner(System.in);\n int T = in.nextInt();\n int X = in.nextInt();\n BinaryTree binaryTree = new BinaryTree(X);\n for(int j=0;j<T-1;j++){\n String where = in.next();\n int k = in.nextInt();\n binaryTree.insert(where, k);\n }\n binaryTree.getHeight(binaryTree.root);\n// binaryTree.traverse(binaryTree.root);\n System.out.println(binaryTree.maxDiameter);\n }", "public TreeNode largest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getRightChild() != null) {\n\t\t\t\tcurrent = current.getRightChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}", "private static Node buildTreeHelper(int[] preorder, int[] preorderIndex, int left, int right, Map<Integer, Integer> inorderMap) {\n\n if (left > right) { return null; }\n int rootVal = preorder[preorderIndex[0]++];\n Node root = new Node(rootVal);\n\n root.left = buildTreeHelper(preorder, preorderIndex, left, inorderMap.get(rootVal) - 1, inorderMap);\n root.right = buildTreeHelper(preorder, preorderIndex, inorderMap.get(rootVal) + 1, right, inorderMap);\n return root;\n }", "public static Tree solve() {\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt();\n\n int[] arrayNode = new int[n + 1];\n for (int i = 1; i <= n; i++) {\n arrayNode[i] = scan.nextInt();\n }\n\n Color[] arrayColor = new Color[n + 1];\n for (int i = 1; i <= n; i++) {\n if (scan.nextInt() == 0) {\n arrayColor[i] = Color.RED;\n } else {\n arrayColor[i] = Color.GREEN;\n }\n }\n\n List<Integer>[] adjacentsList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n adjacentsList[i] = new ArrayList<Integer>();\n }\n\n for (int i = 0; i < n - 1; i++) {\n int x = scan.nextInt();\n int y = scan.nextInt();\n\n adjacentsList[x].add(y);\n adjacentsList[y].add(x);\n }\n\n scan.close();\n\n List<Integer>[] childrenList = new List[n + 1];\n for (int i = 1; i <= n; i++) {\n childrenList[i] = new ArrayList<Integer>();\n }\n\n int[] depths = new int[n + 1];\n boolean[] visited = new boolean[n + 1];\n\n Queue<Integer> queue = new LinkedList<Integer>();\n depths[1] = 0;\n queue.offer(1);\n while (!queue.isEmpty()) {\n int head = queue.poll();\n\n if (visited[head]) {\n continue;\n }\n visited[head] = true;\n\n for (int adjacent : adjacentsList[head]) {\n if (!visited[adjacent]) {\n childrenList[head].add(adjacent);\n depths[adjacent] = depths[head] + 1;\n queue.offer(adjacent);\n }\n }\n }\n\n Tree[] nodes = new Tree[n + 1];\n for (int i = 1; i <= n; i++) {\n if (childrenList[i].isEmpty()) {\n nodes[i] = new TreeLeaf(arrayNode[i], arrayColor[i], depths[i]);\n } else {\n nodes[i] = new TreeNode(arrayNode[i], arrayColor[i], depths[i]);\n }\n }\n for (int i = 1; i <= n; i++) {\n for (int child : childrenList[i]) {\n ((TreeNode) nodes[i]).addChild(nodes[child]);\n }\n }\n return nodes[1];\n }", "public static Node createLargeTree() {\n final int dcCount = 2;\n final int rackCount = 6;\n final int snCount = 6;\n final int hdCount = 12;\n\n int id = 0;\n // root\n Node root = new Node();\n root.setName(\"root\");\n root.setId(id++);\n root.setType(Types.ROOT);\n root.setSelection(Selection.STRAW);\n // DC\n List<Node> dcs = new ArrayList<Node>();\n for (int i = 1; i <= dcCount; i++) {\n Node dc = new Node();\n dcs.add(dc);\n dc.setName(\"dc\" + i);\n dc.setId(id++);\n dc.setType(Types.DATA_CENTER);\n dc.setSelection(Selection.STRAW);\n dc.setParent(root);\n // racks\n List<Node> racks = new ArrayList<Node>();\n for (int j = 1; j <= rackCount; j++) {\n Node rack = new Node();\n racks.add(rack);\n rack.setName(dc.getName() + \"rack\" + j);\n rack.setId(id++);\n rack.setType(StorageSystemTypes.RACK);\n rack.setSelection(Selection.STRAW);\n rack.setParent(dc);\n // storage nodes\n List<Node> sns = new ArrayList<Node>();\n for (int k = 1; k <= snCount; k++) {\n Node sn = new Node();\n sns.add(sn);\n sn.setName(rack.getName() + \"sn\" + k);\n sn.setId(id++);\n sn.setType(StorageSystemTypes.STORAGE_NODE);\n sn.setSelection(Selection.STRAW);\n sn.setParent(rack);\n // hds\n List<Node> hds = new ArrayList<Node>();\n for (int l = 1; l <= hdCount; l++) {\n Node hd = new Node();\n hds.add(hd);\n hd.setName(sn.getName() + \"hd\" + l);\n hd.setId(id++);\n hd.setType(StorageSystemTypes.DISK);\n hd.setWeight(100);\n hd.setParent(sn);\n }\n sn.setChildren(hds);\n }\n rack.setChildren(sns);\n }\n dc.setChildren(racks);\n }\n root.setChildren(dcs);\n return root;\n }", "public static <T> Node<T> removeMax(Node<T> t) {\n if (t == null)\n return null;\n else if (t.right != null) {\n t.right = removeMax(t.right);//recursive call to remove max\n return t;\n } else\n return t.left;// otherwise return left node\n }", "private static TreeNode helper2(TreeNode node, int[] nums, int start, int end) {\n if (start > end) {\n return null;\n }\n int max = Integer.MIN_VALUE;\n int middle = 0;\n for(int i = start; i <= end; i++) {\n if (nums[i] >= max) {\n max = nums[i];\n middle = i;\n }\n }\n node = new TreeNode(max);\n node.left = helper2(node.left, nums, start, middle - 1);\n node.right = helper2(node.right, nums, middle + 1, end);\n return node;\n }" ]
[ "0.80265564", "0.7706681", "0.76981205", "0.6602165", "0.64492786", "0.63564056", "0.6342646", "0.62773097", "0.6268393", "0.62442493", "0.6201975", "0.6114873", "0.6079485", "0.60682094", "0.59427553", "0.5917431", "0.5867973", "0.58393764", "0.583277", "0.5819849", "0.57841337", "0.5765217", "0.5765217", "0.57062507", "0.56634897", "0.56615907", "0.56517833", "0.56478256", "0.56393576", "0.56368774", "0.56314033", "0.56297374", "0.5628136", "0.56228054", "0.5614005", "0.56001", "0.5581132", "0.55625117", "0.5553594", "0.553522", "0.5529975", "0.5520436", "0.55171853", "0.5498689", "0.5492985", "0.54846674", "0.54690206", "0.54683703", "0.54601544", "0.54462475", "0.5443885", "0.5429551", "0.542863", "0.54195255", "0.53903574", "0.5374731", "0.5367452", "0.5351174", "0.5349619", "0.53446", "0.532685", "0.5324949", "0.5323502", "0.52870053", "0.5286626", "0.52828795", "0.5275983", "0.5268295", "0.52641255", "0.52610904", "0.5260064", "0.52590716", "0.52502227", "0.52468747", "0.5244999", "0.5243982", "0.5227947", "0.52263296", "0.5224955", "0.5223032", "0.52170557", "0.5215227", "0.52143604", "0.52110803", "0.5204828", "0.5201353", "0.5198753", "0.51922154", "0.5190693", "0.5184097", "0.5177552", "0.5175902", "0.5169071", "0.5166059", "0.5163965", "0.51526403", "0.51510155", "0.51467794", "0.5142876", "0.51426166" ]
0.7993273
1
pre : tree is a binary search tree post: value is added to overall tree so as to preserve the binary search tree property
public void add(int value) { overallRoot = add(overallRoot, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tree<T> add(Tree<T> tree) {\n checkForNull(tree);\n\n if (childrenValueSet.contains(tree.value)) {\n return null;\n }\n\n if (tree.parent != null) {\n tree.remove();\n }\n\n tree.parent = this;\n children.add(tree);\n childrenValueSet.add(tree.value);\n incModificationCount();\n\n return tree;\n }", "public void setTree(Tree tree) {\n this.tree = tree;\n }", "public Tree<T> add(T value) {\n checkForNull(value);\n\n if (childrenValueSet.contains(value)) {\n return null;\n }\n\n Tree<T> tree = new Tree<>(value, this);\n incModificationCount();\n\n return tree;\n }", "public void setTree(MyTree t) {\r\n\t\ttree = t;\r\n\t}", "private void putInBinaryTree(int val) {\n BinaryTree.Node node = this.binaryTree.getRoot();\n BinaryTree.Node parent = node;\n while (node != null) {\n parent = node;\n if (val < node.data) node = node.left;\n else node = node.right;\n }\n if (val < parent.data) this.binaryTree.addAsLeftChild(parent, val);\n else this.binaryTree.addAsRightChild(parent, val);\n }", "public static void populateTree(BinarySearchTree tree)\n {\n for(int i = 0; i < 20; i++)\n {\n tree.add(i);\n }\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 void add(Comparable obj)\n { \n \t //TODO\n \t //add code\n \t Node n = new Node(); \n \t n.data = obj;\n \t // \tn.left = null;\n \t // \tn.right = null;\n\n \t Node y = null;\n \t // \tNode x = root;\n \t Node current = root;\n \t while(current != null)\n \t {\n \t\t y = current;\n \t\t if(n.data.compareTo(root.data) < 0)\n \t\t\t current = current.left;\n \t\t else\n \t\t\t current = current.right;\n \t }\n\n\n \t n.parent = y;\n \t if(y == null)\n \t\t root = n;\n \t else\n \t\t if(n.data.compareTo(y.data) < 0)\n \t\t\t y.left = n;\n \t\t else\n \t\t\t y.right = n;\n \t n.left = null;\n \t n.right = null;\n \t n.color = RED;\n \t // \troot = new Node();\n \t // \troot.data = \"k\";\n \t // \tNode test = new Node();\n \t // \ttest.data = \"g\";\n \t // \troot.left= test;\n// \t System.out.println(\"the insertion looks like:\");\n// \t System.out.println(BTreePrinter.printNode(root));\n\n \t fixup(root,n);\n \t /*\n \tThe insert() method places a data item into the tree.\n\n \tInsertions\n \tpseudocode for\n \tRB-Insert(T,z)\n \ty = nil[T]\n \tx = root[T]\n \twhile x != nil[T]\n \ty = x\n \tif key[z] < key[x] then\n \tx = left[x]\n \telse\n \tx = right[x]\n \tp[z] = y\n \tif y = nil[T]\n \troot[T] = z\n \telse\n \tif key[z] < key[y] then\n \tleft[y] = z\n \telse\n \tright[y] = z\n \tleft[z] = nil[T]\n \tright[z] = nil[T]\n \tcolor[z] = RED\n \tRB-Insert-fixup(T,z)\n \t */\n }", "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 boolean add(E item, BinaryTree<E> tree)\r\n\t{\r\n\t\tif (item.compareTo(tree.value()) > 0 && tree.right() == null)\r\n\t\t{\r\n\t\t\ttree.setRight(new BinaryTree<E>(item));\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) < 0 && tree.left() == null)\r\n\t\t{\r\n\t\t\ttree.setLeft(new BinaryTree<E>(item));\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) == 0)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) > 0)\r\n\t\t{\r\n\t\t\treturn add(item, tree.right());\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) < 0)\r\n\t\t{\r\n\t\t\treturn add(item, tree.left());\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private static Object[] set(\n Object[] root,\n int depth,\n Object value,\n int index) {\n\n Object[] newRoot = root.clone();\n\n if (depth == 0) {\n // Base case; directly insert the value.\n newRoot[index & 0x1F] = value;\n } else {\n // Recurse, then swap the result in for the appropriate place in\n // this node.\n int nodeIndex = getNodeIndex(index, depth);\n Object[] child = (Object[]) root[nodeIndex];\n newRoot[nodeIndex] = set(child, depth - 5, value, index);\n }\n\n return newRoot;\n }", "public TreeNode mergeTrees(TreeNode t1, TreeNode t2){\r\n if( t1==null )\r\n return t2;\r\n if( t2==null )\r\n return t1;\r\n t1.value += t2.value;\r\n t1.left = mergeTrees(t1.left, t2.left);\r\n t2.right = mergeTrees(t1.right, t2.right);\r\n return t1;\r\n }", "public void add(int value){\n \n // Case 1: The tree is empty - allocate the root\n if(root==null){\n root = new BSTNode(value);\n }\n \n // Case 2: The tree is not empty \n // find the right location to insert value\n else{\n addTo(root, value);\n } \n count++; // update the number of nodes\n }", "public static void setValue(Object tree,Map context,Object root,Object value) throws OgnlException{\n OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);\n Node n = (Node) tree;\n\n if (n.getAccessor() != null){\n n.getAccessor().set(ognlContext, root, value);\n return;\n }\n\n n.setValue(ognlContext, root, value);\n }", "public void add(E val){\n if(mData.compareTo(val) > 0){\n if(mLeft == null){\n mLeft = new BSTNode(val);\n mLeft.mParent = this;\n }//End if null\n else if(mRight == null){\n mRight = new BSTNode(val);\n mRight.mParent = this;\n }//End Else\n }//End if\n else{\n mLeft.add(val);\n mLeft.mParent = this;\n }//End Else\n }", "@Override\n public void setTree(E rootData) {\n root = new TernaryNode<>(rootData);\n }", "private IntTreeNode add(IntTreeNode root, int value) {\n if (root == null) {\n root = new IntTreeNode(value);\n } else if (value <= root.data) {\n root.left = add(root.left, value);\n } else {\n root.right = add(root.right, value);\n\t}\n return root;\n }", "@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 }", "void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}", "public void setTreeSearch(Player tree){\n t = tree;\n\n // e = new EvaluationFunction1(t);\n }", "public void add(int value, String name){\n \n Node newNode = new Node(value, name); //Intialize new node \n \n if(root == null){ //If the root is null \n root = newNode; //Set newNode to the root \n }\n else{ \n Node myNode = root; //Create a second new node\n Node parent; //Crete a parent Node \n\n while (true) { //While true....\n \n parent = myNode;//Set parent node to myNode\n \n if (value < myNode.value) { //If the value is less than my node \n \n myNode = myNode.left; //Set myNode to left \n \n if (myNode == null) { //If the value of myNode is null \n \n parent.left = newNode; //Set the left parent node to newNode\n return; \n \n }\n }else {\n \n myNode = myNode.right; //Set myNode to the right Node\n \n if (myNode == null) {\n \n parent.right = newNode; //Set the right node to the newNode\n return;\n \n }\n\n }\n\n }\n \n }\n \n \n }", "public void addChild(TreeItem t) {\n\t\tleaves = null;\n\t\ttreeLeaves = null;\n\t\tdecideNorm = false;\n\t\tItem newKids[] = new Item[numChildren+1];\n\t\tfor (int i = 0; i < numChildren; i++)\n\t\t\tnewKids[i] = children[i];\n\t\tnewKids[numChildren] = t;\n\t\tchildren = newKids;\n\t\tnumChildren++;\n\t\tsetHashCode();\n\t\tsetNumNodes();\n\t}", "@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 testManipulateObjectByReference() {\n TreeNode root = new TreeNode(0);\n root.left = new TreeNode(1);\n root.right = new TreeNode(2);\n setLeftChildToNull(root);\n System.out.println(root.left);\n }", "private Node add(Node root, Integer value) {\n\t\tif(root==null)\n\t\t\troot=new Node(value);\n\t\telse if(value<root.value)\n\t\t\troot.left=add(root.left, value);\n\t\telse if(value>root.value)\n\t\t\troot.right=add(root.right,value);\n\t\telse\n\t\t\tthrow new RuleViolationException();\n\t\treturn root;\n\t}", "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}", "void setLeft(TreeNode<T> left);", "private void UpdateAddNestedValue(){\n notebookRef.document(\"IpWOjXtIgGJ2giKF4VTp\")\r\n// .update(KEY_Tags+\".tag1\", false);\r\n\r\n // ****** For Practice If we have nested over nested values likke:\r\n // tags-> tag1-> nested_tag-> nested_tag2 :true we write like\r\n .update(\"tags.tag1.nested_tag.nested_tag2\", true);\r\n\r\n }", "@Override\npublic void setIncrementalChildAddition(boolean newVal) {\n\t\n}", "public NonEmptyTree<K, V> add(Tree<K, V> t, K key, V value) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\treturn new NonEmptyTree<K, V>(key, value, left, right);\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\tleft = left.add(left, key, value);\n\t\t\treturn this;\n\t\t} else {\n\t\t\tright = right.add(right, key, value);\n\t\t\treturn this;\n\t\t}\n\t}", "public void add(int value){\n if (value < this.value){\n if (this.left != null)\n left.add(value);\n else left = new MyBinaryTreeNode(value);\n }\n else if (value > this.value){\n if (this.right != null)\n right.add(value);\n else right = new MyBinaryTreeNode(value);\n }\n }", "void add(int data){\n if (isEmpty()) { //tree is empty\n root = new Node(data);\n } else {\n Node current = root; //node yg saat ini bisa ter-update, tidak statis nilainya\n while(true){\n if (data < current.data) {\n if (current.left != null) {\n current = current.left;\n } else {\n current.left = new Node (data);\n break;\n }\n } else if (data > current.data){\n if (current.right != null) {\n current = current.right;\n } else {\n current.right = new Node (data);\n break;\n }\n } else {\n break;\n }\n }\n }\n }", "protected boolean addLeft(T value) {\n this.left = createTreeNode(value);\n return true;\n }", "public void valueChanged(TreeSelectionEvent e) {\n DefaultMutableTreeNode TreeN = (DefaultMutableTreeNode)\n tree.getLastSelectedPathComponent();\n \n if (TreeN == null) return;\n \n Object nodeIn = TreeN.getUserObject();\n Node y = (Node)nodeIn;\n Homework1.inorder(y);\n htmlPane.setText(y.value.toString());\n \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}", "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 BSearchTree() {\n\t\tthis.overallRoot = null;\n\t}", "public void treeOrder ()\n {\n treeOrder (root, 0);\n }", "public NonEmptyTree<K, V> add(K key, V value) {\n\t\tTree<K, V> t = this;\n\t\treturn add(t, key, value);\n\t}", "public static void setValue(Object tree, Map context, Object root, Object value)\n throws OgnlException {\n OgnlContext ognlContext = (OgnlContext) addDefaultContext(root, context);\n Node n = (Node) tree;\n\n if (n.getAccessor() != null) {\n n.getAccessor().set(ognlContext, root, value);\n return;\n }\n\n n.setValue(ognlContext, root, value);\n }", "public void balanceTree() {\n\n balanceTree(root);\n }", "@Before\n public void setUp() {\n this.tree = new SimpleBinarySearchTree<>();\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 add(T value) {\n final Node node = new Node(value);\n if (root != null) {\n root.add(node);\n } else {\n root = node;\n }\n }", "@Test\n public void test(){\n BinarySearchTree tree = new BinarySearchTree(new Node(35));\n\n tree.addNode(4);\n tree.addNode(15);\n tree.addNode(3);\n tree.addNode(1);\n tree.addNode(20);\n tree.addNode(8);\n tree.addNode(50);\n tree.addNode(40);\n tree.addNode(30);\n tree.addNode(80);\n tree.addNode(70);\n\n tree.addNode(90);\n\n tree.deleteNode(50);\n System.out.println(\"=====中序遍历 递归法=====\");\n TreeUtil.traverseInOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traverseInOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====前序遍历=====\");\n TreeUtil.traversePreOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traversePreOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历=====\");\n TreeUtil.traversePostOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历 迭代法=====\");\n TreeUtil.traversePostOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====层次遍历=====\");\n TreeUtil.traverseLevelOrder(tree.getRoot());\n\n int height = TreeUtil.getChildDepth(tree.getRoot());\n System.out.println(\"\");\n System.out.println(\"树高:\"+height);\n }", "public void refreshTree(TwoDimensionBone value) {\r\n\t\tif(value.getParent()==null){\r\n\t\t\ttreeModel.refresh(null);\r\n\t\t}else{\r\n\t\t\ttreeModel.refresh(value.getParent());\r\n\t\t}\r\n\t\ttreeModel.refresh(value);\r\n\t}", "public static void setOldTree(RootedTree t) {\r\n\t\tsetOldNewickString(createNewickString(t)); // Added by Madhu, it is where I save the newick\r\n\t\t// string for the uploaded tree.\r\n\t\tSystem.out.println(\"OLD NODE:\" + getOldNewickString());\r\n\t\toldTree = t;\r\n\t}", "public TreeNode getLeft(){ return leftChild;}", "private void recAdd(String data, Node root) {\r\n\t\tif (root == null) {\r\n\t\t\tSystem.out.println(\"OOPS, this shouldn't happen!!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tif (data.compareTo(root.getData()) < 0) {\r\n/////////////////////////////////\r\n/// go to left\t\t\t ///\r\n/////////////////////////////////\r\n\t\t\tif (root.getlChild() == null) {\r\n\t\t\t\t// put the data on the left child\r\n\t\t\t\tNode ng = new Node();\r\n\t\t\t\tng.setData(data);\r\n\t\t\t\tng.setCount();\r\n\t\t\t\troot.setlChild(ng);\r\n\t\t\t\tcount++;\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\trecAdd(data, root.getlChild());\r\n\t\t\t}\r\n\t\t} else {\r\n/////////////////////////////////\r\n/// go to right\t\t\t ///\r\n/////////////////////////////////\r\n\t\t\tif (root.getrChild() == null) {\r\n\t\t\t\t// put the data on the left child\r\n\t\t\t\tNode ng = new Node();\r\n\t\t\t\tng.setData(data);\r\n\t\t\t\tng.setCount();\r\n\t\t\t\troot.setrChild(ng);\r\n\t\t\t\tcount++;\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\trecAdd(data, root.getrChild());\r\n\t\t\t}\r\n\r\n\t\t\t// System.out.println(\"Count: \" + count);\r\n\t\t}\r\n\r\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 }", "private Node<Integer> addRecursive(Node<Integer> current, int value) {\n\t\tif (current == null) {\n\t\t\treturn new Node<Integer>(value);\n\n\t\t}\n\n\t\tif (value < current.value) {\n\t\t\tcurrent.left = addRecursive(current.left, value);\n\n\t\t} else if (value > current.value) {\n\t\t\tcurrent.right = addRecursive(current.right, value);\n\n\t\t} else\n\t\t\treturn current; // value exist\n\t\treturn current;\n\t}", "public TreeNodeImpl(N value) {\n this.value = value;\n }", "public void add(T t) {\n if (root.getNumKeys() == 4 && root.isLeaf()) {\n BTreeNode<T> newRoot = new BTreeNode(false);\n\n newRoot.setChild(root, 0);\n\n insercionOrdenada(root, t);\n splitChild(newRoot, root, 0);\n\n this.root = newRoot;\n } else {\n insertarKey(root, t);\n }\n }", "public static void setValue(Object tree, Object root, Object value)\n throws OgnlException {\n setValue(tree, createDefaultContext(root), root, value);\n }", "@Test\n public void whenAddNodesOnDifferentLevelsThenResultThreeNodeFromBottomToTop() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n assertThat(tree.getChildren().toString(), is(\"[3, 2, 1]\"));\n }", "public static void main(String[] args) {\n\n MultiChildTreeNode<String> ff = new MultiChildTreeNode<>(\"F\");\n MultiChildTreeNode<String> iff = new MultiChildTreeNode<>(\"I\");\n ff.children.add(iff);\n MultiChildTreeNode<String> kff = new MultiChildTreeNode<>(\"K\");\n ff.children.add(kff);\n MultiChildTreeNode<String> t2 = ff;//Subtree to find\n\n //Main tree\n MultiChildTreeNode<String> t1 = new MultiChildTreeNode<>(\"A\");\n MultiChildTreeNode<String> b = new MultiChildTreeNode<>(\"B\");\n MultiChildTreeNode<String> c = new MultiChildTreeNode<>(\"C\");\n MultiChildTreeNode<String> d = new MultiChildTreeNode<>(\"D\");\n t1.children.add(b);\n t1.children.add(c);\n t1.children.add(d);\n\n MultiChildTreeNode<String> e = new MultiChildTreeNode<>(\"E\");\n MultiChildTreeNode<String> h = new MultiChildTreeNode<>(\"H\");\n e.children.add(h);\n\n MultiChildTreeNode<String> f = new MultiChildTreeNode<>(\"F\");\n b.children.add(f);\n MultiChildTreeNode<String> i = new MultiChildTreeNode<>(\"I\");\n f.children.add(i);\n MultiChildTreeNode<String> j = new MultiChildTreeNode<>(\"J\");\n f.children.add(j);\n\n\n /**\n * A\n * / | \\\n * B C.. D...\n * / |\n *E.. F\n * / \\\n * I J\n * |\n * F\n * / \\\n * I K\n */\n j.children.add(ff); //commenting out this line should give false otherwise true\n\n MultiChildTreeNode<String> k = new MultiChildTreeNode<>(\"K\");\n MultiChildTreeNode<String> g = new MultiChildTreeNode<>(\"G\");\n b.children.add(e);\n\n b.children.add(g);\n MultiChildTreeNode<String> l = new MultiChildTreeNode<>(\"L\");\n c.children.add(k);\n c.children.add(l);\n\n MultiChildTreeNode<String> m = new MultiChildTreeNode<>(\"M\");\n MultiChildTreeNode<String> n = new MultiChildTreeNode<>(\"N\");\n MultiChildTreeNode<String> o = new MultiChildTreeNode<>(\"O\");\n d.children.add(m);\n d.children.add(n);\n d.children.add(o);\n CheckForSubTree<String> checker = new CheckForSubTree<>();\n System.out.println (checker.isSubTree(t1, t2));\n }", "public JdbTree(Hashtable value) {\r\n super(value);\r\n commonInit();\r\n }", "public void convertBinaryTreeToBinarySearchTree()\n\t{\n\t\tif(root==null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t/*Inorder traversal to fill array*/\n\t\tinOrderTraversal(root);\n\t\t/*sorting the array*/\n\t\tCollections.sort(arr);\n\t\t/*Traverse tree using inorder traversal, and replace the node data with data in sorted array*/\n\t\treplaceNodeInInorderTraverse(root);\n\t\t\n\t}", "public TreeNode mergeTrees(TreeNode t1, TreeNode t2) {\n if (t1 == null) return t2;\n if (t2 == null) return t1;\n TreeNode newNode = new TreeNode(t1.val + t2.val);\n newNode.left = mergeTrees(t1.left, t2.left);\n newNode.right = mergeTrees(t1.right, t2.right);\n return newNode;\n }", "@Override\n public BSTNode add(T object) {\n\n BSTNode newNode = new Leaf(object);\n\n\n if (object.compareTo(this.data) < 0) {\n // Put the new object below to the left.\n BSTNode convertedLead = new ElementNode(this.data, newNode, null);\n return convertedLead;\n } else {\n // Put the new object below to the right.\n BSTNode convertedLead = new ElementNode(this.data, null, newNode);\n return convertedLead;\n }\n\n }", "private void updateCategoryTree() {\n categoryTree.removeAll();\r\n fillTree(categoryTree);\r\n\r\n }", "public void add(K key, V value) {\n Node<K,V> node = root, parent = null;\n int cmp = -1;\n\n while (node != null) {\n cmp = key.compareTo(node.key);\n parent = node;\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n node.value = value;\n return;\n }\n }\n\n Node<K,V> new_node = new Node<>(key, value);\n if (parent == null) {\n root = new_node;\n } else if (cmp < 0) {\n parent.left = new_node;\n } else {\n parent.right = new_node;\n }\n }", "private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}", "private void refreshTagsTree(){\n List<TreeItem<String>> treeItemsList = new ArrayList<TreeItem<String>>();\n USER.getImagesByTags().forEach((key, value) -> {\n TreeItem<String> tagTreeItem = new TreeItem<>(key);\n tagTreeItem.getChildren().setAll(\n value.stream()\n .map(imageData -> new TreeItem<>(IMAGE_DATA.inverse().get(imageData).getName()))\n .collect(Collectors.toList())\n );\n treeItemsList.add(tagTreeItem);\n });\n ROOT.getChildren().setAll(treeItemsList);\n }", "TreeNode addChild(TreeNode node);", "public void convertToGreater(TreeNode root){\n if(root==null)return;\n \n //if it is a leaf node\n if(root.left==null && root.right==null){\n //temporary variable to store root value\n int prev=root.val;\n //adding sum value to root\n root.val+=sum;\n //adding prev value to sum\n sum+=prev;\n return; \n };\n //calling right subtree\n convertToGreater(root.right);\n //temporary variable to store root value\n int prev=root.val;\n //adding sum value to root\n root.val+=sum;\n //adding prev value to sum\n sum+=prev;\n //calling left sub tree\n convertToGreater(root.left);\n }", "public void put(int key, int value) {\n int hash = key % 1024;\n TreeNode treeNode = array[hash];\n if (treeNode == null) {\n array[hash] = new TreeNode(value);\n }\n if (value > treeNode.value) {\n\n }\n\n }", "public boolean add(T value) {\n NodePair<T> spl = split(root, value);\n\n if (spl.second != null && getLeft(spl.second).value.compareTo(value) == 0) {\n root = merge(spl.first, spl.second);\n return false;\n }\n\n root = merge(spl.first, merge(makeNode(value), spl.second));\n return true;\n }", "public BinarySearchTree(JSONObject object) {\r\n\t\tthis.root = null;\r\n for (Object key : object.keySet()) {\r\n \taddKeyValuePair(String.valueOf(key).toLowerCase(), (String)object.get(key));\r\n }\r\n\t}", "public void remove(T value) {\n\n // Declares and initializes the node whose value is being searched for and begins a recursive search.\n Node<T> node = new Node<>(value);\n if (root.getValue().compareTo(value) == 0) node = root;\n else node = searchRecursively(root, value);\n\n // If node has no children...\n if (node.getLeft() == null && node.getRight() == null) {\n // If it's the root, remove root.\n if (node.getValue().compareTo(root.getValue()) == 0) {\n root = null;\n return;\n }\n // Otherwise, get its parent node.\n Node parent = getParent(value);\n // Determines whether the node is the left or right child of the parent and sets the appropriate branch of\n // the parent to null.\n if (parent.getLeft() == null) {\n if (parent.getRight().getValue().compareTo(value) == 0)\n parent.setRight(null);\n } else if (parent.getRight() == null) {\n if (parent.getLeft().getValue().compareTo(value) == 0)\n parent.setLeft(null);\n } else if (parent.getLeft().getValue().compareTo(value) == 0) {\n parent.setLeft(null);\n } else if (parent.getRight().getValue().compareTo(value) == 0) {\n parent.setRight(null);\n }\n\n // If the node has either no left or no right branch...\n } else if (node.getLeft() == null || node.getRight() == null) {\n // If its left branch is null...\n if (node.getLeft() == null) {\n // If the value in question belongs to the root and root has no left branch, its right branch becomes\n // the new root.\n if (node.getValue().compareTo(root.getValue()) == 0) root = root.getRight();\n // Otherwise, finds the parent, determines whether the value in question belongs to the node in the\n // parent's left or right branch, and sets the appropriate branch to reference the node's right branch.\n else {\n Node<T> parent = getParent(value);\n if (parent.getLeft().getValue().compareTo(value) == 0) parent.setLeft(node.getRight());\n else parent.setRight(node.getRight());\n }\n // If its right branch is null...\n } else if (node.getRight() == null) {\n // If the value in question belongs to the root and root has no right branch, its left branch becomes\n // the new root.\n if (node.getValue().compareTo(root.getValue()) == 0) root = root.getLeft();\n else {\n Node<T> parent = getParent(value);\n if (parent.getLeft().getValue().compareTo(value) == 0) parent.setLeft(node.getLeft());\n else parent.setRight(node.getRight());\n }\n }\n // If the node has two children...\n } else {\n // Iterates through the current node's left nodes until none remain, replacing its value with that of its left node.\n while (node.getLeft() != null) {\n Node<T> left = node.getLeft();\n node.setValue(left.getValue());\n if (node.getLeft().getLeft() == null && node.getLeft().getRight() == null) {\n node.setLeft(null);\n }\n node = left;\n // If there are no left nodes but a right node exists, sets the current node's value to that of its right\n // node. Loop will continue to iterate through left nodes.\n if (node.getLeft() == null && node.getRight() != null) {\n Node<T> right = node.getRight();\n node.setValue(right.getValue());\n node = right;\n }\n }\n }\n balance(root);\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 Node<K, D> add(K key, D data, Node<K, D> root) {\n if (root == null)\n return new Node<K, D>(key, data);\n int c = key.compareTo(root.key);\n if (c <= 0) {\n root.left = add(key, data, root.left);\n return root;\n } else { // c > 0\n root.right = add(key, data, root.right);\n return root;\n }\n }", "public TreeNode convertBST(TreeNode root) {\n \tif (root==null) return null;\n \tif(root.right!=null){\n root.right = convertBST(root.right);\t\n\t}\n int org = root.val;\n \troot.val += sum;\n \t sum += org;\n \tif(root.left!=null){\n \t\troot.left = convertBST(root.left);\t\n \t}\n \treturn root;\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 encodeTree(){\n StringBuilder builder = new StringBuilder();\n encodeTreeHelper(root,builder);\n }", "public void insert(int value){\r\n\t\tNode node = new Node<>(value);\r\n\t\t//If the tree is empty\r\n\t\tif ( root == null ) {\r\n\t\t\troot = node;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tinsertRec(root, node);\r\n\t}", "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 }", "@Override\n\tpublic boolean add(T elem) {\n\t\tif (this.contains(elem)) { // no duplicates\n\t\t\treturn false;\n\t\t} else if (valCount < 3) { // if has space for more\n\t\t\tif (childCount == 0) { // add elem as direct descendant\n\t\t\t\tfor (int i = 0; i < valCount; ++i) {\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\tfor (int j = 2; j > i; --j) { // shifts all other elements by 1\n\t\t\t\t\t\t\tvalues[j] = values[j - 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvalues[i] = elem;\n\t\t\t\t\t++valCount;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else { // add elem as indirect descendant\n\t\t\t\tfor (int i = 0; i < childCount; ++i) { // searching with which child elem belongs\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\treturn children[i].add(elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn children[childCount].add(elem); // elem is greater than all other children and should be put rightmost\n\t\t\t}\n\t\t} else { // node is 4-tree and should be reduced\n\t\t\tTwoThreeFourTreeSet<T> tempLeft = new TwoThreeFourTreeSet<T>(); // generating new left and right children of reduced node\n\t\t\tTwoThreeFourTreeSet<T> tempRight = new TwoThreeFourTreeSet<T>();\n\t\t\t\n\t\t\ttempLeft.values[0] = values[0];\n\t\t\ttempLeft.valCount = 1;\n\t\t\ttempLeft.children[0] = this.children[0];\n\t\t\ttempLeft.children[1] = this.children[1];\n\t\t\ttempLeft.childCount = 2;\n\t\t\t\n\t\t\ttempRight.values[0] = values[2];\n\t\t\ttempRight.valCount = 1;\n\t\t\ttempRight.children[0] = this.children[2];\n\t\t\ttempRight.children[1] = this.children[3];\n\t\t\ttempRight.childCount = 2;\n\t\t\t\n\t\t\tif (parent == null) { // if no parent, create new node with middle value\n\t\t\t\tTwoThreeFourTreeSet<T> tempParent = new TwoThreeFourTreeSet<T>();\n\t\t\t\ttempParent.values[0] = values[1];\n\t\t\t\t\t\n\t\t\t\ttempParent.children[0] = tempLeft;\n\t\t\t\ttempParent.children[1] = tempRight;\n\t\t\t\ttempParent.childCount = 2;\n\t\t\t\tthis.parent = tempParent;\n\t\t\t} else { // else parent exists, and current node should be added\n\t\t\t\tif (comp.compare(parent.values[0],values[1]) < 0) { // if node belongs leftmost\n\t\t\t\t\tif (parent.valCount > 1) {\n\t\t\t\t\t\t// shift right element by 1\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// shift left element by 1\n\t\t\t\t\tparent.values[1] = parent.values[0];\n\t\t\t\t\tparent.children[2] = parent.children[1];\n\t\t\t\t\t\n\t\t\t\t\t// push left;\n\t\t\t\t\tparent.values[0] = values[1];\n\t\t\t\t\tparent.children[0] = tempLeft;\n\t\t\t\t\tparent.children[1] = tempRight;\n\t\t\t\t} else if (parent.valCount < 2 || comp.compare(parent.values[1],values[1]) < 0) { // if node belongs in center\n\t\t\t\t\tif (parent.valCount > 1) { // should we shift?\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// push center\n\t\t\t\t\tparent.values[1] = values[1];\n\t\t\t\t\tparent.children[1] = tempLeft;\n\t\t\t\t\tparent.children[2] = tempRight;\n\t\t\t\t} else { // if node belongs rightmost\n\t\t\t\t\t// push right\n\t\t\t\t\tparent.values[2] = values[1];\n\t\t\t\t\tparent.children[2] = tempLeft;\n\t\t\t\t\tparent.children[3] = tempRight;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tTwoThreeFourTreeSet<T> newTree = this;\n\t\t\tnewTree = newTree.parent; // changing this indirectly\n\t\t\t++newTree.valCount;\n\t\t\treturn newTree.add(elem);\n\t\t}\n\t\treturn false;\n\t}", "protected void setTree(JTree newTree) {\n\tif(tree != newTree) {\n\t if(tree != null)\n\t\ttree.removeTreeSelectionListener(this);\n\t tree = newTree;\n\t if(tree != null)\n\t\ttree.addTreeSelectionListener(this);\n\t if(timer != null) {\n\t\ttimer.stop();\n\t }\n\t}\n }", "public void addTo(BSTNode node, int value){\n // Allocate new node with specified value\n BSTNode newNode = new BSTNode(value);\n \n // Case 1: Value is less than the current node value\n if(value < node.value){\n // If there is no left child make this the new left\n if(node.left == null){\n node.left = newNode;\n }\n else{\n // else add it to the left node\n addTo(node.left, value);\n }\n } // End Case 1\n \n // Case 2: Value is equal to or greater than the current value\n else {\n // If there is no right, add it to the right\n if(node.right == null){\n node.right = newNode;\n }\n else{\n // else add it to the right node\n addTo(node.right, value);\n }\n } // End Case 2\n }", "private void process(TreeNode root){\n while(root!=null){\n dq.push(root);\n root= root.left;\n }\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 BinarySearchTree(Object root){\r\n\t\tthis.root = (KeyedItem)root;\r\n\t\tleftChild = null;\r\n\t\trightChild = null;\r\n\t}", "public void run() \n\t{\n\t\tNode currentNode = this.tree.getRoot();\n\t\t\n\t\t//if the tree is empty and set the new node as the root node\n\t\tif (this.tree.getRoot() == null) \n\t\t{\n\t\t\tthis.tree.setRoot(this.node = new Node(this.node));\n\t\t\tthis.node.advanceToTheRoot();\n\t\t\ttree.getNote().setNote(\"Inserting a new root node [\" + node.getData()+\"].\");\n\t\t\twaitOnPause();\n\t\t} \n\t\telse \n\t\t{\n\t\t\t//otherwise go above the node and start to search\n\t\t\tthis.node.advanceToAboveTheRoot();\n\t\t\ttree.getNote().setNote(\"Starting to insert node [\"+this.value+\"].\");\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\twhile (true) \n\t\t\t{\n\t\t\t\tint result = 0;\n\t\t\t\tboolean exit = false;\n\t\t\t\t\n\t\t\t\t//if the new node and the node which is being search are both numbers then \n\t\t\t\t//..convert their values into numbers and compare them.\n\t\t\t\tif(tree.isNumeric(currentNode.getData()) && tree.isNumeric(this.value))\n\t\t\t\t{\n\t\t\t\t\tint current = Integer.parseInt(currentNode.getData());\n\t\t\t\t\tint thisValue = Integer.parseInt(this.value);\n\t\t\t\t\t\n\t\t\t\t\tif (current == thisValue)\n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (thisValue < current) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (thisValue > current) \n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//else the node which is being searched is a number so compare\n\t\t\t\t\t//..them both as words.\n\t\t\t\t\tif (currentNode.getData().compareTo(this.value) == 0) \n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (this.value.compareTo(currentNode.getData()) < 0) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (this.value.compareTo(currentNode.getData()) > 0)\n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch(result)\n\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t//if the node already exists in the tree then remove the 'Search' node\n\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] already exists in the tree.\");\n\t\t\t\t\t\tif(!mf.getOpenF())\n\t\t\t\t\t\t\tthis.node.bgColor(node.getDeleteColor());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.node.setColor(node.getInvisibleColor(), node.getInvisibleColor());\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\tthis.node.goDown();\n\t\t\t\t\t\ttree.getNote().setNote(\"\");\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t//if the new node is less than the node which is being searched then go to its left\n\t\t\t\t\t\t//...child. If the left child is empty then set the new node as the left child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Checking left side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is less than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\tif (currentNode.getLeft() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node = new Node(this.node),\"left\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s left child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t//if the new node is greater than the node which is being searched then go to its right\n\t\t\t\t\t\t//...child. If the right child is empty then set the new node as the right child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Going to right side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is greater than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (currentNode.getRight() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// create a new node\n\t\t\t\t\t\t\tthis.node = new Node(this.node);\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node,\"right\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s right child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(exit)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//go to above the next node which is being searched.\n\t\t\t\tthis.node.advanceToNode(currentNode);\n\t\t\t\twaitOnPause();\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.node = (this.tree.node = null);\n\t\t\t\n\t\t\t//if the tree is not empty then reposition it.\n\t\t\tif(this.tree.getRoot() != null)\n\t\t\t\t\tthis.tree.getRoot().repositionTree();\n\t\t\t\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\t//check if the tree is balanced.\n\t\t\tthis.tree.reBalanceNode(currentNode);\n\t\t}\n\t\ttree.getNote().setNote(\"Insertion Complete.\");\n\t\ttree.getMainFrame().getStack().push(\"i \"+this.value); //add the operation to the stack\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 void refresh()\n\t{\n\t\tNode master = new Node(\"Tyler\");\n\t\t//master.add(new Node(\"Test\"));\n\t\tmaster.addParent(new Node(\"Clinton\"));\n\t\tmaster.addParent(new Node(\"Terry\"));\n\t\t\n\t\tmaster.add(\"Justin\", \"Terry\"); \n\t\tmaster.add(\"Justin\", \"Clinton\"); \n\t\t//this adds directly under Terry\n\t\t//maybe do this differently...\n\t\t\n\t\t\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"Diana\"));\n\t\tmaster.findNode(\"Terry\").addParent(new Node(\"George\"));\n\t\t\n\t\tmaster.add(new Node(\"Tyler 2.0\"));\n\t\tmaster.add(new Node(\"Tyler 3.0\"));\n\t\tmaster.add(new Node(\"Tyler Jr\"));\n\t\t\n\n\t\tmaster.add(\"Tyler Jr Jr\", \"Tyler 2.0\");\n\t\t\n\t\tmaster.add(\"Tyler 3.0\", \"Tyler Jr 2.0\");\n\t\t\n\t\tmaster.findNode(\"Clinton\").addParent(new Node(\"Eric\"));\n\t\tmaster.findNode(\"Eric\").addParent(new Node(\"Eric's Dad\"));\n\t\t\n\t\t\n\t\tmaster.findNode(\"Tyler Jr Jr\", 6).add(new Node(\"Mini Tyler\"));\n\t\t//master.findNode(\"Clinton\", 2).add(new Node(\"Justin\"));\n\t\t\n\t\t\n\t\tmaster.getParent().get(0).findNode(\"Justin\", 3).add(new Node(\"Mini Justin\"));\n\t\t\n\t\tmaster.add(new Node(\"Laptop\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Keyboard\"));\n\t\tmaster.findNode(\"Laptop\").add(new Node(\"Mouse\"));\n\t\t\n\t\tmaster.add(\"Touchpad\", \"Laptop\");\n\t\t//master.add(\"Justin\", \"Eric\");\n\t\t\n\t\tmaster.add(\"Hunger\", \"Tyler\");\n\t\t\n\t\tselectedNode = master;\n\t\tselect(selectedNode);\n\t}", "static void buildtree(int arr[], int tree[], int start, int end, int index) {\r\n\t\tif (start == end) {\r\n\t\t\ttree[index] = arr[start];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tint mid = (start + end) / 2;\r\n\t\tbuildtree(arr, tree, start, mid, 2 * index);\r\n\t\tbuildtree(arr, tree, mid + 1, end, (2 * index) + 1);\r\n\r\n\t\ttree[index] = tree[2 * index] + tree[(2 * index) + 1];\r\n\r\n\t}", "public JdbNavTree(Hashtable value) {\r\n super(value);\r\n commonInit();\r\n }", "public MyTree getTree() {\r\n\t\treturn tree;\r\n\t}", "private void buildRoot() {\n this.root = new GPRootTreeNode(this.tree);\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 }", "BinarySearchTree() {\n this.root = null;\n }", "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 }", "private AVLTreeNode<E> insert(E value) {\n int cmp = this.getValue().compareTo(value);\n AVLTreeNode<E> result;\n if(cmp == 0){\n result = null;\n } else if(cmp < 0){\n result = this.getRight() != null ? this.getRight().insert(value) : createTreeNode(value);\n if(result != null){\n this.setRight(result);\n }\n } else {\n result = this.getLeft() != null ? this.getLeft().insert(value) : createTreeNode(value);\n if(result != null){\n this.setLeft(result);\n }\n }\n return result == null ? result : balancing(this);\n }", "private void updateTree() {\n String txt = textArea.getText();\n int tabSize = textArea.getTabSize();\n StringBuilder sb = new StringBuilder(tabSize);\n for (int i=0; i<tabSize; i++) {\n sb.append(\" \"); // NOI18N\n }\n txt = txt.replace(\"\\t\", sb.toString()); // NOI18N\n TreeModel model = propEditor.createTreeModel(txt);\n tree.setModel(model);\n expandTree();\n propEditor.setValue(model);\n }", "public void agregarNodo(Nodo nuevo){\n agregarNodoRec(root, nuevo);//la primera vez inicia en la raiz \n }", "private Node<E> add(E item, Node<E> root){\n\t\t/** found a place to store the item */\n\t\tif(root == null){\n\t\t\taddReturn = true;\n\t\t\troot = new Node<E>(item);\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/** item to add already exists in the tree */\n\t\tif(comparison == 0){\n\t\t\taddReturn = false;\n\t\t\treturn root;\n\t\t}\n\t\t/** item is less -> add to the left of the root */\n\t\telse if(comparison < 0){\n\t\t\troot.left = add(item, root.left);\n\t\t\treturn root;\n\t\t}\n\t\t/** item is greater -> add to the right of the root */\n\t\telse{\n\t\t\troot.right = add(item, root.right);\n\t\t\treturn root;\n\t\t}\n\t}", "public JTree getTree(){\n return tree;\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 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 void setTreeSize(Double newtreesize)\n {\n treesize = newtreesize; \n }" ]
[ "0.7183966", "0.6662534", "0.6439387", "0.6328256", "0.6319511", "0.6293745", "0.628786", "0.6232303", "0.61746097", "0.6122033", "0.60945445", "0.6084331", "0.60837126", "0.60775816", "0.6075876", "0.6026704", "0.6021711", "0.59951913", "0.5990002", "0.59698856", "0.59637403", "0.5956174", "0.59311897", "0.5921204", "0.5901031", "0.58950025", "0.58831924", "0.58787", "0.5871628", "0.58714175", "0.58703", "0.58450705", "0.58417636", "0.58337235", "0.58336073", "0.5829856", "0.5825111", "0.5821731", "0.5817914", "0.58159643", "0.581408", "0.58117855", "0.5810419", "0.5800362", "0.5798167", "0.578633", "0.5785779", "0.5770523", "0.5765334", "0.5759563", "0.57562554", "0.5754995", "0.5743372", "0.5734875", "0.5728534", "0.5728183", "0.57146364", "0.5714599", "0.57133335", "0.57024556", "0.56979305", "0.56967324", "0.5687428", "0.568729", "0.5686869", "0.5684997", "0.5681274", "0.56796134", "0.5672299", "0.566447", "0.5659611", "0.5655364", "0.56529653", "0.5650151", "0.56493527", "0.56360954", "0.56335837", "0.56220084", "0.5620567", "0.56108814", "0.56101495", "0.5605989", "0.560505", "0.56042093", "0.56026185", "0.55969", "0.5595001", "0.5594526", "0.55936", "0.55862206", "0.55797476", "0.55727977", "0.5570144", "0.5563041", "0.5553438", "0.5551854", "0.555096", "0.55506724", "0.55437446", "0.55434006", "0.5541351" ]
0.0
-1
post: value is added to given binary search tree so as to preserve the binary search tree property
private IntTreeNode add(IntTreeNode root, int value) { if (root == null) { root = new IntTreeNode(value); } else if (value <= root.data) { root.left = add(root.left, value); } else { root.right = add(root.right, value); } return root; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tree<T> add(Tree<T> tree) {\n checkForNull(tree);\n\n if (childrenValueSet.contains(tree.value)) {\n return null;\n }\n\n if (tree.parent != null) {\n tree.remove();\n }\n\n tree.parent = this;\n children.add(tree);\n childrenValueSet.add(tree.value);\n incModificationCount();\n\n return tree;\n }", "public void add(Comparable obj)\n { \n \t //TODO\n \t //add code\n \t Node n = new Node(); \n \t n.data = obj;\n \t // \tn.left = null;\n \t // \tn.right = null;\n\n \t Node y = null;\n \t // \tNode x = root;\n \t Node current = root;\n \t while(current != null)\n \t {\n \t\t y = current;\n \t\t if(n.data.compareTo(root.data) < 0)\n \t\t\t current = current.left;\n \t\t else\n \t\t\t current = current.right;\n \t }\n\n\n \t n.parent = y;\n \t if(y == null)\n \t\t root = n;\n \t else\n \t\t if(n.data.compareTo(y.data) < 0)\n \t\t\t y.left = n;\n \t\t else\n \t\t\t y.right = n;\n \t n.left = null;\n \t n.right = null;\n \t n.color = RED;\n \t // \troot = new Node();\n \t // \troot.data = \"k\";\n \t // \tNode test = new Node();\n \t // \ttest.data = \"g\";\n \t // \troot.left= test;\n// \t System.out.println(\"the insertion looks like:\");\n// \t System.out.println(BTreePrinter.printNode(root));\n\n \t fixup(root,n);\n \t /*\n \tThe insert() method places a data item into the tree.\n\n \tInsertions\n \tpseudocode for\n \tRB-Insert(T,z)\n \ty = nil[T]\n \tx = root[T]\n \twhile x != nil[T]\n \ty = x\n \tif key[z] < key[x] then\n \tx = left[x]\n \telse\n \tx = right[x]\n \tp[z] = y\n \tif y = nil[T]\n \troot[T] = z\n \telse\n \tif key[z] < key[y] then\n \tleft[y] = z\n \telse\n \tright[y] = z\n \tleft[z] = nil[T]\n \tright[z] = nil[T]\n \tcolor[z] = RED\n \tRB-Insert-fixup(T,z)\n \t */\n }", "public void postorder()\r\n {\r\n postorder(root);\r\n }", "protected void addingNode( SearchNode 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 Tree<T> add(T value) {\n checkForNull(value);\n\n if (childrenValueSet.contains(value)) {\n return null;\n }\n\n Tree<T> tree = new Tree<>(value, this);\n incModificationCount();\n\n return tree;\n }", "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}", "public void add(E val){\n if(mData.compareTo(val) > 0){\n if(mLeft == null){\n mLeft = new BSTNode(val);\n mLeft.mParent = this;\n }//End if null\n else if(mRight == null){\n mRight = new BSTNode(val);\n mRight.mParent = this;\n }//End Else\n }//End if\n else{\n mLeft.add(val);\n mLeft.mParent = this;\n }//End Else\n }", "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 void putInBinaryTree(int val) {\n BinaryTree.Node node = this.binaryTree.getRoot();\n BinaryTree.Node parent = node;\n while (node != null) {\n parent = node;\n if (val < node.data) node = node.left;\n else node = node.right;\n }\n if (val < parent.data) this.binaryTree.addAsLeftChild(parent, val);\n else this.binaryTree.addAsRightChild(parent, val);\n }", "@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 }", "@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 }", "public void add(int value){\n \n // Case 1: The tree is empty - allocate the root\n if(root==null){\n root = new BSTNode(value);\n }\n \n // Case 2: The tree is not empty \n // find the right location to insert value\n else{\n addTo(root, value);\n } \n count++; // update the number of nodes\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 }", "private boolean add(E item, BinaryTree<E> tree)\r\n\t{\r\n\t\tif (item.compareTo(tree.value()) > 0 && tree.right() == null)\r\n\t\t{\r\n\t\t\ttree.setRight(new BinaryTree<E>(item));\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) < 0 && tree.left() == null)\r\n\t\t{\r\n\t\t\ttree.setLeft(new BinaryTree<E>(item));\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) == 0)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) > 0)\r\n\t\t{\r\n\t\t\treturn add(item, tree.right());\r\n\t\t}\r\n\r\n\t\tif (item.compareTo(tree.value()) < 0)\r\n\t\t{\r\n\t\t\treturn add(item, tree.left());\r\n\t\t}\r\n\t\treturn true;\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 add(int value){\n if (value < this.value){\n if (this.left != null)\n left.add(value);\n else left = new MyBinaryTreeNode(value);\n }\n else if (value > this.value){\n if (this.right != null)\n right.add(value);\n else right = new MyBinaryTreeNode(value);\n }\n }", "public boolean add(T value) {\n NodePair<T> spl = split(root, value);\n\n if (spl.second != null && getLeft(spl.second).value.compareTo(value) == 0) {\n root = merge(spl.first, spl.second);\n return false;\n }\n\n root = merge(spl.first, merge(makeNode(value), spl.second));\n return true;\n }", "public void postorder()\n {\n postorder(root);\n }", "public void postorder()\n {\n postorder(root);\n }", "private static Object[] set(\n Object[] root,\n int depth,\n Object value,\n int index) {\n\n Object[] newRoot = root.clone();\n\n if (depth == 0) {\n // Base case; directly insert the value.\n newRoot[index & 0x1F] = value;\n } else {\n // Recurse, then swap the result in for the appropriate place in\n // this node.\n int nodeIndex = getNodeIndex(index, depth);\n Object[] child = (Object[]) root[nodeIndex];\n newRoot[nodeIndex] = set(child, depth - 5, value, index);\n }\n\n return newRoot;\n }", "@Override\n public boolean add(E value) {\n final AVLTreeNode<E> insert = insert(value);\n if(insert != null && insert != tree.getHead()){\n tree.setHead(insert);\n }\n return insert != null;\n }", "@Override\npublic void setIncrementalChildAddition(boolean newVal) {\n\t\n}", "@Override\n public BSTNode add(T object) {\n\n BSTNode newNode = new Leaf(object);\n\n\n if (object.compareTo(this.data) < 0) {\n // Put the new object below to the left.\n BSTNode convertedLead = new ElementNode(this.data, newNode, null);\n return convertedLead;\n } else {\n // Put the new object below to the right.\n BSTNode convertedLead = new ElementNode(this.data, null, newNode);\n return convertedLead;\n }\n\n }", "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 void addTo(BSTNode node, int value){\n // Allocate new node with specified value\n BSTNode newNode = new BSTNode(value);\n \n // Case 1: Value is less than the current node value\n if(value < node.value){\n // If there is no left child make this the new left\n if(node.left == null){\n node.left = newNode;\n }\n else{\n // else add it to the left node\n addTo(node.left, value);\n }\n } // End Case 1\n \n // Case 2: Value is equal to or greater than the current value\n else {\n // If there is no right, add it to the right\n if(node.right == null){\n node.right = newNode;\n }\n else{\n // else add it to the right node\n addTo(node.right, value);\n }\n } // End Case 2\n }", "public void add(K key, V value) {\n Node<K,V> node = root, parent = null;\n int cmp = -1;\n\n while (node != null) {\n cmp = key.compareTo(node.key);\n parent = node;\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n node.value = value;\n return;\n }\n }\n\n Node<K,V> new_node = new Node<>(key, value);\n if (parent == null) {\n root = new_node;\n } else if (cmp < 0) {\n parent.left = new_node;\n } else {\n parent.right = new_node;\n }\n }", "private boolean addElement(E value) {\n if (value.equals(this.value)) {\n return false;\n }\n\n if (((Comparable)value).compareTo(this.value) < 0) {\n if (this.leftChild != null) {\n if (!this.leftChild.addElement(value)) {\n return false;\n }\n this.leftChild = this.leftChild.balance();\n } else {\n this.leftChild = new Node(value, null, null, 1);\n }\n } else {\n if (this.rightChild != null) {\n if (!this.rightChild.addElement(value)) {\n return false;\n }\n this.rightChild = this.rightChild.balance();\n } else {\n this.rightChild = new Node(value, null, null, 1);\n }\n }\n return true;\n }", "private Node add(Node root, Integer value) {\n\t\tif(root==null)\n\t\t\troot=new Node(value);\n\t\telse if(value<root.value)\n\t\t\troot.left=add(root.left, value);\n\t\telse if(value>root.value)\n\t\t\troot.right=add(root.right,value);\n\t\telse\n\t\t\tthrow new RuleViolationException();\n\t\treturn root;\n\t}", "private void UpdateAddNestedValue(){\n notebookRef.document(\"IpWOjXtIgGJ2giKF4VTp\")\r\n// .update(KEY_Tags+\".tag1\", false);\r\n\r\n // ****** For Practice If we have nested over nested values likke:\r\n // tags-> tag1-> nested_tag-> nested_tag2 :true we write like\r\n .update(\"tags.tag1.nested_tag.nested_tag2\", true);\r\n\r\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 void add(int value) {\n // resize if necessary\n if (size + 1 >= elementData.length) {\n elementData = Arrays.copyOf(elementData, elementData.length * 2);\n }\n \n // insert as new rightmost leaf\n elementData[size + 1] = value;\n \n // \"bubble up\" toward root as necessary to fix ordering\n int index = size + 1;\n boolean found = false; // have we found the proper place yet?\n while (!found && hasParent(index)) {\n int parent = parent(index);\n if (elementData[index] < elementData[parent]) {\n swap(elementData, index, parent(index));\n index = parent(index);\n } else {\n found = true; // found proper location; stop the loop\n }\n }\n \n size++;\n }", "public boolean add(Object value)\r\n {\r\n if (contains(value))\r\n return false;\r\n root = add(root, value);\r\n return true;\r\n }", "public void add(int value, String name){\n \n Node newNode = new Node(value, name); //Intialize new node \n \n if(root == null){ //If the root is null \n root = newNode; //Set newNode to the root \n }\n else{ \n Node myNode = root; //Create a second new node\n Node parent; //Crete a parent Node \n\n while (true) { //While true....\n \n parent = myNode;//Set parent node to myNode\n \n if (value < myNode.value) { //If the value is less than my node \n \n myNode = myNode.left; //Set myNode to left \n \n if (myNode == null) { //If the value of myNode is null \n \n parent.left = newNode; //Set the left parent node to newNode\n return; \n \n }\n }else {\n \n myNode = myNode.right; //Set myNode to the right Node\n \n if (myNode == null) {\n \n parent.right = newNode; //Set the right node to the newNode\n return;\n \n }\n\n }\n\n }\n \n }\n \n \n }", "private void recAdd(String data, Node root) {\r\n\t\tif (root == null) {\r\n\t\t\tSystem.out.println(\"OOPS, this shouldn't happen!!\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tif (data.compareTo(root.getData()) < 0) {\r\n/////////////////////////////////\r\n/// go to left\t\t\t ///\r\n/////////////////////////////////\r\n\t\t\tif (root.getlChild() == null) {\r\n\t\t\t\t// put the data on the left child\r\n\t\t\t\tNode ng = new Node();\r\n\t\t\t\tng.setData(data);\r\n\t\t\t\tng.setCount();\r\n\t\t\t\troot.setlChild(ng);\r\n\t\t\t\tcount++;\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\trecAdd(data, root.getlChild());\r\n\t\t\t}\r\n\t\t} else {\r\n/////////////////////////////////\r\n/// go to right\t\t\t ///\r\n/////////////////////////////////\r\n\t\t\tif (root.getrChild() == null) {\r\n\t\t\t\t// put the data on the left child\r\n\t\t\t\tNode ng = new Node();\r\n\t\t\t\tng.setData(data);\r\n\t\t\t\tng.setCount();\r\n\t\t\t\troot.setrChild(ng);\r\n\t\t\t\tcount++;\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\trecAdd(data, root.getrChild());\r\n\t\t\t}\r\n\r\n\t\t\t// System.out.println(\"Count: \" + count);\r\n\t\t}\r\n\r\n\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 }", "public void postorder() {\n\t\tpostorder(root);\n\t}", "@Override\n\tpublic boolean add(T elem) {\n\t\tif (this.contains(elem)) { // no duplicates\n\t\t\treturn false;\n\t\t} else if (valCount < 3) { // if has space for more\n\t\t\tif (childCount == 0) { // add elem as direct descendant\n\t\t\t\tfor (int i = 0; i < valCount; ++i) {\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\tfor (int j = 2; j > i; --j) { // shifts all other elements by 1\n\t\t\t\t\t\t\tvalues[j] = values[j - 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvalues[i] = elem;\n\t\t\t\t\t++valCount;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else { // add elem as indirect descendant\n\t\t\t\tfor (int i = 0; i < childCount; ++i) { // searching with which child elem belongs\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\treturn children[i].add(elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn children[childCount].add(elem); // elem is greater than all other children and should be put rightmost\n\t\t\t}\n\t\t} else { // node is 4-tree and should be reduced\n\t\t\tTwoThreeFourTreeSet<T> tempLeft = new TwoThreeFourTreeSet<T>(); // generating new left and right children of reduced node\n\t\t\tTwoThreeFourTreeSet<T> tempRight = new TwoThreeFourTreeSet<T>();\n\t\t\t\n\t\t\ttempLeft.values[0] = values[0];\n\t\t\ttempLeft.valCount = 1;\n\t\t\ttempLeft.children[0] = this.children[0];\n\t\t\ttempLeft.children[1] = this.children[1];\n\t\t\ttempLeft.childCount = 2;\n\t\t\t\n\t\t\ttempRight.values[0] = values[2];\n\t\t\ttempRight.valCount = 1;\n\t\t\ttempRight.children[0] = this.children[2];\n\t\t\ttempRight.children[1] = this.children[3];\n\t\t\ttempRight.childCount = 2;\n\t\t\t\n\t\t\tif (parent == null) { // if no parent, create new node with middle value\n\t\t\t\tTwoThreeFourTreeSet<T> tempParent = new TwoThreeFourTreeSet<T>();\n\t\t\t\ttempParent.values[0] = values[1];\n\t\t\t\t\t\n\t\t\t\ttempParent.children[0] = tempLeft;\n\t\t\t\ttempParent.children[1] = tempRight;\n\t\t\t\ttempParent.childCount = 2;\n\t\t\t\tthis.parent = tempParent;\n\t\t\t} else { // else parent exists, and current node should be added\n\t\t\t\tif (comp.compare(parent.values[0],values[1]) < 0) { // if node belongs leftmost\n\t\t\t\t\tif (parent.valCount > 1) {\n\t\t\t\t\t\t// shift right element by 1\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// shift left element by 1\n\t\t\t\t\tparent.values[1] = parent.values[0];\n\t\t\t\t\tparent.children[2] = parent.children[1];\n\t\t\t\t\t\n\t\t\t\t\t// push left;\n\t\t\t\t\tparent.values[0] = values[1];\n\t\t\t\t\tparent.children[0] = tempLeft;\n\t\t\t\t\tparent.children[1] = tempRight;\n\t\t\t\t} else if (parent.valCount < 2 || comp.compare(parent.values[1],values[1]) < 0) { // if node belongs in center\n\t\t\t\t\tif (parent.valCount > 1) { // should we shift?\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// push center\n\t\t\t\t\tparent.values[1] = values[1];\n\t\t\t\t\tparent.children[1] = tempLeft;\n\t\t\t\t\tparent.children[2] = tempRight;\n\t\t\t\t} else { // if node belongs rightmost\n\t\t\t\t\t// push right\n\t\t\t\t\tparent.values[2] = values[1];\n\t\t\t\t\tparent.children[2] = tempLeft;\n\t\t\t\t\tparent.children[3] = tempRight;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tTwoThreeFourTreeSet<T> newTree = this;\n\t\t\tnewTree = newTree.parent; // changing this indirectly\n\t\t\t++newTree.valCount;\n\t\t\treturn newTree.add(elem);\n\t\t}\n\t\treturn false;\n\t}", "@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}", "private Node putHelper(K key, V value, Node p) {\n if(p == null){\n size++;\n Node node = new Node(key, value);\n return node;\n }\n int cmp = key.compareTo(p.key);\n if(cmp < 0){\n // put int the left\n p.left = putHelper(key, value, p.left);\n }else if(cmp > 0){\n // put in the right\n p.right = putHelper(key, value, p.right);\n }else{\n p.value = value;\n }\n return p;\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 void run() \n\t{\n\t\tNode currentNode = this.tree.getRoot();\n\t\t\n\t\t//if the tree is empty and set the new node as the root node\n\t\tif (this.tree.getRoot() == null) \n\t\t{\n\t\t\tthis.tree.setRoot(this.node = new Node(this.node));\n\t\t\tthis.node.advanceToTheRoot();\n\t\t\ttree.getNote().setNote(\"Inserting a new root node [\" + node.getData()+\"].\");\n\t\t\twaitOnPause();\n\t\t} \n\t\telse \n\t\t{\n\t\t\t//otherwise go above the node and start to search\n\t\t\tthis.node.advanceToAboveTheRoot();\n\t\t\ttree.getNote().setNote(\"Starting to insert node [\"+this.value+\"].\");\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\twhile (true) \n\t\t\t{\n\t\t\t\tint result = 0;\n\t\t\t\tboolean exit = false;\n\t\t\t\t\n\t\t\t\t//if the new node and the node which is being search are both numbers then \n\t\t\t\t//..convert their values into numbers and compare them.\n\t\t\t\tif(tree.isNumeric(currentNode.getData()) && tree.isNumeric(this.value))\n\t\t\t\t{\n\t\t\t\t\tint current = Integer.parseInt(currentNode.getData());\n\t\t\t\t\tint thisValue = Integer.parseInt(this.value);\n\t\t\t\t\t\n\t\t\t\t\tif (current == thisValue)\n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (thisValue < current) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (thisValue > current) \n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//else the node which is being searched is a number so compare\n\t\t\t\t\t//..them both as words.\n\t\t\t\t\tif (currentNode.getData().compareTo(this.value) == 0) \n\t\t\t\t\t\tresult = 1;\n\t\t\t\t\t\n\t\t\t\t\t// if the new node comes before the current node, go left\n\t\t\t\t\tif (this.value.compareTo(currentNode.getData()) < 0) \n\t\t\t\t\t\tresult = 2;\n\t\t\t\t\telse if (this.value.compareTo(currentNode.getData()) > 0)\n\t\t\t\t\t\tresult = 3;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch(result)\n\t\t\t\t{\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t//if the node already exists in the tree then remove the 'Search' node\n\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] already exists in the tree.\");\n\t\t\t\t\t\tif(!mf.getOpenF())\n\t\t\t\t\t\t\tthis.node.bgColor(node.getDeleteColor());\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tthis.node.setColor(node.getInvisibleColor(), node.getInvisibleColor());\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\tthis.node.goDown();\n\t\t\t\t\t\ttree.getNote().setNote(\"\");\n\t\t\t\t\t\twaitOnPause();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\t//if the new node is less than the node which is being searched then go to its left\n\t\t\t\t\t\t//...child. If the left child is empty then set the new node as the left child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Checking left side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is less than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\tif (currentNode.getLeft() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node = new Node(this.node),\"left\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s left child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\t//if the new node is greater than the node which is being searched then go to its right\n\t\t\t\t\t\t//...child. If the right child is empty then set the new node as the right child and\n\t\t\t\t\t\t//...connect them both.\n\t\t\t\t\t\ttree.getNote().setNote(\"Going to right side since node [\" + this.value +\n\t\t\t\t\t\t\t\t\"] is greater than node [\"+ currentNode.getData()+\"].\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (currentNode.getRight() != null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// create a new node\n\t\t\t\t\t\t\tthis.node = new Node(this.node);\n\t\t\t\t\t\t\tcurrentNode.connectNode(this.node,\"right\");\n\t\t\t\t\t\t\ttree.getNote().setNote(\"Node [\"+this.value+\"] inserted since node [\"+currentNode.getData()+\n\t\t\t\t\t\t\t\t\t\"]'s right child is empty.\");\n\t\t\t\t\t\t\texit = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(exit)\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//go to above the next node which is being searched.\n\t\t\t\tthis.node.advanceToNode(currentNode);\n\t\t\t\twaitOnPause();\t\n\t\t\t}\n\t\t\t\n\t\t\tthis.node = (this.tree.node = null);\n\t\t\t\n\t\t\t//if the tree is not empty then reposition it.\n\t\t\tif(this.tree.getRoot() != null)\n\t\t\t\t\tthis.tree.getRoot().repositionTree();\n\t\t\t\n\t\t\twaitOnPause();\n\t\t\t\n\t\t\t//check if the tree is balanced.\n\t\t\tthis.tree.reBalanceNode(currentNode);\n\t\t}\n\t\ttree.getNote().setNote(\"Insertion Complete.\");\n\t\ttree.getMainFrame().getStack().push(\"i \"+this.value); //add the operation to the stack\n\t}", "public void add(T value) {\n final Node node = new Node(value);\n if (root != null) {\n root.add(node);\n } else {\n root = node;\n }\n }", "public void 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 NonEmptyTree<K, V> add(K key, V value) {\n\t\tTree<K, V> t = this;\n\t\treturn add(t, key, value);\n\t}", "public static void populateTree(BinarySearchTree tree)\n {\n for(int i = 0; i < 20; i++)\n {\n tree.add(i);\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 void agregarNodo(Nodo nuevo){\n agregarNodoRec(root, nuevo);//la primera vez inicia en la raiz \n }", "private Node<Integer> addRecursive(Node<Integer> current, int value) {\n\t\tif (current == null) {\n\t\t\treturn new Node<Integer>(value);\n\n\t\t}\n\n\t\tif (value < current.value) {\n\t\t\tcurrent.left = addRecursive(current.left, value);\n\n\t\t} else if (value > current.value) {\n\t\t\tcurrent.right = addRecursive(current.right, value);\n\n\t\t} else\n\t\t\treturn current; // value exist\n\t\treturn current;\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}", "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 }", "@Override\n\tpublic V add(K key, V value) {\n\t\tV result = null;\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(currentNode != null && key.equals(currentNode.getKey())){\n\t\t\tresult = (V) currentNode.getValue();\n\t\t\tcurrentNode.setValue(value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tNode newNode = new Node(key, value);\n\t\t\tif(currentNode == null){\n\t\t\t\tnewNode.setNextNode(firstNode);\n\t\t\t\tfirstNode = newNode;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfirstNode.setNextNode(newNode);\n\t\t\t}\n\t\tnumberOfEntries++;\t\n\t\t}\n\t\t\n\t\treturn result;\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 boolean add(Object value) throws WrongInputException\n {\n \tif(! (value instanceof Integer)){\n \t\tthrow new WrongInputException();\n \t}\n Queue queue = new Queue();\n queue.enqueue(this);\n while( ! queue.isEmpty() )\n {\n BinaryTree tree = (BinaryTree)queue.dequeue();\n\n //if the current position is null, then we know we can place a\n //value here.\n //place the value in that position in the tree, and create new \n //BinaryTrees for its children, which will both initially be null.\n if (tree.isEmpty())\n {\n tree.data = value;\n tree.left = new BinaryTree();\n tree.right = new BinaryTree();\n return true;\n }\n //otherwise, if the position is not null (that is, we can't place\n //it at the current position), then we add the left and right children\n //to the queue (if we can) and go back to the beginning of the loop.\n queue.enqueue(tree.left);\n queue.enqueue(tree.right);\n }\n return false; //this statement should never be executed.\n }", "TreeNode addChild(TreeNode node);", "private Node<E> add(E item, Node<E> root){\n\t\t/** found a place to store the item */\n\t\tif(root == null){\n\t\t\taddReturn = true;\n\t\t\troot = new Node<E>(item);\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/** item to add already exists in the tree */\n\t\tif(comparison == 0){\n\t\t\taddReturn = false;\n\t\t\treturn root;\n\t\t}\n\t\t/** item is less -> add to the left of the root */\n\t\telse if(comparison < 0){\n\t\t\troot.left = add(item, root.left);\n\t\t\treturn root;\n\t\t}\n\t\t/** item is greater -> add to the right of the root */\n\t\telse{\n\t\t\troot.right = add(item, root.right);\n\t\t\treturn root;\n\t\t}\n\t}", "protected boolean addLeft(T value) {\n this.left = createTreeNode(value);\n return true;\n }", "public static void process(BinarySearchTree tree)\n {\n Scanner keyboard = new Scanner(System.in);\n\n boolean end = false;\n int currentValue = 0;\n int index = 0;\n\n while(end == false)\n {\n try\n {\n System.out.print(\"Enter #\" + ++index + \": \");\n\n currentValue = keyboard.nextInt();\n\n tree.add(currentValue);\n }\n catch(InputMismatchException e)\n {\n end = true;\n System.out.println(\"Ending input\");\n }\n }\n\n System.out.println(\"DATA POST POPULATION: \\n\" + tree.breadthFirstTraversal());\n }", "@Override\n public boolean add(T parent, T child) {\n boolean result = false;\n if (this.root == null) {\n this.root = new Node<>(parent);\n this.root.add(new Node<>(child));\n result = true;\n this.modCount++;\n } else if (findBy(parent).isPresent()) {\n findBy(parent).get().add(new Node<>(child));\n result = true;\n this.modCount++;\n }\n return result;\n }", "@Test\n public void testManipulateObjectByReference() {\n TreeNode root = new TreeNode(0);\n root.left = new TreeNode(1);\n root.right = new TreeNode(2);\n setLeftChildToNull(root);\n System.out.println(root.left);\n }", "public void postOrder(MyBinNode<Type> r){\n if(r != null){\n this.postOrder(r.right);\n this.postOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n }\n }", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "public void put(int key, int value) {\n int hash = key % 1024;\n TreeNode treeNode = array[hash];\n if (treeNode == null) {\n array[hash] = new TreeNode(value);\n }\n if (value > treeNode.value) {\n\n }\n\n }", "private Node<K, D> add(K key, D data, Node<K, D> root) {\n if (root == null)\n return new Node<K, D>(key, data);\n int c = key.compareTo(root.key);\n if (c <= 0) {\n root.left = add(key, data, root.left);\n return root;\n } else { // c > 0\n root.right = add(key, data, root.right);\n return root;\n }\n }", "private AVLTreeNode<E> insert(E value) {\n int cmp = this.getValue().compareTo(value);\n AVLTreeNode<E> result;\n if(cmp == 0){\n result = null;\n } else if(cmp < 0){\n result = this.getRight() != null ? this.getRight().insert(value) : createTreeNode(value);\n if(result != null){\n this.setRight(result);\n }\n } else {\n result = this.getLeft() != null ? this.getLeft().insert(value) : createTreeNode(value);\n if(result != null){\n this.setLeft(result);\n }\n }\n return result == null ? result : balancing(this);\n }", "public void insert(int value){\r\n\t\tNode node = new Node<>(value);\r\n\t\t//If the tree is empty\r\n\t\tif ( root == null ) {\r\n\t\t\troot = node;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tinsertRec(root, node);\r\n\t}", "protected boolean addRight(T value) {\n this.right = createTreeNode(value);\n return true;\n }", "public void postOrder(BinarySearchTreeNode<T> node)\r\n {\r\n if(node==null)\r\n {\r\n return;\r\n }\r\n postOrder(node.getLeft());\r\n postOrder(node.getRight());\r\n System.out.println(node.getElement());\r\n\r\n }", "@Override\n\tpublic void add(Integer value) {\n\t\troot=add(root,value);\n\t\tcount++;\n\t}", "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 void remove(T value) {\n\n // Declares and initializes the node whose value is being searched for and begins a recursive search.\n Node<T> node = new Node<>(value);\n if (root.getValue().compareTo(value) == 0) node = root;\n else node = searchRecursively(root, value);\n\n // If node has no children...\n if (node.getLeft() == null && node.getRight() == null) {\n // If it's the root, remove root.\n if (node.getValue().compareTo(root.getValue()) == 0) {\n root = null;\n return;\n }\n // Otherwise, get its parent node.\n Node parent = getParent(value);\n // Determines whether the node is the left or right child of the parent and sets the appropriate branch of\n // the parent to null.\n if (parent.getLeft() == null) {\n if (parent.getRight().getValue().compareTo(value) == 0)\n parent.setRight(null);\n } else if (parent.getRight() == null) {\n if (parent.getLeft().getValue().compareTo(value) == 0)\n parent.setLeft(null);\n } else if (parent.getLeft().getValue().compareTo(value) == 0) {\n parent.setLeft(null);\n } else if (parent.getRight().getValue().compareTo(value) == 0) {\n parent.setRight(null);\n }\n\n // If the node has either no left or no right branch...\n } else if (node.getLeft() == null || node.getRight() == null) {\n // If its left branch is null...\n if (node.getLeft() == null) {\n // If the value in question belongs to the root and root has no left branch, its right branch becomes\n // the new root.\n if (node.getValue().compareTo(root.getValue()) == 0) root = root.getRight();\n // Otherwise, finds the parent, determines whether the value in question belongs to the node in the\n // parent's left or right branch, and sets the appropriate branch to reference the node's right branch.\n else {\n Node<T> parent = getParent(value);\n if (parent.getLeft().getValue().compareTo(value) == 0) parent.setLeft(node.getRight());\n else parent.setRight(node.getRight());\n }\n // If its right branch is null...\n } else if (node.getRight() == null) {\n // If the value in question belongs to the root and root has no right branch, its left branch becomes\n // the new root.\n if (node.getValue().compareTo(root.getValue()) == 0) root = root.getLeft();\n else {\n Node<T> parent = getParent(value);\n if (parent.getLeft().getValue().compareTo(value) == 0) parent.setLeft(node.getLeft());\n else parent.setRight(node.getRight());\n }\n }\n // If the node has two children...\n } else {\n // Iterates through the current node's left nodes until none remain, replacing its value with that of its left node.\n while (node.getLeft() != null) {\n Node<T> left = node.getLeft();\n node.setValue(left.getValue());\n if (node.getLeft().getLeft() == null && node.getLeft().getRight() == null) {\n node.setLeft(null);\n }\n node = left;\n // If there are no left nodes but a right node exists, sets the current node's value to that of its right\n // node. Loop will continue to iterate through left nodes.\n if (node.getLeft() == null && node.getRight() != null) {\n Node<T> right = node.getRight();\n node.setValue(right.getValue());\n node = right;\n }\n }\n }\n balance(root);\n }", "public void postOrder() {\n postOrder(root);\n }", "public void merge( int value )\n {\n BiNode loc = _root.findLeaf( value );\n\n //////////////////////////////////////////////////////////\n // Add code here to complete the merge\n //\n // The findLeaf( value ) method of BiNode will return the\n // leaf of the tree that has the range that includes value.\n // Invoke that method using the _root instance variable of\n //\n // Need to get to parent of that node, and get the sibling\n // of the one returned from findLeaf.\n //\n // Then use the 'getValues()' method to get the data points\n // for the found node and for its sibling. All of the data\n // points for both nodes must be added to the parent, AFTER\n // setting the parent's left and right links to null!\n //\n // Note that the sibling of a leaf node might not itself be\n // a leaf, so you'll be deleting a subtree. However, it's\n // straightforwad since the \"getValues()\" method when called\n // on an internal node will return all the values in all its\n // descendents.\n //\n ////////////////////////////////////////////////////////////\n BiNode parent = loc.parent;\n BiNode sibling = null;\n if( loc == parent._left )\n {\n sibling = parent._right;\n }\n else\n {\n sibling = parent._left;\n }\n parent._left = null;\n parent._right = null;\n for( int i = 0; i < loc.getValues( ).size( ); i++ )\n {\n parent.add( loc.getValues( ).get( i ) );\n }\n for( int j = 0; j < sibling.getValues( ).size( ); j++ )\n {\n parent.add( sibling.getValues( ).get( j ) );\n }\n\n\n\n }", "void add(int data){\n if (isEmpty()) { //tree is empty\n root = new Node(data);\n } else {\n Node current = root; //node yg saat ini bisa ter-update, tidak statis nilainya\n while(true){\n if (data < current.data) {\n if (current.left != null) {\n current = current.left;\n } else {\n current.left = new Node (data);\n break;\n }\n } else if (data > current.data){\n if (current.right != null) {\n current = current.right;\n } else {\n current.right = new Node (data);\n break;\n }\n } else {\n break;\n }\n }\n }\n }", "public void insert(T val) {\n\t\tlstEle.add(val);\n\t\theapSize++;\n\t\t// Need to move up the tree and satisfy the heap property\n\t\tint currIndex = heapSize - 1;\n\t\tint parentIndex = getParent(currIndex);\n\t\tif (parentIndex >= 0) {\n\t\t\tdo {\n\t\t\t\tT parentVal = lstEle.get(parentIndex);\n\t\t\t\tif (parentVal.compareTo(val) > 0) {\n\t\t\t\t\tlstEle.set(parentIndex, val);\n\t\t\t\t\tlstEle.set(currIndex, parentVal);\n\t\t\t\t\tcurrIndex = parentIndex;\n\t\t\t\t\tparentIndex = getParent(currIndex);\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (parentIndex >= 0);\n\t\t}else{\n\t\t\t//do nothing\n\t\t}\n\t\t\n\t}", "public void postTrav(ObjectTreeNode tree) {\n if (tree != null) {\n postTrav(tree.getLeft());\n postTrav(tree.getRight());\n ((TreeComparable)tree.getInfo()).visit();\n }\n }", "private PersistentLinkedList<T> addHelper(T data) {\n //there's still space in the latest element\n if (this.treeSize == 0 || this.treeSize % branchingFactor != 0) {\n return setHelper(this.treeSize, data);\n }\n\n //there's still space for the new data\n if (this.base * branchingFactor > this.treeSize) {\n Node<T> newRoot = new Node<>(branchingFactor);\n\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n int index = this.treeSize;\n int b;\n for (b = base; b > 0; b = b / branchingFactor) {\n TraverseData traverseData = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, index, b));\n currentNode = traverseData.currentNode;\n currentNewNode = traverseData.currentNewNode;\n index = traverseData.index;\n\n if (currentNode == null) {\n b = b / branchingFactor;\n break;\n }\n }\n\n while (b > 1) {\n currentNewNode.set(0, new Node<>(branchingFactor));\n currentNewNode = currentNewNode.get(0);\n index = index % b;\n b = b / branchingFactor;\n }\n currentNewNode.set(0, new Node<>(branchingFactor, data));\n\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth, this.base,\n this.treeSize + 1, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }\n\n //root overflow\n Node<T> newRoot = new Node<>(branchingFactor);\n newRoot.set(0, this.root);\n newRoot.set(1, new Node<>(branchingFactor));\n //newRoot[2..]=null\n Node<T> currentNewNode = newRoot.get(1);\n\n int b = base;\n while (b > 1) {\n currentNewNode.set(0, new Node<>(branchingFactor));\n currentNewNode = currentNewNode.get(0);\n b = b / branchingFactor;\n }\n currentNewNode.set(0, new Node<>(branchingFactor, data));\n\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth + 1,\n this.base * branchingFactor, this.treeSize + 1, unusedTreeIndices,\n indexCorrespondingToTheFirstElement, indexCorrespondingToTheLatestElement);\n }", "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 }", "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 convertBinaryTreeToBinarySearchTree()\n\t{\n\t\tif(root==null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t/*Inorder traversal to fill array*/\n\t\tinOrderTraversal(root);\n\t\t/*sorting the array*/\n\t\tCollections.sort(arr);\n\t\t/*Traverse tree using inorder traversal, and replace the node data with data in sorted array*/\n\t\treplaceNodeInInorderTraverse(root);\n\t\t\n\t}", "private void heapifyAdd() {\n // TODO. The general idea of this method is that we are checking whether the \n // most recently added item, which has been put at the end of the array, \n //needs to be swapped with its parent. We do this in a loop, until a swap isn’t needed or we reach the root. This is not recursive.\n\n // Pseudocode:\n // assign newly added item to a temp var.\n // use an index variable to keep track of the index where that value was added\n // while the index isn’t pointing at the root, and while the node at this index is greater than the node at its parent:\n // copy the parent node to the index location (move parent node down the heap)\n // set the index to the parent index\n // when we are at the root, or the parent of current index isn’t bigger, we are done\n // copy the temp variable to the location of the current index. \n T temp;\n int next = count - 1;\n\n temp = heap[next];\n\n while ((next != 0) && (((Comparable) temp).compareTo(heap[(next - 1) / 2]) > 0)) {\n heap[next] = heap[(next - 1) / 2];\n next = (next - 1) / 2;\n }\n heap[next] = temp;\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}", "private Node add(Node node, K k, V v, int depth){\n if(node == null){ //null then create\n Node newNode = new Node(k,v);\n newNode.depth = depth;\n newNode.size++; // update size of new node\n return newNode;\n }\n// recursively add\n if(k.compareTo(node.k)<0){ // less, add left\n node.left = add(node.left, k, v, depth+1);\n }\n else if(k.compareTo(node.k)>0) { // greater, add right\n node.right = add(node.right, k,v, depth+1);\n }else{\n if(allowCount)node.count++; //equal then add count 1\n }\n\n if(allowCount){\n node.size++; //any e will be added\n }else\n node.size = 1 + size(node.left) + size(node.right);\n return node; //not null, value equal, then return node itself\n }", "private void insertNodeIntoTree(Node node) {\n\t\troot = insert(root,node);\t\n\t}", "private void postOrderTraversal(StringBuilder sb) {\n if (left != null) {\n left.postOrderTraversal(sb);\n }\n\n if (right != null) {\n right.postOrderTraversal(sb);\n }\n\n sb.append(data + \" \");\n }", "public void add( T obj )\n {\n // Any distinct object causes creation of a new tree-set.\n // We count any such sets as we go.\n if (!contains( obj ))\n {\n nodes.put(obj, new Node(obj));\n numSets++;\n }\n }", "public void add (K key) {\n\t\tthis.root = this.addRecursively(root,key);\n\t}", "public void add(int d) {\n // if empty tree, new node is root\n if (root == null) {\n root = new Node(d);\n }\n // if non-empty tree, insert for completeness\n else {\n // go down the left branch of tree until a leaf is reached\n \n // check if leaf has a right sibling, if not, add to right, else go back one node and see if the node's right sibling has children\n // if right sibling \n \n // add to its left child\n\n }\n }", "private void addNode(Node<E> node, E value) {\n if (node.children == null) {\n node.children = new ArrayList<>();\n }\n node.children.add(new Node<>(value));\n }", "public void add( Integer inputData ) {\n\t\tif ( root.getData() == null ) {\n\t\t\tthis.root = new TreeNode( inputData );\n\t\t\treturn;\n\t\t} else {\n\n\t\t\tTreeNode current = this.root;\n\n\t\t\tTreeNode newNode = new TreeNode( inputData );\n\n\t\t\twhile ( true ) {\n\n\t\t\t\t// reject duplicates\n\t\t\t\tif ( current.getData().equals( inputData ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t} \n\n\t\t\t\tif ( inputData < current.getData() ) {\n\t\t\t\t\tif ( current.getLeft() == null ) {\n\t\t\t\t\t\tcurrent.setLeft( newNode );\n\t\t\t\t\t\tnewNode.setParent( current );\n\t\t\t\t\t\tthis.size++;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent = current.getLeft();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( current.getRight() == null ) {\n\t\t\t\t\t\tcurrent.setRight( newNode );\n\t\t\t\t\t\tnewNode.setParent( current );\n\t\t\t\t\t\tthis.size++;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent = current.getRight();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}", "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 add (Node n){\n //increment frequency if word already exist\n if (n.getWord().compareTo(word)==0)\n {\n freq++;\n }\n\n if(n.getWord().compareTo(word) <= 0){ //left\n if(left == null){ \n left = n;\n }else{\n left.add (n); //recursive call on the child - left\n }\n }else{ //right\n if(right == null){\n right = n;\n }else{\n right.add (n);\n }\n }\n\n }", "public NonEmptyTree<K, V> add(Tree<K, V> t, K key, V value) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\treturn new NonEmptyTree<K, V>(key, value, left, right);\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\tleft = left.add(left, key, value);\n\t\t\treturn this;\n\t\t} else {\n\t\t\tright = right.add(right, key, value);\n\t\t\treturn this;\n\t\t}\n\t}", "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 void insertRecursively(Node<T> parent, T value) {\n\n Node<T> node = new Node<>(value);\n\n // Traverses the tree to the left if the new node's key is less than the parent's key.\n if (value.compareTo(parent.getValue()) == -1) {\n\n // If the parent's left branch is empty, sets it as the new node.\n if (parent.getLeft() == null) parent.setLeft(node);\n // Otherwise, calls this method again, with the parent's left branch as the new parent.\n else insertRecursively(parent.getLeft(), value);\n\n // Traverses to the right with reversed logic.\n } else if (value.compareTo(parent.getValue()) == 1) {\n\n if (parent.getRight() == null) parent.setRight(node);\n else insertRecursively(parent.getRight(), value);\n }\n\n balance(parent.getLeft());\n balance(parent.getRight());\n balance(parent);\n }", "public BinarySearchTree(Object root){\r\n\t\tthis.root = (KeyedItem)root;\r\n\t\tleftChild = null;\r\n\t\trightChild = null;\r\n\t}", "public BinarySearchTree(JSONObject object) {\r\n\t\tthis.root = null;\r\n for (Object key : object.keySet()) {\r\n \taddKeyValuePair(String.valueOf(key).toLowerCase(), (String)object.get(key));\r\n }\r\n\t}", "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 void process(TreeNode root){\n while(root!=null){\n dq.push(root);\n root= root.left;\n }\n }", "public void insertNode(Node newNode) {\r\n\t\thFlag = 0;\r\n\t\tif( newNode == null ) {\r\n\t\t\tthrow new NullPointerException(\"Inserted node is null\");\r\n\t\t}\r\n\t\t//if tree is empty, make this node the root\r\n\t\tif( size == 0 ) {\r\n\t\t\troot = newNode;\r\n\t\t\tnewNode.parent = nilNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 1;\r\n\t\t\theight = 1;\r\n\t\t} else {\r\n\t\t\t//otherwise, start at root and climb down tree until a spot is found\r\n\t\t\tNode y = nilNode;\r\n\t\t\tNode x = root;\r\n\t\t\tint count = 1;\r\n\r\n\t\t\twhile(x != nilNode) {\r\n\t\t\t\ty = x;\r\n\t\t\t\tif(newNode.key < x.key || (newNode.key == x.key && newNode.p == 1) )\r\n\t\t\t\t\tx = x.left;\r\n\t\t\t\telse\r\n\t\t\t\t\tx = x.right;\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t\tif(height < count) {\r\n\t\t\t\theight = count;\r\n\t\t\t\thFlag = 1;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tnewNode.parent = y;\r\n\t\t\tif(newNode.key < y.key || (newNode.key == y.key && newNode.p == 1) )\r\n\t\t\t\ty.left = newNode;\r\n\t\t\telse\r\n\t\t\t\ty.right = newNode;\r\n\t\t\tnewNode.left = nilNode;\r\n\t\t\tnewNode.right = nilNode;\r\n\t\t\tnewNode.color = 0;\r\n\r\n\t\t\t//fix up tree\r\n\t\t\tRBFixup(newNode);\r\n\t\t\t\r\n\t\t\t//Time to update the vaules in each node in O(h) time\r\n\t\t\t//after the fix up, newNode may have children who need to be updated,so\r\n\t\t\t//if newNode has nonNil children, start updating from either child\r\n\t\t\tif( !newNode.right.isNil || !newNode.left.isNil ) {\r\n\t\t\t\t//start from newNode's left child (right would work too)\r\n\t\t\t\trecUpdateNode(newNode.left);\r\n\t\t\t} else {\r\n\t\t\t\t//start from newNode\r\n\t\t\t\trecUpdateNode(newNode);\r\n\t\t\t}\n\t\t}\r\n\t\tsize++;\r\n\t}" ]
[ "0.6231778", "0.6134183", "0.61194986", "0.6087237", "0.60557264", "0.603908", "0.60258466", "0.5986968", "0.5980494", "0.5974797", "0.59268177", "0.5919507", "0.59185296", "0.5850068", "0.5842802", "0.5825698", "0.58248025", "0.58168", "0.5799385", "0.5799385", "0.5788731", "0.578865", "0.5775042", "0.576726", "0.5757493", "0.57557243", "0.5735709", "0.57224923", "0.5722201", "0.5691651", "0.5690553", "0.5688021", "0.5676223", "0.5672806", "0.5659657", "0.56456316", "0.564084", "0.5635024", "0.56294215", "0.561862", "0.5615797", "0.5606268", "0.56057346", "0.5591901", "0.5588373", "0.5582295", "0.5577394", "0.5572043", "0.55681014", "0.55630165", "0.5559695", "0.5549694", "0.55493575", "0.55378675", "0.5535463", "0.5526132", "0.5519913", "0.5516548", "0.55104905", "0.5501457", "0.5498683", "0.5493419", "0.5493346", "0.5490075", "0.549002", "0.5482448", "0.54702985", "0.5461768", "0.5461328", "0.54543525", "0.54520154", "0.54470193", "0.54423267", "0.5440988", "0.54208446", "0.54158777", "0.54147726", "0.539819", "0.5393497", "0.5392821", "0.53789216", "0.53743684", "0.53721046", "0.53670067", "0.5365701", "0.5364038", "0.5361115", "0.5348286", "0.5346167", "0.5342372", "0.5342133", "0.5340607", "0.53328305", "0.532829", "0.5327895", "0.5326999", "0.5325337", "0.5324907", "0.53240615", "0.5321618" ]
0.55910367
44
post: prints the tree contents using a preorder traversal
public void printPreorder() { System.out.print("preorder:"); printPreorder(overallRoot); System.out.println(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "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 preorder() {\n root.preorder();\n System.out.println(\"\");\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 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 }", "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 postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "void printPostorder() { \n\t\tprintPostorder(root);\n\t}", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "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 void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\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 }", "public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}", "public void print() {\n\t\ttraversePreOrder(root, 0);\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 }", "public void printIterativePreorderTraversal() {\r\n\t\tprintIterativePreorderTraversal(rootNode);\r\n\t}", "void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }", "void printPreorder(Node node) {\n if (node == null)\n return;\n\n /* first print data of node */\n System.out.print(node.key + \" \");\n\n /* then recur on left sutree */\n printPreorder(node.left);\n\n /* now recur on right subtree */\n printPreorder(node.right);\n }", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "public void postOrder(){\n postOrder(root);\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 }", "public void print(){\n inorderTraversal(this.root);\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 }", "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 }", "protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "public void printPostorder() {\n System.out.print(\"postorder:\");\n printPostorder(overallRoot);\n System.out.println();\n }", "public void printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\n }", "public void printIterativePostOrderTraversal() {\r\n\t\tprintIterativePostOrderTraversal(rootNode);\r\n\t}", "protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "public void printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}", "protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}", "public static void preorderTraversal(Node root)\r\n {\r\n if (root == null) {\r\n return;\r\n }\r\n \r\n System.out.print(root.data + \" \");\r\n preorderTraversal(root.left);\r\n preorderTraversal(root.right);\r\n }", "private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\n\t}", "private void preOrder(Node node) {\n\t\tif(null == node) return;\n\t\t\n\t\t//Print node\n\t\tSystem.out.println(node.data);\n\t\t\n\t\t//Go to left child node\n\t\tpreOrder(node.left);\n\t\t\n\t\t//Go to right child node\n\t\tpreOrder(node.right);\n\t}", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\n System.out.println();\n }", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "private void preorderHelper(TreeNode<T> node){\n if(node == null)\n return;\n\n System.out.printf(\"%s \" , node.data);\n preorderHelper(node.leftNode);\n preorderHelper(node.rightNode);\n }", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "static void postorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n System.out.println(\" \" + indent + node.data);\n }", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "public static void preOrder(TreeNode node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }", "public static void preOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tSystem.out.print(node.value + \" \");\n\t\tpreOrder(node.left);\n\t\tpreOrder(node.right);\t\n\t}", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "public void preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\n }", "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}", "void preOrder(Node node) \n { \n if (node != null) \n { \n System.out.print(node.key + \" \"); \n preOrder(node.left); \n preOrder(node.right); \n } \n }", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\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 preOrder(Node node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\n\t}", "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 preOrderPrint(Node root, boolean recursion)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrderPrint(root.left, true);\n\t\tpreOrderPrint(root.right, true);\n\t}", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\n }", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\n }", "private void postOrder() {\n postOrderTraversal(0);\n System.out.println(); // jump to next line\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 static void printPreOrder(Node treeRoot) {\r\n\t\tif (treeRoot == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.print(treeRoot.root + \", \");\r\n\t\tprintPreOrder(treeRoot.left);\r\n\t\tprintPreOrder(treeRoot.right);\r\n\t}", "private void preOrderPrint() {\n System.out.print(\" \" + key);\n if (left != null) left.preOrderPrint();\n if (right != null) right.preOrderPrint();\n }", "public void printInOrder() {\n printInOrderHelper(root);\n }", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "public void preorder()\r\n {\r\n preorder(root);\r\n }", "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}", "public void preOrder(Node root) {\n if (root != null) {\n System.out.print(root.getData() + \" \");\n preOrder(root.getLeftChild());\n preOrder(root.getRightChild());\n }\n }", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "public static void preOrder(Node root) {\n if (root == null)\n return;\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n\n }", "public static void printPreOrderDFT(Node node){\n if (node!=null){ // node มีตัวตน\n\n System.out.print(node.key+\" \"); //เจอ node ไหน print ค่า และ recursive ซ้ายตามด้วยขวา\n printPreOrderDFT(node.left);\n printPreOrderDFT(node.right);\n }\n else {return;}\n\n }", "private void printPostorder(IntTreeNode root) {\n if (root != null) {\n printPostorder(root.left);\n printPostorder(root.right);\n System.out.print(\" \" + root.data);\n }\n }", "public void traversePreOrder(Node node) {\n\t\tif (node != null) {\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t\ttraversePreOrder(node.left);\n\t\t\ttraversePreOrder(node.right);\n\t\t}\n\t}", "private void preOrder(Node root) {\r\n\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (preOrderCount < 20) {\r\n\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + preOrderCount);\r\n\t\t\tpreOrderCount++;\r\n\t\t\tpreOrder(root.getlChild());\r\n\t\t\tpreOrder(root.getrChild());\r\n\t\t}\r\n\r\n\t}", "private void postOrder(Node root) {\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tpostOrder(root.getlChild());\r\n\t\tpostOrder(root.getrChild());\r\n\t\tif (postOrderCount < 20) {\r\n\t\t\tpostOrderCount++;\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + postOrderCount);\r\n\r\n\t\t}\r\n\r\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 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 preorder()\n {\n preorder(root);\n }", "public void preorder()\n {\n preorder(root);\n }", "@Override\n public String print() {\n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n \n System.out.print(\"In ascending order: \");\n for (int i=0; i<inorderTraverse.size(); i++) {\n System.out.print(inorderTraverse.get(i)+\" \");\n }\n System.out.println(\"\");\n return \"\";\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 static void main(String[] args)\r\n {\r\n \r\n int[] preorder = { 1, 2, 4, 5, 3, 6, 8, 9, 7 };\r\n int[] isLeaf = { 0, 0, 1, 1, 0, 0, 1, 1, 1 };\r\n \r\n // construct the tree\r\n Node root = constructTree(preorder, isLeaf);\r\n \r\n // print the tree in preorder fashion\r\n System.out.print(\"Preorder Traversal of the constructed tree is: \");\r\n preorderTraversal(root);\r\n }", "public void printTree() {\n printTreeHelper(root);\n }", "public static void preorder(Node root){\n\t\tif(root != null){\n\t\t\tSystem.out.println(root.toString());\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t}\n\t}", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public void printPreOrder(Node currNode){\n if (currNode != null){\n System.out.print(currNode.val+ \", \");\n printInOrder(currNode.left);\n printInOrder(currNode.right);\n }\n }", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public void preorderTraversal() \n { \n preorderTraversal(header.rightChild); \n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "public void preOrderTraversal() {\n beginAnimation();\n treePreOrderTraversal(root);\n stopAnimation();\n\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public void preorder() {\n\t\tpreorder(root);\n\t}", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "private void postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t}\n\t}", "public String printTree() {\n printSideways();\n return \"\";\n }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "static void preOrderWithoutRecursion(Node root) {\n Stack<Node> stack = new Stack<>();\n stack.push(root);\n while (!stack.isEmpty()) {\n Node node = stack.peek();\n System.out.print(node.data + \" \");\n stack.pop();\n\n if (node.right != null) {\n stack.push(node.right);\n }\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n }", "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 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 printTree(){ \n System.out.format(\"The suffix tree for S = %s is: %n\",this.text); \n this.print(0, 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 }" ]
[ "0.8155258", "0.80770487", "0.79357713", "0.78719676", "0.7830665", "0.7830665", "0.7742422", "0.773891", "0.77241063", "0.7713989", "0.77050114", "0.7630106", "0.75826097", "0.7572948", "0.7551674", "0.7526947", "0.75200063", "0.7464203", "0.74580127", "0.74547225", "0.7428889", "0.7426413", "0.7390482", "0.7384806", "0.7375715", "0.7369225", "0.7367901", "0.7328496", "0.73277855", "0.73274416", "0.7315487", "0.7315027", "0.7297411", "0.7265059", "0.7261322", "0.72480553", "0.7240101", "0.7240052", "0.7224521", "0.72084045", "0.7204501", "0.7197078", "0.71802366", "0.71685153", "0.71479297", "0.7138479", "0.71158534", "0.71129346", "0.7099942", "0.7069904", "0.70547974", "0.70523405", "0.7051585", "0.70096165", "0.70020354", "0.70004606", "0.69941825", "0.69901055", "0.69839716", "0.69818145", "0.6981", "0.6968442", "0.69675756", "0.69657314", "0.6957364", "0.69572276", "0.69565856", "0.6945611", "0.6941912", "0.6937381", "0.69286096", "0.6910757", "0.6909101", "0.68841404", "0.68793935", "0.6876922", "0.6876922", "0.68762213", "0.687529", "0.68689895", "0.68642664", "0.6860068", "0.68581074", "0.6849326", "0.6849011", "0.68282735", "0.6826706", "0.682626", "0.6824754", "0.6817777", "0.68029326", "0.67968833", "0.67946625", "0.6787112", "0.67800915", "0.6773822", "0.67691636", "0.6754113", "0.67491657", "0.67491657" ]
0.7701706
11
post: prints in preorder the tree with given root
private void printPreorder(IntTreeNode root) { if (root != null) { System.out.print(" " + root.data); printPreorder(root.left); printPreorder(root.right); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }", "protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "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 }", "private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\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 void preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\n }", "private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "public static void preorder(Node root){\n\t\tif(root != null){\n\t\t\tSystem.out.println(root.toString());\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t}\n\t}", "public static void preorderTraversal(Node root)\r\n {\r\n if (root == null) {\r\n return;\r\n }\r\n \r\n System.out.print(root.data + \" \");\r\n preorderTraversal(root.left);\r\n preorderTraversal(root.right);\r\n }", "public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}", "public static void preOrder(Node root) {\n if (root == null)\n return;\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n\n }", "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 }", "public void preOrderTraversal() {\n preOrderThroughRoot(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 printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\n }", "public void preOrder(Node root) {\n if (root != null) {\n System.out.print(root.getData() + \" \");\n preOrder(root.getLeftChild());\n preOrder(root.getRightChild());\n }\n }", "public void preOrder(TreeNode root){\n\t\t//Change place of temp\n\t\tSystem.out.println(root.toString());\n\t\tif(root.getLeft()!= null){\n\t\t\tpreOrder(root.getLeft());\n\t\t}\n\t\tif(root.getMiddle()!=null){\n\t\t\tpreOrder(root.getMiddle());\n\t\t}\n\t\tif(root.getRight()!= null){\n\t\t\tpreOrder(root.getRight());\n\t\t}\n\t}", "public void preorder()\r\n {\r\n preorder(root);\r\n }", "public static void printPreOrder(Node treeRoot) {\r\n\t\tif (treeRoot == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.print(treeRoot.root + \", \");\r\n\t\tprintPreOrder(treeRoot.left);\r\n\t\tprintPreOrder(treeRoot.right);\r\n\t}", "private void preOrder(Node root) {\r\n\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (preOrderCount < 20) {\r\n\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + preOrderCount);\r\n\t\t\tpreOrderCount++;\r\n\t\t\tpreOrder(root.getlChild());\r\n\t\t\tpreOrder(root.getrChild());\r\n\t\t}\r\n\r\n\t}", "public void preorder()\n {\n preorder(root);\n }", "public void preorder()\n {\n preorder(root);\n }", "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 printPostorder() { \n\t\tprintPostorder(root);\n\t}", "static void preOrderWithoutRecursion(Node root) {\n Stack<Node> stack = new Stack<>();\n stack.push(root);\n while (!stack.isEmpty()) {\n Node node = stack.peek();\n System.out.print(node.data + \" \");\n stack.pop();\n\n if (node.right != null) {\n stack.push(node.right);\n }\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n }", "public void preOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tSystem.out.println(root);\n\t\t\tpreOrderTraversal(root.getLeftChild());\n\t\t\tpreOrderTraversal(root.getRightChild());\n\t\t}\n\t}", "private void preorderLeftOnly(Node root) {\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n if (root.left != null)\r\n preorderLeftOnly(root.left);\r\n }", "public void preorder() {\n\t\tpreorder(root);\n\t}", "public void postOrder(){\n postOrder(root);\n System.out.println();\n }", "public static void preOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tSystem.out.print(node.value + \" \");\n\t\tpreOrder(node.left);\n\t\tpreOrder(node.right);\t\n\t}", "void printPreorder(Node node) {\n if (node == null)\n return;\n\n /* first print data of node */\n System.out.print(node.key + \" \");\n\n /* then recur on left sutree */\n printPreorder(node.left);\n\n /* now recur on right subtree */\n printPreorder(node.right);\n }", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\n }", "void preOrderPrint(Node root, boolean recursion)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrderPrint(root.left, true);\n\t\tpreOrderPrint(root.right, true);\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 }", "private void printPostorder(IntTreeNode root) {\n if (root != null) {\n printPostorder(root.left);\n printPostorder(root.right);\n System.out.print(\" \" + root.data);\n }\n }", "private void preOrder(HomogeneusNode root) {\n\n if (root != null) {\n System.out.printf(\"%d\", root.getData());\n preOrder(root.getLeft());\n preOrder(root.getRight());\n }\n }", "public static void preOrder(TreeNode node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\n }", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\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 }", "private void preorderHelper(TreeNode<T> node){\n if(node == null)\n return;\n\n System.out.printf(\"%s \" , node.data);\n preorderHelper(node.leftNode);\n preorderHelper(node.rightNode);\n }", "void preOrder(Node node) \n { \n if (node != null) \n { \n System.out.print(node.key + \" \"); \n preOrder(node.left); \n preOrder(node.right); \n } \n }", "public void preOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(localRoot.data+\" \");\r\n\t\t\tpreOrder(localRoot.leftChild);\r\n\t\t\tpreOrder(localRoot.rightChild);\r\n\t\t}\r\n\t}", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "private void postOrder(Node root) {\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tpostOrder(root.getlChild());\r\n\t\tpostOrder(root.getrChild());\r\n\t\tif (postOrderCount < 20) {\r\n\t\t\tpostOrderCount++;\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + postOrderCount);\r\n\r\n\t\t}\r\n\r\n\t}", "public void printPostorder() {\n System.out.print(\"postorder:\");\n printPostorder(overallRoot);\n System.out.println();\n }", "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 preOrder(Node node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }", "public static void preOrderInterative(TreeNode root) {\n\t\tif(root == null) return;\n\t\tDeque<TreeNode> stack = new LinkedList<TreeNode>();\n\t\tTreeNode curr = root;\n\t\twhile(curr != null || !stack.isEmpty()) {\n\t\t\t\n\t\t\tif(curr != null) {\n\t\t\t\tSystem.out.print(curr.value + \" \");\n\t\t\t\tif(curr.right != null) stack.push(curr.right);\n\t\t\t\tcurr = curr.left;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurr = stack.pop();\n\t\t\t}\t\t\t\n\t\t}\t\t\t\n\t}", "public void postOrder(Node root) {\n if(root!=null) {\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\n }\n }", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "private void preOrder(Node node) {\n\t\tif(null == node) return;\n\t\t\n\t\t//Print node\n\t\tSystem.out.println(node.data);\n\t\t\n\t\t//Go to left child node\n\t\tpreOrder(node.left);\n\t\t\n\t\t//Go to right child node\n\t\tpreOrder(node.right);\n\t}", "protected void postorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tpostorder(root.left);\r\n\t\tpostorder(root.right);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t}", "protected void postorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.element + \" \");\n }", "public void printIterativePreorderTraversal() {\r\n\t\tprintIterativePreorderTraversal(rootNode);\r\n\t}", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\n System.out.println();\n }", "public void preOrder() {\n preOrder(root);\n }", "public void postOrderPrint(BinaryTreeNode<T> root) {\n if (root != null) {\n postOrderPrint(root.left);\n postOrderPrint(root.right);\n System.out.println(root.value);\n }\n }", "public void PreOrder() {\n\t\tPreOrder(root);\n\t}", "private void postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\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 print(){\n inorderTraversal(this.root);\n }", "private String traversePreOrder(BinaryNode<T> root) {\n preOrderTrav += root.getData() + \" -> \";\n if (root.getLeftNode() != null) { // traverse left\n traversePreOrder(root.getLeftNode());\n }\n if (root.getRightNode() != null) { // traverse right\n traversePreOrder(root.getRightNode());\n }\n return preOrderTrav;\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 printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\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}", "static void preOrderTraversalStackOptimised(Node root) {\n Stack<Node> stack = new Stack<>();\n Node curr = root;\n while (curr != null || !stack.isEmpty()) {\n\n while (curr != null) {\n System.out.print(curr.data + \" \");\n if (curr.right != null) {\n stack.push(curr.right);\n }\n curr = curr.left;\n }\n\n if (!stack.isEmpty()) {\n curr = stack.pop();\n }\n }\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 postOrder(Node root) {\n if (root != null) {\n postOrder(root.getLeftChild());\n postOrder(root.getRightChild());\n System.out.print(root.getData() + \" \");\n }\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\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 String getPreorder(Node root)\n\t{\n\t\tpreOrder(root);\n\t\t//return the string\n\t\treturn preorder;\n\t}", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\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 }", "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 static void printPostOrder(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\tprintPostOrder(treeRoot.left);\r\n\t\tprintPostOrder(treeRoot.right);\r\n\t\tSystem.out.print(treeRoot.root + \" \");\r\n\t}", "public static void postOrder(Node root) {\n if (root == null)\n return;\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\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 }", "public void postOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpostOrderTraversal(root.getLeftChild());\n\t\t\tpostOrderTraversal(root.getRightChild());\n\t\t\tSystem.out.println(root);\n\t\t}\n\t}", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\n }", "public static void postorder(Node root){\n\t\tif(root != null){\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t\tSystem.out.println(root.toString());\n\n\t\t}\n\t}", "public static void main(String[] args) {\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 System.out.println(new Solution().preorderTraversal(null));\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 }", "public void postorder()\r\n {\r\n postorder(root);\r\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 static void main(String[] args)\r\n {\r\n \r\n int[] preorder = { 1, 2, 4, 5, 3, 6, 8, 9, 7 };\r\n int[] isLeaf = { 0, 0, 1, 1, 0, 0, 1, 1, 1 };\r\n \r\n // construct the tree\r\n Node root = constructTree(preorder, isLeaf);\r\n \r\n // print the tree in preorder fashion\r\n System.out.print(\"Preorder Traversal of the constructed tree is: \");\r\n preorderTraversal(root);\r\n }", "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}" ]
[ "0.8495096", "0.8480297", "0.8456519", "0.8437696", "0.84327465", "0.8420224", "0.84056044", "0.8350118", "0.8350118", "0.8338154", "0.8275401", "0.82467335", "0.8226115", "0.8199899", "0.8183317", "0.8179822", "0.8147374", "0.8141159", "0.81252456", "0.8124724", "0.8079943", "0.80687654", "0.8061672", "0.80449796", "0.80277", "0.79969406", "0.79819405", "0.7951326", "0.78730524", "0.78471476", "0.78471476", "0.78426665", "0.7833195", "0.7799011", "0.7762805", "0.7704381", "0.7693822", "0.7693296", "0.76887196", "0.76810044", "0.7671019", "0.76699907", "0.76609045", "0.7656708", "0.7655316", "0.765235", "0.76152194", "0.7608088", "0.75651383", "0.75633276", "0.7540514", "0.7534613", "0.7529418", "0.7515167", "0.750426", "0.7469103", "0.74213463", "0.7417134", "0.74039537", "0.73847306", "0.73755145", "0.7373357", "0.736158", "0.73476946", "0.7334407", "0.73295844", "0.7302306", "0.7278512", "0.72706175", "0.72561246", "0.7252311", "0.7241535", "0.7241344", "0.72400624", "0.7236791", "0.7226862", "0.7196051", "0.719306", "0.71908337", "0.71760964", "0.71754986", "0.7172712", "0.7172167", "0.7166323", "0.71633255", "0.7156561", "0.7154694", "0.7149833", "0.71375984", "0.7131358", "0.7131358", "0.71260023", "0.7113391", "0.7105301", "0.70919746", "0.7086827", "0.70805365", "0.70781595", "0.70693773", "0.70657134" ]
0.8358255
7
post: prints the tree contents using an inorder traversal
public void printInorder() { System.out.print("inorder:"); printInorder(overallRoot); System.out.println(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\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 void print(){\n inorderTraversal(this.root);\n }", "void printPostorder() { \n\t\tprintPostorder(root);\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 void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "public void postOrder(){\n postOrder(root);\n System.out.println();\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "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 printIterativePostOrderTraversal() {\r\n\t\tprintIterativePostOrderTraversal(rootNode);\r\n\t}", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\n System.out.println();\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 printInOrder() {\n printInOrderHelper(root);\n }", "public void printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "public void printPostorder() {\n System.out.print(\"postorder:\");\n printPostorder(overallRoot);\n System.out.println();\n }", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "@Override\n public String print() {\n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n \n System.out.print(\"In ascending order: \");\n for (int i=0; i<inorderTraverse.size(); i++) {\n System.out.print(inorderTraverse.get(i)+\" \");\n }\n System.out.println(\"\");\n return \"\";\n }", "public void inorderTraversal() {\n inorderThroughRoot(root);\n System.out.println();\n }", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\n }", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "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 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 printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\n }", "static void postorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n System.out.println(\" \" + indent + node.data);\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 printInorder() {\r\n System.out.print(\"inorder:\");\r\n printInorder(overallRoot);\r\n System.out.println();\r\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 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 }", "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 printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\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 }", "public void inOrder(){\n inOrder(root);\n System.out.println();\n }", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\n }", "private void postOrder() {\n postOrderTraversal(0);\n System.out.println(); // jump to next line\n }", "public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "public void preOrder(){\n preOrder(root);\n System.out.println();\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 levelOrderPrint() {\n\t\tlevelOrderPrint(root);\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 }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "public void inOrder() {\r\n\t\tSystem.out.print(\"IN: \");\r\n\t\tinOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\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 preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "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 postOrder(Node<T> node){\n if(node != null){\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" ,\");\n }\n }", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\n\t}", "private void printPostorder(IntTreeNode root) {\n if (root != null) {\n printPostorder(root.left);\n printPostorder(root.right);\n System.out.print(\" \" + root.data);\n }\n }", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\n }", "public void traverseInOrder() {\n\t System.out.println(\"============= BTREE NODES ===============\");\n\t\tinOrder(root);\n System.out.println(\"=========================================\");\n\t}", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public void printTree() {\n printTreeHelper(root);\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public void printIterativePreorderTraversal() {\r\n\t\tprintIterativePreorderTraversal(rootNode);\r\n\t}", "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 String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "public static void printInOrder(Tree<String> s) {\n if (s == null) {\n return;\n }\n printInOrder(s.left);\n System.out.print(s.getData() + \" \");\n printInOrder(s.right);\n }", "@Test\r\n public void printTests(){\n\r\n BinaryTree<Integer> tree = new BinaryTree<>();\r\n tree.add(50);\r\n tree.add(25);\r\n tree.add(75);\r\n tree.add(12);\r\n tree.add(37);\r\n tree.add(67);\r\n tree.add(87);\r\n\r\n // redirect stdout to ByteArrayOutputStream for junit\r\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\r\n PrintStream printStream = new PrintStream(byteArrayOutputStream);\r\n PrintStream oldPrintStream = System.out;\r\n System.setOut(printStream);\r\n\r\n // inorder should print 12 25 37 50 67 75 87\r\n tree.print();\r\n printStream.flush();\r\n assertEquals(\"12 25 37 50 67 75 87 \", byteArrayOutputStream.toString());\r\n\r\n byteArrayOutputStream.reset();\r\n\r\n // preorder should print 50 25 12 37 75 67 87\r\n tree.print(BinaryTree.PrintOrder.PREORDER);\r\n printStream.flush();\r\n assertEquals(\"50 25 12 37 75 67 87 \", byteArrayOutputStream.toString());\r\n\r\n byteArrayOutputStream.reset();\r\n\r\n // postorder should print 12 37 25 67 87 75 50\r\n tree.print(BinaryTree.PrintOrder.POSTORDER);\r\n printStream.flush();\r\n assertEquals(\"12 37 25 67 87 75 50 \", byteArrayOutputStream.toString());\r\n\r\n // restore stdout\r\n System.setOut(oldPrintStream);\r\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 postOrderTraversal(){\n System.out.println(\"postOrderTraversal\");\n //TODO: incomplete\n\n }", "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 }", "private void postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t}\n\t}", "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 _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 }", "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 }", "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 }", "private void postOrder(Node root) {\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tpostOrder(root.getlChild());\r\n\t\tpostOrder(root.getrChild());\r\n\t\tif (postOrderCount < 20) {\r\n\t\t\tpostOrderCount++;\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + postOrderCount);\r\n\r\n\t\t}\r\n\r\n\t}", "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 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 }", "public String printTree() {\n printSideways();\n return \"\";\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 }", "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 }", "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}", "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 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 preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(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}", "void printPreorder(Node node) {\n if (node == null)\n return;\n\n /* first print data of node */\n System.out.print(node.key + \" \");\n\n /* then recur on left sutree */\n printPreorder(node.left);\n\n /* now recur on right subtree */\n printPreorder(node.right);\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 inOrder(Node root) {\n if(root!=null) {\n inOrder(root.left);\n System.out.print(root.data + \" \");\n inOrder(root.right);\n }\n }", "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 printTree() {\r\n printTree(overallRoot, 0);\r\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}", "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 }", "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 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 inOrderRecursive(TreeNode root){\n if(root == null) return;\n inOrderRecursive(root.left);\n System.out.print(root.data + \" \");\n inOrderRecursive(root.right);\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 }", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public static void postOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tpostOrder(node.left);\n\t\tpostOrder(node.right);\n\t\tSystem.out.print(node.value + \" \");\t\n\t}", "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 }", "protected void postorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.element + \" \");\n }", "private void postOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n postOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n postOrderTraversal(2 * index + 2);\n // print the node\n System.out.print(array[index] + \", \");\n }" ]
[ "0.78300977", "0.7810772", "0.7769437", "0.7630187", "0.75883", "0.7554825", "0.75493366", "0.7501846", "0.7454109", "0.742054", "0.738667", "0.7383533", "0.73060644", "0.7294015", "0.7294015", "0.72935045", "0.72895974", "0.72875327", "0.72338694", "0.72266585", "0.7170943", "0.7167508", "0.71620184", "0.71560514", "0.7141012", "0.71252066", "0.71102524", "0.70943683", "0.7091604", "0.7076223", "0.70727265", "0.70697534", "0.7063765", "0.7063765", "0.70542973", "0.70502514", "0.70402145", "0.7039609", "0.70080763", "0.6991931", "0.69908184", "0.6972647", "0.6968393", "0.69577485", "0.69558746", "0.69541293", "0.69439375", "0.69366723", "0.6933118", "0.6920451", "0.69023407", "0.68878865", "0.6886123", "0.6876988", "0.6851698", "0.6847924", "0.68431044", "0.68422616", "0.68410933", "0.68361944", "0.6834954", "0.68256146", "0.68233985", "0.681622", "0.6813972", "0.68114305", "0.68102497", "0.6801952", "0.6798505", "0.6797456", "0.67943895", "0.6791949", "0.67899144", "0.6780879", "0.6780005", "0.67790735", "0.6773852", "0.67617", "0.6761034", "0.6756847", "0.6738759", "0.67325264", "0.67271", "0.670515", "0.66952497", "0.66933525", "0.6686771", "0.6677574", "0.66759485", "0.6668127", "0.666503", "0.6664838", "0.6663517", "0.6662057", "0.6658365", "0.6656618", "0.66555417", "0.6648726", "0.6644899", "0.6642426" ]
0.7040955
36
post: prints in inorder the tree with given root
private void printInorder(IntTreeNode root) { if (root != null) { printInorder(root.left); System.out.print(" " + root.data); printInorder(root.right); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\n }", "public void postOrder(){\n postOrder(root);\n System.out.println();\n }", "void printPostorder() { \n\t\tprintPostorder(root);\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 }", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\n }", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "private void printPostorder(IntTreeNode root) {\n if (root != null) {\n printPostorder(root.left);\n printPostorder(root.right);\n System.out.print(\" \" + root.data);\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 print(){\n inorderTraversal(this.root);\n }", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\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 }", "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 }", "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 void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "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 }", "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}", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\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 }", "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 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 }", "public void printTree(T root) {\n List<TreeLine> treeLines = buildTreeLines(root);\n printTreeLines(treeLines);\n if(flush) outStream.flush();\n }", "public void inOrder(){\n inOrder(root);\n System.out.println();\n }", "public void postOrderPrint(BinaryTreeNode<T> root) {\n if (root != null) {\n postOrderPrint(root.left);\n postOrderPrint(root.right);\n System.out.println(root.value);\n }\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void printInOrder() {\n printInOrderHelper(root);\n }", "protected void postorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tpostorder(root.left);\r\n\t\tpostorder(root.right);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t}", "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 }", "private void postOrder(Node root) {\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tpostOrder(root.getlChild());\r\n\t\tpostOrder(root.getrChild());\r\n\t\tif (postOrderCount < 20) {\r\n\t\t\tpostOrderCount++;\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + postOrderCount);\r\n\r\n\t\t}\r\n\r\n\t}", "protected void postorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.element + \" \");\n }", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "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 printPostorder() {\n System.out.print(\"postorder:\");\n printPostorder(overallRoot);\n System.out.println();\n }", "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 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 postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t}\n\t}", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\n }", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\n System.out.println();\n }", "public void postOrder(Node root) {\n if(root!=null) {\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\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 printTree() {\n printTreeHelper(root);\n }", "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 printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\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 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 }", "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 }", "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}", "protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "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() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public static void postorder(Node root){\n\t\tif(root != null){\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t\tSystem.out.println(root.toString());\n\n\t\t}\n\t}", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "public static void printPostOrder(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\tprintPostOrder(treeRoot.left);\r\n\t\tprintPostOrder(treeRoot.right);\r\n\t\tSystem.out.print(treeRoot.root + \" \");\r\n\t}", "private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\n\t}", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\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 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}", "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 }", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "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 printTree() {\r\n printTree(overallRoot, 0);\r\n }", "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 }", "public static void postOrder(Node root) {\n if (root == null)\n return;\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\n }", "protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\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 inorderTraversal() {\n inorderThroughRoot(root);\n System.out.println();\n }", "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 printInorder() {\r\n System.out.print(\"inorder:\");\r\n printInorder(overallRoot);\r\n System.out.println();\r\n }", "public void postOrder(Node root) {\n if (root != null) {\n postOrder(root.getLeftChild());\n postOrder(root.getRightChild());\n System.out.print(root.getData() + \" \");\n }\n }", "void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }", "private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}", "public static void inorder(BSTNode root) {\n\t\tif (root == null) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tinorder(root.left);\n\t\t\tSystem.out.print(root.data + \" \");\n\t\t\tinorder(root.right);\n\t\t}\n\t}", "public void print()\r\n {\r\n print(root);\r\n }", "public static void printPreOrder(Node treeRoot) {\r\n\t\tif (treeRoot == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.print(treeRoot.root + \", \");\r\n\t\tprintPreOrder(treeRoot.left);\r\n\t\tprintPreOrder(treeRoot.right);\r\n\t}", "public void printInorder() {\n System.out.print(\"inorder:\");\n printInorder(overallRoot);\n System.out.println();\n }", "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}", "public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public void postOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpostOrderTraversal(root.getLeftChild());\n\t\t\tpostOrderTraversal(root.getRightChild());\n\t\t\tSystem.out.println(root);\n\t\t}\n\t}", "public void preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\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}", "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 }", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "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 }", "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 printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "public void treeOrder ()\n {\n treeOrder (root, 0);\n }", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\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}", "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 }", "void preOrderPrint(Node root, boolean recursion)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrderPrint(root.left, true);\n\t\tpreOrderPrint(root.right, true);\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}" ]
[ "0.8106092", "0.79645413", "0.7950893", "0.79302514", "0.7886247", "0.7861351", "0.78478545", "0.78433526", "0.78015155", "0.77446026", "0.7736108", "0.77194315", "0.770069", "0.76947206", "0.7691376", "0.76837164", "0.76747876", "0.76347333", "0.76347333", "0.76313204", "0.76195604", "0.76195604", "0.7608498", "0.7592432", "0.7573616", "0.75686115", "0.7552692", "0.754602", "0.7542624", "0.7534155", "0.75199115", "0.7513273", "0.75123334", "0.7511193", "0.7505874", "0.75048965", "0.74956375", "0.74941236", "0.74903935", "0.746918", "0.74679416", "0.74679416", "0.74603724", "0.7458858", "0.7435218", "0.74269205", "0.7424011", "0.7392349", "0.73854995", "0.737473", "0.73661673", "0.73622763", "0.73549026", "0.7342074", "0.7337708", "0.7332958", "0.7330942", "0.7328818", "0.7328785", "0.73237175", "0.73143506", "0.7313858", "0.731289", "0.7307756", "0.7303271", "0.7300786", "0.7274015", "0.7273744", "0.72732496", "0.7271221", "0.7268259", "0.726368", "0.72564775", "0.7242982", "0.7230977", "0.7229645", "0.7219325", "0.7212667", "0.721147", "0.7209506", "0.72010016", "0.7196744", "0.7192009", "0.7182554", "0.7170072", "0.71644545", "0.7162509", "0.7161619", "0.71520656", "0.71493715", "0.7113441", "0.70936775", "0.7090467", "0.7075496", "0.7057761", "0.70476276", "0.7023868", "0.70213276", "0.7015285", "0.701187" ]
0.7841904
8
post: prints the tree contents using a postorder traversal
public void printPostorder() { System.out.print("postorder:"); printPostorder(overallRoot); System.out.println(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.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 }", "void printPostorder() { \n\t\tprintPostorder(root);\n\t}", "public void postOrder(){\n postOrder(root);\n System.out.println();\n }", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "public void printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "public void printIterativePostOrderTraversal() {\r\n\t\tprintIterativePostOrderTraversal(rootNode);\r\n\t}", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\n System.out.println();\n }", "public void printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\n }", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "static void postorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n System.out.println(\" \" + indent + node.data);\n }", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\n }", "private void postorderHelper(TreeNode<T> node){\n\n if (node == null)\n return;\n\n postorderHelper(node.leftNode);\n postorderHelper(node.rightNode);\n System.out.printf(\"%s \", node.data);\n }", "protected void postorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.element + \" \");\n }", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\n }", "private void postOrder(Node<T> node){\n if(node != null){\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" ,\");\n }\n }", "protected void postorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tpostorder(root.left);\r\n\t\tpostorder(root.right);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t}", "public static void postOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tpostOrder(node.left);\n\t\tpostOrder(node.right);\n\t\tSystem.out.print(node.value + \" \");\t\n\t}", "private void postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t}\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}", "private void postOrder(Node root) {\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tpostOrder(root.getlChild());\r\n\t\tpostOrder(root.getrChild());\r\n\t\tif (postOrderCount < 20) {\r\n\t\t\tpostOrderCount++;\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + postOrderCount);\r\n\r\n\t\t}\r\n\r\n\t}", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\n }", "private void postOrder() {\n postOrderTraversal(0);\n System.out.println(); // jump to next line\n }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "private void printPostorder(IntTreeNode root) {\n if (root != null) {\n printPostorder(root.left);\n printPostorder(root.right);\n System.out.print(\" \" + root.data);\n }\n }", "public static void postOrder(Node node) {\n if (node == null) {\n return;\n }\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" \");\n }", "public void postOrder(Node root) {\n if(root!=null) {\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\n }\n }", "public void postOrder(Node root) {\n if (root != null) {\n postOrder(root.getLeftChild());\n postOrder(root.getRightChild());\n System.out.print(root.getData() + \" \");\n }\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public static void postOrder(Node root) {\n if (root == null)\n return;\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\n }", "public void traversePostOrder(Node node) {\n\t\tif (node != null) {\n\t\t\ttraversePostOrder(node.left);\n\t\t\ttraversePostOrder(node.right);\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t}\n\t}", "public void postorder()\r\n {\r\n postorder(root);\r\n }", "public void postOrderPrint(BinaryTreeNode<T> root) {\n if (root != null) {\n postOrderPrint(root.left);\n postOrderPrint(root.right);\n System.out.println(root.value);\n }\n }", "public void postorder()\n {\n postorder(root);\n }", "public void postorder()\n {\n postorder(root);\n }", "public void postOrderTravel(Node node) {\n\t\tif(node != null) {\r\n\t\t\tpostOrderTravel(node.leftChild);\r\n\t\t\tpostOrderTravel(node.rightChild);\r\n\t\t\tSystem.out.println(node);\r\n\t\t}\r\n\t}", "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 postOrderTraversal(){\n System.out.println(\"postOrderTraversal\");\n //TODO: incomplete\n\n }", "public static void postorder(Node root){\n\t\tif(root != null){\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t\tSystem.out.println(root.toString());\n\n\t\t}\n\t}", "public static void printPostOrder(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\tprintPostOrder(treeRoot.left);\r\n\t\tprintPostOrder(treeRoot.right);\r\n\t\tSystem.out.print(treeRoot.root + \" \");\r\n\t}", "private void postOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n postOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n postOrderTraversal(2 * index + 2);\n // print the node\n System.out.print(array[index] + \", \");\n }", "public static void printPostOrderDFT(Node node){\n if (node!=null){ // node มีตัวตน\n printPostOrderDFT(node.left); //เจอ node ไหน recursive ซ้าย และ recursive ขวา และ print ค่า\n printPostOrderDFT(node.right);\n System.out.print(node.key+\" \");\n }\n else{return;}\n }", "public void postOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpostOrderTraversal(root.getLeftChild());\n\t\t\tpostOrderTraversal(root.getRightChild());\n\t\t\tSystem.out.println(root);\n\t\t}\n\t}", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void postOrderTraversal() {\n beginAnimation();\n treePostOrderTraversal(root);\n stopAnimation();\n\n }", "public void postorder() {\n\t\tpostorder(root);\n\t}", "public void postOrder(BinarySearchTreeNode<T> node)\r\n {\r\n if(node==null)\r\n {\r\n return;\r\n }\r\n postOrder(node.getLeft());\r\n postOrder(node.getRight());\r\n System.out.println(node.getElement());\r\n\r\n }", "public void postOrder(Node node) {\n\n if (node == null) {\n System.out.println(\"Tree is empty\");\n return;\n }\n\n Stack<Node> stack1 = new Stack<>();\n Stack<Node> stack2 = new Stack<>();\n\n stack1.push(node);\n\n while (!stack1.empty()) {\n\n node = stack1.pop();\n\n stack2.push(node);\n\n if (node.left != null) {\n stack1.push(node.left);\n }\n\n if (node.right != null) {\n stack1.push(node.right);\n }\n }\n\n while (!stack2.empty()) {\n node = stack2.pop();\n System.out.print(node.value + \" \");\n }\n }", "public String postorder() {\n \tresult = \"\";\n \ttraversal(root);\n return result;\n }", "public void postorderTraversal() \n { \n postorderTraversal(header.rightChild); \n }", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\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 static void main(String[] args) {\n\t\tNode root = new Node(30);\n\t\troot.right = new Node(40);\n\t\troot.left = new Node(20);\n\t\troot.left.right=new Node(25);\n\t\troot.left.left = new Node(10);\n\t\troot.right.left = new Node(35);\n\t\troot.right.right = new Node(45);\n\t\t\n\t\tpostOrderTraversal(root);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tpostOrderRecursion(root);\n\t}", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "private void postOrder(HomogeneusNode root) {\n if (root != null) {\n postOrder(root.getLeft());\n postOrder(root.getRight());\n System.out.printf(\"%d\", root.getData());\n }\n }", "public void printPostOrder(Node currNode){\n if (currNode != null){\n printInOrder(currNode.left);\n printInOrder(currNode.right);\n System.out.print(currNode.val + \", \");\n }\n }", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "private void postOrderTraverse(Node<String> node,StringBuilder sb) {\n\n\t\t\t\tif (node != null) {\t\n\t\t\t\t\tpostOrderTraverse(node.left, sb);\n\t\t\t\t\tpostOrderTraverse(node.right,sb);\n\t\t\t\t\tsb.append(node.toString());\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t}", "public void print(){\n inorderTraversal(this.root);\n }", "@Override\r\n\tpublic List<Node<T>> getPostOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// Lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\treturn auxiliarRecorridoPost(raiz, lista);\r\n\t}", "private void postOrderTraversal(StringBuilder sb) {\n if (left != null) {\n left.postOrderTraversal(sb);\n }\n\n if (right != null) {\n right.postOrderTraversal(sb);\n }\n\n sb.append(data + \" \");\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 preorder() {\n root.preorder();\n System.out.println(\"\");\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 postOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tpostOrder(localRoot.leftChild);\r\n\t\t\tpostOrder(localRoot.rightChild);\r\n\t\t\tSystem.out.print(localRoot.data+ \" \");\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "private String postorderTraverse(BinarySearchTree curr, StringBuffer treeAsString){\r\n\t\t\r\n\t\t//get left\r\n\t\tif(curr.getLeftChild() != null){\r\n\t\t\tpostorderTraverse(curr.getLeftChild(), treeAsString);\r\n\t\t}\r\n\t\t\r\n\t\t//get right\r\n\t\tif(curr.getRightChild() != null){\r\n\t\t\tpostorderTraverse(curr.getRightChild(), treeAsString);\r\n\t\t}\r\n\t\t\r\n\t\t//get item\r\n\t\ttreeAsString.append(curr.getRoot().toString() + \" \");\r\n\t\t\r\n\t\t//return\r\n\t\treturn treeAsString.toString();\r\n\t}", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "public void postOrder() {\n postOrder(root);\n }", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "private void printTree(Tree parse) {\n\t\tparse.pennPrint();\n\t}", "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 }", "private void postorderRightOnly(Node root) {\r\n if (root.right != null)\r\n postorderRightOnly(root.right);\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n }", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "public void printTree() {\n printTreeHelper(root);\n }", "@Test\r\n public void printTests(){\n\r\n BinaryTree<Integer> tree = new BinaryTree<>();\r\n tree.add(50);\r\n tree.add(25);\r\n tree.add(75);\r\n tree.add(12);\r\n tree.add(37);\r\n tree.add(67);\r\n tree.add(87);\r\n\r\n // redirect stdout to ByteArrayOutputStream for junit\r\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\r\n PrintStream printStream = new PrintStream(byteArrayOutputStream);\r\n PrintStream oldPrintStream = System.out;\r\n System.setOut(printStream);\r\n\r\n // inorder should print 12 25 37 50 67 75 87\r\n tree.print();\r\n printStream.flush();\r\n assertEquals(\"12 25 37 50 67 75 87 \", byteArrayOutputStream.toString());\r\n\r\n byteArrayOutputStream.reset();\r\n\r\n // preorder should print 50 25 12 37 75 67 87\r\n tree.print(BinaryTree.PrintOrder.PREORDER);\r\n printStream.flush();\r\n assertEquals(\"50 25 12 37 75 67 87 \", byteArrayOutputStream.toString());\r\n\r\n byteArrayOutputStream.reset();\r\n\r\n // postorder should print 12 37 25 67 87 75 50\r\n tree.print(BinaryTree.PrintOrder.POSTORDER);\r\n printStream.flush();\r\n assertEquals(\"12 37 25 67 87 75 50 \", byteArrayOutputStream.toString());\r\n\r\n // restore stdout\r\n System.setOut(oldPrintStream);\r\n }", "public void printTree(T root) {\n List<TreeLine> treeLines = buildTreeLines(root);\n printTreeLines(treeLines);\n if(flush) outStream.flush();\n }", "public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "private static <N> void postOrderTraversal(TreeNode<N> node, TreeNodeVisitor<N> visitor) throws TreeNodeVisitException {\r\n\t\tif(node.hasChildren()){\r\n\t\t\tfor(TreeNode<N> childNode : node.getChildren()){\r\n\t\t\t\tpostOrderTraversal(childNode, visitor);\r\n\t\t\t}\r\n\t\t\tvisitor.visitNode(node);\r\n\t\t}else{\r\n\t\t\tvisitor.visitNode(node);\r\n\t\t}\r\n\t}", "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 }", "void printPreorder(Node node) {\n if (node == null)\n return;\n\n /* first print data of node */\n System.out.print(node.key + \" \");\n\n /* then recur on left sutree */\n printPreorder(node.left);\n\n /* now recur on right subtree */\n printPreorder(node.right);\n }", "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 }", "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 }", "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 void postOrder2(BinaryTreeNode root) {\n\t\tBinaryTreeNode cur = root;\n\t\tBinaryTreeNode pre = root;\n\t\tStack<BinaryTreeNode> s = new Stack<BinaryTreeNode>();\n\n\t\tif (root != null)\n\t\t\ts.push(root);\n\n\t\twhile (!s.isEmpty()) {\n\t\t\tcur = s.peek();\n\t\t\t// traversing down the tree\n\t\t\tif (cur == pre || cur == pre.getLeft() || cur == pre.getRight()) {\n\t\t\t\tif (cur.getLeft() != null) {\n\t\t\t\t\ts.push(cur.getLeft());\n\t\t\t\t} else if (cur.getRight() != null) {\n\t\t\t\t\ts.push(cur.getRight());\n\t\t\t\t}\n\t\t\t\tif (cur.getLeft() == null && cur.getRight() == null) {\n\t\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// traversing up the tree from the left\n\t\t\telse if (pre == cur.getLeft()) {\n\t\t\t\tif (cur.getRight() != null) {\n\t\t\t\t\ts.push(cur.getRight());\n\t\t\t\t} else if (cur.getRight() == null) {\n\t\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// we are traversing up the tree from the right\n\t\t\telse if (pre == cur.getRight()) {\n\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t}\n\t\t\tpre = cur;\n\t\t}\n\t}", "public void postOrderTraverseTree(Node focusNode) {\n\n\t\tif (focusNode != null) {\n\n\t\t\tpreorderTraverseTree(focusNode.left);\n\t\t\tpreorderTraverseTree(focusNode.right);\n\n\t\t\tSystem.out.print(focusNode.data + \" \");\n\n\t\t}\n\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 }", "public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public static void main(String[] args) {\n\n TreeNode<Integer> node = new TreeNode<>(7);\n node.left = new TreeNode<>(2);\n node.left.left = new TreeNode<>(1);\n node.left.right = new TreeNode<>(3);\n node.right = new TreeNode<>(5);\n node.right.left = new TreeNode<>(4);\n node.right.right = new TreeNode<>(8);\n node.right.left.left = new TreeNode<>(0);\n\n List<TreeNode<Integer>> list = TreeNode.linearize_postOrder_1(node);\n for (TreeNode<Integer> n : list) {\n System.out.printf(\"%d, \", n.value);\n }\n System.out.printf(\"\\n\");\n\n list = TreeNode.linearize_postOrder_2(node);\n for (TreeNode<Integer> n : list) {\n System.out.printf(\"%d, \", n.value);\n }\n System.out.printf(\"\\n\");\n\n Map<Integer, Deque<Integer>> adjacencyList = new HashMap<>();\n Deque<Integer> children = new ArrayDeque<>();\n children.add(2); children.add(5);\n adjacencyList.put(7, children);\n children = new ArrayDeque<>();\n children.add(1); children.add(3);\n adjacencyList.put(2, children);\n children = new ArrayDeque<>();\n children.add(4); children.add(8);\n adjacencyList.put(5, children);\n //adjacencyList.put(1, new ArrayDeque<>());\n //adjacencyList.put(3, new ArrayDeque<>());\n children = new ArrayDeque<>();\n children.add(0);\n adjacencyList.put(4, children);\n //adjacencyList.put(0, new ArrayDeque<>());\n //adjacencyList.put(8, new ArrayDeque<>());\n GraphUtils.postOrderTraverse(adjacencyList, new Consumer<Integer>() {\n @Override\n public void accept(Integer integer) {\n System.out.printf(\"%d, \", integer);\n }\n });\n System.out.printf(\"\\n\");\n }", "public String printTree() {\n printSideways();\n return \"\";\n }", "public void visitPostorder(Visitor<T> visitor) { if (root != null) root.visitPostorder(visitor); }", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "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}" ]
[ "0.82164395", "0.80192727", "0.79934204", "0.78299755", "0.78140813", "0.7782029", "0.7748556", "0.77378964", "0.7722264", "0.7684574", "0.76606286", "0.7566616", "0.7559298", "0.7527335", "0.7512869", "0.7495133", "0.74834746", "0.7475905", "0.7473667", "0.7458887", "0.74564147", "0.7369804", "0.73542535", "0.7347502", "0.7338167", "0.73199457", "0.73182577", "0.7283638", "0.7250469", "0.7142736", "0.71342415", "0.7130395", "0.71251166", "0.7098272", "0.7092153", "0.7075804", "0.70734483", "0.70734483", "0.7048531", "0.703781", "0.7019638", "0.7004045", "0.7003561", "0.7000443", "0.6977546", "0.6963635", "0.6949717", "0.6922172", "0.69177574", "0.6911706", "0.6908397", "0.68788505", "0.6867918", "0.6829559", "0.6809897", "0.6793068", "0.67727196", "0.6766002", "0.6755499", "0.6751217", "0.6746507", "0.67151284", "0.667794", "0.6670573", "0.6650042", "0.66411227", "0.6636103", "0.6636103", "0.6629311", "0.65764976", "0.6567709", "0.65584826", "0.65484655", "0.6540177", "0.65136105", "0.6503849", "0.64774925", "0.64387923", "0.6422989", "0.63998693", "0.6394308", "0.63936716", "0.6393658", "0.6392444", "0.63746345", "0.6372628", "0.63688594", "0.6366332", "0.63647115", "0.636226", "0.63530886", "0.6351819", "0.6329654", "0.6326313", "0.63228726", "0.6320334", "0.6317842", "0.63036615", "0.6299105", "0.6295737" ]
0.7872503
3
post: prints in postorder the tree with given root
private void printPostorder(IntTreeNode root) { if (root != null) { printPostorder(root.left); printPostorder(root.right); System.out.print(" " + root.data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\n }", "protected void postorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.element + \" \");\n }", "protected void postorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tpostorder(root.left);\r\n\t\tpostorder(root.right);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t}", "public void postOrder(){\n postOrder(root);\n System.out.println();\n }", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\n }", "void printPostorder() { \n\t\tprintPostorder(root);\n\t}", "public void postOrder(Node root) {\n if(root!=null) {\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\n }\n }", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public static void postorder(Node root){\n\t\tif(root != null){\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t\tSystem.out.println(root.toString());\n\n\t\t}\n\t}", "public static void postOrder(Node root) {\n if (root == null)\n return;\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\n }", "private void postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t}\n\t}", "public void printPostorder() {\n System.out.print(\"postorder:\");\n printPostorder(overallRoot);\n System.out.println();\n }", "private void postOrder(Node root) {\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tpostOrder(root.getlChild());\r\n\t\tpostOrder(root.getrChild());\r\n\t\tif (postOrderCount < 20) {\r\n\t\t\tpostOrderCount++;\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + postOrderCount);\r\n\r\n\t\t}\r\n\r\n\t}", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\n }", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "public void postOrder(Node root) {\n if (root != null) {\n postOrder(root.getLeftChild());\n postOrder(root.getRightChild());\n System.out.print(root.getData() + \" \");\n }\n }", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\n System.out.println();\n }", "public void postOrderPrint(BinaryTreeNode<T> root) {\n if (root != null) {\n postOrderPrint(root.left);\n postOrderPrint(root.right);\n System.out.println(root.value);\n }\n }", "public void postorder()\r\n {\r\n postorder(root);\r\n }", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "public static void printPostOrder(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\tprintPostOrder(treeRoot.left);\r\n\t\tprintPostOrder(treeRoot.right);\r\n\t\tSystem.out.print(treeRoot.root + \" \");\r\n\t}", "public static void postOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tpostOrder(node.left);\n\t\tpostOrder(node.right);\n\t\tSystem.out.print(node.value + \" \");\t\n\t}", "public void postorder()\n {\n postorder(root);\n }", "public void postorder()\n {\n postorder(root);\n }", "public void printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "public void postOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpostOrderTraversal(root.getLeftChild());\n\t\t\tpostOrderTraversal(root.getRightChild());\n\t\t\tSystem.out.println(root);\n\t\t}\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 }", "private void postOrder(HomogeneusNode root) {\n if (root != null) {\n postOrder(root.getLeft());\n postOrder(root.getRight());\n System.out.printf(\"%d\", root.getData());\n }\n }", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\n }", "private void postorderHelper(TreeNode<T> node){\n\n if (node == null)\n return;\n\n postorderHelper(node.leftNode);\n postorderHelper(node.rightNode);\n System.out.printf(\"%s \", node.data);\n }", "private void postOrder(Node<T> node){\n if(node != null){\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" ,\");\n }\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "public void postorder() {\n\t\tpostorder(root);\n\t}", "public static void postOrder(Node node) {\n if (node == null) {\n return;\n }\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" \");\n }", "public void postOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tpostOrder(localRoot.leftChild);\r\n\t\t\tpostOrder(localRoot.rightChild);\r\n\t\t\tSystem.out.print(localRoot.data+ \" \");\r\n\t\t}\r\n\t}", "private void postorderRightOnly(Node root) {\r\n if (root.right != null)\r\n postorderRightOnly(root.right);\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n }", "static void postorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n System.out.println(\" \" + indent + node.data);\n }", "public void printIterativePostOrderTraversal() {\r\n\t\tprintIterativePostOrderTraversal(rootNode);\r\n\t}", "public void postOrder2(BinaryTreeNode root) {\n\t\tBinaryTreeNode cur = root;\n\t\tBinaryTreeNode pre = root;\n\t\tStack<BinaryTreeNode> s = new Stack<BinaryTreeNode>();\n\n\t\tif (root != null)\n\t\t\ts.push(root);\n\n\t\twhile (!s.isEmpty()) {\n\t\t\tcur = s.peek();\n\t\t\t// traversing down the tree\n\t\t\tif (cur == pre || cur == pre.getLeft() || cur == pre.getRight()) {\n\t\t\t\tif (cur.getLeft() != null) {\n\t\t\t\t\ts.push(cur.getLeft());\n\t\t\t\t} else if (cur.getRight() != null) {\n\t\t\t\t\ts.push(cur.getRight());\n\t\t\t\t}\n\t\t\t\tif (cur.getLeft() == null && cur.getRight() == null) {\n\t\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// traversing up the tree from the left\n\t\t\telse if (pre == cur.getLeft()) {\n\t\t\t\tif (cur.getRight() != null) {\n\t\t\t\t\ts.push(cur.getRight());\n\t\t\t\t} else if (cur.getRight() == null) {\n\t\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// we are traversing up the tree from the right\n\t\t\telse if (pre == cur.getRight()) {\n\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t}\n\t\t\tpre = cur;\n\t\t}\n\t}", "private void postOrdertraverse(Node root){\n for(var child : root.getChildren())\n postOrdertraverse(child); //recursively travels other childrens in current child\n\n //finally visit root\n System.out.println(root.value);\n\n }", "public void postOrder() {\n postOrder(root);\n }", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "public static void main(String[] args) {\n\t\tNode root = new Node(30);\n\t\troot.right = new Node(40);\n\t\troot.left = new Node(20);\n\t\troot.left.right=new Node(25);\n\t\troot.left.left = new Node(10);\n\t\troot.right.left = new Node(35);\n\t\troot.right.right = new Node(45);\n\t\t\n\t\tpostOrderTraversal(root);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tpostOrderRecursion(root);\n\t}", "public static void printPostOrderDFT(Node node){\n if (node!=null){ // node มีตัวตน\n printPostOrderDFT(node.left); //เจอ node ไหน recursive ซ้าย และ recursive ขวา และ print ค่า\n printPostOrderDFT(node.right);\n System.out.print(node.key+\" \");\n }\n else{return;}\n }", "public void postOrder(BinarySearchTreeNode<T> node)\r\n {\r\n if(node==null)\r\n {\r\n return;\r\n }\r\n postOrder(node.getLeft());\r\n postOrder(node.getRight());\r\n System.out.println(node.getElement());\r\n\r\n }", "private <E> void postOrder(Node root,Action<Integer,E> action) {\n\t\tif(root==null)\n\t\t\treturn;\n\t\t\n\t\t\n\t\tpostOrder(root.left,action);\n\t\t\n\t\tpostOrder(root.right,action);\n\t\t//System.out.println(root.value,action);\n\t\taction.execute(root.value);\n\t\t\n\t}", "public void postOrder(Node node) {\n\n if (node == null) {\n System.out.println(\"Tree is empty\");\n return;\n }\n\n Stack<Node> stack1 = new Stack<>();\n Stack<Node> stack2 = new Stack<>();\n\n stack1.push(node);\n\n while (!stack1.empty()) {\n\n node = stack1.pop();\n\n stack2.push(node);\n\n if (node.left != null) {\n stack1.push(node.left);\n }\n\n if (node.right != null) {\n stack1.push(node.right);\n }\n }\n\n while (!stack2.empty()) {\n node = stack2.pop();\n System.out.print(node.value + \" \");\n }\n }", "public void traversePostOrder(Node node) {\n\t\tif (node != null) {\n\t\t\ttraversePostOrder(node.left);\n\t\t\ttraversePostOrder(node.right);\n\t\t\tSystem.out.print(\" \" + node.value);\n\t\t}\n\t}", "public void postOrderTravel(Node node) {\n\t\tif(node != null) {\r\n\t\t\tpostOrderTravel(node.leftChild);\r\n\t\t\tpostOrderTravel(node.rightChild);\r\n\t\t\tSystem.out.println(node);\r\n\t\t}\r\n\t}", "static void postOrderOneStack(Node root) {\n Stack<Node> stack = new Stack<>();\n while (true) {\n while (root != null) {\n stack.push(root);\n stack.push(root);\n root = root.left;\n }\n if (stack.isEmpty()) {\n return;\n }\n root = stack.pop();\n if (!stack.isEmpty() && stack.peek() == root) {\n root = root.right;\n } else {\n System.out.print(root.data + \" \");\n root = null;\n }\n }\n }", "protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\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 String postorder() {\n \tresult = \"\";\n \ttraversal(root);\n return result;\n }", "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 }", "protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}", "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 }", "private void postOrder() {\n postOrderTraversal(0);\n System.out.println(); // jump to next line\n }", "protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "public void printPostOrder(Node currNode){\n if (currNode != null){\n printInOrder(currNode.left);\n printInOrder(currNode.right);\n System.out.print(currNode.val + \", \");\n }\n }", "void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }", "public void postOrderTraversal() {\n beginAnimation();\n treePostOrderTraversal(root);\n stopAnimation();\n\n }", "public static void postOrderTraverse2(TreeNode head){\n if(head == null) return;\n Stack<TreeNode> stack = new Stack<>();\n stack.push(head);\n TreeNode node;\n while (!stack.isEmpty()){\n while (( node = stack.peek()) != null){\n if(node.lChild != null && node.lChild.visited == true){\n stack.push(null);\n break;\n }\n stack.push(node.lChild);\n }\n stack.pop(); //空指针出栈\n if(!stack.isEmpty()){\n node = stack.peek();\n if(node.rChild == null || node.rChild.visited == true){\n System.out.print(node.val + \" \");\n node.visited = true;\n stack.pop();\n }else {\n stack.push(node.rChild);\n }\n }\n }\n }", "public void printTree(T root) {\n List<TreeLine> treeLines = buildTreeLines(root);\n printTreeLines(treeLines);\n if(flush) outStream.flush();\n }", "public void postOrderTraversal(Node<T> aRoot, List<T> postOrder)\n\t{\n\t\tif (aRoot != null)\n\t\t{\n\t\t\tpostOrderTraversal(aRoot.left, postOrder);\n\t\t\tpostOrderTraversal(aRoot.right, postOrder);\n\t\t\tpostOrder.add(aRoot.X);\n\t\t}\n\t}", "private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\n\t}", "public void preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "public void visitPostorder(Visitor<T> visitor) { if (root != null) root.visitPostorder(visitor); }", "public static void main(String[] args) {\n TreeNode one = new TreeNode(1);\n TreeNode three = new TreeNode(3);\n three.right = one;\n TreeNode two = new TreeNode(2);\n two.right = three;\n new BinaryTreePostorderTraversal_145().postorderTraversal(two);\n }", "public void PostOrder() {\n\t\tPostOrder(root);\n\t}", "private void postOrderTraversal(int index) {\n if (array[index] == null) {\n return;\n }\n //call recursively the method on left child\n postOrderTraversal(2 * index + 1);\n //call recursively the method on right child\n postOrderTraversal(2 * index + 2);\n // print the node\n System.out.print(array[index] + \", \");\n }", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "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 preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\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 }", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "static void postOrderTwoStacks(Node root) {\n Stack<Node> stack = new Stack<>();\n Stack<Node> stack2 = new Stack<>();\n if (root == null) {\n return;\n } else {\n stack.push(root);\n while (!stack.isEmpty()) {\n Node temp = stack.pop();\n stack2.push(temp);\n if (temp.left != null) {\n stack.push(temp.left);\n }\n if (temp.right != null) {\n stack.push(temp.right);\n }\n }\n while (!stack2.isEmpty()) {\n Node temp = stack2.pop();\n System.out.print(temp.data + \" \");\n }\n }\n }", "private void postOrderTraverse(Node<String> node,StringBuilder sb) {\n\n\t\t\t\tif (node != null) {\t\n\t\t\t\t\tpostOrderTraverse(node.left, sb);\n\t\t\t\t\tpostOrderTraverse(node.right,sb);\n\t\t\t\t\tsb.append(node.toString());\n\t\t\t\t\tsb.append(\" \");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t}", "private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}", "public List<Integer> postOrder(TreeNode root) {\n\n List<Integer> ans = new ArrayList<>();\n\n if(root==null){\n return ans;\n }\n\n Deque<TreeNode> stack = new LinkedList<>();\n stack.push(root);\n TreeNode pre = new TreeNode(0);\n\n while(!stack.isEmpty()) {\n\n if (stack.peek().left != null && stack.peek().left != pre && stack.peek().right != pre) {\n stack.push(stack.peek().left);\n continue;\n }\n\n if (stack.peek().right != null && stack.peek().right != pre) {\n stack.push(stack.peek().right);\n continue;\n }\n pre = stack.poll();\n ans.add(pre.key);\n }\n\n return ans;\n\n }", "public String postorderTraverse(){\r\n\t\t\r\n\t\t//the recursive call to the private method\r\n\t\t//StringBuffer is used because it is passed by reference\r\n\t\t//StringBuffer can be changed in recursive calls\r\n\t\treturn postorderTraverse(this, new StringBuffer(\"\"));\r\n\t}", "public void print() {\n\t\tSystem.out.println(\"DECISION TREE\");\n\t\tString indent = \" \";\n\t\tprint(root, indent, \"\");\n\t}", "private static void traversals(Node root) {\n\t\tSystem.out.println(\"Node Pre \" + root.data);\n\t\tfor(Node child : root.children) {\n\t\t\tSystem.out.println(\"Edge Pre \" + root.data + \"--\" + child.data);\n\t\t\ttraversals(child);\n\t\t\tSystem.out.println(\"Edge Post \" + root.data + \"--\" + child.data);\n\t\t}\n\t\tSystem.out.println(\"Node Post \" + root.data);\n\t}", "public static void printPreOrder(Node treeRoot) {\r\n\t\tif (treeRoot == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.print(treeRoot.root + \", \");\r\n\t\tprintPreOrder(treeRoot.left);\r\n\t\tprintPreOrder(treeRoot.right);\r\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 void postOrderTraversal(){\n System.out.println(\"postOrderTraversal\");\n //TODO: incomplete\n\n }", "public static void preOrder(Node root) {\n if (root == null)\n return;\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n\n }", "static void preOrderWithoutRecursion(Node root) {\n Stack<Node> stack = new Stack<>();\n stack.push(root);\n while (!stack.isEmpty()) {\n Node node = stack.peek();\n System.out.print(node.data + \" \");\n stack.pop();\n\n if (node.right != null) {\n stack.push(node.right);\n }\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n }", "public void postOrderTraverseTree(Node focusNode) {\n if (focusNode != null) { // recursively traverse left child nodes first than right\n\n postOrderTraverseTree(focusNode.leftChild);\n postOrderTraverseTree(focusNode.rightChild);\n\n System.out.println(focusNode); // print recursively pre-order traversal (or return!)\n\n }\n }", "public void preOrder(Node root) {\n if (root != null) {\n System.out.print(root.getData() + \" \");\n preOrder(root.getLeftChild());\n preOrder(root.getRightChild());\n }\n }", "public void postOrder(MyBinNode<Type> r){\n if(r != null){\n this.postOrder(r.right);\n this.postOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n }\n }", "public void treeOrder ()\n {\n treeOrder (root, 0);\n }", "private String dfspostorder(TreeNode root, HashMap<String,Integer> set, List<TreeNode> ans){\n if(root == null) return \"\";\n String serial = root.val + \",\" + dfspostorder(root.left, set, ans)+ \",\" + dfspostorder(root.right,set,ans);\n if(set.getOrDefault(serial,0)==1) ans.add(root);\n set.put(serial,set.getOrDefault(serial,0)+1);\n return serial;\n }", "public static void preorderTraversal(Node root)\r\n {\r\n if (root == null) {\r\n return;\r\n }\r\n \r\n System.out.print(root.data + \" \");\r\n preorderTraversal(root.left);\r\n preorderTraversal(root.right);\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}", "public void print() {\n\t\ttraversePreOrder(root, 0);\n\t}" ]
[ "0.8555738", "0.849623", "0.8494571", "0.8419477", "0.83827317", "0.82829887", "0.82773066", "0.82452583", "0.8220839", "0.82091016", "0.82011443", "0.81959134", "0.81767684", "0.81646043", "0.81432194", "0.81137466", "0.80793923", "0.8008551", "0.79905856", "0.79564136", "0.79500836", "0.7940677", "0.79273915", "0.7913107", "0.7913107", "0.7901263", "0.78899217", "0.7883366", "0.7807826", "0.77968985", "0.7715671", "0.76814526", "0.7633404", "0.7619603", "0.7614149", "0.75942576", "0.7473932", "0.74286795", "0.73973984", "0.73390734", "0.73307115", "0.73061615", "0.72665787", "0.72660524", "0.72040784", "0.7199515", "0.7194342", "0.71602756", "0.7142656", "0.7102036", "0.7090216", "0.7058301", "0.6975402", "0.6960937", "0.69452566", "0.6936027", "0.69359183", "0.69050646", "0.68955064", "0.68744755", "0.6869976", "0.6869364", "0.68588144", "0.684362", "0.68427664", "0.68169934", "0.6816702", "0.6815076", "0.6813702", "0.6813306", "0.6812577", "0.6801665", "0.6800851", "0.67786", "0.67309046", "0.67309046", "0.672308", "0.6693772", "0.6680013", "0.66642845", "0.66568184", "0.66304743", "0.662184", "0.66094846", "0.6593525", "0.65836984", "0.6568109", "0.6566304", "0.65577364", "0.65573674", "0.65507853", "0.65366066", "0.6531489", "0.65127593", "0.65104544", "0.6506377", "0.6492152", "0.6480919", "0.64721173", "0.64599925" ]
0.81864256
12
post: prints the tree contents, one per line, following an inorder traversal and using indentation to indicate node depth; prints right to left so that it looks correct when the output is rotated; prints "empty" for an empty tree
public void printSideways() { if (overallRoot == null) { System.out.println("empty tree"); } else { printSideways(overallRoot, 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "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 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 }", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "public String printTree() {\n printSideways();\n return \"\";\n }", "public void printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\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 }", "static void postorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n System.out.println(\" \" + indent + node.data);\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 }", "void printPostorder() { \n\t\tprintPostorder(root);\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 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}", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\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 printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\n }", "public void printPostorder() {\n System.out.print(\"postorder:\");\n printPostorder(overallRoot);\n System.out.println();\n }", "private void printTree(OutputStreamWriter out, boolean isRight, String indent) throws IOException {\n\t if (right != null) {\n\t right.printTree(out, true, indent + (isRight ? \" \" : \" | \"));\n\t }\n\t out.write(indent);\n\t if (isRight) {\n\t out.write(\" /\");\n\t } else {\n\t out.write(\" \\\\\");\n\t }\n\t out.write(\"----- \");\n\t printNodeValue(out);\n\t if (left != null) {\n\t left.printTree(out, false, indent + (isRight ? \" | \" : \" \"));\n\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 }", "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}", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\n }", "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 }", "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 postorderHelper(TreeNode<T> node){\n\n if (node == null)\n return;\n\n postorderHelper(node.leftNode);\n postorderHelper(node.rightNode);\n System.out.printf(\"%s \", node.data);\n }", "public void printTree() {\r\n printTree(overallRoot, 0);\r\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 preorder() {\n root.preorder();\n System.out.println(\"\");\n }", "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}", "private void printTree(Tree parse) {\n \t\tparse.pennPrint();\n \t}", "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 }", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\n }", "private void printPostorder(IntTreeNode root) {\n if (root != null) {\n printPostorder(root.left);\n printPostorder(root.right);\n System.out.print(\" \" + root.data);\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 postOrder(){\n postOrder(root);\n System.out.println();\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 }", "private void postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t}\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 }", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\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 }", "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 }", "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 print(){\n inorderTraversal(this.root);\n }", "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}", "private void printTree(TreeNode root, boolean isRight, String indent){\r\n if (root.right != null) {\r\n printTree(root.right, true, indent + (isRight ? \" \" : \" | \"));\r\n }\r\n System.out.print(indent);\r\n if (isRight) {\r\n System.out.print(\" /\");\r\n } else {\r\n System.out.print(\" \\\\\");\r\n }\r\n System.out.print(\"----- \");\r\n System.out.println(root.data);\r\n if (root.left != null) {\r\n printTree(root.left, false, indent + (isRight ? \" | \" : \" \"));\r\n }\r\n }", "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 }", "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(){\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 print() {\n\t\ttraversePreOrder(root, 0);\n\t}", "public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "void printPreorder(Node node) {\n if (node == null)\n return;\n\n /* first print data of node */\n System.out.print(node.key + \" \");\n\n /* then recur on left sutree */\n printPreorder(node.left);\n\n /* now recur on right subtree */\n printPreorder(node.right);\n }", "public void printTree() {\n printTreeHelper(root);\n }", "public void printIterativePostOrderTraversal() {\r\n\t\tprintIterativePostOrderTraversal(rootNode);\r\n\t}", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "private void postOrder(Node<T> node){\n if(node != null){\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" ,\");\n }\n }", "public static void postOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tpostOrder(node.left);\n\t\tpostOrder(node.right);\n\t\tSystem.out.print(node.value + \" \");\t\n\t}", "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 postOrder() {\n postOrderTraversal(0);\n System.out.println(); // jump to next line\n }", "public void displayTree()\r\n {\r\n Stack globalStack = new Stack();\r\n globalStack.push(root);\r\n int nBlanks = 32;\r\n boolean isRowEmpty = false;\r\n System.out.println(\r\n \"......................................................\");\r\n while(isRowEmpty==false)\r\n {\r\n Stack localStack = new Stack();\r\n isRowEmpty = true;\r\n\r\n for(int j=0; j<nBlanks; j++)\r\n System.out.print(' ');\r\n\r\n while(globalStack.isEmpty()==false)\r\n {\r\n Node temp = (Node)globalStack.pop();\r\n if(temp != null)\r\n {\r\n if((temp.getStoredChar()) != '\\u0000'){\r\n System.out.print(\"{\"+temp.getStoredChar() + \",\" + temp.getFrequency()+\"}\");\r\n \r\n }\r\n else{\r\n System.out.print(\"{_,\"+ temp.getFrequency()+\"}\");\r\n \r\n }\r\n localStack.push(temp.getLeftChild());\r\n localStack.push(temp.getRightChild());\r\n\r\n if(temp.getLeftChild() != null ||\r\n temp.getRightChild() != null)\r\n isRowEmpty = false;\r\n }\r\n else\r\n {\r\n System.out.print(\"-\");\r\n localStack.push(null);\r\n localStack.push(null);\r\n }\r\n for(int j=0; j<nBlanks*2-2; j++)\r\n System.out.print(' ');\r\n } // end while globalStack not empty\r\n System.out.println();\r\n nBlanks /= 2;\r\n while(localStack.isEmpty()==false)\r\n globalStack.push( localStack.pop() );\r\n } // end while isRowEmpty is false\r\n System.out.println(\r\n \"......................................................\");\r\n System.out.println(\"\");\r\n }", "void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }", "private void printTree(Tree parse) {\n\t\tparse.pennPrint();\n\t}", "private void preorderHelper(TreeNode<T> node){\n if(node == null)\n return;\n\n System.out.printf(\"%s \" , node.data);\n preorderHelper(node.leftNode);\n preorderHelper(node.rightNode);\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 }", "void preOrderPrint(Node root, boolean recursion)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrderPrint(root.left, true);\n\t\tpreOrderPrint(root.right, true);\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 }", "private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\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 }", "protected void postorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.element + \" \");\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 static void main(String[] args) {\n ConstructBinaryTreefromInorderandPostorderTraversal obj = new ConstructBinaryTreefromInorderandPostorderTraversal();\n TreeNode root = TreeNode.deserializeLevelorder(\"6,2,8,0,4,7,9,null,null,3,5\");\n TreeNode.printNode(root);\n System.out.println(\"\\nPost order\");\n TreeNode.postorderRecursive(root);\n System.out.println(\"\\nIn order\");\n TreeNode.inorderRecursive(root);\n System.out.println(\"\\nPre order\");\n TreeNode.preorderRecursive(root);\n System.out.println(\"\\nConstruct tree\");\n int[] inorder = {0, 2, 3, 4, 5, 6, 7, 8, 9};\n int[] postOrder = {0, 3, 5, 4, 2, 7, 9, 8, 6};\n TreeNode res = obj.buildTree(inorder, postOrder);\n TreeNode.printNode(res);\n\n int[] inorder2 = {3, 2, 1};\n int[] postOrder2 = {3, 2, 1};\n TreeNode res2 = obj.buildTree(inorder2, postOrder2);\n TreeNode.printNode(res2);\n }", "public void postOrderPrint(BinaryTreeNode<T> root) {\n if (root != null) {\n postOrderPrint(root.left);\n postOrderPrint(root.right);\n System.out.println(root.value);\n }\n }", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "@Test\r\n public void printTests(){\n\r\n BinaryTree<Integer> tree = new BinaryTree<>();\r\n tree.add(50);\r\n tree.add(25);\r\n tree.add(75);\r\n tree.add(12);\r\n tree.add(37);\r\n tree.add(67);\r\n tree.add(87);\r\n\r\n // redirect stdout to ByteArrayOutputStream for junit\r\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\r\n PrintStream printStream = new PrintStream(byteArrayOutputStream);\r\n PrintStream oldPrintStream = System.out;\r\n System.setOut(printStream);\r\n\r\n // inorder should print 12 25 37 50 67 75 87\r\n tree.print();\r\n printStream.flush();\r\n assertEquals(\"12 25 37 50 67 75 87 \", byteArrayOutputStream.toString());\r\n\r\n byteArrayOutputStream.reset();\r\n\r\n // preorder should print 50 25 12 37 75 67 87\r\n tree.print(BinaryTree.PrintOrder.PREORDER);\r\n printStream.flush();\r\n assertEquals(\"50 25 12 37 75 67 87 \", byteArrayOutputStream.toString());\r\n\r\n byteArrayOutputStream.reset();\r\n\r\n // postorder should print 12 37 25 67 87 75 50\r\n tree.print(BinaryTree.PrintOrder.POSTORDER);\r\n printStream.flush();\r\n assertEquals(\"12 37 25 67 87 75 50 \", byteArrayOutputStream.toString());\r\n\r\n // restore stdout\r\n System.setOut(oldPrintStream);\r\n }", "void Print() {\r\n\r\n AVLTreeNode node = root;\r\n\r\n printInorder(node);\r\n\r\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 printTree() {\n Object[] nodeArray = this.toArray();\n for (int i = 0; i < nodeArray.length; i++) {\n System.out.println(nodeArray[i]);\n }\n }", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "protected void postorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tpostorder(root.left);\r\n\t\tpostorder(root.right);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t}", "private void writeTree(QuestionNode current,PrintStream output){\n if (current != null) {\n //assign type, 'Q' or 'A'\n String type = \"\";\n if (current.left == null && current.right == null){\n type = \"A:\";\n } else {\n type = \"Q:\";\n } \n //print data of tree node\n output.println(type);\n output.println(current.data);\n //print left branch\n writeTree(current.left,output);\n //print right branch\n writeTree(current.right,output); \n }\n }", "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 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 }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\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}", "public void printInOrder() { // not to be changed\n\t\tprintInOrder(root);\n\t}", "public static void postOrder(Node node) {\n if (node == null) {\n return;\n }\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" \");\n }", "@Override\n public String print() {\n ArrayList<K> inorderTraverse = inOrdorTraverseBST();\n \n System.out.print(\"In ascending order: \");\n for (int i=0; i<inorderTraverse.size(); i++) {\n System.out.print(inorderTraverse.get(i)+\" \");\n }\n System.out.println(\"\");\n return \"\";\n }", "public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public void printLeftView(){\n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n // take a bool value printed = false\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n boolean printed = false;\n\n while(queue.size() != 0){\n Node<T> node = queue.remove();\n if(node != null){\n // if the first node is not printed print it and flip the bool value\n if(! printed){\n System.out.println(node.data);\n printed = true;\n }\n\n // add left and right child if they exist\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // flip the printed bool value\n // break if the queue is empty else enqueue a null\n printed = false;\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\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 String print(BSTNode<T> node, int level) {\r\n\t\tString ret = \"\";\r\n\t\tif(node!= null) {\r\n\t\t\tfor(int i = 0; i< level; i++) {\r\n\t\t\t\tret += \"\\t\";\r\n\t\t\t}\r\n\t\t\tret+= node.data;\r\n\t\t\tret +=\"\\n\";\r\n\t\t\tret += print(node.left, level +1);\r\n\t\t\tret += print(node.right, level+1);\r\n\t\t}\r\n\t\treturn ret;\r\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 }", "protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "public static void printPostOrder(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\tprintPostOrder(treeRoot.left);\r\n\t\tprintPostOrder(treeRoot.right);\r\n\t\tSystem.out.print(treeRoot.root + \" \");\r\n\t}", "public void preOrder(){\n preOrder(root);\n System.out.println();\n }", "public void postOrder(Node node) {\n\n if (node == null) {\n System.out.println(\"Tree is empty\");\n return;\n }\n\n Stack<Node> stack1 = new Stack<>();\n Stack<Node> stack2 = new Stack<>();\n\n stack1.push(node);\n\n while (!stack1.empty()) {\n\n node = stack1.pop();\n\n stack2.push(node);\n\n if (node.left != null) {\n stack1.push(node.left);\n }\n\n if (node.right != null) {\n stack1.push(node.right);\n }\n }\n\n while (!stack2.empty()) {\n node = stack2.pop();\n System.out.print(node.value + \" \");\n }\n }" ]
[ "0.7350561", "0.7169045", "0.7153596", "0.7086984", "0.7086984", "0.7055946", "0.70069104", "0.699877", "0.6980533", "0.6973407", "0.69618154", "0.69594824", "0.69391304", "0.69285715", "0.6919946", "0.6888469", "0.6884179", "0.68364054", "0.68262684", "0.6805801", "0.6727319", "0.6694846", "0.6692286", "0.6686764", "0.6685348", "0.6676661", "0.66557974", "0.66555893", "0.6650164", "0.6647139", "0.6630513", "0.6618438", "0.6609485", "0.6609424", "0.6607601", "0.66055906", "0.65968686", "0.65874696", "0.6580718", "0.6580718", "0.65766263", "0.6572786", "0.65601355", "0.65516734", "0.6549336", "0.65429175", "0.6542049", "0.6538599", "0.6535602", "0.65282047", "0.6522231", "0.6504264", "0.6498513", "0.64913994", "0.64900655", "0.64865494", "0.6486043", "0.6484362", "0.647657", "0.6455377", "0.6446595", "0.6444668", "0.6420486", "0.64166105", "0.6407489", "0.6384092", "0.6370025", "0.6361414", "0.63421816", "0.63389194", "0.6335877", "0.6332551", "0.63311803", "0.632348", "0.63145125", "0.6312389", "0.63109624", "0.6308652", "0.6308511", "0.6308074", "0.63048285", "0.6286385", "0.62784594", "0.62779385", "0.62702966", "0.6266176", "0.6253848", "0.6243043", "0.6242195", "0.6241791", "0.62374157", "0.6237176", "0.6234443", "0.6231066", "0.6229927", "0.62292826", "0.62281054", "0.6224677", "0.6216625", "0.62146145", "0.6209474" ]
0.0
-1
post: prints in reversed preorder the tree with given root, indenting each line to the given level
private void printSideways(IntTreeNode root, int level) { if (root != null) { printSideways(root.right, level + 1); for (int i = 0; i < level; i++) { System.out.print(" "); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printTreePostOrder(TreeNode root){\r\n if(root==null) return;\r\n printTreeInOrder(root.left);\r\n printTreeInOrder(root.right);\r\n System.out.print(root.value + \" -> \");\r\n }", "public void preorder() {\n root.preorder();\n System.out.println(\"\");\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 }", "void printPostorder() { \n\t\tprintPostorder(root);\n\t}", "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 }", "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 }", "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 }", "static void postOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n postOrderTraversal(root.left);\n postOrderTraversal(root.right);\n System.out.print(root.data + \" \");\n }", "static void postorderPrint(TreeNode node, String indent) {\n if (node == null)\n return;\n\n Iterator iter = node.getChildren().iterator();\n while (iter.hasNext()) {\n postorderPrint((TreeNode) iter.next(), indent + \"| \");\n }\n System.out.println(\" \" + indent + node.data);\n }", "protected void preorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n System.out.print(root.element + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "private void _printPostorder(IntTreeNode root) {\r\n if (root != null) {\r\n _printPostorder(root.left);\r\n _printPostorder(root.right);\r\n System.out.print(\" \" + root.data);\r\n }\r\n }", "void preorder(Node root){\n if(root!=null){\n System.out.print(root.data+\" \");\n preorder(root.left);\n preorder(root.right);\n }\n\n }", "public void postorderTraverse(){\n\t\tpostorderHelper(root);\n\t\tSystem.out.println();\n\t}", "public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}", "private void postOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n postOrderTraversalRec(root.getLeft());\n postOrderTraversalRec(root.getRight());\n System.out.print(root.getData() + \" \");\n }", "private void printPostorder(IntTreeNode root) {\n if (root != null) {\n printPostorder(root.left);\n printPostorder(root.right);\n System.out.print(\" \" + root.data);\n }\n }", "protected void preorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t\tpreorder(root.left);\r\n\t\tpreorder(root.right);\r\n\t}", "public void postOrder(){\n postOrder(root);\n System.out.println();\n }", "protected void preorder(node root){\n if(root == null)\n return;\n\n System.out.print(root.data + \" \");\n preorder(root.left);\n preorder(root.right);\n }", "public void postOrderPrint() {\n\t\tpostOrderPrint(root);\n\t\tSystem.out.println();\n\t}", "private static void preOrder(Node root) {\n\t\tif (root == null)\n\t\t\treturn;\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrder(root.left);\n\t\tpreOrder(root.right);\n\t}", "void postorder(Node root){\n if(root!=null){\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.data+\" \");\n }\n\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 }", "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 void preOrder(){\n preOrder(root);\n System.out.println();\n }", "private void preorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t\tpreorderHelper(root.left);\n\t\t\tpreorderHelper(root.right);\n\t\t}\n\t}", "public void printPreorder() {\n System.out.print(\"preorder:\");\n printPreorder(overallRoot);\n System.out.println();\n }", "public void printPostorder() {\n System.out.print(\"postorder:\");\n printPostorder(overallRoot);\n System.out.println();\n }", "private void preOrderTraversalRec(final Node root){\n if(root == null){\n return;\n }\n System.out.print(root.getData() + \" \");\n preOrderTraversalRec(root.getLeft());\n preOrderTraversalRec(root.getRight());\n }", "public void printTreePostOrder(Node node)\n {\n if (node == null)\n {\n return;\n }\n\n printTreePostOrder(node.left);\n printTreePostOrder(node.right);\n\n System.out.print(node.item + \" \");\n }", "static void preOrderTraversal(Node root) {\n if (root == null) {\n return;\n }\n System.out.print(root.data + \" \");\n preOrderTraversal(root.left);\n preOrderTraversal(root.right);\n }", "public void preOrder() {\r\n\t\tSystem.out.print(\"PRE: \");\r\n\r\n\t\tpreOrder(root);\r\n\t\tSystem.out.println();\r\n\r\n\t}", "public void postOrderTraversal() {\n postOrderThroughRoot(root);\n System.out.println();\n }", "protected void postorder(TreeNode<E> root) {\r\n\t\tif (root == null)\r\n\t\t\treturn;\r\n\t\tpostorder(root.left);\r\n\t\tpostorder(root.right);\r\n\t\tSystem.out.print(root.element + \" \");\r\n\t}", "private void postorderHelper(Node<E> root){\n\t\tif(root != null){\n\t\t\tpostorderHelper(root.left);\n\t\t\tpostorderHelper(root.right);\n\t\t\tSystem.out.print(root.item.toString() + \" \");\n\t\t}\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 }", "static void preOrderWithoutRecursion(Node root) {\n Stack<Node> stack = new Stack<>();\n stack.push(root);\n while (!stack.isEmpty()) {\n Node node = stack.peek();\n System.out.print(node.data + \" \");\n stack.pop();\n\n if (node.right != null) {\n stack.push(node.right);\n }\n if (node.left != null) {\n stack.push(node.left);\n }\n }\n }", "protected void postorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n postorder(root.left);\n postorder(root.right);\n System.out.print(root.element + \" \");\n }", "public static void preorder(Node root){\n\t\tif(root != null){\n\t\t\tSystem.out.println(root.toString());\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t}\n\t}", "public static void postorder(Node root){\n\t\tif(root != null){\n\t\t\tinorder(root.getLeft());\n\t\t\tinorder(root.getRight());\n\t\t\tSystem.out.println(root.toString());\n\n\t\t}\n\t}", "private void showTree(EarleyParser.Node root,int level, String previous) {\n\t\tSystem.out.print(level);\n\t\tfor(int i = 0; i <= level; i++)\n\t\t\tSystem.out.print(\" \");\n\t\tSystem.out.println(root.text);\n\t\tString cur = root.text;\n\t\twhile(graph.containsVertex(cur)) {\n\t\t\tcur = cur + \" \";\n\t\t}\n\n\t\tgraph.addVertex(cur);\n\t\tif(previous != null) {\n\t\t\tgraph.addEdge(edgeid++, previous, cur);\n\t\t}\n\t\tfor(EarleyParser.Node sibling : root.siblings) {\n\t\t\tshowTree(sibling, level+1, cur);\n\t\t}\n\t}", "public void postOrder(Node root) {\n if(root!=null) {\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\n }\n }", "public static void preorderTraversal(Node root)\r\n {\r\n if (root == null) {\r\n return;\r\n }\r\n \r\n System.out.print(root.data + \" \");\r\n preorderTraversal(root.left);\r\n preorderTraversal(root.right);\r\n }", "public void preOrder(Node root) {\n if(root!=null) {\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n }\n }", "public static void printPreOrder(Node treeRoot) {\r\n\t\tif (treeRoot == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.print(treeRoot.root + \", \");\r\n\t\tprintPreOrder(treeRoot.left);\r\n\t\tprintPreOrder(treeRoot.right);\r\n\t}", "private void postOrder(Node root) {\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tpostOrder(root.getlChild());\r\n\t\tpostOrder(root.getrChild());\r\n\t\tif (postOrderCount < 20) {\r\n\t\t\tpostOrderCount++;\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + postOrderCount);\r\n\r\n\t\t}\r\n\r\n\t}", "public void preOrderTraversal() {\n preOrderThroughRoot(root);\n System.out.println();\n }", "public void reverseLevelOrderTraversel(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tQueue<TreeNode> que = new LinkedList<>();\r\n\t\tStack<TreeNode> stack = new Stack<TreeNode>();\r\n\t\t\r\n\t\tque.add(root);\r\n\t\twhile(que.size()>0)\r\n\t\t{\r\n\t\t\tTreeNode element=que.remove();\r\n\t\t\tif(element.right!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.right);\r\n\t\t\t}\r\n\t\t\tif(element.left!=null)\r\n\t\t\t{\r\n\t\t\t\tque.add(element.left);\r\n\t\t\t}\r\n\t\t\tstack.push(element);\r\n\t\t}\r\n\t\twhile(stack.size()>0)\r\n\t\t{\r\n\t\t\tSystem.out.print(stack.pop().data+\" \");\r\n\t\t}\r\n\t\t\t\r\n\t}", "void printPostorder(Node node) {\n\t\t//base case\n\t\tif(node == null)\n\t\t\treturn;\n\t\t// first recur on left subtree\n\t\tprintPostorder(node.left);\n\t\t\t\t\n\t\t// then recur on right subtree\n\t\tprintPostorder(node.right);\n\t\t\t\t\n\t\t// now deal with the node\n\t\tSystem.out.print(node.data + \" \");\n\t}", "public static void rightToLeft(Node root, int level){\n if(root == null){\n return;\n }\n if(level == 1){\n System.out.print(root.data +\" \");\n }else if(level>1){\n rightToLeft(root.right, level-1);\n rightToLeft(root.left, level-1);\n }\n }", "public void levelOrderPrint() {\n\t\tlevelOrderPrint(root);\n\t}", "public void postOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tpostOrderTraversal(root.getLeftChild());\n\t\t\tpostOrderTraversal(root.getRightChild());\n\t\t\tSystem.out.println(root);\n\t\t}\n\t}", "private void postOrder() {\n postOrderTraversal(0);\n System.out.println(); // jump to next line\n }", "public static void preOrder(Node root) {\n if (root == null)\n return;\n System.out.print(root.data + \" \");\n preOrder(root.left);\n preOrder(root.right);\n\n }", "public static void printPostOrder(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\tprintPostOrder(treeRoot.left);\r\n\t\tprintPostOrder(treeRoot.right);\r\n\t\tSystem.out.print(treeRoot.root + \" \");\r\n\t}", "public static void postOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tpostOrder(node.left);\n\t\tpostOrder(node.right);\n\t\tSystem.out.print(node.value + \" \");\t\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 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 }", "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\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}", "public void preOrder(TreeNode root){\n\t\t//Change place of temp\n\t\tSystem.out.println(root.toString());\n\t\tif(root.getLeft()!= null){\n\t\t\tpreOrder(root.getLeft());\n\t\t}\n\t\tif(root.getMiddle()!=null){\n\t\t\tpreOrder(root.getMiddle());\n\t\t}\n\t\tif(root.getRight()!= null){\n\t\t\tpreOrder(root.getRight());\n\t\t}\n\t}", "public void postOrder(Node root) {\n if (root != null) {\n postOrder(root.getLeftChild());\n postOrder(root.getRightChild());\n System.out.print(root.getData() + \" \");\n }\n }", "public void postOrder() {\r\n\t\tSystem.out.print(\"POST: \");\r\n\t\tpostOrder(root);\r\n\t\tSystem.out.println();\r\n\t}", "public void preOrder(Node root) {\n if (root != null) {\n System.out.print(root.getData() + \" \");\n preOrder(root.getLeftChild());\n preOrder(root.getRightChild());\n }\n }", "public static void postOrder(Node root) {\n if (root == null)\n return;\n postOrder(root.left);\n postOrder(root.right);\n System.out.print(root.data + \" \");\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}", "public static void preOrder(TreeNode node) {\n if (node == null) {\n return;\n }\n System.out.print(node.data + \" \");\n preOrder(node.left);\n preOrder(node.right);\n }", "public void levelOrderUsingRecurison(TreeNode root)\r\n\t{\r\n\t\tif(root == null)\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tint height=heightOfTree(root);\r\n\t\tfor (int i=0;i<=height;i++)\r\n\t\t{\r\n\t\t\tprintNodesAtGivenLevel(root,i+1);\t\t\r\n\t\t}\r\n\t}", "public static void preOrder(TreeNode node) {\n\t\tif(node == null) return;\n\t\t\n\t\tSystem.out.print(node.value + \" \");\n\t\tpreOrder(node.left);\n\t\tpreOrder(node.right);\t\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 }", "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}", "void postOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tpostOrderTraversal(node.getLeftNode());\n\t\tpostOrderTraversal(node.getRightNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t}", "public void preorder()\r\n {\r\n preorder(root);\r\n }", "public void postOrderPrint(BinaryTreeNode<T> root) {\n if (root != null) {\n postOrderPrint(root.left);\n postOrderPrint(root.right);\n System.out.println(root.value);\n }\n }", "private void preorderHelper(TreeNode<T> node){\n if(node == null)\n return;\n\n System.out.printf(\"%s \" , node.data);\n preorderHelper(node.leftNode);\n preorderHelper(node.rightNode);\n }", "static void levelOrder(Node root){\n Queue<Node> queue = new LinkedList<Node>();\r\n \r\n queue.add(root);\r\n while (!queue.isEmpty()) {\r\n Node head = queue.remove();\r\n\r\n if (head == null) {\r\n continue;\r\n }\r\n\r\n System.out.print(head.data + \" \");\r\n\r\n queue.add(head.left);\r\n queue.add(head.right);\r\n }\r\n System.out.println();\r\n \r\n }", "private void postorderRightOnly(Node root) {\r\n if (root.right != null)\r\n postorderRightOnly(root.right);\r\n if (this != null && !ifLeaf(root))\r\n System.out.print(root.value + \">\");\r\n }", "private String traversePreOrder(BinaryNode<T> root) {\n preOrderTrav += root.getData() + \" -> \";\n if (root.getLeftNode() != null) { // traverse left\n traversePreOrder(root.getLeftNode());\n }\n if (root.getRightNode() != null) { // traverse right\n traversePreOrder(root.getRightNode());\n }\n return preOrderTrav;\n }", "void printPostorder(Node node) {\n if (node == null)\n return;\n\n // first recur on left subtree\n printPostorder(node.left);\n\n // then recur on right subtree\n printPostorder(node.right);\n\n // now deal with the node\n System.out.print(node.key + \" \");\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}", "void preOrderPrint(Node root, boolean recursion)\n\t{\n\t\tif(root == null)\n\t\t\treturn;\n\t\t\n\t\tSystem.out.print(root.data + \" \");\n\t\tpreOrderPrint(root.left, true);\n\t\tpreOrderPrint(root.right, true);\n\t}", "private void postorderHelper(TreeNode<T> node){\n\n if (node == null)\n return;\n\n postorderHelper(node.leftNode);\n postorderHelper(node.rightNode);\n System.out.printf(\"%s \", node.data);\n }", "public void postOrder2(BinaryTreeNode root) {\n\t\tBinaryTreeNode cur = root;\n\t\tBinaryTreeNode pre = root;\n\t\tStack<BinaryTreeNode> s = new Stack<BinaryTreeNode>();\n\n\t\tif (root != null)\n\t\t\ts.push(root);\n\n\t\twhile (!s.isEmpty()) {\n\t\t\tcur = s.peek();\n\t\t\t// traversing down the tree\n\t\t\tif (cur == pre || cur == pre.getLeft() || cur == pre.getRight()) {\n\t\t\t\tif (cur.getLeft() != null) {\n\t\t\t\t\ts.push(cur.getLeft());\n\t\t\t\t} else if (cur.getRight() != null) {\n\t\t\t\t\ts.push(cur.getRight());\n\t\t\t\t}\n\t\t\t\tif (cur.getLeft() == null && cur.getRight() == null) {\n\t\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// traversing up the tree from the left\n\t\t\telse if (pre == cur.getLeft()) {\n\t\t\t\tif (cur.getRight() != null) {\n\t\t\t\t\ts.push(cur.getRight());\n\t\t\t\t} else if (cur.getRight() == null) {\n\t\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// we are traversing up the tree from the right\n\t\t\telse if (pre == cur.getRight()) {\n\t\t\t\tSystem.out.print(s.pop().getData() + \" \");\n\t\t\t}\n\t\t\tpre = cur;\n\t\t}\n\t}", "public void postOrder(Node localRoot)\r\n\t{\r\n\t\tif(localRoot != null)\r\n\t\t{\r\n\t\t\tpostOrder(localRoot.leftChild);\r\n\t\t\tpostOrder(localRoot.rightChild);\r\n\t\t\tSystem.out.print(localRoot.data+ \" \");\r\n\t\t}\r\n\t}", "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 void printIterativePostOrderTraversal() {\r\n\t\tprintIterativePostOrderTraversal(rootNode);\r\n\t}", "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}", "private void postOrder(Node<T> node){\n if(node != null){\n postOrder(node.left);\n postOrder(node.right);\n System.out.print(node.data + \" ,\");\n }\n }", "public void postorder()\r\n {\r\n postorder(root);\r\n }", "void printLevelOrder(Node root)\n {\n int h = height(root);\n int i;\n for (i=1; i<=h; i++)\n printGivenLevel(root, i);\n }", "public void levelOrder(){\n if(root == null)\n return;\n\n // Take a queue and enqueue root and null\n // every level ending is signified by null\n // since there is just one node at root we enqueue root as well as null\n Queue<Node<T>> queue = new LinkedList<>();\n queue.add(root);\n queue.add(null);\n\n \n while(queue.size() != 0){\n \n Node<T> node = queue.remove();\n // If the node is not null print it and enqueue its left and right child \n // if they exist\n if(node != null){\n System.out.print(node.data + \" ,\");\n if(node.left != null)\n queue.add(node.left);\n if(node.right != null)\n queue.add(node.right);\n }else{\n // We have reached a new level \n // Check is queue is empty, if yes then we are done \n // otherwise print a new line and enqueue a new null for next level\n System.out.println();\n if(queue.size() == 0)\n break;\n queue.add(null);\n }\n }\n }", "public static void createTreeFromTraversals() {\n int[] preorder = {9, 2, 1, 0, 5, 3, 4, 6, 7, 8};\n int[] inorder = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};\n Tree tree = new Tree();\n tree.head = recur(preorder, inorder, 0, 0, inorder.length-1);\n tree.printPreOrder();\n System.out.println();\n tree.printInOrder();\n System.out.println();\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}", "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}", "public void preOrderTraversal(TreeNode<T> root) {\n\t\tif (null == root) {\n\t\t\treturn;\n\t\t} else {\n\t\t\tSystem.out.println(root);\n\t\t\tpreOrderTraversal(root.getLeftChild());\n\t\t\tpreOrderTraversal(root.getRightChild());\n\t\t}\n\t}", "public void preorder()\n {\n preorder(root);\n }", "public void preorder()\n {\n preorder(root);\n }", "private void preOrder(Node root) {\r\n\r\n\t\tif (root == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (preOrderCount < 20) {\r\n\r\n\t\t\tSystem.out.print(\"< \" + root.getData() + \" > \");\r\n\t\t\t//System.out.println(\" Count: \" + preOrderCount);\r\n\t\t\tpreOrderCount++;\r\n\t\t\tpreOrder(root.getlChild());\r\n\t\t\tpreOrder(root.getrChild());\r\n\t\t}\r\n\r\n\t}", "public void levelOrderTraversal(TreeNode root){\n int height = height(root);\n for(int i = 0; i <=height; i++){\n System.out.println();\n printNodesInLevel(root,i);\n }\n }" ]
[ "0.72256154", "0.71152663", "0.70988077", "0.7082171", "0.706359", "0.7053201", "0.7027289", "0.69949937", "0.6989513", "0.6954887", "0.6954143", "0.6951313", "0.6949899", "0.6934333", "0.69132876", "0.69029707", "0.6888737", "0.6886424", "0.6884645", "0.68754816", "0.68704754", "0.68647516", "0.6864687", "0.6853891", "0.6853891", "0.68510336", "0.68421215", "0.6835871", "0.6833111", "0.68275094", "0.68241227", "0.68218446", "0.6820245", "0.681573", "0.68030065", "0.6766793", "0.67646986", "0.67529994", "0.672819", "0.67174554", "0.67086214", "0.6706635", "0.67022294", "0.6687065", "0.6682346", "0.6675057", "0.66745156", "0.6674178", "0.6665318", "0.6651849", "0.664473", "0.6644597", "0.66436005", "0.6619433", "0.66183203", "0.660226", "0.6602081", "0.66007644", "0.65961283", "0.65897286", "0.6589629", "0.65862286", "0.657772", "0.65715593", "0.6560006", "0.65563726", "0.65530634", "0.65431327", "0.65426", "0.65384245", "0.65381837", "0.65242565", "0.651509", "0.65124273", "0.6503749", "0.6493082", "0.6490868", "0.6485112", "0.64802366", "0.6476567", "0.6471789", "0.64548326", "0.6431941", "0.6423123", "0.64221185", "0.6410555", "0.639731", "0.6396468", "0.63950616", "0.6385159", "0.63825405", "0.63696635", "0.6359386", "0.6357441", "0.6354891", "0.63522905", "0.6347053", "0.63263136", "0.63263136", "0.63209414", "0.6318954" ]
0.0
-1
if (!check(comStr,c1,c2)) return 0;
int findExistNum(int N, char c1, char c2, String comStr) { String n1Str = findNth(c1, c2, comStr,1); int curn1 = findSubstr(n1Str, comStr); return findG(N,c1,c2,comStr,curn1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean checkChar(String s1, String s2);", "String[] checkIfLegalCommand(String strToChck);", "@Test\n public void testComp2()\n {\n System.out.println(\"comp\");\n String compString = \"D+M\";\n assertEquals(\"1000010\", N2TCode.comp(compString));\n }", "@Test\n public void testComp1()\n {\n System.out.println(\"comp\");\n String compString = \"A+1\";\n assertEquals(\"0110111\", N2TCode.comp(compString));\n }", "void mo13161c(String str, String str2);", "int mo54403a(String str, String str2);", "public abstract boolean mo70720c(String str);", "int mo23353w(String str, String str2);", "int mo23352v(String str, String str2);", "static int type_of_cc(String passed){\n\t\treturn 1;\n\t}", "final void checkForComodification() {\n\t}", "static void perform_cnc(String passed){\n\t\tint type = type_of_cnc(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcall_when_no_carry(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "int mo23347d(String str, String str2);", "void mo9699a(String str, String str2, boolean z);", "static int type_of_cnc(String passed){\n\t\treturn 1;\n\t}", "public abstract String check() throws Exception;", "boolean hasCsStr();", "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\n\tpublic void secindForInputChecker() {\n\t\tchar charTest = 'c';\n\t\tboolean result = false;\n\t\ttry {\n\t\t\tresult = object1.inputChecker(charTest);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tboolean ExpectedResult = true;\n\t\tassertEquals(ExpectedResult, result);\n\n\t}", "int mo23351i(String str, String str2);", "@Test\r\n public void testEqualChars(){\r\n boolean res1=offByOne.equalChars('c','b');\r\n assertTrue(\"should be true\",res1);\r\n boolean res2=offByOne.equalChars('a','c');\r\n assertFalse(\"should be false\",res2);\r\n }", "public boolean checkPermutaionOfStr(String str1, String str2){\n\tArrayList<Integer> word_cnt1 = new ArrayList<Integer>();\n\tArrayList<Integer> word_cnt2 = new ArrayList<Integer>();\n\t\n\tif(str1.length() != str2.length())\n\t\treturn false;\n\tfor(int i = 0; i< 256; i++){\n\t\tword_cnt1.add(0);\n\t\tword_cnt2.add(0);\n\t}\n\t\n\tfor(int i = 0; i< str1.length(); i++){\n\t\tcntStrChar(str1, word_cnt1, i);\n\t\tcntStrChar(str2, word_cnt2, i);\n\t}\n\t\n\tfor(int i = 0; i< 256; i++){\n\t\tif (word_cnt1.get(i) != word_cnt2.get(i) )\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "public static boolean timingSafeEquals(String first, String second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n char[] firstChars = first.toCharArray();\n char[] secondChars = second.toCharArray();\n char result = (char) ((firstChars.length == secondChars.length) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstChars.length; ++i) {\n result |= firstChars[i] ^ secondChars[j];\n j = (j + 1) % secondChars.length;\n }\n return result == 0;\n }", "private boolean m81840a(String str, String str2) {\n boolean isEmpty = TextUtils.isEmpty(str);\n boolean isEmpty2 = TextUtils.isEmpty(str2);\n if (isEmpty && isEmpty2) {\n return true;\n }\n if (!isEmpty && isEmpty2) {\n return false;\n }\n if (!isEmpty || isEmpty2) {\n return str.equals(str2);\n }\n return false;\n }", "@Test\n\tvoid testCheckString2() {\n\t\tassertFalse(DataChecker.checkString(\"\"));\n\t}", "void mo1329d(String str, String str2);", "void mo131986a(String str, String str2);", "static int type_of_cnz(String passed){\n\t\treturn 1;\n\t}", "public static void main(String[] args) {\n\r\n\t\tString s1=\"abcd\";\r\n\t\tString s2=\"vbvabcdqwe\";\r\n\t\tchar arr1[]=s1.toCharArray();\r\n\t\tchar arr2[]=s2.toCharArray();\r\n\r\n\t\tint flag=0;\r\n\t\tfor(int i=0;i<arr1.length;i++)\r\n\t\t{\r\n\t\t\tfor(int j=i;j<arr2.length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(arr1[i]==arr2[j])\r\n\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}\r\n\t\t}\r\n\t\t\r\n\t}", "public abstract boolean mo53567k(int i, int i2, String str);", "public abstract boolean mo70724g(String str);", "public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc=new Scanner(System.in);\n\t\tString str1=sc.nextLine();\n\t\tString str2=sc.nextLine();\n\t\tstr1=str1.toLowerCase();\n\t\tstr2=str2.toLowerCase();\n\t\tif(str1.length()!=str2.length()){\n\t\tSystem.out.println(\"no\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tboolean flg=true;\n\t\tfor(int i=0; i<str1.length();i++){\n\t\t\tif(str1.charAt(i)!=str2.charAt(i)){\n\t\t\t\tflg=false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(flg){\n\t\t\tSystem.out.println(\"yes\");\n\t\t}\n\t\telse{\n\t\t\tSystem.out.println(\"no\");\n\t\t}\n\n\t}", "static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }", "void mo1886a(String str, String str2);", "@Test\n public void testEqualChars2() {\n char a = 'a';\n char b = 'b';\n char c = '1';\n char d = '2';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertTrue(result1);\n assertTrue(result2);\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString a=sc.nextLine();\r\nString b=sc.nextLine();\r\nchar ch1[]=a.toCharArray();\r\nchar ch2[]=b.toCharArray();\r\nint l1=ch1.length;\r\nint l2=ch2.length;\r\nint n=0;\r\nif(l1==l2)\r\n{\r\n\tfor(int i=0;i<l1;i++)\r\n\t{\r\n\t\tif(ch1[i]!=ch2[i])\r\n\t\t{\r\n\t\t\tn=n+1;\r\n\t\t}\r\n\t}\r\n\tif(n==1)\r\n\t\tSystem.out.println(\"yes\");\r\n\telse\r\n\t\tSystem.out.println(\"no\");\r\n}\r\nelse\r\n\tSystem.out.println(\"no\");\r\n\t}", "@Test\n\tpublic void forInputChecker() {\n\t\tchar charTest = 'c';\n\t\tboolean result = false;\n\t\ttry {\n\t\t\tresult = object1.inputChecker(charTest);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tboolean ExpectedResult = true;\n\t\tassertEquals(ExpectedResult, result);\n\n\t}", "private boolean checkInCashe(String s) {\n return true;\n }", "String mo3176a(String str, String str2);", "int mo23349e(String str, String str2);", "private boolean translateWith2ExchangedChars(String input1, String input2) {\n if (StringUtils.isBlank(input1) || StringUtils.isBlank(input2) || input1.length() != input2.length()) {\n return false;\n }\n if (input1.equals(input2)) {\n for (int i = 0; i < input1.length(); i++) {\n char current = input1.charAt(i);\n if (input1.lastIndexOf(current) != i) {\n return true;\n }\n }\n return false;\n } else {\n int first = -1, second = -1;\n for (int i = 0; i < input1.length(); i++) {\n if (input1.charAt(i) != input2.charAt(i)) {\n if (first == -1) {\n first = i;\n } else if (second == -1) {\n second = i;\n } else {\n return false;\n }\n }\n }\n return input1.charAt(first) == input2.charAt(second)\n && input1.charAt(second) == input2.charAt(first);\n }\n }", "int lcs(int x, int y, string s1, string s2,int[][] str){\n \n if(text1.length()==0||text2.length()==0) {\n return 0;\n }\n \n if(str[x][y]!=0) {\n return str[x][y];\n }\n \n int ans =0;\n \n if(text1.charAt(0)== text2.charAt(0)) {\n \n \n \n ans = 1 + longestCommonSubsequence(x+1,y+1,ros1, ros2,str);\n \n \n }\n else {\n \n int first = longestCommonSubsequence(x,y+1,ros1, text2,str);\n int second = longestCommonSubsequence(x+1,y,text1, ros2,str);\n \n ans = Math.max(first,second);\n \n \n \n }\n \n str[x][y] = ans;\n return ans;\n \n \n \n \n \n}", "void mo1331e(String str, String str2);", "private boolean checkValue(char v1, char v2, char v3){ \r\n\t\treturn ((v1 != '-') && (v1 == v2) && (v2==v3));\r\n\t}", "public boolean compare2StringsIgnoringCasses(String s1, String s2)\r\n {\r\n String a=s1.toLowerCase();\r\n String b=s2.toLowerCase();\r\n if(a.length()!= b.length())\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n for(int i=0; i<a.length(); i++)\r\n {\r\n if(!comparet2Chars(a.charAt(i),b.charAt(i)))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "static void return_not_carry(String passed){\n\t\tif(!CS)\n\t\t\tcomplete_return_requirements();\n\t}", "private boolean checkBoth(String input1, String input2){\r\n\t\tboolean pass=true;\r\n\t\tstart=aptManager.search(input1); //convert input into index\r\n\t\tdestn=aptManager.search(input2); //^^^\r\n\t\tif(start<0 && destn<0){//check if start and destination is valid\r\n\t\t\tJOptionPane.showMessageDialog(this,\"CANNOT IDENTIFY THE STARTING AIRPORT AND DESTINATION AIRPORT\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(destn<0){\r\n\t\t\tJOptionPane.showMessageDialog(this,\"CANNOT IDENTIFY THE DESTINATION AIRPORT\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse if(start<0){\r\n\t\t\tJOptionPane.showMessageDialog(this,\"CANNOT IDENTIFY THE STARTING AIRPORT\");\r\n\t\t\treturn false;\r\n\t\t}\r\n \t\telse if(start==destn){ //check if start and destination is same\r\n \t\t\tJOptionPane.showMessageDialog(this,\"THE STARTING AIRPORT AND DESTINATION AIRPORT CANNOT BE THE SAME\");\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\telse if(!multiDestn.isEmpty()){\r\n \t\t\tif(destn==multiDestn.get(0)){ //if multiple destination exist, check if destination 1 and destination 2 is same\r\n \t\t\t\t\tJOptionPane.showMessageDialog(this,\"The Second Destination Airport cannot be the same as its Departing Airport\");\r\n \t\t\t\treturn false;\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn pass;\r\n }", "void mo1340v(String str, String str2);", "public final void mo9215cu(String str, String str2) {\n }", "static void call_when_no_carry(String passed){\n\t\tif(!CS)\n\t\t\tcomplete_call_req(passed.substring(4));\n\t}", "private static boolean equalityTest4(String a, String b)\n {\n if(a.length() == 0 && b.length() == 0)\n {\n return true;\n }\n else\n {\n if(a.length() == 0 || b.length() == 0)\n {\n return false;\n }\n if(a.charAt(0) == b.charAt(0))\n {\n return equalityTest4(a.substring(1), b.substring(1));\n }\n else\n {\n return false;\n }\n }\n }", "public abstract void mo70711a(String str, String str2);", "static void jump_when_carry_not(String passed){\n\t\tif(!CS)\n\t\t\tcomplete_jump_req(passed.substring(4));\n\t}", "public abstract boolean mo70721d(String str);", "public final void mo9212cr(String str, String str2) {\n }", "public boolean test(String a, String b)\n\t{\n\t\treturn false;\n\t}", "static String twoStrings(String s1, String s2) {\n String bigstr = s1.length() > s2.length() ? s1 : s2;\n String smallstr = s1.length() > s2.length() ? s2 : s1;\n int bigstrSize = bigstr.length();\n int smallstrSize = smallstr.length();\n\n boolean string_check[] = new boolean[1000];\n\n for (int i = 0; i < bigstrSize; i++) {\n string_check[bigstr.charAt(i) - 'A'] = true;\n }\n // if at least one char is present in boolean array\n for (int i = 0; i < smallstrSize; i++) {\n if (string_check[smallstr.charAt(i) - 'A'] == true) {\n return \"YES\";\n }\n }\n return \"NO\";\n }", "public abstract void mo70715b(String str, String str2);", "void mo29850a(zzxz zzxz, String str, String str2) throws RemoteException;", "static void perform_cnz(String passed){\n\t\tint type = type_of_cnz(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcall_when_not_zero(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "static void perform_cc(String passed){\n\t\tint type = type_of_cc(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcall_when_carry(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "public static String contains(String input1, String input2){\n\t\tif((input1 == null && input2 ==null)){\n\t\t\treturn \"yes\";\n\t\t}else if (input1 == null || input2 == null){\n\t\t\treturn \"no\";\n\t\t}\n\t\tchar []input1Arr = input1.toCharArray();\n\t\tchar []input2Arr = input2.toCharArray();\n\t\tint []charMap = new int [256];\n\t\tfor (char ch:input1Arr){\n\t\t\tcharMap[ch] ++;\n\t\t}\n\t\tfor (char ch:input2Arr){\n\t\t\tif(charMap[ch]>=1){\n\t\t\t\tcharMap[ch]--;\n\t\t\t}else {\n\t\t\t\treturn \"no\";\n\t\t\t}\n\t\t}\n\t\treturn \"yes\";\n\t}", "static boolean equal (String s1, String s2) {\r\n if (s1==errorSignature) return true;\r\n if (s2==errorSignature) return true;\r\n if (s1==null || s1.length()==0)\r\n return s2==null || s2.length()==0;\r\n return s1.equals (s2);\r\n }", "static int size_of_cnc(String passed){\n\t\treturn 3;\n\t}", "public boolean isCorrect(String str);", "@Test\n public void testEqualChars1() {\n char a = 'a';\n char b = 'a';\n char c = 'z';\n char d = 'B';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(a, c);\n boolean result3 = offByOne.equalChars(a, d);\n\n assertFalse(result1);\n assertFalse(result2);\n assertFalse(result3);\n }", "static int size_of_cc(String passed){\n\t\treturn 3;\n\t}", "ResultData mo24177a(String str, String str2) throws Exception;", "void mo1342w(String str, String str2);", "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}", "static void call_when_carry(String passed){\n\t\tif(CS)\n\t\t\tcomplete_call_req(passed.substring(3));\n\t}", "void mo1582a(String str, C1329do c1329do);", "void check();", "void check();", "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 public void testEqualChar3() {\n char a = '%';\n char b = '!';\n char c = '\\t';\n char d = '\\n';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertFalse(result1);\n assertTrue(result2);\n }", "public Boolean checkConformance(AbstractSymbol C1, AbstractSymbol C2) {\n \tif ( C1 == C2 ) {\n \t\treturn true;\n \t}\n \t// Check for a path from C2 to reach C1\n \treturn isReachable(C1.getString(), C2.getString());\n }", "private static int coutSubst(char c1, char c2)\n {\n if (c1 == c2) return 0;\n return 1;\n }", "private static boolean validateInput2(String[] input) {\n\t\tif (input.length != 2) {\n\t\t\tSystem.out.println(ErrorType.UNKNOWN_COMMAND);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n\tvoid testCheckString1() {\n\t\tassertTrue(DataChecker.checkString(\"Test\"));\n\t}", "private void check2(){\n \n // All methods past the first rule check to see\n // if errorCode is still 0 or not; if not skips respective method\n if(errorCode == 0){\n \n if (!(fourthDigit == fifthDigit + 1)){\n valid = false;\n errorCode = 2;\n }\n }\n\t}", "public static boolean timingSafeEquals(CharSequence first, CharSequence second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n int firstLength = first.length();\n int secondLength = second.length();\n char result = (char) ((firstLength == secondLength) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstLength; ++i) {\n result |= first.charAt(i) ^ second.charAt(j);\n j = (j + 1) % secondLength;\n }\n return result == 0;\n }", "public boolean checkInvalid2(String x) {\n for (int i = 0; i < x.length(); i++) {\n if (consonants.contains(String.valueOf(x.charAt(i)))) {\n count++;\n }\n }\n return count == x.length();\n\n }", "void mo8715r(String str, String str2, String str3);", "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 }", "static int lcs(int p, int q, String s1, String s2){\n int [][]t=new int[p+1][q+1];\n for(int i=0;i<p+1;i++){\n for(int j=0;j<q+1;j++){\n if(i==0||j==0){\n t[i][j]=0;\n }\n }\n }\n for(int i=1;i<p+1;i++){\n for(int j=1;j<q+1;j++){\n if(s1.charAt(i-1)==s2.charAt(j-1)){\n t[i][j]=1+t[i-1][j-1];\n }\n else{\n t[i][j]=Math.max(t[i-1][j],t[i][j-1]);\n }\n }\n }\n return t[p][q];\n }", "public static void main(String[] args) {\n\t\tString s = \"ssss\";\n\t\tint count = 0;\n\t\t\n\t\tfor(int i = 0; i < s.length();i++) {\n\t\t\tchar a = s.charAt(i);\n\t\t\tfor(int j = 0; j<s.length();j++) {\n\t\t\t\tif(s.charAt(j) == a && j!=i) {\n\t\t\t\t\tSystem.out.println(\"Invalid\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcount = count + 1;\n\t\t}\n\t\tif(count == s.length()) {\n\t\t\tSystem.out.println(\"Valid\");\n\t\t}\n\t}", "static Boolean isOneAway(String s1, String s2) {\r\n\t\tboolean results = false;\r\n\t\tchar[] chars1 = s1.toCharArray();\r\n\t\tchar[] chars2 = s2.toCharArray();\r\n\t\tif(s1.equals(s2)) {\r\n\t\t\tresults = true;\r\n\t\t}else if(chars1.length==chars2.length) {\r\n\t\t\tint mismatches = 0;\r\n\t\t\tfor(int i = 0; i < chars1.length; i++ ) {\r\n\t\t\t\tif(chars1[i]!=chars2[i]) {\r\n\t\t\t\t\tmismatches++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(mismatches <= 1) results = true;\r\n\t\t}else if(Math.abs(s1.length() - s2.length())==1) {\r\n\t\t\tif(s1.length() > s2.length()) {\r\n\t\t\t\tchars1 = s1.toCharArray();\r\n\t\t\t\tchars2 = s2.toCharArray();\r\n\t\t\t}else {\r\n\t\t\t\tchars1 = s2.toCharArray();\r\n\t\t\t\tchars2 = s1.toCharArray();\r\n\t\t\t}\r\n\t\t\tint mismatches = 0;\r\n\t\t\tint cursor1 = 0;\r\n\t\t\tint cursor2 = 0;\r\n\t\t\twhile((cursor1 < chars1.length) && (cursor2 < chars2.length)) {\r\n\t\t\t\tif(chars1[cursor1] != chars2[cursor2]) {\r\n\t\t\t\t\tmismatches++;\r\n\t\t\t\t\tcursor1++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tcursor1++;\r\n\t\t\t\t\tcursor2++;\r\n\t\t\t\t}\t\t\t\t \r\n\t\t\t}\r\n\t\t\tif(mismatches <= 1) results = true;\r\n\t\t}else {\r\n\t\t\tresults = false;\r\n\t\t}\r\n\t\r\n\t\treturn results;\r\n\t}", "static void return_when_carry(String passed){\n\t\tif(CS)\n\t\t\tcomplete_return_requirements();\n\t}", "public int countAbc(String str) {\n//Solution to problem coming soon\n}", "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 Boolean stringScramble(String str1, String str2) {\n // code goes here\n return null;\n }", "static void cmp_with_reg(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tS = val1>=val2?false:true;\n\t\tval2 = 256-val2;\n\t\tval2%=256;\n\t\tval1+=val2;\n\t\tCS = val1>255?true:false;\n\t\tString b = Integer.toBinaryString(val1);\n\t\tint ones=0;\n\t\tfor(int i=0;i<b.length();i++)\n\t\t\tif(b.charAt(i)=='1')\n\t\t\t\tones++;\n\t\tZ = ones==0?true:false;\n\t\tP = ones%2==0?true:false;\n\t}", "public final void mo9214ct(String str, String str2) {\n }", "@Test\n\tvoid testCheckString3() {\n\t\tassertFalse(DataChecker.checkString(null));\n\t}", "public abstract boolean mo70717b(String str);", "void mo303a(C0237a c0237a, String str, String str2, String str3);", "private static boolean checkIfCanBreak( String s1, String s2 ) {\n\n if (s1.length() != s2.length())\n return false;\n\n Map<Character, Integer> map = new HashMap<>();\n for (Character ch : s2.toCharArray()) {\n map.put(ch, map.getOrDefault(ch, 0) + 1);\n }\n\n for (Character ch : s1.toCharArray()) {\n\n char c = ch;\n while ((int) (c) <= 122 && !map.containsKey(c)) {\n c++;\n }\n\n if (map.containsKey(c)) {\n map.put(c, map.getOrDefault(c, 0) - 1);\n\n if (map.get(c) <= 0)\n map.remove(c);\n }\n }\n\n return map.size() == 0;\n }", "public boolean checkPalindromeFormation(String a, String b) {\n int n = a.length();\n return findCommonSubstring(a.toCharArray(), b.toCharArray(), 0, n - 1) ||\n findCommonSubstring(b.toCharArray(), a.toCharArray(), 0, n - 1);\n }", "static int check2(int r, int c) {\r\n\t\tint result = 0;\r\n\t\tString local = \"\";\r\n\t\t// case 1 col++\r\n\t\tif (A[r][c] == 1 && A[r][(c + 1) % 4] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"A'B'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"A'B\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"AB\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"AB'\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"C'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"D\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"C\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"D'\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t\tchecked[r][(c + 1) % 4] = 1;\r\n\r\n\t\t} else\r\n\t\t// case 2 col--\r\n\t\tif (A[r][(4 + (c - 1)) % 4] == 1 && A[r][c] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"A'B'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"A'B\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"AB\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"AB'\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"D'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"C'\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"D\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"C\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][(4 + (c - 1)) % 4] = 1;\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t} else\r\n\t\t// case3 row++\r\n\t\tif (A[r][c] == 1 && A[(r + 1) % 4][c] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"A'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"B\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"A\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"B'\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"C'D'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"C'D\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"CD\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"CD'\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t\tchecked[(r + 1) % 4][c] = 1;\r\n\t\t} else\r\n\t\t// case4 row--\r\n\t\tif (A[r][c] == 1 && A[(4 + (r - 1)) % 4][c] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"B'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"A'\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"B\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"A\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"C'D'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"C'D\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"CD\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"CD'\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t\tchecked[(4 + (r - 1)) % 4][c] = 1;\r\n\t\t}\r\n\t\treturn result;\r\n\t}" ]
[ "0.67224276", "0.6544234", "0.6364199", "0.6361345", "0.6351476", "0.6229207", "0.6165539", "0.61294925", "0.609434", "0.6059725", "0.60149086", "0.59964395", "0.5986936", "0.5972155", "0.5969813", "0.5958436", "0.59559685", "0.5946269", "0.59359014", "0.5919022", "0.5905584", "0.58937824", "0.5844057", "0.5841409", "0.58407915", "0.5814765", "0.5799158", "0.57968426", "0.57772386", "0.5776243", "0.57747847", "0.5761244", "0.5756867", "0.57490236", "0.57472944", "0.5746965", "0.57393193", "0.5738414", "0.5738312", "0.5724039", "0.5718585", "0.571445", "0.571401", "0.56995857", "0.5698642", "0.5695053", "0.56936914", "0.56884044", "0.568377", "0.56741005", "0.5666442", "0.5666068", "0.566133", "0.5659671", "0.5658113", "0.56489116", "0.5645118", "0.56422985", "0.5640828", "0.56366557", "0.562515", "0.5610345", "0.56010836", "0.5599172", "0.5586637", "0.5583418", "0.55755156", "0.5574933", "0.5574502", "0.5573535", "0.5567957", "0.55618614", "0.55610156", "0.55610156", "0.5556595", "0.55556655", "0.5538449", "0.5537392", "0.5536083", "0.5530166", "0.55273306", "0.5523062", "0.552007", "0.55182123", "0.5516641", "0.55079055", "0.5495992", "0.5492452", "0.54867506", "0.5485925", "0.5483412", "0.5474733", "0.547461", "0.5468948", "0.54658353", "0.5464622", "0.54600513", "0.5457833", "0.54472256", "0.5442531" ]
0.5823517
25
CHANGE PATH TO YOU CHROME DRIVER
@Test public void test1() { FirefoxBinary binary = new FirefoxBinary(new File(FIREFOX_PATH)); driver = TestBench.createDriver( new FirefoxDriver(binary, new FirefoxProfile())); setDriver(driver); getDriver().get(URL); ButtonElement button = $(ButtonElement.class).first(); button.click(); LabelElement label = $(LabelElement.class).id("result"); Assert.assertEquals("Thanks , it works!",label.getText()); driver.quit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setChromeDriverProperty() {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\automation_new_code\\\\onfs.alip.accounting\\\\BrowserDriver/chromedriver.exe\");\n\t\t}", "public static void ChromeExePathSetUp() {\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \r\n\t\t\t\t\"D:\\\\VisionITWorkspace\\\\dependencies\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\tReporter.log(\"Chrome Exe path Set up\", true);\r\n\t}", "public static void setChromeDriverDownloadPath(String path)\n\t{\n\t\tApplicationProperties appProperties = p6web.getInstance();\n\t\t\n\ttry{\n\t\t\n\t\tm_driver = ApplicationProperties.getInstance().getDriver();\n\t\tm_driver.get(\"chrome://settings/advanced\");\n JavascriptExecutor js = (JavascriptExecutor) m_driver;\n String prefId = \"download.default_directory\";\n File tempDir=new File(System.getProperty(\"user.dir\")+path);\n if (m_driver.findElements(By.xpath(String.format(\".//input[@pref='%s']\", prefId))).size() == 0) {\n \tm_driver.get(\"chrome://settings-frame\");\n \tm_driver.findElement(By.xpath(\".//button[@id='advanced-settings-expander']\")).click(); }\n String tmpDirEscapedPath = tempDir.getCanonicalPath().replace(\"\\\\\", \"\\\\\\\\\");\n js.executeScript(String.format(\"Preferences.setStringPref('%s', '%s', true)\", prefId,\n tmpDirEscapedPath));\n\t\t}\n\t\n\t\tcatch(IOException e){\n\t\t\t\n\t\t}\n\t\n\t\tm_driver.get(appProperties.getUrl());\n\t\n\t}", "public void setChromeDriver(){\n System.setProperty(\"webdriver.chrome.driver\", browserDriverPath);\n seleniumDriver = new ChromeDriver();\n }", "public static void setSystemPropertyChromeWebDriverOriginal() {\n\t\tString fullPath = getFullPathToSrcTestResourceFolder();\n\t\t\n\t\tString os = getOperationalSystemName();\n\t\t\n\t\tString chromeDriver = CHROME_DRIVER_WINDOWS;\n\t\tif ( os.equals(OS_MAC_OS_X) ) {\n\t\t\tchromeDriver = CHROME_DRIVER_MAC;\n\t\t}\n\t\t\n\t\tSystem.setProperty(\n\t\t\tWEBDRIVER_CHROME_DRIVER, \n\t\t\tfullPath + chromeDriver);\n\t}", "public static void startChromeDriver() {\r\n\t\tswitch (operatingSystem.toLowerCase().split(\" \")[0]) {\r\n\t\tcase \"windows\":\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src//main//resources//drivers//chromedriver.exe\");\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"linux\":\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src//main//resources//drivers//chromedriverLinux\");\r\n\t\t\tbreak;\r\n\r\n\t\tcase \"mac\":\r\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src//main//resources//drivers//chromedriverMac\");\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tSystem.out.println(\"Operating system not supported.\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "private void setDriverPathForBrowser(String browserName) {\n \t\n \tif ( !binariesPath.exists() ) throw new IllegalStateException(\"No path at \" + binariesPath.getAbsolutePath() );\n \t\n switch (browserName.toLowerCase()) {\n case \"firefox\":\n {\n if (isMac())\n {\n System.setProperty(\"webdriver.gecko.driver\", new File(binariesPath,\"/MAC/geckodriver-v0.19.0-macos.tar.gz/geckodriver-v0.19.0-macos.tar\").getAbsolutePath());\n }\n else if (isLinux())\n {\n System.setProperty(\"webdriver.gecko.driver\", new File(binariesPath, \"/Ubuntu/geckodriver\").getAbsolutePath());\n }\n else\n {\n System.setProperty(\"webdriver.gecko.driver\", new File(binariesPath, \"/Windows/geckodriver.exe\").getAbsolutePath());\n }\n break;\n }\n case \"chrome\": {\n if (isMac()) {\n System.setProperty(\"webdriver.chrome.driver\", new File(binariesPath, \"/MAC/chromedriver\").getAbsolutePath());\n } else if (isLinux()) {\n System.setProperty(\"webdriver.chrome.driver\",new File(binariesPath, \"/Ubuntu/chromedriver\").getAbsolutePath());\n } else {\n System.setProperty(\"webdriver.chrome.driver\",new File(binariesPath,\"/Windows/chromedriver.exe\").getAbsolutePath());\n }\n break;\n }\n case \"ie\":\n System.setProperty(\"webdriver.ie.driver\", new File(binariesPath,\"/Windows/IEDriverServer.exe\").getAbsolutePath());\n }\n }", "private void setChromeDriver() throws Exception {\n\t\t// boolean headless = false;\n\t\tHashMap<String, Object> chromePrefs = new HashMap<String, Object>();\n\t\tchromePrefs.put(\"profile.default_content_settings.popups\", 0);\n\t\tchromePrefs.put(\"download.default_directory\", BasePage.myTempDownloadsFolder);\n\t\tchromeOptions.setExperimentalOption(\"prefs\", chromePrefs);\n\t\t// TODO: Using \"C:\" will not work for Linux or OS X\n\t\tFile dir = new File(BasePage.myTempDownloadsFolder);\n\t\tif (!dir.exists()) {\n\t\t\tdir.mkdir();\n\t\t}\n\n\t\tchromeOptions.addArguments(\"disable-popup-blocking\");\n\t\tchromeOptions.addArguments(\"--disable-extensions\");\n\t\tchromeOptions.addArguments(\"start-maximized\");\n\n\t\t/*\n\t\t * To set headless mode for chrome. Would need to make it conditional\n\t\t * from browser parameter Does not currently work for all tests.\n\t\t */\n\t\t// chromeOptions.setHeadless(true);\n\n\t\tif (runLocation.toLowerCase().equals(\"smartbear\")) {\n\t\t\tReporter.log(\"-- SMARTBEAR: standard capabilities. Not ChromeOptions\", true);\n\t\t\tcapabilities = new DesiredCapabilities();\n\t\t} else {\n\t\t\tcapabilities = DesiredCapabilities.chrome();\n\t\t\tcapabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);\n\t\t}\n\n\t\tWebDriver myDriver = null;\n\t\tRemoteWebDriver rcDriver;\n\n\t\tswitch (runLocation.toLowerCase()) {\n\t\tcase \"local\":\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriverLocation);\n\t\t\tmyDriver = new ChromeDriver(chromeOptions);\n\t\t\tbreak;\n\t\tcase \"grid\":\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), capabilities);\n\t\t\trcDriver.setFileDetector(new LocalFileDetector());\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"testingbot\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultChromeVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\t// capabilities.setCapability(\"name\", testName); // TODO: set a test\n\t\t\t// name (suite name maybe) or combined with env\n\t\t\trcDriver = new RemoteWebDriver(new URL(serverURL), capabilities);\n\t\t\tmyDriver = new Augmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tcase \"smartbear\":\n\t\t\tif (browserVersion.isEmpty()) {\n\t\t\t\tbrowserVersion = defaultChromeVersion;\n\t\t\t}\n\t\t\tif (platformOS.isEmpty()) {\n\t\t\t\tplatformOS = defaultPlatformOS;\n\t\t\t}\n\t\t\t \n\t\t\t//capabilities.setCapability(\"name\", testMethod.get());\n\t\t\tcapabilities.setCapability(\"build\", testProperties.getString(TEST_ENV)+\" Chrome-\"+platformOS);\n\t\t\tcapabilities.setCapability(\"max_duration\", smartBearDefaultTimeout);\n\t\t\tcapabilities.setCapability(\"browserName\", browser);\n\t\t\tcapabilities.setCapability(\"version\", browserVersion);\n\t\t\tcapabilities.setCapability(\"platform\", platformOS);\n\t\t\tcapabilities.setCapability(\"screenResolution\", smartBearScreenRes);\n\t\t\tcapabilities.setCapability(\"record_video\", \"true\"); Reporter.log(\n\t\t\t\t\t \"BROWSER: \" + browser, true); Reporter.log(\"BROWSER Version: \" +\n\t\t\t\t\t\t\t browserVersion, true); Reporter.log(\"PLATFORM: \" + platformOS, true);\n\t\t\tReporter.log(\"URL '\" + serverURL + \"'\", true); rcDriver = new\n\t\t\tRemoteWebDriver(new URL(serverURL), capabilities); myDriver = new\n\t\t\tAugmenter().augment(rcDriver);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromeDriverLocation);\n\t\t\tmyDriver = new ChromeDriver(chromeOptions);\n\t\t\tbreak;\n\t\t}\n\t\tdriver.set(myDriver);\n\t}", "public Selenium(String chromePath) {\n this.browserDriverPath = chromePath; \n }", "@ BeforeTest \n\tpublic void Amazon() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",System.getProperty(\"user.dir\")+\"\\\\resources\\\\chromedriver.exe\"); // to make the path portable create folder reources and put the element to it \n\t\tdriver = new ChromeDriver();\n\t\tdriver.get(\"https://www.amazon.com/\");\n\t\tSystem.out.println(driver.getCurrentUrl());\t\n\t\tdriver.manage().window().maximize();\n\n}", "public void chromeLaunch() {\n\t\tSystem.setProperty(key, value);\n\t\ts=new ChromeDriver();\n\t\ts.manage().window().maximize();\n\t\ts.navigate().to(url);\n\t}", "@BeforeTest\r\n public void launchBrowser() {\n System.setProperty(\"webdriver.chrome.driver\", ChromePath);\r\n driver= new ChromeDriver();\r\n driver.manage().window().maximize();\r\n driver.get(titulo);\r\n }", "public static WebDriver chrome()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",System.getProperty(\"user.dir\")+\"\\\\Chrome\\\\chromedriver.exe\");\r\n\t\tgk = new ChromeDriver();\r\n\t\treturn gk;\r\n\t}", "@Test\r\n\tpublic void f()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C://Data_Program//Selenium_Dependencies//chromedriver.exe\");\r\n\t\tWebDriver driver=new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.get(\"http://www.google.com\");\r\n\t}", "@BeforeTest\r\n\tpublic void launch()\r\n\t{\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Yogini\\\\chromedriver\\\\chromedriver.exe\"); //location of browser in local drive\r\n\t\tWebDriver driver = new ChromeDriver(); \r\n\t\tdriver.get(tobj.url);\r\n\t\tSystem.out.println(\"Before test, browser is launched\");\r\n\t}", "public static void main(String[] args) {\n\t\tString current = System.getProperty(\"user.dir\");\n\t\tSystem.out.println(current);\n\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", current + \"\\\\Lib\\\\chromedriver.exe\");\n\n\t\tWebDriver driver = new ChromeDriver(); //open browser\n\t\tdriver.get(\"https://www.google.com\"); //open URL\n\t\ttry {\n\t\t\tThread.sleep(5000); //wait for 5 second\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tdriver.close(); //close browser \n\t}", "@Before\n public void Setup() { //this is done before every test, chrome driver is saved in a specific location\n\n System.setProperty(\"webdriver.chrome.driver\",\n Constant.CROMEDRIVER);\n\n driver = new ChromeDriver();\n }", "public static void main(String[] args) {\n\t\tClass cls = AbsolutePath.class; // These api are coming from java framework\n\t\tClassLoader loader = cls.getClassLoader();\n\t\tURL url = loader.getResource(\"./chromedriver.exe\"); // \". \" represents current working directory \n System.out.println(url.toString()); //chromeedriver gets automatically copied from source to target\n\t}", "@BeforeTest\r\n\tpublic void beforeTest() throws MalformedURLException {\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\PDC2B-Training.pdc2b\\\\Downloads\\\\Selenium Drivers\\\\BrowserDriver\\\\chromedriver_win32\\\\chromedriver.exe\");\r\n\t\tdriver = new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().timeouts().implicitlyWait(5000, TimeUnit.SECONDS);\r\n\t}", "private static WebDriver launchChrome()\n\t{\n\t\tif (REMOTE_URL != null && !REMOTE_URL.equals(\"\")) {\n\t\t\tDesiredCapabilities capabilities = DesiredCapabilities.chrome();\n\t\t\ttry {\n\n\t\t\t\treturn new RemoteWebDriver(new URL(System.getProperty(\"RemoteUrl\")), capabilities);\n\t\t\t}\n\n\n\t\t\tcatch (MalformedURLException e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\telse\n\t\t{\n\t\tURL chromeDriverURL = BrowserDriver.class.getResource(\"/drivers/chromedriver.exe\");\n\t\tFile file = new File(chromeDriverURL.getFile()); \n\t\tSystem.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, file.getAbsolutePath());\n\t\t\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--start-maximized\");\n\t\toptions.addArguments(\"--ignore-certificate-errors\");\n\t\t\n\t\treturn new ChromeDriver(options);\n\t\t}\n\t}", "private void setLocalWebdriver() {\n\n DesiredCapabilities capabilities = new DesiredCapabilities();\n capabilities.setJavascriptEnabled(true);\n capabilities.setCapability(\"handlesAlerts\", true);\n switch (getBrowserId(browser)) {\n case 0:\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n driver.set(new InternetExplorerDriver(capabilities));\n break;\n case 1:\n driver.set(new FirefoxDriver(capabilities));\n break;\n case 2:\n driver.set(new SafariDriver(capabilities));\n break;\n case 3:\n driver.set(new ChromeDriver(capabilities));\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n }", "@Test\r\n\tpublic void launch_browser()\r\n\t{ \r\n\t\t\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C://TESTING TOOLS - SOFTWARES/chromedriver.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\tdriver.get(\"https://www.javatpoint.com/\");\r\n\t\t// remove all cookies\r\n\t\t//driver.manage().deleteAllCookies();\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\t\r\n\t}", "@Given(\"^launch an chrome browser$\")\r\n\tpublic void launch_an_chrome_browser() throws Throwable {\n\t sign.url();\r\n\t\t\r\n\t}", "public static void chromeTest() throws Exception{\n driver = BrowserFactory.getDriver(\"chrome\");\n Thread.sleep(2000);\n\n driver.get(\"http://google.com\");\n Thread.sleep(3000);\n String title = driver.getTitle();\n driver.navigate().to(\"https://etsy.com\");\n Thread.sleep(2000);\n String title2 = driver.getTitle();\n driver.navigate().back();\n title = driver.getTitle();\n Thread.sleep(2000);\n driver.navigate().to(\"https://etsy.com\");\n title2 = driver.getTitle();\n driver.quit();\n }", "@Before\n public synchronized static WebDriver openBrowser() {\n String browser = System.getProperty(\"BROWSER\");\n\n\n if (driver == null) {\n try {\n //Kiem tra BROWSER = null -> gan = chrome\n if (browser == null) {\n browser = System.getenv(\"BROWSER\");\n if (browser == null) {\n browser = \"chrome\";\n }\n }\n switch (browser) {\n case \"chrome\":\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n break;\n case \"firefox\":\n WebDriverManager.firefoxdriver().setup();\n driver = new FirefoxDriver();\n break;\n case \"chrome_headless\":\n WebDriverManager.chromedriver().setup();\n ChromeOptions options = new ChromeOptions();\n options.addArguments(\"headless\");\n options.addArguments(\"window-size=1366x768\");\n driver = new ChromeDriver(options);\n break;\n default:\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n break;\n }\n } catch (UnreachableBrowserException e) {\n driver = new ChromeDriver();\n } catch (WebDriverException e) {\n driver = new ChromeDriver();\n } finally {\n Runtime.getRuntime().addShutdownHook(new Thread(new BrowserCleanup()));\n }\n driver.get(\"http://demo.guru99.com/v4/\");\n driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n driver.manage().window().maximize();\n log.info(\"----------- START BRWOSER -----------\");\n\n }\n return driver;\n }", "@Before\r\n\tpublic void OpenChrome() {\n\t\tconfig = new ConfigReader();\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",config.getChromePath());\r\n\t\tdriver = new ChromeDriver();\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.manage().deleteAllCookies();\r\n\t\texPages = new ExpediaPages(driver);\r\n\t}", "public void getDriver() {\n\t\tWebDriverManager.chromedriver().setup();\n\t\tdriver = new ChromeDriver();\n\t}", "@Given(\"^Open URL in chrome browser$\")\r\n\tpublic void open_URL_in_chrome_browser() {\n\t nop.Launch(\"chrome\", \"http://automationpractice.com/index.php\");\r\n\t}", "public File getChromeDriverFile(){\r\n\t\t\r\n\t\tFile file=null;\r\n\t\tif(testBed.getBrowser().getDriverLocation()!=null){\r\n\t\t\t\r\n\t\t\tfile =new File(testBed.getBrowser().getDriverLocation());\r\n\t\t\r\n\t\t}else{\r\n\t\t\tif(ConfigUtil.isWindows(testBed))\r\n\t\t\t{\r\n\t\t\t\t//TODO have to remove the hard coded values\r\n\t\t\t\t//file = new File(\"..\\\\test-automation-library\\\\resources\\\\chromedriver.exe\");\r\n\t\t\t\tfile = new File(DriverConstantUtil.CHROME_WINDOWS_DRIVER_FILE);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfile = new File(DriverConstantUtil.CHROME_MAC_DRIVER_FILE);\r\n\t\t\t\t//file = new File(\"/Users/sonamdeo/git/test-automation/test-automation-library/resources/chromedriver\");\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn file;\r\n\t}", "public void openBrowser() {\n ResourceBundle config = ResourceBundle.getBundle(\"config\");\n\n config.getString(\"browser\").equalsIgnoreCase(\"Chrome\");\n System.setProperty(\"webdriver.chrome.driver\", \"src/Drivers/chromedriver_76.0.exe\");\n driver = new ChromeDriver();\n\n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n// driver.get(config.getString(\"URL\"));\n driver.manage().window().maximize();\n }", "public static void main(String[] args) {\n\t\t System.setProperty(\"webdriver.chrome.driver\", \"D:/workspace/chromedriver\");\r\n\t\t //System.setProperty(\"webdriver.chrome.driver\", ...);\r\n\t\t \r\n\t\t System.setProperty(\"selenide.browser\", \"Chrome\");\r\n\t\t Configuration.browser=\"chrome\";\r\n\t\t open(\"http://google.com\");\r\n\t\t //$(By.id(\"registerLink\")).pressEnter();\r\n\t\t }", "@Given(\"I set up my Chrome Driver\")\n\tpublic void i_am_on_Magalu_HomePage() {\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--start-maximized\");\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"C:/Users/gocruz/eclipse-workspace/portal.compras/chromedriver.exe\");\n\t\tdriver = new ChromeDriver(options);\n\n\t}", "public void Open_Browser() \r\n\t{\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"drivers\\\\chromedriver.exe\");\r\n\t\t//Brower initiation\r\n\t\tdriver=new ChromeDriver();\r\n\t\t//maximize browser window\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\r\n\t}", "public static void setBrowser() {\n\t\t browser=\"Chrome\";\n\t }", "private void setWebdriver() throws Exception {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\tcurrentDir + fileSeparator + \"lib\" + fileSeparator + \"chromedriver.exe\");\n\t\tcapability = DesiredCapabilities.chrome();\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"--disable-extensions\");\n\t\toptions.addArguments(\"disable-infobars\");\n\t\tcapability.setCapability(ChromeOptions.CAPABILITY, options);\n\t\tdriver = new ChromeDriver(capability);\n\t\tdriver.manage().deleteAllCookies();\n\t\t_eventFiringDriver = new EventFiringWebDriver(driver);\n\t\t_eventFiringDriver.get(getUrl());\n\t\t_eventFiringDriver.manage().window().maximize();\n\n\t}", "@BeforeMethod\n\tpublic void setUp() {\n\t\tString driverByOS = \"\";\n\t\tif (System.getProperty(\"os.name\").equals(\"Windows 10\")) {\n\t\t\tdriverByOS = \"Drivers/chromedriver.exe\";\n\t\t} \n\t\telse {\n\t\t\tdriverByOS = \"Drivers/chromedriver\";\n\t\t}\n\t\t//para saber en qué sistema Operativo estamos corriendo el proyecto.\n\t\tSystem.out.println(System.getProperty(\"os.name\"));\n\t\t\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", driverByOS);\n\t\t//Utilizando headless browser HB\n\t\t/*-HB\n\t\tChromeOptions chromeOptions = new ChromeOptions();\n\t\tchromeOptions.addArguments(\"--headless\");\n\t\tdriver = new ChromeDriver(chromeOptions);\n\t\tHB-*/\n\t\tdriver = new ChromeDriver();\n\t\t//driver.manage().window().maximize(); //esto es para maximizar la ventana del navegador\n\t\t//driver.manage().window().fullscreen(); //esto es para poner en fullscreen la ventana del navegador\n\t\t/*driver.manage().window().setSize(new Dimension(200,200));\n\t\tfor (int i = 0; i <= 800; i++) {\n\t\t\tdriver.manage().window().setPosition(new Point(i,i));\n\t\t}*/\n\t\t//driver.manage().window().setPosition(new Point(800,200)); //posicionando la ventana del navegador\n\t\tdriver.navigate().to(\"http://newtours.demoaut.com/\");\n\t\t//Este codigo de abajo permite abrir otra ventana en el navegador\n\t\t//JavascriptExecutor javaScriptExecutor = (JavascriptExecutor)driver;\n\t\t//String googleWindow = \"window.open('http://www.google.com')\";\n\t\t//javaScriptExecutor.executeScript(googleWindow);\n\t\t//tabs = new ArrayList<String> (driver.getWindowHandles());\n\t\t/*try {\n\t\t\tThread.sleep(5000);\n\t\t} catch (InterruptedException e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t//Helpers helper = new Helpers();\n\t\t//helper.sleepSeconds(4);\n\t}", "@Test\n public void f() {\n\t \n\t System.setProperty(\"webdriver.chrome.driver\", getClass().getResource(\"/chromedriver.exe\").getPath());\n\t System.out.println(\"ssss:\"+getClass().getResource(\"/chromedriver.exe\"));\n\t WebDriver dr = new ChromeDriver();\n\t dr.get(\"http://www.baidu.com\");\n\t \n\t App.printhello();\n\t System.out.println(\"aaaaaaaaaa\");\n\t try {\n\t\tThread.sleep(3000);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t dr.close();\n }", "@Test\r\n\tpublic void tc1(){\r\n\t\tWebDriverManager.chromedriver().setup();\r\n\t\tdriver=new ChromeDriver();\r\n\t\tdriver.get(\"https://www.seleniumhq.org/download/\");\r\n\t\tString title = driver.getTitle();\r\n\t\tSystem.out.println(title);\r\n\t\tdriver.close();\r\n\t}", "@Before\n public void setWebDriver() throws IOException {\n System.setProperty(\"webdriver.chrome.driver\", DRIVER_PATH);\n ChromeOptions chromeOptions = new ChromeOptions();\n chromeOptions.addArguments(\"start-maximized\");\n driver = new ChromeDriver(chromeOptions);\n }", "public WebDriver LaunchChromeBrowserReturnIt() {\n\t\ttry {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\t\t\"/TestSuit/lib/chromedriver.exe\");\n\t\t\tdriver = new ChromeDriver(); // Launch chrome\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn driver;\n\n\t}", "static String getBrowserPath()\n \t{\n \t\tint os = PropertiesAndDirectories.os();\n \t\tString result = browserPath;\n \t\tif (result == null)\n \t\t{\n \t\t\tswitch (os)\n \t\t\t{\n \t\t\tcase PropertiesAndDirectories.XP:\n \t\t\tcase PropertiesAndDirectories.VISTA_AND_7:\n \t\t\t\tif (!Pref.lookupBoolean(\"navigate_with_ie\"))\n \t\t\t\t\tresult = FIREFOX_PATH_WINDOWS;\n \t\t\t\tif (result != null)\n \t\t\t\t{\n \t\t\t\t\tFile existentialTester = new File(result);\n \t\t\t\t\tif (!existentialTester.exists())\n \t\t\t\t\t{\n \t\t\t\t\t\tresult = FIREFOX_PATH_WINDOWS_64;\n \t\t\t\t\t\texistentialTester = new File(result);\n \t\t\t\t\t\tif (!existentialTester.exists())\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tresult = IE_PATH_WINDOWS;\n \t\t\t\t\t\t\texistentialTester = new File(result);\n \t\t\t\t\t\t\tif (!existentialTester.exists())\n \t\t\t\t\t\t\t\tresult = null;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tbreak;\n \t\t\tcase PropertiesAndDirectories.MAC:\n \t\t\t\tresult = \"/usr/bin/open\";\n \t\t\t\tbreak;\n \t\t\tdefault:\n \t\t\t\terror(PropertiesAndDirectories.getOsName(), \"go(ParsedURL) not supported\");\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\tif (result != null)\n \t\t\t{\n \t\t\t\tbrowserPath = result;\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}", "@BeforeTest\n public void setup() {\n System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Users\\\\User\\\\IdeaProjects\\\\LoginToJira\\\\chromedriver.exe\");\n // Create a new instance of the Chrome driver\n this.driver = new ChromeDriver();\n }", "public static WebDriver startBrowser() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"./driver/chromedriver.exe\");\n\t\t\n\t\t// Create ChromeDriver object, launch Chrome browser\n\t\t WebDriver driver = new ChromeDriver();\n\t\t \n\t\t// Create ChromeDriver object, launch Chrome browser\n\t\tdriver.get(\"http://techfios.com/test/107/\");\n\t\treturn driver;\n\t}", "public void setup(){\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"//Users//bpat12//Downloads//chromedriver\");\n\t\tdriver = new ChromeDriver();\n\t\tSystem.out.println(\"launch browser\");\n\t\tdriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);\n\t\tdriver.get(url);\n\t}", "public void initiateBrowser(String browser) {\n\t\tString os = System.getProperty(\"os.name\").toLowerCase();\n\t\tString current_dir = System.getProperty(\"user.dir\");\n\t\tSystem.out.println(os);\n\t\tSystem.out.println(current_dir);\n\t\tswitch (browser) {\n\t\tcase \"ie\":\n\t\t\tSystem.setProperty(\"webdriver.ie.driver\", current_dir + \"/drivers/IEDriverServer.exe\");\n\t\t\tdriver = new InternetExplorerDriver();\n\t\t\tbreak;\n\t\tcase \"chrome\":\n\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\tif (os.contains(\"linux\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", current_dir + \"/drivers/linuxdrivers/chromedriver\");\n\t\t\t\tDesiredCapabilities caps = DesiredCapabilities.chrome();\n\t\t\t\tLoggingPreferences logPrefs = new LoggingPreferences();\n\t\t\t\tlogPrefs.enable(LogType.BROWSER, Level.ALL);\n\t\t\t\tcaps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);\n\n\t\t\t\toptions.setBinary(\"/usr/bin/google-chrome\");\n\t\t\t\toptions.addArguments(\"--headless\");\n\t\t\t} else if (os.contains(\"windows\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", current_dir + \"/drivers/chromedriver.exe\");\n\t\t\t\tDesiredCapabilities caps = DesiredCapabilities.chrome();\n\t\t\t\tLoggingPreferences logPrefs = new LoggingPreferences();\n\t\t\t\tlogPrefs.enable(LogType.BROWSER, Level.ALL);\n\t\t\t\tcaps.setCapability(CapabilityType.LOGGING_PREFS, logPrefs);\n\t\t\t}\n\t\t\toptions.addArguments(\"test-type\");\n\t\t\toptions.addArguments(\"disable-popup-blocking\");\n\t\t\tdriver = new ChromeDriver(options);\n\n\t\t\tdriver.manage().window().maximize();\n\t\t\tbreak;\n\t\tcase \"firefox\":\n\t\t\tdriver = new FirefoxDriver();\n\t\t\tbreak;\n\t\t}\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n\t}", "@BeforeMethod\n\tpublic void registerChromeDriver() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\n\t\t\t\t\"/Users/shwetasharma/Documents/softwares/chromedriver\");\n\t\tdriver = new ChromeDriver();\n\t\tutil = new Utils(driver);\n\t\t// Put a Implicit wait, this means that any search for elements on the\n\t\t// page\n\t\t// could take the time the implicit wait is set for before throwing\n\t\t// exception\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\n\t\t// Launch the Applitools hackathon Website\n\t\tdriver.get(\"https://demo.applitools.com/hackathon.html\");\n\t\tdriver.manage().window().maximize();\n\n\t}", "@Before\n public void start(){\n DesiredCapabilities caps = new DesiredCapabilities();\n driver = new FirefoxDriver(new FirefoxBinary(new File(\"C:\\\\Program Files (x86)\\\\Nightly\\\\firefox.exe\")), new FirefoxProfile(), caps);\n wait = new WebDriverWait(driver, 10);\n\n //IE\n// DesiredCapabilities caps = new DesiredCapabilities();\n// caps.setCapability(InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);\n// WebDriver driver = new InternetExplorerDriver(caps);\n\n\n }", "public static void main(String[] args) {\n String str = getDriver(\"chrome\");\n System.out.println(str);\n\n }", "@BeforeSuite\r\n\tpublic void before_suite() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"G:\\\\chromedriver.exe\");\r\n\t}", "public static void setup(String browser) throws Exception{\n if(browser.equalsIgnoreCase(\"firefox\")){\n \tFile pathToBinary = new File(\"C:\\\\Program Files (x86)\\\\Mozilla Firefox 41\\\\firefox.exe\");\n \tFirefoxBinary binary = new FirefoxBinary(pathToBinary);\n \tFirefoxDriver driver = new FirefoxDriver(binary, new FirefoxProfile());\n \t\n \t//System.setProperty(\"webdriver.firefox.driver\",\"C:\\\\Program Files (x86)\\\\Mozilla Firefox\\\\firefox.exe\");\n \t/*DesiredCapabilities capabilies = DesiredCapabilities.firefox();\t\t\t\n capabilies.getBrowserName();\n capabilies.getVersion();*/\n \t\t\t\n \t//create Firefox instance\t \n //driver = new FirefoxDriver(); \n System.out.println(\"Browser Used: \"+browser);\n }\t \n //Check if parameter passed is 'Chrome'\n // https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html\n // http://www.programcreek.com/java-api-examples/index.php?api=org.openqa.selenium.remote.DesiredCapabilities (Singleton)\n else if(browser.equalsIgnoreCase(\"chrome\")){\t \t \n System.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n ChromeOptions opt = new ChromeOptions();\n opt.setBinary(\"C:\\\\Selenium\\\\Assets\\\\chromedriver.exe\");\n opt.setExperimentalOption(\"Browser\", \"Chrome\");\n opt.getExperimentalOption(\"version\");\n \n// DesiredCapabilities capabilies = DesiredCapabilities.chrome();\n// capabilies.setBrowserName(\"chrome\");\n// capabilies.setPlatform(Platform.WINDOWS);\n// capabilies.setVersion(\"38\");\n// DesiredCapabilities capabilities = new DesiredCapabilities();\n \n //Create Chrome instance\n driver = new ChromeDriver(opt);\t \n }\n \n //Check if parameter passed is 'Safari'\t\n else if(browser.equalsIgnoreCase(\"safari\")){\t \t \n \tSystem.setProperty(\"webdriver.safari.driver\",\"C:/safaridriver.exe\");\n \t\n \t//System.setProperty(\"webdriver.safari.noinstall\", \"true\");\n \tdriver = new SafariDriver();\n \t\n /*\tSafariOptions options = new SafariOptions();\n \tSafariDriver driver = new SafariDriver(options);\n \tDesiredCapabilities capabilities = DesiredCapabilities.safari();\n \tcapabilities.setCapability(SafariOptions.CAPABILITY, options);*/\n }\n \n //Check if parameter passed is 'IE'\t \n else if(browser.equalsIgnoreCase(\"ie\")){\n \t//String IE32 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_32.exe\"; //IE 32 bit\n\t\t\tString IE64 = \"C:\\\\Selenium\\\\Assets\\\\IEDriverServer_64.exe\"; //IE 64 bit\n \tSystem.setProperty(\"webdriver.ie.driver\",IE64);\n \t\n /* \tDesiredCapabilities capabilies = DesiredCapabilities.internetExplorer();\n \tcapabilies.setBrowserName(\"ie\");\n capabilies.getBrowserName();\n capabilies.getPlatform();\n capabilies.getVersion();*/\n \n \t//Create IE instance\n \tdriver = new InternetExplorerDriver();\n }\t \n else{\t \n //If no browser passed throw exception\t \n throw new Exception(\"Browser is not correct\");\t \n }\t \n driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\t\t\n\t}", "@Test\n public void test() throws MalformedURLException {\n System.setProperty(\"webdriver.chrome.driver\",System.getProperty(\"user.dir\")+\"\\\\drivers\\\\chromedriver.exe\"); \n WebDriver driver=new ChromeDriver();\n // WebDriver driver=new RemoteWebDriver(url,cap);\n driver.manage().window().maximize(); \n driver.get(\"https://curiedoctorapp.firebaseapp.com\");\n System.out.println(\"The title is\"+ driver.getTitle());\n driver.quit();\n \n }", "@Test \n public void executSessionThree(){\n System.out.println(\"open the browser: chrome III\");\n final String CHROME_DRIVER_DIRECTORY = System.getProperty(\"user.dir\") + \"/src/test/java/BrowserDrivers/chromedriver.exe\";\n System.setProperty(\"webdriver.chrome.driver\", CHROME_DRIVER_DIRECTORY);\n final WebDriver driver = new ChromeDriver();\n //Goto guru99 site\n driver.get(\"http://demo.guru99.com/V4/\");\n //find user name text box and fill it\n driver.quit();\n }", "@Parameters(\"browser\")\n private void switchBrowser(String browser) {\n if (browser.equals(DRIVER_TYPE.IE.name())) {\n System.setProperty(\"webdriver.ie.driver\", \"src/test/resources/driver/IEDriverServer.exe\");\n driver = new InternetExplorerDriver();\n } else {\n System.setProperty(\"webdriver.chrome.driver\", \"src/test/resources/driver/chromedriver.exe\");\n driver = new ChromeDriver();\n }\n }", "@BeforeTest //special type of testng method which alway run before.\r\n\t\t\tpublic void openBrowser() {\r\n\t\t\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\t\tdriver = new ChromeDriver();\r\n\t\t\t\tdriver.get(\"https://locator.chase.com/\");\r\n\t\t\t}", "public static void main(String[] args) {\nString browser=\"ff\";\nif (browser.equals(\"chrome\")) {\n\tWebDriverManager.chromedriver().setup();\n\t// System.setProperty(\"webdriver.chrome.driver\", \"/Users/user/Downloads/chromedriver\");\n\tdriver=new ChromeDriver();\n}\nelse if (browser.equals(\"ff\")) {\n\tWebDriverManager.firefoxdriver().setup();\n\tdriver=new FirefoxDriver();\n}\nelse\n\tif (browser.equals(\"IE\")) {\n\t\tWebDriverManager.iedriver().setup();\n\t\tdriver=new InternetExplorerDriver();\n\t}\n\telse\n\t\tif (browser.equals(\"opera\")) {\n\t\t\tWebDriverManager.operadriver().setup();\n\t\t\tdriver=new OperaDriver();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"no defined driver\");\n\t\t}\n\n\ndriver.get(\"https://google.com\");\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\t}", "@Test\n public void test1(){\n\n WebDriverManager.chromedriver().setup();\n WebDriver driver2 = new ChromeDriver();\n\n\n\n driver2.get(url);\n bekle(2000);\n driver2.quit();\n\n\n\n }", "@Before\n public void setUp() throws MalformedURLException {\n DesiredCapabilities cap = new DesiredCapabilities();\n cap.setCapability(\"devicename\",\"MyTestDevice\");\n\n //It works with java-client-4.0.0.jar :)\n drive = new AndroidDriver<WebElement>(new URL(\"http://127.0.0.1:4723/wd/hub\"), cap);\n //Reset the cache!\n drive.resetApp();\n\n }", "public static void main(String[] args) {\n\t\tWebDriver driver=new ChromeDriver();\r\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\r\n\t\tdriver.manage().window().maximize();\r\n\t\tdriver.get(\"file:///E:/Qspiders/Notes/Selenium%20notes/Upload.html\");\r\n\t\tString rpath = \"./TestData/URL.txt\";\r\n\t\tSystem.out.println(\"relative path: \"+rpath);\r\n\t\tFile f=new File(rpath);\r\n\t\tString apath = f.getAbsolutePath();\r\n\t\tSystem.out.println(\"absolute path: \"+apath);\r\n\t\tdriver.findElement(By.id(\"1\")).sendKeys(apath);\r\n\r\n\t}", "@Test \n public void executSessionOne(){\n\t System.out.println(\"open the browser: chrome\");\n final String CHROME_DRIVER_DIRECTORY = System.getProperty(\"user.dir\") + \"/src/test/java/BrowserDrivers/chromedriver.exe\";\n System.setProperty(\"webdriver.chrome.driver\", CHROME_DRIVER_DIRECTORY);\n final WebDriver driver = new ChromeDriver();\n //Goto guru99 site\n driver.get(\"http://demo.guru99.com/V4/\");\n //find user name text box and fill it\n driver.quit();\n }", "private String getBinaryPath() {\n return System.getProperty(SeLionConstants.WEBDRIVER_GECKO_DRIVER_PROPERTY,\n Config.getConfigProperty(ConfigProperty.SELENIUM_GECKODRIVER_PATH));\n }", "@BeforeTest\r\n\tpublic void operBrowser(){\n\t\td1=Driver.getBrowser();\r\n\t\tWebDriverCommonLib wlib=new WebDriverCommonLib();\r\n\t\td1.get(Constant.url);\r\n\t\twlib.maximizeBrowse();\r\n\t\twlib.WaitPageToLoad();\r\n\t}", "@Test(groups={\"ut\"})\r\n\tpublic void testCreateCapabilitiesWithRelativeApplicationPath() {\r\n\t\tSeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());\r\n\t\tcontext.setMobilePlatformVersion(\"8.0\");\r\n\t\tcontext.setPlatform(\"android\");\r\n\t\tcontext.setDeviceName(\"Samsung Galasy S8\");\r\n\t\tcontext.setAppPackage(\"appPackage\");\r\n\t\tcontext.setAppActivity(\"appActivity\");\r\n\t\tcontext.setApp(\"data/core/app.apk\");\r\n\t\tDriverConfig config = new DriverConfig(context);\r\n\t\t\r\n\t\tAndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);\r\n\t\tMutableCapabilities capa = capaFactory.createCapabilities();\r\n\t\t\r\n\t\tAssert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), \"\");\r\n\t\tlogger.info(\"app path: \" + capa.getCapability(\"app\"));\r\n\t\tAssert.assertTrue(capa.getCapability(\"app\").toString().contains(\"/data/core/app.apk\"));\r\n\t}", "private void initDriver(){\r\n String browserToBeUsed = (String) jsonConfig.get(\"browserToBeUsed\");\r\n switch (browserToBeUsed) {\r\n case \"FF\":\r\n System.setProperty(\"webdriver.gecko.driver\", (String) jsonConfig.get(\"fireFoxDriverPath\"));\r\n FirefoxProfile ffProfile = new FirefoxProfile();\r\n // ffProfile.setPreference(\"javascript.enabled\", false);\r\n ffProfile.setPreference(\"intl.accept_languages\", \"en-GB\");\r\n\r\n FirefoxOptions ffOptions = new FirefoxOptions();\r\n ffOptions.setProfile(ffProfile);\r\n driver = new FirefoxDriver(ffOptions);\r\n break;\r\n case \"CH\":\r\n String driverPath = (String) jsonConfig.get(\"chromeDriverPath\");\r\n System.setProperty(\"webdriver.chrome.driver\", driverPath);\r\n\r\n Map<String, Object> prefs = new HashMap<String, Object>();\r\n prefs.put(\"profile.default_content_setting_values.notifications\", 2);\r\n\r\n ChromeOptions options = new ChromeOptions();\r\n options.setExperimentalOption(\"prefs\", prefs);\r\n options.addArguments(\"--lang=en-GB\");\r\n driver = new ChromeDriver(options);\r\n break;\r\n case \"IE\":\r\n System.setProperty(\"webdriver.ie.driver\", (String) jsonConfig.get(\"ieDriverPath\"));\r\n\r\n InternetExplorerOptions ieOptions = new InternetExplorerOptions();\r\n ieOptions.disableNativeEvents();\r\n ieOptions.requireWindowFocus();\r\n ieOptions.introduceFlakinessByIgnoringSecurityDomains();\r\n driver = new InternetExplorerDriver(ieOptions);\r\n }\r\n\r\n driver.manage().window().maximize();\r\n }", "public static void main(String[] args) \r\n\t{\n\t\tString path=\"browser_drivers\\\\chromedriver.exe\";\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", path);\r\n\t\tWebDriver driver=new ChromeDriver(); //Launch browser\r\n\t\tdriver.get(\"http://seleniumhq.org\"); //Load webpage\r\n\t\tdriver.manage().window().maximize(); //maximize browser window\r\n\t\t\r\n\t\t\r\n\t\tString Exp_url=\"https://www.seleniumhq.org/\";\r\n\t\t\r\n\t\t//Capture runtime url\r\n\t\tString Runtime_url=driver.getCurrentUrl();\r\n\t\t\t\t\r\n\t\tif(Runtime_url.equals(Exp_url))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Expected url presented for selenium homepage\");\r\n\t\t\t\r\n\t\t\tWebElement Download_tab=driver.findElement(By.xpath(\"//a[@title='Get Selenium']\"));\r\n\t\t\tDownload_tab.click();\r\n\t\t\t\r\n\t\t\tif(driver.getCurrentUrl().contains(\"download/\"))\r\n\t\t\t\tSystem.out.println(\"expected url presented, Downlaod page verified\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"expected url not presented, download page not verified\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Wrong url presnted for selenium hompage\");\r\n\t\t}\r\n\t\r\n\t}", "@Given(\"^the user launch the chrome application$\")\r\n\tpublic void the_user_launch_the_chrome_application() throws Throwable {\n\t\tlaunchBrowser(\"chrome\");\r\n\t\t register= new Para_Registartion_page(driver);\r\n\t}", "@Given(\"url {string}\")\r\n\tpublic void url(String string) {\n\t\tString chromepath=\"C:\\\\Users\\\\a07208trng_b4a.04.26\\\\Desktop\\\\selenium\\\\jar\\\\chromedriver_win32\\\\chromedriver.exe\";\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", chromepath);\r\n\t\tdriver = new ChromeDriver();\r\n\t\tdriver.get(string);\r\n\t\tdriver.manage().window().maximize();\r\n\t}", "public GAfterSearch(WebDriver chromeDriver) {\n super.chromeDriver = chromeDriver;\n }", "public static WebDriver startChrome() {\n\t\treturn new ChromeDriver();\n\t}", "public static void openBrowser() {\r\n\t\tString browser = prop.getProperty(\"browserType\").toLowerCase();\r\n\r\n\t\ttry {\r\n\t\t\tif (browser.equals(\"chrome\")) {\r\n\t\t\t\tSystem.setProperty(prop.getProperty(\"chromeName\"), prop.getProperty(\"chromePath\"));\r\n\t\t\t\tdriver = new ChromeDriver();\r\n\r\n\t\t\t} else if (browser.equals(\"ff\")) {\r\n\t\t\t\tSystem.setProperty(prop.getProperty(\"FFName\"), prop.getProperty(\"FFPath\"));\r\n\t\t\t\tdriver = new FirefoxDriver();\r\n\r\n\t\t\t} else if (browser.equals(\"ie\")) {\r\n\t\t\t\tSystem.setProperty(prop.getProperty(\"IEName\"), prop.getProperty(\"IEPath\"));\r\n\t\t\t\tdriver = new InternetExplorerDriver();\r\n\r\n\t\t\t} else {\r\n\t\t\t\tAssert.fail(\"Unable to find browser, Check EnvrionrmentData.properties file\");\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tAssert.fail(\"Unable to find browser, Check EnvrionrmentData.properties file\");\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws Exception{\n\n WebDriverManager.chromedriver().setup();\n\n WebDriver driver = new ChromeDriver();\n\n driver.get(\"http://practice.cybertekschool.com/open_new_tab\");\n\n Thread.sleep(4000);\n\n //driver.close(); //expected to close the original one\n driver.quit(); //all window will be closed\n\n\n\n\n }", "private void setSauceWebdriver() {\n\n switch (getBrowserId(browser)) {\n case 0:\n capabilities = DesiredCapabilities.internetExplorer();\n capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,\n Boolean.valueOf(System.getProperty(\"IGNORE_SECURITY_DOMAINS\", \"false\")));\n break;\n case 1:\n capabilities = DesiredCapabilities.firefox();\n break;\n case 2:\n capabilities = DesiredCapabilities.safari();\n break;\n case 3:\n capabilities = DesiredCapabilities.chrome();\n break;\n case 4:\n capabilities = DesiredCapabilities.iphone();\n capabilities.setCapability(\"deviceName\",\"iPhone Simulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n case 5:\n capabilities = DesiredCapabilities.iphone();\n capabilities.setCapability(\"deviceName\",\"iPad Simulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n case 6:\n capabilities = DesiredCapabilities.android();\n capabilities.setCapability(\"deviceName\",\"Android Emulator\");\n capabilities.setCapability(\"device-orientation\", \"portrait\");\n break;\n default:\n throw new WebDriverException(\"Browser not found: \" + browser);\n }\n capabilities.merge(extraCapabilities);\n capabilities.setCapability(\"javascriptEnabled\", true);\n capabilities.setCapability(\"platform\", platform);\n capabilities.setCapability(\"version\", version);\n\n try {\n this.driver.set(new RemoteWebDriver(new URL(System\n .getProperty(\"SAUCE_KEY\")), capabilities));\n } catch (MalformedURLException e) {\n LOGGER.log(Level.INFO,\n \"MalformedURLException in setSauceWebdriver() method\", e);\n }\n }", "public static void initializer() \n\t{\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\HP-PC\\\\Downloads\\\\Kahoot\\\\chromedriver.exe\" );\n\t\tdriver=new ChromeDriver();\n\t\tdriver.manage().window().maximize();\n\t\tdriver.get(\"https://www.sathya.in/\");\n\t}", "@BeforeTest // which will be executed first before all the test methods\n@Parameters(\"browser\") //@Parameter is used to pass the values(during run time) to the test methods as arguments using .xml file\npublic void setup(String browser) throws Exception{\n \n//Check if parameter passed as 'chrome'\nif (browser.equalsIgnoreCase(\"chrome\")){\n//set path to chromedriver.exe\nSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\\\\\\\\\\\\\Users\\\\\\\\\\\\\\\\mouleeswaranb\\\\\\\\\\\\\\\\eclipse-workspace_Selenium learning_6127\\\\\\\\\\\\\\\\SeleniumProject\\\\\\\\\\\\\\\\drivers\\\\\\\\\\\\\\\\chromedriver.exe\");\ndriver = new ChromeDriver(); \n}\n\nelse{\n//If no browser passed throw exception\nthrow new Exception(\"Browser is not correct\");\n}\ndriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n}", "public void driverStart(String baseURL) {\n// FirefoxDriverManager.getInstance().setup();\n// driver = new FirefoxDriver();\n// driver.manage().window().maximize();\n// webDriverWait = new WebDriverWait(driver, 10);\n//\n//// ChromeDriverManager.getInstance().setup();\n//// driver = new ChromeDriver();\n//// driver.manage().window().maximize();\n//// webDriverWait = new WebDriverWait(driver, 5);\n//\n// driver.get(baseURL);\n\n FirefoxDriverManager.getInstance().setup();\n WebDriver driver = new FirefoxDriver();\n driver.get(\"http://localhost/litecart/\");\n\n\n }", "@Given(\"^the user launch chrome application$\")\r\n\tpublic void the_user_launch_chrome_application() throws Throwable {\n\t w.browser();\r\n\t}", "@BeforeClass\r\n public void beforeClass() {\n \tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\Tuan\\\\Downloads\\\\chromedriver.exe\");\r\n \tdriver = new ChromeDriver();\r\n \tdriver.get(\"http://daominhdam.890m.com/\");\r\n\t}", "private String getEclipsePathFromWindowsPath(String path) {\n StringBuilder sbPath = new StringBuilder();\n char [] chars = path.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n char c = chars[i];\n if (c == '\\\\') {\n sbPath.append('/');\n } else {\n sbPath.append(c);\n }\n }\n path = sbPath.toString();\n return path;\n }", "public static void main(String[] args) {\n WebDriverManager.chromedriver().setup();\n\n // create object for using selenium driver;\n WebDriver driver=new ChromeDriver();\n\n //open browser\n driver.get(\"http://amazon.com\");// bumu exlaydu\n //driver.get(\"http://google.com\");\n // open website\n System.out.println(driver.getTitle());\n\n\n\n\n }", "private WebDriver getDriver() {\n return new ChromeDriver();\n }", "private void initChromeDriver(String appUrl) {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\",\"Drivers\\\\chromedriver.exe\");\n\t\tdriver = new ChromeDriver();\n\t\tdriver.get(appUrl);\n\t\tdriver.manage().window().maximize();\n\t\tdriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);\n\t}", "@Given(\"^Launch the page$\")\r\n\tpublic void launch_the_page() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"./driver/chromedrivernew.exe\");\r\n\t\tWebDriver driver = new ChromeDriver();\r\n\t\tdriver.get(\"http://realestate.upskills.in\");\r\n\t \t}", "WebDriver modify(WebDriver webDriver);", "@BeforeClass\n\tpublic void setUp() throws MalformedURLException, AWTException{\n\t\tString filepath_driver=Reader.extract(\"chromedriver.exe\");\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", filepath_driver);\n driver = new ChromeDriver(); \n driver.get(\"http://baladyapps.momra.gov.sa/Eservices/Pages/MyRequests.aspx\");\n \n Robot r = new Robot(); \n r.keyPress(KeyEvent.VK_ESCAPE); \n r.keyRelease(KeyEvent.VK_ESCAPE);\n \n \n \n \n\t}", "public GoogleAutomation() {\n\t\t\n\t\t//The setProperty() method of Java system class sets the property of the system which is indicated by a key.\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"driver//chromedriver.exe\");\n\t\t\n\t\t//initilize webDriver \n\t\twebDriver = new ChromeDriver();\n\t}", "public static WebDriver init_driver_crome(String browser) {\n\t\t\tif(browser.equals(\"chrome\")) {\n\t\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"G:\\\\software\\\\chromedriver_win32\\\\chromedriver.exe\");\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Browser is initialised\" +browser);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Browser is not initialised\" +browser);\n\t\t\t}\n\t\t\treturn getDriverChrome();\n\t\t}", "public static WebDriver getLocalChromeDriver() {\n WebDriverManager.chromedriver().setup();\n return new ChromeDriver();\n }", "public static WebDriver getBrowser(BrowserType browserName) {\n\t\tWebDriver driver = null;\n\t\t// System.setProperty(\"webdriver.gecko.driver\",\"G:\\\\eclipse-workspace\\\\zeeui\\\\driver\\\\geckodriver.exe\");\n\t\t// String browserType=Config.getValue(\"BROWSER_TYPE\");\n\t\tif (browserName.equals(BrowserType.FIREFOX)) {\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", Constants.firefoxDriver);\n\t\t\tFirefoxProfile profile = new FirefoxProfile();\n\t\t\tprofile.setPreference(\"browser.download.folderList\", 2);\n\t\t\tprofile.setPreference(\"browser.download.manager.showWhenStarting\", false);\n\t\t\tprofile.setPreference(\"browser.download.dir\", Config.getValue(\"EXPORT_FILE_PATH\"));\n\t\t\tprofile.setPreference(\"browser.helperApps.neverAsk.saveToDisk\",\n\t\t\t\t\t\"image/jpg, text/csv,text/xml,application/xml,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/excel,application/pdf,application/octet-stream\");\n\t\t\tdriver = new FirefoxDriver(profile);\n\t\t\tdrivers.put(\"firefox\", driver);\n\t\t} else if (browserName.equals(\"chrome\")) {\n\t\t\tSystem.setProperty(\"webdriver.chrome.driver\", Constants.chromeDriver);\n\t\t\tMap<String, String> prefs = new Hashtable<String, String>();\n\t\t\tprefs.put(\"download.prompt_for_download\", \"false\");\n\t\t\tprefs.put(\"download.default_directory\", Config.getValue(\"EXPORT_FILE_PATH\"));\n\t\t\tprefs.put(\"download.extensions_to_open\",\n\t\t\t\t\t\"image/jpg, text/csv,text/xml,application/xml,application/vnd.ms-excel,application/x-excel,application/x-msexcel,application/excel,application/pdf,application/octet-stream\");\n\n\t\t\tChromeOptions options = new ChromeOptions();\n\t\t\toptions.setExperimentalOption(\"prefs\", prefs);\n\t\t\tdriver = new ChromeDriver(options);\n\t\t\tdrivers.put(\"chrome\", driver);\n\t\t} else if (browserName.equals(\"ie\")) {\n\t\t\tSystem.setProperty(\"webdriver.ie.driver\", Config.getValue(\"IE_DRIVER\"));\n\t\t\tdriver = new InternetExplorerDriver();\n\t\t\tdrivers.put(\"ie\", driver);\n\t\t} else if (browserName.equals(\"edge\")) {\n\t\t\tSystem.setProperty(\"webdriver.edge.driver\", Config.getValue(\"EDGE_DRIVER\"));\n\t\t\tdriver = new EdgeDriver();\n\t\t\tdrivers.put(\"edge\", driver);\n\t\t} else if (browserName.equals(\"safari\")) {\n\t\t\tdriver = new SafariDriver();\n\t\t\tdrivers.put(\"safari\", driver);\n\t\t} else if (browserName.equals(\"htmlUnit\")) {\n\t\t\tdriver = new HtmlUnitDriver();\n\t\t}\n\n\t\treturn driver;\n\n\t}", "public void browser() {\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"src/test/resources/Driver/chromedriver.exe\");\n\t\tdriver = new ChromeDriver();\n\t\tdriver.manage().window().maximize();// maximize the window\n\t\tdriver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS);\n\n\t}", "public static WebDriver getDriver(String testName) {\n WebDriver driver = getLocalChromeDriver();\n /* * * * * * * * * * * * * * * * * * * * * * * * */\n\n driver.manage().window().maximize();\n return driver;\n }", "public static void main(String[] args) throws MalformedURLException {\n\t\t\n\t\tDesiredCapabilities objRc=new DesiredCapabilities();\n\t\tobjRc.setBrowserName(\"chrome\");\n\t\tobjRc.setPlatform(Platform.WINDOWS);\n\t\tWebDriver driver=new RemoteWebDriver(new URL(\"http://localhost:4546/wd/hub\"),objRc);\n\t}", "public WebDriver browserSetup() throws IOException\r\n\t{ \r\n\t\tBufferedReader br=new BufferedReader(new InputStreamReader(System.in));\r\n\t\tSystem.out.println(\"1.Chrome\\n2.Firefox \\nEnter your choice:\");\r\n\t\tString choice=br.readLine();\r\n\t\t\r\n\t\tswitch(choice)\r\n\t\t{\r\n\t\t//To start Chrome Driver\r\n\t\tcase \"1\":\r\n\t\t System.setProperty(\"webdriver.chrome.driver\", \"C:\\\\Test Automation\\\\Software\\\\chrome\\\\New Version\\\\chromedriver.exe\");\r\n\t\t ChromeOptions options=new ChromeOptions();\r\n\t\t options.addArguments(\"--disable-notifications\");\r\n\t\t driver=new ChromeDriver(options);\r\n\t\t break;\r\n\t\t\r\n\t\t//To start Firefox Driver\r\n\t\tcase \"2\":\r\n\t\t\tSystem.setProperty(\"webdriver.gecko.driver\", \"C:\\\\***\\\\drivers\\\\geckodriver.exe\");\r\n\t\t\tdriver=new FirefoxDriver();\r\n\t\t\tbreak;\r\n\t\t} \r\n\t\t\r\n\t\tdriver.get(url);\r\n\t\t\r\n\t\t//To maximize the window\r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\tdriver.manage().timeouts().pageLoadTimeout(8, TimeUnit.SECONDS);\r\n\t\t\r\n\t\treturn driver;\r\n\t}", "@Before\n public void setUp() throws Exception {\n URL = \"https://www.facebook.com/\";\n\t//baseUrl = \"https://www.katalon.com/\";\n System.setProperty(\"webdriver.chrome.driver\", \"E:\\\\Documentos\\\\Java Drivers\\\\chromedriver.exe\");\n driver = new ChromeDriver();\n // driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\n }", "public static void main(String[] args) {\n WebDriver driver = WebDriverFactory.getDriver(\"chrome\");\n driver.manage().window().maximize();\n\n\n }", "public static void main(String[] args) {\n\n\tSystem.setProperty(\"webdriver.chrome.driver\",\"C:\\\\Users\\\\COMPAQ\\\\Downloads\\\\chromedriver_win32\\\\chromedriver.exe\");\n\nWebDriver driver =new ChromeDriver();\n\n//WebDriverWait wait = new WebDriverWait(driver, 40);\n\n driver.get(\"http://qatestingtips.com/\");\n\t\n\n}", "private WebDriver createChromeDriver() {\n\t\tsetDriverPropertyIfRequired(\"webdriver.chrome.driver\", \"chromedriver.exe\");\n\n\t\tChromeOptions options = new ChromeOptions();\n\t\toptions.addArguments(\"disable-plugins\");\n\t\toptions.addArguments(\"disable-extensions\");\n\t\toptions.addArguments(\"test-type\");\n\n\t\t\n\t\t_driver = new ChromeDriver(options);\n\t\treturn _driver;\n\t}", "public void setDriver(String browserName){\r\n\t \r\n\t\t if(browserName==null){\r\n\t\t\t browserName=\"firefox\";\r\n\t\t\t \r\n\t\t }\r\n\t\t if(browserName.equalsIgnoreCase(\"firefox\")){\r\n\t\t\t \r\n\t\t\t System.setProperty(\"webdriver.gecko.driver\", FIREFOX_DRIVER_PATH);\r\n\t\t\t \r\n\t\t\t driver= new FirefoxDriver();\r\n\t\t\t \r\n\t\t }\r\n\t\t \r\n\t\t if(browserName.equalsIgnoreCase(\"chrome\")){\r\n\t\t\t \r\n\t\t\t System.setProperty(\"webdriver.chrome.driver\",CHROME_DRIVER_PATH);\r\n\t\t\t \r\n\t\t\t driver= new ChromeDriver();\r\n\t\t }\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t if(browserName.equalsIgnoreCase(\"ie\")){\r\n\t\t\t \r\n\t\t\t System.setProperty(\"webdriver.ie.driver\",IE_DRIVER_PATH);\r\n\t\t\t \r\n\t\t\t driver= new InternetExplorerDriver();\r\n\t\t\t \r\n\t\t }\r\n\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t}", "@BeforeMethod(alwaysRun = true)\n public void browserSetup(){\n driver = new ChromeDriver();\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tWebDriverManager.chromedriver().setup();\r\n\t\t\r\n\t\tWebDriver driver =new ChromeDriver();\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\r\n\t PropertyFetcher prop = new PropertyFetcher();\r\n\t \r\n\t \r\n\t \r\n\t \r\nWebDriver driver=new ChromeDriver(); \r\nSystem.setProperty(\"webdriver.chrome.driver\", \"C:/Users/Kumarshobhitsoni/workspace/SeleniumPractice/chromedriver.exe\");\r\n//System.out.println(prop.getProperty(\"URL\"));\r\ndriver.get(prop.fetchProp(\"URL\"));\r\n\r\n//System.out.println(\"Hiii\");\r\n\r\n\t}", "public static void main(String[] args) throws MalformedURLException {\n\t\tFile appDir = new File(\"src/test/java\");\n\t\tFile app = new File(appDir, \"com.google.android-2.3.apk\");\n\t\tDesiredCapabilities capabilities = new DesiredCapabilities();\n\t\t//capabilities.setCapability(\"browserName\", \"Chrome\");\n\n\t\t//capabilities.setCapability(\"device\",\"Android\");\n\t\tcapabilities.setCapability(\"deveiceName\",\"SimulatorGalaxy\" );\t\t\n\t\tcapabilities.setCapability(\"platformVersion\", \"5.0.1\");\n\t\tcapabilities.setCapability(\"platformName\", \"Android\");\n\t\tcapabilities.setCapability(\"app\",app.getAbsolutePath());\n\t\tcapabilities.setCapability(\"appPackage\",\"com.android.chrome\");\n\t\tcapabilities.setCapability(\"appActivity\",\"com.google.android.apps.chrome.\");\n\t\tdriver = new AndroidDriver(new URL(\"http://127.0.0.1:4723/wd/hub\"), capabilities);\t\n\n\t\t/*driver.get(\"Url\");\n\t\tdriver.findElement(By.id(\"menu_projects\")).click();\n\t\tdriver.findElement(By.id(\"menu_about\")).click();\n\t\tdriver.findElement(By.id(\"menu_support\")).click();\n\t\tdriver.findElement(By.id(\"menu_documentation\")).click();\n\t\tdriver.findElement(By.id(\"menu_download\")).click();\n\n\t\tdriver.quit();*/\n\t}", "public static void main(String[] args) {\n\t\tSystem.getProperty(\"webdriver.chrome.driver\",\"A:\\\\javaprograms\\\\Jacky\\\\basicselenium\\\\driver\\\\chromedriver.exe\");\nWebDriver driver=new ChromeDriver();\ndriver.get(\"https://www.facebook.com/\");\nWebElement txtUser = driver.findElement(By.id(\"email\"));\ntxtUser.sendKeys(\"hello\");\n\n\t}" ]
[ "0.70020455", "0.69758004", "0.6923994", "0.6737509", "0.6674685", "0.6404301", "0.6375619", "0.6343186", "0.6342676", "0.6268588", "0.61761683", "0.61472774", "0.61061114", "0.6090634", "0.6082551", "0.60005593", "0.59535635", "0.59444076", "0.59116435", "0.59001404", "0.58794373", "0.58752954", "0.58720183", "0.5866755", "0.5865626", "0.58376455", "0.58366144", "0.582766", "0.58250386", "0.58143365", "0.5805604", "0.5800577", "0.57981735", "0.57727677", "0.57705224", "0.57648593", "0.5751098", "0.5737348", "0.57226497", "0.5717102", "0.57147306", "0.5703971", "0.5689431", "0.56706816", "0.5662291", "0.56576955", "0.5642504", "0.5642109", "0.5641723", "0.5620523", "0.5611214", "0.5607649", "0.55847967", "0.55834085", "0.55733496", "0.5551571", "0.55487895", "0.5541608", "0.5528776", "0.552303", "0.5504675", "0.5502388", "0.5496684", "0.5492116", "0.5490541", "0.5487657", "0.5483877", "0.5479935", "0.5474526", "0.54645187", "0.5464179", "0.5462518", "0.5461039", "0.54518336", "0.54416823", "0.5434365", "0.54329664", "0.54328156", "0.5425934", "0.54257494", "0.54256237", "0.5423236", "0.54226923", "0.5415089", "0.5409092", "0.5403936", "0.5403074", "0.54015714", "0.53964865", "0.53826857", "0.5382026", "0.53720057", "0.5368495", "0.5367657", "0.5360862", "0.5358466", "0.5351054", "0.5350415", "0.5348806", "0.53443515", "0.53429204" ]
0.0
-1