query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
Affiche le panier de commande. | protected void displayOrderTable(List<ArticleStock> articles) {
OrderViewModel model = new OrderViewModel(articles);
table.setModel(model);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printCommand() {\n System.out.println(\"Cette commande n'est pas supportee\");\n System.out.println(\"Quitter : \\\"quit\\\", Total: \\\"total\\\" , Liste: \\\"list\\\" ou Time: \\\"time\\\"\");\n System.out.println(\"--------\");\n }",
"public void emitirSaludoConGui()\n {\n JOptionPane.showMessageDialog(null, \n\t\t\t\t\t\"<html><p style ='color: red'>Saludo en modo gráfico </p></html>\" + \n\t\t\t\t\t\"\\n\\nBienvenido/a al curso de programación orientada a objetos\\n en Java utilizando BlueJ\",\n\t\t\t\t\t\"Ejemplo de prueba\", JOptionPane.INFORMATION_MESSAGE);\n }",
"static void menuPrincipal() {\n System.out.println(\n \"\\nPizzaria o Rato que Ri:\" + '\\n' +\n \"1 - Novo pedido\" + '\\n' +\n \"2 - Mostrar pedidos\" + '\\n' +\n \"3 - Alterar estado do pedido\" + '\\n' +\n \"9 - Sair\"\n );\n }",
"private static void showMenu() {\n System.out.println(\"1. Dodaj zadanie\");\n System.out.println(\"2. Wykonaj zadanie.\");\n System.out.println(\"3. Zamknij program\");\n }",
"static void montaMenu() {\n System.out.println(\"\");\r\n System.out.println(\"1 - Novo cliente\");\r\n System.out.println(\"2 - Lista clientes\");\r\n System.out.println(\"3 - Apagar cliente\");\r\n System.out.println(\"0 - Finalizar\");\r\n System.out.println(\"Digite a opcao desejada: \");\r\n System.out.println(\"\");\r\n }",
"private void showHelp() {\n\t\tJOptionPane.showMessageDialog(this, \"Created by Mario Bobić\", \"About File Encryptor\", JOptionPane.INFORMATION_MESSAGE);\n\t}",
"private static void mostrarMenu() {\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println(\"-----------OPCIONES-----------\");\n\t\tSystem.out.println(\"------------------------------\");\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\n\\t1) Mostrar los procesos\");\n\t\tSystem.out.println(\"\\n\\t2) Parar un proceso\");\n\t\tSystem.out.println(\"\\n\\t3) Arrancar un proceso\");\n\t\tSystem.out.println(\"\\n\\t4) A�adir un proceso\");\n\t\tSystem.out.println(\"\\n\\t5) Terminar ejecucion\");\n\t\tSystem.out.println(\"\\n------------------------------\");\n\t}",
"private void showInfo() {\n JOptionPane.showMessageDialog(\n this,\n \"Пока что никакой\\nинформации тут нет.\\nДа и вряд ли будет.\",\n \"^^(,oO,)^^\",\n JOptionPane.INFORMATION_MESSAGE);\n }",
"@Override\n\tpublic void showContents() {\n\t\tprogram.add(returnToMain);\n\t\tprogram.add(congratMessage);\n\t\tprogram.setBackground(Color.DARK_GRAY);\n\t\t\n\t}",
"private void afficheMenu() {\n\t\tSystem.out.println(\"------------------------------ Bien venu -----------------------------\");\n\t\tSystem.out.println(\"--------------------------- \"+this.getName()+\" ------------------------\\n\");\n\t\t\n\t\ttry {\n\t\t\tThread.sleep(40);\n\t\t\tSystem.out.println(\"A- Afficher l'état de l'hôtel. \");\n\t\t\tThread.sleep(50);\n\t\t\tSystem.out.println(\"B- Afficher Le nombre de chambres réservées.\");\n\t\t\tThread.sleep(60);\n\t\t\tSystem.out.println(\"C- Afficher Le nombre de chambres libres.\");\n\t\t\tThread.sleep(70);\n\t\t\tSystem.out.println(\"D- Afficher Le numéro de la première chambre vide.\");\n\t\t\tThread.sleep(80);\n\t\t\tSystem.out.println(\"E- Afficher La numéro de la dernière chambre vide.\");\n\t\t\tThread.sleep(90);\n\t\t\tSystem.out.println(\"F- Reserver une chambre.\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"G- Libérer une chambre.\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"O- Voire toutes les options possibles?\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"H- Aide?\");\n\t\t\tThread.sleep(100);\n\t\t\tSystem.out.println(\"-------------------------------------------------------------------------\");\n\t\t}catch(Exception err) {\n\t\t\tSystem.out.println(\"Error d'affichage!\");\n\t\t}\n\t\n\t}",
"public static void menu(){\n System.out.println(\"-Ingrese el número correspondiente-\");\n System.out.println(\"------------ Opciones -------------\");\n System.out.println(\"------------ 1. Sumar -------------\");\n System.out.println(\"------------ 2. Restar ------------\");\n System.out.println(\"------------ 3. Multiplicar -------\");\n System.out.println(\"------------ 4. Dividir -----------\");\n }",
"private void tutorial(){\n\t\tString msg = \"[Space] = Inicia e pausa o jogo depois de iniciado.\";\n\t\tmsg += \"\\n[Seta esquerda] = Move o paddle para a esquerda.\";\n\t\tmsg += \"\\n[Seta direita] = Move o paddle para a direita.\";\n\t\tmsg += \"\\n[I] = Abre a janela de informaçoes.\";\n\t\tmsg += \"\\n[R] = Reinicia o jogo.\";\n\t\tJOptionPane.showMessageDialog(null, \"\"+msg, \"Informaçoes\", JOptionPane.INFORMATION_MESSAGE);\n\t}",
"public void showHelp(CommandSender sender) {\n\t\t\n\t}",
"@Override\r\n public final void display() {\r\n System.out.println(\"\\n\\t===============================================================\");\r\n System.out.println(\"\\tEnter the letter associated with one of the following commands:\");\r\n \r\n for (String[] menuItem : HelpMenuView.menuItems) {\r\n System.out.println(\"\\t \" + menuItem[0] + \"\\t\" + menuItem[1]);\r\n }\r\n System.out.println(\"\\t===============================================================\\n\");\r\n }",
"static void afficherMenu() {\n\t\tSystem.out.println(\"\\n\\n\\n\\t\\tMENU PRINCIPAL\\n\");\n\t\tSystem.out.println(\"\\t1. Additionner deux nombres\\n\");\n\t\tSystem.out.println(\"\\t2. Soustraire deux nombres\\n\");\n\t\tSystem.out.println(\"\\t3. Multiplier deux nombres\\n\");\n\t\tSystem.out.println(\"\\t4. Deviser deux nombres\\n\");\n\t\tSystem.out.println(\"\\t0. Quitter\\n\");\n\t\tSystem.out.print(\"\\tFaites votre choix : \");\n\t}",
"public void mainMenu() {\n\n System.out.println(\"\\n HOTEL RESERVATION SYSTEM\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n System.out.println(\" COMMANDS:\");\n System.out.println(\" - View Tables\\t\\t(1)\");\n System.out.println(\" - Add Records\\t\\t(2)\");\n System.out.println(\" - Update Records\\t(3)\");\n System.out.println(\" - Delete Records\\t(4)\");\n System.out.println(\" - Search Records\\t(5)\");\n System.out.println(\"+------------------------------------------------------------------------------+\");\n System.out.print(\" > \");\n }",
"private void print_help_and_exit() {\n System.out.println(\"A bunch of simple directus admin cli commands\");\n System.out.println(\"requires DIRECTUS_API_HOST and DIRECTUS_ADMIN_TOKEN environment variables to be set\");\n System.out.println();\n\n COMMAND_METHODS.values().forEach(c -> {\n for (String desriptionLine : c.descriptionLines) {\n System.out.println(desriptionLine);\n }\n System.out.println();\n });\n\n System.out.println();\n System.exit(-1);\n }",
"private void helpAbout() {\n JOptionPane.showMessageDialog(this, new ConsoleWindow_AboutBoxPanel1(), \"About\", JOptionPane.PLAIN_MESSAGE);\n }",
"public void mostrar() {\n\t\tlimpiarCampos();\n\t\tthis.setVisible(true);\n\t}",
"@Override\r\n\tpublic void mostrar() {\n\t\t\r\n\t}",
"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 }",
"private void showHelp() {\n System.out.println(\"new: \");\n System.out.println(\"new chess and throw the chess bevor away\");\n System.out.println(\"move from to:\");\n System.out.println(\"take the pawn from position from to position to \");\n System.out.println(\"print:\");\n System.out.println(\"print the chess now \");\n System.out.println(\"help:\");\n System.out.println(\"show help\");\n System.out.println(\"quit:\");\n System.out.println(\"quit out\");\n }",
"void show_info() {\n\t\tsetAlwaysOnTop(false);\n\n\t\tString msg = \"<html><ul><li>Shortcuts:<br/>\"\n\t\t\t\t+ \"(\\\") start macro<br/>\"\n\t\t\t\t+ \"(esc) exit<br/><br/>\"\n\t\t\t\t+ \"<li>Author: <b>Can Kurt</b></ul></html>\";\n\n\t\tJLabel label = new JLabel(msg);\n\t\tlabel.setFont(new Font(\"arial\", Font.PLAIN, 15));\n\n\t\tJOptionPane.showMessageDialog(null, label ,\"Info\", JOptionPane.INFORMATION_MESSAGE);\n\n\t\tsetAlwaysOnTop(true);\n\t}",
"public void welcome() {\n System.out.println(\"\\n---------------------------------------------------------------------\" +\n \"\\n\\tBienvenue sur le plateau de Donjon et Dragons !!!\" +\n \"\\n---------------------------------------------------------------------\");\n System.out.println(\"\\nPrêt à en découdre ?\");\n System.out.println(\"\\nNB : tu peux quitter le jeu à tout moment en tapant 'q'.\");\n }",
"private static void showMenu(){\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"What would you like to do?\");\r\n\t\tSystem.out.println(\"0) Show Shape information\");\r\n\t\tSystem.out.println(\"1) Create Shape\");\r\n\t\tSystem.out.println(\"2) Calculate perimeter\");\r\n\t\tSystem.out.println(\"3) Calculate area\");\r\n\t\tSystem.out.println(\"4) Scale shape\");\r\n\t}",
"protected void helpPage() {\n \n System.out.println(\"Commands:\");\n System.out.println(\"\\tQ [filename]\\t\\t\\tquit and save to filename\"); \n System.out.println(\"\\t ~ is used for a space character\" ); \n System.out.println(\"\\tb [STRING] [INDEX]\\t\\tinsert [STRING] \" +\n \"before [INDEX]\");\n System.out.println(\"\\tr [START] [STOP]\\t\\tremove all charecters\" +\n \" from index start to stop\");\n System.out.println(\"\\td [CHAR]\\t\\t\\tremove all [CHAR] elements \" +\n \"in the list\");\n System.out.println(\"\\tr [CHAR1] [CHAR2]\\t\\treplace all \" + \n \"[CHAR1]'s with [CHAR2]\");\n System.out.println(\"\\tz\\t\\t\\t\\trandomly run other commands several\" +\n \" times\");\n System.out.println(\"\\tp [INDEX] [CLIPBOARD]\\t\\tpaste from \" +\n \"clipboard number [CLIPBOARD] to message index [INDEX]\");\n System.out.println(\"\\tc [START] [STOP] [CLIPBOARD]\\t\" + \n \"copy message values from index [START] to [STOP] to \" + \n \"clipboard [CLIPBOARD]\");\n System.out.println(\"\\tx [STOP] [START] [CLIPBOARD]\\tcut from \" +\n \"message index [START] to [STOP] to clipboard [CLIPBOARD]\");\n System.out.println(\"\\th\\t\\t\\t\\tmeans to show this help page\");\n }",
"public static void f_menu() {\n System.out.println(\"----------------------------------------\");\n System.out.println(\"--------------DIGITALSOFT---------------\");\n System.out.println(\"-----version:1.0------28/04/2020.-------\");\n System.out.println(\"-----Angel Manuel Correa Rivera---------\");\n System.out.println(\"----------------------------------------\");\n }",
"public static void MenuPrincipal() {\n System.out.println(\"Ingrese Opcion deseada :.\\n\"\r\n + \"1. Ingresar un perro a la guardería.\\n\"\r\n + \"2. Contar cuántos Perros de la raza y el Genero deceado hay o pasaron por la guardería durante el verano.\\n\"\r\n + \"3. Listar todos los perros (con su respectiva información) que ingresaron en una determinada fecha.\\n\"\r\n + \"4. Listar todos los Perrros de la Raza que decea con estadía mayor a 20 días.\\n\"\r\n + \"5. Dado el código de un perro, informar los datos de su dueño.\\n\"\r\n + \"6. Terminar.\\n\"\r\n +\"______________________________________________________________________________________________________________\"\r\n \r\n );\r\n\r\n }",
"private void helpService() {\n output.println(\"Help command\");\n output.println(\"-calc <number> \\t Calculates the value of pi based on <number> points; quit \\t Exit from program \");\n }",
"public static void help() {\n System.out.println(\"MENU : \");\n System.out.println(\"Step 1 to create a default character.\"); // create and display a character\n System.out.println(\"Step 2 to display characters.\");\n System.out.println(\"Step 3 to choice a character for list his details. \");\n System.out.println(\"Step 4 to start fight between 2 characters\");\n System.out.println(\"step 5 to remove a character.\");\n System.out.println(\"step 6 to create a Warrior.\");\n System.out.println(\"step 7 to create a Wizard.\");\n System.out.println(\"step 8 to create a Thief.\");\n System.out.println(\"Step 9 to exit the game. \");\n System.out.println(\"Step 0 for help ....\");\n\n }",
"public void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(\" go quit help\");\n }",
"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 void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the university.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }",
"private static void writeShortManual() {\n System.out.println(\"\\nPromethean CLI v1.0.0\");\n System.out.println(\"Commands:\");\n System.out.println(\"\\tplan - create (and optionally execute) a plan given input json\");\n System.out.println(\"\\ttestgen - generate a test input file given initial and goal states\");\n System.out.println(\"Run <command> --help to see all options\\n\");\n }",
"@Override\n public void help(CommandSender sender) {\n \n }",
"public void message() {\n JOptionPane.showMessageDialog(null,\n \"Task was deleted successfully.\",\n \"Message\", JOptionPane.INFORMATION_MESSAGE);\n }",
"public void printStrukTel() //Untuk yang tidak pake DialogBox\r\n {\n System.out.println(\"----------------------------------------\");\r\n System.out.println(\" BANK HAFARA \");\r\n System.out.println(\"\\n\");\r\n System.out.println(\" Nomor antrian anda: \");\r\n System.out.println(\" A\" + totalAntrianTeller++);\r\n System.out.println(\" Sedang menunggu \" + (totalAntrianTeller-2) + \" orang\");\r\n System.out.println(\"\\n\");\r\n System.out.println(\" \"+wkt.getTanggal());\r\n System.out.println(\"TERIMA KASIH TELAH MENGGUNAKAN JASA KAMI\");\r\n System.out.println(\"----------------------------------------\");\r\n System.out.println(\"\\n\");\r\n }",
"public static void afficherMenu() {\r\n System.out.println(\"\\n## Menu de l'application ##\\n\" +\r\n \" Actions Membres :\\n\"+\r\n \" [ 1] : Inscription d'un Membre\\n\" +\r\n \" [ 2] : Désinscription d'un Membre\\n\" +\r\n \" ( 3) : Afficher liste des Membres\\n\" +\r\n \" [ 4] : Payer Cotisation\\n\" +\r\n \" Actions vote Arbres d'un Membre :\\n\" +\r\n \" ( 5) : Voter pour un Arbre\\n\" +\r\n \" ( 6) : Afficher liste des votes\\n\" +\r\n \" ( 7) : Retirer un vote\\n\" +\r\n \" ( 8) : Supprimer les votes d'un Membre.\\n\" +\r\n \" ( 9) : Remplacer un vote\\n\" +\r\n \" Actions Arbres :\\n\" +\r\n \" (10) : Afficher la liste des Arbres\\n\" +\r\n // ...\r\n \" Actions Administration :\\n\" +\r\n \" (11) : Nommer nouveau Président\\n\" +\r\n // ...\r\n \"\\n ( 0) : Quitter l'application\\n\" +\r\n \" - Veuillez saisir une action. -\");\r\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJOptionPane.showMessageDialog(null, \"<html><center><u><strong>Edité par :</strong></u><br>RAHMANI ABD EL KADER<br>SEIF EL ISLEM<br> Groupe 1 Section 1</center></html>\", \"A propros\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t}",
"private void showInstructions() {\n Alert popUp = new Alert(Alert.AlertType.INFORMATION);\n popUp.setTitle(\"Instructions\");\n popUp.setContentText(\"The size field in the bottom let controls the board demensions.\" \n + \"The coord field in the bottom right controls the starting point of the tour \" \n + \"where 0 <= x, y < size. \"\n + \"Press enter with the text field in focus to submit changes. \"\n + \"Changes submitted to the coordinate field will start a new tour. \"\n + \"Depending on the conditions it could take a while!\");\n\n popUp.showAndWait();\n }",
"private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around in a dense woods.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }",
"public void duerme() {\n System.out.println(\"Duerme profundamentZzZzZz...\");\n }",
"@Override\n\tpublic void command(List<Commande> commandes) {\n\t\t\n\t}",
"private void displayMenu()\r\n {\r\n System.out.println();\r\n System.out.println(\"--------- Main Menu -------------\");\r\n System.out.println(\"(1) Search Cars\");\r\n System.out.println(\"(2) Add Car\");\r\n System.out.println(\"(3) Delete Car\");\r\n System.out.println(\"(4) Exit System\");\r\n System.out.println(\"(5) Edit Cars\");\r\n }",
"public void help() {\n System.out.println(\"Type 'commands' to list all \" +\n \"available commands\");\n System.out.println(\"Type 'start' to play game\");\n System.out.println(\"Player to remove the last stone loses!\");\n System.out.println();\n }",
"@Override\n\tpublic void EjecutaGui() {\n\t\tSystem.out.println(\"Ejecucion en ventana del ejercicio 2 del grupo 3\");\n\t}",
"public void showMemberCategoryMenu() {\n System.out.println(\"Visa lista med: \");\n System.out.println(\"\\t1. Barnmedlemmar\");\n System.out.println(\"\\t2. Ungdomsmedlemmar\");\n System.out.println(\"\\t3. Vuxenmedlemmar\");\n System.out.println(\"\\t4. Seniormedlemmar\");\n System.out.println(\"\\t5. VIP-medlemmar\");\n System.out.print(\"Ange val: \");\n }",
"public static void menuInicial() {\n System.out.println(\"Boas vindas à Arena pokemon Treinador!!!\");\n System.out.println(\"Digite 1 para fazer sua inscrição\");\n System.out.println(\"Digite 2 para sair\");\n\n }",
"@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"콘텐츠화면이 출력되었습니다\");\n\t}",
"public static void showHelp(String type){\n\t\tSystem.out.println(\"List of commands available :\");\n\t\tSystem.out.println(\"General commands :\");\n\t\tSystem.out.println(\"help [full] : to show this help (if the optional argument \\\"full\\\" is here, every single command is displayed; otherwise, only the ones that can be used by the logged in user\");\n\t\tSystem.out.println(\"quit <> : to exit the application\");\n\t\tSystem.out.println(\"login <username> <password> : to login to the system\");\n\t\tSystem.out.println(\"registerCustomer <firstname> <lastname> <username> <addressCoord1> <addressCoord2> <password> : to register a new customer to the system\");\n\t\tSystem.out.println(\"registerRestaurant <name> <username> <addressCoord1> <addressCoord2> <password> : to register a new restaurant to the system\");\n\t\tSystem.out.println(\"registerCourier <name> <surname> <username> <positionCoord1> <positionCoord2> <phoneNumber> <password> : to register a new courrier\");\n\t\tSystem.out.println(\"save <> : to save the changes that have been performed\");\n\t\tSystem.out.println(\"showUsers <> : to show the name of all the users registered in the system\");\n\t\tSystem.out.println(\"logout <> : to log out of the system\");\n\t\tif(type.equals(\"c\") || type.equals(\"f\")){\n\t\t\tSystem.out.println(\"\\nCommands for customers :\");\n\t\t\tSystem.out.println(\"showRestaurants <> : to show the restaurants registered into the system\");\n\t\t\tSystem.out.println(\"selectRestaurant <restaurantUsername> : to select the restaurant in which perform an order\");\n\t\t\tSystem.out.println(\"showMenu <> : shows the menu of the selected restaurant\");\n\t\t\tSystem.out.println(\"startOrder <> : starts a new order\");\n\t\t\tSystem.out.println(\"addDish2Order <dishName> : adds an item to the current order\");\n\t\t\tSystem.out.println(\"addMeal2Order <mealName> : adds a meal to the current order\");\n\t\t\tSystem.out.println(\"removeDishFromOrder <dishName> : removes a dish from the current order\");\n\t\t\tSystem.out.println(\"removeMealFromOrder <mealName> : removes a meal from the current order\");\n\t\t\tSystem.out.println(\"showOrder <> : show the current order (content and price)\");\n\t\t\tSystem.out.println(\"showMeal <mealName> : to show the content of a meal in the selected restaurant menu\");\n\t\t\tSystem.out.println(\"receiveSpecialOffers <> : to receive a notification when a new special offer is created\");\n\t\t\tSystem.out.println(\"stopReceivingSpecialOffers <> : to stop receiving these notifications\");\n\t\t\tSystem.out.println(\"endOrder <> : to review and confirm the order completed\");\n\t\t}\n\t\tif(type.equals(\"r\") || type.equals(\"f\")){\n\t\t\tSystem.out.println(\"\\nCommands for restaurants :\");\n\t\t\tSystem.out.println(\"addDish <dishName> <dishCourse> <price> [<type1>, <type2>, <type3>...]: adds a new dish to the menu (dishCourse must be : \\\"s\\\" for starter, \\\"m\\\" for main dish, or \\\"d\\\" for dessert. Types are optionals.)\");\n\t\t\tSystem.out.println(\"createMeal <nameMeal> <nameItem1> <nameItem2> [<nameItem3>] : create a new meal composed of the specified items (the third item is optional)\");\n\t\t\tSystem.out.println(\"removeMeal <mealName> : to remove a meal from the menu\");\n\t\t\tSystem.out.println(\"showMeal <mealName> : to show the content of a meal in the menu\");\n\t\t\tSystem.out.println(\"removeDish <dishName> : to remove a dish from the menu\");\n\t\t\tSystem.out.println(\"showMenu <> : for the logged in restaurant to show its own menu\");\n\t\t\tSystem.out.println(\"setSpecialOffer <mealName> : set the meal as meal of the week\");\n\t\t\tSystem.out.println(\"removeFromSpecialOffer <mealName> : remove the status of meal of the week for the meal\");\n\t\t\tSystem.out.println(\"findDeliverer <> : finds an available deliverer for the current order, according to the current delivery policy\");\n\t\t\tSystem.out.println(\"showOrdersToComplete <> : shows the orders that have been sent, but not prepared yet\");\n\t\t\tSystem.out.println(\"setOrderCompleted <orderName> : to set the status of an order from \\\"to complete\\\" to \\\"completed\\\"\");\n\t\t\tSystem.out.println(\"showShippedOrders <> : display a list of shipped orders corresponding to the current sorting policy\");\n\t\t}\n\t\tif(type.equals(\"co\") || type.equals(\"f\")){\n\t\t\tSystem.out.println(\"onDuty <> : to set the state of the courier as \\\"on duty\\\"\");\n\t\t\tSystem.out.println(\"offDuty <> : to set the state of the courier as \\\"off duty\\\"\");\n\t\t\tSystem.out.println(\"deliveryFinished <> : to announce the current delivery was completed without issues.\");\n\t\t\tSystem.out.println(\"setPosition <coord1> <coord2> : to set the courier's position\");\n\t\t}\n\t\tif(type.equals(\"m\") || type.equals(\"f\")){\n\t\t\tSystem.out.println(\"\\nCommands for managers :\");\n\t\t\tSystem.out.println(\"removeUser <username> : to remove the user from the system\");\n\t\t\tSystem.out.println(\"inactivateUser <username> : to inactivate (but not delete) a user in the system\");\n\t\t\tSystem.out.println(\"activateUser <username> : to activate a user which was previously inactivated\");\n\t\t\tSystem.out.println(\"registerManager <name> <surname> <username> <password> : to register a new manager to the system\");\n\t\t\tSystem.out.println(\"setDeliveryPolicy {fastest, fair} : set the delivery policy used to find a courier\");\n\t\t\tSystem.out.println(\"setProfitPolicy {deliveryCost, markupPercentage, serviceFee} : set the system's target profit policy to the corresponding policy\");\n\t\t\tSystem.out.println(\"setSortingPolicy {halfMeal, items} [reverse] : set the system's sorting policy to the corresponding policy. Optional argument \\\"reverse\\\" to reverse the sorting order.\");\n\t\t\tSystem.out.println(\"showCouriersDeliveries <> : show the list of the couriers of the fleet, sorted from the most to the least active.\");\n\t\t\tSystem.out.println(\"showRestaurantTop <> : show the list of the restaurants sorted from the most to the least selling\");\n\t\t\tSystem.out.println(\"showCustomers <> : to display the list of the customers registered in the system\");\n\t\t\tSystem.out.println(\"showMenuItem <restaurantName> : to display elements of the menu of a given restaurant, sorted w.r.t. the current sorting policy\");\n\t\t\tSystem.out.println(\"associateCard <username> {basic, lottery, point} : gives the user specified with <username> a fidelity card of corresponding type (basic, lottery or points)\");\n\t\t\tSystem.out.println(\"showTotalProfit [<dateStart> <dateEnd>] : show total profit since creation (if no arguments) or between dates passed as optional arguments (date format : DDMMYYYY)\");\n\t\t}\n\t}",
"private void showAbout() {\n JOptionPane.showMessageDialog(this,\n \"TalkBox\\n\" + VERSION,\n \"About TalkBox\",\n JOptionPane.INFORMATION_MESSAGE);\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 static void status(){\n System.out.print(\"\\033[H\\033[2J\");//limpia pantalla\n System.out.flush();\n System.out.printf(\"\\nNOMBRE:\\t\\t\\t\"+nombrePersonaje);\n\tSystem.out.printf(\"\\nPuntos De Vida (HP):\\t\"+puntosDeVida);\n\tSystem.out.printf(\"\\nPuntos De mana (MP):\\t\"+puntosDeMana);\n System.out.printf(\"\\nNivel: \\t\\t\\t\"+nivel);\n\tSystem.out.printf(\"\\nExperiencia:\\t\\t\"+experiencia);\n\tSystem.out.printf(\"\\nOro: \\t\\t\"+oro);\n System.out.printf(\"\\nPotion:\\t\\t\\t\"+articulo1);\n System.out.printf(\"\\nHi-Potion:\\t\\t\"+articulo2);\n System.out.printf(\"\\nM-Potion:\\t\\t\"+articulo3);\n System.out.printf(\"\\n\\tEnemigos Vencidos:\\t\");\n\tSystem.out.printf(\"\\nNombre:\\t\\t\\tNo.Derrotas\");\n System.out.printf(\"\\nDark Wolf:\\t\\t\"+enemigoVencido1);\n\tSystem.out.printf(\"\\nDragon:\\t\\t\\t\"+enemigoVencido2);\n System.out.printf(\"\\nMighty Golem:\\t\\t\"+enemigoVencido3);\t\n }",
"public static void main(String[] args) {\n String matriz = \"ABCDEFGHIJLMNOPQRSTUVWXYZ\";\n Ejercicio1 c = new Ejercicio1();\n String retorno;\n String mensaje = JOptionPane.showInputDialog(\"Digite el mensaje\");\n// Convierte el mensaje a mayusculas\n mensaje = mensaje.toUpperCase();\n c.llenaMatriz(matriz);\n retorno = c.aTap(mensaje);\n JOptionPane.showMessageDialog(null, retorno);\n\n //Fin de la Primera parte del examen\n /*\n Inicio de la Segunda parte del examen\n */\n /*\n String[] lista = {\" auto \", \" pato \", \" palo \", \" poto \", \" amar \", \" amor \",\n \" loca \", \" loco \", \" polo \", \" poco \", \" poca \", \" rota \", \" roto \"};\n AdminPalabras admin = new AdminPalabras( lista );\n String[] letras = {\" escalopa \", \" automotor\", \" percatado\"};\n for(int i = 0; i < letras . length ; i ++) {\n int cont = admin .ContarPalabrasPosibles(letras [i ]);\n JOptionPane.showMessageDialog(null,letras [i] + \": \" + cont );\n }*/\n //Fin de la Segunda parte del Examen\n }",
"private void printHelp() \n {\n System.out.println(\"You are lost. You are alone. You wander\");\n System.out.println(\"around at the prision.\");\n System.out.println();\n System.out.println(\"Your command words are:\");\n System.out.println(parser.showCommands());\n }",
"void printUsage(){\n\t\tSystem.out.println(\"Usage: RefactorCalculator [prettyPrint.tsv] [tokenfile.ccfxprep] [cloneM.tsv] [lineM.tsv]\");\n\t\tSystem.out.println(\"Type -h for help.\");\n\t\tSystem.exit(1); //error\n\t}",
"private void printHelp() \n {\n System.out.println(\"Your command words are:\");\n parser.showCommands();\n }",
"@Override\n\tpublic void dialogar() {\n\t\tSystem.out.println(\"Ofrece un Discurso \");\n\t\t\n\t}",
"public void mostrar() {\n\t\tHerramientas.println(menu);\n\t}",
"public static void showOptions() {\n System.out.println(new StringJoiner(\"\\n\")\n .add(\"*************************\")\n .add(\"1- The participants' directory.\")\n .add(\"2- The RDVs' agenda.\")\n .add(\"3- Quit the app.\")\n .add(\"*************************\")\n );\n }",
"public void ejecutarComando() {\r\n\t\tsetVisible(true);\r\n\t}",
"@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"Pasos dados por \" + a.nombre + \" \" + a.distancia + \" m = \" + pasosActividad + \" / Pasos en total = \" + pasosTotal);\n\t}",
"private static void displayMainMenu() {\n\t\tSystem.out.println(\"\\t Main Menu Help \\n\" \n\t\t\t\t+ \"====================================\\n\"\n\t\t\t\t+ \"au <username> : Registers as a new user \\n\"\n\t\t\t\t+ \"du <username> : De-registers a existing user \\n\"\n\t\t\t\t+ \"li <username> : To login \\n\"\n\t\t\t\t+ \"qu : To exit \\n\"\n\t\t\t\t+\"====================================\\n\");\n\t}",
"public static void menuPrincicipal() {\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| Elige una opcion |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 1-Modificar Orden |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 2-Eliminar orden |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 3-Ver todas las ordenes |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t\tSystem.out.println(\"| 0-Salir |\");\n\t\tSystem.out.println(\"+---------------------------+\");\n\t}",
"@Override\n public String showHelp()\n {\n return new String(ChatColour.RED + \"Usage: \" + ChatColour.AQUA + this.getName());\n }",
"@Override\n public void help()\n {\n System.out.println(\"\\tcd [DEST]\");\n }",
"private void showCommands() {\n System.out.println(\"\\n Commands:\");\n System.out.println(\"\\t lf: List reference frames\");\n System.out.println(\"\\t af: Add a reference frame\");\n System.out.println(\"\\t rf: Remove a reference frame\");\n System.out.println(\"\\t le: List events\");\n System.out.println(\"\\t ae: Add an event\");\n System.out.println(\"\\t re: Remove an event\");\n System.out.println(\"\\t ve: View all events from a certain frame\");\n System.out.println(\"\\t li: Calculate the Lorentz Invariant of two events\");\n System.out.println(\"\\t s: Save the world to file\");\n System.out.println(\"\\t l: Load the world from file\");\n System.out.println(\"\\t exit: Exit the program\");\n }",
"public static void helpCommand(){\n\n System.out.println(\"--------list of controls-------\");\n System.out.println(\"'help' : display the list of control\");\n System.out.println(\"'exit' : for quit the app /n\");\n System.out.println(\"'adduser' : you can add user with this command,<fistname>,<lastname>,<country>,<departement>,<age>\");\n System.out.println(\"'edituser' : you can edit an user with this command, <firstname>,<lastname>\");\n System.out.println(\"'removeuser' : you can remove an user with this command, <firstanme>,<lastname>\");\n System.out.println(\"'listusers' : display all of users\");\n System.out.println(\"'addcar' : add a car to the list, <brand>,<model>,<ref>,<year>\");\n System.out.println(\"'editcar' : use this command for edit a car, <ref>\");\n System.out.println(\"'removecar' : use this command for remove a car\");\n System.out.println(\"'listcars' : display all the cars\");\n System.out.println(\"'rentcar' : command for rent a car\");\n System.out.println(\"'returncar' : command for return a car\");\n System.out.println(\"'listrent' : display the list of rents\");\n System.out.println(\"'saveusers' : use this command for save your users file\");\n System.out.println(\"'restoreusers' : use this command open your save users file\");\n System.out.println(\"'serialusers' : use this command serialize object users\");\n System.out.println(\"'saverents' : use this command save the list of rents in file\");\n System.out.println(\"'loadrents' : use this command load the list from file\");\n System.out.println(\"'savecars' : use this command for save the list of cars in a file\");\n System.out.println(\"'loadcars' : use this command for import the list from file \");\n System.out.println(\"'saveall' : use this command for save all the list in a file\");\n System.out.println(\"'loadall' : use this command for import all the list from file\");\n System.out.println(\"----------------------------------\");\n\n }",
"public void visMedlemskabsMenu ()\r\n {\r\n System.out.println(\"Du har valgt medlemskab.\");\r\n System.out.println(\"Hvad Oensker du at foretage dig?\");\r\n System.out.println(\"1: Oprette et nyt medlem\");\r\n System.out.println(\"2: Opdatere oplysninger paa et eksisterende medlem\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }",
"public void displaymenu()\r\n\t{\r\n\t\tSystem.out.println(\"Welcome to the COMP2396 Authentication system!\");\r\n\t\tSystem.out.println(\"1. Authenticate user\");\r\n\t\tSystem.out.println(\"2. Add user record\");\r\n\t\tSystem.out.println(\"3. Edit user record\");\r\n\t\tSystem.out.println(\"4. Reset user password\");\r\n\t\tSystem.out.println(\"What would you like to perform?\");\r\n\t}",
"private void menuArmadura(){\n System.out.println(\"Escolha o local em que queira colocar a uma armadura:\");\n System.out.println(\"1 - Cabeça\");\n System.out.println(\"2 - Tronco\");\n System.out.println(\"3 - Pernas\");\n System.out.println(\"4 - Pés\");\n System.out.println(\"0 - Sair\");\n }",
"public void afficherMessage () {\r\n System.out.println(\"(\"+valeur+\", \"+type+\")\"); \r\n }",
"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 }",
"public void showcommandhelp(Player p)\r\n \t{\n \t\tp.sendMessage(PixArtPlugin.versionheader);\r\n \t\tp.sendMessage(\"Pixel art creation tool\");\r\n \t\tp.sendMessage(\"Syntax:\");\r\n \t\tp.sendMessage(\"/pixart [option] [arguments]\");\r\n \t\tp.sendMessage(\"supported Options- build, calc, ScaleX,ScaleY,FlipX,FlipY,Mode\");\r\n \t\tp.sendMessage(\"use /pixart [option] help for help with each.\");\r\n \t\t\r\n \t\t\r\n \t\t\r\n \t}",
"public void visKontingenthaandteringMenu ()\r\n {\r\n System.out.println(\"Du har valgt kontingent.\");\r\n System.out.println(\"Hvad oensker du at foretage dig?\");\r\n System.out.println(\"1: Se priser\");\r\n System.out.println(\"2: Se medlemmer i restance\");\r\n System.out.println(\"0: Afslut\");\r\n\r\n }",
"private void mostrarEmenta (){\n }",
"static void listerMenu() {\n System.out.println(\n \"-------------------------------------\\n\" +\n \"Saisir une option :\\n\" +\n \"1 : Liste des hôtes\\n\" +\n \"2 : Liste des logements\\n\" +\n \"3 : Liste des voyageurs\\n\" +\n \"4 : Liste des réservations\\n\" +\n \"5 : Fermer le programme\"\n );\n switch (Menu.choix(5)) {\n case 1:\n GestionHotes.listerHotes();\n break;\n case 2:\n GestionLogements.listerLogements();\n break;\n case 3:\n GestionVoyageurs.listerVoyageurs();\n break;\n case 4:\n GestionReservations.listerReservations();\n break;\n case 5:\n System.exit(0);\n break;\n }\n }",
"public void showNoeudByClick() {\r\n\t\tSystem.out.print(\"Cliquez votre noeud: \");\r\n\t\tNoeud noeud = getNoeudByClick();\r\n\t\tthis.dessin.setColor(Color.RED);\r\n\t\tthis.dessin.putText(noeud.getLongitude(), noeud.getLatitude(), noeud.toString());\t\r\n\t\tSystem.out.println(noeud);\r\n\t}",
"public void helpPressed() {\n Stage mainStage = (Stage)pane.getScene().getWindow();\n PresentationCtrl.getInstance().showNotification(\"Information\", \"Information\", null,\n \"- Click <Clear> button to clear the history\\n\\n- Click <Refresh> button to refresh the history\" +\n \"\\n\\n- Double clicks on a row to see the detailed information\", mainStage);\n }",
"@Override\n\tpublic void sendHelp(ICommandSender sender) {\n\t}",
"public void botonOpciones(View view)\n {\n \tmostrarDialogoOpciones();\n }",
"public void displayHelpMenuView()\n {\n System.out.println(\"\\nHelp menu selected.\");\n }",
"public void mostrarVentanaRegistro() {\r\n\t\tmiVentanaRegistroP.setVisible(true);\r\n\t}",
"public void mostrarCompra() {\n }",
"public static void printInventoryHelpMessage() {\n\n UI.printEmptyLine();\n System.out.println(\"Here is a list of Inventory commands: \");\n\n UI.printEmptyLine();\n int[] lengthPara = {10,60,50};\n printer(new String[]{HELP_HEADER_COMMAND, HELP_HEADER_DESCRIPTION, HELP_HEADER_FORMAT}, lengthPara);\n UI.showLongLine();\n printer(new String[]{HELP_COMMAND, INVENTORY_HELP_DESCRIPTION, MARK_BLANK}, lengthPara);\n printer(new String[]{ADD_COMMAND, INVENTORY_ADD_DESCRIPTION, INVENTORY_ADD_FORMAT}, lengthPara);\n printer(new String[]{LIST_COMMAND, INVENTORY_LIST_DESCRIPTION, INVENTORY_LIST_FORMAT}, lengthPara);\n printer(new String[]{DELETE_COMMAND, INVENTORY_DELETE_DESCRIPTION, INVENTORY_DELETE_FORMAT}, lengthPara);\n printer(new String[]{RETURN_COMMAND, RETURN_DESCRIPTION, MARK_BLANK}, lengthPara);\n }",
"public void menuListados() {\n\t\tSystem.out.println(\"MENU LISTADOS\");\n\t\tSystem.out.println(\"1. Personas con la misma actividad\");\n\t\tSystem.out.println(\"2. Cantidad de personas con la misma actividad\");\n\t\tSystem.out.println(\"0. Salir\");\n\t}",
"private void presentMenu() {\n System.out.println(\"\\nHi there, kindly select what you would like to do:\");\n System.out.println(\"\\ta -> add a task\");\n System.out.println(\"\\tr -> remove a task\");\n System.out.println(\"\\tc -> mark a task as complete\");\n System.out.println(\"\\tm -> modify a task\");\n System.out.println(\"\\tv -> view all current tasks as well as tasks saved previously\");\n System.out.println(\"\\tct -> view all completed tasks\");\n System.out.println(\"\\ts -> save tasks to file\");\n System.out.println(\"\\te -> exit\");\n }",
"private void jMenuItemTemasAyudaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTemasAyudaActionPerformed\n JOptionPane.showMessageDialog(this, \"Leer informe\",\n this.getTitle(), JOptionPane.INFORMATION_MESSAGE);\n}",
"public void printInfo() {\r\n System.out.printf(\"%-25s\", \"Nomor Rekam Medis Pasien\");\r\n System.out.println(\": \" + getNomorRekamMedis());\r\n System.out.printf(\"%-25s\", \"Nama Pasien\");\r\n System.out.println(\": \" + getNama());\r\n System.out.printf(\"%-25s\", \"Tempat, Tanggal Lahir\");\r\n System.out.print(\": \" + getTempatLahir() + \" , \");\r\n getTanggalKelahiran();\r\n System.out.printf(\"%-25s\", \"Alamat\");\r\n System.out.println(\": \" + getAlamat());\r\n System.out.println(\"\");\r\n }",
"public void show() {\n\t\t// TODO Auto-generated method stub\n\n\t}",
"private static void showHelp(){\r\n JOptionPane.showMessageDialog(null, \"1. Choose the faculty.\\n\"\r\n + \"2. Type in the year when the school year started in format YYYY.\\n\"\r\n + \"3. Choose the semester.\\n\"\r\n + \"4. Enter subject codes separated by semicolon. You can add them all at once or add other subjects later.\\n\"\r\n + \"5. Press the Add button to load schedule options.\\n\"\r\n + \"6. Click on the loaded options you want to choose. Their color will turn red.\\n\"\r\n + \"7. Save the options you chose to the text file through File -> Save.\\n\",\r\n \"How-to\", JOptionPane.PLAIN_MESSAGE);\r\n }",
"protected void ACTION_B_HELP(ActionEvent arg0) {\n\t\t\r\n\t\tString msg = \"Network Packet Sniffer is JAva packet capturing and traffic analysis application\"\r\n\t\t\t\t+ \"\\n CAPTURE : Start capturing packets on the interface\"\r\n\t\t\t\t+ \"\\nSTOP : Stop capturing packets on the interface\"\r\n\t\t\t\t+ \"\\n LIST : List Network Interfaces on the host\"\r\n\t\t\t\t+ \"\\n SELECT : Select Interface to capture Packets with\"\r\n\t\t\t\t+ \"\\n FILTER : Filter on the selected port when filtering is enabled\"\r\n\t\t\t\t+ \"\\n ENABLE : Enable Port Filtering\"\r\n\t\t\t\t+ \"\\n HELP : Displays the help screen\"\r\n\t\t\t\t+ \"\\n SAVE : Save the information about the packet\"\r\n\t\t\t\t+ \"\\n LOAD : Load the saved data on the interface \"\r\n\t\t\t\t+ \"\\n \";\r\n\t\t\r\n\t\tJOptionPane.showMessageDialog(null, msg);\r\n\t}",
"public void showHelp();",
"private void showHelpDialog() {\n\n view.helpDialog();\n }",
"private void showAboutDialog() {\n JOptionPane.showMessageDialog(this, \"Sea Battle II Version 1.0\\nCS 232 (Computer Programming II), Fall 2018\");\n }",
"private void displayMenu()\r\n {\r\n System.out.println(\"\\nWelcome to Car Park System\");\r\n System.out.println(\"=============================\");\r\n System.out.println(\"(1)Add a Slot \");\r\n System.out.println(\"(2)Delete a Slot\");\r\n System.out.println(\"(3)List all Slots\");\r\n System.out.println(\"(4)Park a Car\");\r\n System.out.println(\"(5)Find a Car \");\r\n System.out.println(\"(6)Remove a Car\");\r\n System.out.println(\"(7)Exit \");\r\n System.out.println(\"\\nSelect an Option: \");\r\n }",
"public void showMenu() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\t1. Show vertices\");\n\t\tSystem.out.println(\"\\t2. Show adjacent vertices\");\n\t\tSystem.out.println(\"\\t3. Get vertex count\");\n\t\tSystem.out.println(\"\\t4. Get edge count\");\n\t\tSystem.out.println(\"\\t5. Add vertex\");\n\t\tSystem.out.println(\"\\t6. Add edge\");\n\t\tSystem.out.println(\"\\t7. Remove vertex\");\n\t\tSystem.out.println(\"\\t8. Remove edge\");\n\t\tSystem.out.println(\"\\t9. Check connectivity\");\n\t\tSystem.out.println(\"\\t0. Check adjacency\");\n\t\tSystem.out.println(\"\\tTRAVERSAL ALGORITHMS\");\n\t\tSystem.out.println(\"\\t11. Depth-first traversal\");\n\t\tSystem.out.println(\"\\t12. Breadth-first traversal\");\n\t\t\n\t\tSystem.out.println(\"\\tINPUT -1 TO EXIT\");\n\t\tSystem.out.println();\n\t}",
"private void showUsage(Command cmd, CommandSender sender, boolean prefix) {\n CommandInfo info = cmd.getClass().getAnnotation(CommandInfo.class);\n if(!PermHandler.hasPerm(sender, info.permission())) return;\n\n sender.sendMessage((prefix ? \"Usage: \" : \"\") + info.usage() + \" \" + ChatColor.YELLOW + info.desc());\n }",
"private void printCreateOrderMenu()\n {\n System.out.println(\"\");\n System.out.println(\"*** Opret Salg ***\");\n System.out.println(\"(0) Tilbage\");\n System.out.println(\"(1) Tilføj Medarbejder\");\n System.out.println(\"(2) Tilføj Kunde\");\n System.out.println(\"(3) Tilføj Produkt\");\n System.out.println(\"(4) Bekræft\");\n System.out.print(\"Valg: \");\n }",
"public static void presentarMenuPrincipal() {\n\t\tSystem.out.println(\"Ingresa el numero de la opcion deseada y preciona enter\");\n\t\tSystem.out.println(\"1 - Registrar nuevo libro\");\n\t\tSystem.out.println(\"2 - Consultar libros\");\n\t\tSystem.out.println(\"3 - terminar\");\n\t}",
"private void printHelp() {\n System.out.println(\"Your available command words are:\");\n parser.showCommands();\n }"
] | [
"0.7430538",
"0.66498",
"0.6463267",
"0.64504516",
"0.6428652",
"0.6411337",
"0.6403084",
"0.63793004",
"0.6334559",
"0.63190377",
"0.63117605",
"0.63039917",
"0.62886894",
"0.62274677",
"0.62225145",
"0.61847824",
"0.61782116",
"0.61740965",
"0.6147635",
"0.61193466",
"0.61168015",
"0.60990804",
"0.6091146",
"0.6083204",
"0.60697925",
"0.6045968",
"0.60378486",
"0.60363746",
"0.60286665",
"0.60146445",
"0.60095555",
"0.6008326",
"0.5987542",
"0.5987121",
"0.59834",
"0.59813666",
"0.5972903",
"0.59562355",
"0.5950288",
"0.5939821",
"0.5938964",
"0.5937211",
"0.5931672",
"0.59199023",
"0.59190667",
"0.5916266",
"0.5915452",
"0.5915365",
"0.5909245",
"0.59045184",
"0.5896878",
"0.5891495",
"0.58869904",
"0.5886541",
"0.5881279",
"0.5880625",
"0.58738744",
"0.5868589",
"0.5867338",
"0.5864187",
"0.5859631",
"0.5859521",
"0.58586186",
"0.5849997",
"0.58482265",
"0.5840984",
"0.58385456",
"0.5835554",
"0.5834753",
"0.58329904",
"0.5831838",
"0.58282435",
"0.582284",
"0.5816701",
"0.5814958",
"0.58139384",
"0.5809765",
"0.5808753",
"0.57917464",
"0.57865274",
"0.578388",
"0.5781551",
"0.5774149",
"0.57735926",
"0.5769623",
"0.5765965",
"0.576096",
"0.5760486",
"0.5753056",
"0.5749265",
"0.5748761",
"0.5745284",
"0.57449496",
"0.57395697",
"0.57379645",
"0.5736874",
"0.5735116",
"0.5735036",
"0.5731935",
"0.57283217",
"0.57242376"
] | 0.0 | -1 |
Get Mapping Get Posts | @GetMapping(path = "/posts")
public ResponseEntity getPosts(@RequestParam(required = false) String city) {
try {
List<Post> list = rocketLunchService.getPosts(city);
return ResponseEntity.ok().body(list);
} catch (Exception e) {
return ResponseEntity.badRequest().body(e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<BlogPost> getPosts();",
"List<PostInfo> getPostList();",
"List<Post> getAllPost() throws Exception;",
"@GetMapping(\"/getAllPosts\")\n public ResponseEntity<List<Post>> getAllPostDetails(){\n return new ResponseEntity<List<Post>>(postService.getAllInfoDetails(),HttpStatus.OK);\n }",
"@GetMapping(\"posts\")\n\tpublic List<Post> index() {\n\t\treturn postSvc.index();\n\t}",
"@GET(\"posts/\")\n Call<List<Post>>getPosts();",
"public List<Post> retriveAllPosts()\n\t {\n\t\t List<Post> Posts =(List<Post>) Postrepository.findAll();\n\t\t \n\t\t for(Post Post :Posts)\n\t\t {\n\t\t\t //l.info(\"Post +++ :\" +Post);\n\t\t }\n\t\t return Posts;\n\t\t\t \n\t }",
"@GetMapping(\"/post/{id}\")\n PostDTO getPostsById(@PathVariable Long id);",
"@GetMapping(\"/feed\")\n private ResponseEntity<List<Post>> getPosts() {\n User user = getCurrentUser();\n logger.info(\"Not null \" + (user == null));\n List<Post> posts = postService.findAllByUser(user);\n return new ResponseEntity<>(posts, HttpStatus.OK);\n }",
"@GetMapping(\"\")\n public ResponseEntity <List<Post>>listAllPosts() {\n return ResponseEntity.ok(postService.listAllPosts());\n }",
"@GET(\"posts/1\")\n public Call<Post> getPost();",
"@Override\r\n\tpublic List<Post> getAllPost() {\n\t\tString hql = \"from Post\";\r\n\t\treturn (List<Post>) getHibernateTemplate().find(hql);\r\n\t}",
"public static ResultSet getPosts(){\n ResultSet result = null;\n try {\n conn = ConnectionProvider.getCon();\n pst = conn.prepareStatement(\"select * from normalposts\");\n result = pst.executeQuery();\n\n System.out.println(\"PostDAO: getting posts\");\n } catch(Exception e) {\n System.out.println(\"PostDAO: unsuccessful query\");\n System.out.println(e);\n }\n return result;\n }",
"public List<Post> getPosts(){return this.posts;}",
"Map getAll();",
"List<Post> findAllPosts();",
"@SuppressWarnings(\"unchecked\")\n\tpublic List<Post> getPostsOf(int postId){\n \t\tList<Post> postList = null;\n\t\tCriteria query = null;\n\t\ttry {\n\t\t\t\n\t\t\t query = getCurrentSession().createCriteria(Post.class);\n\t\t\t \n\t\t\t query.createAlias(\"this.orgperson\", \"author\") \n\t\t\t .createAlias(\"author.personid\",\"authorPerson\")\n\t\t\t \t .createAlias(\"this.postcategories\", \"postcategories\")\n\t\t\t \t .createAlias(\"postcategories.category\", \"category\")\n\t\t\t \t .createAlias(\"this.postskills\", \"postskills\")\n\t\t\t \t .createAlias(\"postskills.skill\", \"skill\")\n\t\t\t \t .createAlias(\"this.posttags\", \"posttags\")\n\t\t\t \t .createAlias(\"posttags.tag\", \"tag\");\n\t\t\t \n\t\t\t query.add(Restrictions.eq(\"this.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"author.orgpersonstatus\", 'A'))\n\t\t\t \t .add(Restrictions.eq(\"authorPerson.personstatus\", 'A'))\n\t\t\t \t .add(Restrictions.eq(\"postcategories.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"category.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"postskills.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"skill.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"posttags.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"tag.status\", \"A\")) \n\t\t\t \t .add(Restrictions.eq(\"this.id\", postId));\n\t\t\t \n\t\t\t query.setProjection(Projections.projectionList()\n\t\t\t\t\t \n\t\t\t\t\t //post\n\t\t\t\t\t .add(Projections.property(\"this.id\").as(\"post_id\"))\n\t\t\t\t\t .add(Projections.property(\"this.title\").as(\"post_title\"))\n\t\t\t\t\t .add(Projections.property(\"this.content\").as(\"post_content\")) \n\t\t\t\t\t .add(Projections.property(\"this.bannerpath\").as(\"post_bannerpath\"))\n\t\t\t\t\t .add(Projections.property(\"this.commentable\").as(\"post_commentable\"))\n\t\t\t\t\t .add(Projections.property(\"this.date\").as(\"post_date\"))\n\t\t\t\t\t .add(Projections.property(\"this.media\").as(\"post_media\")) \n\t\t\t\t\t .add(Projections.property(\"this.status\").as(\"post_status\")) \n\t\t\t\t\t //authorperson\n\t\t\t\t\t .add(Projections.property(\"authorPerson.personid\").as(\"authorPersonPersonId\"))\n\t\t\t\t\t .add(Projections.property(\"authorPerson.firstName\").as(\"authorPersonFirstName\"))\n\t\t\t\t\t .add(Projections.property(\"authorPerson.lastName\").as(\"authorPersonLastName\"))\n\t\t\t\t\t .add(Projections.property(\"authorPerson.middleName\").as(\"authorPersonmiddleName\")) \n\t\t\t\t\t //category\n\t\t\t\t\t .add(Projections.property(\"category.id\").as(\"categoryId\")) \n\t\t\t\t\t .add(Projections.property(\"category.name\").as(\"categoryName\")) \n\t\t\t\t\t //skill\n\t\t\t\t\t .add(Projections.property(\"skill.id\").as(\"skillId\")) \n\t\t\t\t\t .add(Projections.property(\"skill.name\").as(\"skillName\")) \n\t\t\t\t\t//tag\n\t\t\t\t\t .add(Projections.property(\"tag.id\").as(\"tagId\")) \n\t\t\t\t\t .add(Projections.property(\"tag.name\").as(\"tagName\")) \n\t\t\t\t\t \n\t\t\t\t\t ); \n\t\t\t \n\t\t\t postList = query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP).list(); \n\t\t\t \t \t \n\t\t} catch (Exception e) {\n\t\t\tpostServiceLogger.error(\"error in PostService for getPostsOf()\",e);\n\t\t} \n\t\treturn postList;\n\t}",
"public static Result posts() {\n\t\tPost post = new Post();\n\t\tUser user = UserController.loggedInUser();\n\t\tif (user != null) {\n\t\t\tpost.city= user.city;\n\t\t\tpost.state = user.state;\n\t\t\tpost.country = user.country;\n\t\t\tpost.zipcode = user.zipcode;\n\t\t\tpost.createdBy = user.userName;\t\t\t\n\t\t}\n\t\t//TODO:Use bind() instead of the above to avoid 0.0 in price field\n\t\treturn ok(index.render(Post.listPosts(), form(Post.class).fill(post), user));\n\t}",
"@GetMapping(\"/allUsersPosts\")\n public ResponseEntity<List<PostResource>> retrieveAllPostsForAllUsers() {\n //first we will retrieve all users to get their ids\n List<Long> userIds = externalService.retrieveAllUserIds();\n\n //then we will search for every post based on userId\n List<PostResource> postResources = new ArrayList<>();\n for (Long userId : userIds) {\n postResources.addAll(externalService.retrievePostsForUser(userId));\n }\n\n return new ResponseEntity<>(postResources, HttpStatus.ACCEPTED);\n }",
"private List<Text> getPosts() {\n\t\tList<Text> result = new ArrayList<>();\n\t\tObservableList<Post> postList = PostDAO.searchPosts(String.valueOf(friendsID));\n\t\tfor(Post post : postList) {\n\t\t\tString postTime = post.getPostTime();\n\t\t\tString content = post.getPostContent();\n\t\t\tString editTime = post.getEditTime();\n\t\t\tString toPost;\n\t\t\tif(editTime != null) {\n\t\t\t\ttoPost = \"Post on \" + postTime + \" Last edit on \" + editTime + \"\\n\" + content + \"\\n\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttoPost = \"Post on \" + postTime + \"\\n\" + content + \"\\n\";\n\t\t\t}\n\t\t\tText text = new Text(toPost);\n\t\t\tresult.add(text);\n\t\t}\n\t\treturn result;\n\t}",
"public Collection getPosts() throws DatabaseException;",
"public Iterable<Post> listAllPosts();",
"public List getAllBlogPosts(){\n return blogPostFacade.findAll();\n }",
"@GetMapping(\"/\")\n public String allThePosts(Model viewModel) {\n\n viewModel.addAttribute(\"posts\", postService.findAll());\n return \"/blog_template/index\";\n }",
"@GetMapping(\"/{id}\")\n public ResponseEntity<Post> getPostById(@PathVariable Long id){\n Post post = postService.getPostById(id);\n return ResponseEntity.ok(post);\n }",
"public List<?> getPosts(long organizationid) {\n\t\t \n\t\tList<?> postsList = null;\n\t\tCriteria query = null;\n\t\ttry { \n\t\t\tquery = getCurrentSession().createCriteria(Post.class); \n\t\t\t//aliases\n\t\t\tquery.createAlias(\"this.orgperson\", \"author\")\n\t\t\t\t .createAlias(\"author.organizationid\", \"organization\")\n\t\t\t\t .createAlias(\"author.personid\", \"orgperson\");\n\t\t\t//restrictions\n\t\t\tquery.add(Restrictions.eq(\"this.status\", \"A\"))\n\t\t\t\t .add(Restrictions.eq(\"author.orgpersonstatus\", 'A'))\n\t\t\t\t .add(Restrictions.eq(\"orgperson.personstatus\", 'A'))\n\t\t\t\t .add(Restrictions.eq(\"organization.organizationid\", organizationid)); \n\t\t\t\n\t\t\t\n\t\t\tquery.setProjection(Projections.projectionList()\n\t\t\t\t\t//post projections\n\t\t\t\t\t.add(Projections.distinct(Projections.property(\"this.id\").as(\"id\")))\n\t\t\t\t\t.add(Projections.property(\"this.bannerpath\").as(\"bannerpath\"))\n\t\t\t\t\t.add(Projections.property(\"this.commentable\").as(\"commentable\"))\n\t\t\t\t\t.add(Projections.property(\"this.content\").as(\"content\"))\n\t\t\t\t\t.add(Projections.property(\"this.date\").as(\"date\"))\n\t\t\t\t\t.add(Projections.property(\"this.media\").as(\"media\"))\n\t\t\t\t\t.add(Projections.property(\"this.status\").as(\"status\"))\n\t\t\t\t\t.add(Projections.property(\"this.title\").as(\"title\"))\n\t\t\t\t\t\n\t\t\t\t\t//author projections\n\t\t\t\t\t.add(Projections.property(\"author.orgpersonid\").as(\"authororgpersonid\")) \n\t\t\t\t\t.add(Projections.property(\"author.orgpersonstatus\").as(\"authororgpersonstatus\"))\n\t\t\t\t\t\n\t\t\t\t\t.add(Projections.property(\"orgperson.personid\").as(\"orgpersonId\"))\n\t\t\t\t\t.add(Projections.property(\"orgperson.firstName\").as(\"orgpersonFirstName\"))\n\t\t\t\t\t.add(Projections.property(\"orgperson.lastName\").as(\"orgpersonLastName\"))\n\t\t\t\t\t.add(Projections.property(\"orgperson.middleName\").as(\"orgpersonMiddleName\"))\n\t\t\t\t\t.add(Projections.property(\"orgperson.personphotourl\").as(\"orgpersonPhotourl\")) \n\t\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t);\n\t\t\t \n\t\t\tOrder order = Order.desc(\"this.date\");\n\t\t\tquery.addOrder(order);\n\t\t\tpostsList = query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP).list(); \n\t\t\t \n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tpostServiceLogger.error(\"error in PostService for getPosts()\",e);\n\t\t}\n\t\treturn postsList;\n\t}",
"@GetMapping //Sempre que houver uma requisição externa com o método GET através da url \"/postagens\" o metodo GetAll será executado\n\tpublic ResponseEntity<List<Postagem>> GetAll(){\n\treturn ResponseEntity.ok(repository.findAll()); //retornar ok, com a requisição de todas as postagens\n\t}",
"@GET(\"trigger\")\n Call<Post> getPosts(@Query(\"shortid\") String shortid,\n @Query(\"pin\") String pin,\n @Query(\"app\") String app\n );",
"@GetMapping(\"/posts/user/{userName}\")\n List<PostDTO> getPostsByUsername(@PathVariable String userName);",
"public List<PostDto> displayPostList(UserDto user);",
"Optional<Post> getPost(String postId) throws Exception;",
"public interface PostCatgMapper {\n\n}",
"@GET(\"/auth/api/v1/user/{id}/post/list?\")\n Call<JsonObject> fetchAllPost(@Path(\"id\") String id,@Query(\"api_token\") String token);",
"@GetMapping(\"/posts/picture/{pictureId}\")\n List<PostDTO> getPostsByPicId(@PathVariable Long pictureId);",
"@GET(\"posts/{id}\")\n public Call<Post> getPost(@Path(\"id\") int postId);",
"List<Post> getPostForUser(String email) throws Exception;",
"@SuppressWarnings(\"unchecked\")\n\tpublic List<Post> getPostsOf(int postId , int userId){\n\t\t\n\t\tList<Post> postList = null;\n\t\tCriteria query = null;\n\t\ttry {\n\t\t\t\n\t\t\t query = getCurrentSession().createCriteria(Post.class);\n\t\t\t \n\t\t\t query.createAlias(\"this.orgperson\", \"author\") \n\t\t\t .createAlias(\"author.personid\",\"authorPerson\")\n\t\t\t \t .createAlias(\"this.postcategories\", \"postcategories\")\n\t\t\t \t .createAlias(\"postcategories.category\", \"category\")\n\t\t\t \t .createAlias(\"this.postskills\", \"postskills\")\n\t\t\t \t .createAlias(\"postskills.skill\", \"skill\")\n\t\t\t \t .createAlias(\"this.posttags\", \"posttags\")\n\t\t\t \t .createAlias(\"posttags.tag\", \"tag\");\n\t\t\t \n\t\t\t query.add(Restrictions.eq(\"this.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"author.orgpersonstatus\", 'A'))\n\t\t\t \t .add(Restrictions.eq(\"authorPerson.personstatus\", 'A'))\n\t\t\t \t .add(Restrictions.eq(\"postcategories.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"category.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"postskills.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"skill.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"posttags.status\", \"A\"))\n\t\t\t \t .add(Restrictions.eq(\"tag.status\", \"A\")) \n\t\t\t \t .add(Restrictions.eq(\"this.id\", postId))\n\t\t\t \t .add(Restrictions.eq(\"author.orgpersonid\", userId));\n\t\t\t \n\t\t\t query.setProjection(Projections.projectionList()\n\t\t\t\t\t \n\t\t\t\t\t //post\n\t\t\t\t\t .add(Projections.property(\"this.id\").as(\"post_id\"))\n\t\t\t\t\t .add(Projections.property(\"this.title\").as(\"post_title\"))\n\t\t\t\t\t .add(Projections.property(\"this.content\").as(\"post_content\")) \n\t\t\t\t\t .add(Projections.property(\"this.bannerpath\").as(\"post_bannerpath\"))\n\t\t\t\t\t .add(Projections.property(\"this.commentable\").as(\"post_commentable\"))\n\t\t\t\t\t .add(Projections.property(\"this.date\").as(\"post_date\"))\n\t\t\t\t\t .add(Projections.property(\"this.media\").as(\"post_media\")) \n\t\t\t\t\t .add(Projections.property(\"this.status\").as(\"post_status\")) \n\t\t\t\t\t //authorperson\n\t\t\t\t\t .add(Projections.property(\"authorPerson.personid\").as(\"authorPersonPersonId\"))\n\t\t\t\t\t .add(Projections.property(\"authorPerson.firstName\").as(\"authorPersonFirstName\"))\n\t\t\t\t\t .add(Projections.property(\"authorPerson.lastName\").as(\"authorPersonLastName\"))\n\t\t\t\t\t .add(Projections.property(\"authorPerson.middleName\").as(\"authorPersonmiddleName\")) \n\t\t\t\t\t //category \n\t\t\t\t\t .add(Projections.property(\"postcategories.id\").as(\"postCategoryId\"))\n\t\t\t\t\t .add(Projections.property(\"postcategories.status\").as(\"postCategoryStatus\"))\n\t\t\t\t\t .add(Projections.property(\"category.id\").as(\"categoryId\")) \n\t\t\t\t\t .add(Projections.property(\"category.name\").as(\"categoryName\")) \n\t\t\t\t\t //skill\n\t\t\t\t\t .add(Projections.property(\"postskills.id\").as(\"postSkillsId\"))\n\t\t\t\t\t .add(Projections.property(\"postskills.status\").as(\"postSkillsStatus\"))\n\t\t\t\t\t .add(Projections.property(\"skill.id\").as(\"skillId\")) \n\t\t\t\t\t .add(Projections.property(\"skill.name\").as(\"skillName\")) \n\t\t\t\t\t//tag\n\t\t\t\t\t .add(Projections.property(\"posttags.id\").as(\"postTagsId\"))\n\t\t\t\t\t .add(Projections.property(\"posttags.status\").as(\"postTagsStatus\"))\n\t\t\t\t\t .add(Projections.property(\"tag.id\").as(\"tagId\")) \n\t\t\t\t\t .add(Projections.property(\"tag.name\").as(\"tagName\")) \n\t\t\t\t\t \n\t\t\t\t\t ); \n\t\t\t \n\t\t\t postList = query.setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP).list();\n\t\t\t \n\t\t\t \t \t \n\t\t} catch (Exception e) {\n\t\t\tpostServiceLogger.error(\"error in PostService for getPostsOf()\",e);\n\t\t}\n\t\treturn postList;\n\t}",
"void displayAllPosts();",
"private void createPostMap() {\n Map<String, String> map = new HashMap<>();\n map.put(\"userId\", \"12\");\n map.put(\"title\", \"New Title\");\n Call<PostModel> call = jsonPlaceHolderAPI.createPostMap(map);\n call.enqueue(new Callback<PostModel>() {\n @Override\n @EverythingIsNonNull\n public void onResponse(Call<PostModel> call, Response<PostModel> response) {\n if (!response.isSuccessful()) {\n textResult.setText(response.code());\n return;\n }\n PostModel postResponse = response.body();\n String content = \"\";\n assert postResponse != null;\n content += \"Code: \" + response.code() + \"\\n\";\n content += \"ID: \" + postResponse.getId() + \"\\n\";\n content += \"User ID: \" + postResponse.getUserId() + \"\\n\";\n content += \"Title: \" + postResponse.getTitle() + \"\\n\";\n content += \"Body: \" + postResponse.getText();\n textResult.append(content);\n }\n\n @Override\n @EverythingIsNonNull\n public void onFailure(Call<PostModel> call, Throwable t) {\n textResult.setText(t.getMessage());\n }\n });\n }",
"private List<String> searchForPosts(){\n String userId = searchForUser();\n List <String> postIds;\n String response = given().\n get(\"/posts\").then().extract().asString();\n postIds = from(response).getList(String.format(\"findAll { it.userId.equals(%s) }.id\", userId));\n return postIds;\n }",
"com.google.ads.googleads.v6.resources.FeedMapping getFeedMapping();",
"@Override\n\tpublic List<Post> list() {\n\t\treturn null;\n\t}",
"@GET(\"posts/1\")\n Call<Post> getPostOne();",
"public interface PostService {\n @GET(\"posts/index\")\n Call<List<Pokemon>> downloadPosts(@Query(\"post[pokemon_id]\") int pokemonId);\n}",
"@RequestMapping(\"/post/{postId}\")\n public PostEntity postPage(@PathVariable int postId) {\n List<NodeEntity> commentList = nodeService.commentsByPost(postId);\n //get root post\n PostEntity post = postService.findPostById(postId);\n //populate list of nodes in post object with first-level comments\n post.setNodeList(firstLevelNodes(commentList,postId));\n\n //initialize recursive method by starting loop through first-level comments\n for (NodeEntity node : post.getNodeList()) {\n traverseNodes(commentList,node);\n }\n\n //return post with nested lists populated\n return post;\n }",
"@GET(\"posts\")\n public Call<List<Post>> getPost(@Query(\"userId\") String userId);",
"public Mono<ServerResponse> getAllPost(ServerRequest request) {\r\n Flux<Post> posts = repository.findAll();\r\n return ServerResponse.ok()\r\n .contentType(MediaType.APPLICATION_JSON_UTF8)\r\n .body(posts, Post.class);\r\n }",
"@RequestMapping(value = \"/blog/{postId}\", method = RequestMethod.GET)\n @ResponseBody\n public Post getBlogPostPage(@PathVariable(\"postId\") int postId) {\n Post selectedPost = daoP.getPostById(postId);\n return selectedPost; //is this correct? we want to return the post object to Ajax to parse and place in page.\n\n }",
"@GetMapping(value=\"/allstorys\")\n\tpublic @ResponseBody List<Story> selectAllPosts() {\n\t\tloggy.info(\"List of all Stories pulled from the database\");\n\t\treturn storyServ.selectAllStories();\n\t}",
"@Override\n public PostListDTO getPosts( Long categoryId, int pageNum, int pageSize ) {\n if( categoryId != null && categoryId > -1)\n validateCategoryId( categoryId );\n //create a PageRequest\n PageRequest pageRequest = pageRequestBuilder.buildPageRequest( pageNum, pageSize, Sort.Direction.DESC,\"created\" );\n //retrieve the posts\n Page<Post> page;\n if ( categoryId > -1 )\n page = postRepository.findAllByCategory_IdAndParentNull( categoryId, pageRequest );\n else\n page = postRepository.findAllByParentNullOrderByCreatedDesc( pageRequest );\n List<PostDTO> postDTOS = new ArrayList<>();\n page.forEach( post -> {\n PostDTO dto = buildReturnDto( post );\n postDTOS.add( dto );\n } );\n return new PostListDTO( postDTOS, PageRequestBuilder.buildPageInfoResponse(page) );\n }",
"private Map getMapping() {\n return getIndexOperations().getMapping();\n }",
"@GetMapping(\"posts/{id}\")\n public Post getById(@PathVariable Long id){\n return postService.getById(id)\n .orElseThrow(()->new ResponseStatusException(HttpStatus.NOT_FOUND));\n }",
"@RequestMapping(\"/homelist\")\n public Page<PostEntity> mainPage() {\n return postService.getPage(0);\n }",
"public BlogPost getPostById(Long id);",
"@Override\n public ArrayList<PostVo> get_post_by_page(int page) {\n ArrayList<PostVo> posts = (ArrayList<PostVo>) baseDAO.findBySQLForVO(\"\" +\n \"select p.p_id as pId , p.p_floor as pFloor , p.p_main as pMain , p.p_title as pTitle\" +\n \" , u.u_name as uName from Post as p join user as u on p.u_id = u.u_id \"\n ,PostVo.class,null,10*(page-1),10);\n return posts;\n }",
"Post getPostByID(long postId);",
"List<Post> findAll();",
"public List<Post> all() throws DataAccessException{\n String sql = \"select posts.id, posts.user_id, users.name, posts.title, posts.content, posts.create_date from posts join users on posts.user_id=users.id\";\n List<Post> posts = this.jdbcTemplate.query(sql, mapper);\n return posts;\n }",
"@Override\r\n\tpublic List<Post> getPostByName(String name) {\n\t\tString hql = \"from Post p where p.post_name =?\";\r\n\t\treturn (List<Post>) getHibernateTemplate().find(hql, name);\r\n\t}",
"@GetMapping(\"/{post_id}\")\n private ResponseEntity<Post> getPost(@PathVariable Long post_id) {\n User user = getCurrentUser();\n Post post = postService.findById(post_id).orElse(null);\n\n if (post == null) {\n return ResponseEntity.notFound().build();\n } else {\n return ResponseEntity.ok(post);\n }\n }",
"private void queryPosts() {\n ParseQuery<OutfitPost> query = ParseQuery.getQuery(OutfitPost.class);\n // only include data referred by user key\n query.include(OutfitPost.KEY_USER);\n query.whereEqualTo(OutfitPost.KEY_USER, ParseUser.getCurrentUser());\n // limit query to latest 20 items\n query.setLimit(20);\n // order posts by creation date (newest first)\n query.addDescendingOrder(OutfitPost.KEY_CREATED_KEY);\n // start an asynchronous call for posts\n query.findInBackground(new FindCallback<OutfitPost>() {\n @Override\n public void done(List<OutfitPost> posts, ParseException e) {\n // check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n // Save oldest post in query for loading more posts\n if (posts.size() > 0) {\n oldestPost = posts.get(posts.size() - 1).getCreatedAt();\n }\n // update adapter with posts list\n adapter.clear();\n adapter.addAll(posts);\n }\n });\n }",
"@Override\n\tpublic void getPost(Scanner sc) {\n\t\tPost p;\n\t\tgetAll();\n\t\tSystem.out.print(\"보고 싶은 리뷰의 번호를 입력해 주세요 >>\");\n\t\tp = dao.selectPost(sc.nextInt());\n\t\tSystem.out.println(p.getPostName());\n\t\tSystem.out.println(p.getContent());\n\t}",
"@GetMapping(\"/getPost/{id}\")\n public ResponseEntity<Optional<Post>> getPostDetails(@PathVariable @RequestBody Long id){\n return new ResponseEntity<Optional<Post>>(postService.getPost(id),HttpStatus.OK);\n }",
"@Test\n public void mapGet() {\n check(MAPGET);\n query(MAPGET.args(MAPNEW.args(\"()\"), 1), \"\");\n query(MAPGET.args(MAPENTRY.args(1, 2), 1), 2);\n }",
"public HashMap<Integer,T> loadPost() throws IOException, SQLException, ClassNotFoundException;",
"public Page<Post> getNewPosts(){\n Pageable page = new PageRequest(0, 3, Sort.Direction.DESC, \"createdAt\");\n System.out.println(\"getNewPosts\");\n // Page<Post> posts = postRepository.findTop10OrderByCreatedAtOrderByCreatedAtDesc(page);\n // List<Post> p = postRepository.getNewestPosts();\n\n Page<Post> pp = postRepository.findAll(page);\n\n for (Post p :pp){\n logger.info(\"getNewPosts -> \" + p);\n }\n return pp;\n/* for (Post p :posts){\n System.out.println(\"p->\" + p);\n }\n if (posts != null)\n return posts;\n return null;*/\n }",
"@Override\n public List<Post> getPostsByUser(Long userId) {\n return userDao.gePostsByUser(userId);\n }",
"public synchronized List<Post> getPosts(int groupId) {\n try {\n this.connect();\n return linkedin.groupOperations().getPosts(groupId).getPosts();\n } catch (Exception e) {\n log.debug(\"Exception occured when reading posts from group: \" + groupId);\n }\n return null;\n }",
"@GET\n public Map<String, String> get() {\n return first.created();\n }",
"public Iterable<Post> findAll(){\n return postDao.findAll();\n }",
"public void map()\n\t{\n\t // key is the documentId\n\t\t// value is the url\n\t\t//fetch the document using the documentId\n\t\t\n\t}",
"@Override\n public List<Post> postList() {\n List<Post> savedPosts = (List<Post>) postRepository.findAll();\n Set<Long> userIdList = savedPosts.stream().map(Post::getUserId).collect(Collectors.toSet());\n\n User[] rateResponse = sender.getUsersByUserId(userIdList);\n\n HashMap<Long, User> userHashMap = new LinkedHashMap<>();\n for (User user : rateResponse) {\n userHashMap.put(user.getUserId(), user);\n }\n for (Post savedPost : savedPosts) {\n savedPost.setUser(userHashMap.get(savedPost.getUserId()));\n }\n return savedPosts;\n }",
"Achievements getPostDetails();",
"public List<Post> getPostByName(String search) {\n\t\treturn pm.getPostByName(search);\r\n\t}",
"public PostingsList getPostings( String token ) {\n PostingsList post = new PostingsList();\n if(this.index.containsKey(token))\n post = (this.index.get(token)).clone();\n /*System.err.println(\"start search...\");\n // Read JSON file associated to token and return it as a postingslist\n String filename = \"postings/t\"+hash(token)+\".json\";\n PostingsList post = new PostingsList();\n try(Reader reader = new FileReader(filename)){\n post = (new Gson()).fromJson(reader, PostingsList.class);\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n return post;\n }",
"public List<Post> getMyPostById(int id) {\n\t\treturn pm.getMyPostById(id);\r\n\t}",
"@RequestMapping(value = {\"/fpost/list\"}, method = RequestMethod.GET)\r\n\tpublic ResponseEntity<List<Fpost>> fetchAllFposts() {\r\n\t\tSystem.out.println(\"fetching list of all fposts\");\r\n\t\tList<Fpost> fpost = fpostDAO.list();\r\n\t\treturn new ResponseEntity<List<Fpost>>(fpost, HttpStatus.OK);\r\n\t}",
"private PostDTO buildReturnDto( Post post ) {\n PostDTO postDTO = postMapper.postToPostDto( post );\n postDTO.setPostUrl( buildPostUrl( post ) );\n postDTO.getUser().setAvatarUrl( avatarService.buildAvatarUrl( post.getUser() ) );\n //if post is a child post, set the parentPostUrl\n if ( post.getParent() != null ) postDTO.setParentPostUrl( buildPostUrl( post.getParent() ));\n if ( post.getChildren() != null ) {\n for ( int i = 0; i < post.getChildren().size(); i++ ) {\n PostDTO childDTO = postDTO.getChildren().get( i );\n Post child = post.getChildren().get( i );\n childDTO.setPostUrl( buildPostUrl( post.getChildren().get( i ) ) );\n childDTO.getUser().setAvatarUrl( avatarService.buildAvatarUrl( child.getUser() ) );\n childDTO.setParentPostUrl( buildParentPostUrl( child ) );\n }\n }\n return postDTO;\n }",
"public List<Posts> listPosts() {\n\t\treturn this.findAll();\n\t}",
"private static ArrayList<Posts> extractFeatureFromJson(String postJSON) {\n if (TextUtils.isEmpty(postJSON)) {\n\n //Toast.makeText(this , \"null json string\", Toast.LENGTH_SHORT).show();\n return null;\n }\n ArrayList<Posts> posts = new ArrayList<>();\n\n try {\n JSONObject baseJsonResponse = new JSONObject(postJSON);\n JSONArray feed = baseJsonResponse.getJSONArray(\"posts\");\n\n JSONObject c = feed.getJSONObject(0);\n JSONObject insta = c.getJSONObject(\"instagram\");\n JSONArray profile = insta.getJSONArray(\"profile_posts\");\n\n JSONObject f = profile.getJSONObject(0);\n\n JSONObject entry =f.getJSONObject(\"entry_data\");\n JSONArray ProfilePage = entry.getJSONArray(\"ProfilePage\");\n JSONObject d= ProfilePage.getJSONObject(0);\n JSONObject user = d.getJSONObject(\"user\");\n\n JSONObject media = user.getJSONObject(\"media\");\n JSONArray nodes = media.getJSONArray(\"nodes\");\n\n for(int i=0;i<nodes.length();i++)\n {\n JSONObject ca = nodes.getJSONObject(i);\n\n\n String text= ca.getString(\"caption\");\n String time = ca.getString(\"date\");\n posts.add(new Posts(time, text));\n\n }\n\n } catch (JSONException e) {\n Log.e(LOG_TAG, \"Problem parsing the posts JSON results\", e);\n }\n return posts;\n }",
"@GET(\"rest/emprego\")\n Call<List<Posto>> callListPostoSINE();",
"@Override\r\n public List<Post> findAll() {\r\n List<Post> posts = new ArrayList<>();\r\n List<Map<String, Object>> rows = jdbcOp.queryForList(SQL_SELECT_ALL_TICKET);\r\n\r\n for (Map<String, Object> row : rows) {\r\n Post post = new Post();\r\n \r\n int id = (int)row.get(\"id\");\r\n post.setId(id); \r\n \r\n String customername = (String)row.get(\"customername\");\r\n post.setCustomerName(customername); \r\n \r\n String subject = (String)row.get(\"subject\");\r\n post.setSubject(subject);\r\n \r\n String body = (String)row.get(\"body\");\r\n post.setBody(body);\r\n \r\n String categories = (String)row.get(\"categories\");\r\n post.setCategories(categories);\r\n \r\n posts.add(post);\r\n }\r\n return posts;\r\n }",
"@GetMapping()\n\tpublic @ResponseBody ProccessMagazineDTO getMagazines() {\n\t\tString username = this.tokenUtils.getUsernameFromToken(this.httpServletRequest.getHeader(\"X-Auth-Token\"));\n\t\tSystem.out.println(\"dobavljam casopise za korisnika: \" + username);\n\t\tCollection<MagazineDTO> magazines = magazineService.getAll(username);\n\t\tProccessMagazineDTO pmd = new ProccessMagazineDTO(magazines);\n\t\treturn pmd;\n\n\t}",
"PaginatedSearchResponseModel findAllPostsForType(String type, Pageable page);",
"public interface PostsApi {\n\n @GET(\"/posts\")\n Call<ArrayList<Post>> getPosts ();\n\n @GET(\"/posts\")\n Call<ArrayList<Post>> getPostsByUserId (\n @Query(\"userId\") int userId\n );\n}",
"public Collection<Map<String, String>> getLinks();",
"public VBeatPostModel getPost(String postId){\n List<VBeatPostModel> postList = AppLocalDB.getInstance().db.postDao().getPost(postId);\n\n if(postList.size() == 0) {\n return null;\n } else {\n return postList.get(0);\n }\n\n }",
"public synchronized List<Post> getGroupPostsWithMoreInfo(int count, int start) {\n try {\n this.connect();\n Group.GroupPosts groupPosts = linkedin.restOperations().getForObject(\n \"http://api.linkedin.com/v1/groups/{group-id}/posts\" +\n \":(creation-timestamp,title,summary,id,\" +\n \"creator:(first-name,last-name))?\" +\n \"count=\" + count +\n \"&start=\" + start +\n \"&order=recency\",\n Group.GroupPosts.class, groupId);\n return groupPosts.getPosts();\n } catch (Exception e) {\n log.debug(\"Exception occured when reading posts from group: \" + groupId);\n }\n return null;\n }",
"protected void queryPosts() {\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n //get all the post objects from the database\n query.include(Post.KEY_USER);\n //set the limit to 20 posts being retrieved\n query.setLimit(POSTS_QUERY_LIMIT);\n\n query.addDescendingOrder(Post.KEY_CREATED_KEY);\n\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e) {\n // e == null if success\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n\n for (Post post : posts) {\n Log.i(TAG, \"Post: \" + post.getDescription() + \", username: \" + post.getUser().getUsername());\n }\n adapter.clear();\n allPosts.addAll(posts);\n adapter.notifyDataSetChanged();\n }\n });\n }",
"@Override\r\n\tpublic List<Post> findAll() {\n\t\treturn codeblogRepository.findAll();\r\n\t}",
"@Override\n\tpublic void getAll() {\n\t\tArrayList<Post> list = new ArrayList<Post>();\n\t\tlist = dao.selectAll();\n\t\t\n\t\tfor (Post p : list) {\n\t\t\tSystem.out.println(p.getPostId() + \".\" + p.getPostName() + \" 작성자:\" + p.getMemberId());\n\t\t}\n\t}",
"private void readPosts() {\n FirebaseDatabase.getInstance().getReference().child(\"Posts\").addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n postList.clear();\n for(DataSnapshot dataSnapshot:snapshot.getChildren())\n {\n Post post = dataSnapshot.getValue(Post.class);\n for(String id : followingList)\n {\n if(post.getPublisher().equals(id))\n {\n postList.add(post);\n }\n }\n }\n postAdapter.notifyDataSetChanged();\n\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n }",
"public List<BlogPost> getBlogPosts(String query) throws UnsupportedEncodingException, SSOException{\n String fields = \"name,description,content,cat,source,title,state,createdby,updateddate\";\n\t\t\n List<AssetInfo> assetinfoList = search(wcs.getCsSiteName(), \"FW_BlogPost\", query, fields, null, null, \"updateddate\", \"desc\").getAssetinfos();\n List<BlogPost> assets = null;\n \n \n if(assetinfoList!= null && assetinfoList.size()>0){\n \tassets = new ArrayList<BlogPost>();\n\t for(AssetInfo info : assetinfoList){\n\t \t\n\t \t\t\n\n\t \tBlogPost a = new BlogPost();\n\t \ta.setId(info.getId().split(\":\")[1]);\n\t \ta.setDescription(Mapper.getField(\"description\",info.getFieldinfos()) );\n\t \ta.setName(Mapper.getField(\"name\",info.getFieldinfos()) );\n\t \ta.setTitle(Mapper.getField(\"title\",info.getFieldinfos()) );\n\t \ta.setContent(Mapper.getField(\"content\",info.getFieldinfos()) );\n\t \ta.setState(Mapper.getField(\"state\",info.getFieldinfos()) );\n\n\t \ta.setCreatedby(Mapper.getField(\"createdby\",info.getFieldinfos()) );\n\t \ta.setCreateddate(Mapper.getField(\"updateddate\",info.getFieldinfos()) );\n\n\n\t \tassets.add(a);\n\t }\n }\n \n return assets;\n\t\t\n\t}",
"@Override\n public Map<String, PostList> getPostPack(int file) {\n CachedPostPack c = get(file);\n\n if (c == null) {\n return null;\n }\n\n return c.getPostPack();\n }",
"public interface DummyService {\n\n @GET(\"posts\")\n Observable<List<Post>> getPosts();\n\n @GET(\"posts/{nr}\")\n Observable<Post> getChosenPost(@Path(\"nr\") int nr);\n}",
"@GetMapping(\"/tag\")\r\n public Flux<Post> findbytag(@RequestParam(name = \"x\") String tag) {\n System.out.println(\" ================================== \");\r\n return repository.findPostByTag(tag);\r\n }",
"@GetMapping\n public ResponseEntity<BasePaginationRes> searchDynamicPosts(final Long categoryId, AdminPostSearchReq req) {\n Page<Post> posts = postListBloc.searchDynamicPosts(categoryId,req);\n\n return ResponseEntity.ok(PaginationHelper.buildBasePaginationRes(\n posts.map(PostMapper.INSTANCE::toAdminPostRes)\n ));\n }",
"public List<Post> getCreatedPosts() {\n return createdPosts;\n }",
"protected void queryPosts()\n {\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n query.include(Post.KEY_USER);\n query.whereEqualTo(Post.KEY_USER, ParseUser.getCurrentUser());\n query.setLimit(20);\n query.addDescendingOrder(Post.KEY_CREATED_AT);\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e)\n {\n if(e != null)\n {\n Log.e(TAG, \"Issue with getting posts\", e);\n }\n for(Post post : posts)\n {\n Log.i(TAG, \"Post: \" + post.getDescription() + \", username\" + post.getUser().getUsername());\n }\n adapter.clear();\n allPosts.addAll(posts);\n swipeContainer.setRefreshing(false);\n adapter.notifyDataSetChanged();\n\n }\n });\n }",
"@GetMapping(\"/commentaries/{postId}\")\n List<CommentaryDTO> getCommentariesInPost(@PathVariable Long postId);"
] | [
"0.6544685",
"0.6479911",
"0.62985045",
"0.62909085",
"0.6239517",
"0.62220764",
"0.59565026",
"0.5940338",
"0.58992213",
"0.58931804",
"0.57782406",
"0.5762602",
"0.57619053",
"0.5759465",
"0.5747699",
"0.56699353",
"0.56607",
"0.5649968",
"0.5632062",
"0.5600758",
"0.5574924",
"0.5561319",
"0.5548284",
"0.553744",
"0.55307925",
"0.5528883",
"0.55284745",
"0.5477163",
"0.54739594",
"0.5473072",
"0.54544526",
"0.5432104",
"0.5400131",
"0.53892845",
"0.53878194",
"0.5385032",
"0.5380902",
"0.5374582",
"0.537151",
"0.5369033",
"0.53619415",
"0.53551793",
"0.5343196",
"0.5334551",
"0.533375",
"0.53239906",
"0.531823",
"0.5304188",
"0.52993184",
"0.52955115",
"0.52761394",
"0.5264969",
"0.5264559",
"0.5259671",
"0.5244882",
"0.5244247",
"0.5242535",
"0.5231384",
"0.52268666",
"0.52218825",
"0.52163804",
"0.52141625",
"0.5213304",
"0.5205099",
"0.5190832",
"0.5182139",
"0.5174597",
"0.5169594",
"0.51660794",
"0.5160089",
"0.51580477",
"0.51569664",
"0.5116249",
"0.5104614",
"0.51017034",
"0.5101689",
"0.50989693",
"0.5084675",
"0.5078034",
"0.5072075",
"0.50715667",
"0.5068993",
"0.50523937",
"0.50485104",
"0.50456",
"0.50397515",
"0.5037311",
"0.5032997",
"0.50296545",
"0.50289446",
"0.50282973",
"0.50264055",
"0.5026239",
"0.5026058",
"0.5022055",
"0.5016067",
"0.50029576",
"0.50007874",
"0.49958175",
"0.4990179"
] | 0.53309304 | 45 |
Post Mapping User Sign In | @PostMapping(path = "/signin", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity signInUser(@RequestBody User user) {
try {
System.out.println(user.getEmail() + " : " + user.getPassword());
if (rocketLunchService.signIn(user)) {
return ResponseEntity.ok().body(user);
} else {
throw new Exception("Found more than 1 user.");
}
} catch (Exception e) {
return ResponseEntity.badRequest().body(e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }",
"private void signIn() {\n }",
"public F.Promise<Result> handleSignIn() {\n final Form<LogIn> filledForm = logInForm.bindFromRequest();\n if (customerService().isLoggedIn()) {\n return asPromise(redirect(controllers.routes.HomeController.home()));\n } else if (filledForm.hasErrors()) {\n flash(\"error\", \"Login form contains missing or invalid data.\");\n return asPromise(badRequest(loginView.render(data().build(), filledForm)));\n } else {\n return handleSignInWithValidForm(filledForm);\n }\n }",
"@PostMapping(\"/signin\")\n public ResponseEntity<?> authenticateUser(@RequestBody LoginRequest loginRequest) {\n return userService.authenticateUser(loginRequest);\n }",
"User signIn(String login, String password);",
"String signIn(String userName, String password) throws UserNotFoundException;",
"@RequestMapping(value = \"/signin\", method = RequestMethod.POST)\n\tpublic String signin(@ModelAttribute(value=\"user\") User user) {\n\t\tlogger.info(\"Sign-in : \", user.getEmail());\n\t\t\n\t\t//Implement user session to login a user\n\t\tthis.user = vMDaoImpl.getUser(user.getEmail());\n\t\tSystem.out.println(user.getFirstname()+ user.getLastname()+ \"entered password \" + user.getPassword() );\n\t\tSystem.out.println(\"value from database\"+ this.user.getEmail()+ \" \"+ this.user.getPassword());\n\t\tModelAndView model = new ModelAndView();\n\t\tif(this.user.getEmail().equals(user.getEmail()) && this.user.getPassword().equals(user.getPassword())){\n\t\t if(this.user.getIsadmin()==false)\n\t\t\t{\n\t\t\t\n\t\t\t\tmodel.setViewName(\"user\");\n\t\t\t\treturn \"redirect:/user\";\n\t\t\t}\n\t\t else {\n\t\t\n\t\t\tmodel.setViewName(\"admin\");\n\t\t\treturn \"redirect:/admin\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tmodel.setViewName(\"signin\");\t\n\t\treturn \"signin\";\n\t}",
"@POST\n @Path(\"user/login\")\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n public void userLogIn(@FormParam(\"email\") String email, @FormParam(\"password\") String password){\n \n // set the userSession Variable here\n System.out.println(email);\n System.out.println(password);\n \n userSession = 1; // change to the id retrieved from the db search\n \n }",
"@PostMapping(\"/register\")\n public String saveUser(@ModelAttribute User user){\n return \"redirect:login\";\n }",
"private void loggedInUser() {\n\t\t\n\t}",
"public abstract User login(User data);",
"@Override\n\tpublic void onSignInSucceeded() {\n\n\t}",
"@POST\r\n\t@Path(\"/login/\")\r\n\tpublic User login(@RequestBody User user);",
"@Override\n\tpublic void loginUser() {\n\t\t\n\t}",
"@PostMapping(value = \"/signup\", produces = { \"application/json\" })\n\t@ResponseBody\n\tpublic Map<String, Object> saveUser(@RequestParam Map<String, Object> map, HttpServletRequest req) {\n\t\tMap<String, Object> respMap = new HashMap<>();\n\t\tfinal ObjectMapper mapper = new ObjectMapper();\n\t\tfinal InsightUsers insightUsers = mapper.convertValue(map, InsightUsers.class);\n\t\tMap<String, String> response = ius.savefirstLastEmailFromForm(insightUsers);\n\t\tif (((String) response.get(\"status\")).equals(\"Ok\")) {\n\t\t\trespMap.put(\"id\", response.get(\"id\").toString());\n\t\t\trespMap.put(\"message\", \"Details saved successfully\");\n\t\t\trespMap.put(\"status\", ResponseStatusEnum.SUCCESS);\n\t\t\t// Audit section ends here\n\t\t} else if (((String) response.get(\"status\")).equals(\"exists\")) {\n\t\t\trespMap.put(\"message\", \"You have already registered for Try for Free\");\n\t\t\trespMap.put(\"status\", ResponseStatusEnum.ERROR);\n\t\t} else {\n\t\t\trespMap.put(\"message\", \"Failed to save details\");\n\t\t\trespMap.put(\"status\", ResponseStatusEnum.ERROR);\n\t\t}\n\t\treturn respMap;\n\t}",
"@PostMapping(\"login\")\n\tpublic UserInfo login(@RequestBody User user) {\n\t\treturn userService.login(user);\n\t}",
"@Override\n\tpublic AdminDTO loginpost(AdminloginDTO login) {\n\t\treturn adao.loginpost(login);\n\t}",
"private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }",
"public void login(User user);",
"@PostMapping(\"/registration\")\n\t public String registration(@ModelAttribute(\"userForm\") User userForm, BindingResult bindingResult,Model model) {if (bindingResult.hasErrors()) {\n\t return \"registration\";\n\t }\n\t userService.save(userForm);\n\t localUsername=userForm.getUsername();\n\t boolean flag=userService.autoLogin(userForm.getUsername(), userForm.getPasswordConfirm());\n\t model.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t model.addAttribute(\"username\",userForm.getUsername());\n\t return \"redirect:/dashboard\";\n\t }",
"public void login () {\n\t\tGPPSignIn.sharedInstance().authenticate();\n\t}",
"@ResponseStatus(HttpStatus.OK)\n @PostMapping(value = \"/login/renter\")\n public AppResponse<ResponseEntity<?>> logInUser(@Valid @RequestBody LoginRequest loginRequest) throws GeneralException {\n// Authentication authentication = authenticationManager.authenticate(\n// new UsernamePasswordAuthenticationToken(loginRequest.getRenterName(), loginRequest.getRenterPassword()));\n//\n// SecurityContextHolder.getContext().setAuthentication(authentication);\n// String jwt = jwtUtils.generateJwtToken(authentication);\n//\n// UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();\n// List<String> roles = userDetails.getAuthorities().stream()\n// .map(item -> item.getAuthority())\n// .collect(Collectors.toList());\n//\n// return ResponseEntity.ok(new JwtResponse(jwt,\n// userDetails.getId(),\n// userDetails.getUsername(),\n// userDetails.getEmail(),\n// roles));\n return new AppResponse<>(\"Success\",String.valueOf(HttpStatus.CREATED),\n \"Ok\",renterService.loginUser(loginRequest));\n\n }",
"@GetMapping(\"/login\")\r\n public Person login(@RequestBody SignUp signUp) {\r\n Person person = loginService.signup(signUp);\r\n }",
"private void userLogin(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}",
"@PostMapping(value = \"/login\") \n\t public LoginResponseDto usersLogin(@RequestBody LoginDto loginDto) { \n\t\t LOGGER.info(\"login method\");\n\t\t return userService.usersLogin(loginDto);\n\t }",
"public void signIn(View view) {\n requestSignIn();\n }",
"@Override\r\n\tpublic void login() {\n\t\t\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response) throws ServletException, IOException {\r\n \r\n String path = request.getPathInfo();\r\n if (path.equals(\"/signup\")) {\r\n \r\n String name = request.getParameter(\"name\");\r\n String email = request.getParameter(\"email\");\r\n String login = request.getParameter(\"login\");\r\n String password= request.getParameter(\"password\");\r\n \r\n User user = new User(login, password, name, email, false, false);\r\n \r\n BCryptPassword bcrypt = new BCryptPassword(user.getPassword());\r\n loginService.putUser(user.getLogin(), bcrypt, User.ROLES);\r\n \r\n MongoDB.store(user);\r\n response.sendRedirect(\"/login\");\r\n }\r\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n String login = req.getParameter(\"login\");\n String password = req.getParameter(\"password\");\n if (logic.isExisting(login, password)) {\n HttpSession session = req.getSession();\n session.setAttribute(\"login\", login);\n if (logic.isAdmin(login)) {\n session.setAttribute(\"role\", \"admin\");\n }\n resp.sendRedirect(String.format(\"%s/\", req.getContextPath()));\n } else {\n req.setAttribute(\"error\", \"Credentional is invalid\");\n doGet(req, resp);\n }\n }",
"@Override\r\n\tpublic void postRequest(Request request, Response response) {\r\n\t\tcreateUser(request, response);\r\n\t}",
"private void loginHandler(RoutingContext context) {\n JsonObject creds = new JsonObject()\n .put(\"username\", context.getBodyAsJson().getString(\"username\"))\n .put(\"password\", context.getBodyAsJson().getString(\"password\"));\n\n // TODO : Authentication\n context.response().setStatusCode(500).end();\n }",
"@PostMapping(\"/login\") //method handles POST requests with this path (login)\n public ResponseEntity<?> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword()));\n\n // update the SecurityContext\n SecurityContextHolder.getContext().setAuthentication(authentication);\n\n // generate JWT token\n String jwt = jwtUtils.generateJwtToken(authentication);\n\n // get UserDetails\n UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();\n List<String> roles = userDetails.getAuthorities().stream()\n .map(GrantedAuthority::getAuthority)\n .collect(Collectors.toList());\n\n // return response with JWT token and UserDetails\n return ResponseEntity.ok(new JwtResponse(jwt,\n userDetails.getId(),\n userDetails.getUsername(),\n userDetails.getEmail(),\n roles,\n userDetails.getCategory()\n ));\n }",
"void onSignInButtonClicked(String userEmail, String userPassword);",
"protected void login() {\n\t\t\r\n\t}",
"@POST(\"login\")\n Call<User> login();",
"@PostMapping(value = \"/userslogin\")\n\tpublic <T> ResponseEntity<?> loginProcess(@RequestBody User user) {\n\t\tLoginResponse loginResponse = new LoginResponse();\n\t\ttry {\n\t\t\t\n\t\t\tuser.setUserId(userDelegate.fetchUserId(user.getEmail()));\n\t\t\tloginResponse = userDelegate.login(user);\n\t\t\treturn responseUtil.successResponse(loginResponse);\t\t\n\t\t}\n\t\tcatch(ApplicationException e){\t\n\t\t\treturn responseUtil.errorResponse(e);\n\t\t}\n\t\t\n\t}",
"User loginUser(User userLoginRequest, HttpSession httpSession) throws Exception;",
"public void signIn()\r\n {\r\n FoodCenterRequestFactory factory = AndroidRequestUtils.getFoodCenterRF(context);\r\n ClientServiceRequest service = factory.getClientService();\r\n\r\n service.login(regId).fire(this);\r\n }",
"@PostMapping(\"/signin\")\n public ResponseEntity<JwtResponse> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {\n JwtResponse jwtResponse = this.authenticationService.authenticateUser(loginRequest);\n return ResponseEntity.ok(jwtResponse);\n }",
"public String signIn(String username, String password);",
"protected Response login() {\n return login(\"\");\n }",
"public AuthToken loginUser(){\n return null;\n }",
"@PostMapping(\"/logincheck\")\n\tpublic String LoginCheck()\n\t{\n\t\treturn \"profile\";\n\t}",
"public void signInExistingUser(View v) {\n attemptLogin();\n\n }",
"@Override\r\n\tpublic void login() {\n\r\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String email = request.getParameter(\"email\");\n String pass = request.getParameter(\"password\");\n\n Account account = new AccountDAO().login(email, pass);\n if (account != null) {\n //add account to session\n response.getWriter().println(\"Login successfully\");\n request.getSession().setAttribute(\"account\", account);\n response.sendRedirect(\"home\");\n } else {\n// response.getWriter().println(\"Login failed\");\n response.sendRedirect(\"login\");\n }\n }",
"protected void doPostLogin(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tout.println(\"Look where we are, it's the login page\");\n\t\t\n\t\t//get parameter Names\n\t\tsetParameters(request);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tKeyspace keyspace = Connection.getKeyspace();\n\t\tStringSerializer se = StringSerializer.get();\n\t\t\n\t\ttry\n\t\t{\n\t\t\t// given Keyspace keyspace and StringSerializer se\n\t\t\tSliceQuery<String, String, String> q = HFactory.createSliceQuery(keyspace, se, se, se);\n\t\t\tq.setColumnFamily(\"Users\") .setKey(displayName).setColumnNames(\"fullname\", \"email\", \"password\");\n\t\t\tQueryResult<ColumnSlice<String, String>> r = q.execute();\n\n\t\t\tfullname = r.get().getColumnByName(\"fullname\").getValue();\n\t\t\temail = r.get().getColumnByName(\"email\").getValue();\n\n\t\t\tif(password.equals(r.get().getColumnByName(\"password\").getValue()))\n\t\t\t{\n\t\t\t\t//LOGGED IN CORRECTLY\n\t\t\t\t\n\t\t\t\tmySexySession.setAttribute(\"displayName\", displayName);\n\t\t\t\tmySexySession.setAttribute(\"fullname\", fullname);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmySexySession.setAttribute(\"message\", \"Incorrect Password.\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t//catches happen when the key is not found (i.e. user doesn't exist)\n\t\t\tmySexySession.setAttribute(\"message\", \"User does not exist.\");\n\t\t}\n\t\tresponse.sendRedirect(\"/quotes/home\");\n\t}",
"public void signInUser(){\n Intent intent = new Intent(this, AuthUiActivity.class);\n startActivity(intent);\n }",
"@PostMapping(path = \"login_user\")\n public String logIn(User user, Model model){\n for (User currUser: users){\n if(currUser.getEmailId().equals(user.getEmailId()) && currUser.getPassword().equals(user.getPassword())){\n model.addAttribute(\"feeds\",feeds);\n return \"user_page\";\n }\n }\n return \"user_not_found\";\n }",
"void redirectToLogin();",
"@PostMapping(value = \"/login\", headers = {\"content-type=application/x-www-form-urlencoded\"})\n\tpublic ResponseEntity<UserDTO> login(WebRequest request){\n\t\t\n\t\tString username = request.getParameter(\"username\");\n\t\tString password = request.getParameter(\"password\");\n\t\t\n\t\tUser user = userService.findByUsername(username);\n\t\tif(user == null) {\n\t\t\t//ovo glumi token i ide u session local storage\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.NOT_FOUND);\n\t\t}else if(user.getPassword().equals(password)) {\n\t\t\treturn new ResponseEntity<UserDTO>(new UserDTO(user), HttpStatus.OK);\n\t\t}else {\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.UNAUTHORIZED);\n\t\t}\n\t\t\n\t\t\n\t}",
"@RequestMapping(value = \"/session\", method = RequestMethod.POST)\n public String session(@Valid @ModelAttribute(\"loginDto\") LoginDto loginDto,\n BindingResult bindingResult, Map<String, Object> model, HttpSession session, HttpServletRequest request)\n {\n if (UserEntity.getPrincipal(session) != null)\n {\n UserEntity userEntity = (UserEntity) UserEntity.getPrincipal(session);\n message.info(\"\\n\\n Name: \"+userEntity.getName()+\"\\n\\n\");\n message.info(\"\\n\\n Id: \"+userEntity.getId()+\"\\n\\n\");\n\n return \"redirect:/app/daily/list\";\n }\n\n if (bindingResult.hasErrors())\n {\n model.put(\"loginDto\", loginDto);\n return \"login/session\";\n }\n\n Principal principal ;\n try\n {\n principal = this.userAndProfileServiceDao.login(loginDto);\n }catch (ConstraintViolationException e )\n {\n loginDto.setPassword(\"\");\n model.put(\"loginDto\", loginDto);\n model.put(\"loginFail\", true);\n return \"login/session\";\n }\n if(principal == null)\n {\n loginDto.setPassword(\"\");\n model.put(\"loginFail\", true);\n return \"login/session\";\n }\n UserEntity.setPrincipal(session, principal);\n request.changeSessionId();\n return \"redirect:/app/daily/list\";\n\n\n }",
"@RequestMapping(\"/signin\")\n public String signin() throws Exception {\n return \"redirect:\" + baseUrl + \"/cp/auth/callback.html\";\n }",
"void signInComplete();",
"@PostMapping(\"/login\")\n public ResponseEntity<Map<String, String>> loginUser(@RequestBody User user){\n Map<String, String> result = userService.validateUser(user.getUsername(), user.getPassword());\n if(!result.get(\"status\").equals(\"200\"))\n return new ResponseEntity<>(result, HttpStatus.OK);\n \n User validated_user = userService.getUserByUsername(user.getUsername());\n return new ResponseEntity<>(generateJWTTToken(validated_user), HttpStatus.OK);\n }",
"public void authenticate(LoginRequest loginRequest) {\n\n }",
"@GET(Config.REGISTER) Call<User> registerUser(@QueryMap Map<String, String> body);",
"@PostMapping(\"signup\")\n public String login(@ModelAttribute(\"loginFormData\") @Valid LoginFormDTO form, BindingResult bindingResult, HttpSession session) {\n if (bindingResult.hasErrors()) {\n return \"user/signup\";\n }\n User validCredentials = loginService.login(form.getUsername(), form.getPassword());\n if (validCredentials == null) {\n bindingResult.rejectValue(\"username\", \"\", \"login or password incorrect\");\n return \"user/signup\";\n }\n\n // correct login\n session.setAttribute(LOGGED_USER_KEY, validCredentials);\n return \"redirect:/dd\";\n }",
"@RequestMapping(method= RequestMethod.POST, value=\"/staff/login\")\n protected @ResponseBody ResponseEntity login(@RequestBody Staff user) {\n return super.login(user);\n }",
"@RequestMapping(value = \"/userLogin\", method = RequestMethod.POST, produces = \"application/json\")\n \t@ResponseBody\n \tpublic Map<String, String> userLogin(@RequestBody UserLoginRequest userLoginRequest) {\n \tMap<String, String> responseMap = null;\n \t\ttry {\n \t\t\tresponseMap = this.econnectService.userLogin(userLoginRequest);\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\treturn responseMap;\n \t}",
"@GetMapping(\"/user\")\n public User login(@RequestParam String username, @RequestParam String password) { return userDataTierConnection.login(username,password); }",
"private void doSignup(RoutingContext ctx){\n // Get Data from view\n JsonObject req = ctx.getBodyAsJson();\n String username = req.getString(\"username\");\n String password = req.getString(\"password\");\n\n GoogleAuthenticator authenticator = new GoogleAuthenticator();\n\n //Get Generate Key\n System.out.println(\" Calling Google Authenticator to generate AuthKey\");\n GoogleAuthenticatorKey authKey = authenticator.createCredentials();\n String key = authKey.getKey();\n System.out.println(\" Google Authenticator generated AuthKey\");\n\n //Store Data from Repository\n User user = new User(username,password,key);\n\n //send response to the user\n JsonObject res = new JsonObject().put(\"key\",key);\n ctx.response().setStatusCode(200).end(res.encode());\n }",
"boolean doLogin(UserDTO loginUser);",
"@PostMapping(\"/login\")\n\t\tpublic String ValidateLoggedInUser(ModelMap model,@RequestParam String phno_mail,@RequestParam String password) {\n\t\t\tSystem.out.println(phno_mail + password);\n\t\t\t\tif(service.isValideUser(model,phno_mail, password)) {\n\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Valid\");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\treturn \"home\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmodel.put(\"Message\",\"Invalid Phoneno or Password\");\n\t\t\t\treturn \"LoginOrRegister\";}\n\t\t\t\n\t\t\t\t\n\t\t}",
"private static void logedIn(Request req, Response res, CloudService cloud) {\r\n\t\t\tif (cloud.getKorisnici().get(req.cookie(\"userID\")) == null) {\r\n\t\t\t\tString[] params = req.splat();\r\n\t\t\t\tString path;\r\n\t\t\t\tif(params.length == 0)\r\n\t\t\t\t\tpath = \"\";\r\n\t\t\t\telse\r\n\t\t\t\t\tpath = params[0];\r\n\t\t\t\tif(path.equals(\"checkLogin\") || path.equals(\"favicon.ico\"))\r\n\t\t\t\t\treturn;\r\n\t\t\t\tres.redirect(\"/login.html\");\r\n\t\t\t\thalt(302);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(req.session().attribute(\"user\") == null) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tKorisnik k = cloud.getKorisnici().get(req.cookie(\"userID\"));\r\n\t\t\t\t\treq.session().attribute(\"user\", k); // postavi mu korisnika za sesiju\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"public void signIn(String userName, String password) {\n\t}",
"public void signInActionButtonOnClick(View v) {\n EditText usernameField = findViewById(R.id.sign_in_username);\n EditText passwordField = findViewById(R.id.sign_in_password);\n\n if (new UserFieldValidator(fields).validateSignInFields(this)) {\n String username = usernameField.getText().toString();\n String password = passwordField.getText().toString();\n Map<String, String> users = getUsers();\n if (users != null && users.containsKey(username) && users.get(username).equals(password)) {\n Intent tmp = new Intent(this, GameCentreActivity.class);\n tmp.putExtra(\"user\", username);\n startActivity(tmp);\n } else {\n Toast.makeText(this, R.string.sign_in_incorrect, Toast.LENGTH_SHORT).show();\n }\n }\n }",
"@PostMapping(\"/register\")\n public ResponseEntity<Map<String, String>> registerUser(@RequestBody User user){ \n userService.registerUser(user);\n return new ResponseEntity<>(generateJWTTToken(user), HttpStatus.OK);\n }",
"@PostMapping(\"/process_register\")\n public String processRegistration(User user,Model model)\n throws SignatureException, NoSuchAlgorithmException, InvalidKeyException{\n\n //checking if user exists\n if(userService.existByLogin(user.getLogin())) {\n model.addAttribute(\"error\", true);\n return \"registerForm\";\n }\n\n model.addAttribute(\"user\", user);\n //saving user\n /* userRepository.save(user);*/\n userService.saveUser(user, Sha512.generateSalt().toString());\n return \"registerSuccessful\";\n }",
"void onSignInButtonClicked();",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n HttpSession sessao = request.getSession();\n Usuario User =(Usuario) sessao.getAttribute(\"User\");\n \n if(request.getParameter(\"acao\").equals(\"ENTRAR\")) {\n String login = request.getParameter(\"login\");\n String pswd = request.getParameter(\"senha\");\n if(Login(login,pswd,request,response)){\n response.sendRedirect(\"PokeCenter_Perfil.jsp\");\n }else{\n response.sendRedirect(\"home.jsp\");\n }\n }else if(request.getParameter(\"acao\").equals(\"UpdateUser\")){\n UpdateUser(request,response,User);\n }else if(request.getParameter(\"acao\").equals(\"CriaUser\")){\n CriaUser(request,response);\n }else if(request.getParameter(\"acao\").equals(\"Deslogar\")){\n sessao.invalidate();\n response.sendRedirect(\"home.jsp\");\n }\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tMap<String, String[]> parameterMap =\n\t\t\t\treq.getParameterMap();\n\n\t\tUser u = new User();\n\t\ttry {\n\t\t\t//可以直接把map中的内容设置到对象上\n\t\t\tBeanUtils.populate(u,parameterMap);\n\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n int insertUser = userDao.insertUser(u);\n if (insertUser==1){\n resp.getWriter().write(\"SUCCESS\");\n resp.setStatus(302);\n resp.sendRedirect(\"http://localhost:8080/TextRegister.html\");\n }else{\n RequestDispatcher dispatcher = req.getRequestDispatcher(\"/insert\");\n dispatcher.include(req,resp);\n }\n\n\n\t}",
"private void authenticateAction() {\n if (requestModel.getUsername().equals(\"superuser\")\n && requestModel.getPassword().equals(\"\")) {\n Collection<Webres> webres = getAllWebres();\n proceedWhenAuthenticated(new User(null, null, null, \"superuser\", \"\", null) {\n @Override\n public Collection<Webres> getAllowedResources() {\n return webres;\n }\n @Override\n public ActionController getDefaultController() {\n return ActionController.EMPLOYEES_SERVLET;\n }\n });\n return;\n }\n \n // try to authenticate against other credentials from the database\n Optional<User> u = getUserByCredentials(requestModel.getUsername(), requestModel.getPassword()); \n if (u.isPresent()) {\n proceedWhenAuthenticated(u.get());\n return;\n }\n \n // report authentication failed\n LOG.log(Level.INFO, \"{0} Authentication failed. Login: {1}, Password: {2}\", new Object[]{httpSession.getId(), requestModel.getUsername(), requestModel.getPassword()});\n SignInViewModel viewModel = new SignInViewModel(true);\n renderSignInView(viewModel);\n }",
"String registerUserWithGetCurrentSession(User user);",
"private User authenticate(JSONObject data) {\r\n UserJpaController uJpa = new UserJpaController(Persistence.createEntityManagerFactory(\"MovBasePU\"));\r\n\r\n long fbId = Long.parseLong((String) data.remove(\"id\"));\r\n User user = uJpa.findByFbId(fbId);\r\n if (user != null) {\r\n return user;\r\n } else {\r\n user = new User(fbId, (String) data.remove(\"name\"), (String) data.remove(\"email\"), new Date(), \"u\");\r\n try {\r\n uJpa.create(user);\r\n } catch (Exception ex) {\r\n Logger.getLogger(LoginController.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return user;\r\n }\r\n\r\n }",
"private void registerUser(HttpServletRequest request, HttpServletResponse response){\n String firstName = request.getParameter(\"firstName\");\n String lastName = request.getParameter(\"lastName\");\n String address = request.getParameter(\"address\");\n String email = request.getParameter(\"email\");\n String shipAddress = request.getParameter(\"shipAddress\");\n int role = Integer.parseInt(request.getParameter(\"role\"));\n User user = new User(firstName,lastName,address,email,shipAddress,role);\n userServices.addUser(user);\n try {\n request.getRequestDispatcher(\"/home\").forward(request,response);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException \n\t{\n\t\tString usrId = req.getParameter(\"uid\");\n\t\tString password = req.getParameter(\"psw\");\n\t\tString domain=req.getParameter(\"domain\");\n\t\t\n\t\t//2. Validate the credentials\n\t\tUserAuthenticate util = new UserAuthenticate();\n\t\tboolean isValid = util.validate(usrId, password, domain);\n\t\t\n\t\tif(isValid) //if the user is valid, start a session.\n\t\t{\n\t\t\t\tHttpSession session = req.getSession(true); //starting a session.\n\t session.setAttribute(\"userID\", usrId);\n\t \n\t //setting flag according to the user's privileges.\n\t int flag=util.flag;\n\t \t\tsession.setAttribute(\"flag\", flag);\n\t\t\t\t\n\t \t\tresp.sendRedirect(\"home\");\n\t \t\t//End of Authentication\n\t\t}\n\t\telse //invalid user\n\t\t{\n\t\t\treq.setAttribute(\"errMsg\", \"In-Valid User Name / Password\");\n\t\t\tRequestDispatcher dispatcher = req.getRequestDispatcher(\"loginErr\");\n\t\t\tdispatcher.forward(req, resp);\n\t\t}\n\t}",
"@PostMapping(\"/user/login\")\n public ResponseVo<User> login(@Valid @RequestBody UserLoginForm userLoginForm,\n HttpSession session) {\n\n// if (bindingResult.hasErrors()) {\n// log.info(\"params inconsistent for login, {} {}\",\n// Objects.requireNonNull(bindingResult.getFieldError()).getField(),\n// bindingResult.getFieldError().getDefaultMessage());\n// return ResponseVo.error(ResponseEnum.PARAM_ERROR, bindingResult);\n// }\n\n ResponseVo<User> userResponseVo = userService.login(userLoginForm.getUsername(), userLoginForm.getPassword());\n\n session.setAttribute(MallConst.CURRENT_USER, userResponseVo.getData());\n log.info(\"/login sessionId={}\", session.getId());\n\n return userResponseVo;\n }",
"private void onSignIn() {\n\n //get the signed in user's info from the db and\n //turn it into a user object.\n db.collection(\"users\").document(email).get()\n .addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {\n @Override\n public void onSuccess(DocumentSnapshot documentSnapshot) {\n user = documentSnapshot.toObject(User.class);\n goToDoctors();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(\"MainActivity\", \"Couldn't get user's data\", e);\n Toast.makeText(getApplicationContext(), \"Data retrieval failed.\",\n Toast.LENGTH_SHORT).show();\n }\n });\n\n }",
"@GetMapping(\"/login\")\n\tpublic boolean login(HttpServletRequest request) {\n\t\t//Implement logic to authenticate and set authenticated user object in session , setting \n\t\t\n\t\tUserInfo user = new UserInfo(\"yogesh\", \"admin\");\n\t\tHttpSession session = request.getSession(true);\n\t\tsession.setAttribute(\"authUser\",user);\n\t\treturn true;\n\t\t\n\t}",
"private void signIn() {\n final String email = ((EditText)findViewById(R.id.etSignInEmail)).getText().toString();\n final String password = ((EditText)findViewById(R.id.etSignInPassword)).getText().toString();\n\n mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n // Sign in success\n updateUI();\n } else {\n // Sign in failure\n Toast.makeText(LoginActivity.this, \"Incorrect email and/or password.\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}",
"@RequestMapping(method = RequestMethod.POST)\n public ModelAndView doPost(@ModelAttribute(LOGIN_COMMAND) OpenidLoginFormBean_ids data, BindingResult errors, HttpServletRequest request) \n {\n final HttpSession session = request.getSession();\n\tfinal String username; \n\tfinal String password; \n\tString openid = null;\n\tBoolean user_authenticated = false;\n\t\t\n\t\t\n\tusername = data.getUsername(); /* a dict could be more useful ? */\n\tpassword = data.getPassword();\t/* user password is bound to the form backing object */\t\n\t\t\n\t\t\t\t\t\t\n\tif (LOG.isDebugEnabled()) LOG.debug(\"Attempting authentication with user=\"+username+\" password=\"+password);\n\t\t\n\tuser_authenticated = idp.authenticate_ids(username, password);\n\topenid = idp.getOpenid(username);\t\t\n\t\t\n\tif((user_authenticated) && (openid != null)) \n\t{\n\t return setPositiveSessionAuth(session, openid); \n\t} \n\telse \n\t{\n\t // set session-scope authentication flag to FALSE\n\t session.setAttribute(OpenidPars.SESSION_ATTRIBUTE_AUTHENTICATED, Boolean.FALSE);\n\t if (LOG.isDebugEnabled()) LOG.debug(\"Authentication error\");\n\t\t\t\n\t errors.reject(\"error.invalid\", new Object[] {}, \"Invalid OpenID and/or Password combination\");\n\t return new ModelAndView(view);\n\t}\n }",
"@PostMapping(\"/login\")\n\t public String login(@RequestParam(\"username\") String username, @RequestParam(\"password\") String password, Model model) {\n\t \t\tSystem.out.println(username +\"Hello \"+ password);\n\t \t\tboolean flag=userService.autoLogin(username, password);\n\t if(flag) {\n\t \tmodel.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t \t model.addAttribute(\"username\",username);\n\t \t localUsername = username;\n\t \t return \"redirect:/dashboard\";\n\t }\n\t model.addAttribute(\"error\",true);\n\t return \"login\";\n\t }",
"@RequestMapping(value = \"/{username}/{password}\", method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> login (@PathVariable(\"username\") String username,\n @PathVariable(\"password\") String password) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n Timestamp startTime = getTimeStamp();\n User user = userRepo.findByEmailAddress(username);\n\n if (user != null) { // yes user with this username exists\n\n if (user.getPassword().equals(password)) {\n if ( user.getApproved()) {\n respMap.put(\"message\", user.getType() + \" User \" + user.getFirstname() + \" with id \" + user.getUserid() + \" is logged in!\");\n respMap.put(\"userType\", user.getType());\n\n respMap.put(\"name\", user.getFirstname());\n respMap.put(\"httpStatus\", \"\" + HttpStatus.OK);\n respMap.put(\"startTime\", \"\" + startTime);\n respMap.put(\"userId\", \"\" + user.getUserid());\n respMap.put(\"success\", \"\" + 1);\n } else {\n respMap.put( \"message\" , \"Account has not been approved .. check with Administrator\");\n respMap.put( \"success\" , \"0\");\n message = \"Account has not been approved .. check with Administrator\";\n }\n\n } else { // password incorrect\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"0\");\n message = \"Username or password incorrect\";\n }\n } else { // username not found\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"\"+0);\n respMap.put(\"httpStatus\", \"\"+ HttpStatus.OK);\n\n }\n\n\n\n return new ResponseEntity<>(respMap, httpStatus);\n }",
"@PostMapping(path=\"/login\")\n\tpublic User login(@RequestBody User n){\n\t\tString jwtToken = \"\";\n\t\tUser user = new User();\n\t\tif(n.getEmail() == null || n.getPassword() == null) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Please Fill in both user and password\");\n\t\t\treturn user;\n\t\t}\n\t\t\n\t\tString email = n.getEmail();\n\t\tString password = n.getPassword();\n\t\t\n\t\tif (userRepository.getUserByemail(email)==null) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Email is not associated with any accounts\");\n\t\t\treturn user;\n\t\t}\n\t\tuser = userRepository.getUserByemail(email);\n\t\t\n\t\tString pwd = user.getPassword();\n\t\t\n\t\tif(!password.equals(pwd)) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Email/passowrd combination does not match any records\");\n\t\t\treturn user;\n\t\t}\n\t\t\n\t\tjwtToken = Jwts.builder().setSubject(email).claim(\"roles\", \"user\").setIssuedAt(new Date())\n\t\t\t\t.signWith(SignatureAlgorithm.HS256, \"secretkey\").compact();\n\t\tuser.setToken(jwtToken);\n\t\tuserRepository.save(user);\n\t\t\n\t\treturn user;\n\t}",
"public void LogIn() {\n\t\t\r\n\t}",
"@RequestMapping(path = EndPoints.User.AUTHENTICATE, method = RequestMethod.POST)\r\n\tpublic User authenticate(@RequestBody UserAuthenticationToken creds);",
"protected void login (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\n String username = req.getParameter(\"username\");\n String password = req.getParameter(\"password\");\n // invoke userService.login()\n User loginUser = userService.login(new User(null, username, password, null));\n // if null, then fail\n if (loginUser == null) {\n // save information to request domain\n req.setAttribute(\"msg\", \"Username or Password incorrect !\");\n req.setAttribute(\"username\", username);\n // jump to login page dispatcher share the same request information\n req.getRequestDispatcher(\"/pages/user/login.jsp\").forward(req, resp);\n }\n else {\n\n // save user information to Session domain\n req.getSession().setAttribute(\"user\", loginUser);\n req.getRequestDispatcher(\"/pages/user/login_success.jsp\").forward(req, resp);\n }\n\n }",
"public static Result login(){\n String username= Form.form().bindFromRequest().get(\"username\");\n String password= Form.form().bindFromRequest().get(\"password\");\n String new_user= Form.form().bindFromRequest().get(\"new_user\");\n if(new_user != null){\n return ok(login.render(username,password));\n } else {\n Skier s=Session.authenticate(username,password);\n if(s==null){\n return badRequest(index.render(\"Invalid Username or Password\"));\n } else {\n login(s);\n return redirect(\"/home\");\n }\n }\n }",
"@RequestMapping(\"/register-user\")\n public ResponseEntity<UserProfileEntity> register(@RequestBody UserProfileEntity payload, HttpServletRequest request) throws ServletException{\n UserProfileEntity user = userProfileService.findByUser(payload.getUsername());\n\n //if null add new user and login\n if (user == null) {\n RoleEntity role = new RoleEntity();\n role.setRole(\"ROLE_USER\");\n\n Set<RoleEntity> roleSet = new HashSet<>();\n roleSet.add(role);\n\n UserProfileEntity userToAdd = new UserProfileEntity();\n userToAdd.setEnabled(true);\n userToAdd.setUsername(payload.getUsername());\n userToAdd.setPassword(payload.getPassword());\n userToAdd.setRoles(roleSet);\n\n userProfileService.save(userToAdd);\n\n request.login(userToAdd.getUsername(), userToAdd.getPassword());\n\n return new ResponseEntity<UserProfileEntity>(userToAdd, HttpStatus.CREATED);\n\n } else {\n return new ResponseEntity<UserProfileEntity>(HttpStatus.CONFLICT);\n }\n\n }",
"protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n String lastName = req.getParameter(\"lastName\");\n// String age = req.getParameter(\"age\");\n\n if (LAST_NAME.equals(lastName)) {\n HttpSession session = req.getSession(true);\n session.setAttribute(\"user_in\", lastName);\n } else {\n JOptionPane.showMessageDialog(null, \"Only one user registered: Tagirov\");\n }\n res.sendRedirect(\"index.jsp\");\n }",
"public static void signIn(String username, String password, final Context context, final OnLoginListener onLoginListener)\n {\n HttpClientHelper client = new HttpClientHelper(Endpoints.User.login, context);\n\n client.addParamForPost(\"api_type\", \"json\");\n client.addParamForPost(\"user\", username);\n client.addParamForPost(\"passwd\", password);\n client.addParamForPost(\"rem\", String.valueOf(true));\n\n Network.newRequest(client, Network.POST, Network.WITHOUT_COOKIE, new Delegate()\n {\n @Override\n public void requestResults(Network.Status status)\n {\n User user = null;\n boolean err = false;\n\n if(status.hasInternet)\n {\n if(status.response.getStatusLine().getStatusCode() == 200\n || status.response.getStatusLine().getStatusCode() == 409)\n {\n try\n {\n JSONObject values = (JSONObject) ((JSONObject) status.result.get(\"json\")).get(\"data\");\n String cookie = values.getString(\"cookie\");\n\n status.httpClientHelper.setCookie(cookie, context);\n\n getMe(context, onLoginListener);\n }\n catch (JSONException e)\n {\n err = true;\n onLoginListener.onLogin(user, status, err);\n }\n }\n else\n {\n err = true;\n onLoginListener.onLogin(user, status, err);\n }\n }\n else\n {\n onLoginListener.onLogin(user, status, err);\n }\n }\n });\n }",
"@PostMapping(\"/login\")\n\t@ApiOperation(value = \"Identifies the user by login an pin. Return sca methods information\")\n\tResponseEntity<AuthorizeResponse> login(\n\t\t\t@RequestParam(\"login\") String login,\n\t\t\t@RequestParam(\"pin\") String pin);",
"@Override\n\tpublic User login(User user) {\n\t\treturn userMapper.login(user);\n\t}",
"@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@RequestBody RegistrationRequest registrationRequest){\n return userService.registerUser(registrationRequest);\n }",
"@RequestMapping(value=\"/signup/{username}/{password}\")\n @ResponseBody\n public boolean signup(@PathVariable String username, @PathVariable String password){\n\n User user = new User(username, password);\n try{\n customUserDetailsService.save(user);\n return true;\n }catch (Exception e) {\n System.out.println(e);\n //ef return false tha er username fratekid...\n return false;\n }\n }",
"public void signIn(View v){\n\n //Get Sign in form data\n EditText userIdEntry = findViewById(R.id.userIDEntry);\n\n String userId = userIdEntry.getText().toString();\n Intent intent = null;\n\n UserAccountListManager.GetUserAccountsTask getUserAccountsTask =\n new UserAccountListManager.GetUserAccountsTask();\n getUserAccountsTask.execute(\"\");\n ArrayList<UserAccount> userAccountList = new ArrayList<>();\n try {\n userAccountList = getUserAccountsTask.get();\n } catch (Exception e) {\n Log.e(\"Error\", \"Failed to get the tweets out of the async object.\");\n }\n userAccountListController.getUserAccountList().setUserAccounts(userAccountList);\n //TODO Adjust for real ID/PW. maybe use size of UAL?\n for(UserAccount userAccount : userAccountList){\n if(userAccount.authenticate(userId)){\n\n //Check account type, direct to proper activity.\n if(userAccount.getAccountType().toLowerCase().trim().equals(\"patient\")){\n Patient newPatient = new Patient(userAccount.getAccountType(), userAccount.getUserID(), userAccount.getEmailAddress(), userAccount.getPhoneNumber());\n newPatient.setShortCode(userAccount.getShortCode());\n userAccountListController.getUserAccountList().setAccountOfInterest(newPatient);\n intent = new Intent(MainActivity.this, ViewConditionListActivity.class);\n startActivity(intent);\n }\n\n else if(userAccount.getAccountType().toLowerCase().trim().equals(\"care provider\")){\n CareProvider newCareProvider = new CareProvider(userAccount.getAccountType(), userAccount.getUserID(), userAccount.getEmailAddress(), userAccount.getPhoneNumber());\n newCareProvider.setShortCode(userAccount.getShortCode());\n userAccountListController.getUserAccountList().setActiveCareProvider(newCareProvider);\n intent = new Intent(MainActivity.this, ViewPatientListActivity.class);\n startActivity(intent);\n }\n }\n }\n if(intent == null) {\n Toast.makeText(this, \"Incorrect Username\", Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n String username = request.getParameter(\"username\");\n String password1 = request.getParameter(\"password1\");\n String password2 = request.getParameter(\"password2\");\n String firstname = request.getParameter(\"firstname\");\n String lastname = request.getParameter(\"lastname\");\n \n try {\n if(manager.existingUser(username) != null){\n request.setAttribute(\"message\", \"Username esistente!\");\n RequestDispatcher rd = request.getRequestDispatcher(\"signup_page.jsp\");\n rd.forward(request, response);\n }else if(manager.badPassword(password1, password2)){\n request.setAttribute(\"message\", \"Password errata!\");\n RequestDispatcher rd = request.getRequestDispatcher(\"signup_page.jsp\");\n rd.forward(request, response);\n }else{\n User user;\n manager.register(firstname, lastname, username, password2);\n user = manager.authenticate(username, password2);\n HttpSession session = request.getSession(true);\n session.setAttribute(\"user\", user);\n response.sendRedirect(request.getContextPath()+\"/index.jsp\");\n }\n } catch (SQLException ex) {\n Logger.getLogger(SignupServlet.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"@RequestMapping(value = \"/login.htm\",method = RequestMethod.POST)\r\n\tpublic String login(User user,BindingResult result,ModelMap map,HttpSession session,HttpServletResponse response) throws IOException {\r\n\t\t\r\n\t\r\n\t\tboolean b = userService.findUser(user);\r\n\t\tif(b) {\r\n\t\t\tsession.setAttribute(\"user\", user);\r\n\t\t\treturn \"redirect: session_form.htm\";\r\n\t\t}else {\r\n\t\t\tString msa = \"Wrong Credential!!!!!\";\r\n\t\t\tmap.put(\"msg\",msa);\r\n\r\n\t\t\treturn \"login_form\";\r\n\t\t}\r\n\t}"
] | [
"0.667797",
"0.64486253",
"0.63872045",
"0.6382411",
"0.6289632",
"0.62187296",
"0.6148013",
"0.61202204",
"0.6068578",
"0.6021987",
"0.60114723",
"0.599425",
"0.5964974",
"0.5961734",
"0.5957462",
"0.59543514",
"0.5931118",
"0.591761",
"0.5913834",
"0.5892692",
"0.58784485",
"0.58683205",
"0.5866304",
"0.5851993",
"0.58434594",
"0.5840037",
"0.583468",
"0.58326775",
"0.5795117",
"0.5793257",
"0.5790144",
"0.5776222",
"0.57731235",
"0.57722485",
"0.57642037",
"0.5753989",
"0.5744542",
"0.57368636",
"0.57171315",
"0.571106",
"0.571071",
"0.5700337",
"0.5695459",
"0.56945926",
"0.5691693",
"0.5690711",
"0.5685326",
"0.5682242",
"0.5674316",
"0.5670553",
"0.56674194",
"0.5663112",
"0.56574535",
"0.56543213",
"0.5653662",
"0.5653577",
"0.5653552",
"0.5651358",
"0.5649232",
"0.56445485",
"0.5639495",
"0.5637627",
"0.563217",
"0.5629478",
"0.5623372",
"0.56232184",
"0.5622299",
"0.56152487",
"0.55952483",
"0.5591249",
"0.5585882",
"0.55829304",
"0.5576488",
"0.5575565",
"0.5574172",
"0.55684084",
"0.5557164",
"0.55545574",
"0.555187",
"0.5538877",
"0.5537705",
"0.55372643",
"0.5530054",
"0.5519754",
"0.5509915",
"0.5509874",
"0.5505951",
"0.549993",
"0.5498808",
"0.5498013",
"0.54943854",
"0.5488618",
"0.5485008",
"0.54834247",
"0.5481778",
"0.5480365",
"0.5471975",
"0.54691464",
"0.546377",
"0.5462869"
] | 0.6442963 | 2 |
array of words: Java, Saturday, day, coding, is print:"Saturday is Java coding day" | public static void main(String[] args) {
String[] array= {"Java", "Saturday", "day", "coding", "is"};
System.out.println(array[1]+" "+array[4]+ " "+array[0]+" "+array[3]+" "+array[2]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n\r\n\t\tString word=\"On dönüm bostan, yan gel Osman\";\r\n\t\t\r\n\t\tSystem.out.println(\"Today's Word-Of-The-Day is : \" +word );\r\n\t}",
"public static void main(String[] args) {\n String words = \"coding:java:selenium:python\";\n String[] splitWords = words.split(\":\");\n System.out.println(Arrays.toString(splitWords));\n System.out.println(\"Length of Array - \" +splitWords.length);\n\n for (String each:splitWords) {\n System.out.println(each);\n\n }\n // How many words in your sentence\n // Most popular interview questions\n // 0 1 2 3 4 5\n String sentence = \"Productive study is makes you motivated\";\n String[] wordsInSentence = sentence.split(\" \");\n System.out.println(\"First words: \" +wordsInSentence[0]);\n System.out.println(\"First words: \" +sentence.split(\" \")[5]);\n System.out.println(\"Number of words in sentence: \" + wordsInSentence.length);\n\n // print all words in separate line\n for (String each:wordsInSentence) {\n System.out.println(each);\n }\n\n\n\n }",
"public static void main(String[] args) {\n\t\tString var1=\"Today is Wednesday\";\n\t\t//System.out.println(var1.length());\n\t\tString[] strArr=var1.split(\" \");\n\t\tfor(String word:strArr) {\n\t\t\tSystem.out.println(word);\n\t\t}\n\t\t\n\t\tString var2=\"Syntax is best. batch 9 is great.\";\n\t\tString[] strArr2=var2.split(\"[.]\");\n\t\t\n\t\tfor(int i=0;i<strArr2.length;i++) {\n\t\t\tSystem.out.println(strArr2[i]);\t}\n\t\t//method chaining\n\t\tString var3=\" SYNTAX \";\n\t\tSystem.out.println(var3.trim().toLowerCase());\n\t\t\n\t\tString var4=\"hi what are you doining\";\n\tSystem.out.println(convert(var4));\n\t}",
"public static void main(String[] words) {\n\t\tsort(words, 0, words.length-1);\n\t\tprint(words);\n\n\t}",
"public static void show() {\r\n\t\t int[] forword=new int[6];\r\n\t\t int[] temp;\r\n\t\t for(int i=1;i<7;i++){\r\n\t\t\t temp=Arrays.copyOf(forword, 6);\r\n\t\t\t for(int j=0;j<i;j++){\r\n\t\t\t\t if(j==0){\r\n\t\t\t\t\t forword[0]=i;\r\n\t\t\t\t\t System.out.print(forword[0]+\" \");\r\n\t\t\t\t }else{\r\n\t\t\t\t\t forword[j]=forword[j-1]+temp[j-1];\r\n\t\t\t\t\t System.out.print(forword[j]+\" \");\t\t \r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t System.out.println();\r\n\t\t }\r\n\t\t //0-9:48-57 ; A-Z:65-90 ; a-z:97-122 \r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString str = \"Sunday Perfect Day to start coding\";\n\t\t\n\t\tString [] reverseStr = str.split(\" \");\n\t\t\n\t\t//1ST WAY\n\t\tSystem.out.println(Arrays.toString(reverseStr));\n\t\tString store [] = new String[reverseStr.length];\n\t\tfor (int i = 0; i < reverseStr.length; i++) {\n\t\t\tstore[i]=reverseStr[reverseStr.length-1-i];\n\t\t}\n\t\tSystem.out.print(Arrays.toString(store));\n\t\t//--------------------------------------\n\t\t//This one would only print words without Array type\n//\t\tfor (int i = 0; i < reverseStr.length; i++) {\n//\t\t\tSystem.out.print(reverseStr[reverseStr.length-1-i] + \" \");\n//\t\t}\n\t\t//--------------------------------------\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t//2ND WAY\n\t\tfor (int i = 0; i < reverseStr.length/2; i++) {\n\t\t\tString temp = reverseStr[i];\n\t\t\treverseStr[i]=reverseStr[reverseStr.length-1-i];\n\t\t\treverseStr[reverseStr.length-1-i]=temp;\n\t\t}\n\t\tSystem.out.println(Arrays.toString(reverseStr));\n\t\t\n\t\t//--------------------------------------\n\t\tString str1 = \"Sunday Perfect Day to start coding\";\n\t\t\n\t\tString [] reverseStr1 = str.split(\" \");\n\t\tString store1 = \"\";\n\t\tfor (int i = 0; i < reverseStr1.length; i++) {\n\t\t\tchar []c1 = reverseStr1[i].toCharArray();\n\t\t\tfor (int j = 0; j < c1.length/2; j++) {\n\t\t\t\tchar temp = c1[j];\n\t\t\t\tc1[j]=c1[c1.length-1-j];\n\t\t\t\tc1[c1.length-1-j]=temp;\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(Arrays.toString(c1));\n\t\t\tString reverse = new String(c1);\n\t\t\tstore1+=reverse+\" \";\n\t\t}\n\t\t\n\t\tSystem.out.println(store1);\n\t\tString [] splt2 = store1.split(\" \");\n\t\tSystem.out.println(Arrays.toString(splt2));\n\t\t\n\t\t\n\t\t\n\t\t//--------------------------------------\n\t\t//REVERSE\n//\t\tString []fruit = {\"Apple\"};\n//\t\tString fruit2 = \"\";\n//\t\tfor (int i = 1; i <= fruit[0].length(); i++) {\n//\t\t\tfruit2+=\"\"+fruit[0].charAt(fruit[0].length()-i);\n//\t\t\t\n//\t\t}\n//\t\tSystem.out.print(fruit2);\n//\t\tString []fruit3 = {fruit2};\n//\t\t\n//\t\tSystem.out.println();\n//\t\t\n//\t\tSystem.out.println(Arrays.toString(fruit3));\n//\t\t\n\t\t//--------------------------------------\n\t\t\n\n\t\t\n\t\t\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}",
"static ArrayList<String> tag(ArrayList<String> rawWords){\n\t\tArrayList<String> outSentence = new ArrayList<String>();\n\t\t//String[][] chart = new String[rawWords.size()][rawWords.size()];\n\t\tfor(int i = 0; i<rawWords.size(); i++){\n\t\t\tString[] entry = rawWords.get(i).split(\"\\\\s+\");\n\t\t\tString word = entry[0];\n\t\t\tString pos = entry[1];\n\t\t\tSystem.out.println(word);\n\t\t\tif((pos.equals(\"NNP\")||word.equals(\"tomorrow\"))&&rawWords.get(i-1).split(\"\\\\s+\")[0].equals(\"due\")){\n\t\t\t\tint beginning = i;\n\t\t\t\tint ending = i;\n\t\t\t\tint j = i+1;\n\t\t\t\tboolean endingFound = false;\n\t\t\t\twhile(!endingFound){\n\t\t\t\t\tString next=rawWords.get(j).split(\"\\\\s\")[1];\n\t\t\t\t\tif(next.equals(\"NN\")||next.equals(\"NNP\")||next.equals(\"NNS\")||next.equals(\"NNPS\")||next.equals(\"CD\")){\n\t\t\t\t\t\tending++;\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tendingFound = true;\n\t\t\t\t}\n\t\t\t\twhile(beginning<outSentence.size()){\n\t\t\t\t\toutSentence.remove(outSentence.size()-1);\n\t\t\t\t}\n\t\t\t\tString nounGroupLine = rawWords.get(beginning).split(\"\\\\s+\")[0]+\"\\tB-NP\";\n\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\tfor(int index = beginning+1; index<=ending; index++){\n\t\t\t\t\tnounGroupLine = rawWords.get(index).split(\"\\\\s+\")[0]+\"\\tI-NP\";\n\t\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\t}\n\t\t\t\ti=ending;\n\t\t\t}\n\t\t\telse if (pos.equals(\"CD\")){\n\t\t\t\tint beginning = i;\n\t\t\t\tint ending = i;\n\t\t\t\tboolean beginningFound = false;\n\t\t\t\tboolean endingFound = false;\n\t\t\t\tint j = i+1;\n\t\t\t\twhile(!endingFound){\n\t\t\t\t\tif((rawWords.get(j).split(\"\\\\s\")[1].equals(\"CC\")&&rawWords.get(j-1).split(\"\\\\s\")[1].equals(\"CD\")&&rawWords.get(j+1).split(\"\\\\s\")[1].equals(\"CD\"))||rawWords.get(j).split(\"\\\\s\")[1].equals(\"NN\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"NNS\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"NNP\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"NNPS\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"CD\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"CD\")||rawWords.get(j).split(\"\\\\s\")[0].equals(\"%\")){\n\t\t\t\t\t\tending++;\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tendingFound = true;\n\t\t\t\t}\n\t\t\t\tj = i-1;\n\t\t\t\twhile(!beginningFound){\n\t\t\t\t\tif(rawWords.get(j).split(\"\\\\s\")[0].equals(\"to\")&&rawWords.get(j-1).split(\"\\\\s\")[0].equals(\"up\")){\n\t\t\t\t\t\tbeginning-=2;\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if(rawWords.get(j).split(\"\\\\s\")[1].equals(\"#\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"PRP$\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"JJ\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"JJR\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"JJS\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"$\")){\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t}\n\t\t\t\t\telse if(rawWords.get(j).split(\"\\\\s\")[1].equals(\"POS\")||rawWords.get(j).split(\"\\\\s\")[1].equals(\"DT\")||rawWords.get(j).split(\"\\\\s\")[0].equals(\"approximately\")||rawWords.get(j).split(\"\\\\s\")[0].equals(\"around\")||rawWords.get(j).split(\"\\\\s\")[0].equals(\"almost\")||rawWords.get(j).split(\"\\\\s\")[0].equals(\"about\")){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t\t}\n\t\t\t\t\telse if (rawWords.get(j).split(\"\\\\s\")[0].equals(\"as\")&&(rawWords.get(j-1).split(\"\\\\s\")[0].equals(\"many\")||rawWords.get(j-1).split(\"\\\\s\")[0].equals(\"much\"))&&rawWords.get(j-2).split(\"\\\\s\")[0].equals(\"as\")){\n\t\t\t\t\t\tbeginning-=3;\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (rawWords.get(j).split(\"\\\\s\")[1].equals(\"VBN\")&&j>0&&(rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"JJR\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"PRP$\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"JJ\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"DT\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"RB\"))){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse if (rawWords.get(j).split(\"\\\\s\")[1].equals(\"VBN\")&&j>1&&(rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\",\")&&(rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"JJR\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"PRP$\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"JJ\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"DT\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"RB\")))){\n\t\t\t\t\t\tbeginning-=2;\n\t\t\t\t\t\tj-=2;\n\t\t\t\t\t}\n\t\t\t\t\telse if((rawWords.get(j).split(\"\\\\s\")[1].equals(\"RBR\")||rawWords.get(j).split(\"\\\\s\")[0].equals(\"not\"))&&rawWords.get(j+1).split(\"\\\\s+\")[1].equals(\"JJ\")){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse{\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t\t}\n\n\t\t\t\t\twhile(beginning<outSentence.size()){\n\t\t\t\t\t\toutSentence.remove(outSentence.size()-1);\n\t\t\t\t\t}\n\t\t\t\t\tString nounGroupLine = rawWords.get(beginning).split(\"\\\\s+\")[0]+\"\\tB-NP\";\n\t\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\t\tfor(int index = beginning+1; index<=ending; index++){\n\t\t\t\t\t\tnounGroupLine = rawWords.get(index).split(\"\\\\s+\")[0]+\"\\tI-NP\";\n\t\t\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\t\t}\n\t\t\t\t\ti=ending;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*else if(pos.equals(\"CD\")&&rawWords.get(i-1).split(\"\\\\s+\")[0].equals(\"$\")&&rawWords.get(i-2).split(\"\\\\s+\")[1].equals(\"IN\")){\n\t\t\t\tint beginning=i;\n\t\t\t\tint ending = i;\n\t\t\t\tint j=i+1;\n\t\t\t\tboolean endingFound = false;\n\t\t\t\twhile(!endingFound){\n\t\t\t\t\tString next=rawWords.get(j).split(\"\\\\s\")[1];\n\t\t\t\t\tif(next.equals(\"CD\")){\n\t\t\t\t\t\tending++;\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tendingFound = true;\n\t\t\t\t}\n\t\t\t\tboolean beginningFound = false;\n\t\t\t\tj = i-1;\n\t\t\t\twhile(!beginningFound){\n\t\t\t\t\tString prior=rawWords.get(j).split(\"\\\\s\")[1];\n\t\t\t\t\tString priorWord = rawWords.get(j).split(\"\\\\s\")[0];\n\t\t\t\t\tif(prior.equals(\"$\")){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse if (rawWords.get(j).split(\"\\\\s+\")[0].equals(\"as\")&&rawWords.get(j-1).split(\"\\\\s+\")[0].equals(\"much\")&&rawWords.get(j-2).split(\"\\\\s+\")[0].equals(\"as\")){\n\t\t\t\t\t\tbeginning -=3;\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t\t\tj -=3;\n\t\t\t\t\t}\n\t\t\t\t\telse if (prior.equals(\"IN\")){\n\t\t\t\t\t\tbeginning --;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\telse\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t}\n\t\t\t\twhile(beginning<outSentence.size()){\n\t\t\t\t\toutSentence.remove(outSentence.size()-1);\n\t\t\t\t}\n\t\t\t\tString nounGroupLine = rawWords.get(beginning).split(\"\\\\s+\")[0]+\"\\tB-NP\";\n\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\tfor(int index = beginning+1; index<=ending; index++){\n\t\t\t\t\tnounGroupLine = rawWords.get(index).split(\"\\\\s+\")[0]+\"\\tI-NP\";\n\t\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\t}\n\t\t\t\ti=ending;\n\t\t\t}*/\n\t\t\t//else if(pos.equals(arg0))\n\t\t\telse if(pos.equals(\"PRP\")||pos.equals(\"WP\")||word.equals(\"those\")||pos.equals(\"WDT\")){\n\t\t\t\tint beginning = i;\n\t\t\t\t//int ending = i;\n\t\t\t\tString nounGroupLine = rawWords.get(beginning).split(\"\\\\s+\")[0]+\"\\tB-NP\";\n\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t}\n\t\t\telse if(word.equals(\"anywhere\")&&rawWords.get(i+1).split(\"\\\\s+\")[0].equals(\"else\")){\n\t\t\t\toutSentence.add(\"anywhere\\tB-NP\");\n\t\t\t\toutSentence.add(\"else\\tI-NP\");\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t/*else if (word.equals(\"same\")&&rawWords.get(i-1).split(\"\\\\s\")[0].equals(\"the\")){\n\t\t\t\toutSentence.remove(outSentence.size()-1);\n\t\t\t\tString nounGroupLine = \"the\\tB-NP\";\n\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\tnounGroupLine = \"same\\tI-NP\";\n\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t}*/\n\t\t\telse if(pos.equals(\"NN\")||pos.equals(\"NNS\")||pos.equals(\"NNP\")||pos.equals(\"NNPS\")||pos.equals(\"CD\")/*||pos.equals(\"PRP\")*/||pos.equals(\"EX\")||word.equals(\"counseling\")||word.equals(\"Counseling\")){\n\t\t\t\tint beginning = i;\n\t\t\t\tint ending = i;\n\t\t\t\tboolean endFound = false;\n\t\t\t\tint j = i+1;\n\t\t\t\twhile(!endFound){\n\t\t\t\t\tString next=rawWords.get(j).split(\"\\\\s\")[1];\n\t\t\t\t\tif(next.equals(\"NN\")||next.equals(\"NNS\")||next.equals(\"NNP\")||next.equals(\"NNPS\")||next.equals(\"CD\")||(next.equals(\"CC\")&&rawWords.get(j-1).split(\"\\\\s\")[1].equals(rawWords.get(j+1).split(\"\\\\s\")[1]))){\n\t\t\t\t\t\tending++;\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tendFound = true;\n\t\t\t\t}\n\t\t\t\tboolean beginningFound = false;\n\t\t\t\tj = i-1;\n\t\t\t\twhile(!beginningFound){\n\t\t\t\t\tString[] pArray = rawWords.get(j).split(\"\\\\s+\");\n\t\t\t\t\tString prior = pArray[1];\n\t\t\t\t\tif(j>2 &&prior.equals(rawWords.get(j-2).split(\"\\\\s+\")[1])&&(rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"CC\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\",\"))){\n\t\t\t\t\t\tbeginning-=2;\n\t\t\t\t\t\tj-=2;\n\t\t\t\t\t}\n\t\t\t\t\telse if(prior.equals(\"JJ\")||prior.equals(\"JJR\")||prior.equals(\"JJS\")||prior.equals(\"PRP$\")||prior.equals(\"RBS\")||prior.equals(\"$\")||prior.equals(\"RB\")||prior.equals(\"NNP\")||prior.equals(\"NNPS\")){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse if (prior.equals(\"VBN\")&&j>1&&(rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\",\")&&(rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"JJR\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"PRP$\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"JJ\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"DT\")||rawWords.get(j-2).split(\"\\\\s+\")[1].equals(\"RB\")))){\n\t\t\t\t\t\tbeginning-=2;\n\t\t\t\t\t\tj-=2;\n\t\t\t\t\t}\n\t\t\t\t\telse if (prior.equals(\"VBN\")&&j>0&&(rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"JJR\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"PRP$\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"JJ\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"DT\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"RB\"))){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse if (prior.equals(\"VBG\")&&j>0&&(rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"DT\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"JJR\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"JJ\")||rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"PRP$\"))){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse if((prior.equals(\"RBR\")||pArray[0].equals(\"not\"))&&rawWords.get(j+1).split(\"\\\\s+\")[1].equals(\"JJ\")){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse if((pArray[0].equals(\"Buying\")||pArray[0].equals(\"buying\"))&&rawWords.get(j+1).split(\"\\\\s+\")[0].equals(\"income\")){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse if(pArray[0].equals(\"counseling\")||pArray[0].equals(\"Counseling\")){\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\tif(rawWords.get(j).split(\"\\\\s+\")[1].equals(\"NN\")){\n\t\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\t\tj--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (prior.equals(\"DT\")||prior.equals(\"POS\")){\n\t\t\t\t\t\t//j--;\n\t\t\t\t\t\tbeginning--;\n\t\t\t\t\t\tif(!rawWords.get(j-1).split(\"\\\\s+\")[1].equals(\"DT\"))\n\t\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tj--;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbeginningFound = true;\n\t\t\t\t}\n\t\t\t\twhile(beginning<outSentence.size()){\n\t\t\t\t\toutSentence.remove(outSentence.size()-1);\n\t\t\t\t}\n\t\t\t\tString nounGroupLine = rawWords.get(beginning).split(\"\\\\s+\")[0]+\"\\tB-NP\";\n\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\tfor(int index = beginning+1; index<=ending; index++){\n\t\t\t\t\tnounGroupLine = rawWords.get(index).split(\"\\\\s+\")[0]+\"\\tI-NP\";\n\t\t\t\t\toutSentence.add(nounGroupLine);\n\t\t\t\t}\n\t\t\t\ti=ending;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tString outLine = word+\"\\tO\";\n\t\t\t\toutSentence.add(outLine);\n\t\t\t}\n\t\t}\n\t\toutSentence.remove(0);\n\t\toutSentence.remove(outSentence.size()-1);\n\t\toutSentence.add(\"\");\n\t\treturn outSentence;\n\t}",
"public static void main(String args[])\n {\n // Let the given dictionary be following\n String dictionary[] = {\"hit\", \"hits\", \"kilts\", \"pEg\",\"peN\",\"pentAgon\",\"slit\",\"slits\",\"sTilts\"};\n\n\n\n char boggle[][] = {{'P','W','Y','R'},\n {'E','N','T','H'},\n {'G','S','I','Q'},\n {'O','L','S','A'}\n };\n\n String[] val=findWords(boggle,dictionary);\n\n System.out.println(Arrays.toString(val));\n\n\n }",
"public static void printWords (String [] word)\r\n {\r\n int lineCounter = 0;\r\n for(String each : word)\r\n {\r\n if(lineCounter % 5 == 0) \r\n {\r\n System.out.print(\"\\n\");\r\n }\r\n\r\n if(!each.equals(\"\"))\r\n {\r\n System.out.printf(\"%12.12s\", each);\r\n lineCounter++;\r\n } \r\n }\r\n }",
"public static void main(String[] args) {\n\t\tString words=\"today,monday,Sunday\";\n\t\tSystem.out.println(words.lastIndexOf(\"day\"));\n\t\tSystem.out.println(words.lastIndexOf(\"day\", 3));\n\t}",
"@Override\r\n\tpublic void english() {\n\t\tSystem.out.println(\"English class is twice every week on monday & saturday all day.\");\r\n\t\t\r\n\t}",
"private static void buildString(String[] array, Calendar calendar,\r\n\t\t\tBoolean[] bArray) {\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tbuilder.append(trueFormat.format(calendar.getTime()));\r\n\t\tbuilder.append(\" \");\r\n\t\tbuilder.append(array[0]);\r\n\t\tbuilder.append(\" \");\r\n\t\tbuilder.append(array[3]);\r\n\t\tsubBuild(array[4], builder);\r\n\t\tswitch (array[1]) {\r\n\t\tcase \"1\":\r\n\t\t\tif (bArray[0]) {\r\n\t\t\t\tbuilder.append(\"Получение уровня \");\r\n\t\t\t\tsubBuild(array[array.length - 1], builder);\r\n\t\t\t\tSystem.out.println(builder.toString());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"2\":\r\n\t\t\tif (bArray[1]) {\r\n\t\t\t\tbuilder.append(\"Принятие в клан \");\r\n\t\t\t\tsubBuild(array[10], builder);\r\n\t\t\t\tsubBuild(array[array.length - 1], builder);\r\n\t\t\t\tSystem.out.println(builder.toString());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"3\":\r\n\t\t\tif (bArray[2]) {\r\n\t\t\t\tsubBuild(array[10], builder);\r\n\t\t\t\tsubBuild(array[11], builder);\r\n\t\t\t\tbuilder.append(\"Смена статуса в клане \");\r\n\t\t\t\tsubBuild(array[array.length - 1], builder);\r\n\t\t\t\tSystem.out.println(builder.toString());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"4\":\r\n\t\t\tif (bArray[3]) {\r\n\t\t\t\tbuilder.append(\"Исключение из клана\");\r\n\t\t\t\tSystem.out.println(builder.toString());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"5\":\r\n\t\t\tif (bArray[4]) {\r\n\t\t\t\tbuilder.append(\"Принятие склонности \");\r\n\t\t\t\tsubBuild(getFaction(array[array.length - 1]), builder);\r\n\t\t\t\tSystem.out.println(builder.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void showAllWords() {//out\n System.out.println(\"No\\t|English\\t|Vietnamese\");\n ArrayList<Word> fullDictionary = dictionaryManagement.getDictionary().getWords();\n for (int i = 0; i < fullDictionary.size(); i++) {\n String aWord = String.valueOf(i + 1) + \"\\t|\" + fullDictionary.get(i).getWordTarget()\n + \"\\t|\" + fullDictionary.get(i).getWordExplain();\n System.out.println(aWord);\n }\n }",
"public String toString() {\n return String.join(\" \", words);\n }",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\tString S=\"Good Morning to all\";\n\t\tString[] split=S.split(\" \");\n\t\tString Output=\"\";\n\t\t//String Reverse_word=\" \";\n\t\t\n\t\tfor(int i=0;i<split.length;i++)\n\t\t{\n\t\t\tString word=split[i];\n\t\t\tString Reverse_word=\"\";\n\t\t\tfor(int j=word.length()-1;j>=0;j--)\n\t\t\t{\n\t\t\t\tReverse_word=Reverse_word+word.charAt(j);\n\t\t\t\t\n\t\t\t}\n\t\t\tOutput=Output+Reverse_word+\" \";\n\t\t}\n\t\tSystem.out.println(Output);\n\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tString text = \"We learn java basics as part of java sessions in java week1\";\r\n\t\tint count =0;\r\n\t\tString[] arraySplit = text.split(\"\");\r\n\t\t//for(int i=0;i<arraySplit.length;i++) \r\n\t\t//{ \r\n\t\t//\tSystem.out.println(arraySplit[i]); \r\n\t\t//\t}\r\n\t\t\r\n\t\t \r\n\r\n\t\tfor(int i=0;i<arraySplit.length;i++) {\r\n\t\t\t\r\n\t\t\tcount=1;\r\n\t\t\t\r\n\t\t\tfor(int j=i+1;j<arraySplit.length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(arraySplit[i].equals(arraySplit[j])) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\t//arraySplit[j] = \"o\";\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\tif(count>1)\r\n\t\t\t{\r\n\t\t\t\tarraySplit[i] = arraySplit[i].replace(arraySplit[i],\"\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t\t * else { System.out.println(arraySplit[i]); }\r\n\t\t\t */\r\n\t\t\tSystem.out.println(arraySplit[i]);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"public String toString(){\n String r = \"\";\n for(String cs : words){\n r += cs + \" \"; \n }\n r = r.substring(0, r.length()-1);\n return r;\n }",
"public static void main1(String[] args) throws IOException {\n\t\tString a1=\"Today is Friday\";\r\n\t\tString a2=\"Weekend\";\r\n\t\tint num=a1.length();\r\n\t\tSystem.out.println(num);\r\n\t\t\r\n\t\t\r\n\t\t//to get no of lettes\r\n\t\tchar[] ch =a1.toCharArray();\r\n\t\tSystem.out.println(ch);\r\n\t\tfor(char c :ch) {\r\n\t\t\tSystem.out.println(c);\r\n\t\t\t}\r\n\t\t\r\n\t\t//to get value of index\r\n\t\tchar at = a1.charAt(3);\r\n\t\tSystem.out.println(at);\r\n\t\t\r\n\t\t//to get index of char\r\n\t\tint num1 = a1.indexOf(\"d\");\r\n\t\tSystem.out.println(num1);\r\n\t\t\r\n\t\t//to search from right to left\r\n\t\tint num2 = a1.lastIndexOf(\"d\");\r\n\t\tSystem.out.println(num2);\r\n\r\n\t\t//to connect two string\r\n\t\tString text = a1.concat(a2);\r\n\t\tSystem.out.println(text);\r\n\t\t\r\n\t\t//to get partial letters\r\n\t\tString substring = a1.substring(2,8);\r\n\t\tSystem.out.println(substring);\r\n\t\t\r\n\t\t\r\n\t\t//to remove whitespaces in beginning and end\r\n\t\tString trim = a1.trim();\r\n\t\tSystem.out.println(trim);\r\n\t\t\r\n\t\t//to replace\r\n\t\tString replace = a1.replace(\"F\", \"a\");\r\n\t\tSystem.out.println(replace);\r\n\t\t\r\n\t\t\r\n\t\t//to split\r\n\t\tString[] split = a1.split(\" \");\r\n\t\tint length = split.length;\r\n\t\tfor(String each: split)\r\n\t\tSystem.out.println(each);\r\n\t\t\r\n\t\tList<String> all =new ArrayList<String>();\r\n\t\tfor(int i=0; i<all.size();i++) {\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//reverse a string\r\n\t\tStringBuilder input= new StringBuilder();\r\n\t\tinput.append(a1);\r\n\t\tStringBuilder reverse = input.reverse();\r\n\t\tSystem.out.println(reverse);\r\n\t\t\r\n\t\t\r\n\t\t//replace particular char in a string\r\n\t\tStringBuilder input1= new StringBuilder();\r\n\t\tinput1.append(a1);\r\n\t\tStringBuilder rep = input1.replace(2,5,\"a\");\r\n\t\tSystem.out.println(rep);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public static String assemblePhrase(String[] words) {\n String result = \"\";\n for( String str : words )\n\t\t\tresult = result + str + \" \";\n\t\tresult = result.trim();\n\t\treturn result;\n }",
"public static void main(String args[]) {\n\t\tList<String> words = Arrays.asList(\"hi\",\"hello\",\"Bye\",\"Goodbye\");\n\t\twords.stream().forEach(s->s=\" __ \"+s);\n\t\twords.forEach(s->System.out.println(s));\n\t\tSystem.out.println();\n\t\t\n\t\t//using method reference \n\t\twords.stream().map(s->\"_\"+s).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//operations using map\n\t\twords.stream().map(s-> s.replace(\"i\", \"eye\")).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//filter\n\t\twords.stream().filter(s->s.length()<7).forEach(System.out::println);\n\t\tSystem.out.println();\n\t\t\n\t\t//reduce operation and concatenate operation\n\t\tSystem.out.println(words.stream().reduce(\"\",(s1,s2)->s1.toUpperCase()+(s2.toUpperCase())));\n\t\t\n\t\t//Reduce using map and concat\n\t\tSystem.out.println(words.stream().map(s->s.toUpperCase()).reduce(\"\", (s1,s2)->s1.concat(s2)));\n\t\t\n\t\t//concate words with commas in between them\n\t\tSystem.out.println(words.stream().reduce((s1,s2)->s1.concat(\",\"+s2)).get());\n\t\t\n\t\t//Large array of doubles\n\t\tdouble[] list= new Random().doubles(10).toArray();\n\t\t\n\t}",
"@Override\r\n public String wordsOriginal(char[] arrayOfword) {\n String origalWord = \"\";//define a String for save the word orignal\r\n try {\r\n for (int i = 0; i < arrayOfword.length; i++) {\r\n origalWord += arrayOfword[i];//each charater put in the string origalWord\r\n }\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"An error has occured!\");\r\n }\r\n return origalWord;\r\n }",
"public void printWord(){\n\t\tint length = word.length;\n\t\tfor(int i = 0; i < length; i++){\n\t\t\tSystem.out.print(word[i]);\n\t\t}\n\t}",
"public static String [] currentSuit(int [] arr)\n\t{\n\t\tString [] s = new String[5];\n\t\tfor (int i =0; i<5;i++)\n\t\t{\n\t\t\tif( arr[i]>= 1 && arr[i]<=13)\n\t\t\t{\n\t\t\t\ts[i] = \"Clubs\";\n\t\t\t}\n\t\t\telse if(arr[i]>= 14 && arr[i]<=26)\n\t\t\t{\n\t\t\t\ts[i] = \"Diamonds\";\n\t\t\t}\n\t\t\telse if(arr[i]>= 27 && arr[i]<=39)\n\t\t\t{\n\t\t\t\ts[i] = \"Hearts\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ts[i] = \"Spades\";\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}",
"private String dayName() {\n int arrayDay = (day + month + year + (year/4) + (year/100) % 4) % 7;\n return dayName[arrayDay];\n }",
"public static void main(String[] args) {\n\t\tString str1 = \"Humpty Dumpty Sat On The Wall.\";\n\t\tchar array1[] = new char[30];\n\t\t\n\t\tstr1.getChars(0, 30, array1, 0);;\n\t\tSystem.out.println(array1);\n\t\t\n\t\tfor(int i = 29; i >= 0; i--) {\n\t\t\tSystem.out.print(array1[i]);\n\t\t}\n\t}",
"public static void main (String[] args) {\n String day = \"Wednesday\";\n int date = 17;\n String month = \"February\";\n int year = 1999;\n\n System.out.println (\"American format:\");\n System.out.println (day + \", \" + month + \" \" + date + \", \" + year);\n\n System.out.println (\"European format:\");\n System.out.println (day + \" \" + date + \" \" + month + \", \" + year);\n }",
"public static void main(String[] args) {\n\n\t\tint[] num = {25,28,23,12,53,67};\n\t\t\n\t\tboolean result = true ;\n\t\t\n\t\tfor (int i = 0; i < num.length; i++) {\n\t\t\tif(num[i]<=10) {\n\t\t\t\tresult = false ;\n\t\t\t\tbreak ;\n//\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(result);\n\t\t\n\n\n\t/*//Task 2 :\n\tgiven : \n\tString str = \"Cybertek Batch Spartan is most hardworking Batch ever\";\n\n\tuse the method your learned to get each words\n\tand store it into String array: \n\n\tloop through each items -- \n\t in each iteratrion loop : \n\t \t turn each word into char array \n\t \t print each char out with seperated by -\n\toutput : \n\t\tC-y-b-e-r-t-e-k-\n\t\tB-a-t-c-h-\n\t\tS-p-a-r-t-a-n-\n\t\ti-s-\n\t\tm-o-s-t-\n\t\th-a-r-d-w-o-r-k-i-n-g-\n\t\th-c-t-a-B-\n\t\te-v-e-r-\n*/\n\n\t\tString str = \"Cybertek Batch Spartan is most hardworking Batch ever\";\n\n\t\tString[] words = str.split(\" \");\n//\t\tSystem.out.println(Arrays.toString(words));\n\n//\t\t\n//\t\tfor (int i = 0; i < words.length; i++) {\n////\t\t\tSystem.out.println(words[i]);\n//\t\t\n//\t\tString one = words[i] ;\n//\t\tchar[] cyberChars =one.toCharArray() ;\n//\t\t\n//\t\tfor (int j = 0; j < cyberChars.length; j++) {\n//\t\t\tSystem.out.print(cyberChars[j] + \"-\");\n//\t\t}\n//\t\tSystem.out.println();\n//\t\t}\n\n\n\n\n\t/*// Optional : Reverse each word in sentence\n\tyour output should be \n\tketrebyC hctaB natrapS si tsom gnikrowdrah eno reve \n\t\t*/\n\t\t\n//\t\tString str = \"Cybertek Batch Spartan is most hardworking Batch ever\";\n\t\tString[] word = str.split(\" \");\n\t\t\n\t\tfor (int k = 0; k < word.length; k++) {\n\t\t\t\n\t\t\n\t\tString ones = \"Cybertek\" ;\n\t\tchar[] wordChars = ones.toCharArray() ;\n\t\tint lastIndex = wordChars.length-1 ;\n\t\tfor (int h = 0; h < wordChars.length/2; h++) {\n\t\t\n\t\tchar temp = wordChars[h];\n\t\twordChars[h] = wordChars[lastIndex-h] ;\n\t\twordChars[lastIndex-h] = temp ;\n\t\t\t\n\t\t}\n\t\t\n//\t\tSystem.out.println(Arrays.toString(wordChars));\n\t\t\n\t\tString reversed = new String(wordChars) ;\n//\t\tSystem.out.println(reversed);\n\t\t}\n\t\n}",
"public static void main(String[] args) {\n\n\t\tint[]nums=new int[4];\n\t\t\n\t\tnums[0]=12;\n\t\tnums[1]=13;\n\t\tnums[2]=14;\n\t\tnums[3]=15;\n\t\t//to find # of elements we use .length\n\t\tSystem.out.println(nums.length);\n\t\t\n\t\t// 0 1 2 3\n\t\tString[] array= {\"Winter\",\"Fall\",\"Summer\",\"Spring\"};\n\t\t//Print i was born in Summer\n\t\tSystem.out.println(\"I was born in \"+ array[2]);\n\t\t//array.lenght will return an integer\n\t\tint arraySize=array.length;\n\t\tSystem.out.println(array.length);\n\t\t\n\t\t\n\t\t\n\t\tint[]score= {80,90,70,100,99};\n\t\t\n\t\t\n\t\t//Create an array of chars and store grades into it: A,B,C,D,E,F. \n\t\t//Then print a grade B (use 2 different ways of creating an array).\n\n\t\tchar[] grades= {'A','B','C','D','E','F'};\n\t\tSystem.out.println(grades[0]);\n\t\t\n\t\t\n\t\t\n\n\t\t//Create an array of names and store all names of your group.\n\t\t//Then print your name from that array. (use 2 different ways of creating an array).\n\t\t\n\t\tString[]names= {\"Fabi\",\"Shubha\",\"Gunay\",\"Shugoufa\",\"Emily\",\"Seda\"};\n\t\tSystem.out.println(names[0]);\n\t\t\n\t\t\n\t\t\n\n\t\t//Create an array of words: Java, Saturday, day, coding, is. \n\t\t//Print the following sentence using element of array: “Saturday is Java coding Day”. \n\n\t\tString[]words= {\"Java\",\"Saturday\",\"day\",\"coding\",\"is\"};\n\t\tSystem.out.println(words[1]+words[4]+words[0]+words[3]+words[2]);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\n char[] animal = {'k', 'u', 't', 'y', 'a'};\n Arrays.stream(new String(animal).split(\" \")).forEach(System.out::print);\n\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tString text = \"本报讯 (记者 王京) 联想THINKPAD近期几乎全系列笔记本电脑降价促销,最高降幅达到800美元,降幅达到42%。这是记者昨天从联想美国官方网站发现的。联想相关人士表示,这是为纪念新联想成立1周年而在美国市场推出的促销,产品包括THINKPAD T、X以及Z系列笔记本。促销不是打价格战,THINK品牌走高端商务路线方向不会改变。\";\r\n\t\tString[] terms = null;\r\n\t\tterms= ChineseSpliter.split(text, \" \").split(\" \");//中文分词处理(分词后结果可能还包含有停用词)\r\n\t\tterms = DropStopWords(terms);//去掉停用词,以免影响分类\r\n\t\t\r\n\t\tfor(int i=0;i<terms.length;i++)\r\n\t\tSystem.out.println(terms[i]);\r\n\r\n\t}",
"@Test\n public void testConvertToWords()\n {\n System.out.println(\"convertToWords\");\n WoordenController instance = new WoordenController();\n String[] expResult =\n {\n \"een\", \"twee\", \"drie\", \"vier\", \"hoedje\", \"van\", \"hoedje\", \"van\", \"een\", \"twee\", \"drie\", \"vier\",\n \"hoedje\", \"van\", \"papier\"\n };\n String[] result = instance.convertToWords();\n assertArrayEquals(expResult, result);\n }",
"public static void main(String[] args)\r\n {\n Date date = new Date();\r\n Calendar calendar = Calendar.getInstance();\r\n calendar.setTime(date);\r\n \r\n year = calendar.get(Calendar.YEAR);\r\n month = calendar.get(Calendar.MONTH) + 1; // Januarry is Month 0 ???\r\n day = calendar.get(Calendar.DAY_OF_MONTH);\r\n \r\n //initialize a dictionary.\r\n Hdict dict = new Hdict();\r\n leechYahoo(dict);\r\n leechNytimes(dict);\r\n leechCNN(dict);\r\n //fox doesn't work, have to find the conversation element.\r\n //leechFOX(dict);\r\n \r\n Words[] output = dict.toArr();\r\n Hdict.arrSort(output);\r\n \r\n for(int i = 0; i < output.length; i++)\r\n {\r\n System.out.println(\"word \" + output[i].getName() + \" has popularity \" + output[i].getPopularity());\r\n }\r\n }",
"SList evenWords();",
"public static void main(String[] args) {\n\t\tDayOfWeek day = DayOfWeek.MONDAY;\n\t\t\n\t\tswitch(day){\n\t\tcase TUESDAY:\n\t\t\tSystem.out.println(\"Tu\");\n\t\t}\n\t\t\n\t\tfor(DayOfWeek d: DayOfWeek.values()){\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tSystem.out.println(DayOfWeek.valueOf(\"MM\"));\n\t}",
"public static void main(String[] args) {\n\t\tint counter=0;\n String sentence = \"Java is a general-purpose computer-programming language \"\n \t\t+ \"that is concurrent, class-based, object-oriented,\"\n \t\t+ \" and specifically designed to have as few implementation dependencies as possible.\";\n \n String[] word = sentence.split(\" \");\n \n for(String str: word) {\n \t if(str.equals(\"is\")) {\n \t\t break;\n \t } counter++;\n }\n System.out.println(\"Position: \"+ counter);\n System.out.println(word[counter]);\n \n \n \n }",
"public static void main(String[] args) {\n System.out.println(checkWeekday(\"Saturday\"));\n int [] arr = {0,4,6,5,4,3,2};\n System.out.println(countEven(arr));\n String [] arr1 = {\"first\", \"second\", \"third\"};\n System.out.println(Arrays.toString(addArray(arr1, \"last\")));\n System.out.println(Arrays.toString(randomArray(4,9)));\n System.out.println(getDifference(\"8855123456789\"));\n\n }",
"public static void main(String[] args) {\n\t\tString [] plop = {\"Hello\", \"Alaska\", \"Dad\", \"Peace\"};\r\n\t\tArrayList<String> tj = findWords(plop);\r\n\t\tSystem.out.println(\"bouh\");\r\n\r\n\t}",
"public static void main(String args[])\n\t{\n\t\tString intro = new String(\"My name is Aisling\");\n\t\t//adding space to make sure the first word is also included\n\t\tintro = \" \" + intro;\n\t\t//creating end index of each word\n\t\tint j = intro.length();\n\t\t//\n\t\t//loops through the string backwards\n\t\tfor(int i = intro.length()-1; i>=0; i--)\n\t\t{\n\t\t\t//checks if its a new word\n\t\t\tif(intro.charAt(i) == ' ')\n\t\t\t{\n\t\t\t\t//prints out words\n\t\t\t\tSystem.out.println(intro.substring(i, j));\n\t\t\t\tj = i;\n\t\t\t}\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\t\tString str = \"Bangalore is capital of Karnataka where\";\n\t\tString[] words = str.split(\" \");\n\t\tString newString=\"\";\n\t\t\t\n\t\tfor(String word: words) {\n\t\n\t\t\t\tnewString= newString+reverse(word);\n\t\t}\n\t\t\n\t\tSystem.out.println(newString);\n\t}",
"public static void main(String[] args) {\n Day6 d6 = new Day6();\n \n for(int i = 0; i < 8; i++){\n Map<Character, Integer> dictionary = new HashMap<>();\n d6.dictionaries.add(dictionary);\n }\n \n Scanner sc = new Scanner(System.in);\n System.out.println(\"What is your input?\");\n \n d6.parseInput(sc);\n \n StringBuilder sb = new StringBuilder();\n for(int i = 0; i < 8; i++){\n sb.append(d6.getMaxChar(d6.dictionaries.get(i)));\n }\n System.out.println(\"The word for p1 is \" + sb);\n \n StringBuilder sb2 = new StringBuilder();\n for(int i = 0; i < 8; i++){\n sb2.append(d6.getMinChar(d6.dictionaries.get(i)));\n }\n System.out.println(\"The word for p2 is \" + sb2);\n }",
"public static void main(String[] args) {\n\n IndexProgram indexProgram = new IndexProgram();\n String text = indexProgram.input();\n\n String word = \"November\";\n\n List<Integer> list = indexProgram.wordFinder(text, word);\n\n indexProgram.output(list, word);\n\n\n word = \"Dickens\";\n\n list = indexProgram.wordFinder(text, word);\n\n indexProgram.output(list, word);\n }",
"public static void main(String[] args) {\n\t\t/*\n\t\t * T\n\t\t * e\n\t\t * c\n\t\t * h\n\t\t * ...\n\t\t */\n\t\t\n\t\t//0123456789\n\t\t//Techtorial\n\t\t\n\t\tString word=\"Techtorial\";\n\t\t\n\t for(int index=0, lenght=word.length() ; index<lenght ; index++ ) {\n\t \tSystem.out.println(word.charAt(index));\n\t }\n \n//\t\t\n//\t for(int index=0, lenght=word.length()-1 ; lenght>=index ; lenght-- ) {\n//\t \tSystem.out.println(word.charAt(lenght));\n// \t}\n\t for(int index=word.length()-1 ; index>=0 ; index--) {\n\t \tSystem.out.println(word.charAt(index));\n\t }\n }",
"public static String answer(String[] words)\n {\n ArrayList<String> alphabets = new ArrayList<>();\n generateAllAlphabets(words, alphabets);\n return eliminateCombine(alphabets);\n }",
"public static void main(String[] args) {\n\t\tString word = \"java\";\n//\t\tSystem.out.println(word.substring(0,1));\n//\t\tSystem.out.println(word.substring(1,2));\n//\t\tSystem.out.println(word.substring(2,3));\n//\t\tSystem.out.println(word.substring(3));\n\t\t\n//\t\tfor(int i = word.length()-1; i >= 0; i--) {\n//\t\t\tSystem.out.println(word.charAt(i));\n//\t\t}\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString day=\"Sunday\";\n\t\tfor (int i=day.length()-1; i>=0; i--) {\n\t\t\tSystem.out.print(day.charAt(i));\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t// to print the middle of the string \n\t\tString str=\"Hello\";\n\t\t \n\t\tint lenght =str.length();\n\t\tint middle=str.length()/2;\n\t\t\n\t\tif (str.isEmpty()) {\n\t\t\t if (lenght%2!=0 && lenght>=3) { //it should be a reminder\n\t\t\n\t\t\t\t \n\t\t\t }\n\t\t\t \n\t\t }\n\t\tSystem.out.println(str.charAt(middle));\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString str=\"Wednesday\";\n\t\tboolean str1=str.isEmpty();\n\t\tSystem.out.println(str1);\n\t\tSystem.out.println();\n\t\t\n\t\tif ((str.length()%2!=0) && (str.length()>=3)){\n\t\n\t\tSystem.out.println(str.charAt(str.length()/2));\n\t\t\n\t\t}\n}",
"public TextView[] Weekdays(){\n Resources r = getResources();\n String name = getPackageName();\n String WeekDays[]={\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"};\n String DummyWeekDays[]={\"F1\",\"F2\",\"F3\",\"F4\",\"F5\",\"F6\",\"F7\"};\n TextView Weekdays[]=new TextView[7];\n DropDownCalendar.setCurrentDate(Calendar.getInstance());\n for(int i=0;i<WeekDays.length;++i) {\n TextView weekday,dummyWeekday;\n weekday = (TextView) findViewById(r.getIdentifier(WeekDays[i], \"id\", name));\n dummyWeekday=(TextView)findViewById(r.getIdentifier(DummyWeekDays[i],\"id\",name));\n Weekdays[i]=weekday;\n dummyWeekday.setTextColor(Color.TRANSPARENT);\n dummyWeekday.setHintTextColor(Color.TRANSPARENT);\n MaskWeekdays[i]=dummyWeekday;;\n\n }\n return Weekdays;\n }",
"public static void main(String[] args) {\r\n //Letter J composed of \"J\",\"A\",\"V\",\"A\"\r\n System.out.println(\"JAVAJAVAJAVA\");\r\n System.out.println(\"JAVAJAVAJAVA\");\r\n System.out.println(\" JAVA\");\r\n System.out.println(\" JAVA\");\r\n System.out.println(\" JAVA\");\r\n System.out.println(\" JAVA\");\r\n System.out.println(\"J JAVA\");\r\n System.out.println(\"JA JAVA\");\r\n System.out.println(\" JAVAJAVA\");\r\n System.out.println(\" JAVAJA\");\r\n }",
"@Override\n public String toString() {\n \treturn title + \":\" + word ;\n }",
"public static void main(String[] args) {\n\t\tWeekDay wd = new WeekDay();\n\t\t// 2\n\t\t\n\t\t// 4 확인\n\t\twd.input();\n\t\t// 4 확인\n\t\t\n\t\t// 6 확인\n\t\tString result = wd.week();\n\t\t\n\t\t// System.out.println(a);\n\t\t// 6 확인\n\t\t\n\t\twd.write(result);\n\t\t\n\n\t}",
"public String get_all_words(){\n\t\tString found_words = \"\";\n\t\t//We try to find the word within our childs\n\t\tfor(LexiNode child: childs){\n\t\t\t\tfound_words += child.get_all_words();\n\t\t}\n\t\tif(current_word != null && !found_words.equals(\"\"))\n\t\t\treturn current_word + \"#\" + found_words;\n\t\telse if(current_word != null && found_words.equals(\"\"))\n\t\t\treturn current_word+ \"#\";\n\t\telse //current_word == null && found_words != null\n\t\t\treturn found_words;\n\t}",
"public static void main(String[] args) {\n\n String [] arr = {\"milk\",\"pot\",\"pot\",\"bread\",\"bread\",\"iskem\"};\n //String s = \"\";\n\n\n for(int i =0 ; i <= arr.length-1 ; i++) {\n String s = arr[i];\n int count = 0;\n for (int j = 0; j <= arr.length-1; j++) {\n String each = arr[j];\n if(s.equals(each)) {\n count+=1;\n }\n }\n if (count == 1) {\n System.out.println(s);\n }\n\n }\n System.out.println(\"==================================\");\n\n String str = \"islem ouiddir\";\n String [] arr2 = str.split(\" \");\n System.out.println(Arrays.toString(arr2));\n\n char [] ch = str.toCharArray();\n System.out.println(Arrays.toString(ch));\n\n }",
"public static void main(String[] args)\n {\n // PLEASE DO NOT MODIFY THIS METHOD\n String arr[]={\"ghij\",\"defg\",\"jkl\",\"abcd\"};\n int out;\n // ASSUME INPUTS HAVE ALREADY BEEN TAKEN\n out = canArrangeWords(arr);\n System.out.println(\"output:\"+out);\n // Print the output\n }",
"private String intsToDays(int[] intArr) {\n String returnString = \"\";\n for (int i : intArr) {\n if (i == 1) {\n returnString = returnString + \" Mon\";\n }\n if (i == 2) {\n returnString = returnString + \" Tue\";\n }\n if (i == 3) {\n returnString = returnString + \" Wed\";\n }\n if (i == 4) {\n returnString = returnString + \" Thu\";\n }\n if (i == 5) {\n returnString = returnString + \" Fri\";\n }\n }\n return returnString;\n }",
"public String getDate() {\n int keywordIndex = getKeywordIndex();\n if (keywordIndex == -1) {\n return NO_INPUT;\n }\n String dateAsString = NO_INPUT;\n for (int i = keywordIndex + 1; i < words.length; i++) {\n dateAsString += words[i] + \" \";\n }\n return dateAsString.trim();\n }",
"@Override\r\n public String speak() {\r\n String word = \"\";\r\n Time.getInstance().time += 1;\r\n if (Time.getInstance().time == 1) {\r\n word = \"One day Neznaika decided to become an artist.\";\r\n }\r\n if (Time.getInstance().time == 101) {\r\n word = \"This story happened once day with Neznaika.\";\r\n }\r\n if (Time.getInstance().time == 201) {\r\n word = \"One day Neznaika wanted to become a musician.\";\r\n }\r\n if (Time.getInstance().time == 401) {\r\n word = \"One day Neznaika wanted to become a poet.\";\r\n }\r\n System.out.println(word);\r\n return word;\r\n }",
"public static void main(String[] args) throws ParseException {\n\n List<String> weeks = getWeeks(dateFormat.parse(\"2019-01-01\"),dateFormat.parse(\"2019-02-01\"));\n for (String s:weeks) {\n System.out.println(s);\n }\n\n System.out.println(getStartDayOfWeekNo(2019,1));\n System.out.println(getEndDayOfWeekNo(2019,1));\n }",
"public static char[] getWord() {\n\t\t\n\t\tString[] words = {\"cookie\", \"bacon\", \"steak\", \"apple\", \"doughnut\"};\n\t\tString choice = words[(int)(Math.random() * words.length)];\n\t\tchar[] word = new char[choice.length()];\n\n\t\tfor (int i = 0; i < word.length; i++) {\n\t\t\tword[i] = choice.charAt(i); // Convert Word into charArray\n\t\t}\n\t\treturn word;\n\t}",
"public static void main(String[] args) {\n\t\tKeyboardRow test = new KeyboardRow();\n\t\tString[] words = {\"Hello\",\"Alaska\",\"Dad\",\"Peace\"};\n\t\tString s[] = test.findWords(words);\n\t\tfor(String n : s) System.out.println(n);\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString arr[] = new String[] {\"Sunday\", \"Monday\", \"Tuesday\", \r\n\t\t\t\t\"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"};\r\n\t\t\r\n\t\tSystem.out.println(\"Enter a index from 0 to 6 to print the day : \");\r\n\t\tint index = sc.nextInt();\r\n\t\ttry {\r\n\t\t\tSystem.out.println(arr[index]);\r\n\t\t}\r\n\t\tcatch (ArrayIndexOutOfBoundsException e) {\r\n\t\t\tSystem.out.println(\"Array Index Out of Bound : \");\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tBoolean[] b= new Boolean[26];\n\t\tArrays.fill(b, false);\n\t\tint index=0;\n\t\tString test =\"aabbcc\";\n\t\tfor(int i=0;i<test.length();i++)\n\t\t{\n\t\t\tindex=(int)test.charAt(i)-'a';\n\t\t\tb[index]=true;\n\t\t}\n\t\tfor(int i=0;i<b.length;i++)\n\t\t{\n\t\t\tif(b[i]==false)\n\t\t\t{\n\t\t\t//\tSystem.out.println(\"Not pangram\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t String str = \"Happy%^&*Christmas*&*&*)NewYear\"; \n \n\t // similar to Matcher.replaceAll \n\t str = str.replaceAll(\"\\\\p{Punct}\",\" \"); \n\t \n\t System.out.println(str); \n\n\t}",
"public void Dname() {\n\t\t\tScanner sc = new Scanner(System.in);\r\n\t\t\tint n = 0;\r\n\t\t\tint k = max;\r\n\t\t\tString yname;\r\n\t\t\t\r\n\t\t\tString[] name2 = new String[k];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor(n = 0 ; n < name2.length ; n++) {\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Enter words:\");\r\n\t\t\t\tyname = sc.nextLine();\r\n\t\t\t\t\t\t\tname2[n] = yname;\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\tfor(int j = 0 ; j < k ; j++) {\r\n\t\t\t\t\t\tSystem.out.println(\"\\n\"+ name2[j]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}",
"public static void main(String[] args) {\n\n String[] fruit = {\"Grape\", \"Mango\", \"Banana\", \"Apple\", \"Peach\", \"Orange\", \"Cherry\", \"Dragon Fruit\"};\n\n System.out.println(fruit[3] + \"'s are my favourite fruit\");\n\n for (String s : fruit) {\n System.out.println(s.toUpperCase());\n }\n\n System.out.println(\"\\n\");\n\n int j = 0;\n while(j<fruit.length) {\n System.out.println(fruit[j].toUpperCase());\n j++;\n }\n\n }",
"public String iterateThroughArrayList_Words(ArrayList<String> arr){\n\t\tString p = \"\";\n\t\tIterator itr = arr.iterator();\n\t\twhile(itr.hasNext()){\n\t\t\tp += (itr.next() + \", \");\n\t\t}\n\t\treturn p;\n\t}",
"private static void displayWords(char[][] words, int size)\n {\n System.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~Words List~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n for(int i=0; i < size; i++) // As a whole this cycle repeats 'size' times\n {\n for(int j=0; j < size ; j++){ // Print out each elements in 2D arrays [0][0],[0][1],[0][2]...,[1][0],[1][1],[1][2],\n System.out.printf(\"%c \",words[i][j]);\n }//for j\n System.out.println();\n }//for i\n System.out.println(\"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\");\n\n }",
"private void laadSpellen() {\r\n this.spellen = this.dc.geefOpgeslagenSpellen();\r\n int index = 0;\r\n String res = String.format(\"%25s %20s\", r.getString(\"spelNaam\"), r.getString(\"moeilijkheidsGraad\"));\r\n for (String[] rij : spellen) {\r\n index++;\r\n res += String.format(\"%n%d) %20s\", index, rij[0]);\r\n switch (rij[1]) {\r\n case \"1\":\r\n res += String.format(\"%20s\", r.getString(\"makkelijk\"));\r\n break;\r\n case \"2\":\r\n res += String.format(\"%20s\", r.getString(\"gemiddeld\"));\r\n break;\r\n case \"3\":\r\n res += String.format(\"%20s\", r.getString(\"moeilijk\"));\r\n break;\r\n }\r\n \r\n }\r\n System.out.printf(res);\r\n }",
"@Test\n public void DayOfWeek() {\n System.out.printf(\"%s%n\\n\", DayOfWeek.MONDAY.plus(3));\n\n DayOfWeek dow = DayOfWeek.MONDAY;\n Locale locale = Locale.getDefault();\n System.out.println(dow.getDisplayName(TextStyle.FULL, locale));\n System.out.println(dow.getDisplayName(TextStyle.NARROW, locale));\n System.out.println(dow.getDisplayName(TextStyle.SHORT, locale));\n }",
"public static void main(String[] args) {\n\n String st = \"Java is a programming Language. Java is also an Island of Indonesia. Java is widely used language\";\n\n }",
"public static void main(String[] args) {\n\t\n\t\tint day=6 ;\n\t\t\n\t\t\t\tString weekDay;\n\t\t\n\t\t\t\tif ( day==1) {\n\t\t\t\t\tweekDay=\"Monday\";\n\t\t\t\t}else if(day==2) {\n\t\t\t\t\tweekDay=\"Tuesday\";\n\t\t\t\t}else if(day==3) {\n\t\t\t\t\tweekDay=\"Wednesday\";\n\t\t\t\t}else if(day==4) {\n\t\t\t\t\tweekDay=\"Thursday\";\n\t\t\t\t}else if(day==5) {\n\t\t\t\t\tweekDay=\"Friday\";\n\t\t\t\t}else if(day==6) {\n\t\t\t\t\tweekDay=\"Saturday\";\n\t\t\t\t}else if(day==7) {\n\t\t\t\t\tweekDay=\"Sunday\";\n\t\t\t\t}else {\n\t\t\t\t\t\tweekDay=\"invaid\";\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tSystem.out.println(\"weekDay\");\n\t\t\t\t\t}\n\t\t\t\t// switch statement execute one statment from mutiple \n\t\t\t\t//condition a switch works\n\t\t\t\t//with byte, short,char, and string \n\t\t\n\t\t\t\tswitch(day){\n\t\t\t\tcase 1://day==1\n\t\t\t\t\tweekDay=\"Monday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tweekDay=\"Tuesday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tweekDay=\"Wedensday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tweekDay=\"Thursday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tweekDay=\"Friday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tweekDay=\"Saturday\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7: \n\t\t\t\t\tweekDay=\"Sunday\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tweekDay=\"invlid\";\n\t\t\t\t\t\n\t\t\tSystem\n\t\t\t.out.println(weekDay);\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t}\n\n}",
"private String[] toStringArray(String doc, char split) {\n\t\t// count words\n\t\tint wordCount = 0;\n\t\tfor (int i = 0; i < doc.length(); i++) {\n\t\t\tif (doc.charAt(i) == split) {\n\t\t\t\twordCount++;\n\t\t\t}\n\t\t}\n\t\t// split the String\n\t\tString[] words = new String[wordCount];\n\t\tint lastWord = 0;\n\t\tint index = 0;\n\t\tfor (int i = 0; i < doc.length(); i++) {\n\t\t\tif (doc.charAt(i) == split) {\n\t\t\t\twords[index++] = doc.substring(lastWord, i + 1).trim();\n\t\t\t\tlastWord = i + 1;\n\t\t\t}\n\t\t}\n\t\treturn words;\n\t}",
"@Test\n public void findEvenLengthWords() {\n List<String> output = null; // TODO\n\n assertEquals(Arrays.asList(\"in\", \"computer\", \"be\", \"solved\", \"by\", \"adding\", \"of\",\n \"except\", \"many\", \"levels\", \"of\"), output);\n }",
"public static void main(String[] args) {\n\t\t\tString str=\"Four score and seven years ago\";\n\t\t\tSystem.out.println(\"The letter r appears at the following locations: \");\n\t\t\tint position = str.indexOf('r');\n\t\t\twhile (position!= -1) {\n\t\t\t\tSystem.out.print(position + \" \");\n\t\t\t\tposition = str.indexOf('r',position+1);\n\t\t\t}\n\t\t\t\n\t\t\tString str2 = \"and a one and two and a three\";\n\t\t\tSystem.out.println(\"The word \\\" and\\\" appears at the following location: \");\n\t\t\tint positionAnd = str2.indexOf(\"and\");\n\t\t\twhile(positionAnd != -1) {\n\t\t\t\tSystem.out.print(positionAnd + \" \");;\n\t\t\t\tpositionAnd = str2.indexOf(\"and\", positionAnd+1);\n\t\t\t}\n}",
"public static void main(String[] args) {\n\t\t\n\t\tString str= \"I liked Java, did you like it\";\n\t\t\n\t\tString arr[]=str.split(\"d\");\n\t\t\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\nString str1[]=str.split(\" \");\n\t\t\n\t\tSystem.out.println(Arrays.toString(str1));\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tScanner scan=new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter a word\");\n\t\tString a=scan.nextLine();\n\n\t\tint sayac=0;\n\t\tint sayac1=0;\n\t\tint sayac2=0;\n\t\tint sayac3=0;\n\t\tint sayac4=0;\n\t\tint sayac5=0;\n\t\tint sayac6=0;\n\t\tint sayac7=0;\n\t\tint sayac8=0;\n\t\tint sayac9=0;\n\t\n\t\n\tint b=a.toLowerCase().length();\n\t\nchar[] alphabet= {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','u','p','r','s','t','u','z','w','x','v'};\n\t\n\t\n\t\t\n\tfor(int i=0; i<=b-1; i++) {\n\t\tfor(int j=0; j<alphabet.length; j++) {\n\t\tif(a.charAt(i)==alphabet[j] ) {\n\t\t\tSystem.out.println(\"a harfi \"+(i+1)+\". siradadir\");\n\t\t\tsayac++;\n\t\t\tSystem.out.println(sayac+\"tane a.charAt(i) harfi vardir\");\n\t\t}\n\t\t\n\t\t\n\t\n\t\t}}\n\n\n\t}",
"public static void main(String[] args) {\n\n\t\tString a=\"I am using hackerrank to improve programming\";\n\t\tString b=\"am hackerrank to improve\";\n\t\t\n\t\tString[] ans = missingWords(a, b);\n\t\tfor(int i=0;i<ans.length;i++)\n\t\t{\n\t\t\tSystem.out.println(\"ans \"+ans[i]);\n\t\t}\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tString str = \" Жизнь и Смерть. Что мы знаем о них? Немного. \";\n\t\tint a = 0;\n\t\tchar b;\n\t\tchar word;\n\n\t\tfor (int i = 1; i < str.length(); i++) {\n\t\t\tb = str.charAt(i);\n\t\t\ta = i - 1;\n\t\t\tif (b == ' ' || b == '.' || b == ',' || b == '?' || b == '!') {\n\t\t\t\tword = str.charAt(a);\n\t\t\t\tif (word == ' ' || word == '.' || word == ',' || word == '?' || word == '!') {\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(word);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tint day=6;\n\t\t\n\t\tif(day==2 || day==4) {\n\t\t\tSystem.out.println(\"sdlc class\");\n\t\t}else if(day==6 || day==7) {\n\t\t\tSystem.out.println(\"java class\");\n\t\t}else if(day==1||day==5) {\n\t\t\tSystem.out.println(\"no class\");\n\t\t}else if(day==3) {\n\t\t\tSystem.out.println(\"review class\");\n\t\t}else {\n\t\t\tSystem.out.println(\"not a valid day\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\"**********************\");\n\t\t\n\t\tString day1=\"WEDNESDAY\";\n\t\t\n\t\tif(day1.equalsIgnoreCase(\"tuesday\")||day1.equalsIgnoreCase(\"thursday\")){\n\t\t\tSystem.out.println(\"sdlc class\");\n\t\t}else if(day1.equalsIgnoreCase(\"saturday\") || day1.equalsIgnoreCase(\"sunday\")) {\n\t\t\tSystem.out.println(\"java class\");\n\t\t}else if(day1.equalsIgnoreCase(\"monday\") || day1.equalsIgnoreCase(\"friday\")) {\n\t\t\tSystem.out.println(\"no class\");\n\t\t}else if(day1.equalsIgnoreCase(\"wednesday\")) {\n\t\t\tSystem.out.println(\"review class\");\n\t\t}else {\n\t\t\tSystem.out.println(\"not a valid day\");\n\t\t}\n\t\t\t\n\t\t\n\t}",
"public static void wordsToGuess(String [] myWords){\n myWords[0] = \"tesseract\";\n myWords[1] = \"vibranium\";\n myWords[2] = \"mjolnir\";\n myWords[3] = \"jarvis\";\n myWords[4] = \"avengers\";\n myWords[5] = \"wakanda\";\n myWords[6] = \"mixtape\";\n myWords[7] = \"assemble\";\n myWords[8] = \"queens\";\n myWords[9] = \"inevitable\";\n }",
"public String toString(){\r\n return (\"The word '\" + wordSearched + \"' appears: \" + occurrences + \", time(s) in the file.\"); \r\n }",
"public static void main(String[] args) {\r\n\t\tString text = \"thestoryofleetcodeandme\";\r\n\t\tString[] words = new String[]{\"story\", \"fleet\", \"leetcode\"};\r\n\t\tint[][] arr = findIndexPairs(text, words);\r\n\t\tfor(int[] row : arr)\r\n\t\t{\r\n\t\t\tSystem.out.println(Arrays.toString(row));\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tint day=Integer.parseInt(args[0]);\n\t\tint month=Integer.parseInt(args[1]);\n\t\tint year=Integer.parseInt(args[2]);\n\t\tint arr[]=dayOfWeek(day, month, year);\n\t\tSystem.out.print(\"It is : \"+arr[0]+\" : \");\n\t\tswitch(arr[0]) {\n\t\tcase 1: System.out.println(\"January\");break;\n\t\tcase 2: System.out.println(\"February\");break;\n\t\tcase 3: System.out.println(\"March\");break;\n\t\tcase 4: System.out.println(\"April\");break;\n\t\tcase 5: System.out.println(\"May\");break;\n\t\tcase 6: System.out.println(\"June\");break;\n\t\tcase 7: System.out.println(\"July\");break;\n\t\tcase 8: System.out.println(\"August\");break;\n\t\tcase 9: System.out.println(\"September\");break;\n\t\tcase 10: System.out.println(\"October\");break;\n\t\tcase 11: System.out.println(\"November\");break;\n\t\tcase 12: System.out.println(\"December\");break;\n\t\tdefault:System.out.println(\"Error In Month\");\n\t\t}\n\t\tSystem.out.print(\"It is : \"+arr[1]+\" : \");\n\t\tswitch(arr[1]) {\n\t\tcase 0: System.out.println(\"Sunday\");break;\n\t\tcase 1: System.out.println(\"Monday\");break;\n\t\tcase 2: System.out.println(\"Tuesday\");break;\n\t\tcase 3: System.out.println(\"Wednesday\");break;\n\t\tcase 4: System.out.println(\"Thursday\");break;\n\t\tcase 5: System.out.println(\"Friday\");break;\n\t\tcase 6: System.out.println(\"Saturday\");break;\n\t\tdefault:System.out.println(\"Error In Month\");\n\t\t}\n\t}",
"public String getWordOfTheDay() throws Exception {\n String wordOfTheDay;\n\n wordOfTheDay = WordsApi.wordOfTheDay().getWord();\n\n return wordOfTheDay;\n }",
"public static void main(String[] args) {\n\t\tString a = \"SUNDAY\";\n\t\tString b = \"SATURDAY\";\n\t\tSystem.out.println(getDis(a, b));\n\t}",
"public static String getWeek(String fullCommand) {\n String week = fullCommand.replaceFirst(DukeConstants.SHOW_WEEK_HEADER, DukeConstants.NO_FIELD);\n week = week.trim();\n if ((week.equals(DukeConstants.WEEK_FORMAT_KEYWORD_RECESS)\n || week.equals(DukeConstants.WEEK_FORMAT_KEYWORD_READING)\n || week.equals(DukeConstants.WEEK_FORMAT_KEYWORD_EXAM))) {\n week = capitalizeWord(week);\n week = week + DukeConstants.BLANK_SPACE + DukeConstants.WEEK_FORMAT_KEYWORD;\n } else {\n week = DukeConstants.WEEK_FORMAT_KEYWORD + DukeConstants.BLANK_SPACE + week;\n }\n return week;\n }",
"public static void main (String[] args) {\r\n\t\tfindWords(sentence);\r\n\t}",
"public static void main(String[] args) {\n\t\tString ausgang = \"wörter starten mit großbuchstaben. pause nicht\";\r\n\t\tString newausgang = \"\";\r\n\r\n\t\tfor (int i = 0; i < ausgang.length(); i++) {\r\n\r\n\t\t\tif (i == 0) {\r\n\t\t\t\tnewausgang = newausgang + Character.toUpperCase(ausgang.charAt(i));\r\n\r\n\t\t\t} else if (ausgang.charAt(i - 1) == ' ') {\r\n\t\t\t\tnewausgang = newausgang + Character.toUpperCase(ausgang.charAt(i));\r\n\t\t\t} else {\r\n\t\t\t\tnewausgang = newausgang + ausgang.charAt(i);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// normal dazu geben\r\n\t\t}\r\n\t\tSystem.out.println(ausgang);\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(newausgang);\r\n\r\n\t}",
"@NonNull\n @Override\n public String toString() {\n return word;\n }",
"public void showListPhrases() {\r\n\t\tint i = 0;\r\n\t\tString[] array = new String[100];\r\n\t\ttry {\r\n\t\t\tstatement = SqlCon.getConnection().createStatement();\r\n\t\t\tResultSet rs = statement.executeQuery(SqlCon.PHRASE_TO_CHECK);\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tString phrase = rs.getString(\"word\");\r\n\t\t\t\tarray[i] = phrase;\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t} catch (SQLException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\ti= i+1;\r\n\t\tarrPhrase = new String[i];\r\n\t\tarrPhrase[0] = \"None\";\r\n\t\tfor (int j = 1; j < i; j++) {\r\n\t\t\tarrPhrase[j] = array[j-1];\r\n\t\t}\r\n\t\tfor(int k= 0; k<arrPhrase.length;k++)\r\n\t\t\tSystem.out.println(arrPhrase[k]);\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString movies[] = new String[4] ;\n\t\tmovies[0]= \"Life\" ;\n\t\tmovies[1]= \"Without\" ;\n\t\tmovies[2]= \"love is\" ;\n\t\tmovies[3]= \"meaningless\" ;\n\t\t\n//\t\tSystem.out.println(Arrays.toString(movies));\n\t\t\n\t\t\n\t\t\n//\t\tSystem.out.println(movies.length );\n\t\t\n//\t\tint i = 0;\n//\t\tSystem.out.println(movies[0].length());\n//\t\ti++;\n//\t\tSystem.out.println(movies[0].length());\n//\t\ti++;\n//\t\tSystem.out.println(movies[0].length());\n//\t\ti++;\n//\t\tSystem.out.println(movies[0].length());\n\t\t\n\t\tfor(int i = 0; i<movies.length; i++) {\n\t\t\tSystem.out.println(movies[i] + \" char count is : \" + movies[i].length());\n\t\t}\n\t\t\n//\t\tint max = movies[0].length();\n//\t\tfor (int j = 1; j < movies.length; j++) {\n//\t\t\t\n//\t\t\tif( movies[j].length() >max) {\n//\t\t\t\tmax = movies[j].length();\n//\t\t\t}\n//\t\t}\n//\t\tSystem.out.println(max);\n//\t\t\n\t\t\n\t\t\n\t\tint max = movies[0].length();\n\t\t\n\t\tint index = 0 ;\n\t\tfor (int k = 1; k < movies.length; k++) {\n\t\t\t\n\t\t\tif( movies[k].length() >max) {\n\t\t\t\tmax = movies[k].length();\n\t\t\t\tindex = k ;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(index);\n\t\tSystem.out.println(movies[index]);\n\t\t\n\t}",
"public static void main(String[] args) {\n LocalDate[] dates=new LocalDate[10];\n\n for (int i = 0; i <dates.length ; i++) {\n dates[i] = LocalDate.now().plusDays(i+1);\n }\n System.out.println(Arrays.toString(dates));\n for (LocalDate each:dates){\n System.out.println(each.format(DateTimeFormatter.ofPattern(\"MMMM/dd, EEEE\")));\n }\n\n\n }",
"public static void main(String[] args) {\n\t\tScanner console = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter a sentence: \");\n\t\tsentence = console.nextLine();\n\n\t\tSystem.out.println(getBlankPositions());\n\t\tSystem.out.println(countWords());\n\t\tString[] wordArr = getWords();\n\n\t\t// print wordArr in the proper format\n\t\tSystem.out.print(\"{\");\n\t\tfor (int i =0 ; i < wordArr.length; i++) {\n\t\t\tSystem.out.print(wordArr[i]);\n\t\t\tif (i < wordArr.length - 1)\tSystem.out.print(\",\");\n\t\t}\n\t\tSystem.out.println(\"}\");\n\t}",
"public static void main(String[] args) {\n\n\t\tString str=\"This is Batch 11 Batch 11 is great\";\n\t\t\n\t\tString [] arr=str.split(\" \");\n\t\t\n\t\tfor (String word:arr) {\n\t\t\tSystem.out.println(word);\n\t\t}\n\t}",
"public static void main(String[] args) {\n String exclamation1 = \"Ouch!\";\n String exclamation2 = \"Hoorah!\";\n String exclamation3 = \"Amazing!\";\n String adverb1 = \"stupidly\";\n String adverb2 = \"happily\";\n String adverb3 = \"shamefully\";\n String noun1 = \"car\";\n String noun2 = \"book\";\n String noun3 = \"bird\";\n String adjective1 = \"tall\";\n String adjective2 = \"smart\";\n String adjective3 = \"funny\";\n System.out.println( exclamation1+ \" he said \" + adverb1 +\n \" as he jumped into his convertible \" + noun1 +\n \" and drove off with his \" + adjective1 + \" wife.\");\n\n\n\n\n }",
"public String getStartText() {\n return \"Thursday 20 to 7\";\n }",
"SList oddWords();",
"public static void main(String[] args) {\n String s = \"catsanddog\";\n Set<String> dict = new HashSet<>();\n dict.add(\"cat\"); dict.add(\"cats\"); dict.add(\"and\"); dict.add(\"sand\"); dict.add(\"dog\");\n WordBreak solution = new WordBreak();\n List<String> result = solution.wordBreak(s, dict);\n System.out.println(result);\n }",
"public static void printArray(String[] array){\n int noOfElement=array.length; // Number of element is the length of this array\n for(int i=0;i<array.length;i++){ // print out the each element in array with \" \"(space) splitting\n System.out.print(array[i]+\" \");}}",
"public static void main(String[] args) throws Exception {\nSystem.out.println(\"i love nayanthara\");\nSystem.out.println(\"i love trisha\");\nSystem.out.println(\"i love keerthisuresh\");\n\n \n \n\t }",
"@Override\n public String getDailyFortune() {\n return \"tennis coach teach play in tennis\";\n }"
] | [
"0.62159353",
"0.6125748",
"0.6122275",
"0.61135095",
"0.6005089",
"0.59502995",
"0.594539",
"0.58978105",
"0.58694804",
"0.585455",
"0.58291185",
"0.58217335",
"0.5743335",
"0.57185066",
"0.5712078",
"0.5681289",
"0.5641703",
"0.563293",
"0.5627863",
"0.5598233",
"0.5591061",
"0.5587692",
"0.5585891",
"0.5578795",
"0.55720454",
"0.55557805",
"0.5554071",
"0.55431926",
"0.5531709",
"0.5477549",
"0.54746413",
"0.5472664",
"0.546513",
"0.54588413",
"0.54494715",
"0.5433039",
"0.5429555",
"0.5426892",
"0.54040474",
"0.5383701",
"0.53800434",
"0.5370683",
"0.5336763",
"0.53359896",
"0.5333509",
"0.5319434",
"0.53148305",
"0.53134996",
"0.5303006",
"0.53029615",
"0.5282001",
"0.5278969",
"0.52759314",
"0.52755374",
"0.52714735",
"0.52660197",
"0.5257343",
"0.52525043",
"0.525114",
"0.52440614",
"0.5234507",
"0.5233441",
"0.52317053",
"0.5229724",
"0.52216995",
"0.5217415",
"0.5217233",
"0.521642",
"0.5213733",
"0.5208748",
"0.5202777",
"0.5196632",
"0.51939875",
"0.51840234",
"0.51836425",
"0.5181309",
"0.5167505",
"0.51646996",
"0.51598763",
"0.51579875",
"0.5155029",
"0.51530725",
"0.5146222",
"0.5144668",
"0.5143617",
"0.5140612",
"0.51325667",
"0.51316065",
"0.51243436",
"0.5116257",
"0.5113979",
"0.5110871",
"0.5109347",
"0.51008517",
"0.5099526",
"0.50962603",
"0.50863105",
"0.50859964",
"0.50825316",
"0.50812274"
] | 0.61365867 | 1 |
Extracts the model element. | protected TypeElement extractModelElement(Element attribute) {
Element e = attribute.asType().accept(
new SimpleTypeVisitor6<Element, Void>() {
@Override
public Element visitDeclared(DeclaredType t, Void p) {
List<? extends TypeMirror> args = t.getTypeArguments();
if (args.size() == 1) {
TypeMirror arg = args.get(0);
return processingEnv.getTypeUtils().asElement(arg);
}
return null;
}
}, null);
if (e == null) {
e = processingEnv.getTypeUtils().asElement(attribute.asType());
}
return e.accept(new SimpleElementVisitor6<TypeElement, Void>() {
@Override
public TypeElement visitType(TypeElement e, Void p) {
return e;
}
}, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getElement() { return element; }",
"public E getElement() { return element; }",
"public E getElement() {\r\n return element;\r\n }",
"public Object getElement()\r\n\t\t{ return element; }",
"public synchronized T extract(UniverseElement<T> elem) throws IllegalStateException {\n\t\tif (elem.universe() != this) {\n\t\t\tthrow new IllegalStateException(\"elem was not generated from this universe\");\n\t\t}\n\t\t\n\t\treturn elem.val();\n\t}",
"public Object getElement() {\n return element;\n }",
"String getElem();",
"public Object getElement();",
"public T getElement() {\n return element;\n }",
"String getElement();",
"public WModelObject getElementObject()\n\t{\n\t\tWModelObject elementObject = null;\n\n\t\ttry\n\t\t{\n\t\t\t//Class objClass = Class.forName(m_elementObjectClassName);\n\t\t\t//elementObject = (WModelObject)objClass.newInstance();\n\t\t\t//elementObject.setParent(this);\n\t\t\t//return elementObject;\n\n\t\t\tClass modelObjectClass = Class.forName(m_elementObjectClassName);\n\t\t\tClass[] parameterClass = {Class.forName(\"java.lang.String\"), Class.forName(\"java.lang.String\")};\n\t\t\tConstructor constructor = modelObjectClass.getConstructor(parameterClass);\n\t\t\tObject[] parameterObj = {\"\", getImplTypeName()}; //the first parameter is blank to indicate no driver\n\t\t\t\t\t\t\t\t\t //provided this model object\n\t\t\telementObject = (WModelObject)constructor.newInstance(parameterObj);\n\t\t\telementObject.setParent(this);\n\t\t\treturn elementObject;\n\t\t}\n\t\tcatch (NoSuchMethodException e)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(\"Cannot load element object class for WCollection: \" + m_elementObjectClassName + \" \" + e);\n\t\t\treturn elementObject;\n\t\t}\n\t\tcatch (InvocationTargetException e)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(\"Cannot load element object class for WCollection: \" + m_elementObjectClassName + \" \" + e);\n\t\t\treturn elementObject;\n\t\t}\n\t\tcatch (ClassNotFoundException e)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(\"Cannot load element object class for WCollection: \" + m_elementObjectClassName + \" \" + e);\n\t\t\treturn elementObject;\n\t\t}\n\t\tcatch (InstantiationException e)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(\"Cannot instantiate element object in WCollection: \" + m_elementObjectClassName + \" \" + e);\n\t\t\treturn elementObject;\n\t\t}\n\t\tcatch (IllegalAccessException e)\n\t\t{\n\t\t\tcom.ing.connector.Registrar.logError(\"Illegal access when instantiating element object in WCollection: \" + m_elementObjectClassName + \" \" + e);\n\t\t\treturn elementObject;\n\t\t}\n\t}",
"public T getElement()\n {\n\n return element;\n }",
"public T getElement() {\n\t\treturn element;\n\t}",
"Object element();",
"Object element();",
"public E element();",
"public I_Element getElement() {\n\t\treturn element;\n\t}",
"public T getElement() {\r\n\t\t\r\n\t\treturn element;\r\n\t\r\n\t}",
"Element getElement();",
"public Element getElement()\n {\n return m_Element;\n }",
"Element getGenericElement();",
"Elem getElem();",
"public Element getElement() {\n return element;\n }",
"public Element getElement() {\n return element;\n }",
"public synchronized WModelObject elementAt(int index)\n\t{\n\t\treturn (WModelObject)m_elements.elementAt(index);\n\t}",
"@Override\n\tpublic Element getElement() {\n\t\treturn elem;\n\t}",
"public Element element() {\n\t\treturn _element;\n\t}",
"public E getElement()\n {\n return this.data;\n }",
"public Element loadModel(String name){\n\t\tElement load = FactoryManager.getFactoryManager().getScriptManager()\r\n\t\t\t.getReadScript().getRootElement(allModels);\r\n\t\t\r\n\t\t//get the model wanted\r\n\t\tload = load.getChild(name);\r\n\t\t\r\n\t\t//return the element wanted\r\n\t\treturn load;\t\t\r\n\t}",
"Element getElement() {\n\t\tElement result = element.clone();\n\t\tresult.setName(table.getName());\n\t\treturn result;\n\t}",
"final public Element getElement() {\n return element;\n }",
"public E getElement()\n\t{\n\t\treturn this.data;\n\t}",
"public T getElement();",
"public FlowElement getElement() {\n return element;\n }",
"UmlElement getUmlElement();",
"Element getElement(String id);",
"ViewElement getViewElement();",
"public Element getElement() {\r\n\t\treturn element;\r\n\t}",
"public Location getElement(){\n\t\t\treturn element;\n\t\t}",
"public static Element getModelElement(Document projdoc, String modelname){\n\t\tElement projelement = getProjectElement(projdoc);\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tIterator<Element> modelit = projelement.getChildren(\"model\").iterator();\n\t\t\n\t\twhile(modelit.hasNext()){\n\t\t\tElement modelel = modelit.next();\n\t\t\t\n\t\t\tif(modelel.getAttributeValue(\"name\").equals(modelname)){\n\t\t\t\treturn modelel;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n\t\tpublic E getElement() throws IllegalStateException {\n\t\t\treturn element;\n\t\t}",
"public T get() {\n return element;\n }",
"public String getEl() {\r\n\t\treturn el;\r\n\t}",
"public Object element() { return e; }",
"@Override\r\n\tpublic Object getElement(Object elementKey) {\n\t\treturn elements.get(elementKey);\r\n\t}",
"SmilObject get(String elementId) throws SmilException;",
"private Element getElement(String elementName) {\n if (getModel() == null) {\n return null;\n }\n return getModel().getActiveRange().getElement(elementName);\n }",
"public RTWElementRef getAsElement(int i);",
"@Property Element getDocumentElement();",
"public Element getElement() {\n return super.getElement();\n }",
"public Element getElement() {\n if (view != null) {\n return view.getElement();\n }\n return editor.getDocument().getDefaultRootElement();\n }",
"public java.lang.String[] getElement() {\n return element;\n }",
"public Element getElement() {\n/* 78 */ return this.e;\n/* */ }",
"public T getValue(){\n \treturn element;\n }",
"E getElement() throws IllegalStateException;",
"public Object getElement()\n {return data;}",
"private static String getModeledElementLabel(ModeledElement element) {\n\t\treturn element.getName();\n\t}",
"public FormElementModel getFormElementModel();",
"protected E getModel ()\n\t{\n\t\treturn model;\n\t}",
"@Override\r\n\tpublic void findElement() {\n\t\t\r\n\t}",
"public XNode getTargetModel() {\n\t\tString name = getName();\n\t\tif (\"*\".equals(name)) { // any in root selection\n\t\t\tXElement result = new XElement(\"$any\", null, _definition);\n\t\t\tresult.setSPosition(getSPosition());\n\t\t\tresult.setXDPosition(_definition.getXDPosition() + \"*\");\n\t\t\tresult._moreAttributes = 'T';\n\t\t\tresult._moreElements = 'T';\n\t\t\tresult.setUnbounded();\n\t\t\treturn result;\n\t\t}\n\t\tXMDefinition xdef = getXDPool().getXMDefinition(_refXdefName);\n\t\tif (xdef == null) { // X-definition not found\n\t\t\treturn null;\n\t\t}\n\t\tint ndx = name.indexOf('/');\n\t\tString mName = ndx > 0 ? name.substring(0, ndx) : name; //model name\n\t\tString uri;\n\t\tif (getKind() <= 1 && _parent.getXMDefinition() != xdef) {\n\t\t\t// uses or inplements\n\t\t\turi = _parent.getNSUri();\n\t\t} else {\n\t\t\turi = getNSUri();\n\t\t}\n\t\tXElement xe = (XElement) xdef.getModel(uri, mName);\n\t\tif (xe == null) {\n\t\t\tString s = mName + \"$any\";\n\t\t\txe = (XElement) xdef.getModel(getNSUri(), s);\n\t\t\tif (xe != null) {\n\t\t\t\tsetName(s);\n\t\t\t} else {\n\t\t\t\tXPool xp = (XPool) xdef.getXDPool();\n\t\t\t\ts = _refXdefName + '#' + mName;\n\t\t\t\tif (ndx > 0) {\n\t\t\t\t\tString t = name.substring(ndx);\n\t\t\t\t\tString u = \"$choice/$choice\";\n\t\t\t\t\tXMNode xn = xp.findModel(s + u + t);\n\t\t\t\t\tif (xn == null) {\n\t\t\t\t\t\tu = \"$mixed/$mixed\";\n\t\t\t\t\t\txn = xp.findModel(s + u + t);\n\t\t\t\t\t}\n\t\t\t\t\tif (xn == null) {\n\t\t\t\t\t\tu = \"$sequence/$sequence\";\n\t\t\t\t\t\txn = xp.findModel(s + u + t);\n\t\t\t\t\t}\n\t\t\t\t\tif (xn != null) {\n\t\t\t\t\t\tsetName(s + u + t);\n\t\t\t\t\t}\n\t\t\t\t\treturn (XNode) xn;\n\t\t\t\t} else {\n\t\t\t\t\tXMNode xn = xp.findModel(s + \"$choice\");\n\t\t\t\t\tif (xn != null) {\n\t\t\t\t\t\tsetName(s + \"$choice\");\n\t\t\t\t\t\treturn (XNode) xn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (xe == null) {\n\t\t\tif (mName.endsWith(\"$choice\")) { // mName may be e.g. name$choice\n\t\t\t\txe = (XElement) xdef.getModel(\n\t\t\t\t\turi,mName.substring(0,mName.length() - \"$choice\".length()));\n\t\t\t}\n\t\t}\n\t\tif (xe != null) {\n\t\t\tif(ndx > 0) {\n\t\t\t\tXMNode xn = XPool.findXMNode(xe, name.substring(ndx+1), 0, -1);\n\t\t\t\tif (xn == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn (XNode) xn;\n\t\t\t} else if (xe._xon > 0) {\n\t\t\t\tXMNode[] models = xe.getChildNodeModels();\n\t\t\t\tif (models.length==1 && models[0].getKind()==XMNode.XMELEMENT) {\n\t\t\t\t\treturn (XElement) models[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn xe;\n\t}",
"Element getElement(Position pos);",
"public IElement element(String id);",
"@Override\r\n public Element findElement()\r\n {\n return null;\r\n }",
"@Nullable\n public PsiElement<?> getParsedElement() {\n return element;\n }",
"@Override\r\n\tpublic E element() {\n\t\treturn null;\r\n\t}",
"public ModelElements getModelAccess() {\n\t\treturn pModel;\n\t}",
"public GraphElement getElement() {\n return this.element;\n }",
"public String elementName() {\n return _element;\n }",
"public String elementName() {\n return _element;\n }",
"Element asElement();",
"public Element getElement(String subExpression) {\n Element result = null;\n String expression = contextNode + \"/\" + subExpression;\n try {\n Node n = (Node)xp.evaluate(expression, source, XPathConstants.NODE);\n if (n.getNodeType() == Node.ELEMENT_NODE) result = (Element) n;\n } catch(Exception e) {\n Util.log(\"XML error: can't read node \" + expression + \".\");\n Util.logException(e);\n }\n return result;\n }",
"public String getEssentialElement() {\n\t\treturn essentialElement;\n\t}",
"public org.w3c.dom.Element getElement() {\n return element;\n }",
"public AbstractDNode getOriginalElement() {\n return element;\n }",
"public OntologyElement getOntologyElement() {\n\t\treturn element;\n\t}",
"public int getElem()\r\n\t{\r\n\t\treturn elem;\r\n\t}",
"@Override\n\tpublic Element toElement() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Element getElement() {\n\t\treturn null;\n\t}",
"DiagramElement getDiagramElement();",
"public DomainElement elementForIndex(int index);",
"public static void findElementById() {\n\t\tStartEvent startEvent = modelInstance.getModelElementById(\"startEvent\");\n\t\tSystem.out.println(startEvent.getName());\n\t}",
"public T getElement() {\n\t return myData;\n }",
"public T extractVector( boolean extractRow, int element ) {\n if (extractRow) {\n return extractMatrix(element, element + 1, 0, SimpleMatrix.END);\n } else {\n return extractMatrix(0, SimpleMatrix.END, element, element + 1);\n }\n }",
"public abstract Element getElement(int id) throws PositionEX;",
"public Model getModel () { return _model; }",
"public SingleModelGuiElements getModelGuiElements(Model aModel) {\n return mapModelsToGuiElements.get(aModel);\n }",
"@Override\n\t@TimeComplexity(\"O(1)\")\n\tpublic E element()\n\t{\n\t\treturn element;\n\t}",
"public String getModel() {\n return this.model;\r\n }",
"public T get() {\n return this.elemento;\n }",
"public Elemento getElemento() {\n\t\treturn elemento;\n\t}",
"public SC getElementName() { return _elementName; }",
"public String getModel();",
"Object getModelID(Object groupOrElementID) throws Exception;",
"Elem getPointedElem();",
"public String getModel() {\r\n return model;\r\n }",
"@Override\n public T getCombinedElement()\n {\n return element;\n }",
"String getElementStringValue(Object element);",
"public E element() {\r\n\t\tif (isEmpty()) {\r\n\t\t\tthrow new NoSuchElementException();\r\n\t\t}\r\n\t\treturn (E) data.get(0);\r\n\t}",
"public ContainmentModel getModel()\n {\n return m_model;\n }"
] | [
"0.6449525",
"0.6433565",
"0.6252428",
"0.6164198",
"0.6161463",
"0.614355",
"0.6127142",
"0.611325",
"0.6065854",
"0.60624105",
"0.60307676",
"0.5979209",
"0.59761184",
"0.59711885",
"0.59711885",
"0.5969482",
"0.59595144",
"0.5958708",
"0.59506977",
"0.5925539",
"0.5923829",
"0.5906508",
"0.58954823",
"0.58954823",
"0.5878435",
"0.58607864",
"0.5852742",
"0.5841071",
"0.58405215",
"0.58359146",
"0.5833637",
"0.58187187",
"0.5813111",
"0.58115476",
"0.58056885",
"0.58052367",
"0.5788771",
"0.5776479",
"0.57705057",
"0.57474744",
"0.5741635",
"0.57233953",
"0.57141024",
"0.5708445",
"0.57017446",
"0.56823134",
"0.5678848",
"0.5659293",
"0.5654091",
"0.56452376",
"0.56365794",
"0.5624627",
"0.5604288",
"0.5541436",
"0.5524467",
"0.55180305",
"0.55179954",
"0.55161506",
"0.55082357",
"0.5495353",
"0.5487558",
"0.54724455",
"0.5471034",
"0.54672664",
"0.54539806",
"0.54486716",
"0.5435931",
"0.54273105",
"0.54262555",
"0.54262555",
"0.5402379",
"0.5377235",
"0.5368766",
"0.53628933",
"0.5327653",
"0.5321178",
"0.5319249",
"0.5313663",
"0.53104556",
"0.52967304",
"0.52821434",
"0.5271495",
"0.5256777",
"0.52418226",
"0.52351654",
"0.5224891",
"0.5224798",
"0.52154845",
"0.5210556",
"0.52024436",
"0.51937664",
"0.51937234",
"0.5189492",
"0.51872104",
"0.51858974",
"0.51714027",
"0.51703894",
"0.51692164",
"0.5168442",
"0.5157774"
] | 0.68440247 | 0 |
Constructor initializes variables and saves the config file. | protected Config(AFK plugin) {
this.cfg = plugin.getConfig();
cfg.options().copyDefaults(true);
plugin.saveConfig();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Config()\n {\n try\n {\n // Load settings from file\n load();\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n }",
"public Config(String filename) {\n this.filename = filename;\n }",
"private Config()\n {\n // Load from properties file:\n loadLocalConfig();\n // load the system property overrides:\n getExternalConfig();\n }",
"public Config() {\n\t\t// TODO Auto-generated constructor stub\n\t\t\n\t}",
"private void initalConfig() {\n \t\tconfig = new Configuration(new File(getDataFolder(),\"BeardStat.yml\"));\n \t\tconfig.load();\n \t\tconfig.setProperty(\"stats.database.type\", \"mysql\");\n \t\tconfig.setProperty(\"stats.database.host\", \"localhost\");\n \t\tconfig.setProperty(\"stats.database.username\", \"Beardstats\");\n \t\tconfig.setProperty(\"stats.database.password\", \"changeme\");\n \t\tconfig.setProperty(\"stats.database.database\", \"stats\");\n \n \t\tconfig.save();\n \t}",
"public Config() {\n this(System.getProperties());\n\n }",
"public ConfigsUtils() {\r\n mConfig = new Properties();\r\n try {\r\n mConfig.load(new FileInputStream(CONFIG_FILE_PATH));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public Configuration(File configFile) {\r\n \t\tproperties = loadProperties(configFile);\r\n \t}",
"public BaseClass() {\n\t\t \n\t try {\n\t\t\t \n\t\t\t prop=new Properties();\n\t\t\t \n\t\t\tString path=System.getProperty(\"user.dir\");\n\t\t\t \n\t\t\t // FileInputStream is the pre-defined class\n\t\t\tFileInputStream ip=new FileInputStream(path+\"\\\\src\\\\main\\\\java\\\\com\\\\demoQA\\\\config\\\\Config.Properties\");\n\t\t\t prop.load(ip);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t\te.printStackTrace();\n\t\t}\n\t\t \n\t\t \n\t }",
"public Properties() {\n\n\t\tconfig = new java.util.Properties();\n\n\t\ttry {\n\t\t\tInputStream input = new FileInputStream(new File(\n\t\t\t\t\t\"ConfigurationFile.txt\"));\n\t\t\tconfig.load(input);\n\n\t\t} catch (Exception e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"private Config() {\n }",
"public TestBase() {\n try {\n properties = new Properties();\n FileInputStream fileInputStream = new FileInputStream(\"F:/LearningStuff/PracticalWork\" +\n \"/Frameworks/DataDrivenFrameworkSelenium/src/main/resources/config/config.properties\");\n properties.load(fileInputStream);\n } catch (FileNotFoundException f) {\n f.printStackTrace();\n } catch (IOException i) {\n i.printStackTrace();\n }\n }",
"public void initialize() {\n if (!BungeeBan.getInstance().getDataFolder().exists()) {\n BungeeBan.getInstance().getDataFolder().mkdirs();\n }\n File file = this.getConfigurationFile();\n if (!file.exists()) {\n try {\n file.createNewFile();\n if (this.defaultConfig != null) {\n try (InputStream is = BungeeBan.getInstance().getResourceAsStream(this.defaultConfig);\n OutputStream os = new FileOutputStream(file)) {\n ByteStreams.copy(is, os);\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n this.reload();\n }",
"private void initFiles() {\r\n\t\ttry {\r\n\t\t\tFile file = getConfigFile();\r\n\t\t\tif (!file.exists()) {\r\n\t\t\t\tXmlFile.write(file, new SystemSettings());\r\n\t\t\t}\r\n\t\t} catch (Exception ex) {\r\n\t\t\tlogger.error(\"Failed to initialize settings file\", ex);\r\n\t\t}\r\n\t}",
"public static void LoadIntoConfigFiles()\n {\n \tProperties prop = new Properties();\n ///*\n \ttry {\n \t\t//set the properties value\n \n prop.setProperty(\"comp_name\", \"Teledom International Ltd\");\n prop.setProperty(\"com_city\", \"Lagos\");\n \t\tprop.setProperty(\"State\", \"Lagos\");\n \t\tprop.setProperty(\"logo_con\", \"logo.png\");\n \t\tprop.setProperty(\"front_frame\", \"front.png\");\n prop.setProperty(\"back_frame\", \"back.png\");\n \n \n \n \n \t\t//save properties to project root folder\n \t\tprop.store(new FileOutputStream(setupFileName), null);\n \n \t} catch (IOException ex) {\n \t\tex.printStackTrace();\n }\n // */\n \n \n \n }",
"private ConfigReader() {\r\n\t\tsuper();\r\n\t}",
"private void initConfig() {\n Path walletPath;\n Wallet wallet;\n\n // load a CCP\n Path networkConfigPath; \n \n try {\n \t\n \tif (!isLoadFile) {\n // Load a file system based wallet for managing identities.\n walletPath = Paths.get(\"wallet\");\n wallet = Wallet.createFileSystemWallet(walletPath);\n\n // load a CCP\n networkConfigPath = Paths.get(\"\", \"..\", \"basic-network\", configFile);\n \n builder = Gateway.createBuilder();\n \n \tbuilder.identity(wallet, userId).networkConfig(networkConfigPath).discovery(false);\n \t\n \tisLoadFile = true;\n \t}\n } catch (Exception e) {\n \te.printStackTrace();\n \tthrow new RuntimeException(e);\n }\n\t}",
"public MecBasicsConfig()\n {\n\n }",
"public ConfigFileReader(){\r\n\t\tBufferedReader reader;\r\n\t\ttry {\r\n\t\t\treader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\tproperties = new Properties();\r\n\t\t\ttry {\r\n\t\t\t\tproperties.load(reader);\r\n\t\t\t\treader.close();\r\n\t\t\t}catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}catch(FileNotFoundException ex) {\r\n\t\t\tSystem.out.println(\"Configuration.properties not found at \"+propertyFilePath);\r\n\t\t}\r\n\t}",
"@Override\n public void initialize() {\n // TODO Auto-generated method stub\n String name = (String)getConfigParameterValue(\"OutputPath\");\n File file = new File(name);\n try {\n bout = new BufferedWriter(new FileWriter(file));\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n throw new UIMARuntimeException(e);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n throw new UIMARuntimeException(e);\n }\n output = new HashSet<String>();\n }",
"public Config(String filename, String defaultConfig) {\n this.filename = filename;\n this.defaultConfig = defaultConfig;\n }",
"public class_config(){\n\t\t\n\t\tformat_date=\"dd/MM/yyyy\";\n\t\tcurrency='€';\n\t\tdecimals=2;\n\t\tlanguage=\"eng\";\n\t\ttheme=\"Metal\";\n\t\tfile_format=\"json\";\n\t\t\n\t}",
"public void loadConfig(){\n this.saveDefaultConfig();\n //this.saveConfig();\n\n\n }",
"public ConfigFileReader(){\r\n\t\t \r\n\t\t BufferedReader reader;\r\n\t\t try {\r\n\t\t\t reader = new BufferedReader(new FileReader(propertyFilePath));\r\n\t\t\t properties = new Properties();\r\n\t\t\t try {\r\n\t\t\t\t properties.load(reader);\r\n\t\t\t\t reader.close();\r\n\t\t\t } catch (IOException e) {\r\n\t\t\t\t e.printStackTrace();\r\n\t\t\t }\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t\t e.printStackTrace();\r\n\t\t\t throw new RuntimeException(\"configuration.properties not found at \" + propertyFilePath);\r\n\t \t } \r\n\t }",
"public void init()\r\n {\n readFile(inputFile);\r\n writeInfoFile();\r\n }",
"private void init() {\n\t\tif ( PropertiesConfigurationFilename == null ) {\n\t\t\tlogger.info(\"config.properties is default\");\n\t\t\tconfigProp = createDefaultProperties();\n\t\t} else {\n\t\t\ttry {\n\t\t\t\tlogger.info(\"config.properties is \"+ PropertiesConfigurationFilename.getAbsolutePath());\n\t\t\t\tconfigProp = new PropertiesConfiguration();\n\t\t\t\tconfigProp.load(PropertiesConfigurationFilename);\n\t\t\t} catch (ConfigurationException e) {\n\t\t\t\tlogger.error(\"Unable to open config file: \" + PropertiesConfigurationFilename.getAbsolutePath(), e);\n\t\t\t\tlogger.info(\"config.properties is default\");\n\t\t\t\tconfigProp = createDefaultProperties();\n\t\t\t}\n\t\t}\n\n\n\t\t// Load the locale information\n\t\tString locale = configProp.getString(\"locale\");\n\n\t\tconfigProp.setProperty(\"zmMsg\", ResourceBundle.getBundle(\"ZmMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zhMsg\", ResourceBundle.getBundle(\"ZhMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"ajxMsg\", ResourceBundle.getBundle(\"AjxMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"i18Msg\", ResourceBundle.getBundle(\"I18nMsg\", new Locale(locale)));\n\n\t\tconfigProp.setProperty(\"zsMsg\", ResourceBundle.getBundle(\"ZsMsg\", new Locale(locale)));\n\n\t}",
"private void configInit() {\r\n\t\tconfig = pluginInstance.getConfiguration();\r\n\t\tif (!new File(pluginInstance.getDataFolder().getPath() + File.separator + \"config.yml\")\r\n\t\t\t\t.exists()) {\r\n\t\t\tconfig.setProperty(\"reset-deathloc\", true);\r\n\t\t\tconfig.setProperty(\"use-iConomy\", true);\r\n\t\t\tconfig.setProperty(\"creation-price\", 10.0D);\r\n\t\t\tconfig.setProperty(\"deathtp-price\", 50.0D);\r\n\t\t\tconfig.setProperty(\"allow-tp\", true);\r\n\t\t\tconfig.setProperty(\"maxTombStone\", 0);\r\n\t\t\tconfig.setProperty(\"TombKeyword\", \"[Tomb]\");\r\n\t\t\tconfig.setProperty(\"use-tombAsSpawnPoint\", true);\r\n\t\t\tconfig.setProperty(\"cooldownTp\", 5.0D);\r\n\t\t\tconfig.setProperty(\"reset-respawn\", false);\r\n\t\t\tconfig.setProperty(\"maxDeaths\", 0);\r\n\t\t\tconfig.save();\r\n\t\t\tworkerLog.info(\"Config created\");\r\n\t\t}\r\n\t\tconfig.load();\r\n\t}",
"private OptimoveConfig() {\n }",
"public SimulationConfig() {\r\n\t}",
"public SystemConfiguration() {\r\n\t\tlog = Logger.getLogger(SystemConfiguration.class);\r\n\t}",
"public void parse(){\n\t\tFile file = new File(fileLocation);\n\n\t\tlong seed = ConfigurationData.DEFAULT_SEED;\n\t\tString outputDest = ConfigurationData.DEFAULT_OUTPUT_DESTINATION;\n\t\tLong tickLength = ConfigurationData.DEFAULT_TICK_LENGTH;\n\t\tint port = ConfigurationData.DEFAULT_PORT;\n\n\t\ttry {\n\n\t\t\tScanner sc = new Scanner(file);\n\n\t\t\twhile(sc.hasNext()){\n\t\t\t\tString[] tok = sc.next().split(\"=\");\n\t\t\t\tswitch(tok[0]){\n\t\t\t\tcase \"seed\":\n\t\t\t\t\tseed = Long.parseLong(tok[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"outputDestination\":\n\t\t\t\t\toutputDest = tok[1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"tickLength\":\n\t\t\t\t\ttickLength = Long.parseLong(tok[1]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"port\":\n\t\t\t\t\tport = Integer.parseInt(tok[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsc.close();\n\n\t\t\tconfigurationData = new ConfigurationData(seed, outputDest, tickLength, port);\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\tPrintWriter writer;\n\t\t\ttry {\n\t\t\t\twriter = new PrintWriter(fileLocation, \"UTF-8\");\n\t\t\t\twriter.println(\"seed=\"+seed);\n\t\t\t\twriter.println(\"outputDestination=\"+outputDest);\n\t\t\t\twriter.println(\"tickLength=\"+tickLength);\n\t\t\t\twriter.println(\"port=\"+port);\n\t\t\t\twriter.close();\n\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t} catch (UnsupportedEncodingException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\tconfigurationData = ConfigurationData.makeDefault();\n\t\t\tSystem.out.println(\"Default file created\");\n\t\t}\n\t}",
"@PostConstruct\n\tpublic void init() {\n\t\tif (!Files.isDirectory(Paths.get(configFilePath))) {\n\t\t\ttry {\n\t\t\t\tFiles.createDirectory(Paths.get(configFilePath));\n\t\t\t} catch (IOException e) {\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\"can't create the folder for the configuration\", e);\n\t\t\t}\n\t\t}\n\t\t// schedule the watch service in repeating loop to look for modification\n\t\t// at the jambel configuration files\n\t\tconfigFilesWatchServiceExecutor.scheduleAtFixedRate(\n\t\t\t\tnew ConfigPathWatchService(configFilePath), 0L, 1L,\n\t\t\t\tTimeUnit.MILLISECONDS);\n\t}",
"@Override\n public void init() throws Exception {\n config = new Config();\n }",
"public ConfigExample() {\n }",
"private LODEParameters(){\n prefsFile=new File(LODEConstants.PARAMS_FILE);\n }",
"private static synchronized void init() {\n if (CONFIG_VALUES != null) {\n return;\n }\n\n CONFIG_VALUES = new Properties();\n processLocalConfig();\n processIncludedConfig();\n }",
"public ReadConfigFile (){\n\t\ttry {\n\t\t\tinput = ReadConfigFile.class.getClassLoader().getResourceAsStream(Constant.CONFIG_PROPERTIES_DIRECTORY);\n\t\t\tprop = new Properties();\n\t\t\tprop.load(input);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}catch ( IOException e ) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\t\t\n\t}",
"@Override\n public void initialize() \n {\n try {\n mLogFile = new FileWriter(\"/home/lvuser/drivePath.csv\", true);\n mLogFile.write(\"\\n\");\n mLogFile.write(\"\\n\");\n mLogFile.write(\"Event:\"+DriverStation.getInstance().getEventName()+\"\\n\");\n mLogFile.write(\"Match Number:\"+DriverStation.getInstance().getMatchNumber()+\"\\n\");\n mLogFile.write(\"Replay Number:\"+DriverStation.getInstance().getReplayNumber()+\"\\n\");\n mLogFile.write(\"Game Data:\"+DriverStation.getInstance().getGameSpecificMessage()+\"\\n\"); \n mLogFile.write(\"\\n\");\n }\n catch(IOException e) \n {\n e.printStackTrace();\n System.out.println(\"Unable to create FileWriter\");\n }\n mCount = 0;\n }",
"private void GetConfig()\n {\n boolean useClassPath = false;\n if(configFile_ == null)\n {\n useClassPath = true;\n configFile_ = \"data.config.lvg\";\n }\n // read in configuration file\n if(conf_ == null)\n {\n conf_ = new Configuration(configFile_, useClassPath);\n }\n }",
"private static void init()\n {\n long nTimeOut = 12 * 60 * 60 * 1000; // Default == 12 hrs\n \n // Loading values from properties file\n Properties props = new Properties();\n \n try\n {\n ClassLoader classLoader = Constant.class.getClassLoader();\n InputStream is = classLoader.getResourceAsStream(\"joing-server.properties\");\n props.load( is );\n is.close();\n }\n catch( Exception exc )\n {\n // If can not read the file, create a file with default values\n String sHome = System.getProperty( \"user.home\" );\n char cDir = File.separatorChar;\n \n if( sHome.charAt( sHome.length() - 1 ) != cDir )\n sHome += cDir;\n \n // Initialise properties instance with default values\n props.setProperty( sSYSTEM_NAME , \"joing.org\" );\n props.setProperty( sBASE_DIR , cDir +\"joing\" );\n props.setProperty( sEMAIL_SRV , \"localhost\" );\n props.setProperty( sSESSION_TIMEOUT, Long.toString( nTimeOut ));\n }\n \n // Read properties from created props\n sVersion = \"0.1\"; // It's better to hardcode this property than to store it in a file\n sSysName = props.getProperty( sSYSTEM_NAME );\n fBaseDir = new File( props.getProperty( sBASE_DIR ) );\n fUserDir = new File( fBaseDir, \"users\" );\n fAppDir = new File( fBaseDir, \"apps\" );\n \n if( ! fBaseDir.exists() )\n fBaseDir.mkdirs();\n \n if( ! fAppDir.exists() )\n fAppDir.mkdirs();\n \n if( ! fUserDir.exists() )\n fUserDir.mkdirs();\n \n try\n {\n emailServer = new URL( props.getProperty( sEMAIL_SRV ) );\n }\n catch( MalformedURLException exc )\n {\n emailServer = null;\n }\n \n try\n { // From minutes (in file) to milliseconds\n nSessionTimeOut = Long.parseLong( props.getProperty( sSESSION_TIMEOUT ) ) * 60 * 1000;\n }\n catch( NumberFormatException exc )\n {\n nSessionTimeOut = nTimeOut;\n }\n }",
"protected void initVars() {\n prefFile = \"./server.ini\";\n mimeFile = \"./mime.ini\";\n }",
"private void saveConfiguration() {\n }",
"public BaseTest() {\n\n String path = System.getProperty(\"user.dir\") + \"/src/test/resources/config.properties\";\n prop = new Properties();\n /** Stream to read the spreadsheet. */\n FileInputStream fis = null;\n try {\n fis = new FileInputStream(path);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n try {\n prop.load(fis);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }",
"private void init() throws IOException {\n if (Files.exists(getBaseConfigPath()) && !Files.isDirectory(getBaseConfigPath())) {\n throw new IOException(\"Base config path exists and is not a directory \" + getBaseConfigPath());\n }\n\n if (!Files.exists(getBaseConfigPath())) {\n Files.createDirectories(getBaseConfigPath());\n }\n\n\n if (Files.exists(nodeIdPath) && !Files.isRegularFile(nodeIdPath)) {\n throw new IOException(\"NodeId file is not a regular directory!\");\n }\n\n if (Files.exists(clusterNamePath) && !Files.isRegularFile(clusterNamePath)) {\n throw new IOException(\"Cluster name is not a regular directory!\");\n }\n\n if (!Files.isWritable(getBaseConfigPath())) {\n throw new IOException(\"Can't write to the base configuration path!\");\n }\n }",
"private final void config() {\n\t\tfinal File configFile = new File(\"plugins\" + File.separator\n\t\t\t\t+ \"GuestUnlock\" + File.separator + \"config.yml\");\n\t\tif (!configFile.exists()) {\n\t\t\tthis.plugin.saveDefaultConfig();\n\t\t\tMain.INFO(\"Created default configuration-file\");\n\t\t}\n\t}",
"public OServerConfiguration() {}",
"public Configuration() {\r\n\t\tthis.serverAddress = \"127.0.0.1\";\r\n\t\tthis.serverPort = \"2586\";\r\n\t}",
"Config(InfoHandler info){\n \n this.info = info;\n \n config_list = new ArrayList<>();\n \n File test = new File(config_path);\n \n if(test.exists()){ //plik istnieje\n \n info.mode=1; //wlaczenie trybu dla obslugi pliku konfiguracyjnego\n \n \n //tutaj pobieranie informacji z pliku konfiguracyjnego\n //do ciała funkcji\n \n config_file = new DictReader(config_path,info);\n \n //tutaj dodajemy funkcjonalnosci\n \n config_list.add(config_file.szukaj(\"%imie\"));\n config_list.add(config_file.szukaj(\"%dict_path\"));\n \n config = get_config();\n \n info.mode=0;\n \n is_alive = true;\n }\n else{\n config = new ArrayList<>();\n config_file = new DictReader(config_path,info);\n first_start = 1;\n }\n }",
"public BaseTest() {\n\t\t\n\t\tprop= new Properties();\n\t\t\n\t\ttry {\n\t\t\tFileInputStream fle= new FileInputStream(\"C:\\\\Users\\\\19175\\\\eclipse-workspace\\\\com.toyota\\\\src\\\\test\\\\java\\\\Config\\\\config.properties\"); // Path of the Properties file\n\t\t\tprop.load(fle);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public synchronized static void initConfig() {\n SeLionLogger.getLogger().entering();\n Map<ConfigProperty, String> initialValues = new HashMap<>();\n\n initConfig(initialValues);\n\n SeLionLogger.getLogger().exiting();\n }",
"public BaseConfig() {\n\t\tlong current = System.currentTimeMillis();\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTimeInMillis(current);\n\t\tthis.start_hours = cal.get(Calendar.HOUR_OF_DAY);\n\t\tthis.start_minutes = cal.get(Calendar.MINUTE);\n\t\tthis.stop_hours = this.start_hours;\n\t\tthis.stop_minutes = this.start_minutes;\n\t\tthis.force_on = false;\n\t\tthis.force_off = false;\n\t\tthis.sensor_type = SensorType.LIGHT;\n\t\tthis.sensing_threshold = .5f;\n\t\tthis.sensorInterval = 3000;\n\t\t/*String address;\n\t\ttry {\n\t\t\taddress = InetAddress.getLocalHost().toString();\n\t\t\taddress = address.substring(address.indexOf('/') + 1);\n\t\t\tserverIP = address;\n\t\t\tserverPort = 9999;\n\t\t} catch (UnknownHostException e) {\n\t\t\t// Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t\n\t}",
"private void initConfiguration() {\n\t\tseedList = new ArrayList<String>();\n\t\t// TODO: add other initialization here...\n\t}",
"public ConfigFile(String fileName, String encoding) {\n InputStream inputStream = null;\n try {\n inputStream = getClassLoader().getResourceAsStream(fileName); // properties.load(ConfigFile.class.getResourceAsStream(fileName));\n if (inputStream == null) {\n throw new IllegalArgumentException(\"Properties file not found in classpath: \" + fileName);\n }\n\n properties = new Properties();\n if (fileName.endsWith(\"yml\")){\n isYml = true;\n properties= new Yaml().loadAs(new InputStreamReader(inputStream, encoding),Properties.class);\n }else\n properties.load(new InputStreamReader(inputStream, encoding));\n } catch (IOException e) {\n throw new RuntimeException(\"Error loading properties file.\", e);\n } finally {\n if (inputStream != null) try {\n inputStream.close();\n } catch (IOException e) {\n LogKit.error(e.getMessage(), e);\n }\n }\n }",
"private static void initConfig() {\n /*\n * Human IO\n */\n {\n /*\n * Constants\n */\n {\n /*\n * Joysticks\n */\n {\n addToConstants(\"joysticks.left\", 0);\n addToConstants(\"joysticks.right\", 1);\n addToConstants(\"joysticks.operator\", 2);\n }\n\n /*\n * Buttons and axis\n */\n {\n }\n }\n }\n\n /*\n * RobotIO\n */\n {\n /*\n * Constants\n */\n {\n /*\n * Kicker\n */\n addToConstantsA(\"kicker.encoder.distPerPulse\", 360.0 / 1024.0);\n }\n }\n\n /*\n * Chassis\n */\n {\n /*\n * Constants\n */\n {\n }\n\n /*\n * Variables\n */\n {\n }\n }\n\n /*\n * Kicker\n */\n {\n /*\n * Constants\n */\n {\n addToConstants(\"kicker.kick.normal\", 1.75);\n addToConstants(\"kicker.kick.timeout\", 0.75);\n\n addToConstants(\"kicker.shaken.voltage\", -0.3316);\n addToConstants(\"kicker.shaken.tolerance\", 3.0);\n\n addToConstants(\"kicker.zero.voltage\", 0.8);\n addToConstants(\"kicker.zero.duration\", 0.75);\n }\n\n /*\n * Variables\n */\n {\n }\n }\n\n /*\n * Gripper\n */\n {\n /*\n * Constants\n */\n {\n addToConstants(\"gripper.collection.voltage\", 0.82);\n addToConstants(\"gripper.ejection.voltage\", -0.45);\n }\n }\n }",
"protected DiscoveryVOSConfig() {\n\t\tsuper(BRANCH_ROOT + \".DiscoveryVOS.com.discoveryVOS.\".replace('.', File.separatorChar));\n\t}",
"private ConfigProperties() {\n\n }",
"void construct() throws FndException\n {\n if (DEBUG) debug(\"ASPConfig.construct()\");\n String cfgdir = getASPManager().getASPConfigFileDir();\n\n synchronized(getClass())\n {\n configfile = ASPConfigFile.getDir(cfgdir);\n if( !configfile.initialized ) configfile.construct(getASPPage());\n }\n parameters = (Hashtable)configfile.params.clone();\n srv_fmt = (ServerFormatter)configfile.srv_fmt.clone();\n }",
"public void init( ){\n\t filepath = getServletContext().getContextPath();\r\n\tappPath = getServletContext().getRealPath(SAVE_DIR);\r\n\t \r\n\t }",
"private void init() {\n\n DateFormat dateFormatter = new SimpleDateFormat(\"YYYY_MM_dd-HH_mm_ss_SSS\");\n String timeString = dateFormatter.format(new Date(System.currentTimeMillis()));\n urlsFile = new File(\"urls_\" + timeString + \".txt\");\n emailsFile = new File(\"emails_\" + timeString + \".txt\");\n\n try {\n urlsFile.createNewFile();\n emailsFile.createNewFile();\n urlsWriter = new PrintWriter(urlsFile.getPath(), \"UTF-8\");\n emailsWriter = new PrintWriter(emailsFile.getPath(), \"UTF-8\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"private void initPath() {\n this.IniFile = new IniFile();\n String configPath = this.getApplicationContext().getFilesDir()\n .getParentFile().getAbsolutePath();\n if (configPath.endsWith(\"/\") == false) {\n configPath = configPath + \"/\";\n }\n this.appIniFile = configPath + constants.USER_CONFIG_FILE_NAME;\n }",
"@Override\r\n public void init(){\r\n System.out.println(\"Application inits\");\r\n try {\r\n\t\t// Create file for logging\r\n\t\ttrainFile = new File(trainFileName);\r\n\t\tif(!trainFile.exists()) {\r\n\t\t\tSystem.out.println(\"\\n\\nTrain Log file does not exist. Create...\");\r\n\t\t\ttrainFile.createNewFile();\r\n\t\t\tSystem.out.println(\"\\n\\nTrain Log file created in folder: \" + trainFile.getAbsolutePath());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"\\n\\nTrain Log file created in folder: \" + trainFile.getAbsolutePath());\r\n\t\t}\r\n\t\ttestFile = new File(testFileName);\r\n\t\tif(!testFile.exists()) {\r\n\t\t\tSystem.out.println(\"\\n\\nTest Log file does not exist. Create...\");\r\n\t\t\ttestFile.createNewFile();\r\n\t\t\tSystem.out.println(\"\\n\\nTest Log file created in folder: \" + testFile.getAbsolutePath());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"\\n\\nTest Log file created in folder: \" + testFile.getAbsolutePath());\r\n\t\t}\r\n\t\t// Create file for saving config and results \r\n\t\tstatsFile = new File(statsFileName);\r\n\t\tif(!statsFile.exists()) {\r\n\t\t\tSystem.out.println(\"\\n\\nStats file does not exist. Create...\");\r\n\t\t\tstatsFile.createNewFile();\r\n\t\t\tSystem.out.println(\"\\n\\nStats file created in folder: \" + statsFile.getAbsolutePath());\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"\\n\\nStats file created in folder: \" + statsFile.getAbsolutePath());\r\n\t\t}\r\n\t\t\r\n\t\t// Create FileWriters\r\n\t\ttrainWriter = new FileWriter(trainFile, false);\r\n\t\ttestWriter = new FileWriter(testFile, false);\r\n\t\tstatsWriter = new FileWriter(statsFile, false);\r\n\t\t\r\n\t\t\r\n } catch (Exception e) {\r\n System.err.println(\"Error in creating log files\");\r\n e.printStackTrace();\r\n }\r\n \r\n try {\r\n super.init();\r\n trainWriter.write(\"---Initialization of Application.--- \\nBuild model....\");\r\n this.vgg16Transfer = configurate();\r\n trainWriter.write(\"Configuration created successfully!\");\r\n System.out.println(\"Configuration created successfully!\");\r\n vgg16Transfer.init();\r\n trainWriter.write(\"Neural Network initialized successfully!\");\r\n trainWriter.write(vgg16Transfer.summary());\r\n System.out.println(vgg16Transfer.summary()); // Print changes config\r\n } catch (Exception e) {\r\n System.err.println(\"Error in configurating Neural Network\");\r\n e.printStackTrace();\r\n }\r\n\r\n // Load data for training\r\n try {\r\n \ttrainWriter.write(\"\\nStarted loading training data...\");\r\n loadDataTraining(trainDirAddr);\r\n } catch (IOException e) {\r\n System.err.println(\"Error while loading training dataset\");\r\n e.printStackTrace();\r\n }\r\n // Load data for testing\r\n try {\r\n \ttestWriter.write(\"Started loading training data...\");\r\n loadDataTesting(testDirAddr);\r\n } catch (IOException e) {\r\n System.err.println(\"Error while loading testing dataset\");\r\n e.printStackTrace();\r\n }\r\n\r\n /*\r\n * Check, if model is ready - then load it from file, then check it on test iterator.\r\n * Else - train it and save params to the specified file.\r\n */\r\n if(!collectStats) {\r\n try {\r\n \tSystem.out.println(\"\\n Model is already pre-trained. Loading...\");\r\n \ttestWriter.write(\"\\n Model is already pre-trained. Loading...\");\r\n \r\n // Load model\r\n vgg16Transfer = load();\r\n testWriter.write(\"\\n Model loaded successfully!\");\r\n } \r\n catch (IOException e) {\r\n System.err.println(\"Error while writing to log file\");\r\n e.printStackTrace();\r\n }\r\n catch (Exception e) {\r\n System.err.println(\"Error while loading Neural Network\");\r\n e.printStackTrace();\r\n }\r\n }\r\n else {\r\n \ttry {\r\n\t\t\t\ttrainWriter.write(\"\\n Model is not pre-trained.\");\r\n\t\t\t\tSystem.out.println(\"\\n Model is not pre-trained.\");\r\n\t // Train NN\r\n\t train();\r\n\t\t\t\t\r\n\t\t\t} \r\n catch (IOException e) {\r\n System.err.println(\"Error while writing to log file\");\r\n e.printStackTrace();\r\n }\r\n \tcatch (Exception e1) {\r\n\t\t\t\tSystem.err.println(\"Error while training Neural Network\");\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n \r\n // Save NN to file\r\n try {\r\n System.out.println(\"\\n Model is trained. Saving...\");\r\n trainWriter.write(\"\\n Model is trained. Saving...\");\r\n save(vgg16Transfer);\r\n trainWriter.write(\"\\n Model saved successfully!\");\r\n } catch (Exception e) {\r\n System.err.println(\"Error while saving Neural Network\");\r\n e.printStackTrace();\r\n }\r\n }\r\n }",
"private GameConfig() {}",
"private void init() {\r\n this.configMapping = ChannelConfigHolder.getInstance().getConfigs();\r\n if (!isValid(this.configMapping)) {\r\n SystemExitHelper.exit(\"Cannot load the configuations from the configuration file please check the channelConfig.xml\");\r\n }\r\n }",
"public ConfigurationFileManager(Plugin plugin, Class<T> configClass, int saveInterval, String fileName)\n\t{\n\t\tthis.plugin = plugin;\n\t\tthis.fileName = fileName;\n\t\ttry {\n\t\t\tmodel = configClass.newInstance();\n\t\t\tmodel.init(YamlUtil.getConfiguration(plugin, \"/\", fileName + \".yml\"));\n\t\t\tgetConfigClass().onLoad(getConfigClass().getConfig());\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tBukkit.getLogger().info(\"[MGLib] Error occurred while trying ot initialized config file.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif(saveInterval > 0) savetask.start(Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, this::saveConfig, 20 * saveInterval, 20 * saveInterval));\n\t}",
"private void setAndWriteFiles()\n\t{\n\t\tSensorConfiguration config = new SensorConfiguration();\n\t\tString versionMajor = ConfigurationInterface_v1_0.VERSION.substring(0,\n\t\t\t\tConfigurationInterface_v1_0.VERSION.indexOf('.'));\n\t\tString versionMinor = ConfigurationInterface_v1_0.VERSION\n\t\t\t\t.substring(ConfigurationInterface_v1_0.VERSION.indexOf('.') + 1);\n\t\tconfig.setConfigurationInterfaceVersion(versionMajor, versionMinor);\n\n\t\tStartModes startModes = new StartModes();\n\t\t// set startMode for sensorConfiguration\n\t\tfor (StartMode element : startModes.getStartModeList())\n\t\t{\n\t\t\tif (element.getName().equals(\"DEFINED_TIME\"))\n\t\t\t{\n\t\t\t\tconfig.setStartMode(element);\n\t\t\t}\n\t\t}\n\n\t\tConfigurationSets configSets = new ConfigurationSets();\n\t\t// set configurationSet for sensorConfiguration\n\t\tfor (ConfigurationSet element : configSets.getConfigSetList())\n\t\t{\n\t\t\tif (element.getName().equals(\"mesana\"))\n\t\t\t{\n\n\t\t\t\tconfig.setConfigurationSet(element);\n\t\t\t}\n\t\t}\n\n\t\tif (config.getStartMode().getName().equals(\"DEFINED_TIME\"))\n\t\t{\n\n\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\tcalendar.set(Calendar.DAY_OF_MONTH, 10);\n\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, 5);\n\t\t\tcalendar.set(Calendar.MINUTE, 11);\n\t\t\tDate date = calendar.getTime();\n\t\t\tconfig.setRecordingStartTime(date);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconfig.setRecordingStartTime(null);\n\t\t}\n\t\t\n\t\tconfig.setRecordingDuration(12000);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnectionManager.getInstance().currentSensor(0).setSensorConfiguration(config);\n\t\t\t\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeConfigFile();\n\t\t\t\n\t\t\t// write Encrypted data to sensor\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeEncryptedParameters(\"123456789abcd12\");\n\t\t\t\n\t\t\tint index = customerList.getSelectionIndex();\n\t\t\tif (index >= 0 && index <= mCollect.getList().size())\n\t\t\t{\n\t\t\t\tString linkId = mCollect.getList().get(index).getLinkId();\n\t\t\t\tconfig.addParameter(\"LinkId\", linkId);\n\t\t\t}\n\t\t\t// write custom data to additional file in sensor\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeCustomFile();\n\t\t}\n\t\tcatch (SensorNotFoundException e)\n\t\t{\n\t\t\tstatusBar.setText(e.getMessage());\n\t\t}\n\t}",
"public ServerConfigImpl() {\n this.expectations = new ExpectationsImpl(globalEncoders, globalDecoders);\n this.requirements = new RequirementsImpl();\n }",
"private void initialize(String configLocation) throws IOException {\n\t\tInputStream input = null;\n\t\tProperties props = null;\n\t\ttry {\n\t\t\tinput = SystemListener.class.getResourceAsStream(configLocation);\n\t\t\tprops = new Properties();\n\t\t\tprops.load(input);\t\t\t\n\t\t} finally {\n\t\t\tif (input != null) {\n\t\t\t\tinput.close();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"System Configration initialize Details:\");\n\t\t\n\t\tfor (Entry<Object, Object> entry : props.entrySet()) {\n\t\t String key=(String)entry.getKey();\n\t\t String value=(String)entry.getValue();\n\t\t System.out.println(\"|------ key[\"+key+\"];value[\"+value+\"]\");\n\t\t\tSystem.setProperty(key , value);\n\t\t}\n\t\tSystem.out.println(\"-------finish\");\n\t}",
"public BlobParserConfig() {\n\t\tthis.libraryPath = null;\n\t\tthis.parserClass = null;\n\t}",
"public StorageConfig() {\n }",
"public static void initLoad() throws Exception {\n\n String configPath = System.getProperty(\"config.dir\") + File.separatorChar + \"config.cfg\";\n System.out.println(System.getProperty(\"config.dir\"));\n \n Utils.LoadConfig(configPath); \n /*\n \n // log init load \n String dataPath = System.getProperty(\"logsDir\");\n if(!dataPath.endsWith(String.valueOf(File.separatorChar))){\n dataPath = dataPath + File.separatorChar;\n }\n String logDir = dataPath + \"logs\" + File.separatorChar;\n System.out.println(\"logdir:\" + logDir);\n System.setProperty(\"log.dir\", logDir);\n System.setProperty(\"log.info.file\", \"info_sync.log\");\n System.setProperty(\"log.debug.file\", \"error_sync.log\");\n PropertyConfigurator.configure(System.getProperty(\"config.dir\") + File.separatorChar + \"log4j.properties\");\n */\n }",
"public void loadConfig(){\n \t\tFile configDir = this.getDataFolder();\n \t\tif (!configDir.exists())\n \t\t\tconfigDir.mkdir();\n \n \t\t// Check for existance of config file\n \t\tFile configFile = new File(this.getDataFolder().toString() + \"/config.yml\");\n \t\tconfig = YamlConfiguration.loadConfiguration(configFile);\n \t\t\n \t\t// Adding Variables\n \t\tif(!config.contains(\"Debug\"))\n \t\t{\n \t\t\tconfig.addDefault(\"Debug\", false);\n \t \n \t config.addDefault(\"Worlds\", \"ExampleWorld1, ExampleWorld2\");\n \t\n\t config.addDefault(\"Regions.Residence\", \"ExampleWorld.ExampleResRegion1, ExampleWorld.ExampleResRegion2\");\n \t \n\t config.addDefault(\"Regions.WorldGuard\", \"ExampleWorld.ExampleWGRegion1, ExampleWorld.ExampleWGRegion2\"); \n \t\t}\n \n // Loading the variables from config\n \tdebug = (Boolean) config.get(\"Debug\");\n \tpchestWorlds = (String) config.get(\"Worlds\");\n \tpchestResRegions = (String) config.get(\"Regions.Residence\");\n \tpchestWGRegions = (String) config.get(\"Regions.WorldGuard\");\n \n if(pchestWorlds != null)\n {\n \tlog.info(\"[\"+getDescription().getName()+\"] All Chests Worlds: \" + pchestWorlds);\n }\n \n if(pchestResRegions != null)\n {\n \tlog.info(\"[\"+getDescription().getName()+\"] All Residence Regions: \" + pchestResRegions);\n }\n \n if(pchestWGRegions != null)\n {\n \tlog.info(\"[\"+getDescription().getName()+\"] All World Guard Regions: \" + pchestWGRegions);\n }\n \n config.options().copyDefaults(true);\n try {\n config.save(configFile);\n } catch (IOException ex) {\n Logger.getLogger(JavaPlugin.class.getName()).log(Level.SEVERE, \"Could not save config to \" + configFile, ex);\n }\n }",
"public Driver() {\n setupFiles();\n }",
"private void createConfig(File fileName) {\n\t\tthis.getConfig().set(\"Auto-update\", false);\n \n\t\t// setting a String\n\t\tString announcerName = \"&6[&cBroadcast&5Ex&6]&f: \";\n\t\tthis.getConfig().set(\"Announcer Name\", announcerName);\n \n\t\t// setting an int value\n\t\tint Interval = 10;\n\t\tthis.getConfig().set(\"Interval\", Interval);\n \n\t\t// Setting a List of Strings\n\t\t// The List of Strings is first defined in this array\n\t\tList<String> Messages = Arrays.asList(\"Hello World\", \"Powered by BroadcastEx\", \"&dColor codes &fare compatible :)\");\n\t\tthis.getConfig().set(\"Messages\", Messages);\n\t\tthis.saveConfig();\n\t}",
"public ConfigFileNotFoundException() {\n\tthis(\"No pude encontrar el archivo de configuración!\");\n }",
"private ConfigurationModel() {\r\n\tloadConfiguration();\r\n }",
"public ConfigData(FileConfiguration CoreConfig, FileConfiguration outConfig) {\n\t\t// core configuration is configuration that is Global.\n\t\t// we try to avoid these now. Normally the primary interest is the\n\t\t// GriefPrevention.WorldConfigFolder setting.\n\t\tString DefaultConfigFolder = DataStore.dataLayerFolderPath + File.separator + \"WorldConfigs\" + File.separator;\n\t\tString DefaultTemplateFile = DefaultConfigFolder + \"_template.cfg\";\n\t\t// Configurable template file.\n\t\tTemplateFile = CoreConfig.getString(\"GriefPrevention.WorldConfig.TemplateFile\", DefaultTemplateFile);\n\t\tif (!(new File(TemplateFile).exists())) {\n\t\t\tTemplateFile = DefaultTemplateFile;\n\n\t\t}\n this.GlobalClaims = CoreConfig.getBoolean(\"GriefPrevention.GlobalClaimsEnabled\",true);\n this.GlobalPVP = CoreConfig.getBoolean(\"GriefPrevention.GlobalPVPEnabled\",true);\n this.GlobalSiege = CoreConfig.getBoolean(\"GriefPrevention.GlobalSiegeEnabled\",true);\n this.GlobalSpam = CoreConfig.getBoolean(\"GriefPrevention.GlobalSpamEnabled\",true);\n this.AllowAutomaticMigration = CoreConfig.getBoolean(\"GriefPrevention.AllowAutomaticMigration\",true);\n outConfig.set(\"GriefPrevention.GlobalClaimsEnabled\",GlobalClaims);\n outConfig.set(\"GriefPrevention.GlobalPVPEnabled\",GlobalPVP);\n outConfig.set(\"GriefPrevention.GlobalSiegeEnabled\",GlobalSiege);\n outConfig.set(\"GriefPrevention.GlobalSpamEnabled\",GlobalSpam);\n outConfig.set(\"GriefPrevention.AllowAutomaticMigration\",AllowAutomaticMigration);\n this.DisabledGPCommands = CoreConfig.getStringList(\"GriefPrevention.DisabledCommands\");\n outConfig.set(\"GriefPrevention.DisabledCommands\",DisabledGPCommands);\n\n\n\t\tString SingleConfig = CoreConfig.getString(\"GriefPrevention.WorldConfig.SingleWorld\", NoneSpecifier);\n\t\tSingleWorldConfigLocation = SingleConfig;\n\t\tif (!SingleConfig.equals(NoneSpecifier) && new File(SingleConfig).exists()) {\n\t\t\tGriefPrevention.AddLogEntry(\"SingleWorld Configuration Mode Enabled. File \\\"\" + SingleConfig + \"\\\" will be used for all worlds.\");\n\t\t\tYamlConfiguration SingleReadConfig = YamlConfiguration.loadConfiguration(new File(SingleConfig));\n\t\t\tYamlConfiguration SingleTargetConfig = new YamlConfiguration();\n\t\t\tthis.SingleWorldConfig = new WorldConfig(\"Single World\", SingleReadConfig, SingleTargetConfig);\n\t\t\ttry {\n\t\t\t\tSingleTargetConfig.save(SingleConfig);\n\t\t\t} catch (IOException exx) {\n\t\t\t}\n\t\t}\n\t\tthis.SiegeCooldownSeconds = CoreConfig.getInt(\"GriefPrevention.Siege.CooldownTime\",1000 * 60 * 60);\n outConfig.set(\"GriefPrevention.Siege.CooldownTime\",SiegeCooldownSeconds);\n\t\toutConfig.set(\"GriefPrevention.WorldConfig.SingleWorld\", SingleConfig);\n\t\toutConfig.set(\"GriefPrevention.WorldConfig.TemplateFile\", TemplateFile);\n\t\t// check for appropriate configuration in given FileConfiguration. Note\n\t\t// we also save out this configuration information.\n\t\t// configurable World Configuration folder.\n\t\t// save the configuration.\n\n\t\tWorldConfigLocation = CoreConfig.getString(\"GriefPrevention.WorldConfigFolder\");\n\t\tif (WorldConfigLocation == null || WorldConfigLocation.length() == 0) {\n\t\t\tWorldConfigLocation = DefaultConfigFolder;\n\t\t}\n\t\tFile ConfigLocation = new File(WorldConfigLocation);\n\t\tif (!ConfigLocation.exists()) {\n\t\t\t// if not found, create the directory.\n\t\t\tGriefPrevention.instance.getLogger().log(Level.INFO, \"mkdirs() on \" + ConfigLocation.getAbsolutePath());\n\t\t\tConfigLocation.mkdirs();\n\n\t\t}\n\n\t\t/*\n\t\t * GriefPrevention.instance.getLogger().log(Level.INFO,\n\t\t * \"Reading WorldConfigurations from \" +\n\t\t * ConfigLocation.getAbsolutePath()); if(ConfigLocation.exists() &&\n\t\t * ConfigLocation.isDirectory()){ for(File lookfile:\n\t\t * ConfigLocation.listFiles()){ //System.out.println(lookfile);\n\t\t * if(lookfile.isFile()){ String Extension =\n\t\t * lookfile.getName().substring(lookfile.getName().indexOf('.')+1);\n\t\t * String baseName = Extension.length()==0? lookfile.getName():\n\t\t * lookfile.\n\t\t * getName().substring(0,lookfile.getName().length()-Extension.length\n\t\t * ()-1); if(baseName.startsWith(\"_\")) continue; //configs starting with\n\t\t * underscore are templates. Normally just _template.cfg. //if baseName\n\t\t * is an existing world... if(Bukkit.getWorld(baseName)!=null){\n\t\t * GriefPrevention.instance.getLogger().log(Level.INFO, \"World \" +\n\t\t * baseName + \" Configuration found.\"); } //read it in...\n\t\t * GriefPrevention.AddLogEntry(lookfile.getAbsolutePath());\n\t\t * FileConfiguration Source = YamlConfiguration.loadConfiguration(new\n\t\t * File(lookfile.getAbsolutePath())); FileConfiguration Target = new\n\t\t * YamlConfiguration(); //load in the WorldConfig... WorldConfig wc =\n\t\t * new WorldConfig(baseName,Source,Target); try { Target.save(lookfile);\n\t\t * \n\t\t * }catch(IOException iex){\n\t\t * GriefPrevention.instance.getLogger().log(Level.SEVERE,\n\t\t * \"Failed to save to \" + lookfile.getAbsolutePath()); }\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\t * \n\t\t * } else if(ConfigLocation.exists() && ConfigLocation.isFile()){\n\t\t * GriefPrevention.instance.getLogger().log(Level.SEVERE,\n\t\t * \"World Configuration Folder found, but it's a File. Double-check your GriefPrevention configuration files, and try again.\"\n\t\t * );\n\t\t * \n\t\t * }\n\t\t */\n\n\t}",
"public void loadConfigurationFromDisk() {\r\n try {\r\n FileReader fr = new FileReader(CONFIG_FILE);\r\n BufferedReader rd = new BufferedReader(fr);\r\n\r\n String line;\r\n while ((line = rd.readLine()) != null) {\r\n if (line.startsWith(\"#\")) continue;\r\n if (line.equalsIgnoreCase(\"\")) continue;\r\n\r\n StringTokenizer str = new StringTokenizer(line, \"=\");\r\n if (str.countTokens() > 1) {\r\n String aux;\r\n switch (str.nextToken().trim()) {\r\n case \"system.voidchain.protocol_version\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.protocolVersion = aux;\r\n continue;\r\n case \"system.voidchain.transaction.max_size\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.transactionMaxSize = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.block.num_transaction\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.numTransactionsInBlock = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.storage.data_file_extension\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.dataFileExtension = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.block_file_base_name\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockFileBaseName = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.wallet_file_base_name\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.walletFileBaseName = aux;\r\n }\r\n continue;\r\n case \"system.voidchain.storage.data_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.dataDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.storage.block_file_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.blockFileDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.storage.wallet_file_directory\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null) {\r\n aux = aux.replace('/', File.separatorChar);\r\n if (!aux.endsWith(File.separator))\r\n //aux = aux.substring(0, aux.length() - 1);\r\n aux = aux.concat(File.separator);\r\n this.walletFileDirectory = aux;\r\n }\r\n }\r\n continue;\r\n case \"system.voidchain.memory.block_megabytes\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.memoryUsedForBlocks = Integer.parseInt(aux);\r\n continue;\r\n case \"system.voidchain.sync.block_sync_port\":\r\n if (firstRun) {\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockSyncPort = Integer.parseInt(aux);\r\n }\r\n continue;\r\n case \"system.voidchain.crypto.ec_param\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.ecParam = aux;\r\n continue;\r\n case \"system.voidchain.core.block_proposal_timer\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockProposalTimer = Integer.parseInt(aux) * 1000;\r\n continue;\r\n case \"system.voidchain.blockchain.chain_valid_timer\":\r\n aux = str.nextToken().trim();\r\n if (aux != null)\r\n this.blockchainValidTimer = Integer.parseInt(aux) * 1000;\r\n continue;\r\n }\r\n }\r\n }\r\n\r\n fr.close();\r\n rd.close();\r\n\r\n if (this.firstRun)\r\n this.firstRun = false;\r\n } catch (IOException e) {\r\n logger.error(\"Could not load configuration\", e);\r\n }\r\n }",
"public Config createConfig(String filename);",
"public void setupProp() {\r\n\t\tprop = new Properties();\r\n\t\tInputStream in = getClass().getResourceAsStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\ttry {\r\n\t\t\tprop.load(in);\r\n\t\t\tFileInputStream fin = new FileInputStream(\"C:/Users/Marcus/git/EmailProgram/EmailProgram/resources/config.properties\");\r\n\t\t\tObjectInputStream ois = new ObjectInputStream(fin);\r\n\t\t\tdblogic = (PatronDBLogic) ois.readObject();\r\n\t\t\tois.close();\r\n\r\n\t\t} catch (IOException | ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public OlcDistProcConfig()\n {\n super();\n }",
"public ConfigManager() {\n // Nobody here.\n }",
"protected CommonSettings() {\r\n port = 1099;\r\n objectName = \"library\";\r\n }",
"public DBCredentials() {\n try {\n // Get the inputStream\n InputStream inputStream = this.getClass().getClassLoader()\n .getResourceAsStream(file);\n\n Properties properties = new Properties();\n\n // load the inputStream using the Properties\n properties.load(inputStream);\n // get the value of the property\n this.dbUser = properties.getProperty(\"Username\");\n this.dbPassword = properties.getProperty(\"Password\");\n this.dbUrl = properties.getProperty(\"DataBase\");\n\n } catch (IOException e) {\n System.out.println(\"IOException\");\n e.printStackTrace();\n }\n }",
"public FileBasedConfigSource() {\n // Intentionally empty.\n }",
"protected Configuration() {\r\n }",
"public SystemConfigurations() {\n\t\tsetOs();\n\t\tsetFileSeparator();\n\t\tsetWorkDiretory();\n\t\t\n\t}",
"public static void acceptConfig() {\r\n\t\t//Here, it tries to read over the config file using try-catch in case of Exception\r\n\t\ttry {\r\n\t\t\tProperties properties = new Properties();\r\n\t\t\tFileInputStream fis = new FileInputStream(new File(\"config.properties\"));\r\n\t\t\tproperties.load(fis);\r\n\t\t\tString storage = properties.getProperty(\"storage\");\r\n\t\t\tif(storage == null) \r\n\t\t\t\tthrow new IllegalArgumentException(\"Property 'storage' not found\");\r\n\t\t\tif(storage.equals(\"tree\"))\r\n\t\t\t\tdata = new BinarySearchTree();\r\n\t\t\tif(storage.equals(\"trie\"))\r\n\t\t\t\tdata = new Trie();\r\n\t\t\tif(data == null) \r\n\t\t\t\tthrow new IllegalArgumentException(\"Not valid storage configuration.\");\r\n\t\t}\r\n\t\t//If an Exception occurs, it just prints a message\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\tSystem.out.println(\"Configuration file not found.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t} catch (IllegalArgumentException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t\tSystem.exit(1);\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(\"Error reading the configuration file.\");\r\n\t\t\tSystem.exit(1);\r\n\t\t}\r\n\t}",
"private Configuration(String location) {\n this.location = location;\n }",
"public Property(String configFileName) {\r\n\r\n\t\tpositive = new String[] { \"fun\", \"happy\", \"positive\" };\r\n\t\tnegative = new String[] { \"sad\", \"bad\", \"angry\" };\r\n\t\tstop = new String[] { \"a\", \"an\", \"the\" };\r\n\t\tscoringmethod = 0;\r\n\t\tmindistance = 0.5;\r\n\r\n\t\tif (configFileName == null) {\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\t\tScanner in = null;\r\n\t\tScanner scan = null;\r\n\t\ttry {\r\n\t\t\tFile conf = new File(configFileName);\r\n\t\t\tin = new Scanner(conf);\r\n\t\t\twhile (in.hasNextLine()) {\r\n\t\t\t\tString line = in.nextLine().replace('=', ',');\r\n\t\t\t\tscan = new Scanner(line);\r\n\t\t\t\tscan.useDelimiter(\",\");\r\n\t\t\t\tString firstWord = scan.next();\r\n\t\t\t\tif (firstWord.equals(\"positive\")) {\r\n\t\t\t\t\tpositive = termsArray(scan);\r\n\t\t\t\t} else if (firstWord.equals(\"negative\")) {\r\n\t\t\t\t\tnegative = termsArray(scan);\r\n\t\t\t\t} else if (firstWord.equals(\"stop\")) {\r\n\t\t\t\t\tstop = termsArray(scan);\r\n\t\t\t\t} else if (firstWord.equals(\"scoringmethod\")) {\r\n\t\t\t\t\tString next = scan.next();\r\n\t\t\t\t\tscoringmethod = Integer.parseInt(next);\r\n\t\t\t\t} else if (firstWord.equals(\"mindistance\")) {\r\n\t\t\t\t\tString next = scan.next();\r\n\t\t\t\t\tmindistance = Double.parseDouble(next);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (NumberFormatException ex) {\r\n\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\tpositive = new String[] { \"fun\", \"happy\", \"positive\" };\r\n\t\t\tnegative = new String[] { \"sad\", \"bad\", \"angry\" };\r\n\t\t\tstop = new String[] { \"a\", \"an\", \"the\" };\r\n\t\t\tscoringmethod = 0;\r\n\t\t\tmindistance = 0.5;\r\n\t\t} catch (IOException ex) {\r\n\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\tpositive = new String[] { \"fun\", \"happy\", \"positive\" };\r\n\t\t\tnegative = new String[] { \"sad\", \"bad\", \"angry\" };\r\n\t\t\tstop = new String[] { \"a\", \"an\", \"the\" };\r\n\t\t\tscoringmethod = 0;\r\n\t\t\tmindistance = 0.5;\r\n\t\t} finally{\r\n\t\t\tif(scan != null)\r\n\t\t\t\tscan.close();\r\n\t\t}\r\n\t}",
"public Properties() \r\n\t{\r\n\t\tsuper();\r\n\t\tthis.port = 1234;\r\n\t\tthis.ip = \"127.0.0.1\";\r\n\t}",
"public void loadStorageConfiguration() throws IOException {\n String loadedConfigurationFile;\n if (this.configFile != null) {\n loadedConfigurationFile = this.configFile;\n this.configuration = StorageConfiguration.load(new FileInputStream(new File(this.configFile)));\n } else {\n // We load configuration file either from app home folder or from the JAR\n Path path = Paths.get(appHome + \"/conf/storage-configuration.yml\");\n if (appHome != null && Files.exists(path)) {\n loadedConfigurationFile = path.toString();\n this.configuration = StorageConfiguration.load(new FileInputStream(path.toFile()));\n } else {\n loadedConfigurationFile = StorageConfiguration.class.getClassLoader().getResourceAsStream(\"storage-configuration.yml\")\n .toString();\n this.configuration = StorageConfiguration\n .load(StorageConfiguration.class.getClassLoader().getResourceAsStream(\"storage-configuration.yml\"));\n }\n }\n\n // logLevel parameter has preference in CLI over configuration file\n if (this.logLevel == null || this.logLevel.isEmpty()) {\n this.logLevel = \"info\";\n }\n configureDefaultLog(this.logLevel);\n\n // logFile parameter has preference in CLI over configuration file, we first set the logFile passed\n// if (this.logFile != null && !this.logFile.isEmpty()) {\n// this.configuration.setLogFile(logFile);\n// }\n\n // If user has set up a logFile we redirect logs to it\n// if (this.logFile != null && !this.logFile.isEmpty()) {\n// org.apache.log4j.Logger rootLogger = LogManager.getRootLogger();\n//\n// // If a log file is used then console log is removed\n// rootLogger.removeAppender(\"stderr\");\n//\n// // Creating a RollingFileAppender to output the log\n// RollingFileAppender rollingFileAppender = new RollingFileAppender(new PatternLayout(\"%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - \"\n// + \"%m%n\"), this.logFile, true);\n// rollingFileAppender.setThreshold(Level.toLevel(this.logLevel));\n// rootLogger.addAppender(rollingFileAppender);\n// }\n\n logger.debug(\"Loading configuration from '{}'\", loadedConfigurationFile);\n }",
"private void initConfigVar() {\n\t\tConfigUtils configUtils = new ConfigUtils();\n\t\tmenuColor = configUtils.readConfig(\"MENU_COLOR\");\n\t\taboutTitle = configUtils.readConfig(\"ABOUT_TITLE\");\n\t\taboutHeader = configUtils.readConfig(\"ABOUT_HEADER\");\n\t\taboutDetails = configUtils.readConfig(\"ABOUT_DETAILS\");\n\t\tgsTitle = configUtils.readConfig(\"GS_TITLE\");\n\t\tgsHeader = configUtils.readConfig(\"GS_HEADER\");\n\t\tgsDetailsFiles = configUtils.readConfig(\"GS_DETAILS_FILES\");\n\t\tgsDetailsCases = configUtils.readConfig(\"GS_DETAILS_CASES\");\n\t}",
"public IdeCfg(String filename) throws DataNotFoundException {\n super (filename);\n name = IDE_CFG;\n }",
"private void createConfigFile() {\n\t\tFile configFile = new File(projectRoot, SC_CONFIG_FILENAME);\n\t\tif (configFile.exists())\n\t\t\treturn;\n\n\t\tServiceCutterConfig config = createInitialServiceCutterConfig();\n\t\ttry {\n\t\t\tFileWriter writer = new FileWriter(configFile);\n\t\t\twriter.write(new Yaml().dumpAs(config, Tag.MAP, FlowStyle.BLOCK));\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new ContextMapperApplicationException(\"Could not create '.servicecutter.yml' file!\", e);\n\t\t}\n\t}",
"private AceContext()\n {\n //load from file\n File f = new File(ServerSettings.FILE_NAME);\n if (!f.exists())\n {\n ServerSettings.setDefaults();\n }\n\n// setWorkingParent( ServerSettings.getInstance().getProperty(ServerSettings.WORKING_PARENT));\n// setCommonDir( ServerSettings.getInstance().getProperty(ServerSettings.COMMON_DIR));\n// setApplicationPath( ServerSettings.getInstance().getProperty(ServerSettings.APP_EXE));\n }",
"public GenAmazonS3Config() {\n }",
"private void config() {\n\t}",
"public CrawlerConfiguration() {\n\t\tinitConfiguration();\n\t}",
"private static void loadConfig()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal Properties props = ManagerServer.loadProperties(ManagerServer.class, \"/resources/conf.properties\");\n\t\t\tasteriskIP = props.getProperty(\"asteriskIP\");\n\t\t\tloginName = props.getProperty(\"userName\");\n\t\t\tloginPwd = props.getProperty(\"password\");\n\t\t\toutboundproxy = props.getProperty(\"outBoundProxy\");\n\t\t\tasteriskPort = Integer.parseInt(props.getProperty(\"asteriskPort\"));\n\t\t}\n\t\tcatch (IOException ex)\n\t\t{\n\t\t\tLOG.error(\"IO Exception while reading the configuration file.\", ex);\n\t\t}\n\t}",
"public void init() {\n // the config string contains just the asset store directory path\n //set baseDir?\n this.initialized = true;\n }",
"private void setConfiguration() throws IOException{\n\t\tString confPath = \"mapreduce.conf\";\n\t\tFileInputStream fis = new FileInputStream(confPath);\n\t\tthis.load(fis);\n\t\tfis.close();\n\t}"
] | [
"0.74557775",
"0.72474974",
"0.6912873",
"0.68872976",
"0.68823236",
"0.68567526",
"0.6854866",
"0.6819225",
"0.6717421",
"0.67158806",
"0.6704576",
"0.667351",
"0.66554934",
"0.6655351",
"0.65785515",
"0.6517945",
"0.6490288",
"0.6487504",
"0.6380167",
"0.63679755",
"0.63660014",
"0.63639176",
"0.6333811",
"0.6289414",
"0.6283535",
"0.6262199",
"0.6257393",
"0.6246242",
"0.623431",
"0.62244266",
"0.62228054",
"0.6218952",
"0.62035966",
"0.61986417",
"0.6181813",
"0.6150365",
"0.61497",
"0.61358774",
"0.61346906",
"0.61302596",
"0.61211824",
"0.6090904",
"0.6088417",
"0.608616",
"0.6084413",
"0.6080576",
"0.60672885",
"0.60581285",
"0.60564584",
"0.6049945",
"0.6048309",
"0.60406363",
"0.60346276",
"0.6033726",
"0.60331994",
"0.6027524",
"0.60201573",
"0.60157806",
"0.6014245",
"0.6010881",
"0.6000798",
"0.5997274",
"0.59926784",
"0.5987509",
"0.5986543",
"0.59759235",
"0.5974723",
"0.59706086",
"0.596809",
"0.5959601",
"0.59564054",
"0.5955441",
"0.5954245",
"0.5951096",
"0.59500295",
"0.5936116",
"0.59339136",
"0.59319466",
"0.5926805",
"0.5921389",
"0.5919824",
"0.59150755",
"0.59116465",
"0.59115756",
"0.5905575",
"0.5904899",
"0.58980614",
"0.58978057",
"0.5893546",
"0.58917445",
"0.58747864",
"0.587415",
"0.5862604",
"0.58477163",
"0.5844602",
"0.5843583",
"0.58337516",
"0.58294517",
"0.5818105",
"0.5812662",
"0.5811154"
] | 0.0 | -1 |
Player List AFK name color. | protected String playerListColor() {
return cfg.getString("Colors.player").toUpperCase();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String rainbowColoredName(String name) {\n\t\tStringBuilder rainbowName = new StringBuilder();\n\t\tfor (char c: name.toCharArray()) {\n\t\t\trainbowName.append(randomRainbowColor());\n\t\t\trainbowName.append(c);\n\t\t}\n\t\treturn rainbowName.toString();\n\t}",
"KeyColor(String name){\n this.name = name;\n }",
"@Override\n\tpublic String getColorName() {\n\t\treturn colorName;\n\t}",
"@Override\n public String toString() {\n return color.name();\n }",
"public String getColouredName() {\n\t\tConfigManager crates = new ConfigManager(\"crates.yml\");\n\t\tcrates.get().getString(\"crates.\"+name.toLowerCase()+\".colouredName\");\n\t\treturn new String(ChatColor.translateAlternateColorCodes('&', crates.get().getString(\"crates.\"+name+\".colouredName\")));\n\t}",
"public void nameAccepted(String name) {\n\n String c = null;\n for(PlayerInterface p : onlinePlayers){\n if(p.getNickname().equals(name)){\n c = p.getWorkerRef().get(0).getColor();\n break;\n }\n\n }\n notifyPlayerAdded(name, c);\n\n }",
"public void drawPlayerNames(Graphics g) {\n\t}",
"@Override\n\tpublic Color getColor() {\n\t\treturn playerColor;\n\t}",
"public void initializeNames(Map<PlayerColor, String> playerNames) {\n for (PlayerColor color : PlayerColor.values()){\n if (playerNames.keySet().contains(color)){\n switch (color){\n case RED:\n redName.setText(playerNames.get(color));\n break;\n case GREEN:\n greenName.setText(playerNames.get(color));\n break;\n case BLUE:\n blueName.setText(playerNames.get(color));\n break;\n case YELLOW:\n yellowName.setText(playerNames.get(color));\n break;\n }\n }\n else {\n switch (color){\n case RED:\n redName.setText(\"\");\n for(Text text : redPlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n case GREEN:\n greenName.setText(\"\");\n for(Text text : greenPlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n case BLUE:\n blueName.setText(\"\");\n for(Text text : bluePlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n case YELLOW:\n yellowName.setText(\"\");\n for(Text text : yellowPlayerTrack.values()){\n text.setText(\"\");\n }\n break;\n }\n }\n }\n }",
"public String getPlayer1Color() {\r\n return this.player1Color;\r\n }",
"public String toString() {\r\n\t\tString str = color.substring(0,1).toUpperCase()\r\n\t\t\t\t + color.substring(1) + \" \" \r\n\t\t\t\t + name.substring(0,1).toUpperCase()\r\n\t\t\t\t + name.substring(1);\r\n\t\treturn str;\r\n\t}",
"public List<Record> showcolor() {\n\t\treturn recordMapper.showcolor();\r\n\t}",
"public String getPlayername(Player player) {\n System.out.println(\"――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\");\n System.out.println(\"Merci de d'indiquer le nom du joueur \"+player.getColor().toString(false)+\" : \");\n String name = readInput.nextLine();\n return name;\n }",
"public String showPlayListNames(){\n String namePlayList = \"\";\n for(int i = 0; i<MAX_PLAYLIST; i++){\n if(thePlayLists[i] != null){\n namePlayList += \"[\"+(i+1)+\"]\"+thePlayLists[i].getNamePlayList()+\"\\n\";\n }\n }\n return namePlayList;\n }",
"public static void setColor(ArrayList<LaverieButton> L){\n int n = LABEL.size();\n for (int i=0; i<n; i++){\n switch (LABEL.get(i)){\n case \"empty\":\n L.get(i).setBackgroundColor(Color.GREEN);\n break;\n case \"full\":\n L.get(i).setBackgroundColor(Color.RED);\n break;\n case \"reserved\":\n L.get(i).setBackgroundColor(Color.GRAY);\n break;\n }\n }\n }",
"public String getName() {\n Boolean color = this.getColor();\n if (!color) {\n return \"bQ\";\n }\n return \"wQ\";\n }",
"public List<Colour> getPlayerList();",
"public String toString() {\n return \"Flowers [name=\" + name + \", color=\" + color + \"]\";\n }",
"public String getPlayerListName ( ) {\n\t\treturn handleOptional ( ).map ( Player :: getPlayerListName ).orElse ( name );\n\t}",
"private void createYourListsTitle() {\n\t\tjlYourLists = new JLabel(\"PLAYLISTS\");\t\t\n\t\tjlYourLists.setFont(new java.awt.Font(\"Century Gothic\",0, 17));\n\t\tjlYourLists.setForeground(new Color(250,250,250));\n\t}",
"public void changeWildRouteColor() {\n if (mCardsList.get(0))\n mSelectedRoute.setColor(\"red\");\n else if (mCardsList.get(1))\n mSelectedRoute.setColor(\"blue\");\n else if (mCardsList.get(2))\n mSelectedRoute.setColor(\"yellow\");\n else if (mCardsList.get(3))\n mSelectedRoute.setColor(\"green\");\n else if (mCardsList.get(4))\n mSelectedRoute.setColor(\"black\");\n else if (mCardsList.get(5))\n mSelectedRoute.setColor(\"orange\");\n else if (mCardsList.get(6))\n mSelectedRoute.setColor(\"purple\");\n else if (mCardsList.get(7))\n mSelectedRoute.setColor(\"white\");\n }",
"public char getSeekerColor() {\n return getCharProperty(\"RequestedColor\");\n }",
"@ApiModelProperty(value = \"Use one of the common predefined colors, alternatively provide an RGB value in the respective field.\")\n public NameEnum getName() {\n return name;\n }",
"public static List<PlayerColor> getPlayerColors() {\n List<PlayerColor> colorList = new ArrayList<>();\n for (PlayerColor color: PlayerColor.values()) {\n colorList.add(color);\n }\n return colorList;\n }",
"public String showColor(){\r\n\t\tSystem.out.println(\"The color of this fruit is \" + color);\r\n\t\treturn color;}",
"public synchronized List<WebElement> list_ColorSwatchName() throws Exception {\n\n\t\treturn utils.findElementsByLocator(driver, \"PDP_ColorSwatchName\",\n\t\t\t\t\"| PDP: Color swatch Name Not Displayed On PDP\");\n\t}",
"@Override\n public String toString() {\n return \"Player{\" +\n \"id= \" + id +\n \", nickName= '\" + nickName +\n \"', color=\" + color +\n '}';\n }",
"public static Color name2color(String name) {\n Color ans = name2color.get(name);\n if (ans!=null) return ans;\n else if (name.equals(\"magic\")) ans=Color.WHITE;\n else if (name.equals(\"palevioletred\")) ans=new Color(222,113,148);\n else if (name.equals(\"red\")) ans=new Color(255,0,0);\n else if (name.equals(\"salmon\")) ans=new Color(255,130,115);\n else if (name.equals(\"magenta\")) ans=new Color(255,0,255);\n else if (name.equals(\"limegreen\")) ans=new Color(49,207,49);\n else if (name.equals(\"green2\")) ans=new Color(0,239,0);\n else if (name.equals(\"darkolivegreen2\")) ans=new Color(189,239,107);\n else if (name.equals(\"chartreuse2\")) ans=new Color(115,239,0);\n else if (name.equals(\"gold\")) ans=new Color(255,215,0);\n else if (name.equals(\"yellow\")) ans=new Color(255,255,0);\n else if (name.equals(\"lightgoldenrod\")) ans=new Color(239,223,132);\n else if (name.equals(\"cornflowerblue\")) ans=new Color(99,150,239);\n else if (name.equals(\"blue\")) ans=new Color(0,0,255);\n else if (name.equals(\"cadetblue\")) ans=new Color(90,158,165);\n else if (name.equals(\"cyan\")) ans=new Color(0,255,255);\n else if (name.equals(\"lightgray\")) ans=new Color(214,214,214);\n else if (name.equals(\"white\")) ans=Color.WHITE;\n else ans=Color.BLACK;\n name2color.put(name,ans);\n return ans;\n }",
"@Override\n\tpublic String toString(){\n\t\tif(this.getColor()==1){\n\t\t\treturn \"wK\";\n\t\t}else{\n\t\t\treturn \"bK\";\n\t\t}\n\t}",
"private String getPlayersInfo(List<LightPlayer> players, String name){\n StringBuilder stringBuilder = new StringBuilder();\n for (LightPlayer player : players){\n stringBuilder.append(player.getName());\n if (player.getName().equals(name)) {\n stringBuilder.append(\" (you)\");\n }\n\n stringBuilder\n .append(\"\\n\")\n .append(player.getColor().name())\n .append(\" \")\n .append(\"[\")\n .append(player.getColor().name().toCharArray()[0])\n .append(\"]\")\n .append(\"\\n\");\n\n if (player.getCard() != null) {\n stringBuilder.append(player.getCard().getName().name());\n }\n\n stringBuilder.append(\"\\n\\n\\n\");\n }\n\n return stringBuilder.toString();\n }",
"public String toString(){\n\n\t\tString output =\"\";\n\n\t\tfor(int i=0; i<items.size(); i++){\n\t\t\tPeg peg = items.get(i);\n\t\t\toutput+=peg.getColor();\n\t\t}// end for\n\n\t\treturn output;\n\t}",
"@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}",
"String getColor();",
"@Override\r\n\tpublic String getColor() {\n\t\treturn \"white\";\r\n\t}",
"private void initPlayerNames() {\n\t\tlb_player1.setText(playerNames[0]);\n\t\tlb_player2.setText(playerNames[1]);\n\t\tlb_player3.setText(playerNames[2]);\n\t\tlb_player4.setText(playerNames[3]);\n\t}",
"public String getColorString();",
"@Override\n public String getColor() {\n return this.color.name();\n }",
"public String dame_color() {\n\t\treturn color;\n\t}",
"public MultiLineText getGameScreenFullPlayerName() {\n if (this.gameScreenFullPlayerName == null) {\n String[] strTemp = { this.fullPlayerName };\n this.gameScreenFullPlayerName = new MultiLineText(strTemp, 10, 10, Color.black, 15.0f, \"Lucida Blackletter\", ImageLibRef.TEXT_PRIORITY, MultiLineText.LEFT_ALIGNMENT);\n }\n\n return this.gameScreenFullPlayerName;\n }",
"private void addColors() {\n colors.add(Color.GRAY);\n colors.add(Color.BLUE);\n colors.add(Color.DKGRAY);\n colors.add(Color.CYAN);\n colors.add(Color.MAGENTA);\n //Zijn voorlopig maar 5 kleuren, kan altijd makkelijk meer doen, wil ook liever hex-based kleuren gaan gebruiken.\n }",
"public String getColor() { \n return color; \n }",
"private static String determineActiveColor(final Board gameBoard) {\n return gameBoard.getCurrentPlayer().getColor().getAbbr();\n }",
"private Color getPlayerColor(int player){\n\t\tColor pColor;\n\t\tswitch (this.groups[player]){ // adjust color based on what group of balls they're hitting\n\t\t\tcase Ball.TYPE_RED: pColor = new Color(200, 7, 23); break;\n\t\t\tcase Ball.TYPE_BLUE: pColor = new Color(10, 7, 200); break;\n\t\t\tcase 3: pColor = new Color(230, 210, 0); break; // color/type for winner (TODO: enum for player group?)\n\t\t\tdefault: pColor = Color.black; break;\n\t\t}\n\t\t// change color based on if they're allowed to place/hit the ball at the moment\n\t\tpColor = (this.turn==player && !this.table.moving) ? pColor : new Color(pColor.getRed(), pColor.getGreen(), pColor.getBlue(), (int)(0.4*255)); \n\t\treturn pColor;\n\t}",
"public void setPlayerName(String name){\n\t\tplayerName = name;\n\t\trepaint();\n\t}",
"public List<ColorId> getPlayerList() {\n return playerList;\n }",
"@Override\r\n\tpublic String Color() {\n\t\treturn Color;\r\n\t}",
"@Override\n\tpublic String getColor() {\n\t\treturn \"red\";\n\t}",
"private static void printColor() {\n\t\tfor (int i = 0; i < colors.length; i++) {\n\t\t\tSystem.out.print(String.format(\"%d for %s\", i + 1, colors[i]));\n\t\t\tif (i != colors.length - 1) {\n\t\t\t\tSystem.out.print(\", \"); // Separate colors with comma\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\")\"); // Print a new line for the last color option\n\t\t\t}\n\t\t}\n\t}",
"public String getColor() {\n\t\treturn \"Elcolor del vehiculo es: \"+color; \n\t }",
"public PlayerColor playerColor() {\n return color;\n }",
"public ArrayList<String> getColorList()\n {\n \treturn colors;\n }",
"public String getTitleColor() {\n\t\treturn hex == null ? \"<col=C12006>\" : hex;\n\t}",
"private void drawOneNameOnCanvas(NameSurferEntry entry, Color color) {\r\n\t\tdouble width = this.getWidth();\r\n\t\tdouble height = this.getHeight();\r\n\t\t\r\n\t\tString name = entry.getName();\r\n\t\tfor(int i = 0; i< NDECADES-1; i++) {\r\n\t\t\tint leftRank = entry.getRank(i);\r\n\t\t\tdouble[] leftCoordinate = rankToCoordinate(i, leftRank, width, height);\r\n\t\t\t\r\n\t\t\tint rightRank = entry.getRank(i+1);\r\n\t\t\tdouble[] rightCoordinate = rankToCoordinate(i+1, rightRank, width, height);\r\n\t\t\t\r\n\t\t\tdrawNameLabel(leftRank, name, leftCoordinate, color, rightCoordinate);\r\n\t\t\tdrawNameCircle(leftCoordinate, color);\r\n\t\t\tdrawConnectLine(leftCoordinate, rightCoordinate, color);\r\n\t\t}\r\n\t\t\r\n\t\tint lastRank = entry.getRank(NDECADES-1);\r\n\t\tdouble[] lastCoordinate = rankToCoordinate(NDECADES-1, lastRank, width, height);\r\n\t\tdrawNameLabel(lastRank, name, lastCoordinate, color, null);\r\n\t}",
"public String listOfColors() {\r\n\t\t StringBuilder sb = new StringBuilder();\r\n for (Iterator<Color> it = colors.iterator(); it.hasNext();){\r\n\t\t\t Color c = (Color) it.next();\r\n \t sb.append(c.toString() + NL);\r\n }\r\n return sb.toString();\r\n }",
"private void setCustomName(String name) {\n this.name = ChatColorConverter.convert(name);\n this.getLivingEntity().setCustomName(this.name);\n this.hasCustomName = true;\n if (ConfigValues.defaultConfig.getBoolean(DefaultConfig.ALWAYS_SHOW_NAMETAGS))\n eliteMob.setCustomNameVisible(true);\n }",
"public String getColor(){\r\n return color;\r\n }",
"public Paint getColorTitle() {\n return bufColorTitle;\n }",
"public static void addColor(){ \r\n \r\n welcome.add(black);\r\n black.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n black.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\r\n \r\n welcome.add(red);\r\n red.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n red.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); //adding some buttons, formatting them, and aligning them\r\n \r\n welcome.add(yellow);\r\n yellow.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n yellow.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\r\n \r\n welcome.add(green);\r\n green.setAlignmentX(Component.CENTER_ALIGNMENT);\r\n green.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));\r\n }",
"private Color generateColor() {\r\n\t\tint length = nameColor.size();\r\n\t\tif(length == 0) return colorArray[0];\r\n\t\t\r\n\t\tColor lastColor = nameColor.get(length-1);\r\n\t\tint lastColorIndex = 0;\r\n\t\tfor(int i = 0; i<colorArray.length; i++) {\r\n\t\t\tif(lastColor == colorArray[i]) {\r\n\t\t\t\tlastColorIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tColor curColor = colorArray[(lastColorIndex+1)%3];\r\n\t\treturn curColor;\r\n\t}",
"private static String getColorString(int index) {\n switch (index) {\n case 0: return \"None\";\n case 1: case 6: return \"Orange\";\n case 2: case 7: return \"Green\";\n case 3: return \"Blue\";\n case 4: case 14: return \"Yellow\";\n case 8: return \"Black\";\n default: return \"not a color\";\n }\n }",
"@Override\n\t\tpublic Color color() { return color; }",
"public abstract void tellColorList(ArrayList<String> colors);",
"public String keyColor(int i){\r\n if(this.down.contains(this.draw.get(i)))\r\n return \"red\";\r\n return \"black\";\r\n }",
"@Override\r\n public String levelName() {\r\n return \"Green 3\";\r\n }",
"public final String getColorName(final Color c) {\n if (Color.BLUE.equals(c)) {\n return \"Blue\";\n } else if (Color.YELLOW.equals(c)) {\n return \"Jaune\";\n } else if (Color.RED.equals(c)) {\n return \"Red\";\n } else if (Color.PINK.equals(c)) {\n return \"Rose\";\n } else if (Color.GREEN.equals(c)) {\n return \"Vert\";\n }\n return null;\n }",
"public String getName(){\r\n\t\treturn playerName;\r\n\t}",
"public Fruit(String color, String name) {\r\n\t\tthis.color = color;\r\n\t\tthis.name = name;\r\n\t}",
"public void setPlayerName(String name) {\n \tplayername = name;\n }",
"private void displayName(String name) {\n\t\tGLabel profileName = new GLabel(name);\n\t\tprofileName.setFont(PROFILE_NAME_FONT);\n\t\tprofileName.setColor(Color.BLUE);\n\t\tadd(profileName, LEFT_MARGIN, TOP_MARGIN + profileName.getHeight());\n\t\tnameY = profileName.getY();\n\t}",
"void showWaitingPlayerList(List<String> waitingPlayerUsernames);",
"public static void main(String[] args) {\n\t\tList<String> colors=new ArrayList<String>();\r\n\t\tcolors.add(\"Blue\");\r\n\t\tcolors.add(\"Black\");\r\n\t\tcolors.add(\"Red\");\r\n\t\tcolors.add(\"Magenta\");\r\n\t\tcolors.add(\"Yellow\");\r\n\t\tSystem.out.println(colors);\r\n\t\tfor(String x:colors) {\r\n\t\t\tSystem.out.println(x);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic String getName() {\n\t\treturn \"Real Dumb Player by Group 10\";\n\t}",
"public String getPlayerName(int playerColor) {\n if (nrOfPlayers() - 1 >= playerColor) {\n if (players.get(playerColor).getState()) {\n return players.get(playerColor).getName();\n } else {\n return \"Inactive: \" + players.get(playerColor).getName();\n }\n }\n return null;\n }",
"public String displayFamilyMembers() {\n int i = 1;\n StringBuilder ret = new StringBuilder();\n for (FamilyMember fam : this.famMemberList) {\n ret.append(i + \".\" + \" \" + fam.getSkinColour() + \" -> \" + fam.getActionValue());\n ret.append(\" | \");\n i++;\n }\n return ret.toString();\n }",
"String getColour();",
"public String getName(){\n\t\treturn players.get(0).getName();\n\t}",
"public List<String> listPlayerNames() {\n return this.playersNames;\n }",
"public String getPlayer2Color() {\r\n return this.player2Color;\r\n }",
"public void displayName(){\n player1.setText(p1.getName());\n player2.setText(p2.getName());\n }",
"void showFaithCube(FamilyColor familyColor, int cardOrdinal);",
"@Override\n public String getColor() {\n return this.color;\n }",
"public String getColor() {\r\n\t\treturn \"Color = [\"+ ColorUtil.red(color) + \", \"+ ColorUtil.green(color) + \", \"+ ColorUtil.blue(color) + \"]\";\r\n\t}",
"public JMenuItem colorItem(final String theName) {\n \n final JMenuItem color = new JMenuItem(theName);\n color.setMnemonic(KeyEvent.VK_C);\n final ColorIcon icon = new ColorIcon(10);\n color.setIcon(icon);\n color.addActionListener(this);\n return color;\n }",
"public String toString()\n {\n return color.charAt(0) + \"Q\";\n }",
"String getPlayerName();",
"public String getTextColor();",
"public Seagull(String name){\n this.name = name;\n this.color = SWT.COLOR_DARK_BLUE;\n }",
"public String getColor(){\n return this.color;\n }",
"abstract void nameHighlight(Spannable name, String matchStr, int color,\r\n int text_color);",
"public static List<Color> getShuffledPlayerColor(int count) {\n List<Color> validPlayerColors = Config.PLAYER_COLORS;\n\n if (count > validPlayerColors.size()) {\n throw new IllegalStateException(\"Not enough valid Playercolor available\");\n }\n\n List<Color> colorList = new ArrayList<>();\n for (int i = 0; i < count; i++) {\n colorList.add(new Color(validPlayerColors.get(i)));\n }\n\n return colorList;\n }",
"public GamePlayerManager(int players, int ai){\n playerAmount = players;\n aiAmount = ai;\n colorArray[0] = \"RED\";\n colorArray[1] = \"BLUE\";\n colorArray[2] = \"YELLOW\";\n colorArray[3] = \"GREEN\";\n colorArray[4] = \"WHITE\";\n colorArray[5] = \"BLACK\";\n colorArray[6] = \"CYAN\";\n colorArray[7] = \"ORANGE\";\n colorArray[8] = \"MAGENTA\";\n colorArray[9] = \"PINK\";\n }",
"abstract String getColor();",
"@Override\n Color getColor() {\n return new Color(32, 83, 226, 255);\n }",
"public String getColor()\n {\n return color;\n }",
"public String getColor()\n {\n return color;\n }",
"public String getColor(){\n\t\treturn color;\n\t}",
"@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\tString name = d.getName(e.getX(),e.getY());\r\n\t\t\t\tGraphics g = w.getGraphics();\r\n\t\t\t\tg.setColor(Color.RED);\r\n\t\t\t\tg.setFont(new Font(\"Arial\", Font.BOLD, 12));\r\n\t\t\t\tg.drawString(name, e.getX(), e.getY());\r\n\t\t\t}",
"public String getPlayerName() {\n return name; \n }",
"public char getColor();",
"private Colors ingameColor() {\n\t\tList<Colors> colors = new ArrayList<Colors>();\n\t\tIterator<Sphere> it = this.spheres.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tSphere s = it.next();\n\t\t\tif (!colors.contains(s.color())) {\n\t\t\t\tcolors.add(s.color());\n\t\t\t}\n\t\t}\n\t\treturn colors.get(MathUtils.random(colors.size() - 1));\n\t}"
] | [
"0.62586695",
"0.60861564",
"0.6062299",
"0.6055466",
"0.60431844",
"0.6026397",
"0.5928085",
"0.5877103",
"0.5873025",
"0.58040303",
"0.5796045",
"0.5749409",
"0.5747532",
"0.5741694",
"0.57061213",
"0.57012653",
"0.5699879",
"0.56737316",
"0.558401",
"0.5577752",
"0.5522494",
"0.5505572",
"0.55009836",
"0.54992867",
"0.5487975",
"0.5462408",
"0.54567057",
"0.5456125",
"0.54471767",
"0.5444615",
"0.5436158",
"0.5432303",
"0.54317236",
"0.54307294",
"0.5417257",
"0.54143184",
"0.538886",
"0.5358732",
"0.5355965",
"0.534977",
"0.5344193",
"0.5340522",
"0.53129053",
"0.53089577",
"0.5301723",
"0.5296151",
"0.52958244",
"0.5292886",
"0.5281315",
"0.52796817",
"0.527809",
"0.5276734",
"0.5275275",
"0.5274877",
"0.5270666",
"0.5266466",
"0.5243636",
"0.5240212",
"0.52262026",
"0.52061474",
"0.52051675",
"0.5205019",
"0.51905733",
"0.5179945",
"0.5177741",
"0.5167349",
"0.51635396",
"0.5163505",
"0.5163248",
"0.5158793",
"0.51531005",
"0.514873",
"0.51460516",
"0.5138303",
"0.51368415",
"0.512747",
"0.5124846",
"0.5124141",
"0.5119447",
"0.5118779",
"0.51102906",
"0.5103742",
"0.5096245",
"0.50952655",
"0.5095086",
"0.50924313",
"0.50918853",
"0.5086819",
"0.50855327",
"0.50702184",
"0.50628567",
"0.50627536",
"0.5062458",
"0.506096",
"0.506096",
"0.5057479",
"0.5054817",
"0.5053419",
"0.5050506",
"0.5049155"
] | 0.77945787 | 0 |
AFK message. When the Player become AFK. | protected String toAfk() {
return cfg.getString("Messages.+afk");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void handleAFKCommand(Player player, String playerName)\n {\n Server server = this.getServer();\n \n // whatever happens, this was explicit.\n this.afkPlayersAuto.put(playerName, false);\n \n if (!this.afkPlayers.containsKey(playerName) || !this.afkPlayers.get(playerName))\n {\n this.afkPlayers.put(playerName, true);\n \n server.broadcastMessage(ChatColor.YELLOW + playerName + \" is now away.\");\n \n // set the new player name, make sure to truncate it.\n playerName = ChatColor.GRAY + playerName;\n player.setPlayerListName(playerName.substring(0, Math.min(16, playerName.length())));\n }\n else \n {\n this.afkPlayers.put(playerName, false);\n \n // reset the player name, of course.\n player.setPlayerListName(playerName);\n server.broadcastMessage(ChatColor.YELLOW + playerName + \" is no longer away.\");\n }\n }",
"public void updatePlayersAFKState()\n {\n // Iterate through all players\n for (Map.Entry<UUID, PlayerAFKModel> entry : players.entrySet())\n {\n PlayerAFKModel playerAFKModel = entry.getValue();\n\n // Check if player has moved\n if( playerAFKModel.hasMoved() )\n {\n // Moved\n\n // Check if AFK\n if( playerAFKModel.isAFK() )\n {\n // Is AFK. Then player left AFK\n playerAFKModel.markAsNotAFK();\n this.playerLeftAFK(Bukkit.getPlayer(playerAFKModel.getPlayer().getUniqueId()));\n }\n\n // Restart AFK timer\n playerAFKModel.timerStartOrRestart();\n } else {\n // Player hasn't moved\n\n // Check if player is AFK\n if ( !playerAFKModel.isAFK() )\n {\n // Not AFK. Check for how long\n if( playerAFKModel.hasBeenAFKFor(this.timeItTakesToGoAFK) )\n {\n // AFK for too long. Mark them as AFK\n this.playerWentAFK( playerAFKModel.getPlayer() );\n }\n } else {\n // Player is AFK already. Increase timer\n this.updatePlayerAFKTimer( playerAFKModel.getPlayer() );\n }\n }\n }\n }",
"public void playerLeftAFK(Player player)\n {\n updatePlayerAFKTimer(player);\n startOrResetAFKTimerForPlayer(player);\n }",
"@Override\n\t\t\t\t\t public void visit(Player player) {\n\t\t\t\t\t\t\tPacketSendUtility.sendPacket(player, SM_SYSTEM_MESSAGE.STR_MSG_HF_ShugoCaravanAppear);\n\t\t\t\t\t }",
"public void onIdleTimerTick()\n {\n GregorianCalendar now = new GregorianCalendar();\n \n // any player we haven't seen for 3 minutes is now AFK.\n now.add(Calendar.MINUTE, -3);\n \n Server server = this.getServer();\n Player[] players = server.getOnlinePlayers();\n \n for (int i = 0; i < players.length; i++)\n {\n String playerName = players[i].getName();\n \n if (this.afkLastSeen.containsKey(playerName) && this.afkLastSeen.get(playerName).after(now))\n {\n if (this.afkPlayersAuto.containsKey(playerName) && this.afkPlayersAuto.get(playerName))\n {\n // this player is no longer AFK.\n this.afkPlayers.put(playerName, false);\n this.afkPlayersAuto.put(playerName, false);\n \n server.broadcastMessage(ChatColor.YELLOW + playerName + \" is no longer away.\");\n }\n }\n else\n {\n if (!this.afkPlayers.containsKey(playerName) || !this.afkPlayers.get(playerName))\n {\n // mark this player as AFK, broadcast the message.\n this.afkPlayers.put(playerName, true);\n this.afkPlayersAuto.put(playerName, true);\n \n server.broadcastMessage(ChatColor.YELLOW + playerName + \" is now away (idle).\");\n }\n }\n }\n }",
"public void playAI() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"You're going to lose foolish human!\");\r\n }",
"public final void beK() {\n AppMethodBeat.i(88975);\n if (this.kaS.aZV().vTW != null && this.kaS.aZV().vTW.size() > 0) {\n tm tmVar = (tm) this.kaS.aZV().vTW.get(0);\n if (this.iPD != null) {\n this.iPD.setText(tmVar.title);\n }\n if (this.ksp != null) {\n if (TextUtils.isEmpty(tmVar.kbW)) {\n this.ksp.setVisibility(8);\n } else {\n this.ksp.setText(tmVar.kbW);\n }\n }\n if (this.ksq != null) {\n if (TextUtils.isEmpty(tmVar.kbX)) {\n this.ksq.setVisibility(8);\n } else {\n this.ksq.setText(tmVar.kbX);\n AppMethodBeat.o(88975);\n return;\n }\n }\n }\n AppMethodBeat.o(88975);\n }",
"@EventHandler\n public void onPlayerJoin(PlayerJoinEvent e) {\n plugin.getPlayer(e.getPlayer()).forceStopAFK();\n }",
"public String action() { \n return \"Player capped.\";\n }",
"@Override\n\tpublic void action(Player player) {\n\t\tfireMessageEvent(player.getPlayerId());\n\t\tplayer.setPosition(jail);\n\t\tplayer.setInJail(true);\n\t}",
"@Override\n\tpublic void msgAtKitchen() {\n\t\t\n\t}",
"@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"We played Snokker today\");\n\t\t\n\t\t\n\t}",
"@Override\n\tpublic void msgAtFrige() {\n\t\t\n\t}",
"public void playerWon()\r\n {\r\n \r\n }",
"public void mo1607a() {\r\n if (this.f4603a.f4592h != null) {\r\n Message.obtain(this.f4603a.f4598n, 3).sendToTarget();\r\n }\r\n }",
"@Override\n public void run() {\n if (player.canKickBall(fsmAI.ball)) {\n player.stateMachine.changeState(new KickBall(player, fsmAI));\n return;\n }\n \n Player nearestToBall = fsmAI.myTeam.getNearestPlayerToBall();\n if (player != nearestToBall && !(nearestToBall instanceof GoalKeeper)) {\n player.stateMachine.changeState(new MoveToHomeRegion(player, fsmAI));\n MessageDispatcher.getInstance().sendMessage(new PursueBallMessage(), nearestToBall);\n }\n }",
"public boolean isAFK(final Player player) {\n\t\tif (!plugin.getConfigHandler().useAFKIntegration() || !this.getDependency(dependency.STATZ).isAvailable()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.getDependencyHandler(Dependency.ESSENTIALS).isAvailable()) {\n\t\t\tplugin.debugMessage(\"Using Essentials for AFK\");\n\t\t\treturn ((EssentialsHandler) this.getDependencyHandler(Dependency.ESSENTIALS)).isAFK(player);\n\t\t} else if (this.getDependencyHandler(Dependency.ROYAL_COMMANDS).isAvailable()) {\n\t\t\tplugin.debugMessage(\"Using RoyalCommands for AFK\");\n\t\t\treturn ((RoyalCommandsHandler) this.getDependencyHandler(Dependency.ROYAL_COMMANDS)).isAFK(player);\n\t\t} else if (this.getDependencyHandler(Dependency.ULTIMATE_CORE).isAvailable()) {\n\t\t\tplugin.debugMessage(\"Using UltimateCore for AFK\");\n\t\t\treturn ((UltimateCoreHandler) this.getDependencyHandler(Dependency.ULTIMATE_CORE)).isAFK(player);\n\t\t} else if (this.getDependencyHandler(Dependency.AFKTERMINATOR).isAvailable()) {\n\t\t\tplugin.debugMessage(\"Using AfkTerminator for AFK\");\n\t\t\treturn ((AFKTerminatorHandler) this.getDependencyHandler(Dependency.AFKTERMINATOR)).isAFK(player);\n\t\t}\n\n\t\t// No suitable plugin found\n\t\treturn false;\n\t}",
"public void notifyKi(){\n this.kiPlugin.gamerFoundASet();\n }",
"public void printVictoryMessage() { //main playing method\r\n System.out.println(\"Congrats \" + name + \" you won!!!\");\r\n }",
"public abstract void onBakeCommand(Player player);",
"public void enter(FieldPlayer player){\n player.getTeam().setReceiver(player);\n \n //this player is also now the controlling player\n player.getTeam().setControllingPlayer(player);\n\n //there are two types of receive behavior. One uses arrive to direct\n //the receiver to the position sent by the passer in its telegram. The\n //other uses the pursuit behavior to pursue the ball. \n //This statement selects between them dependent on the probability\n //ChanceOfUsingArriveTypeReceiveBehavior, whether or not an opposing\n //player is close to the receiving player, and whether or not the receiving\n //player is in the opponents 'hot region' (the third of the pitch closest\n //to the opponent's goal\n double PassThreatRadius = 70.0;\n\n if (( player.isInHotRegion() ||\n RandFloat() < Params.Instance().ChanceOfUsingArriveTypeReceiveBehavior) &&\n !player.getTeam().isOpponentWithinRadius(player.getPos(), PassThreatRadius)){\n player.getSteering().arriveOn();\n }\n else{\n player.getSteering().pursuitOn();\n }\n \n //FIXME: Change animation\n// player.info.setAnim(\"Run\");\n// player.info.setDebugText(\"ReceiveBall\");\n }",
"@Override\n public void keyPressed(KeyEvent e) {\n player.keyPressed(e); // tell player a key has been pressed\n if (e.getKeyCode() == KeyEvent.VK_X && player.invulnerableTime <= 0 && spellCards > 0){ // player cast spell card\n spellCards --;\n audioloader.play(\"spark\");\n player.invulnerableTime = 5.0 * FPS;\n }\n if (e.getKeyCode() == KeyEvent.VK_C){ // toggle hitbox\n if (player.invulnerableTime <= 0)\n player.invulnerableTime = 10000000;\n else\n player.invulnerableTime = 0;\n }\n if (e.getKeyCode() == KeyEvent.VK_ENTER && entityloader.frame >= levelEnd){ // advance to next level\n gameResult = 1;\n }\n if (e.getKeyCode() == KeyEvent.VK_A){ // add life\n lives++;\n }\n }",
"protected void processPlayerArrived(String name) {\n Player player = tournamentService.findPlayer(name);\n if (player == null) {\n alertManagers(\"Arriving player {0} is on my notify list, but I don''t have him in the tournament roster.\", name);\n return;\n }\n player.setState(PlayerState.WAITING);\n Game game = tournamentService.findPlayerGame(player);\n if (game == null) return;\n if (game.status.isFinished()) return;\n if (loggingIn) {\n \tcommand.sendCommand(\"observe {0}\", name);\n } else {\n tellManagers(\"{0} arrived. Reserving board {1}.\", name, game.boardNumber);\n }\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.whitePlayer);\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.whitePlayer);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.whitePlayer, game.boardNumber);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.blackPlayer, game.boardNumber);\n if (game.status.isAdjourned()) {\n command.sendAdminCommand(\"spoof {0} match {1}\", game.whitePlayer, game.blackPlayer);\n command.sendAdminCommand(\"spoof {0} match {1}\", game.blackPlayer, game.whitePlayer);\n }\n }",
"public void hitBJ() {\n\t\tif (blackjack.isOkBet()) {\n\t\t\tif (blackjack.getCount(1, false, 21)) {\n\t\t\t\t((BlackjackView) manager.getPanel(Constants.BJ_VIEW_NAME)).addCard(blackjack.giveCard(1), 1);\n\t\t\t\tif (blackjack.getCount(1, true, 21)) {\n\t\t\t\t\tblackjack.playerLoses();\n\t\t\t\t\tJOptionPane.showMessageDialog(manager.getPanel(Constants.BJ_VIEW_NAME), \"You lose!\", \"BUSTED\",\n\t\t\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\tresetBJTable();\n\t\t\t\t}\n\t\t\t}\n\t\t} else\n\t\t\tJOptionPane.showMessageDialog(manager.getPanel(Constants.BJ_VIEW_NAME), \"You must bet something\", \"ERROR\",\n\t\t\t\t\tJOptionPane.PLAIN_MESSAGE);\n\t}",
"@EventHandler(priority = EventPriority.HIGHEST) // set to highest because this is most important\n\tpublic void playerBanned(PlayerLoginEvent event){\n\t\tUUID uuid = event.getPlayer().getUniqueId();\n\t\tString reason = bm.isBanned(uuid);\n\t\tif (reason.equals(\"\")) return;\n\t\tPlayer p = event.getPlayer();\n\t\tevent.setKickMessage(reason);\n\t\tevent.setResult(Result.KICK_BANNED);\n\t}",
"public void hitKey() {\n }",
"public void updatePlayerAFKTimer(Player player)\n {\n PlayerAFKModel playerAFKModel = players.get(player.getUniqueId()).updateAFKTimer();\n\n if ( !afkDatabaseApi.updateAFKTimerForPlayer(playerAFKModel) )\n {\n ConsoleUtil.logError(SuitePluginManager.AFK.Name.full,\n \"Unable to update player AFK timer. Report to developer!\");\n }\n }",
"private void pique() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -38;\n\t\tint yInit = 0;\n\t\tEFieldSide side = selfPerception.getSide();\n\t\tVector2D initPos = new Vector2D(xInit * side.value(), yInit * side.value());\n\t\tplayerDeafaultPosition = initPos;\n\t\tVector2D ballPos;\n\t\tdouble ballX = 0, ballY = 0;\n\t\t\n\t\tRectangle area = side == EFieldSide.LEFT ? new Rectangle(-52, -25, 32, 50) : new Rectangle(25, -25, 32, 50);\n\t\t\n\t\twhile (commander.isActive()) {\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tballPos = fieldPerception.getBall().getPosition();\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\t\t\t\t\n\t\t\t\tcommander.doMoveBlocking(-38, 0);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\tballX = fieldPerception.getBall().getPosition().getX();\n\t\t\t\tballY = fieldPerception.getBall().getPosition().getY();\n\t\t\t\tif (arrivedAtBall()) { // chutar\n\t\t\t\t\tcommander.doKickBlocking(100.0d, 0.0d);\n\t\t\t\t} else if (area.contains(ballX, ballY)) { // defender\n\t\t\t\t\tdashBall(ballPos);\n\t\t\t\t} else if (!isCloseTo(initPos)) { // recuar\t\t\t\t\t\n\t\t\t\t\tdash(initPos);\n\t\t\t\t} else { // olhar para a bola\n\t\t\t\t\tturnTo(ballPos);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(-38, 0);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(-38, 0);\n\t\t\t\tbreak;\t\t\t\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Face UP\", Toast.LENGTH_LONG).show();\n\t\t\t\t}",
"@Override\n\t\tpublic void onCompletion(MediaPlayer mp) {\n\t\t\tcekKecepatanBatas(bataskecepatan, cepatkmh);\n\t\t\t\n\t\t}",
"@EventHandler\n public void ballKickEvent(BallKickEvent event) {\n final Game game;\n if ((game = this.controller.getGameFromBall(event.getBall())) != null) {\n game.playBallKickEffects(event.getPlayer());\n }\n }",
"@FXML\n\tpublic void play (ActionEvent e) {\n\t\twriteToAttendant.println(ClientAttendant.PLAY);\n\t\ttry {\n\t\t\tString nickname = readFromAttendant.readLine();\n\t\t\tString dec=readFromAttendant.readLine();\n\t\t\tint portGameHoster=Integer.parseInt(readFromAttendant.readLine());\n\t\t\tif(dec.equals(ClientAttendant.GAMEAVAILABLE)) {\n\t\t\t\topenGamePane();\n\t\t\t\treadFromAttendant.close();\n\t\t\t\twriteToAttendant.close();\n\t\t\t\tsocketToLoginSystem.close();\n\t\t\t\tstartGame(portGameHoster,nickname);\n\t\t\t}else if(dec.equals(ClientAttendant.GAMEFULL)) {\n\t\t\t\tStreamingController sc=new StreamingController();\n\t\t\t\tsc.openObserverPane();\n\t\t\t\treadFromAttendant.close();\n\t\t\t\twriteToAttendant.close();\n\t\t\t\tsocketToLoginSystem.close();\n\t\t\t\tsc.startStreaming(portGameHoster,nickname);\n\t\t\t}\n\t\t} catch (IOException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tAlert al = new Alert(AlertType.ERROR);\n\t\t\tal.setTitle(\"Error en la conexión\");\n\t\t\tal.setHeaderText(\"Problemas con el servidor\");\n\t\t\tal.setContentText(\"No se ha podido establecer conexión con el servidor de logueo.\");\n\t\t\tal.showAndWait();\n\t\t}\n\t\t\n\t}",
"public void OnKickConfCallback(int nReason);",
"@Override\n\tpublic void tellPlayer(String message) {\n\t\tSystem.out.println(message);\n\t}",
"@Override\n\tpublic void msgAtCooking() {\n\t\t\n\t}",
"@Override\n\tpublic void msgAtCook() {\n\t\t\n\t}",
"public void onShake(float force) {\n String keys=\" \";\n String mode=\"k\";\n if (mTcpClient != null && !paused) {\n mTcpClient.sendMessage(mode+keys);\n Log.d(\"myInfo\", \"Send: \"+mode+\":\"+keys );\n }\n\n // Called when Motion Detected\n Toast.makeText(context, \"Motion detected\",\n Toast.LENGTH_SHORT).show();\n\n }",
"@Override\n public void landedOn(Player player) {}",
"@Override\n public Boolean call() throws RemoteException {\n stateGame = applicationServerGameInterface.startMessage(playerId);\n return true;\n }",
"@Override\n public void bounce() {\n System.out.println(name+\" Kangaroo is bouncing\");\n }",
"public void becomeLeader()\r\n\t{\r\n\t\tisleader = true;\r\n\t}",
"public void enlist() {\n\n audio.playSound(LDSound.SMALL_CLICK);\n if (canEnlist()) {\n Logger.info(\"HUD Presenter: enlist\");\n uiStateManager.setState(GameUIState.ENLISTING);\n }\n }",
"@EventHandler\r\n\tpublic void onFish(PlayerFishEvent e) {\n\t\tif(!(e.getCaught() == null)) {\r\n\t\t\tBukkit.broadcastMessage(ChatColor.YELLOW + e.getPlayer().getDisplayName() + \r\n\t\t\t\t\tChatColor.GRAY + \" has caught \" +\r\n\t\t\t\t\tChatColor.YELLOW + e.getCaught().getName());\r\n\t\t}\r\n\t\t \r\n\t\t// Notifies everyone in chat that a player is fishing in water\r\n\t\tif(e.getState() == State.FISHING && e.getState() != State.IN_GROUND) {\r\n\t\t\tBukkit.broadcastMessage(ChatColor.YELLOW + e.getPlayer().getDisplayName() +\r\n\t\t\t\t\t\tChatColor.GRAY + \" immerses themself in the wonders of fishing\");\r\n\t\t\te.getPlayer().updateInventory();\r\n\t\t}\r\n\t}",
"public static void playF() throws InterruptedException\n\t{\n\t\tchannels[channel].noteOn( 65, volume );//E\n\t\tThread.sleep(200);\n\t}",
"@Override\n\tpublic void nowPlaying() {\n\t}",
"@Override\n\tpublic void msgAtBed() {\n\t\t\n\t}",
"@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\tactivarBoton();\r\n\t}",
"private void suarez() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -10;\n\t\tint yInit = 8;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit*selfPerception.getSide().value());\n\t\twhile (commander.isActive()) {\n\t\t\t\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\t//state = State.FOLLOW;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}",
"public void playerLost()\r\n {\r\n \r\n }",
"@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)\n public void onPlayerLogin(PlayerLoginEvent event) {\n String playerName = event.getPlayer().getName();\n \n if(plugin.bannedPlayers.contains(playerName)){\n \t event.setKickMessage(\"You are banned from this server!\");\n \t event.setResult(Result.KICK_BANNED);\n \t \n }\n \n \n }",
"@Override\n\t\t\tpublic void handleMessage(Message msg) {\n\t\t\t\tsuper.handleMessage(msg);\n\t\t\t\tBundle bundle=msg.getData();\n\t\t\t\t\n\t\t\t\tif(bundle.getInt(\"ready\") == 1){\n\t\t\t\t\t//Receive info and assign to player\n\t\t\t\t\tIntent j = new Intent();\n\t\t\t\t\tj.setClassName(\"com.example.client\",\n\t\t\t\t\t\t\t\"com.example.client.GameScreen\");\n\t\t\t\t\tstartActivity(j);\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\t//Time out\n\t\t\t\t\t\talertMessage();\t\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}",
"public void playTopHat() {\n\t\tSystem.out.println(\"ding ding da-ding\");\n\t\t\n\t}",
"private void WaitTalk() {\n // to restart as touched screen.\n if (this.mRestartF) this.RestartTalk();\n }",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Face Down\", Toast.LENGTH_LONG).show();\n\t\t\t\t}",
"@Override\r\n public void fromFearToChase() {\r\n if (afraid()) {\r\n startChase();\r\n }\r\n }",
"public void handleEvent(Message event) {\n\r\n if(m_ensureLock && event.getMessageType() == Message.ARENA_MESSAGE && event.getMessage().equals(\"Arena UNLOCKED\")) {\r\n m_botAction.toggleLocked();\r\n return;\r\n }\r\n\r\n if(event.getMessageType() != Message.PRIVATE_MESSAGE) {\r\n return;\r\n }\r\n\r\n int id = event.getPlayerID();\r\n String name = m_botAction.getPlayerName(id);\r\n String msg = event.getMessage().trim().toLowerCase();\r\n\r\n if(name == null || msg == null || msg.length() == 0) {\r\n return;\r\n }\r\n\r\n String lcname = name.toLowerCase();\r\n\r\n boolean isSmod = m_operatorList.isSmod(lcname);\r\n boolean hasAccess = isSmod || m_access.contains(lcname);\r\n\r\n /* public pm commands */\r\n //!help\r\n if(msg.equals(\"!help\")) {\r\n m_botAction.privateMessageSpam(id, help_player);\r\n\r\n if(hasAccess) {\r\n m_botAction.privateMessageSpam(id, help_staff);\r\n }\r\n\r\n if(isSmod) {\r\n m_botAction.privateMessageSpam(id, help_smod);\r\n m_botAction.sendPrivateMessage(id, \"Database: \" + (m_botAction.SQLisOperational() ? \"online\" : \"offline\"));\r\n }\r\n\r\n //!status\r\n } else if(msg.equals(\"!status\")) {\r\n cmdStatus(id);\r\n\r\n //!spec\r\n } else if(msg.equals(\"!spec\")) {\r\n if(m_state.isStarting() || m_state.isStartingFinal()) {\r\n m_botAction.specWithoutLock(id);\r\n }\r\n\r\n //!about\r\n } else if(msg.equals(\"!about\")) {\r\n m_botAction.sendPrivateMessage(id, \"KimBot! (2007-12-15) by flibb <ER>\", 7);\r\n\r\n //!lagout/!return\r\n } else if(msg.equals(\"!lagout\") || msg.equals(\"!return\")) {\r\n KimPlayer kp = m_allPlayers.get(lcname);\r\n\r\n if(kp == null) {\r\n return;\r\n }\r\n\r\n if(!kp.m_isOut) {\r\n synchronized(m_state) {\r\n if((m_state.isMidGame() || m_state.isMidGameFinal()) && m_lagoutMan.remove(lcname)) {\r\n putPlayerInGame(id, kp, false);\r\n } else if((m_state.isStarting() || m_state.isStartingFinal()) && m_startingLagouts.remove(lcname)) {\r\n m_startingReturns.add(kp);\r\n m_botAction.sendPrivateMessage(id, \"You will be put in at the start of the game.\");\r\n }\r\n }\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"Cannot return to game.\");\r\n }\r\n\r\n //poll vote\r\n } else if(Tools.isAllDigits(msg)) {\r\n if(m_poll != null) {\r\n m_poll.handlePollCount(id, name, msg);\r\n }\r\n\r\n /* staff commands */\r\n } else if(hasAccess) {\r\n //!start\r\n if(msg.equals(\"!start\")) {\r\n m_deathsToSpec = 10;\r\n m_maxTeamSize = 1;\r\n cmdStart(id);\r\n } else if(msg.startsWith(\"!start \")) {\r\n String[] params = msg.substring(7).split(\" \");\r\n m_deathsToSpec = 10;\r\n m_maxTeamSize = 1;\r\n\r\n for(String p : params) {\r\n try {\r\n if(Tools.isAllDigits(p)) {\r\n m_deathsToSpec = Integer.parseInt(p);\r\n } else if(p.startsWith(\"teams=\")) {\r\n m_maxTeamSize = Integer.parseInt(p.substring(6));\r\n }\r\n } catch(NumberFormatException e) {\r\n m_botAction.sendPrivateMessage(id, \"Can't understand: \" + p);\r\n return;\r\n }\r\n }\r\n\r\n m_deathsToSpec = Math.max(1, Math.min(99, m_deathsToSpec));\r\n m_maxTeamSize = Math.max(1, Math.min(99, m_maxTeamSize));\r\n cmdStart(id);\r\n //!stop\r\n } else if(msg.equals(\"!stop\")) {\r\n cmdStop(id);\r\n //!die\r\n } else if(msg.equals(\"!die\")) {\r\n if(m_state.isStopped()) {\r\n m_lvz.clear();\r\n\r\n try {\r\n Thread.sleep(3000);\r\n } catch(InterruptedException e) {}\r\n\r\n m_botAction.die(\"!die by \" + name);\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"A game is in progress. Use !stop first.\");\r\n }\r\n\r\n //!startinfo\r\n } else if(msg.equals(\"!startinfo\")) {\r\n if(m_state.isStopped() || m_startedBy == null) {\r\n m_botAction.sendPrivateMessage(id, \"No one started a game.\");\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"Game started by \" + m_startedBy);\r\n }\r\n\r\n //!reset\r\n } else if(msg.equals(\"!reset\")) {\r\n if(m_state.isStopped()) {\r\n resetArena();\r\n m_botAction.sendPrivateMessage(id, \"Resetted.\");\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"A game is in progress. Use !stop first.\");\r\n }\r\n\r\n //!remove\r\n } else if(msg.startsWith(\"!remove \")) {\r\n synchronized(m_state) {\r\n if(m_state.isStopped()) {\r\n m_botAction.sendPrivateMessage(id, \"The game is not running.\");\r\n } else {\r\n cmdRemove(id, msg.substring(8));\r\n }\r\n }\r\n\r\n //!test\r\n } else if(msg.startsWith(\"!test\")) {\r\n m_botAction.sendArenaMessage(Tools.addSlashes(\"test'test\\\"test\\\\test\"));\r\n\r\n } else if(isSmod) {\r\n //!addstaff\r\n if(msg.startsWith(\"!addstaff \")) {\r\n String addname = msg.substring(10);\r\n\r\n if(addname.length() <= 1 || addname.indexOf(':') >= 0) {\r\n m_botAction.sendPrivateMessage(id, \"Invalid name. Access list not changed.\");\r\n } else if(addname.length() > MAX_NAMELENGTH) {\r\n m_botAction.sendPrivateMessage(id, \"Name too long. Max. 18 characters.\");\r\n } else if(m_access.add(msg.substring(10))) {\r\n updateAccessList(id);\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"That name already has access.\");\r\n }\r\n\r\n //!delstaff\r\n } else if(msg.startsWith(\"!delstaff \")) {\r\n if(m_access.remove(msg.substring(10))) {\r\n updateAccessList(id);\r\n } else {\r\n m_botAction.sendPrivateMessage(id, \"Name not found.\");\r\n }\r\n\r\n //!accesslist\r\n } else if(msg.equals(\"!accesslist\")) {\r\n for(String s : m_access) {\r\n m_botAction.sendPrivateMessage(id, s);\r\n }\r\n\r\n m_botAction.sendPrivateMessage(id, \"End of list.\");\r\n //!purge\r\n } else if(msg.equals(\"!purge\")) {\r\n cmdPurge(id, 90);\r\n } else if(msg.startsWith(\"!purge \")) {\r\n try {\r\n cmdPurge(id, Integer.parseInt(msg.substring(7)));\r\n } catch(NumberFormatException e) {\r\n m_botAction.sendPrivateMessage(id, \"Nothing done. Check your typing.\");\r\n }\r\n }\r\n }\r\n }\r\n }",
"@Override\n\tpublic void msgAtHomePos() {\n\t\t\n\t}",
"public void msgGantryAtFeeder()\n\t{\n\t\tprint(\"Gantry: Gantry at feeder\");\n\t\tgantry_events.add(GantryEvents.GantryAtFeeder);\n\t//\tlog.add(new LoggedEvent(\"msgGantryAtFeeder sent from Server\"));\n\t\tstateChanged();\n\t}",
"public void onMessage(Session session);",
"public void howToPlay() {\r\n // An item has been added to the ticket. Fire an event and let everyone know.\r\n System.out.println(\"Step 1: Have no life. \\nStep 2: Deal cards\\nStep 3: Cry yourself to sleep.\");\r\n }",
"public void act() \n {\n \n checkKey();\n platformAbove();\n \n animationCounter++;\n checkFall();\n }",
"@Override\n\tpublic void OnAttackCommand() {\n\t\tsuper.OnAttackCommand();\n\t\tSoundManage.playSound(atkSound1);\n\t}",
"@Override\n\tpublic void play() {\n\t\tSystem.out.println(\"打击乐器奏乐~~!\");\n\t}",
"protected EventHandler<KeyEvent> playKeyEvent() {\n EventHandler<KeyEvent> keyEventHandler;\n keyEventHandler = new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent keyEvent) {\n // Rotates the boat.\n if (keyEvent.getCode() == KeyCode.R) {\n if(rotationIsValide){\n if(activeBoat!=null){\n drawRotation(activeBoat); \n }\n } \n }\n // Relocates the boat to origin.\n if (keyEvent.getCode() == KeyCode.DELETE) {\n if(activeBoat!=null) {\n reinitBoat(activeBoat);\n // enable validate button if all boats are well placed\n valider.setDisable(!allBoatsArePlaced());\n }\n // enable validate button if all boats are well placed\n valider.setDisable(!allBoatsArePlaced());\n }\n keyEvent.consume();\n }\n };\n return keyEventHandler;\n }",
"void onUserAttentionAvailable() {\n if (!isPlaying()) {\n seekTo(mPauseTime);\n super.start();\n }\n }",
"@Override\n\tpublic void onStandDown(PlatformPlayer player) {\n\t\t\n\t}",
"@Override\n public void update(KlantBedrijf kb) {\n }",
"@Override\n public void onSpeakPaused() throws RemoteException {\n Log.d(TAG, \"onSpeakPaused\");\n }",
"public String callPlayer() {\n\t\treturn \"OVER HERE!!\";\n\t}",
"public void onPlayerLoggedIn() {\n\t\tshowPlayerButtons();\n\t}",
"@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tif (mTakeCallback != null) {\n\t\t\t\tmTakeCallback.takeEnd();\n\t\t\t}\n\t\t\tif (MainActivity.volume == MainActivity.VOLUME_MUTE) {\n\t\t\t\tCamera.Parameters params = mCamera.getParameters();\n\t\t\t\tparams.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);\n\t\t\t\tmCamera.setParameters(params);\n\t\t\t}\n\t\t\t\n\t\t}",
"@Override\n\t\t\tpublic void action() {\n\t\t\t\tMessageTemplate cfpTemplate = MessageTemplate.MatchPerformative(ACLMessage.CFP);\n\t\t\t\tMessageTemplate informTemplate = MessageTemplate.MatchPerformative(ACLMessage.INFORM);\n\t\t\t\tMessageTemplate messageTemplate = MessageTemplate.or(cfpTemplate, informTemplate);\n\t\t\t\tACLMessage receivedMessage = myAgent.receive(messageTemplate);\n\t\t\t\t\n\t\t\t\tif (receivedMessage != null) {\n\t\t\t\t\thasReceivedMessage = true;\n\t\t\t\t\t\n\t\t\t\t\tif (receivedMessage.getPerformative() == ACLMessage.CFP) {\n\t\t\t\t\t\tdouble price = Double.parseDouble(receivedMessage.getContent());\n\t\t\t\t\t\tSystem.out.println(\"Buyer [\" + getAID().getLocalName() + \"] received \"\n\t\t\t\t\t\t\t\t+ \"CFP with price \" + Double.toString(price));\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Value in range; send proposal\n\t\t\t\t\t\tif (price <= priceToBuy) {\n\t\t\t\t\t\t\tACLMessage proposal = new ACLMessage(ACLMessage.PROPOSE);\n\t\t\t\t\t\t\tproposal.addReceiver(receivedMessage.getSender());\n\t\t\t\t\t\t\tproposal.setProtocol(receivedMessage.getProtocol());\n\t\t\t\t\t\t\tmyAgent.send(proposal);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttransitionStatus = sendProposal;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Price too high; refuse and wait for new CFP\n\t\t\t\t\t\t\tACLMessage refusal = new ACLMessage(ACLMessage.REFUSE);\n\t\t\t\t\t\t\trefusal.addReceiver(receivedMessage.getSender());\n\t\t\t\t\t\t\trefusal.setProtocol(receivedMessage.getProtocol());\n\t\t\t\t\t\t\tmyAgent.send(refusal);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttransitionStatus = highPrice;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (receivedMessage.getPerformative() == ACLMessage.INFORM) {\n\t\t\t\t\t\ttransitionStatus = noBuyers;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tblock();\n\t\t\t\t}\n\t\t\t}",
"public void notifyPlayerDefeat(Player p);",
"public void onAction(Player player) {\n }",
"void onStartGameRequested();",
"public void playerListenerFiringCallback(Player player) {\n\t\tif (!m_CSActionStates.containsKey(player) || m_CSActionStates.get(player) == ActionState.NOACTION) {\n\t\t\tm_PlayerListener.stopListeningTo(player);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (m_CSActionStates.get(player) == ActionState.FM_TARGETING) {\n\t\t\tLocation curLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\tm_CSUnconfirmedLocations.put(player, curLoc);\n\t\t\tm_CSActionStates.put(player, ActionState.FM_CONFIRMING);\n\t\t\tOrbitalStrike.sendMessage(player, \"Confirm target (\" + curLoc.getBlockX() + \",\" + curLoc.getBlockZ() + \") for fire mission\");\n\t\t}\n\t\telse if (m_CSActionStates.get(player) == ActionState.FM_CONFIRMING) {\n\t\t\tLocation prevLoc = m_CSUnconfirmedLocations.get(player);\n\t\t\tLocation curLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\tif (prevLoc.equals(curLoc)) {\n\t\t\t\tm_Handler.initiateOrbitalStrike(m_Handler.new BeamLocation(curLoc), m_CSBeamSettings.get(player));\n\t\t\t\tsenderStateCleanup(player);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Fire mission confirmed, firing for effect!\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tm_CSActionStates.put(player, ActionState.FM_TARGETING);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Cannot confirm target location, awaiting new target\");\n\t\t\t}\n\t\t}\n\t\telse if (m_CSActionStates.get(player) == ActionState.FS_TARGETING) {\n\t\t\tif (!m_CSUnconfirmedSwathStartLocations.containsKey(player)) {\t// STEP 1: target start\n\t\t\t\tLocation startLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tm_CSUnconfirmedSwathStartLocations.put(player, startLoc);\n\t\t\t\tm_CSActionStates.put(player, ActionState.FS_CONFIRMING);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Confirm start position (\" + startLoc.getBlockX() + \",\" + startLoc.getBlockZ() + \") for fire sweep\");\n\t\t\t}\n\t\t\telse if (!m_CSUnconfirmedSwathEndLocations.containsKey(player)) {\t// STEP 3: target end\n\t\t\t\tLocation endLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tm_CSUnconfirmedSwathEndLocations.put(player, endLoc);\n\t\t\t\tm_CSActionStates.put(player, ActionState.FS_CONFIRMING);\n\t\t\t\tOrbitalStrike.sendMessage(player, \"Confirm end position (\" + endLoc.getBlockX() + \",\" + endLoc.getBlockZ() + \") for fire sweep\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tOrbitalStrike.logInfo(\"Error: Logic error in swath targetting \" + player, 1);\n\t\t\t\tsenderStateCleanup(player);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\telse if (m_CSActionStates.get(player) == ActionState.FS_CONFIRMING) {\n\t\t\tif (m_CSUnconfirmedSwathStartLocations.containsKey(player) && !m_CSUnconfirmedSwathEndLocations.containsKey(player)) {\t// STEP 2: confirm start\n\t\t\t\tLocation prevLoc = m_CSUnconfirmedSwathStartLocations.get(player);\n\t\t\t\tLocation startLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tif (prevLoc.equals(startLoc)) {\n\t\t\t\t\tm_CSActionStates.put(player, ActionState.FS_TARGETING);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Start position confirmed, designate end position\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tm_CSUnconfirmedSwathStartLocations.remove(player);\n\t\t\t\t\tm_CSActionStates.put(player, ActionState.FS_TARGETING);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Cannot confirm target location, awaiting new start position\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (m_CSUnconfirmedSwathStartLocations.containsKey(player) && m_CSUnconfirmedSwathEndLocations.containsKey(player)) {\t//STEP 4: confirm end\n\t\t\t\tLocation prevLoc = m_CSUnconfirmedSwathEndLocations.get(player);\n\t\t\t\tLocation endLoc = player.getTargetBlock(null, 256).getLocation();\n\t\t\t\tif (prevLoc.equals(endLoc)) {\n\t\t\t\t\tLocation startLoc = m_CSUnconfirmedSwathStartLocations.get(player);\n\t\t\t\t\tm_Handler.initiateOrbitalSwath(m_Handler.new BeamLocation(startLoc), m_Handler.new BeamLocation(endLoc), m_CSBeamSettings.get(player));\n\t\t\t\t\tsenderStateCleanup(player);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Fire sweep confirmed, firing for effect!\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tm_CSUnconfirmedSwathEndLocations.remove(player);\n\t\t\t\t\tm_CSActionStates.put(player, ActionState.FS_TARGETING);\n\t\t\t\t\tOrbitalStrike.sendMessage(player, \"Cannot confirm target location, awaiting new end position\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tOrbitalStrike.logInfo(\"Error: Logic error in swath targetting \" + player, 1);\n\t\t\t\tsenderStateCleanup(player);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"public void msgKitIsGood(AgentKit kit) {\n\t\tfor(MyKit mk: myKits){\n\t\t\tif(mk.kit.equals(kit)){\n\t\t\t\tmk.status = KitStatus.Ready_For_Delivery;\n\t\t\t\tstateChanged();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"public void youWinByAbandonment() {\n try {\n if (getClientInterface() != null)\n getClientInterface().gameEndedByAbandonment(\"YOU WON BECAUSE YOUR OPPONENTS HAVE ABANDONED!!\");\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending ended by abandonment error\");\n }\n }",
"public Boolean receiveKebab() {\r\n\t\t\t// receive msg matching with template\r\n\t\t\tACLMessage response = myAgent.receive(mt);\r\n\t\t\tBoolean result = false;\r\n\t\t\t//System.out.println(\"\\n\\n\\n\" + myAgent.getAID().getName() + \" receiveKebab \" + response + \"\\n\\n\\n\");\r\n\t\t\tif (response != null) {\r\n\t\t\t\tswitch (response.getPerformative()) {\r\n\t\t\t\t// obtained kebab\r\n\t\t\t\tcase ACLMessage.ACCEPT_PROPOSAL:\r\n\t\t\t\t\t// TODO if all will work add unpacking object from content\r\n\t\t\t\t\tSystem.out.println(myAgent.getAID().getName() + \" got kebab.\");\r\n\t\t\t\t\tresult = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t// no kebab available\r\n\t\t\t\tcase ACLMessage.REFUSE:\r\n\t\t\t\t\tresult = false;\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\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tblock();\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t}",
"private final void m703b() {\n int i;\n akc akc = this.f529n;\n akp akp = this.f533r;\n if (akp != akc.f503a || akc.f504b > 0 || akc.f505c) {\n Handler handler = this.f524i;\n int i2 = akc.f504b;\n if (akc.f505c) {\n i = akc.f506d;\n } else {\n i = -1;\n }\n handler.obtainMessage(0, i2, i, akp).sendToTarget();\n akc akc2 = this.f529n;\n akc2.f503a = this.f533r;\n akc2.f504b = 0;\n akc2.f505c = false;\n }\n }",
"private void bluetoothClientProcessing(){\n\n\t\tif( client != null ){\n\t\t\tbyte keyReceive = client.receiveByte() ;\n\n\t\t\tif( keyReceive == DataTransmiting.SOFTKEY_RIGHT ||\n\t\t\t\tkeyReceive == DataTransmiting.KEY_FIRE\t){\n \n\t\t\t\tshouldStop=true;\n\t // midlet.setCurrLevel(currlevel);+\n\t midlet.playGameAgain( currlevel ,isBluetoothMode );\n\n\t\t\t}\n\t\t\telse if( keyReceive == DataTransmiting.MESSAGE_EXIT_GAME ){\n\t\t\t\tmidlet.setAlert(\"The device disconnected\") ;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcurrlevel = keyReceive ;\n\t\t\t}\n\t\t\t\n\n\t\t}\n\t}",
"public void act()\n {\n if (Greenfoot.mouseClicked(this))\n Greenfoot.playSound(\"fanfare.wav\");\n }",
"public void msgReadyForParts()\n\t{\n\t\tprint(\"Gantry: Feeder ready for party\");\n\t\tgantry_events.add(GantryEvents.FeederReadyForBin);\n\t//\tlog.add(new LoggedEvent(\"msgReadyForParts received from Feeder\"));\n\t\tstateChanged();\n\t}",
"public void mo1610b() {\r\n if (this.f4603a.f4592h != null) {\r\n Message.obtain(this.f4603a.f4598n, 4).sendToTarget();\r\n }\r\n }",
"public void announceWinner(){\n gameState = GameState.HASWINNER;\n notifyObservers();\n }",
"public void ack() {\n }",
"public void mo15789a() {\n if (mo15791c()) {\n C1557c.m7458a(f11337e, \"Publishing new messaging session event.\");\n this.f11340c.mo15485a(C4485k.f11123a, C4485k.class);\n this.f11341d = true;\n return;\n }\n C1557c.m7458a(f11337e, \"Messaging session not started.\");\n }",
"@Override\r\n\tpublic void playMonumentCard() {\n\t\t\r\n\t}",
"protected void onHotbarFocused(final Player player) {\n\t}",
"@Override\r\n\tpublic void seeEvent(Player spkr,String s) {\n\t\tplayerMappingService.sendString(this,s);\r\n\t}",
"@Override\r\n\t\t\tpublic void seeEvent(Player p, String s) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void seeEvent(Player p, String s) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void seeEvent(Player p, String s) {\n\t\t\t\t\r\n\t\t\t}",
"@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\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}",
"@Override\n public void keyUp(KeyEvent e){\n super.keyUp(e);\n// if(e.getKeyCode() == KeyEvent.VK_S)\n// spawnControl.spawnNow();\n// if(e.getKeyCode() == KeyEvent.VK_D)\n// player.sleep();\n// if(e.getKeyCode() == KeyEvent.VK_E)\n// player.invincibility();\n// if(e.getKeyCode() == KeyEvent.VK_F)\n// player.fast();\n }",
"void receivePausedGameMessage(String fromPlayer, String msg) throws RpcException;",
"void bake() {\n\t\tSystem.out.println(\"Bake for 25 mins at 350\\u00b0\");\n\t}",
"@Override\n\tpublic void onMessagePlayCompleted() {\n\t\tbtnSend.setEnabled(true);\n\t}",
"public void act() \n {\n if (Greenfoot.mouseClicked(this))\n {\n Peter.lb=2; \n Greenfoot.playSound(\"click.mp3\");\n Greenfoot.setWorld(new StartEngleza());\n };\n }",
"@Override\n public void playFootball() {\n System.out.println(this.name+ \" is \"+this.age+ \" years old and plays as Midfielder.\");\n System.out.println(\"The Midfielder controls the game by passing the ball to the forward players to score!\");\n }"
] | [
"0.6892479",
"0.6721727",
"0.67211336",
"0.65335345",
"0.6102014",
"0.585273",
"0.5832691",
"0.57478356",
"0.5692802",
"0.56715643",
"0.5651836",
"0.5642919",
"0.56030285",
"0.5588584",
"0.5563098",
"0.5562136",
"0.5557374",
"0.5551004",
"0.551371",
"0.55037445",
"0.5501082",
"0.5490966",
"0.54882157",
"0.54627883",
"0.5446681",
"0.54428595",
"0.5439872",
"0.5437096",
"0.54303104",
"0.5429304",
"0.542922",
"0.5424967",
"0.5410803",
"0.540584",
"0.54055303",
"0.53982514",
"0.5396881",
"0.53853405",
"0.5384906",
"0.5384304",
"0.5383573",
"0.5380382",
"0.53769565",
"0.5364477",
"0.5352082",
"0.53427434",
"0.53224164",
"0.5315029",
"0.5314416",
"0.53020597",
"0.5297922",
"0.5297347",
"0.5296565",
"0.5291164",
"0.52841866",
"0.5282649",
"0.52806985",
"0.52767384",
"0.527317",
"0.5271088",
"0.5265075",
"0.52642995",
"0.52597505",
"0.52589804",
"0.52531415",
"0.52414787",
"0.52411336",
"0.5229931",
"0.52283764",
"0.5223711",
"0.5220844",
"0.52107817",
"0.52084315",
"0.5205736",
"0.52017677",
"0.5195342",
"0.5192919",
"0.51908135",
"0.5190327",
"0.5189546",
"0.518727",
"0.5184324",
"0.51693004",
"0.51678973",
"0.51565725",
"0.5152951",
"0.5145032",
"0.5142147",
"0.5141731",
"0.51355493",
"0.5134348",
"0.5134348",
"0.5134348",
"0.51307833",
"0.51268405",
"0.5125698",
"0.51193136",
"0.51189786",
"0.51086164",
"0.51085746",
"0.5107611"
] | 0.0 | -1 |
AFK message. When the Player cancel AFK. | protected String noAfk() {
return cfg.getString("Messages.-afk");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void sendCancelMessage();",
"void onCancel(int key);",
"protected abstract void onCancel();",
"public void onCancel();",
"@Override\r\n public void cancelMsg() {\n System.out.println(\"Transaction has been cancelled for gas pump #1..\");\r\n }",
"public void cancel( String reason );",
"public void onCancel() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}",
"void onCancel();",
"public void onCancel() {\n\t\t\t\t\t}",
"public void cancel() {\n writeData(ESC.CMD_CANCEL);\n }",
"@Override\n\t\t\t\t\t\t\t\t\tpublic void cancel() {\n\t\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 public void onCancel() {\n\t\t\t\t\t errorMessage = \"You cancelled Operation\";\n\t\t\t\t\t getResponse();\n\t\t\t\t }",
"public void notifyCancel() {\n Player senderPlayer = this.getToTeleport().getPlayerReference(Player.class),\n targetPlayer = this.getTarget().getPlayerReference(Player.class);\n\n if (senderPlayer == null || targetPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_CANCELLED\").sendTo(senderPlayer);\n MainData.getIns().getMessageManager().getMessage(\"TPA_SELF_CANCELLED\").sendTo(targetPlayer);\n\n }",
"protected abstract void sendCancel(Status reason);",
"@Override\r\n\t\tpublic void onCancel() {\n\t\t}",
"public void onCancel() {\n }",
"@Action\n public void acCancel() {\n setChangeObj(false);\n }",
"@Action\n public void acCancel() {\n setChangeObj(false);\n }",
"public void cancel() {\n btCancel().push();\n }",
"public void cancelCard() {}",
"@Override\n\t\tpublic void onCancel() {\n \n \t}",
"public void cancel()\n\t{\n\t}",
"@Override\n public void onCancel() {\n }",
"@Override\n\t\t\t\t\t\tpublic void cancel() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}",
"@Override\r\n\tpublic void cancel() {\n\t\t\r\n\t}",
"@Override\n public void cancel() {\n\n }",
"@Override\n public void cancel() {\n\n }",
"@Override\n public void cancel() {\n\n }",
"@Override\n\t\t\tpublic void onCancel() {\n\t\t\t\t\n\t\t\t}",
"public String cancel() {\n endConversation();\n return CANCEL_OUTCOME_ID;\n }",
"@Override\n\t\tpublic void cancel() {\n\t\t\t\n\t\t}",
"@Override\n\tpublic void cancel() {\n\t\t\n\t}",
"@Override\r\n\t\t\t\t\tpublic void onCancel() {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\n public void cancel() {\n }",
"@Override\n\tpublic void cancel() {\n\n\t}",
"@Override\n\tpublic void cancel() {\n\n\t}",
"@Override\n\tpublic void cancel() {\n\n\t}",
"public void cancel() {\n\t}",
"private CancelMessage() {\n initFields();\n }",
"@Override\n public void cancel() {\n\n }",
"@objid (\"26d79ec6-186f-11e2-bc4e-002564c97630\")\n @Override\n public void performCancel() {\n }",
"@Override\n public void cancel() {\n\n }",
"public void cancel();",
"public void cancel();",
"public void cancel();",
"public void cancel();",
"public void cancel();",
"public void cancel();",
"public void cancel();",
"public void onCancel() {\n\n }",
"@Override\n public void onCancel() {\n }",
"public final void cancel() {\n mHandler.removeMessages(MSG);\n mCancelled = true;\n }",
"@Override\n public void cancel() {\n }",
"public synchronized void cancel() {\n }",
"protected abstract void handleCancel();",
"@Override\n protected void onCancel() {\n }",
"@Override\n public void onCancel() {\n\n }",
"@Override\n public void onCancel() {\n\n }",
"@Override\r\n public void onCancel(String callerTag) {\n }",
"@Override\r\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\ttalkDialog.cancel();\r\n\t\t\t\t}",
"public void cancel() {\r\n\t\tthis.cancel = true;\r\n\t}",
"public abstract boolean cancel();",
"@Override\n public void onCancel() {\n\n }",
"@Override\n public void onCancel() {\n\n }",
"private void onCancel() {\n data.put(\"cerrado\",true);\n dispose();\n }",
"@Override\n\t\t\t\t\tpublic void onCancel(Platform arg0, int arg1) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public boolean cancel();",
"@Override\n\t\t\t\tpublic boolean onCancel() {\n\t\t\t\t\treturn false;\n\t\t\t\t}",
"@Override\n public void onCancel() {\n\n }",
"public void requestcanceled() {\n\n requestcancelcheck = true;\n\n String diatitle = \"Request cancelled.\";\n String msg = \"Request cancelled by Rider.\";\n\n marker.setEnabled(false);\n // mGoogleMap.clear();\n fullbutton.setVisibility(View.GONE);\n usercheck = false;\n touch.setVisibility(View.GONE);\n marker.setVisibility(View.INVISIBLE);\n checkonclick = false;\n timercheck = true;\n whilecheck = true;\n accheck = true;\n receivecheck = true;\n\n acc1 = acc;\n\n registerReceiver(mHandleMessageReceiver, new IntentFilter(Config.DISPLAY_MESSAGE_ACTION));\n dialogshow(diatitle, msg);\n\n }",
"public void cancel(){\n cancelled = true;\n }",
"void cancel();",
"void cancel();",
"void cancel();",
"void cancel();",
"void cancel();",
"@Override\n public void onCancel(Platform arg0, int arg1) {\n }",
"@Override\n public void onCancel(Platform arg0, int arg1) {\n }",
"@Override\n public void onCancel(Platform arg0, int arg1) {\n\n }",
"public void cancel() {\n\t\tcancelled = true;\n\t}",
"@Override\n public void onCancel(Platform arg0, int arg1)\n {\n }",
"public void cancelInvitionUser() {\n\n }",
"@SubscribeEvent\n\tpublic void abilityAborted(AbilityEvent.AbortControl event) {\n\t\tClientUtils.playSound(abortSound, 1.0f);\n\t}",
"@Override\n public void onCancel(Platform arg0, int arg1)\n {\n\n }",
"private void onCancel()\n\t{\n\t\tdispose();\n\t}",
"private void cancelPressed() {\n\t\tVideoPlayer.mediaPlayer.stop();\n\t\tl.clear();\n\t\tpaths.clear();\n\t\tsizes.clear();\n\t\tcancelPlayingList.setEnabled(false);\n\t\tplayTheList.setEnabled(true);\n\t}",
"private void cancel(ActionEvent e){\r\n // Clear textfields\r\n clearFields();\r\n // If coming from appt management screen, go back there\r\n if (fromAppt){\r\n goToManageApptScreen();\r\n }\r\n // Otherwise, set the current client to null and go to the landing page \r\n else {\r\n currClient = null;\r\n LandingPage.returnToLandingPage();\r\n }\r\n }",
"protected MessageBody cancel() {\n\t\tPlatformMessage msg = cancelRequest(incidentAddress).getMessage();\n\t\talarm.cancel(context, msg);\n\t\treturn msg.getValue();\n\t}",
"@Override\r\n\t\tpublic void onCancel(Platform arg0, int arg1) {\n\r\n\t\t}",
"@Override\n public void onCancel(AmbilWarnaDialog dialog) {\n }",
"@Override\n public void onCancel(AmbilWarnaDialog dialog) {\n }",
"@Override\n public void onClick(View v) {\n aManager.cancel(pIntent);\n Toast.makeText(getApplicationContext(), \"Cancel\", Toast.LENGTH_SHORT).show();\n }",
"public void youWinByAbandonment() {\n try {\n if (getClientInterface() != null)\n getClientInterface().gameEndedByAbandonment(\"YOU WON BECAUSE YOUR OPPONENTS HAVE ABANDONED!!\");\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending ended by abandonment error\");\n }\n }",
"@Override\n public void onCancel(AmbilWarnaDialog dialog){\n }",
"@Override\n\t\t\t\t\t\tpublic void onCancel() {\n\t\t\t\t\t\t\tToast.makeText(FBactivity.this, \"onCancel\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\t}",
"public void cancel() {\r\n\t\tbStop = true;\r\n\t}",
"private void onCancel() {\n\t\tdispose();\n\t}",
"@Override\n\t\t\t\t\tpublic void onCancel(Platform arg0, int arg1) {\n\t\t\t\t\t\tLog.i(\"tag\", \"onCancel\");\t\t\t\t\t\n\t\t\t\t\t}",
"public void cancel() {\n ei();\n this.fd.eT();\n this.oJ.b(this);\n this.oM = Status.CANCELLED;\n if (this.oL != null) {\n this.oL.cancel();\n this.oL = null;\n }\n }",
"@Override\n\tpublic void canceled() {\n\t\t\n\t}",
"@Override\n\tpublic void canceled() {\n\t\t\n\t}"
] | [
"0.689635",
"0.6802078",
"0.6684263",
"0.6682015",
"0.66568977",
"0.65742046",
"0.6536082",
"0.6528754",
"0.6518133",
"0.6513862",
"0.6507174",
"0.65000904",
"0.6473682",
"0.64443076",
"0.64190054",
"0.64056563",
"0.64049965",
"0.64049965",
"0.63955176",
"0.6394055",
"0.6390576",
"0.63841915",
"0.6381755",
"0.6375357",
"0.6370763",
"0.63695985",
"0.63695985",
"0.63695985",
"0.63649106",
"0.63640684",
"0.6362761",
"0.6352066",
"0.63433534",
"0.6343343",
"0.6323322",
"0.6323322",
"0.6323322",
"0.6313108",
"0.6309841",
"0.6307073",
"0.62935174",
"0.6290332",
"0.62808883",
"0.62808883",
"0.62808883",
"0.62808883",
"0.62808883",
"0.62808883",
"0.6280229",
"0.62744766",
"0.6267505",
"0.6261766",
"0.6258485",
"0.623615",
"0.62311035",
"0.62301874",
"0.6216454",
"0.6216454",
"0.6206162",
"0.61814845",
"0.61638016",
"0.61572003",
"0.6143509",
"0.614154",
"0.6103635",
"0.6088169",
"0.60717714",
"0.60621065",
"0.6056957",
"0.60557413",
"0.60544425",
"0.60498846",
"0.60498846",
"0.60498846",
"0.60498846",
"0.60498846",
"0.6048308",
"0.6048308",
"0.6042337",
"0.60402596",
"0.6032526",
"0.6030898",
"0.60177666",
"0.6014037",
"0.6010835",
"0.60028166",
"0.59969616",
"0.5980979",
"0.5976193",
"0.59744775",
"0.59744775",
"0.5973889",
"0.5973633",
"0.59536535",
"0.5942419",
"0.59390074",
"0.5937422",
"0.59350264",
"0.59125394",
"0.59100825",
"0.59100825"
] | 0.0 | -1 |
A seekable output stream interface for use by ImageWriters. Various output destinations, such as OutputStreams and Files, as well as future fast I/O destinations may be "wrapped" by a suitable implementation of this interface for use by the Image I/O API. Unlike a standard OutputStream, ImageOutputStream extends its counterpart, ImageInputStream. Thus it is possible to read from the stream as it is being written. The same seek and flush positions apply to both reading and writing, although the semantics for dealing with a nonzero bit offset before a bytealigned write are necessarily different from the semantics for dealing with a nonzero bit offset before a bytealigned read. When reading bytes, any bit offset is set to 0 before the read; when writing bytes, a nonzero bit offset causes the remaining bits in the byte to be written as 0s. The bytealigned write then starts at the next byte position. | public interface ImageOutputStream extends ImageInputStream, DataOutput {
/**
* Writes a single byte to the stream at the current position.
* The 24 high-order bits of <code>b</code> are ignored.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write. Implementers can use the
* {@link ImageOutputStreamImpl#flushBits flushBits}
* method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
* to guarantee this.
*
* @param b an <code>int</code> whose lower 8 bits are to be
* written.
*
* @exception IOException if an I/O error occurs.
*/
void write(int b) throws IOException;
/**
* Writes a sequence of bytes to the stream at the current
* position. If <code>b.length</code> is 0, nothing is written.
* The byte <code>b[0]</code> is written first, then the byte
* <code>b[1]</code>, and so on.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param b an array of <code>byte</code>s to be written.
*
* @exception NullPointerException if <code>b</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void write(byte b[]) throws IOException;
/**
* Writes a sequence of bytes to the stream at the current
* position. If <code>len</code> is 0, nothing is written.
* The byte <code>b[off]</code> is written first, then the byte
* <code>b[off + 1]</code>, and so on.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write. Implementers can use the
* {@link ImageOutputStreamImpl#flushBits flushBits}
* method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}
* to guarantee this.
*
* @param b an array of <code>byte</code>s to be written.
* @param off the start offset in the data.
* @param len the number of <code>byte</code>s to write.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
* negative, <code>len</code> is negative, or <code>off +
* len</code> is greater than <code>b.length</code>.
* @exception NullPointerException if <code>b</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void write(byte b[], int off, int len) throws IOException;
/**
* Writes a <code>boolean</code> value to the stream. If
* <code>v</code> is true, the value <code>(byte)1</code> is
* written; if <code>v</code> is false, the value
* <code>(byte)0</code> is written.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param v the <code>boolean</code> to be written.
*
* @exception IOException if an I/O error occurs.
*/
void writeBoolean(boolean v) throws IOException;
/**
* Writes the 8 low-order bits of <code>v</code> to the
* stream. The 24 high-order bits of <code>v</code> are ignored.
* (This means that <code>writeByte</code> does exactly the same
* thing as <code>write</code> for an integer argument.)
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param v an <code>int</code> containing the byte value to be
* written.
*
* @exception IOException if an I/O error occurs.
*/
void writeByte(int v) throws IOException;
/**
* Writes the 16 low-order bits of <code>v</code> to the
* stream. The 16 high-order bits of <code>v</code> are ignored.
* If the stream uses network byte order, the bytes written, in
* order, will be:
*
* <pre>
* (byte)((v >> 8) & 0xff)
* (byte)(v & 0xff)
* </pre>
*
* Otherwise, the bytes written will be:
*
* <pre>
* (byte)(v & 0xff)
* (byte)((v >> 8) & 0xff)
* </pre>
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param v an <code>int</code> containing the short value to be
* written.
*
* @exception IOException if an I/O error occurs.
*/
void writeShort(int v) throws IOException;
/**
* This method is a synonym for {@link #writeShort writeShort}.
*
* @param v an <code>int</code> containing the char (unsigned
* short) value to be written.
*
* @exception IOException if an I/O error occurs.
*
* @see #writeShort(int)
*/
void writeChar(int v) throws IOException;
/**
* Writes the 32 bits of <code>v</code> to the stream. If the
* stream uses network byte order, the bytes written, in order,
* will be:
*
* <pre>
* (byte)((v >> 24) & 0xff)
* (byte)((v >> 16) & 0xff)
* (byte)((v >> 8) & 0xff)
* (byte)(v & 0xff)
* </pre>
*
* Otheriwse, the bytes written will be:
*
* <pre>
* (byte)(v & 0xff)
* (byte)((v >> 8) & 0xff)
* (byte)((v >> 16) & 0xff)
* (byte)((v >> 24) & 0xff)
* </pre>
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param v an <code>int</code> containing the value to be
* written.
*
* @exception IOException if an I/O error occurs.
*/
void writeInt(int v) throws IOException;
/**
* Writes the 64 bits of <code>v</code> to the stream. If the
* stream uses network byte order, the bytes written, in order,
* will be:
*
* <pre>
* (byte)((v >> 56) & 0xff)
* (byte)((v >> 48) & 0xff)
* (byte)((v >> 40) & 0xff)
* (byte)((v >> 32) & 0xff)
* (byte)((v >> 24) & 0xff)
* (byte)((v >> 16) & 0xff)
* (byte)((v >> 8) & 0xff)
* (byte)(v & 0xff)
* </pre>
*
* Otherwise, the bytes written will be:
*
* <pre>
* (byte)(v & 0xff)
* (byte)((v >> 8) & 0xff)
* (byte)((v >> 16) & 0xff)
* (byte)((v >> 24) & 0xff)
* (byte)((v >> 32) & 0xff)
* (byte)((v >> 40) & 0xff)
* (byte)((v >> 48) & 0xff)
* (byte)((v >> 56) & 0xff)
* </pre>
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param v a <code>long</code> containing the value to be
* written.
*
* @exception IOException if an I/O error occurs.
*/
void writeLong(long v) throws IOException;
/**
* Writes a <code>float</code> value, which is comprised of four
* bytes, to the output stream. It does this as if it first
* converts this <code>float</code> value to an <code>int</code>
* in exactly the manner of the <code>Float.floatToIntBits</code>
* method and then writes the int value in exactly the manner of
* the <code>writeInt</code> method.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param v a <code>float</code> containing the value to be
* written.
*
* @exception IOException if an I/O error occurs.
*/
void writeFloat(float v) throws IOException;
/**
* Writes a <code>double</code> value, which is comprised of four
* bytes, to the output stream. It does this as if it first
* converts this <code>double</code> value to an <code>long</code>
* in exactly the manner of the
* <code>Double.doubleToLongBits</code> method and then writes the
* long value in exactly the manner of the <code>writeLong</code>
* method.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param v a <code>double</code> containing the value to be
* written.
*
* @exception IOException if an I/O error occurs.
*/
void writeDouble(double v) throws IOException;
/**
* Writes a string to the output stream. For every character in
* the string <code>s</code>, taken in order, one byte is written
* to the output stream. If <code>s</code> is <code>null</code>, a
* <code>NullPointerException</code> is thrown.
*
* <p> If <code>s.length</code> is zero, then no bytes are
* written. Otherwise, the character <code>s[0]</code> is written
* first, then <code>s[1]</code>, and so on; the last character
* written is <code>s[s.length-1]</code>. For each character, one
* byte is written, the low-order byte, in exactly the manner of
* the <code>writeByte</code> method. The high-order eight bits of
* each character in the string are ignored.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param s a <code>String</code> containing the value to be
* written.
*
* @exception NullPointerException if <code>s</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeBytes(String s) throws IOException;
/**
* Writes a string to the output stream. For every character in
* the string <code>s</code>, taken in order, two bytes are
* written to the output stream, ordered according to the current
* byte order setting. If network byte order is being used, the
* high-order byte is written first; the order is reversed
* otherwise. If <code>s</code> is <code>null</code>, a
* <code>NullPointerException</code> is thrown.
*
* <p> If <code>s.length</code> is zero, then no bytes are
* written. Otherwise, the character <code>s[0]</code> is written
* first, then <code>s[1]</code>, and so on; the last character
* written is <code>s[s.length-1]</code>.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param s a <code>String</code> containing the value to be
* written.
*
* @exception NullPointerException if <code>s</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeChars(String s) throws IOException;
/**
* Writes two bytes of length information to the output stream in
* network byte order, followed by the
* <a href="../../../java/io/DataInput.html#modified-utf-8">modified
* UTF-8</a>
* representation of every character in the string <code>s</code>.
* If <code>s</code> is <code>null</code>, a
* <code>NullPointerException</code> is thrown. Each character in
* the string <code>s</code> is converted to a group of one, two,
* or three bytes, depending on the value of the character.
*
* <p> If a character <code>c</code> is in the range
* <code>\u0001</code> through <code>\u007f</code>, it is
* represented by one byte:
*
* <p><pre>
* (byte)c
* </pre>
*
* <p> If a character <code>c</code> is <code>\u0000</code> or
* is in the range <code>\u0080</code> through
* <code>\u07ff</code>, then it is represented by two bytes,
* to be written in the order shown:
*
* <p> <pre><code>
* (byte)(0xc0 | (0x1f & (c >> 6)))
* (byte)(0x80 | (0x3f & c))
* </code></pre>
*
* <p> If a character <code>c</code> is in the range
* <code>\u0800</code> through <code>uffff</code>, then it is
* represented by three bytes, to be written in the order shown:
*
* <p> <pre><code>
* (byte)(0xe0 | (0x0f & (c >> 12)))
* (byte)(0x80 | (0x3f & (c >> 6)))
* (byte)(0x80 | (0x3f & c))
* </code></pre>
*
* <p> First, the total number of bytes needed to represent all
* the characters of <code>s</code> is calculated. If this number
* is larger than <code>65535</code>, then a
* <code>UTFDataFormatException</code> is thrown. Otherwise, this
* length is written to the output stream in exactly the manner of
* the <code>writeShort</code> method; after this, the one-, two-,
* or three-byte representation of each character in the string
* <code>s</code> is written.
*
* <p> The current byte order setting is ignored.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* <p><strong>Note:</strong> This method should not be used in
* the implementation of image formats that use standard UTF-8,
* because the modified UTF-8 used here is incompatible with
* standard UTF-8.
*
* @param s a <code>String</code> containing the value to be
* written.
*
* @exception NullPointerException if <code>s</code> is
* <code>null</code>.
* @exception java.io.UTFDataFormatException if the modified UTF-8
* representation of <code>s</code> requires more than 65536 bytes.
* @exception IOException if an I/O error occurs.
*/
void writeUTF(String s) throws IOException;
/**
* Writes a sequence of shorts to the stream at the current
* position. If <code>len</code> is 0, nothing is written.
* The short <code>s[off]</code> is written first, then the short
* <code>s[off + 1]</code>, and so on. The byte order of the
* stream is used to determine the order in which the individual
* bytes are written.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param s an array of <code>short</code>s to be written.
* @param off the start offset in the data.
* @param len the number of <code>short</code>s to write.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
* negative, <code>len</code> is negative, or <code>off +
* len</code> is greater than <code>s.length</code>.
* @exception NullPointerException if <code>s</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeShorts(short[] s, int off, int len) throws IOException;
/**
* Writes a sequence of chars to the stream at the current
* position. If <code>len</code> is 0, nothing is written.
* The char <code>c[off]</code> is written first, then the char
* <code>c[off + 1]</code>, and so on. The byte order of the
* stream is used to determine the order in which the individual
* bytes are written.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param c an array of <code>char</code>s to be written.
* @param off the start offset in the data.
* @param len the number of <code>char</code>s to write.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
* negative, <code>len</code> is negative, or <code>off +
* len</code> is greater than <code>c.length</code>.
* @exception NullPointerException if <code>c</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeChars(char[] c, int off, int len) throws IOException;
/**
* Writes a sequence of ints to the stream at the current
* position. If <code>len</code> is 0, nothing is written.
* The int <code>i[off]</code> is written first, then the int
* <code>i[off + 1]</code>, and so on. The byte order of the
* stream is used to determine the order in which the individual
* bytes are written.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param i an array of <code>int</code>s to be written.
* @param off the start offset in the data.
* @param len the number of <code>int</code>s to write.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
* negative, <code>len</code> is negative, or <code>off +
* len</code> is greater than <code>i.length</code>.
* @exception NullPointerException if <code>i</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeInts(int[] i, int off, int len) throws IOException;
/**
* Writes a sequence of longs to the stream at the current
* position. If <code>len</code> is 0, nothing is written.
* The long <code>l[off]</code> is written first, then the long
* <code>l[off + 1]</code>, and so on. The byte order of the
* stream is used to determine the order in which the individual
* bytes are written.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param l an array of <code>long</code>s to be written.
* @param off the start offset in the data.
* @param len the number of <code>long</code>s to write.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
* negative, <code>len</code> is negative, or <code>off +
* len</code> is greater than <code>l.length</code>.
* @exception NullPointerException if <code>l</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeLongs(long[] l, int off, int len) throws IOException;
/**
* Writes a sequence of floats to the stream at the current
* position. If <code>len</code> is 0, nothing is written.
* The float <code>f[off]</code> is written first, then the float
* <code>f[off + 1]</code>, and so on. The byte order of the
* stream is used to determine the order in which the individual
* bytes are written.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param f an array of <code>float</code>s to be written.
* @param off the start offset in the data.
* @param len the number of <code>float</code>s to write.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
* negative, <code>len</code> is negative, or <code>off +
* len</code> is greater than <code>f.length</code>.
* @exception NullPointerException if <code>f</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeFloats(float[] f, int off, int len) throws IOException;
/**
* Writes a sequence of doubles to the stream at the current
* position. If <code>len</code> is 0, nothing is written.
* The double <code>d[off]</code> is written first, then the double
* <code>d[off + 1]</code>, and so on. The byte order of the
* stream is used to determine the order in which the individual
* bytes are written.
*
* <p> If the bit offset within the stream is non-zero, the
* remainder of the current byte is padded with 0s
* and written out first. The bit offset will be 0 after the
* write.
*
* @param d an array of <code>doubles</code>s to be written.
* @param off the start offset in the data.
* @param len the number of <code>double</code>s to write.
*
* @exception IndexOutOfBoundsException if <code>off</code> is
* negative, <code>len</code> is negative, or <code>off +
* len</code> is greater than <code>d.length</code>.
* @exception NullPointerException if <code>d</code> is
* <code>null</code>.
* @exception IOException if an I/O error occurs.
*/
void writeDoubles(double[] d, int off, int len) throws IOException;
/**
* Writes a single bit, given by the least significant bit of the
* argument, to the stream at the current bit offset within the
* current byte position. The upper 31 bits of the argument are
* ignored. The given bit replaces the previous bit at that
* position. The bit offset is advanced by one and reduced modulo
* 8.
*
* <p> If any bits of a particular byte have never been set
* at the time the byte is flushed to the destination, those
* bits will be set to 0 automatically.
*
* @param bit an <code>int</code> whose least significant bit
* is to be written to the stream.
*
* @exception IOException if an I/O error occurs.
*/
void writeBit(int bit) throws IOException;
/**
* Writes a sequence of bits, given by the <code>numBits</code>
* least significant bits of the <code>bits</code> argument in
* left-to-right order, to the stream at the current bit offset
* within the current byte position. The upper <code>64 -
* numBits</code> bits of the argument are ignored. The bit
* offset is advanced by <code>numBits</code> and reduced modulo
* 8. Note that a bit offset of 0 always indicates the
* most-significant bit of the byte, and bytes of bits are written
* out in sequence as they are encountered. Thus bit writes are
* always effectively in network byte order. The actual stream
* byte order setting is ignored.
*
* <p> Bit data may be accumulated in memory indefinitely, until
* <code>flushBefore</code> is called. At that time, all bit data
* prior to the flushed position will be written.
*
* <p> If any bits of a particular byte have never been set
* at the time the byte is flushed to the destination, those
* bits will be set to 0 automatically.
*
* @param bits a <code>long</code> containing the bits to be
* written, starting with the bit in position <code>numBits -
* 1</code> down to the least significant bit.
*
* @param numBits an <code>int</code> between 0 and 64, inclusive.
*
* @exception IllegalArgumentException if <code>numBits</code> is
* not between 0 and 64, inclusive.
* @exception IOException if an I/O error occurs.
*/
void writeBits(long bits, int numBits) throws IOException;
/**
* Flushes all data prior to the given position to the underlying
* destination, such as an <code>OutputStream</code> or
* <code>File</code>. Attempting to seek to the flushed portion
* of the stream will result in an
* <code>IndexOutOfBoundsException</code>.
*
* @param pos a <code>long</code> containing the length of the
* stream prefix that may be flushed to the destination.
*
* @exception IndexOutOfBoundsException if <code>pos</code> lies
* in the flushed portion of the stream or past the current stream
* position.
* @exception IOException if an I/O error occurs.
*/
void flushBefore(long pos) throws IOException;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract OutputStream getStream() throws IOException;",
"public OutputStream getOutputStream() throws IOException;",
"@NotNull OutputStream openOutputStream() throws IOException;",
"OutputStream getOutputStream() throws IOException;",
"public interface ObjectOutput extends DataOutput, AutoCloseable {\n /**\n * Write an object to the underlying storage or stream. The class that implements this interface\n * defines how the object is written.\n *\n * @param obj the object to be written\n * @exception IOException Any of the usual Input/Output related exceptions.\n */\n public void writeObject(Object obj) throws IOException;\n\n /**\n * Writes a byte. This method will block until the byte is actually written.\n * \n * @param b the byte\n * @exception IOException If an I/O error has occurred.\n */\n public void write(int b) throws IOException;\n\n /**\n * Writes an array of bytes. This method will block until the bytes are actually written.\n * \n * @param b the data to be written\n * @exception IOException If an I/O error has occurred.\n */\n public void write(byte b[]) throws IOException;\n\n /**\n * Writes a sub array of bytes.\n * \n * @param b the data to be written\n * @param off the start offset in the data\n * @param len the number of bytes that are written\n * @exception IOException If an I/O error has occurred.\n */\n public void write(byte b[], int off, int len) throws IOException;\n\n /**\n * Flushes the stream. This will write any buffered output bytes.\n * \n * @exception IOException If an I/O error has occurred.\n */\n public void flush() throws IOException;\n\n /**\n * Closes the stream. This method must be called to release any resources associated with the\n * stream.\n * \n * @exception IOException If an I/O error has occurred.\n */\n public void close() throws IOException;\n}",
"public OutputStream openOutputStream() throws IOException {\n\n\tthrow new IllegalArgumentException(\"Not supported\");\n }",
"public void write(OutputStream arg0) throws IOException {\n\n\t}",
"protected OutputStream _createDataOutputWrapper(DataOutput out)\n/* */ {\n/* 1520 */ return new DataOutputAsStream(out);\n/* */ }",
"public void seek(long pos) throws IOException {\n/* 155 */ if (pos < 0L) {\n/* 156 */ throw new IOException(PropertyUtil.getString(\"MemoryCacheSeekableStream0\"));\n/* */ }\n/* 158 */ this.pointer = pos;\n/* */ }",
"public OutputStream getOutputStream();",
"public interface Writable {\n void readData(DataInput input) throws IOException;\n void writeData(DataOutput output) throws IOException;\n}",
"public void seek(long pos) throws IOException {\n checkClosed();\n\n if (pos < flushedPos) {\n throw new IndexOutOfBoundsException();\n }\n\n cache.seek(pos);\n this.streamPos = cache.getFilePointer();\n maxStreamPos = Math.max(maxStreamPos, streamPos);\n this.bitOffset = 0;\n }",
"void seek(long position) throws IOException;",
"OutputStream getOutputStream();",
"public OutputStream createOutputStream() throws IOException {\n/* 213 */ return this.stream.createOutputStream();\n/* */ }",
"public RandomAccessOutputStream(IRandomAccess handle) {\n raos = new ome.scifio.io.RandomAccessOutputStream(AdapterTools.getAdapter(IRandomAccessAdapter.class).getModern(handle));\n }",
"public abstract void writeToStream(java.io.DataOutputStream output) throws java.io.IOException;",
"public interface EXRInputStream {\r\n \r\n /**\r\n * Read from the stream.\r\n * \r\n * <p>{@code read(dst)} reads <em>n</em> bytes from the stream, where\r\n * <em>n</em> is the number of bytes remaining in the buffer, that is,\r\n * {@code dst.remaining()}, at the moment this method is invoked. The bytes\r\n * are read into the current position of the buffer.</p>\r\n * \r\n * <p>If the stream contains less than <em>n</em> bytes, or if an I/O error\r\n * occurs, {@code read(dst)} throws an exception. If {@code read(dst)}\r\n * reads the last byte from the stream it returns {@code false}, otherwise\r\n * it returns {@code true}.</p>\r\n * \r\n * @param dst The buffer into which bytes are to be transferred \r\n * @return {@code false} if the call read the last byte from the stream,\r\n * {@code true} otherwise.\r\n * @throws EXRIOException if the stream contains less than <em>n</em>\r\n * bytes, or if an I/O error occurs.\r\n */\r\n boolean read(ByteBuffer dst) throws EXRIOException;\r\n \r\n /**\r\n * Get the current reading position, in bytes from the beginning of the\r\n * stream. If the next call to {@code read()} will read the first byte in\r\n * the stream file, {@code position()} returns {@literal 0}.\r\n * \r\n * @return the current reading position, in bytes from the beginning of the\r\n * stream.\r\n * @throws EXRIOException if an I/O error occurs.\r\n */\r\n long position() throws EXRIOException;\r\n \r\n /**\r\n * Set the current position. After calling {@code position(i)},\r\n * {@code position()} returns <em>i</em>.\r\n * \r\n * @param pos the new reading position.\r\n * @throws EXRIOException if an I/O error occurs.\r\n */\r\n void position(long pos) throws EXRIOException;\r\n \r\n}",
"public MemoryCacheSeekableStream(InputStream src) {\n/* 75 */ this.src = src;\n/* */ }",
"public FileCacheImageOutputStream(OutputStream stream, File cacheDir) throws IOException {\n if (stream == null) {\n throw new IllegalArgumentException(\"stream == null!\");\n }\n if ((cacheDir != null) && !(cacheDir.isDirectory())) {\n throw new IllegalArgumentException(\"Not a directory!\");\n }\n this.stream = stream;\n if (cacheDir == null)\n this.cacheFile = Files.createTempFile(\"imageio\", \".tmp\").toFile();\n else\n this.cacheFile = Files.createTempFile(cacheDir.toPath(), \"imageio\", \".tmp\").toFile();\n this.cache = new RandomAccessFile(cacheFile, \"rw\");\n\n this.closeAction = StreamCloser.createCloseAction(this);\n StreamCloser.addToQueue(closeAction);\n }",
"public abstract SeekInputStream getRawInput();",
"boolean isSeekable();",
"public OutputStream openOutputStream() throws IOException {\n // TODO: this mode is not set yet.\n // \tif ((parent.mode & Connector.WRITE) == 0)\n // \t\tthrow new IOException(\"read-only connection\");\n ensureOpen();\n ensureNotDone();\n\n if (outputStreamOpened)\n throw new IOException(\"no more output streams available\");\n\n if (privateOutput == null) {\n // there are 3 bytes operation headers and 3 bytes body headers //\n privateOutput = new PrivateOutputStream(this, maxPacketSize - 6);\n }\n\n outputStreamOpened = true;\n\n return privateOutput;\n }",
"void seek(long pos) throws IOException;",
"int writeTo(OutputStream out) throws IOException;",
"public synchronized OutputStream getOutputStream() throws IOException {\n/* 229 */ return this.delegate.getOutputStream();\n/* */ }",
"public abstract void write(DataOutput out) throws IOException;",
"int writeTo(byte[] iStream, int pos, ORecordVersion version);",
"public abstract void read0(int aPosition, PageIOStream aStream);",
"public void writeTo(OutputStream arg0) throws IOException {\n\t\t\r\n\t}",
"public RandomAccessOutputStream(RandomAccessWrite writer)\n {\n this.writer = writer;\n // we don't have to maintain a position, as each COSStream can only have one writer.\n }",
"OutputStream getOutputStream() throws FileSystemException;",
"public interface StreamReceiver{\r\n\t/**\r\n\t * Writes an array of bytes to the object holding one end of the pipe.\r\n\t * \r\n\t * @param b The byte array to be written.\r\n\t */\r\n\tpublic abstract void write(byte[] b);\r\n\t\r\n}",
"public InputStream getInputStream(long position);",
"public OutputStream openOutputStream() throws IOException {\n return new FileOutputStream(this);\n }",
"public OutputStream createOutputStream() throws IOException\n {\n return stream.createOutputStream();\n }",
"void flushToOutputStream(OutputStream outputStream) throws IOException;",
"protected abstract void _write(DataOutput output) throws IOException;",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"public boolean isSeekable() {\n return canBeSeekable && channel instanceof FileChannel;\n }",
"@Override\r\n\tpublic void write(IByteBuffer target, long offset) {\n\r\n\t}",
"public int writeBytes(FileChannel in, long position, int length)\r\n/* 910: */ throws IOException\r\n/* 911: */ {\r\n/* 912:916 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 913:917 */ return super.writeBytes(in, position, length);\r\n/* 914: */ }",
"@DSSink({DSSinkKind.IO})\n @DSSpec(DSCat.IO)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-03 14:59:52.264 -0400\", hash_original_method = \"C10E35B15C5C34D2F11AD8F56A8AFBE7\", hash_generated_method = \"8538DC9FDF04C178771F287DC9084D00\")\n \n@Override\r\n public void write(int idx) throws IOException {\r\n try {\r\n beforeWrite(1);\r\n out.write(idx);\r\n afterWrite(1);\r\n } catch (IOException e) {\r\n handleIOException(e);\r\n }\r\n }",
"public OutputStream getStream()\r\n {\r\n return mStream;\r\n }",
"public interface IMemoriaFile {\r\n \r\n public void append(byte[] data);\r\n \r\n /**\r\n * Releases the write-lock\r\n */\r\n public void close();\r\n \r\n /**\r\n * Returns a stream starting at position 0.\r\n * \r\n * Attention: The stream must be closed!\r\n * \r\n * @return Stream for reading the whole content of the file.\r\n */\r\n public InputStream getInputStream();\r\n \r\n /**\r\n * Returns a stream starting at the given <tt>position</tt>.\r\n * \r\n * Attention: The stream must be closed!\r\n * \r\n * @param position\r\n * @return Stream for reading the whole content of the file.\r\n */\r\n public InputStream getInputStream(long position);\r\n \r\n public long getSize();\r\n\r\n public boolean isEmpty();\r\n\r\n \r\n public void sync();\r\n\r\n /**\r\n * The given offset plus the size of the given byte-array must not exceed the file-site.\r\n * @param data\r\n * @param offset\r\n */\r\n public void write(byte[] data, long offset);\r\n}",
"public interface ByteVectorIO {\n public void send(byte[] b) throws IOException;\n\n public byte[] get() throws IOException;\n\n public void close();\n}",
"public OutputStream getOutputStream() {\n return new BufferedOutputStream(new OutputStream() {\n public void write(int b) throws IOException {\n _combinedOutputStream.write(b);\n }\n public void flush() throws IOException {\n _combinedOutputStream.flush();\n }\n public void close() throws IOException {\n _combinedOutputStream.close();\n }\n });\n }",
"public void write(int position, int value) {\n if (isDiskImageMounted()) {\n writeInternal(getPositionIndex(position), value);\n }\n }",
"@Override\n public long writeTo(OutputStream out) {\n // read file and write to 'out'\n if (position == -1) {\n // whole file\n return new ReaderWriter().readFile(out, storageKey);\n } else {\n // range\n return new ReaderWriter().readFile(out, storageKey,\n position, count);\n }\n }",
"public interface IStreamContainerAdapter {\n\n /**\n\t * Get InputStream for communicating via container adapter.\n\t * @return InputStream <code>null</code> if no InputStream available.\n\t */\n public InputStream getInputStream();\n\n /**\n\t * Get OutputStream for communicating via container adapter.\n\t * @return OutputStream <code>null</code> if no OutputStream available.\n\t */\n public OutputStream getOutputStream();\n}",
"public interface LogInputStream {\n\n /**\n * Returns the actual position in a stream after read some data.\n *\n * @return actual position in a stream after read some data.\n */\n public abstract LogPointer getPointer() throws IOException;\n\n}",
"public interface WritableObject {\n\n\t/** Write this object to the specified {@link DataTransferOutput} stream.\n\t * @param outputStream the data output stream to write the data to\n\t * @throws IOException if there is an error writing data to the output stream\n\t */\n\tpublic void writeData(DataTransferOutput outputStream) throws IOException;\n\n}",
"OutputStream getOutputStream()\n {\n return outputStream;\n }",
"public int writeBytes(ScatteringByteChannel in, int length)\r\n/* 624: */ throws IOException\r\n/* 625: */ {\r\n/* 626:634 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 627:635 */ return super.writeBytes(in, length);\r\n/* 628: */ }",
"public void write(DataOutputStream out) throws IOException\n {\n getImage().write(out);\n out.writeFloat(getX());\n out.writeFloat(getY());\n out.writeFloat(getRot());\n out.writeFloat(getSclx());\n out.writeFloat(getScly());\n }",
"public abstract void write (DataOutputStream outStream)\r\n throws IOException;",
"public PipedOutputStream(PipedInputStream snk) throws IOException {\n connect(snk);\n }",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"public void write(final OutputStream stream) throws IOException\n {\n // Write the size information for compressed or Cpa animation block\n if (this.type == MsqType.Compressed || this.type == MsqType.CpaAnimation)\n {\n stream.write(this.size & 0xff);\n stream.write((this.size >> 8) & 0xff);\n stream.write((this.size >> 16) & 0xff);\n stream.write((this.size >> 24) & 0xff);\n }\n\n // Write the MSQ identifier\n if (this.type == MsqType.CpaAnimation)\n {\n stream.write(0x08);\n stream.write(0x67);\n stream.write(0x01);\n }\n else\n {\n stream.write('m');\n stream.write('s');\n stream.write('q');\n }\n\n // Write the disk index\n if (this.type == MsqType.Uncompressed)\n {\n stream.write(this.disk + '0');\n }\n else\n {\n stream.write(this.disk);\n }\n }",
"private int getBytes(int index, FileChannel out, long position, int length, boolean internal)\r\n/* 211: */ throws IOException\r\n/* 212: */ {\r\n/* 213:233 */ ensureAccessible();\r\n/* 214:234 */ ByteBuffer tmpBuf = internal ? internalNioBuffer() : ByteBuffer.wrap(this.array);\r\n/* 215:235 */ return out.write((ByteBuffer)tmpBuf.clear().position(index).limit(index + length), position);\r\n/* 216: */ }",
"public int writeBytes(InputStream in, int length)\r\n/* 617: */ throws IOException\r\n/* 618: */ {\r\n/* 619:628 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 620:629 */ return super.writeBytes(in, length);\r\n/* 621: */ }",
"OutputStream read(String id, OutputStream output);",
"public BlockOutputStream(OutputStream out) {\n\t\t\t// always use a buffered stream, even though we know how\n\t\t\t// much bytes to write/read, since this is just faster for\n\t\t\t// some reason\n\t\t\tsuper(new BufferedOutputStream(out));\n\t\t}",
"public OutputStream setAsciiStream(long pos)\n\t{\n\t\tthrow new UnsupportedOperationException();\n\t}",
"private void writeInMemoryData() throws IOException {\n out.write(totalBitsInChunk);\n\n /* write chunk of bytes itself */\n out.write(chunk, 0, chunkIndex < chunk.length ? chunkIndex + 1 : chunkIndex);\n out.flush();\n\n zeroChunk();\n }",
"public void write(BitOutputStream out) throws IOException {\n\tint nBits;\n\tlong x, y;\n\tout.writeBit(hasScale());\n\tif (hasScale()) {\n\t x = toFixed(getScaleX());\n\t y = toFixed(getScaleY());\n\t nBits = Math.max(minBitsS(x), minBitsS(y));\n\t out.writeBits(x, nBits);\n\t out.writeBits(y, nBits);\n\t}\n\tout.writeBit(hasRotate());\n\tif (hasRotate()) {\n\t x = toFixed(getRotate1());\n\t y = toFixed(getRotate2());\n\t nBits = Math.max(minBitsS(x), minBitsS(y));\n\t out.writeBits(x, nBits);\n\t out.writeBits(y, nBits);\n\t}\n\tx = toFixed(getTranslateX());\n\ty = toFixed(getTranslateY());\n\tnBits = Math.max(minBitsS(x), minBitsS(y));\n\tout.writeBits(x, nBits);\n\tout.writeBits(y, nBits);\n }",
"void seek(int offsetFromStart);",
"public PipedOutputStream() {\n }",
"public RandomAccessOutputStream(String file) throws IOException {\n raos = new ome.scifio.io.RandomAccessOutputStream(file);\n }",
"public StorageOutputStream(OutputStream o) throws Exception {\r\n\tout = o;\r\n}",
"@Override\n\tpublic long Seek(long offset, SeekOrigin origin)\n\t{\n\t\tthrow new UnsupportedOperationException(\"TarInputStream Seek not supported\");\n\t}",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"public abstract void writeData(DataOutput dout) throws IOException;",
"@NotNull\n RecordId writeStream(@NotNull InputStream stream) throws IOException;",
"public int readBytes(FileChannel out, long position, int length)\r\n/* 903: */ throws IOException\r\n/* 904: */ {\r\n/* 905:910 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 906:911 */ return super.readBytes(out, position, length);\r\n/* 907: */ }",
"public void mWriteByte(OutputStream oOutputStream,int out) { //Cast the byt to an array\n byte[] out1=new byte[1];\n out1[0]= (byte) out;\n mWriteByte(oOutputStream,out1);\n }",
"public int internalWrite(ByteBuffer buffer) throws IOException, BadDescriptorException {\n checkOpen();\n \n // TODO: It would be nice to throw a better error for this\n if (!(channel instanceof WritableByteChannel)) {\n throw new BadDescriptorException();\n }\n \n WritableByteChannel writeChannel = (WritableByteChannel)channel;\n \n if (isSeekable() && originalModes.isAppendable()) {\n FileChannel fileChannel = (FileChannel)channel;\n fileChannel.position(fileChannel.size());\n }\n \n return writeChannel.write(buffer);\n }",
"public SnappyOutputStream(OutputStream out)\n throws IOException\n {\n this(out, true);\n }",
"public void write(ArrayDataOutput out) throws FitsException, IOException;",
"@Override\n public void writeExternal(ObjectOutput out) throws IOException {\n out.writeLong(size);\n out.writeInt(batch);\n\n long remaining = size >> 3;\n int step = 1 << 15;\n w.position(0);\n while (remaining > 0) {\n ByteBuffer buffer = ByteBuffer.allocate(step);\n int byteSize = w.read(buffer);\n remaining -= byteSize;\n out.write(buffer.array());\n }\n }",
"public static void copy2(RandomAccessFile input, OutputStream output, long start, long length) throws IOException {\r\n\r\n\t\tbyte[] buffer = new byte[DEFAULT_BUFFER_SIZE];\r\n\t\tint read;\r\n\r\n\t\tif (input.length() == length) {\r\n\t\t\t// Write full range.\r\n\t\t\twhile ((read = input.read(buffer)) > 0) {\r\n\t\t\t\tByteArrayOutputStream bais = new ByteArrayOutputStream((int)length);\r\n\t\t\t\tbais.write(buffer, 0, read);\r\n//\t\t\t\toutput.write(buffer, 0, read);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Write partial range.\r\n\t\t\tinput.seek(start);\r\n\t\t\tlong toRead = length;\r\n\r\n\t\t\twhile ((read = input.read(buffer)) > 0) {\r\n\t\t\t\tif ((toRead -= read) > 0) {\r\n\t\t\t\t\tByteArrayOutputStream bais = new ByteArrayOutputStream((int)length);\r\n\t\t\t\t\tbais.write(buffer, 0, read);\r\n//\t\t\t\t\toutput.write(buffer, 0, read);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tByteArrayOutputStream bais = new ByteArrayOutputStream((int)length);\r\n//\t\t\t\t\tByteArrayOutputStream bais = new ByteArrayOutputStream((int)length);\r\n\t\t\t\t\tbais.write(buffer, 0, (int)toRead + read);\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}",
"PipedOutputStream getOutputStream() {\n return getStreamManager().getBodyStreamWriter();\n }",
"public void setStreams (ByteBufferInputStream in, \n ByteBufferOutputStream out) {\n if (input != null || output != null)\n throw new IllegalStateException (\n \"input or output has already been set\");\n if (in == null)\n throw new IllegalArgumentException (\n \"input stream may not be null\");\n input = in;\n if (out == null) \n out = new ByteBufferOutputStream(); // accept default length\n output = out;\n }",
"public int setBytes(int index, InputStream in, int length)\r\n/* 264: */ throws IOException\r\n/* 265: */ {\r\n/* 266:283 */ ensureAccessible();\r\n/* 267:284 */ return in.read(this.array, index, length);\r\n/* 268: */ }",
"private void writeObject(ObjectOutputStream _stream)\n/* 428: */ throws IOException\n/* 429: */ {\n/* 430:503 */ _stream.defaultWriteObject();\n/* 431:504 */ writeCustomData(_stream);\n/* 432: */ }",
"public interface OutputStreamFactory {\n\n /**\n * Create an output stream for file location.\n * String that represents file location should be relative path, '/' is a delimiter.\n *\n * @param location sting that contains relative file location\n *\n * @return new stream instance\n */\n OutputStream createStream(String location);\n}",
"public void save(DataOutput stream)\n throws IOException\n {\n stream.write(getBytes());\n }",
"public abstract void writeToStream(DataOutputStream dataOutputStream);",
"public void doWrite() throws IOException {\n\t\tbbout.flip();\n\t\tsc.write(bbout);\n\t\tbbout.compact();\n\t\tprocessOut();\n\t\tupdateInterestOps();\n\t}",
"@Override\n public void write(byte[] buf, int offset, int size) throws IOException;",
"protected OutputStream decorateOutputStream(HttpExchange exchange, OutputStream os)\r\n/* 73: */ throws IOException\r\n/* 74: */ {\r\n/* 75:175 */ return os;\r\n/* 76: */ }",
"@InterfaceAudience.Private\npublic interface ByteBufferWriter {\n\n /**\n * Writes <code>len</code> bytes from the specified ByteBuffer starting at offset <code>off</code>\n * @param b the data.\n * @param off the start offset in the data.\n * @param len the number of bytes to write.\n * @exception IOException if an I/O error occurs.\n */\n void write(ByteBuffer b, int off, int len) throws IOException;\n\n /**\n * Writes an <code>int</code> to the underlying output stream as four bytes, high byte first.\n * @param i the <code>int</code> to write\n * @throws IOException if an I/O error occurs.\n */\n // This is pure performance oriented API been added here. It has nothing to do with\n // ByteBuffer and so not fully belong to here. This allows an int to be written at one go instead\n // of 4 (4 bytes one by one).\n // TODO remove it from here?\n void writeInt(int i) throws IOException;\n}",
"public void testWrite() throws IOException\n {\n Pic pic;\n ByteArrayOutputStream stream;\n\n pic = new Pic(ImageIO.read(new File(\"src/test/resources/pic/test.png\")));\n stream = new ByteArrayOutputStream();\n pic.write(stream);\n\n assertEquals(new File(\"src/test/resources/pic/test.pic\"), stream\n .toByteArray());\n }",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"public StreamWriter write(byte[] buffer, int offset, int size)\r\n {\r\n _stream.write(buffer,offset,size);\r\n return this;\r\n }",
"OutputStream createStream(String location);",
"public int readBytes(FileChannel out, long position, int length)\r\n/* 228: */ throws IOException\r\n/* 229: */ {\r\n/* 230:248 */ checkReadableBytes(length);\r\n/* 231:249 */ int readBytes = getBytes(this.readerIndex, out, position, length, true);\r\n/* 232:250 */ this.readerIndex += readBytes;\r\n/* 233:251 */ return readBytes;\r\n/* 234: */ }",
"public interface OutputProcessor {\n\n void process(Reader reader, Writer writer) throws IOException;\n\n}",
"@Override\n protected void doWriteTo(StreamOutput out) throws IOException {\n }",
"@Override\n\tpublic void write(OutStream outStream) {\n\t}"
] | [
"0.6402199",
"0.6025577",
"0.59884053",
"0.5985498",
"0.57594556",
"0.5712147",
"0.56489176",
"0.5640088",
"0.5617128",
"0.5598411",
"0.5561666",
"0.555168",
"0.54646504",
"0.5463801",
"0.5463225",
"0.5451059",
"0.5440208",
"0.5433452",
"0.5417094",
"0.5409654",
"0.5381624",
"0.53624284",
"0.53487873",
"0.5346048",
"0.53328025",
"0.5326107",
"0.53143793",
"0.5300043",
"0.5298646",
"0.52957255",
"0.52850044",
"0.5283522",
"0.5258328",
"0.52444845",
"0.52398705",
"0.52334255",
"0.51997775",
"0.5193081",
"0.5179746",
"0.5172828",
"0.5168579",
"0.51647127",
"0.5161605",
"0.5154754",
"0.51279753",
"0.51233125",
"0.5117431",
"0.50887287",
"0.50632447",
"0.50470275",
"0.5029767",
"0.5016659",
"0.50157595",
"0.5009918",
"0.50081474",
"0.5000697",
"0.5000597",
"0.49939272",
"0.49807668",
"0.4969177",
"0.49647772",
"0.49623036",
"0.49622875",
"0.4942368",
"0.4936262",
"0.49306533",
"0.49300352",
"0.49269193",
"0.4926915",
"0.49214014",
"0.49181253",
"0.4903611",
"0.48902607",
"0.48869947",
"0.4885286",
"0.4883574",
"0.48822674",
"0.48812523",
"0.487938",
"0.48751906",
"0.48670152",
"0.48657796",
"0.48590896",
"0.48560724",
"0.48525226",
"0.48490155",
"0.4844854",
"0.48375764",
"0.4834721",
"0.48264772",
"0.4825587",
"0.4824793",
"0.48207942",
"0.48133022",
"0.48032907",
"0.47994855",
"0.47918814",
"0.4791774",
"0.4789961",
"0.478398"
] | 0.7779196 | 0 |
Writes a sequence of bytes to the stream at the current position. If b.length is 0, nothing is written. The byte b[0] is written first, then the byte b[1], and so on. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void write(byte b[]) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void write(byte b[]) throws IOException\n {\n checkThreshold(b.length);\n getStream().write(b);\n written += b.length;\n }",
"@Override\n public void write (byte[] b) throws IOException {\n byte currByte = b[b[0] + 1];\n int counter = 0;\n for (int i = 0; i < b[0] + 1; i++) {\n out.write(b[i]);\n }\n for (int i = b[0] + 1; i < b.length; i++) {\n if (currByte == 0 && b[i] == 1 || currByte == 1 && b[i] == 0) {\n if (counter <= 255) {\n out.write((byte) counter);\n } else {\n OutOfByteSize(counter);\n }\n counter = 1;\n currByte = b[i];\n } else {\n counter++;\n }\n }\n\n }",
"public void write(byte b[]) throws IOException;",
"public void write(byte b[], int off, int len) throws IOException;",
"public abstract void writeBytes(byte[] b, int offset, int length) throws IOException;",
"public void write(byte b[]) throws IOException {\n baos.write(b, 0, b.length);\n }",
"public void write(byte[] b) throws IOException {\n\t\tbaos.writeBytes(b);\n\t}",
"public void writeBytes(byte[] b) throws IOException {\n\t\tbaos.writeBytes(b);\n\t}",
"public void write(byte[] b) throws IOException\n {\n for(int i = 0; i < 12; i++) // write the first 12 bytes to the OutPutStream [row, row, column, column, S(r), S(r), S(c), S(c), G(r), G(r), G(c), G(c), ..]\n {\n this.out.write(b[i]);\n }\n int counter = 0;\n String s = \"\";\n int lastIter = 7;\n for(int i = 12; i < b.length; i++)\n {\n s += b[i];\n counter++;\n if((counter == 7) || (i == b.length - 1))\n {\n if(i == b.length - 1)\n {\n lastIter = counter;\n }\n byte binaryByte = (byte)(int)Integer.valueOf(s, 2);\n this.out.write(binaryByte);\n counter = 0;\n s = \"\";\n }\n }\n this.out.write(lastIter);\n }",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"public void write(int b) throws IOException {\n baos.write(b);\n }",
"public abstract void write(byte[] b);",
"public void write( int b ) throws IOException {\n\t\tthis.oneBuf[0] = (byte) b;\n\t\tthis.write( this.oneBuf, 0, 1 );\n\t\t}",
"@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}",
"public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }",
"public void writeBytes(byte[] b, int length) throws IOException {\n\t\twriteBytes(b, 0, length);\n\t}",
"public synchronized void write(final int b) throws IOException {\n\t\tthis.singleIntArray[0] = (byte) (0xFF & b);\n\t\twrite(singleIntArray, 0, 1);\n\t}",
"void write(ByteBuffer b, int off, int len) throws IOException;",
"public void write(final byte[] b) throws IOException {\n\t\twrite(b, 0, b.length);\n\t}",
"public void writeData(byte[] b, int pos)\n throws IOException\n {\n Buffer buf;\n for (int i = 0; i < b.length; i++)\n {\n buf = getBufferByPosition(pos + i);\n buf.setByte(b[i], pos + i);\n }\n }",
"@Override\n public void write(ByteBuffer b, int off, int len)\n throws IOException {\n byteBufferStreamOutput.write(b, off, len);\n }",
"public void write(byte[] b, int offset, int len) throws IOException {\n if (pos + len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, pos, len);\n pos += len;\n } else {\n flush();\n if (len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, 0, len);\n } else {\n ConsoleRedirect.this.flush(b, offset, len);\n }\n }\n }",
"public void write(byte b[], int off, int len) throws IOException {\n baos.write(b, off, len);\n }",
"public void write(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}",
"private void writeBuffer( byte b[], int offset, int length) throws IOException\r\n\t{\r\n\t\t// Write the chunk length as a hex number.\r\n\t\tfinal String size = Integer.toHexString(length);\r\n\t\tthis.out.write(size.getBytes());\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// Write the data.\r\n\t\tif (length != 0 )\r\n\t\t\tthis.out.write(b, offset, length);\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// And flush the real stream.\r\n\t\tthis.out.flush();\r\n\t}",
"public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }",
"public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"public void write(ByteBuffer b) throws IOException {\n raos.write(b);\n }",
"public void write(int b) throws IOException;",
"@Override\n public void write(int b) throws IOException {\n byte ib = (byte) b;\n long p = df.position();\n // If not at the end yet,\n if (p < df.size()) {\n // Get the current value,\n byte cur_b = df.get();\n // If the value we are inserting is different,\n if (cur_b != ib) {\n // Reposition and put the new value,\n df.position(p);\n df.put(ib);\n// ++change_count;\n }\n }\n // At the end so write the byte,\n else {\n df.put(ib);\n }\n }",
"@Override\r\n\t\t\tpublic void write(int b) throws IOException {\n\t\t\t}",
"@Override\n public void write(int b) {\n try {\n out.write(b);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@Override\n\tpublic void writeByte(int b) throws IOException {\n\t\t\n\t}",
"@Override\n public void write(byte[] b) throws IOException {\n byte lastByte = 0;\n int count = 0;\n List compressedBytes = new ArrayList();\n out.write(Arrays.copyOfRange(b, 0, metaData));\n for(int i=metaData; i < b.length; i++){\n if(b[i] == lastByte)\n count++;\n else{\n while(count>256){\n compressedBytes.add((byte)255);\n compressedBytes.add((byte)0);\n //out.write(255);\n //out.write(0);\n count = count - 255;\n }\n compressedBytes.add((byte)count);\n //out.write(count);\n count = 1;\n if (lastByte == 0)\n lastByte = 1;\n else\n lastByte = 0;\n }\n }\n compressedBytes.add((byte)count);\n //out.write(count);\n out.write(toByteArray(compressedBytes));\n\n System.out.println ((compressedBytes.size()/b.length)*100);\n }",
"@Override\r\n\tpublic Buffer setBytes(int pos, byte[] b, int offset, int len) {\n\t\treturn null;\r\n\t}",
"public void write(int b) throws IOException {\n/* 54 */ this.appendable.append((char)b);\n/* */ }",
"public void write(int b) throws IOException\n {\n this.out.write(b); // write the byte b to the Stream\n }",
"public void write(byte b[], int off, int len) throws IOException\n\t{\n\t\tout.write(b, off, len);\n\t\tmd5.update(b, off, len);\n\t}",
"private void writeBytes( ByteBuffer byteBuffer, byte[] bytes, int len )\n {\n if ( null == bytes )\n {\n bytes = new byte[]\n {};\n }\n\n byteBuffer.put( bytes, 0, Math.min( len, bytes.length ) );\n\n // pad as necessary\n int remain = len - bytes.length;\n\n while ( remain-- > 0 )\n {\n byteBuffer.put( ( byte ) 0 );\n }\n }",
"public void write(int b) throws IOException\n {\n checkThreshold(1);\n getStream().write(b);\n written++;\n }",
"public void write(byte[] buffer);",
"void writeBytes(byte[] b, File f) throws Exception {\n \n ByteBuffer[] bb = splitByteArray(b);\n\n for (int i = 0; i < bb.length; ++i) {\n\n // WRITE NEXT PORTION OF BYTES VIA FOS:\n\n fos.write(bb[i].array()); \n\n ++i;\n\n // WRITE NEXT PORTION OF BYTES VIA CHANNEL:\n\n if (i < bb.length) {\n FileLock fl = outChannel.lock();\n outChannel.write(bb[i]);\n outChannel.force(false);\n fl.release();\n }\n }\n }",
"@Override\r\n\tpublic Buffer setBytes(int pos, byte[] b) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"public void add(byte b) {\n\t\tif (pointer == size)\n\t\t\twriteToFile();\n\t\tstream.set(pointer++, b);\n\t\twrittenBytes++;\n\t}",
"public abstract void writeByte(byte b) throws IOException;",
"public static int putByte(byte[] bytes, int offset, byte b) {\n bytes[offset] = b;\n return offset + 1;\n }",
"public void writeData(byte b[]) throws IOException {\n\n RandomAccessFile raf;\n int skip_head;\n\n float vox_offset = header.getVox_offset();\n String ds_datname = header.getDs_datname();\n\n skip_head = (int) vox_offset;\n\n\n // can't write random access compressed yet\n if (ds_datname.endsWith(\".gz\")) {\n throw new IOException(\"Sorry, can't write to compressed image data file: \" + ds_datname);\n }\n\n\n // write data blob\n raf = new RandomAccessFile(ds_datname, \"rwd\");\n raf.seek(skip_head);\n raf.write(b, 0, b.length);\n raf.close();\n\n }",
"void writeBytes(byte[] value);",
"public void write(int b) throws IOException\n\t{\n\t\tout.write(b);\n\t\tmd5.update((byte) (b & 0xff));\n\t}",
"public void write(byte[] data, long offset);",
"@Override\n public void write(byte[] b_array) throws IOException {\n int i;\n int flag = 1;\n int my_decimal1=0;\n for (i = 0; i < 12; i++) {\n out.write(b_array[i]);\n }\n //write to output stream the rest of the bytearray's size - division 8\n int rest = (b_array.length - 12) % 8;\n out.write((byte) rest);\n\n\n while (i < b_array.length) {\n //start to count the number of 0\n if (i < b_array.length - rest) {\n for (int j = 0; j < 8; j++) {\n //check if we not in the rest part of the byte array\n if (i < b_array.length - rest) {\n //my_str = String.valueOf((int)b_array[i]);\n my_decimal1 += (int)b_array[i]*(Math.pow(2, j));\n i++;\n }\n else {\n flag = 0;\n break;\n }\n }\n }\n else{\n flag=0;\n }\n //if the for loop finish without break;\n if (flag == 1) {\n out.write((byte) my_decimal1);\n my_decimal1 = 0;\n }\n else {\n out.write(b_array[i]);\n i++;\n }\n }\n\n //>>\n\n\n }",
"private void byteOut(){\n if(nrOfWrittenBytes >= 0){\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else if(c < 0x8000000){\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=c>>>19;\n c &= 0x7FFFF;\n cT=8;\n }\n else{\n b++;\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n c &= 0x7FFFFFF;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else{\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=((c>>>19)&0xFF);\n c &= 0x7FFFF;\n cT=8;\n }\n }\n }\n else {\n // NOTE: carry bit can never be set if the byte buffer was empty\n b= (c>>>19);\n c &= 0x7FFFF;\n cT=8;\n nrOfWrittenBytes++;\n }\n }",
"@Override\n public void write(int b) throws IOException {\n if (b == ModbusASCIITransport.FRAME_START) {\n out.write(58);\n // System.out.println(\"Wrote FRAME_START\");\n return;\n } else if (b == ModbusASCIITransport.FRAME_END) {\n out.write(13);\n out.write(10);\n // System.out.println(\"Wrote FRAME_END\");\n return;\n } else {\n out.write(ModbusUtil.toHex(b));\n // System.out.println(\"Wrote byte \"+b+\"=\"+new String(ModbusUtil.toHex(b)));\n }\n }",
"public int write(byte[] b, int off, int len)\n {\n synchronized (this) {\n if (!open) {\n return 0;\n }\n\n writing = true;\n started = true;\n reset = false;\n timeTracker.start();\n }\n line.start();\n int written = line.write(b, off, len);\n synchronized (this) {\n // drain() might be waiting, so we should wake it up.\n notifyAll();\n writing = false;\n\t\t\tif (!reset) {\n\t\t\t\ttotalWritten += written;\n\t\t\t} else if (reset && open) {\n\t\t\t\t// Flush what we just wrote to keep it reset.\n\t\t\t\tline.flush();\n\t\t\t}\n return written;\n }\n }",
"void flush(byte[] b, int off, int len) {\n if (len > 0) {\n synchronized (flushed) {\n flushed.append(new String(b, off, len));\n }\n }\n }",
"public final void b(byte[] bArr) throws IOException {\n int length = bArr.length;\n if (this.b - this.c >= length) {\n System.arraycopy(bArr, 0, this.a, this.c, length);\n this.c += length;\n return;\n }\n StringBuilder sb = new StringBuilder(\"Out of space: position=\");\n sb.append(this.c);\n sb.append(\", limit=\");\n sb.append(this.b);\n throw new IOException(sb.toString());\n }",
"public final void write2(int b) throws Exception{\r\n\tb += 32768;\r\n\tif (b < 0)\r\n\t\tb = 0;\r\n\twrite(b & 0xFF);\r\n\twrite((b >> 8) & 0xFF);\r\n\t//System.out.println(\"orig=\" + (b-32768) + \" wrote=\" + b + \" 1=\" + (b & 0xFF) + \" 2=\" + ((b >> 8) & 0xFF));\r\n}",
"public void write(byte[] b, int off, int len) throws IOException {\r\n try {\r\n os.write(b, off, len);\r\n } catch (IOException io) {\r\n if (!cbImpl.checkMobileNetwork()) {\r\n throw new WrapperIOException(new TransportException(io.getMessage(), io,\r\n TransportException.NO_NETWORK_COVERAGE));\r\n }\r\n throw io;\r\n }\r\n }",
"@Override\r\n\tpublic Buffer appendUnsignedByte(short b) {\n\t\tbuffer.putShort((short) (b & 0xff));\r\n\t\treturn this;\r\n\t}",
"public void write( byte[] array, int firstIndex,\n\t\t\tint count );",
"@Override\r\n\tpublic Buffer setBytes(int pos, ByteBuffer b) {\n\t\treturn null;\r\n\t}",
"public void write(byte[] bytes) {\n\t\ttry {\n\t\t\tfor(int i=0; i<bytes.length; i++) {\n\t\t\t\tmmOutStream.write(bytes[i] & 0xFF);\t\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void writeBytes() {\n\t\tint needToWrite = rawBytes.length - bytesWritten;\n\t\tint actualWrit = line.write(rawBytes, bytesWritten, needToWrite);\n\t\t// if the total written is not equal to how much we needed to write\n\t\t// then we need to remember where we were so that we don't read more\n\t\t// until we finished writing our entire rawBytes array.\n\t\tif (actualWrit != needToWrite) {\n\t\t\tCCSoundIO.debug(\"writeBytes: wrote \" + actualWrit + \" of \" + needToWrite);\n\t\t\tshouldRead = false;\n\t\t\tbytesWritten += actualWrit;\n\t\t} else {\n\t\t\t// if it all got written, we should continue reading\n\t\t\t// and we reset our bytesWritten value.\n\t\t\tshouldRead = true;\n\t\t\tbytesWritten = 0;\n\t\t}\n\t}",
"private void doClipWrite(byte b[], int off, int len) {\n\t\tif (count + len <= maxOutputSize) { // won't overflow\n\t\t\tthis.writeDirectly(b, off, len);\n\t\t} else {\n\t\t\tint discardBytes = len + count - maxOutputSize;\n\t\t\tif (len >= maxOutputSize) {\n\t\t\t\treset();\n\t\t\t\tthis.writeDirectly(b, off + len - maxOutputSize, maxOutputSize);\n\t\t\t} else {\n\t\t\t\tint shiftStart = count - maxOutputSize + len;\n\t\t\t\tint remaining = maxOutputSize - len;\n\t\t\t\tSystem.arraycopy(buf, shiftStart, buf, 0, remaining);\n\t\t\t\tcount = remaining;\n\t\t\t\tthis.writeDirectly(b, off, len);\n\t\t\t}\n\t\t\tclipNum ++;\n\t\t\tSystem.out.println(String.format(\"Overflow count: %d, discarded bytes number: %d\", clipNum,\n\t\t\t\t\tdiscardBytes));\n\t\t\t\n\t\t}\n\n\t}",
"@Override\n public void write(byte[] buf, int offset, int size) throws IOException;",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"public void write(byte buffer[], int bufferOffset,int nrOfBytes) throws VlException\n {\n write(0,buffer,bufferOffset,nrOfBytes);\n }",
"public void write(boolean b) {\n write(b ? 1 : 0);\n }",
"@Override\r\n public void write(byte[] b) throws IOException {\r\n int rows = (Byte.toUnsignedInt(b[0])*255) + Byte.toUnsignedInt(b[1]);\r\n int cols = (Byte.toUnsignedInt(b[2])*255) + Byte.toUnsignedInt(b[3]);\r\n int compressed_size = 12 + (((rows*cols)) / 8);\r\n if ((rows*cols) % 8 != 0)\r\n compressed_size++;\r\n\r\n byte[] to_return = new byte[compressed_size];\r\n System.arraycopy(b,0,to_return,0,12);\r\n String s1=\"\";\r\n int j=0;\r\n int index=12;\r\n //go through the body of the maze\r\n for(int i=12; i<b.length; i++){\r\n //reached end of chunk\r\n if(j==8){\r\n byte temp=(byte)Integer.parseInt(s1,2);\r\n to_return[index]=temp;\r\n index++;\r\n s1=Integer.toString(b[i]);\r\n j=1;\r\n if(i==b.length-1){\r\n //s1+=Integer.toString(b[i]);\r\n byte temp1=(byte)Integer.parseInt(s1,2);\r\n to_return[index]=temp1;\r\n }\r\n }\r\n else if(j != 8 && i==b.length-1){ //remaining in case doesn't divide in 7 completely\r\n s1+=Integer.toString(b[i]);\r\n byte temp=(byte)Integer.parseInt(s1,2); //turns from binary string to byte(0-127)\r\n to_return[index]=temp;\r\n }\r\n else{\r\n s1+=Integer.toString(b[i]);\r\n j++;\r\n }\r\n }\r\n try{\r\n if(this.out instanceof ObjectOutputStream){\r\n ObjectOutputStream o=(ObjectOutputStream)this.out;\r\n o.writeObject(to_return);\r\n }\r\n else {\r\n out.write(to_return);\r\n }\r\n }\r\n catch(Exception e){\r\n e.printStackTrace();\r\n }\r\n\r\n }",
"public BinaryEncoder writeBytes(byte[] bytes) throws IOException {\n writeLong(bytes.length);\n output.write(bytes, 0, bytes.length);\n return this;\n }",
"void writeBlock(int blockId, byte[] buffer, int offset) throws IOException;",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public void append(byte b)\n\t{\n\t\tappend(new byte[]\n\t\t\t{\n\t\t\t\tb\n\t\t\t});\n\t}",
"public StreamWriter write(byte[] buffer)\r\n {\r\n \t_stream.write(buffer,0,buffer.length);\r\n\t\treturn this;\r\n }",
"@Override\r\n\tpublic Buffer setByte(int pos, byte b) {\n\t\treturn null;\r\n\t}",
"public void writedata(byte b) throws Exception{\n ByteBuffer byteBuffer = ByteBuffer.wrap(\"hello\".getBytes(\"UTF-8\"));\n// byteBuffer.flip();\n client.write(byteBuffer);\n byteBuffer.clear();\n client.close();\n\n }",
"void writeByte(int v) throws IOException;",
"public static void write(byte[] buffer, long offset, long length , long value) {\n while(length-- > 0){\n buffer[(int) offset++] = (byte) (value & 0xFF);\n value >>=8;\n }\n }",
"@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"public static void writeBytes(Vector byteVector, DataOutputStream dos) throws IOException {\t\r\n\t\tif(byteVector != null){\r\n\t\t\tdos.writeByte(byteVector.size());\r\n\t\t\tfor(int i=0; i<byteVector.size(); i++ )\r\n\t\t\t\tdos.writeByte(((Byte)byteVector.elementAt(i)).byteValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"@Override\r\n\tpublic Buffer setUnsignedByte(int pos, short b) {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic int write( byte [] buffer, int offset, int length ) {\n\t\tByteBuffer out = getOutputBuffer();\n\t\tif( out.limit() <= 0 ) {\n\t\t\tout.limit( out.capacity() );\n\t\t}\n\t\tsynchronized( out ) {\n\t\t\tout.put( buffer, offset, length );\n\t\t}\n\t\tdispatcher.requestWrite( this );\n\t\treturn length;\n\t}",
"public void write(byte buffer[],int nrOfBytes) throws VlException\n {\n write(0,buffer,0,nrOfBytes);\n }",
"public void write(byte[] buffer){\r\n\t\t\r\n\t\ttry{\r\n\t\t\toOutStream.write(buffer);\r\n\t\t}catch(IOException e){\r\n\t\t\tLog.e(TAG, \"exception during write\", e);\r\n\t\t}\r\n\t}",
"@Override // c.d.a.m.w.b.AbstractC0024b\n public ByteBuffer b(byte[] bArr) {\n return ByteBuffer.wrap(bArr);\n }",
"public static void writeAll(byte[] bs, OutputStream os) {\n\t\ttry {\n\t\t\tos.write(bs);\n\t\t} catch (IOException e) {\n\t\t\tthrow new WrappedException(e);\n\t\t} finally {\n\t\t\tclose(os);\n\t\t}\n\t}",
"void writeBlock(int blockId, byte[] buffer) throws IOException;",
"void writeByte(byte value);",
"public void writeInt(int i) throws IOException {\n\t\tmBuffer[mBufferLength+3] = (byte) i;\n\t\tmBuffer[mBufferLength+2] = (byte) (i>>>8);\n\t\tmBuffer[mBufferLength+1] = (byte) (i>>>16);\n\t\tmBuffer[mBufferLength] = (byte) (i>>>24);\n\n\n\t\t\n\n\n\t\tmBufferLength += 4;\n\n\t\t// TODO: on the first filling of the buffer, flush when bufferLength+offset is at the end of a segment\n\t\tif (firstFill && ((mBufferLength >= firstFillThreshold))) {\n\t\t\tthis.flush();\n\t\t\tfirstFill = false;\n\t\t}\n\n\t\tif (mBufferLength == BUFFER_SIZE){\n\t\t\tthis.flush();\n\t\t}\n\t}",
"public void flush () throws IOException\n {\n if (m_nBufferedBitCount > 0)\n {\n if (m_nBufferedBitCount != CGlobal.BITS_PER_BYTE)\n if (LOGGER.isDebugEnabled ())\n LOGGER.debug (\"Flushing BitOutputStream with only \" + m_nBufferedBitCount + \" bits\");\n m_aOS.write ((byte) m_nBuffer);\n m_nBufferedBitCount = 0;\n m_nBuffer = 0;\n }\n }",
"public void write(byte[] buffer) {\n try {\n String bufferstring=\"a5550100a2\";\n // byte [] buffer03=new byte[]{(byte) 0xa5, Byte.parseByte(\"ffaa\"),0x01,0x00, (byte) 0xa2};\n byte buffer01[]=bufferstring.getBytes();\n byte [] buffer02=new byte[]{(byte) 0xa5,0x55,0x01,0x00, (byte) 0xa2};\n\n\n //for(int i=0;i<100000;i++) {\n mmOutStream.write(buffer);\n // Thread.sleep(1000);\n //}\n //\n //Share the sent message back to the UI Activity\n// mHandler.obtainMessage(BluetoothChat.MESSAGE_WRITE, -1, -1, buffer)\n// .sendToTarget();\n } catch (Exception e) {\n Log.e(TAG, \"Exception during write\", e);\n }\n }",
"public void write_to_buffer(byte[] buffer) throws IOException {\r\n ByteArrayOutputStream byte_out = new ByteArrayOutputStream(buffer.length);\r\n DataOutputStream out = new DataOutputStream(byte_out);\r\n\r\n write_to_buffer(out);\r\n\r\n byte[] bytes = byte_out.toByteArray();\r\n for (int i = 0; i < buffer.length; ++i) {\r\n buffer[i] = bytes[i];\r\n }\r\n\r\n out.close();\r\n byte_out.close();\r\n }",
"public void writeByte(byte b) throws SerialPortException {\n\t\tport.writeByte(b);\n\t\tif(debug) {\n\t\t\tSystem.out.println(\"<0x\"+ b + \">\");\n\t\t}\n\t\t\n\t}",
"@Override\n public void write(byte[] data) throws IOException {\n for (int i = 0; i < data.length; i++) {\n write(data[i]);\n }\n }",
"@Override\n public void write(final byte[] data, final int offset, final int length)\n throws IOException {\n if (offset < 0 || length < 0 || length > data.length - offset) {\n throw new IndexOutOfBoundsException();\n }\n\n writeInternal(data, offset, length);\n }"
] | [
"0.7279674",
"0.72472167",
"0.7214028",
"0.717823",
"0.7171539",
"0.7041755",
"0.70079064",
"0.6998801",
"0.6967659",
"0.695338",
"0.67930984",
"0.6773894",
"0.66850334",
"0.66813314",
"0.6672498",
"0.66197217",
"0.66193265",
"0.6618083",
"0.65521544",
"0.6519181",
"0.64826334",
"0.64818627",
"0.648166",
"0.6468882",
"0.6459265",
"0.6453086",
"0.6295342",
"0.62579525",
"0.6256651",
"0.6215398",
"0.6205312",
"0.6191725",
"0.6187073",
"0.6145936",
"0.6081456",
"0.60725325",
"0.60657346",
"0.6046413",
"0.60383415",
"0.60229015",
"0.60061777",
"0.5989492",
"0.5977573",
"0.59582484",
"0.5950672",
"0.59461266",
"0.5931958",
"0.5910605",
"0.5859333",
"0.58570045",
"0.58319896",
"0.58261424",
"0.5764139",
"0.5733646",
"0.57148874",
"0.56900996",
"0.56511575",
"0.56253874",
"0.5623911",
"0.56131494",
"0.55297685",
"0.55167884",
"0.5512266",
"0.5507389",
"0.54879385",
"0.5414212",
"0.54031",
"0.53997815",
"0.5395684",
"0.53898233",
"0.53790855",
"0.53771377",
"0.5375055",
"0.53689104",
"0.5356006",
"0.5340431",
"0.5339817",
"0.53216",
"0.532024",
"0.5311771",
"0.5284223",
"0.5281884",
"0.52810836",
"0.5260074",
"0.52588284",
"0.5252303",
"0.52514744",
"0.5247139",
"0.5206983",
"0.5204264",
"0.5201645",
"0.5200508",
"0.5196756",
"0.51917744",
"0.5174222",
"0.5164865",
"0.5157615",
"0.5156331",
"0.51560163",
"0.51531994"
] | 0.68717664 | 10 |
Writes a boolean value to the stream. If v is true, the value (byte)1 is written; if v is false, the value (byte)0 is written. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeBoolean(boolean v) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void writeBooleanValue(boolean v) throws IOException {\n _generator.writeBoolean(v);\n }",
"void writeBool(boolean value);",
"public void write(boolean b) {\n write(b ? 1 : 0);\n }",
"public static void writeBoolean(DataOutputStream dos,Boolean data) throws IOException{\r\n\t\tif(data != null){\r\n\t\t\tdos.writeBoolean(true);\r\n\t\t\tdos.writeBoolean(data.booleanValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeBoolean(false);\r\n\t}",
"public ByteBuf writeBoolean(boolean value)\r\n/* 527: */ {\r\n/* 528:538 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 529:539 */ return super.writeBoolean(value);\r\n/* 530: */ }",
"public void writeBoolean(boolean bool) throws IOException {\n DebugLog.stdoutPrintln(\"\tmarshalling bool\" + bool, DebugLog.BSF_LOG_L3);\n fDataOutputStream.writeBoolean(bool);\n\t}",
"private native void Df1_Write_Boolean(String plcAddress,boolean value) throws Df1LibraryNativeException;",
"public void setBoolean(int index, boolean value) throws ArrayIndexOutOfBoundsException\n\t{\n\t\tbytes[index] = (byte) (value ? 1 : 0);\n\t}",
"String byteOrBooleanWrite();",
"private void serializeBoolean(final Boolean value, final StringBuffer buffer)\n {\n buffer.append(\"b:\");\n buffer.append(value.booleanValue() ? 1 : 0);\n buffer.append(';');\n }",
"public void sendBool(boolean b) {\n try {\n dOut.writeBoolean(b);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send boolean\");\n e.printStackTrace();\n }\n }",
"@Specialization(guards = \"isBooleanOrIllegal(frame)\")\n protected boolean writeBoolean(VirtualFrame frame, boolean value) {\n it.getSlot().setKind(FrameSlotKind.Boolean);\n\n frame.setBoolean(it.getSlot(), value);\n return value;\n }",
"protected void _setBooleanElement(int index, boolean value) {\n\t\tint bitOffset = Math.multiplyExact(index, this.step);\n\t\t// the number of the Bit in the byte it is in\n\t\tbyte bitnum = (byte) (bitOffset % Constants.BITS_PER_BYTE);\n\t\t// position of the byte in the data section\n\t\tint position = (this.ptr + bitOffset / Constants.BITS_PER_BYTE);\n\t\tbyte oldValue = this.segment.buffer.get(position);\n\t\t// the left side of the '|' zeros the selected bit; the right side sets the new value\n\t\tthis.segment.buffer.put(position, (byte) ((oldValue & (~(1 << bitnum))) | ((value ? 1 : 0) << bitnum)));\n\t}",
"public void setV(boolean v) {\n\tthis.v = v;\n }",
"public ByteBuf setBoolean(int index, boolean value)\r\n/* 265: */ {\r\n/* 266:280 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 267:281 */ return super.setBoolean(index, value);\r\n/* 268: */ }",
"static SibillaValue of(boolean v) {\n if (v) {\n return SibillaBoolean.TRUE;\n } else {\n return SibillaBoolean.FALSE;\n }\n }",
"void setBit(int index, boolean value);",
"public static ByteBuffer toByteBuffer(boolean value) {\n\t\tByteBuffer result = ByteBuffer.allocate(1);\n\t\tbyte byteValue = value ? (byte) 1 : (byte) 0;\n\t\tresult.put(byteValue);\n\t\tresult.flip();// 將pos歸位到0\n\t\treturn result;\n\t}",
"void setBoolean(boolean value);",
"public static byte[] getBytes(boolean value) {\r\n\t\t\r\n\t\tif (value) {\r\n\t\t\treturn new byte[] { 1 };\r\n\t\t}\r\n\t\treturn new byte[] { 0 };\r\n\t}",
"void visitBooleanValue(BooleanValue value);",
"public void append(boolean bool)\n\t{\n\t\t// determine the byte to append\n\t\tbyte b = (bool ? TRUE : FALSE);\n\t\t\n\t\t// append the byte\n\t\tappend(b);\n\t}",
"public void writeBooleanPrefs(String prefName, boolean prefValue) {\n editor = sPrefs.edit();\n editor.putBoolean(prefName, prefValue);\n editor.apply();\n }",
"public native int cGPIOWrite(int pin, boolean value);",
"public void putBoolean(ResourceLocation name, boolean value) {\n data.putBoolean(name.toString(), value);\n }",
"void set(boolean value);",
"public interface BitOutput {\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a 1-bit boolean value. This method writes {@code 0b1} for {@code true}\n\t * and {@code 0b0} for {@code false}.\n\t *\n\t * @param value the value to write.\n\t * @throws IOException if an I/O error occurs\n\t */\n\tvoid writeBoolean( boolean value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a {@code byte} value.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 7 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeByte( boolean unsigned, int size, byte value ) throws IOException;\n\n\t/**\n\t * Writes a {@code short} value.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 15 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeShort( boolean unsigned, int size, short value ) throws IOException;\n\n\t/**\n\t * Writes an {@code int} value. Only the lower specified number of bits are\n\t * written.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 31 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeInt( boolean unsigned, int size, int value ) throws IOException;\n\n\t/**\n\t * Writes a {@code long} value. Only the lower specified number of bits are\n\t * written.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of valid bits for value; between {@code 1} and\n\t * {@code 63 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeLong( boolean unsigned, int size, long value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a {@code char} value.\n\t *\n\t * @param size the number of bits for value; between {@code 1} and {@code 16},\n\t * both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeChar( int size, char value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Aligns to specified number of bytes by padding zero bits.\n\t *\n\t * @param bytes the number of bytes to align; must be positive.\n\t * @return the number of zero bits padded while aligning.\n\t * @throws IllegalArgumentException if {@code bytes} is less than or equals to\n\t * {@code 0}.\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tlong align( int bytes ) throws IOException;\n}",
"void setBoolean(int index, boolean value) throws SQLException;",
"public static String booleanToString(boolean val){\n return val ? \"1\" : \"0\";\n }",
"public BooleanValue(boolean value) {\r\n\t\tthis.value = value;\r\n\t}",
"public BooleanValue(boolean value) {\r\n\t\tthis.value = value;\r\n\t}",
"public void writeLedCharacteristic(boolean value) {\n byte[] byteVal = new byte[1];\n if (value) {\n byteVal[0] = (byte) (1);\n } else {\n byteVal[0] = (byte) (0);\n }\n Log.i(TAG, \"LED \" + value);\n mLedCharacteristic.setValue(byteVal);\n BLEService.genericWriteCharacteristic(mLedCharacteristic);\n }",
"public BooleanValue(boolean bool) {\r\n this.val = bool;\r\n }",
"public void putBoolean(String key, boolean value) {\n String valueAsString = value ? TRUE_AS_STRING : FALSE_AS_STRING;\n\n put(key, valueAsString);\n }",
"@Test\n public void testReadWriteBoolean() {\n System.out.println(\"readBoolean\");\n ByteArray instance = new ByteArray();\n \n instance.writeBoolean(true, 0);\n instance.writeBoolean(false, 1);\n instance.writeBoolean(true, instance.compacity());\n \n assertEquals(true, instance.readBoolean(0));\n assertEquals(false, instance.readBoolean(1));\n assertEquals(true, instance.readBoolean(instance.compacity() - 1));\n \n instance.writeBoolean(true, 1);\n assertEquals(true, instance.readBoolean(1));\n }",
"public static boolean toBoolean(byte[] value) {\r\n\t\treturn toBoolean(value, 0);\r\n\t}",
"public boolean writeByte(byte val) {\n try {\n m_DataOutputStream.writeByte(val);\n }\n catch (IOException e) {\n return false;\n }\n return true;\n }",
"public void setBool(String parName, boolean parVal) throws HibException;",
"public void send(boolean bool) {\r\n\t\tif (s != null) {\r\n\t\t\ttry {\r\n\t\t\t\tdos.writeByte(LiteServer.BOOL_CONST);\r\n\t\t\t\tdos.writeBoolean(bool);\r\n\t\t\t\tif (autoFlush) {\r\n\t\t\t\t\tdos.flush();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// if the socket is null\r\n\t\t}\r\n\r\n\t}",
"private void setIsBinary(boolean value) {\r\n\t \t_isBinary = value;\r\n\t }",
"public void setInverse(Boolean bool) throws IOException {\n writer.write(0x1D);\n writer.write(\"B\");\n writer.write((int) (bool ? 1 : 0));\n writer.flush();\n }",
"void setBoolean(String key, boolean val);",
"public void setBooleanValue(String booleanValue) { this.booleanValue = booleanValue; }",
"boolean getBoolValue();",
"boolean getBoolValue();",
"public BooleanType(final Boolean val) {\n\t\tthis.b = val;\n\t}",
"@Override\n public void setBoolean(boolean value) throws SQLException {\n if (possibleCharLength > 4) {\n setString(value ? LONG_TRUE : LONG_FALSE);\n } else if (possibleCharLength >= 1) {\n setString(value ? SHORT_TRUE : SHORT_FALSE);\n }\n }",
"public BooleanType(final boolean val) {\n\t\tthis.b = new Boolean(val);\n\t}",
"public void setBool(String name, Boolean value) {\n parameters.get(name).setValue(value);\n }",
"public Builder setBoolValue(boolean value) {\n typeCase_ = 2;\n type_ = value;\n onChanged();\n return this;\n }",
"public void onClick(View v) {\n\t\t\t\tif (tv.isChecked()) {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('9');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('0');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}",
"public Builder setBoolValue(boolean value) {\n bitField0_ |= 0x00000040;\n boolValue_ = value;\n onChanged();\n return this;\n }",
"public static boolean toPrimitiveBoolean(Boolean value) {\n if (value == null) {\n return false;\n }\n return value;\n }",
"public static boolean toBoolean(Boolean value)\r\n {\r\n return toBoolean(value, false);\r\n }",
"public static boolean writePreferences(final Context context,\n\t\t\tfinal String key, final Boolean value) {\n\t\tboolean result = false;\n\t\tfinal SharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tfinal Editor editor = sharedPreferences.edit();\n\t\tif (editor != null) {\n\t\t\teditor.putBoolean(key, value);\n\t\t\teditor.commit();\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}",
"public void putBoolean(String key, boolean value, boolean commit) {\r\n\t\tputBoolean(Global.getContext(), key, value, commit);\r\n\t}",
"public boolean set(@NullableDecl V v) {\n if (v == null) {\n v = NULL;\n }\n if (!zzhwd.zza((zzdxo<?>) this, (Object) null, (Object) v)) {\n return false;\n }\n zza((zzdxo<?>) this);\n return true;\n }",
"public void setBoolean(String plcAddress,boolean value) throws Df1LibraryNativeException\n\t{\n\t\tDf1_Write_Boolean(plcAddress,value);\n\t}",
"public VfeLkBooleanAdp(Byte booleanId) { this.booleanId = booleanId; }",
"public void updateBoolean(int columnIndex, boolean x) throws SQLException\n {\n m_rs.updateBoolean(columnIndex, x);\n }",
"@JsProperty void setChecked(boolean value);",
"public boolean write(int b) throws FTD2XXException {\n byte[] c = new byte[1];\n c[0] = (byte) b;\n return (write(c) == 1) ? true : false;\n }",
"public static Value makeBool(boolean b) {\n if (b)\n return theBoolTrue;\n else\n return theBoolFalse;\n }",
"boolean boolField(String name, boolean isDefined, boolean value)\n throws NullField, InvalidFieldValue;",
"public void boxBoolean(MethodVisitor mv) {\n Label l0 = new Label();\n mv.visitJumpInsn(Opcodes.IFEQ, l0);\n mv.visitFieldInsn(Opcodes.GETSTATIC, \"java/lang/Boolean\", \"TRUE\", \"Ljava/lang/Boolean;\");\n Label l1 = new Label();\n mv.visitJumpInsn(Opcodes.GOTO, l1);\n mv.visitLabel(l0);\n mv.visitFieldInsn(Opcodes.GETSTATIC, \"java/lang/Boolean\", \"FALSE\", \"Ljava/lang/Boolean;\");\n mv.visitLabel(l1);\n }",
"@Column(name = \"BOOLEAN_VALUE\", length = 20)\n/* 35 */ public String getBooleanValue() { return this.booleanValue; }",
"public static boolean writePreferences(final Context context,\n\t\t\tfinal String key, final boolean value) {\n\t\tboolean result = false;\n\t\tfinal SharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(context);\n\t\tfinal Editor editor = sharedPreferences.edit();\n\t\tif (editor != null) {\n\t\t\teditor.putBoolean(key, value);\n\t\t\teditor.commit();\n\t\t\tresult = true;\n\t\t}\n\t\treturn result;\n\t}",
"void writeBit(int bit) throws IOException;",
"public static byte setBit(byte input, int position, boolean val){\n return val? (byte) (input | (1 << position)):(byte) (input & ~(1 << position));\n }",
"boolean readBoolean();",
"public static byte setFlag(byte field, int pos, boolean value) {\n if(pos < 1 || pos > 8) {\n throw new IllegalArgumentException(\"Pos value is not defined between 1 and 8\");\n }\n\n short flag = (short) Math.pow(2, (pos-1));\n\n if(value) {\n field |= flag;\n } else {\n field &= ~flag;\n }\n return field;\n }",
"void boolean1(boolean a);",
"public Boolean asBoolean();",
"com.google.protobuf.BoolValue getPersistent();",
"BooleanValue createBooleanValue();",
"BooleanValue createBooleanValue();",
"BooleanValue createBooleanValue();",
"BooleanValue createBooleanValue();",
"protected BooleanValue(Boolean bv) {\n boolValue = bv;\n }",
"void writeByte(int v) throws IOException;",
"public void updateBoolean(int columnIndex, boolean x) throws SQLException {\n\n try {\n if (isDebugEnabled()) {\n debugCode(\"updateBoolean(\" + columnIndex + \", \" + x + \");\");\n }\n update(columnIndex, ValueBoolean.get(x));\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }",
"public boolean getBoolValue() {\n return boolValue_;\n }",
"public void setReserved1(boolean value)\n {\n field_1_options = reserved1.setShortBoolean(field_1_options, value);\n }",
"public boolean readBoolean() throws IOException {\n boolean bool = fDataInputStream.readBoolean();\n DebugLog.stdoutPrintln(\"Connection marshalling boolean \" + \n bool, DebugLog.BSF_LOG_L3);\n return bool;\n\t}",
"public void write(long time, boolean value) {\n timeEncoder.encode(time, timeOut);\n valueEncoder.encode(value, valueOut);\n statistics.update(time, value);\n }",
"public boolean getBoolValue() {\n return boolValue_;\n }",
"public String toBooleanValueString(boolean bool) {\n \t\treturn bool ? \"1\" : \"0\";\n \t}",
"public final void fromBoolean(boolean booleanValue) {\n\t\tif (booleanValue) {\n\t\t\tpush(1.0f);\n\t\t} else {\n\t\t\tpush(0.0f);\n\t\t}\n\t}",
"public static void writeBoolean(Context context, String fileName, String key, boolean value) {\n if (context == null)\n return;\n SharedPreferences sharedPreferences = context.getSharedPreferences(fileName, Context.MODE_PRIVATE);\n Editor editor = sharedPreferences.edit();\n editor.putBoolean(key, value);\n editor.apply();\n }",
"@SuppressFBWarnings(\"NP_BOOLEAN_RETURN_NULL\")\r\n public static Boolean fromByte(byte b)\r\n {\r\n return b == 0 ? null : b == 1 ? Boolean.FALSE : Boolean.TRUE;\r\n }",
"public static boolean toBoolean(byte[] value, int startIndex) {\r\n\r\n\t\tif (value[startIndex] == 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"private void encodeBooleanDataType(Encoder encoder, DataType type) throws IOException {\n\t\tencoder.openElement(ELEM_TYPE);\n\t\tencodeNameIdAttributes(encoder, type);\n\t\tencoder.writeString(ATTRIB_METATYPE, \"bool\");\n\t\tencoder.writeSignedInteger(ATTRIB_SIZE, type.getLength());\n\t\tencoder.closeElement(ELEM_TYPE);\n\t}",
"public abstract void read_boolean_array(boolean[] value, int offset, int\nlength);",
"protected void sendBoolean(boolean b, String uniformName) {\n int uniformLocation = glGetUniformLocation(programID, uniformName);\n glUniform1f(uniformLocation, (b == true) ? 1 : 0);\n }",
"public static String toString(boolean value) {\n return value ? \"true\" : \"false\";\n }",
"public synchronized boolean storeBoolean(String key, boolean value) {\n mEditor = mSharedPreferences.edit();\n mEditor.putBoolean(key, value);\n\n return mEditor.commit();\n }",
"public static void setBoolean(String prop, boolean value)\n {\n props.setProperty(prop, \"\" + value);\n }",
"public void setValue(boolean value) {\n this.value = value;\n }",
"public void onClick(View v) {\n\t\t\t\tif (fan.isChecked()) {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('1');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t} else {\n\t\t\t\t\tif (stat == 1) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmmOutputStream.write('2');\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tMainActivity.this,\n\t\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else\n\t\t\t\t\t\tToast.makeText(MainActivity.this,\n\t\t\t\t\t\t\t\t\"Connection not established with your home\",\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t}\n\t\t\t}",
"public BooleanStateValue( boolean value) {\n\t\tthis( value, false);\n\t}"
] | [
"0.80412436",
"0.74163055",
"0.6745904",
"0.66940916",
"0.6604641",
"0.65906835",
"0.63550097",
"0.6289102",
"0.6223571",
"0.60612285",
"0.6036221",
"0.60109454",
"0.60055",
"0.59320086",
"0.57434845",
"0.5735824",
"0.56361216",
"0.5509971",
"0.5494575",
"0.5459031",
"0.5449943",
"0.54334277",
"0.54288656",
"0.54220414",
"0.5404004",
"0.5387351",
"0.5379726",
"0.53754437",
"0.5372823",
"0.5370017",
"0.5370017",
"0.5315905",
"0.5277883",
"0.52723676",
"0.52230054",
"0.5210429",
"0.5205931",
"0.5186347",
"0.5181732",
"0.5164437",
"0.51517934",
"0.5144982",
"0.5144735",
"0.5118776",
"0.5118776",
"0.5112218",
"0.5107816",
"0.5093051",
"0.5092947",
"0.5079775",
"0.5055789",
"0.5053908",
"0.50479966",
"0.5040003",
"0.50376296",
"0.50266224",
"0.50167614",
"0.50153667",
"0.5012472",
"0.49910986",
"0.49855292",
"0.49800918",
"0.49741352",
"0.4971964",
"0.49612448",
"0.49604195",
"0.49470627",
"0.4943274",
"0.49423024",
"0.49422124",
"0.4937311",
"0.49370983",
"0.49214354",
"0.49039793",
"0.4896501",
"0.4896501",
"0.4896501",
"0.4896501",
"0.48863745",
"0.48856285",
"0.48795995",
"0.4878479",
"0.48758158",
"0.48668367",
"0.4862584",
"0.48610434",
"0.48524192",
"0.485193",
"0.483892",
"0.48308006",
"0.48231256",
"0.48150703",
"0.480862",
"0.48068988",
"0.48062634",
"0.48040068",
"0.47966027",
"0.4793345",
"0.47903475",
"0.47875908"
] | 0.80252904 | 1 |
Writes the 8 loworder bits of v to the stream. The 24 highorder bits of v are ignored. (This means that writeByte does exactly the same thing as write for an integer argument.) If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeByte(int v) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"void writeShort(int v) throws IOException;",
"void writeInt(int v) throws IOException;",
"void writeByte(byte value);",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"public StreamWriter write(int value) {\r\n\t\tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n\t\t\t_buffer[2] = (byte) ((value & 0xFF0000) >> 16);\r\n\t\t\t_buffer[3] = (byte) ((value & 0xFF000000) >> 24);\r\n\t\t}else{\r\n\t\t\t_buffer[0] = (byte) (value >> 24);\r\n\t\t\t_buffer[1] = (byte) (value >> 16);\r\n\t\t\t_buffer[2] = (byte) (value >> 8);\r\n\t\t\t_buffer[3] = (byte) value;\r\n\t\t}\r\n\t\t_stream.write(_buffer,0,4);\r\n\t\treturn this;\r\n\t}",
"public void writeUnsignedByte(int i) throws IOException {\r\n\t\tthis.writeByte(i);\r\n\t\t// this.writeByte((byte) (i % 128));\r\n\t}",
"private void writeByteAt(int pos, int val) {\n dest[pos] = (byte) val;\n }",
"public void writeByte(int value)\n throws java.io.IOException {\n\n outputStream.writeByte(value);\n }",
"public void writeInt(int i) throws IOException {\n\t\twriteByte((byte) (i >> 24));\n\t\twriteByte((byte) (i >> 16));\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"public synchronized void write(final int b) throws IOException {\n\t\tthis.singleIntArray[0] = (byte) (0xFF & b);\n\t\twrite(singleIntArray, 0, 1);\n\t}",
"public void writeInt(int value)\n throws java.io.IOException {\n\n if (isBigEndian) {\n outputStream.writeByte((value >> 24) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte(value & 0xFF);\n } else {\n outputStream.writeByte(value & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 24) & 0xFF);\n }\n }",
"@Override\n\tpublic void writeByte(int b) throws IOException {\n\t\t\n\t}",
"public void writeUnsignedShortLittleEndian(int i) throws IOException {\r\n\t\tshort s = (short) (i & 0x0000ffff);\r\n\t\tthis.writeShort(Short.reverseBytes(s));\r\n\t}",
"public void writeInt(int i) throws IOException {\n\t\tmBuffer[mBufferLength+3] = (byte) i;\n\t\tmBuffer[mBufferLength+2] = (byte) (i>>>8);\n\t\tmBuffer[mBufferLength+1] = (byte) (i>>>16);\n\t\tmBuffer[mBufferLength] = (byte) (i>>>24);\n\n\n\t\t\n\n\n\t\tmBufferLength += 4;\n\n\t\t// TODO: on the first filling of the buffer, flush when bufferLength+offset is at the end of a segment\n\t\tif (firstFill && ((mBufferLength >= firstFillThreshold))) {\n\t\t\tthis.flush();\n\t\t\tfirstFill = false;\n\t\t}\n\n\t\tif (mBufferLength == BUFFER_SIZE){\n\t\t\tthis.flush();\n\t\t}\n\t}",
"private static int writeBits(byte[] bytes, int value, int pos, int len) {\n assert(value > 0 && pos + len <= bytes.length * 8);\n int ind = pos / 8;\n int lastPos = 0;\n for (int i = 0; i < len; i++) {\n int bi = (pos + i) % 8;\n if ((value & (1 << (len - i - 1))) != 0) {\n bytes[ind] |= 1 << (7 - bi);\n lastPos = pos + i;\n }\n if (bi == 7) {\n ind++;\n }\n }\n return lastPos;\n }",
"public StreamWriter write(short value)\r\n {\r\n \tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n \t}else{\r\n _buffer[0] = (byte)(value >> 8);\r\n _buffer[1] = (byte)value;\r\n \t}\r\n _stream.write(_buffer,0,2);\r\n\t\treturn this;\r\n }",
"public void write(int b) throws IOException;",
"public abstract void writeByte(byte b) throws IOException;",
"public static int checkBits8(int v) {\n checkArgument(0 <= v && v <= 0xff);\n return v;\n }",
"public void write(int b) throws IOException\n {\n this.out.write(b); // write the byte b to the Stream\n }",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"public static void writeBytes(Vector byteVector, DataOutputStream dos) throws IOException {\t\r\n\t\tif(byteVector != null){\r\n\t\t\tdos.writeByte(byteVector.size());\r\n\t\t\tfor(int i=0; i<byteVector.size(); i++ )\r\n\t\t\t\tdos.writeByte(((Byte)byteVector.elementAt(i)).byteValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"public void write( int b ) throws IOException {\n\t\tthis.oneBuf[0] = (byte) b;\n\t\tthis.write( this.oneBuf, 0, 1 );\n\t\t}",
"void writeShort(short value);",
"public StreamWriter write(byte value)\r\n {\r\n\t\ttry {\r\n\t\t\t_stream.write(new byte[] { value });\r\n\t\t} catch (IOException ex) {\r\n\t\t}\r\n\t\treturn this;\r\n }",
"private void byteOut(){\n if(nrOfWrittenBytes >= 0){\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else if(c < 0x8000000){\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=c>>>19;\n c &= 0x7FFFF;\n cT=8;\n }\n else{\n b++;\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n c &= 0x7FFFFFF;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else{\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=((c>>>19)&0xFF);\n c &= 0x7FFFF;\n cT=8;\n }\n }\n }\n else {\n // NOTE: carry bit can never be set if the byte buffer was empty\n b= (c>>>19);\n c &= 0x7FFFF;\n cT=8;\n nrOfWrittenBytes++;\n }\n }",
"int writeTo(byte[] iStream, int pos, ORecordVersion version);",
"static void encodeInt(DataOutput os, int i) throws IOException {\n if (i >> 28 != 0)\n os.write((i >> 28) & 0x7f);\n if (i >> 21 != 0)\n os.write((i >> 21) & 0x7f);\n if (i >> 14 != 0)\n os.write((i >> 14) & 0x7f);\n if (i >> 7 != 0)\n os.write((i >> 7) & 0x7f);\n os.write((i & 0x7f) | (1 << 7));\n }",
"public ByteBuf writeByte(int value)\r\n/* 533: */ {\r\n/* 534:544 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 535:545 */ return super.writeByte(value);\r\n/* 536: */ }",
"@Override\r\n\tpublic Buffer appendUnsignedByte(short b) {\n\t\tbuffer.putShort((short) (b & 0xff));\r\n\t\treturn this;\r\n\t}",
"@Override\n\tpublic void write(int value) {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\tCpuMem.getInstance().writeMem(address, value);\n\t}",
"void writeLong(long v) throws IOException;",
"void writeInt(int value);",
"@Override\r\n\tpublic Buffer setUnsignedByte(int pos, short b) {\n\t\treturn null;\r\n\t}",
"public static int OPLWrite(FM_OPL OPL, int a, int v) {\n if ((a & 1) == 0) {\n /* address port */\n\n OPL.address = v & 0xff;\n } else {\n /* data port */\n\n if (OPL.UpdateHandler != null) {\n OPL.UpdateHandler.handler(OPL.UpdateParam, 0);\n }\n OPLWriteReg(OPL, OPL.address, v);\n }\n return (OPL.status >> 7) & 0xFF; //status is uint8\n\n }",
"public void write(byte[] data, long offset);",
"@Override\n public void write (byte[] b) throws IOException {\n byte currByte = b[b[0] + 1];\n int counter = 0;\n for (int i = 0; i < b[0] + 1; i++) {\n out.write(b[i]);\n }\n for (int i = b[0] + 1; i < b.length; i++) {\n if (currByte == 0 && b[i] == 1 || currByte == 1 && b[i] == 0) {\n if (counter <= 255) {\n out.write((byte) counter);\n } else {\n OutOfByteSize(counter);\n }\n counter = 1;\n currByte = b[i];\n } else {\n counter++;\n }\n }\n\n }",
"public void writeThin(StreamOutput out) throws IOException {\n super.writeTo(out);\n out.writeVInt(bytes.length());\n }",
"@Override\n\tpublic void showByteWrite(ByteBuffer data)\n\t{\n\n\t}",
"public static byte[] convertInt8(int v)\r\n {\r\n byte[] bytes = new byte[1];\r\n bytes[0] = (byte) v;\r\n return bytes;\r\n }",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"public void write(int b) throws IOException {\n/* 54 */ this.appendable.append((char)b);\n/* */ }",
"public BinaryEncoder writeInt(int i) throws IOException {\n // Compute the zig-zag value. First double the value and flip the bit if the input is negative.\n int val = (i << 1) ^ (i >> 31);\n\n if ((val & ~0x7f) != 0) {\n output.write(0x80 | val & 0x7f);\n val >>>= 7;\n while (val > 0x7f) {\n output.write(0x80 | val & 0x7f);\n val >>>= 7;\n }\n }\n output.write(val);\n\n return this;\n }",
"public int writeByte(byte src) {\n try {\n out.write(src);\n return 0;\n } catch (IOException e) {\n print(\"Error writing byte to \" + portName);\n }\n return -1;\n }",
"@Override\r\n\tpublic Buffer appendUnsignedShort(int s) {\n\t\treturn null;\r\n\t}",
"void writeBit(int bit) throws IOException;",
"protected void writeBooleanValue(boolean v) throws IOException {\n _generator.writeBoolean(v);\n }",
"private void writeInt(DataOutputStream out, int n) throws IOException {\n int result = ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n & 0xFF0000) >> 8) | ((n & 0xFF000000) >> 24);\n out.writeInt(result);\n }",
"void write(ByteBuffer b, int off, int len) throws IOException;",
"@Override\r\n\t\t\tpublic void write(int b) throws IOException {\n\t\t\t}",
"public void write(int b) throws IOException {\n baos.write(b);\n }",
"public void z_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 7); }",
"public static void write4bytes(int value, OutputStream outputStream) throws IOException {\n outputStream.write(value >>> 3 * 8);\n outputStream.write(value >>> 2 * 8 & 255);\n outputStream.write(value >>> 1 * 8 & 255);\n outputStream.write(value & 255);\n }",
"public static void unsignedIntToBytes(byte[] buf, int offset, int len, int value) {\n for (int i = len - 1; i >= 0; i--) {\n buf[i + offset] = (byte) (value & 0xFF);\n value >>= 8;\n }\n }",
"public void writeShort(short i) throws IOException {\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"@Override\n public void write(ByteBuffer b, int off, int len)\n throws IOException {\n byteBufferStreamOutput.write(b, off, len);\n }",
"void writeBoolean(boolean v) throws IOException;",
"@Override\n public void write(int b) {\n try {\n out.write(b);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void write(byte b[], int off, int len) throws IOException;",
"public ByteBuf writeShortLE(int value)\r\n/* 859: */ {\r\n/* 860:868 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 861:869 */ return super.writeShortLE(value);\r\n/* 862: */ }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"public void write(int pVal) throws IOException {\n mPrintWriter.write(pVal);\n }",
"@Override\n public void write(int b) throws IOException {\n byte ib = (byte) b;\n long p = df.position();\n // If not at the end yet,\n if (p < df.size()) {\n // Get the current value,\n byte cur_b = df.get();\n // If the value we are inserting is different,\n if (cur_b != ib) {\n // Reposition and put the new value,\n df.position(p);\n df.put(ib);\n// ++change_count;\n }\n }\n // At the end so write the byte,\n else {\n df.put(ib);\n }\n }",
"static void write32( int dword, OutputStream out )\n throws IOException\n {\n out.write( dword );\n out.write( dword >> 8 );\n out.write( dword >> 16 );\n out.write( dword >> 24 );\n }",
"public ByteBuf writeShort(int value)\r\n/* 539: */ {\r\n/* 540:550 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 541:551 */ return super.writeShort(value);\r\n/* 542: */ }",
"public void write(byte b[]) throws IOException;",
"@Override\n\tpublic void write(DataOutput dout) throws IOException {\n\t\tdout.writeLong(this.time);\n\t\tdout.writeInt(this.intVal);\n\t}",
"protected abstract void writeInternal(int index, int value);",
"private static void writeByte(boolean rs, int data) {\n int highData = ((data >>> NIBBLE_SIZE) & NIBBLE_MASK); //Parte Alta do data\n int lowData = (data & NIBBLE_MASK); //Parte Baixa do data\n writeNibble(rs,highData);\n writeNibble(rs,lowData);\n Time.sleep(WRITEBYTE_SLEEP_TIME);\n }",
"private static void m17788a(OutputStream outputStream, int i) {\n outputStream.write((i >> 0) & 255);\n outputStream.write((i >> 8) & 255);\n outputStream.write((i >> 16) & 255);\n outputStream.write((i >> 24) & 255);\n }",
"static void write16( int word, OutputStream out )\n throws IOException\n {\n out.write( word );\n out.write( word >> 8 );\n }",
"public void write(int index, UnsignedByte unsignedByte) {\n memory[index] = unsignedByte;\n }",
"public void writeData(final DataOutputStream out) throws IOException {\n\t\tout.writeShort(constantValueIndex);\n\t}",
"public void encodeBinary(Buf out)\n {\n out.u2(val.length()+1);\n for (int i=0; i<val.length(); ++i)\n out.u1(val.charAt(i));\n out.u1(0);\n }",
"@Test(timeout = 4000)\n public void test000() throws Throwable {\n byte[] byteArray0 = new byte[4];\n byteArray0[0] = (byte) (-71);\n byteArray0[1] = (byte)38;\n byteArray0[2] = (byte) (-71);\n byteArray0[3] = (byte) (-28);\n MethodWriter.writeShort(byteArray0, 0, (byte)38);\n assertArrayEquals(new byte[] {(byte)0, (byte)38, (byte) (-71), (byte) (-28)}, byteArray0);\n }",
"void writeByte(byte[] header, int index, int data) {\n header[index] = (byte) data;\n }",
"@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"void writeBytes(byte[] value);",
"public static void writeWithByte(final long address, final long size, final byte value) {\n\t\tUnsafe.get().setMemory(address, size, value);\n\t}",
"@Override\n public void write(byte[] buf, int offset, int size) throws IOException;",
"@Override\n public void encode(BigEndianEncoder encoderV)\n {\n encoderV.encodeShort(this.id);\n // then encode the 16-bit flags\n encoderV.encodeShort(this.flag);\n // then encode QCOUNT\n encoderV.encodeShort(this.questionCount);\n // then encode ANCOUNT\n encoderV.encodeShort(this.answerCount);\n // then encode NSCOUNT\n encoderV.encodeShort(this.nameServerCount);\n // then encode ARCOUNT\n encoderV.encodeShort(this.additionalFullRRCount);\n\n\n }",
"public void write(java.io.PrintWriter ps) {\n ps.print(\" \" + versionId\n + \" \" + n_bits\n + \" \" + vector.toBinString()\n + \" \" + delay);\n }",
"void write(byte b[]) throws IOException;",
"public void write(int b) throws IOException\n {\n checkThreshold(1);\n getStream().write(b);\n written++;\n }",
"public void writeTo(ByteBuf out) {\n/* 77 */ if (this.value == null) {\n/* */ return;\n/* */ }\n/* 80 */ out.writeByte(this.value.byteValue());\n/* */ }",
"@Override\r\n\tpublic Buffer setUnsignedShort(int pos, int s) {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic void WriteByte(byte value)\n\t{\n\t\tthrow new UnsupportedOperationException(\"TarInputStream WriteByte not supported\");\n\t}",
"protected abstract void write( int value ) throws IOException;",
"public final void write(int c) {\r\n if (cbyte == size) {\r\n throw new ArrayIndexOutOfBoundsException(String.format(\"%d\", cbyte));\r\n }\r\n \r\n // Append the input byte to the data element.\r\n elem |= (c & 0xff) << (bytenum << 3);\r\n \r\n bytenum++;\r\n cbyte++;\r\n if (bytenum == BYTES_IN_ELEMENT) {\r\n // Write the data\r\n data[offset] = elem;\r\n // Increase offset\r\n offset++;\r\n // Reset current element\r\n elem = 0;\r\n // Reset bytenum\r\n bytenum = 0;\r\n }\r\n }",
"String write(byte[] content, boolean noPin);",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"void writeBits(long bits, int numBits) throws IOException;",
"@Override\n\tpublic void setV(ByteBuffer fileBytes) {\n\t\tthis.v = fileBytes.getInt();\n\t}",
"public abstract void encode(ByteBuffer buffer, int offset, int value);",
"public void write(int b) throws IOException\n\t{\n\t\tout.write(b);\n\t\tmd5.update((byte) (b & 0xff));\n\t}",
"public void write(byte[] b) throws IOException\n {\n for(int i = 0; i < 12; i++) // write the first 12 bytes to the OutPutStream [row, row, column, column, S(r), S(r), S(c), S(c), G(r), G(r), G(c), G(c), ..]\n {\n this.out.write(b[i]);\n }\n int counter = 0;\n String s = \"\";\n int lastIter = 7;\n for(int i = 12; i < b.length; i++)\n {\n s += b[i];\n counter++;\n if((counter == 7) || (i == b.length - 1))\n {\n if(i == b.length - 1)\n {\n lastIter = counter;\n }\n byte binaryByte = (byte)(int)Integer.valueOf(s, 2);\n this.out.write(binaryByte);\n counter = 0;\n s = \"\";\n }\n }\n this.out.write(lastIter);\n }"
] | [
"0.59678376",
"0.5839939",
"0.5762635",
"0.56535393",
"0.55120087",
"0.54075974",
"0.53931",
"0.5351868",
"0.53219485",
"0.52649593",
"0.52063066",
"0.5196411",
"0.5195147",
"0.5145793",
"0.51199543",
"0.51190406",
"0.5105017",
"0.5100914",
"0.50763434",
"0.50720906",
"0.5056823",
"0.50203395",
"0.5002307",
"0.4977865",
"0.49593312",
"0.4948864",
"0.49282047",
"0.4917386",
"0.49037495",
"0.4902205",
"0.48977694",
"0.48855916",
"0.48597622",
"0.48509422",
"0.48491663",
"0.48421752",
"0.48352757",
"0.48347718",
"0.4832959",
"0.4832686",
"0.48231238",
"0.48127043",
"0.48072577",
"0.47888628",
"0.47813177",
"0.47566426",
"0.47564372",
"0.4743743",
"0.47397912",
"0.47203207",
"0.47186542",
"0.4717105",
"0.47049838",
"0.47044852",
"0.4701176",
"0.46985897",
"0.4681247",
"0.46812406",
"0.46709833",
"0.4668446",
"0.46520233",
"0.46492034",
"0.4648925",
"0.4648925",
"0.46402755",
"0.46368286",
"0.46299294",
"0.4626907",
"0.46230596",
"0.46194094",
"0.46106845",
"0.46089116",
"0.46016374",
"0.459396",
"0.45860642",
"0.45826328",
"0.45815545",
"0.45807785",
"0.45766017",
"0.45701113",
"0.45648864",
"0.4563131",
"0.4556997",
"0.45508718",
"0.45353517",
"0.45295444",
"0.45267108",
"0.45229036",
"0.45161623",
"0.45136088",
"0.45108962",
"0.45100212",
"0.45091718",
"0.44865668",
"0.44862884",
"0.44858518",
"0.44831067",
"0.44828412",
"0.44756585",
"0.44588363"
] | 0.66397 | 0 |
Writes the 16 loworder bits of v to the stream. The 16 highorder bits of v are ignored. If the stream uses network byte order, the bytes written, in order, will be: (byte)((v >> 8) & 0xff) (byte)(v & 0xff) Otherwise, the bytes written will be: (byte)(v & 0xff) (byte)((v >> 8) & 0xff) If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeShort(int v) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public StreamWriter write(short value)\r\n {\r\n \tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n \t}else{\r\n _buffer[0] = (byte)(value >> 8);\r\n _buffer[1] = (byte)value;\r\n \t}\r\n _stream.write(_buffer,0,2);\r\n\t\treturn this;\r\n }",
"void writeByte(int v) throws IOException;",
"public void writeUnsignedShortLittleEndian(int i) throws IOException {\r\n\t\tshort s = (short) (i & 0x0000ffff);\r\n\t\tthis.writeShort(Short.reverseBytes(s));\r\n\t}",
"static void write16( int word, OutputStream out )\n throws IOException\n {\n out.write( word );\n out.write( word >> 8 );\n }",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"void writeShort(short value);",
"public final void writeShort(final short data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer2[0] = (byte) (data >>> 8);\r\n byteBuffer2[1] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer2[0] = (byte) (data & 0xff);\r\n byteBuffer2[1] = (byte) (data >>> 8);\r\n }\r\n\r\n raFile.write(byteBuffer2);\r\n }",
"public void z_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 7); }",
"public static int writeShort(OutputStream target, short value) throws IOException {\n target.write((byte) (value >>> 8 & 255));\n target.write((byte) (value & 255));\n return Short.BYTES;\n }",
"public static byte[] convertInt16(short v, boolean isLE)\r\n {\r\n byte[] bytes = new byte[2];\r\n if (isLE)\r\n {\r\n bytes[1] = (byte) ((v >>> 8) & 0xFF);\r\n bytes[0] = (byte) ((v >>> 0) & 0xFF);\r\n }\r\n else\r\n {\r\n bytes[0] = (byte) ((v >>> 8) & 0xFF);\r\n bytes[1] = (byte) ((v >>> 0) & 0xFF);\r\n }\r\n return bytes;\r\n }",
"public static int checkBits16(int v) {\n checkArgument(0 <= v && v <= 0xffff);\n return v;\n }",
"public void writeShort(short i) throws IOException {\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"public static byte[] convertInt16(int v, boolean isLE)\r\n {\r\n return convertInt16((short) v, isLE);\r\n }",
"@Override\n public void encode(BigEndianEncoder encoderV)\n {\n encoderV.encodeShort(this.id);\n // then encode the 16-bit flags\n encoderV.encodeShort(this.flag);\n // then encode QCOUNT\n encoderV.encodeShort(this.questionCount);\n // then encode ANCOUNT\n encoderV.encodeShort(this.answerCount);\n // then encode NSCOUNT\n encoderV.encodeShort(this.nameServerCount);\n // then encode ARCOUNT\n encoderV.encodeShort(this.additionalFullRRCount);\n\n\n }",
"@Override\r\n\tpublic Buffer appendUnsignedShort(int s) {\n\t\treturn null;\r\n\t}",
"public void x_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 3); }",
"public StreamWriter write(int value) {\r\n\t\tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n\t\t\t_buffer[2] = (byte) ((value & 0xFF0000) >> 16);\r\n\t\t\t_buffer[3] = (byte) ((value & 0xFF000000) >> 24);\r\n\t\t}else{\r\n\t\t\t_buffer[0] = (byte) (value >> 24);\r\n\t\t\t_buffer[1] = (byte) (value >> 16);\r\n\t\t\t_buffer[2] = (byte) (value >> 8);\r\n\t\t\t_buffer[3] = (byte) value;\r\n\t\t}\r\n\t\t_stream.write(_buffer,0,4);\r\n\t\treturn this;\r\n\t}",
"@Override\r\n\tpublic Buffer setUnsignedShort(int pos, int s) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic Buffer appendUnsignedByte(short b) {\n\t\tbuffer.putShort((short) (b & 0xff));\r\n\t\treturn this;\r\n\t}",
"public ByteBuf writeShort(int value)\r\n/* 539: */ {\r\n/* 540:550 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 541:551 */ return super.writeShort(value);\r\n/* 542: */ }",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public static void shortToByteArray(short value, byte[] buffer, int offset) {\n buffer[offset] = (byte) (value >> 8 & 0xFF);\n buffer[offset + 1] = (byte) (value & 0xFF);\n }",
"public void writeUnsignedByte(int i) throws IOException {\r\n\t\tthis.writeByte(i);\r\n\t\t// this.writeByte((byte) (i % 128));\r\n\t}",
"public void r_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 9); }",
"public static int OPLWrite(FM_OPL OPL, int a, int v) {\n if ((a & 1) == 0) {\n /* address port */\n\n OPL.address = v & 0xff;\n } else {\n /* data port */\n\n if (OPL.UpdateHandler != null) {\n OPL.UpdateHandler.handler(OPL.UpdateParam, 0);\n }\n OPLWriteReg(OPL, OPL.address, v);\n }\n return (OPL.status >> 7) & 0xFF; //status is uint8\n\n }",
"private void writeByteAt(int pos, int val) {\n dest[pos] = (byte) val;\n }",
"private static byte[] shortToBytes(short value) {\n ByteBuffer bb = ByteBuffer.allocate(2);\n bb.putShort(value);\n return bb.array();\n }",
"public void y_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 5); }",
"public static void write4bytes(int value, OutputStream outputStream) throws IOException {\n outputStream.write(value >>> 3 * 8);\n outputStream.write(value >>> 2 * 8 & 255);\n outputStream.write(value >>> 1 * 8 & 255);\n outputStream.write(value & 255);\n }",
"void writeInt(int v) throws IOException;",
"public ByteBuf writeShortLE(int value)\r\n/* 859: */ {\r\n/* 860:868 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 861:869 */ return super.writeShortLE(value);\r\n/* 862: */ }",
"@Override\r\n\tpublic Buffer setUnsignedByte(int pos, short b) {\n\t\treturn null;\r\n\t}",
"@Test\n public void testReadWriteShort() {\n System.out.println(\"readShort\");\n ByteArray instance = new ByteArray();\n \n instance.writeShort((short) 12, 0);\n instance.writeShort((short) 15, 2);\n instance.writeShort((short) 13, instance.compacity());\n \n assertEquals(12, instance.readShort(0));\n assertEquals(15, instance.readShort(2));\n assertEquals(13, instance.readShort(instance.compacity() - 2));\n \n instance.writeShort((short) 14, 2);\n assertEquals(14, instance.readShort(2));\n }",
"public void writeData(final DataOutputStream out) throws IOException {\n\t\tout.writeShort(constantValueIndex);\n\t}",
"public void writeInt(int value)\n throws java.io.IOException {\n\n if (isBigEndian) {\n outputStream.writeByte((value >> 24) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte(value & 0xFF);\n } else {\n outputStream.writeByte(value & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 24) & 0xFF);\n }\n }",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"void writeShorts(short[] s, int off, int len) throws IOException;",
"public void writeByte(int value)\n throws java.io.IOException {\n\n outputStream.writeByte(value);\n }",
"public final void setBufferShort(final byte[] buffer, final short data, final int i, final boolean endianess) {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n buffer[i] = (byte) (data >>> 8);\r\n buffer[i + 1] = (byte) (data & 0xff);\r\n } else {\r\n buffer[i] = (byte) (data & 0xff);\r\n buffer[i + 1] = (byte) (data >>> 8);\r\n }\r\n }",
"private void writeInt(DataOutputStream out, int n) throws IOException {\n int result = ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n & 0xFF0000) >> 8) | ((n & 0xFF000000) >> 24);\n out.writeInt(result);\n }",
"public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}",
"private static short flipEndian(short signedShort) {\n int input = signedShort & 0xFFFF;\n return (short) (input << 8 | (input & 0xFF00) >>> 8);\n }",
"public void onWriteShortBegin(ICPU cpu, int addr) {\n\t}",
"public static short setByte(short field, int pos, short value) {\n if(pos < 1 || pos > 2) {\n throw new IllegalArgumentException(\"Pos value is not defined between 1 and 2\");\n }\n\n switch(pos) {\n case 1:\n field = (short) (field & 0xFF00);\n break;\n case 2:\n field = (short) (field & 0x00FF);\n break;\n }\n\n return (short) (field | (value << (8* (pos-1))));\n }",
"public void write(DataOutput output) throws IOException {\n output.writeShort(this.data);\n }",
"protected void writeBooleanValue(boolean v) throws IOException {\n _generator.writeBoolean(v);\n }",
"private void emitHeader(OutputStream stream) throws IOException {\n int header = 0x0;\n header |= WORKBUF_PROTOCOL_VERSION;\n stream.write(TfWorkbufProtocol.intToFourBytes(header));\n }",
"static void encodeInt(DataOutput os, int i) throws IOException {\n if (i >> 28 != 0)\n os.write((i >> 28) & 0x7f);\n if (i >> 21 != 0)\n os.write((i >> 21) & 0x7f);\n if (i >> 14 != 0)\n os.write((i >> 14) & 0x7f);\n if (i >> 7 != 0)\n os.write((i >> 7) & 0x7f);\n os.write((i & 0x7f) | (1 << 7));\n }",
"void writeFloat(float v) throws IOException;",
"public void write16(int ireg, int data)\n {\n this.write(ireg, new byte[] { (byte)(data&0xFF), (byte)((data>>8)&0xFF)} );\n }",
"public abstract void encode(ByteBuffer buffer, int offset, int value);",
"protected void _setShort(int index, int value)\r\n/* 435: */ {\r\n/* 436:449 */ HeapByteBufUtil.setShort(this.array, index, value);\r\n/* 437: */ }",
"void writeByte(byte value);",
"public static int setByte(int field, int pos, short value) {\n if(pos < 1 || pos > 4) {\n throw new IllegalArgumentException(\"Pos value is not defined between 1 and 4\");\n }\n\n switch(pos) {\n case 1:\n field = field & 0xFFFFFF00;\n break;\n case 2:\n field = field & 0xFFFF00FF;\n break;\n case 3:\n field = field & 0xFF00FFFF;\n break;\n case 4:\n field = field & 0x00FFFFFF;\n break;\n }\n\n return (field | (value << (8* (pos-1))));\n }",
"int setShort(int num, int a_short, int which)\n {\n return ((num & (0b1111111111111111 << ((~which) << 4))) | (a_short << (which << 4)));\n }",
"private static void m17788a(OutputStream outputStream, int i) {\n outputStream.write((i >> 0) & 255);\n outputStream.write((i >> 8) & 255);\n outputStream.write((i >> 16) & 255);\n outputStream.write((i >> 24) & 255);\n }",
"public ByteBuf setShort(int index, int value)\r\n/* 277: */ {\r\n/* 278:292 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 279:293 */ return super.setShort(index, value);\r\n/* 280: */ }",
"public StreamWriter write(byte value)\r\n {\r\n\t\ttry {\r\n\t\t\t_stream.write(new byte[] { value });\r\n\t\t} catch (IOException ex) {\r\n\t\t}\r\n\t\treturn this;\r\n }",
"public Builder setField1632Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1632_ = value;\n onChanged();\n return this;\n }",
"@Override\r\n\tpublic Buffer setShort(int pos, short s) {\n\t\treturn null;\r\n\t}",
"public static String toHexString(int v) {\n v &= 0xFF;\n // Will return either \"x\" or \"xx\" as v is bounded to 0-255.\n String res = Integer.toHexString(v);\n if (res.length() == 1)\n return \"0\" + res;\n return res;\n }",
"protected void _setShortLE(int index, int value)\r\n/* 447: */ {\r\n/* 448:461 */ HeapByteBufUtil.setShortLE(this.array, index, value);\r\n/* 449: */ }",
"@Override\r\n\tpublic int getUnsignedShort(int pos) {\n\t\treturn getShort(pos) & 0x0FFFF;\r\n\t}",
"public static void writeU32(int hClient, int offset, int value,\n\t\t\tNiRioStatus status) {\n//\t\t System.out.print(\"write offset = 0x\");\n//\t\t System.out.print(Long.toString(offset, 16) + \"\");\n//\t\t System.out.print(\"value = \");\n//\t\t System.out.println(Long.toString(((long)value) & 0xFFFFFFFFL, 10));\n\t\tmergeStatus(status,\n\t\t\t\twriteU32Fn.invokeInt(new Object[] { hClient, offset, value }));\n\t}",
"public void param_index_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 2); }",
"public Builder setField1716Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1716_ = value;\n onChanged();\n return this;\n }",
"int writeTo(byte[] iStream, int pos, ORecordVersion version);",
"public void set_dest(short value) {\n setUIntElement(offsetBits_dest(), 8, value);\n }",
"public ByteBuf setShort(int index, int value)\r\n/* 428: */ {\r\n/* 429:442 */ ensureAccessible();\r\n/* 430:443 */ _setShort(index, value);\r\n/* 431:444 */ return this;\r\n/* 432: */ }",
"void writeBoolean(boolean v) throws IOException;",
"@Test(timeout = 4000)\n public void test000() throws Throwable {\n byte[] byteArray0 = new byte[4];\n byteArray0[0] = (byte) (-71);\n byteArray0[1] = (byte)38;\n byteArray0[2] = (byte) (-71);\n byteArray0[3] = (byte) (-28);\n MethodWriter.writeShort(byteArray0, 0, (byte)38);\n assertArrayEquals(new byte[] {(byte)0, (byte)38, (byte) (-71), (byte) (-28)}, byteArray0);\n }",
"public Builder setField1116Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1116_ = value;\n onChanged();\n return this;\n }",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"public void version_SET(char src)\n { set_bytes((char)(src) & -1L, 1, data, 2); }",
"public static void writeBytes(Vector byteVector, DataOutputStream dos) throws IOException {\t\r\n\t\tif(byteVector != null){\r\n\t\t\tdos.writeByte(byteVector.size());\r\n\t\t\tfor(int i=0; i<byteVector.size(); i++ )\r\n\t\t\t\tdos.writeByte(((Byte)byteVector.elementAt(i)).byteValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"public ByteBuf setShortLE(int index, int value)\r\n/* 793: */ {\r\n/* 794:802 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 795:803 */ return super.setShortLE(index, value);\r\n/* 796: */ }",
"public void writeInt(int i) throws IOException {\n\t\twriteByte((byte) (i >> 24));\n\t\twriteByte((byte) (i >> 16));\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"void writeByte(byte[] header, int index, int data) {\n header[index] = (byte) data;\n }",
"public Builder setField1615Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1615_ = value;\n onChanged();\n return this;\n }",
"public Builder setField1516Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1516_ = value;\n onChanged();\n return this;\n }",
"public Builder setField1617Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1617_ = value;\n onChanged();\n return this;\n }",
"static void write32( int dword, OutputStream out )\n throws IOException\n {\n out.write( dword );\n out.write( dword >> 8 );\n out.write( dword >> 16 );\n out.write( dword >> 24 );\n }",
"public void writeInt(int i) throws IOException {\n\t\tmBuffer[mBufferLength+3] = (byte) i;\n\t\tmBuffer[mBufferLength+2] = (byte) (i>>>8);\n\t\tmBuffer[mBufferLength+1] = (byte) (i>>>16);\n\t\tmBuffer[mBufferLength] = (byte) (i>>>24);\n\n\n\t\t\n\n\n\t\tmBufferLength += 4;\n\n\t\t// TODO: on the first filling of the buffer, flush when bufferLength+offset is at the end of a segment\n\t\tif (firstFill && ((mBufferLength >= firstFillThreshold))) {\n\t\t\tthis.flush();\n\t\t\tfirstFill = false;\n\t\t}\n\n\t\tif (mBufferLength == BUFFER_SIZE){\n\t\t\tthis.flush();\n\t\t}\n\t}",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"public void write(DataOutputStream out) throws IOException;",
"public void setShort(int addr, short val) throws ProgramException {\n setLittleEndian(addr, Short.BYTES, val);\n }",
"public void encodeBinary(Buf out)\n {\n out.u2(val.length()+1);\n for (int i=0; i<val.length(); ++i)\n out.u1(val.charAt(i));\n out.u1(0);\n }",
"public void onEncodeSerialData(StreamWriter streamWriter) throws IOException {\n Vector<BlockHeader> vector = this.blockHeaderVector;\n if (vector == null) {\n streamWriter.writeVariableInt(0);\n return;\n }\n Iterator it = vector.iterator();\n while (it.hasNext()) {\n ((BlockHeader) it.next()).mo44659c(streamWriter);\n }\n }",
"public void write(int b) throws IOException\n {\n this.out.write(b); // write the byte b to the Stream\n }",
"public static byte[] getBytes(short value) {\r\n\t\treturn ByteBuffer.allocate(2).order(ByteOrder.LITTLE_ENDIAN).putShort(value).array();\r\n\t}",
"private void byteOut(){\n if(nrOfWrittenBytes >= 0){\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else if(c < 0x8000000){\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=c>>>19;\n c &= 0x7FFFF;\n cT=8;\n }\n else{\n b++;\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n c &= 0x7FFFFFF;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else{\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=((c>>>19)&0xFF);\n c &= 0x7FFFF;\n cT=8;\n }\n }\n }\n else {\n // NOTE: carry bit can never be set if the byte buffer was empty\n b= (c>>>19);\n c &= 0x7FFFF;\n cT=8;\n nrOfWrittenBytes++;\n }\n }",
"public static int checkBits8(int v) {\n checkArgument(0 <= v && v <= 0xff);\n return v;\n }",
"@Override\r\n\tpublic short getUnsignedByte(int pos) {\n\t\treturn (short) (getByte(pos) & 0xff);\r\n\t}",
"public void write( int b ) throws IOException {\n\t\tthis.oneBuf[0] = (byte) b;\n\t\tthis.write( this.oneBuf, 0, 1 );\n\t\t}",
"public void write(long time, short value) {\n timeEncoder.encode(time, timeOut);\n valueEncoder.encode(value, valueOut);\n statistics.update(time, value);\n }",
"public Builder setField1611Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1611_ = value;\n onChanged();\n return this;\n }",
"void writeBit(int bit) throws IOException;",
"public static short toInt16(byte[] value) {\r\n\t\treturn toInt16(value, 0);\r\n\t}",
"public void write(int b) throws IOException;",
"public void writeThin(StreamOutput out) throws IOException {\n super.writeTo(out);\n out.writeVInt(bytes.length());\n }"
] | [
"0.60248137",
"0.5778611",
"0.5673385",
"0.5652378",
"0.5602445",
"0.54663336",
"0.5445747",
"0.5424112",
"0.540275",
"0.53890586",
"0.5384948",
"0.53357816",
"0.53081083",
"0.53072774",
"0.5265683",
"0.5238881",
"0.52372223",
"0.51977706",
"0.5182487",
"0.5156066",
"0.51544625",
"0.51216817",
"0.505698",
"0.50383425",
"0.50382394",
"0.500367",
"0.49989086",
"0.4980237",
"0.49768406",
"0.49716443",
"0.49617916",
"0.49615553",
"0.4949746",
"0.48993373",
"0.48959804",
"0.48925266",
"0.4889371",
"0.4881076",
"0.4871827",
"0.48527232",
"0.48446265",
"0.48407218",
"0.48358274",
"0.4816627",
"0.48156837",
"0.48033834",
"0.47957116",
"0.47824225",
"0.47817528",
"0.47766426",
"0.47686994",
"0.47654888",
"0.47595647",
"0.4721887",
"0.47167778",
"0.46865866",
"0.4675442",
"0.46688223",
"0.46559653",
"0.4654551",
"0.4633524",
"0.46258113",
"0.46127573",
"0.46078333",
"0.46046478",
"0.4596298",
"0.45903698",
"0.45898807",
"0.4575225",
"0.4571064",
"0.45699885",
"0.4560131",
"0.45501202",
"0.45418158",
"0.45392585",
"0.4538758",
"0.45381558",
"0.45366228",
"0.4532553",
"0.45319116",
"0.4530443",
"0.4518076",
"0.45116442",
"0.44999433",
"0.44950753",
"0.44808412",
"0.4479281",
"0.4460059",
"0.44582954",
"0.44564077",
"0.44531617",
"0.44501287",
"0.4447553",
"0.44127142",
"0.44064012",
"0.44063783",
"0.44052455",
"0.44037557",
"0.4403578",
"0.44009486"
] | 0.62533396 | 0 |
Writes the 32 bits of v to the stream. If the stream uses network byte order, the bytes written, in order, will be: (byte)((v >> 24) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 8) & 0xff) (byte)(v & 0xff) Otheriwse, the bytes written will be: (byte)(v & 0xff) (byte)((v >> 8) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 24) & 0xff) If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeInt(int v) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static void write32( int dword, OutputStream out )\n throws IOException\n {\n out.write( dword );\n out.write( dword >> 8 );\n out.write( dword >> 16 );\n out.write( dword >> 24 );\n }",
"public static void writeU32(int hClient, int offset, int value,\n\t\t\tNiRioStatus status) {\n//\t\t System.out.print(\"write offset = 0x\");\n//\t\t System.out.print(Long.toString(offset, 16) + \"\");\n//\t\t System.out.print(\"value = \");\n//\t\t System.out.println(Long.toString(((long)value) & 0xFFFFFFFFL, 10));\n\t\tmergeStatus(status,\n\t\t\t\twriteU32Fn.invokeInt(new Object[] { hClient, offset, value }));\n\t}",
"public StreamWriter write(int value) {\r\n\t\tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n\t\t\t_buffer[2] = (byte) ((value & 0xFF0000) >> 16);\r\n\t\t\t_buffer[3] = (byte) ((value & 0xFF000000) >> 24);\r\n\t\t}else{\r\n\t\t\t_buffer[0] = (byte) (value >> 24);\r\n\t\t\t_buffer[1] = (byte) (value >> 16);\r\n\t\t\t_buffer[2] = (byte) (value >> 8);\r\n\t\t\t_buffer[3] = (byte) value;\r\n\t\t}\r\n\t\t_stream.write(_buffer,0,4);\r\n\t\treturn this;\r\n\t}",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"void writeByte(int v) throws IOException;",
"void writeShort(int v) throws IOException;",
"public StreamWriter write(short value)\r\n {\r\n \tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n \t}else{\r\n _buffer[0] = (byte)(value >> 8);\r\n _buffer[1] = (byte)value;\r\n \t}\r\n _stream.write(_buffer,0,2);\r\n\t\treturn this;\r\n }",
"public void writeInt(int value)\n throws java.io.IOException {\n\n if (isBigEndian) {\n outputStream.writeByte((value >> 24) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte(value & 0xFF);\n } else {\n outputStream.writeByte(value & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 24) & 0xFF);\n }\n }",
"private void writeInt(DataOutputStream out, int n) throws IOException {\n int result = ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n & 0xFF0000) >> 8) | ((n & 0xFF000000) >> 24);\n out.writeInt(result);\n }",
"public static void write4bytes(int value, OutputStream outputStream) throws IOException {\n outputStream.write(value >>> 3 * 8);\n outputStream.write(value >>> 2 * 8 & 255);\n outputStream.write(value >>> 1 * 8 & 255);\n outputStream.write(value & 255);\n }",
"void writeLong(long v) throws IOException;",
"public static int OPLWrite(FM_OPL OPL, int a, int v) {\n if ((a & 1) == 0) {\n /* address port */\n\n OPL.address = v & 0xff;\n } else {\n /* data port */\n\n if (OPL.UpdateHandler != null) {\n OPL.UpdateHandler.handler(OPL.UpdateParam, 0);\n }\n OPLWriteReg(OPL, OPL.address, v);\n }\n return (OPL.status >> 7) & 0xFF; //status is uint8\n\n }",
"static void encodeInt(DataOutput os, int i) throws IOException {\n if (i >> 28 != 0)\n os.write((i >> 28) & 0x7f);\n if (i >> 21 != 0)\n os.write((i >> 21) & 0x7f);\n if (i >> 14 != 0)\n os.write((i >> 14) & 0x7f);\n if (i >> 7 != 0)\n os.write((i >> 7) & 0x7f);\n os.write((i & 0x7f) | (1 << 7));\n }",
"public void writeInt(int i) throws IOException {\n\t\twriteByte((byte) (i >> 24));\n\t\twriteByte((byte) (i >> 16));\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"public void z_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 7); }",
"public static byte[] convertInt32(int v, boolean isLE)\r\n {\r\n byte[] bytes = new byte[4];\r\n if (isLE)\r\n {\r\n bytes[3] = (byte) ((v >>> 24) & 0xFF);\r\n bytes[2] = (byte) ((v >>> 16) & 0xFF);\r\n bytes[1] = (byte) ((v >>> 8) & 0xFF);\r\n bytes[0] = (byte) ((v >>> 0) & 0xFF);\r\n }\r\n else\r\n {\r\n bytes[0] = (byte) ((v >>> 24) & 0xFF);\r\n bytes[1] = (byte) ((v >>> 16) & 0xFF);\r\n bytes[2] = (byte) ((v >>> 8) & 0xFF);\r\n bytes[3] = (byte) ((v >>> 0) & 0xFF);\r\n }\r\n return bytes;\r\n }",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"public void writeUnsignedShortLittleEndian(int i) throws IOException {\r\n\t\tshort s = (short) (i & 0x0000ffff);\r\n\t\tthis.writeShort(Short.reverseBytes(s));\r\n\t}",
"public abstract void encode(ByteBuffer buffer, int offset, int value);",
"@Override\n public void encode(BigEndianEncoder encoderV)\n {\n encoderV.encodeShort(this.id);\n // then encode the 16-bit flags\n encoderV.encodeShort(this.flag);\n // then encode QCOUNT\n encoderV.encodeShort(this.questionCount);\n // then encode ANCOUNT\n encoderV.encodeShort(this.answerCount);\n // then encode NSCOUNT\n encoderV.encodeShort(this.nameServerCount);\n // then encode ARCOUNT\n encoderV.encodeShort(this.additionalFullRRCount);\n\n\n }",
"public void x_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 3); }",
"public static @NonNull Buffer writeVarInt(@NonNull Buffer buffer, int value) {\n while (true) {\n if ((value & ~0x7F) == 0) {\n buffer.writeByte((byte) value);\n return buffer;\n } else {\n buffer.writeByte((byte) ((value & 0x7F) | 0x80));\n value >>>= 7;\n }\n }\n }",
"static void write16( int word, OutputStream out )\n throws IOException\n {\n out.write( word );\n out.write( word >> 8 );\n }",
"void writeShort(short value);",
"boolean write(final ByteBuffer src);",
"@Override\r\n\tpublic Buffer appendUnsignedShort(int s) {\n\t\treturn null;\r\n\t}",
"private void writeByteAt(int pos, int val) {\n dest[pos] = (byte) val;\n }",
"public void r_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 9); }",
"@Override\n\tpublic void write(int value) {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\tCpuMem.getInstance().writeMem(address, value);\n\t}",
"public int writeByte(byte src) {\n try {\n out.write(src);\n return 0;\n } catch (IOException e) {\n print(\"Error writing byte to \" + portName);\n }\n return -1;\n }",
"public static int writeShort(OutputStream target, short value) throws IOException {\n target.write((byte) (value >>> 8 & 255));\n target.write((byte) (value & 255));\n return Short.BYTES;\n }",
"public ByteBuf writeShortLE(int value)\r\n/* 859: */ {\r\n/* 860:868 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 861:869 */ return super.writeShortLE(value);\r\n/* 862: */ }",
"public void writeThin(StreamOutput out) throws IOException {\n super.writeTo(out);\n out.writeVInt(bytes.length());\n }",
"private static void m17788a(OutputStream outputStream, int i) {\n outputStream.write((i >> 0) & 255);\n outputStream.write((i >> 8) & 255);\n outputStream.write((i >> 16) & 255);\n outputStream.write((i >> 24) & 255);\n }",
"public static int writeInt(OutputStream target, int value) throws IOException {\n target.write(value >>> 24);\n target.write(value >>> 16);\n target.write(value >>> 8);\n target.write(value);\n return Integer.BYTES;\n }",
"public void writeUnsignedByte(int i) throws IOException {\r\n\t\tthis.writeByte(i);\r\n\t\t// this.writeByte((byte) (i % 128));\r\n\t}",
"public void writeTo(ByteBuf out) {\n/* 77 */ if (this.value == null) {\n/* */ return;\n/* */ }\n/* 80 */ out.writeByte(this.value.byteValue());\n/* */ }",
"int writeTo(byte[] iStream, int pos, ORecordVersion version);",
"private void emitHeader(OutputStream stream) throws IOException {\n int header = 0x0;\n header |= WORKBUF_PROTOCOL_VERSION;\n stream.write(TfWorkbufProtocol.intToFourBytes(header));\n }",
"public static int writeLong(OutputStream target, long value) throws IOException {\n target.write((byte) (value >>> 56));\n target.write((byte) (value >>> 48));\n target.write((byte) (value >>> 40));\n target.write((byte) (value >>> 32));\n target.write((byte) (value >>> 24));\n target.write((byte) (value >>> 16));\n target.write((byte) (value >>> 8));\n target.write((byte) value);\n return Long.BYTES;\n }",
"void writeByte(byte value);",
"public void write(int b) throws IOException\n\t{\n\t\tout.write(b);\n\t\tmd5.update((byte) (b & 0xff));\n\t}",
"private void setLittleEndian(int addr, int bytes, long val) throws ProgramException {\n if ((addr & bytes - 1) != 0) {\n throw new ProgramException(ErrorType.ADDRL);\n }\n\n byte[] buff = new byte[bytes];\n for (int i = 0; i < bytes; i++) {\n buff[i] = (byte) (val >> (i * Byte.SIZE));\n }\n\n set(addr, buff);\n }",
"private static void serializeUint32(ArrayList<Byte> arrlist, int k) {\n\t\tint i;\n\t\tbyte b;\n\t\n\t\tfor (i = 3; i >= 0; i--) {\n\t\t\tb = (byte) ((k & (0x000000ff << (i * 8))) >> (i * 8));\n\t\t\tarrlist.add(Byte.valueOf(b));\n\t\t}\n\t}",
"public StreamWriter write(byte value)\r\n {\r\n\t\ttry {\r\n\t\t\t_stream.write(new byte[] { value });\r\n\t\t} catch (IOException ex) {\r\n\t\t}\r\n\t\treturn this;\r\n }",
"public void write(int b) throws IOException;",
"public final void writeShort(final short data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer2[0] = (byte) (data >>> 8);\r\n byteBuffer2[1] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer2[0] = (byte) (data & 0xff);\r\n byteBuffer2[1] = (byte) (data >>> 8);\r\n }\r\n\r\n raFile.write(byteBuffer2);\r\n }",
"public void writeByte(int value)\n throws java.io.IOException {\n\n outputStream.writeByte(value);\n }",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"void writeInt(int value);",
"public static void write(byte[] buffer, long offset, long length , long value) {\n while(length-- > 0){\n buffer[(int) offset++] = (byte) (value & 0xFF);\n value >>=8;\n }\n }",
"public ByteBuf writeShort(int value)\r\n/* 539: */ {\r\n/* 540:550 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 541:551 */ return super.writeShort(value);\r\n/* 542: */ }",
"public void y_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 5); }",
"private static int writeBits(byte[] bytes, int value, int pos, int len) {\n assert(value > 0 && pos + len <= bytes.length * 8);\n int ind = pos / 8;\n int lastPos = 0;\n for (int i = 0; i < len; i++) {\n int bi = (pos + i) % 8;\n if ((value & (1 << (len - i - 1))) != 0) {\n bytes[ind] |= 1 << (7 - bi);\n lastPos = pos + i;\n }\n if (bi == 7) {\n ind++;\n }\n }\n return lastPos;\n }",
"long writeValue(V value, int[] version) {\n // the length of the given value plus its header\n int valueLength = valueSerializer.calculateSize(value) + valueOperator.getHeaderSize();\n // The allocated slice is actually the thread's copy moved to point to the newly allocated slice\n Slice slice = memoryManager.allocateSlice(valueLength, MemoryManager.Allocate.VALUE);\n version[0] = slice.getByteBuffer().getInt(slice.getByteBuffer().position());\n // initializing the header lock to be free\n slice.initHeader(valueOperator);\n // since this is a private environment, we can only use ByteBuffer::slice, instead of ByteBuffer::duplicate\n // and then ByteBuffer::slice\n // This is the only place where we create a new object (for the serializer).\n valueSerializer.serialize(value, valueOperator.getValueByteBufferNoHeaderPrivate(slice));\n // combines the blockID with the value's length (including the header)\n int valueBlockAndLength = (slice.getBlockID() << VALUE_BLOCK_SHIFT) | (valueLength & VALUE_LENGTH_MASK);\n return intsToLong(valueBlockAndLength, slice.getByteBuffer().position());\n }",
"public void write(int b) throws IOException\n {\n this.out.write(b); // write the byte b to the Stream\n }",
"public static String toHexString(int v) {\n v &= 0xFF;\n // Will return either \"x\" or \"xx\" as v is bounded to 0-255.\n String res = Integer.toHexString(v);\n if (res.length() == 1)\n return \"0\" + res;\n return res;\n }",
"@Override\r\n\tpublic Buffer setUnsignedShort(int pos, int s) {\n\t\treturn null;\r\n\t}",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"public void onEncodeSerialData(StreamWriter streamWriter) throws IOException {\n Vector<BlockHeader> vector = this.blockHeaderVector;\n if (vector == null) {\n streamWriter.writeVariableInt(0);\n return;\n }\n Iterator it = vector.iterator();\n while (it.hasNext()) {\n ((BlockHeader) it.next()).mo44659c(streamWriter);\n }\n }",
"public static void writeMessageType(OutputStream os, short type) throws IOException {\n os.write((byte)(type & 0xFF));\n os.write((byte)((type >> 8) & 0xFF));\n }",
"private void setInt(byte [] buffer, int offset, int value) {\r\n\t\tbuffer[offset++] = (byte)((value & 0xFF000000) >>> 24);\r\n\t\tbuffer[offset++] = (byte)((value & 0x00FF0000) >>> 16);\r\n\t\tbuffer[offset++] = (byte)((value & 0x0000FF00) >>> 8);\r\n\t\tbuffer[offset] = (byte)((value & 0x000000FF));\r\n\t}",
"public int write(byte[] src) {\n try {\n out.write(src);\n return 0;\n } catch (IOException e) {\n print(\"Error writing bytes to \" + portName);\n }\n return -1;\n }",
"public void streamWrite(byte[] buffer,int bufferOffset,int nrOfBytes) throws VlException\n {\n if (this instanceof VStreamWritable)\n {\n VStreamWritable wfile = (VStreamWritable) (this);\n OutputStream ostr = wfile.getOutputStream(); // do not append\n\n try\n {\n ostr.write(buffer, bufferOffset, nrOfBytes);\n ostr.flush(); \n ostr.close(); // Close between actions !\n }\n catch (IOException e)\n {\n throw new VlIOException(\"Failed to write to file:\" + this, e);\n }\n }\n else\n {\n throw new nl.uva.vlet.exception.NotImplementedException(\"File type does not support (remote) write access\");\n }\n }",
"public synchronized void write(final int b) throws IOException {\n\t\tthis.singleIntArray[0] = (byte) (0xFF & b);\n\t\twrite(singleIntArray, 0, 1);\n\t}",
"void writeLong(long value);",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public void write(int pVal) throws IOException {\n mPrintWriter.write(pVal);\n }",
"public void writeShort(short i) throws IOException {\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"public void writeData(final DataOutputStream out) throws IOException {\n\t\tout.writeShort(constantValueIndex);\n\t}",
"@Override\r\n\t\t\tpublic void write(int b) throws IOException {\n\t\t\t}",
"public void version_SET(char src)\n { set_bytes((char)(src) & -1L, 1, data, 2); }",
"void writeBytes(byte[] value);",
"protected void marshalReferences(uka.transport.MarshalStream _stream)\n throws java.io.IOException\n {\n int _size = _length * uka.transport.BasicIO.SIZEOF_byte;\n if(_size > uka.transport.BasicIO.REQUEST_MAX){\n //b is too big to be serialized as a primitive field\n _stream.writeObject(value);\n } else {\n //b is small enough to be serialized as a primitive field\n _stream.reserve(_size);\n byte[] _buffer = _stream.getBuffer();\n int _pos = _stream.getPosition();\n _pos = uka.transport.BasicIO.insert(_buffer, _pos, value);\n _stream.deliver(_size);\n }\n }",
"public void marshal(uka.transport.MarshalStream _stream)\n throws java.io.IOException\n {\n _stream.reserve(_SIZE);\n byte[] _buffer = _stream.getBuffer();\n int _pos = _stream.getPosition();\n marshalPrimitives(_buffer, _pos);\n _stream.deliver(_SIZE);\n marshalReferences(_stream);\n }",
"public void writeInt(int i) throws IOException {\n\t\tmBuffer[mBufferLength+3] = (byte) i;\n\t\tmBuffer[mBufferLength+2] = (byte) (i>>>8);\n\t\tmBuffer[mBufferLength+1] = (byte) (i>>>16);\n\t\tmBuffer[mBufferLength] = (byte) (i>>>24);\n\n\n\t\t\n\n\n\t\tmBufferLength += 4;\n\n\t\t// TODO: on the first filling of the buffer, flush when bufferLength+offset is at the end of a segment\n\t\tif (firstFill && ((mBufferLength >= firstFillThreshold))) {\n\t\t\tthis.flush();\n\t\t\tfirstFill = false;\n\t\t}\n\n\t\tif (mBufferLength == BUFFER_SIZE){\n\t\t\tthis.flush();\n\t\t}\n\t}",
"public void writeLong(long i) throws IOException {\n\t\twriteInt((int) (i >> 32));\n\t\twriteInt((int) i);\n\t}",
"void writeFloat(float v) throws IOException;",
"void write(final OutputStream byteStream, final N source, String encoding) throws IOException, XdmMarshalException;",
"public void encodeBinary(Buf out)\n {\n out.u2(val.length()+1);\n for (int i=0; i<val.length(); ++i)\n out.u1(val.charAt(i));\n out.u1(0);\n }",
"protected abstract void write( int value ) throws IOException;",
"public void write(LogEntryProto entry) throws IOException {\n final int serialized = entry.getSerializedSize();\n final int proto = CodedOutputStream.computeUInt32SizeNoTag(serialized) + serialized;\n final int total = proto + 4; // proto and 4-byte checksum\n final byte[] buf = sharedBuffer != null? sharedBuffer.get(): new byte[total];\n Preconditions.assertTrue(total <= buf.length, () -> \"total = \" + total + \" > buf.length \" + buf.length);\n preallocateIfNecessary(total);\n\n CodedOutputStream cout = CodedOutputStream.newInstance(buf);\n cout.writeUInt32NoTag(serialized);\n entry.writeTo(cout);\n\n checksum.reset();\n checksum.update(buf, 0, proto);\n ByteBuffer.wrap(buf, proto, 4).putInt((int) checksum.getValue());\n\n out.write(buf, total);\n }",
"void writeBits(long bits, int numBits) throws IOException;",
"public void write(java.io.PrintWriter ps) {\n ps.print(\" \" + versionId\n + \" \" + n_bits\n + \" \" + vector.toBinString()\n + \" \" + delay);\n }",
"@Override\n public int write(byte[] bytes, int offset, int length) throws SWPException {\n int codePointLength = getLength();\n SWPException.requireTrue(length >= codePointLength, \"Buffer overflow.\");\n bytes[offset] = (byte) ((codePointLength << 8) & 0xff);\n bytes[offset + 1] = (byte) (codePointLength & 0xff);\n bytes[offset + 2] = (byte) (codePoint >>> 8);\n bytes[offset + 3] = (byte) (codePoint & 0xff);\n if (isNull()) {\n\n bytes[offset + 4] = SwpConstants.NULL_INDICATOR;\n }\n else {\n\n bytes[offset + 4] = SwpConstants.NOT_NULL_INDICATOR;\n primitive.write(bytes, offset + 5, length - 5);\n }\n return codePointLength;\n }",
"public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }",
"public void write(int ints) {\n try {\n mOutStream.writeInt(ints);\n Log.i(\"TRANSFER\", \"wrote \" + ints);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"String write(byte[] content, boolean noPin);",
"public final void writeInt(final int data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer4[0] = (byte) (data >>> 24);\r\n byteBuffer4[1] = (byte) (data >>> 16);\r\n byteBuffer4[2] = (byte) (data >>> 8);\r\n byteBuffer4[3] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer4[0] = (byte) (data & 0xff);\r\n byteBuffer4[1] = (byte) (data >>> 8);\r\n byteBuffer4[2] = (byte) (data >>> 16);\r\n byteBuffer4[3] = (byte) (data >>> 24);\r\n }\r\n\r\n raFile.write(byteBuffer4);\r\n }",
"@Override\r\n\tpublic Buffer appendUnsignedByte(short b) {\n\t\tbuffer.putShort((short) (b & 0xff));\r\n\t\treturn this;\r\n\t}",
"public final void write2(int b) throws Exception{\r\n\tb += 32768;\r\n\tif (b < 0)\r\n\t\tb = 0;\r\n\twrite(b & 0xFF);\r\n\twrite((b >> 8) & 0xFF);\r\n\t//System.out.println(\"orig=\" + (b-32768) + \" wrote=\" + b + \" 1=\" + (b & 0xFF) + \" 2=\" + ((b >> 8) & 0xFF));\r\n}",
"public void write(DataOutputStream out) throws IOException;",
"public static void writeBytes(Vector byteVector, DataOutputStream dos) throws IOException {\t\r\n\t\tif(byteVector != null){\r\n\t\t\tdos.writeByte(byteVector.size());\r\n\t\t\tfor(int i=0; i<byteVector.size(); i++ )\r\n\t\t\t\tdos.writeByte(((Byte)byteVector.elementAt(i)).byteValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"public void write(byte[] data, long offset);",
"public void alt_SET(int src)\n { set_bytes((int)(src) & -1L, 4, data, 24); }",
"private void writeLength(int length) {\n if (length < 128) {\n os.write((byte) length);\n } else if (length < 256) {\n os.write(-127); // 10000001 - 1 byte to follow\n os.write((byte) length);\n } else if (length < 65536) {\n os.write(-126); // 10000010 - 2 bytes to follow\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else if (length < 16777216) {\n os.write(-125); // 10000011 - 3 bytes to follow\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else {\n os.write(-124); // 10000100 - 4 bytes to follow\n os.write((byte) (length >> 24));\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n }\n }",
"public ByteBuf writeByte(int value)\r\n/* 533: */ {\r\n/* 534:544 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 535:545 */ return super.writeByte(value);\r\n/* 536: */ }",
"public static void unsignedIntToBytes(byte[] buf, int offset, int len, int value) {\n for (int i = len - 1; i >= 0; i--) {\n buf[i + offset] = (byte) (value & 0xFF);\n value >>= 8;\n }\n }"
] | [
"0.6082466",
"0.5952804",
"0.5933514",
"0.58507925",
"0.5689952",
"0.5605024",
"0.55725235",
"0.53907055",
"0.53852975",
"0.53072786",
"0.5261338",
"0.5223491",
"0.5170518",
"0.5100215",
"0.5099887",
"0.5041441",
"0.50383514",
"0.50179446",
"0.49991086",
"0.49821562",
"0.4978873",
"0.4952655",
"0.49373344",
"0.4890365",
"0.48492947",
"0.4838272",
"0.48343143",
"0.48293686",
"0.48124224",
"0.4805907",
"0.478549",
"0.47837636",
"0.4776691",
"0.47728816",
"0.47633323",
"0.47468683",
"0.47214758",
"0.4711005",
"0.47077554",
"0.47052473",
"0.4701447",
"0.46915868",
"0.46906516",
"0.4680017",
"0.4672293",
"0.4669225",
"0.46599615",
"0.46514383",
"0.46378058",
"0.46341702",
"0.46198776",
"0.46191642",
"0.4607666",
"0.46019173",
"0.4599872",
"0.45862928",
"0.45814383",
"0.45792365",
"0.4578323",
"0.4576056",
"0.456018",
"0.45425764",
"0.4542026",
"0.4539398",
"0.4535529",
"0.45208433",
"0.45208034",
"0.4518122",
"0.45170563",
"0.45169008",
"0.45126984",
"0.45055893",
"0.45048207",
"0.44974896",
"0.44951943",
"0.44887388",
"0.4483358",
"0.44775355",
"0.44709456",
"0.4466931",
"0.44620463",
"0.44617724",
"0.44598565",
"0.44590333",
"0.44507784",
"0.44455454",
"0.44438428",
"0.44404274",
"0.441169",
"0.4405596",
"0.44052467",
"0.4398705",
"0.43979016",
"0.43974808",
"0.4389891",
"0.4373912",
"0.4373062",
"0.43695956",
"0.4366488",
"0.43534404"
] | 0.55053324 | 7 |
Writes the 64 bits of v to the stream. If the stream uses network byte order, the bytes written, in order, will be: (byte)((v >> 56) & 0xff) (byte)((v >> 48) & 0xff) (byte)((v >> 40) & 0xff) (byte)((v >> 32) & 0xff) (byte)((v >> 24) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 8) & 0xff) (byte)(v & 0xff) Otherwise, the bytes written will be: (byte)(v & 0xff) (byte)((v >> 8) & 0xff) (byte)((v >> 16) & 0xff) (byte)((v >> 24) & 0xff) (byte)((v >> 32) & 0xff) (byte)((v >> 40) & 0xff) (byte)((v >> 48) & 0xff) (byte)((v >> 56) & 0xff) If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeLong(long v) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int writeLong(OutputStream target, long value) throws IOException {\n target.write((byte) (value >>> 56));\n target.write((byte) (value >>> 48));\n target.write((byte) (value >>> 40));\n target.write((byte) (value >>> 32));\n target.write((byte) (value >>> 24));\n target.write((byte) (value >>> 16));\n target.write((byte) (value >>> 8));\n target.write((byte) value);\n return Long.BYTES;\n }",
"public void writeUnsignedByte(int i) throws IOException {\r\n\t\tthis.writeByte(i);\r\n\t\t// this.writeByte((byte) (i % 128));\r\n\t}",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"void writeByte(int v) throws IOException;",
"public void writeLong(long i) throws IOException {\n\t\twriteInt((int) (i >> 32));\n\t\twriteInt((int) i);\n\t}",
"void writeLong(long value);",
"void writeBits(long bits, int numBits) throws IOException;",
"static void encodeInt(DataOutput os, int i) throws IOException {\n if (i >> 28 != 0)\n os.write((i >> 28) & 0x7f);\n if (i >> 21 != 0)\n os.write((i >> 21) & 0x7f);\n if (i >> 14 != 0)\n os.write((i >> 14) & 0x7f);\n if (i >> 7 != 0)\n os.write((i >> 7) & 0x7f);\n os.write((i & 0x7f) | (1 << 7));\n }",
"void writeInt(int v) throws IOException;",
"private void writeInt(DataOutputStream out, int n) throws IOException {\n int result = ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n & 0xFF0000) >> 8) | ((n & 0xFF000000) >> 24);\n out.writeInt(result);\n }",
"public void writeBinary(Base64Variant b64variant, byte[] data, int offset, int len)\n/* */ throws IOException, JsonGenerationException\n/* */ {\n/* 545 */ _verifyValueWrite(\"write a binary value\");\n/* */ \n/* 547 */ if (this._outputTail >= this._outputEnd) {\n/* 548 */ _flushBuffer();\n/* */ }\n/* 550 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* 551 */ _writeBinary(b64variant, data, offset, offset + len);\n/* */ \n/* 553 */ if (this._outputTail >= this._outputEnd) {\n/* 554 */ _flushBuffer();\n/* */ }\n/* 556 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* */ }",
"private static void m17788a(OutputStream outputStream, int i) {\n outputStream.write((i >> 0) & 255);\n outputStream.write((i >> 8) & 255);\n outputStream.write((i >> 16) & 255);\n outputStream.write((i >> 24) & 255);\n }",
"public int writeBinary(Base64Variant b64variant, InputStream data, int dataLength)\n/* */ throws IOException, JsonGenerationException\n/* */ {\n/* 564 */ _verifyValueWrite(\"write a binary value\");\n/* */ \n/* 566 */ if (this._outputTail >= this._outputEnd) {\n/* 567 */ _flushBuffer();\n/* */ }\n/* 569 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* 570 */ byte[] encodingBuffer = this._ioContext.allocBase64Buffer();\n/* */ int bytes;\n/* */ try { int bytes;\n/* 573 */ if (dataLength < 0) {\n/* 574 */ bytes = _writeBinary(b64variant, data, encodingBuffer);\n/* */ } else {\n/* 576 */ int missing = _writeBinary(b64variant, data, encodingBuffer, dataLength);\n/* 577 */ if (missing > 0) {\n/* 578 */ _reportError(\"Too few bytes available: missing \" + missing + \" bytes (out of \" + dataLength + \")\");\n/* */ }\n/* 580 */ bytes = dataLength;\n/* */ }\n/* */ } finally {\n/* 583 */ this._ioContext.releaseBase64Buffer(encodingBuffer);\n/* */ }\n/* */ \n/* 586 */ if (this._outputTail >= this._outputEnd) {\n/* 587 */ _flushBuffer();\n/* */ }\n/* 589 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* 590 */ return bytes;\n/* */ }",
"public StreamWriter write(int value) {\r\n\t\tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n\t\t\t_buffer[2] = (byte) ((value & 0xFF0000) >> 16);\r\n\t\t\t_buffer[3] = (byte) ((value & 0xFF000000) >> 24);\r\n\t\t}else{\r\n\t\t\t_buffer[0] = (byte) (value >> 24);\r\n\t\t\t_buffer[1] = (byte) (value >> 16);\r\n\t\t\t_buffer[2] = (byte) (value >> 8);\r\n\t\t\t_buffer[3] = (byte) value;\r\n\t\t}\r\n\t\t_stream.write(_buffer,0,4);\r\n\t\treturn this;\r\n\t}",
"public static void write4bytes(int value, OutputStream outputStream) throws IOException {\n outputStream.write(value >>> 3 * 8);\n outputStream.write(value >>> 2 * 8 & 255);\n outputStream.write(value >>> 1 * 8 & 255);\n outputStream.write(value & 255);\n }",
"private void write(byte[] data, int pos, int len)\n\t\tthrows IOException\n\t{\n\t\tchar[] chars = BASE64;\n\n\t\tint loc = (len > 0 ? (data[pos] << 24) >>> 8 : 0) |\n\t\t\t(len > 1 ? (data[pos+1] << 24) >>> 16 : 0) |\n\t\t\t(len > 2 ? (data[pos+2] << 24) >>> 24 : 0);\n\n\t\tswitch(len)\n\t\t{\n\t\t\tcase 3:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write(chars[loc & 0x3f]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\twriter.write('=');\n\t\t}\n\t}",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }",
"public static void write(byte[] buffer, long offset, long length , long value) {\n while(length-- > 0){\n buffer[(int) offset++] = (byte) (value & 0xFF);\n value >>=8;\n }\n }",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"public void writeInt(int i) throws IOException {\n\t\twriteByte((byte) (i >> 24));\n\t\twriteByte((byte) (i >> 16));\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"public BinaryEncoder writeLong(long l) throws IOException {\n // Compute the zig-zag value. First double the value and flip the bit if the input is negative.\n long val = (l << 1) ^ (l >> 63);\n\n if ((val & ~0x7f) != 0) {\n output.write((int) (0x80 | val & 0x7f));\n val >>>= 7;\n while (val > 0x7f) {\n output.write((int) (0x80 | val & 0x7f));\n val >>>= 7;\n }\n }\n output.write((int) val);\n\n return this;\n }",
"public void writeInt(int value)\n throws java.io.IOException {\n\n if (isBigEndian) {\n outputStream.writeByte((value >> 24) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte(value & 0xFF);\n } else {\n outputStream.writeByte(value & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 24) & 0xFF);\n }\n }",
"public void write(int b) throws IOException\n\t{\n\t\tout.write(b);\n\t\tmd5.update((byte) (b & 0xff));\n\t}",
"public ByteBuf writeLong(long value)\r\n/* 557: */ {\r\n/* 558:568 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 559:569 */ return super.writeLong(value);\r\n/* 560: */ }",
"protected void _writeBinary(Base64Variant b64variant, byte[] input, int inputPtr, int inputEnd)\n/* */ throws IOException, JsonGenerationException\n/* */ {\n/* 1421 */ int safeInputEnd = inputEnd - 3;\n/* */ \n/* 1423 */ int safeOutputEnd = this._outputEnd - 6;\n/* 1424 */ int chunksBeforeLF = b64variant.getMaxLineLength() >> 2;\n/* */ \n/* */ \n/* 1427 */ while (inputPtr <= safeInputEnd) {\n/* 1428 */ if (this._outputTail > safeOutputEnd) {\n/* 1429 */ _flushBuffer();\n/* */ }\n/* */ \n/* 1432 */ int b24 = input[(inputPtr++)] << 8;\n/* 1433 */ b24 |= input[(inputPtr++)] & 0xFF;\n/* 1434 */ b24 = b24 << 8 | input[(inputPtr++)] & 0xFF;\n/* 1435 */ this._outputTail = b64variant.encodeBase64Chunk(b24, this._outputBuffer, this._outputTail);\n/* 1436 */ chunksBeforeLF--; if (chunksBeforeLF <= 0)\n/* */ {\n/* 1438 */ this._outputBuffer[(this._outputTail++)] = '\\\\';\n/* 1439 */ this._outputBuffer[(this._outputTail++)] = 'n';\n/* 1440 */ chunksBeforeLF = b64variant.getMaxLineLength() >> 2;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1445 */ int inputLeft = inputEnd - inputPtr;\n/* 1446 */ if (inputLeft > 0) {\n/* 1447 */ if (this._outputTail > safeOutputEnd) {\n/* 1448 */ _flushBuffer();\n/* */ }\n/* 1450 */ int b24 = input[(inputPtr++)] << 16;\n/* 1451 */ if (inputLeft == 2) {\n/* 1452 */ b24 |= (input[(inputPtr++)] & 0xFF) << 8;\n/* */ }\n/* 1454 */ this._outputTail = b64variant.encodeBase64Partial(b24, inputLeft, this._outputBuffer, this._outputTail);\n/* */ }\n/* */ }",
"@Override\n\tpublic void serializeTo(DataOutputStream output) throws IOException\n\t{\n\t\toutput.writeLong(value);\n\t}",
"public static void writeBytes(Vector byteVector, DataOutputStream dos) throws IOException {\t\r\n\t\tif(byteVector != null){\r\n\t\t\tdos.writeByte(byteVector.size());\r\n\t\t\tfor(int i=0; i<byteVector.size(); i++ )\r\n\t\t\t\tdos.writeByte(((Byte)byteVector.elementAt(i)).byteValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"@Override\n\tpublic void write(DataOutput dout) throws IOException {\n\t\tdout.writeLong(this.time);\n\t\tdout.writeInt(this.intVal);\n\t}",
"public com.dj.model.avro.LargeObjectAvro.Builder setVar64(java.lang.Integer value) {\n validate(fields()[65], value);\n this.var64 = value;\n fieldSetFlags()[65] = true;\n return this;\n }",
"static void write32( int dword, OutputStream out )\n throws IOException\n {\n out.write( dword );\n out.write( dword >> 8 );\n out.write( dword >> 16 );\n out.write( dword >> 24 );\n }",
"public void write(byte[] data, long offset);",
"private void writeLength(int length) {\n if (length < 128) {\n os.write((byte) length);\n } else if (length < 256) {\n os.write(-127); // 10000001 - 1 byte to follow\n os.write((byte) length);\n } else if (length < 65536) {\n os.write(-126); // 10000010 - 2 bytes to follow\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else if (length < 16777216) {\n os.write(-125); // 10000011 - 3 bytes to follow\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else {\n os.write(-124); // 10000100 - 4 bytes to follow\n os.write((byte) (length >> 24));\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n }\n }",
"@Override\n\tpublic void write(int value) {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\tCpuMem.getInstance().writeMem(address, value);\n\t}",
"public void write(long time, Binary value) {\n timeEncoder.encode(time, timeOut);\n valueEncoder.encode(value, valueOut);\n statistics.update(time, value);\n }",
"public void write(DataOutput out) throws IOException {\n out.writeLong(upFlow);\n out.writeLong(downFlow);\n out.writeLong(sumFlow);\n }",
"void writeShort(int v) throws IOException;",
"long writeValue(V value, int[] version) {\n // the length of the given value plus its header\n int valueLength = valueSerializer.calculateSize(value) + valueOperator.getHeaderSize();\n // The allocated slice is actually the thread's copy moved to point to the newly allocated slice\n Slice slice = memoryManager.allocateSlice(valueLength, MemoryManager.Allocate.VALUE);\n version[0] = slice.getByteBuffer().getInt(slice.getByteBuffer().position());\n // initializing the header lock to be free\n slice.initHeader(valueOperator);\n // since this is a private environment, we can only use ByteBuffer::slice, instead of ByteBuffer::duplicate\n // and then ByteBuffer::slice\n // This is the only place where we create a new object (for the serializer).\n valueSerializer.serialize(value, valueOperator.getValueByteBufferNoHeaderPrivate(slice));\n // combines the blockID with the value's length (including the header)\n int valueBlockAndLength = (slice.getBlockID() << VALUE_BLOCK_SHIFT) | (valueLength & VALUE_LENGTH_MASK);\n return intsToLong(valueBlockAndLength, slice.getByteBuffer().position());\n }",
"public StreamWriter write(short value)\r\n {\r\n \tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n \t}else{\r\n _buffer[0] = (byte)(value >> 8);\r\n _buffer[1] = (byte)value;\r\n \t}\r\n _stream.write(_buffer,0,2);\r\n\t\treturn this;\r\n }",
"public static void writeWithByte(final long address, final long size, final byte value) {\n\t\tUnsafe.get().setMemory(address, size, value);\n\t}",
"public static int OPLWrite(FM_OPL OPL, int a, int v) {\n if ((a & 1) == 0) {\n /* address port */\n\n OPL.address = v & 0xff;\n } else {\n /* data port */\n\n if (OPL.UpdateHandler != null) {\n OPL.UpdateHandler.handler(OPL.UpdateParam, 0);\n }\n OPLWriteReg(OPL, OPL.address, v);\n }\n return (OPL.status >> 7) & 0xFF; //status is uint8\n\n }",
"void write(final OutputStream byteStream, final N source, String encoding) throws IOException, XdmMarshalException;",
"private void writeByteAt(int pos, int val) {\n dest[pos] = (byte) val;\n }",
"void writeByte(byte value);",
"public void writeTo(ByteBuf out) {\n/* 77 */ if (this.value == null) {\n/* */ return;\n/* */ }\n/* 80 */ out.writeByte(this.value.byteValue());\n/* */ }",
"public void encodeBinary(Buf out)\n {\n out.u2(val.length()+1);\n for (int i=0; i<val.length(); ++i)\n out.u1(val.charAt(i));\n out.u1(0);\n }",
"static void write16( int word, OutputStream out )\n throws IOException\n {\n out.write( word );\n out.write( word >> 8 );\n }",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\ttimeInt.write(out);\n\t\tsum.write(out);\n\t\tIp.write(out);\n\t}",
"protected int _writeBinary(Base64Variant b64variant, InputStream data, byte[] readBuffer)\n/* */ throws IOException, JsonGenerationException\n/* */ {\n/* 1523 */ int inputPtr = 0;\n/* 1524 */ int inputEnd = 0;\n/* 1525 */ int lastFullOffset = -3;\n/* 1526 */ int bytesDone = 0;\n/* */ \n/* */ \n/* 1529 */ int safeOutputEnd = this._outputEnd - 6;\n/* 1530 */ int chunksBeforeLF = b64variant.getMaxLineLength() >> 2;\n/* */ \n/* */ for (;;)\n/* */ {\n/* 1534 */ if (inputPtr > lastFullOffset) {\n/* 1535 */ inputEnd = _readMore(data, readBuffer, inputPtr, inputEnd, readBuffer.length);\n/* 1536 */ inputPtr = 0;\n/* 1537 */ if (inputEnd < 3) {\n/* */ break;\n/* */ }\n/* 1540 */ lastFullOffset = inputEnd - 3;\n/* */ }\n/* 1542 */ if (this._outputTail > safeOutputEnd) {\n/* 1543 */ _flushBuffer();\n/* */ }\n/* */ \n/* 1546 */ int b24 = readBuffer[(inputPtr++)] << 8;\n/* 1547 */ b24 |= readBuffer[(inputPtr++)] & 0xFF;\n/* 1548 */ b24 = b24 << 8 | readBuffer[(inputPtr++)] & 0xFF;\n/* 1549 */ bytesDone += 3;\n/* 1550 */ this._outputTail = b64variant.encodeBase64Chunk(b24, this._outputBuffer, this._outputTail);\n/* 1551 */ chunksBeforeLF--; if (chunksBeforeLF <= 0) {\n/* 1552 */ this._outputBuffer[(this._outputTail++)] = '\\\\';\n/* 1553 */ this._outputBuffer[(this._outputTail++)] = 'n';\n/* 1554 */ chunksBeforeLF = b64variant.getMaxLineLength() >> 2;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1559 */ if (inputPtr < inputEnd) {\n/* 1560 */ if (this._outputTail > safeOutputEnd) {\n/* 1561 */ _flushBuffer();\n/* */ }\n/* 1563 */ int b24 = readBuffer[(inputPtr++)] << 16;\n/* 1564 */ int amount = 1;\n/* 1565 */ if (inputPtr < inputEnd) {\n/* 1566 */ b24 |= (readBuffer[inputPtr] & 0xFF) << 8;\n/* 1567 */ amount = 2;\n/* */ }\n/* 1569 */ bytesDone += amount;\n/* 1570 */ this._outputTail = b64variant.encodeBase64Partial(b24, amount, this._outputBuffer, this._outputTail);\n/* */ }\n/* 1572 */ return bytesDone;\n/* */ }",
"@Override\n public long readSInt64() throws IOException {\n long value = decoder.readVarint64();\n return (value >>> 1) ^ -(value & 1);\n }",
"public static byte[] convertLong(long v, boolean isLE)\r\n {\r\n byte[] bytes = new byte[8];\r\n if (isLE)\r\n {\r\n bytes[0] = (byte) (v >>> 0);\r\n bytes[1] = (byte) (v >>> 8);\r\n bytes[2] = (byte) (v >>> 16);\r\n bytes[3] = (byte) (v >>> 24);\r\n bytes[4] = (byte) (v >>> 32);\r\n bytes[5] = (byte) (v >>> 40);\r\n bytes[6] = (byte) (v >>> 48);\r\n bytes[7] = (byte) (v >>> 56);\r\n }\r\n else\r\n {\r\n bytes[0] = (byte) (v >>> 56);\r\n bytes[1] = (byte) (v >>> 48);\r\n bytes[2] = (byte) (v >>> 40);\r\n bytes[3] = (byte) (v >>> 32);\r\n bytes[4] = (byte) (v >>> 24);\r\n bytes[5] = (byte) (v >>> 16);\r\n bytes[6] = (byte) (v >>> 8);\r\n bytes[7] = (byte) (v >>> 0);\r\n }\r\n return bytes;\r\n }",
"public static void write(OutputStream output, byte value) throws IOException {\n output.write(new byte[] { value });\n }",
"public void setVar64(java.lang.Integer value) {\n this.var64 = value;\n }",
"protected int _writeBinary(Base64Variant b64variant, InputStream data, byte[] readBuffer, int bytesLeft)\n/* */ throws IOException, JsonGenerationException\n/* */ {\n/* 1463 */ int inputPtr = 0;\n/* 1464 */ int inputEnd = 0;\n/* 1465 */ int lastFullOffset = -3;\n/* */ \n/* */ \n/* 1468 */ int safeOutputEnd = this._outputEnd - 6;\n/* 1469 */ int chunksBeforeLF = b64variant.getMaxLineLength() >> 2;\n/* */ \n/* 1471 */ while (bytesLeft > 2) {\n/* 1472 */ if (inputPtr > lastFullOffset) {\n/* 1473 */ inputEnd = _readMore(data, readBuffer, inputPtr, inputEnd, bytesLeft);\n/* 1474 */ inputPtr = 0;\n/* 1475 */ if (inputEnd < 3) {\n/* */ break;\n/* */ }\n/* 1478 */ lastFullOffset = inputEnd - 3;\n/* */ }\n/* 1480 */ if (this._outputTail > safeOutputEnd) {\n/* 1481 */ _flushBuffer();\n/* */ }\n/* 1483 */ int b24 = readBuffer[(inputPtr++)] << 8;\n/* 1484 */ b24 |= readBuffer[(inputPtr++)] & 0xFF;\n/* 1485 */ b24 = b24 << 8 | readBuffer[(inputPtr++)] & 0xFF;\n/* 1486 */ bytesLeft -= 3;\n/* 1487 */ this._outputTail = b64variant.encodeBase64Chunk(b24, this._outputBuffer, this._outputTail);\n/* 1488 */ chunksBeforeLF--; if (chunksBeforeLF <= 0) {\n/* 1489 */ this._outputBuffer[(this._outputTail++)] = '\\\\';\n/* 1490 */ this._outputBuffer[(this._outputTail++)] = 'n';\n/* 1491 */ chunksBeforeLF = b64variant.getMaxLineLength() >> 2;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1496 */ if (bytesLeft > 0) {\n/* 1497 */ inputEnd = _readMore(data, readBuffer, inputPtr, inputEnd, bytesLeft);\n/* 1498 */ inputPtr = 0;\n/* 1499 */ if (inputEnd > 0) {\n/* 1500 */ if (this._outputTail > safeOutputEnd) {\n/* 1501 */ _flushBuffer();\n/* */ }\n/* 1503 */ int b24 = readBuffer[(inputPtr++)] << 16;\n/* */ int amount;\n/* 1505 */ int amount; if (inputPtr < inputEnd) {\n/* 1506 */ b24 |= (readBuffer[inputPtr] & 0xFF) << 8;\n/* 1507 */ amount = 2;\n/* */ } else {\n/* 1509 */ amount = 1;\n/* */ }\n/* 1511 */ this._outputTail = b64variant.encodeBase64Partial(b24, amount, this._outputBuffer, this._outputTail);\n/* 1512 */ bytesLeft -= amount;\n/* */ }\n/* */ }\n/* 1515 */ return bytesLeft;\n/* */ }",
"@Override\n public void encode(BigEndianEncoder encoderV)\n {\n encoderV.encodeShort(this.id);\n // then encode the 16-bit flags\n encoderV.encodeShort(this.flag);\n // then encode QCOUNT\n encoderV.encodeShort(this.questionCount);\n // then encode ANCOUNT\n encoderV.encodeShort(this.answerCount);\n // then encode NSCOUNT\n encoderV.encodeShort(this.nameServerCount);\n // then encode ARCOUNT\n encoderV.encodeShort(this.additionalFullRRCount);\n\n\n }",
"void writeBytes(byte[] value);",
"public void write(int b) throws IOException;",
"void bytesRealWriteFlowControl(long write)\r\n/* 179: */ {\r\n/* 180:355 */ this.realWrittenBytes.addAndGet(write);\r\n/* 181: */ }",
"public StreamWriter write(byte value)\r\n {\r\n\t\ttry {\r\n\t\t\t_stream.write(new byte[] { value });\r\n\t\t} catch (IOException ex) {\r\n\t\t}\r\n\t\treturn this;\r\n }",
"@Override\n\t\tprotected byte[] encode(OffsetSnap value) {\n\t\t\tByteBuffer buf = ByteBuffer.allocate(16);\n\t\t\tbuf.putLong(value.offset);\n\t\t\tbuf.putLong(value.snap ^ Long.MIN_VALUE);\n\t\t\treturn buf.array();\n\t\t}",
"public static int writeInt(OutputStream target, int value) throws IOException {\n target.write(value >>> 24);\n target.write(value >>> 16);\n target.write(value >>> 8);\n target.write(value);\n return Integer.BYTES;\n }",
"public ByteBuf writeLongLE(long value)\r\n/* 877: */ {\r\n/* 878:886 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 879:887 */ return super.writeLongLE(value);\r\n/* 880: */ }",
"public Builder setField1664Bytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n field1664_ = value;\n onChanged();\n return this;\n }",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"public static void writeU32(int hClient, int offset, int value,\n\t\t\tNiRioStatus status) {\n//\t\t System.out.print(\"write offset = 0x\");\n//\t\t System.out.print(Long.toString(offset, 16) + \"\");\n//\t\t System.out.print(\"value = \");\n//\t\t System.out.println(Long.toString(((long)value) & 0xFFFFFFFFL, 10));\n\t\tmergeStatus(status,\n\t\t\t\twriteU32Fn.invokeInt(new Object[] { hClient, offset, value }));\n\t}",
"@Override\r\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeUTF(this.url);\r\n\t\tout.writeInt(this.counts);\r\n\t\t\r\n\t}",
"@Override\n protected void serialize(OutputStream os) throws IOException {\n writeInt(os,_gateCounter);\n }",
"void writeBit(int bit) throws IOException;",
"String longWrite();",
"public void write(DataOutputStream out) throws IOException;",
"public static void writeMessageType(OutputStream os, short type) throws IOException {\n os.write((byte)(type & 0xFF));\n os.write((byte)((type >> 8) & 0xFF));\n }",
"public static void write(OutputStream paramOutputStream, ValueMember paramValueMember) {\n/* 153 */ paramOutputStream.write_string(paramValueMember.name);\n/* 154 */ paramOutputStream.write_string(paramValueMember.id);\n/* 155 */ paramOutputStream.write_string(paramValueMember.defined_in);\n/* 156 */ paramOutputStream.write_string(paramValueMember.version);\n/* 157 */ paramOutputStream.write_TypeCode(paramValueMember.type);\n/* 158 */ IDLTypeHelper.write(paramOutputStream, paramValueMember.type_def);\n/* 159 */ paramOutputStream.write_short(paramValueMember.access);\n/* */ }",
"String write(byte[] content, boolean noPin);",
"private static int writeBits(byte[] bytes, int value, int pos, int len) {\n assert(value > 0 && pos + len <= bytes.length * 8);\n int ind = pos / 8;\n int lastPos = 0;\n for (int i = 0; i < len; i++) {\n int bi = (pos + i) % 8;\n if ((value & (1 << (len - i - 1))) != 0) {\n bytes[ind] |= 1 << (7 - bi);\n lastPos = pos + i;\n }\n if (bi == 7) {\n ind++;\n }\n }\n return lastPos;\n }",
"@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}",
"public int writeBytes(InputStream in, int length)\r\n/* 617: */ throws IOException\r\n/* 618: */ {\r\n/* 619:628 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 620:629 */ return super.writeBytes(in, length);\r\n/* 621: */ }",
"protected abstract void write( int value ) throws IOException;",
"public long encode(long value) {\n\n return value ^ (value >> 1);\n }",
"public void mWriteByte(OutputStream oOutputStream,int out) { //Cast the byt to an array\n byte[] out1=new byte[1];\n out1[0]= (byte) out;\n mWriteByte(oOutputStream,out1);\n }",
"public ByteBuf writeByte(int value)\r\n/* 533: */ {\r\n/* 534:544 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 535:545 */ return super.writeByte(value);\r\n/* 536: */ }",
"public void writeThin(StreamOutput out) throws IOException {\n super.writeTo(out);\n out.writeVInt(bytes.length());\n }",
"public void writeByte(int value)\n throws java.io.IOException {\n\n outputStream.writeByte(value);\n }",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"void writeInt(int value);",
"public void writeBits (final int aValue, @Nonnegative final int nNumBits) throws IOException\n {\n ValueEnforcer.isBetweenInclusive (nNumBits, \"NumberOfBits\", 1, CGlobal.BITS_PER_INT);\n\n for (int i = nNumBits - 1; i >= 0; i--)\n writeBit ((aValue >> i) & 1);\n }",
"public void write(long time, long value) {\n timeEncoder.encode(time, timeOut);\n valueEncoder.encode(value, valueOut);\n statistics.update(time, value);\n }",
"public void write(int b) throws IOException\n {\n this.out.write(b); // write the byte b to the Stream\n }",
"public abstract void encode(ByteBuffer buffer, int offset, int value);",
"public int writeByte(byte src) {\n try {\n out.write(src);\n return 0;\n } catch (IOException e) {\n print(\"Error writing byte to \" + portName);\n }\n return -1;\n }",
"void write(final OutputStream byteStream, final N source, final SerializationParams config) throws IOException, XdmMarshalException;",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"public void writePacket(DataOutputStream dataOutputStream) throws IOException;",
"public long readRawVarint64() throws java.io.IOException {\n /*\n r9 = this;\n int r0 = r9.bufferPos\n int r1 = r9.bufferSize\n if (r1 != r0) goto L_0x0008\n goto L_0x00b8\n L_0x0008:\n byte[] r2 = r9.buffer\n int r3 = r0 + 1\n byte r0 = r2[r0]\n if (r0 < 0) goto L_0x0014\n r9.bufferPos = r3\n long r0 = (long) r0\n return r0\n L_0x0014:\n int r1 = r1 - r3\n r4 = 9\n if (r1 >= r4) goto L_0x001b\n goto L_0x00b8\n L_0x001b:\n int r1 = r3 + 1\n byte r3 = r2[r3]\n int r3 = r3 << 7\n r0 = r0 ^ r3\n long r3 = (long) r0\n r5 = 0\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x002f\n r5 = -128(0xffffffffffffff80, double:NaN)\n L_0x002b:\n long r2 = r3 ^ r5\n goto L_0x00bf\n L_0x002f:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n int r1 = r1 << 14\n long r7 = (long) r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0042\n r1 = 16256(0x3f80, double:8.0315E-320)\n L_0x003d:\n long r2 = r3 ^ r1\n r1 = r0\n goto L_0x00bf\n L_0x0042:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n int r0 = r0 << 21\n long r7 = (long) r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x0052\n r5 = -2080896(0xffffffffffe03f80, double:NaN)\n goto L_0x002b\n L_0x0052:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 28\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0063\n r1 = 266354560(0xfe03f80, double:1.315966377E-315)\n goto L_0x003d\n L_0x0063:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n r0 = 35\n long r7 = r7 << r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x0076\n r5 = -34093383808(0xfffffff80fe03f80, double:NaN)\n goto L_0x002b\n L_0x0076:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 42\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 < 0) goto L_0x0089\n r1 = 4363953127296(0x3f80fe03f80, double:2.1560793202584E-311)\n goto L_0x003d\n L_0x0089:\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n r0 = 49\n long r7 = r7 << r0\n long r3 = r3 ^ r7\n int r0 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x009c\n r5 = -558586000294016(0xfffe03f80fe03f80, double:NaN)\n goto L_0x002b\n L_0x009c:\n int r0 = r1 + 1\n byte r1 = r2[r1]\n long r7 = (long) r1\n r1 = 56\n long r7 = r7 << r1\n long r3 = r3 ^ r7\n r7 = 71499008037633920(0xfe03f80fe03f80, double:6.838959413692434E-304)\n long r3 = r3 ^ r7\n int r1 = (r3 > r5 ? 1 : (r3 == r5 ? 0 : -1))\n if (r1 >= 0) goto L_0x00bd\n int r1 = r0 + 1\n byte r0 = r2[r0]\n long r7 = (long) r0\n int r0 = (r7 > r5 ? 1 : (r7 == r5 ? 0 : -1))\n if (r0 >= 0) goto L_0x00be\n L_0x00b8:\n long r0 = r9.readRawVarint64SlowPath()\n return r0\n L_0x00bd:\n r1 = r0\n L_0x00be:\n r2 = r3\n L_0x00bf:\n r9.bufferPos = r1\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.reflect.jvm.internal.impl.protobuf.CodedInputStream.readRawVarint64():long\");\n }",
"public void write(java.io.PrintWriter ps) {\n ps.print(\" \" + versionId\n + \" \" + n_bits\n + \" \" + vector.toBinString()\n + \" \" + delay);\n }",
"private static void writeBinaryData(int id, InputStream data, File f) throws IOException {\n \n XMLOutputFactory factory = XMLOutputFactory.newInstance();\n try {\n XMLStreamWriter writer = factory.createXMLStreamWriter(new FileWriter(f));\n\n writer.writeStartDocument(PlanXMLConstants.ENCODING,\"1.0\");\n writer.writeStartElement(\"data\");\n writer.writeAttribute(\"id\", \"\" + id);\n\n Base64InputStream base64EncodingIn = new Base64InputStream( data, true, PlanXMLConstants.BASE64_LINE_LENGTH, PlanXMLConstants.BASE64_LINE_BREAK);\n \n OutputStream out = new WriterOutputStream(new XMLStreamContentWriter(writer) , PlanXMLConstants.ENCODING);\n // read the binary data and encode it on the fly\n IOUtils.copy(base64EncodingIn, out);\n out.flush();\n \n // all data is written - end \n writer.writeEndElement();\n writer.writeEndDocument();\n\n writer.flush();\n writer.close();\n\n } catch (XMLStreamException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } \n }",
"public void write(long l) {\n while (isFull()) {\n }\n Timing.waitSyncLocal();\n writeEnable.setNow(1);\n writeData.setNow(l);\n Timing.waitClockLocal();\n }",
"public void write(long time, short value) {\n timeEncoder.encode(time, timeOut);\n valueEncoder.encode(value, valueOut);\n statistics.update(time, value);\n }",
"@Override\r\n\tpublic void write(DataOutput out) throws IOException {\n\t\tWritableUtils.writeVInt(out, this.id);\r\n\t}",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"public static int writeLong(byte[] target, int offset, long value) {\n target[offset] = (byte) (value >>> 56);\n target[offset + 1] = (byte) (value >>> 48);\n target[offset + 2] = (byte) (value >>> 40);\n target[offset + 3] = (byte) (value >>> 32);\n target[offset + 4] = (byte) (value >>> 24);\n target[offset + 5] = (byte) (value >>> 16);\n target[offset + 6] = (byte) (value >>> 8);\n target[offset + 7] = (byte) value;\n return Long.BYTES;\n }"
] | [
"0.55184406",
"0.5454888",
"0.540203",
"0.53895545",
"0.53408545",
"0.5301486",
"0.52632254",
"0.5219531",
"0.51500857",
"0.5090051",
"0.50861776",
"0.5082619",
"0.50784415",
"0.5070574",
"0.50615305",
"0.50070554",
"0.49044865",
"0.4899879",
"0.4896854",
"0.4876841",
"0.4867459",
"0.48658472",
"0.48623055",
"0.48581958",
"0.48346815",
"0.48207292",
"0.4820029",
"0.48080695",
"0.48005342",
"0.47984967",
"0.4796434",
"0.47950208",
"0.4788446",
"0.4785421",
"0.47559908",
"0.47543958",
"0.47467178",
"0.4732002",
"0.46797666",
"0.46779385",
"0.4664938",
"0.4661295",
"0.46470952",
"0.46412712",
"0.4639828",
"0.4635028",
"0.463062",
"0.46248636",
"0.4620111",
"0.4608783",
"0.46082458",
"0.46062964",
"0.46017596",
"0.45969072",
"0.45780256",
"0.4563431",
"0.45632115",
"0.45629972",
"0.4556617",
"0.45553786",
"0.45284683",
"0.45279253",
"0.45264032",
"0.4519415",
"0.45131707",
"0.45066997",
"0.4500641",
"0.44998845",
"0.44895464",
"0.44847268",
"0.44726798",
"0.44661057",
"0.4457986",
"0.44570777",
"0.44552666",
"0.44463784",
"0.4445965",
"0.44449556",
"0.44444603",
"0.44398746",
"0.44346517",
"0.44314924",
"0.4421336",
"0.44193333",
"0.4417339",
"0.44103748",
"0.44089016",
"0.4406026",
"0.44021177",
"0.4396942",
"0.43922496",
"0.43840024",
"0.43808043",
"0.43806788",
"0.43739974",
"0.436615",
"0.43562356",
"0.43484512",
"0.4342662",
"0.43379873"
] | 0.59331155 | 0 |
Writes a float value, which is comprised of four bytes, to the output stream. It does this as if it first converts this float value to an int in exactly the manner of the Float.floatToIntBits method and then writes the int value in exactly the manner of the writeInt method. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeFloat(float v) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void writeFloat(float value);",
"public final void writeFloat(final float data, final boolean endianess) throws IOException {\r\n int tmpInt;\r\n\r\n tmpInt = Float.floatToIntBits(data);\r\n writeInt(tmpInt, endianess);\r\n }",
"public ByteBuf writeFloat(float value)\r\n/* 569: */ {\r\n/* 570:580 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 571:581 */ return super.writeFloat(value);\r\n/* 572: */ }",
"protected void writeE(float value)\n\t{\n\t\t_buf.putFloat(value);\n\t}",
"protected void writeFloatArray( DataOutput out, float[] array ) throws IOException {\n\n ByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n DataOutputStream dataOut = new DataOutputStream( byteStream );\n\n dataOut.writeInt( array.length );\n for(int i=0; i<array.length; i++)\n dataOut.writeFloat( array[i] );\n dataOut.close();\n\n out.writeInt( byteStream.size() );\n out.write( byteStream.toByteArray() );\n }",
"void writeFloats(float[] f, int off, int len) throws IOException;",
"public static byte[] writeFloatToBytes(float value) {\n FLOAT_BUFFER.clear();\n FLOAT_BUFFER.putFloat(value);\n return FLOAT_BUFFER.array();\n }",
"public void writeInt(int value)\n throws java.io.IOException {\n\n if (isBigEndian) {\n outputStream.writeByte((value >> 24) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte(value & 0xFF);\n } else {\n outputStream.writeByte(value & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 24) & 0xFF);\n }\n }",
"public void write(float f) {\n write(String.valueOf(f));\n }",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"public static void write4bytes(int value, OutputStream outputStream) throws IOException {\n outputStream.write(value >>> 3 * 8);\n outputStream.write(value >>> 2 * 8 & 255);\n outputStream.write(value >>> 1 * 8 & 255);\n outputStream.write(value & 255);\n }",
"public StreamWriter write(int value) {\r\n\t\tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n\t\t\t_buffer[2] = (byte) ((value & 0xFF0000) >> 16);\r\n\t\t\t_buffer[3] = (byte) ((value & 0xFF000000) >> 24);\r\n\t\t}else{\r\n\t\t\t_buffer[0] = (byte) (value >> 24);\r\n\t\t\t_buffer[1] = (byte) (value >> 16);\r\n\t\t\t_buffer[2] = (byte) (value >> 8);\r\n\t\t\t_buffer[3] = (byte) value;\r\n\t\t}\r\n\t\t_stream.write(_buffer,0,4);\r\n\t\treturn this;\r\n\t}",
"String floatWrite();",
"public static int[] writeFloat(float f, int[] o){\r\n\t\tint[] a = writeFloat(f);\r\n\t\tint[] n = Arrays.copyOf(o, o.length + a.length);\r\n\t\tfor(int i=0;i<a.length;i++){\r\n\t\t\tn[o.length+i] = a[i];\r\n\t\t}\r\n\t\treturn n;\r\n\t}",
"private native void Df1_Write_Float(String plcAddress,float value) throws Df1LibraryNativeException;",
"public void writeByte(int value)\n throws java.io.IOException {\n\n outputStream.writeByte(value);\n }",
"protected void outputFloat(int number) {\r\n if (number == 0) {\r\n buf.write(NUMBERS[0]);\r\n return;\r\n }\r\n final int dec = outputInt(Math.abs(number % 1000));\r\n for (int i = dec; i < 3; ++i) {\r\n buf.write(NUMBERS[0]);\r\n }\r\n buf.write(DOT);\r\n final int floor = number / 1000;\r\n if (floor == 0) {\r\n buf.write(NUMBERS[0]);\r\n if (number < 0) {\r\n buf.write(DASH);\r\n }\r\n } else {\r\n outputInt(floor);\r\n }\r\n }",
"void writeInt(int value);",
"public void writeInt(int i) throws IOException {\n\t\twriteByte((byte) (i >> 24));\n\t\twriteByte((byte) (i >> 16));\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"void writeInt(int v) throws IOException;",
"public void setVal(float val) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 8, val);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 8, val);\n\t\t}\n\t}",
"@Override\n\tpublic void write(DataOutput dout) throws IOException {\n\t\tdout.writeLong(this.time);\n\t\tdout.writeInt(this.intVal);\n\t}",
"private void writeInt(DataOutputStream out, int n) throws IOException {\n int result = ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n & 0xFF0000) >> 8) | ((n & 0xFF000000) >> 24);\n out.writeInt(result);\n }",
"public void writeInt(int i) throws IOException {\n\t\tmBuffer[mBufferLength+3] = (byte) i;\n\t\tmBuffer[mBufferLength+2] = (byte) (i>>>8);\n\t\tmBuffer[mBufferLength+1] = (byte) (i>>>16);\n\t\tmBuffer[mBufferLength] = (byte) (i>>>24);\n\n\n\t\t\n\n\n\t\tmBufferLength += 4;\n\n\t\t// TODO: on the first filling of the buffer, flush when bufferLength+offset is at the end of a segment\n\t\tif (firstFill && ((mBufferLength >= firstFillThreshold))) {\n\t\t\tthis.flush();\n\t\t\tfirstFill = false;\n\t\t}\n\n\t\tif (mBufferLength == BUFFER_SIZE){\n\t\t\tthis.flush();\n\t\t}\n\t}",
"public synchronized void write(final int b) throws IOException {\n\t\tthis.singleIntArray[0] = (byte) (0xFF & b);\n\t\twrite(singleIntArray, 0, 1);\n\t}",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"public void write(int b) throws IOException\n {\n this.out.write(b); // write the byte b to the Stream\n }",
"public void writeData(final DataOutputStream out) throws IOException {\n\t\tout.writeShort(constantValueIndex);\n\t}",
"void writeByte(int v) throws IOException;",
"public void write(int b) throws IOException;",
"protected abstract void write( int value ) throws IOException;",
"@Override\r\n\tpublic Buffer setFloat(int pos, float f) {\n\t\treturn null;\r\n\t}",
"public void write(int ints) {\n try {\n mOutStream.writeInt(ints);\n Log.i(\"TRANSFER\", \"wrote \" + ints);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void write(DataOutput output) throws IOException {\n output.writeShort(this.data);\n }",
"public void write(int pVal) throws IOException {\n mPrintWriter.write(pVal);\n }",
"public ByteBuf setFloat(int index, float value)\r\n/* 307: */ {\r\n/* 308:322 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 309:323 */ return super.setFloat(index, value);\r\n/* 310: */ }",
"public void write( int b ) throws IOException {\n\t\tthis.oneBuf[0] = (byte) b;\n\t\tthis.write( this.oneBuf, 0, 1 );\n\t\t}",
"public final void setBufferFloat(final byte[] buffer, final float data, final int i, final boolean endianess) {\r\n int tmpInt;\r\n\r\n tmpInt = Float.floatToIntBits(data);\r\n setBufferInt(buffer, tmpInt, i, endianess);\r\n }",
"static void encodeInt(DataOutput os, int i) throws IOException {\n if (i >> 28 != 0)\n os.write((i >> 28) & 0x7f);\n if (i >> 21 != 0)\n os.write((i >> 21) & 0x7f);\n if (i >> 14 != 0)\n os.write((i >> 14) & 0x7f);\n if (i >> 7 != 0)\n os.write((i >> 7) & 0x7f);\n os.write((i & 0x7f) | (1 << 7));\n }",
"public void write(DataOutput out) throws IOException {\n\t\t\n\t\tout.writeInt(this.id.length());\n\t\tout.write(this.id.getBytes());\n\t\t\n\t\tout.writeInt(this.sequence.length());\n\t\tout.write(this.sequence.getBytes());\n\t\t\n\t\tfor (Point3d p: this.structure) {\n\t\t\tif (p == null) {\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t} else {\n\t\t\t\tif (p.x*10 > Short.MAX_VALUE || p.y*10 > Short.MAX_VALUE || p.z*10 > Short.MAX_VALUE) {\n\t\t\t\t\tSystem.out.println(\"Overflow\");\n\t\t\t\t}\n\t\t\t\tout.writeShort((short)Math.round(p.x*10));\n\t\t\t\tout.writeShort((short)Math.round(p.y*10));\n\t\t\t\tout.writeShort((short)Math.round(p.z*10));\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n public void write(int value) throws IOException {\r\n super.write(value);\r\n if (!(inWrite1 || inWrite3)) {\r\n /*if (!Helper.NEW_IO_HANDLING && null != IoNotifier.fileNotifier) {\r\n IoNotifier.fileNotifier.notifyWrite(recId, 1);\r\n } else {*/\r\n if (null != RecorderFrontend.instance) {\r\n RecorderFrontend.instance.writeIo(recId, \r\n null, 1, StreamType.FILE);\r\n }\r\n //}\r\n }\r\n }",
"static void write32( int dword, OutputStream out )\n throws IOException\n {\n out.write( dword );\n out.write( dword >> 8 );\n out.write( dword >> 16 );\n out.write( dword >> 24 );\n }",
"@Override\n\tpublic boolean put(Float value) {\n\t\tif (bufferCount < BUFFER_SIZE) {\n\t\t\tbuffer[bufferCount++] = value;\n\t\t} else {\n\t\t\twriteBufferToOCL();\n\t\t\tput(value);\n\t\t}\n\t\treturn true;\n\t}",
"void writeInt(int i) throws IOException;",
"@Override\n\tpublic void write(int value) {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\tCpuMem.getInstance().writeMem(address, value);\n\t}",
"public static int writeInt(OutputStream target, int value) throws IOException {\n target.write(value >>> 24);\n target.write(value >>> 16);\n target.write(value >>> 8);\n target.write(value);\n return Integer.BYTES;\n }",
"public float floatValue() {\r\n return (float) intValue();\r\n }",
"@Override\r\n\t\t\tpublic void write(int b) throws IOException {\n\t\t\t}",
"public void write(int b) throws IOException\n\t{\n\t\tout.write(b);\n\t\tmd5.update((byte) (b & 0xff));\n\t}",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"public void write(int b) throws IOException\n {\n checkThreshold(1);\n getStream().write(b);\n written++;\n }",
"public FloatType asFloat() {\n return TypeFactory.getIntType(toInt(this.getValue())).asFloat();\n }",
"public void writeValue(OutputStream out) throws IOException {\n if (m_strCoding != null) {\n m_strCoding.write(out);\n if (qvalue >= 0.0 && qvalue <= 1.0) {\n BS_QVALUE.write(out);\n out.write(DsByteString.getBytes(Float.toString(qvalue)));\n }\n }\n }",
"public void pushFloat(float aValue)\n\t{\n\t\tif (aValue == 0)\n\t\t{\n\t\t\titsVisitor.visitInsn(Opcodes.FCONST_0);\n\t\t\treturn;\n\t\t}\n\t\telse if (aValue == 1)\n\t\t{\n\t\t\titsVisitor.visitInsn(Opcodes.FCONST_1);\n\t\t\treturn;\n\t\t}\n\t\telse if (aValue == 2)\n\t\t{\n\t\t\titsVisitor.visitInsn(Opcodes.FCONST_2);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\titsVisitor.visitLdcInsn(new Float(aValue));\n\t}",
"public void send(float f) {\r\n\t\tif (s != null) {\r\n\t\t\ttry {\r\n\t\t\t\tdos.writeByte(LiteServer.FLOAT_CONST);\r\n\t\t\t\tdos.writeFloat(f);\r\n\t\t\t\tif (autoFlush) {\r\n\t\t\t\t\tdos.flush();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// if the socket is null\r\n\t\t}\r\n\r\n\t}",
"protected void outputFloat5(final IParserContext context, final int number)\r\n throws IOException {\r\n final double d = (number * 2) / 256.0 / 256.0;\r\n final String string = String.format(Locale.ENGLISH, \"%.5f\", d);\r\n final byte[] out = string.getBytes(charset);\r\n context.getOutputStream().write(out);\r\n }",
"public void write(DataOutput out) throws IOException {\n out.writeLong(upFlow);\n out.writeLong(downFlow);\n out.writeLong(sumFlow);\n }",
"public abstract void save(IntFloatsCol col, DataOutputStream output) throws IOException;",
"public static float toFloat(byte [] bytes, int offset) {\n return Float.intBitsToFloat(toInt(bytes, offset, SIZEOF_INT));\n }",
"public void write(long time, float value) {\n timeEncoder.encode(time, timeOut);\n valueEncoder.encode(value, valueOut);\n statistics.update(time, value);\n }",
"public void write(int b) throws IOException {\n baos.write(b);\n }",
"@Override\n protected void writeFixed(Schema schema, Object datum, Encoder out)\n throws IOException {\n\n final byte[] bytes = ((GenericFixed) datum).bytes();\n GenericBinding.writeFixed(schema, bytes, out);\n }",
"@Override\n\tpublic void writeByte(int b) throws IOException {\n\t\t\n\t}",
"public static float fixedPointIntToFloat4Bit(int intVal) {\n return fixedPointIntToFloatNBits(intVal, 4);\n }",
"public void writeUnsignedByte(int i) throws IOException {\r\n\t\tthis.writeByte(i);\r\n\t\t// this.writeByte((byte) (i % 128));\r\n\t}",
"public void grabarFloat(float x) throws IOException\r\n {\r\n maestro.writeFloat(x); \r\n }",
"@Override\n public void write(int b) {\n try {\n out.write(b);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private static void writeToBuffer(int index, RandomAccessFile fos) {\n\n try {\n\n // x is the current integer value to be written.\n int x;\n // loc is the current location in the buffer to be written.\n int loc = 0;\n\n // iterates through each value in the sorted integer array.\n for (int k = 0; k < index; k++) {\n // gets the current integer.\n x = ints[k];\n\n // checks if the buffer is full.\n if (loc == BUF_SIZE) {\n // if the buffer is full, write its contents out to the file.\n fos.write(buf);\n // the buffer has been emptied, so set its current location back to the start.\n loc = 0;\n }\n\n // convert the current integer value to be written to a byte array.\n buf[loc] = (byte) (x >> 24);\n buf[loc + 1] = (byte) (x >> 16);\n buf[loc + 2] = (byte) (x >> 8);\n buf[loc + 3] = (byte) (x);\n\n // increment the location in the buffer now that a value has been written in.\n loc += BYTES_TO_INTS;\n }\n\n if (loc > 0) {\n // if there are any values left over in the buffer, write them out to the file.\n fos.write(buf, 0, loc);\n\n }\n } catch (IOException e){\n e.printStackTrace();\n }\n }",
"public void write(DataOutputStream out) throws IOException\n {\n getImage().write(out);\n out.writeFloat(getX());\n out.writeFloat(getY());\n out.writeFloat(getRot());\n out.writeFloat(getSclx());\n out.writeFloat(getScly());\n }",
"public void writeToParcel(Parcel out, int flags) {\t\t\r\n\t\tint parameters[] = new int[6];\r\n\t\tparameters[0] = operationType;\r\n\t\tparameters[1] = dataType;\r\n\t\tparameters[2] = calculater;\r\n\t\tparameters[3] = sensorName;\r\n\t\tparameters[4] = valueName;\r\n\t\tparameters[5] = attributeName;\r\n\t\tout.writeIntArray(parameters);\r\n\t\tout.writeFloat(floatConstant);\r\n\t}",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(count);\n\t\tout.writeFloat(avg_stock_price);\n\t}",
"@Override\r\n\tpublic void write(DataOutput out) throws IOException {\n\t\tWritableUtils.writeVInt(out, this.id);\r\n\t}",
"@Override\n public void write(int b) throws IOException {\n byte ib = (byte) b;\n long p = df.position();\n // If not at the end yet,\n if (p < df.size()) {\n // Get the current value,\n byte cur_b = df.get();\n // If the value we are inserting is different,\n if (cur_b != ib) {\n // Reposition and put the new value,\n df.position(p);\n df.put(ib);\n// ++change_count;\n }\n }\n // At the end so write the byte,\n else {\n df.put(ib);\n }\n }",
"public void writeFloatPrefs(String prefName, float prefValue) {\n editor = sPrefs.edit();\n editor.putFloat(prefName, prefValue);\n editor.apply();\n }",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\ttimeInt.write(out);\n\t\tsum.write(out);\n\t\tIp.write(out);\n\t}",
"public float readFloat() throws IOException {\n\n\t\tif (read(bb, 0, 4) < 4) {\n\t\t\tthrow new EOFException();\n\t\t}\n\n\t\tint i = bb[0] << 24 | (bb[1] & 0xFF) << 16 | (bb[2] & 0xFF) << 8\n\t\t\t\t| (bb[3] & 0xFF);\n\t\treturn Float.intBitsToFloat(i);\n\n\t}",
"@Override\n public void writeCompressed(DataOutput out) throws IOException {\n out.writeInt(length);\n out.write(array);\n }",
"public float getFloatValue() {\n \t\treturn floatValue;\n \t}",
"public StreamWriter write(short value)\r\n {\r\n \tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n \t}else{\r\n _buffer[0] = (byte)(value >> 8);\r\n _buffer[1] = (byte)value;\r\n \t}\r\n _stream.write(_buffer,0,2);\r\n\t\treturn this;\r\n }",
"void floatOp(int b) {\n int blength = (byte)OPC.FLOAT_LENGTH_TABLE.charAt(b);\n int bstack = (byte)OPC.FLOAT_STACK_EFFECT_TABLE.charAt(b);\n sp += bstack;\n write(2, \"floatOp\\n\\t\\t\"+Mnemonics.FLOAT_OPCODES[b]);\n }",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"public void write_to_buffer(DataOutputStream out) throws IOException {\r\n //for (int i = 0; i < this.dimension; ++i)\r\n for (int i = 0; i < this.dimension * 2; ++i) {\r\n out.writeFloat(this.data[i]);\r\n }\r\n out.writeFloat(this.distanz);\r\n// out.write(this.PlaceId.getBytes());\r\n out.writeInt(this.getPlaceId());\r\n// System.out.println(\"heheheh +::\" + this.PlaceId.length);\r\n out.writeDouble(this.location[0]);\r\n out.writeDouble(this.location[1]);\r\n// System.out.println(\"heheheh +::\" +this.PlaceId.getBytes().length);\r\n }",
"private static float intToFloat(int x) {\n\t\treturn Float.intBitsToFloat(x);\n\t}",
"public final void writeInt(final int data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer4[0] = (byte) (data >>> 24);\r\n byteBuffer4[1] = (byte) (data >>> 16);\r\n byteBuffer4[2] = (byte) (data >>> 8);\r\n byteBuffer4[3] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer4[0] = (byte) (data & 0xff);\r\n byteBuffer4[1] = (byte) (data >>> 8);\r\n byteBuffer4[2] = (byte) (data >>> 16);\r\n byteBuffer4[3] = (byte) (data >>> 24);\r\n }\r\n\r\n raFile.write(byteBuffer4);\r\n }",
"public float unpackFloat() {\n return buffer.getFloat();\n }",
"@Override\n\tpublic void serializeTo(DataOutputStream output) throws IOException\n\t{\n\t\toutput.writeLong(value);\n\t}",
"void setFloat(int index, float value) throws SQLException;",
"public void writeTo(ByteBuf out) {\n/* 77 */ if (this.value == null) {\n/* */ return;\n/* */ }\n/* 80 */ out.writeByte(this.value.byteValue());\n/* */ }",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"void writeShort(int v) throws IOException;",
"@Override\r\n\tpublic float getFloat(int pos) {\n\t\treturn buffer.getFloat(pos);\r\n\t}",
"public float floatValue() {\n return (float) value;\n }",
"public byte[] readRawFloat() throws IOException {\n byte[] bytes = new byte[5];\n bytes[0] = (byte) Type.FLOAT.code;\n in.readFully(bytes, 1, 4);\n return bytes;\n }",
"private void encodeAbstractFloatDataType(Encoder encoder, DataType type) throws IOException {\n\t\tencoder.openElement(ELEM_TYPE);\n\t\tencodeNameIdAttributes(encoder, type);\n\t\tencoder.writeString(ATTRIB_METATYPE, \"float\");\n\t\tencoder.writeSignedInteger(ATTRIB_SIZE, type.getLength());\n\t\tencoder.closeElement(ELEM_TYPE);\n\t}",
"public int getByte(float f) {\n if (_dirty)\n update();\n if (f<_flower) f = _flower;\n if (f>_fupper) f = _fupper;\n return (int)((f-_flower)*_fscale);\n }",
"public void setFloatValue(float value) {\n setValueIndex(getPool().findFloatEntry(value, true));\n }",
"public float floatValue() {\n return this.value;\n }"
] | [
"0.73398453",
"0.7012958",
"0.6432672",
"0.6337711",
"0.6285568",
"0.62701005",
"0.62375885",
"0.61793435",
"0.6131607",
"0.5992906",
"0.5888732",
"0.58779943",
"0.5871109",
"0.58593994",
"0.58564246",
"0.57921",
"0.5705956",
"0.57004654",
"0.5681236",
"0.5664991",
"0.5655755",
"0.54904",
"0.5477079",
"0.54663205",
"0.5416036",
"0.5412921",
"0.5375692",
"0.5369583",
"0.5350845",
"0.53247535",
"0.5318121",
"0.53171617",
"0.53169525",
"0.531508",
"0.5298099",
"0.5293314",
"0.52376086",
"0.5210472",
"0.52032614",
"0.5201487",
"0.5191639",
"0.5187222",
"0.51778036",
"0.517348",
"0.5153658",
"0.514267",
"0.5141993",
"0.5123008",
"0.51201826",
"0.51151395",
"0.51008075",
"0.509903",
"0.50979835",
"0.50965255",
"0.50960183",
"0.5089294",
"0.5080656",
"0.507212",
"0.5071776",
"0.5068985",
"0.5044141",
"0.50384843",
"0.50207114",
"0.5020504",
"0.5020337",
"0.501051",
"0.5008787",
"0.4965417",
"0.49500296",
"0.4942818",
"0.49422348",
"0.49383405",
"0.49347126",
"0.49206534",
"0.49199885",
"0.49180955",
"0.4910963",
"0.49097064",
"0.48785082",
"0.48754603",
"0.48671716",
"0.48588786",
"0.48588786",
"0.48577982",
"0.4837621",
"0.48316056",
"0.4822379",
"0.4817168",
"0.48141602",
"0.48068675",
"0.48008955",
"0.47872692",
"0.47831666",
"0.4779558",
"0.4771695",
"0.47581643",
"0.47519326",
"0.4750582",
"0.47390708",
"0.47383577"
] | 0.72547483 | 1 |
Writes a double value, which is comprised of four bytes, to the output stream. It does this as if it first converts this double value to an long in exactly the manner of the Double.doubleToLongBits method and then writes the long value in exactly the manner of the writeLong method. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeDouble(double v) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final void writeDouble(final double data, final boolean endianess) throws IOException {\r\n\r\n long tmpLong;\r\n\r\n tmpLong = Double.doubleToLongBits(data);\r\n writeLong(tmpLong, endianess);\r\n }",
"void writeDouble(double value);",
"public abstract void writeAsDbl(int offset, double d);",
"public ByteBuf writeDouble(double value)\r\n/* 575: */ {\r\n/* 576:586 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 577:587 */ return super.writeDouble(value);\r\n/* 578: */ }",
"void writeDoubles(double[] d, int off, int len) throws IOException;",
"protected void writeDoubleArray( DataOutput out, double[] array ) throws IOException {\n\n ByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n DataOutputStream dataOut = new DataOutputStream( byteStream );\n\n dataOut.writeInt( array.length );\n for(int i=0; i<array.length; i++)\n dataOut.writeDouble( array[i] );\n dataOut.close();\n\n out.writeInt( byteStream.size() );\n out.write( byteStream.toByteArray() );\n }",
"double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }",
"private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}",
"public static byte [] toBytes(final double d) {\n // Encode it as a long\n return Bytes.toBytes(Double.doubleToRawLongBits(d));\n }",
"public abstract void save(LongDoublesCol col, DataOutputStream output) throws IOException;",
"public void write(long time, double value) {\n timeEncoder.encode(time, timeOut);\n valueEncoder.encode(value, valueOut);\n statistics.update(time, value);\n }",
"public ByteBuf setDouble(int index, double value)\r\n/* 313: */ {\r\n/* 314:328 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 315:329 */ return super.setDouble(index, value);\r\n/* 316: */ }",
"String doubleWrite();",
"void writeLong(long value);",
"private void serializeDouble(final double number, final StringBuffer buffer)\n {\n buffer.append(\"d:\");\n buffer.append(number);\n buffer.append(';');\n }",
"public final double getDouble(final boolean endianess) throws IOException {\r\n b1 = (tagBuffer[bPtr] & 0xff);\r\n b2 = (tagBuffer[bPtr + 1] & 0xff);\r\n b3 = (tagBuffer[bPtr + 2] & 0xff);\r\n b4 = (tagBuffer[bPtr + 3] & 0xff);\r\n b5 = (tagBuffer[bPtr + 4] & 0xff);\r\n b6 = (tagBuffer[bPtr + 5] & 0xff);\r\n b7 = (tagBuffer[bPtr + 6] & 0xff);\r\n b8 = (tagBuffer[bPtr + 7] & 0xff);\r\n\r\n long tmpLong;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n tmpLong = ( ((long) b1 << 56) | ((long) b2 << 48) | ((long) b3 << 40) | ((long) b4 << 32)\r\n | ((long) b5 << 24) | ((long) b6 << 16) | ((long) b7 << 8) | b8);\r\n } else {\r\n tmpLong = ( ((long) b8 << 56) | ((long) b7 << 48) | ((long) b6 << 40) | ((long) b5 << 32)\r\n | ((long) b4 << 24) | ((long) b3 << 16) | ((long) b2 << 8) | b1);\r\n }\r\n\r\n bPtr += 8;\r\n\r\n return (Double.longBitsToDouble(tmpLong));\r\n\r\n }",
"public static long doubleToLongBits(double value)\n {\n long result = Double.doubleToRawLongBits(value);\n // Check for NaN based on values of bit fields, maximum\n // exponent and nonzero significand.\n if (((result & DOUBLE_EXP_BIT_MASK) == DOUBLE_EXP_BIT_MASK)\n && (result & DOUBLE_SIGNIF_BIT_MASK) != 0L)\n result = 0x7ff8000000000000L;\n return result;\n }",
"void writeLong(long v) throws IOException;",
"@Override\n\tpublic void serializeTo(DataOutputStream output) throws IOException\n\t{\n\t\toutput.writeLong(value);\n\t}",
"double readDouble() throws IOException;",
"@Override\r\n\tpublic Buffer setDouble(int pos, double d) {\n\t\treturn null;\r\n\t}",
"private static String DoubleToBinaryString(double data){\n long longData = Double.doubleToLongBits(data);\n //A long is 64-bit\n return String.format(\"%64s\", Long.toBinaryString(longData)).replace(' ', '0');\n }",
"public abstract double readAsDbl(int offset);",
"public static long doubleToLong(double d) {\n return new Long(String.format(\"%.0f\", d)).longValue();\n }",
"public double nextDouble() {\n long x = (nextLong() >>> LONG_TO_DOUBLE_SHIFT) | LONG_TO_DOUBLE_MASK;\n return Double.longBitsToDouble(x) - 1.0;\n }",
"public double readDouble() throws IOException {\n\n\t\tif (read(bb, 0, 8) < 8) {\n\t\t\tthrow new EOFException();\n\t\t}\n\n\t\tint i1 = bb[0] << 24 | (bb[1] & 0xFF) << 16 | (bb[2] & 0xFF) << 8\n\t\t\t\t| (bb[3] & 0xFF);\n\t\tint i2 = bb[4] << 24 | (bb[5] & 0xFF) << 16 | (bb[6] & 0xFF) << 8\n\t\t\t\t| (bb[7] & 0xFF);\n\n\t\treturn Double.longBitsToDouble(((long) i1) << 32\n\t\t\t\t| ((long) i2 & 0x00000000ffffffffL));\n\t}",
"private final double get_DOUBLE(int column) {\n if (metadata.isZos()) {\n byte[] bytes = new byte[8];\n dataBuffer_.getBytes(columnDataPosition_[column - 1], bytes);\n return FloatingPoint.getDouble_hex(bytes, 0);\n //return dataBuffer_.getDouble(columnDataPosition_[column - 1]);\n } else {\n return dataBuffer_.getDoubleLE(columnDataPosition_[column - 1]);\n// return FloatingPoint.getDouble(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }\n }",
"public double unpackDouble() {\n return buffer.getDouble();\n }",
"public int maDBCursorGetColumnDouble(\n \t\tint cursorHandle,\n \t\tint columnIndex,\n \t\tint doubleValueAddress,\n \t\tMoSyncThread mosync)\n \t{\n \t\tif (!hasCursor(cursorHandle))\n \t\t{\n \t\t\treturn MA_DB_ERROR;\n \t\t}\n \n \t\ttry\n \t\t{\n \t\t\t// Check for NULL value.\n \t\t\tif (getCursor(cursorHandle).isNull(columnIndex))\n \t\t\t{\n \t\t\t\treturn MA_DB_NULL;\n \t\t\t}\n \n \t\t\t// Get data as a float value.\n \t\t\tdouble value = getCursor(cursorHandle).getDouble(columnIndex);\n \n\t\t\t// Write to MoSync memory. Size of a double is 8 - take care of endianess\n \t\t\t// TODO: Replace with high-level call to write double.\n\t\t\tByteBuffer buffer = mosync.getMemorySlice(doubleValueAddress, 8).order(null);\n \t\t\tbuffer.putLong(Double.doubleToLongBits(value));\n \n \t\t\treturn MA_DB_OK;\n \t\t}\n \t\tcatch (CursorIndexOutOfBoundsException ex1)\n \t\t{\n \t\t\tlogStackTrace(ex1);\n \t\t}\n \t\tcatch (SQLException ex2)\n \t\t{\n \t\t\tlogStackTrace(ex2);\n \t\t}\n \n \t\treturn MA_DB_ERROR;\n \t}",
"public void writeLong(long i) throws IOException {\n\t\twriteInt((int) (i >> 32));\n\t\twriteInt((int) i);\n\t}",
"public void setDoubleValue(double v)\n {\n this.setValue(String.valueOf(v));\n }",
"@Override\n\tpublic void write(DataOutput dout) throws IOException {\n\t\tdout.writeLong(this.time);\n\t\tdout.writeInt(this.intVal);\n\t}",
"public abstract void save(IntDoublesCol col, DataOutputStream output) throws IOException;",
"public byte[] readRawDouble() throws IOException {\n byte[] bytes = new byte[9];\n bytes[0] = (byte) Type.DOUBLE.code;\n in.readFully(bytes, 1, 8);\n return bytes;\n }",
"@SuppressWarnings(\"unchecked\")\r\n public static void writeDoubleToObjectArray(final Storage theStorage,\r\n final Field<?, ?>[] theFieldArray, final Object[] theValues) {\r\n\r\n for (int i = 0; i < theFieldArray.length; i++) {\r\n final DoubleField<?, ?> theField = (DoubleField<?, ?>) theFieldArray[i];\r\n if (theField != null) {\r\n final DoubleConverter<Object> converter = (DoubleConverter<Object>) theField\r\n .converter();\r\n final double dval = converter.fromObject(theValues[i]);\r\n theStorage.write(theField, dval);\r\n }\r\n }\r\n }",
"public synchronized static void write(double[] xxx,String fileName){\n\t\ttry{\n\t\t \tFileOutputStream fos = new FileOutputStream(fileName);\n\t\t \tDataOutputStream dos = new DataOutputStream(fos);\n\t\t\t\n\t\t\tfor(double x:xxx)\n\t\t\t\tdos.writeDouble(x);\n\t\t\tdos.close();\n\t\t\tfos.close();\n\t\t}catch(Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t}",
"public final double nextDouble() {\n return ((state = (state << 29 | state >>> 35) * 0xAC564B05L) * 0x818102004182A025L & 0x1fffffffffffffL) * 0x1p-53;\n }",
"public void setDoubleValue(double value) {\n setValueIndex(getPool().findDoubleEntry(value, true));\n }",
"public void setIOPortDoubleWord(int portAddress, byte[] dataDoubleWord)\n {\n return;\n }",
"public BinaryDouble(double value) {\n\t\tthis.value = value;\n\t}",
"public static double swap(double dValue)\n\t{\n\t\treturn Double.longBitsToDouble(swap(Double.doubleToLongBits(dValue)));\n\t}",
"public native double __doubleMethod( long __swiftObject, double arg );",
"void setDouble(int index, double value) throws SQLException;",
"public double doubleValue() {\n\t\treturn mDouble;\n\t}",
"public double readDouble() throws IOException {\n return in.readDouble();\n }",
"public void write(DataOutput out) throws IOException {\n\t\t\n\t\tout.writeInt(this.id.length());\n\t\tout.write(this.id.getBytes());\n\t\t\n\t\tout.writeInt(this.sequence.length());\n\t\tout.write(this.sequence.getBytes());\n\t\t\n\t\tfor (Point3d p: this.structure) {\n\t\t\tif (p == null) {\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t} else {\n\t\t\t\tif (p.x*10 > Short.MAX_VALUE || p.y*10 > Short.MAX_VALUE || p.z*10 > Short.MAX_VALUE) {\n\t\t\t\t\tSystem.out.println(\"Overflow\");\n\t\t\t\t}\n\t\t\t\tout.writeShort((short)Math.round(p.x*10));\n\t\t\t\tout.writeShort((short)Math.round(p.y*10));\n\t\t\t\tout.writeShort((short)Math.round(p.z*10));\n\t\t\t}\n\t\t}\n\t}",
"public void send(double d) {\r\n\t\tif (s != null) {\r\n\t\t\ttry {\r\n\t\t\t\tdos.writeByte(LiteServer.DOUBLE_CONST);\r\n\t\t\t\tdos.writeDouble(d);\r\n\t\t\t\tif (autoFlush) {\r\n\t\t\t\t\tdos.flush();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// if the socket is null\r\n\t\t}\r\n\r\n\t}",
"public static double longToDouble(long l) {\n return (double) l;\n }",
"public void setDoubleValue(double doubleValueIn) {\n\t\tthis.doubleValue = doubleValueIn;\n\t}",
"public double getDoubleValue() {\n\t\treturn value;\r\n\t}",
"public void testDoubleValue() {\n AtomicLong ai = new AtomicLong();\n assertEquals(0.0d, ai.doubleValue());\n for (long x : VALUES) {\n ai.set(x);\n assertEquals((double)x, ai.doubleValue());\n }\n }",
"public static void setDouble(String prop, double value)\n {\n props.setProperty(prop, \"\" + value);\n }",
"public static double bitsToBytes(double num) { return (num/8); }",
"public static int writeLong(OutputStream target, long value) throws IOException {\n target.write((byte) (value >>> 56));\n target.write((byte) (value >>> 48));\n target.write((byte) (value >>> 40));\n target.write((byte) (value >>> 32));\n target.write((byte) (value >>> 24));\n target.write((byte) (value >>> 16));\n target.write((byte) (value >>> 8));\n target.write((byte) value);\n return Long.BYTES;\n }",
"public DoubleValue(int n) {\n\t\ttimesToWrite = n;\n\t}",
"public static boolean setDoubleValue(String propID, double v)\n {\n return SystemProps.setStringValue(propID, String.valueOf(v));\n }",
"@Override\n public void serialize(Double value, JsonGenerator jgen, SerializerProvider provider) throws IOException {\n BigDecimal bd = new BigDecimal(value);\n bd = bd.setScale(1, RoundingMode.HALF_UP);\n jgen.writeNumber(bd.doubleValue());\n }",
"public double getDoubleValue() {\n if (getValueIndex() <= 0)\n return 0D;\n return ((DoubleEntry) getPool().getEntry(getValueIndex())).getValue();\n }",
"static public void writeVectorArray(PrintWriter writer, double[] vector) {\r\n writer.println(vector.length);\r\n for (double v : vector) {\r\n writer.println(Double.toString(v));\r\n }\r\n }",
"@Override\r\n\tpublic double getDouble(int pos) {\n\t\treturn buffer.getDouble(pos);\r\n\t}",
"@Override\n protected void writeFixed(Schema schema, Object datum, Encoder out)\n throws IOException {\n\n final byte[] bytes = ((GenericFixed) datum).bytes();\n GenericBinding.writeFixed(schema, bytes, out);\n }",
"public final void writeLong(final long data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer8[0] = (byte) (data >>> 56);\r\n byteBuffer8[1] = (byte) (data >>> 48);\r\n byteBuffer8[2] = (byte) (data >>> 40);\r\n byteBuffer8[3] = (byte) (data >>> 32);\r\n byteBuffer8[4] = (byte) (data >>> 24);\r\n byteBuffer8[5] = (byte) (data >>> 16);\r\n byteBuffer8[6] = (byte) (data >>> 8);\r\n byteBuffer8[7] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer8[0] = (byte) (data & 0xff);\r\n byteBuffer8[1] = (byte) (data >>> 8);\r\n byteBuffer8[2] = (byte) (data >>> 16);\r\n byteBuffer8[3] = (byte) (data >>> 24);\r\n byteBuffer8[4] = (byte) (data >>> 32);\r\n byteBuffer8[5] = (byte) (data >>> 40);\r\n byteBuffer8[6] = (byte) (data >>> 48);\r\n byteBuffer8[7] = (byte) (data >>> 56);\r\n }\r\n\r\n raFile.write(byteBuffer8);\r\n }",
"public byte[] serialize(Double object, TypeOptions options) {\n\t\treturn null;\n\t}",
"public void write_to_buffer(DataOutputStream out) throws IOException {\r\n //for (int i = 0; i < this.dimension; ++i)\r\n for (int i = 0; i < this.dimension * 2; ++i) {\r\n out.writeFloat(this.data[i]);\r\n }\r\n out.writeFloat(this.distanz);\r\n// out.write(this.PlaceId.getBytes());\r\n out.writeInt(this.getPlaceId());\r\n// System.out.println(\"heheheh +::\" + this.PlaceId.length);\r\n out.writeDouble(this.location[0]);\r\n out.writeDouble(this.location[1]);\r\n// System.out.println(\"heheheh +::\" +this.PlaceId.getBytes().length);\r\n }",
"public double getDouble(int columnIndex) throws SQLException\n {\n return m_rs.getDouble(columnIndex);\n }",
"public ByteBuf writeLong(long value)\r\n/* 557: */ {\r\n/* 558:568 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 559:569 */ return super.writeLong(value);\r\n/* 560: */ }",
"public void putDouble(String key, double value) {\n String doubleAsString = Double.toString(value);\n\n put(key, doubleAsString);\n }",
"public void write(long[] timestamps, double[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"public void updateDouble(int columnIndex, double x) throws SQLException {\n\n try {\n if (isDebugEnabled()) {\n debugCode(\"updateDouble(\" + columnIndex + \", \" + x + \"d);\");\n }\n update(columnIndex, ValueDouble.get(x));\n }\n catch (Exception e) {\n throw logAndConvert(e);\n }\n }",
"public void updateDouble(int columnIndex, double x) throws SQLException\n {\n m_rs.updateDouble(columnIndex, x);\n }",
"public double doubleValue() {\n return (double) value;\n }",
"public double getDouble() {\r\n\t\treturn (value.getDouble());\r\n\t}",
"public void pushDouble (double aValue)\n\t{\n\t\tif (aValue == 0)\n\t\t{\n\t\t\titsVisitor.visitInsn(Opcodes.DCONST_0);\n\t\t\treturn;\n\t\t}\n\t\telse if (aValue == 1)\n\t\t{\n\t\t\titsVisitor.visitInsn(Opcodes.DCONST_1);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\titsVisitor.visitLdcInsn(new Double(aValue));\n\t}",
"public void setDoubleValue(double newDouble) {\n\t\tmDouble = newDouble;\n\t}",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default double asDouble() {\n \n return notSupportedCast(BasicTypeID.DOUBLE);\n }",
"@Override\n public void writeTo(DataOutput dout) throws IOException {\n\n if (!isHeadless()) {\n dout.writeShort(getTransactionID());\n dout.writeShort(getProtocolID());\n dout.writeShort(getDataLength());\n }\n dout.writeByte(getUnitID());\n dout.writeByte(getFunctionCode());\n writeData(dout);\n }",
"String longWrite();",
"public static void fieldSetDouble(final Class<?> cls, final String name,\r\n final Object inst, final double value) throws SecurityException,\r\n NoSuchFieldException, IllegalArgumentException, IllegalAccessException {\r\n final Field field = jvmGetField(cls, name);\r\n field.setDouble(inst, value);\r\n }",
"String floatWrite();",
"@Override\n public void onChanged(Double aDouble) {\n if (aDouble*1000 < 1) {\n etOutputValue.setText(\"0.0\");\n } else {\n DecimalFormat decimalFormat = new DecimalFormat(\"#,##0.###\");\n etOutputValue.setText(decimalFormat.format(aDouble));\n }\n }",
"public abstract void read_double_array(double[] value, int offset, int\nlength);",
"public double getDouble();",
"public double doubleValue() {\r\n return (double) intValue();\r\n }",
"static void write32( int dword, OutputStream out )\n throws IOException\n {\n out.write( dword );\n out.write( dword >> 8 );\n out.write( dword >> 16 );\n out.write( dword >> 24 );\n }",
"public long longValue() {\n\t\treturn (long) mDouble;\n\t}",
"public double readDouble()\r\n/* 453: */ {\r\n/* 454:466 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 455:467 */ return super.readDouble();\r\n/* 456: */ }",
"public Double getDouble(double defaultVal) {\n return get(ContentType.DoubleType, defaultVal);\n }",
"@Override\n\tpublic double readScalarDouble() throws IOException {\n\t\treturn 0;\n\t}",
"public void addDouble(String name, double value) {\n DOUBLES.add(new SimpleMessageObjectDoubleItem(name, value));\n }",
"public int read(double[] d, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\n\t\t\t\tif (count - pos < 8) {\n\t\t\t\t\tfillBuf(8);\n\t\t\t\t}\n\t\t\t\tint i1 = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tint i2 = buf[pos + 4] << 24 | (buf[pos + 5] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 6] & 0xFF) << 8 | (buf[pos + 7] & 0xFF);\n\t\t\t\td[i] = Double.longBitsToDouble(((long) i1) << 32\n\t\t\t\t\t\t| ((long) i2 & 0x00000000FFFFFFFFL));\n\t\t\t\tpos += 8;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 8);\n\t\t}\n\t\treturn 8 * len;\n\t}",
"private void appendOutputValue(Tuple tuple, double value, boolean enablePrecision) {\n if(enablePrecision) {\n switch(this.getPrecisionType()) {\n case FLOAT7:\n tuple.append(DECIMAL_FORMAT.format(value));\n break;\n case FLOAT16:\n tuple.append(toFloat(fromFloat((float) value)));\n break;\n case DOUBLE64:\n tuple.append(value);\n break;\n case FLOAT32:\n default:\n tuple.append((float) value);\n break;\n }\n } else {\n tuple.append((float) value);\n }\n }",
"public void setDoubleValue(double v)\n {\n if ((v + dblExtent) > dblMaximum)\n {\n v = dblMaximum - dblExtent;\n }\n if (v < dblMinimum)\n {\n v = dblMinimum;\n }\n double dblValue = v;\n setValue((int) (dblValue * multiplier));\n }",
"public double doubleValue() {\n return (double) m_value;\n }",
"public DoubleField(double value) {\n\t\tthis(\"\" + value, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);\n\t}",
"public void writeData(final DataOutputStream out) throws IOException {\n\t\tout.writeShort(constantValueIndex);\n\t}",
"public void writeValue(OutputStream out) throws IOException {\n if (m_strCoding != null) {\n m_strCoding.write(out);\n if (qvalue >= 0.0 && qvalue <= 1.0) {\n BS_QVALUE.write(out);\n out.write(DsByteString.getBytes(Float.toString(qvalue)));\n }\n }\n }",
"double readDouble();",
"public com.dj.model.avro.LargeObjectAvro.Builder setVar4(java.lang.Double value) {\n validate(fields()[5], value);\n this.var4 = value;\n fieldSetFlags()[5] = true;\n return this;\n }",
"@Test\n public void decodeDouble()\n {\n final double[] array = new double[4];\n array[0] = 0;\n array[1] = 0;\n array[2] = 1;\n array[3] = 1;\n\n final BinaryEncoder encoder = new BinaryEncoder(16);\n assertEquals(3.0, encoder.decode(array), 0.0);\n }",
"public static double toDouble(BitSet bits, int numberOfBits, double MAX_VALUE, double MIN_VALUE) {\n int numberOfSteps;\n double stepSize;\n stepSize = (MAX_VALUE - MIN_VALUE) / Math.pow(2, numberOfBits);\n numberOfSteps = toInteger(bits);\n return MIN_VALUE + (stepSize / 2) + numberOfSteps * stepSize;\n }"
] | [
"0.7566525",
"0.7550758",
"0.7226738",
"0.7132784",
"0.7004911",
"0.6585944",
"0.61468357",
"0.5894116",
"0.58660734",
"0.5832804",
"0.5830319",
"0.5766413",
"0.56923723",
"0.5684898",
"0.5667564",
"0.5630539",
"0.56275976",
"0.55487466",
"0.5528421",
"0.5524617",
"0.5514018",
"0.54430336",
"0.5441332",
"0.5428171",
"0.5420939",
"0.54091",
"0.54079634",
"0.5296787",
"0.5281144",
"0.5258935",
"0.5217952",
"0.5214709",
"0.51706904",
"0.51674515",
"0.51356804",
"0.5103097",
"0.5077537",
"0.50730675",
"0.50458246",
"0.5043029",
"0.5015107",
"0.5002934",
"0.49910152",
"0.499079",
"0.49757752",
"0.49681696",
"0.49598402",
"0.49528727",
"0.49518695",
"0.49288708",
"0.4910217",
"0.4906256",
"0.48889628",
"0.4877876",
"0.48580134",
"0.48292327",
"0.48265898",
"0.48204675",
"0.4817158",
"0.4815926",
"0.4812029",
"0.48093188",
"0.48088968",
"0.48031643",
"0.47942463",
"0.47874135",
"0.47839004",
"0.4782761",
"0.4781103",
"0.47729397",
"0.4764601",
"0.4757501",
"0.4754391",
"0.475116",
"0.47427696",
"0.4734082",
"0.47316682",
"0.4729509",
"0.47250903",
"0.47222182",
"0.47163317",
"0.47127885",
"0.47116998",
"0.47095546",
"0.47060895",
"0.470468",
"0.47021046",
"0.47008458",
"0.46993762",
"0.4698806",
"0.46957955",
"0.4690003",
"0.46888086",
"0.4688645",
"0.46871307",
"0.46865475",
"0.46832594",
"0.4681448",
"0.46800235",
"0.46784237"
] | 0.7557093 | 1 |
Writes a string to the output stream. For every character in the string s, taken in order, one byte is written to the output stream. If s is null, a NullPointerException is thrown. If s.length is zero, then no bytes are written. Otherwise, the character s[0] is written first, then s[1], and so on; the last character written is s[s.length1]. For each character, one byte is written, the loworder byte, in exactly the manner of the writeByte method. The highorder eight bits of each character in the string are ignored. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeBytes(String s) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void write(String s){\n\t\tint length = s.length();\n\t\tchar[] chars = new char[length];\n\t\ts.getChars(0, length, chars, 0);\n\t\twrite(chars, 0, length);\n\t}",
"public void write(String s) throws IOException {\n\t\tif (s != null && s.length() > 0) {\n\t\t\tfos.write(s.getBytes());\n\t\t}\n\t}",
"protected final void write(String s) throws IOException {\n\t\toutput.write(s);\n\t}",
"public void writeString(final String s) throws IOException {\n checkOpened();\n dos.writeUTF(s);\n flush();\n }",
"protected static void writeString(final String s, final DataOutputStream d) throws IOException {\n\t\tif (s == null) {\n\t\t\td.writeShort(-1);\n\t\t} else {\n\t\t\td.writeShort(s.length());\n\t\t\td.write(s.getBytes());\n\t\t\td.writeByte(0);\n\t\t}\n\t}",
"private void write(String s) {\n _writer.print(s);\n _writer.flush(); // This is need to actually write the data.\n\n _index += s.length();\n }",
"void writeUTF(String s) throws IOException;",
"void write (String s, int offset);",
"public void writeString(String s) throws Exception {\r\n\tout.write(s.getBytes());\r\n}",
"public void write (String s) {\n pw.print(s);\n }",
"private void write(String s) {\n\n try {\n // Add the delimiter\n s += DELIMITER;\n\n // Convert to bytes and write\n outStream.write(s.getBytes());\n Log.i(TAG, \"[SENT] \" + s);\n\n } catch (Exception e) {\n Log.e(TAG, \"Write failed!\", e);\n }\n }",
"public static void write(OutputStream out, String s) throws IOException {\n out.write(s.getBytes());\n }",
"void writeChars(String s) throws IOException;",
"void writeUTF(OutputStream out, String str) throws IOException\n {\n for (int i = 0, len = str.length(); i < len; i++)\n {\n int c = str.charAt(i);\n if ((c >= 0x0001) && (c <= 0x007F))\n {\n out.write(c);\n }\n else\n {\n if (c > 0x07FF)\n {\n out.write(0xE0 | ((c >> 12) & 0x0F));\n out.write(0x80 | ((c >> 6) & 0x3F));\n out.write(0x80 | ((c >> 0) & 0x3F));\n }\n else\n {\n out.write(0xC0 | ((c >> 6) & 0x1F));\n out.write(0x80 | ((c >> 0) & 0x3F));\n }\n }\n }\n }",
"void write(String s)\n\t\t{\n\t\t\tfor(int i = 0; i < sp; i++)\n\t\t\t\tXMLStream.print(\" \");\n\t\t\tXMLStream.println(\"<\" + s + \"/>\");\n\t\t}",
"public static void writeln(OutputStream out, String s) throws IOException {\n write(out,s+nl);\n }",
"public void writeString(String s){ \r\n message = \"String written\";\r\n byte[] pLen = new byte[1];\r\n byte[] pTAG = new byte[1];\r\n byte[] pSN = new byte[10];\r\n byte[] pNumTagFound = new byte[1];\r\n short tag = cardReader.select(handle,pTAG, pLen, pSN);\r\n if (tag < 0 ){\r\n message = \"No card found\";\r\n System.err.println(message);\r\n }\r\n if (!login())\r\n return;\r\n s = s + \" \"; // padding in case len < 16\r\n byte[] b = s.getBytes();\r\n byte[] b16 = new byte[16];\r\n for (int i=0;i<16;i++) \r\n b16[i] = b[i];\r\n int result = cardReader.write(handle,blocknr,b16);\r\n if (result < 0) {\r\n message = \"write block failed\";\r\n }\r\n System.err.println(message); \r\n }",
"public void write(String s) throws IOException {\n\t\tString logmsg = toString() + \".write(\" + s + \")\";\n\t\t_log.trace(logmsg);\n\n\t\ttry {\n\t\t\t_commandLine.write(s);\n\n\t\t\t// FIXME: Do we need both CR and LF ?\n\t\t\t_commandLine.write(Ascii.CR);\n\t\t\t_commandLine.write(Ascii.LF);\n\t\t}\n\t\tcatch(IOException ioe) {\n\t\t\t_log.error(logmsg,ioe);\n\t\t\tthrow(ioe);\n\t\t}\n\t}",
"public void write(String string) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(string);\r\n }",
"@Override\n public void write (final String s, final int off, final int len)\n {\n if (text != null)\n {\n text.append (s.substring (off, off + len));\n if ((col += len) > wrap)\n println ();\n }\n else\n {\n super.write (s, off, len);\n flush ();\n }\n }",
"private void _writeString(String text)\n/* */ throws IOException\n/* */ {\n/* 908 */ int len = text.length();\n/* 909 */ if (len > this._outputEnd) {\n/* 910 */ _writeLongString(text);\n/* 911 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 916 */ if (this._outputTail + len > this._outputEnd) {\n/* 917 */ _flushBuffer();\n/* */ }\n/* 919 */ text.getChars(0, len, this._outputBuffer, this._outputTail);\n/* */ \n/* 921 */ if (this._characterEscapes != null) {\n/* 922 */ _writeStringCustom(len);\n/* 923 */ } else if (this._maximumNonEscapedChar != 0) {\n/* 924 */ _writeStringASCII(len, this._maximumNonEscapedChar);\n/* */ } else {\n/* 926 */ _writeString2(len);\n/* */ }\n/* */ }",
"protected void writeln(String s)\n {\n out.println(s);\n }",
"public void write(String s) {\n String s_t_txt = s + \".txt\";\n try {\n PrintWriter writer = new PrintWriter(s_t_txt, \"UTF-8\");\n writer.print(s + \"\\n\");\n writer.print(toString());\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void sendMsg(OutputStream os, String s) throws IOException {\r\n\t byte[] bytes = s.getBytes();\r\n\t os.write(bytes);\r\n\t os.flush();\r\n\t }",
"public void write(String string, int offset, int length) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(string.substring(offset, length));\r\n }",
"public static void writeUTF(DataOutputStream dos,String data) throws IOException{\r\n\t\tif(data != null){\r\n\t\t\tdos.writeBoolean(true);\r\n\t\t\tdos.writeUTF(data);\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeBoolean(false);\r\n\t}",
"private void writeString( ByteBuffer byteBuffer, String string, int len )\n {\n if ( null == string )\n {\n string = \"\";\n }\n\n try\n {\n byte[] sbytes = string.getBytes( \"ASCII\" );\n\n // writeBytes will automatically zero-pad and thus terminate the\n // string.\n writeBytes( byteBuffer, sbytes, len );\n }\n catch ( UnsupportedEncodingException e )\n {\n // should not happen\n throw new RuntimeException( I18n.err( I18n.ERR_635 ), e );\n }\n }",
"void writeString(String value);",
"public void writeln (String s) {\n pw.println(s);\n }",
"private void writeStream(OutputStream os, String out) {\n try {\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, \"utf-8\"));\n writer.write(out);\n writer.flush();\n writer.close();\n os.close();\n } catch (IOException e) {\n }\n }",
"protected void writeString(String str, DataOutput out) throws IOException {\n out.writeBoolean(str!=null);\n if (str!=null)\n out.writeUTF(str);\n }",
"@Override\n\tpublic void write(final CharSequence string)\n\t{\n\t\tif (string instanceof AppendingStringBuffer)\n\t\t{\n\t\t\twrite((AppendingStringBuffer)string);\n\t\t}\n\t\telse if (string instanceof StringBuffer)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tStringBuffer sb = (StringBuffer)string;\n\t\t\t\tchar[] array = new char[sb.length()];\n\t\t\t\tsb.getChars(0, sb.length(), array, 0);\n\t\t\t\thttpServletResponse.getWriter().write(array, 0, array.length);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow new WicketRuntimeException(\"Error while writing to servlet output writer.\", e);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\thttpServletResponse.getWriter().write(string.toString());\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow new WicketRuntimeException(\"Error while writing to servlet output writer.\", e);\n\t\t\t}\n\t\t}\n\t}",
"public boolean writeString(String string) {\n try {\n m_DataOutputStream.writeBytes(string);\n }\n catch (IOException e) {\n return false;\n }\n return true;\n }",
"private void writeLine(String s) throws IOException {\n\tfbuf.write(s, 0, s.length());\n\tfbuf.newLine();\n }",
"private void _writeString(char[] text, int offset, int len)\n/* */ throws IOException\n/* */ {\n/* 1049 */ if (this._characterEscapes != null) {\n/* 1050 */ _writeStringCustom(text, offset, len);\n/* 1051 */ return;\n/* */ }\n/* 1053 */ if (this._maximumNonEscapedChar != 0) {\n/* 1054 */ _writeStringASCII(text, offset, len, this._maximumNonEscapedChar);\n/* 1055 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1062 */ len += offset;\n/* 1063 */ int[] escCodes = this._outputEscapes;\n/* 1064 */ int escLen = escCodes.length;\n/* 1065 */ while (offset < len) {\n/* 1066 */ int start = offset;\n/* */ for (;;)\n/* */ {\n/* 1069 */ char c = text[offset];\n/* 1070 */ if ((c < escLen) && (escCodes[c] != 0)) {\n/* */ break;\n/* */ }\n/* 1073 */ offset++; if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1079 */ int newAmount = offset - start;\n/* 1080 */ if (newAmount < 32)\n/* */ {\n/* 1082 */ if (this._outputTail + newAmount > this._outputEnd) {\n/* 1083 */ _flushBuffer();\n/* */ }\n/* 1085 */ if (newAmount > 0) {\n/* 1086 */ System.arraycopy(text, start, this._outputBuffer, this._outputTail, newAmount);\n/* 1087 */ this._outputTail += newAmount;\n/* */ }\n/* */ } else {\n/* 1090 */ _flushBuffer();\n/* 1091 */ this._writer.write(text, start, newAmount);\n/* */ }\n/* */ \n/* 1094 */ if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ \n/* 1098 */ char c = text[(offset++)];\n/* 1099 */ _appendCharacterEscape(c, escCodes[c]);\n/* */ }\n/* */ }",
"public void write(byte[] b) throws IOException\n {\n for(int i = 0; i < 12; i++) // write the first 12 bytes to the OutPutStream [row, row, column, column, S(r), S(r), S(c), S(c), G(r), G(r), G(c), G(c), ..]\n {\n this.out.write(b[i]);\n }\n int counter = 0;\n String s = \"\";\n int lastIter = 7;\n for(int i = 12; i < b.length; i++)\n {\n s += b[i];\n counter++;\n if((counter == 7) || (i == b.length - 1))\n {\n if(i == b.length - 1)\n {\n lastIter = counter;\n }\n byte binaryByte = (byte)(int)Integer.valueOf(s, 2);\n this.out.write(binaryByte);\n counter = 0;\n s = \"\";\n }\n }\n this.out.write(lastIter);\n }",
"void write (char ch, int offset);",
"public void write(String str) {\n Log.d(TAG, \"-> \"+str);\n mmOutStream.println(str);\n mmOutStream.flush();\n }",
"public static void writeString(String content, OutputStream os) throws IOException {\n writeString(content, os, DEFAULT_ENCODING);\n }",
"public void writeLine(String s) throws IOException {\n raos.writeLine(s);\n }",
"public void writeString(String text)\n/* */ throws IOException\n/* */ {\n/* 357 */ _verifyValueWrite(\"write a string\");\n/* 358 */ if (text == null) {\n/* 359 */ _writeNull();\n/* 360 */ return;\n/* */ }\n/* 362 */ if (this._outputTail >= this._outputEnd) {\n/* 363 */ _flushBuffer();\n/* */ }\n/* 365 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* 366 */ _writeString(text);\n/* */ \n/* 368 */ if (this._outputTail >= this._outputEnd) {\n/* 369 */ _flushBuffer();\n/* */ }\n/* 371 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* */ }",
"public synchronized void write(String data){\n\t\tlog.debug(\"[SC] Writing \"+data, 4);\n\t\twriteBuffer.add(data.getBytes());\n\t}",
"public void writeString(String message);",
"protected void print(Object s) throws IOException {\n out.write(Convert.escapeUnicode(s.toString()));\n }",
"public void write(String str) throws IOException {\n\t\toffset = dataBase.getFilePointer();\n\t\tdataBase.writeBytes(str + \"\\n\");\n\t}",
"public void write(OutputStream stream) {\n Validate.notNull(stream, \"Stream may not be null\");\n\n write(new OutputStreamWriter(stream, StandardCharsets.UTF_8));\n }",
"public void println(String s) {\n\t\t\n\t\t//out.println(s);\n\t\toutput += s;\n\t}",
"protected void send(String s) throws IOException {\n\t\t// Send string to browser.\n\t\t// Log.debug(\"Adapter: sending: \" + s);\n\t\tif (servletOut == null) {\n\t\t\tthrow new IOException(\"Client adapter was stopped\");\n\t\t}\n\n\t\tservletOut.print(s);\n\n\t\tservletOut.flush();\n\n\t\t// Note: this doesn't seem to have effect\n\t\t// in Tomcat 4/5 if the client already disconnected.\n\t\tservletRsp.flushBuffer();\n\n\t\tbytesSent += s.length();\n\t\tLog.debug(\"bytesSent= \" + bytesSent);\n\t\t// Log.debug(\"BCA sent event: \" + s);\n\t}",
"default NettyOutbound sendString(Publisher<? extends String> dataStream,\n\t\t\tCharset charset) {\n\t\tObjects.requireNonNull(charset, \"charset\");\n\t\treturn send(ReactorNetty.publisherOrScalarMap(\n\t\t\t\tdataStream, s -> {\n\t\t\t\t ByteBuf buffer = alloc().buffer();\n\t\t\t\t buffer.writeCharSequence(s, charset);\n\t\t\t\t return buffer;\n\t\t\t\t}));\n\t}",
"protected void println(String string) {\n this.output.println(string);\n this.dataSize += (string.getBytes().length);\n }",
"void writeChars(char[] c, int off, int len) throws IOException;",
"public void write(String str, int off, int len) throws IOException {\n ensureOpen();\n if ((off < 0) || (off > str.length()) || (len < 0) ||\n ((off + len) > str.length()) || ((off + len) < 0)) {\n throw new IndexOutOfBoundsException();\n } else if (len == 0) {\n return;\n }\n out.write(str, off, len);\n }",
"private static void writeToFile(String string){\n try {\n buffer.write(string);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void write(String[] buf, int offset, int size) throws IOException;",
"void write(String text);",
"public void writeBlock(String s) {\n\t\tuncheckedWrite(s);\n\t\t_column += s.length();\n\t}",
"public void write_string_variable(int size, String str) throws IOException {\n\n // Creem una seqüència amb la mida\n byte bHeader[] = new byte[size];\n String strHeader;\n int numBytes = 0;\n\n // Creem la capçalera amb el nombre de bytes que codifiquen la mida\n numBytes = str.length();\n\n strHeader = String.valueOf(numBytes);\n int len;\n if ((len = strHeader.length()) < size)\n for (int i = len; i < size; i++) {\n strHeader = \"0\" + strHeader;\n }\n for (int i = 0; i < size; i++)\n bHeader[i] = (byte) strHeader.charAt(i);\n // Enviem la capçalera\n dos.write(bHeader, 0, size);\n // Enviem l'string writeBytes de DataOutputStrem no envia el byte més alt dels chars.\n dos.writeBytes(str);\n }",
"private final void _writeNull()\n/* */ throws IOException\n/* */ {\n/* 1610 */ if (this._outputTail + 4 >= this._outputEnd) {\n/* 1611 */ _flushBuffer();\n/* */ }\n/* 1613 */ int ptr = this._outputTail;\n/* 1614 */ char[] buf = this._outputBuffer;\n/* 1615 */ buf[ptr] = 'n';\n/* 1616 */ buf[(++ptr)] = 'u';\n/* 1617 */ buf[(++ptr)] = 'l';\n/* 1618 */ buf[(++ptr)] = 'l';\n/* 1619 */ this._outputTail = (ptr + 1);\n/* */ }",
"public void writeRaw(String text)\n/* */ throws IOException\n/* */ {\n/* 442 */ int len = text.length();\n/* 443 */ int room = this._outputEnd - this._outputTail;\n/* */ \n/* 445 */ if (room == 0) {\n/* 446 */ _flushBuffer();\n/* 447 */ room = this._outputEnd - this._outputTail;\n/* */ }\n/* */ \n/* 450 */ if (room >= len) {\n/* 451 */ text.getChars(0, len, this._outputBuffer, this._outputTail);\n/* 452 */ this._outputTail += len;\n/* */ } else {\n/* 454 */ writeRawLong(text);\n/* */ }\n/* */ }",
"public int writeString(String src) {\n // Convert the argument strings to ASCII\n byte[] srcAsBytes;\n src += \"\\r\";\n try {\n srcAsBytes = src.getBytes(\"US-ASCII\");\n } catch (UnsupportedEncodingException e) {\n // Very very unlikely in the near-scope of the project.\n return -1;\n }\n print(\"Wrote :\" + src + \":\");\n return write(srcAsBytes);\n }",
"public static void write(@Nullable final String data, final Writer output) throws IOException {\n if (data != null) {\n output.write(data);\n }\n }",
"private void writeData(Socket s, String cmd){\n\t\ttry {\n\t\t\tDataOutputStream dos = new DataOutputStream(s.getOutputStream());\n\t\t\tdos.writeUTF(cmd);\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(main, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}",
"public void sendPlayerName(String s) {\n try {\n dOut.writeUTF(s);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send player name\");\n e.printStackTrace();\n }\n }",
"void write(final Writer characterStream, final N source) throws IOException, XdmMarshalException;",
"private void printOut(String s)\n {\n outVideo.println(s);\n outVideo.flush();\n }",
"public void sendString(String s) throws IOException{\n\t\tbyte[] b = s.getBytes();\n\t\tDatagramPacket packet = new DatagramPacket(b, b.length, mIP, port);\n\t\tmSocket.send(packet);\n\t}",
"public static void write(Hashtable stringHashtable, DataOutputStream dos) throws IOException {\t\r\n\t\tif(stringHashtable != null){\r\n\t\t\tdos.writeByte(stringHashtable.size());\r\n\t\t\tEnumeration keys = stringHashtable.keys();\r\n\t\t\tString key;\r\n\t\t\twhile(keys.hasMoreElements()){\r\n\t\t\t\tkey = (String)keys.nextElement();\r\n\t\t\t\tdos.writeUTF(key);\r\n\t\t\t\tdos.writeUTF((String)stringHashtable.get(key));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"String charWrite();",
"public void output (String s)\n\t{\n\t\toutputArea.append (s + \"\\n\");\n\t\toutputArea.setCaretPosition (outputArea.getDocument().getLength());\n\t}",
"void writeString(final String result) throws WriterException;",
"private void bluetoothSendMsg(String s) {\n byte [] msgOnBuf;\n msgOnBuf = s.getBytes();\n try {\n outStream.write(msgOnBuf);\n } catch (IOException e) {\n Log.d(TAG,\"send message fail!\");\n }\n }",
"public void write(DataOutput output) throws IOException {\n output.writeUTF(this.data);\n }",
"void writeChar(char value);",
"public static void writeFos( final OutputStream fos, final String data ) throws IOException {\n if ( data != null ) {\n fos.write( data.getBytes( MainActivity.ENCODING ) );\n }\n }",
"void write(final OutputStream byteStream, final N source, String encoding) throws IOException, XdmMarshalException;",
"@Override\n\tpublic void write(DataOutput arg0) throws IOException {\n\t\targ0.writeUTF(first);\n\t\targ0.writeUTF(second);\n\t}",
"protected void print(String string) {\n this.output.print(string);\n this.dataSize += (string.getBytes().length);\n }",
"public static void display(String s)\r\n\t{\r\n\t\t//Use to write a string to a line in the output stream without moving the cursor\r\n\t\t//to the next line.\r\n\t\toutStream.print(s);\r\n\t}",
"public void print(String someString) {\r\n try {\r\n innerStream.write(someString.getBytes(\"UTF8\"));\r\n } catch (Exception e) {\r\n LogManager.getRootLogger().error(e);\r\n }\r\n }",
"private static Appendable writeString(Appendable buffer, String s, char quote) {\n append(buffer, quote);\n int len = s.length();\n for (int i = 0; i < len; i++) {\n char c = s.charAt(i);\n escapeCharacter(buffer, c, quote);\n }\n return append(buffer, quote);\n }",
"public static void writeString(String content, OutputStream os, String encoding)\n throws IOException {\n try {\n PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, encoding));\n printWriter.write(content);\n printWriter.flush();\n os.flush();\n } finally {\n close(os);\n }\n }",
"public void write(String value){\r\n for(int i=0; i<value.length(); i++){\r\n mBufferData.add(value.charAt(i));\r\n }\r\n }",
"public void sendNotification(String s) {\n try {\n dOut.writeUTF(s);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send notification\");\n e.printStackTrace();\n }\n }",
"public void write(String str) throws XMLStreamException {\n try {\n this.writer.write(str);\n } catch (IOException e) {\n throw new XMLStreamException((Throwable) e);\n }\n }",
"default NettyOutbound sendString(Publisher<? extends String> dataStream) {\n\t\treturn sendString(dataStream, Charset.defaultCharset());\n\t}",
"public void writeTextFile(String s) {\n\t\ttry {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new FileWriter(filename,true)));\n\t\t\twriter.println(s);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not write to\\t\\\"\" + filename + \"\\\"\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\twriter.close();\n\t\t}\n\t}",
"protected final void write(char c) throws IOException {\n\t\toutput.write(c);\n\t}",
"public void write(OutputStream arg0) throws IOException {\n\n\t}",
"public abstract void writeToStream(java.io.DataOutputStream output) throws java.io.IOException;",
"public static void write(@Nullable final char[] data, final Writer output) throws IOException {\n if (data != null) {\n output.write(data);\n }\n }",
"private static void writeStrings(BufferedWriter out, Collection strings) throws IOException {\n\t\tIterator it = strings.iterator();\n\t\t\n\t\twhile (it.hasNext()) {\n\t\t\tString string = (String)it.next();\n\t\t\tif (string!=null) out.write(string);\n\t\t\tif (it.hasNext()) out.write('\\t');\n\t\t}\n\t\tout.newLine();\n\t}",
"public void write(byte[] pBuf, int pOffset, int pLength)\n throws IOException {\n String strValue = null;\n if(characterEncoding != null && !\"\".equals(characterEncoding)) {\n try {\n strValue = new String(pBuf, pOffset, pLength, characterEncoding);\n }\n catch(UnsupportedEncodingException uee) {\n // ignore and allow the null to handle.\n }\n }\n\n if(strValue == null) {\n strValue = new String(pBuf, pOffset, pLength);\n }\n\n mPrintWriter.write(strValue);\n }",
"public void writeToFile(String s,String outFile) \n\t{\n\t\ttry \n\t\t{\n\t\t\tbw = new BufferedWriter(new FileWriter(outFile));\n\t\t\tbw.write(s);\n\t\t\tMyLogger.writeMessage(\"Results written to file\", MyLogger.DebugLevel.RESULTS);\n\t\t\tbw.close();\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.err.println(\"Exception: writing to output.txt\");\n\t\t\tSystem.err.println(\"Exiting\");\n\t\t\tSystem.err.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t}",
"@Override\n public int write(byte[] bytes, int offset, int length) throws SWPException {\n int codePointLength = getLength();\n SWPException.requireTrue(length >= codePointLength, \"Buffer overflow.\");\n bytes[offset] = (byte) ((codePointLength << 8) & 0xff);\n bytes[offset + 1] = (byte) (codePointLength & 0xff);\n bytes[offset + 2] = (byte) (codePoint >>> 8);\n bytes[offset + 3] = (byte) (codePoint & 0xff);\n if (isNull()) {\n\n bytes[offset + 4] = SwpConstants.NULL_INDICATOR;\n }\n else {\n\n bytes[offset + 4] = SwpConstants.NOT_NULL_INDICATOR;\n primitive.write(bytes, offset + 5, length - 5);\n }\n return codePointLength;\n }",
"public void write(String value) {\n try {\n out.println(value);\n out.flush();\n System.out.println(value);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void write(String input) {\n byte[] msgBuffer = input.getBytes(); //converts entered String into bytes\n try {\n mmOutStream.write(msgBuffer); //write bytes over BT connection via outstream\n } catch (IOException e) {\n //if you cannot write, close the application\n Toast.makeText(getBaseContext(), \"Connection Failure\", Toast.LENGTH_LONG).show();\n finish();\n }\n }",
"public void write(DataOutputStream out) throws IOException;",
"public static void printCharArray(java.io.PrintWriter ostr, String s) {\n ostr.print(\"{\");\n for (int i = 0; i < s.length(); i++) {\n ostr.print(\"0x\" + Integer.toHexString((int)s.charAt(i)) + \", \");\n }\n ostr.print(\"0}\");\n }",
"private synchronized void write(RecordOutputStream s) throws IOException {\r\n s.writeIntCompressed(originalNamesToFixedNames.size());\r\n for (final Map.Entry<String, String> entry : originalNamesToFixedNames.entrySet()) { \r\n s.writeUTF(entry.getKey());\r\n s.writeUTF(entry.getValue());\r\n }\r\n }",
"public static String stringCompression(String s){\n\t\tint total = longerThanOriginalOne(s);\n\n\t if (total >= s.length()) return s;\n\n\n\t\t// if it is worth to compress it, build it\n\t\tStringBuilder compressed = new StringBuilder(total);\n\n\t\tint count = 1;\n\t\tchar c = s.charAt(0);\n\n\t\tfor (int i = 1; i < s.length(); i++){\n\n\t\t\tif (s.charAt(i) == c){\n\t\t\t\tcount += 1;\n\t\t\t}else{\n\t\t\t\tcompressed.append(c);\n\t\t\t\tcompressed.append(Integer.toString(count));\n\n\t\t\t\tc = s.charAt(i);\n\t\t\t\tcount = 1;\n\n\t\t\t}\n\t\t}\n\t\tcompressed.append(c);\n\t\tcompressed.append(Integer.toString(count));\n\t\treturn compressed.toString();\n\n\t}"
] | [
"0.7500213",
"0.7420456",
"0.716194",
"0.71301925",
"0.70998895",
"0.70783097",
"0.70615774",
"0.6956038",
"0.6931545",
"0.6811701",
"0.67994106",
"0.67021066",
"0.66606426",
"0.6565134",
"0.6457671",
"0.64374256",
"0.63752055",
"0.62835145",
"0.61530465",
"0.60727394",
"0.6012053",
"0.5985483",
"0.5899809",
"0.58788204",
"0.5864824",
"0.5843472",
"0.580709",
"0.5804558",
"0.57408315",
"0.5736521",
"0.5689465",
"0.567076",
"0.5655789",
"0.56197435",
"0.56043524",
"0.5528896",
"0.5526964",
"0.5503263",
"0.5490664",
"0.54669464",
"0.5431629",
"0.54315954",
"0.5404765",
"0.5391135",
"0.5386421",
"0.5374501",
"0.535993",
"0.530731",
"0.53004336",
"0.52961826",
"0.52722496",
"0.52561283",
"0.525602",
"0.5254255",
"0.5251368",
"0.5246459",
"0.52421874",
"0.52057445",
"0.5198974",
"0.5175974",
"0.5173785",
"0.51709366",
"0.5170502",
"0.5160146",
"0.51573",
"0.51565343",
"0.5142317",
"0.5141523",
"0.51413125",
"0.5124565",
"0.51242036",
"0.5123713",
"0.5122517",
"0.5113392",
"0.51041454",
"0.50918007",
"0.507557",
"0.5074927",
"0.50746894",
"0.5066775",
"0.50646204",
"0.50538677",
"0.5050671",
"0.50284517",
"0.50194615",
"0.50177205",
"0.5011055",
"0.50056046",
"0.499191",
"0.4988452",
"0.49863988",
"0.49832797",
"0.4981769",
"0.49735504",
"0.49644914",
"0.49567544",
"0.49510986",
"0.49498552",
"0.49496222",
"0.49441728"
] | 0.7091557 | 5 |
Writes a string to the output stream. For every character in the string s, taken in order, two bytes are written to the output stream, ordered according to the current byte order setting. If network byte order is being used, the highorder byte is written first; the order is reversed otherwise. If s is null, a NullPointerException is thrown. If s.length is zero, then no bytes are written. Otherwise, the character s[0] is written first, then s[1], and so on; the last character written is s[s.length1]. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeChars(String s) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void write(String s){\n\t\tint length = s.length();\n\t\tchar[] chars = new char[length];\n\t\ts.getChars(0, length, chars, 0);\n\t\twrite(chars, 0, length);\n\t}",
"public void write(String s) throws IOException {\n\t\tif (s != null && s.length() > 0) {\n\t\t\tfos.write(s.getBytes());\n\t\t}\n\t}",
"protected final void write(String s) throws IOException {\n\t\toutput.write(s);\n\t}",
"protected static void writeString(final String s, final DataOutputStream d) throws IOException {\n\t\tif (s == null) {\n\t\t\td.writeShort(-1);\n\t\t} else {\n\t\t\td.writeShort(s.length());\n\t\t\td.write(s.getBytes());\n\t\t\td.writeByte(0);\n\t\t}\n\t}",
"public void writeString(final String s) throws IOException {\n checkOpened();\n dos.writeUTF(s);\n flush();\n }",
"private void write(String s) {\n _writer.print(s);\n _writer.flush(); // This is need to actually write the data.\n\n _index += s.length();\n }",
"void writeUTF(String s) throws IOException;",
"void writeBytes(String s) throws IOException;",
"private void write(String s) {\n\n try {\n // Add the delimiter\n s += DELIMITER;\n\n // Convert to bytes and write\n outStream.write(s.getBytes());\n Log.i(TAG, \"[SENT] \" + s);\n\n } catch (Exception e) {\n Log.e(TAG, \"Write failed!\", e);\n }\n }",
"public void writeString(String s) throws Exception {\r\n\tout.write(s.getBytes());\r\n}",
"void write (String s, int offset);",
"public void write (String s) {\n pw.print(s);\n }",
"public static void write(OutputStream out, String s) throws IOException {\n out.write(s.getBytes());\n }",
"public static void writeln(OutputStream out, String s) throws IOException {\n write(out,s+nl);\n }",
"void write(String s)\n\t\t{\n\t\t\tfor(int i = 0; i < sp; i++)\n\t\t\t\tXMLStream.print(\" \");\n\t\t\tXMLStream.println(\"<\" + s + \"/>\");\n\t\t}",
"public void writeString(String s){ \r\n message = \"String written\";\r\n byte[] pLen = new byte[1];\r\n byte[] pTAG = new byte[1];\r\n byte[] pSN = new byte[10];\r\n byte[] pNumTagFound = new byte[1];\r\n short tag = cardReader.select(handle,pTAG, pLen, pSN);\r\n if (tag < 0 ){\r\n message = \"No card found\";\r\n System.err.println(message);\r\n }\r\n if (!login())\r\n return;\r\n s = s + \" \"; // padding in case len < 16\r\n byte[] b = s.getBytes();\r\n byte[] b16 = new byte[16];\r\n for (int i=0;i<16;i++) \r\n b16[i] = b[i];\r\n int result = cardReader.write(handle,blocknr,b16);\r\n if (result < 0) {\r\n message = \"write block failed\";\r\n }\r\n System.err.println(message); \r\n }",
"void writeUTF(OutputStream out, String str) throws IOException\n {\n for (int i = 0, len = str.length(); i < len; i++)\n {\n int c = str.charAt(i);\n if ((c >= 0x0001) && (c <= 0x007F))\n {\n out.write(c);\n }\n else\n {\n if (c > 0x07FF)\n {\n out.write(0xE0 | ((c >> 12) & 0x0F));\n out.write(0x80 | ((c >> 6) & 0x3F));\n out.write(0x80 | ((c >> 0) & 0x3F));\n }\n else\n {\n out.write(0xC0 | ((c >> 6) & 0x1F));\n out.write(0x80 | ((c >> 0) & 0x3F));\n }\n }\n }\n }",
"public void write(String string) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(string);\r\n }",
"protected void writeln(String s)\n {\n out.println(s);\n }",
"public void write(String s) throws IOException {\n\t\tString logmsg = toString() + \".write(\" + s + \")\";\n\t\t_log.trace(logmsg);\n\n\t\ttry {\n\t\t\t_commandLine.write(s);\n\n\t\t\t// FIXME: Do we need both CR and LF ?\n\t\t\t_commandLine.write(Ascii.CR);\n\t\t\t_commandLine.write(Ascii.LF);\n\t\t}\n\t\tcatch(IOException ioe) {\n\t\t\t_log.error(logmsg,ioe);\n\t\t\tthrow(ioe);\n\t\t}\n\t}",
"public void sendMsg(OutputStream os, String s) throws IOException {\r\n\t byte[] bytes = s.getBytes();\r\n\t os.write(bytes);\r\n\t os.flush();\r\n\t }",
"@Override\n public void write (final String s, final int off, final int len)\n {\n if (text != null)\n {\n text.append (s.substring (off, off + len));\n if ((col += len) > wrap)\n println ();\n }\n else\n {\n super.write (s, off, len);\n flush ();\n }\n }",
"public void write(String s) {\n String s_t_txt = s + \".txt\";\n try {\n PrintWriter writer = new PrintWriter(s_t_txt, \"UTF-8\");\n writer.print(s + \"\\n\");\n writer.print(toString());\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private void writeStream(OutputStream os, String out) {\n try {\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, \"utf-8\"));\n writer.write(out);\n writer.flush();\n writer.close();\n os.close();\n } catch (IOException e) {\n }\n }",
"private void writeString( ByteBuffer byteBuffer, String string, int len )\n {\n if ( null == string )\n {\n string = \"\";\n }\n\n try\n {\n byte[] sbytes = string.getBytes( \"ASCII\" );\n\n // writeBytes will automatically zero-pad and thus terminate the\n // string.\n writeBytes( byteBuffer, sbytes, len );\n }\n catch ( UnsupportedEncodingException e )\n {\n // should not happen\n throw new RuntimeException( I18n.err( I18n.ERR_635 ), e );\n }\n }",
"public static void writeUTF(DataOutputStream dos,String data) throws IOException{\r\n\t\tif(data != null){\r\n\t\t\tdos.writeBoolean(true);\r\n\t\t\tdos.writeUTF(data);\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeBoolean(false);\r\n\t}",
"public void writeln (String s) {\n pw.println(s);\n }",
"public void write(String str) {\n Log.d(TAG, \"-> \"+str);\n mmOutStream.println(str);\n mmOutStream.flush();\n }",
"protected void writeString(String str, DataOutput out) throws IOException {\n out.writeBoolean(str!=null);\n if (str!=null)\n out.writeUTF(str);\n }",
"public void write(String string, int offset, int length) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(string.substring(offset, length));\r\n }",
"private void _writeString(String text)\n/* */ throws IOException\n/* */ {\n/* 908 */ int len = text.length();\n/* 909 */ if (len > this._outputEnd) {\n/* 910 */ _writeLongString(text);\n/* 911 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 916 */ if (this._outputTail + len > this._outputEnd) {\n/* 917 */ _flushBuffer();\n/* */ }\n/* 919 */ text.getChars(0, len, this._outputBuffer, this._outputTail);\n/* */ \n/* 921 */ if (this._characterEscapes != null) {\n/* 922 */ _writeStringCustom(len);\n/* 923 */ } else if (this._maximumNonEscapedChar != 0) {\n/* 924 */ _writeStringASCII(len, this._maximumNonEscapedChar);\n/* */ } else {\n/* 926 */ _writeString2(len);\n/* */ }\n/* */ }",
"private void writeLine(String s) throws IOException {\n\tfbuf.write(s, 0, s.length());\n\tfbuf.newLine();\n }",
"void writeString(String value);",
"public boolean writeString(String string) {\n try {\n m_DataOutputStream.writeBytes(string);\n }\n catch (IOException e) {\n return false;\n }\n return true;\n }",
"protected void send(String s) throws IOException {\n\t\t// Send string to browser.\n\t\t// Log.debug(\"Adapter: sending: \" + s);\n\t\tif (servletOut == null) {\n\t\t\tthrow new IOException(\"Client adapter was stopped\");\n\t\t}\n\n\t\tservletOut.print(s);\n\n\t\tservletOut.flush();\n\n\t\t// Note: this doesn't seem to have effect\n\t\t// in Tomcat 4/5 if the client already disconnected.\n\t\tservletRsp.flushBuffer();\n\n\t\tbytesSent += s.length();\n\t\tLog.debug(\"bytesSent= \" + bytesSent);\n\t\t// Log.debug(\"BCA sent event: \" + s);\n\t}",
"public synchronized void write(String data){\n\t\tlog.debug(\"[SC] Writing \"+data, 4);\n\t\twriteBuffer.add(data.getBytes());\n\t}",
"public void writeLine(String s) throws IOException {\n raos.writeLine(s);\n }",
"public void write(String str) throws IOException {\n\t\toffset = dataBase.getFilePointer();\n\t\tdataBase.writeBytes(str + \"\\n\");\n\t}",
"protected void print(Object s) throws IOException {\n out.write(Convert.escapeUnicode(s.toString()));\n }",
"private void printOut(String s)\n {\n outVideo.println(s);\n outVideo.flush();\n }",
"public void writeString(String message);",
"@Override\n\tpublic void write(final CharSequence string)\n\t{\n\t\tif (string instanceof AppendingStringBuffer)\n\t\t{\n\t\t\twrite((AppendingStringBuffer)string);\n\t\t}\n\t\telse if (string instanceof StringBuffer)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tStringBuffer sb = (StringBuffer)string;\n\t\t\t\tchar[] array = new char[sb.length()];\n\t\t\t\tsb.getChars(0, sb.length(), array, 0);\n\t\t\t\thttpServletResponse.getWriter().write(array, 0, array.length);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow new WicketRuntimeException(\"Error while writing to servlet output writer.\", e);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\thttpServletResponse.getWriter().write(string.toString());\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\tthrow new WicketRuntimeException(\"Error while writing to servlet output writer.\", e);\n\t\t\t}\n\t\t}\n\t}",
"public void println(String s) {\n\t\t\n\t\t//out.println(s);\n\t\toutput += s;\n\t}",
"public void sendPlayerName(String s) {\n try {\n dOut.writeUTF(s);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send player name\");\n e.printStackTrace();\n }\n }",
"default NettyOutbound sendString(Publisher<? extends String> dataStream,\n\t\t\tCharset charset) {\n\t\tObjects.requireNonNull(charset, \"charset\");\n\t\treturn send(ReactorNetty.publisherOrScalarMap(\n\t\t\t\tdataStream, s -> {\n\t\t\t\t ByteBuf buffer = alloc().buffer();\n\t\t\t\t buffer.writeCharSequence(s, charset);\n\t\t\t\t return buffer;\n\t\t\t\t}));\n\t}",
"public static void writeString(String content, OutputStream os) throws IOException {\n writeString(content, os, DEFAULT_ENCODING);\n }",
"protected void println(String string) {\n this.output.println(string);\n this.dataSize += (string.getBytes().length);\n }",
"private synchronized void write(RecordOutputStream s) throws IOException {\r\n s.writeIntCompressed(originalNamesToFixedNames.size());\r\n for (final Map.Entry<String, String> entry : originalNamesToFixedNames.entrySet()) { \r\n s.writeUTF(entry.getKey());\r\n s.writeUTF(entry.getValue());\r\n }\r\n }",
"public void write(byte[] b) throws IOException\n {\n for(int i = 0; i < 12; i++) // write the first 12 bytes to the OutPutStream [row, row, column, column, S(r), S(r), S(c), S(c), G(r), G(r), G(c), G(c), ..]\n {\n this.out.write(b[i]);\n }\n int counter = 0;\n String s = \"\";\n int lastIter = 7;\n for(int i = 12; i < b.length; i++)\n {\n s += b[i];\n counter++;\n if((counter == 7) || (i == b.length - 1))\n {\n if(i == b.length - 1)\n {\n lastIter = counter;\n }\n byte binaryByte = (byte)(int)Integer.valueOf(s, 2);\n this.out.write(binaryByte);\n counter = 0;\n s = \"\";\n }\n }\n this.out.write(lastIter);\n }",
"private void bluetoothSendMsg(String s) {\n byte [] msgOnBuf;\n msgOnBuf = s.getBytes();\n try {\n outStream.write(msgOnBuf);\n } catch (IOException e) {\n Log.d(TAG,\"send message fail!\");\n }\n }",
"public void sendString(String s) throws IOException{\n\t\tbyte[] b = s.getBytes();\n\t\tDatagramPacket packet = new DatagramPacket(b, b.length, mIP, port);\n\t\tmSocket.send(packet);\n\t}",
"public void write_string_variable(int size, String str) throws IOException {\n\n // Creem una seqüència amb la mida\n byte bHeader[] = new byte[size];\n String strHeader;\n int numBytes = 0;\n\n // Creem la capçalera amb el nombre de bytes que codifiquen la mida\n numBytes = str.length();\n\n strHeader = String.valueOf(numBytes);\n int len;\n if ((len = strHeader.length()) < size)\n for (int i = len; i < size; i++) {\n strHeader = \"0\" + strHeader;\n }\n for (int i = 0; i < size; i++)\n bHeader[i] = (byte) strHeader.charAt(i);\n // Enviem la capçalera\n dos.write(bHeader, 0, size);\n // Enviem l'string writeBytes de DataOutputStrem no envia el byte més alt dels chars.\n dos.writeBytes(str);\n }",
"public static void display(String s)\r\n\t{\r\n\t\t//Use to write a string to a line in the output stream without moving the cursor\r\n\t\t//to the next line.\r\n\t\toutStream.print(s);\r\n\t}",
"private final void _writeNull()\n/* */ throws IOException\n/* */ {\n/* 1610 */ if (this._outputTail + 4 >= this._outputEnd) {\n/* 1611 */ _flushBuffer();\n/* */ }\n/* 1613 */ int ptr = this._outputTail;\n/* 1614 */ char[] buf = this._outputBuffer;\n/* 1615 */ buf[ptr] = 'n';\n/* 1616 */ buf[(++ptr)] = 'u';\n/* 1617 */ buf[(++ptr)] = 'l';\n/* 1618 */ buf[(++ptr)] = 'l';\n/* 1619 */ this._outputTail = (ptr + 1);\n/* */ }",
"private void _writeString(char[] text, int offset, int len)\n/* */ throws IOException\n/* */ {\n/* 1049 */ if (this._characterEscapes != null) {\n/* 1050 */ _writeStringCustom(text, offset, len);\n/* 1051 */ return;\n/* */ }\n/* 1053 */ if (this._maximumNonEscapedChar != 0) {\n/* 1054 */ _writeStringASCII(text, offset, len, this._maximumNonEscapedChar);\n/* 1055 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1062 */ len += offset;\n/* 1063 */ int[] escCodes = this._outputEscapes;\n/* 1064 */ int escLen = escCodes.length;\n/* 1065 */ while (offset < len) {\n/* 1066 */ int start = offset;\n/* */ for (;;)\n/* */ {\n/* 1069 */ char c = text[offset];\n/* 1070 */ if ((c < escLen) && (escCodes[c] != 0)) {\n/* */ break;\n/* */ }\n/* 1073 */ offset++; if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1079 */ int newAmount = offset - start;\n/* 1080 */ if (newAmount < 32)\n/* */ {\n/* 1082 */ if (this._outputTail + newAmount > this._outputEnd) {\n/* 1083 */ _flushBuffer();\n/* */ }\n/* 1085 */ if (newAmount > 0) {\n/* 1086 */ System.arraycopy(text, start, this._outputBuffer, this._outputTail, newAmount);\n/* 1087 */ this._outputTail += newAmount;\n/* */ }\n/* */ } else {\n/* 1090 */ _flushBuffer();\n/* 1091 */ this._writer.write(text, start, newAmount);\n/* */ }\n/* */ \n/* 1094 */ if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ \n/* 1098 */ char c = text[(offset++)];\n/* 1099 */ _appendCharacterEscape(c, escCodes[c]);\n/* */ }\n/* */ }",
"private void writeData(Socket s, String cmd){\n\t\ttry {\n\t\t\tDataOutputStream dos = new DataOutputStream(s.getOutputStream());\n\t\t\tdos.writeUTF(cmd);\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(main, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}",
"public int writeString(String src) {\n // Convert the argument strings to ASCII\n byte[] srcAsBytes;\n src += \"\\r\";\n try {\n srcAsBytes = src.getBytes(\"US-ASCII\");\n } catch (UnsupportedEncodingException e) {\n // Very very unlikely in the near-scope of the project.\n return -1;\n }\n print(\"Wrote :\" + src + \":\");\n return write(srcAsBytes);\n }",
"public synchronized void writeNow(String data){\n\t\tlog.debug(\"[SC] Writing now unencrypted - \"+data, 4);\n\t\tif(out!=null){\n\t\t\ttry {\n\t\t\t\tif(!data.endsWith(\"\\n\")){\n\t\t\t\t\tdata = data + \"\\n\";\n\t\t\t\t}\n\t\t\t\tout.write(data.getBytes());\n\t\t\t\tout.flush();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.error(\"[SC] Could not write to socket\");\n\t\t\t}\t\n\t\t}else{\n\t\t\tlog.error(\"[SC] Could not write to socket\");\n\t\t}\n\t}",
"public void writeFile(String s) {\n\t\ttry\n\t\t{\t\t\t \n\t\t\tPrintWriter writer = new PrintWriter(s, \"UTF-8\");\n\t\t\twriter.println(\"digraph G{\");\n\t\t\tint u;\n\t\t\tint n = vertices();\n\t\t\tfor (u = 0; u < n; u++) {\n\t\t\t for (Edge e: next(u)) {\n\t\t\t \twriter.println(e.from + \"->\" + e.to + \"[label=\\\"\" + e.cost + \"\\\"];\");\n\t\t\t }\n\t\t\t}\n\t\t\twriter.println(\"}\");\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\t\n\t\t}\t\t\t\t\t\t\n }",
"@Override\n\tpublic void write(DataOutput arg0) throws IOException {\n\t\targ0.writeUTF(first);\n\t\targ0.writeUTF(second);\n\t}",
"private static void writeToFile(String string){\n try {\n buffer.write(string);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void writeBlock(String s) {\n\t\tuncheckedWrite(s);\n\t\t_column += s.length();\n\t}",
"public void write(String input) {\n byte[] msgBuffer = input.getBytes(); //converts entered String into bytes\n try {\n mmOutStream.write(msgBuffer); //write bytes over BT connection via outstream\n } catch (IOException e) {\n //if you cannot write, close the application\n Toast.makeText(getBaseContext(), \"Connection Failure\", Toast.LENGTH_LONG).show();\n finish();\n }\n }",
"protected void print(String string) {\n this.output.print(string);\n this.dataSize += (string.getBytes().length);\n }",
"public static void write(Hashtable stringHashtable, DataOutputStream dos) throws IOException {\t\r\n\t\tif(stringHashtable != null){\r\n\t\t\tdos.writeByte(stringHashtable.size());\r\n\t\t\tEnumeration keys = stringHashtable.keys();\r\n\t\t\tString key;\r\n\t\t\twhile(keys.hasMoreElements()){\r\n\t\t\t\tkey = (String)keys.nextElement();\r\n\t\t\t\tdos.writeUTF(key);\r\n\t\t\t\tdos.writeUTF((String)stringHashtable.get(key));\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"public void writeRaw(String text)\n/* */ throws IOException\n/* */ {\n/* 442 */ int len = text.length();\n/* 443 */ int room = this._outputEnd - this._outputTail;\n/* */ \n/* 445 */ if (room == 0) {\n/* 446 */ _flushBuffer();\n/* 447 */ room = this._outputEnd - this._outputTail;\n/* */ }\n/* */ \n/* 450 */ if (room >= len) {\n/* 451 */ text.getChars(0, len, this._outputBuffer, this._outputTail);\n/* 452 */ this._outputTail += len;\n/* */ } else {\n/* 454 */ writeRawLong(text);\n/* */ }\n/* */ }",
"public void print(String someString) {\r\n try {\r\n innerStream.write(someString.getBytes(\"UTF8\"));\r\n } catch (Exception e) {\r\n LogManager.getRootLogger().error(e);\r\n }\r\n }",
"default NettyOutbound sendString(Publisher<? extends String> dataStream) {\n\t\treturn sendString(dataStream, Charset.defaultCharset());\n\t}",
"public void output (String s)\n\t{\n\t\toutputArea.append (s + \"\\n\");\n\t\toutputArea.setCaretPosition (outputArea.getDocument().getLength());\n\t}",
"public void enviarTexto(String n,String s) {\r\n \t try {\r\n \t\t\t//dos = new DataOutputStream( socket.getOutputStream() );\r\n \t\t\t//System.out.println(s);\r\n \t\t\tdos.writeInt(Integer.valueOf(n));\r\n \t\t\tdos.flush();\r\n // Enviamos el nombre del archivo \r\n \t\t\tdos.writeUTF( s ); \r\n \tdos.flush();\r\n \tdos.close();\r\n \tsocket.close();\r\n \t\t} catch (IOException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tSystem.out.println(\"------------ERROR AL ENVIAR SQL----------\");\r\n \t\t}//\r\n }",
"public void writeString(String text)\n/* */ throws IOException\n/* */ {\n/* 357 */ _verifyValueWrite(\"write a string\");\n/* 358 */ if (text == null) {\n/* 359 */ _writeNull();\n/* 360 */ return;\n/* */ }\n/* 362 */ if (this._outputTail >= this._outputEnd) {\n/* 363 */ _flushBuffer();\n/* */ }\n/* 365 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* 366 */ _writeString(text);\n/* */ \n/* 368 */ if (this._outputTail >= this._outputEnd) {\n/* 369 */ _flushBuffer();\n/* */ }\n/* 371 */ this._outputBuffer[(this._outputTail++)] = this._quoteChar;\n/* */ }",
"public void sendNotification(String s) {\n try {\n dOut.writeUTF(s);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send notification\");\n e.printStackTrace();\n }\n }",
"public void write(byte[] pBuf, int pOffset, int pLength)\n throws IOException {\n String strValue = null;\n if(characterEncoding != null && !\"\".equals(characterEncoding)) {\n try {\n strValue = new String(pBuf, pOffset, pLength, characterEncoding);\n }\n catch(UnsupportedEncodingException uee) {\n // ignore and allow the null to handle.\n }\n }\n\n if(strValue == null) {\n strValue = new String(pBuf, pOffset, pLength);\n }\n\n mPrintWriter.write(strValue);\n }",
"protected void sendToServer(String string) {\r\n System.out.println(\"Sending to server: \" + string);\r\n toServer.println(string);\r\n toServer.flush();\r\n }",
"void write (char ch, int offset);",
"public void write(DataOutput output) throws IOException {\n output.writeUTF(this.data);\n }",
"public void write(String str, int off, int len) throws IOException {\n ensureOpen();\n if ((off < 0) || (off > str.length()) || (len < 0) ||\n ((off + len) > str.length()) || ((off + len) < 0)) {\n throw new IndexOutOfBoundsException();\n } else if (len == 0) {\n return;\n }\n out.write(str, off, len);\n }",
"void write(String text);",
"public static void writeString(String content, OutputStream os, String encoding)\n throws IOException {\n try {\n PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(os, encoding));\n printWriter.write(content);\n printWriter.flush();\n os.flush();\n } finally {\n close(os);\n }\n }",
"public static void write(@Nullable final String data, final Writer output) throws IOException {\n if (data != null) {\n output.write(data);\n }\n }",
"private void writeData(String data) {\n try {\n outStream = btSocket.getOutputStream();\n } catch (IOException e) {\n }\n\n String message = data;\n byte[] msgBuffer = message.getBytes();\n\n try {\n outStream.write(msgBuffer);\n } catch (IOException e) {\n }\n }",
"public static void writeFos( final OutputStream fos, final String data ) throws IOException {\n if ( data != null ) {\n fos.write( data.getBytes( MainActivity.ENCODING ) );\n }\n }",
"public void write(String[] buf, int offset, int size) throws IOException;",
"protected synchronized void writeOut(String data) {\n\t\t\n\t\tif(output != null)\n\t\t\toutput.println(data);\n\t\telse\n\t\t\tSystem.out.println(this.name + \" output not initialized\");\n\t}",
"public void write(OutputStream stream) {\n Validate.notNull(stream, \"Stream may not be null\");\n\n write(new OutputStreamWriter(stream, StandardCharsets.UTF_8));\n }",
"void write(final OutputStream byteStream, final N source, String encoding) throws IOException, XdmMarshalException;",
"public void write(String value) {\n try {\n out.println(value);\n out.flush();\n System.out.println(value);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"void writeString(final String result) throws WriterException;",
"private void convertToString(String s)\n\t{\n\t\tchar chars[] = s.toCharArray();\n\t\tfor(int i = 0; i < chars.length; i+=3)\n\t\t{\n\t\t\tString temp = \"\";\n\t\t\ttemp += chars[i];\n\t\t\ttemp += chars[i+1];\n\t\t\tif(chars[i] < '3')\n\t\t\t{\n\t\t\t\ttemp += chars[i+2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ti -= 1;\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"256\"))\n\t\t\t{\n\t\t\t\tmyDecryptedMessage += (char)(Integer.parseInt(temp));\n\t\t\t}\n\t\t}\n\t}",
"private void writeData(String data) throws IOException\n {\n this.writer.println(data);\n this.writer.flush();\n }",
"public void writeMessage(String s, Sprite sprite) {\n\n this.sprite = sprite;\n sprite.setOrigin(transform);\n writeMessage(s);\n }",
"public static String stringCompression(String s){\n\t\tint total = longerThanOriginalOne(s);\n\n\t if (total >= s.length()) return s;\n\n\n\t\t// if it is worth to compress it, build it\n\t\tStringBuilder compressed = new StringBuilder(total);\n\n\t\tint count = 1;\n\t\tchar c = s.charAt(0);\n\n\t\tfor (int i = 1; i < s.length(); i++){\n\n\t\t\tif (s.charAt(i) == c){\n\t\t\t\tcount += 1;\n\t\t\t}else{\n\t\t\t\tcompressed.append(c);\n\t\t\t\tcompressed.append(Integer.toString(count));\n\n\t\t\t\tc = s.charAt(i);\n\t\t\t\tcount = 1;\n\n\t\t\t}\n\t\t}\n\t\tcompressed.append(c);\n\t\tcompressed.append(Integer.toString(count));\n\t\treturn compressed.toString();\n\n\t}",
"public static void encode()\n {\n \n String s = BinaryStdIn.readString();\n //String s = \"ABRACADABRA!\";\n int len = s.length();\n int key = 0;\n \n // generating rotating string table\n String[] table = new String[len];\n for (int i = 0 ; i < len; i++)\n {\n table[i] = rotate(s, i, len);\n }\n \n // sort the table\n String[] sorted = new String[len];\n for(int i = 0 ; i < len; i++)\n {\n sorted[i] = table[i];\n }\n sort(sorted, len);\n \n //generating encoded string\n StringBuilder result = new StringBuilder();\n for(int i = 0 ; i < len; i++)\n result.append(sorted[i].charAt(len-1));\n \n //find the key index \n for(int i = 0 ; i < table.length; i++)\n {\n if(sorted[i].equals(s))\n {\n key = i;\n break;\n }\n }\n \n // output part\n \n BinaryStdOut.write(key);\n \n for(int i = 0 ; i < len; i++)\n BinaryStdOut.write(result.charAt(i)); // generate the output character by character\n \n BinaryStdOut.close();\n \n }",
"public void writeTextFile(String s) {\n\t\ttry {\n\t\t\twriter = new PrintWriter(new BufferedWriter(new FileWriter(filename,true)));\n\t\t\twriter.println(s);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Could not write to\\t\\\"\" + filename + \"\\\"\");\n\t\t\tSystem.out.println(e.getMessage());\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\twriter.close();\n\t\t}\n\t}",
"public void write(DataOutputStream out) throws IOException;",
"protected void writeDescription(PrintStream wps, String sDesc)\n {\n wps.println(sDesc);\n // without this line sometimes the following row is omitted.\n wps.flush();\n }",
"private static void write(String s, Style style) {\r\n\t\ttry {\r\n\t\t\tdoc.insertString(doc.getLength(), s, style);\r\n\t\t} catch (BadLocationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"void write(final Writer characterStream, final N source) throws IOException, XdmMarshalException;",
"public void save(String s) {\n try (FileOutputStream routeFile = new FileOutputStream(s);\n ObjectOutputStream routeStream = new ObjectOutputStream(routeFile);) {\n routeStream.writeObject(this);\n\n } catch (IOException e) {\n System.out.println(e);\n }\n }",
"public static void decodeToStream(String string, OutputStream out) throws IOException {\n\t\tdecode(new ByteArrayInputStream(string.getBytes()), out);\n\t}"
] | [
"0.7182973",
"0.7058249",
"0.69428843",
"0.6929676",
"0.68795407",
"0.6829218",
"0.67298317",
"0.6701889",
"0.66760004",
"0.6655065",
"0.6615045",
"0.6549498",
"0.64148796",
"0.640401",
"0.6302532",
"0.62831736",
"0.6245427",
"0.59753275",
"0.5964098",
"0.5963368",
"0.5901299",
"0.5881071",
"0.5837979",
"0.5757825",
"0.5709482",
"0.5674022",
"0.5638704",
"0.5628968",
"0.5625416",
"0.56220305",
"0.5620654",
"0.55099285",
"0.5507204",
"0.54970783",
"0.54634446",
"0.5439539",
"0.5385542",
"0.5357998",
"0.5354569",
"0.53493845",
"0.53279257",
"0.532688",
"0.5244707",
"0.5238726",
"0.5229178",
"0.52264804",
"0.52188665",
"0.52164143",
"0.52133524",
"0.5196119",
"0.5176851",
"0.5175419",
"0.5147668",
"0.5146827",
"0.51251227",
"0.51179564",
"0.5116222",
"0.5115266",
"0.5111724",
"0.5107169",
"0.5089806",
"0.50891006",
"0.50733787",
"0.5057309",
"0.50554377",
"0.5055262",
"0.5054015",
"0.5044331",
"0.5035028",
"0.5026492",
"0.5023238",
"0.49946222",
"0.49844867",
"0.49843872",
"0.4975697",
"0.49643496",
"0.4955831",
"0.49510622",
"0.49480757",
"0.49366492",
"0.49291435",
"0.49220958",
"0.4919599",
"0.49165988",
"0.49090558",
"0.4895739",
"0.48863477",
"0.48773506",
"0.48618326",
"0.48602408",
"0.48509806",
"0.48399282",
"0.48349884",
"0.48309892",
"0.48282146",
"0.4826991",
"0.48226783",
"0.48208144",
"0.48177925",
"0.4815244"
] | 0.5992077 | 17 |
Writes two bytes of length information to the output stream in network byte order, followed by the modified UTF8 representation of every character in the string s. If s is null, a NullPointerException is thrown. Each character in the string s is converted to a group of one, two, or three bytes, depending on the value of the character. If a character c is in the range &92;u0001 through &92;u007f, it is represented by one byte: (byte)c If a character c is &92;u0000 or is in the range &92;u0080 through &92;u07ff, then it is represented by two bytes, to be written in the order shown: (byte)(0xc0 | (0x1f & (c >> 6))) (byte)(0x80 | (0x3f & c)) If a character c is in the range &92;u0800 through uffff, then it is represented by three bytes, to be written in the order shown: (byte)(0xe0 | (0x0f & (c >> 12))) (byte)(0x80 | (0x3f & (c >> 6))) (byte)(0x80 | (0x3f & c)) First, the total number of bytes needed to represent all the characters of s is calculated. If this number is larger than 65535, then a UTFDataFormatException is thrown. Otherwise, this length is written to the output stream in exactly the manner of the writeShort method; after this, the one, two, or threebyte representation of each character in the string s is written. The current byte order setting is ignored. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. Note: This method should not be used in the implementation of image formats that use standard UTF8, because the modified UTF8 used here is incompatible with standard UTF8. | void writeUTF(String s) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void writeUTF(OutputStream out, String str) throws IOException\n {\n for (int i = 0, len = str.length(); i < len; i++)\n {\n int c = str.charAt(i);\n if ((c >= 0x0001) && (c <= 0x007F))\n {\n out.write(c);\n }\n else\n {\n if (c > 0x07FF)\n {\n out.write(0xE0 | ((c >> 12) & 0x0F));\n out.write(0x80 | ((c >> 6) & 0x3F));\n out.write(0x80 | ((c >> 0) & 0x3F));\n }\n else\n {\n out.write(0xC0 | ((c >> 6) & 0x1F));\n out.write(0x80 | ((c >> 0) & 0x3F));\n }\n }\n }\n }",
"void writeChars(String s) throws IOException;",
"public void write(String s){\n\t\tint length = s.length();\n\t\tchar[] chars = new char[length];\n\t\ts.getChars(0, length, chars, 0);\n\t\twrite(chars, 0, length);\n\t}",
"protected static void writeString(final String s, final DataOutputStream d) throws IOException {\n\t\tif (s == null) {\n\t\t\td.writeShort(-1);\n\t\t} else {\n\t\t\td.writeShort(s.length());\n\t\t\td.write(s.getBytes());\n\t\t\td.writeByte(0);\n\t\t}\n\t}",
"void writeBytes(String s) throws IOException;",
"@Override\n public int write(byte[] bytes, int offset, int length) throws SWPException {\n int codePointLength = getLength();\n SWPException.requireTrue(length >= codePointLength, \"Buffer overflow.\");\n bytes[offset] = (byte) ((codePointLength << 8) & 0xff);\n bytes[offset + 1] = (byte) (codePointLength & 0xff);\n bytes[offset + 2] = (byte) (codePoint >>> 8);\n bytes[offset + 3] = (byte) (codePoint & 0xff);\n if (isNull()) {\n\n bytes[offset + 4] = SwpConstants.NULL_INDICATOR;\n }\n else {\n\n bytes[offset + 4] = SwpConstants.NOT_NULL_INDICATOR;\n primitive.write(bytes, offset + 5, length - 5);\n }\n return codePointLength;\n }",
"private void writeLength(int length) {\n if (length < 128) {\n os.write((byte) length);\n } else if (length < 256) {\n os.write(-127); // 10000001 - 1 byte to follow\n os.write((byte) length);\n } else if (length < 65536) {\n os.write(-126); // 10000010 - 2 bytes to follow\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else if (length < 16777216) {\n os.write(-125); // 10000011 - 3 bytes to follow\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else {\n os.write(-124); // 10000100 - 4 bytes to follow\n os.write((byte) (length >> 24));\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n }\n }",
"public void writeString(String s){ \r\n message = \"String written\";\r\n byte[] pLen = new byte[1];\r\n byte[] pTAG = new byte[1];\r\n byte[] pSN = new byte[10];\r\n byte[] pNumTagFound = new byte[1];\r\n short tag = cardReader.select(handle,pTAG, pLen, pSN);\r\n if (tag < 0 ){\r\n message = \"No card found\";\r\n System.err.println(message);\r\n }\r\n if (!login())\r\n return;\r\n s = s + \" \"; // padding in case len < 16\r\n byte[] b = s.getBytes();\r\n byte[] b16 = new byte[16];\r\n for (int i=0;i<16;i++) \r\n b16[i] = b[i];\r\n int result = cardReader.write(handle,blocknr,b16);\r\n if (result < 0) {\r\n message = \"write block failed\";\r\n }\r\n System.err.println(message); \r\n }",
"protected final void write(String s) throws IOException {\n\t\toutput.write(s);\n\t}",
"public void write(String s) throws IOException {\n\t\tif (s != null && s.length() > 0) {\n\t\t\tfos.write(s.getBytes());\n\t\t}\n\t}",
"void write (String s, int offset);",
"@Override\r\n\tpublic Buffer appendUnsignedShort(int s) {\n\t\treturn null;\r\n\t}",
"@Override\n public void write (final String s, final int off, final int len)\n {\n if (text != null)\n {\n text.append (s.substring (off, off + len));\n if ((col += len) > wrap)\n println ();\n }\n else\n {\n super.write (s, off, len);\n flush ();\n }\n }",
"private void write(String s) {\n _writer.print(s);\n _writer.flush(); // This is need to actually write the data.\n\n _index += s.length();\n }",
"private static void appendMultibyte(Reader r, StringBuilder s) throws IOException {\n int b = decodeHex(r.read()) << 4 | decodeHex(r.read());\n int u, n;\n if (b < 0x80) { u = b; n = 1; }\n else if (b < 0xe0) { u = b & 0x1f; n = 2; }\n else if (b < 0xf0) { u = b & 0x0f; n = 3; }\n else if (b < 0xf8) { u = b & 0x07; n = 4; }\n else throw new HttpStatusException(STATUS_BAD_REQUEST, \"Invalid UTF-8 octet in %HH code\");\n for (int i = 1; i < n; ++i) {\n if (r.read() != '%') throw new HttpStatusException(STATUS_BAD_REQUEST, \"Invalid UTF-8 sequence in %HH codes\");\n b = decodeHex(r.read()) << 4 | decodeHex(r.read());\n if ((b & 0xc0) != 0x80) throw new HttpStatusException(STATUS_BAD_REQUEST, \"Invalid UTF-8 octet in %HH code\");\n u = u << 6 | b &0x3f;\n }\n if (u < 0x10000) s.append((char) u);\n else {\n s.append((char) (0xd800 + (u >>> 10)));\n s.append((char) (0xdc00 + (u & 0x3ff)));\n }\n }",
"public void writeString(final String s) throws IOException {\n checkOpened();\n dos.writeUTF(s);\n flush();\n }",
"public void write(String string, int offset, int length) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(string.substring(offset, length));\r\n }",
"private void write(String s) {\n\n try {\n // Add the delimiter\n s += DELIMITER;\n\n // Convert to bytes and write\n outStream.write(s.getBytes());\n Log.i(TAG, \"[SENT] \" + s);\n\n } catch (Exception e) {\n Log.e(TAG, \"Write failed!\", e);\n }\n }",
"public void writeString(String s) throws Exception {\r\n\tout.write(s.getBytes());\r\n}",
"public static void writeUTF(DataOutputStream dos,String data) throws IOException{\r\n\t\tif(data != null){\r\n\t\t\tdos.writeBoolean(true);\r\n\t\t\tdos.writeUTF(data);\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeBoolean(false);\r\n\t}",
"void writeShorts(short[] s, int off, int len) throws IOException;",
"public void write (String s) {\n pw.print(s);\n }",
"private String UTF8Encode(String s) {\n\n\n s = s.replace(\"\\r\\n\", \"\\n\");\n int[] utftext = new int[s.length() * 3];\n int utftextlen = 0;\n for (int n = 0; n < s.length(); n++) {\n int c = s.charAt(n);\n if (c < 128) {\n utftext[utftextlen++] = c;\n Log.e(\"utf\", n + \" try:\" + c);\n } else if ((c > 127) && (c < 2048)) {\n utftext[utftextlen++] = (c >> 6) | 192;\n utftext[utftextlen++] = (c & 63) | 128;\n Log.e(\"utf\", n + \" try:\" + ((c >> 6) | 192));\n Log.e(\"utf\", n + \" try:\" + ((c & 63) | 128));\n } else {\n utftext[utftextlen++] = (c >> 12) | 224;\n utftext[utftextlen++] = ((c >> 6) & 63) | 128;\n utftext[utftextlen++] = (c & 63) | 128;\n Log.e(\"utf\", n + \" try:\" + ((c >> 12) | 224));\n Log.e(\"utf\", n + \" try:\" + (((c >> 6) & 63) | 128));\n Log.e(\"utf\", n + \" try:\" + ((c & 63) | 128));\n }\n\n }\n int i = 0;\n char chr1, chr2, chr3;\n int enc1, enc2, enc3, enc4;\n StringBuilder string = new StringBuilder();\n while (i < utftextlen) {\n chr1 = (char) utftext[i++];\n chr2 = (char) utftext[i++];\n chr3 = (char) utftext[i++];\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n string.append(_keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4));\n }\n string.append(\"\");\n return string.toString();\n }",
"private void _writeString(String text)\n/* */ throws IOException\n/* */ {\n/* 908 */ int len = text.length();\n/* 909 */ if (len > this._outputEnd) {\n/* 910 */ _writeLongString(text);\n/* 911 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 916 */ if (this._outputTail + len > this._outputEnd) {\n/* 917 */ _flushBuffer();\n/* */ }\n/* 919 */ text.getChars(0, len, this._outputBuffer, this._outputTail);\n/* */ \n/* 921 */ if (this._characterEscapes != null) {\n/* 922 */ _writeStringCustom(len);\n/* 923 */ } else if (this._maximumNonEscapedChar != 0) {\n/* 924 */ _writeStringASCII(len, this._maximumNonEscapedChar);\n/* */ } else {\n/* 926 */ _writeString2(len);\n/* */ }\n/* */ }",
"private void writeLength( ObjectOutput out, int len ) throws IOException\n {\n\t\tif (len <= 31)\n\t\t{\n\t\t\tout.write((byte) (0x80 | (len & 0xff)));\n\t\t}\n\t\telse if (len <= 0xFFFF)\n\t\t{\n\t\t\tout.write((byte) 0xA0);\n\t\t\tout.writeShort((short) len);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tout.write((byte) 0xC0);\n\t\t\tout.writeInt(len);\n\n\t\t}\n }",
"private void writeString( ByteBuffer byteBuffer, String string, int len )\n {\n if ( null == string )\n {\n string = \"\";\n }\n\n try\n {\n byte[] sbytes = string.getBytes( \"ASCII\" );\n\n // writeBytes will automatically zero-pad and thus terminate the\n // string.\n writeBytes( byteBuffer, sbytes, len );\n }\n catch ( UnsupportedEncodingException e )\n {\n // should not happen\n throw new RuntimeException( I18n.err( I18n.ERR_635 ), e );\n }\n }",
"void write(String s)\n\t\t{\n\t\t\tfor(int i = 0; i < sp; i++)\n\t\t\t\tXMLStream.print(\" \");\n\t\t\tXMLStream.println(\"<\" + s + \"/>\");\n\t\t}",
"private void _writeLongString(String text)\n/* */ throws IOException\n/* */ {\n/* 974 */ _flushBuffer();\n/* */ \n/* */ \n/* 977 */ int textLen = text.length();\n/* 978 */ int offset = 0;\n/* */ do {\n/* 980 */ int max = this._outputEnd;\n/* 981 */ int segmentLen = offset + max > textLen ? textLen - offset : max;\n/* */ \n/* 983 */ text.getChars(offset, offset + segmentLen, this._outputBuffer, 0);\n/* 984 */ if (this._characterEscapes != null) {\n/* 985 */ _writeSegmentCustom(segmentLen);\n/* 986 */ } else if (this._maximumNonEscapedChar != 0) {\n/* 987 */ _writeSegmentASCII(segmentLen, this._maximumNonEscapedChar);\n/* */ } else {\n/* 989 */ _writeSegment(segmentLen);\n/* */ }\n/* 991 */ offset += segmentLen;\n/* 992 */ } while (offset < textLen);\n/* */ }",
"void writeChars(char[] c, int off, int len) throws IOException;",
"public static void writeln(OutputStream out, String s) throws IOException {\n write(out,s+nl);\n }",
"public void writeNumber(short s)\n/* */ throws IOException\n/* */ {\n/* 602 */ _verifyValueWrite(\"write a number\");\n/* 603 */ if (this._cfgNumbersAsStrings) {\n/* 604 */ _writeQuotedShort(s);\n/* 605 */ return;\n/* */ }\n/* */ \n/* 608 */ if (this._outputTail + 6 >= this._outputEnd) {\n/* 609 */ _flushBuffer();\n/* */ }\n/* 611 */ this._outputTail = NumberOutput.outputInt(s, this._outputBuffer, this._outputTail);\n/* */ }",
"private void _writeString(char[] text, int offset, int len)\n/* */ throws IOException\n/* */ {\n/* 1049 */ if (this._characterEscapes != null) {\n/* 1050 */ _writeStringCustom(text, offset, len);\n/* 1051 */ return;\n/* */ }\n/* 1053 */ if (this._maximumNonEscapedChar != 0) {\n/* 1054 */ _writeStringASCII(text, offset, len, this._maximumNonEscapedChar);\n/* 1055 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1062 */ len += offset;\n/* 1063 */ int[] escCodes = this._outputEscapes;\n/* 1064 */ int escLen = escCodes.length;\n/* 1065 */ while (offset < len) {\n/* 1066 */ int start = offset;\n/* */ for (;;)\n/* */ {\n/* 1069 */ char c = text[offset];\n/* 1070 */ if ((c < escLen) && (escCodes[c] != 0)) {\n/* */ break;\n/* */ }\n/* 1073 */ offset++; if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1079 */ int newAmount = offset - start;\n/* 1080 */ if (newAmount < 32)\n/* */ {\n/* 1082 */ if (this._outputTail + newAmount > this._outputEnd) {\n/* 1083 */ _flushBuffer();\n/* */ }\n/* 1085 */ if (newAmount > 0) {\n/* 1086 */ System.arraycopy(text, start, this._outputBuffer, this._outputTail, newAmount);\n/* 1087 */ this._outputTail += newAmount;\n/* */ }\n/* */ } else {\n/* 1090 */ _flushBuffer();\n/* 1091 */ this._writer.write(text, start, newAmount);\n/* */ }\n/* */ \n/* 1094 */ if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ \n/* 1098 */ char c = text[(offset++)];\n/* 1099 */ _appendCharacterEscape(c, escCodes[c]);\n/* */ }\n/* */ }",
"void write(final Writer characterStream, final N source) throws IOException, XdmMarshalException;",
"public static void write(OutputStream out, String s) throws IOException {\n out.write(s.getBytes());\n }",
"public void write_string_variable(int size, String str) throws IOException {\n\n // Creem una seqüència amb la mida\n byte bHeader[] = new byte[size];\n String strHeader;\n int numBytes = 0;\n\n // Creem la capçalera amb el nombre de bytes que codifiquen la mida\n numBytes = str.length();\n\n strHeader = String.valueOf(numBytes);\n int len;\n if ((len = strHeader.length()) < size)\n for (int i = len; i < size; i++) {\n strHeader = \"0\" + strHeader;\n }\n for (int i = 0; i < size; i++)\n bHeader[i] = (byte) strHeader.charAt(i);\n // Enviem la capçalera\n dos.write(bHeader, 0, size);\n // Enviem l'string writeBytes de DataOutputStrem no envia el byte més alt dels chars.\n dos.writeBytes(str);\n }",
"String charWrite();",
"String shortWrite();",
"public void writeRaw(String text)\n/* */ throws IOException\n/* */ {\n/* 442 */ int len = text.length();\n/* 443 */ int room = this._outputEnd - this._outputTail;\n/* */ \n/* 445 */ if (room == 0) {\n/* 446 */ _flushBuffer();\n/* 447 */ room = this._outputEnd - this._outputTail;\n/* */ }\n/* */ \n/* 450 */ if (room >= len) {\n/* 451 */ text.getChars(0, len, this._outputBuffer, this._outputTail);\n/* 452 */ this._outputTail += len;\n/* */ } else {\n/* 454 */ writeRawLong(text);\n/* */ }\n/* */ }",
"void write(final OutputStream byteStream, final N source, String encoding) throws IOException, XdmMarshalException;",
"public void write(byte[] pBuf, int pOffset, int pLength)\n throws IOException {\n String strValue = null;\n if(characterEncoding != null && !\"\".equals(characterEncoding)) {\n try {\n strValue = new String(pBuf, pOffset, pLength, characterEncoding);\n }\n catch(UnsupportedEncodingException uee) {\n // ignore and allow the null to handle.\n }\n }\n\n if(strValue == null) {\n strValue = new String(pBuf, pOffset, pLength);\n }\n\n mPrintWriter.write(strValue);\n }",
"public int writeString(String src) {\n // Convert the argument strings to ASCII\n byte[] srcAsBytes;\n src += \"\\r\";\n try {\n srcAsBytes = src.getBytes(\"US-ASCII\");\n } catch (UnsupportedEncodingException e) {\n // Very very unlikely in the near-scope of the project.\n return -1;\n }\n print(\"Wrote :\" + src + \":\");\n return write(srcAsBytes);\n }",
"public void setString_data(String s) { \n int len = s.length();\n int i;\n for (i = 0; i < len; i++) {\n setElement_data(i, (short)s.charAt(i));\n }\n setElement_data(i, (short)0); //null terminate\n }",
"@Override // com.google.protobuf.Utf8.Processor\n public int encodeUtf8(CharSequence in, byte[] out, int offset, int length) {\n char c;\n int utf16Length = in.length();\n int i = 0;\n int limit = offset + length;\n while (i < utf16Length && i + offset < limit && (c = in.charAt(i)) < 128) {\n out[offset + i] = (byte) c;\n i++;\n }\n if (i == utf16Length) {\n return offset + utf16Length;\n }\n int j = offset + i;\n while (i < utf16Length) {\n char c2 = in.charAt(i);\n if (c2 < 128 && j < limit) {\n out[j] = (byte) c2;\n j++;\n } else if (c2 < 2048 && j <= limit - 2) {\n int j2 = j + 1;\n out[j] = (byte) ((c2 >>> 6) | 960);\n j = j2 + 1;\n out[j2] = (byte) ((c2 & '?') | 128);\n } else if ((c2 < 55296 || 57343 < c2) && j <= limit - 3) {\n int j3 = j + 1;\n out[j] = (byte) ((c2 >>> '\\f') | 480);\n int j4 = j3 + 1;\n out[j3] = (byte) (((c2 >>> 6) & 63) | 128);\n out[j4] = (byte) ((c2 & '?') | 128);\n j = j4 + 1;\n } else if (j <= limit - 4) {\n if (i + 1 != in.length()) {\n i++;\n char low = in.charAt(i);\n if (Character.isSurrogatePair(c2, low)) {\n int codePoint = Character.toCodePoint(c2, low);\n int j5 = j + 1;\n out[j] = (byte) ((codePoint >>> 18) | PageId.FINGERPRINT_ENROLLING_VALUE);\n int j6 = j5 + 1;\n out[j5] = (byte) (((codePoint >>> 12) & 63) | 128);\n int j7 = j6 + 1;\n out[j6] = (byte) (((codePoint >>> 6) & 63) | 128);\n j = j7 + 1;\n out[j7] = (byte) ((codePoint & 63) | 128);\n }\n }\n throw new UnpairedSurrogateException(i - 1, utf16Length);\n } else if (55296 > c2 || c2 > 57343 || (i + 1 != in.length() && Character.isSurrogatePair(c2, in.charAt(i + 1)))) {\n throw new ArrayIndexOutOfBoundsException(\"Failed writing \" + c2 + \" at index \" + j);\n } else {\n throw new UnpairedSurrogateException(i, utf16Length);\n }\n i++;\n }\n return j;\n }",
"default NettyOutbound sendString(Publisher<? extends String> dataStream,\n\t\t\tCharset charset) {\n\t\tObjects.requireNonNull(charset, \"charset\");\n\t\treturn send(ReactorNetty.publisherOrScalarMap(\n\t\t\t\tdataStream, s -> {\n\t\t\t\t ByteBuf buffer = alloc().buffer();\n\t\t\t\t buffer.writeCharSequence(s, charset);\n\t\t\t\t return buffer;\n\t\t\t\t}));\n\t}",
"@Override // com.google.protobuf.Utf8.Processor\n public void encodeUtf8Direct(CharSequence in, ByteBuffer out) {\n char c;\n long j;\n long outIx;\n long outLimit;\n long outIx2;\n char c2;\n long address = addressOffset(out);\n long outIx3 = ((long) out.position()) + address;\n long outLimit2 = ((long) out.limit()) + address;\n int inLimit = in.length();\n if (((long) inLimit) <= outLimit2 - outIx3) {\n int inIx = 0;\n while (true) {\n c = 128;\n j = 1;\n if (inIx < inLimit) {\n char c3 = in.charAt(inIx);\n if (c3 >= 128) {\n break;\n }\n UNSAFE.putByte(outIx3, (byte) c3);\n inIx++;\n outIx3 = 1 + outIx3;\n } else {\n break;\n }\n }\n if (inIx == inLimit) {\n out.position((int) (outIx3 - address));\n return;\n }\n while (inIx < inLimit) {\n char c4 = in.charAt(inIx);\n if (c4 < c && outIx3 < outLimit2) {\n UNSAFE.putByte(outIx3, (byte) c4);\n outLimit = outLimit2;\n outIx3 += j;\n c2 = 128;\n outIx = 1;\n outIx2 = address;\n } else if (c4 >= 2048 || outIx3 > outLimit2 - 2) {\n outIx2 = address;\n if ((c4 < 55296 || 57343 < c4) && outIx3 <= outLimit2 - 3) {\n long outIx4 = outIx3 + 1;\n UNSAFE.putByte(outIx3, (byte) ((c4 >>> '\\f') | 480));\n long outIx5 = outIx4 + 1;\n UNSAFE.putByte(outIx4, (byte) (((c4 >>> 6) & 63) | 128));\n UNSAFE.putByte(outIx5, (byte) ((c4 & '?') | 128));\n outLimit = outLimit2;\n outIx3 = outIx5 + 1;\n c2 = 128;\n outIx = 1;\n } else if (outIx3 <= outLimit2 - 4) {\n if (inIx + 1 != inLimit) {\n inIx++;\n char low = in.charAt(inIx);\n if (Character.isSurrogatePair(c4, low)) {\n int codePoint = Character.toCodePoint(c4, low);\n outLimit = outLimit2;\n long outIx6 = outIx3 + 1;\n UNSAFE.putByte(outIx3, (byte) ((codePoint >>> 18) | PageId.FINGERPRINT_ENROLLING_VALUE));\n long outIx7 = outIx6 + 1;\n UNSAFE.putByte(outIx6, (byte) (((codePoint >>> 12) & 63) | 128));\n long outIx8 = outIx7 + 1;\n c2 = 128;\n UNSAFE.putByte(outIx7, (byte) (((codePoint >>> 6) & 63) | 128));\n outIx = 1;\n outIx3 = outIx8 + 1;\n UNSAFE.putByte(outIx8, (byte) ((codePoint & 63) | 128));\n }\n }\n throw new UnpairedSurrogateException(inIx - 1, inLimit);\n } else if (55296 > c4 || c4 > 57343 || (inIx + 1 != inLimit && Character.isSurrogatePair(c4, in.charAt(inIx + 1)))) {\n throw new ArrayIndexOutOfBoundsException(\"Failed writing \" + c4 + \" at index \" + outIx3);\n } else {\n throw new UnpairedSurrogateException(inIx, inLimit);\n }\n } else {\n outIx2 = address;\n long outIx9 = outIx3 + 1;\n UNSAFE.putByte(outIx3, (byte) ((c4 >>> 6) | 960));\n outIx3 = outIx9 + 1;\n UNSAFE.putByte(outIx9, (byte) ((c4 & '?') | 128));\n outLimit = outLimit2;\n c2 = 128;\n outIx = 1;\n }\n inIx++;\n c = c2;\n address = outIx2;\n outLimit2 = outLimit;\n j = outIx;\n }\n out.position((int) (outIx3 - address));\n return;\n }\n throw new ArrayIndexOutOfBoundsException(\"Failed writing \" + in.charAt(inLimit - 1) + \" at index \" + out.limit());\n }",
"private void _writeStringASCII(int len, int maxNonEscaped)\n/* */ throws IOException, JsonGenerationException\n/* */ {\n/* 1117 */ int end = this._outputTail + len;\n/* 1118 */ int[] escCodes = this._outputEscapes;\n/* 1119 */ int escLimit = Math.min(escCodes.length, maxNonEscaped + 1);\n/* 1120 */ int escCode = 0;\n/* */ \n/* */ \n/* 1123 */ while (this._outputTail < end)\n/* */ {\n/* */ char c;\n/* */ do\n/* */ {\n/* 1128 */ c = this._outputBuffer[this._outputTail];\n/* 1129 */ if (c < escLimit) {\n/* 1130 */ escCode = escCodes[c];\n/* 1131 */ if (escCode != 0) {\n/* */ break;\n/* */ }\n/* 1134 */ } else if (c > maxNonEscaped) {\n/* 1135 */ escCode = -1;\n/* 1136 */ break;\n/* */ }\n/* 1138 */ } while (++this._outputTail < end);\n/* 1139 */ break;\n/* */ \n/* */ \n/* 1142 */ int flushLen = this._outputTail - this._outputHead;\n/* 1143 */ if (flushLen > 0) {\n/* 1144 */ this._writer.write(this._outputBuffer, this._outputHead, flushLen);\n/* */ }\n/* 1146 */ this._outputTail += 1;\n/* 1147 */ _prependOrWriteCharacterEscape(c, escCode);\n/* */ }\n/* */ }",
"public void write(String s) throws IOException {\n\t\tString logmsg = toString() + \".write(\" + s + \")\";\n\t\t_log.trace(logmsg);\n\n\t\ttry {\n\t\t\t_commandLine.write(s);\n\n\t\t\t// FIXME: Do we need both CR and LF ?\n\t\t\t_commandLine.write(Ascii.CR);\n\t\t\t_commandLine.write(Ascii.LF);\n\t\t}\n\t\tcatch(IOException ioe) {\n\t\t\t_log.error(logmsg,ioe);\n\t\t\tthrow(ioe);\n\t\t}\n\t}",
"protected void print(Object s) throws IOException {\n out.write(Convert.escapeUnicode(s.toString()));\n }",
"@Override // com.google.protobuf.Utf8.Processor\n public int encodeUtf8(CharSequence in, byte[] out, int offset, int length) {\n char c;\n long j;\n long j2;\n long outLimit;\n String str;\n String str2;\n char c2;\n long outIx = (long) (ARRAY_BASE_OFFSET + offset);\n long outLimit2 = ((long) length) + outIx;\n int inLimit = in.length();\n String str3 = \" at index \";\n String str4 = \"Failed writing \";\n if (inLimit > length || out.length - length < offset) {\n throw new ArrayIndexOutOfBoundsException(str4 + in.charAt(inLimit - 1) + str3 + (offset + length));\n }\n int inIx = 0;\n while (true) {\n c = 128;\n j = 1;\n if (inIx < inLimit) {\n char c3 = in.charAt(inIx);\n if (c3 >= 128) {\n break;\n }\n UNSAFE.putByte(out, outIx, (byte) c3);\n inIx++;\n outIx = 1 + outIx;\n } else {\n break;\n }\n }\n if (inIx == inLimit) {\n return (int) (outIx - ((long) ARRAY_BASE_OFFSET));\n }\n while (inIx < inLimit) {\n char c4 = in.charAt(inIx);\n if (c4 < c && outIx < outLimit2) {\n UNSAFE.putByte(out, outIx, (byte) c4);\n str2 = str3;\n outIx += j;\n j2 = 1;\n outLimit = outLimit2;\n str = str4;\n c2 = 128;\n } else if (c4 >= 2048 || outIx > outLimit2 - 2) {\n if (c4 >= 55296 && 57343 >= c4) {\n str2 = str3;\n str = str4;\n } else if (outIx <= outLimit2 - 3) {\n str2 = str3;\n str = str4;\n long outIx2 = outIx + 1;\n UNSAFE.putByte(out, outIx, (byte) ((c4 >>> '\\f') | 480));\n long outIx3 = outIx2 + 1;\n UNSAFE.putByte(out, outIx2, (byte) (((c4 >>> 6) & 63) | 128));\n UNSAFE.putByte(out, outIx3, (byte) ((c4 & '?') | 128));\n outLimit = outLimit2;\n outIx = outIx3 + 1;\n c2 = 128;\n j2 = 1;\n } else {\n str2 = str3;\n str = str4;\n }\n if (outIx <= outLimit2 - 4) {\n if (inIx + 1 != inLimit) {\n inIx++;\n char low = in.charAt(inIx);\n if (Character.isSurrogatePair(c4, low)) {\n int codePoint = Character.toCodePoint(c4, low);\n outLimit = outLimit2;\n long outIx4 = outIx + 1;\n UNSAFE.putByte(out, outIx, (byte) ((codePoint >>> 18) | PageId.FINGERPRINT_ENROLLING_VALUE));\n long outIx5 = outIx4 + 1;\n UNSAFE.putByte(out, outIx4, (byte) (((codePoint >>> 12) & 63) | 128));\n long outIx6 = outIx5 + 1;\n c2 = 128;\n UNSAFE.putByte(out, outIx5, (byte) (((codePoint >>> 6) & 63) | 128));\n j2 = 1;\n UNSAFE.putByte(out, outIx6, (byte) ((codePoint & 63) | 128));\n outIx = outIx6 + 1;\n }\n }\n throw new UnpairedSurrogateException(inIx - 1, inLimit);\n } else if (55296 > c4 || c4 > 57343 || (inIx + 1 != inLimit && Character.isSurrogatePair(c4, in.charAt(inIx + 1)))) {\n throw new ArrayIndexOutOfBoundsException(str + c4 + str2 + outIx);\n } else {\n throw new UnpairedSurrogateException(inIx, inLimit);\n }\n } else {\n long outIx7 = outIx + 1;\n UNSAFE.putByte(out, outIx, (byte) ((c4 >>> 6) | 960));\n UNSAFE.putByte(out, outIx7, (byte) ((c4 & '?') | 128));\n str2 = str3;\n outIx = outIx7 + 1;\n j2 = 1;\n outLimit = outLimit2;\n str = str4;\n c2 = 128;\n }\n inIx++;\n c = c2;\n str3 = str2;\n str4 = str;\n outLimit2 = outLimit;\n j = j2;\n }\n return (int) (outIx - ((long) ARRAY_BASE_OFFSET));\n }",
"public void writeShort(short i) throws IOException {\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"private void writeStream(OutputStream os, String out) {\n try {\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, \"utf-8\"));\n writer.write(out);\n writer.flush();\n writer.close();\n os.close();\n } catch (IOException e) {\n }\n }",
"public void enviarTexto(String n,String s) {\r\n \t try {\r\n \t\t\t//dos = new DataOutputStream( socket.getOutputStream() );\r\n \t\t\t//System.out.println(s);\r\n \t\t\tdos.writeInt(Integer.valueOf(n));\r\n \t\t\tdos.flush();\r\n // Enviamos el nombre del archivo \r\n \t\t\tdos.writeUTF( s ); \r\n \tdos.flush();\r\n \tdos.close();\r\n \tsocket.close();\r\n \t\t} catch (IOException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\tSystem.out.println(\"------------ERROR AL ENVIAR SQL----------\");\r\n \t\t}//\r\n }",
"protected final void write(char c) throws IOException {\n\t\toutput.write(c);\n\t}",
"public static final void transcodeAndWrite(byte[] input, \r\n java.io.OutputStream os,\r\n int offset, int length, int input_encoding, int output_encoding)\r\n throws TranscodeException,\r\n IOException {\n int k = offset;\r\n int c;\r\n while (k < offset + length) {\r\n long l = decode(input, k, input_encoding);\r\n k = (int) (l >> 32);\r\n c = (int) l;\r\n encodeAndWrite(os, c, output_encoding);\r\n }\r\n }",
"private static void writeLength(ByteBuffer buffer, int length) {\n RuntimeAssertionError.assertTrue(length <= (int)Short.MAX_VALUE);\n buffer.putShort((short)length);\n }",
"void writeShort(int v) throws IOException;",
"private byte[] setStringSize(StringBuffer s, int n) {\n\n byte b[];\n int i, slen;\n\n slen = s.length();\n\n if (slen >= n) {\n return (s.toString().substring(0, n).getBytes());\n }\n\n b = new byte[n];\n for (i = 0; i < slen; i++) {\n b[i] = (byte) s.charAt(i);\n }\n for (i = slen; i < n; i++) {\n b[i] = 0;\n }\n\n return (b);\n }",
"public static void printShortBinary(short s) {\n\t\tbyte t;\n\t\tbyte b;\n\t\t// Use bit shifting and masking (&) to save the first\n\t\t// 8 bits of s in one byte, and the second 8 bits of\n\t\t// s in the other byte\n\t\tt = (byte)(s>>8);\n\t\tb = (byte)(s&0b00001111);\n\t\t// Call printByteBinary twice using the two bytes\n\t\t// Make sure they are in the correct order\n\t\tprintByteBinary(t);\n\t\tprintByteBinary(b);\n\t}",
"public void write(char[] charArray, int offset, int length) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(charArray, offset, length);\r\n }",
"@Override\r\n\tpublic Buffer setUnsignedShort(int pos, int s) {\n\t\treturn null;\r\n\t}",
"private final void _writeNull()\n/* */ throws IOException\n/* */ {\n/* 1610 */ if (this._outputTail + 4 >= this._outputEnd) {\n/* 1611 */ _flushBuffer();\n/* */ }\n/* 1613 */ int ptr = this._outputTail;\n/* 1614 */ char[] buf = this._outputBuffer;\n/* 1615 */ buf[ptr] = 'n';\n/* 1616 */ buf[(++ptr)] = 'u';\n/* 1617 */ buf[(++ptr)] = 'l';\n/* 1618 */ buf[(++ptr)] = 'l';\n/* 1619 */ this._outputTail = (ptr + 1);\n/* */ }",
"private void _writeStringCustom(int len)\n/* */ throws IOException, JsonGenerationException\n/* */ {\n/* 1261 */ int end = this._outputTail + len;\n/* 1262 */ int[] escCodes = this._outputEscapes;\n/* 1263 */ int maxNonEscaped = this._maximumNonEscapedChar < 1 ? 65535 : this._maximumNonEscapedChar;\n/* 1264 */ int escLimit = Math.min(escCodes.length, maxNonEscaped + 1);\n/* 1265 */ int escCode = 0;\n/* 1266 */ CharacterEscapes customEscapes = this._characterEscapes;\n/* */ \n/* */ \n/* 1269 */ while (this._outputTail < end)\n/* */ {\n/* */ char c;\n/* */ do\n/* */ {\n/* 1274 */ c = this._outputBuffer[this._outputTail];\n/* 1275 */ if (c < escLimit) {\n/* 1276 */ escCode = escCodes[c];\n/* 1277 */ if (escCode != 0)\n/* */ break;\n/* */ } else {\n/* 1280 */ if (c > maxNonEscaped) {\n/* 1281 */ escCode = -1;\n/* 1282 */ break;\n/* */ }\n/* 1284 */ if ((this._currentEscape = customEscapes.getEscapeSequence(c)) != null) {\n/* 1285 */ escCode = -2;\n/* 1286 */ break;\n/* */ }\n/* */ }\n/* 1289 */ } while (++this._outputTail < end);\n/* 1290 */ break;\n/* */ \n/* */ \n/* 1293 */ int flushLen = this._outputTail - this._outputHead;\n/* 1294 */ if (flushLen > 0) {\n/* 1295 */ this._writer.write(this._outputBuffer, this._outputHead, flushLen);\n/* */ }\n/* 1297 */ this._outputTail += 1;\n/* 1298 */ _prependOrWriteCharacterEscape(c, escCode);\n/* */ }\n/* */ }",
"public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}",
"public void write(String string) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(string);\r\n }",
"private static byte[] addLengthOctet(String s)\n {\n byte buf[], buf2[];\n\n buf = s.getBytes();\n buf2 = new byte[buf.length + 1];\n System.arraycopy(buf, 0, buf2, 1, buf.length);\n buf2[0] = (byte)buf.length;\n\n return buf2;\n }",
"public void sendPlayerName(String s) {\n try {\n dOut.writeUTF(s);\n dOut.flush();\n } catch (IOException e) {\n System.out.println(\"Could not send player name\");\n e.printStackTrace();\n }\n }",
"private StringBuffer encodes( StringBuffer io2Append, String i2Encode, int iLength, char iType)\n \t{\n \t\tiLength = iLength < i2Encode.length() ? iLength : i2Encode.length();\n \t\tio2Append.ensureCapacity( iLength * 4 / 3 + 6);\n \t\tint i = 0;\n \t\tchar[] lTranslationTable = iType == 'u' ? uu_table : b64_table;\n \t\tchar lPadding;\n \t\tchar[] l2Encode = i2Encode.toCharArray();\n \t\tif (iType == 'u') {\n \t\t\tif (iLength >= lTranslationTable.length)\n \t\t\t\tthrow new ArgumentError(ruby, \"\" + iLength + \" is not a correct value for the number of bytes per line in a u directive. Correct values range from 0 to \" + lTranslationTable.length);\n \t\t\tio2Append.append(lTranslationTable[iLength]);\n \t\t\tlPadding = '`';\n \t\t}\n \t\telse {\n \t\t\tlPadding = '=';\n \t\t}\n \t\twhile (iLength >= 3) {\n \t\t\tchar lCurChar = l2Encode[i++];\n \t\t\tchar lNextChar = l2Encode[i++];\n \t\t\tchar lNextNextChar = l2Encode[i++];\n \t\t\tio2Append.append(lTranslationTable[077 & (lCurChar >>> 2)]);\n \t\t\tio2Append.append(lTranslationTable[077 & (((lCurChar << 4) & 060) | ((lNextChar >>> 4) & 017))]);\n \t\t\tio2Append.append(lTranslationTable[077 & (((lNextChar << 2) & 074) | ((lNextNextChar >>> 6) & 03))]);\n \t\t\tio2Append.append(lTranslationTable[077 & lNextNextChar]);\n \t\t\tiLength -= 3;\n \t\t}\n \t\tif (iLength == 2) {\n \t\t\tchar lCurChar = l2Encode[i++];\n \t\t\tchar lNextChar = l2Encode[i++];\n \t\t\tio2Append.append(lTranslationTable[077 & (lCurChar >>> 2)]);\n \t\t\tio2Append.append(lTranslationTable[077 & (((lCurChar << 4) & 060) | ((lNextChar >> 4) & 017))]);\n \t\t\tio2Append.append(lTranslationTable[077 & (((lNextChar << 2) & 074) | (('\\0' >> 6) & 03))]);\n \t\t\tio2Append.append(lPadding);\n \t\t}\n \t\telse if (iLength == 1) {\n \t\t\tchar lCurChar = l2Encode[i++];\n \t\t\tio2Append.append(lTranslationTable[077 & (lCurChar >>> 2)]);\n \t\t\tio2Append.append(lTranslationTable[077 & (((lCurChar << 4) & 060) | (('\\0' >>> 4) & 017))]);\n \t\t\tio2Append.append(lPadding);\n \t\t\tio2Append.append(lPadding);\n \t\t}\n \t\tio2Append.append('\\n');\n \t\treturn io2Append;\n \t}",
"public void sendMsg(OutputStream os, String s) throws IOException {\r\n\t byte[] bytes = s.getBytes();\r\n\t os.write(bytes);\r\n\t os.flush();\r\n\t }",
"void write (char ch, int offset);",
"public WriteChars(Writer writer, boolean close) {\n this.writer = writer;\n this.close = close;\n }",
"protected void send(String s) throws IOException {\n\t\t// Send string to browser.\n\t\t// Log.debug(\"Adapter: sending: \" + s);\n\t\tif (servletOut == null) {\n\t\t\tthrow new IOException(\"Client adapter was stopped\");\n\t\t}\n\n\t\tservletOut.print(s);\n\n\t\tservletOut.flush();\n\n\t\t// Note: this doesn't seem to have effect\n\t\t// in Tomcat 4/5 if the client already disconnected.\n\t\tservletRsp.flushBuffer();\n\n\t\tbytesSent += s.length();\n\t\tLog.debug(\"bytesSent= \" + bytesSent);\n\t\t// Log.debug(\"BCA sent event: \" + s);\n\t}",
"@Override\n\tpublic void write(DataOutput arg0) throws IOException {\n\t\targ0.writeUTF(first);\n\t\targ0.writeUTF(second);\n\t}",
"private void writeData(Socket s, String cmd){\n\t\ttry {\n\t\t\tDataOutputStream dos = new DataOutputStream(s.getOutputStream());\n\t\t\tdos.writeUTF(cmd);\n\t\t} catch (Exception e) {\n\t\t\tJOptionPane.showMessageDialog(main, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}",
"protected void writeln(String s)\n {\n out.println(s);\n }",
"public SpookyHashStream putUTF8(String src) {\n\t\treturn put(src.getBytes(UTF8));\n\t}",
"void writeChar(char value);",
"public synchronized void write(String data){\n\t\tlog.debug(\"[SC] Writing \"+data, 4);\n\t\twriteBuffer.add(data.getBytes());\n\t}",
"@Override\r\n\tpublic Buffer setShort(int pos, short s) {\n\t\treturn null;\r\n\t}",
"public void writeUnsignedByte(int i) throws IOException {\r\n\t\tthis.writeByte(i);\r\n\t\t// this.writeByte((byte) (i % 128));\r\n\t}",
"void writeShort(short value);",
"public void write(byte[] b) throws IOException\n {\n for(int i = 0; i < 12; i++) // write the first 12 bytes to the OutPutStream [row, row, column, column, S(r), S(r), S(c), S(c), G(r), G(r), G(c), G(c), ..]\n {\n this.out.write(b[i]);\n }\n int counter = 0;\n String s = \"\";\n int lastIter = 7;\n for(int i = 12; i < b.length; i++)\n {\n s += b[i];\n counter++;\n if((counter == 7) || (i == b.length - 1))\n {\n if(i == b.length - 1)\n {\n lastIter = counter;\n }\n byte binaryByte = (byte)(int)Integer.valueOf(s, 2);\n this.out.write(binaryByte);\n counter = 0;\n s = \"\";\n }\n }\n this.out.write(lastIter);\n }",
"public void sendString(String s) throws IOException{\n\t\tbyte[] b = s.getBytes();\n\t\tDatagramPacket packet = new DatagramPacket(b, b.length, mIP, port);\n\t\tmSocket.send(packet);\n\t}",
"@Override\n\tpublic String memUTF8String(DirectBuffer buffer, int length) {\n\t\tif (length == -1)\n\t\t\tthrow new IllegalArgumentException(\"Illegal length\");\n\t\ttry {\n\t\t\treturn UTF8_DECODER.decode(NioByteBufferWrapper.wrap(buffer, length)).toString();\n\t\t} catch (CharacterCodingException e) {\n\t\t\treturn CHARACTER_CODING_EXCEPTION;\n\t\t}\n\t}",
"public void write(String str, int off, int len) throws IOException {\n ensureOpen();\n if ((off < 0) || (off > str.length()) || (len < 0) ||\n ((off + len) > str.length()) || ((off + len) < 0)) {\n throw new IndexOutOfBoundsException();\n } else if (len == 0) {\n return;\n }\n out.write(str, off, len);\n }",
"protected void println(String string) {\n this.output.println(string);\n this.dataSize += (string.getBytes().length);\n }",
"public void write(DataOutput output) throws IOException {\n output.writeUTF(this.data);\n }",
"protected void writeString(String str, DataOutput out) throws IOException {\n out.writeBoolean(str!=null);\n if (str!=null)\n out.writeUTF(str);\n }",
"private void printOut(String s)\n {\n outVideo.println(s);\n outVideo.flush();\n }",
"public static String toUtf8String(String s) {\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\tchar c = s.charAt(i);\n\t\t\tif (c >= 0 && c <= 255) {\n\t\t\t\tsb.append(c);\n\t\t\t} else {\n\t\t\t\tbyte[] b;\n\t\t\t\ttry {\n\t\t\t\t\tb = Character.toString(c).getBytes(\"utf-8\");\n\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\tSystem.out.println(ex);\n\t\t\t\t\tb = new byte[0];\n\t\t\t\t}\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tint k = b[j];\n\t\t\t\t\tif (k < 0)\n\t\t\t\t\t\tk += 256;\n\t\t\t\t\tsb.append(\"%\" + Integer.toHexString(k).toUpperCase());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"private void convertToString(String s)\n\t{\n\t\tchar chars[] = s.toCharArray();\n\t\tfor(int i = 0; i < chars.length; i+=3)\n\t\t{\n\t\t\tString temp = \"\";\n\t\t\ttemp += chars[i];\n\t\t\ttemp += chars[i+1];\n\t\t\tif(chars[i] < '3')\n\t\t\t{\n\t\t\t\ttemp += chars[i+2];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ti -= 1;\n\t\t\t}\n\t\t\t\n\t\t\tif(!temp.equals(\"256\"))\n\t\t\t{\n\t\t\t\tmyDecryptedMessage += (char)(Integer.parseInt(temp));\n\t\t\t}\n\t\t}\n\t}",
"private static String readNullPaddedString(ByteBuffer data, int length) {\n byte[] bytes = new byte[length];\n data.get(bytes);\n int stringLength = bytes.length - 1;\n while (stringLength > 0 && bytes[stringLength] == 0) {\n stringLength--;\n }\n return new String(bytes, 0, stringLength+1, Charset.forName(\"utf-8\"));\n }",
"public static byte[] shortToBytes(short s) {\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(NUM_BYTES_IN_SHORT);\n byteBuffer.putShort(s);\n return byteBuffer.array();\n\n }",
"private synchronized void write(RecordOutputStream s) throws IOException {\r\n s.writeIntCompressed(originalNamesToFixedNames.size());\r\n for (final Map.Entry<String, String> entry : originalNamesToFixedNames.entrySet()) { \r\n s.writeUTF(entry.getKey());\r\n s.writeUTF(entry.getValue());\r\n }\r\n }",
"void writeString(String value);",
"private static String makeCorrectSize(String s, int length){\n\t\tStringBuilder sb = new StringBuilder(s); \n\t\tfor(int i = sb.length(); i<length; i++){\n sb.append(\" \");\n }\n\t\treturn sb.toString(); \n\n\t}",
"public StreamWriter write(short value)\r\n {\r\n \tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n \t}else{\r\n _buffer[0] = (byte)(value >> 8);\r\n _buffer[1] = (byte)value;\r\n \t}\r\n _stream.write(_buffer,0,2);\r\n\t\treturn this;\r\n }",
"public void encode(int c, Writer out)\n throws IOException {\n out.write(c);\n }",
"protected void print(String string) {\n this.output.print(string);\n this.dataSize += (string.getBytes().length);\n }",
"public static int shortToBytes(short s, byte bc[], int index) {\n bc[index++] = (byte) ((s >> 8) & 0xff);\n bc[index++] = (byte) (s & 0xff);\n return index;\n }",
"public void write(char[] b, int off, int len) throws IOException {\n\t\t\tif (!initialized) {\n\t\t\t\tarea.setText(\"\");\n\t\t\t\tinitialized = true;\n\t\t\t}\n\t\t\tString str = new String(b, off, len);\n\t\t\tStringBuffer sb = new StringBuffer(len);\n\t\t\twhile (str != null && str.length() > 0) {\n\t\t\t\tif (lastCR && str.charAt(0) == '\\n')\n\t\t\t\t\tstr = str.substring(1);\n\t\t\t\tint crIndex = str.indexOf('\\r');\n\t\t\t\tif (crIndex >= 0) {\n\t\t\t\t\tsb.append(str.substring(0, crIndex));\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tstr = str.substring(crIndex + 1);\n\t\t\t\t\tlastCR = true;\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(str);\n\t\t\t\t\tstr = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tarea.append(sb.toString());\n\t\t}"
] | [
"0.60529",
"0.6052315",
"0.59357715",
"0.5933046",
"0.5912733",
"0.590349",
"0.57681537",
"0.5723749",
"0.57235354",
"0.57211673",
"0.56666535",
"0.5659185",
"0.56244445",
"0.56060934",
"0.5578239",
"0.5522024",
"0.549968",
"0.5462666",
"0.5425828",
"0.5420467",
"0.54116464",
"0.53553456",
"0.53432876",
"0.5272336",
"0.52670133",
"0.5195307",
"0.5190117",
"0.5126264",
"0.51026726",
"0.50678676",
"0.50626665",
"0.50598943",
"0.50547373",
"0.5027274",
"0.5023482",
"0.5002246",
"0.4994155",
"0.49922317",
"0.49815476",
"0.49729046",
"0.496622",
"0.49633113",
"0.49630943",
"0.4949026",
"0.49297652",
"0.49210495",
"0.49199075",
"0.48943898",
"0.48941258",
"0.4873707",
"0.485256",
"0.48364097",
"0.48358527",
"0.48237252",
"0.48145998",
"0.48104265",
"0.481039",
"0.4792101",
"0.47843435",
"0.47821957",
"0.4781389",
"0.47772187",
"0.47651947",
"0.47616035",
"0.47582796",
"0.47391936",
"0.47316298",
"0.47274172",
"0.47205293",
"0.47047824",
"0.46944633",
"0.46838415",
"0.46808773",
"0.46806523",
"0.46795994",
"0.46701023",
"0.466357",
"0.4635785",
"0.46354958",
"0.46313363",
"0.4620828",
"0.4602891",
"0.45980275",
"0.45922825",
"0.4584462",
"0.45642206",
"0.45535275",
"0.45506564",
"0.4547881",
"0.45445254",
"0.4541862",
"0.45321977",
"0.45316815",
"0.45237625",
"0.4521622",
"0.45179883",
"0.45108625",
"0.4509191",
"0.45007148",
"0.4496374"
] | 0.6659753 | 0 |
Writes a sequence of shorts to the stream at the current position. If len is 0, nothing is written. The short s[off] is written first, then the short s[off + 1], and so on. The byte order of the stream is used to determine the order in which the individual bytes are written. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeShorts(short[] s, int off, int len) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"void writeShort(short value);",
"void writeShort(int v) throws IOException;",
"public void write( short[] array, int firstIndex, int numShorts )\n\t{\n\t\tint numShortsLeft = numShorts;\n\t\tint shortsInBuffer = buffer.length >> 1;\n\t\tint shortIndex = firstIndex;\n\t\twhile( numShortsLeft > 0 )\n\t\t{\n\t\t\tint numShortsToWrite = (numShortsLeft < shortsInBuffer) ? numShortsLeft\n\t\t\t\t\t: shortsInBuffer;\n\n\t\t\tint byteIndex = 0;\n\t\t\tfor( int i = 0; i < numShortsToWrite; i++ )\n\t\t\t{\n\t\t\t\tshort sample = array[shortIndex++];\n\t\t\t\tbuffer[byteIndex++] = (byte) (sample);\n\t\t\t\tbuffer[byteIndex++] = (byte) (sample >> 8);\n\t\t\t}\n\t\t\tnumShortsLeft -= numShortsToWrite;\n\n\t\t\t// Shift by one to convert shorts to bytes.\n\t\t\tbyteArray.write( buffer, 0, byteIndex );\n\t\t}\n\t}",
"public void writeShort(short i) throws IOException {\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"@Override\r\n\tpublic Buffer setShort(int pos, short s) {\n\t\treturn null;\r\n\t}",
"public StreamWriter write(short value)\r\n {\r\n \tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n \t}else{\r\n _buffer[0] = (byte)(value >> 8);\r\n _buffer[1] = (byte)value;\r\n \t}\r\n _stream.write(_buffer,0,2);\r\n\t\treturn this;\r\n }",
"@Override\r\n\tpublic Buffer setUnsignedShort(int pos, int s) {\n\t\treturn null;\r\n\t}",
"public int read(short[] s, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 2) {\n\t\t\t\t\tfillBuf(2);\n\t\t\t\t}\n\t\t\t\ts[i] = (short) (buf[pos] << 8 | (buf[pos + 1] & 0xFF));\n\t\t\t\tpos += 2;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 2);\n\t\t}\n\t\treturn 2 * len;\n\t}",
"@Override\r\n\tpublic Buffer appendUnsignedShort(int s) {\n\t\treturn null;\r\n\t}",
"public void writeSamples( short[] samples, int offset, int numSamples );",
"public static void printShortBinary(short s) {\n\t\tbyte t;\n\t\tbyte b;\n\t\t// Use bit shifting and masking (&) to save the first\n\t\t// 8 bits of s in one byte, and the second 8 bits of\n\t\t// s in the other byte\n\t\tt = (byte)(s>>8);\n\t\tb = (byte)(s&0b00001111);\n\t\t// Call printByteBinary twice using the two bytes\n\t\t// Make sure they are in the correct order\n\t\tprintByteBinary(t);\n\t\tprintByteBinary(b);\n\t}",
"public final void writeShort(final short data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer2[0] = (byte) (data >>> 8);\r\n byteBuffer2[1] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer2[0] = (byte) (data & 0xff);\r\n byteBuffer2[1] = (byte) (data >>> 8);\r\n }\r\n\r\n raFile.write(byteBuffer2);\r\n }",
"public void writeUnsignedShortLittleEndian(int i) throws IOException {\r\n\t\tshort s = (short) (i & 0x0000ffff);\r\n\t\tthis.writeShort(Short.reverseBytes(s));\r\n\t}",
"public static int shortToBytes(short s, byte bc[], int index) {\n bc[index++] = (byte) ((s >> 8) & 0xff);\n bc[index++] = (byte) (s & 0xff);\n return index;\n }",
"public static int writeShort(OutputStream target, short value) throws IOException {\n target.write((byte) (value >>> 8 & 255));\n target.write((byte) (value & 255));\n return Short.BYTES;\n }",
"public ByteBuf writeShort(int value)\r\n/* 539: */ {\r\n/* 540:550 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 541:551 */ return super.writeShort(value);\r\n/* 542: */ }",
"public void writeNumber(short s)\n/* */ throws IOException\n/* */ {\n/* 602 */ _verifyValueWrite(\"write a number\");\n/* 603 */ if (this._cfgNumbersAsStrings) {\n/* 604 */ _writeQuotedShort(s);\n/* 605 */ return;\n/* */ }\n/* */ \n/* 608 */ if (this._outputTail + 6 >= this._outputEnd) {\n/* 609 */ _flushBuffer();\n/* */ }\n/* 611 */ this._outputTail = NumberOutput.outputInt(s, this._outputBuffer, this._outputTail);\n/* */ }",
"public abstract void read_short_array(short[] value, int offset, int\nlength);",
"public void readRecordUshort(short[] data, int start, int length,\n\t\tint offset, int pixelStride, int n2, int n3) throws IOException;",
"private static void writeLength(ByteBuffer buffer, int length) {\n RuntimeAssertionError.assertTrue(length <= (int)Short.MAX_VALUE);\n buffer.putShort((short)length);\n }",
"static void write16( int word, OutputStream out )\n throws IOException\n {\n out.write( word );\n out.write( word >> 8 );\n }",
"public ByteBuf writeShortLE(int value)\r\n/* 859: */ {\r\n/* 860:868 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 861:869 */ return super.writeShortLE(value);\r\n/* 862: */ }",
"protected void _setShort(int index, int value)\r\n/* 435: */ {\r\n/* 436:449 */ HeapByteBufUtil.setShort(this.array, index, value);\r\n/* 437: */ }",
"private short readShort(SeekableStream stream)\n throws IOException {\n if (isBigEndian) {\n return stream.readShort();\n } else {\n return stream.readShortLE();\n }\n }",
"String shortWrite();",
"public ByteBuf setShort(int index, int value)\r\n/* 428: */ {\r\n/* 429:442 */ ensureAccessible();\r\n/* 430:443 */ _setShort(index, value);\r\n/* 431:444 */ return this;\r\n/* 432: */ }",
"public static byte[] shortToBytes(short s) {\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(NUM_BYTES_IN_SHORT);\n byteBuffer.putShort(s);\n return byteBuffer.array();\n\n }",
"short readShort() throws IOException;",
"@Test\n public void testReadWriteShort() {\n System.out.println(\"readShort\");\n ByteArray instance = new ByteArray();\n \n instance.writeShort((short) 12, 0);\n instance.writeShort((short) 15, 2);\n instance.writeShort((short) 13, instance.compacity());\n \n assertEquals(12, instance.readShort(0));\n assertEquals(15, instance.readShort(2));\n assertEquals(13, instance.readShort(instance.compacity() - 2));\n \n instance.writeShort((short) 14, 2);\n assertEquals(14, instance.readShort(2));\n }",
"@Override\r\n\tpublic short getShort(int pos) {\n\t\treturn buffer.getShort(pos);\r\n\t}",
"public final void setBufferShort(final byte[] buffer, final short data, final int i, final boolean endianess) {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n buffer[i] = (byte) (data >>> 8);\r\n buffer[i + 1] = (byte) (data & 0xff);\r\n } else {\r\n buffer[i] = (byte) (data & 0xff);\r\n buffer[i + 1] = (byte) (data >>> 8);\r\n }\r\n }",
"public void onWriteShortBegin(ICPU cpu, int addr) {\n\t}",
"public ByteBuf setShort(int index, int value)\r\n/* 277: */ {\r\n/* 278:292 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 279:293 */ return super.setShort(index, value);\r\n/* 280: */ }",
"public void setShort(int addr, short val) throws ProgramException {\n setLittleEndian(addr, Short.BYTES, val);\n }",
"protected void _setShortLE(int index, int value)\r\n/* 447: */ {\r\n/* 448:461 */ HeapByteBufUtil.setShortLE(this.array, index, value);\r\n/* 449: */ }",
"public short readShort() throws IOException;",
"private byte[] short2byte(short[] sData) {\n int shortArrsize = sData.length;\n byte[] bytes = new byte[shortArrsize * 2];\n for (int i = 0; i < shortArrsize; i++) {\n bytes[i * 2] = (byte) (sData[i] & 0x00FF);\n bytes[(i * 2) + 1] = (byte) (sData[i] >> 8);\n sData[i] = 0;\n }\n return bytes;\n\n }",
"public void z_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 7); }",
"public void x_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 3); }",
"public static short getShort(byte[] buffer, int index, int len) {\n switch (len) {\n case 0: return (short) 0xFFFF;\n case 1: return (short) (0xFFFFFF00 | _getByte(buffer, index, 1));\n case 2: return _getShort(buffer, index, 2);\n default: throw new IllegalArgumentException(\"len is out of range: \" + len);\n }\n }",
"public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }",
"public void r_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 9); }",
"public void write(long address, short[] buffer, int length, int moteID) {\n\t\tmote.write(address, buffer, length, moteID);\t\n\t}",
"abstract int readShort(int start);",
"public ByteBuf setShortLE(int index, int value)\r\n/* 793: */ {\r\n/* 794:802 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 795:803 */ return super.setShortLE(index, value);\r\n/* 796: */ }",
"protected static final int parseUnsignedShort(ByteArrayInputStream stream) throws EOFException\n {\n return (EASMessage.parseUnsignedByte(stream) << 8) | EASMessage.parseUnsignedByte(stream);\n }",
"void setShort(int index, short value) throws SQLException;",
"public ByteBuf setShortLE(int index, int value)\r\n/* 440: */ {\r\n/* 441:454 */ ensureAccessible();\r\n/* 442:455 */ _setShortLE(index, value);\r\n/* 443:456 */ return this;\r\n/* 444: */ }",
"public static void writeMessageType(OutputStream os, short type) throws IOException {\n os.write((byte)(type & 0xFF));\n os.write((byte)((type >> 8) & 0xFF));\n }",
"public void write(byte b[], int off, int len) throws IOException;",
"public int read(short[] s) throws IOException {\n\t\treturn read(s, 0, s.length);\n\t}",
"private void writeLength(int length) {\n if (length < 128) {\n os.write((byte) length);\n } else if (length < 256) {\n os.write(-127); // 10000001 - 1 byte to follow\n os.write((byte) length);\n } else if (length < 65536) {\n os.write(-126); // 10000010 - 2 bytes to follow\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else if (length < 16777216) {\n os.write(-125); // 10000011 - 3 bytes to follow\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else {\n os.write(-124); // 10000100 - 4 bytes to follow\n os.write((byte) (length >> 24));\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n }\n }",
"public void write( byte[] array, int firstIndex,\n\t\t\tint count );",
"public void mo1957a(short s) throws cf {\r\n mo1986b(m10266c((int) s));\r\n }",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"public void send(short[] bytes) {\n\t\tfor (short b : bytes) {\n\t\t\tsend(b);\n\t\t}\n\t}",
"public synchronized void read( int readIndex, short[] array,\n\t\t\tint firstIndex, int numShorts )\n\t{\n\t\tint numShortsLeft = numShorts;\n\t\tint shortsInBuffer = buffer.length >> 1;\n\t\tint shortIndex = firstIndex;\n\t\tint byteReadIndex = readIndex << 1;\n\t\twhile( numShortsLeft > 0 )\n\t\t{\n\t\t\tint numShortsToRead = (numShortsLeft < shortsInBuffer) ? numShortsLeft\n\t\t\t\t\t: shortsInBuffer;\n\n\t\t\t// Shift by one to convert numShorts to numBytes.\n\t\t\tint numBytesToRead = (numShortsToRead << 1);\n\t\t\tbyteArray.read( byteReadIndex, buffer, 0, numBytesToRead );\n\t\t\tbyteReadIndex += numBytesToRead;\n\n\t\t\tint byteIndex = 0;\n\t\t\tfor( int i = 0; i < numShortsToRead; i++ )\n\t\t\t{\n\t\t\t\tint loByte = buffer[byteIndex++];\n\t\t\t\tint hiByte = buffer[byteIndex++];\n\n\t\t\t\tint sample = (hiByte << 8) | (loByte & 0x00FF);\n\t\t\t\tarray[shortIndex++] = (short) sample;\n\t\t\t}\n\t\t\tnumShortsLeft -= numShortsToRead;\n\t\t}\n\t}",
"@Override\r\n\tpublic int getUnsignedShort(int pos) {\n\t\treturn getShort(pos) & 0x0FFFF;\r\n\t}",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"private void writeLength( ObjectOutput out, int len ) throws IOException\n {\n\t\tif (len <= 31)\n\t\t{\n\t\t\tout.write((byte) (0x80 | (len & 0xff)));\n\t\t}\n\t\telse if (len <= 0xFFFF)\n\t\t{\n\t\t\tout.write((byte) 0xA0);\n\t\t\tout.writeShort((short) len);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tout.write((byte) 0xC0);\n\t\t\tout.writeInt(len);\n\n\t\t}\n }",
"@Override\r\n\tpublic Buffer appendUnsignedByte(short b) {\n\t\tbuffer.putShort((short) (b & 0xff));\r\n\t\treturn this;\r\n\t}",
"public static byte[] getShortAsBytes(short s) {\n\t\treturn new byte[] {\n\t\t\t\t(byte) (s >>> 8),\n\t\t\t\t(byte) s\n\t\t};\n\t}",
"private static short flipEndian(short signedShort) {\n int input = signedShort & 0xFFFF;\n return (short) (input << 8 | (input & 0xFF00) >>> 8);\n }",
"public void y_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 5); }",
"public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }",
"public static void main(String[] args) {\nshort i = 128;\r\nbyte shortToByte = (byte)i;\r\nSystem.out.println(shortToByte);\r\nbyte t = 127;\r\nt++;\r\nSystem.out.println(t);\r\nt++;\r\nSystem.out.println(t);\r\n\r\n\t}",
"public void write(DataOutput output) throws IOException {\n output.writeShort(this.data);\n }",
"public static void shortToByteArray(short value, byte[] buffer, int offset) {\n buffer[offset] = (byte) (value >> 8 & 0xFF);\n buffer[offset + 1] = (byte) (value & 0xFF);\n }",
"private static void readFully(final DataInput input, final short[] shorts) throws IOException {\n if (input instanceof ImageInputStream) {\n // Optimization for ImageInputStreams, read all in one go\n ((ImageInputStream) input).readFully(shorts, 0, shorts.length);\n } else {\n for (int i = 0; i < shorts.length; i++) {\n shorts[i] = input.readShort();\n }\n }\n }",
"public static final short readShort(InputStream in) throws IOException {\n byte[] buff = new byte[2];\n StreamTool.readFully(in, buff);\n return getShort(buff, 0);\n }",
"public void testNIO_short_array() throws Exception {\n short[] shortArray = new short[8];\n ShortBuffer sb = ShortBuffer.wrap(shortArray);\n shortBufferTest(sb);\n }",
"short readShort();",
"public void mo5074b(short s) {\n this.f3707a = s;\n }",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"public short toShort()\n\t{\n\t\treturn (short)this.ordinal();\n\t}",
"public void set_dest(short value) {\n setUIntElement(offsetBits_dest(), 8, value);\n }",
"public final int getSignedShort(final boolean endianess) throws IOException {\r\n b3 = 0;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n b3 = ( (tagBuffer[bPtr] & 0xff) << 8) | (tagBuffer[bPtr + 1] & 0xff);\r\n } else {\r\n b3 = ( (tagBuffer[bPtr + 1] & 0xff) << 8) | (tagBuffer[bPtr] & 0xff);\r\n }\r\n\r\n if ( (b3 & 0x0080) != 0) {\r\n b3 = b3 | 0xff00;\r\n }\r\n\r\n bPtr += 2;\r\n\r\n return b3;\r\n }",
"public void setFlag(short flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t} else {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t}\n\t}",
"public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }",
"@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }",
"public void onWriteShortEnd(ICPU cpu, int addr) {\n\t}",
"public short readShort() throws IOException {\n\n\t\tif (read(bb, 0, 2) < 2) {\n\t\t\tthrow new EOFException();\n\t\t}\n\n\t\tshort s = (short) (bb[0] << 8 | (bb[1] & 0xFF));\n\t\treturn s;\n\t}",
"int setShort(int num, int a_short, int which)\n {\n return ((num & (0b1111111111111111 << ((~which) << 4))) | (a_short << (which << 4)));\n }",
"private void doClipWrite(byte b[], int off, int len) {\n\t\tif (count + len <= maxOutputSize) { // won't overflow\n\t\t\tthis.writeDirectly(b, off, len);\n\t\t} else {\n\t\t\tint discardBytes = len + count - maxOutputSize;\n\t\t\tif (len >= maxOutputSize) {\n\t\t\t\treset();\n\t\t\t\tthis.writeDirectly(b, off + len - maxOutputSize, maxOutputSize);\n\t\t\t} else {\n\t\t\t\tint shiftStart = count - maxOutputSize + len;\n\t\t\t\tint remaining = maxOutputSize - len;\n\t\t\t\tSystem.arraycopy(buf, shiftStart, buf, 0, remaining);\n\t\t\t\tcount = remaining;\n\t\t\t\tthis.writeDirectly(b, off, len);\n\t\t\t}\n\t\t\tclipNum ++;\n\t\t\tSystem.out.println(String.format(\"Overflow count: %d, discarded bytes number: %d\", clipNum,\n\t\t\t\t\tdiscardBytes));\n\t\t\t\n\t\t}\n\n\t}",
"T print(short data) throws PrintingException;",
"public void setValue(short value) {\n this.value = value;\n }",
"public short getShort(int pos) {\n return Tuples.toShort(getObject(pos));\n }",
"private static byte[] shortToBytes(short value) {\n ByteBuffer bb = ByteBuffer.allocate(2);\n bb.putShort(value);\n return bb.array();\n }",
"public short getShortA() {\n\t\tint i = (payload.get() & 0xFF) << 8 | payload.get() - 128 & 0xFF;\n\t\tif (i > 32767) {\n\t\t\ti -= 0x10000;\n\t\t}\n\t\treturn (short) i;\n\t}",
"public void write(final byte[] data, final int offset, final int len) throws IOException {\n checkOpened();\n dos.write(data, offset, len);\n flush();\n }",
"protected final short getShort(int offset)\n {\n final byte[] tableData = tables.getTablesData();\n return Bytes.getShort(tableData, cursor+offset);\n }",
"@Override\n public void write (final String s, final int off, final int len)\n {\n if (text != null)\n {\n text.append (s.substring (off, off + len));\n if ((col += len) > wrap)\n println ();\n }\n else\n {\n super.write (s, off, len);\n flush ();\n }\n }",
"public void writePacket(byte[] pkt, int off, int len)\n throws IOException {\n\n throw new IOException(\"writePacket() not implemented\");\n }",
"public short getLEShort() {\n\t\tint i = payload.get() & 0xFF | (payload.get() & 0xFF) << 8;\n\t\tif (i > 32767) {\n\t\t\ti -= 0x10000;\n\t\t}\n\t\treturn (short) i;\n\t}",
"public void write(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}",
"public void send(short b) {\n\t\t// If we're using send to send 255, we need to escape it.\n\t\tif (b == IAC) {\n\t\t\toutWriter.write(new short[] {IAC, IAC});\n\t\t} else {\n\t\t\ttry {\n\t\t\t\toutWriter.write(b);\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tSystem.err.println(ioe.toString());\n\t\t\t}\n\t\t}\n\t}",
"public void updateShort(int columnIndex, short x) throws SQLException\n {\n m_rs.updateShort(columnIndex, x);\n }",
"public void setValue(short value) {\n this.value = value;\n }"
] | [
"0.72157353",
"0.6683974",
"0.6546892",
"0.64189553",
"0.6418735",
"0.6320636",
"0.62118423",
"0.609635",
"0.60367966",
"0.5995514",
"0.59490645",
"0.58081186",
"0.57963943",
"0.578806",
"0.57839954",
"0.57605755",
"0.5705684",
"0.5679262",
"0.55384827",
"0.54955965",
"0.53847104",
"0.53317124",
"0.5318945",
"0.52766865",
"0.5269932",
"0.52281094",
"0.5215297",
"0.52102405",
"0.51875204",
"0.5173787",
"0.5165539",
"0.5161859",
"0.5134152",
"0.5134007",
"0.5128868",
"0.51007634",
"0.50995904",
"0.50657636",
"0.5065646",
"0.5064765",
"0.5056453",
"0.5023499",
"0.5008898",
"0.4983154",
"0.49736187",
"0.49443096",
"0.49347103",
"0.4926103",
"0.4922842",
"0.4905914",
"0.49028537",
"0.48754457",
"0.48621526",
"0.48574972",
"0.4850291",
"0.4843236",
"0.4838636",
"0.48337558",
"0.4827589",
"0.48129538",
"0.4808904",
"0.4806737",
"0.47947046",
"0.47938094",
"0.47926012",
"0.47744972",
"0.47726324",
"0.4758387",
"0.4751615",
"0.47502548",
"0.47495982",
"0.47359467",
"0.47322476",
"0.47222817",
"0.47179624",
"0.47129872",
"0.47093514",
"0.46916336",
"0.46865648",
"0.46817428",
"0.46642774",
"0.4660586",
"0.46559557",
"0.46533194",
"0.46475622",
"0.46464622",
"0.46445036",
"0.4641714",
"0.46395218",
"0.46384174",
"0.4621093",
"0.46181723",
"0.46180478",
"0.4613038",
"0.4607001",
"0.46022627",
"0.45958298",
"0.45947295",
"0.4583904",
"0.4582711"
] | 0.810506 | 0 |
Writes a sequence of chars to the stream at the current position. If len is 0, nothing is written. The char c[off] is written first, then the char c[off + 1], and so on. The byte order of the stream is used to determine the order in which the individual bytes are written. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeChars(char[] c, int off, int len) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void write(char cbuf[], int off, int len) throws IOException {\n ensureOpen();\n if ((off < 0) || (off > cbuf.length) || (len < 0) ||\n ((off + len) > cbuf.length) || ((off + len) < 0)) {\n throw new IndexOutOfBoundsException();\n } else if (len == 0) {\n return;\n }\n out.write(cbuf, off, len);\n }",
"public synchronized void write(final byte[] cbuf, final int off, final int len) throws IOException {\n\t\tif (len < 0) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tif (off < 0) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\tif (cbuf == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif ((len + off) > cbuf.length) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\n\t\tensureSize(cursor + len);\n\n\t\tSystem.arraycopy(cbuf, off, this.buffer, cursor, len);\n\t\tcursor += len;\n\t}",
"@Override\r\n public void write(char[] cbuf, int off, int len) throws IOException {\r\n\r\n IOException ioException = null;\r\n for (WriterInfo writerInfo : mWriters) {\r\n try {\r\n writerInfo.getWriter().write(cbuf, off, len);\r\n } catch(IOException ioex) {\r\n ioException = ioex;\r\n }\r\n }\r\n if (ioException != null) {\r\n throw ioException;\r\n }\r\n\r\n }",
"public void write(char cbuf[], int off, int len) {\r\n if ((cbuf != null) && (len > 0)) {\r\n\r\n // Force flush if we have accumulated more than 1K of text\r\n boolean flushMe = false;\r\n synchronized (LogWriter.this) {\r\n buffer.append(cbuf, off, len);\r\n if (buffer.length() >= 1024) {\r\n flushMe = true;\r\n } else {\r\n // Look for embedded EOL\r\n for (int i=off+len-1; i>= off; i--) {\r\n if (cbuf[i] == '\\n') {\r\n flushMe = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (flushMe) flush();\r\n }\r\n }",
"@Override\n public void write(char[] cbuf, int off, int len) throws IOException\n {\n builder.append(cbuf, off, len);\n }",
"@Override\n public void writeCData(char[] cbuf, int start, int len)\n throws XMLStreamException\n {\n /* 02-Dec-2004, TSa: Maybe the writer is to \"re-direct\" these\n * writes as normal text? (sometimes useful to deal with broken\n * XML parsers, for example)\n */\n if (mCfgCDataAsText) {\n writeCharacters(cbuf, start, len);\n return;\n }\n\n mAnyOutput = true;\n // Need to finish an open start element?\n if (mStartElementOpen) {\n closeStartElement(mEmptyElement);\n }\n verifyWriteCData();\n if (mVldContent == XMLValidator.CONTENT_ALLOW_VALIDATABLE_TEXT\n && mValidator != null) {\n /* Last arg is false, since we do not know if more text\n * may be added with additional calls\n */\n mValidator.validateText(cbuf, start, start + len, false);\n }\n int ix;\n try {\n ix = mWriter.writeCData(cbuf, start, len);\n } catch (IOException ioe) {\n throw new WstxIOException(ioe);\n }\n if (ix >= 0) { // problems that could not to be fixed?\n throwOutputError(ErrorConsts.WERR_CDATA_CONTENT, DataUtil.Integer(ix));\n }\n }",
"public void write(char[] charArray, int offset, int length) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(charArray, offset, length);\r\n }",
"void write (char ch, int offset);",
"public void write(char[] b, int off, int len) throws IOException {\n\t\t\tif (!initialized) {\n\t\t\t\tarea.setText(\"\");\n\t\t\t\tinitialized = true;\n\t\t\t}\n\t\t\tString str = new String(b, off, len);\n\t\t\tStringBuffer sb = new StringBuffer(len);\n\t\t\twhile (str != null && str.length() > 0) {\n\t\t\t\tif (lastCR && str.charAt(0) == '\\n')\n\t\t\t\t\tstr = str.substring(1);\n\t\t\t\tint crIndex = str.indexOf('\\r');\n\t\t\t\tif (crIndex >= 0) {\n\t\t\t\t\tsb.append(str.substring(0, crIndex));\n\t\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\tstr = str.substring(crIndex + 1);\n\t\t\t\t\tlastCR = true;\n\t\t\t\t} else {\n\t\t\t\t\tsb.append(str);\n\t\t\t\t\tstr = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tarea.append(sb.toString());\n\t\t}",
"@Override\n public void write (final char buf[], final int off, final int len)\n {\n if (text != null)\n {\n text.append (new String (buf, off, len));\n if ((col += len) > wrap)\n println ();\n }\n else\n super.write (buf, off, len);\n }",
"@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }",
"public void write(char c){\n\t\tbuffer[bufferPos++] = c;\n\n\t\tif(bufferPos == limit) flush();\n\t}",
"public void write(final byte[] data, final int offset, final int len) throws IOException {\n checkOpened();\n dos.write(data, offset, len);\n flush();\n }",
"public void write(byte b[], int off, int len) throws IOException;",
"@Override\n public void write(char[] cbuf, int off, int len) throws IOException {\n if (textArea == null) {\n throw new IOException(\"Writer has already been closed!\");\n }\n String toWrite = String.copyValueOf(cbuf, off, len);\n textArea.appendText(toWrite);\n\n }",
"@Override\n public void write (final String s, final int off, final int len)\n {\n if (text != null)\n {\n text.append (s.substring (off, off + len));\n if ((col += len) > wrap)\n println ();\n }\n else\n {\n super.write (s, off, len);\n flush ();\n }\n }",
"public void write(char[] cArr) throws XMLStreamException {\n try {\n this.writer.write(cArr);\n } catch (IOException e) {\n throw new XMLStreamException((Throwable) e);\n }\n }",
"public final void write(int c) {\r\n if (cbyte == size) {\r\n throw new ArrayIndexOutOfBoundsException(String.format(\"%d\", cbyte));\r\n }\r\n \r\n // Append the input byte to the data element.\r\n elem |= (c & 0xff) << (bytenum << 3);\r\n \r\n bytenum++;\r\n cbyte++;\r\n if (bytenum == BYTES_IN_ELEMENT) {\r\n // Write the data\r\n data[offset] = elem;\r\n // Increase offset\r\n offset++;\r\n // Reset current element\r\n elem = 0;\r\n // Reset bytenum\r\n bytenum = 0;\r\n }\r\n }",
"public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }",
"public void write(int c) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append((char)c);\r\n }",
"@Override\n public void write (final int c)\n {\n if (text != null)\n {\n text.append (String.valueOf ((char) c));\n if (++col > wrap)\n println ();\n }\n else\n super.write (c);\n }",
"public synchronized void write(byte[] buf, int off, int len)\n\t\t\t\tthrows IOException {\n\t\t\tsuper.write(buf, off, len);\n\t\t}",
"public void write(byte[] b, int offset, int len) throws IOException {\n if (pos + len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, pos, len);\n pos += len;\n } else {\n flush();\n if (len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, 0, len);\n } else {\n ConsoleRedirect.this.flush(b, offset, len);\n }\n }\n }",
"void writeChars(String s) throws IOException;",
"public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"protected final void write(char c) throws IOException {\n\t\toutput.write(c);\n\t}",
"public void write(char c) throws XMLStreamException {\n try {\n this.writer.write(c);\n } catch (IOException e) {\n throw new XMLStreamException((Throwable) e);\n }\n }",
"private void write(byte[] data, int pos, int len)\n\t\tthrows IOException\n\t{\n\t\tchar[] chars = BASE64;\n\n\t\tint loc = (len > 0 ? (data[pos] << 24) >>> 8 : 0) |\n\t\t\t(len > 1 ? (data[pos+1] << 24) >>> 16 : 0) |\n\t\t\t(len > 2 ? (data[pos+2] << 24) >>> 24 : 0);\n\n\t\tswitch(len)\n\t\t{\n\t\t\tcase 3:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write(chars[loc & 0x3f]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\twriter.write('=');\n\t\t}\n\t}",
"@Override\n public void write(char[] cbuf, int off, int len) throws IOException {\n for (int i = 0; i < cbuf.length; ++i)\n cbuf[i] = Character.toUpperCase(cbuf[i]);\n \n super.write(cbuf, off, len);\n \n }",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"public void write(int c) throws IOException {\n ensureOpen();\n out.write(c);\n }",
"private void doClipWrite(byte b[], int off, int len) {\n\t\tif (count + len <= maxOutputSize) { // won't overflow\n\t\t\tthis.writeDirectly(b, off, len);\n\t\t} else {\n\t\t\tint discardBytes = len + count - maxOutputSize;\n\t\t\tif (len >= maxOutputSize) {\n\t\t\t\treset();\n\t\t\t\tthis.writeDirectly(b, off + len - maxOutputSize, maxOutputSize);\n\t\t\t} else {\n\t\t\t\tint shiftStart = count - maxOutputSize + len;\n\t\t\t\tint remaining = maxOutputSize - len;\n\t\t\t\tSystem.arraycopy(buf, shiftStart, buf, 0, remaining);\n\t\t\t\tcount = remaining;\n\t\t\t\tthis.writeDirectly(b, off, len);\n\t\t\t}\n\t\t\tclipNum ++;\n\t\t\tSystem.out.println(String.format(\"Overflow count: %d, discarded bytes number: %d\", clipNum,\n\t\t\t\t\tdiscardBytes));\n\t\t\t\n\t\t}\n\n\t}",
"public void characters( char[] buf, int offset, int len ) {\r\n\r\n // Append the new characters\r\n currentString.append( new String( buf, offset, len ) );\r\n }",
"@Override\n public int write(byte[] bytes, int offset, int length) throws SWPException {\n int codePointLength = getLength();\n SWPException.requireTrue(length >= codePointLength, \"Buffer overflow.\");\n bytes[offset] = (byte) ((codePointLength << 8) & 0xff);\n bytes[offset + 1] = (byte) (codePointLength & 0xff);\n bytes[offset + 2] = (byte) (codePoint >>> 8);\n bytes[offset + 3] = (byte) (codePoint & 0xff);\n if (isNull()) {\n\n bytes[offset + 4] = SwpConstants.NULL_INDICATOR;\n }\n else {\n\n bytes[offset + 4] = SwpConstants.NOT_NULL_INDICATOR;\n primitive.write(bytes, offset + 5, length - 5);\n }\n return codePointLength;\n }",
"public void write(byte b[], int off, int len) throws IOException\n\t{\n\t\tout.write(b, off, len);\n\t\tmd5.update(b, off, len);\n\t}",
"public static final void transcodeAndWrite(byte[] input, \r\n java.io.OutputStream os,\r\n int offset, int length, int input_encoding, int output_encoding)\r\n throws TranscodeException,\r\n IOException {\n int k = offset;\r\n int c;\r\n while (k < offset + length) {\r\n long l = decode(input, k, input_encoding);\r\n k = (int) (l >> 32);\r\n c = (int) l;\r\n encodeAndWrite(os, c, output_encoding);\r\n }\r\n }",
"public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }",
"public void write(byte[] data, long offset);",
"public void charData(char[] c, int offset, int length) throws Exception {\n\t\t\tString s = new String(c, offset, length);\n\n\t\t\tif (isVerbose()) {\n\t\t\t\tString x;\n\n\t\t\t\tif (s.length() > 40) {\n\t\t\t\t\tx = s.substring(0, 40) + \"...\";\n\t\t\t\t} else {\n\t\t\t\t\tx = s;\n\t\t\t\t}\n\n\t\t\t\tlogInfo(\"cdata\", \"[\" + offset + \",\" + length + \"] \" + x);\n\t\t\t}\n\n\t\t\t_currentElement.appendPCData(s);\n\t\t}",
"private void byteOut(){\n if(nrOfWrittenBytes >= 0){\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else if(c < 0x8000000){\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=c>>>19;\n c &= 0x7FFFF;\n cT=8;\n }\n else{\n b++;\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n c &= 0x7FFFFFF;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else{\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=((c>>>19)&0xFF);\n c &= 0x7FFFF;\n cT=8;\n }\n }\n }\n else {\n // NOTE: carry bit can never be set if the byte buffer was empty\n b= (c>>>19);\n c &= 0x7FFFF;\n cT=8;\n nrOfWrittenBytes++;\n }\n }",
"public void write(byte b[], int off, int len) throws IOException {\n baos.write(b, off, len);\n }",
"void writeChar(char value);",
"protected void write(byte[] bytes, int offset, int length) {\n/* 114 */ if (this.socket == null) {\n/* 115 */ if (this.connector != null && !this.immediateFail) {\n/* 116 */ this.connector.latch();\n/* */ }\n/* 118 */ if (this.socket == null) {\n/* 119 */ String msg = \"Error writing to \" + getName() + \" socket not available\";\n/* 120 */ throw new AppenderLoggingException(msg);\n/* */ } \n/* */ } \n/* 123 */ synchronized (this) {\n/* */ try {\n/* 125 */ getOutputStream().write(bytes, offset, length);\n/* 126 */ } catch (IOException ex) {\n/* 127 */ if (this.retry && this.connector == null) {\n/* 128 */ this.connector = new Reconnector(this);\n/* 129 */ this.connector.setDaemon(true);\n/* 130 */ this.connector.setPriority(1);\n/* 131 */ this.connector.start();\n/* */ } \n/* 133 */ String msg = \"Error writing to \" + getName();\n/* 134 */ throw new AppenderLoggingException(msg, ex);\n/* */ } \n/* */ } \n/* */ }",
"public void writeText(char[] text, int off, int len) throws IOException {\r\n deNude();\r\n writerEscape.writeText(text, off, len);\r\n }",
"void flush(byte[] b, int off, int len) {\n if (len > 0) {\n synchronized (flushed) {\n flushed.append(new String(b, off, len));\n }\n }\n }",
"public void write(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}",
"void write(ByteBuffer b, int off, int len) throws IOException;",
"private void _writeString(char[] text, int offset, int len)\n/* */ throws IOException\n/* */ {\n/* 1049 */ if (this._characterEscapes != null) {\n/* 1050 */ _writeStringCustom(text, offset, len);\n/* 1051 */ return;\n/* */ }\n/* 1053 */ if (this._maximumNonEscapedChar != 0) {\n/* 1054 */ _writeStringASCII(text, offset, len, this._maximumNonEscapedChar);\n/* 1055 */ return;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 1062 */ len += offset;\n/* 1063 */ int[] escCodes = this._outputEscapes;\n/* 1064 */ int escLen = escCodes.length;\n/* 1065 */ while (offset < len) {\n/* 1066 */ int start = offset;\n/* */ for (;;)\n/* */ {\n/* 1069 */ char c = text[offset];\n/* 1070 */ if ((c < escLen) && (escCodes[c] != 0)) {\n/* */ break;\n/* */ }\n/* 1073 */ offset++; if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 1079 */ int newAmount = offset - start;\n/* 1080 */ if (newAmount < 32)\n/* */ {\n/* 1082 */ if (this._outputTail + newAmount > this._outputEnd) {\n/* 1083 */ _flushBuffer();\n/* */ }\n/* 1085 */ if (newAmount > 0) {\n/* 1086 */ System.arraycopy(text, start, this._outputBuffer, this._outputTail, newAmount);\n/* 1087 */ this._outputTail += newAmount;\n/* */ }\n/* */ } else {\n/* 1090 */ _flushBuffer();\n/* 1091 */ this._writer.write(text, start, newAmount);\n/* */ }\n/* */ \n/* 1094 */ if (offset >= len) {\n/* */ break;\n/* */ }\n/* */ \n/* 1098 */ char c = text[(offset++)];\n/* 1099 */ _appendCharacterEscape(c, escCodes[c]);\n/* */ }\n/* */ }",
"public void putc(char c);",
"public int write(byte[] b, int off, int len)\n {\n synchronized (this) {\n if (!open) {\n return 0;\n }\n\n writing = true;\n started = true;\n reset = false;\n timeTracker.start();\n }\n line.start();\n int written = line.write(b, off, len);\n synchronized (this) {\n // drain() might be waiting, so we should wake it up.\n notifyAll();\n writing = false;\n\t\t\tif (!reset) {\n\t\t\t\ttotalWritten += written;\n\t\t\t} else if (reset && open) {\n\t\t\t\t// Flush what we just wrote to keep it reset.\n\t\t\t\tline.flush();\n\t\t\t}\n return written;\n }\n }",
"private void flushChars() throws SAXException, IOException {\n if (cstart != -1) {\n if (pos > cstart) {\n int currCol = col;\n int currLine = line;\n col = colPrev;\n line = linePrev;\n try {\n tokenHandler.characters(buf, cstart, pos - cstart);\n } finally {\n col = currCol;\n line = currLine;\n }\n }\n }\n cstart = -1;\n }",
"@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}",
"void writeChar(final char result) throws WriterException;",
"public void write(char[] cArr, int i, int i2) throws XMLStreamException {\n try {\n this.writer.write(cArr, i, i2);\n } catch (IOException e) {\n throw new XMLStreamException((Throwable) e);\n }\n }",
"public void cdata(char[] chars, int start, int length);",
"private static void writer(String filename, char[] chars) {\n BinaryOut binaryOut = new BinaryOut(filename);\n\n for (char c : chars) {\n binaryOut.write(c);\n }\n\n binaryOut.close();\n }",
"public void writeCharactersInternal(char[] cArr, int i, int i2, boolean z) throws XMLStreamException {\n CharsetEncoder charsetEncoder;\n if (i2 != 0) {\n int i3 = 0;\n while (i3 < i2) {\n char c = cArr[i3 + i];\n if (c == '\\\"') {\n if (z) {\n break;\n }\n } else if (c != '&' && c != '<' && c != '>') {\n if (c >= ' ') {\n if (c > 127 && (charsetEncoder = this.encoder) != null && !charsetEncoder.canEncode(c)) {\n break;\n }\n } else if (!z) {\n if (!(c == 9 || c == 10)) {\n break;\n }\n } else {\n break;\n }\n } else {\n break;\n }\n i3++;\n }\n if (i3 < i2) {\n slowWriteCharacters(cArr, i, i2, z);\n } else {\n write(cArr, i, i2);\n }\n }\n }",
"private void writeChar(byte[] bytes) {\n // let terminal do auto wrap around. \n term.writeChar(bytes);\n\n // update cursor \n //int x=term.getCursorX(); \n //int y=term.getCursorY();\n //term.putChar(bytes, x, y);\n // increment: let terminal do auto wrap around. \n //term.moveCursor(1,0); \n\n }",
"public void write(int b) throws IOException {\n/* 54 */ this.appendable.append((char)b);\n/* */ }",
"public int read(char[] c, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 2) {\n\t\t\t\t\tfillBuf(2);\n\t\t\t\t}\n\t\t\t\tc[i] = (char) (buf[pos] << 8 | (buf[pos + 1] & 0xFF));\n\t\t\t\tpos += 2;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 2);\n\t\t}\n\t\treturn 2 * len;\n\t}",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"@Override\n\tpublic int write( byte [] buffer, int offset, int length ) {\n\t\tByteBuffer out = getOutputBuffer();\n\t\tif( out.limit() <= 0 ) {\n\t\t\tout.limit( out.capacity() );\n\t\t}\n\t\tsynchronized( out ) {\n\t\t\tout.put( buffer, offset, length );\n\t\t}\n\t\tdispatcher.requestWrite( this );\n\t\treturn length;\n\t}",
"@Override\n public void write(final byte[] data, final int offset, final int length)\n throws IOException {\n if (offset < 0 || length < 0 || length > data.length - offset) {\n throw new IndexOutOfBoundsException();\n }\n\n writeInternal(data, offset, length);\n }",
"public void safeEncode(char[] chars, int off, int len, CharWriter writer) throws EncodingException\n {\n int previous = off;\n\n //\n int to = off + len;\n\n // Perform lookup char by char\n for (int current = off; current < to; current++)\n {\n // Lookup\n String replacement = lookup(chars[current]);\n\n // Do we have a replacement\n if (replacement != null)\n {\n // We lazy create the result\n\n // Append the previous chars if any\n writer.append(chars, previous, current - previous);\n\n // Append the replaced entity\n writer.append('&').append(replacement).append(';');\n\n // Update the previous pointer\n previous = current + 1;\n }\n }\n\n //\n writer.append(chars, previous, chars.length - previous);\n }",
"public static void write(@Nullable final char[] data, final Writer output) throws IOException {\n if (data != null) {\n output.write(data);\n }\n }",
"@Override\n public void write(ByteBuffer b, int off, int len)\n throws IOException {\n byteBufferStreamOutput.write(b, off, len);\n }",
"void write (String s, int offset);",
"public int write(int c) throws IOException, BadDescriptorException {\n checkOpen();\n \n ByteBuffer buf = ByteBuffer.allocate(1);\n buf.put((byte)c);\n buf.flip();\n \n return internalWrite(buf);\n }",
"public static native int write(int fd, byte[] data, int off, int len) throws IOException;",
"public int writeCharSequence(CharSequence sequence, Charset charset)\r\n/* 883: */ {\r\n/* 884:892 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 885:893 */ return super.writeCharSequence(sequence, charset);\r\n/* 886: */ }",
"public AppendableCharSequence append(char c)\r\n/* 44: */ {\r\n/* 45: 57 */ if (this.pos == this.chars.length)\r\n/* 46: */ {\r\n/* 47: 58 */ char[] old = this.chars;\r\n/* 48: */ \r\n/* 49: 60 */ int len = old.length << 1;\r\n/* 50: 61 */ if (len < 0) {\r\n/* 51: 62 */ throw new IllegalStateException();\r\n/* 52: */ }\r\n/* 53: 64 */ this.chars = new char[len];\r\n/* 54: 65 */ System.arraycopy(old, 0, this.chars, 0, old.length);\r\n/* 55: */ }\r\n/* 56: 67 */ this.chars[(this.pos++)] = c;\r\n/* 57: 68 */ return this;\r\n/* 58: */ }",
"@Override\n\tpublic void characters(char ch[], int start, int len) throws SAXException {\n\t\ttry {\n\t\t\tif (!startTagIsClosed) {\n\t\t\t\twrite('>');\n\t\t\t\tstartTagIsClosed = true;\n\t\t\t}\n\t\t\twriteEsc(ch, start, len, false);\n\t\t\tsuper.characters(ch, start, len);\n\t\t} catch (IOException e) {\n\t\t\tthrow new SAXException(e);\n\t\t}\n\t}",
"@Override\n \tpublic void characters(final char inbuf[], final int offset, final int len)\n \t\t\tthrows SAXException {\n \t\tif (curAtom != null || !isParsing(eIsParsing.NONE)) {\n \t\t\tfinal String tmpString = new String(inbuf, offset, len);\n \t\t\tbuf += tmpString;\n \t\t}\n \t}",
"@Override\n\t\tpublic void characters(char[] ch, int start, int length)\n\t\t\t\tthrows SAXException {\n\t\t\tbuffer.append(ch);\n\t\t}",
"public void write(String[] buf, int offset, int size) throws IOException;",
"public void write(byte b[]) throws IOException;",
"public void characters(char[] ch, int start, int length) throws SAXException {\n //Remember that characters may be called multiple times for the same\n //element, so if data is null then the characters delivered here are\n //the data, otherwise append the characters to data\n if (data == null) {\n data = new String(ch, start, length);\n } else {\n data = data + new String(ch, start, length);\n }\n data = data.trim();\n }",
"private void writeBuffer( byte b[], int offset, int length) throws IOException\r\n\t{\r\n\t\t// Write the chunk length as a hex number.\r\n\t\tfinal String size = Integer.toHexString(length);\r\n\t\tthis.out.write(size.getBytes());\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// Write the data.\r\n\t\tif (length != 0 )\r\n\t\t\tthis.out.write(b, offset, length);\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// And flush the real stream.\r\n\t\tthis.out.flush();\r\n\t}",
"public void write(String string, int offset, int length) throws IOException{\r\n if(closed){\r\n throw new IOException(\"The stream is not open.\");\r\n }\r\n getBuffer().append(string.substring(offset, length));\r\n }",
"public void putc(int achar){\n if(view!=null) {\n if (achar >= 0) {\n StringBuilder arf = new StringBuilder(1);\n arf.append((char) achar);\n view.append(arf);\n } else {\n //is return code from a failed stream read\n }\n }\n }",
"public void write( byte[] array, int firstIndex,\n\t\t\tint count );",
"public void characters(char[] ch, int start, int length) throws SAXException {\n contents.write(ch, start, length);//ne znam cemu sluzi ali neka ostane\n textBuffer.append(new String(ch, start, length));\n }",
"@Override\n public void write(byte[] buf, int offset, int size) throws IOException;",
"@Override\n\tpublic void characters(char[] ch, int start, int length)\n\t\t\tthrows SAXException {\n\t\tsuper.characters(ch, start, length);\n\t\tbuilder.append(ch, start, length);\n\t}",
"public WriteChars(Writer writer, boolean close) {\n this.writer = writer;\n this.close = close;\n }",
"public static int compress(char[] chars) {\n int anchor = 0, write = 0;\n for (int read = 0; read < chars.length; read++){\n if (read + 1 == chars.length || chars[read + 1] != chars[read]){\n chars[write++] = chars[anchor];\n if (read > anchor) {\n// Integer.toString(read-anchor + 1)\n for (char c: (\"\" + (read - anchor + 1)).toCharArray()){\n chars[write++] = c;\n }\n }\n anchor = read + 1;\n }\n }\n return write;\n }",
"@Override\n\tpublic void characters(char ch[], int start, int length) {\n\t\tchars.append(new String(ch, start, length));\n\t}",
"private void _writeSegment(int end)\n/* */ throws IOException\n/* */ {\n/* 1006 */ int[] escCodes = this._outputEscapes;\n/* 1007 */ int escLen = escCodes.length;\n/* */ \n/* 1009 */ int ptr = 0;\n/* 1010 */ int start = ptr;\n/* */ \n/* */ \n/* 1013 */ while (ptr < end)\n/* */ {\n/* */ char c;\n/* */ for (;;) {\n/* 1017 */ c = this._outputBuffer[ptr];\n/* 1018 */ if ((c >= escLen) || (escCodes[c] == 0))\n/* */ {\n/* */ \n/* 1021 */ ptr++; if (ptr >= end) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* 1030 */ int flushLen = ptr - start;\n/* 1031 */ if (flushLen > 0) {\n/* 1032 */ this._writer.write(this._outputBuffer, start, flushLen);\n/* 1033 */ if (ptr >= end) {\n/* */ break;\n/* */ }\n/* */ }\n/* 1037 */ ptr++;\n/* */ \n/* 1039 */ start = _prependOrWriteCharacterEscape(this._outputBuffer, ptr, end, c, escCodes[c]);\n/* */ }\n/* */ }",
"public void write(char[] charArray) throws IOException{\r\n write(charArray, 0, charArray.length);\r\n }",
"void write(byte b[]) throws IOException;",
"public static void encode(InputStream in, OutputStream out, int len) \n throws IOException {\n if(len%4!=0)\n throw new IllegalArgumentException(\"Length must be a multiple of 4\");\n\n // Read input stream until end of file\n int bits=0;\n int nbits=0;\n int nbytes=0;\n int b;\n\n while( (b=in.read()) != -1) {\n bits=(bits<<8)|b;\n nbits+=8;\n while(nbits>=6) {\n\tnbits-=6;\n\tout.write(encTab[0x3f&(bits>>nbits)]);\n\tnbytes ++;\n\t// New line\n\tif (len !=0 && nbytes>=len) {\n\t out.write(0x0d);\n\t out.write(0x0a);\n\t nbytes -= len;\n\t}\n }\n }\n\n switch(nbits) {\n case 2:\n out.write(encTab[0x3f&(bits<<4)]);\n out.write(0x3d); // 0x3d = '='\n out.write(0x3d);\n break;\n case 4:\n out.write(encTab[0x3f&(bits<<2)]);\n out.write(0x3d);\n break;\n }\n\n if (len != 0) {\n if (nbytes != 0) {\n\tout.write(0x0d);\n\tout.write(0x0a);\n }\n out.write(0x0d);\n out.write(0x0a);\n }\n }",
"public int write(ByteList buf, int offset, int len) throws IOException, BadDescriptorException {\n checkOpen();\n \n return internalWrite(ByteBuffer.wrap(buf.getUnsafeBytes(), buf.begin()+offset, len));\n }",
"public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {\n\n updateCharacterStream(columnIndex, x, (long) length);\n }",
"@Override\n\tpublic void characters(char[] ch, int start, int length)\n\t\t\tthrows SAXException {\n\t\tsuper.characters(ch, start, length);\n\t\tbuilder.append(ch, start, length); // 将读取的字符数组追加到builder中\n\t}",
"public void write(String str, int off, int len) throws IOException {\n ensureOpen();\n if ((off < 0) || (off > str.length()) || (len < 0) ||\n ((off + len) > str.length()) || ((off + len) < 0)) {\n throw new IndexOutOfBoundsException();\n } else if (len == 0) {\n return;\n }\n out.write(str, off, len);\n }",
"public void write(int c) throws IOException {\r\n try {\r\n os.write(c);\r\n } catch (IOException io) {\r\n if (!cbImpl.checkMobileNetwork()) {\r\n throw new WrapperIOException(new TransportException(io.getMessage(), io,\r\n TransportException.NO_NETWORK_COVERAGE));\r\n }\r\n throw io;\r\n }\r\n }",
"public abstract void writeBytes(byte[] b, int offset, int length) throws IOException;",
"public static void writeOutputStreamContents(OutputStream os, char[] text, String encoding) throws CoreException {\r\n\t\tCheck.checkArg(os);\r\n\r\n\t\tWriter writer;\r\n\t\ttry {\r\n\t \tif (encoding != null)\r\n\t \t\twriter = new OutputStreamWriter(os, encoding);\r\n\t \telse\r\n\t \t\twriter = new OutputStreamWriter(os);\r\n\t\r\n\t writeWriterContents(writer, text);\r\n\t\t} catch (UnsupportedEncodingException e) {\r\n throw new CoreException(createErrorStatus(e));\r\n }\r\n\t}",
"public void updateCharacterStream(int columnIndex,\n java.io.Reader x,\n int length) throws SQLException\n {\n m_rs.updateCharacterStream(columnIndex, x, length);\n }"
] | [
"0.71359694",
"0.6920362",
"0.68104213",
"0.6793896",
"0.6757729",
"0.60959935",
"0.6046185",
"0.5944992",
"0.59357333",
"0.58885753",
"0.57629776",
"0.57069546",
"0.5655815",
"0.5635516",
"0.5608757",
"0.55721575",
"0.55541486",
"0.5551797",
"0.55070335",
"0.55037504",
"0.5431433",
"0.53895366",
"0.5389045",
"0.5382669",
"0.536846",
"0.5353901",
"0.5331546",
"0.5310432",
"0.52952766",
"0.5281419",
"0.52724004",
"0.5252073",
"0.5220369",
"0.5207394",
"0.5121776",
"0.5111892",
"0.51027244",
"0.5102537",
"0.51008064",
"0.51005346",
"0.5099751",
"0.50802374",
"0.506908",
"0.5066836",
"0.50658506",
"0.5043101",
"0.50227726",
"0.5003812",
"0.50023264",
"0.49770978",
"0.49550715",
"0.49515483",
"0.49341148",
"0.49332887",
"0.49288115",
"0.49236098",
"0.49218893",
"0.49007526",
"0.48959133",
"0.48946926",
"0.48933977",
"0.48667538",
"0.48437405",
"0.48267895",
"0.48237756",
"0.4790856",
"0.47606522",
"0.47565386",
"0.47534093",
"0.47366738",
"0.47343254",
"0.47117555",
"0.47074553",
"0.47050288",
"0.47016492",
"0.46926296",
"0.46905592",
"0.4688606",
"0.4672993",
"0.46659887",
"0.46639115",
"0.46550938",
"0.46536115",
"0.46376884",
"0.46359935",
"0.46332788",
"0.46240547",
"0.46231288",
"0.46170682",
"0.46094695",
"0.45937634",
"0.45685875",
"0.45562682",
"0.45537877",
"0.45512345",
"0.45474824",
"0.45462835",
"0.45356363",
"0.45304075",
"0.45213056"
] | 0.71029395 | 1 |
Writes a sequence of ints to the stream at the current position. If len is 0, nothing is written. The int i[off] is written first, then the int i[off + 1], and so on. The byte order of the stream is used to determine the order in which the individual bytes are written. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeInts(int[] i, int off, int len) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeInt(int i) throws IOException {\n\t\tmBuffer[mBufferLength+3] = (byte) i;\n\t\tmBuffer[mBufferLength+2] = (byte) (i>>>8);\n\t\tmBuffer[mBufferLength+1] = (byte) (i>>>16);\n\t\tmBuffer[mBufferLength] = (byte) (i>>>24);\n\n\n\t\t\n\n\n\t\tmBufferLength += 4;\n\n\t\t// TODO: on the first filling of the buffer, flush when bufferLength+offset is at the end of a segment\n\t\tif (firstFill && ((mBufferLength >= firstFillThreshold))) {\n\t\t\tthis.flush();\n\t\t\tfirstFill = false;\n\t\t}\n\n\t\tif (mBufferLength == BUFFER_SIZE){\n\t\t\tthis.flush();\n\t\t}\n\t}",
"public void write(int ints) {\n try {\n mOutStream.writeInt(ints);\n Log.i(\"TRANSFER\", \"wrote \" + ints);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"public void writeInt(int i) throws IOException {\n\t\twriteByte((byte) (i >> 24));\n\t\twriteByte((byte) (i >> 16));\n\t\twriteByte((byte) (i >> 8));\n\t\twriteByte((byte) i);\n\t}",
"@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"static void encodeInt(DataOutput os, int i) throws IOException {\n if (i >> 28 != 0)\n os.write((i >> 28) & 0x7f);\n if (i >> 21 != 0)\n os.write((i >> 21) & 0x7f);\n if (i >> 14 != 0)\n os.write((i >> 14) & 0x7f);\n if (i >> 7 != 0)\n os.write((i >> 7) & 0x7f);\n os.write((i & 0x7f) | (1 << 7));\n }",
"void writeInt(int i) throws IOException;",
"public void writeIntArray(int[] array) throws IOException {\n\t\tfor (int a : array) {\n\t\t\tthis.writeInt(a);\n\t\t}\n\t}",
"public int read(int[] i, int start, int len) throws IOException {\n\n\t\tint ii = start;\n\t\ttry {\n\t\t\tfor (; ii < start + len; ii += 1) {\n\n\t\t\t\tif (count - pos < 4) {\n\t\t\t\t\tfillBuf(4);\n\t\t\t\t}\n\n\t\t\t\ti[ii] = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tpos += 4;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, ii, start, 4);\n\t\t}\n\t\treturn i.length * 4;\n\t}",
"public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }",
"public void write(byte b[], int off, int len) throws IOException;",
"void writeInt(int v) throws IOException;",
"public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }",
"public synchronized void write(byte[] buf, int off, int len)\n\t\t\t\tthrows IOException {\n\t\t\tsuper.write(buf, off, len);\n\t\t}",
"public void writeInt(int value)\n throws java.io.IOException {\n\n if (isBigEndian) {\n outputStream.writeByte((value >> 24) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte(value & 0xFF);\n } else {\n outputStream.writeByte(value & 0xFF);\n outputStream.writeByte((value >> 8) & 0xFF);\n outputStream.writeByte((value >> 16) & 0xFF);\n outputStream.writeByte((value >> 24) & 0xFF);\n }\n }",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"void writeInt(int value);",
"private static void writeToBuffer(int index, RandomAccessFile fos) {\n\n try {\n\n // x is the current integer value to be written.\n int x;\n // loc is the current location in the buffer to be written.\n int loc = 0;\n\n // iterates through each value in the sorted integer array.\n for (int k = 0; k < index; k++) {\n // gets the current integer.\n x = ints[k];\n\n // checks if the buffer is full.\n if (loc == BUF_SIZE) {\n // if the buffer is full, write its contents out to the file.\n fos.write(buf);\n // the buffer has been emptied, so set its current location back to the start.\n loc = 0;\n }\n\n // convert the current integer value to be written to a byte array.\n buf[loc] = (byte) (x >> 24);\n buf[loc + 1] = (byte) (x >> 16);\n buf[loc + 2] = (byte) (x >> 8);\n buf[loc + 3] = (byte) (x);\n\n // increment the location in the buffer now that a value has been written in.\n loc += BYTES_TO_INTS;\n }\n\n if (loc > 0) {\n // if there are any values left over in the buffer, write them out to the file.\n fos.write(buf, 0, loc);\n\n }\n } catch (IOException e){\n e.printStackTrace();\n }\n }",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }",
"public void write(byte b[], int off, int len) throws IOException {\n baos.write(b, off, len);\n }",
"int writeTo(byte[] iStream, int pos, ORecordVersion version);",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"public static void unsignedIntToBytes(byte[] buf, int offset, int len, int value) {\n for (int i = len - 1; i >= 0; i--) {\n buf[i + offset] = (byte) (value & 0xFF);\n value >>= 8;\n }\n }",
"public static void writeInteger(DataOutputStream dos,Integer data) throws IOException{\r\n\t\tif(data != null){\r\n\t\t\tdos.writeBoolean(true);\r\n\t\t\tdos.writeInt(data.intValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeBoolean(false);\r\n\t}",
"@Override\n\tpublic int write( byte [] buffer, int offset, int length ) {\n\t\tByteBuffer out = getOutputBuffer();\n\t\tif( out.limit() <= 0 ) {\n\t\t\tout.limit( out.capacity() );\n\t\t}\n\t\tsynchronized( out ) {\n\t\t\tout.put( buffer, offset, length );\n\t\t}\n\t\tdispatcher.requestWrite( this );\n\t\treturn length;\n\t}",
"public int write(ByteList buf, int offset, int len) throws IOException, BadDescriptorException {\n checkOpen();\n \n return internalWrite(ByteBuffer.wrap(buf.getUnsafeBytes(), buf.begin()+offset, len));\n }",
"public void write(byte[] data, long offset);",
"public synchronized void write(final int b) throws IOException {\n\t\tthis.singleIntArray[0] = (byte) (0xFF & b);\n\t\twrite(singleIntArray, 0, 1);\n\t}",
"public void write(final byte[] data, final int offset, final int len) throws IOException {\n checkOpened();\n dos.write(data, offset, len);\n flush();\n }",
"private static void m17788a(OutputStream outputStream, int i) {\n outputStream.write((i >> 0) & 255);\n outputStream.write((i >> 8) & 255);\n outputStream.write((i >> 16) & 255);\n outputStream.write((i >> 24) & 255);\n }",
"private void doClipWrite(byte b[], int off, int len) {\n\t\tif (count + len <= maxOutputSize) { // won't overflow\n\t\t\tthis.writeDirectly(b, off, len);\n\t\t} else {\n\t\t\tint discardBytes = len + count - maxOutputSize;\n\t\t\tif (len >= maxOutputSize) {\n\t\t\t\treset();\n\t\t\t\tthis.writeDirectly(b, off + len - maxOutputSize, maxOutputSize);\n\t\t\t} else {\n\t\t\t\tint shiftStart = count - maxOutputSize + len;\n\t\t\t\tint remaining = maxOutputSize - len;\n\t\t\t\tSystem.arraycopy(buf, shiftStart, buf, 0, remaining);\n\t\t\t\tcount = remaining;\n\t\t\t\tthis.writeDirectly(b, off, len);\n\t\t\t}\n\t\t\tclipNum ++;\n\t\t\tSystem.out.println(String.format(\"Overflow count: %d, discarded bytes number: %d\", clipNum,\n\t\t\t\t\tdiscardBytes));\n\t\t\t\n\t\t}\n\n\t}",
"public void writeUnsignedByte(int i) throws IOException {\r\n\t\tthis.writeByte(i);\r\n\t\t// this.writeByte((byte) (i % 128));\r\n\t}",
"public synchronized void write(final byte[] cbuf, final int off, final int len) throws IOException {\n\t\tif (len < 0) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tif (off < 0) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\tif (cbuf == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif ((len + off) > cbuf.length) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\n\t\tensureSize(cursor + len);\n\n\t\tSystem.arraycopy(cbuf, off, this.buffer, cursor, len);\n\t\tcursor += len;\n\t}",
"private void writeInt(DataOutputStream out, int n) throws IOException {\n int result = ((n & 0xFF) << 24) | ((n & 0xFF00) << 8) | ((n & 0xFF0000) >> 8) | ((n & 0xFF000000) >> 24);\n out.writeInt(result);\n }",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public void write( byte[] array, int firstIndex,\n\t\t\tint count );",
"protected abstract void write( int value ) throws IOException;",
"public void write(byte b[], int off, int len) throws IOException\n\t{\n\t\tout.write(b, off, len);\n\t\tmd5.update(b, off, len);\n\t}",
"public void write(int b) throws IOException;",
"@Override\n\tpublic void write(DataOutput dout) throws IOException {\n\t\tdout.writeLong(this.time);\n\t\tdout.writeInt(this.intVal);\n\t}",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\ttimeInt.write(out);\n\t\tsum.write(out);\n\t\tIp.write(out);\n\t}",
"public int write(byte[] b, int off, int len)\n {\n synchronized (this) {\n if (!open) {\n return 0;\n }\n\n writing = true;\n started = true;\n reset = false;\n timeTracker.start();\n }\n line.start();\n int written = line.write(b, off, len);\n synchronized (this) {\n // drain() might be waiting, so we should wake it up.\n notifyAll();\n writing = false;\n\t\t\tif (!reset) {\n\t\t\t\ttotalWritten += written;\n\t\t\t} else if (reset && open) {\n\t\t\t\t// Flush what we just wrote to keep it reset.\n\t\t\t\tline.flush();\n\t\t\t}\n return written;\n }\n }",
"private void writeLength( ObjectOutput out, int len ) throws IOException\n {\n\t\tif (len <= 31)\n\t\t{\n\t\t\tout.write((byte) (0x80 | (len & 0xff)));\n\t\t}\n\t\telse if (len <= 0xFFFF)\n\t\t{\n\t\t\tout.write((byte) 0xA0);\n\t\t\tout.writeShort((short) len);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tout.write((byte) 0xC0);\n\t\t\tout.writeInt(len);\n\n\t\t}\n }",
"@Override\n public void write(final byte[] data, final int offset, final int length)\n throws IOException {\n if (offset < 0 || length < 0 || length > data.length - offset) {\n throw new IndexOutOfBoundsException();\n }\n\n writeInternal(data, offset, length);\n }",
"@Override\n public void writeCompressed(DataOutput out) throws IOException {\n out.writeInt(length);\n out.write(array);\n }",
"@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}",
"@Override\n public void write(byte[] buf, int offset, int size) throws IOException;",
"public void writeLong(long i) throws IOException {\n\t\twriteInt((int) (i >> 32));\n\t\twriteInt((int) i);\n\t}",
"public int write(byte[] bytes, int offset, int length) throws FTD2XXException {\n Memory memory = new Memory(length);\n memory.write(0, bytes, offset, length);\n IntByReference wrote = new IntByReference();\n\n ensureFTStatus(ftd2xx.FT_Write(ftHandle, memory, length, wrote));\n\n return wrote.getValue();\n }",
"public final void writeInt(final int data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer4[0] = (byte) (data >>> 24);\r\n byteBuffer4[1] = (byte) (data >>> 16);\r\n byteBuffer4[2] = (byte) (data >>> 8);\r\n byteBuffer4[3] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer4[0] = (byte) (data & 0xff);\r\n byteBuffer4[1] = (byte) (data >>> 8);\r\n byteBuffer4[2] = (byte) (data >>> 16);\r\n byteBuffer4[3] = (byte) (data >>> 24);\r\n }\r\n\r\n raFile.write(byteBuffer4);\r\n }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"@Override\n protected void writeInternal(int index, int value) {\n\n }",
"void writeLongs(long[] l, int off, int len) throws IOException;",
"private static int writeBits(byte[] bytes, int value, int pos, int len) {\n assert(value > 0 && pos + len <= bytes.length * 8);\n int ind = pos / 8;\n int lastPos = 0;\n for (int i = 0; i < len; i++) {\n int bi = (pos + i) % 8;\n if ((value & (1 << (len - i - 1))) != 0) {\n bytes[ind] |= 1 << (7 - bi);\n lastPos = pos + i;\n }\n if (bi == 7) {\n ind++;\n }\n }\n return lastPos;\n }",
"public void write(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}",
"public BinaryEncoder writeInt(int i) throws IOException {\n // Compute the zig-zag value. First double the value and flip the bit if the input is negative.\n int val = (i << 1) ^ (i >> 31);\n\n if ((val & ~0x7f) != 0) {\n output.write(0x80 | val & 0x7f);\n val >>>= 7;\n while (val > 0x7f) {\n output.write(0x80 | val & 0x7f);\n val >>>= 7;\n }\n }\n output.write(val);\n\n return this;\n }",
"public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}",
"public static int writeStream(final DataOutputStream dos, final ByteBuffer towrite) throws IOException {\n int numBytesWritten = 0;\n final int bytesToWrite = towrite.capacity();\n final int bytesToWriteAsLongs = bytesToWrite & (~0x07);\n for(int i = 0; i < bytesToWriteAsLongs; i += Long.BYTES) {\n dos.writeLong(towrite.getLong(i));\n numBytesWritten += Long.BYTES;\n }\n for(int i = numBytesWritten; i < bytesToWrite; i++) {\n dos.write(towrite.get(i));\n numBytesWritten++;\n }\n return numBytesWritten;\n }",
"void writeByte(int v) throws IOException;",
"private byte[] intToBytes(int i) {\n\t\tb.clear();\n\t\treturn b.order(ByteOrder.LITTLE_ENDIAN).putInt(i).array();\n\t}",
"private void writeBuffer( byte b[], int offset, int length) throws IOException\r\n\t{\r\n\t\t// Write the chunk length as a hex number.\r\n\t\tfinal String size = Integer.toHexString(length);\r\n\t\tthis.out.write(size.getBytes());\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// Write the data.\r\n\t\tif (length != 0 )\r\n\t\t\tthis.out.write(b, offset, length);\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// And flush the real stream.\r\n\t\tthis.out.flush();\r\n\t}",
"@Override\n public void write(byte[] data) throws IOException {\n for (int i = 0; i < data.length; i++) {\n write(data[i]);\n }\n }",
"@Override\n public void write(DataOutput out) throws IOException {\n out.writeInt(numberOfIterations);\n }",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"public static final void transcodeAndWrite(byte[] input, \r\n java.io.OutputStream os,\r\n int offset, int length, int input_encoding, int output_encoding)\r\n throws TranscodeException,\r\n IOException {\n int k = offset;\r\n int c;\r\n while (k < offset + length) {\r\n long l = decode(input, k, input_encoding);\r\n k = (int) (l >> 32);\r\n c = (int) l;\r\n encodeAndWrite(os, c, output_encoding);\r\n }\r\n }",
"@Override\r\n public void write(int value) throws IOException {\r\n super.write(value);\r\n if (!(inWrite1 || inWrite3)) {\r\n /*if (!Helper.NEW_IO_HANDLING && null != IoNotifier.fileNotifier) {\r\n IoNotifier.fileNotifier.notifyWrite(recId, 1);\r\n } else {*/\r\n if (null != RecorderFrontend.instance) {\r\n RecorderFrontend.instance.writeIo(recId, \r\n null, 1, StreamType.FILE);\r\n }\r\n //}\r\n }\r\n }",
"protected abstract void writeInternal(int index, int value);",
"@DSSink({DSSinkKind.IO})\n @DSSpec(DSCat.IO)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-03 14:59:52.264 -0400\", hash_original_method = \"C10E35B15C5C34D2F11AD8F56A8AFBE7\", hash_generated_method = \"8538DC9FDF04C178771F287DC9084D00\")\n \n@Override\r\n public void write(int idx) throws IOException {\r\n try {\r\n beforeWrite(1);\r\n out.write(idx);\r\n afterWrite(1);\r\n } catch (IOException e) {\r\n handleIOException(e);\r\n }\r\n }",
"@Override\r\n\tpublic Buffer setUnsignedInt(int pos, long i) {\n\t\treturn null;\r\n\t}",
"public static native int write(int fd, byte[] data, int off, int len) throws IOException;",
"public void write(int b) throws IOException\n {\n checkThreshold(1);\n getStream().write(b);\n written++;\n }",
"@Override\r\n public void write(byte[] buffer, int off, int len) throws IOException {\r\n inWrite3 = true;\r\n try {\r\n super.write(buffer, off, len);\r\n if (!inWrite1) {\r\n /*if (!Helper.NEW_IO_HANDLING \r\n && null != IoNotifier.fileNotifier) {\r\n IoNotifier.fileNotifier.notifyWrite(recId, len);\r\n } else {*/\r\n if (null != RecorderFrontend.instance) {\r\n RecorderFrontend.instance.writeIo(recId, \r\n null, len, StreamType.FILE);\r\n }\r\n //}\r\n }\r\n inWrite3 = false;\r\n } catch (IOException e) {\r\n inWrite3 = false;\r\n throw e;\r\n }\r\n }",
"public void write(int b) throws IOException {\n baos.write(b);\n }",
"private synchronized void writeInternal(final byte[] data, int offset,\n int length) throws IOException {\n while (length > 0) {\n checkStreamState();\n final int availableBufferBytes = MAX_DATA_BYTES_PER_REQUEST\n - this.outBuffer.size();\n final int nextWrite = Math.min(availableBufferBytes, length);\n\n outBuffer.write(data, offset, nextWrite);\n offset += nextWrite;\n length -= nextWrite;\n\n if (outBuffer.size() > MAX_DATA_BYTES_PER_REQUEST) {\n throw new RuntimeException(\"Internal error: maximum write size \" +\n Integer.toString(MAX_DATA_BYTES_PER_REQUEST) + \"exceeded.\");\n }\n\n if (outBuffer.size() == MAX_DATA_BYTES_PER_REQUEST) {\n flushIOBuffers();\n }\n }\n }",
"@Override\r\n\t\t\tpublic void write(int b) throws IOException {\n\t\t\t}",
"private void write(byte[] data, int pos, int len)\n\t\tthrows IOException\n\t{\n\t\tchar[] chars = BASE64;\n\n\t\tint loc = (len > 0 ? (data[pos] << 24) >>> 8 : 0) |\n\t\t\t(len > 1 ? (data[pos+1] << 24) >>> 16 : 0) |\n\t\t\t(len > 2 ? (data[pos+2] << 24) >>> 24 : 0);\n\n\t\tswitch(len)\n\t\t{\n\t\t\tcase 3:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write(chars[loc & 0x3f]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\twriter.write('=');\n\t\t}\n\t}",
"public StreamWriter write(int value) {\r\n\t\tif(order() == ByteOrder.LITTLE_ENDIAN){\r\n\t\t\t_buffer[0] = (byte) (value & 0xFF);\r\n\t\t\t_buffer[1] = (byte) ((value & 0xFF00) >> 8);\r\n\t\t\t_buffer[2] = (byte) ((value & 0xFF0000) >> 16);\r\n\t\t\t_buffer[3] = (byte) ((value & 0xFF000000) >> 24);\r\n\t\t}else{\r\n\t\t\t_buffer[0] = (byte) (value >> 24);\r\n\t\t\t_buffer[1] = (byte) (value >> 16);\r\n\t\t\t_buffer[2] = (byte) (value >> 8);\r\n\t\t\t_buffer[3] = (byte) value;\r\n\t\t}\r\n\t\t_stream.write(_buffer,0,4);\r\n\t\treturn this;\r\n\t}",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"public void write(byte[] b, int offset, int len) throws IOException {\n if (pos + len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, pos, len);\n pos += len;\n } else {\n flush();\n if (len < BUFFER_SIZE) {\n System.arraycopy(b, offset, buffer, 0, len);\n } else {\n ConsoleRedirect.this.flush(b, offset, len);\n }\n }\n }",
"public void write(byte b[]) throws IOException;",
"public abstract void writeRange(int startElement, int count,\r\n ByteBuffer src, int offsetBytes, boolean bForward);",
"public void mWriteByte(OutputStream oOutputStream,int out) { //Cast the byt to an array\n byte[] out1=new byte[1];\n out1[0]= (byte) out;\n mWriteByte(oOutputStream,out1);\n }",
"public static int writeInt(OutputStream target, int value) throws IOException {\n target.write(value >>> 24);\n target.write(value >>> 16);\n target.write(value >>> 8);\n target.write(value);\n return Integer.BYTES;\n }",
"public interface ImageOutputStream extends ImageInputStream, DataOutput {\n\n /**\n * Writes a single byte to the stream at the current position.\n * The 24 high-order bits of <code>b</code> are ignored.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write. Implementers can use the\n * {@link ImageOutputStreamImpl#flushBits flushBits}\n * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}\n * to guarantee this.\n *\n * @param b an <code>int</code> whose lower 8 bits are to be\n * written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void write(int b) throws IOException;\n\n /**\n * Writes a sequence of bytes to the stream at the current\n * position. If <code>b.length</code> is 0, nothing is written.\n * The byte <code>b[0]</code> is written first, then the byte\n * <code>b[1]</code>, and so on.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param b an array of <code>byte</code>s to be written.\n *\n * @exception NullPointerException if <code>b</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void write(byte b[]) throws IOException;\n\n /**\n * Writes a sequence of bytes to the stream at the current\n * position. If <code>len</code> is 0, nothing is written.\n * The byte <code>b[off]</code> is written first, then the byte\n * <code>b[off + 1]</code>, and so on.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write. Implementers can use the\n * {@link ImageOutputStreamImpl#flushBits flushBits}\n * method of {@link ImageOutputStreamImpl ImageOutputStreamImpl}\n * to guarantee this.\n *\n * @param b an array of <code>byte</code>s to be written.\n * @param off the start offset in the data.\n * @param len the number of <code>byte</code>s to write.\n *\n * @exception IndexOutOfBoundsException if <code>off</code> is\n * negative, <code>len</code> is negative, or <code>off +\n * len</code> is greater than <code>b.length</code>.\n * @exception NullPointerException if <code>b</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void write(byte b[], int off, int len) throws IOException;\n\n /**\n * Writes a <code>boolean</code> value to the stream. If\n * <code>v</code> is true, the value <code>(byte)1</code> is\n * written; if <code>v</code> is false, the value\n * <code>(byte)0</code> is written.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param v the <code>boolean</code> to be written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeBoolean(boolean v) throws IOException;\n\n /**\n * Writes the 8 low-order bits of <code>v</code> to the\n * stream. The 24 high-order bits of <code>v</code> are ignored.\n * (This means that <code>writeByte</code> does exactly the same\n * thing as <code>write</code> for an integer argument.)\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param v an <code>int</code> containing the byte value to be\n * written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeByte(int v) throws IOException;\n\n /**\n * Writes the 16 low-order bits of <code>v</code> to the\n * stream. The 16 high-order bits of <code>v</code> are ignored.\n * If the stream uses network byte order, the bytes written, in\n * order, will be:\n *\n * <pre>\n * (byte)((v >> 8) & 0xff)\n * (byte)(v & 0xff)\n * </pre>\n *\n * Otherwise, the bytes written will be:\n *\n * <pre>\n * (byte)(v & 0xff)\n * (byte)((v >> 8) & 0xff)\n * </pre>\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param v an <code>int</code> containing the short value to be\n * written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeShort(int v) throws IOException;\n\n /**\n * This method is a synonym for {@link #writeShort writeShort}.\n *\n * @param v an <code>int</code> containing the char (unsigned\n * short) value to be written.\n *\n * @exception IOException if an I/O error occurs.\n *\n * @see #writeShort(int)\n */\n void writeChar(int v) throws IOException;\n\n /**\n * Writes the 32 bits of <code>v</code> to the stream. If the\n * stream uses network byte order, the bytes written, in order,\n * will be:\n *\n * <pre>\n * (byte)((v >> 24) & 0xff)\n * (byte)((v >> 16) & 0xff)\n * (byte)((v >> 8) & 0xff)\n * (byte)(v & 0xff)\n * </pre>\n *\n * Otheriwse, the bytes written will be:\n *\n * <pre>\n * (byte)(v & 0xff)\n * (byte)((v >> 8) & 0xff)\n * (byte)((v >> 16) & 0xff)\n * (byte)((v >> 24) & 0xff)\n * </pre>\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param v an <code>int</code> containing the value to be\n * written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeInt(int v) throws IOException;\n\n /**\n * Writes the 64 bits of <code>v</code> to the stream. If the\n * stream uses network byte order, the bytes written, in order,\n * will be:\n *\n * <pre>\n * (byte)((v >> 56) & 0xff)\n * (byte)((v >> 48) & 0xff)\n * (byte)((v >> 40) & 0xff)\n * (byte)((v >> 32) & 0xff)\n * (byte)((v >> 24) & 0xff)\n * (byte)((v >> 16) & 0xff)\n * (byte)((v >> 8) & 0xff)\n * (byte)(v & 0xff)\n * </pre>\n *\n * Otherwise, the bytes written will be:\n *\n * <pre>\n * (byte)(v & 0xff)\n * (byte)((v >> 8) & 0xff)\n * (byte)((v >> 16) & 0xff)\n * (byte)((v >> 24) & 0xff)\n * (byte)((v >> 32) & 0xff)\n * (byte)((v >> 40) & 0xff)\n * (byte)((v >> 48) & 0xff)\n * (byte)((v >> 56) & 0xff)\n * </pre>\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param v a <code>long</code> containing the value to be\n * written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeLong(long v) throws IOException;\n\n /**\n * Writes a <code>float</code> value, which is comprised of four\n * bytes, to the output stream. It does this as if it first\n * converts this <code>float</code> value to an <code>int</code>\n * in exactly the manner of the <code>Float.floatToIntBits</code>\n * method and then writes the int value in exactly the manner of\n * the <code>writeInt</code> method.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param v a <code>float</code> containing the value to be\n * written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeFloat(float v) throws IOException;\n\n /**\n * Writes a <code>double</code> value, which is comprised of four\n * bytes, to the output stream. It does this as if it first\n * converts this <code>double</code> value to an <code>long</code>\n * in exactly the manner of the\n * <code>Double.doubleToLongBits</code> method and then writes the\n * long value in exactly the manner of the <code>writeLong</code>\n * method.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param v a <code>double</code> containing the value to be\n * written.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeDouble(double v) throws IOException;\n\n /**\n * Writes a string to the output stream. For every character in\n * the string <code>s</code>, taken in order, one byte is written\n * to the output stream. If <code>s</code> is <code>null</code>, a\n * <code>NullPointerException</code> is thrown.\n *\n * <p> If <code>s.length</code> is zero, then no bytes are\n * written. Otherwise, the character <code>s[0]</code> is written\n * first, then <code>s[1]</code>, and so on; the last character\n * written is <code>s[s.length-1]</code>. For each character, one\n * byte is written, the low-order byte, in exactly the manner of\n * the <code>writeByte</code> method. The high-order eight bits of\n * each character in the string are ignored.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param s a <code>String</code> containing the value to be\n * written.\n *\n * @exception NullPointerException if <code>s</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeBytes(String s) throws IOException;\n\n /**\n * Writes a string to the output stream. For every character in\n * the string <code>s</code>, taken in order, two bytes are\n * written to the output stream, ordered according to the current\n * byte order setting. If network byte order is being used, the\n * high-order byte is written first; the order is reversed\n * otherwise. If <code>s</code> is <code>null</code>, a\n * <code>NullPointerException</code> is thrown.\n *\n * <p> If <code>s.length</code> is zero, then no bytes are\n * written. Otherwise, the character <code>s[0]</code> is written\n * first, then <code>s[1]</code>, and so on; the last character\n * written is <code>s[s.length-1]</code>.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param s a <code>String</code> containing the value to be\n * written.\n *\n * @exception NullPointerException if <code>s</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeChars(String s) throws IOException;\n\n /**\n * Writes two bytes of length information to the output stream in\n * network byte order, followed by the\n * <a href=\"../../../java/io/DataInput.html#modified-utf-8\">modified\n * UTF-8</a>\n * representation of every character in the string <code>s</code>.\n * If <code>s</code> is <code>null</code>, a\n * <code>NullPointerException</code> is thrown. Each character in\n * the string <code>s</code> is converted to a group of one, two,\n * or three bytes, depending on the value of the character.\n *\n * <p> If a character <code>c</code> is in the range\n * <code>\u0001</code> through <code>\u007f</code>, it is\n * represented by one byte:\n *\n * <p><pre>\n * (byte)c\n * </pre>\n *\n * <p> If a character <code>c</code> is <code>\u0000</code> or\n * is in the range <code>\u0080</code> through\n * <code>\u07ff</code>, then it is represented by two bytes,\n * to be written in the order shown:\n *\n * <p> <pre><code>\n * (byte)(0xc0 | (0x1f & (c >> 6)))\n * (byte)(0x80 | (0x3f & c))\n * </code></pre>\n *\n * <p> If a character <code>c</code> is in the range\n * <code>\u0800</code> through <code>uffff</code>, then it is\n * represented by three bytes, to be written in the order shown:\n *\n * <p> <pre><code>\n * (byte)(0xe0 | (0x0f & (c >> 12)))\n * (byte)(0x80 | (0x3f & (c >> 6)))\n * (byte)(0x80 | (0x3f & c))\n * </code></pre>\n *\n * <p> First, the total number of bytes needed to represent all\n * the characters of <code>s</code> is calculated. If this number\n * is larger than <code>65535</code>, then a\n * <code>UTFDataFormatException</code> is thrown. Otherwise, this\n * length is written to the output stream in exactly the manner of\n * the <code>writeShort</code> method; after this, the one-, two-,\n * or three-byte representation of each character in the string\n * <code>s</code> is written.\n *\n * <p> The current byte order setting is ignored.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * <p><strong>Note:</strong> This method should not be used in\n * the implementation of image formats that use standard UTF-8,\n * because the modified UTF-8 used here is incompatible with\n * standard UTF-8.\n *\n * @param s a <code>String</code> containing the value to be\n * written.\n *\n * @exception NullPointerException if <code>s</code> is\n * <code>null</code>.\n * @exception java.io.UTFDataFormatException if the modified UTF-8\n * representation of <code>s</code> requires more than 65536 bytes.\n * @exception IOException if an I/O error occurs.\n */\n void writeUTF(String s) throws IOException;\n\n /**\n * Writes a sequence of shorts to the stream at the current\n * position. If <code>len</code> is 0, nothing is written.\n * The short <code>s[off]</code> is written first, then the short\n * <code>s[off + 1]</code>, and so on. The byte order of the\n * stream is used to determine the order in which the individual\n * bytes are written.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param s an array of <code>short</code>s to be written.\n * @param off the start offset in the data.\n * @param len the number of <code>short</code>s to write.\n *\n * @exception IndexOutOfBoundsException if <code>off</code> is\n * negative, <code>len</code> is negative, or <code>off +\n * len</code> is greater than <code>s.length</code>.\n * @exception NullPointerException if <code>s</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeShorts(short[] s, int off, int len) throws IOException;\n\n /**\n * Writes a sequence of chars to the stream at the current\n * position. If <code>len</code> is 0, nothing is written.\n * The char <code>c[off]</code> is written first, then the char\n * <code>c[off + 1]</code>, and so on. The byte order of the\n * stream is used to determine the order in which the individual\n * bytes are written.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param c an array of <code>char</code>s to be written.\n * @param off the start offset in the data.\n * @param len the number of <code>char</code>s to write.\n *\n * @exception IndexOutOfBoundsException if <code>off</code> is\n * negative, <code>len</code> is negative, or <code>off +\n * len</code> is greater than <code>c.length</code>.\n * @exception NullPointerException if <code>c</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeChars(char[] c, int off, int len) throws IOException;\n\n /**\n * Writes a sequence of ints to the stream at the current\n * position. If <code>len</code> is 0, nothing is written.\n * The int <code>i[off]</code> is written first, then the int\n * <code>i[off + 1]</code>, and so on. The byte order of the\n * stream is used to determine the order in which the individual\n * bytes are written.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param i an array of <code>int</code>s to be written.\n * @param off the start offset in the data.\n * @param len the number of <code>int</code>s to write.\n *\n * @exception IndexOutOfBoundsException if <code>off</code> is\n * negative, <code>len</code> is negative, or <code>off +\n * len</code> is greater than <code>i.length</code>.\n * @exception NullPointerException if <code>i</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeInts(int[] i, int off, int len) throws IOException;\n\n /**\n * Writes a sequence of longs to the stream at the current\n * position. If <code>len</code> is 0, nothing is written.\n * The long <code>l[off]</code> is written first, then the long\n * <code>l[off + 1]</code>, and so on. The byte order of the\n * stream is used to determine the order in which the individual\n * bytes are written.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param l an array of <code>long</code>s to be written.\n * @param off the start offset in the data.\n * @param len the number of <code>long</code>s to write.\n *\n * @exception IndexOutOfBoundsException if <code>off</code> is\n * negative, <code>len</code> is negative, or <code>off +\n * len</code> is greater than <code>l.length</code>.\n * @exception NullPointerException if <code>l</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeLongs(long[] l, int off, int len) throws IOException;\n\n /**\n * Writes a sequence of floats to the stream at the current\n * position. If <code>len</code> is 0, nothing is written.\n * The float <code>f[off]</code> is written first, then the float\n * <code>f[off + 1]</code>, and so on. The byte order of the\n * stream is used to determine the order in which the individual\n * bytes are written.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param f an array of <code>float</code>s to be written.\n * @param off the start offset in the data.\n * @param len the number of <code>float</code>s to write.\n *\n * @exception IndexOutOfBoundsException if <code>off</code> is\n * negative, <code>len</code> is negative, or <code>off +\n * len</code> is greater than <code>f.length</code>.\n * @exception NullPointerException if <code>f</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeFloats(float[] f, int off, int len) throws IOException;\n\n /**\n * Writes a sequence of doubles to the stream at the current\n * position. If <code>len</code> is 0, nothing is written.\n * The double <code>d[off]</code> is written first, then the double\n * <code>d[off + 1]</code>, and so on. The byte order of the\n * stream is used to determine the order in which the individual\n * bytes are written.\n *\n * <p> If the bit offset within the stream is non-zero, the\n * remainder of the current byte is padded with 0s\n * and written out first. The bit offset will be 0 after the\n * write.\n *\n * @param d an array of <code>doubles</code>s to be written.\n * @param off the start offset in the data.\n * @param len the number of <code>double</code>s to write.\n *\n * @exception IndexOutOfBoundsException if <code>off</code> is\n * negative, <code>len</code> is negative, or <code>off +\n * len</code> is greater than <code>d.length</code>.\n * @exception NullPointerException if <code>d</code> is\n * <code>null</code>.\n * @exception IOException if an I/O error occurs.\n */\n void writeDoubles(double[] d, int off, int len) throws IOException;\n\n /**\n * Writes a single bit, given by the least significant bit of the\n * argument, to the stream at the current bit offset within the\n * current byte position. The upper 31 bits of the argument are\n * ignored. The given bit replaces the previous bit at that\n * position. The bit offset is advanced by one and reduced modulo\n * 8.\n *\n * <p> If any bits of a particular byte have never been set\n * at the time the byte is flushed to the destination, those\n * bits will be set to 0 automatically.\n *\n * @param bit an <code>int</code> whose least significant bit\n * is to be written to the stream.\n *\n * @exception IOException if an I/O error occurs.\n */\n void writeBit(int bit) throws IOException;\n\n /**\n * Writes a sequence of bits, given by the <code>numBits</code>\n * least significant bits of the <code>bits</code> argument in\n * left-to-right order, to the stream at the current bit offset\n * within the current byte position. The upper <code>64 -\n * numBits</code> bits of the argument are ignored. The bit\n * offset is advanced by <code>numBits</code> and reduced modulo\n * 8. Note that a bit offset of 0 always indicates the\n * most-significant bit of the byte, and bytes of bits are written\n * out in sequence as they are encountered. Thus bit writes are\n * always effectively in network byte order. The actual stream\n * byte order setting is ignored.\n *\n * <p> Bit data may be accumulated in memory indefinitely, until\n * <code>flushBefore</code> is called. At that time, all bit data\n * prior to the flushed position will be written.\n *\n * <p> If any bits of a particular byte have never been set\n * at the time the byte is flushed to the destination, those\n * bits will be set to 0 automatically.\n *\n * @param bits a <code>long</code> containing the bits to be\n * written, starting with the bit in position <code>numBits -\n * 1</code> down to the least significant bit.\n *\n * @param numBits an <code>int</code> between 0 and 64, inclusive.\n *\n * @exception IllegalArgumentException if <code>numBits</code> is\n * not between 0 and 64, inclusive.\n * @exception IOException if an I/O error occurs.\n */\n void writeBits(long bits, int numBits) throws IOException;\n\n /**\n * Flushes all data prior to the given position to the underlying\n * destination, such as an <code>OutputStream</code> or\n * <code>File</code>. Attempting to seek to the flushed portion\n * of the stream will result in an\n * <code>IndexOutOfBoundsException</code>.\n *\n * @param pos a <code>long</code> containing the length of the\n * stream prefix that may be flushed to the destination.\n *\n * @exception IndexOutOfBoundsException if <code>pos</code> lies\n * in the flushed portion of the stream or past the current stream\n * position.\n * @exception IOException if an I/O error occurs.\n */\n void flushBefore(long pos) throws IOException;\n}",
"public void write(int datum) throws IOException {\n if (!_open)\n return;\n datum &= 0xff;\n long _here = position();\n\n // Are we synced up?\n if (_here == _digestvalidto) {\n\n // Yes, digest the byte and move the valid to pointer.\n _digest.update((byte) datum);\n _digestvalidto++; // JMC: Was missing.\n\n } // Otherwise, advancing of the position will destroy the digest sync.\n\n datum = _head.crypt((byte) datum, _here);\n _backing.write(datum);\n }",
"@Override\r\n\tpublic Buffer setInt(int pos, int i) {\n\t\treturn null;\r\n\t}",
"public static void write4bytes(int value, OutputStream outputStream) throws IOException {\n outputStream.write(value >>> 3 * 8);\n outputStream.write(value >>> 2 * 8 & 255);\n outputStream.write(value >>> 1 * 8 & 255);\n outputStream.write(value & 255);\n }",
"protected void write(byte[] bytes, int offset, int length) {\n/* 114 */ if (this.socket == null) {\n/* 115 */ if (this.connector != null && !this.immediateFail) {\n/* 116 */ this.connector.latch();\n/* */ }\n/* 118 */ if (this.socket == null) {\n/* 119 */ String msg = \"Error writing to \" + getName() + \" socket not available\";\n/* 120 */ throw new AppenderLoggingException(msg);\n/* */ } \n/* */ } \n/* 123 */ synchronized (this) {\n/* */ try {\n/* 125 */ getOutputStream().write(bytes, offset, length);\n/* 126 */ } catch (IOException ex) {\n/* 127 */ if (this.retry && this.connector == null) {\n/* 128 */ this.connector = new Reconnector(this);\n/* 129 */ this.connector.setDaemon(true);\n/* 130 */ this.connector.setPriority(1);\n/* 131 */ this.connector.start();\n/* */ } \n/* 133 */ String msg = \"Error writing to \" + getName();\n/* 134 */ throw new AppenderLoggingException(msg, ex);\n/* */ } \n/* */ } \n/* */ }",
"@Override\n protected void serialize(OutputStream os) throws IOException {\n writeInt(os,_gateCounter);\n }",
"public void write(byte b[]) throws IOException\n {\n checkThreshold(b.length);\n getStream().write(b);\n written += b.length;\n }",
"@Override\r\n\tpublic void write(DataOutput out) throws IOException {\n\t\tWritableUtils.writeVInt(out, this.id);\r\n\t}",
"@Override\n\tpublic void write(int value) {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\tCpuMem.getInstance().writeMem(address, value);\n\t}",
"public abstract void writeBytes(byte[] b, int offset, int length) throws IOException;",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"@Override\n public int write(byte[] bytes, int offset, int length) throws SWPException {\n int codePointLength = getLength();\n SWPException.requireTrue(length >= codePointLength, \"Buffer overflow.\");\n bytes[offset] = (byte) ((codePointLength << 8) & 0xff);\n bytes[offset + 1] = (byte) (codePointLength & 0xff);\n bytes[offset + 2] = (byte) (codePoint >>> 8);\n bytes[offset + 3] = (byte) (codePoint & 0xff);\n if (isNull()) {\n\n bytes[offset + 4] = SwpConstants.NULL_INDICATOR;\n }\n else {\n\n bytes[offset + 4] = SwpConstants.NOT_NULL_INDICATOR;\n primitive.write(bytes, offset + 5, length - 5);\n }\n return codePointLength;\n }",
"public void write(int b) throws IOException\n {\n this.out.write(b); // write the byte b to the Stream\n }",
"public void write(long[] timestamps, int[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"public static int writeInt(byte[] target, int offset, int value) {\n target[offset] = (byte) (value >>> 24);\n target[offset + 1] = (byte) (value >>> 16);\n target[offset + 2] = (byte) (value >>> 8);\n target[offset + 3] = (byte) value;\n return Integer.BYTES;\n }"
] | [
"0.6555127",
"0.62593967",
"0.6217069",
"0.6113152",
"0.6056727",
"0.5926616",
"0.5880891",
"0.5815795",
"0.5756617",
"0.5745028",
"0.5717682",
"0.5537564",
"0.55314523",
"0.54827976",
"0.54368067",
"0.5431082",
"0.5381808",
"0.5377031",
"0.53762805",
"0.5348105",
"0.53461426",
"0.53257614",
"0.53070897",
"0.52801794",
"0.52768064",
"0.5263811",
"0.52634233",
"0.526317",
"0.5242684",
"0.5241763",
"0.5222254",
"0.5218088",
"0.52154225",
"0.5211216",
"0.5187407",
"0.51851326",
"0.5167765",
"0.51377356",
"0.5113763",
"0.5086049",
"0.5083385",
"0.50824827",
"0.50754565",
"0.50621516",
"0.5049093",
"0.5047566",
"0.5041043",
"0.5007496",
"0.50040996",
"0.49997708",
"0.4996106",
"0.49822628",
"0.49707752",
"0.49707752",
"0.4967772",
"0.49655983",
"0.49624342",
"0.49531245",
"0.49461296",
"0.49114665",
"0.48637533",
"0.48560825",
"0.48560584",
"0.4844569",
"0.48445347",
"0.48355344",
"0.48354185",
"0.48319772",
"0.48140365",
"0.48134974",
"0.47976345",
"0.47846135",
"0.47841808",
"0.47771883",
"0.47739947",
"0.47651672",
"0.4760537",
"0.47418314",
"0.47397482",
"0.47239646",
"0.47205722",
"0.47200984",
"0.4707315",
"0.46996194",
"0.46974513",
"0.4685985",
"0.46819693",
"0.46804774",
"0.46797815",
"0.4671168",
"0.46680063",
"0.46609184",
"0.4655322",
"0.46478346",
"0.46477583",
"0.46445185",
"0.4641586",
"0.46398607",
"0.46376252",
"0.4630804"
] | 0.75049406 | 0 |
Writes a sequence of longs to the stream at the current position. If len is 0, nothing is written. The long l[off] is written first, then the long l[off + 1], and so on. The byte order of the stream is used to determine the order in which the individual bytes are written. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeLongs(long[] l, int off, int len) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static LongWriter<?> writer(long[] longs, int offset, int length) {\n\t\treturn new SimpleLongWriter(longs, offset, length);\n\t}",
"public int read(long[] l, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 8) {\n\t\t\t\t\tfillBuf(8);\n\t\t\t\t}\n\t\t\t\tint i1 = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tint i2 = buf[pos + 4] << 24 | (buf[pos + 5] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 6] & 0xFF) << 8 | (buf[pos + 7] & 0xFF);\n\t\t\t\tl[i] = ((long) i1) << 32 | ((long) i2 & 0x00000000FFFFFFFFL);\n\t\t\t\tpos += 8;\n\t\t\t}\n\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 8);\n\t\t}\n\t\treturn 8 * len;\n\t}",
"public BinaryEncoder writeLong(long l) throws IOException {\n // Compute the zig-zag value. First double the value and flip the bit if the input is negative.\n long val = (l << 1) ^ (l >> 63);\n\n if ((val & ~0x7f) != 0) {\n output.write((int) (0x80 | val & 0x7f));\n val >>>= 7;\n while (val > 0x7f) {\n output.write((int) (0x80 | val & 0x7f));\n val >>>= 7;\n }\n }\n output.write((int) val);\n\n return this;\n }",
"void writeLong(long v) throws IOException;",
"public void writeLong(long i) throws IOException {\n\t\twriteInt((int) (i >> 32));\n\t\twriteInt((int) i);\n\t}",
"void writeLong(long value);",
"public void write(long l) {\n while (isFull()) {\n }\n Timing.waitSyncLocal();\n writeEnable.setNow(1);\n writeData.setNow(l);\n Timing.waitClockLocal();\n }",
"public static LongWriter<?> writer(long[] longs) {\n\t\treturn writer(longs, 0, longs.length);\n\t}",
"public static int putLong(byte[] bytes, int offset, long val) {\n if (bytes.length - offset < SIZEOF_LONG) {\n throw new IllegalArgumentException(\"Not enough room to put a long at\"\n + \" offset \" + offset + \" in a \" + bytes.length + \" byte array\");\n }\n\n for(int i = offset + 7; i > offset; i--) {\n bytes[i] = (byte) val;\n val >>>= 8;\n }\n bytes[offset] = (byte) val;\n return offset + SIZEOF_LONG;\n\n }",
"public static void write(byte[] buffer, long offset, long length , long value) {\n while(length-- > 0){\n buffer[(int) offset++] = (byte) (value & 0xFF);\n value >>=8;\n }\n }",
"public void printLongBinary(long l) {\n\t}",
"public ByteBuf writeLongLE(long value)\r\n/* 877: */ {\r\n/* 878:886 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 879:887 */ return super.writeLongLE(value);\r\n/* 880: */ }",
"@Override\r\n\tpublic Buffer setLong(int pos, long l) {\n\t\treturn null;\r\n\t}",
"private synchronized long readLong(int len) throws IOException {\n\t\tread(bytes, len);\n\t\treturn readLong(bytes, 0, len);\n\t}",
"public ByteBuf writeLong(long value)\r\n/* 557: */ {\r\n/* 558:568 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 559:569 */ return super.writeLong(value);\r\n/* 560: */ }",
"public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }",
"public int read(long[] l) throws IOException {\n\t\treturn read(l, 0, l.length);\n\t}",
"public void setLong(int offset, long value) {\n for (int i = 0; i < 8; ++i) {\n setByte(offset+i, value >>> (8-i-1 << 3));\n }\n }",
"void writeBits(long bits, int numBits) throws IOException;",
"public static int writeLong(byte[] target, int offset, long value) {\n target[offset] = (byte) (value >>> 56);\n target[offset + 1] = (byte) (value >>> 48);\n target[offset + 2] = (byte) (value >>> 40);\n target[offset + 3] = (byte) (value >>> 32);\n target[offset + 4] = (byte) (value >>> 24);\n target[offset + 5] = (byte) (value >>> 16);\n target[offset + 6] = (byte) (value >>> 8);\n target[offset + 7] = (byte) value;\n return Long.BYTES;\n }",
"public void write(byte b[], int off, int len) throws IOException\n\t{\n\t\tout.write(b, off, len);\n\t\tmd5.update(b, off, len);\n\t}",
"private void writeLength( ObjectOutput out, int len ) throws IOException\n {\n\t\tif (len <= 31)\n\t\t{\n\t\t\tout.write((byte) (0x80 | (len & 0xff)));\n\t\t}\n\t\telse if (len <= 0xFFFF)\n\t\t{\n\t\t\tout.write((byte) 0xA0);\n\t\t\tout.writeShort((short) len);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tout.write((byte) 0xC0);\n\t\t\tout.writeInt(len);\n\n\t\t}\n }",
"private void writeLength(int length) {\n if (length < 128) {\n os.write((byte) length);\n } else if (length < 256) {\n os.write(-127); // 10000001 - 1 byte to follow\n os.write((byte) length);\n } else if (length < 65536) {\n os.write(-126); // 10000010 - 2 bytes to follow\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else if (length < 16777216) {\n os.write(-125); // 10000011 - 3 bytes to follow\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n } else {\n os.write(-124); // 10000100 - 4 bytes to follow\n os.write((byte) (length >> 24));\n os.write((byte) (length >> 16));\n os.write((byte) (length >> 8));\n os.write((byte) length);\n }\n }",
"public void write(byte[] data, long offset);",
"public int write(byte[] b, int off, int len)\n {\n synchronized (this) {\n if (!open) {\n return 0;\n }\n\n writing = true;\n started = true;\n reset = false;\n timeTracker.start();\n }\n line.start();\n int written = line.write(b, off, len);\n synchronized (this) {\n // drain() might be waiting, so we should wake it up.\n notifyAll();\n writing = false;\n\t\t\tif (!reset) {\n\t\t\t\ttotalWritten += written;\n\t\t\t} else if (reset && open) {\n\t\t\t\t// Flush what we just wrote to keep it reset.\n\t\t\t\tline.flush();\n\t\t\t}\n return written;\n }\n }",
"public ByteBuf setLongLE(int index, long value)\r\n/* 811: */ {\r\n/* 812:820 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 813:821 */ return super.setLongLE(index, value);\r\n/* 814: */ }",
"public static int writeLong(OutputStream target, long value) throws IOException {\n target.write((byte) (value >>> 56));\n target.write((byte) (value >>> 48));\n target.write((byte) (value >>> 40));\n target.write((byte) (value >>> 32));\n target.write((byte) (value >>> 24));\n target.write((byte) (value >>> 16));\n target.write((byte) (value >>> 8));\n target.write((byte) value);\n return Long.BYTES;\n }",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"public abstract void read_ulonglong_array(long[] value, int offset, int\nlength);",
"public void writeNonBlock(long l) {\n Timing.throughputLocal(0);\n writeEnable.setNow(1);\n writeData.setNow(l);\n Timing.waitClockLocal();\n }",
"public synchronized static byte [] LongToBytes ( long ldata, int n )\n {\n byte buff[] = new byte [ n ];\n\n for ( int i=n-1; i>=0; i--)\n {\n // Keep assigning the right most 8 bits to the\n // byte arrays while shift 8 bits during each iteration\n buff [ i ] = (byte) ldata;\n ldata = ldata >> 8;\n }\n return buff;\n }",
"public final void writeLong(final long data, final boolean endianess) throws IOException {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n byteBuffer8[0] = (byte) (data >>> 56);\r\n byteBuffer8[1] = (byte) (data >>> 48);\r\n byteBuffer8[2] = (byte) (data >>> 40);\r\n byteBuffer8[3] = (byte) (data >>> 32);\r\n byteBuffer8[4] = (byte) (data >>> 24);\r\n byteBuffer8[5] = (byte) (data >>> 16);\r\n byteBuffer8[6] = (byte) (data >>> 8);\r\n byteBuffer8[7] = (byte) (data & 0xff);\r\n } else {\r\n byteBuffer8[0] = (byte) (data & 0xff);\r\n byteBuffer8[1] = (byte) (data >>> 8);\r\n byteBuffer8[2] = (byte) (data >>> 16);\r\n byteBuffer8[3] = (byte) (data >>> 24);\r\n byteBuffer8[4] = (byte) (data >>> 32);\r\n byteBuffer8[5] = (byte) (data >>> 40);\r\n byteBuffer8[6] = (byte) (data >>> 48);\r\n byteBuffer8[7] = (byte) (data >>> 56);\r\n }\r\n\r\n raFile.write(byteBuffer8);\r\n }",
"public int write(ByteList buf, int offset, int len) throws IOException, BadDescriptorException {\n checkOpen();\n \n return internalWrite(ByteBuffer.wrap(buf.getUnsafeBytes(), buf.begin()+offset, len));\n }",
"public ByteBuf setLongLE(int index, long value)\r\n/* 512: */ {\r\n/* 513:526 */ ensureAccessible();\r\n/* 514:527 */ _setLongLE(index, value);\r\n/* 515:528 */ return this;\r\n/* 516: */ }",
"private static void ensureOffsetLengthOfLongArray(final long[] a, final int offset, final int length) {\n\t\tensureOffsetLength(a.length, offset, length);\n\t}",
"@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }",
"public void write(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}",
"private void write(byte[] data, int pos, int len)\n\t\tthrows IOException\n\t{\n\t\tchar[] chars = BASE64;\n\n\t\tint loc = (len > 0 ? (data[pos] << 24) >>> 8 : 0) |\n\t\t\t(len > 1 ? (data[pos+1] << 24) >>> 16 : 0) |\n\t\t\t(len > 2 ? (data[pos+2] << 24) >>> 24 : 0);\n\n\t\tswitch(len)\n\t\t{\n\t\t\tcase 3:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write(chars[loc & 0x3f]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\twriter.write('=');\n\t\t}\n\t}",
"String longWrite();",
"public void write(byte b[], int off, int len) throws IOException {\n baos.write(b, off, len);\n }",
"public void write(final byte[] data, final int offset, final int len) throws IOException {\n checkOpened();\n dos.write(data, offset, len);\n flush();\n }",
"public synchronized void write(byte[] buf, int off, int len)\n\t\t\t\tthrows IOException {\n\t\t\tsuper.write(buf, off, len);\n\t\t}",
"public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }",
"void writeInts(int[] i, int off, int len) throws IOException;",
"public static StringBuilder formatLong(StringBuilder sb, long v, int length) { return formatLong(sb,v,length,false); }",
"public abstract void save(IntLongsCol col, DataOutputStream output) throws IOException;",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public static byte[] longToBytes(long l) {\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(NUM_BYTES_IN_LONG);\n byteBuffer.putLong(l);\n return byteBuffer.array();\n\n }",
"public abstract void read_long_array(int[] value, int offset, int\nlength);",
"public void setLong(int addr, long val) throws ProgramException {\n setLittleEndian(addr, Long.BYTES, val);\n }",
"public static byte[] getLongAsBytes(long l) {\n\t\treturn new byte[] {\n\t\t\t\t(byte) (l >> 56),\n\t\t\t\t(byte) (l >> 48),\n\t\t\t\t(byte) (l >> 40),\n\t\t\t\t(byte) (l >> 32),\n\t\t\t\t(byte) (l >> 24),\n\t\t\t\t(byte) (l >> 16),\n\t\t\t\t(byte) (l >> 8),\n\t\t\t\t(byte) l\n\t\t\t};\n\t}",
"public abstract void read_longlong_array(long[] value, int offset, int\nlength);",
"public static long read(byte[] buffer, long offset, long length) {\n offset =0;\n long result = 0 ;\n int shift_count = 0 ;\n\n while ( length -- > 0 ) {\n int temp = buffer[(int) offset++] & 0xFF;\n result |= temp << shift_count ;\n shift_count += 8;\n }\n return(result);\n }",
"public ByteBuf setLong(int index, long value)\r\n/* 295: */ {\r\n/* 296:310 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 297:311 */ return super.setLong(index, value);\r\n/* 298: */ }",
"public void write(byte b[], int off, int len) throws IOException;",
"public static long getLong(final byte[] buffer, final int index, final int len) {\n switch (len) {\n case 0: return 0xFFFFFFFF_FFFFFFFFL;\n case 1: return 0xFFFFFFFF_FFFFFF00L | _getByte(buffer, index, 1);\n case 2: return 0xFFFFFFFF_FFFF0000L | _getShort(buffer, index, 2);\n case 3: return 0xFFFFFFFF_FF000000L | _getInt(buffer, index, 3);\n case 4: return 0xFFFFFFFF_00000000L | _getInt(buffer, index, 4);\n case 5: return 0xFFFFFF00_00000000L | _getLong(buffer, index, 5);\n case 6: return 0xFFFF0000_00000000L | _getLong(buffer, index, 6);\n case 7: return 0xFF000000_00000000L | _getLong(buffer, index, 7);\n case 8: return _getLong(buffer, index, 8);\n default: throw new IllegalArgumentException(\"len is out of range: \" + len);\n }\n }",
"public final void b(int i, Long l) throws IOException {\n a(a(), i, l, WireType.FIXED64);\n }",
"public static int write(final Locator locator, final long at, final byte[] val, final int off, final int length) {\n final ByteBuffer buf = locator.forWrite(at, length);\n final int idx = locator.index(at);\n final int lengthToWrite = Math.min(buf.capacity() - idx, length);\n buf.position(idx);\n buf.put(val, off, lengthToWrite);\n if(lengthToWrite < length) {\n write(locator, at + lengthToWrite, val, off + lengthToWrite, length - lengthToWrite);\n }\n\n return length;\n }",
"public static long consecutiveBytesAsLong(byte... bytes) {\r\n\t\tlong result = 0;\r\n\t\tfor(int i=0; i<bytes.length; i++) {\r\n\t\t\tint shiftFactor = 8 * (bytes.length - (i + 1));\r\n\t\t\tresult += bytes[i] << shiftFactor;\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"@Override\n public long applyAsLong(BytesStore bytes) {\n return applyAsLong(bytes, bytes.readRemaining());\n }",
"public ByteBuf setLong(int index, long value)\r\n/* 500: */ {\r\n/* 501:514 */ ensureAccessible();\r\n/* 502:515 */ _setLong(index, value);\r\n/* 503:516 */ return this;\r\n/* 504: */ }",
"public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }",
"public LongOpenHashSet(final long[] a, final int offset, final int length, final float f) {\n\t\tthis(length < 0 ? 0 : length, f);\n\t\tensureOffsetLengthOfLongArray(a, offset, length);\n\t\tfor (int i = 0; i < length; i++)\n\t\t\tadd(a[offset + i]);\n\t}",
"public static LongArrayBitVector wrap( final long[] array ) {\n\t\treturn wrap( array, (long)array.length * Long.SIZE );\n\t}",
"public final void a(int i, Long l) throws IOException {\n a(a(), i, l, WireType.VARINT);\n }",
"private void writeBuffer( byte b[], int offset, int length) throws IOException\r\n\t{\r\n\t\t// Write the chunk length as a hex number.\r\n\t\tfinal String size = Integer.toHexString(length);\r\n\t\tthis.out.write(size.getBytes());\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// Write the data.\r\n\t\tif (length != 0 )\r\n\t\t\tthis.out.write(b, offset, length);\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// And flush the real stream.\r\n\t\tthis.out.flush();\r\n\t}",
"public abstract void save(LongIntsCol col, DataOutputStream output) throws IOException;",
"public void write(long timeStampFirst, long timestampLast);",
"public abstract void load(IntLongsCol col, DataInputStream output) throws IOException;",
"private void doClipWrite(byte b[], int off, int len) {\n\t\tif (count + len <= maxOutputSize) { // won't overflow\n\t\t\tthis.writeDirectly(b, off, len);\n\t\t} else {\n\t\t\tint discardBytes = len + count - maxOutputSize;\n\t\t\tif (len >= maxOutputSize) {\n\t\t\t\treset();\n\t\t\t\tthis.writeDirectly(b, off + len - maxOutputSize, maxOutputSize);\n\t\t\t} else {\n\t\t\t\tint shiftStart = count - maxOutputSize + len;\n\t\t\t\tint remaining = maxOutputSize - len;\n\t\t\t\tSystem.arraycopy(buf, shiftStart, buf, 0, remaining);\n\t\t\t\tcount = remaining;\n\t\t\t\tthis.writeDirectly(b, off, len);\n\t\t\t}\n\t\t\tclipNum ++;\n\t\t\tSystem.out.println(String.format(\"Overflow count: %d, discarded bytes number: %d\", clipNum,\n\t\t\t\t\tdiscardBytes));\n\t\t\t\n\t\t}\n\n\t}",
"@Override\n public long applyAsLong(BytesStore bytes, @NonNegative long length) throws IllegalStateException, BufferUnderflowException {\n long hash;\n long remaining = length;\n long off = bytes.readPosition();\n\n if (remaining >= 32) {\n long v1 = seed + P1 + P2;\n long v2 = seed + P2;\n long v3 = seed;\n long v4 = seed - P1;\n\n do {\n v1 += fetch64(bytes, off) * P2;\n v1 = Long.rotateLeft(v1, 31);\n v1 *= P1;\n\n v2 += fetch64(bytes, off + 8) * P2;\n v2 = Long.rotateLeft(v2, 31);\n v2 *= P1;\n\n v3 += fetch64(bytes, off + 16) * P2;\n v3 = Long.rotateLeft(v3, 31);\n v3 *= P1;\n\n v4 += fetch64(bytes, off + 24) * P2;\n v4 = Long.rotateLeft(v4, 31);\n v4 *= P1;\n\n off += 32;\n remaining -= 32;\n } while (remaining >= 32);\n\n hash = Long.rotateLeft(v1, 1)\n + Long.rotateLeft(v2, 7)\n + Long.rotateLeft(v3, 12)\n + Long.rotateLeft(v4, 18);\n\n v1 *= P2;\n v1 = Long.rotateLeft(v1, 31);\n v1 *= P1;\n hash ^= v1;\n hash = hash * P1 + P4;\n\n v2 *= P2;\n v2 = Long.rotateLeft(v2, 31);\n v2 *= P1;\n hash ^= v2;\n hash = hash * P1 + P4;\n\n v3 *= P2;\n v3 = Long.rotateLeft(v3, 31);\n v3 *= P1;\n hash ^= v3;\n hash = hash * P1 + P4;\n\n v4 *= P2;\n v4 = Long.rotateLeft(v4, 31);\n v4 *= P1;\n hash ^= v4;\n hash = hash * P1 + P4;\n } else {\n hash = seed + P5;\n }\n\n hash += length;\n\n while (remaining >= 8) {\n long k1 = fetch64(bytes, off);\n k1 *= P2;\n k1 = Long.rotateLeft(k1, 31);\n k1 *= P1;\n hash ^= k1;\n hash = Long.rotateLeft(hash, 27) * P1 + P4;\n off += 8;\n remaining -= 8;\n }\n\n if (remaining >= 4) {\n hash ^= fetch32(bytes, off) * P1;\n hash = Long.rotateLeft(hash, 23) * P2 + P3;\n off += 4;\n remaining -= 4;\n }\n\n while (remaining != 0) {\n hash ^= fetch8(bytes, off) * P5;\n hash = Long.rotateLeft(hash, 11) * P1;\n --remaining;\n ++off;\n }\n\n return finishUp(hash);\n }",
"private void formatUnsignedOctalString(final long value, byte[] buffer, final int offset, final int length) {\n int remaining = length;\n remaining--;\n if (value == 0) {\n buffer[offset + remaining--] = (byte) '0';\n } else {\n long val = value;\n for (; remaining >= 0 && val != 0; --remaining) {\n buffer[offset + remaining] = (byte) ((byte) '0' + (byte) (val & 7));\n val = val >>> 3;\n }\n if (val != 0) {\n throw new IllegalArgumentException(value + \"=\" + Long.toOctalString(value) + \" will not fit in octal number buffer of length \" + length);\n }\n }\n\n for (; remaining >= 0; --remaining) { // leading zeros\n buffer[offset + remaining] = (byte) '0';\n }\n }",
"public long readLong() throws IOException;",
"public static LongArrayBitVector ofLength( final long length ) {\n\t\treturn new LongArrayBitVector( length ).length( length );\n\t}",
"public long[] read();",
"@Override\n\tpublic void serializeTo(DataOutputStream output) throws IOException\n\t{\n\t\toutput.writeLong(value);\n\t}",
"@Override // com.google.android.gms.internal.firebase_ml.zzsq, java.util.List, java.util.AbstractList\n public final /* synthetic */ Long set(int i, Long l) {\n long longValue = l.longValue();\n zzpu();\n zzci(i);\n long[] jArr = this.zzbqi;\n long j = jArr[i];\n jArr[i] = longValue;\n return Long.valueOf(j);\n }",
"public static LongArrayBitVector wrap( final long[] array, final long size ) {\n\t\tif ( size > (long)array.length << LOG2_BITS_PER_WORD ) throw new IllegalArgumentException( \"The provided array is too short (\" + array.length + \" elements) for the given size (\" + size + \")\" );\n\t\tfinal LongArrayBitVector result = new LongArrayBitVector( 0 );\n\t\tresult.length = size;\n\t\tresult.bits = array;\n\t\t\n\t\tfinal int arrayLength = array.length;\n\t\tfinal int lastWord = (int)( size / Long.SIZE ); \n\t\tif ( lastWord < arrayLength && ( array[ lastWord ] & ~ ( ( 1L << size % Long.SIZE ) - 1 ) ) != 0 ) throw new IllegalArgumentException( \"Garbage beyond size in bit array\" );\n\t\tfor( int i = lastWord + 1; i < arrayLength; i++ ) if ( array[ i ] != 0 ) throw new IllegalArgumentException( \"Garbage beyond size in bit array\" );\n\t\treturn result;\n\t}",
"protected void _setLongLE(int index, long value)\r\n/* 519: */ {\r\n/* 520:533 */ HeapByteBufUtil.setLongLE(this.array, index, value);\r\n/* 521: */ }",
"public final void setBufferLong(final byte[] buffer, final long data, final int i, final boolean endianess) {\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n buffer[i] = (byte) (data >>> 56);\r\n buffer[i + 1] = (byte) (data >>> 48);\r\n buffer[i + 2] = (byte) (data >>> 40);\r\n buffer[i + 3] = (byte) (data >>> 32);\r\n buffer[i + 4] = (byte) (data >>> 24);\r\n buffer[i + 5] = (byte) (data >>> 16);\r\n buffer[i + 6] = (byte) (data >>> 8);\r\n buffer[i + 7] = (byte) (data & 0xff);\r\n } else {\r\n buffer[i] = (byte) (data & 0xff);\r\n buffer[i + 1] = (byte) (data >>> 8);\r\n buffer[i + 2] = (byte) (data >>> 16);\r\n buffer[i + 3] = (byte) (data >>> 24);\r\n buffer[i + 4] = (byte) (data >>> 32);\r\n buffer[i + 5] = (byte) (data >>> 40);\r\n buffer[i + 6] = (byte) (data >>> 48);\r\n buffer[i + 7] = (byte) (data >>> 56);\r\n }\r\n }",
"long readLong() throws IOException;",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"void flush(byte[] b, int off, int len) {\n if (len > 0) {\n synchronized (flushed) {\n flushed.append(new String(b, off, len));\n }\n }\n }",
"public final long fixed_64bit_literal() throws RecognitionException {\n long value = 0;\n\n\n int integer_literal47 = 0;\n long long_literal48 = 0;\n short short_literal49 = 0;\n byte byte_literal50 = 0;\n float float_literal51 = 0.0f;\n double double_literal52 = 0.0;\n char char_literal53 = 0;\n boolean bool_literal54 = false;\n\n try {\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:301:3: ( integer_literal | long_literal | short_literal | byte_literal | float_literal | double_literal | char_literal | bool_literal )\n int alt11 = 8;\n switch (input.LA(1)) {\n case INTEGER_LITERAL: {\n alt11 = 1;\n }\n break;\n case LONG_LITERAL: {\n alt11 = 2;\n }\n break;\n case SHORT_LITERAL: {\n alt11 = 3;\n }\n break;\n case BYTE_LITERAL: {\n alt11 = 4;\n }\n break;\n case FLOAT_LITERAL: {\n alt11 = 5;\n }\n break;\n case DOUBLE_LITERAL: {\n alt11 = 6;\n }\n break;\n case CHAR_LITERAL: {\n alt11 = 7;\n }\n break;\n case BOOL_LITERAL: {\n alt11 = 8;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 11, 0, input);\n throw nvae;\n }\n switch (alt11) {\n case 1:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:301:5: integer_literal\n {\n pushFollow(FOLLOW_integer_literal_in_fixed_64bit_literal649);\n integer_literal47 = integer_literal();\n state._fsp--;\n\n value = integer_literal47;\n }\n break;\n case 2:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:302:5: long_literal\n {\n pushFollow(FOLLOW_long_literal_in_fixed_64bit_literal657);\n long_literal48 = long_literal();\n state._fsp--;\n\n value = long_literal48;\n }\n break;\n case 3:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:303:5: short_literal\n {\n pushFollow(FOLLOW_short_literal_in_fixed_64bit_literal665);\n short_literal49 = short_literal();\n state._fsp--;\n\n value = short_literal49;\n }\n break;\n case 4:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:304:5: byte_literal\n {\n pushFollow(FOLLOW_byte_literal_in_fixed_64bit_literal673);\n byte_literal50 = byte_literal();\n state._fsp--;\n\n value = byte_literal50;\n }\n break;\n case 5:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:305:5: float_literal\n {\n pushFollow(FOLLOW_float_literal_in_fixed_64bit_literal681);\n float_literal51 = float_literal();\n state._fsp--;\n\n value = Float.floatToRawIntBits(float_literal51);\n }\n break;\n case 6:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:306:5: double_literal\n {\n pushFollow(FOLLOW_double_literal_in_fixed_64bit_literal689);\n double_literal52 = double_literal();\n state._fsp--;\n\n value = Double.doubleToRawLongBits(double_literal52);\n }\n break;\n case 7:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:307:5: char_literal\n {\n pushFollow(FOLLOW_char_literal_in_fixed_64bit_literal697);\n char_literal53 = char_literal();\n state._fsp--;\n\n value = char_literal53;\n }\n break;\n case 8:\n // D:\\\\decomplier_tools\\\\smali\\\\smali\\\\smali\\\\src\\\\main\\\\antlr3\\\\smaliTreeWalker.g:308:5: bool_literal\n {\n pushFollow(FOLLOW_bool_literal_in_fixed_64bit_literal705);\n bool_literal54 = bool_literal();\n state._fsp--;\n\n value = bool_literal54 ? 1 : 0;\n }\n break;\n\n }\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return value;\n }",
"public static StringBuilder formatLongToHex(StringBuilder sb, long v, int length, boolean leadingZeros)\n\t{\n\t\treturn format(sb, Long.toHexString(v), length, ALIGN_RIGHT, ((leadingZeros) ? '0' : ' '), ' ');\n\t}",
"public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException {\n\n updateBinaryStream(columnName, x, (long) length);\n }",
"@Test\n public void testReadWriteLong() {\n System.out.println(\"readLong\");\n ByteArray instance = new ByteArray();\n \n instance.writeLong(12, 0);\n instance.writeLong(12345678, 8);\n instance.writeLong(13, instance.compacity());\n \n assertEquals(12, instance.readLong(0));\n assertEquals(12345678, instance.readLong(8));\n assertEquals(13, instance.readLong(instance.compacity() - 8));\n \n instance.writeLong(14, 8);\n assertEquals(14, instance.readLong(8));\n }",
"void setLength( long length );",
"@Override\n\tpublic int write( byte [] buffer, int offset, int length ) {\n\t\tByteBuffer out = getOutputBuffer();\n\t\tif( out.limit() <= 0 ) {\n\t\t\tout.limit( out.capacity() );\n\t\t}\n\t\tsynchronized( out ) {\n\t\t\tout.put( buffer, offset, length );\n\t\t}\n\t\tdispatcher.requestWrite( this );\n\t\treturn length;\n\t}",
"long fetch64(BytesStore bytes, @NonNegative long off) throws IllegalStateException, BufferUnderflowException {\n return bytes.readLong(off);\n }",
"public void wrap(boolean mark, int payloadType, int seqNumber, long timestamp, long ssrc, byte[] data, int offset, int len) {\n buffer.clear();\n buffer.rewind();\n\n //no extensions, paddings and cc\n buffer.put((byte)0x80);\n\n byte b = (byte) (payloadType);\n if (mark) {\n b = (byte) (b | 0x80);\n }\n\n buffer.put(b);\n\n //sequence number\n buffer.put((byte) ((seqNumber & 0xFF00) >> 8));\n buffer.put((byte) (seqNumber & 0x00FF));\n\n //timestamp\n buffer.put((byte) ((timestamp & 0xFF000000) >> 24));\n buffer.put((byte) ((timestamp & 0x00FF0000) >> 16));\n buffer.put((byte) ((timestamp & 0x0000FF00) >> 8));\n buffer.put((byte) ((timestamp & 0x000000FF)));\n\n //ssrc\n buffer.put((byte) ((ssrc & 0xFF000000) >> 24));\n buffer.put((byte) ((ssrc & 0x00FF0000) >> 16));\n buffer.put((byte) ((ssrc & 0x0000FF00) >> 8));\n buffer.put((byte) ((ssrc & 0x000000FF)));\n\n buffer.put(data, offset, len);\n buffer.flip();\n buffer.rewind();\n }",
"public synchronized void write(final byte[] cbuf, final int off, final int len) throws IOException {\n\t\tif (len < 0) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tif (off < 0) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\t\tif (cbuf == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t\tif ((len + off) > cbuf.length) {\n\t\t\tthrow new IndexOutOfBoundsException();\n\t\t}\n\n\t\tensureSize(cursor + len);\n\n\t\tSystem.arraycopy(cbuf, off, this.buffer, cursor, len);\n\t\tcursor += len;\n\t}",
"@Override\n\tpublic void setBytes(final long startpos, final byte[] bytes,\n\t\tfinal int offset, final int length)\n\t{\n\t\tcheckWritePos(startpos, startpos + length);\n\t\tfinal int neededCapacity = size + length;\n\t\tensureCapacity(neededCapacity);\n\n\t\t// copy the data\n\t\tbuffer.position((int) startpos);\n\t\tbuffer.put(bytes, offset, length);\n\n\t\t// update the maxpos\n\t\tupdateSize(startpos + length);\n\t}",
"public int write(byte[] bytes, int offset, int length) throws FTD2XXException {\n Memory memory = new Memory(length);\n memory.write(0, bytes, offset, length);\n IntByReference wrote = new IntByReference();\n\n ensureFTStatus(ftd2xx.FT_Write(ftHandle, memory, length, wrote));\n\n return wrote.getValue();\n }",
"public int syncWrite(byte[] data, int length)\n {\n return syncWrite(-1, data, length);\n }",
"long readS64LE()\n throws IOException, EOFException;",
"public void write(long address, short[] buffer, int length, int moteID) {\n\t\tmote.write(address, buffer, length, moteID);\t\n\t}",
"@Override\n public void write (final String s, final int off, final int len)\n {\n if (text != null)\n {\n text.append (s.substring (off, off + len));\n if ((col += len) > wrap)\n println ();\n }\n else\n {\n super.write (s, off, len);\n flush ();\n }\n }",
"public static void longToByteArray(long value, byte[] buffer, int offset) {\n buffer[offset] = (byte) (value >> 56 & 0xFF);\n buffer[offset + 1] = (byte) (value >> 48 & 0xFF);\n buffer[offset + 2] = (byte) (value >> 40 & 0xFF);\n buffer[offset + 3] = (byte) (value >> 32 & 0xFF);\n buffer[offset + 4] = (byte) (value >> 24 & 0xFF);\n buffer[offset + 5] = (byte) (value >> 16 & 0xFF);\n buffer[offset + 6] = (byte) (value >> 8 & 0xFF);\n buffer[offset + 7] = (byte) (value & 0xFF);\n }",
"public static LongBuffer createLongBuffer(int longs) {\n SimpleLogger.d(BufferUtils.class, \"Creating long buffer with int size: \" + longs);\n return ByteBuffer.allocateDirect(longs * 8).order(ByteOrder.nativeOrder()).asLongBuffer();\n\n }"
] | [
"0.63474476",
"0.61809045",
"0.6047461",
"0.6044311",
"0.6033839",
"0.59425163",
"0.5909534",
"0.5636114",
"0.56201667",
"0.5614328",
"0.55850357",
"0.5571563",
"0.5450818",
"0.53087026",
"0.5274038",
"0.52461034",
"0.5245017",
"0.5121262",
"0.50964326",
"0.5062876",
"0.5057357",
"0.50569415",
"0.5035482",
"0.50130486",
"0.4985245",
"0.49753022",
"0.4963045",
"0.49565762",
"0.49536943",
"0.49505797",
"0.49332675",
"0.49311194",
"0.49265632",
"0.49121022",
"0.48995128",
"0.48948288",
"0.48775715",
"0.4869158",
"0.48577186",
"0.4848085",
"0.48087156",
"0.4792689",
"0.47851595",
"0.4767977",
"0.47663337",
"0.47215235",
"0.47166798",
"0.47092703",
"0.47027996",
"0.47022507",
"0.4701196",
"0.4697616",
"0.46772322",
"0.4608005",
"0.4598058",
"0.45846856",
"0.45769218",
"0.4554945",
"0.45294663",
"0.4523052",
"0.4515725",
"0.45095795",
"0.4505324",
"0.44894964",
"0.44756034",
"0.44731686",
"0.44721863",
"0.4468025",
"0.44483116",
"0.4426917",
"0.44253853",
"0.4421648",
"0.4408684",
"0.43979457",
"0.43978184",
"0.4385513",
"0.4384033",
"0.4378486",
"0.43675858",
"0.43659717",
"0.4365302",
"0.43607616",
"0.43541497",
"0.43527746",
"0.43507454",
"0.43285033",
"0.43185157",
"0.43127254",
"0.43090975",
"0.43051034",
"0.43010044",
"0.4300844",
"0.4299431",
"0.42984802",
"0.42970198",
"0.42899796",
"0.42807722",
"0.42662156",
"0.42648214",
"0.42606908"
] | 0.7921023 | 0 |
Writes a sequence of floats to the stream at the current position. If len is 0, nothing is written. The float f[off] is written first, then the float f[off + 1], and so on. The byte order of the stream is used to determine the order in which the individual bytes are written. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeFloats(float[] f, int off, int len) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void writeFloatArray( DataOutput out, float[] array ) throws IOException {\n\n ByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n DataOutputStream dataOut = new DataOutputStream( byteStream );\n\n dataOut.writeInt( array.length );\n for(int i=0; i<array.length; i++)\n dataOut.writeFloat( array[i] );\n dataOut.close();\n\n out.writeInt( byteStream.size() );\n out.write( byteStream.toByteArray() );\n }",
"void writeFloat(float v) throws IOException;",
"public int read(float[] f, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\t\t\t\tif (count - pos < 4) {\n\t\t\t\t\tfillBuf(4);\n\t\t\t\t}\n\t\t\t\tint t = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tf[i] = Float.intBitsToFloat(t);\n\t\t\t\tpos += 4;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 4);\n\t\t}\n\t\treturn 4 * len;\n\t}",
"public final void writeFloat(final float data, final boolean endianess) throws IOException {\r\n int tmpInt;\r\n\r\n tmpInt = Float.floatToIntBits(data);\r\n writeInt(tmpInt, endianess);\r\n }",
"void writeFloat(float value);",
"public final void setBufferFloat(final byte[] buffer, final float data, final int i, final boolean endianess) {\r\n int tmpInt;\r\n\r\n tmpInt = Float.floatToIntBits(data);\r\n setBufferInt(buffer, tmpInt, i, endianess);\r\n }",
"public void writeSamples( float[] samples, int offset, int numSamples );",
"public ByteBuf writeFloat(float value)\r\n/* 569: */ {\r\n/* 570:580 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 571:581 */ return super.writeFloat(value);\r\n/* 572: */ }",
"public abstract void read_float_array(float[] value, int offset, int\nlength);",
"protected void writeE(float value)\n\t{\n\t\t_buf.putFloat(value);\n\t}",
"public static int[] writeFloat(float f, int[] o){\r\n\t\tint[] a = writeFloat(f);\r\n\t\tint[] n = Arrays.copyOf(o, o.length + a.length);\r\n\t\tfor(int i=0;i<a.length;i++){\r\n\t\t\tn[o.length+i] = a[i];\r\n\t\t}\r\n\t\treturn n;\r\n\t}",
"public void setVal(float val) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeFloat(__io__address + 8, val);\n\t\t} else {\n\t\t\t__io__block.writeFloat(__io__address + 8, val);\n\t\t}\n\t}",
"public void write(long[] timestamps, float[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }",
"public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }",
"public void write(float f) {\n write(String.valueOf(f));\n }",
"public FloatSampleBuffer(byte[] buffer, int offset, int byteCount,\n\t\t\tAudioFormat format) {\n\t\tthis(format.getChannels(), byteCount\n\t\t\t\t/ (format.getSampleSizeInBits() / 8 * format.getChannels()),\n\t\t\t\tformat.getSampleRate());\n\t\tinitFromByteArray(buffer, offset, byteCount, format);\n\t}",
"public byte[] readRawFloat() throws IOException {\n byte[] bytes = new byte[5];\n bytes[0] = (byte) Type.FLOAT.code;\n in.readFully(bytes, 1, 4);\n return bytes;\n }",
"@Override\r\n\tpublic Buffer setFloat(int pos, float f) {\n\t\treturn null;\r\n\t}",
"public static FloatBuffer createFloatBuffer(float... data) {\n\n FloatBuffer buff = BufferUtils.createFloatBuffer(data.length * 3);\n buff.clear();\n for (int i = 0; i < data.length; i++) {\n buff.put(data[i]);\n System.out.println(\"Buff: \" + buff.get(i));\n }\n buff.flip();\n return buff;\n }",
"public void write(byte b[], int off, int len) throws IOException\n\t{\n\t\tout.write(b, off, len);\n\t\tmd5.update(b, off, len);\n\t}",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"String floatWrite();",
"public ByteBuf setFloat(int index, float value)\r\n/* 307: */ {\r\n/* 308:322 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 309:323 */ return super.setFloat(index, value);\r\n/* 310: */ }",
"public void write(byte b[], int off, int len) throws IOException;",
"public static byte[] writeFloatToBytes(float value) {\n FLOAT_BUFFER.clear();\n FLOAT_BUFFER.putFloat(value);\n return FLOAT_BUFFER.array();\n }",
"public static float toFloat(byte [] bytes) {\n return toFloat(bytes, 0);\n }",
"void writeDoubles(double[] d, int off, int len) throws IOException;",
"public void testNIO_float_array() throws Exception {\n float[] floatArray = new float[8];\n FloatBuffer fb = FloatBuffer.wrap(floatArray);\n floatBufferTest(fb);\n }",
"public void write( byte[] array, int firstIndex,\n\t\t\tint count );",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public void getBytes(float[] f, byte[] b) {\n getBytes(f,b,0);\n }",
"public void flush() {\r\n // Flushing is required only if there are written bytes in\r\n // the current data element.\r\n if (bytenum != 0) {\r\n data[offset] = elem;\r\n }\r\n }",
"void flush(byte[] b, int off, int len) {\n if (len > 0) {\n synchronized (flushed) {\n flushed.append(new String(b, off, len));\n }\n }\n }",
"public FloatArrayWritable(FloatWritable[] values) {\n super(FloatWritable.class, values);\n }",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"public VectorFloat(float[] storage) {\n this(storage.length / elementSize, storage);\n }",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"@Override\n\tpublic boolean put(Float value) {\n\t\tif (bufferCount < BUFFER_SIZE) {\n\t\t\tbuffer[bufferCount++] = value;\n\t\t} else {\n\t\t\twriteBufferToOCL();\n\t\t\tput(value);\n\t\t}\n\t\treturn true;\n\t}",
"public void write(final byte[] data, final int offset, final int len) throws IOException {\n checkOpened();\n dos.write(data, offset, len);\n flush();\n }",
"public static float byteArrayToFloat(byte[] bytes, int size, int fpBits) {\n return byteArrayToLong(bytes, size) / (float) (1 << fpBits);\n }",
"@Override\r\n\tpublic float getFloat(int pos) {\n\t\treturn buffer.getFloat(pos);\r\n\t}",
"protected void writeTrueData(BufferedDataOutputStream o) throws FitsException {\n\n try {\n o.writePrimitiveArray(dataArray);\n } catch (IOException e) {\n throw new FitsException(\"FITS Output Error: \"+e);\n }\n }",
"public void write(byte b[], int off, int len) throws IOException {\n baos.write(b, off, len);\n }",
"public int write(byte[] bytes, int offset, int length) throws FTD2XXException {\n Memory memory = new Memory(length);\n memory.write(0, bytes, offset, length);\n IntByReference wrote = new IntByReference();\n\n ensureFTStatus(ftd2xx.FT_Write(ftHandle, memory, length, wrote));\n\n return wrote.getValue();\n }",
"public void grabarFloat(float x) throws IOException\r\n {\r\n maestro.writeFloat(x); \r\n }",
"public void write_to_buffer(DataOutputStream out) throws IOException\r\n {\r\n for (int i = 0; i < 2*dimension; ++i)\r\n out.writeFloat(bounces[i]);\r\n out.writeInt(son);\r\n out.writeInt(num_of_data);\r\n }",
"private byte[] encodeFos( byte[] pcm, int offset, int len )\n {\n byte[] ret = new byte[len / 4];\n\n for ( int i = 0; i < ( len / 2 ); i++ )\n {\n //int curSample = pcm[i] & 0xFF;\n int curSample = pcm[i];\n\n int delta = curSample - predictedSample;\n\n boolean isSignBit = false;\n\n if ( delta < 0 )\n {\n delta = -delta;\n isSignBit = true;\n }\n\n int code = 4 * delta / ADPCMDecoder.step_table[index];\n\n if ( code > 7 )\n code = 7;\n\n delta = ( ADPCMDecoder.step_table[index] * code ) / 4 +\n ADPCMDecoder.step_table[index] / 8;\n\n if ( isSignBit )\n delta = -delta;\n\n predictedSample += delta;\n\n if ( predictedSample > 32767 )\n predictedSample = 32767;\n else if ( predictedSample < -32768 )\n predictedSample = -32768;\n\n index += ADPCMDecoder.index_adjust[code];\n\n if ( index < 0 )\n index = 0;\n else if ( index > 88 )\n index = 88;\n\n if ( i % 2 != 0 )\n ret[i >> 1] |= code | ( isSignBit ? 8 : 0 );\n else\n ret[i >> 1] = (byte)( ( code | ( isSignBit ? 8 : 0 ) ) << 4 );\n\n }\n\n return ret;\n }",
"public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }",
"public abstract void writeBytes(byte[] b, int offset, int length) throws IOException;",
"public void Add(float[] item) {\n for (int i = 0; i < item.length; i++) {\n String s = String.format(\"%8s\", Integer.toHexString(Float.floatToRawIntBits(item[i])))\n .replace(' ', '0');\n StringBuilder out2 = new StringBuilder();\n String ss = \"\";\n for (int j = s.length() - 1; j > 0; j -= 2) {\n String str = s.substring(j - 1, j + 1);\n out2.append(str);\n ss = out2.toString();\n }\n mpBuffer += ss;\n }\n // mpBuffer+=Utils.bytesToHex(bites);\n mLenght += Long.SIZE / 8 * item.length;\n mBackOffset = mLenght;\n }",
"public final void next(float[] v) { next(v,0); }",
"public final void next(java.nio.FloatBuffer fb, int off)\r\n {\r\n fb.put(off++, (d0 >>> 8) * 0x1p-24f);\r\n fb.put(off++, (d1 >>> 8) * 0x1p-24f);\r\n fb.put(off, (d2 >>> 8) * 0x1p-24f);\r\n updateState();\r\n }",
"int writeTo(byte[] iStream, int pos, ORecordVersion version);",
"private static void writeToBuffer(int index, RandomAccessFile fos) {\n\n try {\n\n // x is the current integer value to be written.\n int x;\n // loc is the current location in the buffer to be written.\n int loc = 0;\n\n // iterates through each value in the sorted integer array.\n for (int k = 0; k < index; k++) {\n // gets the current integer.\n x = ints[k];\n\n // checks if the buffer is full.\n if (loc == BUF_SIZE) {\n // if the buffer is full, write its contents out to the file.\n fos.write(buf);\n // the buffer has been emptied, so set its current location back to the start.\n loc = 0;\n }\n\n // convert the current integer value to be written to a byte array.\n buf[loc] = (byte) (x >> 24);\n buf[loc + 1] = (byte) (x >> 16);\n buf[loc + 2] = (byte) (x >> 8);\n buf[loc + 3] = (byte) (x);\n\n // increment the location in the buffer now that a value has been written in.\n loc += BYTES_TO_INTS;\n }\n\n if (loc > 0) {\n // if there are any values left over in the buffer, write them out to the file.\n fos.write(buf, 0, loc);\n\n }\n } catch (IOException e){\n e.printStackTrace();\n }\n }",
"public FloatArrayWritable() {\n super(FloatWritable.class);\n }",
"public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }",
"public void write(ArrayDataOutput out) throws FitsException, IOException;",
"public static float toFloat(byte [] bytes, int offset) {\n return Float.intBitsToFloat(toInt(bytes, offset, SIZEOF_INT));\n }",
"protected void write(CCompatibleOutputStream os) throws Exception {\n java.util.Vector fieldVector = getFieldVector();\n for (int i = 0; i < fieldVector.size(); i++) {\n Field field = (Field) (fieldVector.elementAt(i));\n Class type = field.getType();\n if (type == Byte.TYPE) {\n os.writeByte(field.getByte(this));\n }\n else if (type == Short.TYPE) {\n os.writeShortReverse(field.getShort(this));\n }\n else if (type == Integer.TYPE) {\n os.writeIntReverse(field.getInt(this));\n }\n else if (type == Long.TYPE) {\n os.writeLongReverse(field.getLong(this));\n }\n else if (type == Double.TYPE) {\n os.writeDouble(field.getDouble(this));\n }\n else if (type.getName().equals(\"[B\")) {\n os.write( (byte[]) (field.get(this)));\n }\n }\n }",
"public void write(byte[] data, long offset);",
"public static void logBuffer(FloatBuffer buffer, int count) {\n StringBuffer sb = new StringBuffer();\n float[] storage = new float[count];\n buffer.get(storage);\n for (int i = 0; i < count; i++) {\n sb.append(Float.toString(storage[i]) + \", \");\n }\n SimpleLogger.d(BufferUtils.class, \"Contents of float buffer:\\n\" + sb.toString());\n }",
"public void getBytes(float[][] f, byte[][] b) {\n int n = f.length;\n for (int i=0; i<n; ++i)\n getBytes(f[i],b[i]);\n }",
"public void setSamplesFromBytes(byte[] input, int inByteOffset,\n\t\t\tAudioFormat format, int floatOffset, int frameCount) {\n\t\tif (floatOffset < 0 || frameCount < 0 || inByteOffset < 0) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"FloatSampleBuffer.setSamplesFromBytes: negative inByteOffset, floatOffset, or frameCount\");\n\t\t}\n\t\tif (inByteOffset + (frameCount * format.getFrameSize()) > input.length) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"FloatSampleBuffer.setSamplesFromBytes: input buffer too small.\");\n\t\t}\n\t\tif (floatOffset + frameCount > getSampleCount()) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"FloatSampleBuffer.setSamplesFromBytes: frameCount too large\");\n\t\t}\n\t\tFloatSampleTools.byte2float(input, inByteOffset, channels, floatOffset,\n\t\t\t\tframeCount, format, false);\n\t}",
"public VectorFloat(int numElements) {\n this(numElements, new float[numElements]);\n }",
"public void getBytes(float[][] f, byte[] b) {\n int n1 = f[0].length;\n int n2 = f.length;\n for (int i2=0; i2<n2; ++i2)\n getBytes(f[i2],b,i2*n1);\n }",
"@Override\r\n public void write(byte[] buffer, int off, int len) throws IOException {\r\n inWrite3 = true;\r\n try {\r\n super.write(buffer, off, len);\r\n if (!inWrite1) {\r\n /*if (!Helper.NEW_IO_HANDLING \r\n && null != IoNotifier.fileNotifier) {\r\n IoNotifier.fileNotifier.notifyWrite(recId, len);\r\n } else {*/\r\n if (null != RecorderFrontend.instance) {\r\n RecorderFrontend.instance.writeIo(recId, \r\n null, len, StreamType.FILE);\r\n }\r\n //}\r\n }\r\n inWrite3 = false;\r\n } catch (IOException e) {\r\n inWrite3 = false;\r\n throw e;\r\n }\r\n }",
"private native void Df1_Write_Float(String plcAddress,float value) throws Df1LibraryNativeException;",
"@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}",
"public synchronized void write(byte[] buf, int off, int len)\n\t\t\t\tthrows IOException {\n\t\t\tsuper.write(buf, off, len);\n\t\t}",
"public void write(byte b[]) throws IOException;",
"T print(float data) throws PrintingException;",
"public void getBytes(float[][][] f, byte[] b) {\n int n1 = f[0][0].length;\n int n2 = f[0].length;\n int n3 = f.length;\n for (int i3=0; i3<n3; ++i3)\n for (int i2=0; i2<n2; ++i2)\n getBytes(f[i3][i2],b,i2*n1+i3*n1*n2);\n }",
"public abstract float[] toFloatArray();",
"public void write(byte b[]) throws IOException\n {\n checkThreshold(b.length);\n getStream().write(b);\n written += b.length;\n }",
"public void write(OutputStream out) throws Exception {\r\n\r\n\t\ttry {\r\n\r\n\t\t\tif (this.raf == null) {\r\n\r\n\t\t\t\tDataOutputStream outStream = new DataOutputStream(out);\r\n\r\n\t\t\t\tthis.header.numberOfRecords = v_records.size();\r\n\t\t\t\tthis.header.write(outStream);\r\n\r\n\t\t\t\t/* Now write all the records */\r\n\t\t\t\tint t_recCount = v_records.size();\r\n\t\t\t\tfor (int i = 0; i < t_recCount; i++) { /*\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * iterate through\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t * records\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t */\r\n\r\n\t\t\t\t\tObject[] t_values = (Object[]) v_records.elementAt(i);\r\n\r\n\t\t\t\t\twriteRecord(outStream, t_values);\r\n\t\t\t\t}\r\n\r\n\t\t\t\toutStream.write(END_OF_DATA);\r\n\t\t\t\toutStream.flush();\r\n\t\t\t} else {\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * everything is written already. just update the header for\r\n\t\t\t\t * record count and the END_OF_DATA mark\r\n\t\t\t\t */\r\n\t\t\t\tthis.header.numberOfRecords = this.recordCount;\r\n\t\t\t\tthis.raf.seek(0);\r\n\t\t\t\tthis.header.write(this.raf);\r\n\t\t\t\tthis.raf.seek(raf.length());\r\n\t\t\t\tthis.raf.writeByte(END_OF_DATA);\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\tthrow new DBFException(e.getMessage());\r\n\t\t}\r\n\t}",
"private void writeBuffer( byte b[], int offset, int length) throws IOException\r\n\t{\r\n\t\t// Write the chunk length as a hex number.\r\n\t\tfinal String size = Integer.toHexString(length);\r\n\t\tthis.out.write(size.getBytes());\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// Write the data.\r\n\t\tif (length != 0 )\r\n\t\t\tthis.out.write(b, offset, length);\r\n\t\t// Write a CRLF.\r\n\t\tthis.out.write( CR );\r\n\t\tthis.out.write( LF );\r\n\t\t// And flush the real stream.\r\n\t\tthis.out.flush();\r\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n public static void writeFloatToObjectArray(final Storage theStorage,\r\n final Field<?, ?>[] theFieldArray, final Object[] theValues) {\r\n\r\n for (int i = 0; i < theFieldArray.length; i++) {\r\n final FloatField<?, ?> theField = (FloatField<?, ?>) theFieldArray[i];\r\n if (theField != null) {\r\n final FloatConverter<Object> converter = (FloatConverter<Object>) theField\r\n .converter();\r\n final float fval = converter.fromObject(theValues[i]);\r\n theStorage.write(theField, fval);\r\n }\r\n }\r\n }",
"@Override\n public void write(final byte[] data, final int offset, final int length)\n throws IOException {\n if (offset < 0 || length < 0 || length > data.length - offset) {\n throw new IndexOutOfBoundsException();\n }\n\n writeInternal(data, offset, length);\n }",
"private void write(byte[] data, int pos, int len)\n\t\tthrows IOException\n\t{\n\t\tchar[] chars = BASE64;\n\n\t\tint loc = (len > 0 ? (data[pos] << 24) >>> 8 : 0) |\n\t\t\t(len > 1 ? (data[pos+1] << 24) >>> 16 : 0) |\n\t\t\t(len > 2 ? (data[pos+2] << 24) >>> 24 : 0);\n\n\t\tswitch(len)\n\t\t{\n\t\t\tcase 3:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write(chars[loc & 0x3f]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\twriter.write('=');\n\t\t}\n\t}",
"public int convertToByteArray(int readOffset, int lenInSamples,\n\t\t\tbyte[] buffer, int writeOffset, AudioFormat format) {\n\t\tint byteCount = format.getFrameSize() * lenInSamples;\n\t\tif (writeOffset + byteCount > buffer.length) {\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"FloatSampleBuffer.convertToByteArray: buffer too small.\");\n\t\t}\n\t\tif (format != lastConvertToByteArrayFormat) {\n\t\t\tif (format.getSampleRate() != getSampleRate()) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"FloatSampleBuffer.convertToByteArray: different samplerates.\");\n\t\t\t}\n\t\t\tif (format.getChannels() != getChannelCount()) {\n\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\"FloatSampleBuffer.convertToByteArray: different channel count.\");\n\t\t\t}\n\t\t\tlastConvertToByteArrayFormat = format;\n\t\t\tlastConvertToByteArrayFormatCode = FloatSampleTools.getFormatType(format);\n\t\t}\n\t\tFloatSampleTools.float2byte(channels, readOffset, buffer, writeOffset,\n\t\t\t\tlenInSamples, lastConvertToByteArrayFormatCode,\n\t\t\t\tformat.getChannels(), format.getFrameSize(),\n\t\t\t\tgetConvertDitherBits(lastConvertToByteArrayFormatCode));\n\n\t\treturn byteCount;\n\t}",
"public static float[] pcmToFloat(byte[] bytes)\n\t{\n\t\treturn toFloat(toShort(bytes));\n\t}",
"public void write(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}",
"void floatOp(int b) {\n int blength = (byte)OPC.FLOAT_LENGTH_TABLE.charAt(b);\n int bstack = (byte)OPC.FLOAT_STACK_EFFECT_TABLE.charAt(b);\n sp += bstack;\n write(2, \"floatOp\\n\\t\\t\"+Mnemonics.FLOAT_OPCODES[b]);\n }",
"public void write(long[] timestamps, double[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"public F64Vector(double[] values, int offset, int length) {\n this(length);\n System.arraycopy(values, offset, data, 0, length);\n }",
"public void write(long[] timestamps, Binary[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"@Override\r\n public synchronized void flush() throws IOException {\r\n\t\tif ( count != 0 ) {\r\n\t\t writeBuffer(buf, 0, count );\r\n\t\t count = 0;\r\n\t\t}\r\n\t}",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"public void write(byte[] buffer);",
"@Override\r\n\tpublic float[] toFloats() {\n\t\treturn null;\r\n\t}",
"public static float readFloatFromBytes(byte[] data) {\n return ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).getFloat();\n }",
"public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}",
"protected void outputFloat(int number) {\r\n if (number == 0) {\r\n buf.write(NUMBERS[0]);\r\n return;\r\n }\r\n final int dec = outputInt(Math.abs(number % 1000));\r\n for (int i = dec; i < 3; ++i) {\r\n buf.write(NUMBERS[0]);\r\n }\r\n buf.write(DOT);\r\n final int floor = number / 1000;\r\n if (floor == 0) {\r\n buf.write(NUMBERS[0]);\r\n if (number < 0) {\r\n buf.write(DASH);\r\n }\r\n } else {\r\n outputInt(floor);\r\n }\r\n }",
"@Override\n public void writeCompressed(DataOutput out) throws IOException {\n out.writeInt(length);\n out.write(array);\n }",
"public abstract void writeRange(int startElement, int count,\r\n ByteBuffer src, int offsetBytes, boolean bForward);",
"public FloatSampleBuffer() {\n\t\tthis(0, 0, 1);\n\t}",
"public void getBytes(float[][][] f, byte[][][] b) {\n int n = f.length;\n for (int i=0; i<n; ++i)\n getBytes(f[i],b[i]);\n }",
"public float[] getAsFloats() {\n return (float[])data;\n }",
"public float readFloat() throws IOException {\n\n\t\tif (read(bb, 0, 4) < 4) {\n\t\t\tthrow new EOFException();\n\t\t}\n\n\t\tint i = bb[0] << 24 | (bb[1] & 0xFF) << 16 | (bb[2] & 0xFF) << 8\n\t\t\t\t| (bb[3] & 0xFF);\n\t\treturn Float.intBitsToFloat(i);\n\n\t}"
] | [
"0.6386291",
"0.6219339",
"0.606685",
"0.6057889",
"0.58622247",
"0.567252",
"0.5635981",
"0.55945504",
"0.5480894",
"0.5429938",
"0.5412691",
"0.53049767",
"0.5141133",
"0.51296705",
"0.5098569",
"0.50953716",
"0.5080572",
"0.5080316",
"0.50803083",
"0.50777483",
"0.50279105",
"0.5016628",
"0.49983636",
"0.4980984",
"0.49658212",
"0.49579093",
"0.49435982",
"0.49433893",
"0.49431396",
"0.49273923",
"0.49017677",
"0.48998627",
"0.486085",
"0.4832142",
"0.48156646",
"0.4815194",
"0.4804073",
"0.48012275",
"0.47664648",
"0.47645944",
"0.4762994",
"0.47608027",
"0.47604433",
"0.47530425",
"0.47479263",
"0.47232544",
"0.47126347",
"0.4698976",
"0.4681337",
"0.46716622",
"0.46704313",
"0.466803",
"0.46523264",
"0.46509317",
"0.4646647",
"0.4642031",
"0.46407574",
"0.4628716",
"0.46208638",
"0.46120405",
"0.4608768",
"0.46049204",
"0.4587904",
"0.45874828",
"0.45787624",
"0.45581076",
"0.45572615",
"0.45490152",
"0.45471412",
"0.45446983",
"0.45441177",
"0.45369354",
"0.45367762",
"0.4536056",
"0.45344839",
"0.45210642",
"0.45185766",
"0.45173478",
"0.4516902",
"0.45071793",
"0.45067874",
"0.4493605",
"0.44822448",
"0.44715115",
"0.44709435",
"0.4445614",
"0.4440283",
"0.44327626",
"0.44321916",
"0.44277036",
"0.442342",
"0.44167054",
"0.44076678",
"0.4404666",
"0.4400081",
"0.43980876",
"0.43978137",
"0.43966478",
"0.43908495",
"0.43907472"
] | 0.7711933 | 0 |
Writes a sequence of doubles to the stream at the current position. If len is 0, nothing is written. The double d[off] is written first, then the double d[off + 1], and so on. The byte order of the stream is used to determine the order in which the individual bytes are written. If the bit offset within the stream is nonzero, the remainder of the current byte is padded with 0s and written out first. The bit offset will be 0 after the write. | void writeDoubles(double[] d, int off, int len) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void writeAsDbl(int offset, double d);",
"protected void writeDoubleArray( DataOutput out, double[] array ) throws IOException {\n\n ByteArrayOutputStream byteStream = new ByteArrayOutputStream();\n DataOutputStream dataOut = new DataOutputStream( byteStream );\n\n dataOut.writeInt( array.length );\n for(int i=0; i<array.length; i++)\n dataOut.writeDouble( array[i] );\n dataOut.close();\n\n out.writeInt( byteStream.size() );\n out.write( byteStream.toByteArray() );\n }",
"public int read(double[] d, int start, int len) throws IOException {\n\n\t\tint i = start;\n\t\ttry {\n\t\t\tfor (; i < start + len; i += 1) {\n\n\t\t\t\tif (count - pos < 8) {\n\t\t\t\t\tfillBuf(8);\n\t\t\t\t}\n\t\t\t\tint i1 = buf[pos] << 24 | (buf[pos + 1] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 2] & 0xFF) << 8 | (buf[pos + 3] & 0xFF);\n\t\t\t\tint i2 = buf[pos + 4] << 24 | (buf[pos + 5] & 0xFF) << 16\n\t\t\t\t\t\t| (buf[pos + 6] & 0xFF) << 8 | (buf[pos + 7] & 0xFF);\n\t\t\t\td[i] = Double.longBitsToDouble(((long) i1) << 32\n\t\t\t\t\t\t| ((long) i2 & 0x00000000FFFFFFFFL));\n\t\t\t\tpos += 8;\n\t\t\t}\n\t\t} catch (EOFException e) {\n\t\t\treturn eofCheck(e, i, start, 8);\n\t\t}\n\t\treturn 8 * len;\n\t}",
"void writeDouble(double v) throws IOException;",
"public final void writeDouble(final double data, final boolean endianess) throws IOException {\r\n\r\n long tmpLong;\r\n\r\n tmpLong = Double.doubleToLongBits(data);\r\n writeLong(tmpLong, endianess);\r\n }",
"void writeDouble(double value);",
"public void write(final byte[] data, final int offset, final int len) throws IOException {\n checkOpened();\n dos.write(data, offset, len);\n flush();\n }",
"public synchronized static void write(double[] xxx,String fileName){\n\t\ttry{\n\t\t \tFileOutputStream fos = new FileOutputStream(fileName);\n\t\t \tDataOutputStream dos = new DataOutputStream(fos);\n\t\t\t\n\t\t\tfor(double x:xxx)\n\t\t\t\tdos.writeDouble(x);\n\t\t\tdos.close();\n\t\t\tfos.close();\n\t\t}catch(Exception ex){\n\t\t\tex.printStackTrace();\n\t\t}\n\t}",
"public abstract void read_double_array(double[] value, int offset, int\nlength);",
"public void write(long[] timestamps, double[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"@Override\n public void write(byte[] data, int off, int len) throws IOException {\n for (int i = off; i < len; i++) {\n write(data[i]);\n }\n }",
"void writeFloats(float[] f, int off, int len) throws IOException;",
"public ByteBuf writeDouble(double value)\r\n/* 575: */ {\r\n/* 576:586 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 577:587 */ return super.writeDouble(value);\r\n/* 578: */ }",
"public void writeSamples( float[] samples, int offset, int numSamples );",
"@Override\r\n\tpublic Buffer setDouble(int pos, double d) {\n\t\treturn null;\r\n\t}",
"static public void writeVectorArray(PrintWriter writer, double[] vector) {\r\n writer.println(vector.length);\r\n for (double v : vector) {\r\n writer.println(Double.toString(v));\r\n }\r\n }",
"public static double[] readDoubleVector(DataInputStream input) throws IOException {\n int length = input.readInt();\n\n double[] ret = new double[length];\n\n for (int i = 0; i < length; i++) {\n double value = input.readDouble();\n ret[i] = value;\n }\n\n return ret;\n }",
"public void write(byte b[], int off, int len) throws IOException\n {\n checkThreshold(len);\n getStream().write(b, off, len);\n written += len;\n }",
"@Override\n\tpublic long readDoubleArray(int len, double[] varr) throws IOException {\n\t\tlong nnz = 0;\n\t\tfor( int i=0; i<len; i++ )\n\t\t\tnnz += (varr[i] = _buff.getDouble()) != 0 ? 1 : 0;\n\t\treturn nnz;\n\t}",
"public void write(byte b[], int off, int len) throws IOException;",
"public F64Vector(double[] values, int offset, int length) {\n this(length);\n System.arraycopy(values, offset, data, 0, length);\n }",
"public void nextDoubles(double[] d) {\n real.nextDoubles(d);\n }",
"public void write(long[] timestamps, float[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"public void write(byte[] data, long offset);",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"public abstract double readAsDbl(int offset);",
"public abstract void save(LongDoublesCol col, DataOutputStream output) throws IOException;",
"public synchronized void write(byte[] buf, int off, int len)\n\t\t\t\tthrows IOException {\n\t\t\tsuper.write(buf, off, len);\n\t\t}",
"public void write(byte b[], int off, int len) \r\n {\r\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\r\n ((off + len) > b.length) || ((off + len) < 0)) \r\n \t{\r\n \t\tthrow new IndexOutOfBoundsException();\r\n \t} \r\n \telse if (len == 0) \r\n \t{\r\n \t\treturn;\r\n \t}\r\n int newcount = count + len;\r\n if (newcount > buf.length) \r\n {\r\n byte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n System.arraycopy(buf, 0, newbuf, 0, count);\r\n buf = newbuf;\r\n }\r\n System.arraycopy(b, off, buf, count, len);\r\n count = newcount;\r\n }",
"public void write(DataOutputStream out) throws IOException;",
"public void writeSamples( short[] samples, int offset, int numSamples );",
"double readDouble() throws IOException;",
"public void write_to_buffer(DataOutputStream out) throws IOException {\r\n //for (int i = 0; i < this.dimension; ++i)\r\n for (int i = 0; i < this.dimension * 2; ++i) {\r\n out.writeFloat(this.data[i]);\r\n }\r\n out.writeFloat(this.distanz);\r\n// out.write(this.PlaceId.getBytes());\r\n out.writeInt(this.getPlaceId());\r\n// System.out.println(\"heheheh +::\" + this.PlaceId.length);\r\n out.writeDouble(this.location[0]);\r\n out.writeDouble(this.location[1]);\r\n// System.out.println(\"heheheh +::\" +this.PlaceId.getBytes().length);\r\n }",
"public void write(BufferedDataOutputStream o) throws FitsException {\n\n this.writeTrueData(o);\n byte[] padding = new byte[getPadding()];\n try {\n o.writePrimitiveArray(padding);\n } catch (IOException e) {\n throw new FitsException (\"Error writing padding: \"+e);\n }\n\n }",
"public ByteBuf setDouble(int index, double value)\r\n/* 313: */ {\r\n/* 314:328 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 315:329 */ return super.setDouble(index, value);\r\n/* 316: */ }",
"public abstract void save(IntDoublesCol col, DataOutputStream output) throws IOException;",
"public void write(long[] timestamps, long[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"public void write(long[] timestamps, Binary[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"public void write(byte b[], int off, int len) throws IOException {\n baos.write(b, off, len);\n }",
"public void write(byte b[], int off, int len) throws IOException\n\t{\n\t\tout.write(b, off, len);\n\t\tmd5.update(b, off, len);\n\t}",
"public final double getDouble(final boolean endianess) throws IOException {\r\n b1 = (tagBuffer[bPtr] & 0xff);\r\n b2 = (tagBuffer[bPtr + 1] & 0xff);\r\n b3 = (tagBuffer[bPtr + 2] & 0xff);\r\n b4 = (tagBuffer[bPtr + 3] & 0xff);\r\n b5 = (tagBuffer[bPtr + 4] & 0xff);\r\n b6 = (tagBuffer[bPtr + 5] & 0xff);\r\n b7 = (tagBuffer[bPtr + 6] & 0xff);\r\n b8 = (tagBuffer[bPtr + 7] & 0xff);\r\n\r\n long tmpLong;\r\n\r\n if (endianess == FileDicomBaseInner.BIG_ENDIAN) {\r\n tmpLong = ( ((long) b1 << 56) | ((long) b2 << 48) | ((long) b3 << 40) | ((long) b4 << 32)\r\n | ((long) b5 << 24) | ((long) b6 << 16) | ((long) b7 << 8) | b8);\r\n } else {\r\n tmpLong = ( ((long) b8 << 56) | ((long) b7 << 48) | ((long) b6 << 40) | ((long) b5 << 32)\r\n | ((long) b4 << 24) | ((long) b3 << 16) | ((long) b2 << 8) | b1);\r\n }\r\n\r\n bPtr += 8;\r\n\r\n return (Double.longBitsToDouble(tmpLong));\r\n\r\n }",
"public static byte [] toBytes(final double d) {\n // Encode it as a long\n return Bytes.toBytes(Double.doubleToRawLongBits(d));\n }",
"public void write(DataOutput out) throws IOException {\n\t\t\n\t\tout.writeInt(this.id.length());\n\t\tout.write(this.id.getBytes());\n\t\t\n\t\tout.writeInt(this.sequence.length());\n\t\tout.write(this.sequence.getBytes());\n\t\t\n\t\tfor (Point3d p: this.structure) {\n\t\t\tif (p == null) {\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t\tout.writeShort(Short.MAX_VALUE);\n\t\t\t} else {\n\t\t\t\tif (p.x*10 > Short.MAX_VALUE || p.y*10 > Short.MAX_VALUE || p.z*10 > Short.MAX_VALUE) {\n\t\t\t\t\tSystem.out.println(\"Overflow\");\n\t\t\t\t}\n\t\t\t\tout.writeShort((short)Math.round(p.x*10));\n\t\t\t\tout.writeShort((short)Math.round(p.y*10));\n\t\t\t\tout.writeShort((short)Math.round(p.z*10));\n\t\t\t}\n\t\t}\n\t}",
"void writeInts(int[] i, int off, int len) throws IOException;",
"public void write( byte[] array, int firstIndex,\n\t\t\tint count );",
"@Override\n\tpublic void\n\tset( int i, double value )\n\t{\n\t\tdata[i] = value;\n\t}",
"public final void writeNumeric(double[] data) {\n myRow.setNumeric(data);\n writeRow(myRow);\n }",
"public int write(byte[] b, int off, int len)\n {\n synchronized (this) {\n if (!open) {\n return 0;\n }\n\n writing = true;\n started = true;\n reset = false;\n timeTracker.start();\n }\n line.start();\n int written = line.write(b, off, len);\n synchronized (this) {\n // drain() might be waiting, so we should wake it up.\n notifyAll();\n writing = false;\n\t\t\tif (!reset) {\n\t\t\t\ttotalWritten += written;\n\t\t\t} else if (reset && open) {\n\t\t\t\t// Flush what we just wrote to keep it reset.\n\t\t\t\tline.flush();\n\t\t\t}\n return written;\n }\n }",
"@Override\r\n\tpublic double getDouble(int pos) {\n\t\treturn buffer.getDouble(pos);\r\n\t}",
"@DSSink({DSSinkKind.IO})\n @DSSpec(DSCat.IO)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-03 14:59:52.266 -0400\", hash_original_method = \"6659C26B9D2F6D845755120D9E3C542C\", hash_generated_method = \"1D85046399E8D016E013E1B1E96055F2\")\n \n@Override\r\n public void write(byte[] bts, int st, int end) throws IOException {\r\n try {\r\n beforeWrite(end);\r\n out.write(bts, st, end);\r\n afterWrite(end);\r\n } catch (IOException e) {\r\n handleIOException(e);\r\n }\r\n }",
"private void write(byte[] data, int pos, int len)\n\t\tthrows IOException\n\t{\n\t\tchar[] chars = BASE64;\n\n\t\tint loc = (len > 0 ? (data[pos] << 24) >>> 8 : 0) |\n\t\t\t(len > 1 ? (data[pos+1] << 24) >>> 16 : 0) |\n\t\t\t(len > 2 ? (data[pos+2] << 24) >>> 24 : 0);\n\n\t\tswitch(len)\n\t\t{\n\t\t\tcase 3:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write(chars[loc & 0x3f]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write(chars[(loc >>> 6) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\twriter.write(chars[loc >>> 18]);\n\t\t\t\twriter.write(chars[(loc >>> 12) & 0x3f]);\n\t\t\t\twriter.write('=');\n\t\t\t\twriter.write('=');\n\t\t}\n\t}",
"double readDouble()\n throws IOException {\n return Double.longBitsToDouble( readLong() );\n }",
"void writeLongs(long[] l, int off, int len) throws IOException;",
"@Override\n public void writeCompressed(DataOutput out) throws IOException {\n out.writeInt(length);\n out.write(array);\n }",
"public byte[] readRawDouble() throws IOException {\n byte[] bytes = new byte[9];\n bytes[0] = (byte) Type.DOUBLE.code;\n in.readFully(bytes, 1, 8);\n return bytes;\n }",
"public static native int write(int fd, byte[] data, int off, int len) throws IOException;",
"public void write_to_buffer(DataOutputStream out) throws IOException\r\n {\r\n for (int i = 0; i < 2*dimension; ++i)\r\n out.writeFloat(bounces[i]);\r\n out.writeInt(son);\r\n out.writeInt(num_of_data);\r\n }",
"public void write(byte[] b, int off, int len) {\n\t\tbaos.write(b, off, len);\n\t}",
"@Override\n public void write(final byte[] data, final int offset, final int length)\n throws IOException {\n if (offset < 0 || length < 0 || length > data.length - offset) {\n throw new IndexOutOfBoundsException();\n }\n\n writeInternal(data, offset, length);\n }",
"public abstract void writeData(DataOutput dout) throws IOException;",
"@Override\r\n\tpublic synchronized void write(byte[] b, int off, int len)\r\n\t{\r\n\t}",
"public static double[] readDoubles() {\n return readAllDoubles();\n }",
"@Override\n protected void writeFixed(Schema schema, Object datum, Encoder out)\n throws IOException {\n\n final byte[] bytes = ((GenericFixed) datum).bytes();\n GenericBinding.writeFixed(schema, bytes, out);\n }",
"public synchronized void write(byte b[], int off, int len) {\n \tif ((off < 0) || (off > b.length) || (len < 0) ||\n \t\t\t((off + len) > b.length) || ((off + len) < 0)) {\n \t\tthrow new IndexOutOfBoundsException();\n \t} else if (len == 0) {\n \t\treturn;\n \t}\n \tif (enableClip) {\n \t\tdoClipWrite(b, off, len);\n \t} else {\n \t\twriteDirectly(b, off, len);\n \t}\n \t\n }",
"void write(byte[] buffer, int bufferOffset, int length) throws IOException;",
"public void write(long[] timestamps, boolean[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"public void write(long[] timestamps, int[] values, int batchSize) {\n for (int i = 0; i < batchSize; i++) {\n timeEncoder.encode(timestamps[i], timeOut);\n valueEncoder.encode(values[i], valueOut);\n }\n statistics.update(timestamps, values, batchSize);\n }",
"String doubleWrite();",
"public void readRecord(double[] data, int start, int length, int offset,\n\t\t\tint pixelStride, int n2, int n3) throws IOException;",
"public void send(double d) {\r\n\t\tif (s != null) {\r\n\t\t\ttry {\r\n\t\t\t\tdos.writeByte(LiteServer.DOUBLE_CONST);\r\n\t\t\t\tdos.writeDouble(d);\r\n\t\t\t\tif (autoFlush) {\r\n\t\t\t\t\tdos.flush();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// if the socket is null\r\n\t\t}\r\n\r\n\t}",
"public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}",
"@Override\n public void write(byte[] buf, int offset, int size) throws IOException;",
"@DSSink({DSSinkKind.IO})\n @DSSpec(DSCat.IO)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-09-03 14:59:52.266 -0400\", hash_original_method = \"E4B5E15EBD1DC0F51B6909882AA2B9D3\", hash_generated_method = \"F2EA6D6D1EB28486AFF7B8C18D6CD1F3\")\n \n@Override\r\n public void write(byte[] bts) throws IOException {\r\n try {\r\n int len = bts != null ? bts.length : 0;\r\n beforeWrite(len);\r\n out.write(bts);\r\n afterWrite(len);\r\n } catch (IOException e) {\r\n handleIOException(e);\r\n }\r\n }",
"public void flush() {\r\n // Flushing is required only if there are written bytes in\r\n // the current data element.\r\n if (bytenum != 0) {\r\n data[offset] = elem;\r\n }\r\n }",
"public void save(DataOutputStream dataOut) {\n int i;\n int j;\n for (i = 0; i < nr_of_segments; i++) {\n for (j = 0; j < points_per_segment; j++) {\n try {\n dataOut.writeDouble(points[i][j].x);\n dataOut.writeDouble(points[i][j].y);\n dataOut.writeDouble(points[i][j].z);\n } catch (IOException e) {\n System.out.println(\"Problem creating file\");\n }\n\n }\n }\n }",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public double readDouble() throws IOException {\n\n\t\tif (read(bb, 0, 8) < 8) {\n\t\t\tthrow new EOFException();\n\t\t}\n\n\t\tint i1 = bb[0] << 24 | (bb[1] & 0xFF) << 16 | (bb[2] & 0xFF) << 8\n\t\t\t\t| (bb[3] & 0xFF);\n\t\tint i2 = bb[4] << 24 | (bb[5] & 0xFF) << 16 | (bb[6] & 0xFF) << 8\n\t\t\t\t| (bb[7] & 0xFF);\n\n\t\treturn Double.longBitsToDouble(((long) i1) << 32\n\t\t\t\t| ((long) i2 & 0x00000000ffffffffL));\n\t}",
"@Override\n\t\tpublic void write(DataOutput arg0) throws IOException {\n\t\t\tk.write(arg0);\n\t\t\tv.write(arg0);\n\t\t}",
"public static void writeBytes(Vector byteVector, DataOutputStream dos) throws IOException {\t\r\n\t\tif(byteVector != null){\r\n\t\t\tdos.writeByte(byteVector.size());\r\n\t\t\tfor(int i=0; i<byteVector.size(); i++ )\r\n\t\t\t\tdos.writeByte(((Byte)byteVector.elementAt(i)).byteValue());\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeByte(0);\r\n\t}",
"public abstract void writeToStream(java.io.DataOutputStream output) throws java.io.IOException;",
"private void writeLength( ObjectOutput out, int len ) throws IOException\n {\n\t\tif (len <= 31)\n\t\t{\n\t\t\tout.write((byte) (0x80 | (len & 0xff)));\n\t\t}\n\t\telse if (len <= 0xFFFF)\n\t\t{\n\t\t\tout.write((byte) 0xA0);\n\t\t\tout.writeShort((short) len);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tout.write((byte) 0xC0);\n\t\t\tout.writeInt(len);\n\n\t\t}\n }",
"@Override\n public void write(byte[] data) throws IOException {\n for (int i = 0; i < data.length; i++) {\n write(data[i]);\n }\n }",
"public void write(ArrayDataOutput out) throws FitsException, IOException;",
"public int read(double[] d) throws IOException {\n\t\treturn read(d, 0, d.length);\n\t}",
"public static void writeBig(Vector persistentVector, DataOutputStream dos) throws IOException {\t\r\n\t\tif(persistentVector != null){\r\n\t\t\tdos.writeInt(persistentVector.size());\r\n\t\t\tfor(int i=0; i<persistentVector.size(); i++ ){\r\n\t\t\t\t((Persistent)persistentVector.elementAt(i)).write(dos);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tdos.writeInt(0);\r\n\t}",
"public int write(ByteList buf, int offset, int len) throws IOException, BadDescriptorException {\n checkOpen();\n \n return internalWrite(ByteBuffer.wrap(buf.getUnsafeBytes(), buf.begin()+offset, len));\n }",
"@SuppressWarnings(\"unchecked\")\r\n public static void writeDoubleToObjectArray(final Storage theStorage,\r\n final Field<?, ?>[] theFieldArray, final Object[] theValues) {\r\n\r\n for (int i = 0; i < theFieldArray.length; i++) {\r\n final DoubleField<?, ?> theField = (DoubleField<?, ?>) theFieldArray[i];\r\n if (theField != null) {\r\n final DoubleConverter<Object> converter = (DoubleConverter<Object>) theField\r\n .converter();\r\n final double dval = converter.fromObject(theValues[i]);\r\n theStorage.write(theField, dval);\r\n }\r\n }\r\n }",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\ttimeInt.write(out);\n\t\tsum.write(out);\n\t\tIp.write(out);\n\t}",
"protected void writeTrueData(BufferedDataOutputStream o) throws FitsException {\n\n try {\n o.writePrimitiveArray(dataArray);\n } catch (IOException e) {\n throw new FitsException(\"FITS Output Error: \"+e);\n }\n }",
"private double readDouble() throws IOException {\n\t\treturn (isBigEndian ? ioReadDouble() : Double.longBitsToDouble(readLELong()));\n\t}",
"protected void write(CCompatibleOutputStream os) throws Exception {\n java.util.Vector fieldVector = getFieldVector();\n for (int i = 0; i < fieldVector.size(); i++) {\n Field field = (Field) (fieldVector.elementAt(i));\n Class type = field.getType();\n if (type == Byte.TYPE) {\n os.writeByte(field.getByte(this));\n }\n else if (type == Short.TYPE) {\n os.writeShortReverse(field.getShort(this));\n }\n else if (type == Integer.TYPE) {\n os.writeIntReverse(field.getInt(this));\n }\n else if (type == Long.TYPE) {\n os.writeLongReverse(field.getLong(this));\n }\n else if (type == Double.TYPE) {\n os.writeDouble(field.getDouble(this));\n }\n else if (type.getName().equals(\"[B\")) {\n os.write( (byte[]) (field.get(this)));\n }\n }\n }",
"public ListOfDouble(int size) {\n\t\telements = new double[size];\n\t\tpointer = 0;\n\t}",
"@Override\n public void write(byte[] b_array) throws IOException {\n int i;\n int flag = 1;\n int my_decimal1=0;\n for (i = 0; i < 12; i++) {\n out.write(b_array[i]);\n }\n //write to output stream the rest of the bytearray's size - division 8\n int rest = (b_array.length - 12) % 8;\n out.write((byte) rest);\n\n\n while (i < b_array.length) {\n //start to count the number of 0\n if (i < b_array.length - rest) {\n for (int j = 0; j < 8; j++) {\n //check if we not in the rest part of the byte array\n if (i < b_array.length - rest) {\n //my_str = String.valueOf((int)b_array[i]);\n my_decimal1 += (int)b_array[i]*(Math.pow(2, j));\n i++;\n }\n else {\n flag = 0;\n break;\n }\n }\n }\n else{\n flag=0;\n }\n //if the for loop finish without break;\n if (flag == 1) {\n out.write((byte) my_decimal1);\n my_decimal1 = 0;\n }\n else {\n out.write(b_array[i]);\n i++;\n }\n }\n\n //>>\n\n\n }",
"public abstract void writeToStream(DataOutputStream dataOutputStream);",
"private void serializeDouble(final double number, final StringBuffer buffer)\n {\n buffer.append(\"d:\");\n buffer.append(number);\n buffer.append(';');\n }",
"@Override\n\tpublic void write(DataOutput dout) throws IOException {\n\t\tdout.writeLong(this.time);\n\t\tdout.writeInt(this.intVal);\n\t}",
"public void writeData(byte b[]) throws IOException {\n\n RandomAccessFile raf;\n int skip_head;\n\n float vox_offset = header.getVox_offset();\n String ds_datname = header.getDs_datname();\n\n skip_head = (int) vox_offset;\n\n\n // can't write random access compressed yet\n if (ds_datname.endsWith(\".gz\")) {\n throw new IOException(\"Sorry, can't write to compressed image data file: \" + ds_datname);\n }\n\n\n // write data blob\n raf = new RandomAccessFile(ds_datname, \"rwd\");\n raf.seek(skip_head);\n raf.write(b, 0, b.length);\n raf.close();\n\n }",
"public synchronized void append(long timestamp, double value) {\n if (timestamp < 0 || timestamp > MAX_UNIX_TIMESTAMP) {\n throw new IllegalArgumentException(\"Timestamp is not a valid unix timestamp: \" + timestamp);\n }\n\n if (size == 0) {\n appendFirstPoint(timestamp, value);\n } else {\n appendNextPoint(timestamp, value);\n }\n size++;\n }",
"public abstract void write (DataOutputStream outStream)\r\n throws IOException;",
"public void write(byte[] b, int off, int len) throws IOException {\r\n try {\r\n os.write(b, off, len);\r\n } catch (IOException io) {\r\n if (!cbImpl.checkMobileNetwork()) {\r\n throw new WrapperIOException(new TransportException(io.getMessage(), io,\r\n TransportException.NO_NETWORK_COVERAGE));\r\n }\r\n throw io;\r\n }\r\n }"
] | [
"0.6402469",
"0.6238307",
"0.6141663",
"0.60372686",
"0.59317154",
"0.57421744",
"0.5533159",
"0.549302",
"0.5491697",
"0.5388777",
"0.53823406",
"0.5377969",
"0.5312574",
"0.5174891",
"0.5167494",
"0.5159453",
"0.5053393",
"0.5040152",
"0.50035095",
"0.4999109",
"0.49947643",
"0.4968622",
"0.49324208",
"0.4915585",
"0.49115387",
"0.4901104",
"0.48581952",
"0.48269048",
"0.47872815",
"0.47806117",
"0.477663",
"0.4774101",
"0.4769281",
"0.47681472",
"0.47679725",
"0.47675458",
"0.47627902",
"0.4752975",
"0.4750938",
"0.47505462",
"0.4748537",
"0.4734481",
"0.473352",
"0.47131523",
"0.47038263",
"0.4693955",
"0.4686968",
"0.4685497",
"0.46808442",
"0.46649873",
"0.46442872",
"0.46385905",
"0.46369618",
"0.46343523",
"0.46269348",
"0.46267334",
"0.46216056",
"0.46210057",
"0.4618277",
"0.4616492",
"0.46142772",
"0.45950833",
"0.45924658",
"0.4587932",
"0.45588785",
"0.45547408",
"0.4547728",
"0.45469466",
"0.45452276",
"0.45355836",
"0.45273918",
"0.4520269",
"0.450699",
"0.45047092",
"0.45013162",
"0.44751132",
"0.44694963",
"0.44691673",
"0.44681385",
"0.44667578",
"0.44491383",
"0.44443035",
"0.4444072",
"0.44427904",
"0.44325086",
"0.4427101",
"0.44248572",
"0.44232944",
"0.44179726",
"0.4412847",
"0.4404618",
"0.44043583",
"0.43962765",
"0.43887013",
"0.43760034",
"0.43754563",
"0.43529212",
"0.43513468",
"0.43422848",
"0.43387803"
] | 0.78878057 | 0 |
Writes a single bit, given by the least significant bit of the argument, to the stream at the current bit offset within the current byte position. The upper 31 bits of the argument are ignored. The given bit replaces the previous bit at that position. The bit offset is advanced by one and reduced modulo 8. If any bits of a particular byte have never been set at the time the byte is flushed to the destination, those bits will be set to 0 automatically. | void writeBit(int bit) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeBit(int bit) {\n if (bit < 0 || bit > 1)\n throw new IllegalArgumentException(\"Illegal bit: \" + bit);\n digits += bit << numDigits;\n numDigits++;\n if (numDigits == this.byteSize) {\n flush();\n }\n }",
"public void writeBit (final int aBit) throws IOException\n {\n if (m_aOS == null)\n throw new IllegalStateException (\"BitOutputStream is already closed\");\n if (aBit != CGlobal.BIT_NOT_SET && aBit != CGlobal.BIT_SET)\n throw new IllegalArgumentException (aBit + \" is not a bit\");\n\n if (aBit == CGlobal.BIT_SET)\n if (m_bHighOrderBitFirst)\n m_nBuffer |= (aBit << (7 - m_nBufferedBitCount));\n else\n m_nBuffer |= (aBit << m_nBufferedBitCount);\n\n ++m_nBufferedBitCount;\n if (m_nBufferedBitCount == CGlobal.BITS_PER_BYTE)\n flush ();\n }",
"public static byte set(byte value, int bit){\n return (byte)(value|(1<<bit));\n }",
"public void setBit(int pos, int bit) {\r\n\t\tflagBits[pos] = bit;\r\n\t}",
"public int anySetBit(int beyondBit)\n \t{\n \t\tif (SanityManager.DEBUG)\n \t\t{\n \t\t\tif (beyondBit >= this.getLength())\n SanityManager.THROWASSERT(\n \"Attempt to access bit position that exceeds the max length (\"\n + this.getLength() + \")\");\n \t\t}\n \n \t\tint startingBit = (beyondBit+1);\n \n \t\t// we have seen the last bit.\n \t\tif (startingBit >= this.getLength())\n \t\t\treturn -1;\n \n \t\tint numbytes = getLengthInBytes();\n \t\tint startingByte = startingBit / 8;\n \t\tint startingBitpos = startingBit % 8;\n \t\tint bitpos;\n \t\tbyte mask;\n \n \t\t// see if any bits in this byte is set, only the bottom part of the\n \t\t// first byte is relevant\n \t\tmask = (byte)(0xFF >> startingBitpos);\n \n \t\tif (startingByte == numbytes-1)\t// starting byte == last byte \n \t\t\tmask &= (byte)(0xFF << (8-bitsInLastByte));\n \n \t\tif ((value[startingByte] & mask ) != 0)\n \t\t{\n \t\t\t// I know we will see the bit before bitsInLastByte even if we are\n \t\t\t// at the last byte, no harm in going up to 8 in the loop\n \t\t\tfor (int j = startingBitpos; j < 8; j++)\n \t\t\t{\n \t\t\t\tif (SanityManager.DEBUG)\n \t\t\t\t{\n \t\t\t\t\tif (startingByte == numbytes-1)\n \t\t\t\t\t\tSanityManager.ASSERT(j < bitsInLastByte,\n \t\t\t\t\t\t\t\t \"going beyond the last bit\");\n \t\t\t\t}\n \t\t\t\tbitpos = 7-j;\n \t\t\t\tif (((1 << bitpos) & value[startingByte]) != 0)\n \t\t\t\t{\n \t\t\t\t\treturn (startingByte*8+j);\n \t\t\t\t}\n \t\t\t}\t\n \t\t}\n \n \t\tfor (int i = (startingByte+1); i < numbytes-1; i++)\n \t\t{\t\t\t\n \t\t\tif (value[i] != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < 8; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[i]) != 0)\n \t\t\t\t\t{\n \t\t\t\t\t\treturn ((i*8)+j);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Last byte if there are more than one bytes. Only the top part of\n \t\t// the last byte is relevant \n \t\tif (startingByte != numbytes-1)\n \t\t{\n \t\t\tmask = (byte)(0xFF << (8-bitsInLastByte));\n \n \t\t\tif ((value[numbytes-1] & mask) != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < bitsInLastByte; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[numbytes-1]) != 0)\n \t\t\t\t\t{\n \t\t\t\t\t\treturn ((numbytes-1)*8)+j;\t\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn -1;\n \n \t}",
"private static int mask(int bit) {\n return MSB >>> bit;\n }",
"void setBit(int index, int value);",
"void writeBits(long bits, int numBits) throws IOException;",
"public void setBit(int index, boolean bit)\n\t{\n\t\tif (index + 1 > bits.size()) bits.ensureCapacity(index + 1);\n\t\tbits.add(index, bit);\n\t}",
"public void setBitOffset(int bitOffset) {\r\n\t\tthis.bitOffset = bitOffset;\r\n\t}",
"public static void writeBit(int[][] matrix, int col, int row, boolean bit, int mask) {\n matrix[col][row] = maskColor(col, row, bit, mask);\n }",
"public static byte setBit(byte input, int position, boolean val){\n return val? (byte) (input | (1 << position)):(byte) (input & ~(1 << position));\n }",
"public TribitByte setBit(int bitPosition, Tribit bit){\n MathUtils.assertInRange(bitPosition, 0, LENGTH - 1);\n Objects.requireNonNull(bit);\n Tribit[] newValues = Arrays.copyOf(this.value, this.value.length);\n newValues[bitPosition] = bit;\n return new TribitByte(newValues);\n }",
"protected void setBit(long bitIndex) {\r\n\t long intIndex = (bitIndex >>> ADDRESS_BITS_PER_UNIT);\r\n\t bits[(int)(intIndex / ONE_MB_INTS)][(int)(intIndex % ONE_MB_INTS)] \r\n\t |= 1 << (bitIndex & BIT_INDEX_MASK);\r\n\t }",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"protected long setBit(long word, boolean flag, long position) {\n\t\tif (!flag) {\n\t\t\treturn word & (~(1L << position));\n\t\t}\n\t\treturn word | (1L << position);\n\t}",
"public interface BitOutput {\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a 1-bit boolean value. This method writes {@code 0b1} for {@code true}\n\t * and {@code 0b0} for {@code false}.\n\t *\n\t * @param value the value to write.\n\t * @throws IOException if an I/O error occurs\n\t */\n\tvoid writeBoolean( boolean value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a {@code byte} value.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 7 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeByte( boolean unsigned, int size, byte value ) throws IOException;\n\n\t/**\n\t * Writes a {@code short} value.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 15 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeShort( boolean unsigned, int size, short value ) throws IOException;\n\n\t/**\n\t * Writes an {@code int} value. Only the lower specified number of bits are\n\t * written.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 31 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeInt( boolean unsigned, int size, int value ) throws IOException;\n\n\t/**\n\t * Writes a {@code long} value. Only the lower specified number of bits are\n\t * written.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of valid bits for value; between {@code 1} and\n\t * {@code 63 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeLong( boolean unsigned, int size, long value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a {@code char} value.\n\t *\n\t * @param size the number of bits for value; between {@code 1} and {@code 16},\n\t * both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeChar( int size, char value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Aligns to specified number of bytes by padding zero bits.\n\t *\n\t * @param bytes the number of bytes to align; must be positive.\n\t * @return the number of zero bits padded while aligning.\n\t * @throws IllegalArgumentException if {@code bytes} is less than or equals to\n\t * {@code 0}.\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tlong align( int bytes ) throws IOException;\n}",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"private static int writeBits(byte[] bytes, int value, int pos, int len) {\n assert(value > 0 && pos + len <= bytes.length * 8);\n int ind = pos / 8;\n int lastPos = 0;\n for (int i = 0; i < len; i++) {\n int bi = (pos + i) % 8;\n if ((value & (1 << (len - i - 1))) != 0) {\n bytes[ind] |= 1 << (7 - bi);\n lastPos = pos + i;\n }\n if (bi == 7) {\n ind++;\n }\n }\n return lastPos;\n }",
"public static byte getMybit(byte val, int pos){\n return (byte) ((val >> pos) & 1);\n }",
"protected void setBitAt(final int bitIndex) {\n _bitMap = _setBit(_bitMap,\n \t\t\t\t (Numbers.INTEGER_WIDTH*8-1)-bitIndex-1);\n }",
"public void setFlag( int flag )\n {\n value |= 1 << ( MAX_SIZE - 1 - flag );\n }",
"public static int setBit(final int intValue, final Bits bit) {\n return setFlag(intValue, bit, true);\n }",
"public void setFlag(short flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t} else {\n\t\t\t__io__block.writeShort(__io__address + 6, flag);\n\t\t}\n\t}",
"void setBit(int index, boolean value);",
"public void x_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 3); }",
"public static long setBit(long value, int pos) {\n pos--;\n return value | (1L << pos);\n\n }",
"public void setBitToOne(int k) {\n if (this.inBitRange(k)) {\n int i = k / 8;\n int j = k % 8;\n int b = this.data.get(i);\n int c = 1 << (7 - j);\n b = b | c;\n byte d = (byte) b;\n this.data.set(i, d);\n }\n }",
"public void flipper(int bit)\n\t{\n\t\tif (binaryCode[bit])\n\t\t{\n\t\t\t//if value is true, it becomes false\n\t\t\tbinaryCode[bit]=false;\n\n\t\t} else {\n\t\t\t\n\t\t\t//if value is false, it becomes true\n\t\t\tbinaryCode[bit]=true;\n\t\t}\n\t}",
"public void or(FormatableBitSet otherBit)\n \t{\n \t\tif (otherBit == null) {\n \t\t\treturn;\n \t\t}\n \t\tint otherLength = otherBit.getLength();\n \n \t\tif (otherLength > getLength()) {\n \t\t\tgrow(otherLength);\n \t\t}\n \n \t\tint obByteLen = otherBit.getLengthInBytes();\n \t\tfor (int i = 0; i < obByteLen; ++i) {\n \t\t\tvalue[i] |= otherBit.value[i];\n \t\t}\n \t\tif (SanityManager.DEBUG) {\n \t\t\tSanityManager.ASSERT(invariantHolds(),\"or() broke invariant\");\n \t\t}\n \t}",
"public void z_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 7); }",
"static int setBit(int n, int pos){\n return n | (1<<pos);\n }",
"public void r_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 9); }",
"public void y_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 5); }",
"void writeByte(byte value);",
"public int anySetBit()\n \t{\n \t\tint numbytes = getLengthInBytes();\n \t\tint bitpos;\n \n \t\tfor (int i = 0; i < numbytes-1; i++)\n \t\t{\n \t\t\tif (value[i] != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < 8; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[i]) != 0)\n \t\t\t\t\t\treturn ((i*8)+j);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \n \t\t// only the top part of the last byte is relevant\n \t\tbyte mask = (byte)(0xFF << (8-bitsInLastByte));\n \t\tif ((value[numbytes-1] & mask) != 0)\n \t\t{\n \t\t\tfor (int j = 0; j < bitsInLastByte; j++)\n \t\t\t{\n \t\t\t\tbitpos = 7-j;\n \t\t\t\tif (((1 << bitpos) & value[numbytes-1]) != 0)\n \t\t\t\t\treturn ((numbytes-1)*8)+j;\n \t\t\t}\n \t\t}\n \n \t\treturn -1;\n \t}",
"public void write(boolean b) {\n write(b ? 1 : 0);\n }",
"public int updateBit(int i,int j, boolean set){\n int value=(set)?1:0;\n int mask=~(1<<j);\n int clear=mask&i;\n return clear|(1<<value);\n\n}",
"static int setBit(int num, int pos) {\n\t\t\treturn num | (1<<pos);\n\t\t}",
"public static byte getSpecifiedBitValue(byte originByte, int bitIndex) {\n return (byte) ((originByte) >> (bitIndex) & 1);\n }",
"public void set(int loc, boolean val)\n\t{\n\t\tif (loc < this.size)\n\t\t{\n\t\t\tif (val)\n\t\t\t{\n\t\t\t\tbits[loc / BITS_IN_LONG] |= (1L << (loc % BITS_IN_LONG));\n\t\t\t} else\n\t\t\t{\n\t\t\t\tbits[loc / BITS_IN_LONG] &= ~(1L << (loc % BITS_IN_LONG)); // DO NOT FORGET THAT SECOND L\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // TOOK ME FOREVER TO FIX WHEN I FORGOT\n\t\t\t}\n\t\t} else\n\t\t{\n\t\t\tthrow new ArrayIndexOutOfBoundsException(\"Exception: tried to set value of BitArray that was out of bounds: \" + loc + \". Size was \" + this.size);\n\t\t}\n\t}",
"public void xor(FormatableBitSet otherBit)\n \t{\n \t\tif (otherBit == null) {\n \t\t\treturn;\n \t\t}\n \t\tint otherLength = otherBit.getLength();\n \t\tif (otherLength > getLength()) {\n \t\t\tgrow(otherLength);\n \t\t}\n \n \t\tint obByteLen = otherBit.getLengthInBytes();\n \t\tfor (int i = 0; i < obByteLen; ++i) {\n \t\t\tvalue[i] ^= otherBit.value[i];\n \t\t}\n \t\tif (SanityManager.DEBUG) {\n \t\t\tSanityManager.ASSERT(invariantHolds(),\"xor() broke invariant\");\n \t\t}\n \t}",
"private static void writeByte(boolean rs, int data) {\n int highData = ((data >>> NIBBLE_SIZE) & NIBBLE_MASK); //Parte Alta do data\n int lowData = (data & NIBBLE_MASK); //Parte Baixa do data\n writeNibble(rs,highData);\n writeNibble(rs,lowData);\n Time.sleep(WRITEBYTE_SLEEP_TIME);\n }",
"public void setZero() {\n\t\tset((byte) (get() | (1 << 7)));\n\t}",
"public static int _setBit(final int originalInt,final int bitIndex) {\n return originalInt | _getMask(bitIndex);\n }",
"public void setFlag( int flag )\n {\n value |= 1 << flag;\n setBit( flag );\n }",
"public void setFlag(int flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeInt(__io__address + 20, flag);\n\t\t} else {\n\t\t\t__io__block.writeInt(__io__address + 12, flag);\n\t\t}\n\t}",
"public Builder then(Tribit bit){\n Objects.requireNonNull(bit);\n MathUtils.assertInRange(this.cursor, 0, LENGTH - 1);\n bits[this.cursor] = bit;\n this.cursor += 1;\n return this;\n }",
"public UnmodifiableBitSet setBit(int i){\n\t\tUnmodifiableBitSet nbs = (UnmodifiableBitSet)this.clone();\n\t\tnbs.setBitInn(i);\n\t\treturn nbs;\n\t}",
"public void set()\n\t{\n\t\tbitHolder.setValue(1);\n\t}",
"public void setFlag(int flag) throws IOException\n\t{\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__io__block.writeInt(__io__address + 4, flag);\n\t\t} else {\n\t\t\t__io__block.writeInt(__io__address + 4, flag);\n\t\t}\n\t}",
"public static int getBit(byte input,int position){\n return (input >> position) & 1;\n }",
"@Override\n\tpublic void write(int value) {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\tCpuMem.getInstance().writeMem(address, value);\n\t}",
"void setCollideBits (long bits);",
"void writeByte(int v) throws IOException;",
"public void write( int b ) throws IOException {\n\t\tthis.oneBuf[0] = (byte) b;\n\t\tthis.write( this.oneBuf, 0, 1 );\n\t\t}",
"private void writeByteAt(int pos, int val) {\n dest[pos] = (byte) val;\n }",
"public synchronized void write(final int b) throws IOException {\n\t\tthis.singleIntArray[0] = (byte) (0xFF & b);\n\t\twrite(singleIntArray, 0, 1);\n\t}",
"public static byte setSpecifiedBitToReverse(byte originByte, int bitIndex) {\n return originByte ^= (1 << bitIndex);\n }",
"public int bitAt(int i) {\n // PUT YOUR CODE HERE\n }",
"public int setBit(int i, int j){\n return (i|(1<<j));\n }",
"public void set(final int i) {\n\t\tint wordPos;\n\t\tint bitPos = 0;\n\t\tint offset;\n\n\t\tassert (i >= 0);\n\n\t\t// try simple set (append style)\n\t\tif (fastSet(i))\n\t\t\treturn;\n\n\t\t// simple set failed. Find compressed word where to set the bit\n\t\tRunningLengthWord rlw = null, prev = null, next = null;\n\n\t\tEWAHIterator iter = new EWAHIterator(this.buffer, actualsizeinwords);\n\t\twhile (iter.hasNext() && (bitPos < i || bitPos == 0)) {\n\t\t\tif (rlw != null)\n\t\t\t\tprev = new RunningLengthWord(rlw);\n\t\t\trlw = iter.next();\n\t\t\tbitPos += rlw.size() * wordinbits;\n\t\t}\n\t\tif (iter.hasNext())\n\t\t\tnext = rlw.getNext();\n\n\t\tbitPos -= rlw.size() * 64;\n\t\toffset = i - bitPos;\n\t\twordPos = rlw.position;\n\n\t\t// the bit to set is in a literal word. Try to set bit directly\n\t\tif (offset >= rlw.getRunningLength() * 64) {\n\t\t\toffset -= rlw.getRunningLength() * 64;\n\t\t\tint literalPos = (offset / 64);\n\t\t\twordPos += literalPos + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\t\t\tthis.buffer[wordPos] = this.buffer[wordPos] | newdata;\n\t\t\t// if all bits of literal set, then either merge with run length\n\t\t\t// or create new RLW.\n\t\t\tif (this.buffer[wordPos] == oneMask) {\n\t\t\t\t// first literal of current RLW and running bit is set\n\t\t\t\t// increase count by one (unless maximal count reached)\n\t\t\t\tif (literalPos == 0\n\t\t\t\t\t\t&& (rlw.getRunningBit() || rlw.getRunningLength() == 0)\n\t\t\t\t\t\t&& rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\trlw.setRunningBit(true);\n\t\t\t\t\trlw.setRunningLength(rlw.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following RLW\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() + rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tif (rlw.equals(this.rlw))\n\t\t\t\t\t\t\tthis.rlw.position = next.position;\n\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t}\n\t\t\t\t\t// merging doesn't work because of size\n\t\t\t\t\t// else just reduce length of rlw by 1\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t}\n\t\t\t\t// if last word increase following running length count if\n\t\t\t\t// possible\n\t\t\t\telse if (next != null\n\t\t\t\t\t\t&& next.getRunningLength() \n\t\t\t\t\t\t\t\t< RunningLengthWord.largestrunninglengthcount\n\t\t\t\t\t\t&& (next.getRunningLength() == 0 || next\n\t\t\t\t\t\t\t\t.getRunningBit())\n\t\t\t\t\t\t&& literalPos == rlw.getNumberOfLiteralWords() - 1) {\n\t\t\t\t\tnext.setRunningBit(true);\n\t\t\t\t\tnext.setRunningLength(next.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()) {\n\t\t\t\t\t\tlong totalRunLen = next.getRunningLength() + rlw.getRunningLength(); \n\t\t\t\t\t\t\n\t\t\t\t\t\t// merging into next possible?\n\t\t\t\t\t\tif (totalRunLen < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// run length to large, move run length from next to current\n\t\t\t\t\t\t// and shift next one to the left\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\trlw.setRunningLength(RunningLengthWord.\n\t\t\t\t\t\t\t\t\tlargestrunninglengthcount);\n\t\t\t\t\t\t\tnext.setRunningLength(totalRunLen - RunningLengthWord\n\t\t\t\t\t\t\t\t\t.largestrunninglengthcount);\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// remove RLW\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(\n\t\t\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t\t\t\t+ 2, 1);\n\t\t\t\t}\n\t\t\t\t// cannot merge, have to create new RLW and adapt literal count\n\t\t\t\t// of current RLW\n\t\t\t\telse {\n\t\t\t\t\tint beforeLit = literalPos;\n\t\t\t\t\tint afterLit =\n\t\t\t\t\t\t\trlw.getNumberOfLiteralWords() - literalPos - 1;\n\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split into \" + beforeLit + \" and \" + afterLit);};\n\n\t\t\t\t\tRunningLengthWord newRlw = new RunningLengthWord(rlw);\n\t\t\t\t\tnewRlw.position += literalPos + 1;\n\t\t\t\t\tnewRlw.setRunningBit(true);\n\t\t\t\t\tnewRlw.setRunningLength(1L);\n\t\t\t\t\tnewRlw.setNumberOfLiteralWords(afterLit);\n\n\t\t\t\t\trlw.setNumberOfLiteralWords(beforeLit);\n\n\t\t\t\t\t// if next one is full running length 1's we have to switch\n\t\t\t\t\t// running lengths\n\t\t\t\t\tif (next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() == RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tnext.setRunningLength(1L);\n\t\t\t\t\t\tnewRlw.setRunningLength(RunningLengthWord.largestrunninglengthcount);\n\t\t\t\t\t}\n\n\t\t\t\t\t// we split the last word, adapt it\n\t\t\t\t\tif (rlw.position == this.rlw.position)\n\t\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split because new 1's run\");};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// bit is in a clean word, if it is a '1' sequence we are fine\n\t\telse if (rlw.getRunningBit()) {\n\t\t\treturn;\n\t\t}\n\t\t// bit to set is in '0' clean word. We have to split this clean word and\n\t\t// shift following words in the buffer.\n\t\t// We do this by adding a new RLW y after the RLW x which has to be\n\t\t// split. This new RWL y takes over all the\n\t\t// literal words of x and encodes the part of the 0 sequence that\n\t\t// follows the bit we want to set. RWL x's\n\t\t// run length is reduced and we add the new bit as the new single\n\t\t// literal word for x.\n\t\telse {\n\t\t\tlong zeroRunLen = rlw.getRunningLength();\n\t\t\tlong newRunLen = offset / 64;\n\t\t\tlong afterRunLen = ((zeroRunLen * 64 - 63) / 64) - newRunLen;\n\t\t\tlong newNumLiterals = rlw.getNumberOfLiteralWords() + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\n\t\t\t// no preceeding and following run length.\n\t\t\t// CASE 1) Try to merge with preceeding or following RLW.\n\t\t\tif (newRunLen == 0 && afterRunLen == 0) {\n\t\t\t\t// merge with previous if exists and possible\n\t\t\t\tif (prev != null\n\t\t\t\t\t\t&& prev.getNumberOfLiteralWords() + newNumLiterals <= RunningLengthWord.largestliteralcount) {\n\t\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t+ newNumLiterals);\n\t\t\t\t\tthis.buffer[rlw.position] = newdata;\n\n\t\t\t\t\tif (this.rlw.equals(rlw))\n\t\t\t\t\t\tthis.rlw = prev;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// No merging possible!\n\t\t\t// CASE 2) if previous run length = 0 then add new literal into\n\t\t\t// previous if previous still has space\n\t\t\tif (newRunLen == 0\n\t\t\t\t\t&& prev != null\n\t\t\t\t\t&& prev.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(afterRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position, 1);\n\t\t\t\tthis.buffer[prev.position + prev.getNumberOfLiteralWords()] =\n\t\t\t\t\t\tnewdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 3) No merging possible, if following run length = 0, then\n\t\t\t// try to extend R with the new literal.\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO rlw is full (literals) and next one has no running length\n\t\t\t// and is not full\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t& next != null\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount\n\t\t\t\t\t&& next.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setRunningLength(rlw.getRunningLength() - 1);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\trlw.array = this.buffer;\n\t\t\t\tnext.array = this.buffer;\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\t// switch next header with last literal\n\t\t\t\tlong temp = this.buffer[next.position + 1];\n\t\t\t\tthis.buffer[next.position + 1] = this.buffer[next.position];\n\t\t\t\tthis.buffer[next.position] = temp;\n\t\t\t\tnext.setNumberOfLiteralWords(next.getNumberOfLiteralWords() + 1);\n\n\t\t\t\tif (next.position + 1 == this.rlw.position)\n\t\t\t\t\tthis.rlw.position = next.position;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 4) no extension possible. Have to SPLIT the zero sequence\n\t\t\t// and create new RLW\n\t\t\t// new RLW only gets a single literal\n\t\t\tif (afterRunLen == 0) {\n\t\t\t\tassert (rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount);\n\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tshiftCompressedWordsRight(\n\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords() + 1, 1);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, rlw.position\n\t\t\t\t\t\t\t\t+ rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(1L);\n\t\t\t\tnewRlw.setRunningLength(0);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t\t// new RLW also gets run length\n\t\t\telse {\n\t\t\t\tshiftCompressedWordsRight(wordPos + 1, 2);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, wordPos + 2);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords());\n\t\t\t\tnewRlw.setRunningLength(afterRunLen);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\trlw.setNumberOfLiteralWords(1);\n\n\t\t\t\tthis.buffer[wordPos + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t}\n\t}",
"int getBitAsInt(int index);",
"public static int setFlag(final int intValue, Bits bit, final boolean condition) {\n if (condition) {\n return intValue | bit.getMask();\n } else {\n return intValue & ~bit.getMask();\n }\n }",
"public void write(int b) throws IOException;",
"public static byte setFlag(byte field, int pos, boolean value) {\n if(pos < 1 || pos > 8) {\n throw new IllegalArgumentException(\"Pos value is not defined between 1 and 8\");\n }\n\n short flag = (short) Math.pow(2, (pos-1));\n\n if(value) {\n field |= flag;\n } else {\n field &= ~flag;\n }\n return field;\n }",
"private static int setBit(int ci, int bo, int newBit) {\n int clearMask = ~(1 << bo);\n int ciWithBitCleared = ci & clearMask;\n int bitMask = newBit << bo;\n int xiWithNewBitSet = ciWithBitCleared | bitMask;\n return xiWithNewBitSet;\n }",
"@Override\n public void write(int oneByte) throws IOException {\n currentRead++;\n if (currentRead % callback.interval() == 0) {\n callback.callback(currentRead);\n }\n outstream.write(oneByte);\n }",
"public void setByte(int offset, byte data)\n {\n writeMode(offset + 0xA0000, data);\n }",
"public void flip(int bitIndex);",
"private void write(SidRegisterAddress reg) {\n\t\to.reg(reg).write(UnsignedByte.x01);\n\t}",
"int setShort(int num, int a_short, int which)\n {\n return ((num & (0b1111111111111111 << ((~which) << 4))) | (a_short << (which << 4)));\n }",
"void shiftAndAddToRight(BitField fieldToAddToTheRight);",
"public static int flipBit(int value, int bitIndex) {\n\n// value = value ^ (1<<(bitIndex-1));\n\n return value ^ (1<<(bitIndex-1)); // put your implementation here\n }",
"private EfficientTerminalSet setBit(int index, boolean value) {\n int[] newData = data.clone();\n int blockIndex = index / 32;\n int bitIndex = index % 32;\n if (value)\n newData[blockIndex] |= 1 << bitIndex;\n else\n newData[blockIndex] &= ~(1 << bitIndex);\n return new EfficientTerminalSet(terminals, indices, newData);\n }",
"protected void clearBitAt(final int bitIndex) {\n _bitMap = _clearBit(_bitMap,\n \t\t\t\t\t(Numbers.INTEGER_WIDTH*8-1)-bitIndex-1);\n }",
"public abstract void writeByte(byte b) throws IOException;",
"void bytesRealWriteFlowControl(long write)\r\n/* 179: */ {\r\n/* 180:355 */ this.realWrittenBytes.addAndGet(write);\r\n/* 181: */ }",
"public void writeByte(int value)\n throws java.io.IOException {\n\n outputStream.writeByte(value);\n }",
"public Builder set(int position, Tribit bit){\n Objects.requireNonNull(bit);\n MathUtils.assertInRange(position, 0, LENGTH - 1);\n bits[position] = bit;\n this.cursor = position + 1;\n return this;\n }",
"BinaryArrayReadWrite set(int index, byte x);",
"public void and(FormatableBitSet otherBit)\n \t{\n \t\tif (otherBit == null) {\n \t\t\tclear();\n \t\t\treturn;\n \t\t}\n \t\tint otherLength = otherBit.getLength();\n \n \t\tif (otherLength > getLength()) {\n \t\t\tgrow(otherLength);\n \t\t}\n \n \t\t// Since this bitset is at least as large as the other bitset,\n \t\t// one can use the length of the other bitset in the iteration\n \t\tint byteLength = otherBit.getLengthInBytes();\n \t\tint i = 0;\n \t\tfor (; i < byteLength; ++i) {\n \t\t\tvalue[i] &= otherBit.value[i];\n \t\t}\n \n \t\t// If the other bitset is shorter the excess bytes in this\n \t\t// bitset must be cleared\n \t\tbyteLength = getLengthInBytes();\n \t\tfor (; i < byteLength; ++i) {\n \t\t\tvalue[i] = 0;\n \t\t}\n \t\tif (SanityManager.DEBUG) {\n \t\t\tSanityManager.ASSERT(invariantHolds(),\"and() broke invariant\");\n \t\t}\n \t}",
"public ByteBuf writeByte(int value)\r\n/* 533: */ {\r\n/* 534:544 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 535:545 */ return super.writeByte(value);\r\n/* 536: */ }",
"public static int bitSetter1(int x, int k) {\n\t\tint bitSetter = 1 << k;\n\t\tx = x | bitSetter;\n\t\treturn x; // x's kth bit\n\t}",
"public void port_SET(char src)\n { set_bytes((char)(src) & -1L, 1, data, 20); }",
"public void port_SET(char src)\n { set_bytes((char)(src) & -1L, 1, data, 20); }",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"public static byte swap(final byte byte_, final byte bit_position_0, final byte bit_position_1) throws BitException\n\t{\n\t\tfinal byte byte_length = (byte) Integer.toBinaryString(byte_).length();\n\t\tfinal byte byte_index_length = 7, byte_index_start = 0;\n\t\n\t\tif ((bit_position_0 > byte_index_length) || (bit_position_1 > byte_index_length) || (bit_position_0 >= byte_length) || (bit_position_1 >= byte_length))\n\t\t\tthrow new BitException(ExceptionType.GREATER_THAN_LENGTH);\n\t\telse if ((bit_position_0 < byte_index_start) || (bit_position_1 < byte_index_start))\n\t\t\tthrow new BitException(ExceptionType.NEGATIVE_INDEX);\n\n\t\tfinal byte bit_0 = (byte) ((byte_ >> bit_position_0) & BIT_ONE_),\n\t\t\t\tbit_1 = (byte) (((byte_ >> bit_position_1) & BIT_ONE_));\n\n\t\t// Check if Bits are the same...\n\t\tif (bit_0 == bit_1)\n\t\t\treturn byte_; \n\t\t\n\t\t// Create Mask \n\t\tfinal byte mask = (byte) ((BIT_ONE_ << bit_position_0) | (BIT_ONE_ << bit_position_1));\n\t\t\n\t\t// XOR (^)\n\t\treturn (byte) (byte_ ^ mask);\n\t}",
"@Override\r\n\tpublic Buffer setUnsignedByte(int pos, short b) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"public void writeBits (final int aValue, @Nonnegative final int nNumBits) throws IOException\n {\n ValueEnforcer.isBetweenInclusive (nNumBits, \"NumberOfBits\", 1, CGlobal.BITS_PER_INT);\n\n for (int i = nNumBits - 1; i >= 0; i--)\n writeBit ((aValue >> i) & 1);\n }",
"public void flush () throws IOException\n {\n if (m_nBufferedBitCount > 0)\n {\n if (m_nBufferedBitCount != CGlobal.BITS_PER_BYTE)\n if (LOGGER.isDebugEnabled ())\n LOGGER.debug (\"Flushing BitOutputStream with only \" + m_nBufferedBitCount + \" bits\");\n m_aOS.write ((byte) m_nBuffer);\n m_nBufferedBitCount = 0;\n m_nBuffer = 0;\n }\n }",
"public void param_index_SET(short src)\n { set_bytes((short)(src) & -1L, 2, data, 2); }",
"public void digitalWrite(int pin, byte value) { // pack this bit into..\r\n int portNumber = (pin >> 3) & 0x0F; // ..8-bit port & send to Ardu\r\n int digiData = digitalOutputData[portNumber & MDB_msk];\r\n if (SpeakEasy){\r\n System.out.println(\"F%%F/digiWrite #\" + pin + \" = \" + value);\r\n }\r\n if ((int) value == 0){\r\n digiData = digiData & ~(1 << (pin & 7));\r\n } else {\r\n digiData = digiData | (1 << (pin & 7));\r\n }\r\n digitalOutputData[portNumber & MDB_msk] = digiData;\r\n Send3bytes(DIGITAL_MESSAGE | portNumber, digiData, -1);\r\n }",
"public int writeByte(byte src) {\n try {\n out.write(src);\n return 0;\n } catch (IOException e) {\n print(\"Error writing byte to \" + portName);\n }\n return -1;\n }",
"private int bitToInt(char bit) {\n return bit == '0' ? 0 : 1;\n }",
"static int toggleBit(int n){\n return n & (n-1);\n }",
"public void update(int[] bit, int val, int index) {\n index = index + 1;\n while (index < bit.length) {\n bit[index] += val;\n index = getNext(index);\n }\n }",
"public void clearFlag( int flag )\n {\n value &= ~( 1 << ( MAX_SIZE - 1 - flag ) );\n }",
"public static long setByte(long field, int pos, short value) {\n if(pos < 1 || pos > 8) {\n throw new IllegalArgumentException(\"Pos value is not defined between 1 and 8\");\n }\n\n switch(pos) {\n case 1:\n field = field & 0xFFFFFFFFFFFFFF00l;\n break;\n case 2:\n field = field & 0xFFFFFFFFFFFF00FFl;\n break;\n case 3:\n field = field & 0xFFFFFFFFFF00FFFFl;\n break;\n case 4:\n field = field & 0xFFFFFFFF00FFFFFFl;\n break;\n case 5:\n field = field & 0xFFFFFF00FFFFFFFFl;\n break;\n case 6:\n field = field & 0xFFFF00FFFFFFFFFFl;\n break;\n case 7:\n field = field & 0xFF00FFFFFFFFFFFFl;\n break;\n case 8:\n field = field & 0x00FFFFFFFFFFFFFFl;\n break;\n }\n\n return (field | (((long) value) << (8* (pos-1))));\n }"
] | [
"0.67619824",
"0.66734457",
"0.6549754",
"0.5920091",
"0.58962345",
"0.5832882",
"0.5810696",
"0.5718157",
"0.56783503",
"0.56464",
"0.56394243",
"0.56256986",
"0.56008834",
"0.5469816",
"0.5432446",
"0.54237586",
"0.54222345",
"0.53814626",
"0.5349431",
"0.5333035",
"0.53156406",
"0.5297179",
"0.5288788",
"0.5236161",
"0.5209711",
"0.51870227",
"0.5184446",
"0.51694024",
"0.51681125",
"0.51551616",
"0.5135278",
"0.5130932",
"0.51272476",
"0.51244324",
"0.50653535",
"0.5063982",
"0.5057116",
"0.5041923",
"0.5040699",
"0.50345904",
"0.4991351",
"0.49863368",
"0.4960268",
"0.49507704",
"0.49355495",
"0.49296647",
"0.49260515",
"0.49257",
"0.49092394",
"0.490216",
"0.490213",
"0.48871604",
"0.48801836",
"0.48677528",
"0.48642805",
"0.48641035",
"0.4861218",
"0.4856268",
"0.48551726",
"0.4842965",
"0.48359305",
"0.48079348",
"0.48030818",
"0.47933772",
"0.4791186",
"0.47878334",
"0.47687152",
"0.47447875",
"0.47433472",
"0.47413534",
"0.474024",
"0.47384673",
"0.4735262",
"0.47293457",
"0.47127104",
"0.4685676",
"0.46796945",
"0.4675816",
"0.46724498",
"0.46660653",
"0.46660593",
"0.46622255",
"0.4653601",
"0.4648468",
"0.46453685",
"0.46453685",
"0.46358147",
"0.46249822",
"0.46248767",
"0.46224332",
"0.46168172",
"0.46160176",
"0.46131253",
"0.46099558",
"0.46094725",
"0.4598772",
"0.4586037",
"0.458382",
"0.4579686",
"0.4576461"
] | 0.71956515 | 0 |
Writes a sequence of bits, given by the numBits least significant bits of the bits argument in lefttoright order, to the stream at the current bit offset within the current byte position. The upper 64 numBits bits of the argument are ignored. The bit offset is advanced by numBits and reduced modulo 8. Note that a bit offset of 0 always indicates the mostsignificant bit of the byte, and bytes of bits are written out in sequence as they are encountered. Thus bit writes are always effectively in network byte order. The actual stream byte order setting is ignored. Bit data may be accumulated in memory indefinitely, until flushBefore is called. At that time, all bit data prior to the flushed position will be written. If any bits of a particular byte have never been set at the time the byte is flushed to the destination, those bits will be set to 0 automatically. | void writeBits(long bits, int numBits) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void writeBits (final int aValue, @Nonnegative final int nNumBits) throws IOException\n {\n ValueEnforcer.isBetweenInclusive (nNumBits, \"NumberOfBits\", 1, CGlobal.BITS_PER_INT);\n\n for (int i = nNumBits - 1; i >= 0; i--)\n writeBit ((aValue >> i) & 1);\n }",
"public void writeBit (final int aBit) throws IOException\n {\n if (m_aOS == null)\n throw new IllegalStateException (\"BitOutputStream is already closed\");\n if (aBit != CGlobal.BIT_NOT_SET && aBit != CGlobal.BIT_SET)\n throw new IllegalArgumentException (aBit + \" is not a bit\");\n\n if (aBit == CGlobal.BIT_SET)\n if (m_bHighOrderBitFirst)\n m_nBuffer |= (aBit << (7 - m_nBufferedBitCount));\n else\n m_nBuffer |= (aBit << m_nBufferedBitCount);\n\n ++m_nBufferedBitCount;\n if (m_nBufferedBitCount == CGlobal.BITS_PER_BYTE)\n flush ();\n }",
"public void writeBit(int bit) {\n if (bit < 0 || bit > 1)\n throw new IllegalArgumentException(\"Illegal bit: \" + bit);\n digits += bit << numDigits;\n numDigits++;\n if (numDigits == this.byteSize) {\n flush();\n }\n }",
"void writeBit(int bit) throws IOException;",
"public void flush () throws IOException\n {\n if (m_nBufferedBitCount > 0)\n {\n if (m_nBufferedBitCount != CGlobal.BITS_PER_BYTE)\n if (LOGGER.isDebugEnabled ())\n LOGGER.debug (\"Flushing BitOutputStream with only \" + m_nBufferedBitCount + \" bits\");\n m_aOS.write ((byte) m_nBuffer);\n m_nBufferedBitCount = 0;\n m_nBuffer = 0;\n }\n }",
"private static int writeBits(byte[] bytes, int value, int pos, int len) {\n assert(value > 0 && pos + len <= bytes.length * 8);\n int ind = pos / 8;\n int lastPos = 0;\n for (int i = 0; i < len; i++) {\n int bi = (pos + i) % 8;\n if ((value & (1 << (len - i - 1))) != 0) {\n bytes[ind] |= 1 << (7 - bi);\n lastPos = pos + i;\n }\n if (bi == 7) {\n ind++;\n }\n }\n return lastPos;\n }",
"private static int getRightShiftedNumberBufAsInt(int numberBuf,\n long bitPos, int nrBits, ByteOrder byteOrder) throws BitBufferException {\n\n // number of bits integer buffer needs to be shifted to the right in\n // order to reach the last bit in last byte\n long shiftBits;\n if (byteOrder == ByteOrder.BigEndian)\n shiftBits = 7 - ((nrBits + bitPos + 7) % 8);\n else\n shiftBits = bitPos % 8;\n\n return numberBuf >> shiftBits;\n }",
"void setCollideBits (long bits);",
"public OurIntegerCanPayloadTranslator(WriteableCanMailbox payload, int numBits, boolean signed) {\n super(payload, (numBits + 7)/8);\n this.numBits = numBits;\n this.signed = signed;\n }",
"private static long getRightShiftedNumberBufAsLong(long numberBuf,\n long bitPos, int nrBits, ByteOrder byteOrder) throws BitBufferException {\n\n // number of bits integer buffer needs to be shifted to the right in\n // order to reach the last bit in last byte\n long shiftBits;\n if (byteOrder == ByteOrder.BigEndian)\n shiftBits = 7 - ((nrBits + bitPos + 7) % 8);\n else\n shiftBits = bitPos % 8;\n\n return numberBuf >> shiftBits;\n }",
"public FormatableBitSet(int numBits)\n \t{\n \t\tinitializeBits(numBits);\n \t}",
"private static int getNrNecessaryBytes(long bitPos, int nrBits) {\n return (int) (((bitPos % 8) + nrBits + 7) / 8);\n }",
"private static int numBytesFromBits(int bits) {\n \t\treturn (bits + 7) >> 3;\n \t}",
"public static void writeBit(int[][] matrix, int col, int row, boolean bit, int mask) {\n matrix[col][row] = maskColor(col, row, bit, mask);\n }",
"private void doClipWrite(byte b[], int off, int len) {\n\t\tif (count + len <= maxOutputSize) { // won't overflow\n\t\t\tthis.writeDirectly(b, off, len);\n\t\t} else {\n\t\t\tint discardBytes = len + count - maxOutputSize;\n\t\t\tif (len >= maxOutputSize) {\n\t\t\t\treset();\n\t\t\t\tthis.writeDirectly(b, off + len - maxOutputSize, maxOutputSize);\n\t\t\t} else {\n\t\t\t\tint shiftStart = count - maxOutputSize + len;\n\t\t\t\tint remaining = maxOutputSize - len;\n\t\t\t\tSystem.arraycopy(buf, shiftStart, buf, 0, remaining);\n\t\t\t\tcount = remaining;\n\t\t\t\tthis.writeDirectly(b, off, len);\n\t\t\t}\n\t\t\tclipNum ++;\n\t\t\tSystem.out.println(String.format(\"Overflow count: %d, discarded bytes number: %d\", clipNum,\n\t\t\t\t\tdiscardBytes));\n\t\t\t\n\t\t}\n\n\t}",
"public void write(int b) \r\n {\r\n \tint newcount = count + 1;\r\n \tif (newcount > buf.length) \r\n \t{\r\n \t\tbyte newbuf[] = new byte[Math.max(buf.length << 1, newcount)];\r\n \t\tSystem.arraycopy(buf, 0, newbuf, 0, count);\r\n \t\tbuf = newbuf;\r\n \t}\r\n \tbuf[count] = (byte)b;\r\n \tcount = newcount;\r\n }",
"public void write(short[] buffer, int offset, int bufLen) throws IOException {\n for(int i = offset; i< offset + bufLen; i++) {\n byte b1 = (byte) (buffer[i] & 0xFF);\n byte b2 = (byte) (buffer[i] >> 8);\n // Log.d(\"PHILIP\", \"writing \" + b1);\n mOutputStream.write(b1);\n // Log.d(\"PHILIP\", \"writing \" + b2);\n mOutputStream.write(b2);\n }\n }",
"public NonBlockingBitOutputStream (@Nonnull final OutputStream aOS, @Nonnull final ByteOrder aByteOrder)\n {\n ValueEnforcer.notNull (aOS, \"OutputStream\");\n ValueEnforcer.notNull (aByteOrder, \"ByteOrder\");\n\n m_aOS = aOS;\n m_bHighOrderBitFirst = aByteOrder.equals (ByteOrder.LITTLE_ENDIAN);\n m_nBufferedBitCount = 0;\n }",
"private static short\n \tnumBitsInLastByte(int bits)\n \t{\n \t\tint modulo = bits % 8;\n \t\treturn (short)((modulo == 0) ?\n \t\t\t\t((bits == 0) ? 0 : 8) :\n \t\t\t\tmodulo);\n \t}",
"public interface BitOutput {\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a 1-bit boolean value. This method writes {@code 0b1} for {@code true}\n\t * and {@code 0b0} for {@code false}.\n\t *\n\t * @param value the value to write.\n\t * @throws IOException if an I/O error occurs\n\t */\n\tvoid writeBoolean( boolean value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a {@code byte} value.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 7 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeByte( boolean unsigned, int size, byte value ) throws IOException;\n\n\t/**\n\t * Writes a {@code short} value.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 15 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeShort( boolean unsigned, int size, short value ) throws IOException;\n\n\t/**\n\t * Writes an {@code int} value. Only the lower specified number of bits are\n\t * written.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of bits for value; between {@code 1} and\n\t * {@code 31 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeInt( boolean unsigned, int size, int value ) throws IOException;\n\n\t/**\n\t * Writes a {@code long} value. Only the lower specified number of bits are\n\t * written.\n\t *\n\t * @param unsigned a flag for indicating unsigned value; {@code true} for\n\t * unsigned, {@code false} for signed.\n\t * @param size the number of valid bits for value; between {@code 1} and\n\t * {@code 63 + (unsigned ? 0 : 1)}, both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeLong( boolean unsigned, int size, long value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Writes a {@code char} value.\n\t *\n\t * @param size the number of bits for value; between {@code 1} and {@code 16},\n\t * both inclusive.\n\t * @param value the value to write\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tvoid writeChar( int size, char value ) throws IOException;\n\n\t// -----------------------------------------------------------------------------------------------------------------\n\n\t/**\n\t * Aligns to specified number of bytes by padding zero bits.\n\t *\n\t * @param bytes the number of bytes to align; must be positive.\n\t * @return the number of zero bits padded while aligning.\n\t * @throws IllegalArgumentException if {@code bytes} is less than or equals to\n\t * {@code 0}.\n\t * @throws IOException if an I/O error occurs.\n\t */\n\tlong align( int bytes ) throws IOException;\n}",
"public static String toPaddedBinaryString(BigInteger data, int numBits) {\n String binStr = UnsignedBigIntUtils.toBinaryString(data);\n binStr = RegExp.replaceFirst(\"0b\", binStr, \"\");\n StringBuilder sb = new StringBuilder();\n\n if (RegExp.isMatch(\"^0b\", binStr) == false) {\n sb.append(\"0b\");\n }\n\n if (numBits > binStr.length()) {\n for (int ii = numBits - binStr.length(); ii > 0; ii--) {\n sb.append('0');\n }\n }\n sb.append(binStr);\n return (sb.toString());\n }",
"public void setAverageBits(int bits) {\n }",
"void setCategoryBits (long bits);",
"public void setBitOffset(int bitOffset) {\r\n\t\tthis.bitOffset = bitOffset;\r\n\t}",
"@Override\n public void write(final int byteVal) throws IOException {\n write(new byte[] { (byte) (byteVal & 0xFF) });\n }",
"public OurIntegerCanPayloadTranslator(ReadableCanMailbox payload, int numBits, boolean signed) {\n super(payload, (numBits + 7)/8);\n this.numBits = numBits;\n this.signed = signed;\n }",
"void bytesRealWriteFlowControl(long write)\r\n/* 179: */ {\r\n/* 180:355 */ this.realWrittenBytes.addAndGet(write);\r\n/* 181: */ }",
"protected void setBit(long bitIndex) {\r\n\t long intIndex = (bitIndex >>> ADDRESS_BITS_PER_UNIT);\r\n\t bits[(int)(intIndex / ONE_MB_INTS)][(int)(intIndex % ONE_MB_INTS)] \r\n\t |= 1 << (bitIndex & BIT_INDEX_MASK);\r\n\t }",
"public int anySetBit(int beyondBit)\n \t{\n \t\tif (SanityManager.DEBUG)\n \t\t{\n \t\t\tif (beyondBit >= this.getLength())\n SanityManager.THROWASSERT(\n \"Attempt to access bit position that exceeds the max length (\"\n + this.getLength() + \")\");\n \t\t}\n \n \t\tint startingBit = (beyondBit+1);\n \n \t\t// we have seen the last bit.\n \t\tif (startingBit >= this.getLength())\n \t\t\treturn -1;\n \n \t\tint numbytes = getLengthInBytes();\n \t\tint startingByte = startingBit / 8;\n \t\tint startingBitpos = startingBit % 8;\n \t\tint bitpos;\n \t\tbyte mask;\n \n \t\t// see if any bits in this byte is set, only the bottom part of the\n \t\t// first byte is relevant\n \t\tmask = (byte)(0xFF >> startingBitpos);\n \n \t\tif (startingByte == numbytes-1)\t// starting byte == last byte \n \t\t\tmask &= (byte)(0xFF << (8-bitsInLastByte));\n \n \t\tif ((value[startingByte] & mask ) != 0)\n \t\t{\n \t\t\t// I know we will see the bit before bitsInLastByte even if we are\n \t\t\t// at the last byte, no harm in going up to 8 in the loop\n \t\t\tfor (int j = startingBitpos; j < 8; j++)\n \t\t\t{\n \t\t\t\tif (SanityManager.DEBUG)\n \t\t\t\t{\n \t\t\t\t\tif (startingByte == numbytes-1)\n \t\t\t\t\t\tSanityManager.ASSERT(j < bitsInLastByte,\n \t\t\t\t\t\t\t\t \"going beyond the last bit\");\n \t\t\t\t}\n \t\t\t\tbitpos = 7-j;\n \t\t\t\tif (((1 << bitpos) & value[startingByte]) != 0)\n \t\t\t\t{\n \t\t\t\t\treturn (startingByte*8+j);\n \t\t\t\t}\n \t\t\t}\t\n \t\t}\n \n \t\tfor (int i = (startingByte+1); i < numbytes-1; i++)\n \t\t{\t\t\t\n \t\t\tif (value[i] != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < 8; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[i]) != 0)\n \t\t\t\t\t{\n \t\t\t\t\t\treturn ((i*8)+j);\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t\n \t\t// Last byte if there are more than one bytes. Only the top part of\n \t\t// the last byte is relevant \n \t\tif (startingByte != numbytes-1)\n \t\t{\n \t\t\tmask = (byte)(0xFF << (8-bitsInLastByte));\n \n \t\t\tif ((value[numbytes-1] & mask) != 0)\n \t\t\t{\n \t\t\t\tfor (int j = 0; j < bitsInLastByte; j++)\n \t\t\t\t{\n \t\t\t\t\tbitpos = 7-j;\n \t\t\t\t\tif (((1 << bitpos) & value[numbytes-1]) != 0)\n \t\t\t\t\t{\n \t\t\t\t\t\treturn ((numbytes-1)*8)+j;\t\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn -1;\n \n \t}",
"private void byteOut(){\n if(nrOfWrittenBytes >= 0){\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else if(c < 0x8000000){\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=c>>>19;\n c &= 0x7FFFF;\n cT=8;\n }\n else{\n b++;\n if(b==0xFF){\n // Delay 0xFF byte\n delFF = true;\n c &= 0x7FFFFFF;\n b=c>>>20;\n c &= 0xFFFFF;\n cT=7;\n }\n else{\n // Write delayed 0xFF bytes\n if (delFF) {\n out.write(0xFF);\n delFF = false;\n nrOfWrittenBytes++;\n }\n out.write(b);\n nrOfWrittenBytes++;\n b=((c>>>19)&0xFF);\n c &= 0x7FFFF;\n cT=8;\n }\n }\n }\n else {\n // NOTE: carry bit can never be set if the byte buffer was empty\n b= (c>>>19);\n c &= 0x7FFFF;\n cT=8;\n nrOfWrittenBytes++;\n }\n }",
"public void write( OutputStream stream, short[] shorts, int offset, int numShorts ) throws IOException\n {\n int limit = offset + numShorts;\n\t\tfor( int i=offset; i<limit; i++ )\n\t\t{\n short sample = shorts[i];\n stream.write( sample >> 8 ); // high byte\n stream.write( sample ); // low byte\n\t\t}\n\t}",
"protected void setBitAt(final int bitIndex) {\n _bitMap = _setBit(_bitMap,\n \t\t\t\t (Numbers.INTEGER_WIDTH*8-1)-bitIndex-1);\n }",
"public void write(byte[] data, long offset);",
"@Override\r\n public synchronized void write(byte b[], int off, int len ) throws IOException {\r\n \tint avail = buf.length - count;\r\n\r\n \tif ( len <= avail ) {\r\n \t\tSystem.arraycopy( b, off, buf, count, len );\r\n \t\tcount += len;\r\n \t\treturn; // Over step to do flush()\r\n\t } else if ( len > avail ) {\r\n\t \tSystem.arraycopy( b, off, buf, count, avail);\r\n\t \tcount += avail;\r\n\t \tflush();\r\n\t \tSystem.arraycopy( b, avail, b, 0, (len-avail));\r\n\t \twrite(b, 0, (len-avail));\r\n\t } else {\r\n\t \twriteBuffer(b, off, len);\r\n\t }\r\n\t}",
"private static int mask(int bit) {\n return MSB >>> bit;\n }",
"public static int shiftmask(int bitwidth) {\n return bitwidth < 1 ? 0 : (1 << (32 - Integer.numberOfLeadingZeros(bitwidth - 1))) - 1;\n }",
"private void writeBytes() {\n\t\tint needToWrite = rawBytes.length - bytesWritten;\n\t\tint actualWrit = line.write(rawBytes, bytesWritten, needToWrite);\n\t\t// if the total written is not equal to how much we needed to write\n\t\t// then we need to remember where we were so that we don't read more\n\t\t// until we finished writing our entire rawBytes array.\n\t\tif (actualWrit != needToWrite) {\n\t\t\tCCSoundIO.debug(\"writeBytes: wrote \" + actualWrit + \" of \" + needToWrite);\n\t\t\tshouldRead = false;\n\t\t\tbytesWritten += actualWrit;\n\t\t} else {\n\t\t\t// if it all got written, we should continue reading\n\t\t\t// and we reset our bytesWritten value.\n\t\t\tshouldRead = true;\n\t\t\tbytesWritten = 0;\n\t\t}\n\t}",
"void bytesWriteFlowControl(long write)\r\n/* 173: */ {\r\n/* 174:344 */ this.currentWrittenBytes.addAndGet(write);\r\n/* 175:345 */ this.cumulativeWrittenBytes.addAndGet(write);\r\n/* 176: */ }",
"public static String toFormattedBinaryString(BigInteger data, int numBits) {\n //BigInteger.toString(radix) does not pad to full word sizes.\n String tmpStr = UnsignedBigIntUtils.toPaddedBinaryString(data, numBits);\n tmpStr = RegExp.replaceFirst(\"0b\", tmpStr, \"\");\n\n StringBuilder formattedBinaryString = new StringBuilder();\n\n if (RegExp.isMatch(\"^0b\", tmpStr) == false) {\n formattedBinaryString.append(\"0b\");\n }\n\n // If you modify anything in this loop, then you must modify tests.\n for (int ii = 0; ii < tmpStr.length(); ii++) {\n if (ii % 16 == 0 && ii != 0) {\n formattedBinaryString.append(\" | \");\n } else if (ii % 4 == 0 && ii != 0) {\n formattedBinaryString.append(\" \");\n }\n formattedBinaryString.append(tmpStr.charAt(ii));\n }\n\n tmpStr = formattedBinaryString.toString();\n\n return (tmpStr);\n }",
"private int setNibble(int num, int data, int which, int bitsToReplace) {\n return (num & ~(bitsToReplace << (which * 4)) | (data << (which * 4)));\n }",
"public static String writeBits(byte b) {\n\n StringBuffer stringBuffer = new StringBuffer();\n int bit = 0;\n\n for (int i = 7; i >= 0; i--) {\n\n bit = (b >>> i) & 0x01;\n stringBuffer.append(bit);\n\n }\n\n return stringBuffer.toString();\n\n }",
"private int writeBytesMultiple(ChannelOutboundBuffer in, ByteBuffer[] nioBuffers, int nioBufferCnt, long expectedWrittenBytes, long maxBytesPerGatheringWrite) throws IOException {\n/* 346 */ assert expectedWrittenBytes != 0L;\n/* 347 */ if (expectedWrittenBytes > maxBytesPerGatheringWrite) {\n/* 348 */ expectedWrittenBytes = maxBytesPerGatheringWrite;\n/* */ }\n/* */ \n/* 351 */ long localWrittenBytes = this.socket.writev(nioBuffers, 0, nioBufferCnt, expectedWrittenBytes);\n/* 352 */ if (localWrittenBytes > 0L) {\n/* 353 */ adjustMaxBytesPerGatheringWrite(expectedWrittenBytes, localWrittenBytes, maxBytesPerGatheringWrite);\n/* 354 */ in.removeBytes(localWrittenBytes);\n/* 355 */ return 1;\n/* */ } \n/* 357 */ return Integer.MAX_VALUE;\n/* */ }",
"public void setBit(int index, boolean bit)\n\t{\n\t\tif (index + 1 > bits.size()) bits.ensureCapacity(index + 1);\n\t\tbits.add(index, bit);\n\t}",
"public void grow(int n)\n \t{\n \t\tif (n <= this.getLength())\n \t\t\treturn;\n \n \t\tint delta = n - this.getLength();\n \n \n \t\tint oldNumBytes = getLengthInBytes();\n \n \t\t/*\n \t\t** If we have enough space in the left over bits,\n \t\t** then all we need to do is change the modulo.\n \t\t*/\n \t\tif ((oldNumBytes != 0) &&\n \t\t (8 - this.bitsInLastByte) >= delta)\n \t\t{\n \t\t\tthis.bitsInLastByte += delta;\n \t\t\tlengthAsBits = n;\n \t\t\treturn;\n \t\t}\n \n \t\tint newNumBytes = FormatableBitSet.numBytesFromBits(n);\n \n \t\t// is there enough room in the existing array\n \t\tif (newNumBytes <= value.length) {\n \t\t\t// ensure the bits are zeroed\n \t\t\tfor (int i = oldNumBytes; i < newNumBytes; i++)\n \t\t\t\tvalue[i] = 0;\n \t\t} else {\n \n \n \t\t\t/*\n \t\t\t** We didn't have enough bytes in value, so we need\n \t\t\t** to create a bigger byte array and use that.\n \t\t\t*/\n \t\t\tbyte[] newValue = new byte[newNumBytes];\n \n \t\t\tSystem.arraycopy(value, 0, newValue, 0, oldNumBytes);\n \n \t\t\tvalue = newValue;\n \t\t}\n \t\tbitsInLastByte = numBitsInLastByte(n);\n \t\tlengthAsBits = n;\n \t}",
"public void writeSamples( short[] samples, int offset, int numSamples );",
"public synchronized void write(final int b) throws IOException {\n\t\tthis.singleIntArray[0] = (byte) (0xFF & b);\n\t\twrite(singleIntArray, 0, 1);\n\t}",
"static void getIndexSetBits(int[] setBits, long board) {\n\t\tint onBits = 0;\n\t\twhile (board != 0) {\n\t\t\tsetBits[onBits] = Long.numberOfTrailingZeros(board);\n\t\t\tboard ^= (1L << setBits[onBits++]);\n\t\t}\n\t\tsetBits[onBits] = -1;\n\t}",
"public abstract void writeRange(int startElement, int count,\r\n ByteBuffer src, int offsetBytes, boolean bForward);",
"public void write(int b) throws IOException;",
"int nextBits(int bits);",
"public void write( int b ) throws IOException {\n\t\tthis.oneBuf[0] = (byte) b;\n\t\tthis.write( this.oneBuf, 0, 1 );\n\t\t}",
"public static String showLogicalBitStreamGrouped(final List<Boolean> bits)\n {\n if(null == bits) { throw new IllegalArgumentException(); }\n if(5 != (bits.size() % 9)) { throw new IllegalArgumentException(\"unexpected size \" + bits.size() + \" % 9 = \"+(bits.size() % 9)); }\n\n final StringBuilder sb = new StringBuilder(2 + bits.size());\n sb.append('H');\n\n // Do header up to first 1...\n int index;\n for(index = 0; !bits.get(index); ++index) { sb.append('0'); }\n sb.append('1'); ++index;\n\n // Do groups of 9 bits for each original byte plus parity...\n while((bits.size() - index) > 9)\n {\n sb.append('-');\n for(int i = 0; i < 9; ++i)\n { sb.append(bits.get(index++) ? '1' : '0'); }\n }\n\n // Trailer...\n sb.append('T');\n for( ; index < bits.size(); )\n { sb.append(bits.get(index++) ? '1' : '0'); }\n\n return(sb.toString());\n }",
"private static void testShift() {\n for (int a:new int[]{96754441, -206107026, 803362655, Integer.MIN_VALUE+1}) {\n System.out.println(\"<<\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a<<i) + \" \" + (a<<i));\n }\n System.out.println();\n System.out.println(\">>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>i) + \" \" + (a>>i));\n }\n System.out.println();\n System.out.println(\">>>\");\n for (int i=0;i<=32;i++) {\n System.out.println(intToBin(a>>>i) + \" \" + (a>>>i));\n }\n System.out.println();\n }\n }",
"public abstract void resetBytesWritten();",
"public static int offsetBits_counter() {\n return 8;\n }",
"protected void write(byte[] bytes, int offset, int length) {\n/* 114 */ if (this.socket == null) {\n/* 115 */ if (this.connector != null && !this.immediateFail) {\n/* 116 */ this.connector.latch();\n/* */ }\n/* 118 */ if (this.socket == null) {\n/* 119 */ String msg = \"Error writing to \" + getName() + \" socket not available\";\n/* 120 */ throw new AppenderLoggingException(msg);\n/* */ } \n/* */ } \n/* 123 */ synchronized (this) {\n/* */ try {\n/* 125 */ getOutputStream().write(bytes, offset, length);\n/* 126 */ } catch (IOException ex) {\n/* 127 */ if (this.retry && this.connector == null) {\n/* 128 */ this.connector = new Reconnector(this);\n/* 129 */ this.connector.setDaemon(true);\n/* 130 */ this.connector.setPriority(1);\n/* 131 */ this.connector.start();\n/* */ } \n/* 133 */ String msg = \"Error writing to \" + getName();\n/* 134 */ throw new AppenderLoggingException(msg, ex);\n/* */ } \n/* */ } \n/* */ }",
"private static int getMaskAsInt(int nrBits) {\n return 0xFFFFFFFF >>> (32 - nrBits);\n }",
"@Override\n public void write (byte[] b) throws IOException {\n byte currByte = b[b[0] + 1];\n int counter = 0;\n for (int i = 0; i < b[0] + 1; i++) {\n out.write(b[i]);\n }\n for (int i = b[0] + 1; i < b.length; i++) {\n if (currByte == 0 && b[i] == 1 || currByte == 1 && b[i] == 0) {\n if (counter <= 255) {\n out.write((byte) counter);\n } else {\n OutOfByteSize(counter);\n }\n counter = 1;\n currByte = b[i];\n } else {\n counter++;\n }\n }\n\n }",
"public void xor(FormatableBitSet otherBit)\n \t{\n \t\tif (otherBit == null) {\n \t\t\treturn;\n \t\t}\n \t\tint otherLength = otherBit.getLength();\n \t\tif (otherLength > getLength()) {\n \t\t\tgrow(otherLength);\n \t\t}\n \n \t\tint obByteLen = otherBit.getLengthInBytes();\n \t\tfor (int i = 0; i < obByteLen; ++i) {\n \t\t\tvalue[i] ^= otherBit.value[i];\n \t\t}\n \t\tif (SanityManager.DEBUG) {\n \t\t\tSanityManager.ASSERT(invariantHolds(),\"xor() broke invariant\");\n \t\t}\n \t}",
"public void setQuantizationBits(\r\n\t\t\t@UInt32 int bitsCount)\r\n\t\tthrows IllegalArgumentException;",
"public void write(int b) throws IOException {\n baos.write(b);\n }",
"@Override\n\tpublic void write(DataOutput out) throws IOException {\n\t\tout.writeInt(bytes);\n\t\tout.write(buffer);\t\t\n\t}",
"public void write(OutputBitStream stream, boolean hasColorTransform)\n throws IOException {\n stream.writeUnsignedBits(0, 2);\n stream.writeBooleanBit(hasBlendMode);\n stream.writeBooleanBit(hasFilters);\n stream.writeBooleanBit(hitState);\n stream.writeBooleanBit(downState);\n stream.writeBooleanBit(overState);\n stream.writeBooleanBit(upState);\n stream.writeUI16(characterId);\n stream.writeUI16(placeDepth);\n placeMatrix.write(stream);\n if (hasColorTransform) {\n if (colorTransform != null) {\n colorTransform.write(stream);\n } else {\n new CXformWithAlpha().write(stream);\n }\n }\n if (hasFilters) {\n Filter.writeFilters(filters, stream);\n }\n if (hasBlendMode) {\n stream.writeUI8(blendMode.getCode());\n }\n }",
"@Override\r\n\tpublic synchronized void write(int b)\r\n\t{\r\n\t}",
"public BinaryEncoder writeBytes(byte[] bytes) throws IOException {\n writeLong(bytes.length);\n output.write(bytes, 0, bytes.length);\n return this;\n }",
"public void setBit(int pos, int bit) {\r\n\t\tflagBits[pos] = bit;\r\n\t}",
"void shiftAndAddToRight(BitField fieldToAddToTheRight);",
"private DefaultBitBuffer(ByteBuffer inputByteBuffer, long bitBufBitSize,\n long bitPos) {\n this.byteBuffer = inputByteBuffer;\n this.bitBufBitSize = bitBufBitSize;\n this.bitPos = bitPos;\n }",
"public static byte set(byte value, int bit){\n return (byte)(value|(1<<bit));\n }",
"static void encodeInt(DataOutput os, int i) throws IOException {\n if (i >> 28 != 0)\n os.write((i >> 28) & 0x7f);\n if (i >> 21 != 0)\n os.write((i >> 21) & 0x7f);\n if (i >> 14 != 0)\n os.write((i >> 14) & 0x7f);\n if (i >> 7 != 0)\n os.write((i >> 7) & 0x7f);\n os.write((i & 0x7f) | (1 << 7));\n }",
"public void writeInt(int i) throws IOException {\n\t\tmBuffer[mBufferLength+3] = (byte) i;\n\t\tmBuffer[mBufferLength+2] = (byte) (i>>>8);\n\t\tmBuffer[mBufferLength+1] = (byte) (i>>>16);\n\t\tmBuffer[mBufferLength] = (byte) (i>>>24);\n\n\n\t\t\n\n\n\t\tmBufferLength += 4;\n\n\t\t// TODO: on the first filling of the buffer, flush when bufferLength+offset is at the end of a segment\n\t\tif (firstFill && ((mBufferLength >= firstFillThreshold))) {\n\t\t\tthis.flush();\n\t\t\tfirstFill = false;\n\t\t}\n\n\t\tif (mBufferLength == BUFFER_SIZE){\n\t\t\tthis.flush();\n\t\t}\n\t}",
"public void printWrite(MessageBitSection packet, int channel);",
"public static int offsetBits_dest() {\n return 0;\n }",
"public static int offsetBits_p_sendts() {\n return 40;\n }",
"void setBits(int... values);",
"public void write(int b) throws IOException\n {\n checkThreshold(1);\n getStream().write(b);\n written++;\n }",
"private static void writeNibbleParallel(boolean rs, int data) {\n if(rs) HAL.writeBits(NIBBLE_MASK_SIZE,0x10);\n else HAL.writeBits(NIBBLE_MASK_SIZE,0);\n HAL.writeBits(0x20,0x20);\n HAL.writeBits(NIBBLE_MASK,data);\n HAL.writeBits(0x20,0);\n }",
"public void write(int ints) {\n try {\n mOutStream.writeInt(ints);\n Log.i(\"TRANSFER\", \"wrote \" + ints);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void writeNonBlock(long l) {\n Timing.throughputLocal(0);\n writeEnable.setNow(1);\n writeData.setNow(l);\n Timing.waitClockLocal();\n }",
"public void write(long l) {\n while (isFull()) {\n }\n Timing.waitSyncLocal();\n writeEnable.setNow(1);\n writeData.setNow(l);\n Timing.waitClockLocal();\n }",
"static void primitiveLeftShift(int[] a, int len, int n) {\n if (len == 0 || n == 0)\n return;\n\n int n2 = 32 - n;\n for (int i=0, c=a[i], m=i+len-1; i < m; i++) {\n int b = c;\n c = a[i+1];\n a[i] = (b << n) | (c >>> n2);\n }\n a[len-1] <<= n;\n }",
"public static byte[] mask(byte[] ip, int maskbits)\n {\n int nrbytes=(maskbits+7)/8; // Upper(bits/8) \n int len=ip.length; \n \n for (int i=0;i<nrbytes;i++)\n {\n int mask=0; \n // first byte, start with lowest byte (last one)\n if (maskbits>=8)\n mask=0x0000; // erase network bits \n else\n {\n mask=(0x0001<<maskbits)-1; // 0xffff....\n mask=0x00ff-(mask&0x00ff); // reverse mask; \n }\n \n ip[len-i-1]=(byte)(ip[len-i-1]&mask);\n maskbits-=8; // next byte \n }\n \n return ip; \n }",
"private void writeInMemoryData() throws IOException {\n out.write(totalBitsInChunk);\n\n /* write chunk of bytes itself */\n out.write(chunk, 0, chunkIndex < chunk.length ? chunkIndex + 1 : chunkIndex);\n out.flush();\n\n zeroChunk();\n }",
"private static int[] leftShift(int[] a, int len, int n) {\n int nInts = n >>> 5;\n int nBits = n&0x1F;\n int bitsInHighWord = bitLengthForInt(a[0]);\n\n // If shift can be done without recopy, do so\n if (n <= (32-bitsInHighWord)) {\n primitiveLeftShift(a, len, nBits);\n return a;\n } else { // Array must be resized\n if (nBits <= (32-bitsInHighWord)) {\n int result[] = new int[nInts+len];\n System.arraycopy(a, 0, result, 0, len);\n primitiveLeftShift(result, result.length, nBits);\n return result;\n } else {\n int result[] = new int[nInts+len+1];\n System.arraycopy(a, 0, result, 0, len);\n primitiveRightShift(result, result.length, 32 - nBits);\n return result;\n }\n }\n }",
"public void copyBytes(DataInput input, long numBytes) throws IOException {\n\t\tassert numBytes >= 0 : \"numBytes=\" + numBytes;\n\t\tlong left = numBytes;\n\t\tif (copyBuffer == null)\n\t\t\tcopyBuffer = new byte[COPY_BUFFER_SIZE];\n\t\twhile (left > 0) {\n\t\t\tfinal int toCopy;\n\t\t\tif (left > COPY_BUFFER_SIZE)\n\t\t\t\ttoCopy = COPY_BUFFER_SIZE;\n\t\t\telse\n\t\t\t\ttoCopy = (int) left;\n\t\t\tinput.readBytes(copyBuffer, 0, toCopy);\n\t\t\twriteBytes(copyBuffer, 0, toCopy);\n\t\t\tleft -= toCopy;\n\t\t}\n\t}",
"private void writeByte(int val) {\n dest[destPos++] = (byte) val;\n }",
"@Override\r\n\t\t\tpublic void write(int b) throws IOException {\n\t\t\t}",
"public static void write4bytes(int value, OutputStream outputStream) throws IOException {\n outputStream.write(value >>> 3 * 8);\n outputStream.write(value >>> 2 * 8 & 255);\n outputStream.write(value >>> 1 * 8 & 255);\n outputStream.write(value & 255);\n }",
"private void sendBitfield() throws IOException{\r\n\t\tbyte[]bitfield=new byte[this.torrentClient.getNumberOfPieces()];\r\n\t\tFragmentsInformation fi=this.torrentClient.getFragmentsInformation();\r\n\t\t//IF the fragment information is null or the current fragment is -1 it means that I have all the pieces\r\n\t\tif(fi==null||fi.getCurrentFragment()==-1){\r\n\t\t\tfor(int i=0,ii=bitfield.length;i<ii;i++){\r\n\t\t\t\tbitfield[i]=1;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//we only have some pieces\r\n\t\t\tint lastFragment=this.torrentClient.getFragmentsInformation().getCurrentFragment();\r\n\t\t\tint i=0;\r\n\t\t\t\r\n\t\t\tfor(;i<lastFragment;i++){\r\n\t\t\t\tbitfield[i]=1;\r\n\t\t\t}\r\n\t\t\tfor(int ii=bitfield.length;i<ii;i++){\r\n\t\t\t\tbitfield[i]=0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tBitfieldMsg message= new BitfieldMsg(bitfield);\r\n\t\tthis.outputStream.write(message.getBytes());\r\n\t}",
"public static double bitsToBytes(double num) { return (num/8); }",
"private static int setBits(int n) {\r\n int highestBitValue = 1;\r\n int c = 0;\r\n\r\n while (highestBitValue < n) {\r\n highestBitValue = highestBitValue * 2;\r\n }\r\n\r\n \r\n int currentBitValue = highestBitValue;\r\n while (currentBitValue > 0) {\r\n if (currentBitValue <= n) {\r\n\r\n n -= currentBitValue;\r\n c++;\r\n }\r\n currentBitValue = currentBitValue / 2;\r\n }\r\n\r\n return c;\r\n }",
"@Override\n\tpublic void visit(BitwiseLeftShift arg0) {\n\t\t\n\t}",
"private int getResultAsInt(long bitPos, int nrBits, ByteOrder byteOrder,\n int maxNrBitsRead) {\n\n // check if input params are correct otherwise throw BitBufferException\n validateInputParams(bitPos, nrBits, maxNrBitsRead);\n\n // min number of bytes covering specified bits\n int nrReadBytes = getNrNecessaryBytes(bitPos, nrBits);\n\n // buffer containing specified bits\n int numberBuf = getNumberBufAsInt(byteOrder, nrReadBytes,\n (int) (bitPos >> 3));\n\n // mask leaving only specified bits\n int mask = getMaskAsInt(nrBits);\n\n // apply the mask for to the right shifted number buffer with the\n // specific bits to the most right\n int result = mask\n & getRightShiftedNumberBufAsInt(numberBuf, bitPos, nrBits,\n byteOrder);\n\n // increase bit pointer position by the number of read bits\n this.bitPos = bitPos + nrBits;\n\n return result;\n }",
"private void writeBytes( ByteBuffer byteBuffer, byte[] bytes, int len )\n {\n if ( null == bytes )\n {\n bytes = new byte[]\n {};\n }\n\n byteBuffer.put( bytes, 0, Math.min( len, bytes.length ) );\n\n // pad as necessary\n int remain = len - bytes.length;\n\n while ( remain-- > 0 )\n {\n byteBuffer.put( ( byte ) 0 );\n }\n }",
"public void write(byte[] bytes) {\n\t\ttry {\n\t\t\tfor(int i=0; i<bytes.length; i++) {\n\t\t\t\tmmOutStream.write(bytes[i] & 0xFF);\t\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n\tpublic void write(int value) {\n\t\tint lowByte = getFirstArg();\n\t\tint highByte = getSecondArg();\n\t\tint address = highByte;\n\t\taddress = address << 8;\n\t\taddress |= lowByte;\n\t\tCpuMem.getInstance().writeMem(address, value);\n\t}",
"public void set(final int i) {\n\t\tint wordPos;\n\t\tint bitPos = 0;\n\t\tint offset;\n\n\t\tassert (i >= 0);\n\n\t\t// try simple set (append style)\n\t\tif (fastSet(i))\n\t\t\treturn;\n\n\t\t// simple set failed. Find compressed word where to set the bit\n\t\tRunningLengthWord rlw = null, prev = null, next = null;\n\n\t\tEWAHIterator iter = new EWAHIterator(this.buffer, actualsizeinwords);\n\t\twhile (iter.hasNext() && (bitPos < i || bitPos == 0)) {\n\t\t\tif (rlw != null)\n\t\t\t\tprev = new RunningLengthWord(rlw);\n\t\t\trlw = iter.next();\n\t\t\tbitPos += rlw.size() * wordinbits;\n\t\t}\n\t\tif (iter.hasNext())\n\t\t\tnext = rlw.getNext();\n\n\t\tbitPos -= rlw.size() * 64;\n\t\toffset = i - bitPos;\n\t\twordPos = rlw.position;\n\n\t\t// the bit to set is in a literal word. Try to set bit directly\n\t\tif (offset >= rlw.getRunningLength() * 64) {\n\t\t\toffset -= rlw.getRunningLength() * 64;\n\t\t\tint literalPos = (offset / 64);\n\t\t\twordPos += literalPos + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\t\t\tthis.buffer[wordPos] = this.buffer[wordPos] | newdata;\n\t\t\t// if all bits of literal set, then either merge with run length\n\t\t\t// or create new RLW.\n\t\t\tif (this.buffer[wordPos] == oneMask) {\n\t\t\t\t// first literal of current RLW and running bit is set\n\t\t\t\t// increase count by one (unless maximal count reached)\n\t\t\t\tif (literalPos == 0\n\t\t\t\t\t\t&& (rlw.getRunningBit() || rlw.getRunningLength() == 0)\n\t\t\t\t\t\t&& rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\trlw.setRunningBit(true);\n\t\t\t\t\trlw.setRunningLength(rlw.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following RLW\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() + rlw.getRunningLength() < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tif (rlw.equals(this.rlw))\n\t\t\t\t\t\t\tthis.rlw.position = next.position;\n\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t}\n\t\t\t\t\t// merging doesn't work because of size\n\t\t\t\t\t// else just reduce length of rlw by 1\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t}\n\t\t\t\t// if last word increase following running length count if\n\t\t\t\t// possible\n\t\t\t\telse if (next != null\n\t\t\t\t\t\t&& next.getRunningLength() \n\t\t\t\t\t\t\t\t< RunningLengthWord.largestrunninglengthcount\n\t\t\t\t\t\t&& (next.getRunningLength() == 0 || next\n\t\t\t\t\t\t\t\t.getRunningBit())\n\t\t\t\t\t\t&& literalPos == rlw.getNumberOfLiteralWords() - 1) {\n\t\t\t\t\tnext.setRunningBit(true);\n\t\t\t\t\tnext.setRunningLength(next.getRunningLength() + 1);\n\t\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() - 1);\n\t\t\t\t\t// current RLW has no literals left, try to merge with\n\t\t\t\t\t// following\n\t\t\t\t\tif (rlw.getNumberOfLiteralWords() == 0\n\t\t\t\t\t\t\t&& next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()) {\n\t\t\t\t\t\tlong totalRunLen = next.getRunningLength() + rlw.getRunningLength(); \n\t\t\t\t\t\t\n\t\t\t\t\t\t// merging into next possible?\n\t\t\t\t\t\tif (totalRunLen < RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\t\tnext.setRunningLength(next.getRunningLength()\n\t\t\t\t\t\t\t\t\t+ rlw.getRunningLength());\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// run length to large, move run length from next to current\n\t\t\t\t\t\t// and shift next one to the left\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\trlw.setRunningLength(RunningLengthWord.\n\t\t\t\t\t\t\t\t\tlargestrunninglengthcount);\n\t\t\t\t\t\t\tnext.setRunningLength(totalRunLen - RunningLengthWord\n\t\t\t\t\t\t\t\t\t.largestrunninglengthcount);\n\t\t\t\t\t\t\tshiftCompressedWordsLeft(rlw.position + 2, 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// remove RLW\n\t\t\t\t\telse\n\t\t\t\t\t\tshiftCompressedWordsLeft(\n\t\t\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t\t\t\t+ 2, 1);\n\t\t\t\t}\n\t\t\t\t// cannot merge, have to create new RLW and adapt literal count\n\t\t\t\t// of current RLW\n\t\t\t\telse {\n\t\t\t\t\tint beforeLit = literalPos;\n\t\t\t\t\tint afterLit =\n\t\t\t\t\t\t\trlw.getNumberOfLiteralWords() - literalPos - 1;\n\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split into \" + beforeLit + \" and \" + afterLit);};\n\n\t\t\t\t\tRunningLengthWord newRlw = new RunningLengthWord(rlw);\n\t\t\t\t\tnewRlw.position += literalPos + 1;\n\t\t\t\t\tnewRlw.setRunningBit(true);\n\t\t\t\t\tnewRlw.setRunningLength(1L);\n\t\t\t\t\tnewRlw.setNumberOfLiteralWords(afterLit);\n\n\t\t\t\t\trlw.setNumberOfLiteralWords(beforeLit);\n\n\t\t\t\t\t// if next one is full running length 1's we have to switch\n\t\t\t\t\t// running lengths\n\t\t\t\t\tif (next != null\n\t\t\t\t\t\t\t&& next.getRunningBit()\n\t\t\t\t\t\t\t&& next.getRunningLength() == RunningLengthWord.largestrunninglengthcount) {\n\t\t\t\t\t\tnext.setRunningLength(1L);\n\t\t\t\t\t\tnewRlw.setRunningLength(RunningLengthWord.largestrunninglengthcount);\n\t\t\t\t\t}\n\n\t\t\t\t\t// we split the last word, adapt it\n\t\t\t\t\tif (rlw.position == this.rlw.position)\n\t\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t\t\tif (log.isDebugEnabled()) {log.debug(\"split because new 1's run\");};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// bit is in a clean word, if it is a '1' sequence we are fine\n\t\telse if (rlw.getRunningBit()) {\n\t\t\treturn;\n\t\t}\n\t\t// bit to set is in '0' clean word. We have to split this clean word and\n\t\t// shift following words in the buffer.\n\t\t// We do this by adding a new RLW y after the RLW x which has to be\n\t\t// split. This new RWL y takes over all the\n\t\t// literal words of x and encodes the part of the 0 sequence that\n\t\t// follows the bit we want to set. RWL x's\n\t\t// run length is reduced and we add the new bit as the new single\n\t\t// literal word for x.\n\t\telse {\n\t\t\tlong zeroRunLen = rlw.getRunningLength();\n\t\t\tlong newRunLen = offset / 64;\n\t\t\tlong afterRunLen = ((zeroRunLen * 64 - 63) / 64) - newRunLen;\n\t\t\tlong newNumLiterals = rlw.getNumberOfLiteralWords() + 1;\n\t\t\tfinal long newdata = 1l << (offset % 64);\n\n\t\t\t// no preceeding and following run length.\n\t\t\t// CASE 1) Try to merge with preceeding or following RLW.\n\t\t\tif (newRunLen == 0 && afterRunLen == 0) {\n\t\t\t\t// merge with previous if exists and possible\n\t\t\t\tif (prev != null\n\t\t\t\t\t\t&& prev.getNumberOfLiteralWords() + newNumLiterals <= RunningLengthWord.largestliteralcount) {\n\t\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords()\n\t\t\t\t\t\t\t+ newNumLiterals);\n\t\t\t\t\tthis.buffer[rlw.position] = newdata;\n\n\t\t\t\t\tif (this.rlw.equals(rlw))\n\t\t\t\t\t\tthis.rlw = prev;\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// No merging possible!\n\t\t\t// CASE 2) if previous run length = 0 then add new literal into\n\t\t\t// previous if previous still has space\n\t\t\tif (newRunLen == 0\n\t\t\t\t\t&& prev != null\n\t\t\t\t\t&& prev.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\tprev.setNumberOfLiteralWords(prev.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(afterRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position, 1);\n\t\t\t\tthis.buffer[prev.position + prev.getNumberOfLiteralWords()] =\n\t\t\t\t\t\tnewdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 3) No merging possible, if following run length = 0, then\n\t\t\t// try to extend R with the new literal.\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// TODO rlw is full (literals) and next one has no running length\n\t\t\t// and is not full\n\t\t\tif (afterRunLen == 0\n\t\t\t\t\t& next != null\n\t\t\t\t\t&& rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount\n\t\t\t\t\t&& next.getNumberOfLiteralWords() < RunningLengthWord.largestliteralcount) {\n\t\t\t\trlw.setRunningLength(rlw.getRunningLength() - 1);\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\trlw.array = this.buffer;\n\t\t\t\tnext.array = this.buffer;\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\t// switch next header with last literal\n\t\t\t\tlong temp = this.buffer[next.position + 1];\n\t\t\t\tthis.buffer[next.position + 1] = this.buffer[next.position];\n\t\t\t\tthis.buffer[next.position] = temp;\n\t\t\t\tnext.setNumberOfLiteralWords(next.getNumberOfLiteralWords() + 1);\n\n\t\t\t\tif (next.position + 1 == this.rlw.position)\n\t\t\t\t\tthis.rlw.position = next.position;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// CASE 4) no extension possible. Have to SPLIT the zero sequence\n\t\t\t// and create new RLW\n\t\t\t// new RLW only gets a single literal\n\t\t\tif (afterRunLen == 0) {\n\t\t\t\tassert (rlw.getNumberOfLiteralWords() == RunningLengthWord.largestliteralcount);\n\n\t\t\t\tshiftCompressedWordsRight(rlw.position + 1, 1);\n\t\t\t\tshiftCompressedWordsRight(\n\t\t\t\t\t\trlw.position + rlw.getNumberOfLiteralWords() + 1, 1);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, rlw.position\n\t\t\t\t\t\t\t\t+ rlw.getNumberOfLiteralWords() + 1);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(1L);\n\t\t\t\tnewRlw.setRunningLength(0);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\n\t\t\t\tthis.buffer[rlw.position + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t\t// new RLW also gets run length\n\t\t\telse {\n\t\t\t\tshiftCompressedWordsRight(wordPos + 1, 2);\n\t\t\t\tRunningLengthWord newRlw =\n\t\t\t\t\t\tnew RunningLengthWord(this.buffer, wordPos + 2);\n\t\t\t\trlw.array = this.buffer;\n\n\t\t\t\tnewRlw.setNumberOfLiteralWords(rlw.getNumberOfLiteralWords());\n\t\t\t\tnewRlw.setRunningLength(afterRunLen);\n\t\t\t\tnewRlw.setRunningBit(false);\n\n\t\t\t\trlw.setRunningLength(newRunLen);\n\t\t\t\trlw.setNumberOfLiteralWords(1);\n\n\t\t\t\tthis.buffer[wordPos + 1] = newdata;\n\n\t\t\t\tif (newRlw.position > this.rlw.position)\n\t\t\t\t\tthis.rlw.position = newRlw.position;\n\t\t\t}\n\t\t}\n\t}",
"static void primitiveRightShift(int[] a, int len, int n) {\n int n2 = 32 - n;\n for (int i=len-1, c=a[i]; i > 0; i--) {\n int b = c;\n c = a[i-1];\n a[i] = (c << n2) | (b >>> n);\n }\n a[0] >>>= n;\n }",
"public void clearBits(int[][] bits, int start, int len) {\n\t\tint left = start; \n\t\tint right = start + len - 1; \n\t\tfor (int i = 0; i < bits.length; i++) {\n\t\t\tfor (int j = left; j <= right; j++) {\n\t\t\t\tbits[i][j] = 0;\n\t\t\t}\n\t\t\tleft = left / 2;\n\t\t\tright = right / 2;\n\t\t}\n\t}",
"public void write(byte b[]) throws IOException\n {\n checkThreshold(b.length);\n getStream().write(b);\n written += b.length;\n }"
] | [
"0.6456502",
"0.5783922",
"0.57657325",
"0.5528368",
"0.5339742",
"0.51260865",
"0.50219846",
"0.50164163",
"0.48679167",
"0.47716978",
"0.47492155",
"0.47184297",
"0.4697774",
"0.46279496",
"0.45914847",
"0.45830238",
"0.45788422",
"0.45771855",
"0.4573477",
"0.45707455",
"0.45632243",
"0.4550403",
"0.45366254",
"0.45240474",
"0.45108056",
"0.4485221",
"0.44764066",
"0.44634268",
"0.43972853",
"0.43621367",
"0.43496177",
"0.43439263",
"0.43295985",
"0.432108",
"0.4287604",
"0.42861626",
"0.42802346",
"0.4279013",
"0.42720857",
"0.42657152",
"0.42587215",
"0.42454824",
"0.4243274",
"0.42376795",
"0.42166355",
"0.42008805",
"0.41812405",
"0.417317",
"0.41705167",
"0.41639557",
"0.41189295",
"0.41128492",
"0.4112217",
"0.41059113",
"0.4101838",
"0.4098856",
"0.40956512",
"0.40955654",
"0.40849167",
"0.40804282",
"0.40774792",
"0.40729278",
"0.40722573",
"0.40678364",
"0.40656686",
"0.40639645",
"0.4059191",
"0.40529588",
"0.40360472",
"0.40300703",
"0.40292504",
"0.4029204",
"0.4027088",
"0.40255487",
"0.40203223",
"0.40175182",
"0.4014905",
"0.4014306",
"0.40116066",
"0.4002701",
"0.4000688",
"0.3998475",
"0.39919513",
"0.3986194",
"0.39810345",
"0.39755958",
"0.39736786",
"0.39685756",
"0.39675817",
"0.39603686",
"0.3958123",
"0.39419493",
"0.39403516",
"0.3939567",
"0.39382556",
"0.39319113",
"0.3930558",
"0.39300638",
"0.3921041",
"0.3910983"
] | 0.72983825 | 0 |
Flushes all data prior to the given position to the underlying destination, such as an OutputStream or File. Attempting to seek to the flushed portion of the stream will result in an IndexOutOfBoundsException. | void flushBefore(long pos) throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void flush() throws IOException {\n\t\tmFile.seek(mOffset);\n\t\tmWriter.write(mBuffer, 0, mBufferLength);\n\t\tmOffset += mBufferLength;\n\t\tmBufferLength = 0;\n\t}",
"public void flush(){\n\t\ttry{\n\t\t\tse.write(buffer, 0, bufferPos);\n\t\t\tbufferPos = 0;\n\t\t\tse.flush();\n\t\t}catch(IOException ioex){\n\t\t\tfailures = true;\n\t\t}\n\t}",
"@Override\r\n public synchronized void flush() throws IOException {\r\n\t\tif ( count != 0 ) {\r\n\t\t writeBuffer(buf, 0, count );\r\n\t\t count = 0;\r\n\t\t}\r\n\t}",
"public void flush(long offset) {\n if (offset < 0) {\n throw new IllegalArgumentException(\"Invalid offset: \" + offset);\n }\n // TODO: Once we persisted stream type, we should check the call can only be issued on BUFFERED\n // stream here.\n Storage.FlushRowsRequest request =\n Storage.FlushRowsRequest.newBuilder().setWriteStream(streamName).setOffset(offset).build();\n stub.flushRows(request);\n // TODO: We will verify if the returned offset is equal to requested offset.\n }",
"public void flush() throws IOException;",
"public void flush() throws IOException;",
"public void flush() throws IOException;",
"public void seek(long pos) throws IOException {\n checkClosed();\n\n if (pos < flushedPos) {\n throw new IndexOutOfBoundsException();\n }\n\n cache.seek(pos);\n this.streamPos = cache.getFilePointer();\n maxStreamPos = Math.max(maxStreamPos, streamPos);\n this.bitOffset = 0;\n }",
"@Override\n public void flush() throws IOException {\n checkStreamState();\n flushIOBuffers();\n }",
"public void flush() {\n\r\n int inflatedSize = buffer.position();\r\n deflator.setInput(buffer.getBuffer(), 0, inflatedSize);\r\n deflator.finish();\r\n int deflatedSize = deflator.deflate(compressionBuffer.array());\r\n deflator.reset();\r\n\r\n try {\r\n outputStream.writeInt(deflatedSize);\r\n outputStream.writeInt(inflatedSize);\r\n outputStream.write(compressionBuffer.array(), 0, deflatedSize);\r\n }\r\n catch (IOException e) {\r\n throw new RuntimeException(\"Failed to write compressed data to stream\", e);\r\n }\r\n\r\n buffer.clear();\r\n compressionBuffer.clear();\r\n }",
"public synchronized void flush() throws IOException {\n\t\tcheckNotClosed();\n\t\ttrimToSize();\n\t\tjournalWriter.flush();\n\t}",
"void flushToOutputStream(OutputStream outputStream) throws IOException;",
"public void flush() throws IOException\n {\n getStream().flush();\n }",
"public void forceFlush() throws IOException {\n flushCurrentIndexBlock();\n }",
"void flush() throws IOException;",
"void flush() throws IOException;",
"void flush() throws IOException;",
"public void flush() throws IOException {\n\t\tif ((buffer.length - cursor) > 50000) {\n\t\t\tSystem.out.println(\"WASTED: \" + (buffer.length - cursor));\n\t\t}\n\t}",
"private void flushWrite() throws IOException, BadDescriptorException {\n if (reading || !modes.isWritable() || buffer.position() == 0) return; // Don't bother\n \n int len = buffer.position();\n buffer.flip();\n int n = descriptor.write(buffer);\n \n if(n != len) {\n // TODO: check the return value here\n }\n buffer.clear();\n }",
"public void flush(){\r\n mBufferData.clear();\r\n }",
"public void flush() throws IOException {\n // nothing to do with cached bytes\n }",
"public abstract void flush();",
"@Override\n public void flush() throws IOException {\n ConsoleRedirect.this.flush(buffer, 0, pos);\n pos = 0;\n }",
"@SuppressWarnings(\"GuardedByChecker\")\n private void sendFlushDataLocked() {\n assert mWriteState == State.WAITING_FOR_FLUSH;\n int size = mFlushData.size();\n ByteBuffer[] buffers = new ByteBuffer[size];\n int[] positions = new int[size];\n int[] limits = new int[size];\n for (int i = 0; i < size; i++) {\n ByteBuffer buffer = mFlushData.poll();\n buffers[i] = buffer;\n positions[i] = buffer.position();\n limits[i] = buffer.limit();\n }\n assert mFlushData.isEmpty();\n assert buffers.length >= 1;\n mWriteState = State.WRITING;\n mRequestHeadersSent = true;\n if (!CronetBidirectionalStreamJni.get().writevData(mNativeStream,\n CronetBidirectionalStream.this, buffers, positions, limits,\n mEndOfStreamWritten && mPendingData.isEmpty())) {\n // Still waiting on flush. This is just to have consistent\n // behavior with the other error cases.\n mWriteState = State.WAITING_FOR_FLUSH;\n throw new IllegalArgumentException(\"Unable to call native writev.\");\n }\n }",
"@Override\n\tpublic void flushBuffer() throws IOException {\n\t}",
"@Override\n public void flush() throws IOException {\n byteBufferStreamOutput.flush();\n }",
"public void flush();",
"public void flush();",
"public void flush();",
"public void flush();",
"void flush() throws Exception;",
"public void flush() throws IOException {\n\t\t// TODO implement me\n\t}",
"public void flush() {\n wasFlushed = true;\n }",
"public synchronized void flush() throws java.io.IOException { throw new RuntimeException(\"Stub!\"); }",
"void seek(long position) throws IOException;",
"@Override\n public void flush() throws IOException {\n }",
"@Override\n public void flushBuffer() throws IOException {\n\n }",
"public void seek(long pos) throws IOException {\r\n int n = (int)(file_pos - pos);\r\n if (n >= 0 && n <= buf_end) {\r\n buf_pos = buf_end - n;\r\n } else {\r\n super.seek(pos);\r\n invalidate();\r\n }\r\n }",
"void flush() throws EDIStreamException;",
"public void flush() {\r\n // Flushing is required only if there are written bytes in\r\n // the current data element.\r\n if (bytenum != 0) {\r\n data[offset] = elem;\r\n }\r\n }",
"void seek(long pos) throws IOException;",
"public void flush() {\n\t\t\n\t}",
"public void flush()\n/* */ throws IOException\n/* */ {\n/* 833 */ _flushBuffer();\n/* 834 */ if ((this._writer != null) && \n/* 835 */ (isEnabled(JsonGenerator.Feature.FLUSH_PASSED_TO_STREAM))) {\n/* 836 */ this._writer.flush();\n/* */ }\n/* */ }",
"public void flush() {\n flushed = true;\n }",
"@Override\r\n public void flush ()\r\n {\r\n }",
"private void flush() {\n try {\n final int flushResult = Mp3EncoderWrap.newInstance().encodeFlush(mp3Buffer);\n Log.d(TAG, \"===zhongjihao====flush mp3Buffer: \"+mp3Buffer+\" flush size: \"+flushResult);\n if (flushResult > 0) {\n mp3File.write(mp3Buffer, 0, flushResult);\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n mp3File.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n Log.d(TAG, \"===zhongjihao====destroy===mp3 encoder====\");\n Mp3EncoderWrap.newInstance().destroyMp3Encoder();\n }\n }",
"public void flush() {\r\n\t\ttry {\r\n\t\t\tdos.flush();\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}",
"@Override\r\n\tpublic void flush() {\n\t\t\r\n\t}",
"public synchronized void flush() {\n\t\ttry {\n\t\t\tcloseWriter();\n\t\t} catch(IOException ioe ) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\topenWriter(true);\n\t\t} catch(IOException ioe ) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\t}",
"public void flushData()\n {\n try {\n //outputStreamAccelerometer.flush();\n //outputStreamLinear.flush();\n outputStreamAccelerometer.close();\n outputStreamLinear.close();\n\n String paths[] = {fileAccelerometer.getPath(), fileLinear.getPath(), fileSettings.getPath()};\n MediaScannerConnection.scanFile(context, paths, null, this);\n }\n catch(Exception exc)\n {\n Log.e(\"LOGGER_ERROR_FLUSH\", exc.toString());\n exc.printStackTrace();\n }\n }",
"public abstract void resetBytesWritten();",
"@Override\n\t\tpublic void flush() throws IOException {\n\t\t\twriteBlock(true);\n\t\t\tout.flush();\n\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\t// it's a bit nasty if an exception is thrown from the log,\n\t\t\t// but ignoring it can be nasty as well, so it is decided to\n\t\t\t// let it go so there is feedback about something going wrong\n\t\t\tif (debug) {\n\t\t\t\tlog.flush();\n\t\t\t}\n\t\t}",
"public final void seek(long pos) throws IOException {\r\n\t\tf.seek( pos );\r\n\t}",
"@Override\n public void flush()\n {\n }",
"void flushBuffer();",
"public void seek(long pos) throws IOException {\n/* 155 */ if (pos < 0L) {\n/* 156 */ throw new IOException(PropertyUtil.getString(\"MemoryCacheSeekableStream0\"));\n/* */ }\n/* 158 */ this.pointer = pos;\n/* */ }",
"public void flush() throws IOException {\n if (firstMessage != null) {\n writer.messageWrite(firstMessage);\n }\n firstMessage = null;\n }",
"public void flush () throws IOException\n {\n if (m_nBufferedBitCount > 0)\n {\n if (m_nBufferedBitCount != CGlobal.BITS_PER_BYTE)\n if (LOGGER.isDebugEnabled ())\n LOGGER.debug (\"Flushing BitOutputStream with only \" + m_nBufferedBitCount + \" bits\");\n m_aOS.write ((byte) m_nBuffer);\n m_nBufferedBitCount = 0;\n m_nBuffer = 0;\n }\n }",
"@Override\n public void flush()\n throws XMLStreamException\n {\n try {\n mWriter.flush();\n } catch (IOException ie) {\n throw new WstxIOException(ie);\n }\n }",
"public void flush() {\n writer.flush();\n }",
"@Override\n public void reset() throws IOException {\n setPosition(startPosition);\n }",
"@Override\n public void flush() {\n }",
"@Override\n public void flush() {\n }",
"@Override\n public void flush() {\n }",
"void flush();",
"void flush();",
"void flush();",
"void flush();",
"void flush();",
"void flush();",
"void flush();",
"void flush();",
"@Override\n\tpublic void flush() {\n\t\t\n\t}",
"@Override\n\tpublic void flush() {\n\t\t\n\t}",
"@Override\n\tpublic void flush() {\n\t\t\n\t}",
"@Override\n\tpublic void flush() {\n\t\t\n\t}",
"protected void deferFlush()\n {\n // push next flush out to avoid attempts at multiple simultaneous\n // flushes\n m_lNextFlush = Long.MAX_VALUE;\n }",
"private void flushBuffer(Runnable paramRunnable) {\n/* 149 */ int i = this.buf.position();\n/* 150 */ if (i > 0 || paramRunnable != null)\n/* */ {\n/* 152 */ flushBuffer(this.buf.getAddress(), i, paramRunnable);\n/* */ }\n/* */ \n/* 155 */ this.buf.clear();\n/* */ \n/* 157 */ this.refSet.clear();\n/* */ }",
"@Override\r\n\tpublic void flush() {\n\t}",
"public void flush(boolean rollToNext)\n throws CommitFailure, TxnBatchFailure, TxnFailure, InterruptedException {\n // if there are no records do not call flush\n if (totalRecords <= 0) {\n return;\n }\n try {\n synchronized (txnBatchLock) {\n commitTxn();\n nextTxn(rollToNext);\n totalRecords = 0;\n lastUsed = System.currentTimeMillis();\n }\n } catch (StreamingException e) {\n throw new TxnFailure(txnBatch, e);\n }\n }",
"@Override\n\tpublic void flush() {\n\t}",
"@Override\n public void hflush() throws IOException {\n hsync();\n }",
"private static void flushInternalBuffer() {\n\n //Strongly set the last byte to \"0A\"(new line)\n if (mPos < LOG_BUFFER_SIZE_MAX) {\n buffer[LOG_BUFFER_SIZE_MAX - 1] = 10;\n }\n\n long t1, t2;\n\n //Save buffer to SD card.\n t1 = System.currentTimeMillis();\n writeToSDCard();\n //calculate write file cost\n t2 = System.currentTimeMillis();\n Log.i(LOG_TAG, \"internalLog():Cost of write file to SD card is \" + (t2 - t1) + \" ms!\");\n\n //flush buffer.\n Arrays.fill(buffer, (byte) 0);\n mPos = 0;\n }",
"public void flush() throws IOException {\n dos.flush();\n }",
"public void flush() throws IOException {\n try {\n out.flush();\n } catch (IOException ioe) {\n String msg = \"Failed to flush \" + this;\n LOG.error(msg, ioe);\n throw new IOException(msg, ioe);\n }\n }",
"@Override\n public void flush () throws IOException\n {\n if ((null == _topParts) || (null == _mmDelimiter))\n throw new EOFException(\"No parsing in progress to flush\");\n if (null == this.out)\n throw new EOFException(\"No underlying output stream to flush\");\n this.out.flush();\n }",
"public void flush() {\r\n\t\tindexBuffer.flip();\r\n\t\tif (DEBUG) {\r\n\t\t\tSystem.out.println(\"flush \"+indexBuffer.position()+\" \"+indexBuffer.limit());\r\n\t\t}\r\n\t\tif (indexBuffer.limit() > 0) {\r\n\t\t\tGL11.glDrawElements(GL11.GL_TRIANGLES, indexBuffer);\r\n\t\t}\r\n\t\tindexBuffer.limit(indexBuffer.capacity());\r\n\t}",
"public void seek(long pos) throws IOException {\n raos.seek(pos);\n }",
"public int flush()\n/* */ {\n/* 145 */ return 0;\n/* */ }",
"private void flushData()\n {\n try\n {\n while(state.get().ordinal() < SimulationState.TEARING_DOWN.ordinal() || !flushing.isEmpty())\n {\n ICardinality cardinality = flushing.poll(1, TimeUnit.MILLISECONDS);\n if (cardinality == null)\n continue;\n\n long numToFlush = cardinality.cardinality();\n counters.numFlushed.addAndGet(numToFlush);\n generateSSTables(cardinality, numToFlush, partitioner.getMinimumToken(), partitioner.getMaximumToken(), \"flushing\", true);\n }\n }\n catch (InterruptedException e)\n {\n logger.error(\"Exception happen during flushing\", e);\n }\n }",
"public synchronized void flush() throws IOException {\n if (sink != null) {\n synchronized (sink) {\n sink.notifyAll();\n }\n }\n }",
"void pushBack() throws IOException {\n iis.seek(iis.getStreamPosition()-bufAvail);\n bufAvail = 0;\n bufPtr = 0;\n }",
"public boolean flushPipelinedData() throws IOException {\n if (buffer == null || (buffer.getBuffer().position() == 0 && allAreClear(state, FLUSHING))) {\n return next.flush();\n }\n return flushBuffer();\n }",
"@Override\n public void write(int i) throws IOException {\n if (pos == BUFFER_SIZE) {\n flush();\n }\n buffer[pos++] = (byte)i;\n }",
"void flush() {\r\n synchronized (sync) {\r\n updatedFiles.clear();\r\n }\r\n }",
"public void flushStreamSpecs();",
"public synchronized void reset() throws IOException {\n\t\t\tdata.seek(firstPosition);\n\t\t}",
"@Override\n public void flush() throws IOException\n {\n for(;;) {\n int index = indexOneOf(builder, '\\r', '\\n');\n if(index == -1) {\n break;\n }\n // ignore false returned by offer when queue is full\n queue.offer(builder.substring(0, index));\n\n if(builder.charAt(index) == '\\r') {\n ++index;\n }\n if(builder.charAt(index) != '\\n') {\n throw new IllegalStateException();\n }\n ++index;\n builder.delete(0, index);\n }\n }",
"void flush(byte[] b, int off, int len) {\n if (len > 0) {\n synchronized (flushed) {\n flushed.append(new String(b, off, len));\n }\n }\n }",
"public void flush() throws IOException {\n mPrintWriter.flush();\n }"
] | [
"0.65354854",
"0.648374",
"0.6367831",
"0.6359131",
"0.6238374",
"0.6238374",
"0.6238374",
"0.62259036",
"0.6203479",
"0.617664",
"0.6139777",
"0.6102567",
"0.610086",
"0.60756207",
"0.60350776",
"0.60350776",
"0.60350776",
"0.60266817",
"0.59813946",
"0.59440887",
"0.5922122",
"0.5913663",
"0.59028804",
"0.58765185",
"0.5875316",
"0.5819191",
"0.5786285",
"0.5786285",
"0.5786285",
"0.5786285",
"0.5749912",
"0.57450753",
"0.5711659",
"0.5709702",
"0.57050496",
"0.5689236",
"0.5667556",
"0.5663305",
"0.56558335",
"0.56301135",
"0.56216425",
"0.56211764",
"0.5560254",
"0.5544249",
"0.5525825",
"0.5518843",
"0.5493882",
"0.5478582",
"0.5477546",
"0.54737395",
"0.54609436",
"0.5458389",
"0.5456515",
"0.5437163",
"0.54308444",
"0.5423625",
"0.54213494",
"0.5412878",
"0.53979874",
"0.5396433",
"0.53927135",
"0.5382563",
"0.5382563",
"0.5382563",
"0.53615975",
"0.53615975",
"0.53615975",
"0.53615975",
"0.53615975",
"0.53615975",
"0.53615975",
"0.53615975",
"0.535516",
"0.535516",
"0.535516",
"0.535516",
"0.5347495",
"0.5337192",
"0.53334653",
"0.52991164",
"0.5294737",
"0.52910507",
"0.5282501",
"0.5271949",
"0.52608854",
"0.5259657",
"0.5237868",
"0.51948917",
"0.51927143",
"0.5173876",
"0.5160974",
"0.51605606",
"0.5155849",
"0.5138079",
"0.5112614",
"0.5105579",
"0.50986975",
"0.5097193",
"0.50930285",
"0.50657487"
] | 0.7124355 | 0 |
API CLASS 3 4 HOURS CLASS /Given the Accept type is JSON When I send a GET request to REST URL /regions Then status code is 200 And Response content should be json and 4 Regions should be returned and has America and has america europe when we say items.region_id it is getting multipple items so we can use hassize has item and items | @Test
public void testItemsCountFromResponseBody() {
given().accept(ContentType.JSON).
when().get(ConfigurationReader.getProperty("hrapp.baseurl")+"/regions")
.then().assertThat().statusCode(200)
.and().contentType(ContentType.JSON)
.and().assertThat().body("items.region_id", hasSize(4))
.and().assertThat().body("items.region_id", hasItem("Europe"))
.and().assertThat().body("items.region_name", hasItems("Americas","Europe","do"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testItemsCountFromResponseBody(){\n given().accept(ContentType.JSON)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/regions\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n //here we need to provide address starting from the root element\n .and().assertThat().body(\"items.region_id\", hasSize(4))\n .and().assertThat().body(\"items.region_name\", hasItem(\"Americas\")); //hasItem accepts only 1 item\n //.and().assertThat().body(\"items.region_name\", hasItems(\"Americas\",\"Asia\")); //hasItems accepts multiple items, because it uses varags as argument\n }",
"@Test\npublic void verifyRegionName() {\n\t\tgiven().accept(ContentType.JSON).\n\t\twhen().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/regions\")\n\t\t.then().assertThat().statusCode(200)\n\t\t.and().contentType(ContentType.JSON)\n\t\t.and().assertThat().body(\"items[1].region_name\", equalTo(\"Americas\"));\n}",
"@Test\n public void testTransplantListEndpointQueryRegion() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,null,null,\"Auckland\",upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionEndpointCombo() {\n ResponseEntity response = dataController.getReceiverDataRegion(\"F\", \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"public HashMap<String, HashMap<String, ArrayList<HashMap<String, HashMap<String, String>>>>> getStatus(String region) throws IOException {\r\n String currentData;\r\n\r\n try {\r\n baseURL = StaticData.buildURL(region);\r\n currentData = getUrlData();\r\n networkOK = true;\r\n }\r\n catch(UnknownHostException e) {\r\n currentData = \"\";\r\n networkOK = false;\r\n throw e;\r\n }\r\n \r\n JsonElement jelem = new JsonParser().parse(currentData);\r\n JsonObject jobj = jelem.getAsJsonObject();\r\n JsonArray servicesArr = jobj.getAsJsonArray(\"services\");\r\n JsonArray incidentsArr;\r\n JsonArray updatesArr;\r\n \r\n String service, status;\r\n HashMap<String, HashMap<String, ArrayList<HashMap<String, HashMap<String, String>>>>> statusInfo = new HashMap();\r\n HashMap<String, ArrayList<HashMap<String, HashMap<String, String>>>> statusValues = new HashMap();\r\n ArrayList<HashMap<String, HashMap<String, String>>> services = new ArrayList();\r\n HashMap<String, HashMap<String, String>> incidents = new HashMap();\r\n HashMap<String, String> content = new HashMap();\r\n\r\n for(int i = 0; i < servicesArr.size(); i++) {\r\n jobj = servicesArr.get(i).getAsJsonObject();\r\n \r\n service = formatOutput(jobj.get(\"name\").toString());\r\n status = formatOutput(jobj.get(\"status\").toString()); \r\n\r\n incidentsArr = jobj.getAsJsonArray(\"incidents\");\r\n \r\n // If there are any incidents, store them.\r\n if(incidentsArr.size() > 0) {\r\n // Get each incident.\r\n for(int j = 0; j < incidentsArr.size(); j++) {\r\n jobj = incidentsArr.get(j).getAsJsonObject();\r\n updatesArr = jobj.getAsJsonArray(\"updates\");\r\n \r\n // Get information for each update.\r\n if(updatesArr.size() > 0) {\r\n for(int k = 0; k < updatesArr.size(); k++) {\r\n jobj = updatesArr.get(k).getAsJsonObject();\r\n\r\n // Add id\r\n content.put(\"id\", formatOutput(jobj.get(\"id\").toString()));\r\n // Add severity\r\n content.put(\"severity\", formatOutput(jobj.get(\"severity\").toString()));\r\n // Add updated_at\r\n content.put(\"updated_at\", formatOutput(jobj.get(\"updated_at\").toString()));\r\n // Add content\r\n content.put(\"content\", formatOutput(jobj.get(\"content\").toString()));\r\n \r\n incidents.put(service, (HashMap)content.clone());\r\n services.add((HashMap)incidents.clone());\r\n }\r\n }\r\n }\r\n }\r\n \r\n Collections.reverse(services); // Flip incidents ArrayList to have the newest first.\r\n statusValues.put(status, (ArrayList)services.clone());\r\n services.clear(); // Make sure old incidents aren't copied if current service has no incidents.\r\n statusInfo.put(service, (HashMap)statusValues.clone());\r\n statusValues.clear(); // Make sure old statuses aren't copied if current service has no incidents.\r\n }\r\n \r\n return statusInfo;\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 }",
"@org.junit.Test\n\tpublic void allStatesOfCountry() {\n\t\tResponse response = given().when().get(\"http://services.groupkt.com/state/get/IND/all\");\n\n\t\tresponse.prettyPrint();\n\n\t\t/* 1. verify status code */\n\t\tresponse.then().statusCode(200);\n\n\t\t/* 2. verify countryCode */\n//\t\tresponse.then().body(\"RestResponse.result.country\", equalTo(\"IND\")).body(\"RestResponse.result.name\",\n//\t\t\t\tequalTo(\"Karnataka\"));\n//\t\t\n//\t\tresponse.then().body(\"RestResponse.result.name\", hasItems(\"Andhra Pradesh,Arunachal Pradesh\"));\n\t\t\n\t\t\n\t\tresponse.then().assertThat().body(\"RestResponse.result.name\", hasValue(\"Jammu and Kashmir\"));\n\t\t\n//\t\t\n//\t\tJsonPath jsonPath = new JsonPath(response.toString()).setRoot(\"RestResponse\");\n//\t\tJsonObject lottoId = jsonPath.getJsonObject(\"result\");\n//\t\tList<Integer> winnerIds = jsonPath.get(\"result.id\");\n\n\t}",
"@Test\n public void testReceiverRegionEndpointAge() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testRegionName() throws JSONException {\n String[] region = {\"Asia\",\"Asia\",\"Africa\"};\n for (i=0;i<respArray.length();i++){\n Assert.assertEquals(respArray.getJSONObject(i).getString(\"region\"),region[i], \"Region name does not match\");\n }\n }",
"@Test\n public void testReceiverRegionEndpointBloodType() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"private void loadSearchRegions() {\n showProgress(ApplicationConstants.DIALOG_HEADER, \"Please wait while we retrieve regions from server.\");\n String authToken = ShPrefManager.with(getActivity()).getToken();\n RestClient.getAPI().getRegions(authToken, new RestCallback<RegionsResponse>() {\n @Override\n public void failure(RestError restError) {\n OpenHomeUtils.showToast(getActivity().getApplicationContext(), \"Could not load regions from the server.\", Toast.LENGTH_LONG);\n }\n\n @Override\n public void success(RegionsResponse regionsResponse, Response response) {\n if (regionsResponse.getMessage().size() > 0) {\n regionsList = regionsResponse.getMessage();\n setOnClickListeners();\n populateRegions();\n } else {\n String message = \"There is an error loading data. Please contact administrator..\";\n CustomDialogFragment regSuccessDialogFragment = CustomDialogFragment.newInstance(R.string.try_again,\n message, ApplicationConstants.BUTTON_OK, 0);\n regSuccessDialogFragment.show(getActivity().getFragmentManager(), \"AddPropertyFragment\");\n }\n }\n });\n\n getAllHazards();\n }",
"@Test\n public void Scenario3() {\n\n int limit = 5;\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<String, Double> biomass = new HashMap<>();\n Map<String, Double> coal = new HashMap<>();\n Map<String, Double> imports = new HashMap<>();\n Map<String, Double> gas = new HashMap<>();\n Map<String, Double> nuclear = new HashMap<>();\n Map<String, Double> other = new HashMap<>();\n Map<String, Double> hydro = new HashMap<>();\n Map<String, Double> solar = new HashMap<>();\n Map<String, Double> wind = new HashMap<>();\n\n try {\n\n ListIterator iterator = regions.listIterator();\n int iter = 0;\n\n while (iterator.hasNext()) {\n\n biomass.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(0).getPerc()\n );\n coal.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(1).getPerc()\n );\n imports.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(2).getPerc()\n );\n gas.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(3).getPerc()\n );\n nuclear.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(4).getPerc()\n );\n other.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(5).getPerc()\n );\n hydro.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(6).getPerc()\n );\n solar.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(7).getPerc()\n );\n wind.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(8).getPerc()\n );\n\n iter++;\n iterator.next();\n\n }\n\n } catch (NullPointerException npe) {\n npe.printStackTrace();\n }\n\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(biomass), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(coal), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(imports), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(gas), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(nuclear), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(other), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(hydro), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(solar), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(wind), limit));\n }",
"@Test\n public void testReceiverAgeEndpointRegion() {\n ResponseEntity response = dataController.getReceiverDataAge(null, null, \"Canterbury\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverGenderEndpointRegionFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(\"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testDonorGenderEndpointRegionFilterReturns() {\n ResponseEntity response = dataController.getDonorDataGender(\"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Delegate\n @Path(\"/projects/{project}/regions/{region}\")\n RegionOperationApi getRegionOperationApi(@PathParam(\"project\") String project, @PathParam(\"region\") String region);",
"@Test\n public void testReceiverRegionReturns() {\n ResponseEntity response = dataController.getReceiverDataByOrgans(\"N\", \"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@GET(\"/sight/list_by_region\")\n\t\tvoid getSightsByRegion(@Query(\"region\") String region, @Query(\"type\") String type, @Query(\"offset\") int start, @Query(\"limit\") int limit, Callback<List<Long>> callback);",
"public AirQuality getAirQuality(String cityName){\n String place = cityName.toLowerCase().replaceAll(\"\\\\d\",\"\");\n // https://www.baeldung.com/spring-5-webclient\n // https://springframework.guru/spring-5-webclient/ -> testam os endpoints\n // TODO: https://stackoverflow.com/questions/60289283/webclient-map-nested-object -> passar pa objetos\n // dizer que é melhor que RestTemplate que vai tar decrepeat\n AirQuality workingAQ = airQualityRepository.findByCityName(place);\n if (workingAQ != null && (ChronoUnit.MINUTES.between(workingAQ.getDate(), LocalDateTime.now()) < 50)){\n return workingAQ;\n }\n\n Api01MainResponse response01 = externalCaller.getFromApiOne(place);\n Api02MainResponse response02 = null;\n\n List<Pollutant> pollutantList = new ArrayList<>();\n\n if (response01.getError() != null){\n System.out.println(\"Couldn't get data from API01. Cause: \" + response01.getError().getDescription());\n response02 = externalCaller.getFromApiTwo(place);\n\n if (response02.getError() != null){\n System.out.println(\"Couldn't get data from API02. Cause: \" + response02.getError().getDetail());\n\n // If both API's requests have problems, send Null Object\n return new AirQualityNull();\n }\n\n // If API01 request doesn't work, but API02 does, use it\n for (Api02MainResponse.Api02Data.Api02Pollutants.Api02Pollutant p : response02.getAllPollutants()){\n pollutantList.add( new Pollutant(p.getDisplay_name().toLowerCase(), p.getFull_name().toLowerCase(), p.getConcentration().getValue() ,p.getConcentration().getUnits()) );\n }\n\n workingAQ = new AirQuality(place, \"portugal\", LocalDateTime.parse(response02.getApi02Date().split(\"Z\")[0] ) ,pollutantList);\n airQualityRepository.save(workingAQ);\n return workingAQ;\n }\n\n // If API01 request works, use it\n for (Api01MainResponse.Api01Response.Api01Periods.Api01Pollutant p: response01.getAllPollutants()){\n pollutantList.add( new Pollutant(p.getType(), p.getName(), p.getValueUGM3(), \"ug/m3\" ));\n }\n workingAQ = new AirQuality(place, \"portugal\", LocalDateTime.parse(response01.getApi01Date().split(\"\\\\+\")[0]) ,pollutantList);\n airQualityRepository.save(workingAQ);\n return workingAQ;\n }",
"@Test\n\tpublic void ListAllCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tString json = given().get(Endpoint.GET_COUNTRY).then().extract().asString();\n\t\tJsonPath jp = new JsonPath(json);\n\t\tList<String> list = jp.get(\"name\");\n\t\tSystem.out.println(\"Country's are -------\" + list.get(0));\n\t}",
"@Test\n public void testReceiverRegionEndpointGender() {\n ResponseEntity response = dataController.getReceiverDataRegion(\"M\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverDonorEndpointCombo() {\n ResponseEntity response = dataController.getDonorDataRegion(\"F\", \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@RequestLine(\"GET /geoip/territories?codes={codes}\")\n Collection<Collection<Region>> getAvailableRegions(@Param(\"codes\") String codes);",
"private void loadSearchRegions() {\n showProgress(ApplicationConstants.DIALOG_HEADER, \"Please wait while we retrieve matching results.\");\n String authToken = ShPrefManager.with(getActivity()).getToken();\n RestClient.getAPI().getRegions(authToken, new RestCallback<RegionsResponse>() {\n @Override\n public void failure(RestError restError) {\n hideProgress();\n OpenHomeUtils.showToast(getActivity().getApplicationContext(), restError.getErrorMessage(), Toast.LENGTH_LONG);\n }\n\n @Override\n public void success(RegionsResponse regionsResponse, Response response) {\n hideProgress();\n if (regionsResponse.getMessage().size() > 0) {\n regionsList = regionsResponse.getMessage();\n for (RegionsResponse.Regions region : regionsList) {\n listingsCount += region.getListingsCount();\n if (region.getParentId() == 0)\n adapterList.add(region);\n }\n regionsAdapter = new RegionsAdapter(getActivity(), adapterList, 0);\n mRecyclerView.setAdapter(regionsAdapter);\n currentAdapter = \"R\";\n listingsCountDisplayTextView.setText(listingsCount + \" Listings\");\n currentDisplayingParentId = 0;\n\n } else {\n String message = \"No results to display. Please modify the search criteria and try again.\";\n CustomDialogFragment regSuccessDialogFragment = CustomDialogFragment.newInstance(R.string.try_again,\n message, ApplicationConstants.BUTTON_OK, 0);\n regSuccessDialogFragment.show(getActivity().getFragmentManager(), \"SearchRegionsFragment\");\n }\n }\n });\n }",
"private void getAreas(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\tAreasServiceImpl areas = new AreasServiceImpl();\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Areas> select = areas.selectAllId(parameter);\n\t\t\n\t\t\n\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\t\n\t}",
"@Test\n\tpublic void validateCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tgiven().get(Endpoint.GET_COUNTRY).then().statusCode(200).\n\t\tand().contentType(ContentType.JSON).\n\t\tand().body(\"name\", hasItem(\"India\")).\n\t\tand().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t}",
"private void nokri_getCountryCityState(String id, final String tag){\n progressBar.setVisibility(View.VISIBLE);\n JsonArray params = new JsonArray();\n\n\n\n JsonObject jsonObject = new JsonObject();\n jsonObject.addProperty(\"country_id\",id);\n\n params.add(jsonObject);\n\n\n\n RestService restService = Nokri_ServiceGenerator.createService(RestService.class);\n\n Call<ResponseBody> myCall;\n if(Nokri_SharedPrefManager.isSocialLogin(getContext())) {\n myCall = restService.getCountryCityState(jsonObject, Nokri_RequestHeaderManager.addSocialHeaders());\n } else\n\n {\n myCall = restService.getCountryCityState(jsonObject, Nokri_RequestHeaderManager.addHeaders());\n }\n\n myCall.enqueue(new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> responseObject) {\n if(responseObject.isSuccessful()){\n try {\n JSONArray response = new JSONArray(responseObject.body().string());\n Log.v(\"response\",responseObject.message());\n\n switch (tag)\n {\n case \"state\":\n stateSpinnerModel = nokri_populateSpinner(stateSpinner,response);\n break;\n case \"city\":\n citySpinnerModel = nokri_populateSpinner(citySpinner,response);\n break;\n case \"town\":\n townSpinnerModel = nokri_populateSpinner(townSpinner,response);\n break;\n\n }\n\n\n // dialogManager.hideAlertDialog();\n progressBar.setVisibility(View.GONE);\n\n } catch (JSONException e) {\n /* dialogManager.showCustom(e.getMessage());\n dialogManager.hideAfterDelay();*/\n progressBar.setVisibility(View.GONE);\n e.printStackTrace();\n } catch (IOException e) {\n /* dialogManager.showCustom(e.getMessage());\n dialogManager.hideAfterDelay();*/\n progressBar.setVisibility(View.GONE);\n e.printStackTrace();\n\n }\n }\n else {\n /* dialogManager.showCustom(responseObject.code()+\"\");\n dialogManager.hideAfterDelay();*/\n progressBar.setVisibility(View.GONE);\n }\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n /* dialogManager.showCustom(t.getMessage());\n dialogManager.hideAfterDelay();*/\n progressBar.setVisibility(View.GONE);\n }\n });\n }",
"@Test\r\n public void testListRegistrations1() throws Throwable {\r\n // Parameters for the API call\r\n Double limit = 10d;\r\n Double offset = 20d;\r\n Options8Enum options = null;\r\n\r\n // Set callback and perform API call\r\n List<ListRegistrationsResponse> result = null;\r\n controller.setHttpCallBack(httpResponse);\r\n try {\r\n result = controller.listRegistrations(limit, offset, options);\r\n } catch(APIException e) {};\r\n\r\n // Test whether the response is null\r\n assertNotNull(\"Response is null\", \r\n httpResponse.getResponse());\r\n // Test response code\r\n assertEquals(\"Status is not 200\", \r\n 200, httpResponse.getResponse().getStatusCode());\r\n\r\n // Test whether the captured response is as we expected\r\n assertNotNull(\"Result does not exist\", \r\n result);\r\n assertTrue(\"Response body does not match in keys\", TestHelper.isArrayOfJsonObjectsProperSubsetOf(\r\n \"[ { \\\"id\\\": \\\"abcdefg\\\", \\\"description\\\": \\\"Example Context Source\\\", \\\"dataProvided\\\": { \\\"entities\\\": [ { \\\"id\\\": \\\"Bcn_Welt\\\", \\\"type\\\": \\\"Room\\\" } ], \\\"attrs\\\": [ \\\"temperature\\\" ] }, \\\"provider\\\": { \\\"http\\\": { \\\"url\\\": \\\"http://contextsource.example.org\\\" }, \\\"supportedForwardingMode\\\": \\\"all\\\" }, \\\"expires\\\": \\\"2017-10-31T12:00:00\\\", \\\"status\\\": \\\"active\\\", \\\"forwardingInformation\\\": { \\\"timesSent\\\": 12, \\\"lastForwarding\\\": \\\"2017-10-06T16:00:00.00Z\\\", \\\"lastSuccess\\\": \\\"2017-10-06T16:00:00.00Z\\\", \\\"lastFailure\\\": \\\"2017-10-05T16:00:00.00Z\\\" } }]\", \r\n TestHelper.convertStreamToString(httpResponse.getResponse().getRawBody()), \r\n false, true, false));\r\n }",
"@RequestMapping(\"/getById/{id}\")\r\npublic Optional<Region> getById(@Valid int id){\nreturn regionService.getById(id);\r\n// return \"index\";\r\n// if (region.isPresent()) {\r\n// return new ResponseEntity<>(region.get(), HttpStatus.OK);\r\n// } else {\r\n// return new ResponseEntity<>(HttpStatus.NOT_FOUND);\r\n// }\r\n }",
"@Test\n public void testReceiverRegionEndpointNoFilters() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"public List getZonasRegion(String feriadoRegion);",
"@Delegate\n @Path(\"/projects/{project}\")\n RegionApi getRegionApi(@PathParam(\"project\") String projectName);",
"private void getCities(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\tCitiesServiceImpl cities = new CitiesServiceImpl();\n\t\t\n\t\t\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Cities> select = cities.selectAllId(\"2\");\n\t\t\n\t\t\n\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\n\t}",
"List<RegionalClassifierEntity> getItsListOfRegions();",
"@Test\n public void testDonorRegionReturns() {\n ResponseEntity response = dataController.getDonorDataByOrgans(\"N\", \"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void test19(){\n // List<Integer> services = response.extract().path(\"data.findAll{it.services=='Samsung Experience'}.storeservices\");\n //List<HashMap<String, ?>> address = response.extract().path(\"data.findAll{it.service=='Samsung Experience'}.storeservices\");\n System.out.println(\"------------------StartingTest---------------------------\");\n System.out.println(\"The name of all services:\" );\n System.out.println(\"------------------End of Test---------------------------\");\n }",
"@GET\n @Path(\"/getRecipes\")\n public Response getRecipes(\n @QueryParam(\"items\") String ingredients\n ){\n\n try {\n String decodedRecipes = URLDecoder.decode(ingredients, \"UTF-8\");\n } catch (Exception e){\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(\"Error\")\n .build();\n }\n\n String baseURL = \"https://api.edamam.com/search\";\n Client client = ClientBuilder.newClient();\n\n WebTarget target = client.target(baseURL)\n .queryParam(\"app_id\", \"d1fc9900\")\n .queryParam(\"app_key\", \"a9307ac9d85fe8df2ad5d37597245915\")\n .queryParam(\"q\", ingredients);\n String response = target.request().get(String.class);\n\n JSONObject jsonObject = new JSONObject(response);\n\n String recipes = jsonObject.get(\"hits\").toString();\n\n JSONArray array = new JSONArray(recipes);\n\n StringBuilder results = new StringBuilder();\n for(int i = 0; i < array.length(); i++){\n JSONObject object = (JSONObject) array.get(i);\n JSONObject recipeObject = (JSONObject) object.get(\"recipe\");\n\n //System.out.println(recipeObject.keySet());\n// System.out.println(\"Label: \" + recipeObject.get(\"label\"));\n// System.out.println(\"Image: \" + recipeObject.get(\"image\"));\n// System.out.println(\"URL: \" + recipeObject.get(\"url\"));\n// System.out.println();\n\n JSONObject data = new JSONObject();\n data.put(\"label\", recipeObject.get(\"label\"));\n data.put(\"image\", recipeObject.get(\"image\"));\n data.put(\"url\", recipeObject.get(\"url\"));\n\n results.append(data.toString() + \"∑\");\n }\n\n System.out.println(results.toString());\n\n return Response.ok(results.toString()).build();\n\n // Parsing JSON response\n\n//\n// ObjectMapper objectMapper = new ObjectMapper();\n//\n// try{\n// Map<String, Object> map = objectMapper.readValue(response, new TypeReference<Map<String, Object>>() {\n// });\n//\n// //StringTokenizer tokenizer = new StringTokenizer(map.get(\"hits\").toString(), \"recipe=\");\n// // System.out.println(map.get(\"hits\"));\n// //System.out.println(map.keySet());\n//\n// }\n// catch (Exception e){\n// System.out.println(\"Error parsing string\");\n// }\n// return null;\n }",
"public void testGetRegion() {\r\n\t\tregionBuilder = getRegionTestBuilder();\r\n\t\ttry {\r\n\t\t\tRegion region = regionMgr.getRegion(RegionTestBuilder.REGION_ID_INDIA);\r\n\t\t\tassertTrue(\"Unable to get country list\", region.getName()\r\n\t\t\t\t\t.equalsIgnoreCase(\"India\"));\r\n\t\t} catch (Exception ex) {\r\n\t\t\tassertTrue(\"An excpetion has occured\", false);\r\n\t\t}\r\n\t}",
"@Test\n public void testGetTravel() throws Exception{\n mockMVC.perform(get(\"/user/1/travel/1\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isOk())\n .andExpect(content().contentType(TestUtil.APPLICATION_JSON_UTF8))\n .andExpect(jsonPath(\"$.id\", is(\"1\")))\n .andExpect(jsonPath(\"$.name\", is(\"travel1\")))\n .andExpect(jsonPath(\"$.time_interval[0]\", is(\"10:15:30\")))\n .andExpect(jsonPath(\"$.time_interval[1]\", is(\"12:15:30\")))\n .andExpect(jsonPath(\"$.is_arrival_time\", is(false)))\n .andExpect(jsonPath(\"$.recurring[0]\", is(false)))\n .andExpect(jsonPath(\"$.recurring[1]\", is(false)))\n .andExpect(jsonPath(\"$.recurring[2]\", is(false)))\n .andExpect(jsonPath(\"$.recurring[3]\", is(false)))\n .andExpect(jsonPath(\"$.recurring[4]\", is(false)))\n .andExpect(jsonPath(\"$.recurring[5]\", is(false)))\n .andExpect(jsonPath(\"$.recurring[6]\", is(false)))\n .andExpect(jsonPath(\"$.startpoint.street\", is(\"teststreet\")))\n .andExpect(jsonPath(\"$.startpoint.housenumber\", is(\"1\")))\n .andExpect(jsonPath(\"$.startpoint.city\", is(\"testcity\")))\n .andExpect(jsonPath(\"$.startpoint.country\", is(\"BE\")))\n .andExpect(jsonPath(\"$.startpoint.postal_code\", is(\"1234\")))\n .andExpect(jsonPath(\"$.startpoint.coordinates.lat\", is(50.0)))\n .andExpect(jsonPath(\"$.startpoint.coordinates.lon\", is(60.0)))\n .andExpect(jsonPath(\"$.endpoint.street\", is(\"teststreet\")))\n .andExpect(jsonPath(\"$.endpoint.housenumber\", is(\"5\")))\n .andExpect(jsonPath(\"$.endpoint.city\", is(\"testcity\")))\n .andExpect(jsonPath(\"$.endpoint.country\", is(\"BE\")))\n .andExpect(jsonPath(\"$.endpoint.postal_code\", is(\"1234\")))\n .andExpect(jsonPath(\"$.endpoint.coordinates.lat\", is(55.0)))\n .andExpect(jsonPath(\"$.endpoint.coordinates.lon\", is(65.0)));\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }",
"@Test\n public void test_getFacilities() throws Exception {\n ResponseEntity<FacilityResponse> response = restTemplate.getForEntity(\"/v1/facilities\", FacilityResponse.class);\n\n // assert\n Assertions.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);\n Assertions.assertThat(Collections.singletonList(Objects.requireNonNull(response.getBody()).getFacilities()));\n Assertions.assertThat(response.getBody().getFacilities().get(0).getName()).isEqualTo(\"p1\");\n // response structure: //{\"facilities\":[{\"id\":101,\"name\":\"p1\",\"address\":\"testAddress\"}]}\n }",
"@Test\n public void getWitheaders(){\n with().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/countries/US\")\n .then().statusCode(200);\n }",
"@Override\n public void onSucceed(int what, Response response) {\n gson = new Gson();\n try {\n switch (what) {\n case 0x021://获取城市\n\n //企查查城市数据解法\n// String jstring = (String) response.get();\n// map = gson.fromJson(jstring, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.citys> list = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Result\").toString(), new TypeToken<List<DataManager.citys>>() {\n// }.getType());\n// DataManager.citysList = list;\n\n //真实城市数据解法————zlh手解json\n String jstring = (String) response.get();\n map = gson.fromJson(jstring, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (((LinkedTreeMap) map.get(\"data\")).size() != 0) {\n List<LinkedTreeMap> list = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"city\");\n for (int i = 0; i < list.size(); i++) {\n DataManager.citys temp1 = new DataManager.citys();\n temp1.c_name = (String) list.get(i).get(\"c_name\");\n temp1.c_code = (String) list.get(i).get(\"c_code\");\n temp1.citycode = new ArrayList<>();\n List<LinkedTreeMap> templist = (List<LinkedTreeMap>) list.get(i).get(\"citycode\");\n for (int j = 0; j < templist.size(); j++) {\n DataManager.citycode temp2 = new DataManager.citycode();\n temp2.c_code = (String) templist.get(j).get(\"c_code\");\n temp2.c_name = (String) templist.get(j).get(\"c_name\");\n temp1.citycode.add(temp2);\n }\n DataManager.citysList.add(temp1);\n }\n }\n break;\n case 0x110://获取APP最新版本\n jsonString = (String) response.get();\n DataManager.MyNewAppS = gson.fromJson(jsonString, DataManager.MyNewApp.class);\n WelcomeActivity.handler.sendEmptyMessage(1);\n break;\n case 0x111://获取新闻\n jsonString = (String) response.get();\n DataManager.MyNewsS = gson.fromJson(jsonString, DataManager.MyNews.class);\n if (DataManager.MyNewsS.data.Newslist != null && DataManager.MyNewsS.data.Newslist.size() > 0) {\n MainActivity.MyNewsList = DataManager.MyNewsS.data.Newslist;\n }\n WelcomeActivity.handler.sendEmptyMessage(10);\n break;\n case 0x1111://获取更多新闻\n jsonString = (String) response.get();\n DataManager.MyNewsSMore = gson.fromJson(jsonString, DataManager.MyNews.class);\n if (DataManager.MyNewsSMore.data.Newslist != null && DataManager.MyNewsSMore.data.Newslist.size() > 0) {\n for (int i = 0; i < DataManager.MyNewsSMore.data.Newslist.size(); i++) {\n MainActivity.MyNewsList.add(DataManager.MyNewsSMore.data.Newslist.get(i));\n }\n MainActivity.handler.sendEmptyMessage(0);\n } else {\n MainActivity.handler.sendEmptyMessage(101);\n }\n break;\n case 0x112://获取APP首页轮播图\n jsonString = (String) response.get();\n DataManager.LBimgS = gson.fromJson(jsonString, DataManager.LBimg.class);\n WelcomeActivity.handler.sendEmptyMessage(0);\n break;\n case 0x113://获取最新认领\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n if (DataManager.MyClaimUtilsModel.data.Claimlist != null && DataManager.MyClaimUtilsModel.data.Claimlist.size() > 0) {\n MainActivity.MyCliamList = DataManager.MyClaimUtilsModel.data.Claimlist;\n if (MainActivity.handler != null) {\n MainActivity.handler.sendEmptyMessage(7);\n }\n }\n break;\n case 0x1131://获取最新认领(more)\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n if (DataManager.MyClaimUtilsModel.data.Claimlist != null && DataManager.MyClaimUtilsModel.data.Claimlist.size() > 0) {\n Main_NewCliam_MoreListActivity.MyCliamListMore = DataManager.MyClaimUtilsModel.data.Claimlist;\n MainActivity.handler.sendEmptyMessage(11);\n }\n break;\n case 0x114://获取热点\n jsonString = (String) response.get();\n DataManager.MyHotS = gson.fromJson(jsonString, DataManager.MyHot.class);\n if (DataManager.MyHotS.data != null && DataManager.MyHotS.data.HotspotAnalysis != null && DataManager.MyHotS.data.HotspotAnalysis.size() > 0) {\n MainActivity.MyHotsList = DataManager.MyHotS.data.HotspotAnalysis;\n }\n break;\n case 0x022://搜索结果\n String searchstr = (String) response.get();\n //test\n //searchstr=\"{\\\"message\\\":\\\"true\\\",\\\"status\\\":1,\\\"data\\\":{\\\"Result\\\":[{\\\"PRIPID\\\":\\\"3601032011041300098564\\\",\\\"entname\\\":\\\"江西智容科技有限公司\\\",\\\"REGNO\\\":\\\"360103210025958\\\",\\\"REGORG_CN\\\":\\\"南昌高新技术产业开发区\\\",\\\"NAME\\\":\\\"万杏娥\\\",\\\"OPFROM\\\":\\\"2011-04-28\\\",\\\"OPTO\\\":\\\"2031-04-27\\\",\\\"REGSTATE_CN\\\":\\\"存续(在营、开业、在册)\\\",\\\"C_PROVINCE\\\":\\\"36\\\",\\\"D_ADDTIME\\\":\\\"2016-03-17\\\",\\\"C_STATE\\\":\\\"1\\\",\\\"UNISCID\\\":\\\"null\\\",\\\"REGCAP\\\":\\\"5000.0\\\",\\\"ENTTYPE_CN\\\":\\\"有限责任公司(自然人投资或控股)\\\",\\\"DOM\\\":\\\"江西省南昌市高新技术产业开发区高新区高新二路建昌工业园金庐软件园海外大厦北楼306室\\\",\\\"INDUSTRYPHY\\\":\\\"I\\\",\\\"INDUSTRYPHY_NAME\\\":\\\"信息传输、软件和信息技术服务业\\\",\\\"OPSCOPE\\\":\\\"计算机软件系统开发;办公自动化设备销售;计算机系统集成;国内广告的设计、制作、发布、代理;会展服务(以上项目国家有专项规定的除外)\\\"},{\\\"PRIPID\\\":\\\"20160127091814206993\\\",\\\"entname\\\":\\\"江西智容科技有限公司南昌分公司\\\",\\\"REGNO\\\":\\\"360105220000025\\\",\\\"REGORG_CN\\\":\\\"null\\\",\\\"NAME\\\":\\\"罗川\\\",\\\"OPFROM\\\":\\\"2016-02-04\\\",\\\"OPTO\\\":\\\"null\\\",\\\"REGSTATE_CN\\\":\\\"存续(在营、开业、在册)\\\",\\\"C_PROVINCE\\\":\\\"36\\\",\\\"D_ADDTIME\\\":\\\"2016-03-17\\\",\\\"C_STATE\\\":\\\"null\\\",\\\"UNISCID\\\":\\\"91360105MA35GGBY60\\\",\\\"REGCAP\\\":\\\"null\\\",\\\"ENTTYPE_CN\\\":\\\"有限责任公司分公司(自然人投资或控股)\\\",\\\"DOM\\\":\\\"红星村原红星乡财政所\\\",\\\"INDUSTRYPHY\\\":\\\"L\\\",\\\"INDUSTRYPHY_NAME\\\":\\\"租赁和商业服务业\\\",\\\"OPSCOPE\\\":\\\"餐饮企业管理服务;食堂(主食、热菜、早点)(卫生许可证有效期至2011年5月13日止)(以上项目国家有专项规定的除外)\\\"}],\\\"Paging\\\":{\\\"PageSize\\\":40,\\\"PageIndex\\\":0,\\\"TotalRecords\\\":2}}}\";\n map = gson.fromJson(searchstr, new TypeToken<Map<String, Object>>() {\n }.getType());\n// List<DataManager.search> searchstrlist2 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Result\").toString(), new TypeToken<List<DataManager.search>>() {\n// }.getType());\n// DataManager.searchList = searchstrlist2;\n baging = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Paging\").toString(), DataManager.baging.class);\n List<LinkedTreeMap> searchstrlist2 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"Result\");//余思\n if (DataManager.searchList.size() != 0) {\n DataManager.searchList.clear();\n }\n if (DataManager.searchListMore.size() != 0) {\n DataManager.searchListMore.clear();\n }\n for (LinkedTreeMap temp : searchstrlist2) {\n DataManager.search serchtemp = new DataManager.search();\n\n serchtemp.ENTTYPE = (String) temp.get(\"ENTTYPE\");\n\n serchtemp.PRIPID = (String) temp.get(\"PRIPID\");\n serchtemp.ENTNAME = (String) temp.get(\"ENTNAME\");\n serchtemp.REGNO = (String) temp.get(\"REGNO\");\n serchtemp.REGORG_CN = (String) temp.get(\"REGORG_CN\");\n serchtemp.NAME = (String) temp.get(\"NAME\");\n serchtemp.OPFROM = (String) temp.get(\"ESTDATE\");//以前是OPFROM后来无缘无故变成ESTDATE\n serchtemp.OPTO = (String) temp.get(\"OPTO\");\n serchtemp.REGSTATE_CN = (String) temp.get(\"REGSTATE_CN\");\n serchtemp.C_PROVINCE = (String) temp.get(\"C_PROVINCE\");\n serchtemp.D_ADDTIME = (Object) temp.get(\"D_ADDTIME\");\n serchtemp.C_STATE = (String) temp.get(\"C_STATE\");\n if (String.valueOf(temp.get(\"REGCAP\")) == \"null\") {\n serchtemp.REGCAP = \"0\";\n }\n if (((String) temp.get(\"REGCAP\")).contains(\".\")) {\n serchtemp.REGCAP = ((String) temp.get(\"REGCAP\")).substring(0, ((String) temp.get(\"REGCAP\")).indexOf(\".\"));//查企业,品牌和失信判定是否有小数点\n } else {\n serchtemp.REGCAP = (String) temp.get(\"REGCAP\");\n }\n serchtemp.ENTTYPE_CN = (String) temp.get(\"ENTTYPE_CN\");\n serchtemp.DOM = (String) temp.get(\"DOM\");\n serchtemp.INDUSTRYPHY = (String) temp.get(\"INDUSTRYPHY\");\n serchtemp.INDUSTRYPHY_NAME = (String) temp.get(\"INDUSTRYPHY_NAME\");\n serchtemp.OPSCOPE = (String) temp.get(\"OPSCOPE\");\n DataManager.searchList.add(serchtemp);\n }\n if (DataManager.searchList != null && DataManager.searchList.size() > 0) {\n SearchFirmActivty.handler.sendEmptyMessage(0);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n break;\n case 0x0221://搜索加载更多\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n baging = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"Paging\").toString(), DataManager.baging.class);\n List<LinkedTreeMap> searchstrlist22 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"Result\");\n if (DataManager.searchListMore.size() != 0) {\n DataManager.searchListMore.clear();\n }\n for (LinkedTreeMap temp : searchstrlist22) {\n DataManager.search serchtemp = new DataManager.search();\n serchtemp.ENTTYPE = (String) temp.get(\"ENTTYPE\");\n serchtemp.PRIPID = (String) temp.get(\"PRIPID\");\n serchtemp.ENTNAME = (String) temp.get(\"ENTNAME\");\n serchtemp.REGNO = (String) temp.get(\"REGNO\");\n serchtemp.REGORG_CN = (String) temp.get(\"REGORG_CN\");\n serchtemp.NAME = (String) temp.get(\"NAME\");\n serchtemp.OPFROM = (String) temp.get(\"ESTDATE\");//以前是OPFROM后来无缘无故变成ESTDATE\n serchtemp.OPTO = (String) temp.get(\"OPTO\");\n serchtemp.REGSTATE_CN = (String) temp.get(\"REGSTATE_CN\");\n serchtemp.C_PROVINCE = (String) temp.get(\"C_PROVINCE\");\n serchtemp.D_ADDTIME = (Object) temp.get(\"D_ADDTIME\");\n serchtemp.C_STATE = (String) temp.get(\"C_STATE\");\n if (String.valueOf(temp.get(\"REGCAP\")) == \"null\") {\n serchtemp.REGCAP = \"0\";\n }\n if (((String) temp.get(\"REGCAP\")).contains(\".\")) {\n serchtemp.REGCAP = ((String) temp.get(\"REGCAP\")).substring(0, ((String) temp.get(\"REGCAP\")).indexOf(\".\"));//查企业,品牌和失信去小数点\n } else {\n serchtemp.REGCAP = (String) temp.get(\"REGCAP\");\n }\n\n serchtemp.ENTTYPE_CN = (String) temp.get(\"ENTTYPE_CN\");\n serchtemp.DOM = (String) temp.get(\"DOM\");\n serchtemp.INDUSTRYPHY = (String) temp.get(\"INDUSTRYPHY\");\n serchtemp.INDUSTRYPHY_NAME = (String) temp.get(\"INDUSTRYPHY_NAME\");\n serchtemp.OPSCOPE = (String) temp.get(\"OPSCOPE\");\n DataManager.searchListMore.add(serchtemp);\n }\n if (DataManager.searchListMore != null && DataManager.searchListMore.size() > 0) {\n SearchFirmActivty.handler.sendEmptyMessage(0);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n break;\n case 0x023://预留获取行业\n// gson = new Gson();\n// String str3 = (String) response.get();\n// map = gson.fromJson(str3, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<LinkedTreeMap> listtemp = (List<LinkedTreeMap>) map.get(\"data\");\n// String jsonstradd = gson.toJson(listtemp);\n// List<DataManager.industryData> listtemps = gson.fromJson(jsonstradd, new TypeToken<List<DataManager.Data>>() {\n// }.getType());\n// DataManager.dataList = listtemps;\n// for (DataManager.industryData dt : DataManager.dataList) {\n// DataManager.SubyList = dt.SubIndustryList;\n// }\n /*DataManager.industry industry1 = null;\n String industry = (String) response.get();*/\n\n /* try {\n JSONObject a=new JSONObject(industry);\n JSONArray array=a.getJSONArray(\"data\");\n for(int i=0;i<array.length();i++){\n JSONObject b=array.getJSONObject(i);\n DataManager.industry.Name= (String) b.get(\"Name\");\n DataManager.industry.Code=(String) b.get(\"Code\");\n DataManager.industry.Desc=(String) b.get(\"Desc\");\n JSONArray array1=b.getJSONArray(\"SubIndustryList\");\n for(int j=0;j<array1.length();j++){\n JSONObject c =(JSONObject) array1.get(j);\n DataManager.industry.SubIndustryList.add((String) c.get(\"Name\"));\n }\n DataManager.industryList.add(industry1);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }*/\n String str3 = (String) response.get();\n map = gson.fromJson(str3, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (((LinkedTreeMap) map.get(\"data\")).size() != 0) {\n List<LinkedTreeMap> list4 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"industry\");\n if (DataManager.industryDataList.size() != 0) {\n DataManager.industryDataList.clear();\n }\n for (LinkedTreeMap tempTree : list4) {\n DataManager.industryData industryData = new DataManager.industryData();\n industryData.EC_VALUE = (String) tempTree.get(\"EC_VALUE\");\n industryData.EC_NAME = (String) tempTree.get(\"EC_NAME\");\n DataManager.industryDataList.add(industryData);\n }\n }\n\n break;\n case 0x024://获取企业详情24宫格等\n jsonString = (String) response.get();\n try {\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> lists2 = null;\n if (map.get(\"data\") != null && !map.get(\"data\").equals(null) && ((Map<String, Object>) map.get(\"data\")).get(\"allcount\") != null && !((Map<String, Object>) map.get(\"data\")).get(\"allcount\").equals(null)) {\n lists2 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"allcount\");\n }\n List<LinkedTreeMap> lists3 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"baseinfo\");\n if (DataManager.allcountsList != null) {\n DataManager.allcountsList.clear();\n }\n if (DataManager.BaseinfoList != null) {\n DataManager.BaseinfoList.clear();\n }\n\n if (lists2 != null && lists2.size() > 0) {\n for (LinkedTreeMap temp : lists2) {\n DataManager.allcount cfo = new DataManager.allcount();\n cfo.EnterAddtionID = temp.get(\"EnterAddtionID\").toString();\n cfo.IsFavorite = temp.get(\"IsFavorite\").toString();\n cfo.HonorCount = temp.get(\"HonorCount\").toString();\n cfo.JudiciaryCount = temp.get(\"JudiciaryCount\").toString();\n cfo.PledgeCount = temp.get(\"PledgeCount\").toString();\n cfo.CopyrightCount = temp.get(\"CopyrightCount\").toString();\n cfo.AnnualCount = temp.get(\"AnnualCount\").toString();\n cfo.AdvertisementCount = temp.get(\"AdvertisementCount\").toString();\n cfo.BaseInfoCount = temp.get(\"BaseInfoCount\").toString();\n cfo.ApprovalCount = temp.get(\"ApprovalCount\").toString();\n cfo.PunishCount = temp.get(\"PunishCount\").toString();\n cfo.WarningCount = temp.get(\"WarningCount\").toString();\n cfo.TrademarkCount = temp.get(\"TrademarkCount\").toString();\n cfo.AbnormityCount = temp.get(\"AbnormityCount\").toString();\n cfo.CreditCount = temp.get(\"CreditCount\").toString();\n cfo.SupportCount = temp.get(\"SupportCount\").toString();\n cfo.MortgagorCount = temp.get(\"MortgagorCount\").toString();\n cfo.PatentCount = temp.get(\"PatentCount\").toString();\n cfo.PageView = temp.get(\"PageView\").toString();\n cfo.IsClaim = temp.get(\"IsClaim\").toString();\n cfo.EntShowCount = temp.get(\"EntShowCount\").toString();//++\n cfo.BiddingCount = temp.get(\"BiddingCount\").toString();\n cfo.JobCount = temp.get(\"JobCount\").toString();\n cfo.EntNewCount = temp.get(\"EntNewCount\").toString();\n DataManager.allcountsList.add(cfo);\n }\n }\n if (lists3 != null && lists3.size() > 0) {\n for (LinkedTreeMap temp : lists3) {\n DataManager.Baseinfo cfo = new DataManager.Baseinfo();\n cfo.REGSTATE = temp.get(\"REGSTATE\").toString();\n cfo.REGNO = temp.get(\"REGNO\").toString();\n cfo.NAME = temp.get(\"NAME\").toString();\n cfo.REGCAP = temp.get(\"REGCAP\").toString();\n cfo.ESTDATE = temp.get(\"ESTDATE\").toString();\n cfo.ENTTYPE_CN = temp.get(\"ENTTYPE_CN\").toString();\n cfo.ENTNAME = temp.get(\"ENTNAME\").toString();\n cfo.REGSTATE_CN = temp.get(\"REGSTATE_CN\").toString();\n cfo.UNISCID = temp.get(\"UNISCID\").toString();\n cfo.PRIPID = temp.get(\"PRIPID\").toString();\n cfo.ENTTYPE = temp.get(\"ENTTYPE\").toString();\n DataManager.BaseinfoList.add(cfo);\n }\n }\n if (DataManager.allcountsList != null && DataManager.allcountsList.size() > 0) {\n SearchFirmActivty.handler.sendEmptyMessage(5);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n } catch (NullPointerException e) {\n e.printStackTrace();\n Toast.show(\"该企业暂无数据\");\n SearchFirmActivty.pd.dismiss();\n }\n break;\n case 0x025://我的关注跳公司详情界面的请求\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> lists25 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"allcount\");\n List<LinkedTreeMap> lists35 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"baseinfo\");\n if (DataManager.allcountsList != null) {\n DataManager.allcountsList.clear();\n }\n if (DataManager.BaseinfoList != null) {\n DataManager.BaseinfoList.clear();\n }\n if (lists25 != null && lists25.size() > 0) {\n for (LinkedTreeMap temp : lists25) {\n DataManager.allcount cfo = new DataManager.allcount();\n cfo.EnterAddtionID = temp.get(\"EnterAddtionID\").toString();\n cfo.IsFavorite = temp.get(\"IsFavorite\").toString();\n cfo.HonorCount = temp.get(\"HonorCount\").toString();\n cfo.JudiciaryCount = temp.get(\"JudiciaryCount\").toString();\n cfo.PledgeCount = temp.get(\"PledgeCount\").toString();\n cfo.CopyrightCount = temp.get(\"CopyrightCount\").toString();\n cfo.AnnualCount = temp.get(\"AnnualCount\").toString();\n cfo.AdvertisementCount = temp.get(\"AdvertisementCount\").toString();\n cfo.BaseInfoCount = temp.get(\"BaseInfoCount\").toString();\n cfo.ApprovalCount = temp.get(\"ApprovalCount\").toString();\n cfo.PunishCount = temp.get(\"PunishCount\").toString();\n cfo.WarningCount = temp.get(\"WarningCount\").toString();\n cfo.TrademarkCount = temp.get(\"TrademarkCount\").toString();\n cfo.AbnormityCount = temp.get(\"AbnormityCount\").toString();\n cfo.CreditCount = temp.get(\"CreditCount\").toString();\n cfo.SupportCount = temp.get(\"SupportCount\").toString();\n cfo.MortgagorCount = temp.get(\"MortgagorCount\").toString();\n cfo.PatentCount = temp.get(\"PatentCount\").toString();\n cfo.PageView = temp.get(\"PageView\").toString();\n cfo.IsClaim = temp.get(\"IsClaim\").toString();\n cfo.EntShowCount = temp.get(\"EntShowCount\").toString();//++\n cfo.BiddingCount = temp.get(\"BiddingCount\").toString();\n cfo.JobCount = temp.get(\"JobCount\").toString();\n cfo.EntNewCount = temp.get(\"EntNewCount\").toString();\n DataManager.allcountsList.add(cfo);\n }\n }\n if (lists35 != null && lists35.size() > 0) {\n for (LinkedTreeMap temp : lists35) {\n DataManager.Baseinfo cfo = new DataManager.Baseinfo();\n cfo.REGSTATE = temp.get(\"REGSTATE\").toString();\n cfo.REGNO = temp.get(\"REGNO\").toString();\n cfo.NAME = temp.get(\"NAME\").toString();\n cfo.REGCAP = temp.get(\"REGCAP\").toString();\n cfo.ESTDATE = temp.get(\"ESTDATE\").toString();\n cfo.ENTTYPE_CN = temp.get(\"ENTTYPE_CN\").toString();\n cfo.ENTNAME = temp.get(\"ENTNAME\").toString();\n cfo.REGSTATE_CN = temp.get(\"REGSTATE_CN\").toString();\n cfo.UNISCID = temp.get(\"UNISCID\").toString();\n cfo.PRIPID = temp.get(\"PRIPID\").toString();\n cfo.ENTTYPE = temp.get(\"ENTTYPE\").toString();\n DataManager.BaseinfoList.add(cfo);\n }\n }\n if (DataManager.allcountsList != null && DataManager.allcountsList.size() > 0) {\n MyconcernActivity.handler.sendEmptyMessage(1);\n } else {\n SearchFirmActivty.handler.sendEmptyMessage(500);\n }\n break;\n case 0x026://主界面 跳公司详情\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> lists26 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"allcount\");\n List<LinkedTreeMap> lists261 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"baseinfo\");\n if (DataManager.allcountsList != null) {\n DataManager.allcountsList.clear();\n }\n if (DataManager.BaseinfoList != null) {\n DataManager.BaseinfoList.clear();\n }\n if (lists26 != null && lists26.size() > 0) {\n for (LinkedTreeMap temp : lists26) {\n DataManager.allcount cfo = new DataManager.allcount();\n cfo.EnterAddtionID = temp.get(\"EnterAddtionID\").toString();\n cfo.IsFavorite = temp.get(\"IsFavorite\").toString();\n cfo.HonorCount = temp.get(\"HonorCount\").toString();\n cfo.JudiciaryCount = temp.get(\"JudiciaryCount\").toString();\n cfo.PledgeCount = temp.get(\"PledgeCount\").toString();\n cfo.CopyrightCount = temp.get(\"CopyrightCount\").toString();\n cfo.AnnualCount = temp.get(\"AnnualCount\").toString();\n cfo.AdvertisementCount = temp.get(\"AdvertisementCount\").toString();\n cfo.BaseInfoCount = temp.get(\"BaseInfoCount\").toString();\n cfo.ApprovalCount = temp.get(\"ApprovalCount\").toString();\n cfo.PunishCount = temp.get(\"PunishCount\").toString();\n cfo.WarningCount = temp.get(\"WarningCount\").toString();\n cfo.TrademarkCount = temp.get(\"TrademarkCount\").toString();\n cfo.AbnormityCount = temp.get(\"AbnormityCount\").toString();\n cfo.CreditCount = temp.get(\"CreditCount\").toString();\n cfo.SupportCount = temp.get(\"SupportCount\").toString();\n cfo.MortgagorCount = temp.get(\"MortgagorCount\").toString();\n cfo.PatentCount = temp.get(\"PatentCount\").toString();\n cfo.PageView = temp.get(\"PageView\").toString();\n cfo.IsClaim = temp.get(\"IsClaim\").toString();\n cfo.EntShowCount = temp.get(\"EntShowCount\").toString();//++\n cfo.BiddingCount = temp.get(\"BiddingCount\").toString();\n cfo.JobCount = temp.get(\"JobCount\").toString();\n cfo.EntNewCount = temp.get(\"EntNewCount\").toString();\n DataManager.allcountsList.add(cfo);\n }\n }\n if (lists261 != null && lists261.size() > 0) {\n for (LinkedTreeMap temp : lists261) {\n DataManager.Baseinfo cfo = new DataManager.Baseinfo();\n cfo.REGSTATE = temp.get(\"REGSTATE\").toString();\n cfo.REGNO = temp.get(\"REGNO\").toString();\n cfo.NAME = temp.get(\"NAME\").toString();\n cfo.REGCAP = temp.get(\"REGCAP\").toString();\n cfo.ESTDATE = temp.get(\"ESTDATE\").toString();\n cfo.ENTTYPE_CN = temp.get(\"ENTTYPE_CN\").toString();\n cfo.ENTNAME = temp.get(\"ENTNAME\").toString();\n cfo.REGSTATE_CN = temp.get(\"REGSTATE_CN\").toString();\n cfo.UNISCID = temp.get(\"UNISCID\").toString();\n cfo.PRIPID = temp.get(\"PRIPID\").toString();\n cfo.ENTTYPE = temp.get(\"ENTTYPE\").toString();\n DataManager.BaseinfoList.add(cfo);\n }\n }\n if (DataManager.allcountsList != null && DataManager.allcountsList.size() > 0) {\n MainActivity.handler.sendEmptyMessage(8);\n }\n break;\n case 0x000://工商信息\n /*DataManager.Data0List.clear();\n String jstring0 = (String) response.get();\n DataManager.Root0 jsonRoot0 = gson.fromJson(jstring0, new TypeToken<DataManager.Root0>() {\n }.getType());\n DataManager.Data0 dt = jsonRoot0.data;\n DataManager.Data0List.add(dt);\n if (DataManager.Data0List != null && DataManager.Data0List.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(0);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }*/\n\n jsonString = (String) response.get();\n DataManager.gsxx = gson.fromJson(jsonString, DataManager.GSXX.class);\n if (DataManager.gsxx != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(0);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x001://行政信息\n String jstring1 = (String) response.get();\n map = gson.fromJson(jstring1, new TypeToken<Map<String, Object>>() {\n }.getType());\n\n List<LinkedTreeMap> list1 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"administrative\");\n List<LinkedTreeMap> list221 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"other\");\n if (DataManager.ad_List != null) {\n DataManager.ad_List.clear();\n }\n if (DataManager.admin_other_List != null) {\n DataManager.admin_other_List.clear();\n }\n if (list1 != null && list1.size() > 0) {\n for (LinkedTreeMap temp : list1) {\n DataManager.administraton cfo = new DataManager.administraton();\n cfo.PRIPID = (String) temp.get(\"PRIPID\");\n cfo.LICNAME = (String) temp.get(\"LICNAME\");\n cfo.LICNO = (String) temp.get(\"LICNO\");\n cfo.VALFROM = (String) temp.get(\"VALFROM\");\n cfo.LICANTH = (String) temp.get(\"LICANTH\");\n cfo.VALTO = (String) temp.get(\"VALTO\");\n DataManager.ad_List.add(cfo);\n }\n }\n if (list221 != null && list221.size() > 0) {\n for (LinkedTreeMap temp : list221) {\n DataManager.admin_other cfo = new DataManager.admin_other();\n cfo.LICANTH = (String) temp.get(\"LICANTH\");\n cfo.REGNO = (String) temp.get(\"REGNO\");\n cfo.VALFROM = (String) temp.get(\"VALFROM\");\n cfo.LICNAME_CN = (String) temp.get(\"LICNAME_CN\");\n cfo.LICID = (String) temp.get(\"LICID\");\n cfo.ENTNAME = (String) temp.get(\"ENTNAME\");\n cfo.LICNO = (String) temp.get(\"LICNO\");\n cfo.VALTO = (String) temp.get(\"VALTO\");\n cfo.PRIPID = (String) temp.get(\"PRIPID\");\n cfo.TYPE = (String) temp.get(\"TYPE\");\n cfo.LICITEM = (String) temp.get(\"LICITEM\");\n DataManager.admin_other_List.add(cfo);\n }\n }\n if (DataManager.ad_List != null || DataManager.admin_other_List != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(1);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x002://荣誉信息\n String jstring2 = (String) response.get();\n// map = gson.fromJson(jstring2, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.honorInfo> list2 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"chattel\").toString().trim(), new TypeToken<List<DataManager.honorInfo>>() {\n// }.getType());\n// DataManager.honorInfoList = list2;\n// 以下代码解决空格问题c\n map = gson.fromJson(jstring2, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list2 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"chattel\");\n\n if (DataManager.honorInfoList != null) {\n DataManager.honorInfoList.clear();\n }\n if (list2 != null && list2.size() > 0) {\n for (LinkedTreeMap temp : list2) {\n DataManager.honorInfo cfo = new DataManager.honorInfo();\n cfo.HONORID = (String) temp.get(\"HONORID\");\n cfo.HONORNAME = (String) temp.get(\"HONORNAME\");\n cfo.HONORCONTENT = (String) temp.get(\"HONORCONTENT\");\n cfo.ORGAN = (String) temp.get(\"ORGAN\");\n cfo.C_UNIQUE_CODE = (String) temp.get(\"C_UNIQUE_CODE\");\n\n DataManager.honorInfoList.add(cfo);\n }\n }\n\n if (DataManager.honorInfoList != null && DataManager.honorInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(2);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x003://企业扶持信息\n String jstring3 = (String) response.get();\n DataManager.supportInfoS = gson.fromJson(jstring3, DataManager.supportInfo.class);\n if (DataManager.supportInfoS != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(3);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x004://抵押信息/动产\n jsonString = (String) response.get();\n DataManager.MychattelS = gson.fromJson(jsonString, DataManager.Mychattel.class);\n break;\n case 0x0041://抵押信息/不动产\n jsonString = (String) response.get();\n DataManager.MyrealEstateS = gson.fromJson(jsonString, DataManager.MyrealEstate.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(4);\n break;\n case 0x005://出质信息\n String jstring5 = (String) response.get();\n DataManager.Root5 jsonRoot5 = gson.fromJson(jstring5, new TypeToken<DataManager.Root5>() {\n }.getType());\n DataManager.pledgeInfoList = jsonRoot5.data;\n if (DataManager.pledgeInfoList != null && DataManager.pledgeInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(5);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x006://司法信息\n String jstring6 = (String) response.get();\n map = gson.fromJson(jstring6, new TypeToken<Map<String, Object>>() {\n }.getType());\n /**\n * json报错解析方法\n */\n// List<DataManager.JudicialDocuments> list61 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"judicialDocuments\").toString(), new TypeToken<List<DataManager.JudicialDocuments>>() {\n// }.getType());\n// List<DataManager.CrackCredit> list62 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"crackCredit\").toString(), new TypeToken<List<DataManager.CrackCredit>>() {\n// }.getType());\n// List<DataManager.ShareholderInformationChange> list63 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"shareholderInformationChange\").toString(), new TypeToken<List<DataManager.ShareholderInformationChange>>() {\n// }.getType());\n// List<DataManager.FrozenInformation> list64 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"frozenInformation\").toString(), new TypeToken<List<DataManager.FrozenInformation>>() {\n// }.getType());\n List<LinkedTreeMap> list61 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"judicialDocuments\");\n List<LinkedTreeMap> list62 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"crackCredit\");\n List<LinkedTreeMap> list63 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"shareholderInformationChange\");\n List<LinkedTreeMap> list64 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"frozenInformation\");\n /**\n * 司法文书信息\n */\n if (DataManager.JudicialDocumentsList != null) {\n DataManager.JudicialDocumentsList.clear();\n }\n if (list61 != null && list61.size() > 0) {\n for (LinkedTreeMap temp : list61) {\n DataManager.JudicialDocuments jud = new DataManager.JudicialDocuments();\n jud.CASENUM = (String) temp.get(\"CASENUM\");\n jud.REDECORG_CN = (String) temp.get(\"REDECORG_CN\");\n jud.SENTENCECONMENT = (String) temp.get(\"SENTENCECONMENT\");\n jud.SENTENCEDATE = (String) temp.get(\"SENTENCEDATE\");\n jud.SUPDEPARTMENT = (String) temp.get(\"SUPDEPARTMENT\");\n DataManager.JudicialDocumentsList.add(jud);\n }\n }\n /**\n * 失信被执行人信息\n */\n if (DataManager.CrackCreditList != null) {\n DataManager.CrackCreditList.clear();\n }\n if (list62 != null && list62.size() > 0) {\n for (LinkedTreeMap temp : list62) {\n DataManager.CrackCredit cra = new DataManager.CrackCredit();\n cra.COURT_NAME = (String) temp.get(\"COURT_NAME\");\n cra.COURTCASEID = (String) temp.get(\"COURTCASEID\");\n cra.DISREPUT_TYPE_NAME = (String) temp.get(\"DISREPUT_TYPE_NAME\");\n cra.GIST_CID = (String) temp.get(\"GIST_CID\");\n cra.PERFORMANCE = (String) temp.get(\"PERFORMANCE\");\n cra.REG_DATE = (String) temp.get(\"REG_DATE\");\n cra.DUTY = (String) temp.get(\"DUTY\");\n DataManager.CrackCreditList.add(cra);\n }\n }\n /**\n * 股东变更信息\n */\n if (DataManager.ShareholderInformationChangeList != null) {\n DataManager.ShareholderInformationChangeList.clear();\n }\n if (list63 != null && list63.size() > 0) {\n for (LinkedTreeMap temp : list63) {\n DataManager.ShareholderInformationChange sha = new DataManager.ShareholderInformationChange();\n sha.ALIEN = (String) temp.get(\"ALIEN\");\n sha.FROAM = (Double) temp.get(\"FROAM\");\n sha.FROAUTH = (String) temp.get(\"FROAUTH\");\n sha.INV = (String) temp.get(\"INV\");\n sha.REGNO = (String) temp.get(\"REGNO\");\n DataManager.ShareholderInformationChangeList.add(sha);\n }\n }\n /**\n * 股权冻结信息\n */\n if (DataManager.FrozenInformationList != null) {\n DataManager.FrozenInformationList.clear();\n }\n if (list64 != null && list64.size() > 0) {\n for (LinkedTreeMap temp : list64) {\n DataManager.FrozenInformation fro = new DataManager.FrozenInformation();\n fro.FROAM = (String) temp.get(\"FROAM\");\n fro.FROAUTH = (String) temp.get(\"FROAUTH\");\n fro.FROFROM = (String) temp.get(\"FROFROM\");\n fro.FROID = (String) temp.get(\"FROID\");\n fro.FROZDEADLINE = (String) temp.get(\"FROZDEADLINE\");\n fro.INVTYPE_CN = (String) temp.get(\"INVTYPE_CN\");\n DataManager.FrozenInformationList.add(fro);\n }\n }\n\n// DataManager.JudicialDocumentsList = list61;//司法文书信息\n// DataManager.CrackCreditList = list62;//失信被执行人信息\n// DataManager.ShareholderInformationChangeList = list63;//股东变更信息\n// DataManager.FrozenInformationList = list64;//股权冻结信息\n\n CompanyDetailsActivity.handler.sendEmptyMessage(6);\n break;\n case 0x007://预警信息zlh\n String jsonstring = (String) response.get();\n DataManager.AlertInfoS = gson.fromJson(jsonstring, DataManager.AlertInfo.class);\n if (DataManager.AlertInfoS.data.size() > 0 && DataManager.AlertInfoS != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(7);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x008://行政处罚\n String jstring8 = (String) response.get();\n DataManager.Root8 jsonRoot8 = gson.fromJson(jstring8, new TypeToken<DataManager.Root8>() {\n }.getType());\n DataManager.punishInfoList = jsonRoot8.data;\n if (DataManager.punishInfoList.size() > 0 && DataManager.punishInfoList != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(8);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x009://经营异常信息\n jsonString = (String) response.get();\n// map = gson.fromJson(jstring9, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.abnormalInfo> list9 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"abNormal\").toString(), new TypeToken<List<DataManager.abnormalInfo>>() {\n// }.getType());\n// map = gson.fromJson(jstring9, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<LinkedTreeMap> list9 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"abNormal\");\n//\n// if (DataManager.abnormalInfoList != null) {\n// DataManager.abnormalInfoList.clear();\n// }\n// if (list9 != null && list9.size() > 0) {\n// for (LinkedTreeMap temp : list9) {\n// DataManager.abnormalInfo cfo = new DataManager.abnormalInfo();\n// cfo.BUSEXCLIST = (String) temp.get(\"BUSEXCLIST\");\n// cfo.SPECAUSE_CN = (String) temp.get(\"SPECAUSE_CN\");\n// cfo.ABNTIME = (String) temp.get(\"ABNTIME\");\n// cfo.DECORG_CN = (String) temp.get(\"DECORG_CN\");\n// cfo.REMEXCPRES_CN = (String) temp.get(\"REMEXCPRES_CN\");\n// cfo.REMDATE = (String) temp.get(\"REMDATE\");\n// cfo.REDECORG_CN = (String) temp.get(\"REDECORG_CN\");\n// DataManager.abnormalInfoList.add(cfo);\n// }\n\n DataManager.abnormalInfoS = gson.fromJson(jsonString, DataManager.abnormalInfo.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(9);\n\n break;\n case 0x010://专利信息\n jsonString = (String) response.get();\n DataManager.PatentInfoS = gson.fromJson(jsonString, DataManager.PatentInfo.class);\n if (DataManager.PatentInfoS.data.patentInfo != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(10);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x01012://专利信息(加载更多)\n jsonString = (String) response.get();\n DataManager.PatentInfoS = gson.fromJson(jsonString, DataManager.PatentInfo.class);\n if (DataManager.PatentInfoS.data.patentInfo != null) {\n PatentActivity.handler.sendEmptyMessage(0);\n }\n\n break;\n case 0x011://商标信息\n jsonString = (String) response.get();\n DataManager.trademarkModelS = gson.fromJson(jsonString, DataManager.trademarkModel.class);\n if (DataManager.trademarkModelS.data.trademark.size() > 0 && DataManager.trademarkModelS.data.trademark != null) {\n CompanyDetailsActivity.handler.sendEmptyMessage(11);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x01112://商标信息(加载更多)\n jsonString = (String) response.get();\n DataManager.trademarkModelS = gson.fromJson(jsonString, DataManager.trademarkModel.class);\n if (DataManager.trademarkModelS.data.trademark.size() > 0 && DataManager.trademarkModelS.data.trademark != null) {\n TrademarkActivity.handler.sendEmptyMessage(0);\n }\n break;\n case 0x012://著作信息\n String jstrin12 = (String) response.get();\n map = gson.fromJson(jstrin12, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list112 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"patentInfo\");\n List<LinkedTreeMap> list112_1 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"patentInfoSoftwore\");\n ;\n\n\n if (DataManager.copyrightInfoeList != null) {\n DataManager.copyrightInfoeList.clear();\n }\n\n if (list112 != null && list112.size() > 0) {\n for (LinkedTreeMap temp : list112) {\n DataManager.copyrightInfo cfo = new DataManager.copyrightInfo();\n cfo.ID = (String) temp.get(\"ID\");\n cfo.REGISTERDATA = (String) temp.get(\"REGISTERDATA\");\n cfo.REGISTERID = (String) temp.get(\"REGISTERID\");\n\n cfo.WORKNAME = (String) temp.get(\"WORKNAME\");\n cfo.WORKCLASS = (String) temp.get(\"WORKCLASS\");\n cfo.FINISHDATE = (String) temp.get(\"FINISHDATE\");\n cfo.FIRSTDATE = (String) temp.get(\"FIRSTDATE\");\n DataManager.copyrightInfoeList.add(cfo);\n }\n }\n if (list112_1 != null && list112_1.size() > 0) {\n for (LinkedTreeMap temp : list112_1) {\n DataManager.copyrightInfo cfo = new DataManager.copyrightInfo();\n cfo.ID = (String) temp.get(\"ID\");\n cfo.REGISTERDATA = (String) temp.get(\"REGISTERDATA\");\n cfo.REGISTERID = (String) temp.get(\"REGISTERID\");\n\n cfo.WORKCLASS = \"软件\";//额外附加值\n\n cfo.SOFTWARENAME = (String) temp.get(\"SOFTWARENAME\");\n cfo.SOFTWARESHORT = (String) temp.get(\"SOFTWARESHORT\");\n cfo.STARTINGDATE = (String) temp.get(\"STARTINGDATE\");\n DataManager.copyrightInfoeList.add(cfo);\n }\n }\n\n if (DataManager.copyrightInfoeList != null && DataManager.copyrightInfoeList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(12);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x013://广告资质\n String jstring13 = (String) response.get();\n// map = gson.fromJson(jstring13, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.advertisementInfo> list13 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"advertising\").toString(), new TypeToken<List<DataManager.advertisementInfo>>() {\n// }.getType());\n// DataManager.advertisementInfoList = list13;\n\n map = gson.fromJson(jstring13, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list13 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"advertising\");\n\n if (DataManager.advertisementInfoList != null) {\n DataManager.advertisementInfoList.clear();\n }\n if (list13 != null && list13.size() > 0) {\n for (LinkedTreeMap temp : list13) {\n DataManager.advertisementInfo cfo = new DataManager.advertisementInfo();\n cfo.ADVERTID = (String) temp.get(\"ADVERTID\");\n cfo.C_LEVEL = (String) temp.get(\"C_LEVEL\");\n cfo.CATEGORY = (String) temp.get(\"CATEGORY\");\n cfo.IDENTIFYDATE = (String) temp.get(\"IDENTIFYDATE\");\n cfo.VALFORM = (String) temp.get(\"VALFORM\");\n cfo.VALTO = (String) temp.get(\"VALTO\");\n cfo.IDENTIFYORGANS = (String) temp.get(\"IDENTIFYORGANS\");\n DataManager.advertisementInfoList.add(cfo);\n }\n }\n\n if (DataManager.advertisementInfoList != null && DataManager.advertisementInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(13);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x014://守合同重信用信息\n String jstring14 = (String) response.get();\n// map = gson.fromJson(jstring14, new TypeToken<Map<String, Object>>() {\n// }.getType());\n// List<DataManager.obeyedInfo> list14 = gson.fromJson(((Map<String, Object>) map.get(\"data\")).get(\"contractInfo\").toString(), new TypeToken<List<DataManager.obeyedInfo>>() {\n// }.getType());\n// DataManager.obeyedInfoList = list14;\n map = gson.fromJson(jstring14, new TypeToken<Map<String, Object>>() {\n }.getType());\n List<LinkedTreeMap> list14 = (List<LinkedTreeMap>) ((Map<String, Object>) map.get(\"data\")).get(\"contractInfo\");\n\n if (DataManager.obeyedInfoList != null) {\n DataManager.obeyedInfoList.clear();\n }\n if (list14 != null && list14.size() > 0) {\n for (LinkedTreeMap temp : list14) {\n DataManager.obeyedInfo cfo = new DataManager.obeyedInfo();\n cfo.PRIPID = (String) temp.get(\"PRIPID\");\n cfo.ENTNAME = (String) temp.get(\"ENTNAME\");\n cfo.REGNO = (String) temp.get(\"REGNO\");\n cfo.UNISCID = (String) temp.get(\"UNISCID\");\n cfo.CONTENT = (String) temp.get(\"CONTENT\");\n cfo.IDENTIFYDATE = (String) temp.get(\"IDENTIFYDATE\");\n cfo.IDENTIFYORGANS = (String) temp.get(\"IDENTIFYORGANS\");\n cfo.STATE = (String) temp.get(\"STATE\");\n DataManager.obeyedInfoList.add(cfo);\n }\n }\n if (DataManager.obeyedInfoList != null && DataManager.obeyedInfoList.size() > 0) {\n CompanyDetailsActivity.handler.sendEmptyMessage(14);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n\n break;\n case 0x015://自主公示zlh\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if ((List<LinkedTreeMap>) map.get(\"data\") != null) {\n List<LinkedTreeMap> listtemp = (List<LinkedTreeMap>) map.get(\"data\");\n\n for (int i = 0; i < listtemp.size(); i++) {\n switch (listtemp.get(i).get(\"type\").toString()) {\n case \"企业年报\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.reportList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.report>>() {\n }.getType());*/\n if (DataManager.reportList.size() > 0 || DataManager.reportList != null) {\n DataManager.reportList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.report report = new DataManager.report();\n report.ANCHEDATE = (String) r.get(\"ANCHEDATE\");\n report.ANCHEID = (String) r.get(\"ANCHEID\");\n report.ANCHEYEAR = (String) r.get(\"ANCHEYEAR\");\n DataManager.reportList.add(report);\n }\n\n }\n break;\n case \"股东及出资信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.fundedList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.funded>>() {\n }.getType());*/\n if (DataManager.fundedList.size() > 0 || DataManager.fundedList != null) {\n DataManager.fundedList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.funded funded = new DataManager.funded();\n funded.ACCONAM = (double) r.get(\"ACCONAM\");\n funded.ACCONDATE = (String) r.get(\"ACCONDATE\");\n funded.ACCONFORM = (String) r.get(\"ACCONFORM\");\n funded.ACCONFORM_CN = (String) r.get(\"ACCONFORM_CN\");\n funded.CONDATE = (String) r.get(\"CONDATE\");\n funded.CONFORM = (String) r.get(\"CONFORM\");\n funded.CONFORM_CN = (String) r.get(\"CONFORM_CN\");\n funded.INV = (String) r.get(\"INV\");\n funded.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n funded.SUBCONAM = (double) r.get(\"SUBCONAM\");\n funded.ACPUBLICDATE = (String) r.get(\"ACPUBLICDATE\");\n DataManager.fundedList.add(funded);\n\n }\n }\n break;\n case \"股权变更信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.stockList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.stock>>() {\n }.getType());*/\n if (DataManager.stockList.size() > 0 || DataManager.stockList != null) {\n DataManager.stockList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.stock stock = new DataManager.stock();\n stock.REGNO = (String) r.get(\"REGNO\");\n stock.ALTAF = (String) r.get(\"ALTAF\");\n stock.ENTNAME = (String) r.get(\"ENTNAME\");\n stock.INVUID = (String) r.get(\"INVUID\");\n stock.UNISCID = (String) r.get(\"UNISCID\");\n stock.PRIPID = (String) r.get(\"PRIPID\");\n stock.ALITEM = (String) r.get(\"ALITEM\");\n stock.ALTDATE = (String) r.get(\"ALTDATE\");\n stock.ALTBE = (String) r.get(\"ALTBE\");\n DataManager.stockList.add(stock);\n }\n }\n break;\n case \"行政许可信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.permitList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.permit>>() {\n }.getType());*/\n if (DataManager.permitList.size() > 0 || DataManager.permitList != null) {\n DataManager.permitList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.permit permit = new DataManager.permit();\n permit.invalidDate = (String) r.get(\"invalidDate\");\n permit.LICANTH = (String) r.get(\"LICANTH\");\n permit.LICITEM = (String) r.get(\"LICITEM\");\n permit.LICNAME_CN = (String) r.get(\"LICNAME_CN\");\n permit.LICNO = (String) r.get(\"LICNO\");\n permit.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n permit.VALFROM = (String) r.get(\"VALFROM\");\n permit.VALTO = (String) r.get(\"VALTO\");\n DataManager.permitList.add(permit);\n }\n }\n break;\n case \"知识产权登记信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.loreList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.lore>>() {\n }.getType());*/\n if (DataManager.loreList.size() > 0 || DataManager.loreList != null) {\n DataManager.loreList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.lore lore = new DataManager.lore();\n lore.TYPENAME = (String) r.get(\"TYPENAME\");\n lore.TMNAME = (String) r.get(\"TMNAME\");\n lore.INVALIDDATE = (String) r.get(\"INVALIDDATE\");\n lore.PLEREGPERFROM = (String) r.get(\"PLEREGPERFROM\");\n lore.EQUPLECANREA = (String) r.get(\"EQUPLECANREA\");\n lore.CANDATE = (String) r.get(\"CANDATE\");\n lore.UNISCID = (String) r.get(\"UNISCID\");\n lore.KINDS = (String) r.get(\"KINDS\");\n lore.PLEREGPERTO = (String) r.get(\"PLEREGPERTO\");\n lore.REGNO = (String) r.get(\"REGNO\");\n lore.TMREGNO = (String) r.get(\"TMREGNO\");\n lore.PLEDGOR = (String) r.get(\"PLEDGOR\");\n lore.PLEID = (String) r.get(\"PLEID\");\n lore.ENTNAME = (String) r.get(\"ENTNAME\");\n lore.INVALIDREA = (String) r.get(\"INVALIDREA\");\n lore.PRIPID = (String) r.get(\"PRIPID\");\n lore.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n lore.IMPORG = (String) r.get(\"IMPORG\");\n lore.TYPE = (String) r.get(\"TYPE\");\n DataManager.loreList.add(lore);\n }\n\n }\n break;\n case \"行政处罚信息\":\n if (listtemp.get(i).get(\"data\") != null) {\n /*DataManager.punishList = gson.fromJson(listtemp.get(i).get(\"data\").toString(), new TypeToken<List<DataManager.punish>>() {\n }.getType());*/\n if (DataManager.punishList.size() > 0 || DataManager.punishList != null) {\n DataManager.punishList.clear();\n }\n for (LinkedTreeMap r : (List<LinkedTreeMap>) listtemp.get(i).get(\"data\")) {\n DataManager.punish punish = new DataManager.punish();\n punish.PENTYPE_CN = (String) r.get(\"PENTYPE_CN\");\n punish.REMARK = (String) r.get(\"REMARK\");\n punish.UNISCID = (String) r.get(\"UNISCID\");\n punish.PENDECISSDATE = (String) r.get(\"PENDECISSDATE\");\n punish.PENAM = (Double) r.get(\"PENAM\");\n punish.CASEID = (String) r.get(\"CASEID\");\n punish.REGNO = (String) r.get(\"REGNO\");\n punish.JUDAUTH = (String) r.get(\"JUDAUTH\");\n punish.ENTNAME = (String) r.get(\"ENTNAME\");\n punish.PENDECNO = (String) r.get(\"PENDECNO\");\n punish.PENTYPE = (String) r.get(\"PENTYPE\");\n punish.FORFAM = (Double) r.get(\"FORFAM\");\n punish.ILLEGACTTYPE = (String) r.get(\"ILLEGACTTYPE\");\n punish.PENCONTENT = (String) r.get(\"PENCONTENT\");\n punish.PRIPID = (String) r.get(\"PRIPID\");\n punish.PUBLICDATE = (String) r.get(\"PUBLICDATE\");\n DataManager.punishList.add(punish);\n }\n }\n break;\n default:\n break;\n }\n\n }\n CompanyDetailsActivity.handler.sendEmptyMessage(15);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x101://关注企业\n jsonString = (String) response.get();\n DataManager.FavotiteS = gson.fromJson(jsonString, DataManager.Favotite.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(22);\n break;\n case 0x102://取消关注企业\n jsonString = (String) response.get();\n DataManager.FavotiteS = gson.fromJson(jsonString, DataManager.Favotite.class);\n CompanyDetailsActivity.handler.sendEmptyMessage(23);\n break;\n case 0x103://我的关注列表\n jsonString = (String) response.get();\n DataManager.FavotiteListS = gson.fromJson(jsonString, DataManager.FavotiteList.class);\n MainActivity.handler.sendEmptyMessage(5);\n break;\n case 0x201://评论\n jsonString = (String) response.get();\n DataManager.MyCommentlistrS = gson.fromJson(jsonString, DataManager.MyCommentlistr.class);\n if (DataManager.MyCommentlistrS.data.userreview != null && DataManager.MyCommentlistrS.data.userreview.size() > 0) {\n CommentListActivity.handler.sendEmptyMessage(0);\n } else {\n CommentListActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x202://点赞\n String jstring202 = (String) response.get();\n DataManager.Root202 jsonRoot202 = gson.fromJson(jstring202, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d202 = jsonRoot202.data;\n DataManager.Result = d202.result;\n// if (DataManager.Result.equals(\"1\")) {\n// CommentListDetailsActivity.handler.sendEmptyMessage(2);\n// }\n break;\n case 0x203://差评\n String jstring203 = (String) response.get();\n DataManager.Root202 jsonRoot203 = gson.fromJson(jstring203, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d203 = jsonRoot203.data;\n DataManager.Result = d203.result;\n// if (DataManager.Result.equals(\"1\")) {\n// CommentListDetailsActivity.handler.sendEmptyMessage(2);\n// }\n break;\n case 0x204://发表评论\n String jstring204 = (String) response.get();\n DataManager.Root202 jsonRoot204 = gson.fromJson(jstring204, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d204 = jsonRoot204.data;\n DataManager.Result = d204.result;\n if (DataManager.Result.equals(\"success\")) {\n ToCommentActivity.handler.sendEmptyMessage(1);\n } else {\n ToCommentActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x205://回复评论\n String jstring205 = (String) response.get();\n DataManager.Root202 jsonRoot205 = gson.fromJson(jstring205, new TypeToken<DataManager.Root202>() {\n }.getType());\n DataManager.Data202 d205 = jsonRoot205.data;\n DataManager.Result = d205.result;\n if (DataManager.Result.equals(\"success\")) {\n CommentListDetailsActivity.handler.sendEmptyMessage(1);\n } else {\n CommentListDetailsActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x206://我的评价\n jsonString = (String) response.get();\n DataManager.MyComms = gson.fromJson(jsonString, DataManager.MyComm.class);\n MainActivity.handler.sendEmptyMessage(1);\n break;\n case 0x301://提交认领s\n jsonString = (String) response.get();\n DataManager.ClaimUtilsModel = gson.fromJson(jsonString, DataManager.ClaimUtils.class);\n if (DataManager.ClaimUtilsModel.data.result.equals(\"success\")) {\n ToClaimActivity.handler.sendEmptyMessage(1);\n } else {\n ToClaimActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x302://提交认领附件\n jsonString = (String) response.get();\n DataManager.ClaimUtilsModel = gson.fromJson(jsonString, DataManager.ClaimUtils.class);\n if (DataManager.ClaimUtilsModel.data.result.equals(\"success\")) {\n ToClaimActivity.handler.sendEmptyMessage(2);\n } else {\n ToClaimActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x303://我的认领列表\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n MainActivity.handler.sendEmptyMessage(6);\n break;\n case 0x3031://我的认领列表{副}\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n MyClaimActivity.handler.sendEmptyMessage(2);\n break;\n case 0x304://我的认领详情\n jsonString = (String) response.get();\n DataManager.MyClaimUtilsModel = gson.fromJson(jsonString, DataManager.MyClaimUtils.class);\n// MyClaimActivity.handler.sendEmptyMessage(6);\n break;\n case 0x305://取消认领\n jsonString = (String) response.get();\n DataManager.ClaimUtilsModel = gson.fromJson(jsonString, DataManager.ClaimUtils.class);\n if (DataManager.ClaimUtilsModel.data.result.equals(\"success\") || DataManager.ClaimUtilsModel.data.result.equals(\"fail\")) {\n MyClaimActivity.handler.sendEmptyMessage(1);\n } else {\n MyClaimActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x401://修改个人资料{\"message\":\"Success\",\"status\":\"1\",\"version\":\"v1.0\"}\n jsonString = (String) response.get();\n DataManager.user = gson.fromJson(jsonString, DataManager.User.class);\n if (DataManager.user.message.equals(\"success\")) {\n csp.putUser(DataManager.user);\n UserSetActivity.handler.sendEmptyMessage(1);\n MainActivity.loginImg(csp.getICONSTEAM());\n } else {\n UserSetActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x4011://个人资料字典\n jsonString = (String) response.get();\n DataManager.ZdianS = gson.fromJson(jsonString, DataManager.Zdian.class);\n if (DataManager.ZdianS.data.dictionarie != null && DataManager.ZdianS.data.dictionarie.size() > 0) {\n UserSetActivity.handler.sendEmptyMessage(3);\n }\n break;\n case 0x501://修改密码\n jsonString = (String) response.get();\n DataManager.user = gson.fromJson(jsonString, DataManager.User.class);\n if (DataManager.user.message.equals(\"Success\")) {\n PassWordActivity.handler.sendEmptyMessage(1);\n } else if (DataManager.user.message.equals(\"原始密码错误\")) {\n PassWordActivity.handler.sendEmptyMessage(3);\n } else {\n PassWordActivity.handler.sendEmptyMessage(2);\n }\n\n break;\n case 0x601://二维码名片\n jsonString = (String) response.get();\n DataManager.TwoDimSli = gson.fromJson(jsonString, DataManager.TwoDim.class);\n if (DataManager.TwoDimSli.message.equals(\"success\")) {\n CompanyDetailsActivity.waitDialog.dismiss();\n CompanyDetailsActivity.handler.sendEmptyMessage(25);\n } else {\n CompanyDetailsActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x701://信用报告1\n jsonString = (String) response.get();\n if (jsonString.equals(DataManager.BaseinfoList.get(0).ENTNAME + \".pdf\")) {\n DataManager.ReportText = jsonString;\n ReportActivity.handler.sendEmptyMessage(0);\n } else {\n ReportActivity.handler.sendEmptyMessage(1);\n }\n break;\n case 0x702://信用报告2\n jsonString = (String) response.get();\n if (jsonString.equals(\"success\")) {\n ReportActivity.handler.sendEmptyMessage(3);\n } else {\n ReportActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x999://登入\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n\n if (!map.get(\"status\").equals(\"1\")) {//登入失败谁动了我的账号,给我站出来\n Toast.show(map.get(\"message\").toString());\n LoginActivity.wd.dismiss();\n } else {//登入成功\n DataManager.user = gson.fromJson(jsonString, DataManager.User.class);\n csp.putUser(DataManager.user);\n csp.putLoginStatus(true);\n Toast.show(\"登录成功\");\n if (csp.getALIASNAME().equals(\"\")) {\n csp.putALIASNAME(\"用户12138\");\n }\n if (!csp.getALIASNAME().equals(\"\")) {\n MainActivity.UserSz.setText(csp.getALIASNAME());\n } else {\n MainActivity.UserSz.setText(csp.getUSERNAME());\n }\n if (!csp.getICONSTEAM().equals(\"\")) {\n MainActivity.loginImg(csp.getICONSTEAM());\n }\n LoginActivity.handler.sendEmptyMessage(0);\n LoginActivity.wd.dismiss();\n }\n break;\n case 0x998://注册\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (!map.get(\"status\").equals(\"1\")) {//注册失败\n RegisterActivity.pd.dismiss();\n Toast.show(\"注册失败\" + map.get(\"message\").toString());\n } else {//注册成功\n\n RegisterActivity.handler.sendEmptyMessage(0);\n }\n break;\n case 0x997://个人中心获取投诉列表\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n MainActivity.handler.sendEmptyMessage(2);\n\n break;\n case 0x9971://个人中心获取投诉列表\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n MycomplaintsListActivity.handler.sendEmptyMessage(21);\n\n break;\n\n case 0x996://个人中心取消投诉请求\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (!map.get(\"status\").equals(\"1\")) {//取消失败\n MycomplaintsListActivity.pd.dismiss();\n Toast.show(\"取消失败\" + map.get(\"message\").toString());\n } else {//取消成功\n MycomplaintsListActivity.handler.sendEmptyMessage(1);\n }\n break;\n case 0x995://获取投诉详情\n jsonString = (String) response.get();\n DataManager.complaintDetail = gson.fromJson(jsonString, DataManager.ComplaintDetail.class);\n MycomplaintsListActivity.handler.sendEmptyMessage(3);\n break;\n case 0x994://获取企业投诉列表\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n if (CompanyDetailsActivity.waitDialog != null) {\n CompanyDetailsActivity.waitDialog.dismiss();\n }\n CompanyDetailsActivity.handler.sendEmptyMessage(24);\n break;\n case 0x9941://获取企业投诉列表更多\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n if (CompanyDetailsActivity.waitDialog != null) {\n CompanyDetailsActivity.waitDialog.dismiss();\n }\n MycomplaintsListActivity.handler.sendEmptyMessage(6);\n break;\n\n case 0x993://提交企业投诉\n jsonString = (String) response.get();\n DataManager.toComplain = gson.fromJson(jsonString, DataManager.ToComplain.class);\n /*map=gson.fromJson(jsonString,new TypeToken<Map<String, Object>>() {\n }.getType());*/\n if (!DataManager.toComplain.status.equals(\"1\")) {//返回提交投诉失败\n Toast.show(\"提交投诉失败\" + map.get(\"message\"));\n } else {//成功\n ToComplaintActivity.handler.sendEmptyMessage(1);\n\n }\n break;\n case 0x992://提交投诉附件\n jsonString = (String) response.get();\n map = gson.fromJson(jsonString, new TypeToken<Map<String, Object>>() {\n }.getType());\n if (!map.get(\"status\").equals(\"1\")) {//返回提交投诉失败\n Toast.show(\"提交投诉图片失败\" + map.get(\"message\"));\n } else {//成功\n ToComplaintActivity.handler.sendEmptyMessage(0);\n\n }\n break;\n case 0x991://提交投诉后刷新企业投诉\n jsonString = (String) response.get();\n DataManager.myComplaint = gson.fromJson(jsonString, DataManager.MyComplaint.class);\n MycomplaintsListActivity.handler.sendEmptyMessage(5);\n break;\n case 0x12138://记录24宫格\n jsonString = (String) response.get();\n break;\n case 0x1001://商标查询\n jsonString = (String) response.get();\n DataManager.sb_searchS = gson.fromJson(jsonString, DataManager.sb_search.class);\n if (DataManager.sb_searchS.data.trademark.size() > 0) {\n Main_SearchActivity.handler.sendEmptyMessage(0);\n } else {\n Main_SearchActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x1002://首页专利查询\n jsonString = (String) response.get();\n DataManager.zl_searchS = gson.fromJson(jsonString, DataManager.zl_search.class);\n if (DataManager.zl_searchS.data.patentInfo.size() > 0 && DataManager.zl_searchS.data.patentInfo != null) {\n Main_SearchActivity.handler.sendEmptyMessage(1);\n } else {\n Main_SearchActivity.handler.sendEmptyMessage(500);\n }\n break;\n case 0x1003://首页商标查询(上下拉事件)\n jsonString = (String) response.get();\n DataManager.sb_searchS = gson.fromJson(jsonString, DataManager.sb_search.class);\n if (DataManager.sb_searchS.data.trademark.size() > 0) {\n Main_Search_ListActivity.handler.sendEmptyMessage(0);\n }\n break;\n case 0x1004://专利查询(上下拉事件)\n jsonString = (String) response.get();\n DataManager.zl_searchS = gson.fromJson(jsonString, DataManager.zl_search.class);\n if (DataManager.zl_searchS.data.patentInfo.size() > 0 && DataManager.zl_searchS.data.patentInfo != null) {\n Main_Search_ListActivity.handler.sendEmptyMessage(1);\n }\n break;\n case 0x1005://失信查询\n jsonString = (String) response.get();\n DataManager.MyDishonestyS = gson.fromJson(jsonString, DataManager.MyDishonesty.class);\n if (DataManager.MyDishonestyS.data.Courtcaseinfo.size() > 0 && DataManager.MyDishonestyS.data.Courtcaseinfo != null) {\n Main_SearchActivity.handler.sendEmptyMessage(2);\n }\n break;\n case 0x1006://失信查询(上下拉事件)\n jsonString = (String) response.get();\n DataManager.MyDishonestyS = gson.fromJson(jsonString, DataManager.MyDishonesty.class);\n if (DataManager.MyDishonestyS.data.Courtcaseinfo.size() > 0 && DataManager.MyDishonestyS.data.Courtcaseinfo != null) {\n Main_Search_ListActivity.handler.sendEmptyMessage(2);\n }\n break;\n default:\n break;\n }\n } catch (NullPointerException e) {\n showdisplay(what);\n Toast.show(\"后台数据空返回!\");\n } catch (IndexOutOfBoundsException e) {\n showdisplay(what);\n Toast.show(\"后台数据结构变更下标越界!\");\n } catch (ClassCastException e) {\n showdisplay(what);\n Toast.show(\"后台数据变更类型转换出错!\");\n } catch (NumberFormatException e) {\n showdisplay(what);\n Toast.show(\"字符串转换为数字异常!\");\n } catch (JsonSyntaxException e) {\n showdisplay(what);\n Toast.show(\"后台数据变更json解析出错!\");\n }\n }",
"public static List<String> getAttackerFromEngland() throws URISyntaxException, IOException {\n HttpClient httpClient = HttpClientBuilder.create().build();\n URIBuilder uriBuilder = new URIBuilder();\n //http://api.football-data.org/v2/teams/\n uriBuilder.setScheme(\"http\").setHost(\"api.football-data.org\").setPath(\"v2/teams/66\");\n HttpGet httpGet = new HttpGet(uriBuilder.build());\n httpGet.setHeader(\"X-Auth-Token\",\"7cf82ca9d95e498793ac0d3179e1ec9f\");\n httpGet.setHeader(\"Accept\",\"application/json\");\n HttpResponse response = httpClient.execute(httpGet);\n ObjectMapper objectMapper = new ObjectMapper();\n Team66Pojo team66Pojo =objectMapper.readValue(response.getEntity().getContent(),Team66Pojo.class);\n List<Squad> squad = team66Pojo.getSquad();\n List<String> attackerName= new ArrayList<>();\n for (int i = 0; i <squad.size() ; i++) {\n try {\n if(squad.get(i).getPosition().equals(\"Attacker\")&&squad.get(i).getNationality().equals(\"England\")){\n\n attackerName.add(squad.get(i).getName());\n }\n }catch (NullPointerException e){\n\n\n }\n }\n return attackerName;\n }",
"private void populateRegions() {\n regionsSpinnerAdapter.clear();\n regionsSpinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n regionSpinner.setAdapter(regionsSpinnerAdapter);\n regionsSpinnerAdapter.add(\"Choose Region...\");\n for (RegionsResponse.Regions region : regionsList) {\n if (region.getParentId() == 0)\n regionsSpinnerAdapter.add(region.getRegionName());\n }\n regionsSpinnerAdapter.notifyDataSetChanged();\n }",
"@Test\n public void testGetTravels() throws Exception{\n\n mockMVC.perform(get(\"/user/1/travel\")\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isOk())\n .andExpect(content().contentType(TestUtil.APPLICATION_JSON_UTF8))\n .andExpect(jsonPath(\"$\", hasSize(2)))\n .andExpect(jsonPath(\"$[0].id\", is(\"1\")))\n .andExpect(jsonPath(\"$[0].name\", is(\"travel1\")))\n .andExpect(jsonPath(\"$[0].time_interval[0]\", is(\"10:15:30\")))\n .andExpect(jsonPath(\"$[0].time_interval[1]\", is(\"12:15:30\")))\n .andExpect(jsonPath(\"$[0].is_arrival_time\", is(false)))\n .andExpect(jsonPath(\"$[0].recurring[0]\", is(false)))\n .andExpect(jsonPath(\"$[0].recurring[1]\", is(false)))\n .andExpect(jsonPath(\"$[0].recurring[2]\", is(false)))\n .andExpect(jsonPath(\"$[0].recurring[3]\", is(false)))\n .andExpect(jsonPath(\"$[0].recurring[4]\", is(false)))\n .andExpect(jsonPath(\"$[0].recurring[5]\", is(false)))\n .andExpect(jsonPath(\"$[0].recurring[6]\", is(false)))\n .andExpect(jsonPath(\"$[0].startpoint.street\", is(\"teststreet\")))\n .andExpect(jsonPath(\"$[0].startpoint.housenumber\", is(\"1\")))\n .andExpect(jsonPath(\"$[0].startpoint.city\", is(\"testcity\")))\n .andExpect(jsonPath(\"$[0].startpoint.country\", is(\"BE\")))\n .andExpect(jsonPath(\"$[0].startpoint.postal_code\", is(\"1234\")))\n .andExpect(jsonPath(\"$[0].startpoint.coordinates.lat\", is(50.0)))\n .andExpect(jsonPath(\"$[0].startpoint.coordinates.lon\", is(60.0)))\n .andExpect(jsonPath(\"$[0].endpoint.street\", is(\"teststreet\")))\n .andExpect(jsonPath(\"$[0].endpoint.housenumber\", is(\"5\")))\n .andExpect(jsonPath(\"$[0].endpoint.city\", is(\"testcity\")))\n .andExpect(jsonPath(\"$[0].endpoint.country\", is(\"BE\")))\n .andExpect(jsonPath(\"$[0].endpoint.postal_code\", is(\"1234\")))\n .andExpect(jsonPath(\"$[0].endpoint.coordinates.lat\", is(55.0)))\n .andExpect(jsonPath(\"$[0].endpoint.coordinates.lon\", is(65.0)))\n .andExpect(jsonPath(\"$[1].id\", is(\"2\")))\n .andExpect(jsonPath(\"$[1].name\", is(\"travel2\")))\n .andExpect(jsonPath(\"$[1].time_interval[0]\", is(\"10:15:30\")))\n .andExpect(jsonPath(\"$[1].time_interval[1]\", is(\"12:15:30\")))\n .andExpect(jsonPath(\"$[1].is_arrival_time\", is(true)))\n .andExpect(jsonPath(\"$[1].recurring[0]\", is(false)))\n .andExpect(jsonPath(\"$[1].recurring[1]\", is(false)))\n .andExpect(jsonPath(\"$[1].recurring[2]\", is(false)))\n .andExpect(jsonPath(\"$[1].recurring[3]\", is(false)))\n .andExpect(jsonPath(\"$[1].recurring[4]\", is(false)))\n .andExpect(jsonPath(\"$[1].recurring[5]\", is(false)))\n .andExpect(jsonPath(\"$[1].recurring[6]\", is(false)))\n .andExpect(jsonPath(\"$[1].endpoint.street\", is(\"teststreet\")))\n .andExpect(jsonPath(\"$[1].endpoint.housenumber\", is(\"1\")))\n .andExpect(jsonPath(\"$[1].endpoint.city\", is(\"testcity\")))\n .andExpect(jsonPath(\"$[1].endpoint.country\", is(\"BE\")))\n .andExpect(jsonPath(\"$[1].endpoint.postal_code\", is(\"1234\")))\n .andExpect(jsonPath(\"$[1].endpoint.coordinates.lat\", is(50.0)))\n .andExpect(jsonPath(\"$[1].endpoint.coordinates.lon\", is(60.0)))\n .andExpect(jsonPath(\"$[1].startpoint.street\", is(\"teststreet\")))\n .andExpect(jsonPath(\"$[1].startpoint.housenumber\", is(\"5\")))\n .andExpect(jsonPath(\"$[1].startpoint.city\", is(\"testcity\")))\n .andExpect(jsonPath(\"$[1].startpoint.country\", is(\"BE\")))\n .andExpect(jsonPath(\"$[1].startpoint.postal_code\", is(\"1234\")))\n .andExpect(jsonPath(\"$[1].startpoint.coordinates.lat\", is(55.0)))\n .andExpect(jsonPath(\"$[1].startpoint.coordinates.lon\", is(65.0)));\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }",
"public List<RegionServer> regionServers() {\n\t\tBufferedReader bufReader = null;\n\t\tInputStreamReader input = null;\n\t\tList<RegionServer> list = new ArrayList<>();\n\t\ttry {\n\t\t\tURL url = new URL(HBase.HTTP + SystemConfig.getProperty(\"hive.cube.hbase.master\") + HBase.HBASE_REGION_SERVER_JMX);\n\t\t\tHttpURLConnection httpConn = (HttpURLConnection) url.openConnection();\n\t\t\tinput = new InputStreamReader(httpConn.getInputStream(), \"UTF-8\");\n\t\t\tbufReader = new BufferedReader(input);\n\t\t\tString line = \"\";\n\t\t\tStringBuilder contentBuf = new StringBuilder();\n\t\t\twhile ((line = bufReader.readLine()) != null) {\n\t\t\t\tcontentBuf.append(line);\n\t\t\t}\n\t\t\tJSONObject tmpBuf = JSON.parseObject(contentBuf.toString());\n\t\t\tJSONObject object = (JSONObject) JSON.parseArray(tmpBuf.getString(\"beans\")).get(0);\n\t\t\tString[] liveRegionServers = object.getString(\"tag.liveRegionServers\").split(\";\");\n\t\t\tfor (String node : liveRegionServers) {\n\t\t\t\tif (node.length() != 0) {\n\t\t\t\t\tRegionServer region = new RegionServer();\n\t\t\t\t\tregion.setRegionName(node.split(\",\")[0] + \":\" + node.split(\",\")[1]);\n\t\t\t\t\tregion.setStartTime(CalendarUtils.convertUnixTime(Long.parseLong(node.split(\",\")[2])));\n\t\t\t\t\tregion.setLive(true);\n\t\t\t\t\tlist.add(region);\n\t\t\t\t}\n\t\t\t}\n\t\t\tString[] deadRegionServers = object.getString(\"tag.deadRegionServers\").split(\";\");\n\t\t\tfor (String node : deadRegionServers) {\n\t\t\t\tif (node.length() != 0) {\n\t\t\t\t\tRegionServer region = new RegionServer();\n\t\t\t\t\tregion.setRegionName(node.split(\",\")[0] + \":\" + node.split(\",\")[1]);\n\t\t\t\t\tregion.setStartTime(CalendarUtils.convertUnixTime(Long.parseLong(node.split(\",\")[2])));\n\t\t\t\t\tregion.setLive(false);\n\t\t\t\t\tlist.add(region);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOG.error(\"Filter[Region] HBase JMX has error,msg is \" + e.getMessage());\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (input != null) {\n\t\t\t\t\tinput.close();\n\t\t\t\t}\n\t\t\t\tif (bufReader != null) {\n\t\t\t\t\tbufReader.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tLOG.error(\"Close IO has error,msg is \" + e.getMessage());\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}",
"public interface GetCountryDataService {\n\n\n\n @GET(\"country/get/all\")\n Call<Info> getResults();\n\n\n\n\n\n\n\n\n}",
"@Test\r\n\tpublic void givenResourceUrl_whenSendGetForRequestEntity_thenStatusOk() throws IOException {\n\r\n\t\tfinal Logger log = LoggerFactory.getLogger(UserDataRestTemplateTest.class);\r\n\r\n\t\tRestTemplate restTemplate = new RestTemplate();\r\n\t\tMap<String, String> response = (Map<String, String>) restTemplate\r\n\t\t\t\t.getForObject(\"http://services.groupkt.com/country/get/iso2code/IN\", Map.class);\r\n\t\tlog.info(\"==== RESTful API Response using Spring RESTTemplate START =======\");\r\n\t\tlog.info(response.toString());\r\n\t\tlog.info(\"==== RESTful API Response using Spring RESTTemplate END =======\");\r\n\r\n\t}",
"@Test\n public void GETProduct_ProductInventoryCall() {\n\n givenHeaders().\n when().\n get(_url_product).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETPRODUCT_Inventory Test Run Result\");\n }",
"private void getProvinces(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\t\n\t\tProvincesService provinces=new ProvincesServiceImpl();\n\t\t\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Provinces> select = provinces.select();\n\t\t\t\t\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\t\t\t\t\n\t}",
"public interface HttpConnectionCovid {\n\n /**\n * Gets all statistics from the api.\n *\n * @return the all statistics\n * @throws UnirestException the unirest exception\n */\n public JSONObject getAllStatistics() throws UnirestException;\n\n /**\n * Gets statistics of country by its name from the api .\n *\n * @param country the country\n * @return the statistics of country\n * @throws UnirestException the unirest exception\n */\n public JSONObject getStatisticsOfCountry(String country) throws UnirestException;\n\n /**\n * Gets cords of any country.\n *\n * @param Country the country\n * @return the cords of the country\n * @throws UnirestException the unirest exception\n */\n public JSONArray getCordsOfCountry(String Country) throws UnirestException;\n\n}",
"@Test\n public void testReceiverAgeEndpointCombo() {\n ResponseEntity response = dataController.getReceiverDataAge(\"M\", null, \"Canterbury\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"public interface RegionMapper {\n List<Province> queryAllProvince();\n String queryProvince(@Param(\"provinceId\") Integer provinceId);\n String queryCityByPid(@Param(\"cityId\") Integer cityId );\n String queryDistrictByCode(@Param(\"areaId\") Integer areaId);\n\n List<Region> regionlist(int pid);\n}",
"@GET\n @Path(\"location/Arovince\")\n @Produces(\"application/json\")\n public String getJson() throws IOException {\n FileWriter file = new FileWriter(\"/home/component/NetBeansProjects/ArovinceAndSchool/web/api/Arovince.json\");\n JSONObject jsonArray = null;\n\n try {\n URL url = new URL(\"https://opend.data.go.th/get-ckan/datastore_search?resource_id=df922923-e009-4dee-92fc-d963a86ce4b8\"); \n HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();\n httpURLConnection.setRequestMethod(\"GET\");\n httpURLConnection.setRequestProperty(\"api-key\", \"XOe9aVTolOhCbyTU103IqAKTNNNPX8b5\");\n String line = \"\";\n InputStreamReader inputStreamReader = new InputStreamReader(httpURLConnection.getInputStream());\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n StringBuilder response = new StringBuilder();\n\n try {\n while((line = bufferedReader.readLine()) != null) {\n file.write(line);\n response.append(line);\n }\n } catch (IOException var10) {\n }\n\n file.close();\n bufferedReader.close();\n jsonArray = new JSONObject(response.toString());\n return jsonArray.toString(4);\n } catch (Exception var11) {\n return \"\" + var11;\n }\n }",
"@Test\r\n\tpublic void getAllIncidents() {\n\t\tRestAssured.baseURI = \"https://dev49243.service-now.com/api/now/table/incident\";\r\n\t\t\r\n\t\t// Step 2: Authentication (basic)\r\n\t\tRestAssured.authentication = RestAssured.basic(\"admin\", \"Tuna@123\");\r\n\t\t\r\n\t\t// Step 3: Request type - Get -> Response\r\n\t\tResponse response = RestAssured.get();\r\n\t\t\r\n\t\t// Step 4: Validate (Response -> Status Code : 200)\r\n\t\tSystem.out.println(response.getStatusCode());\r\n\t\t\r\n\t\t// Print the response time as well \r\n\t\t\r\n\t\t// Check what is the response format\r\n\t\tSystem.out.println(response.getContentType());\r\n\t\t\r\n\t\t// print the response\r\n\t\tresponse.prettyPrint();\r\n\t\t\r\n\t}",
"@CrossOrigin\n @RequestMapping(method = RequestMethod.GET, path = \"/item/restaurant/{restaurant_id}\", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<ItemListResponse> getItemsByPopularity(\n @PathVariable(\"restaurant_id\") final String restaurantId) throws RestaurantNotFoundException {\n\n //Fetching the restaurant info. if restaurant Id entered is valid\n RestaurantEntity restaurantEntity = restaurantService.restaurantByUUID(restaurantId);\n\n //Fetching all items of restaurant in order of popularity\n List<ItemEntity> itemList = itemService.getItemsByPopularity(restaurantEntity);\n\n ItemListResponse itemListResponse = new ItemListResponse();\n\n //Considering only top 5 items..\n int count = 0;\n for (ItemEntity itemEntity : itemList) {\n if (count < 5) {\n ItemList items = new ItemList()\n .id(UUID.fromString(itemEntity.getUuid()))\n .itemName(itemEntity.getItemName())\n .price(itemEntity.getPrice())\n .itemType(ItemList.ItemTypeEnum.fromValue(itemEntity.getType().getValue()));\n itemListResponse.add(items);\n count = count + 1;\n } else {\n break;\n }\n }\n //Sending response with the desired body and required status code.\n return new ResponseEntity<ItemListResponse>(itemListResponse, HttpStatus.OK);\n }",
"public JSONObject getStatisticsOfCountry(String country) throws UnirestException;",
"@Test\n public void testReceiverDonorEndpointAge() {\n ResponseEntity response = dataController.getDonorDataRegion(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"public static String getDsInstitutionRegion(DigitalObject ds, GbifClient gbifClient){\n String institutionRegion = null;\n String institutionId = DigitalSpecimenUtils.getTermFromDsDwcaJson(ds, DwcTerm.institutionID);\n String institutionCode = DigitalSpecimenUtils.getStringPropertyFromDS(ds,\"institutionCode\");\n String collectionCode = DigitalSpecimenUtils.getStringPropertyFromDS(ds,\"collectionCode\");\n String collectionId = DigitalSpecimenUtils.getTermFromDsDwcaJson(ds, DwcTerm.collectionID);\n String identifier = DigitalSpecimenUtils.getTermFromDsDwcaJson(ds, DcTerm.identifier);\n try{\n JsonObject institutionInfo = null;\n if (StringUtils.isNotBlank(institutionId) && DigitalSpecimenUtils.isStringAValidUuid(institutionId)){\n institutionInfo = gbifClient.getInstitutionInfoByInstitutionId(institutionId);\n } else if (StringUtils.isNotBlank(institutionCode)){\n JsonArray posibleInstitutions = gbifClient.getInstitutionsInfoByInstitutionCode(institutionCode);\n if (posibleInstitutions.size()==1){\n institutionInfo = posibleInstitutions.get(0).getAsJsonObject();\n } else if (posibleInstitutions.size()>1){\n //There are several institution with that institution code\n //Check if all of them are from the same region\n String possibleRegion = \"UNKNOWN\";\n if (posibleInstitutions.get(0).getAsJsonObject().has(\"country\")){\n possibleRegion = posibleInstitutions.get(0).getAsJsonObject().getAsJsonObject(\"country\").get(\"region\").getAsString();\n }\n boolean sameRegion=true;\n for (JsonElement posibleInstitution:posibleInstitutions) {\n if (!posibleInstitution.getAsJsonObject().has(\"country\") || !possibleRegion.equalsIgnoreCase(posibleInstitution.getAsJsonObject().getAsJsonObject(\"country\").get(\"region\").getAsString())){\n sameRegion=false;\n break;\n }\n }\n if (sameRegion){\n institutionInfo=posibleInstitutions.get(0).getAsJsonObject();\n } else if (StringUtils.isNotBlank(collectionCode)){\n //Try to see if we can find what institution this digital specimen belongs to by looking at the collection code\n for (Iterator<JsonElement> iter = posibleInstitutions.iterator(); iter.hasNext(); ) {\n JsonObject posibleInstitution = (JsonObject) iter.next();\n JsonObject collectionInfo = gbifClient.getCollectionInfoByInstitutionIdAndCollectionCode(posibleInstitution.get(\"key\").getAsString(),collectionCode);\n if (collectionInfo==null){\n iter.remove();\n }\n }\n if (posibleInstitutions.size()==1){\n institutionInfo=posibleInstitutions.get(0).getAsJsonObject();\n }\n }\n }\n }\n\n if (institutionInfo!=null && institutionInfo.has(\"country\")){\n institutionRegion = institutionInfo.getAsJsonObject(\"country\").get(\"region\").getAsString();\n } else{\n //As last attempt, try to get the country from the record institutionId, collectionsId or identifier if they are valid url\n UrlValidator urlValidator = new UrlValidator();\n CountryResponse countryResponse = null;\n if (StringUtils.isNotBlank(institutionId) && urlValidator.isValid(institutionId)){\n logger.debug(\"Obtaining institution code from \");\n countryResponse = NetUtils.getCountryInfoFromUrl(institutionId);\n } else if (StringUtils.isNotBlank(collectionId) && urlValidator.isValid(collectionId)){\n countryResponse = NetUtils.getCountryInfoFromUrl(collectionId);\n } else if (StringUtils.isNotBlank(identifier) && urlValidator.isValid(identifier)){\n countryResponse = NetUtils.getCountryInfoFromUrl(identifier);\n }\n if (countryResponse!=null){\n institutionRegion = countryResponse.getContinent().getName();\n }\n }\n\n if (StringUtils.isBlank(institutionRegion)){\n String physicalSpecimenId=DigitalSpecimenUtils.getStringPropertyFromDS(ds,\"physicalSpecimenId\");\n String scientificName=DigitalSpecimenUtils.getStringPropertyFromDS(ds,\"scientificName\");\n logger.warn(\"It was not possible to obtain institution's regions for ds [\" + scientificName\n + \" || \" + institutionCode + \" || \"+ physicalSpecimenId + \"]\");\n }\n } catch (Exception e){\n logger.error(\"Unexpected error trying to obtain institution's region for ds \" + e.getMessage(),ds);\n }\n return institutionRegion;\n }",
"@Test\n\tpublic void getAllByRegion() {\n\t\tList<String> consequenceTypeList = new ArrayList<String>();\n\t\tconsequenceTypeList.add(\"2KB_upstream_variant\");\n\t\tconsequenceTypeList.add(\"splice_region_variant\");\n\t\tList<Snp> snps = snpDBAdaptor.getAllByRegion(new Region(\"1\", 10327, 12807), consequenceTypeList);\n\t\tthis.printSNPList(\"getAllByRegion\", snps, 50);\n\t}",
"public static List<City> pareseJsonToCities(URL url) {\r\n\tObjectMapper objectMapper = new ObjectMapper();\r\n\tList<City> cities = null;\r\n\ttry {\r\n\t JsonNode node = objectMapper.readValue(url, JsonNode.class);\r\n\t if (node.isArray() && node.size() > 0) {\r\n\t\tcities = new ArrayList<>();\r\n\t\tIterator<JsonNode> nodeElements = node.elements();\r\n\t\twhile (nodeElements.hasNext()) {\r\n\t\t City city = new City();\r\n\r\n\t\t JsonNode currentCity = nodeElements.next();\r\n\t\t JsonNode idNode = currentCity.get(\"_id\");\r\n\t\t Long id = idNode.asLong();\r\n\t\t city.setId(id);\r\n\r\n\t\t JsonNode nameNode = currentCity.get(\"name\");\r\n\t\t String name = nameNode != null ? nameNode.asText() :\" \";\r\n\t\t city.setName(name);\r\n\r\n\t\t JsonNode typeNode = currentCity.get(\"type\");\r\n\t\t String type = typeNode != null ? typeNode.asText() :\" \";\r\n\t\t city.setType(type);\r\n\r\n\t\t JsonNode geoPositionNode = currentCity.get(\"geo_position\");\r\n\t\t if (geoPositionNode != null) {\r\n\t\t\tJsonNode latitudeNode = geoPositionNode.get(\"latitude\");\r\n\t\t\tString latitude = latitudeNode!=null?latitudeNode.asText():\" \";\r\n\t\t\tcity.setLatitude(latitude);\r\n\r\n\t\t\tJsonNode longitudeNode = geoPositionNode.get(\"longitude\");\r\n\t\t\tString longitude = longitudeNode!=null?longitudeNode.asText():\" \";\r\n\t\t\tcity.setLongitude(longitude);\r\n\t\t }\r\n\r\n\t\t cities.add(city);\r\n\t\t}\r\n\r\n\t }\r\n\t} catch (JsonParseException | JsonMappingException e) {\r\n\t System.out.println(\"Could not parse Json.\");\r\n\t e.printStackTrace();\r\n\t} catch (IOException e) {\r\n\t System.out.println(\"File I/O problems.\");\r\n\t e.printStackTrace();\r\n\t}\r\n\treturn cities;\r\n }",
"List<City> getCityList(Integer countryId)throws EOTException;",
"@Override\n\t@GET\n\t@Path(\"/airports\")\n @Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAirports() {\n\t\t\n\t\tList<String> list = new ArrayList<String>();\n\t\tlist.addAll(mapAirportData.keySet());\n\t\tlog.debug(\"Resource requested to print all the known airports.\");\n\t\t log.debug(\"Success :\" + Response.Status.OK);\n\t\t return Response.status(Response.Status.OK).entity(list).build();\n\t}",
"void loadData() {\n Request request = new Request.Builder()\n .url(\"https://www.metaweather.com/api/location/search/?lattlong=20.5937,78.9629\")\n .get().build();\n //Create OkHttpClient Object\n OkHttpClient client = new OkHttpClient();\n\n // Call the request using client we just created\n client.newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Request request, IOException e) {\n //Use this code to Handle Failed Request mostly due to internet issue\n // we will just Create a Tost Message for user\n Toast.makeText(MainActivity.this, \"Request Failed\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onResponse(Response response) throws IOException {\n //Here we will check is reponse is Sucessfull or is their any\n // request error i.e url error\n if (!response.isSuccessful()) {\n //Here our reponse is UnSucessfull so we inform the user\n // about the same as before\n Toast.makeText(MainActivity.this, \"Request Failed\", Toast.LENGTH_SHORT).show();\n return;\n }\n //If Response is sucessfull we move forward and convert the\n // reponse which is in JSON format to String\n String respFromApi = response.body().string();\n\n //We will Log this LogCat in order to view the Raw Format recieved\n //you can open the log cat go in debug section and type RawData you\n // will be able to observe data there\n Log.d(\"RawData\", respFromApi);\n\n //Now We will call Extract Data Function which will retrieve the\n // woied and name of each city from the response\n try {\n extractData(respFromApi);\n } catch (Exception e) {\n //Informing Data is Not in JSON Format\n Toast.makeText(MainActivity.this, \"Response Not in JSON Format\", Toast.LENGTH_SHORT).show();\n }\n ;\n }\n });\n\n\n //---------------------------------FOR United States----------------------------------------\n\n //Following codes has similar output as before but the difference is the city Names here\n //is of United States\n request = new Request.Builder()\n .url(\"https://www.metaweather.com/api/location/search/?lattlong=38.899101,-77.028999\")\n .get().build();\n client = new OkHttpClient();\n client.newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Request request, IOException e) {\n Toast.makeText(MainActivity.this, \"Request Failed\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onResponse(Response response) throws IOException {\n if (!response.isSuccessful()) {\n Toast.makeText(MainActivity.this, \"Request Failed\", Toast.LENGTH_SHORT).show();\n return;\n }\n String respFromApi = response.body().string();\n Log.d(\"RawData\", respFromApi);\n try {\n extractData(respFromApi);\n } catch (Exception e) {\n Toast.makeText(MainActivity.this, \"Response Not in JSON Format\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n\n\n }",
"void addPlaceAPI() {\n RestAssured.baseURI = \"https://rahulshettyacademy.com/\";\n String response = given().log().all().queryParam(\"key\",\"qaclick123\")\n .header(\"Content-Type\",\"application/json\")\n\n .body(Payloads.addPlaceJson())\n .when().post(\"maps/api/place/add/json\")\n .then().log().all().assertThat().statusCode(200).body(\"scope\",equalTo(\"APP\"))\n .header(\"server\",\"Apache/2.4.18 (Ubuntu)\").extract().response().asString();\n System.out.println(\"the response is\" + response );\n JsonPath jsonpath = new JsonPath(response); // for parsing the json body/payload\n String OriginalpalaceId = jsonpath.getString(\"place_id\");\n System.out.println(\"the place id is\" + OriginalpalaceId );\n\n // update the address using original place id\n\n String updateResponse = given().log().all().queryParam(\"key\",\"qaclick123\")\n .header(\"Content-Type\",\"application/json\")\n .body(\"{\\n\" +\n \"\\\"place_id\\\":\\\"\"+ OriginalpalaceId + \"\\\",\\n\" +\n \"\\\"address\\\":\\\"70 Summer walk, USA\\\",\\n\" +\n \"\\\"key\\\":\\\"qaclick123\\\"\\n\" +\n \"}\")\n .when().put(\"maps/api/place/update/json\")\n .then().log().all().assertThat().statusCode(200).body(\"msg\",equalTo(\"Address successfully updated\"))\n .extract().response().asString();\n jsonpath = null;\n jsonpath = new JsonPath(updateResponse);\n String msg = jsonpath.getString(\"msg\");\n System.out.println(\"the successful msg is \" + msg );\n\n // now getPlace API call to get the updated Place Id\n\n String getResponse = given().log().all().queryParam(\"key\",\"qaclick123\")\n .queryParam(\"place_id\",OriginalpalaceId)\n .when().get(\"maps/api/place/get/json\")\n .then().log().all().assertThat().statusCode(200).extract().response().asString();\n\n jsonpath = null;\n jsonpath = new JsonPath(getResponse);\n System.out.println(jsonpath.getString(\"address\"));\n System.out.println(\"the response of the get API method \"+ getResponse);\n\n Assert.assertEquals(jsonpath.getString(\"address\"),\"70 Summer walk, USA\",\"Address not matched\" );\n\n }",
"@Test\n public void GetMEthod() {\n\n RestAssured.baseURI = \"http://www.omdbapi.com/\";\n\n RequestSpecification request = RestAssured\n\n .given()\n .config(RestAssured.config().sslConfig(new SSLConfig().allowAllHostnames()));\n\n Response response = request\n\n .when()\n\n .get(\"/?apikey=5148dbc1&s=Harry Potter\")\n .then()\n .statusCode(200)\n\n\n .extract().response();\n\n int responseCode = response.getStatusCode();\n ResponseBody responseBody = response.getBody();\n ArrayList<String> list=new ArrayList<String>();\n\n //System.out.println(response.asString());\n Gson gson=new Gson();\n String json=response.asString();\n Search obj=gson.fromJson(json,Search.class);\n String imdb=\"\";\n for (Element e:obj.Search\n ) {\n String title=e.getTitle();\n if (title.equals(\"Harry Potter and the Sorcerer's Stone\")){\n imdb=e.getimdbID();\n }\n }\n System.out.println(\"imdbID:\"+imdb);\n //http://www.omdbapi.com/?apikey=5148dbc1&i=tt0241527&type=movie\n RequestSpecification request1 = RestAssured\n\n .given()\n .config(RestAssured.config().sslConfig(new SSLConfig().allowAllHostnames()));\n\n Response response1 = request1\n\n .when()\n\n .get(\"/?apikey=5148dbc1&i=\"+imdb+\"&type=movie\")\n .then()\n .statusCode(200)\n\n\n .extract().response();\n\n String json1=response1.asString();\n Movie obj1=gson.fromJson(json1,Movie.class);\n\n System.out.println(\"Title:\" +obj1.getTitle() + \" Year: \" + obj1.getYear()+ \" Released: \"+obj1.getReleased());\n\n System.out.println(\"---------------------\");\n\n\n\n\n\n }",
"@ResponseBody\r\n @RequestMapping(method = RequestMethod.GET, path=\"/item/restaurant/{restaurant_id}\", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\r\n public ResponseEntity<ItemListResponse> getItemsByPopularity(@PathVariable(\"restaurant_id\") final String restaurantId) throws RestaurantNotFoundException\r\n {\r\n // Gets the restaurant by UUID\r\n RestaurantEntity restaurantEntity = restaurantService.restaurantByUUID(restaurantId);\r\n //Get items by no of times the item is ordered from restaurant\r\n List<ItemEntity> itemEntities = itemService.getItemsByPopularity(restaurantEntity);\r\n //Create response item list\r\n ItemListResponse itemListResponse = new ItemListResponse();\r\n for (ItemEntity itemEntity : itemEntities) {\r\n ItemList itemList = new ItemList();\r\n itemList.setId(UUID.fromString(itemEntity.getUuid()));\r\n itemList.setItemName(itemEntity.getItemName());\r\n itemList.setPrice(itemEntity.getPrice());\r\n itemList.setItemType(ItemList.ItemTypeEnum.valueOf(itemEntity.getType().toString()));\r\n itemListResponse.add(itemList);\r\n }\r\n return new ResponseEntity<ItemListResponse>(itemListResponse, HttpStatus.OK);\r\n }",
"@Test\n void getTransactionList() throws JsonProcessingException {\n\n String idAccount = \"14537780\";\n String fromAccountingDate = \"2019-01-01\";\n String toAccountingDate = \"2019-12-01\";\n\n Response response = greetingWebClient.getTransactionList(idAccount, fromAccountingDate, toAccountingDate);\n assertTrue(response.getPayload().getList().size()>0 && response.getStatus().equals(\"OK\"));\n\n }",
"public interface PlacesInterface {\n\n @GET(\"nearbysearch/json?type=restaurant\" )\n Call<Restaurants> listRestaurants(@Query(\"key\") String apikey, @Query(\"location\") String latlong, @Query(\"radius\") String radius);\n\n @GET(\"nearbysearch/json?type=restaurant&rankby=distance\" )\n Call<Restaurants> listRestaurantsByDistance(@Query(\"key\") String apikey, @Query(\"location\") String latlong);\n\n @GET(\"details/json\" )\n Call<Place> getDetails(@Query(\"key\") String apikey, @Query(\"placeid\") String placeid);\n\n}",
"public void getCities(Integer province_id) {\n App.getInstance().getApiInterface().getCities(province_id,Constants.APPJSON).enqueue(new Callback<List<CityList>>() {\n @Override\n public void onResponse(Call<List<CityList>> call, final Response<List<CityList>> response) {\n if (response.isSuccessful()) {\n final Realm realm = Realm.getDefaultInstance();\n realm.executeTransactionAsync(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n realm.delete(CityList.class);\n realm.copyToRealmOrUpdate(response.body());\n }\n }, new Realm.Transaction.OnSuccess() {\n @Override\n public void onSuccess() {\n realm.close();\n }\n }, new Realm.Transaction.OnError() {\n @Override\n public void onError(Throwable error) {\n realm.close();\n error.printStackTrace();\n getView().showAlert(error.getLocalizedMessage());\n }\n });\n } else {\n getView().showAlert(\"Server Error\");\n }\n }\n\n @Override\n public void onFailure(Call<List<CityList>> call, Throwable t) {\n t.printStackTrace();\n getView().showAlert(t.getLocalizedMessage());\n }\n });\n }",
"public interface RegionService {\n\t\n\tRegion getById(Long id);\n\tList<Region> getAll();\n}",
"@Test\n public void testReceiverDonorEndpointBloodType() {\n ResponseEntity response = dataController.getDonorDataRegion(null, \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n\tpublic void validateAll() {\n\n\t\tgiven()\n\t\t.when()\n\t\t.get(\"https://restcountries.eu/rest/v2/all\")\n\t\t.then()\n\t\t.and().body(\"name\", hasItem(\"India\"))\n\t\t.and().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t\tString name = returnValueByKeys(\"India\", \"name\");\n\t\tString capital = returnValueByKeys(\"India\", \"capital\");\n\t\tString region = returnValueByKeys(\"India\", \"region\");\n\t\tString population = returnValueByKeys(\"India\", \"population\");\n\t\tList borders = returnValuesByKeys(\"India\", \"borders\");\n\n\t\tSystem.out.println(name + \" \" + capital + \" \" + region + \" \" + population);\n\t\tfor (Object border : borders) {\n\t\t\tSystem.out.print(border + \" \");\n\t\t}\n\n\t}",
"@RequestLine(\"GET /api/v1/localidades/estados\")\n\tList<EstadoJson> get();",
"public GetUpcomingResponse getUpcoming(String language, Integer page, String region) {\n String path = \"/movie/upcoming\";\n Map<String, Object> requestParams = new HashMap<>();\n requestParams.put(\"language\", language);\n requestParams.put(\"page\", page);\n requestParams.put(\"region\", region);\n return restClient.get(path, requestParams, new TypeReference<>() {\n\n\n }\n );\n }",
"@Test\n public void testGetAllLocations() throws Exception {\n\n mockMvc.perform(get(URL_PREFIX + \"/all\"))\n .andExpect(status().isOk())\n .andExpect(content().contentType(contentType))\n .andExpect(jsonPath(\"$\", hasSize(DB_LOCATION_NUMBER)))\n .andExpect(jsonPath(\"$.[*].id\").value(hasItem(DB_LOCATION_ID.intValue())))\n .andExpect(jsonPath(\"$.[*].city\").value(hasItem(DB_LOCATION_CITY)))\n .andExpect(jsonPath(\"$.[*].cityArea\").value(hasItem(DB_LOCATION_CITY_AREA)))\n .andExpect(jsonPath(\"$.[*].street\").value(hasItem(DB_LOCATION_STREET)))\n .andExpect(jsonPath(\"$.[*].streetNumber\").value(hasItem(DB_LOCATION_STREET_NUMBER)))\n .andExpect(jsonPath(\"$.[*].state\").value(hasItem(DB_LOCATION_STATE)));\n }",
"@Test\n public void crawleProductSize() throws Exception {\n String url = \"https://www.net-a-porter.com/cn/en/product/1048811/fendi/mon-tresor-embroidered-leather-bucket-bag\" ;\n NetCrawingProductSizes crawingProductSizes = new NetCrawingProductSizes() ;\n NetProductDetailPage productDetailPage = crawingProductSizes.crawle(url, \"https://www.net-a-porter.com\") ;\n System.out.println(productDetailPage) ;\n\n ObjectMapper mapper = new ObjectMapper();\n List<NetProductDetailPage.OptionJson> options = mapper.readValue(productDetailPage.options, new TypeReference<List<NetProductDetailPage.OptionJson>>(){});\n System.out.println(options);\n\n }",
"public interface CountryService {\n\n List<City> getCitiesByRegion(int rig_id);\n List<Region> getRegionsByCountry(int con_id);\n List<Country> getCountries();\n List<CityData> searchCities(String name, int limit, int pageNo);\n CityData addCityData(PostCityData postCityData);\n\n}",
"public RegionManagementDetails getCompleteRegionDetails(String seasonId);",
"@Test\r\n\tpublic void testGetAllVendors() throws Exception {\r\n\t\t// when\r\n\t\tMockHttpServletResponse response = mvc.perform(\r\n\t\t\tget(\"/vendors\")\r\n\t\t\t\t.accept(MediaType.APPLICATION_JSON))\r\n\t\t\t.andReturn().getResponse();\r\n\r\n\t\t// then\r\n\t\tassertEquals(response.getStatus(), HttpStatus.OK.value());\r\n\r\n\t\tString content = response.getContentAsString();\r\n\t\tVendor[] vendors = gson.fromJson(content, Vendor[].class);\r\n\t\tassertTrue(vendors.length == 0);\r\n\r\n\t}",
"@Secured({\"ROLE_ADMIN\",\"ROLE_USER\"})\n\t@GetMapping(\"/regiones\")\n\tpublic List<Region> index() {\n\t\treturn regionService.findAll();\n\t}",
"public static JsonObject specialRespToClient_queryFreeUnitByPack_4H_001(JsonObject nomalRespToClient){\n\t\tJsonObject specialRespToClient = new JsonObject();\n\t\tJsonArray freeUnitItemList = (JsonArray) nomalRespToClient.get(\"freeUnitItemList\");\n\t\tArrayList<HashMap<String, Object>> flatMap = getFlatMapFromJsonArray(freeUnitItemList);\n//\t\tSystem.out.println(\"---flatMap---\");\n//\t\tSystem.out.println(flatMap.toString());\n//\t\tSystem.out.println(\"------------------------\");\n\t\t\n\t\tHashMap<String, List<HashMap<String, Object>>> groupByProductMap = new HashMap<String, List<HashMap<String, Object>>>();\n\t\tfor(int i =0;i<flatMap.size();i++) {\n\t\t\tString firstId = (flatMap.get(i).get(\"productId\")==null)?\"\":flatMap.get(i).get(\"productId\").toString();\n\t\t\tString firstSequence = (flatMap.get(i).get(\"productSequenceId\")==null)?\"\":flatMap.get(i).get(\"productSequenceId\").toString();\n\t\t\tList<HashMap<String, Object>> productDetail;\n\t\t\tif(groupByProductMap.containsKey(firstId+firstSequence)) {\n\t\t\t\tproductDetail = groupByProductMap.get(firstId+firstSequence);\n\t\t\t\tproductDetail.add(flatMap.get(i));\n\t\t\t}else {\n\t\t\t\tproductDetail = new ArrayList<>();\n\t\t\t\tproductDetail.add(flatMap.get(i));\n\t\t\t\tgroupByProductMap.put(firstId+firstSequence, productDetail);\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tJsonArray mainProduct = new JsonArray();\n\t\tJsonArray onTopProduct = new JsonArray();\n\t\tJsonArray ortherFreeUnit = new JsonArray();\n\t\t\n\t\tfor(Entry<String, List<HashMap<String, Object>>> key : groupByProductMap.entrySet()) {\n\n\t\t\t\tString productId = key.getValue().get(0).get(\"productId\")==null?\"\":key.getValue().get(0).get(\"productId\").toString();\n\t\t\t\tif(productId.length() == 8) {\n\t\t\t\t\tgroupByProductProcessor(mainProduct,key.getValue(),true);\n\t\t\t\t}else if(productId.length() == 6){\n\t\t\t\t\tgroupByProductProcessor(onTopProduct,key.getValue(),false);\n\t\t\t\t}else {\n\t\t\t\t\tgroupByProductProcessor(ortherFreeUnit,key.getValue(),false);\n\t\t\t\t}\n\t\t}\n\n\t\tspecialRespToClient.add(\"responseMainProductList\", mainProduct);\n\t\tspecialRespToClient.add(\"responseOntopAndServiceList\", onTopProduct);\n\t\tspecialRespToClient.add(\"responseOtherList\", ortherFreeUnit);\n\t\t\n\t\tAFLog.d(specialRespToClient.toString());\n\t\treturn specialRespToClient;\n\t\t\n\t}",
"@Test\n public void oneSpartanPojo(){\n Response response = given().accept(ContentType.JSON)\n .and().pathParam(\"id\", 15)\n .and().get(\"http://18.232.145.26:8000/api/spartans/{id}\");\n\n // Verify response status code should be 200\n Assert.assertEquals(response.statusCode(), 200 , \"Verify status code : \");\n\n // Convert Json to POJO( Our custom Spartan java class )\n Spartan spartan15 = response.body().as(Spartan.class);\n System.out.println(\"spartan15 = \" + spartan15);\n System.out.println(\"spartan15.getNames() = \" + spartan15.getName());\n System.out.println(\"spartan15.getId() = \" + spartan15.getId());\n\n\n }",
"public void getCountries() {\n\n\n SimpleProgressBar.showProgress(AddressesActivity.this);\n try {\n final String url = Contents.baseURL + \"getAllCountries\";\n\n StringRequest stringRequest = new StringRequest(Request.Method.POST, url,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n\n SimpleProgressBar.closeProgress();\n Log.e(\"device response\", response);\n try {\n JSONObject object = new JSONObject(response);\n String status = object.getString(\"status\");\n String message = object.getString(\"message\");\n if (status.equals(\"1\")) {\n\n country_name = new ArrayList<String>();\n iso_name = new ArrayList<String>();\n JSONArray jsonArray = object.getJSONArray(\"record\");\n for (int i = 0; i < jsonArray.length(); i++) {\n JSONObject c = jsonArray.getJSONObject(i);\n if (session.getKeyLang().equals(\"Arabic\")) {\n country_name.add(c.getString(\"name_arabic\"));\n } else {\n country_name.add(c.getString(\"name\"));\n }\n iso_name.add(c.getString(\"iso\"));\n }\n\n //Creating the ArrayAdapter instance having the country list\n ArrayAdapter aa = new ArrayAdapter(AddressesActivity.this, android.R.layout.simple_spinner_item, country_name);\n aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n spin_country.setAdapter(aa);\n\n spin_country.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {\n @Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n System.out.println(\"OSO NAME===\" + iso_name.get(position));\n getProvinces(iso_name.get(position));\n }\n\n @Override\n public void onNothingSelected(AdapterView<?> parent) {\n\n }\n });\n\n for (int i = 0; i < iso_name.size(); i++) {\n if (iso_name.get(i).contains(\"KW\")) {\n position = i;\n //mDob=iso_name.get(position);\n break;\n }\n }\n\n spin_country.setSelection(position);\n\n } else {\n\n Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();\n }\n } catch (JSONException e) {\n SimpleProgressBar.closeProgress();\n }\n\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n if (error != null && error.networkResponse != null) {\n Toast.makeText(getApplicationContext(), R.string.server_error, Toast.LENGTH_SHORT).show();\n\n } else {\n Toast.makeText(getApplicationContext(), R.string.no_internet, Toast.LENGTH_SHORT).show();\n }\n SimpleProgressBar.closeProgress();\n }\n }) {\n @Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"appUser\", \"tefsal\");\n params.put(\"appSecret\", \"tefsal@123\");\n params.put(\"appVersion\", \"1.1\");\n\n Log.e(\"Refsal device == \", url + params);\n\n return params;\n }\n\n };\n\n stringRequest.setRetryPolicy(new DefaultRetryPolicy(30000,\n DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\n RequestQueue requestQueue = Volley.newRequestQueue(AddressesActivity.this);\n stringRequest.setShouldCache(false);\n requestQueue.add(stringRequest);\n\n } catch (Exception surError) {\n surError.printStackTrace();\n }\n }",
"public ResponseDTO getRegionProvinceCityList() {\n ResponseDTO dto = new ResponseDTO();\n List<Region> list = regionBiz.selectRegionProvinceCityList();\n dto.setCode(ResponseCode.CommonCode.OK.v());\n dto.setMsg(ResponseCode.CommonCode.OK.c());\n dto.setData(list);\n return dto;\n }",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getListAll() {\n\n\t\tGenericEntity<List<AreaTO>> entity = null;\n\n\t\tfinal Users user = this.usersService.findByCDSID(this.requestContext.getUserId());\n\t\tfinal Area filter = new Area();\n\t\tfilter.setCountryC(FunctionsUtils.validateInteger(user.getCountryDbC()));\n\t\tfinal List<Area> listArea = this.areaService.findByFilter(filter);\n\n\t\tfinal List<AreaTO> listAreaTO = new ArrayList<AreaTO>();\n\n\t\ttry {\n\n\t\t\tif (listArea != null && listArea.size() > 0) {\n\n\t\t\t\tfor (final Area area : listArea) {\n\t\t\t\t\tfinal AreaTO areaTO = new AreaTO();\n\t\t\t\t\tPropertyUtils.copyProperties(areaTO, area);\n\t\t\t\t\tlistAreaTO.add(areaTO);\n\t\t\t\t}\n\n\t\t\t\tentity = new GenericEntity<List<AreaTO>>(listAreaTO) {\n\t\t\t\t\t// teste...\n\t\t\t\t};\n\t\t\t}\n\n\t\t} catch (final ApplicationException e) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setCodigoIncident(e.getLogReferenceCode());\n\n\t\t\tfinal ResourceBundle bundle = ResourceBundle.getBundle(\"ApplicationResources\");\n\n\t\t\tfinal List<ErrorType> erros = e.getErrorTypes();\n\n\t\t\tfor (final ErrorType errorType : erros) {\n\t\t\t\terro.setMessage(bundle.getString(errorType.getKey()));\n\t\t\t}\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\n\t\t} catch (final Exception ex) {\n\n\t\t\tfinal ErrorTO erro = new ErrorTO();\n\t\t\terro.setMessage(\"Fatal Error\");\n\n\t\t\treturn this.buildResponse(erro, Status.INTERNAL_SERVER_ERROR);\n\t\t}\n\n\t\treturn buildResponseListOK(entity);\n\n\t}",
"public void Category_name()\n {\n\n RequestBody requestBody = new ParamsBuilder<>()\n .key(\"pbevyvHkf1sFtyGL35gFfQ==\")\n .methodName(\"GetArea\")\n .gson(new Gson())\n .noParams()\n // .object(loginParams)\n /*.typeValue(\"string\",\"\")*/\n .build();\n// ParamsBuilder<LoginParams> builder = new ParamsBuilder<LoginParams>().\n// .key(\"\")\n// .build();\n //分类名称\n Call<BaseResp> call = HttpClients.getInstance().maintenance(requestBody);\n\n call.enqueue(new Callback<BaseResp>() {\n @Override\n public void onResponse(Call<BaseResp> call, Response<BaseResp> response) {\n String data = response.body().getData();\n Log.e(\"地区列表\",data+\"\");\n jx(data);\n\n }\n\n @Override\n public void onFailure(Call<BaseResp> call, Throwable t) {\n Log.e(\"111\",\"失败\");\n }\n });\n\n\n }",
"public interface Service {\n @GET(\"/orama-media/json/fund_detail_full.json?limit=1000&offset=0&serializer=fund_detail_full\")\n Call<List<Example>> getExample();\n\n}",
"@Override\n public void onSuccess(int statusCode, Header[] headers, JSONObject response)\n {\n super.onSuccess(statusCode, headers, response);\n LogUtil.i(TAG, \"getservBookResource\", response.toString());\n if (response.opt(\"code\").equals(\"00000\"))\n {\n JSONObject dataJsonObject = response.optJSONObject(\"data\");\n JSONArray trafficJSONList = dataJsonObject.optJSONArray(\"traffic\");\n if (trafficJSONList != null && trafficJSONList.length() > 0)\n {\n for (int j = 0; j < trafficJSONList.length(); j++)\n {\n JSONObject serviceJSON = trafficJSONList.optJSONObject(j);\n ServResrouce service = new ServResrouce();\n service.setServId(serviceJSON.optString(\"servId\"));\n service.setServName(serviceJSON.optString(\"servName\"));\n service.setServAlias(serviceJSON.optString(\"servAlias\"));\n service.setServType(serviceJSON.optString(\"servType\"));\n service.setRank(serviceJSON.optString(\"rank\"));\n service.setTitleImage(serviceJSON.optString(\"titleImg\"));\n service.setServDesc(serviceJSON.optString(\"servDesc\"));\n if (service.getServType().equals(\"airplane\") || service.getServType().equals(\"Iairplane\"))\n {\n airPlaneList.add(service);\n }\n else\n {\n carOrBoaticList.add(service);\n }\n }\n }\n JSONArray stayJSONList = dataJsonObject.optJSONArray(\"stay\");\n if (stayJSONList != null && stayJSONList.length() > 0)\n {\n for (int j = 0; j < stayJSONList.length(); j++)\n {\n JSONObject serviceJSON = stayJSONList.optJSONObject(j);\n ServResrouce service = new ServResrouce();\n service.setServId(serviceJSON.optString(\"servId\"));\n service.setServName(serviceJSON.optString(\"servName\"));\n service.setServAlias(serviceJSON.optString(\"servAlias\"));\n service.setServType(serviceJSON.optString(\"servType\"));\n service.setRank(serviceJSON.optString(\"rank\"));\n service.setTitleImage(serviceJSON.optString(\"titleImg\"));\n service.setServDesc(serviceJSON.optString(\"servDesc\"));\n stayList.add(service);\n }\n }\n mAirListViewAdapter.notifyDataSetChanged();\n mNoAirAdapter.notifyDataSetChanged();\n mHotelAdapter.notifyDataSetChanged();\n }\n }",
"@RequestMapping(value = \"get_history_by_items\",headers=\"Accept=*/*\", method={RequestMethod.GET},produces=\"application/json\")\n\t@ResponseBody\n\t@org.codehaus.jackson.map.annotate.JsonView(HistoryPair.class)\n\tpublic HistoryPair[] getHistoryByItems(@RequestParam(\"entity\") String title){\n\t\t//:TODO your implementation\n\t\tHistoryPair hp = new HistoryPair(\"aa\", new Date());\n\t\tSystem.out.println(\"ByItem \"+hp);\n\t\treturn new HistoryPair[]{hp};\n\t}",
"public interface GsonAPIService {\n\n @Get(\"{query}/pm10.json\")\n @Head(\"Cache-Control:max-age=640000\")\n Call<List<PM25>> getWeather(@Path(\"query\") String query, @Query(\"city\") String city, @Query(\"token\") String token);\n}",
"public static void example2(ApiEndpoint apiEndpoint, String email, String password) {\n System.out.println(\"--- EXAMPLE 2 ---\");\n try {\n HashMap<String, String> params = new HashMap<>();\n\n System.out.print(\"Retrieving authToken...\");\n AuthToken authToken = AuthService.getAuthToken(apiEndpoint, email, password);\n System.out.println(\"Done!\");\n\n System.out.print(\"Retrieving Vehicle List...\");\n // Uncomment following line, if you want to include the vehicles the user has been granted read rights to.\n //params.put(\"includeAccessGrantVehicles\", \"true\");\n ActionResponse vResp = AuthService.runAction(apiEndpoint, authToken, \"v1/vehicle\", ActionTypes.GET, params, null);\n System.out.println(\"Done!\");\n System.out.println(\"Response \"+vResp.httpCode+\": \"+vResp.jsonArray.toJSONString());\n\n System.out.print(\"Retrieving first vehicle(including all vehicle states) from previous response...\");\n JSONObject firstV = (JSONObject)(vResp.jsonArray.get(0));\n params.clear();\n // we are settings all 'with*' to true here in order to retrieve all vehicle information and not just basic meta data\n params.put(\"withBase\", \"true\");\n params.put(\"withRemoteFunctionsState\", \"true\");\n params.put(\"withLockState\", \"true\");\n params.put(\"withClimaState\", \"true\");\n params.put(\"withDrivingState\", \"true\");\n params.put(\"withGeoState\", \"true\");\n params.put(\"withBatteryState\", \"true\");\n params.put(\"includeAccessGrantVehicles\", \"true\");\n ActionResponse singlevResp = AuthService.runAction(apiEndpoint, authToken, \"v1/vehicle/\"+firstV.get(\"id\"), ActionTypes.GET, params, null);\n System.out.println(\"Done!\");\n System.out.println(\"Response \"+singlevResp.httpCode+\": \"+singlevResp.jsonObject.toJSONString());\n\n // Print out SoC\n JSONObject baseState = (JSONObject)(singlevResp.jsonObject.get(\"base\"));\n if(baseState != null) {\n System.out.println(\"Vehicle SoC: \" + baseState.get(\"soc\"));\n }\n\n } catch (RcmsClientException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(\"--- END OF EXAMPLE 2 ---\");\n }",
"public interface APIEndpoint {\n\n @GET(\"/search?show-tags=keyword&show-elements=all&show-fields=headline%2CtrailText%2Cbody%2Cmain%2CcreationDate%2Cthumbnail&api-key=\" + Constant.APIKEY)\n Call<APIResponse> getLastestArticle(@Query(\"page\") int page);\n\n @GET(\"/search?show-tags=keyword&show-elements=all&show-fields=headline%2CtrailText%2Cbody%2Cmain%2CcreationDate%2Cthumbnail&page=1&page-size=5&api-key=\" + Constant.APIKEY)\n Call<APIResponse> getArticlesBySection(@Query(\"section\") String sectionId, @Query(\"from-date\") String fromDate, @Query(\"to-date\") String toDate);\n\n @GET(\"/search?show-tags=keyword&show-elements=all&show-fields=headline%2CtrailText%2Cbody%2Cmain%2CcreationDate%2Cthumbnail&page-size=10&api-key=\" + Constant.APIKEY)\n Call<APIResponse> getArticlesBySection(@Query(\"section\") String sectionId, @Query(\"page\") int page);\n\n @GET(\"/search?show-tags=keyword&show-elements=all&show-fields=headline%2CtrailText%2Cbody%2Cmain%2CcreationDate%2Cthumbnail&api-key=\" + Constant.APIKEY)\n Call<APIResponse> getArticleBySearch(@Query(\"q\") String searchQuery,@Query(\"page\") int page);\n\n @GET(\"/{id}?show-tags=keyword&show-elements=all&show-fields=headline%2CtrailText%2Cbody%2Cmain%2CcreationDate%2Cthumbnail&api-key=\" + Constant.APIKEY)\n Call<APIResponse> getArticle(@Path(\"id\") String ArticleId);\n\n @GET(\"/sections?show-tags=all&show-fields=trailText&page=1&page-size=5&api-key=\" + Constant.APIKEY)\n Call<Topic> getTopic();\n\n\n\n\n}",
"@Test\n\tpublic void testGetVehicleModels() throws UnirestException {\n\tHttpResponse<String> response = Unirest.get(\"http://localhost:8080/TrackingVehicle/api/service/vehicleModels\")\n\t\t\t .header(\"Cache-Control\", \"no-cache\")\n\t\t\t .header(\"Postman-Token\", \"5d15aea4-c5ba-4e67-b979-42bd52ae1ccf\")\n\t\t\t .asString();\n}",
"public void getProvince() {\n App.getInstance().getApiInterface().getProvince(Constants.APPJSON).enqueue(new Callback<List<Province>>() {\n @Override\n public void onResponse(Call<List<Province>> call, final Response<List<Province>> response) {\n if (response.isSuccessful()) {\n final Realm realm = Realm.getDefaultInstance();\n realm.executeTransactionAsync(new Realm.Transaction() {\n @Override\n public void execute(Realm realm) {\n realm.delete(Province.class);\n realm.copyToRealmOrUpdate(response.body());\n }\n }, new Realm.Transaction.OnSuccess() {\n @Override\n public void onSuccess() {\n realm.close();\n }\n }, new Realm.Transaction.OnError() {\n @Override\n public void onError(Throwable error) {\n realm.close();\n error.printStackTrace();\n getView().showAlert(error.getLocalizedMessage());\n }\n });\n } else {\n getView().showAlert(\"Server Error\");\n }\n }\n\n @Override\n public void onFailure(Call<List<Province>> call, Throwable t) {\n t.printStackTrace();\n getView().showAlert(t.getLocalizedMessage());\n }\n });\n }",
"@Test\n public void test1() {\n\n Student student = given().accept(ContentType.JSON)\n .pathParam(\"id\", 23401)\n .when()\n .get(\"http://api.cybertektraining.com/student/{id}\")\n .then().statusCode(200)\n .and().contentType(\"application/json;charset=UTF-8\")\n .and().header(\"Content-Encoding\", equalTo(\"gzip\"))\n .and().header(\"Date\", notNullValue()).extract().jsonPath().getObject(\"students[0]\", Student.class);\n\n System.out.println(\"student.getFirstName() = \" + student.getFirstName());\n System.out.println(\"student.getBatch() = \" + student.getBatch());\n System.out.println(\"student.getSection() = \" + student.getSection());\n System.out.println(\"student.getContact().getEmailAddress() = \" + student.getContact().getEmailAddress());\n System.out.println(\"student.getAddress().getState() = \" + student.getCompany().getAddress().getState());\n System.out.println(\"student.getAddress().getZipCode() = \" + student.getCompany().getAddress().getZipCode());\n\n System.out.println(\"student.getCompany().getCompanyName() = \" + student.getCompany().getCompanyName());\n\n String expFirstName = \"Vera\";\n int expBatch = 14;\n int expSection = 12;\n String expEmail = \"aaa@gmail.com\";\n String expCompanyName = \"Cybertek\";\n String expState = \"IL\";\n int expZipCode = 60606;\n\n assertThat(expFirstName, equalTo(student.getFirstName()));\n assertThat(expBatch, equalTo(student.getBatch()));\n assertThat(expSection, equalTo( student.getSection()));\n assertThat(expEmail, equalTo(student.getContact().getEmailAddress()));\n assertThat(expCompanyName, equalTo(student.getCompany().getCompanyName()));\n assertThat(expState, equalTo(student.getCompany().getAddress().getState()));\n assertThat(expZipCode, equalTo(student.getCompany().getAddress().getZipCode()));\n\n\n\n\n\n\n}",
"@GetMapping(\"/v2/test/{userId}\")\n public ResponseEntity<Map> getTestById(@PathVariable(value = \"userId\") BigInteger userId) {\n\t List<Map> sourceList = new ArrayList<Map>();\n\t Map source = new HashMap();\n\t source.put(\"type\", 1);\n\t source.put(\"ip\", \"10.8.1.3\");\n\t source.put(\"count\", 8);\n\t source.put(\"asset_name\", \"10.8.1.3资产\");\n\t source.put(\"domain\", \"鱼鱼\");\n\t sourceList.add(source);\n\t \n\t Map source2 = new HashMap();\n\t source2.put(\"type\", 3);\n\t source2.put(\"ip\", \"10.10.19.8\");\n\t source2.put(\"count\", 18);\n\t source2.put(\"asset_name\", \"10.10.19.8资产\");\n\t source2.put(\"domain\", \"aaa\");\n sourceList.add(source2);\n \n Map source3 = new HashMap();\n source3.put(\"type\", 2);\n source3.put(\"ip\", \"10.10.19.2\");\n source3.put(\"count\", 18);\n source3.put(\"asset_name\", \"10.10.19.2资产\");\n source3.put(\"domain\", \"ccc\");\n sourceList.add(source3);\n\t \n\t \n\t Map data = new HashMap(); \n\t data.put(\"source\", sourceList);\n\t Map map = new HashMap();\n map.put(\"data\", data);\n \n return new ResponseEntity(map,HttpStatus.OK);\n }",
"public interface RetrofitCountryIO {\n\n @GET(\"/names.json\")\n Map<String, String> getCountryCodes();\n}",
"@Delegate\n @Path(\"/projects/{project}/regions/{region}\")\n AddressApi getAddressApi(@PathParam(\"project\") String projectName, @PathParam(\"region\") String region);",
"public List<HCLFieldTransaction> getAllTransactionListService()\r\n\t\t\tthrows JsonProcessingException, MalformedURLException, IOException {\r\n\t\tlogger.info(\"Logger Name: getAllTransactionListService() :: \" + logger.getName());\r\n\t\tObjectMapper mapper = new ObjectMapper();\r\n\r\n\t\tlogger.info(\"Open Bank API URL :: getTotalAmountbyTransactionType() :: \"\r\n\t\t\t\t+ TransactionConstant.THIRD_PARTY_REST_API);\r\n\t\tJsonNode root = mapper.readTree(new URL(TransactionConstant.THIRD_PARTY_REST_API));\r\n\r\n\t\tList<HCLFieldTransaction> transactionList = new ArrayList<HCLFieldTransaction>();\r\n\r\n\t\t/* Traversing Nested JSON node to publish the relevant data */\r\n\t\ttry {\r\n\t\t\tJsonNode transactionsNodes = root.path(\"transactions\");\r\n\r\n\t\t\tfor (JsonNode transactionsNode : transactionsNodes) {\r\n\r\n\t\t\t\tHCLFieldTransaction hclFieldTransaction = new HCLFieldTransaction();\r\n\t\t\t\thclFieldTransaction.setId(transactionsNode.path(\"id\").asText());\r\n\r\n\t\t\t\tJsonNode thisAccount_Node = transactionsNode.path(\"this_account\");\r\n\t\t\t\thclFieldTransaction.setAccountId(thisAccount_Node.path(\"id\").asText());\r\n\r\n\t\t\t\tJsonNode otherAccount_Node = transactionsNode.path(\"other_account\");\r\n\t\t\t\thclFieldTransaction.setCounterpartyAccount(otherAccount_Node.path(\"number\").asText());\r\n\r\n\t\t\t\tJsonNode otherAccount_holder_Node = otherAccount_Node.path(\"holder\");\r\n\t\t\t\thclFieldTransaction.setCounterpartyName(otherAccount_holder_Node.path(\"name\").asText());\r\n\t\t\t\tJsonNode metadata = otherAccount_Node.path(\"metadata\");\r\n\t\t\t\thclFieldTransaction.setCounterPartyLogoPath(metadata.path(\"open_corporates_URL\").asText());\r\n\r\n\t\t\t\tJsonNode details = transactionsNode.path(\"details\");\r\n\t\t\t\thclFieldTransaction.setTransactionType(details.path(\"type\").asText());\r\n\t\t\t\thclFieldTransaction.setDescription(details.path(\"description\").asText());\r\n\r\n\t\t\t\tJsonNode value = details.path(\"value\");\r\n\t\t\t\thclFieldTransaction.setInstructedAmount(value.path(\"amount\").asDouble());\r\n\r\n\t\t\t\thclFieldTransaction.setInstructedCurrency(value.path(\"currency\").asText());\r\n\r\n\t\t\t\thclFieldTransaction.setTransactionAmount(value.path(\"amount\").asDouble());\r\n\t\t\t\thclFieldTransaction.setTransactionCurrency(value.path(\"currency\").asText());\r\n\t\t\t\tlogger.debug(\"Transaction Field Row Value:: \" + hclFieldTransaction.toString());\r\n\r\n\t\t\t\t/* Adding all transaction list into one ArrayList */\r\n\t\t\t\ttransactionList.add(hclFieldTransaction);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"Exception : getAllTransactionListService() :: \", e);\r\n\t\t}\r\n\t\tlogger.info(\r\n\t\t\t\t\"Return value from service layer :: getAllTransactionListService() :: \" + transactionList.toString());\r\n\t\treturn transactionList;\r\n\t}"
] | [
"0.65451205",
"0.63478106",
"0.61677456",
"0.6153476",
"0.6102355",
"0.60120916",
"0.591548",
"0.5888677",
"0.58331084",
"0.57990485",
"0.57802826",
"0.5730259",
"0.57066673",
"0.5706411",
"0.56284416",
"0.5617755",
"0.55946255",
"0.5552989",
"0.55362964",
"0.5532368",
"0.5507056",
"0.5485798",
"0.5469976",
"0.5463563",
"0.54408985",
"0.5434134",
"0.5434103",
"0.5409839",
"0.5408134",
"0.53961974",
"0.5366521",
"0.535112",
"0.53449315",
"0.5330936",
"0.53042054",
"0.52909565",
"0.52703625",
"0.5244473",
"0.5235593",
"0.5231367",
"0.5230278",
"0.5223019",
"0.5188654",
"0.5188043",
"0.51831144",
"0.517541",
"0.51606727",
"0.5158844",
"0.5158416",
"0.51556116",
"0.5133865",
"0.5121262",
"0.5120496",
"0.51177937",
"0.5101328",
"0.50936514",
"0.5088899",
"0.5087014",
"0.50755996",
"0.50635505",
"0.5054416",
"0.50496364",
"0.5043931",
"0.5039706",
"0.5030459",
"0.50241643",
"0.501861",
"0.50128055",
"0.5006766",
"0.50066537",
"0.50037944",
"0.50019574",
"0.49975663",
"0.49941966",
"0.4984871",
"0.49787092",
"0.4976317",
"0.49739662",
"0.4971028",
"0.49696478",
"0.49629322",
"0.49503288",
"0.4949159",
"0.49486893",
"0.49458462",
"0.4937488",
"0.49317315",
"0.4930092",
"0.49283457",
"0.4927311",
"0.49260202",
"0.49256688",
"0.49199277",
"0.4917431",
"0.49171445",
"0.49148807",
"0.49143237",
"0.49129623",
"0.4911396",
"0.49037257"
] | 0.6688702 | 0 |
/Given the Accept type is JSON When I send a GET request to REST URL /regions Then status code is 200 And Response content should be json and second region name is Americas | @Test
public void verifyRegionName() {
given().accept(ContentType.JSON).
when().get(ConfigurationReader.getProperty("hrapp.baseurl")+"/regions")
.then().assertThat().statusCode(200)
.and().contentType(ContentType.JSON)
.and().assertThat().body("items[1].region_name", equalTo("Americas"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testReceiverRegionEndpointCombo() {\n ResponseEntity response = dataController.getReceiverDataRegion(\"F\", \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverGenderEndpointRegionFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(\"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testDonorGenderEndpointRegionFilterReturns() {\n ResponseEntity response = dataController.getDonorDataGender(\"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionEndpointGender() {\n ResponseEntity response = dataController.getReceiverDataRegion(\"M\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionEndpointBloodType() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionReturns() {\n ResponseEntity response = dataController.getReceiverDataByOrgans(\"N\", \"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testTransplantListEndpointQueryRegion() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,null,null,\"Auckland\",upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverAgeEndpointRegion() {\n ResponseEntity response = dataController.getReceiverDataAge(null, null, \"Canterbury\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverRegionEndpointAge() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Delegate\n @Path(\"/projects/{project}/regions/{region}\")\n RegionOperationApi getRegionOperationApi(@PathParam(\"project\") String project, @PathParam(\"region\") String region);",
"@Test\n public void testItemsCountFromResponseBody() {\n\t\tgiven().accept(ContentType.JSON).\n\t\twhen().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/regions\")\n\t\t.then().assertThat().statusCode(200)\n\t\t.and().contentType(ContentType.JSON)\n\t\t.and().assertThat().body(\"items.region_id\", hasSize(4))\n\t\t.and().assertThat().body(\"items.region_id\", hasItem(\"Europe\"))\n\t\t.and().assertThat().body(\"items.region_name\", hasItems(\"Americas\",\"Europe\",\"do\"));\n }",
"@Test\n public void getWitheaders(){\n with().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/countries/US\")\n .then().statusCode(200);\n }",
"@Test\n public void testReceiverRegionEndpointNoFilters() {\n ResponseEntity response = dataController.getReceiverDataRegion(null, null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testItemsCountFromResponseBody(){\n given().accept(ContentType.JSON)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/regions\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n //here we need to provide address starting from the root element\n .and().assertThat().body(\"items.region_id\", hasSize(4))\n .and().assertThat().body(\"items.region_name\", hasItem(\"Americas\")); //hasItem accepts only 1 item\n //.and().assertThat().body(\"items.region_name\", hasItems(\"Americas\",\"Asia\")); //hasItems accepts multiple items, because it uses varags as argument\n }",
"@Test\n public void testDonorRegionReturns() {\n ResponseEntity response = dataController.getDonorDataByOrgans(\"N\", \"Canterbury\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverDonorEndpointCombo() {\n ResponseEntity response = dataController.getDonorDataRegion(\"F\", \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testRegionName() throws JSONException {\n String[] region = {\"Asia\",\"Asia\",\"Africa\"};\n for (i=0;i<respArray.length();i++){\n Assert.assertEquals(respArray.getJSONObject(i).getString(\"region\"),region[i], \"Region name does not match\");\n }\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 }",
"@RequestMapping(\"/getById/{id}\")\r\npublic Optional<Region> getById(@Valid int id){\nreturn regionService.getById(id);\r\n// return \"index\";\r\n// if (region.isPresent()) {\r\n// return new ResponseEntity<>(region.get(), HttpStatus.OK);\r\n// } else {\r\n// return new ResponseEntity<>(HttpStatus.NOT_FOUND);\r\n// }\r\n }",
"@Test\r\n\tpublic void givenResourceUrl_whenSendGetForRequestEntity_thenStatusOk() throws IOException {\n\r\n\t\tfinal Logger log = LoggerFactory.getLogger(UserDataRestTemplateTest.class);\r\n\r\n\t\tRestTemplate restTemplate = new RestTemplate();\r\n\t\tMap<String, String> response = (Map<String, String>) restTemplate\r\n\t\t\t\t.getForObject(\"http://services.groupkt.com/country/get/iso2code/IN\", Map.class);\r\n\t\tlog.info(\"==== RESTful API Response using Spring RESTTemplate START =======\");\r\n\t\tlog.info(response.toString());\r\n\t\tlog.info(\"==== RESTful API Response using Spring RESTTemplate END =======\");\r\n\r\n\t}",
"@Test\n public void testReceiverDonorEndpointGender() {\n ResponseEntity response = dataController.getDonorDataRegion(\"M\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@RequestLine(\"GET /geoip/territories?codes={codes}\")\n Collection<Collection<Region>> getAvailableRegions(@Param(\"codes\") String codes);",
"@Delegate\n @Path(\"/projects/{project}\")\n RegionApi getRegionApi(@PathParam(\"project\") String projectName);",
"@Test\n\tpublic void testHighlightProducesDefaultJsonWithBrowserRequest() throws Exception {\n\t\tHttpServletRequest req = mock(HttpServletRequest.class);\n\n\t\twhen(req.getHeaders(Constants.HEADER_ACCEPT)).thenAnswer(theInvocation -> new ArrayEnumeration<>(\"text/html,application/xhtml+xml,application/xml;q=0.9\"));\n\n\t\tHttpServletResponse resp = mock(HttpServletResponse.class);\n\t\tStringWriter sw = new StringWriter();\n\t\twhen(resp.getWriter()).thenReturn(new PrintWriter(sw));\n\n\t\tPatient resource = new Patient();\n\t\tresource.addName().setFamily(\"FAMILY\");\n\n\t\tServletRequestDetails reqDetails = new TestServletRequestDetails(mock(IInterceptorBroadcaster.class));\n\t\treqDetails.setRequestType(RequestTypeEnum.GET);\n\t\treqDetails.setParameters(new HashMap<>());\n\t\tRestfulServer server = new RestfulServer(ourCtx);\n\t\tserver.setDefaultResponseEncoding(EncodingEnum.JSON);\n\t\treqDetails.setServer(server);\n\t\treqDetails.setServletRequest(req);\n\n\t\tassertFalse(ourInterceptor.outgoingResponse(reqDetails, new ResponseDetails(resource), req, resp));\n\n\t\tString output = sw.getBuffer().toString();\n\t\tourLog.info(output);\n\t\tassertThat(output, containsString(\"resourceType\"));\n\t}",
"@GET\n @Path(\"location/Arovince\")\n @Produces(\"application/json\")\n public String getJson() throws IOException {\n FileWriter file = new FileWriter(\"/home/component/NetBeansProjects/ArovinceAndSchool/web/api/Arovince.json\");\n JSONObject jsonArray = null;\n\n try {\n URL url = new URL(\"https://opend.data.go.th/get-ckan/datastore_search?resource_id=df922923-e009-4dee-92fc-d963a86ce4b8\"); \n HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();\n httpURLConnection.setRequestMethod(\"GET\");\n httpURLConnection.setRequestProperty(\"api-key\", \"XOe9aVTolOhCbyTU103IqAKTNNNPX8b5\");\n String line = \"\";\n InputStreamReader inputStreamReader = new InputStreamReader(httpURLConnection.getInputStream());\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n StringBuilder response = new StringBuilder();\n\n try {\n while((line = bufferedReader.readLine()) != null) {\n file.write(line);\n response.append(line);\n }\n } catch (IOException var10) {\n }\n\n file.close();\n bufferedReader.close();\n jsonArray = new JSONObject(response.toString());\n return jsonArray.toString(4);\n } catch (Exception var11) {\n return \"\" + var11;\n }\n }",
"@org.junit.Test\n\tpublic void allStatesOfCountry() {\n\t\tResponse response = given().when().get(\"http://services.groupkt.com/state/get/IND/all\");\n\n\t\tresponse.prettyPrint();\n\n\t\t/* 1. verify status code */\n\t\tresponse.then().statusCode(200);\n\n\t\t/* 2. verify countryCode */\n//\t\tresponse.then().body(\"RestResponse.result.country\", equalTo(\"IND\")).body(\"RestResponse.result.name\",\n//\t\t\t\tequalTo(\"Karnataka\"));\n//\t\t\n//\t\tresponse.then().body(\"RestResponse.result.name\", hasItems(\"Andhra Pradesh,Arunachal Pradesh\"));\n\t\t\n\t\t\n\t\tresponse.then().assertThat().body(\"RestResponse.result.name\", hasValue(\"Jammu and Kashmir\"));\n\t\t\n//\t\t\n//\t\tJsonPath jsonPath = new JsonPath(response.toString()).setRoot(\"RestResponse\");\n//\t\tJsonObject lottoId = jsonPath.getJsonObject(\"result\");\n//\t\tList<Integer> winnerIds = jsonPath.get(\"result.id\");\n\n\t}",
"@Test\n\tpublic void useResponseSpecification() {\n\t\t\n\t\tgiven().\n\t\t\tspec(requestSpec).\n\t\twhen().\n\t\t\tget(\"/2014/1/circuits.json\").\n\t\tthen().\n\t\t\tspec(responseSpec).\n\t\tand().\n\t\t\tbody(\"MRData.CircuitTable.Circuits.Location[0].locality\",equalTo(\"Melbourne\"));\n\t}",
"private void loadSearchRegions() {\n showProgress(ApplicationConstants.DIALOG_HEADER, \"Please wait while we retrieve regions from server.\");\n String authToken = ShPrefManager.with(getActivity()).getToken();\n RestClient.getAPI().getRegions(authToken, new RestCallback<RegionsResponse>() {\n @Override\n public void failure(RestError restError) {\n OpenHomeUtils.showToast(getActivity().getApplicationContext(), \"Could not load regions from the server.\", Toast.LENGTH_LONG);\n }\n\n @Override\n public void success(RegionsResponse regionsResponse, Response response) {\n if (regionsResponse.getMessage().size() > 0) {\n regionsList = regionsResponse.getMessage();\n setOnClickListeners();\n populateRegions();\n } else {\n String message = \"There is an error loading data. Please contact administrator..\";\n CustomDialogFragment regSuccessDialogFragment = CustomDialogFragment.newInstance(R.string.try_again,\n message, ApplicationConstants.BUTTON_OK, 0);\n regSuccessDialogFragment.show(getActivity().getFragmentManager(), \"AddPropertyFragment\");\n }\n }\n });\n\n getAllHazards();\n }",
"public List getZonasRegion(String feriadoRegion);",
"@Test\n public void testReceiverDonorEndpointBloodType() {\n ResponseEntity response = dataController.getDonorDataRegion(null, \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n\t@Ignore\n\tpublic void testResponse() throws UnsupportedEncodingException {\n\t\tws = resource().path(\"omxdata\");\n\t\tClientResponse response = ws.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);\n\t\tassertEquals(200, response.getStatus());\n\t\tSystem.out.println(response.getStatus());\n\t}",
"@Test\n public void printResponse(){\n when().get(\"http:://34.223.219.142:1212/ords/hr/countries\")\n .body().prettyPrint();\n\n }",
"@Test\n\tpublic void ListAllCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tString json = given().get(Endpoint.GET_COUNTRY).then().extract().asString();\n\t\tJsonPath jp = new JsonPath(json);\n\t\tList<String> list = jp.get(\"name\");\n\t\tSystem.out.println(\"Country's are -------\" + list.get(0));\n\t}",
"@Test\n public void testReceiverAgeEndpointCombo() {\n ResponseEntity response = dataController.getReceiverDataAge(\"M\", null, \"Canterbury\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n\tpublic void validateCountry() {\n\t\tRequestSpecification requestSpecification = new base().getRequestSpecification();\n\t\tgiven().get(Endpoint.GET_COUNTRY).then().statusCode(200).\n\t\tand().contentType(ContentType.JSON).\n\t\tand().body(\"name\", hasItem(\"India\")).\n\t\tand().body(\"find { d -> d.name == 'India' }.borders\", hasItem(\"CHN\"));\n\n\t}",
"private void getAreas(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\tAreasServiceImpl areas = new AreasServiceImpl();\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Areas> select = areas.selectAllId(parameter);\n\t\t\n\t\t\n\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\t\n\t}",
"@Secured({\"ROLE_ADMIN\",\"ROLE_USER\"})\n\t@GetMapping(\"/regiones\")\n\tpublic List<Region> index() {\n\t\treturn regionService.findAll();\n\t}",
"@Test\n public void testReceiverDonorEndpointAge() {\n ResponseEntity response = dataController.getDonorDataRegion(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void test1() {\n\n Student student = given().accept(ContentType.JSON)\n .pathParam(\"id\", 23401)\n .when()\n .get(\"http://api.cybertektraining.com/student/{id}\")\n .then().statusCode(200)\n .and().contentType(\"application/json;charset=UTF-8\")\n .and().header(\"Content-Encoding\", equalTo(\"gzip\"))\n .and().header(\"Date\", notNullValue()).extract().jsonPath().getObject(\"students[0]\", Student.class);\n\n System.out.println(\"student.getFirstName() = \" + student.getFirstName());\n System.out.println(\"student.getBatch() = \" + student.getBatch());\n System.out.println(\"student.getSection() = \" + student.getSection());\n System.out.println(\"student.getContact().getEmailAddress() = \" + student.getContact().getEmailAddress());\n System.out.println(\"student.getAddress().getState() = \" + student.getCompany().getAddress().getState());\n System.out.println(\"student.getAddress().getZipCode() = \" + student.getCompany().getAddress().getZipCode());\n\n System.out.println(\"student.getCompany().getCompanyName() = \" + student.getCompany().getCompanyName());\n\n String expFirstName = \"Vera\";\n int expBatch = 14;\n int expSection = 12;\n String expEmail = \"aaa@gmail.com\";\n String expCompanyName = \"Cybertek\";\n String expState = \"IL\";\n int expZipCode = 60606;\n\n assertThat(expFirstName, equalTo(student.getFirstName()));\n assertThat(expBatch, equalTo(student.getBatch()));\n assertThat(expSection, equalTo( student.getSection()));\n assertThat(expEmail, equalTo(student.getContact().getEmailAddress()));\n assertThat(expCompanyName, equalTo(student.getCompany().getCompanyName()));\n assertThat(expState, equalTo(student.getCompany().getAddress().getState()));\n assertThat(expZipCode, equalTo(student.getCompany().getAddress().getZipCode()));\n\n\n\n\n\n\n}",
"@Test\n public void VerifyContentTypeWithAssertThat(){\n given().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/employees/100\")\n .then().assertThat().statusCode(200)\n .and().contentType(ContentType.JSON);\n }",
"public void testGetRegion() {\r\n\t\tregionBuilder = getRegionTestBuilder();\r\n\t\ttry {\r\n\t\t\tRegion region = regionMgr.getRegion(RegionTestBuilder.REGION_ID_INDIA);\r\n\t\t\tassertTrue(\"Unable to get country list\", region.getName()\r\n\t\t\t\t\t.equalsIgnoreCase(\"India\"));\r\n\t\t} catch (Exception ex) {\r\n\t\t\tassertTrue(\"An excpetion has occured\", false);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic ResponseEntity<String> getSectionTypes(@RequestBody Map<String, String> request) throws Exception \n\t{\n\t\t// Print is for testing purposes\n\t\tSystem.out.println(\"controller (map/sectionType) reached\");\n\n\t\t// add any objects that need to be returned to the success list\n\t\tString response = \"\";\n\t\tList<Object> success = new ArrayList<Object>();\n\t\t\n\t\t\n\t\tsuccess.add(mapService.getSectionTypes());\n\t\tresponse = JsonResponseCreator.getJSONResponse(JsonResponseCreator.ResponseKey.SUCCESS, success);\n\n\t\treturn new ResponseEntity<String>(response, HttpStatus.OK);\n\t}",
"@Delegate\n @Path(\"/projects/{project}/regions/{region}\")\n AddressApi getAddressApi(@PathParam(\"project\") String projectName, @PathParam(\"region\") String region);",
"@Test\n public void culturesTest(){\n RestAssured.baseURI=\"https://api.got.show/api\";\n Response responce=RestAssured.get(\"/cultures/\");\n responce.prettyPrint();\n Assert.assertTrue(responce.asString().contains(\"Crannogmen\"));\n }",
"@Test\n public void testReceiverAgeEndpointGender() {\n ResponseEntity response = dataController.getReceiverDataAge(\"F\", null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverGenderEndpointReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(null, null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"private void getProvinces(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\t\n\t\tProvincesService provinces=new ProvincesServiceImpl();\n\t\t\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Provinces> select = provinces.select();\n\t\t\t\t\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\t\t\t\t\n\t}",
"@Test\n public void given_devEnvironmentAndListStudent_when_callEndpointFindAll_then_returnListStudentAndStatus200() throws Exception {\n\n when(studentRepo.findAll()).thenReturn(STUDENT_LIST);\n\n RequestBuilder request = MockMvcRequestBuilders\n .get(\"/students\")\n .accept(MediaType.APPLICATION_JSON);\n\n mockMvc.perform(request)\n .andExpect(status().isOk())\n .andExpect(content().json(gson.toJson(STUDENT_LIST),true))\n .andReturn();\n }",
"@Test\n public void genderTest() {\n Response response = given().accept(ContentType.JSON).\n queryParam(\"gender\", \"male\").\n when().get(\"/\");\n\n assertEquals(response.contentType(), \"application/json; charset=utf-8\");\n\n JsonPath json = response.jsonPath();\n String exp = \"male\";\n String act = json.getString(\"gender\");\n assertEquals(exp,act);\n }",
"@Test\n public void testTransplantListEndpointQueryGender() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,\"M\",null,null,upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverGenderEndpointAgeFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"private void defaultReservationShouldBeFound(String filter) throws Exception {\n restReservationMockMvc.perform(get(ReservationController.BASE_URL + \"?sort=id,desc&\" + filter))\n .andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))\n //.andExpect(jsonPath(\"$.data.content.[*].id\").value(hasItem(reservationSaved.getId().intValue())))\n .andExpect(jsonPath(\"$.data.content.[*].state\").value(hasItem(DEFAULT_STATE.toString())))\n .andExpect(jsonPath(\"$.data.content.[*].name\").value(hasItem(ReservationTest.NAME)))\n .andExpect(jsonPath(\"$.data.content.[*].lastName\").value(hasItem(ReservationTest.LAST_NAME)))\n .andExpect(jsonPath(\"$.data.content.[*].email\").value(hasItem(ReservationTest.EMAIL)))\n ;\n\n }",
"@Test\n public void test_getFacilities() throws Exception {\n ResponseEntity<FacilityResponse> response = restTemplate.getForEntity(\"/v1/facilities\", FacilityResponse.class);\n\n // assert\n Assertions.assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);\n Assertions.assertThat(Collections.singletonList(Objects.requireNonNull(response.getBody()).getFacilities()));\n Assertions.assertThat(response.getBody().getFacilities().get(0).getName()).isEqualTo(\"p1\");\n // response structure: //{\"facilities\":[{\"id\":101,\"name\":\"p1\",\"address\":\"testAddress\"}]}\n }",
"public HashMap<String, HashMap<String, ArrayList<HashMap<String, HashMap<String, String>>>>> getStatus(String region) throws IOException {\r\n String currentData;\r\n\r\n try {\r\n baseURL = StaticData.buildURL(region);\r\n currentData = getUrlData();\r\n networkOK = true;\r\n }\r\n catch(UnknownHostException e) {\r\n currentData = \"\";\r\n networkOK = false;\r\n throw e;\r\n }\r\n \r\n JsonElement jelem = new JsonParser().parse(currentData);\r\n JsonObject jobj = jelem.getAsJsonObject();\r\n JsonArray servicesArr = jobj.getAsJsonArray(\"services\");\r\n JsonArray incidentsArr;\r\n JsonArray updatesArr;\r\n \r\n String service, status;\r\n HashMap<String, HashMap<String, ArrayList<HashMap<String, HashMap<String, String>>>>> statusInfo = new HashMap();\r\n HashMap<String, ArrayList<HashMap<String, HashMap<String, String>>>> statusValues = new HashMap();\r\n ArrayList<HashMap<String, HashMap<String, String>>> services = new ArrayList();\r\n HashMap<String, HashMap<String, String>> incidents = new HashMap();\r\n HashMap<String, String> content = new HashMap();\r\n\r\n for(int i = 0; i < servicesArr.size(); i++) {\r\n jobj = servicesArr.get(i).getAsJsonObject();\r\n \r\n service = formatOutput(jobj.get(\"name\").toString());\r\n status = formatOutput(jobj.get(\"status\").toString()); \r\n\r\n incidentsArr = jobj.getAsJsonArray(\"incidents\");\r\n \r\n // If there are any incidents, store them.\r\n if(incidentsArr.size() > 0) {\r\n // Get each incident.\r\n for(int j = 0; j < incidentsArr.size(); j++) {\r\n jobj = incidentsArr.get(j).getAsJsonObject();\r\n updatesArr = jobj.getAsJsonArray(\"updates\");\r\n \r\n // Get information for each update.\r\n if(updatesArr.size() > 0) {\r\n for(int k = 0; k < updatesArr.size(); k++) {\r\n jobj = updatesArr.get(k).getAsJsonObject();\r\n\r\n // Add id\r\n content.put(\"id\", formatOutput(jobj.get(\"id\").toString()));\r\n // Add severity\r\n content.put(\"severity\", formatOutput(jobj.get(\"severity\").toString()));\r\n // Add updated_at\r\n content.put(\"updated_at\", formatOutput(jobj.get(\"updated_at\").toString()));\r\n // Add content\r\n content.put(\"content\", formatOutput(jobj.get(\"content\").toString()));\r\n \r\n incidents.put(service, (HashMap)content.clone());\r\n services.add((HashMap)incidents.clone());\r\n }\r\n }\r\n }\r\n }\r\n \r\n Collections.reverse(services); // Flip incidents ArrayList to have the newest first.\r\n statusValues.put(status, (ArrayList)services.clone());\r\n services.clear(); // Make sure old incidents aren't copied if current service has no incidents.\r\n statusInfo.put(service, (HashMap)statusValues.clone());\r\n statusValues.clear(); // Make sure old statuses aren't copied if current service has no incidents.\r\n }\r\n \r\n return statusInfo;\r\n }",
"@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = {\"/api/states/\", \"/api/states\"}, method = RequestMethod.GET)\n \tpublic HttpEntity<String> getStates() {\n \t\tList<AgentInfo> agents = agentManagerService.getAllVisibleAgentInfoFromDB();\n \t\treturn toJsonHttpEntity(getAgentStatus(agents));\n \t}",
"@Test\n\tpublic void testStatusCode() {\n\t\tgiven().\n\t\tget(Endpoint.GET_COUNTRY).then().statusCode(200);\n\t}",
"@Test\r\n\tpublic void testGetAllVendors() throws Exception {\r\n\t\t// when\r\n\t\tMockHttpServletResponse response = mvc.perform(\r\n\t\t\tget(\"/vendors\")\r\n\t\t\t\t.accept(MediaType.APPLICATION_JSON))\r\n\t\t\t.andReturn().getResponse();\r\n\r\n\t\t// then\r\n\t\tassertEquals(response.getStatus(), HttpStatus.OK.value());\r\n\r\n\t\tString content = response.getContentAsString();\r\n\t\tVendor[] vendors = gson.fromJson(content, Vendor[].class);\r\n\t\tassertTrue(vendors.length == 0);\r\n\r\n\t}",
"@Test\n\tpublic void testGetVehicleModels() throws UnirestException {\n\tHttpResponse<String> response = Unirest.get(\"http://localhost:8080/TrackingVehicle/api/service/vehicleModels\")\n\t\t\t .header(\"Cache-Control\", \"no-cache\")\n\t\t\t .header(\"Postman-Token\", \"5d15aea4-c5ba-4e67-b979-42bd52ae1ccf\")\n\t\t\t .asString();\n}",
"@Test\n public void testDonorGenderEndpointAgeFilterReturns() {\n ResponseEntity response = dataController.getDonorDataGender(null, null, \"20\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\r\n public void testListRegistrations1() throws Throwable {\r\n // Parameters for the API call\r\n Double limit = 10d;\r\n Double offset = 20d;\r\n Options8Enum options = null;\r\n\r\n // Set callback and perform API call\r\n List<ListRegistrationsResponse> result = null;\r\n controller.setHttpCallBack(httpResponse);\r\n try {\r\n result = controller.listRegistrations(limit, offset, options);\r\n } catch(APIException e) {};\r\n\r\n // Test whether the response is null\r\n assertNotNull(\"Response is null\", \r\n httpResponse.getResponse());\r\n // Test response code\r\n assertEquals(\"Status is not 200\", \r\n 200, httpResponse.getResponse().getStatusCode());\r\n\r\n // Test whether the captured response is as we expected\r\n assertNotNull(\"Result does not exist\", \r\n result);\r\n assertTrue(\"Response body does not match in keys\", TestHelper.isArrayOfJsonObjectsProperSubsetOf(\r\n \"[ { \\\"id\\\": \\\"abcdefg\\\", \\\"description\\\": \\\"Example Context Source\\\", \\\"dataProvided\\\": { \\\"entities\\\": [ { \\\"id\\\": \\\"Bcn_Welt\\\", \\\"type\\\": \\\"Room\\\" } ], \\\"attrs\\\": [ \\\"temperature\\\" ] }, \\\"provider\\\": { \\\"http\\\": { \\\"url\\\": \\\"http://contextsource.example.org\\\" }, \\\"supportedForwardingMode\\\": \\\"all\\\" }, \\\"expires\\\": \\\"2017-10-31T12:00:00\\\", \\\"status\\\": \\\"active\\\", \\\"forwardingInformation\\\": { \\\"timesSent\\\": 12, \\\"lastForwarding\\\": \\\"2017-10-06T16:00:00.00Z\\\", \\\"lastSuccess\\\": \\\"2017-10-06T16:00:00.00Z\\\", \\\"lastFailure\\\": \\\"2017-10-05T16:00:00.00Z\\\" } }]\", \r\n TestHelper.convertStreamToString(httpResponse.getResponse().getRawBody()), \r\n false, true, false));\r\n }",
"@RequestLine(\"GET /api/v1/localidades/estados\")\n\tList<EstadoJson> get();",
"private void loadSearchRegions() {\n showProgress(ApplicationConstants.DIALOG_HEADER, \"Please wait while we retrieve matching results.\");\n String authToken = ShPrefManager.with(getActivity()).getToken();\n RestClient.getAPI().getRegions(authToken, new RestCallback<RegionsResponse>() {\n @Override\n public void failure(RestError restError) {\n hideProgress();\n OpenHomeUtils.showToast(getActivity().getApplicationContext(), restError.getErrorMessage(), Toast.LENGTH_LONG);\n }\n\n @Override\n public void success(RegionsResponse regionsResponse, Response response) {\n hideProgress();\n if (regionsResponse.getMessage().size() > 0) {\n regionsList = regionsResponse.getMessage();\n for (RegionsResponse.Regions region : regionsList) {\n listingsCount += region.getListingsCount();\n if (region.getParentId() == 0)\n adapterList.add(region);\n }\n regionsAdapter = new RegionsAdapter(getActivity(), adapterList, 0);\n mRecyclerView.setAdapter(regionsAdapter);\n currentAdapter = \"R\";\n listingsCountDisplayTextView.setText(listingsCount + \" Listings\");\n currentDisplayingParentId = 0;\n\n } else {\n String message = \"No results to display. Please modify the search criteria and try again.\";\n CustomDialogFragment regSuccessDialogFragment = CustomDialogFragment.newInstance(R.string.try_again,\n message, ApplicationConstants.BUTTON_OK, 0);\n regSuccessDialogFragment.show(getActivity().getFragmentManager(), \"SearchRegionsFragment\");\n }\n }\n });\n }",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJSON() {\n throw new UnsupportedOperationException();\n }",
"@Test\n public void given_devEnvironmentWithParamOfStudent_when_callEndPointFilterStudent_then_returnStatus200AndStudentList() throws Exception {\n when(studentRepo.findAll(ArgumentMatchers.any(Specification.class)))\n .thenReturn(Collections.singletonList(STUDENT));\n\n RequestBuilder request = MockMvcRequestBuilders\n .get(\"/students/filter\")\n .accept(MediaType.APPLICATION_JSON)\n .param(\"name\", \"John\")\n .param(\"address\", \"US\");\n\n mockMvc.perform(request)\n .andExpect(status().isOk())\n .andExpect(content().json(gson.toJson(Collections.singletonList(STUDENT)),true))\n .andDo(MockMvcResultHandlers.print())\n .andReturn();\n }",
"@GET(\"/sight/list_by_region\")\n\t\tvoid getSightsByRegion(@Query(\"region\") String region, @Query(\"type\") String type, @Query(\"offset\") int start, @Query(\"limit\") int limit, Callback<List<Long>> callback);",
"List<RegionalClassifierEntity> getItsListOfRegions();",
"@GET\n @Produces(\"application/json\")\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }",
"@Test\n public void testDonorGenderEndpointReturns() {\n ResponseEntity response = dataController.getDonorDataGender(null, null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"public static boolean useJsonResponse(HttpServletRequest request) {\n String acceptHeaderValue = request.getHeader(\"Accept\");\n if (acceptHeaderValue == null) {\n return false;\n }\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.add(HttpHeaders.ACCEPT, acceptHeaderValue);\n List<MediaType> acceptedMediaTypes = httpHeaders.getAccept();\n boolean acceptsHtml = acceptedMediaTypes.contains(MediaType.TEXT_HTML);\n boolean acceptsJson = acceptedMediaTypes.contains(MediaType.APPLICATION_JSON);\n if (acceptsJson && (!acceptsHtml)) {\n return true;\n } else {\n return false;\n }\n }",
"@Test\n public void testGetAllRecipes() throws Exception {\n System.out.println(\"getAllRecipesREST\");\n given()\n .contentType(\"application/json\")\n .accept(ContentType.JSON)\n .when()\n .get(\"/recipes/all\")\n .then()\n .statusCode(200).assertThat().body(\"[0]\", equalTo(\"Slow cooker spicy chicken and bean soup\"));\n \n }",
"@Test\n public void testReceiverGenderEndpointBloodTypeFilterReturns() {\n ResponseEntity response = dataController.getReceiverDataGender(null, \"AB+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\r\n\tpublic void getAllIncidents() {\n\t\tRestAssured.baseURI = \"https://dev49243.service-now.com/api/now/table/incident\";\r\n\t\t\r\n\t\t// Step 2: Authentication (basic)\r\n\t\tRestAssured.authentication = RestAssured.basic(\"admin\", \"Tuna@123\");\r\n\t\t\r\n\t\t// Step 3: Request type - Get -> Response\r\n\t\tResponse response = RestAssured.get();\r\n\t\t\r\n\t\t// Step 4: Validate (Response -> Status Code : 200)\r\n\t\tSystem.out.println(response.getStatusCode());\r\n\t\t\r\n\t\t// Print the response time as well \r\n\t\t\r\n\t\t// Check what is the response format\r\n\t\tSystem.out.println(response.getContentType());\r\n\t\t\r\n\t\t// print the response\r\n\t\tresponse.prettyPrint();\r\n\t\t\r\n\t}",
"@Override\n\tpublic ClientResponse get() {\n\t\tWebResource webResource = this.webResource.path(\"/locations\");\n\t\treturn get(webResource);\n\t}",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n //TODO return proper representation object\n throw new UnsupportedOperationException();\n }",
"@Test\n public void testReceiverAgeEndpointBloodType() {\n ResponseEntity response = dataController.getReceiverDataAge(null, \"B+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void shouldGetParkingList() throws Exception {\n Mockito.when(restTemplate.getForObject(anyString(), any())).thenReturn(response);\n\n String expectedResponse = \"/expected_parkingList_response.json\";\n ClassPathResource expectedResultPath = new ClassPathResource(expectedResponse, this.getClass().getClassLoader());\n String expectedResult = StreamUtils.copyToString( expectedResultPath.getInputStream(), Charset.defaultCharset());\n\n String uri = \"/parkings\";\n\n mockMvc.perform(get(uri))\n /*.andDo(print())*/\n .andExpect(content().contentType(APPLICATION_JSON_VALUE))\n .andExpect(status().isOk())\n .andExpect(content().string(expectedResult));\n\n }",
"@Path(\"/providers/Microsoft.Compute/locations/{location}\")\n@RequestFilters({ OAuthFilter.class, ApiVersionFilter.class })\n@Consumes(APPLICATION_JSON)\npublic interface OSImageApi {\n\n /**\n * List Publishers in location\n */\n @Named(\"publisher:list\")\n @GET\n @Path(\"/publishers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Publisher> listPublishers();\n\n /**\n * List Offers in publisher\n */\n @Named(\"offer:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Offer> listOffers(@PathParam(\"publisher\") String publisher);\n\n /**\n * List SKUs in offer\n */\n @Named(\"sku:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<SKU> listSKUs(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer);\n\n /**\n * List Versions in SKU\n */\n @Named(\"version:list\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n List<Version> listVersions(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku);\n \n /**\n * Get the details of a Version\n */\n @Named(\"version:get\")\n @GET\n @Path(\"/publishers/{publisher}/artifacttypes/vmimage/offers/{offer}/skus/{sku}/versions/{version}\")\n @Fallback(EmptyListOnNotFoundOr404.class)\n Version getVersion(@PathParam(\"publisher\") String publisher, @PathParam(\"offer\") String offer,\n @PathParam(\"sku\") String sku, @PathParam(\"version\") String version);\n\n}",
"@GET\n @Path(\"{path : .+}\")\n @Produces(value = MediaType.APPLICATION_JSON)\n// @ApiOperation(value = \"Retrieve a image by id\",\n// produces = MediaType.APPLICATION_JSON)\n// @ApiResponses({\n// @ApiResponse(code = HttpStatus.NOT_FOUND_404,\n// message = \"The requested image could not be found\"),\n// @ApiResponse(code = HttpStatus.BAD_REQUEST_400,\n// message = \"The request is not valid. The response body will contain a code and \" +\n// \"details specifying the source of the error.\"),\n// @ApiResponse(code = HttpStatus.UNAUTHORIZED_401,\n// message = \"User is unauthorized to perform the desired operation\")\n// })\n\n public Response getMethod(\n @ApiParam(name = \"id\", value = \"id of page to retrieve image content\", required = true)\n @PathParam(\"path\") String getpath, @Context HttpServletRequest httpRequest, @Context UriInfo uriInfo) {\n String contentType = \"application/json\";\n String method = \"getMethod\";\n String httpMethodType = \"GET\";\n String resolvedResponseBodyFile = null;\n Response.ResponseBuilder myresponseFinalBuilderObject = null;\n\n try {\n\n\n\n String paramPathStg = getpath.replace(\"/\", \".\");\n\n //Step 1: Get responseGuidanceObject\n //TODO: handle JsonTransformationException exception.\n LocationGuidanceDTO responseGuidanceObject = resolveResponsePaths(httpMethodType, paramPathStg);\n\n //Step 2: Create queryparams hash and headers hash.\n Map<String, String> queryParamsMap = grabRestParams(uriInfo);\n Map<String, String> headerMap = getHeaderMap(httpRequest);\n\n\n //Step 3: TODO: Resolve header and params variables from Guidance JSON Body.\n resolvedResponseBodyFile = findExtractAndReplaceSubStg(responseGuidanceObject.getResponseBodyFile(), HEADER_REGEX, headerMap);\n resolvedResponseBodyFile = findExtractAndReplaceSubStg(resolvedResponseBodyFile, PARAMS_REGEX, headerMap);\n\n //Step 4: TODO: Validate responseBody, responseHeader, responseCode files existence and have rightJson structures.\n\n //Step 6: TODO: Grab responses body\n\n String responseJson = replaceHeadersAndParamsInJson(headerMap, queryParamsMap, resolvedResponseBodyFile);\n\n //Step 5: TODO: Decorate with response header\n String headerStg = \"{\\\"ContentType\\\": \\\"$contentType\\\"}\";\n\n //Step 7: TODO: Grab response code and related responsebuilderobject\n Response.ResponseBuilder myRespBuilder = returnRespBuilderObject(responseGuidanceObject.getResponseCode(), null).entity(responseJson);\n\n //Step 5: TODO: Decorate with response headers\n myresponseFinalBuilderObject = decorateWithResponseHeaders(myRespBuilder, responseGuidanceObject.getResponseHeaderFile());\n\n return myresponseFinalBuilderObject.build();\n } catch (IOException ex) {\n logger.error(\"api={}\", \"getContents\", ex);\n mapAndThrow(ex);\n }\n return myresponseFinalBuilderObject.build();\n }",
"@Test\n public void Scenario3() {\n\n int limit = 5;\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<String, Double> biomass = new HashMap<>();\n Map<String, Double> coal = new HashMap<>();\n Map<String, Double> imports = new HashMap<>();\n Map<String, Double> gas = new HashMap<>();\n Map<String, Double> nuclear = new HashMap<>();\n Map<String, Double> other = new HashMap<>();\n Map<String, Double> hydro = new HashMap<>();\n Map<String, Double> solar = new HashMap<>();\n Map<String, Double> wind = new HashMap<>();\n\n try {\n\n ListIterator iterator = regions.listIterator();\n int iter = 0;\n\n while (iterator.hasNext()) {\n\n biomass.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(0).getPerc()\n );\n coal.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(1).getPerc()\n );\n imports.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(2).getPerc()\n );\n gas.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(3).getPerc()\n );\n nuclear.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(4).getPerc()\n );\n other.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(5).getPerc()\n );\n hydro.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(6).getPerc()\n );\n solar.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(7).getPerc()\n );\n wind.put(regions.get(iter).getShortname(),\n regions.get(iter).getGenerationmix().get(8).getPerc()\n );\n\n iter++;\n iterator.next();\n\n }\n\n } catch (NullPointerException npe) {\n npe.printStackTrace();\n }\n\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(biomass), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(coal), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(imports), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(gas), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(nuclear), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(other), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(hydro), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(solar), limit));\n System.out.println(MapUtils.limitMapAndReturnList(MapUtils.sortByValueDescending(wind), limit));\n }",
"@Test\n\tpublic void givenVendors_whenGetVendors_thenReturnJsonArray()\n\t throws Exception {\n\t \n\t Vendor vendor1 = new Vendor(\"Rackspace\",\"Produts\",\"18/09/2011\",\"10/05/2013\",25,1000.00,\"Inactive\",\"Bangalore\");\n\t Vendor vendor2 = new Vendor(\"Infoglen\",\"Services\",\"18/09/2011\",\"10/05/2013\",25,1000.00,\"Inactive\",\"Bangalore\");\n\t \n\t ArrayList<Vendor> allVendors = new ArrayList<Vendor>();\n\t allVendors.add(vendor1);\n\t allVendors.add(vendor2);\n\t \n\t when(vendorService.findAll()).thenReturn((ArrayList<Vendor>) allVendors);\n\t \n\t mvc.perform(get(\"/vendor/getAllVendors\")\n\t .contentType(MediaType.APPLICATION_JSON))\n\t .andExpect(status().isOk())\n\t .andExpect(jsonPath(\"$\", hasSize(2)))\n\t .andExpect(jsonPath(\"$[1].name\", is(vendor2.getName())));\n\t \n}",
"@Test\n public void verifyFirstName(){\n given().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/employees/100\")\n .then().assertThat().statusCode(200)\n .and().contentType(ContentType.JSON)\n .and().assertThat().body(\"first_name\", Matchers.equalTo(\"Steven\"))\n .and().assertThat().body(\"employee_id\",Matchers.equalTo(\"100\"));\n\n }",
"@PUT\r\n\t@Path(\"{code}\")\r\n\t@RolesAllowed(\"user\")\r\n\t @Produces(\"application/json\")\r\n\t public String countryAdjust(InputStream is) {\r\n\t\t// data opvangen\r\n\t\tJsonObject object = Json.createReader(is).readObject();\r\n\t \r\n\t\t//uitlezen\r\n\t\tString code2 = object.getString(\"kort\");\r\n\t\tString code3 = object.getString(\"lang\");\r\n\t\tString land = object.getString(\"land\");\r\n\t\tString capital = object.getString(\"capital\");\r\n\t\tString continent = object.getString(\"continent\");\r\n\t\tString regio = object.getString(\"regio\");\r\n\t\tdouble oppervlakte = object.getInt(\"oppervlakte\");\r\n\t\tint populatie = object.getInt(\"populatie\");\r\n\t\tString regering = object.getString(\"regering\");\r\n\t\tdouble lat = object.getInt(\"latitude\");\r\n\t\tdouble lon = object.getInt(\"longitude\");\r\n\t\t\r\n\t\t\r\n\t\tJsonObjectBuilder job = Json.createObjectBuilder();\r\n\t\tString response = \"\";\r\n\t\t\r\n\t\ttry{\r\n\r\n\t\t\t//land-object maken\r\n\t\t\tCountry newCountry = new Country(code2, code3, land, capital, continent, regio, oppervlakte, populatie, regering, lat, lon);\r\n\r\n\t\t //Service aanroepen\r\n\t\t\tWorldService service = ServiceProvider.getWorldService();\r\n\t\t service.adjustCountry(newCountry); \r\n\t \r\n\t\t response = \"Server heeft land:\"+newCountry.getName()+\" gewijzigt\";\r\n\t\t job.add(\"response\", response );\t\r\n\t\t job.add(\"naam\",newCountry.getName());\r\n\t\t\t\r\n\t\t}catch(Error e){\t\r\n\t\t\t\r\n\t\t\tresponse = \"Fout met wijzigen: \" + e.toString();\r\n\t\t\tjob.add(\"response\", response );\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t \r\n\r\n\t return job.build().toString();\r\n\t }",
"@Test\n\tpublic void getRequestWithQueryParamter() {\n\t\tgiven()\n\t\t.queryParam(\"fullText\", \"true\")\n\t\t.when()\n\t\t.get(\"https://restcountries.eu/rest/v2/name/aruba\")\n\t\t.then()\n\t\t.assertThat()\n\t\t.contentType(ContentType.JSON)\n\t\t.and()\n\t\t.statusCode(HttpStatus.SC_OK)\n\t\t.log().all();\n\t}",
"public RegionManagementDetails getCompleteRegionDetails(String seasonId);",
"private void getCities(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\tCitiesServiceImpl cities = new CitiesServiceImpl();\n\t\t\n\t\t\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Cities> select = cities.selectAllId(\"2\");\n\t\t\n\t\t\n\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\n\t}",
"@Test\n public void testReceiverDonorEndpointNoFilters() {\n ResponseEntity response = dataController.getDonorDataRegion(null, null, null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void GETProduct_ProductInventoryCall() {\n\n givenHeaders().\n when().\n get(_url_product).//.body().prettyPrint();\n then().\n using().defaultParser(Parser.JSON).\n log().ifError().\n statusCode(200).\n body(\"response\", not(isEmptyString()));\n System.out.print(\"GETPRODUCT_Inventory Test Run Result\");\n }",
"@Test\n public void getBorrowers() throws Exception{\n String payload=\"[\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 121,\\n\" +\n \" \\\"name\\\": \\\"David\\\",\\n\" +\n \" \\\"address\\\": \\\"Giessen\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 161,\\n\" +\n \" \\\"name\\\": \\\"Ingo\\\",\\n\" +\n \" \\\"address\\\": \\\"Giessen\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 61,\\n\" +\n \" \\\"name\\\": \\\"Jannik\\\",\\n\" +\n \" \\\"address\\\": \\\"Darmstadt\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 101,\\n\" +\n \" \\\"name\\\": \\\"Julian\\\",\\n\" +\n \" \\\"address\\\": \\\"Giessen\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 123,\\n\" +\n \" \\\"name\\\": \\\"Karl\\\",\\n\" +\n \" \\\"address\\\": \\\"Freiburg\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 122,\\n\" +\n \" \\\"name\\\": \\\"Manfred\\\",\\n\" +\n \" \\\"address\\\": \\\"Marburg\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 64,\\n\" +\n \" \\\"name\\\": \\\"Mohamed\\\",\\n\" +\n \" \\\"address\\\": \\\"Darmstadt\\\"\\n\" +\n \" }\\n\" +\n \"]\";\n mockMvc.perform(MockMvcRequestBuilders.get(\"/getBorrowers\").content(payload)\n .contentType(MediaType.APPLICATION_JSON))\n .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$\",Matchers.hasSize(7))).andReturn();\n\n\n }",
"@Test\n public void testResponseGivenAStartDate() throws HTTPException, HttpClientErrorException, HttpServerErrorException,ParseException {\n String dateValue = \"2021-10-04\";\n String startDateParamExtension = \"&start_date=\" + dateValue;\n response = restTemplate.getForObject(templateUrl + apiKey + startDateParamExtension, String.class);\n JSONParser parser = new JSONParser();\n JSONArray object = (JSONArray) parser.parse(response);\n Assert.assertEquals(\"Response should return \" + 2 + \"images information\", 2, object.size());\n }",
"@Test\n\tpublic void listAllConfigVendas() throws JsonParseException, JsonMappingException, IOException {\n\n\t\tInteger count = 0;\n\t\tInteger id = 10000;\n\t\tRestTemplate restTemplate = new RestTemplate();\n\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.set(\"Header\", \"value\");\n\t\theaders.setContentType(MediaType.APPLICATION_JSON);\n\t\theaders.set(\"Other-Header\", \"othervalue\");\n\t\theaders.set(\"username\", \"taz@qat.com\");\n\n\t\tMap<String, String> params = new HashMap<String, String>();\n\t\tparams.put(\"username\", \"taz@qat.com\");\n\t\tparams.put(\"password\", \"taz@qat.com\");\n\n\t\tRestTemplate rest = new RestTemplate();\n\t\trest.setMessageConverters(Arrays.asList(new StringHttpMessageConverter(), new FormHttpMessageConverter()));\n\t\tMultiValueMap<String, String> paramss = new LinkedMultiValueMap<String, String>();\n\t\tparamss.set(\"username\", \"taz@qat.com\");\n\t\tparamss.set(\"password\", \"devil\");\n\t\tURI tgtUrl = rest.postForLocation(REST_SERVICE_URI + \"auth/api/authenticate\", paramss, Collections.emptyMap());\n\t\tSystem.out.println(\"[\" + tgtUrl + \"]\");\n\n\t\tSystem.out.println(\"[\" + tgtUrl + \"]\");\n\n\t\tResponseEntity<String> st = rest.postForEntity(REST_SERVICE_URI + \"auth/api/authenticate\", paramss,\n\t\t\t\tString.class);\n\t\tSystem.out.println(\"[\" + st.getBody() + \"]\");\n\t\tSystem.out.println(\"[\" + st + \"]\");\n\t\tString tk = st.getBody();\n\t\tClass<? extends String> mt = tk.getClass();\n\t\tSystem.out.println(\"[\" + mt + \"]\");\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tModelToken obj = mapper.readValue(st.getBody(), ModelToken.class);\n\n\t\tSystem.out.println(\"[\" + obj.getToken() + \"]\");\n\n\t\theaders = new HttpHeaders();\n\t\theaders.set(\"Header\", \"value\");\n\t\theaders.setContentType(MediaType.APPLICATION_JSON);\n\t\theaders.set(\"Other-Header\", \"othervalue\");\n\t\theaders.set(\"X-Auth-Token\", obj.getToken());\n\t\tString a = \"request:{pageSize: 20, startPage: 2, sortExpressions: null, preQueryCount: true, maxPreQueryCount: 0}, token:taz@qat.com:1469815365580:33f9281620d9dc7df079e056ad235420, url:configuracao/api/cfop/fetchPage/\";\n\t\tHttpEntity<String> entity = new HttpEntity<String>(\"{}\", headers);\n\n\t\t// =========== fetch\n\t\t// ================================================================\n\t\tSystem.out.println(\"==================================FetchALL==============================================\");\n\t\tString jsonInString = mapper.writeValueAsString(new PagedInquiryRequest());\n\t\tSystem.out.println(jsonInString);\n\t\tHttpEntity<String> entitys = new HttpEntity<String>(jsonInString, headers);\n\t\tConfigVendasResponse result = restTemplate.postForObject(\n\t\t\t\tREST_SERVICE_URI + \"configuracao/api/configVendas/fetchPage/\", entitys, ConfigVendasResponse.class);\n\t\tAssert.assertEquals(result.isOperationSuccess(), true);\n\t\tcount = result.getConfigVendasList().size();\n\n\t\t// =========== Insert\n\t\t// ================================================================\n\t\tSystem.out.println(\"==================================INSERT==============================================\");\n\t\tjsonInString = mapper.writeValueAsString(\n\t\t\t\tObjects.insertConfigVendas(id, TabelaEnum.CONFIGVENDAS, PersistenceActionEnum.INSERT));\n\t\tSystem.out.println(jsonInString);\n\t\tString requestJson = \"{\\\"configVendas\\\":\" + jsonInString + \"}\";\n\t\tentitys = new HttpEntity<String>(requestJson, headers);\n\t\tresult = restTemplate.postForObject(REST_SERVICE_URI + \"configuracao/api/configVendas/insert/\", entitys,\n\t\t\t\tConfigVendasResponse.class);\n\t\tAssert.assertEquals(result.isOperationSuccess(), true);\n\n\t\t// =========== Update\n\t\t// ================================================================\n\t\tSystem.out.println(\"==================================UPDATE==============================================\");\n\n\t\tjsonInString = mapper.writeValueAsString(\n\t\t\t\tObjects.insertConfigVendas(id, TabelaEnum.CONFIGVENDAS, PersistenceActionEnum.UPDATE));\n\t\trequestJson = \"{\\\"configVendas\\\":\" + jsonInString + \"}\";\n\t\tentitys = new HttpEntity<String>(requestJson, headers);\n\t\tresult = restTemplate.postForObject(REST_SERVICE_URI + \"configuracao/api/configVendas/update/\", entitys,\n\t\t\t\tConfigVendasResponse.class);\n\t\tAssert.assertEquals(result.isOperationSuccess(), true);\n\n\t\t// =========== FetchbyID\n\t\t// ================================================================\n\t\tSystem.out.println(\"==================================FetchID==============================================\");\n\n\t\tPagedInquiryRequest request001 = new PagedInquiryRequest();\n\t\trequest001.setId(id);\n\t\tjsonInString = mapper.writeValueAsString(request001);\n\t\tSystem.out.println(jsonInString);\n\t\tentitys = new HttpEntity<String>(jsonInString, headers);\n\t\tresult = restTemplate.postForObject(REST_SERVICE_URI + \"configuracao/api/configVendas/fetchPage/\", entitys,\n\t\t\t\tConfigVendasResponse.class);\n\t\tAssert.assertEquals(result.isOperationSuccess(), true);\n\t\tAssert.assertEquals(result.getConfigVendasList().size(), 15);\n\n\t\t//\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getDescontoMaxVenda(),(10.00);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getObservacao(),\"\"observacao_2\"\n\t\t// - UPDATE\");\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getImprSegVia(),(1003);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getImprAssinatura(),(1004);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getImprResumoFinanc(),(1005);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getAtuaPrecoClonar(),(1006);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getImprColUnidade(),(1007);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getBloquearvendProdSemEstoq(),(1008);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getAddDespCalcImposto(),(1009);\n\t\t// Assert.assertEquals(result.getConfigVendasList().get(0).getRetSubstTribICMS(),(1010);\n\n\t\t// =======================\n\t\tSystem.out.println(\"==================================DELETE==============================================\");\n\t\tjsonInString = mapper.writeValueAsString(\n\t\t\t\tObjects.insertConfigVendas(id, TabelaEnum.CONFIGVENDAS, PersistenceActionEnum.DELETE));\n\t\trequestJson = \"{\\\"configVendas\\\":\" + jsonInString + \"}\";\n\t\tentitys = new HttpEntity<String>(requestJson, headers);\n\t\tresult = restTemplate.postForObject(REST_SERVICE_URI + \"configuracao/api/configVendas/delete/\", entitys,\n\t\t\t\tConfigVendasResponse.class);\n\t\tAssert.assertEquals(result.isOperationSuccess(), true);\n\t\t// Assert.assertEquals(result.getConfigVendasList().size(),\n\t\t// count.intValue());\n\n\t}",
"@PostMapping(value = \"/search\",produces = MediaType.APPLICATION_JSON_VALUE,consumes = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<String> getAvailabilityAndPrice(JSONObject reqJson) throws Exception{\n\t\t\treturn new ResponseEntity<String>(RailSearchProcessor.process(reqJson), HttpStatus.OK);\n }",
"@Test\n public void testDonorGenderEndpointBloodTypeFilterReturns() {\n ResponseEntity response = dataController.getDonorDataGender(null, \"AB+\", null);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Path(JaxRsActivator.OVERVIEW_ENDPOINT_PATH)\npublic interface ApiOverviewRestEndpoint {\n /**\n * A {@code String} constant representing json v1 \"{@value #MEDIA_TYPE_JSON_V1}\" media type .\n */\n String MEDIA_TYPE_JSON_V1 = \"application/vnd.overview-v1+json\";\n /**\n * A {@link MediaType} constant representing json v1 \"{@value #MEDIA_TYPE_JSON_V1}\" media type.\n */\n MediaType MEDIA_TYPE_JSON_V1_TYPE = new MediaType(\"application\", \"vnd.overview-v1+json\");\n\n /**\n * <pre>\n * http://127.0.0.1:8180/auth-microservice/auth-api/overview/endpoints\n * curl -v -H \"Accept: application/vnd.overview-v1+json\" -H \"Content-Type: application/vnd.overview-v1+json\" -H \"X-BOMC-REQUEST-ID: SET-BY-CURL-123\" -H \"X-BOMC-AUTHORIZATION: BOMC_USER\" -X GET \"127.0.0.1:8180/auth-microservice/auth-api/overview/endpoints\"\n * </pre>\n * @return JSON response for all available endpoints.\n * @description List all available endpoints. responseType javax.json.JsonObject\n * @responseMessage 200 A Response object that wraps the javax.json.JsonObject.\n * @responseMessage 400 Invalid Request.\n * @responseMessage 401 Unauthorized. API key does not need access privileges.\n * @responseMessage 404 Endpoint not found.\n */\n @GET\n @Path(\"/endpoints\")\n @Produces(ApiOverviewRestEndpoint.MEDIA_TYPE_JSON_V1)\n @Cache\n Response getAvailableEndpoints(@Context final Dispatcher dispatcher);\n}",
"@Test\n void getAllProfessors() throws Exception{\n MvcResult result = mvc.perform(get(\"/api/v1/professors\")).andExpect(status().isOk()).andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)).andReturn();\n System.out.println(result.getResponse().getContentAsString());\n\n }",
"@Test\n public void Task3() {\n given()\n .when()\n .get(\"https://jsonplaceholder.typicode.com/todos/2\")\n .then()\n .statusCode(200)\n .contentType(ContentType.JSON)\n .body(\"title\",equalTo(\"quis ut nam facilis et officia qui\"))\n ;\n }",
"@RequestMapping(value={\"/search.json\"}, method={RequestMethod.GET})\n \tpublic void handleSearchJson(@RequestParam String q,@RequestParam String t, HttpServletResponse response){\n \t\tresponse.setCharacterEncoding(\"UTF-8\");\n \t\tresponse.setContentType(JSON_CONTENT_TYPE);\n \t\t\n \t\tList<NameConceptModelIF> nameConceptModelList = null;\n \t\tif(\"taxon\".equalsIgnoreCase(t)){\n \t\t\tnameConceptModelList = searchService.searchTaxon(q);\n \t\t}\n \t\telse if(\"vernacular\".equalsIgnoreCase(t)){\n \t\t\tnameConceptModelList = searchService.searchVernacularName(q);\n \t\t}\n \t\t\n \t\tJSONArray responseJson = new JSONArray();\n \t\tfor(NameConceptModelIF currNameConcept : nameConceptModelList){\n \t\t\tresponseJson.put(currNameConcept.getName());\n \t\t}\n \t\ttry {\n \t\t\tresponse.getWriter().print(responseJson.toString());\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}",
"@Path(\"/\")\n @GET\n @Produces(MediaType.APPLICATION_JSON) // indique que la réponse est en json\n public Response test(@Context final UriInfo ui) {\n\n return Response.ok(true).build();\n }",
"@Test\n void simpleBddTest(){\n given()\n .baseUri(\"https://reqres.in/api\")\n .basePath(\"/users?page=2\")\n\n //когда система\n .when().get()\n\n .then().statusCode(200)\n .and().header(\"Content-Type\", \"application/json; charset=utf-8\");\n }"
] | [
"0.6881676",
"0.67245525",
"0.66411805",
"0.65456593",
"0.6515611",
"0.64879423",
"0.6412478",
"0.6370019",
"0.6352284",
"0.62693805",
"0.62561697",
"0.62536687",
"0.6169194",
"0.6153366",
"0.6132877",
"0.6112532",
"0.6104148",
"0.5995965",
"0.5975977",
"0.5945483",
"0.59165156",
"0.58869356",
"0.58743244",
"0.5756118",
"0.57560813",
"0.5742895",
"0.5737007",
"0.5714328",
"0.565627",
"0.5654772",
"0.5653127",
"0.56435376",
"0.5639769",
"0.56267166",
"0.5602594",
"0.55736405",
"0.5541043",
"0.553392",
"0.54911274",
"0.5481856",
"0.54680866",
"0.54570276",
"0.5453125",
"0.5450664",
"0.54062027",
"0.540406",
"0.5398737",
"0.5390582",
"0.53782785",
"0.5367749",
"0.5359145",
"0.53555614",
"0.5327716",
"0.5306312",
"0.5294412",
"0.5281095",
"0.52782214",
"0.526447",
"0.5262249",
"0.52464396",
"0.5236104",
"0.5235803",
"0.52258635",
"0.5222171",
"0.520974",
"0.5207147",
"0.51987463",
"0.51972145",
"0.5189476",
"0.51847863",
"0.51835865",
"0.51769304",
"0.517495",
"0.51580524",
"0.51580524",
"0.51580524",
"0.515324",
"0.51516056",
"0.51515657",
"0.5148385",
"0.514463",
"0.5127914",
"0.5121413",
"0.51168483",
"0.5116614",
"0.511446",
"0.5114036",
"0.5107102",
"0.5106178",
"0.50904316",
"0.50897324",
"0.50777",
"0.5072899",
"0.5072019",
"0.5061432",
"0.5060832",
"0.5059486",
"0.5045387",
"0.5044444",
"0.50285405"
] | 0.74695593 | 0 |
/ Given Accept type is JSON When I send a GET request to employees Then status code is 200 And Response content should be json And 100 employees data should be in json response body | @Test
public void testWithQueryParametersAndList() {
given().accept(ContentType.JSON)
.and().params("limit",100)
.when().get(ConfigurationReader.getProperty("hrapp.baseurl")+"/employees")
.then().assertThat().statusCode(200)
.and().contentType(ContentType.JSON)
.and().assertThat().body("items.employee_id", hasSize(100));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@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 }",
"@Test\r\n\tpublic void test_getAllEmployees() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t// .pathParam(\"page\", \"0\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(0))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}",
"@GetMapping(\"/all\")\n public ResponseEntity responseAllEmployees(){\n return new ResponseEntity<>(hr_service.getAllEmployees(), HttpStatus.OK);\n }",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAll() {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findAll()) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getAllEmployees(){\n\t\tString employeesJsonString = getFileContent();\n\t\treturn employeesJsonString;\n\t}",
"@GetMapping(\"/get_all_employees\")\n public String getAllEmployees(){\n\n Gson gsonBuilder = new GsonBuilder().create();\n List<Employee> initial_employee_list = employeeService.get_all_employees();\n String jsonFromJavaArray = gsonBuilder.toJson(initial_employee_list);\n\n return jsonFromJavaArray;\n }",
"@RequestMapping(\"/get\")\n public ResponseEntity<ResponseDTO> getEmployeePayrollData() {\n List<EmployeePayrollData> empDataList ;\n empDataList = employeePayrollService.getEmployeePayrollData();\n ResponseDTO responseDTO = new ResponseDTO(\"Get Call Success\", empDataList);\n log.info(\"get all data\");\n return new ResponseEntity<>(responseDTO, HttpStatus.OK);\n\n }",
"@Test\r\n\tpublic void test_getEmployeeById() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"id\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employee\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200);\r\n\t}",
"public ResponseEntity<List<Employee>> getAllEmployees() {\n \tList<Employee> emplist=empService.getAllEmployees();\n\t\t\n\t\tif(emplist==null) {\n\t\t\tthrow new ResourceNotFoundException(\"No Employee Details found\");\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<>(emplist,HttpStatus.OK);\t\t\n }",
"@Test \n\tpublic void testJsonPathWithLists() {\n\t\n\t\tMap<String,Integer> requestParamMaps=new HashMap<>();\n\t\t requestParamMaps.put(\"limit\", 100);\n\t\t\n\t\t\tResponse response = given().accept(ContentType.JSON).and().params(requestParamMaps)\n\t\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/\");\n\t\t\t\n\t\t\tassertEquals(response.statusCode(), 200);\n\t\t\t\n\t\t\tJsonPath json = response.jsonPath();\n\t\t\t//get all employee ids into arratlist\n\t\t\tList<Integer> empIDs = json.getList(\"items.employee_id\");\n\t\t\tSystem.out.println(empIDs);\n\t\t\t//assert that there are 100 emp ids\n\t\t\tassertEquals(empIDs.size(), 100);\n\t\t\t\n\t\t\t//get all emails and assign in list \n\t\t\tList<String> emails = json.getList(\"items.email\");\n\t\t\t\n\t\t\tassertEquals(emails.size(), 100);\n\t\t\t\n\t\t\t//get all employee ids that are greater than 150\n\t\t\tList<Integer> empIdList = json.getList(\"items.findAll{it.employee_id > 150}.employee_id\");\n\t\t\tSystem.out.println(empIdList);\n\t\t\t\n\t\t\t//get all employee lastnames, whose salary is more than 7000\n\t\t\t\n\t\t\tList<String> lastNames = json.getList(\"items.findAll{it.salary > 7000}.last_name\");\n\t\t\tSystem.out.println(lastNames);\n\t}",
"@Test\n //1. adim URL i olusturmak\n public void get01(){\n spec03.pathParam(\"employeePath\",\"employees\");\n\n // 2. adim test datalarini olusturmak\n\n // 3. adim Request olusturma\n Response response = given().\n spec(spec03).\n when().\n get(\"/{employeePath}\");\n // response.prettyPrint();\n // 1. yol EqualTo-- Body ile assert ediyoruz\n response.\n then().\n assertThat().\n statusCode(200).\n body(\"data.employee_name[4]\",equalTo(\"Airi Satou\"),\n \"data[5].employee_salary\",equalTo(\"372000\"),\n \"data.id\",hasSize(24),\n \"data.employee_name\",hasItem(\"Rhona Davidson\"),\n \"data.employee_age\",hasItems(\"21\", \"23\", \"61\"));\n\n // 2. yol Hard Assertion\n // JsonPath ile\n JsonPath json = response.jsonPath();\n Assert.assertEquals(\"Airi Satou\",json.getString(\"data.employee_name[4]\"));\n Assert.assertEquals(\"372000\",json.getString(\"data[5].employee_salary\"));\n // System.out.println(json.getList(\"data.id\"));\n Assert.assertEquals(24,json.getList(\"data.id\").size());\n // System.out.println(json.getList(\"data.employee_name\"));\n Assert.assertTrue(json.getList(\"data.employee_name\").contains(\"Rhona Davidson\"));\n\n List<String> yasListesi = new ArrayList<>();\n yasListesi.add(\"21\");\n yasListesi.add(\"23\");\n yasListesi.add(\"61\");\n Assert.assertTrue(json.getList(\"data.employee_age\").containsAll(yasListesi));\n\n\n\n }",
"@GetMapping(\"/getEmployees\")\n\t@ResponseBody\n\tpublic List<Employee> getAllEmployees(){\n\t\treturn employeeService.getEmployees();\n\t}",
"@Test\n public void testJsonPathWithLists(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\");\n\n Assert.assertEquals(response.statusCode(),200); //to check status code\n\n //First way to use JsonPath\n JsonPath json = response.jsonPath();\n\n //Second way\n //JsonPath json = new JsonPath(response.asString());\n\n //Third way\n //JsonPath json = new JsonPath(new File(FilePath.json));\n\n //get all employee ids into ArrayList\n List<Integer> empIds = json.getList(\"items.employee_id\");\n System.out.println(empIds);\n //assert that there are 100 employee ids\n Assert.assertEquals(empIds.size(), 100);\n\n //get all employee emails and assign into ArrayList\n List<String> empEmails = json.getList(\"items.email\");\n System.out.println(empEmails);\n Assert.assertEquals(empEmails.size(), 100);\n\n //get all employee ids that are greater than 150\n List<Integer> empIdsMoreThan150 = json.getList(\"items.findAll{it.employee_id>150}.employee_id\");\n System.out.println(empIdsMoreThan150);\n\n //get all employees last name whose salary > 15000\n List<String> empSalaryMoreThan7000 = json.getList(\"items.findAll{it.salary>15000}.last_name\");\n System.out.println(empSalaryMoreThan7000);\n\n //get data from saved JSON file\n JsonPath jsonFromFile = new JsonPath(new File(\"/Users/asselkassymbekova/Desktop/employees.json\"));\n List<String> empEmails1 = jsonFromFile.getList(\"items.email\");\n System.out.println(empEmails1);\n\n }",
"@Test //make sure it comes from testNG\n public void testWithQueryParameterAndList(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"items.employee_id\", hasSize(100));\n }",
"@RequestMapping(value = \"/getAllEmployees\", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })\r\n\tpublic List<Employee> getAllEmpoyees(){\r\n\t\treturn repository.getAllEmpoyees();\r\n\t}",
"@RequestMapping(value = \"/employeesList\", method = RequestMethod.GET, produces = {\"application/xml\", \"application/json\" })\n\t@ResponseStatus(HttpStatus.OK)\n\tpublic @ResponseBody\n\tEmployeeListVO getListOfAllEmployees() {\n\t\tlog.info(\"ENTERING METHOD :: getListOfAllEmployees\");\n\t\t\n\t\tList<EmployeeVO> employeeVOs = employeeService.getListOfAllEmployees();\n\t\tEmployeeListVO employeeListVO = null;\n\t\tStatusVO statusVO = new StatusVO();\n\t\t\n\t\tif(employeeVOs.size()!=0){\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_0);\n\t\t\tstatusVO.setMessage(AccountantConstants.SUCCESS);\n\t\t}else{\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_1);\n\t\t\tstatusVO.setMessage(AccountantConstants.NO_RECORDS_FOUND);\n\t\t}\n\t\t\n\t\temployeeListVO = new EmployeeListVO(employeeVOs, statusVO);\n\t\t\n\t\tlog.info(\"EXITING METHOD :: getListOfAllEmployees\");\n\t\treturn employeeListVO;\n\t}",
"@GET\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGetbyId(@PathParam(\"id\") String id) {\n Gson gson = GSONFactory.getInstance();\n Employee employee = getEmployeeById(id);\n\n if (employee == null) {\n Response response = Response.status(404).build();\n return response;\n } else {\n String jsonOutput = gson.toJson(employee);\n Response response = Response.ok().entity(jsonOutput).build();\n return response;\n }\n }",
"@Test\r\n\tpublic void test_getAllEmployeesPage2() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(2))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}",
"@Test\n\tpublic void testWithJsonPath() {\n\t\t\t\t\n\t\tResponse response = given().accept(ContentType.JSON)\n\t\t.and().pathParam(\"id\", 110)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/{id}\");\n\t\t\n\t\tJsonPath json = response.jsonPath(); //get json body and assign to jsonPath object\n\t\t//we are assiging whole response to json object so we can easyly reach and use it \n\t\t\n\t\tSystem.out.println(json.getInt(\"employee_id\"));\n\t\tSystem.out.println(json.getString(\"first_name\"));\n\t\tSystem.out.println(json.getString(\"job_id\"));\n\t\tSystem.out.println(json.getInt(\"salary\"));\n\t\tSystem.out.println(json.getString(\"links[0].href\")); //get specific element from array \n\t \n\t\t//assign all hrefs into a list of strings \n\t\tList<String> hrefs = json.getList(\"links.href\");\n\t\t\n\t\t//everything in arraylist \n\t System.out.println(hrefs);\n\t \n\t //one by one \n\t\tfor(String href:hrefs) {\n\t\t\tSystem.out.println(href);\n\t\t}\n\t}",
"@GetMapping(\"/all\")\n\tpublic ResponseEntity<List<Employee>> getAllEmployees() {\n\t\tList<Employee> list = service.getAllEmployees();\n\t\treturn new ResponseEntity<List<Employee>>(list, HttpStatus.OK);\n\t}",
"@GET\n @Path(\"/getEmployeeById/{empId}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeById(@PathParam(\"empId\") String empId){\n String output = \"\";\n try {\n Employee employee = new Employee();\n employee = EmployeeFacade.getInstance().getEmployeeById(empId);\n output = gson.toJson(employee);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@GET\n\t@Path(\"{empID}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getById(@PathParam(\"empID\") int id) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findById(id)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@RequestMapping(value=\"/employees/all\", method = RequestMethod.GET)\npublic @ResponseBody List<Employee> employeeListRest(){\n\treturn (List<Employee>) employeerepository.findAll();\n}",
"@Test\n public void testWithJsonPath(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n //we are getting the response and assigning it to this variable\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .and().pathParams(\"employee_id\", 177) //path param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\");\n\n //here we are saying get json body and assign it yo jsonpath object\n JsonPath json = response.jsonPath();\n\n System.out.println(json.getInt(\"employee_id\"));\n System.out.println(json.getString(\"last_name\"));\n System.out.println(json.getString(\"job_id\"));\n System.out.println(json.getInt(\"salary\"));\n //we put index to links, because links is an array, but href is just a value of the array\n System.out.println(json.getString(\"links[0].href\")); //to get only the first link\n //we use upper statement to get specific element from array\n\n //assign all href into a List of strings\n List<String> hrefs = json.getList(\"links.href\");\n System.out.println(hrefs);\n }",
"@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }",
"@Override\n\tpublic ResponseEntity<Collection<Employee>> findAll() {\n\t\treturn new ResponseEntity<Collection<Employee>>(empService.findAll(),HttpStatus.OK);\n\t}",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> getEmployees(){\r\n\t\t\r\n\t\treturn employeeService.getEmployees();\r\n\t\t\r\n\t}",
"@RequestMapping(value = GET_ALL_EMPLOYEE_URL_API, method=RequestMethod.GET)\r\n public ResponseEntity<?> getAllEmployee() {\r\n\r\n checkLogin();\r\n\r\n return new ResponseEntity<>(employeeService.getAll(), HttpStatus.OK);\r\n }",
"@RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();",
"private String getEmployees() {\n\n String uri = new String(\"http://\" + mRESTServer.getHost() +\n mRESTServer.getContextPath());\n try {\n String result = restTemplate.getForObject(uri, String.class);\n\n System.out.println(result);\n return result+\": (\"+uri+\")\";\n\n } catch (HttpClientErrorException e) {\n /**\n *\n * If we get a HTTP Exception display the error message\n */\n log.error(\"error: \" + e.getResponseBodyAsString());\n\n ObjectMapper mapper = new ObjectMapper();\n ErrorHolder eh = null;\n try {\n eh = mapper.readValue(e.getResponseBodyAsString(), ErrorHolder.class);\n } catch (IOException ignored) {\n }\n\n log.error(\"error: \" + eh.getErrorMessage());\n\n } catch (Exception e) {\n log.error(\"error: \" + e.getMessage());\n\n }\n\n return null;\n }",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getEmployee( @NotNull(message = \"Employee ID cannnot be null\")\n @QueryParam(\"empId\") String empId) {\n return null;\n }",
"@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}",
"@GetMapping(\"/getoffer/{empId}\")\n\t public ResponseEntity<List<Offer>> getAllOffers(@PathVariable int empId)\n\t {\n\t\t List<Offer> fetchedOffers=employeeService.getAllOffers(empId);\n\t\t if(fetchedOffers.isEmpty())\n\t\t {\n\t\t\t throw new InvalidEmployeeException(\"No Employee found with id= : \" + empId);\n\t\t }\n\t\t else\n\t\t {\n\t\t\t return new ResponseEntity<List<Offer>>(fetchedOffers,HttpStatus.OK);\n\t\t }\n\t }",
"@Test\n\tpublic void get01() {\n\t\tResponse response = given().\n\t\t\t\t spec(spec02).\n\t\t\t\t when().\n\t\t\t\t get();\n\t\tresponse.prettyPrint();\n\t\t\n\t\tresponse.\n\t\t then().\n\t\t assertThat()\n\t\t .statusCode(200);\n\t\t\n\t\tJsonPath json = response.jsonPath();\n\t\tSoftAssert softAssert = new SoftAssert();\n\t\t\n\t//10 dan buyuk tum id leri console a yazdir.\n\t\tList<String> idList = json.getList(\"data.findAll{Integer.valueOf(it.id)>10}.id\");\n\t\tSystem.out.println(idList);\n\t\t\n\t//verify\n\t\tsoftAssert.assertEquals(idList.size(), 14, \"Eleman sayisi istenen gibi degil\");\n\t\t\n\t\n\t//30 dan kucuk tum yaslari console a yazdir\n\t\tList<String> ageList = json.getList(\"data.findAll{Integer.valueOf(it.employee_age)<30}.employee_age\");\n\t\tSystem.out.println(ageList);\n\t\t\n\t\t\n\t// Assert that maximum age is 23\n\t\tCollections.sort(ageList);\n\t\tsoftAssert.assertTrue(ageList.get(ageList.size()-1).equals(\"23\"), \"Yas istenen gibi degil\");\n\t\t\n\t\t\n\t//Print all employee names whose salaries are greater than 350000\n\t\tList<String> nameList = json.getList(\"data.findAll{Integer.valueOf(it.employee_salary)>350000}.employee_name\");\n\t\tSystem.out.println(nameList);\n\t\t\n\t\t\n\t//Assert that Charde Marshall is one of the employees whose salary is greater than 350000\t\n\t\tsoftAssert.assertTrue(nameList.contains(\"Charde Marshall\"));\n\t\t\n\t\t\n\t\t\n\t\tsoftAssert.assertAll();\n\t}",
"@GET\n @Path(\"/getEmployeeByName/{empName}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeByName(@PathParam(\"empName\") String empName){\n String output = \"\";\n try {\n Map<String, Employee> employeeMap = new HashMap<String, Employee>();\n employeeMap = EmployeeFacade.getInstance().getEmployeeByName(empName);\n output = gson.toJson(employeeMap);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@Test\r\n\tpublic void test_getAllEmployeesPage_notfound() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"6\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(404);\r\n\t}",
"@ApiOperation(value = \"getEmployeeByPagination controller method\")\r\n\t@GetMapping(\"/getEmployeeByPagination/{maxPage}/{ofset}\")\r\n\tpublic ResponseEntity<List<Employee>> getAllEmployeesByPagination(@PathVariable String maxPage,@PathVariable String ofset)\r\n\t{\r\n\t\tLog.info(\" Employee Controller Triggerd\");\r\n\t\tList<Employee> employees=employeeService.getAllEmployeesByPagination(maxPage, ofset);\r\n\t\treturn new ResponseEntity<List<Employee>>(employees,HttpStatus.OK);\r\n\t}",
"@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}",
"@GetMapping(\"/one/{id}\")\n\tpublic ResponseEntity<?> fetchOneData(@PathVariable(\"id\") Integer id) {\n\t\tResponseEntity<?> res = null;\n\t\ttry {\n\t\t\tEmployee emp = service.getOneEmpObject(id);\n\t\t\tres = new ResponseEntity<Employee>(emp, HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\tres = new ResponseEntity<String>(\"Unable Featch Data \", HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn res;\n\t}",
"@GetMapping(value = {\"/count\", \"/count/\"})\n public ResponseEntity<Void> getEmployeeCount(){\n employeeService.getEmployeeCount();\n return new ResponseEntity<>(HttpStatus.OK);\n }",
"@ResponseBody\n\t@GetMapping(\"/employees\")\n\tpublic List<Employee> listEmployees() {\n\t\tList<Employee> theEmployees = employeeDAO.getEmployees();\n\t\t\n\t\treturn theEmployees;\n\t}",
"@GetMapping(value = \"/allEmployees/produces\", produces =\"Application/vnd.company.app-v1+json\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddProd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"public List<EmployeeDto> retrieveEmployees();",
"@Override\n public Response intercept(Chain chain) throws IOException {\n Request request = chain.request();\n Request.Builder newRequest;\n\n newRequest = request.newBuilder()\n .addHeader(\"Content-type\", \"application/json;charset=UTF-8\")\n .addHeader(\"Accept\", \"application/json\");\n return chain.proceed(newRequest.build());\n }",
"@PostMapping(value = \"/search\",produces = MediaType.APPLICATION_JSON_VALUE,consumes = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<String> getAvailabilityAndPrice(JSONObject reqJson) throws Exception{\n\t\t\treturn new ResponseEntity<String>(RailSearchProcessor.process(reqJson), HttpStatus.OK);\n }",
"@GET\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployees( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees for given education using EducationResource.EmployeeResource.getEducatedEmployees(educationId) method of REST API\");\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<Employee> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees for given education filtered by given params\n employees = new ResourceList<>(\n employeeFacade.findByMultipleCriteria(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees for given education without filtering (eventually paginated)\n employees = new ResourceList<>( employeeFacade.findByEducation(education, params.getOffset(), params.getLimit()) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<List<Enquiry>> getAll(@RequestParam(value = \"page\" , required = false) Integer offset,\n @RequestParam(value = \"per_page\", required = false) Integer limit)\n throws URISyntaxException {\n Page<Enquiry> page = enquiryRepository.findAll(PaginationUtil.generatePageRequest(offset, limit));\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/enquirys\", offset, limit);\n return new ResponseEntity<List<Enquiry>>(page.getContent(), headers, HttpStatus.OK);\n }",
"@GetMapping(value = \"/allEmployees/header\", headers =\"X-API-VERSION=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddHdr(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@Test\n\t@WithMockUser(username=\"admin\",roles={\"ADMIN\"})\n\tpublic void getAllEmployees_AuthorisedUser_ReturnsJsonOfEmployees() throws Exception\n\t{\n\t\tString result = this.mockMvc.perform(MockMvcRequestBuilders\n\t\t\t .get(\"/api/employees\")\n\t\t\t .contentType(MediaType.APPLICATION_JSON))\n\t\t\t\t .andDo(MockMvcResultHandlers.print())\n\t\t\t\t .andExpect(MockMvcResultMatchers.status().isOk())\n\t\t\t\t .andReturn()\n\t\t\t\t .getResponse()\n\t\t\t\t .getContentAsString();\n\t\t\n\t\t//Assert\n\t\tJSONObject json = new JSONObject(result);\t\n\t\t//the json returns in an object called \"_embedded\", which then has an array of accounts\n\t\tJSONObject embedded = (JSONObject) json.get(\"_embedded\");\n\t\tJSONArray employees = embedded.getJSONArray(\"employees\");\n\t\tassertTrue(employees.length() > 0);\n\t\t\n\t}",
"@GetMapping(\"/employee/{id}\")\r\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Long id)\r\n\t{\r\n\t\tEmployee emp=empdao.findOne(id);\r\n\t\tif(emp == null)\r\n\t\t{\r\n\t\treturn ResponseEntity.notFound().build();\r\n\t\t}\r\n\t\treturn ResponseEntity.ok().body(emp);\r\n\t}",
"@Test\n public void given_devEnvironmentAndListStudent_when_callEndpointFindAll_then_returnListStudentAndStatus200() throws Exception {\n\n when(studentRepo.findAll()).thenReturn(STUDENT_LIST);\n\n RequestBuilder request = MockMvcRequestBuilders\n .get(\"/students\")\n .accept(MediaType.APPLICATION_JSON);\n\n mockMvc.perform(request)\n .andExpect(status().isOk())\n .andExpect(content().json(gson.toJson(STUDENT_LIST),true))\n .andReturn();\n }",
"@Test\n public void verifyFirstName(){\n given().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/employees/100\")\n .then().assertThat().statusCode(200)\n .and().contentType(ContentType.JSON)\n .and().assertThat().body(\"first_name\", Matchers.equalTo(\"Steven\"))\n .and().assertThat().body(\"employee_id\",Matchers.equalTo(\"100\"));\n\n }",
"@RequestMapping(value = \"/listEmployees\", method = RequestMethod.GET)\r\n\tpublic Employee employees() {\r\n System.out.println(\"---BEGIN\");\r\n List<Employee> allEmployees = employeeData.findAll();\r\n \r\n System.out.println(\"size of emp == \"+allEmployees.size());\r\n System.out.println(\"---END\");\r\n Employee oneEmployee = allEmployees.get(0);\r\n\t\treturn oneEmployee;\r\n }",
"@Test\n\tpublic void postCallMethod() throws JsonGenerationException, JsonMappingException, IOException {\n\t\tpostMethod = new RestClient();\n\n\t\t// Header Value to Pass with GET Method (URI is already ready in before Method)\n\t\tHashMap<String, String> header = new HashMap<String, String>();\n\t\theader.put(\"Content-Type\", \"application/json\");\n\n\t\t// Create Java Object (POJO) in which data is stored\n\t\tString name = \"Manish\" + TestUtil.getCurrentDateTimeStamp();\n\t\tSystem.out.println(\"Name: \" + name);\n\t\tEmployee employee = new Employee(name, \"10000\", \"25\", null);\n\n\t\t// Convert POJO into JSON Object\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.writeValue(new File(System.getProperty(\"user.dir\") + \"/src/main/java/employee.json\"), employee);\n\n\t\t// java Object to JSON in string (Marshelling)\n\t\tString usersJsonString = mapper.writeValueAsString(employee);\n\n\t\t// POST method is called using URI,JSON body and headers and response is saved\n\t\t// in variable\n\t\tresponseUnderPostRequest = postMethod.post(URI, usersJsonString, header);\n\n\t\t// Output of POST call\n\t\t// Validation part (For POST method output is 1.StatusCode,2.Response\n\t\t// JSON,3.Header)\n\t\t// 1. Retrieve Response Status Code and Assert it\n\t\tint StatusCode = responseUnderPostRequest.getStatusLine().getStatusCode();\n\t\tAssert.assertEquals(StatusCode, RESPONSE_STATUS_CODE_200);\n\n\t\t// 2.Retrieve Response JSON Object as a String\n\t\tString jsonString = EntityUtils.toString(responseUnderPostRequest.getEntity(), \"UTF-8\");\n\n\t\t/*\n\t\t * JSONObject jsonObject=new JSONObject(jsonString);\n\t\t * System.out.println(jsonObject);\n\t\t */\n\n\t\t// Convert JSON Object to java object POJO (Unmarshelling) and Assert with\n\t\t// Previous JAVA Object POJO\n\t\tEmployee responseUser = mapper.readValue(jsonString, Employee.class);\n\t\tAssert.assertTrue(responseUser.getName().equals(employee.getName()));\n\t}",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> list() {\r\n\t return empService.listAll();\r\n\t}",
"@GET\n\t@Path(\"/search/{empName}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getByName(@PathParam(\"empName\") String name) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findByName(name)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n WebFunction.JsonHeaderInit(resp);\r\n ArticleService svc=new ArticleService();\r\n JSONObject ResultJson = svc.GetType(\"1\");\r\n WebFunction.ResponseJson(resp, ResultJson);\r\n }",
"@GetMapping(path=\"/json\")\n public String getTodos() {\n String theUrl = \"http://localhost:8080/hello\";\n ResponseEntity<String> response = restTemplate.exchange(theUrl, HttpMethod.GET, null, String.class);\n\n return response.getBody();\n }",
"@Test\n public void getretrieveAllOffersTest() throws IOException {\n\n ObjectMapper mapper = new ObjectMapper();\n RetrieveAllOffersgetResponse response = api.getretrieveAllOffers( null, null);\n\n String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(response);\n System.out.println(json);\n }",
"@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}",
"@Test\n public void test1() throws JsonProcessingException {\n JSONObject payload = getJsonObject(PAYLOAD_BASEPATH + \"saveEmployee.json\");\n\n payload.put(\"email\", RandomUtils.generateRandomString(5).concat(\"@gmail.com\"));\n payload.put(\"status\", fetchDataFromDataFile(\"service1Data\", \"createUser\", \"Value2\"));\n payload.put(\"name\", fetchDataFromDataFile(\"service1Data\", \"createUser\", \"Value3\"));\n payload.put(\"gender\", fetchDataFromDataFile(\"service1Data\", \"createUser\", \"Value4\"));\n\n log.info(\"api request is {} \", payload);\n Response response = given().headers(\"Authorization\", \"Bearer e85170d9b952bb8a12603f87d6c8f525946b4906c311b83eeec703bd0c1cbea0\").filter(new ErrorLoggingFilter(errorCapture)).contentType(ContentType.JSON).body(payload.toString()).log().everything().when().post(Constants.BASEPATH.concat(Constants.CREATE_USER));\n verifyStatusCode(response);\n verifyResponseBody(response, \"201\");\n// dbAssist.responseValidation(response);\n log.error(\"hey {} \", errorWriter.toString().toUpperCase());\n log.info(\"response is {}\", response.prettyPrint());\n }",
"@GET\n @Path(\"/\")\n @Produces(\"application/json\")\n public Response all() {\n // Return some cliched textual content\n return Response.ok(\"clients list goes here\", MediaType.APPLICATION_JSON).build();\n }",
"@Test\n void getAllProfessors() throws Exception{\n MvcResult result = mvc.perform(get(\"/api/v1/professors\")).andExpect(status().isOk()).andExpect(content().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)).andReturn();\n System.out.println(result.getResponse().getContentAsString());\n\n }",
"@Test\n public void getWitheaders(){\n with().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/countries/US\")\n .then().statusCode(200);\n }",
"@GetMapping(value=\"/employes\")\n\tpublic List<Employee> getEmployeeDetails(){\n\t\t\n\t\tList<Employee> employeeList = employeeService.fetchEmployeeDetails();\n\t\treturn employeeList;\t\t\t\t\t\t\n\t}",
"@GetMapping(\"/all\")\n public ResponseEntity<?> findAllData() {\n logger.info(\"Start controller call get All Data \");\n ServiceResult serviceResult = new ServiceResult();\n serviceResult.setMessage(\"Get All Data Success\");\n try {\n List<AdCampaign> lstAdCampaigns = adCampaignService.findAll();\n serviceResult.setData(lstAdCampaigns);\n serviceResult.setStatus(ServiceResult.Status.SUCCESS);\n }catch (Exception ex){\n logger.error(\"Error get All Data\");\n serviceResult.setMessage(\"Error\");\n serviceResult.setStatus(ServiceResult.Status.FAILED);\n }\n\n logger.info(\"End controller call get All Data \");\n return new ResponseEntity<ServiceResult>(serviceResult,new HttpHeaders(), HttpStatus.OK);\n }",
"@Override\n public void intercept(RequestInterceptor.RequestFacade request) {\n request.addHeader(\"Accept\", \"application/json\");\n }",
"@RequestMapping(value=\"restAddemployments\" , method={RequestMethod.POST})\r\n\tpublic ResponseEntity<JsonResponse<Object>> restAddemployment(@RequestBody HrmsEmploymentMasterModel employment) \r\n\t{\r\n\t\tlogger.info(\"Method : restAddemployment starts\");\r\n\t\t\r\n\t\tlogger.info(\"Method : restAddemployment ends\");\r\n\t\t\r\n\t\treturn hrmEmploymentMasterDao.addemployment(employment);\r\n\t}",
"@GET\n @Path(\"/getAll\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getJson() {\n \n \ttry \n \t{\n \t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", \"*\").entity(servDoctores.getDoctores().toString()).build();\n \t} catch (Exception e) {\n\n \t\te.printStackTrace();\n \t\treturn Response.status(Response.Status.NO_CONTENT).build();\n \t}\n }",
"@Test\n public void VerifyContentTypeWithAssertThat(){\n given().accept(ContentType.JSON)\n .when().get(\"http://34.223.219.142:1212/ords/hr/employees/100\")\n .then().assertThat().statusCode(200)\n .and().contentType(ContentType.JSON);\n }",
"@Test\n public void simpleGet(){\n when()\n .get(\"http:://34.223.219.142:1212/ords/hr/employees\")\n .then().statusCode(200);\n\n }",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n response.setContentType(\"application/json\");\n\n List<Table> tables = getTables();\n Gson gson = new Gson();\n String json = gson.toJson(tables);\n\n response.getOutputStream().println(json);\n }",
"@Override\r\n JSONObject doPerform(HttpServletRequest req, HttpServletResponse response) throws Exception {\r\n JSONObject jo = new JSONObject();\r\n try {\r\n JSONObject json;\r\n if (req.getMethod().equals(\"POST\")) {\r\n String js = IOUtils.toString(req.getInputStream(), \"UTF-8\");\r\n json = new JSONObject(js);\r\n } else {\r\n json = new JSONObject(req.getParameter(\"json\"));\r\n }\r\n OfferRecord or = OfferRecord.fromJSON(json);\r\n JSONObject ret = new JSONObject(SolrIndexerCommiter.indexJSON(new JSONObject(JSON.toJSONString(or)), \"offersCore\"));\r\n\r\n// Indexer indexer = new Indexer();\r\n// indexer.indexWanted(or.doc_code,\r\n// UsersController.toKnihovna(req).getCode(),\r\n// or.chci);\r\n return ret;\r\n\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n jo.put(\"error\", ex.toString());\r\n }\r\n return jo;\r\n\r\n }",
"@Transactional(propagation = Propagation.REQUIRED)\n\tpublic String getEmployeeListJSON(){\n\t\tGson gson = new GsonBuilder()\n\t\t\t\t\t\t.setDateFormat(\"dd/MM/yyyy\")\n\t\t\t\t\t\t.create();\n\t\t String rtnString = gson.toJson(daoImpl.getEmployees());\n\t\t \n\t\t return rtnString;\n\t}",
"@GetMapping(\"/findAllEmployees\")\n\tpublic List<Employee> getAll() {\n\t\treturn testService.getAll();\n\t}",
"@GetMapping(\"v1/allEmployees\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterVer(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GetMapping(\"/one/{id}\")\n\tpublic ResponseEntity<?> getOneEmployee(@PathVariable Integer id) {\n\t\tResponseEntity<?> response = null;\n\t\ttry {\n\t\t\tEmployee employee = service.getOneEmployee(id);\n\t\t\tresponse = new ResponseEntity<Employee>(employee, HttpStatus.OK); // 200\n\t\t} catch (EmployeeNotFoundException enfe) {\n\t\t\tthrow enfe;\n\t\t}\n\t\treturn response;\n\t}",
"@RequestMapping(\"/getAllContacts\")\n\tprivate ResponseEntity<String> getAllContacts() throws JsonProcessingException {\n\t\t\n\t\tList<Contacts> contactlist = c_service.getAllContacts();\t\t\n\t HttpHeaders responseHeaders = new HttpHeaders();\n\t \n\t if (contactlist == null) {\n\t return new ResponseEntity<String>(\"No Users found\", \n\t responseHeaders, HttpStatus.UNAUTHORIZED);\n\t } else {\n\t responseHeaders.add(\"Content-Type\", \"application/json\");\n\t String json = convertListToJson(contactlist);\n\t return new ResponseEntity<String>(json, responseHeaders, HttpStatus.OK); \n\t }\t\t\n\t}",
"@Test\r\n\tpublic void getAllIncidents() {\n\t\tRestAssured.baseURI = \"https://dev49243.service-now.com/api/now/table/incident\";\r\n\t\t\r\n\t\t// Step 2: Authentication (basic)\r\n\t\tRestAssured.authentication = RestAssured.basic(\"admin\", \"Tuna@123\");\r\n\t\t\r\n\t\t// Step 3: Request type - Get -> Response\r\n\t\tResponse response = RestAssured.get();\r\n\t\t\r\n\t\t// Step 4: Validate (Response -> Status Code : 200)\r\n\t\tSystem.out.println(response.getStatusCode());\r\n\t\t\r\n\t\t// Print the response time as well \r\n\t\t\r\n\t\t// Check what is the response format\r\n\t\tSystem.out.println(response.getContentType());\r\n\t\t\r\n\t\t// print the response\r\n\t\tresponse.prettyPrint();\r\n\t\t\r\n\t}",
"@GET\n @Path(\"/eagerly\")\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployeesEagerly( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees eagerly for given education using \" +\n \"EducationResource.EmployeeResource.getEducatedEmployeesEagerly(educationId) method of REST API\" );\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<EmployeeWrapper> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees eagerly for given education filtered by given params\n employees = new ResourceList<>(\n EmployeeWrapper.wrap(\n employeeFacade.findByMultipleCriteriaEagerly(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n )\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees eagerly for given education without filtering (eventually paginated)\n employees = new ResourceList<>( EmployeeWrapper.wrap(employeeFacade.findByEducationEagerly(education, params.getOffset(), params.getLimit())) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@Test\n public void testReceiverAgeEndpointCombo() {\n ResponseEntity response = dataController.getReceiverDataAge(\"M\", null, \"Canterbury\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"public EmployeeDto getEmployee(Long employeeId) throws ApiDemoBusinessException;",
"@GET\n @Path(\"location/Arovince\")\n @Produces(\"application/json\")\n public String getJson() throws IOException {\n FileWriter file = new FileWriter(\"/home/component/NetBeansProjects/ArovinceAndSchool/web/api/Arovince.json\");\n JSONObject jsonArray = null;\n\n try {\n URL url = new URL(\"https://opend.data.go.th/get-ckan/datastore_search?resource_id=df922923-e009-4dee-92fc-d963a86ce4b8\"); \n HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();\n httpURLConnection.setRequestMethod(\"GET\");\n httpURLConnection.setRequestProperty(\"api-key\", \"XOe9aVTolOhCbyTU103IqAKTNNNPX8b5\");\n String line = \"\";\n InputStreamReader inputStreamReader = new InputStreamReader(httpURLConnection.getInputStream());\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n StringBuilder response = new StringBuilder();\n\n try {\n while((line = bufferedReader.readLine()) != null) {\n file.write(line);\n response.append(line);\n }\n } catch (IOException var10) {\n }\n\n file.close();\n bufferedReader.close();\n jsonArray = new JSONObject(response.toString());\n return jsonArray.toString(4);\n } catch (Exception var11) {\n return \"\" + var11;\n }\n }",
"@RequestMapping(value=\"getemploymentDetails\" , method={RequestMethod.POST})\r\n\tpublic ResponseEntity<JsonResponse<List<HrmsEmploymentMasterModel>>> getemploymentDetails(@RequestBody DataTableRequest request) \r\n\t{\r\n\t\tlogger.info(\"Method : getemploymentDetails starts\");\r\n\t\t\r\n\t\tlogger.info(\"Method : getemploymentDetails ends\");\r\n\t\t\r\n\t\treturn hrmEmploymentMasterDao.getemploymentDetails(request);\r\n\t}",
"@Test\n\t@Ignore\n\tpublic void testResponse() throws UnsupportedEncodingException {\n\t\tws = resource().path(\"omxdata\");\n\t\tClientResponse response = ws.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);\n\t\tassertEquals(200, response.getStatus());\n\t\tSystem.out.println(response.getStatus());\n\t}",
"@Test\r\n\tpublic void givenResourceUrl_whenSendGetForRequestEntity_thenStatusOk() throws IOException {\n\r\n\t\tfinal Logger log = LoggerFactory.getLogger(UserDataRestTemplateTest.class);\r\n\r\n\t\tRestTemplate restTemplate = new RestTemplate();\r\n\t\tMap<String, String> response = (Map<String, String>) restTemplate\r\n\t\t\t\t.getForObject(\"http://services.groupkt.com/country/get/iso2code/IN\", Map.class);\r\n\t\tlog.info(\"==== RESTful API Response using Spring RESTTemplate START =======\");\r\n\t\tlog.info(response.toString());\r\n\t\tlog.info(\"==== RESTful API Response using Spring RESTTemplate END =======\");\r\n\r\n\t}",
"public Response getRequestForGetAPI(String endpoint) {\n response = given().contentType(ContentType.JSON)\n .when()\n .get(endpoint)\n .then()\n .extract().response();\n\n System.out.println(\"Response of API :\"+response.getBody().asString());\n\n String body = response.getBody().asString();\n JSONArray responseArray= new JSONArray(body);\n comment.setBody(responseArray);\n return response;\n\n }",
"@GET\n @Path(\"/createEmployee/{empName}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String createEmployee(@PathParam(\"empName\") String empName){\n String output = \"\";\n try {\n Employee employee = new Employee();\n employee = EmployeeFacade.getInstance().createEmployee(empName);\n output = gson.toJson(employee);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@GetMapping(\"/emloyees\")\n public List<Employee> all() {\n return employeeRepository.findAll();\n }",
"@GetMapping(value=\"/employee/{eId}\" , produces=\"application/json\")\n\n\tpublic List<Application> getEmpApplications(@PathVariable(\"eId\") int eId){\n\t\tEmployee emp = es.getEmployeeById(eId);\n\t\tList<Application> a = as.getAll();\n\t\tList<Application> empAppList = as.getBySpecies(emp.getSpecies());\n\t\t\n\n\t\t\n\t\t//Need to filter out second approval for the employee's own species\n\t\tfor (Application app : a){\n\t\t\t//if ((app.getStatus().equals(\"submitted\"))) {empAppList.add(app);}\n\t\t\t if ((app.getStatus().equals(\"secondApproval\"))&&(app.getPet().getBreed().getSpecies() != emp.getSpecies())) {\n\t\t\t\tempAppList.add(app);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\treturn empAppList;\n\t}",
"private void useFakeResponse() {\n EmployeeApp.useFakeResponse = true;\n ResponseObject responseObject = new ResponseObject();\n responseObject.setReturnCode(200);\n responseObject.setType(ResponseObject.ResponseType.JSON);\n responseObject.setResponseBodyString(new CompanyEmployeesResponse().getRandomResponse());\n FakeInterceptor.addTest(\"-mobile-\", responseObject);\n }",
"@RequestMapping(value = \"/v2/employees\", method = RequestMethod.GET)\r\n\tpublic List<Employee> employeev2() {\r\n JPAQuery<?> query = new JPAQuery<Void>(em);\r\n QEmployee qemployee = QEmployee.employee;\r\n List<Employee> employees = (List<Employee>) query.from(qemployee).fetch();\r\n // Employee oneEmp = employees.get(0);\r\n\t\treturn employees;\r\n }",
"public static DefaultResponseUser getOKResponse(List<Employee> data) {\n\t\treturn new DefaultResponseUser(ApplicationConstants.SUCCESSFULL_UPDATED, HttpStatus.OK.value(), data);\n\t}",
"@RequestMapping(value = \"/employees\")\n\tpublic String getAllEmployess(@RequestParam String user,HttpServletRequest request,HttpServletResponse response,Model mv) throws JsonMappingException, JsonProcessingException\n\t{\n\t\tList<Employee> empList = RestCalls.getAllEmployees();\n\t\tmv.addAttribute(\"empList\",empList);\n\t\tmv.addAttribute(\"auth\", \"true\");\n\t\tmv.addAttribute(\"user\", user);\n\t\treturn \"employeedetails.jsp\";\n\t}",
"@Test\n public void given_devEnvironmentAndEmptyListStudent_when_callEndpointFindAll_then_returnEmptyListStudentAndStatus200() throws Exception {\n\n List<Student> studentList = new ArrayList<>();\n\n when(studentRepo.findAll()).thenReturn(studentList);\n\n RequestBuilder request = MockMvcRequestBuilders\n .get(\"/students\")\n .accept(MediaType.APPLICATION_JSON);\n\n mockMvc.perform(request)\n .andExpect(status().isOk())\n .andExpect(content().json(gson.toJson(studentList)))\n .andReturn();\n }",
"@GetMapping(value = \"allEmployees/param\", params =\"version=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAdd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GetMapping(\"/getRE\")\n\tpublic List<EnquiryDetails> getDataRE()\n\t{\n\t\tString url=\"http://localhost:8083/getclient/getalldatafor_re\";\n\t\tList<EnquiryDetails> list=rt.getForObject(url, List.class);\n\t\tSystem.out.println(list);\n\t\treturn list;\n\t}",
"@GetMapping(\"/GetAllEmployees\")\r\n public List<Employee> viewAllEmployees() {\r\n return admin.viewAllEmployees();\r\n }",
"@RequestMapping(value = \"/getAutoCompleteInfo\", method = RequestMethod.POST)\r\n public @ResponseBody String getAutoCompleteInfo(@RequestParam(\"employeeId\") String employeeId) {\r\n\r\n List<Integer> infolist = null;\r\n Pattern pattern = Pattern.compile(\"^[0-9]$\");\r\n Matcher matcher = pattern.matcher(employeeId);\r\n if (matcher.find()) {\r\n logger.info(\"Integer:\" + employeeId);\r\n logger.info(\"inside ReportGenerationController getAutoCompleteInfo()\");\r\n logger.info(\"received employee id: \" + employeeId);\r\n int empid = Integer.parseInt(employeeId);\r\n infolist = reportGenerationService.getAutoCompleteInfo(empid);\r\n logger.info(\"info list in controller:\" + infolist);\r\n\r\n return JsonUtility.convertToJson(infolist);\r\n } else {\r\n logger.info(\"String:\" + employeeId);\r\n List<String> data = reportGenerationService.getAutoCompleteInfo(employeeId);\r\n return JsonUtility.convertToJson(data);\r\n }\r\n }",
"@GetMapping(\"/employebyid/{empId}\")\n\t public ResponseEntity<Employee> getEmployeeById(@PathVariable int empId)\n\t {\n\t\tEmployee fetchedEmployee = employeeService.getEmployee(empId);\n\t\tif(fetchedEmployee.getEmpId()==0)\n\t\t{\n\t\t\tthrow new InvalidEmployeeException(\"No employee found with id= : \" + empId);\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn new ResponseEntity<Employee>(fetchedEmployee,HttpStatus.OK);\n\t\t}\n }"
] | [
"0.69494706",
"0.6906922",
"0.6681592",
"0.65922195",
"0.6536354",
"0.63890576",
"0.63556856",
"0.6324184",
"0.6300521",
"0.6292109",
"0.6286773",
"0.62831885",
"0.62550193",
"0.62481236",
"0.61655265",
"0.6151917",
"0.6138565",
"0.6134137",
"0.60927004",
"0.60728407",
"0.6054186",
"0.60344994",
"0.60315835",
"0.6022582",
"0.60133564",
"0.60087675",
"0.59623677",
"0.5950337",
"0.5914858",
"0.59068155",
"0.5871119",
"0.5858537",
"0.58575904",
"0.58562565",
"0.58443964",
"0.5834458",
"0.5813357",
"0.5797506",
"0.5796856",
"0.57739",
"0.57478553",
"0.5743549",
"0.57136655",
"0.5699947",
"0.5686052",
"0.5685717",
"0.5659165",
"0.565734",
"0.56548655",
"0.565477",
"0.56542104",
"0.56391275",
"0.56363213",
"0.5623427",
"0.56223017",
"0.5621226",
"0.56198174",
"0.56176984",
"0.5613389",
"0.5596205",
"0.55830455",
"0.5570101",
"0.5556252",
"0.555271",
"0.555054",
"0.55467945",
"0.5509649",
"0.5507223",
"0.5505378",
"0.5503942",
"0.550177",
"0.5495879",
"0.5495256",
"0.54948694",
"0.54933816",
"0.54929006",
"0.5487534",
"0.5482851",
"0.54818916",
"0.54792607",
"0.5478005",
"0.5460434",
"0.54544353",
"0.5453994",
"0.5452262",
"0.5450685",
"0.5449239",
"0.54372203",
"0.5435763",
"0.5433046",
"0.5431976",
"0.54300046",
"0.5427988",
"0.54167974",
"0.54144204",
"0.5411741",
"0.5411283",
"0.54041",
"0.5401619",
"0.53904283"
] | 0.6159164 | 15 |
/ Given Accept type is JSON And Params are limit=100 And Path param is 110 When I send a GET request to employees Then status code is 200 And Response content should be json And following data should be return "employee_id": 110, "first_name" "john", "last_name":"Chen", "email":"JCHEN", | @Test
public void testWithPathParameters() {
given().accept(ContentType.JSON).and().params("limit",100)
.and().pathParams("id", 110)
.when().get(ConfigurationReader.getProperty("hrapp.baseurl")+"/employees/{id}") //when we send e request this id will be replaced with 110
.then().statusCode(200)
.and().assertThat().contentType(ContentType.JSON)
.and().body("employee_id", equalTo(110),
"first_name",equalTo("John"),
"last_name",equalTo("Chen"),
"email",equalTo("JCHEN"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n\tpublic void test_getAllEmployees() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t// .pathParam(\"page\", \"0\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(0))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\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 }",
"@Test \n\tpublic void testJsonPathWithLists() {\n\t\n\t\tMap<String,Integer> requestParamMaps=new HashMap<>();\n\t\t requestParamMaps.put(\"limit\", 100);\n\t\t\n\t\t\tResponse response = given().accept(ContentType.JSON).and().params(requestParamMaps)\n\t\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/\");\n\t\t\t\n\t\t\tassertEquals(response.statusCode(), 200);\n\t\t\t\n\t\t\tJsonPath json = response.jsonPath();\n\t\t\t//get all employee ids into arratlist\n\t\t\tList<Integer> empIDs = json.getList(\"items.employee_id\");\n\t\t\tSystem.out.println(empIDs);\n\t\t\t//assert that there are 100 emp ids\n\t\t\tassertEquals(empIDs.size(), 100);\n\t\t\t\n\t\t\t//get all emails and assign in list \n\t\t\tList<String> emails = json.getList(\"items.email\");\n\t\t\t\n\t\t\tassertEquals(emails.size(), 100);\n\t\t\t\n\t\t\t//get all employee ids that are greater than 150\n\t\t\tList<Integer> empIdList = json.getList(\"items.findAll{it.employee_id > 150}.employee_id\");\n\t\t\tSystem.out.println(empIdList);\n\t\t\t\n\t\t\t//get all employee lastnames, whose salary is more than 7000\n\t\t\t\n\t\t\tList<String> lastNames = json.getList(\"items.findAll{it.salary > 7000}.last_name\");\n\t\t\tSystem.out.println(lastNames);\n\t}",
"@Test //make sure it comes from testNG\n public void testWithQueryParameterAndList(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"items.employee_id\", hasSize(100));\n }",
"@Test\n\tpublic void testWithQueryParametersAndList() {\n\t\tgiven().accept(ContentType.JSON)\n\t\t.and().params(\"limit\",100)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees\")\n\t\t.then().assertThat().statusCode(200)\n\t\t.and().contentType(ContentType.JSON)\n\t\t.and().assertThat().body(\"items.employee_id\", hasSize(100));\n\t\t\n\t}",
"@Test\r\n\tpublic void test_getEmployeeById() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"id\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employee\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200);\r\n\t}",
"@GET\n @Path(\"/getEmployeeById/{empId}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeById(@PathParam(\"empId\") String empId){\n String output = \"\";\n try {\n Employee employee = new Employee();\n employee = EmployeeFacade.getInstance().getEmployeeById(empId);\n output = gson.toJson(employee);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@RequestMapping(\"/get\")\n public ResponseEntity<ResponseDTO> getEmployeePayrollData() {\n List<EmployeePayrollData> empDataList ;\n empDataList = employeePayrollService.getEmployeePayrollData();\n ResponseDTO responseDTO = new ResponseDTO(\"Get Call Success\", empDataList);\n log.info(\"get all data\");\n return new ResponseEntity<>(responseDTO, HttpStatus.OK);\n\n }",
"@Test\n public void testWithJsonPath(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n //we are getting the response and assigning it to this variable\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .and().pathParams(\"employee_id\", 177) //path param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\");\n\n //here we are saying get json body and assign it yo jsonpath object\n JsonPath json = response.jsonPath();\n\n System.out.println(json.getInt(\"employee_id\"));\n System.out.println(json.getString(\"last_name\"));\n System.out.println(json.getString(\"job_id\"));\n System.out.println(json.getInt(\"salary\"));\n //we put index to links, because links is an array, but href is just a value of the array\n System.out.println(json.getString(\"links[0].href\")); //to get only the first link\n //we use upper statement to get specific element from array\n\n //assign all href into a List of strings\n List<String> hrefs = json.getList(\"links.href\");\n System.out.println(hrefs);\n }",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getAllEmployees(){\n\t\tString employeesJsonString = getFileContent();\n\t\treturn employeesJsonString;\n\t}",
"@GET\n\t@Path(\"{empID}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getById(@PathParam(\"empID\") int id) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findById(id)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getEmployee( @NotNull(message = \"Employee ID cannnot be null\")\n @QueryParam(\"empId\") String empId) {\n return null;\n }",
"@GET\n @Path(\"/getEmployeeByName/{empName}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeByName(@PathParam(\"empName\") String empName){\n String output = \"\";\n try {\n Map<String, Employee> employeeMap = new HashMap<String, Employee>();\n employeeMap = EmployeeFacade.getInstance().getEmployeeByName(empName);\n output = gson.toJson(employeeMap);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAll() {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findAll()) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@GetMapping(\"/get_all_employees\")\n public String getAllEmployees(){\n\n Gson gsonBuilder = new GsonBuilder().create();\n List<Employee> initial_employee_list = employeeService.get_all_employees();\n String jsonFromJavaArray = gsonBuilder.toJson(initial_employee_list);\n\n return jsonFromJavaArray;\n }",
"@GET\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGetbyId(@PathParam(\"id\") String id) {\n Gson gson = GSONFactory.getInstance();\n Employee employee = getEmployeeById(id);\n\n if (employee == null) {\n Response response = Response.status(404).build();\n return response;\n } else {\n String jsonOutput = gson.toJson(employee);\n Response response = Response.ok().entity(jsonOutput).build();\n return response;\n }\n }",
"@Test\n public void testJsonPathWithLists(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\");\n\n Assert.assertEquals(response.statusCode(),200); //to check status code\n\n //First way to use JsonPath\n JsonPath json = response.jsonPath();\n\n //Second way\n //JsonPath json = new JsonPath(response.asString());\n\n //Third way\n //JsonPath json = new JsonPath(new File(FilePath.json));\n\n //get all employee ids into ArrayList\n List<Integer> empIds = json.getList(\"items.employee_id\");\n System.out.println(empIds);\n //assert that there are 100 employee ids\n Assert.assertEquals(empIds.size(), 100);\n\n //get all employee emails and assign into ArrayList\n List<String> empEmails = json.getList(\"items.email\");\n System.out.println(empEmails);\n Assert.assertEquals(empEmails.size(), 100);\n\n //get all employee ids that are greater than 150\n List<Integer> empIdsMoreThan150 = json.getList(\"items.findAll{it.employee_id>150}.employee_id\");\n System.out.println(empIdsMoreThan150);\n\n //get all employees last name whose salary > 15000\n List<String> empSalaryMoreThan7000 = json.getList(\"items.findAll{it.salary>15000}.last_name\");\n System.out.println(empSalaryMoreThan7000);\n\n //get data from saved JSON file\n JsonPath jsonFromFile = new JsonPath(new File(\"/Users/asselkassymbekova/Desktop/employees.json\"));\n List<String> empEmails1 = jsonFromFile.getList(\"items.email\");\n System.out.println(empEmails1);\n\n }",
"@GetMapping(\"/all\")\n public ResponseEntity responseAllEmployees(){\n return new ResponseEntity<>(hr_service.getAllEmployees(), HttpStatus.OK);\n }",
"@Test\n public void testWithPathParameters(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .and().pathParams(\"employee_id\", 110)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"employee_id\", equalTo(110),\n \"first_name\", equalTo(\"John\"),\n \"last_name\", equalTo(\"Chen\"),\n \"email\", equalTo(\"JCHEN\") );\n }",
"@Test\n //1. adim URL i olusturmak\n public void get01(){\n spec03.pathParam(\"employeePath\",\"employees\");\n\n // 2. adim test datalarini olusturmak\n\n // 3. adim Request olusturma\n Response response = given().\n spec(spec03).\n when().\n get(\"/{employeePath}\");\n // response.prettyPrint();\n // 1. yol EqualTo-- Body ile assert ediyoruz\n response.\n then().\n assertThat().\n statusCode(200).\n body(\"data.employee_name[4]\",equalTo(\"Airi Satou\"),\n \"data[5].employee_salary\",equalTo(\"372000\"),\n \"data.id\",hasSize(24),\n \"data.employee_name\",hasItem(\"Rhona Davidson\"),\n \"data.employee_age\",hasItems(\"21\", \"23\", \"61\"));\n\n // 2. yol Hard Assertion\n // JsonPath ile\n JsonPath json = response.jsonPath();\n Assert.assertEquals(\"Airi Satou\",json.getString(\"data.employee_name[4]\"));\n Assert.assertEquals(\"372000\",json.getString(\"data[5].employee_salary\"));\n // System.out.println(json.getList(\"data.id\"));\n Assert.assertEquals(24,json.getList(\"data.id\").size());\n // System.out.println(json.getList(\"data.employee_name\"));\n Assert.assertTrue(json.getList(\"data.employee_name\").contains(\"Rhona Davidson\"));\n\n List<String> yasListesi = new ArrayList<>();\n yasListesi.add(\"21\");\n yasListesi.add(\"23\");\n yasListesi.add(\"61\");\n Assert.assertTrue(json.getList(\"data.employee_age\").containsAll(yasListesi));\n\n\n\n }",
"@ApiOperation(value = \"getEmployeeByPagination controller method\")\r\n\t@GetMapping(\"/getEmployeeByPagination/{maxPage}/{ofset}\")\r\n\tpublic ResponseEntity<List<Employee>> getAllEmployeesByPagination(@PathVariable String maxPage,@PathVariable String ofset)\r\n\t{\r\n\t\tLog.info(\" Employee Controller Triggerd\");\r\n\t\tList<Employee> employees=employeeService.getAllEmployeesByPagination(maxPage, ofset);\r\n\t\treturn new ResponseEntity<List<Employee>>(employees,HttpStatus.OK);\r\n\t}",
"@Test\n\tpublic void testWithJsonPath() {\n\t\t\t\t\n\t\tResponse response = given().accept(ContentType.JSON)\n\t\t.and().pathParam(\"id\", 110)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/{id}\");\n\t\t\n\t\tJsonPath json = response.jsonPath(); //get json body and assign to jsonPath object\n\t\t//we are assiging whole response to json object so we can easyly reach and use it \n\t\t\n\t\tSystem.out.println(json.getInt(\"employee_id\"));\n\t\tSystem.out.println(json.getString(\"first_name\"));\n\t\tSystem.out.println(json.getString(\"job_id\"));\n\t\tSystem.out.println(json.getInt(\"salary\"));\n\t\tSystem.out.println(json.getString(\"links[0].href\")); //get specific element from array \n\t \n\t\t//assign all hrefs into a list of strings \n\t\tList<String> hrefs = json.getList(\"links.href\");\n\t\t\n\t\t//everything in arraylist \n\t System.out.println(hrefs);\n\t \n\t //one by one \n\t\tfor(String href:hrefs) {\n\t\t\tSystem.out.println(href);\n\t\t}\n\t}",
"@RequestMapping(value = \"/getAllEmployees\", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })\r\n\tpublic List<Employee> getAllEmpoyees(){\r\n\t\treturn repository.getAllEmpoyees();\r\n\t}",
"@GetMapping(\"/getEmployees\")\n\t@ResponseBody\n\tpublic List<Employee> getAllEmployees(){\n\t\treturn employeeService.getEmployees();\n\t}",
"@RequestMapping(value=\"/employees/all\", method = RequestMethod.GET)\npublic @ResponseBody List<Employee> employeeListRest(){\n\treturn (List<Employee>) employeerepository.findAll();\n}",
"@GetMapping(value = \"/allEmployees/produces\", produces =\"Application/vnd.company.app-v1+json\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddProd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"public List<EmployeeDto> retrieveEmployees();",
"@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}",
"@RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();",
"@RequestMapping(value = \"/employees\")\n\tpublic String getAllEmployess(@RequestParam String user,HttpServletRequest request,HttpServletResponse response,Model mv) throws JsonMappingException, JsonProcessingException\n\t{\n\t\tList<Employee> empList = RestCalls.getAllEmployees();\n\t\tmv.addAttribute(\"empList\",empList);\n\t\tmv.addAttribute(\"auth\", \"true\");\n\t\tmv.addAttribute(\"user\", user);\n\t\treturn \"employeedetails.jsp\";\n\t}",
"@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }",
"@GetMapping(value = \"/allEmployees/header\", headers =\"X-API-VERSION=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddHdr(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> getEmployees(){\r\n\t\t\r\n\t\treturn employeeService.getEmployees();\r\n\t\t\r\n\t}",
"public ResponseEntity<List<Employee>> getAllEmployees() {\n \tList<Employee> emplist=empService.getAllEmployees();\n\t\t\n\t\tif(emplist==null) {\n\t\t\tthrow new ResourceNotFoundException(\"No Employee Details found\");\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<>(emplist,HttpStatus.OK);\t\t\n }",
"@GetMapping(\"/employee/{id}\")\r\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Long id)\r\n\t{\r\n\t\tEmployee emp=empdao.findOne(id);\r\n\t\tif(emp == null)\r\n\t\t{\r\n\t\treturn ResponseEntity.notFound().build();\r\n\t\t}\r\n\t\treturn ResponseEntity.ok().body(emp);\r\n\t}",
"@GetMapping(\"v1/allEmployees\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterVer(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@Test\r\n\tpublic void test_getAllEmployeesPage2() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(2))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}",
"@GetMapping(\"/getoffer/{empId}\")\n\t public ResponseEntity<List<Offer>> getAllOffers(@PathVariable int empId)\n\t {\n\t\t List<Offer> fetchedOffers=employeeService.getAllOffers(empId);\n\t\t if(fetchedOffers.isEmpty())\n\t\t {\n\t\t\t throw new InvalidEmployeeException(\"No Employee found with id= : \" + empId);\n\t\t }\n\t\t else\n\t\t {\n\t\t\t return new ResponseEntity<List<Offer>>(fetchedOffers,HttpStatus.OK);\n\t\t }\n\t }",
"@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}",
"public EmployeeDto getEmployee(Long employeeId) throws ApiDemoBusinessException;",
"@GetMapping(value = \"allEmployees/param\", params =\"version=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAdd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"private String getEmployees() {\n\n String uri = new String(\"http://\" + mRESTServer.getHost() +\n mRESTServer.getContextPath());\n try {\n String result = restTemplate.getForObject(uri, String.class);\n\n System.out.println(result);\n return result+\": (\"+uri+\")\";\n\n } catch (HttpClientErrorException e) {\n /**\n *\n * If we get a HTTP Exception display the error message\n */\n log.error(\"error: \" + e.getResponseBodyAsString());\n\n ObjectMapper mapper = new ObjectMapper();\n ErrorHolder eh = null;\n try {\n eh = mapper.readValue(e.getResponseBodyAsString(), ErrorHolder.class);\n } catch (IOException ignored) {\n }\n\n log.error(\"error: \" + eh.getErrorMessage());\n\n } catch (Exception e) {\n log.error(\"error: \" + e.getMessage());\n\n }\n\n return null;\n }",
"@GetMapping(\"/one/{id}\")\n\tpublic ResponseEntity<?> fetchOneData(@PathVariable(\"id\") Integer id) {\n\t\tResponseEntity<?> res = null;\n\t\ttry {\n\t\t\tEmployee emp = service.getOneEmpObject(id);\n\t\t\tres = new ResponseEntity<Employee>(emp, HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\tres = new ResponseEntity<String>(\"Unable Featch Data \", HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn res;\n\t}",
"@GetMapping(value=\"/employes\")\n\tpublic List<Employee> getEmployeeDetails(){\n\t\t\n\t\tList<Employee> employeeList = employeeService.fetchEmployeeDetails();\n\t\treturn employeeList;\t\t\t\t\t\t\n\t}",
"@GetMapping(value=\"/searchEmpData/{fname}\")\n\tpublic List<Employee> getEmployeeByName(@PathVariable (value = \"fname\") String fname)\n\t{\n\t\treturn integrationClient.getEmployees(fname);\n\t}",
"@RequestMapping(value = \"/employeesList\", method = RequestMethod.GET, produces = {\"application/xml\", \"application/json\" })\n\t@ResponseStatus(HttpStatus.OK)\n\tpublic @ResponseBody\n\tEmployeeListVO getListOfAllEmployees() {\n\t\tlog.info(\"ENTERING METHOD :: getListOfAllEmployees\");\n\t\t\n\t\tList<EmployeeVO> employeeVOs = employeeService.getListOfAllEmployees();\n\t\tEmployeeListVO employeeListVO = null;\n\t\tStatusVO statusVO = new StatusVO();\n\t\t\n\t\tif(employeeVOs.size()!=0){\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_0);\n\t\t\tstatusVO.setMessage(AccountantConstants.SUCCESS);\n\t\t}else{\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_1);\n\t\t\tstatusVO.setMessage(AccountantConstants.NO_RECORDS_FOUND);\n\t\t}\n\t\t\n\t\temployeeListVO = new EmployeeListVO(employeeVOs, statusVO);\n\t\t\n\t\tlog.info(\"EXITING METHOD :: getListOfAllEmployees\");\n\t\treturn employeeListVO;\n\t}",
"@GET\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployees( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees for given education using EducationResource.EmployeeResource.getEducatedEmployees(educationId) method of REST API\");\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<Employee> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees for given education filtered by given params\n employees = new ResourceList<>(\n employeeFacade.findByMultipleCriteria(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees for given education without filtering (eventually paginated)\n employees = new ResourceList<>( employeeFacade.findByEducation(education, params.getOffset(), params.getLimit()) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@GET\n\t@Path(\"/search/{empName}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getByName(@PathParam(\"empName\") String name) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findByName(name)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@RequestMapping(value = \"/listEmployees\", method = RequestMethod.GET)\r\n\tpublic Employee employees() {\r\n System.out.println(\"---BEGIN\");\r\n List<Employee> allEmployees = employeeData.findAll();\r\n \r\n System.out.println(\"size of emp == \"+allEmployees.size());\r\n System.out.println(\"---END\");\r\n Employee oneEmployee = allEmployees.get(0);\r\n\t\treturn oneEmployee;\r\n }",
"@RequestMapping(value=\"/employee/{id}\", method = RequestMethod.GET)\npublic @ResponseBody Optional<Employee> findEmployeeRest(@PathVariable(\"id\") String id){\n\treturn employeerepository.findById(id);\n}",
"@GET\n @Path(\"/createEmployee/{empName}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String createEmployee(@PathParam(\"empName\") String empName){\n String output = \"\";\n try {\n Employee employee = new Employee();\n employee = EmployeeFacade.getInstance().createEmployee(empName);\n output = gson.toJson(employee);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@GetMapping(\"/all\")\n\tpublic ResponseEntity<List<Employee>> getAllEmployees() {\n\t\tList<Employee> list = service.getAllEmployees();\n\t\treturn new ResponseEntity<List<Employee>>(list, HttpStatus.OK);\n\t}",
"@RequestMapping(value = GET_ALL_EMPLOYEE_URL_API, method=RequestMethod.GET)\r\n public ResponseEntity<?> getAllEmployee() {\r\n\r\n checkLogin();\r\n\r\n return new ResponseEntity<>(employeeService.getAll(), HttpStatus.OK);\r\n }",
"@RequestMapping(value = \"/v2/employees\", method = RequestMethod.GET)\r\n\tpublic List<Employee> employeev2() {\r\n JPAQuery<?> query = new JPAQuery<Void>(em);\r\n QEmployee qemployee = QEmployee.employee;\r\n List<Employee> employees = (List<Employee>) query.from(qemployee).fetch();\r\n // Employee oneEmp = employees.get(0);\r\n\t\treturn employees;\r\n }",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> list() {\r\n\t return empService.listAll();\r\n\t}",
"@Path(\"/{educationId : \\\\d+}/employees\")\n public EmployeeResource getEmployeeResource() {\n return new EmployeeResource();\n }",
"@RestResource(path = \"lastname\")\n List<Employee> findAllByOrderByLastNameAsc();",
"@GetMapping(\"/employebyid/{empId}\")\n\t public ResponseEntity<Employee> getEmployeeById(@PathVariable int empId)\n\t {\n\t\tEmployee fetchedEmployee = employeeService.getEmployee(empId);\n\t\tif(fetchedEmployee.getEmpId()==0)\n\t\t{\n\t\t\tthrow new InvalidEmployeeException(\"No employee found with id= : \" + empId);\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn new ResponseEntity<Employee>(fetchedEmployee,HttpStatus.OK);\n\t\t}\n }",
"@GetMapping(value = {\"/{id}\", \"/{id}/\"})\n public ResponseEntity<Employee> loadEmployee(@NotBlank @PathVariable(\"id\") String id){\n Employee employee = employeeService.getEmployee(id);\n return new ResponseEntity<>(employee, HttpStatus.OK);\n }",
"@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}",
"@GET\n @Path(\"/eagerly\")\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployeesEagerly( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees eagerly for given education using \" +\n \"EducationResource.EmployeeResource.getEducatedEmployeesEagerly(educationId) method of REST API\" );\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<EmployeeWrapper> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees eagerly for given education filtered by given params\n employees = new ResourceList<>(\n EmployeeWrapper.wrap(\n employeeFacade.findByMultipleCriteriaEagerly(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n )\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees eagerly for given education without filtering (eventually paginated)\n employees = new ResourceList<>( EmployeeWrapper.wrap(employeeFacade.findByEducationEagerly(education, params.getOffset(), params.getLimit())) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@GetMapping(\"/employee/{id}\")\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Long id) {\n\t\t\n\t\tEmployee employee = emprepo.findById(id).orElseThrow(()-> new ResourceNotFoundException(\"Employee not exist with id: \" + id)); \n\t\t\n\t\treturn ResponseEntity.ok(employee);\n\t}",
"@GetMapping(\"/employee/{id}\")\n public Employee getEmployeeById(@PathVariable(value = \"id\") Integer id){\n\n Employee employee = employeeService.findEmployeeById(id);\n\n return employee;\n }",
"@GetMapping\n public List<Map<String, Object>> employee(){\n List<Map<String, Object>> test = jdbcTemplate.queryForList(\"select * from employee\");\n return test;\n }",
"@GET\n\t@Consumes(\"text/plain\")\n\t@Produces(\"application/json\")\n\t@Path(\"/get/{id}\")\n\tpublic Response getEmployee(@PathParam(\"id\") String id) {\n\t\tid = id.trim();\n\t\tif (bookedTickets.containsKey(id)) {\n\t\t\tMap<String, String> info = new HashMap<>();\n\t\t\tinfo = bookedTickets.get(id);\n\t\t\tTicket ticket = new Ticket();\n\t\t\tticket.setDate(info.get(\"date\"));\n\t\t\tticket.setFoodItems(info.get(\"foodItems\"));\n\t\t\tticket.setSeats(info.get(\"seats\"));\n\t\t\tticket.setShowTime(info.get(\"showTime\"));\n\t\t\tticket.setTheater(info.get(\"theater\"));\n\t\t\tticket.setTicketNo(info.get(\"ticketNo\"));\n\t\t\tticket.setTotalPrice(info.get(\"totalPrice\"));\n\t\t\t\n\t\n\t\t\treturn Response.ok(ticket).build();\n\t\t}\n\n\t\tMessage msg = new Message();\n\t\tmsg.setMessage(\"ID is not registered\");\n\t\treturn Response.ok(msg).build();\n\n\t}",
"@Test\r\n\tpublic void test_getAllEmployeesPage_notfound() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"6\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(404);\r\n\t}",
"@GetMapping(\"/{id}\")\n public Employee findById(@PathVariable(\"id\") Long id){\n return employeeService.findById(id);\n }",
"@ResponseBody\n\t@GetMapping(\"/employees\")\n\tpublic List<Employee> listEmployees() {\n\t\tList<Employee> theEmployees = employeeDAO.getEmployees();\n\t\t\n\t\treturn theEmployees;\n\t}",
"@GetMapping(\"/employee/{id}\")\r\n\tpublic Employee get(@PathVariable Integer id) {\r\n\t \r\n\t Employee employee = empService.get(id);\r\n\t return employee;\r\n\t \r\n\t}",
"@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<List<Enquiry>> getAll(@RequestParam(value = \"page\" , required = false) Integer offset,\n @RequestParam(value = \"per_page\", required = false) Integer limit)\n throws URISyntaxException {\n Page<Enquiry> page = enquiryRepository.findAll(PaginationUtil.generatePageRequest(offset, limit));\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/enquirys\", offset, limit);\n return new ResponseEntity<List<Enquiry>>(page.getContent(), headers, HttpStatus.OK);\n }",
"@Override\n\tpublic ResponseEntity<Collection<Employee>> findAll() {\n\t\treturn new ResponseEntity<Collection<Employee>>(empService.findAll(),HttpStatus.OK);\n\t}",
"public EmployeeResponse getById(int id) throws EmployeeNotFoundException {\n\n Optional<Employee> result=employeeRepository.findById(id);\n if (result.isPresent()){\n EmployeeResponse response=new EmployeeResponse();\n response.setId(result.get().getId());\n response.setName(result.get().getName());\n return response;\n }\n\n throw new EmployeeNotFoundException(\"Employee not found id=\"+id);\n// return response;\n }",
"@RequestMapping(value = \"/getAutoCompleteInfo\", method = RequestMethod.POST)\r\n public @ResponseBody String getAutoCompleteInfo(@RequestParam(\"employeeId\") String employeeId) {\r\n\r\n List<Integer> infolist = null;\r\n Pattern pattern = Pattern.compile(\"^[0-9]$\");\r\n Matcher matcher = pattern.matcher(employeeId);\r\n if (matcher.find()) {\r\n logger.info(\"Integer:\" + employeeId);\r\n logger.info(\"inside ReportGenerationController getAutoCompleteInfo()\");\r\n logger.info(\"received employee id: \" + employeeId);\r\n int empid = Integer.parseInt(employeeId);\r\n infolist = reportGenerationService.getAutoCompleteInfo(empid);\r\n logger.info(\"info list in controller:\" + infolist);\r\n\r\n return JsonUtility.convertToJson(infolist);\r\n } else {\r\n logger.info(\"String:\" + employeeId);\r\n List<String> data = reportGenerationService.getAutoCompleteInfo(employeeId);\r\n return JsonUtility.convertToJson(data);\r\n }\r\n }",
"@GetMapping(\"/getRE\")\n\tpublic List<EnquiryDetails> getDataRE()\n\t{\n\t\tString url=\"http://localhost:8083/getclient/getalldatafor_re\";\n\t\tList<EnquiryDetails> list=rt.getForObject(url, List.class);\n\t\tSystem.out.println(list);\n\t\treturn list;\n\t}",
"@Transactional(propagation = Propagation.REQUIRED)\n\tpublic String getEmployeeListJSON(){\n\t\tGson gson = new GsonBuilder()\n\t\t\t\t\t\t.setDateFormat(\"dd/MM/yyyy\")\n\t\t\t\t\t\t.create();\n\t\t String rtnString = gson.toJson(daoImpl.getEmployees());\n\t\t \n\t\t return rtnString;\n\t}",
"@Test\n\tpublic void get01() {\n\t\tResponse response = given().\n\t\t\t\t spec(spec02).\n\t\t\t\t when().\n\t\t\t\t get();\n\t\tresponse.prettyPrint();\n\t\t\n\t\tresponse.\n\t\t then().\n\t\t assertThat()\n\t\t .statusCode(200);\n\t\t\n\t\tJsonPath json = response.jsonPath();\n\t\tSoftAssert softAssert = new SoftAssert();\n\t\t\n\t//10 dan buyuk tum id leri console a yazdir.\n\t\tList<String> idList = json.getList(\"data.findAll{Integer.valueOf(it.id)>10}.id\");\n\t\tSystem.out.println(idList);\n\t\t\n\t//verify\n\t\tsoftAssert.assertEquals(idList.size(), 14, \"Eleman sayisi istenen gibi degil\");\n\t\t\n\t\n\t//30 dan kucuk tum yaslari console a yazdir\n\t\tList<String> ageList = json.getList(\"data.findAll{Integer.valueOf(it.employee_age)<30}.employee_age\");\n\t\tSystem.out.println(ageList);\n\t\t\n\t\t\n\t// Assert that maximum age is 23\n\t\tCollections.sort(ageList);\n\t\tsoftAssert.assertTrue(ageList.get(ageList.size()-1).equals(\"23\"), \"Yas istenen gibi degil\");\n\t\t\n\t\t\n\t//Print all employee names whose salaries are greater than 350000\n\t\tList<String> nameList = json.getList(\"data.findAll{Integer.valueOf(it.employee_salary)>350000}.employee_name\");\n\t\tSystem.out.println(nameList);\n\t\t\n\t\t\n\t//Assert that Charde Marshall is one of the employees whose salary is greater than 350000\t\n\t\tsoftAssert.assertTrue(nameList.contains(\"Charde Marshall\"));\n\t\t\n\t\t\n\t\t\n\t\tsoftAssert.assertAll();\n\t}",
"@Test\n\t@WithMockUser(username=\"admin\",roles={\"ADMIN\"})\n\tpublic void getAllEmployees_AuthorisedUser_ReturnsJsonOfEmployees() throws Exception\n\t{\n\t\tString result = this.mockMvc.perform(MockMvcRequestBuilders\n\t\t\t .get(\"/api/employees\")\n\t\t\t .contentType(MediaType.APPLICATION_JSON))\n\t\t\t\t .andDo(MockMvcResultHandlers.print())\n\t\t\t\t .andExpect(MockMvcResultMatchers.status().isOk())\n\t\t\t\t .andReturn()\n\t\t\t\t .getResponse()\n\t\t\t\t .getContentAsString();\n\t\t\n\t\t//Assert\n\t\tJSONObject json = new JSONObject(result);\t\n\t\t//the json returns in an object called \"_embedded\", which then has an array of accounts\n\t\tJSONObject embedded = (JSONObject) json.get(\"_embedded\");\n\t\tJSONArray employees = embedded.getJSONArray(\"employees\");\n\t\tassertTrue(employees.length() > 0);\n\t\t\n\t}",
"Collection<EmployeeDTO> getAll();",
"@GetMapping(\"/byCode/{empCode}\")\n\tpublic ResponseEntity<EmployeeMasterDetails> getByEmpCode(@PathVariable String empCode)\n\t{\n\t\treturn ResponseEntity.ok(employeeMasterService.findByCode(empCode)) ;\n\t}",
"@GET(API_ROUTE + \"/contactos-empleado/{emp_id}\")\n Call<List<Persona>> getContactsByEmployeeId(@Path(\"emp_id\") long emp_id);",
"@GET\n @Path(\"{id}\")\n @Produces({ \"application/json\" })\n public abstract Response find(@PathParam(\"id\") Long id);",
"@GetMapping(\"/external/{id}\")\n\t\t\t@JsonView(Views.External.class)\n\t\t\tpublic Optional<Employee> getEmployeeById(@PathVariable(\"id\") @Min(1) Long id) {\n\t\t\t\tSystem.out.println(\"id\"+id);\n\t\t\t\ttry {\n\t\t\t\t\treturn employeeService.getEmployeeById(id);\n\t\t\t\t} catch (UserNotFoundException e) {\n\t\t\t\t\tthrow new ResponseStatusException(HttpStatus.NOT_FOUND, e.getMessage());\n\t\t\t\t}\n\n\t\t\t}",
"@GetMapping(\"/employees/{id}\")\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Long id) {\n\t\tEmployee orElseThrow = repo.findById(id).orElseThrow(() -> new ResourceNotFoundException(\"Employee not exist with id \" + id));\n\t\treturn ResponseEntity.ok(orElseThrow);\n\t}",
"@GetMapping(\"/GetAllEmployees\")\r\n public List<Employee> viewAllEmployees() {\r\n return admin.viewAllEmployees();\r\n }",
"@Override\n\tpublic JSONObject getEmployeeById(String id) {\n\t\tJSONObject json=new JSONObject();;\n\t\tEmployeeDAO employeeDAO = DAOFactory.getEmployeeDAO();\n\t\ttry {\n\t\t\tEmployee employee=employeeDAO.findById(id);\n\t\t\tjson.put(\"name\", employee.getName());\n\t\t\tjson.put(\"id\", employee.getId());\n\t\t\tjson.put(\"job\", employee.getJobTitle());\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn json;\n\t}",
"@GetMapping(value=\"employee/{employeeId}\")\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable(\"employeeId\") int employeeId)\n\t{\n\t\treturn employeeService.getEmployeeById(employeeId);\n\t}",
"@GetMapping(\"/all\")\n public ResponseEntity<?> findAllData() {\n logger.info(\"Start controller call get All Data \");\n ServiceResult serviceResult = new ServiceResult();\n serviceResult.setMessage(\"Get All Data Success\");\n try {\n List<AdCampaign> lstAdCampaigns = adCampaignService.findAll();\n serviceResult.setData(lstAdCampaigns);\n serviceResult.setStatus(ServiceResult.Status.SUCCESS);\n }catch (Exception ex){\n logger.error(\"Error get All Data\");\n serviceResult.setMessage(\"Error\");\n serviceResult.setStatus(ServiceResult.Status.FAILED);\n }\n\n logger.info(\"End controller call get All Data \");\n return new ResponseEntity<ServiceResult>(serviceResult,new HttpHeaders(), HttpStatus.OK);\n }",
"@Test\n public void employeeGetsAllTransactionsWithOffsetAndLimitShouldReturnOk() throws Exception{\n mvc.perform(get(\"/transactions?offset=1&limit=4\")\n .header(\"ApiKeyAuth\", \"1234-abcd-5678-efgh\"))\n .andExpect(status().isOk());\n }",
"@GetMapping(\"/one/{id}\")\n\tpublic ResponseEntity<?> getOneEmployee(@PathVariable Integer id) {\n\t\tResponseEntity<?> response = null;\n\t\ttry {\n\t\t\tEmployee employee = service.getOneEmployee(id);\n\t\t\tresponse = new ResponseEntity<Employee>(employee, HttpStatus.OK); // 200\n\t\t} catch (EmployeeNotFoundException enfe) {\n\t\t\tthrow enfe;\n\t\t}\n\t\treturn response;\n\t}",
"@GET\n\t@Path(\"{id}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getEmployeeById(@PathParam(\"id\") String id) throws ParseException{\n\t\tString message = \"{}\";\n\t\t\n\t\tJSONObject employeesJsonObject = (JSONObject) parser.parse(getFileContent());\n\t\tJSONArray employeesArray = (JSONArray) employeesJsonObject.get(\"employee\");\n\t\tJSONObject employee;\n\t\t\n\t\t/*checking each employee*/\n\t\tfor ( int i = 0 ; i < employeesArray.size() ; i++ ){\n\t\t\temployee = ((JSONObject) employeesArray.get(i));\n\t\t\t\n\t\t\tif(employee.get(\"id\").toString().equalsIgnoreCase(id)){\n\t\t\t\tmessage = employee.toString();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn message;\n\t}",
"@RequestMapping(value=\"getEmploymentById\" , method={RequestMethod.GET})\r\n\tpublic ResponseEntity<JsonResponse<HrmsEmploymentMasterModel>> getEmploymentById(@RequestParam String id) \r\n\t{\r\n\t\tlogger.info(\"Method : getEmploymentById starts\");\r\n\t\t\r\n\t\tlogger.info(\"Method : getEmploymentById ends\");\r\n\t\t\r\n\t\treturn hrmEmploymentMasterDao.getEmploymentById(id);\r\n\t}",
"@GetMapping(\"/emloyees\")\n public List<Employee> all() {\n return employeeRepository.findAll();\n }",
"@Repository\n@RepositoryRestResource(path = \"employees\")\npublic interface EmployeeRepository extends JpaRepository<Employee, Long> {\n\n /**\n *Retrieve employees ordered be last name\n * With link /api/employees/search/lastname\n */\n @RestResource(path = \"lastname\")\n List<Employee> findAllByOrderByLastNameAsc();\n\n}",
"@RequestMapping(value = \"/instEmpEduQualis/currentLogin\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<InstEmpEduQuali> currentInstEmpEduQuali() throws Exception{\n // public List<InstEmpEduQuali> currentInstEmpEduQuali() {\n log.debug(\"REST request to get InstEmpSpouseInfo : {}\");\n //return instEmpEduQualiRepository.findAllByLogin();\n String userName = SecurityUtils.getCurrentUserLogin();\n InstEmployee instEmployeeresult=instEmployeeRepository.findOneByEmployeeCode(userName);\n List<InstEmpEduQuali> instEmpEduQualilist=null;\n /*if(instEmployeeresult !=null && instEmployeeresult.getId()>0){\n log.debug(\"--------------------------------employee result id\"+instEmployeeresult.getId());\n instEmpEduQualilist=rptJdbcDao.findListByInstEmployeeId(instEmployeeresult.getId());\n }\n if(instEmpEduQualilist !=null && instEmpEduQualilist.size()>0){\n return instEmpEduQualilist;\n }else{\n return new ArrayList<>();\n }*/\n log.debug(\"-------------userName---------\"+userName+\"----------employee result id\"+instEmployeeresult.getId());\n //return rptJdbcDao.findListByInstEmployeeId(instEmployeeresult.getId());\n instEmpEduQualilist=instEmpEduQualiRepository.findListByInstEmployeeId(instEmployeeresult.getId());\n /*for(InstEmpEduQuali instEmpEduQuali:instEmpEduQualilist){\n instEmpEduQuali.setCertificateCopy(AttachmentUtil.retriveAttachment(\"/backup/teacher_info/\",instEmpEduQuali.getCertificateCopyName()));\n instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName().substring(0, (instEmpEduQuali.getCertificateCopyName().length() - 17)));\n }*/\n for(InstEmpEduQuali instEmpEduQuali:instEmpEduQualilist){\n if(instEmpEduQuali.getCertificateCopyName()!=null){\n instEmpEduQuali.setCertificateCopy(AttachmentUtil.retriveAttachment(\"/backup/teacher_info/\",instEmpEduQuali.getCertificateCopyName()));\n //instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName().substring(0, (instEmpEduQuali.getCertificateCopyName().length() - 17)));\n instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName());\n }\n }\n return instEmpEduQualilist;\n\n }",
"com.example.nettyserver.protobuf.Employee.EmployeeInfo getEmployeelist();",
"public String getAPI()\n {\n ResponseEntity<String> person;\n\n /*\n\t\t * Headers for the response type if we want to return JSON response then we\n\t\t * require to add.\n */\n HttpHeaders headers = new HttpHeaders();\n\n /*\n\t\t * Adding of the response header with application/json type\n */\n headers.add(\"Accept\", \"application/json\");\n\n /*\n\t\t * Creation of the Entity object for the adding the headers into request.\n */\n entity = new HttpEntity<>(headers);\n\n /*\n\t\t * Creation of REST TEMPLET object for the executing of the REST calls.\n */\n restTemplate = new RestTemplate();\n\n /*\n\t\t * Adding the basic type of authentication on the REST TEMPLETE.\n */\n restTemplate.getInterceptors()\n .add(new BasicAuthorizationInterceptor(\"Administrator\", \"Oneeight@admin18\"));\n\n /*\n\t\t * Execution of the REST call with basic authentication and JSON response type\n */\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/login?username=Administrator&password=Oneeight@admin18\", HttpMethod.POST, entity, String.class);\n System.out.println(\"\"+person.toString());\n //headers.add(\"Cookie\", \"JSESSIONID=0FC37952D64B545C46969EFEC0E4FD12\");\n headers.add(\"Cookie\", person.getHeaders().getFirst(HttpHeaders.SET_COOKIE));\n entity = new HttpEntity<>(headers);\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/analytics/v1.0.0/data/provider/tenants/OneEight/features/SDWAN/?qt=summary&start-date=1daysAgo&end-date=today&q=linkusage(site)&metrics=volume-rx&metrics=volume-tx&metrics=volume-rx&metrics=volume-tx&metrics=bandwidth&ds=aggregate&count=10\", HttpMethod.GET, entity, String.class);\n\n /*\n\t\t * Returning the response body with string format that easily readable.\n */\n return person.getBody();\n }",
"@Test\n public void test1() throws JsonProcessingException {\n JSONObject payload = getJsonObject(PAYLOAD_BASEPATH + \"saveEmployee.json\");\n\n payload.put(\"email\", RandomUtils.generateRandomString(5).concat(\"@gmail.com\"));\n payload.put(\"status\", fetchDataFromDataFile(\"service1Data\", \"createUser\", \"Value2\"));\n payload.put(\"name\", fetchDataFromDataFile(\"service1Data\", \"createUser\", \"Value3\"));\n payload.put(\"gender\", fetchDataFromDataFile(\"service1Data\", \"createUser\", \"Value4\"));\n\n log.info(\"api request is {} \", payload);\n Response response = given().headers(\"Authorization\", \"Bearer e85170d9b952bb8a12603f87d6c8f525946b4906c311b83eeec703bd0c1cbea0\").filter(new ErrorLoggingFilter(errorCapture)).contentType(ContentType.JSON).body(payload.toString()).log().everything().when().post(Constants.BASEPATH.concat(Constants.CREATE_USER));\n verifyStatusCode(response);\n verifyResponseBody(response, \"201\");\n// dbAssist.responseValidation(response);\n log.error(\"hey {} \", errorWriter.toString().toUpperCase());\n log.info(\"response is {}\", response.prettyPrint());\n }",
"@Test\n\tpublic void postCallMethod() throws JsonGenerationException, JsonMappingException, IOException {\n\t\tpostMethod = new RestClient();\n\n\t\t// Header Value to Pass with GET Method (URI is already ready in before Method)\n\t\tHashMap<String, String> header = new HashMap<String, String>();\n\t\theader.put(\"Content-Type\", \"application/json\");\n\n\t\t// Create Java Object (POJO) in which data is stored\n\t\tString name = \"Manish\" + TestUtil.getCurrentDateTimeStamp();\n\t\tSystem.out.println(\"Name: \" + name);\n\t\tEmployee employee = new Employee(name, \"10000\", \"25\", null);\n\n\t\t// Convert POJO into JSON Object\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.writeValue(new File(System.getProperty(\"user.dir\") + \"/src/main/java/employee.json\"), employee);\n\n\t\t// java Object to JSON in string (Marshelling)\n\t\tString usersJsonString = mapper.writeValueAsString(employee);\n\n\t\t// POST method is called using URI,JSON body and headers and response is saved\n\t\t// in variable\n\t\tresponseUnderPostRequest = postMethod.post(URI, usersJsonString, header);\n\n\t\t// Output of POST call\n\t\t// Validation part (For POST method output is 1.StatusCode,2.Response\n\t\t// JSON,3.Header)\n\t\t// 1. Retrieve Response Status Code and Assert it\n\t\tint StatusCode = responseUnderPostRequest.getStatusLine().getStatusCode();\n\t\tAssert.assertEquals(StatusCode, RESPONSE_STATUS_CODE_200);\n\n\t\t// 2.Retrieve Response JSON Object as a String\n\t\tString jsonString = EntityUtils.toString(responseUnderPostRequest.getEntity(), \"UTF-8\");\n\n\t\t/*\n\t\t * JSONObject jsonObject=new JSONObject(jsonString);\n\t\t * System.out.println(jsonObject);\n\t\t */\n\n\t\t// Convert JSON Object to java object POJO (Unmarshelling) and Assert with\n\t\t// Previous JAVA Object POJO\n\t\tEmployee responseUser = mapper.readValue(jsonString, Employee.class);\n\t\tAssert.assertTrue(responseUser.getName().equals(employee.getName()));\n\t}",
"@GetMapping(\"/findAllEmployees\")\n\tpublic List<Employee> getAll() {\n\t\treturn testService.getAll();\n\t}",
"@WebMethod\n public List<Employee> getEmployeesInSpecificDepartment(@WebParam(name = \"arg0\") int dep_id) {\n Connection conn = null;\n List<Employee> emplyeeList = new ArrayList<Employee>();\n try {\n conn = EmpDBUtil.getConnection();\n PreparedStatement pStmt = conn.prepareStatement(\"select * from EMPLOYEES where DEPARTMENT_ID = ?\");\n pStmt.setInt(1, dep_id);\n ResultSet rSet = pStmt.executeQuery();\n while (rSet.next()) {\n Employee emp = new Employee();\n emp.setEmployee_id(rSet.getInt(\"EMPLOYEE_ID\"));\n emp.setFirst_name(rSet.getString(\"FIRST_NAME\"));\n emp.setLast_name(rSet.getString(\"LAST_NAME\"));\n emp.setEmail(rSet.getString(\"EMAIL\"));\n emp.setPhone_number(rSet.getString(\"PHONE_NUMBER\"));\n emp.setHire_date(rSet.getDate(\"HIRE_DATE\"));\n emp.setJop_id(rSet.getString(\"JOB_ID\"));\n emp.setSalary(rSet.getInt(\"SALARY\"));\n emp.setCommission_pct(rSet.getDouble(\"COMMISSION_PCT\"));\n emp.setManager_id(rSet.getInt(\"MANAGER_ID\"));\n emp.setDepartment_id(rSet.getInt(\"DEPARTMENT_ID\"));\n\n emplyeeList.add(emp);\n \n }\n \n System.out.println(\"done\");\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n EmpDBUtil.closeConnection(conn);\n }\n\n return emplyeeList;\n }"
] | [
"0.6905297",
"0.6888476",
"0.6884345",
"0.6857931",
"0.68423903",
"0.68148714",
"0.6761119",
"0.6737498",
"0.6679911",
"0.6677763",
"0.6651389",
"0.66389287",
"0.66243374",
"0.6623981",
"0.6609253",
"0.66083014",
"0.6600162",
"0.6569802",
"0.65244037",
"0.6511194",
"0.64402586",
"0.64242274",
"0.63436776",
"0.63413346",
"0.63387936",
"0.63146776",
"0.6314282",
"0.6313314",
"0.63102335",
"0.6308052",
"0.6305749",
"0.63017946",
"0.6301335",
"0.62890553",
"0.62841976",
"0.62477416",
"0.6237376",
"0.62365866",
"0.62305516",
"0.6214382",
"0.6198548",
"0.6187379",
"0.61747336",
"0.61701876",
"0.61655396",
"0.610233",
"0.60980093",
"0.6090092",
"0.60570484",
"0.604376",
"0.6035092",
"0.6032196",
"0.601926",
"0.6016779",
"0.6016154",
"0.60093725",
"0.59938645",
"0.5988007",
"0.5987203",
"0.5979412",
"0.5954327",
"0.59329665",
"0.59271103",
"0.59229016",
"0.59196186",
"0.59028417",
"0.5896326",
"0.58834696",
"0.58788776",
"0.58755445",
"0.5855113",
"0.58429515",
"0.58380604",
"0.58159876",
"0.5784709",
"0.5783148",
"0.57822204",
"0.57782614",
"0.5776912",
"0.57737243",
"0.5771153",
"0.57669854",
"0.576451",
"0.5760785",
"0.57550895",
"0.57456875",
"0.57406014",
"0.5731637",
"0.57295877",
"0.5713674",
"0.57058334",
"0.57017666",
"0.56776434",
"0.56775945",
"0.5675509",
"0.5656859",
"0.56561244",
"0.5656123",
"0.5648377",
"0.56297445"
] | 0.6562907 | 18 |
================================JSON PATH ==================== / Given Accept type is JSON And Params are limit=100 And Path param is 110 When I send a GET request to employees Then status code is 200 And Response content should be json And following data should be return "employee_id": 110, "first_name" "john", "last_name":"Chen", "email":"JCHEN", | @Test
public void testWithJsonPath() {
Response response = given().accept(ContentType.JSON)
.and().pathParam("id", 110)
.when().get(ConfigurationReader.getProperty("hrapp.baseurl")+"/employees/{id}");
JsonPath json = response.jsonPath(); //get json body and assign to jsonPath object
//we are assiging whole response to json object so we can easyly reach and use it
System.out.println(json.getInt("employee_id"));
System.out.println(json.getString("first_name"));
System.out.println(json.getString("job_id"));
System.out.println(json.getInt("salary"));
System.out.println(json.getString("links[0].href")); //get specific element from array
//assign all hrefs into a list of strings
List<String> hrefs = json.getList("links.href");
//everything in arraylist
System.out.println(hrefs);
//one by one
for(String href:hrefs) {
System.out.println(href);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test \n\tpublic void testJsonPathWithLists() {\n\t\n\t\tMap<String,Integer> requestParamMaps=new HashMap<>();\n\t\t requestParamMaps.put(\"limit\", 100);\n\t\t\n\t\t\tResponse response = given().accept(ContentType.JSON).and().params(requestParamMaps)\n\t\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/\");\n\t\t\t\n\t\t\tassertEquals(response.statusCode(), 200);\n\t\t\t\n\t\t\tJsonPath json = response.jsonPath();\n\t\t\t//get all employee ids into arratlist\n\t\t\tList<Integer> empIDs = json.getList(\"items.employee_id\");\n\t\t\tSystem.out.println(empIDs);\n\t\t\t//assert that there are 100 emp ids\n\t\t\tassertEquals(empIDs.size(), 100);\n\t\t\t\n\t\t\t//get all emails and assign in list \n\t\t\tList<String> emails = json.getList(\"items.email\");\n\t\t\t\n\t\t\tassertEquals(emails.size(), 100);\n\t\t\t\n\t\t\t//get all employee ids that are greater than 150\n\t\t\tList<Integer> empIdList = json.getList(\"items.findAll{it.employee_id > 150}.employee_id\");\n\t\t\tSystem.out.println(empIdList);\n\t\t\t\n\t\t\t//get all employee lastnames, whose salary is more than 7000\n\t\t\t\n\t\t\tList<String> lastNames = json.getList(\"items.findAll{it.salary > 7000}.last_name\");\n\t\t\tSystem.out.println(lastNames);\n\t}",
"@GET\n @Path(\"/getEmployeeById/{empId}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeById(@PathParam(\"empId\") String empId){\n String output = \"\";\n try {\n Employee employee = new Employee();\n employee = EmployeeFacade.getInstance().getEmployeeById(empId);\n output = gson.toJson(employee);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@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 }",
"@Test\n public void testWithJsonPath(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n //we are getting the response and assigning it to this variable\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .and().pathParams(\"employee_id\", 177) //path param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\");\n\n //here we are saying get json body and assign it yo jsonpath object\n JsonPath json = response.jsonPath();\n\n System.out.println(json.getInt(\"employee_id\"));\n System.out.println(json.getString(\"last_name\"));\n System.out.println(json.getString(\"job_id\"));\n System.out.println(json.getInt(\"salary\"));\n //we put index to links, because links is an array, but href is just a value of the array\n System.out.println(json.getString(\"links[0].href\")); //to get only the first link\n //we use upper statement to get specific element from array\n\n //assign all href into a List of strings\n List<String> hrefs = json.getList(\"links.href\");\n System.out.println(hrefs);\n }",
"@Test\n public void testJsonPathWithLists(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\");\n\n Assert.assertEquals(response.statusCode(),200); //to check status code\n\n //First way to use JsonPath\n JsonPath json = response.jsonPath();\n\n //Second way\n //JsonPath json = new JsonPath(response.asString());\n\n //Third way\n //JsonPath json = new JsonPath(new File(FilePath.json));\n\n //get all employee ids into ArrayList\n List<Integer> empIds = json.getList(\"items.employee_id\");\n System.out.println(empIds);\n //assert that there are 100 employee ids\n Assert.assertEquals(empIds.size(), 100);\n\n //get all employee emails and assign into ArrayList\n List<String> empEmails = json.getList(\"items.email\");\n System.out.println(empEmails);\n Assert.assertEquals(empEmails.size(), 100);\n\n //get all employee ids that are greater than 150\n List<Integer> empIdsMoreThan150 = json.getList(\"items.findAll{it.employee_id>150}.employee_id\");\n System.out.println(empIdsMoreThan150);\n\n //get all employees last name whose salary > 15000\n List<String> empSalaryMoreThan7000 = json.getList(\"items.findAll{it.salary>15000}.last_name\");\n System.out.println(empSalaryMoreThan7000);\n\n //get data from saved JSON file\n JsonPath jsonFromFile = new JsonPath(new File(\"/Users/asselkassymbekova/Desktop/employees.json\"));\n List<String> empEmails1 = jsonFromFile.getList(\"items.email\");\n System.out.println(empEmails1);\n\n }",
"@GET\n @Path(\"/getEmployeeByName/{empName}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeByName(@PathParam(\"empName\") String empName){\n String output = \"\";\n try {\n Map<String, Employee> employeeMap = new HashMap<String, Employee>();\n employeeMap = EmployeeFacade.getInstance().getEmployeeByName(empName);\n output = gson.toJson(employeeMap);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getAllEmployees(){\n\t\tString employeesJsonString = getFileContent();\n\t\treturn employeesJsonString;\n\t}",
"@GET\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGetbyId(@PathParam(\"id\") String id) {\n Gson gson = GSONFactory.getInstance();\n Employee employee = getEmployeeById(id);\n\n if (employee == null) {\n Response response = Response.status(404).build();\n return response;\n } else {\n String jsonOutput = gson.toJson(employee);\n Response response = Response.ok().entity(jsonOutput).build();\n return response;\n }\n }",
"@Test\r\n\tpublic void test_getAllEmployees() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t// .pathParam(\"page\", \"0\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(0))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}",
"@Test\r\n\tpublic void test_getEmployeeById() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"id\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employee\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200);\r\n\t}",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getEmployee( @NotNull(message = \"Employee ID cannnot be null\")\n @QueryParam(\"empId\") String empId) {\n return null;\n }",
"@GET\n\t@Path(\"{empID}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getById(@PathParam(\"empID\") int id) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findById(id)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@GetMapping(\"/get_all_employees\")\n public String getAllEmployees(){\n\n Gson gsonBuilder = new GsonBuilder().create();\n List<Employee> initial_employee_list = employeeService.get_all_employees();\n String jsonFromJavaArray = gsonBuilder.toJson(initial_employee_list);\n\n return jsonFromJavaArray;\n }",
"@Test\n\tpublic void testWithPathParameters() {\n\t\tgiven().accept(ContentType.JSON).and().params(\"limit\",100)\n\t\t.and().pathParams(\"id\", 110)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/{id}\") //when we send e request this id will be replaced with 110\n\t\t.then().statusCode(200)\n\t\t.and().assertThat().contentType(ContentType.JSON)\n\t\t.and().body(\"employee_id\", equalTo(110),\n\t\t\t\t\"first_name\",equalTo(\"John\"),\n\t\t\t\t\"last_name\",equalTo(\"Chen\"),\n\t\t\t\t\"email\",equalTo(\"JCHEN\"));\n\t\t\n\t}",
"@RequestMapping(\"/get\")\n public ResponseEntity<ResponseDTO> getEmployeePayrollData() {\n List<EmployeePayrollData> empDataList ;\n empDataList = employeePayrollService.getEmployeePayrollData();\n ResponseDTO responseDTO = new ResponseDTO(\"Get Call Success\", empDataList);\n log.info(\"get all data\");\n return new ResponseEntity<>(responseDTO, HttpStatus.OK);\n\n }",
"@Test //make sure it comes from testNG\n public void testWithQueryParameterAndList(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"items.employee_id\", hasSize(100));\n }",
"@Test\n public void testWithPathParameters(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .and().pathParams(\"employee_id\", 110)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"employee_id\", equalTo(110),\n \"first_name\", equalTo(\"John\"),\n \"last_name\", equalTo(\"Chen\"),\n \"email\", equalTo(\"JCHEN\") );\n }",
"@Test\n\tpublic void testWithQueryParametersAndList() {\n\t\tgiven().accept(ContentType.JSON)\n\t\t.and().params(\"limit\",100)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees\")\n\t\t.then().assertThat().statusCode(200)\n\t\t.and().contentType(ContentType.JSON)\n\t\t.and().assertThat().body(\"items.employee_id\", hasSize(100));\n\t\t\n\t}",
"@Test\n //1. adim URL i olusturmak\n public void get01(){\n spec03.pathParam(\"employeePath\",\"employees\");\n\n // 2. adim test datalarini olusturmak\n\n // 3. adim Request olusturma\n Response response = given().\n spec(spec03).\n when().\n get(\"/{employeePath}\");\n // response.prettyPrint();\n // 1. yol EqualTo-- Body ile assert ediyoruz\n response.\n then().\n assertThat().\n statusCode(200).\n body(\"data.employee_name[4]\",equalTo(\"Airi Satou\"),\n \"data[5].employee_salary\",equalTo(\"372000\"),\n \"data.id\",hasSize(24),\n \"data.employee_name\",hasItem(\"Rhona Davidson\"),\n \"data.employee_age\",hasItems(\"21\", \"23\", \"61\"));\n\n // 2. yol Hard Assertion\n // JsonPath ile\n JsonPath json = response.jsonPath();\n Assert.assertEquals(\"Airi Satou\",json.getString(\"data.employee_name[4]\"));\n Assert.assertEquals(\"372000\",json.getString(\"data[5].employee_salary\"));\n // System.out.println(json.getList(\"data.id\"));\n Assert.assertEquals(24,json.getList(\"data.id\").size());\n // System.out.println(json.getList(\"data.employee_name\"));\n Assert.assertTrue(json.getList(\"data.employee_name\").contains(\"Rhona Davidson\"));\n\n List<String> yasListesi = new ArrayList<>();\n yasListesi.add(\"21\");\n yasListesi.add(\"23\");\n yasListesi.add(\"61\");\n Assert.assertTrue(json.getList(\"data.employee_age\").containsAll(yasListesi));\n\n\n\n }",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAll() {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findAll()) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@GetMapping(\"/all\")\n public ResponseEntity responseAllEmployees(){\n return new ResponseEntity<>(hr_service.getAllEmployees(), HttpStatus.OK);\n }",
"@RequestMapping(value = \"/employees\")\n\tpublic String getAllEmployess(@RequestParam String user,HttpServletRequest request,HttpServletResponse response,Model mv) throws JsonMappingException, JsonProcessingException\n\t{\n\t\tList<Employee> empList = RestCalls.getAllEmployees();\n\t\tmv.addAttribute(\"empList\",empList);\n\t\tmv.addAttribute(\"auth\", \"true\");\n\t\tmv.addAttribute(\"user\", user);\n\t\treturn \"employeedetails.jsp\";\n\t}",
"@ApiOperation(value = \"getEmployeeByPagination controller method\")\r\n\t@GetMapping(\"/getEmployeeByPagination/{maxPage}/{ofset}\")\r\n\tpublic ResponseEntity<List<Employee>> getAllEmployeesByPagination(@PathVariable String maxPage,@PathVariable String ofset)\r\n\t{\r\n\t\tLog.info(\" Employee Controller Triggerd\");\r\n\t\tList<Employee> employees=employeeService.getAllEmployeesByPagination(maxPage, ofset);\r\n\t\treturn new ResponseEntity<List<Employee>>(employees,HttpStatus.OK);\r\n\t}",
"@GET\n @Path(\"/createEmployee/{empName}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String createEmployee(@PathParam(\"empName\") String empName){\n String output = \"\";\n try {\n Employee employee = new Employee();\n employee = EmployeeFacade.getInstance().createEmployee(empName);\n output = gson.toJson(employee);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@RequestMapping(value=\"/employees/all\", method = RequestMethod.GET)\npublic @ResponseBody List<Employee> employeeListRest(){\n\treturn (List<Employee>) employeerepository.findAll();\n}",
"@RequestMapping(value = \"/getAllEmployees\", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })\r\n\tpublic List<Employee> getAllEmpoyees(){\r\n\t\treturn repository.getAllEmpoyees();\r\n\t}",
"@GetMapping(\"/getEmployees\")\n\t@ResponseBody\n\tpublic List<Employee> getAllEmployees(){\n\t\treturn employeeService.getEmployees();\n\t}",
"@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }",
"private String getEmployees() {\n\n String uri = new String(\"http://\" + mRESTServer.getHost() +\n mRESTServer.getContextPath());\n try {\n String result = restTemplate.getForObject(uri, String.class);\n\n System.out.println(result);\n return result+\": (\"+uri+\")\";\n\n } catch (HttpClientErrorException e) {\n /**\n *\n * If we get a HTTP Exception display the error message\n */\n log.error(\"error: \" + e.getResponseBodyAsString());\n\n ObjectMapper mapper = new ObjectMapper();\n ErrorHolder eh = null;\n try {\n eh = mapper.readValue(e.getResponseBodyAsString(), ErrorHolder.class);\n } catch (IOException ignored) {\n }\n\n log.error(\"error: \" + eh.getErrorMessage());\n\n } catch (Exception e) {\n log.error(\"error: \" + e.getMessage());\n\n }\n\n return null;\n }",
"@GetMapping(\"/employee/{id}\")\r\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Long id)\r\n\t{\r\n\t\tEmployee emp=empdao.findOne(id);\r\n\t\tif(emp == null)\r\n\t\t{\r\n\t\treturn ResponseEntity.notFound().build();\r\n\t\t}\r\n\t\treturn ResponseEntity.ok().body(emp);\r\n\t}",
"@GetMapping(value = \"/allEmployees/header\", headers =\"X-API-VERSION=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddHdr(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GetMapping(value = \"/allEmployees/produces\", produces =\"Application/vnd.company.app-v1+json\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddProd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"public ResponseEntity<List<Employee>> getAllEmployees() {\n \tList<Employee> emplist=empService.getAllEmployees();\n\t\t\n\t\tif(emplist==null) {\n\t\t\tthrow new ResourceNotFoundException(\"No Employee Details found\");\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<>(emplist,HttpStatus.OK);\t\t\n }",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> getEmployees(){\r\n\t\t\r\n\t\treturn employeeService.getEmployees();\r\n\t\t\r\n\t}",
"@RequestMapping(value=\"/employee/{id}\", method = RequestMethod.GET)\npublic @ResponseBody Optional<Employee> findEmployeeRest(@PathVariable(\"id\") String id){\n\treturn employeerepository.findById(id);\n}",
"@GetMapping(\"/one/{id}\")\n\tpublic ResponseEntity<?> fetchOneData(@PathVariable(\"id\") Integer id) {\n\t\tResponseEntity<?> res = null;\n\t\ttry {\n\t\t\tEmployee emp = service.getOneEmpObject(id);\n\t\t\tres = new ResponseEntity<Employee>(emp, HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\tres = new ResponseEntity<String>(\"Unable Featch Data \", HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn res;\n\t}",
"@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}",
"@Path(\"/{educationId : \\\\d+}/employees\")\n public EmployeeResource getEmployeeResource() {\n return new EmployeeResource();\n }",
"@GetMapping(\"v1/allEmployees\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterVer(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GetMapping(value=\"/searchEmpData/{fname}\")\n\tpublic List<Employee> getEmployeeByName(@PathVariable (value = \"fname\") String fname)\n\t{\n\t\treturn integrationClient.getEmployees(fname);\n\t}",
"@GetMapping(value = \"allEmployees/param\", params =\"version=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAdd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GetMapping(\"/getoffer/{empId}\")\n\t public ResponseEntity<List<Offer>> getAllOffers(@PathVariable int empId)\n\t {\n\t\t List<Offer> fetchedOffers=employeeService.getAllOffers(empId);\n\t\t if(fetchedOffers.isEmpty())\n\t\t {\n\t\t\t throw new InvalidEmployeeException(\"No Employee found with id= : \" + empId);\n\t\t }\n\t\t else\n\t\t {\n\t\t\t return new ResponseEntity<List<Offer>>(fetchedOffers,HttpStatus.OK);\n\t\t }\n\t }",
"@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}",
"@GET\n\t@Path(\"/search/{empName}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getByName(@PathParam(\"empName\") String name) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findByName(name)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@RequestMapping(value = \"/employeesList\", method = RequestMethod.GET, produces = {\"application/xml\", \"application/json\" })\n\t@ResponseStatus(HttpStatus.OK)\n\tpublic @ResponseBody\n\tEmployeeListVO getListOfAllEmployees() {\n\t\tlog.info(\"ENTERING METHOD :: getListOfAllEmployees\");\n\t\t\n\t\tList<EmployeeVO> employeeVOs = employeeService.getListOfAllEmployees();\n\t\tEmployeeListVO employeeListVO = null;\n\t\tStatusVO statusVO = new StatusVO();\n\t\t\n\t\tif(employeeVOs.size()!=0){\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_0);\n\t\t\tstatusVO.setMessage(AccountantConstants.SUCCESS);\n\t\t}else{\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_1);\n\t\t\tstatusVO.setMessage(AccountantConstants.NO_RECORDS_FOUND);\n\t\t}\n\t\t\n\t\temployeeListVO = new EmployeeListVO(employeeVOs, statusVO);\n\t\t\n\t\tlog.info(\"EXITING METHOD :: getListOfAllEmployees\");\n\t\treturn employeeListVO;\n\t}",
"@RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();",
"public List<EmployeeDto> retrieveEmployees();",
"public EmployeeDto getEmployee(Long employeeId) throws ApiDemoBusinessException;",
"@Test\r\n\tpublic void test_getAllEmployeesPage2() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(2))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}",
"@GetMapping(value=\"/employes\")\n\tpublic List<Employee> getEmployeeDetails(){\n\t\t\n\t\tList<Employee> employeeList = employeeService.fetchEmployeeDetails();\n\t\treturn employeeList;\t\t\t\t\t\t\n\t}",
"@RequestMapping(value = \"/listEmployees\", method = RequestMethod.GET)\r\n\tpublic Employee employees() {\r\n System.out.println(\"---BEGIN\");\r\n List<Employee> allEmployees = employeeData.findAll();\r\n \r\n System.out.println(\"size of emp == \"+allEmployees.size());\r\n System.out.println(\"---END\");\r\n Employee oneEmployee = allEmployees.get(0);\r\n\t\treturn oneEmployee;\r\n }",
"@Transactional(propagation = Propagation.REQUIRED)\n\tpublic String getEmployeeListJSON(){\n\t\tGson gson = new GsonBuilder()\n\t\t\t\t\t\t.setDateFormat(\"dd/MM/yyyy\")\n\t\t\t\t\t\t.create();\n\t\t String rtnString = gson.toJson(daoImpl.getEmployees());\n\t\t \n\t\t return rtnString;\n\t}",
"@GET\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployees( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees for given education using EducationResource.EmployeeResource.getEducatedEmployees(educationId) method of REST API\");\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<Employee> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees for given education filtered by given params\n employees = new ResourceList<>(\n employeeFacade.findByMultipleCriteria(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees for given education without filtering (eventually paginated)\n employees = new ResourceList<>( employeeFacade.findByEducation(education, params.getOffset(), params.getLimit()) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@Override\n\tpublic JSONObject getEmployeeById(String id) {\n\t\tJSONObject json=new JSONObject();;\n\t\tEmployeeDAO employeeDAO = DAOFactory.getEmployeeDAO();\n\t\ttry {\n\t\t\tEmployee employee=employeeDAO.findById(id);\n\t\t\tjson.put(\"name\", employee.getName());\n\t\t\tjson.put(\"id\", employee.getId());\n\t\t\tjson.put(\"job\", employee.getJobTitle());\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn json;\n\t}",
"@GetMapping(\"/employebyid/{empId}\")\n\t public ResponseEntity<Employee> getEmployeeById(@PathVariable int empId)\n\t {\n\t\tEmployee fetchedEmployee = employeeService.getEmployee(empId);\n\t\tif(fetchedEmployee.getEmpId()==0)\n\t\t{\n\t\t\tthrow new InvalidEmployeeException(\"No employee found with id= : \" + empId);\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn new ResponseEntity<Employee>(fetchedEmployee,HttpStatus.OK);\n\t\t}\n }",
"@RestResource(path = \"lastname\")\n List<Employee> findAllByOrderByLastNameAsc();",
"@RequestMapping(value = GET_ALL_EMPLOYEE_URL_API, method=RequestMethod.GET)\r\n public ResponseEntity<?> getAllEmployee() {\r\n\r\n checkLogin();\r\n\r\n return new ResponseEntity<>(employeeService.getAll(), HttpStatus.OK);\r\n }",
"@RequestMapping(value = \"/v2/employees\", method = RequestMethod.GET)\r\n\tpublic List<Employee> employeev2() {\r\n JPAQuery<?> query = new JPAQuery<Void>(em);\r\n QEmployee qemployee = QEmployee.employee;\r\n List<Employee> employees = (List<Employee>) query.from(qemployee).fetch();\r\n // Employee oneEmp = employees.get(0);\r\n\t\treturn employees;\r\n }",
"@ResponseBody\n\t@GetMapping(\"/employees\")\n\tpublic List<Employee> listEmployees() {\n\t\tList<Employee> theEmployees = employeeDAO.getEmployees();\n\t\t\n\t\treturn theEmployees;\n\t}",
"@GET\n\t@Consumes(\"text/plain\")\n\t@Produces(\"application/json\")\n\t@Path(\"/get/{id}\")\n\tpublic Response getEmployee(@PathParam(\"id\") String id) {\n\t\tid = id.trim();\n\t\tif (bookedTickets.containsKey(id)) {\n\t\t\tMap<String, String> info = new HashMap<>();\n\t\t\tinfo = bookedTickets.get(id);\n\t\t\tTicket ticket = new Ticket();\n\t\t\tticket.setDate(info.get(\"date\"));\n\t\t\tticket.setFoodItems(info.get(\"foodItems\"));\n\t\t\tticket.setSeats(info.get(\"seats\"));\n\t\t\tticket.setShowTime(info.get(\"showTime\"));\n\t\t\tticket.setTheater(info.get(\"theater\"));\n\t\t\tticket.setTicketNo(info.get(\"ticketNo\"));\n\t\t\tticket.setTotalPrice(info.get(\"totalPrice\"));\n\t\t\t\n\t\n\t\t\treturn Response.ok(ticket).build();\n\t\t}\n\n\t\tMessage msg = new Message();\n\t\tmsg.setMessage(\"ID is not registered\");\n\t\treturn Response.ok(msg).build();\n\n\t}",
"@GET\n\t@Path(\"{id}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getEmployeeById(@PathParam(\"id\") String id) throws ParseException{\n\t\tString message = \"{}\";\n\t\t\n\t\tJSONObject employeesJsonObject = (JSONObject) parser.parse(getFileContent());\n\t\tJSONArray employeesArray = (JSONArray) employeesJsonObject.get(\"employee\");\n\t\tJSONObject employee;\n\t\t\n\t\t/*checking each employee*/\n\t\tfor ( int i = 0 ; i < employeesArray.size() ; i++ ){\n\t\t\temployee = ((JSONObject) employeesArray.get(i));\n\t\t\t\n\t\t\tif(employee.get(\"id\").toString().equalsIgnoreCase(id)){\n\t\t\t\tmessage = employee.toString();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn message;\n\t}",
"@GetMapping(value = {\"/{id}\", \"/{id}/\"})\n public ResponseEntity<Employee> loadEmployee(@NotBlank @PathVariable(\"id\") String id){\n Employee employee = employeeService.getEmployee(id);\n return new ResponseEntity<>(employee, HttpStatus.OK);\n }",
"@RequestMapping(value = \"/getAutoCompleteInfo\", method = RequestMethod.POST)\r\n public @ResponseBody String getAutoCompleteInfo(@RequestParam(\"employeeId\") String employeeId) {\r\n\r\n List<Integer> infolist = null;\r\n Pattern pattern = Pattern.compile(\"^[0-9]$\");\r\n Matcher matcher = pattern.matcher(employeeId);\r\n if (matcher.find()) {\r\n logger.info(\"Integer:\" + employeeId);\r\n logger.info(\"inside ReportGenerationController getAutoCompleteInfo()\");\r\n logger.info(\"received employee id: \" + employeeId);\r\n int empid = Integer.parseInt(employeeId);\r\n infolist = reportGenerationService.getAutoCompleteInfo(empid);\r\n logger.info(\"info list in controller:\" + infolist);\r\n\r\n return JsonUtility.convertToJson(infolist);\r\n } else {\r\n logger.info(\"String:\" + employeeId);\r\n List<String> data = reportGenerationService.getAutoCompleteInfo(employeeId);\r\n return JsonUtility.convertToJson(data);\r\n }\r\n }",
"@Test\n\t@WithMockUser(username=\"admin\",roles={\"ADMIN\"})\n\tpublic void getAllEmployees_AuthorisedUser_ReturnsJsonOfEmployees() throws Exception\n\t{\n\t\tString result = this.mockMvc.perform(MockMvcRequestBuilders\n\t\t\t .get(\"/api/employees\")\n\t\t\t .contentType(MediaType.APPLICATION_JSON))\n\t\t\t\t .andDo(MockMvcResultHandlers.print())\n\t\t\t\t .andExpect(MockMvcResultMatchers.status().isOk())\n\t\t\t\t .andReturn()\n\t\t\t\t .getResponse()\n\t\t\t\t .getContentAsString();\n\t\t\n\t\t//Assert\n\t\tJSONObject json = new JSONObject(result);\t\n\t\t//the json returns in an object called \"_embedded\", which then has an array of accounts\n\t\tJSONObject embedded = (JSONObject) json.get(\"_embedded\");\n\t\tJSONArray employees = embedded.getJSONArray(\"employees\");\n\t\tassertTrue(employees.length() > 0);\n\t\t\n\t}",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> list() {\r\n\t return empService.listAll();\r\n\t}",
"@GetMapping(\"/all\")\n\tpublic ResponseEntity<List<Employee>> getAllEmployees() {\n\t\tList<Employee> list = service.getAllEmployees();\n\t\treturn new ResponseEntity<List<Employee>>(list, HttpStatus.OK);\n\t}",
"@GetMapping(\"/external/{id}\")\n\t\t\t@JsonView(Views.External.class)\n\t\t\tpublic Optional<Employee> getEmployeeById(@PathVariable(\"id\") @Min(1) Long id) {\n\t\t\t\tSystem.out.println(\"id\"+id);\n\t\t\t\ttry {\n\t\t\t\t\treturn employeeService.getEmployeeById(id);\n\t\t\t\t} catch (UserNotFoundException e) {\n\t\t\t\t\tthrow new ResponseStatusException(HttpStatus.NOT_FOUND, e.getMessage());\n\t\t\t\t}\n\n\t\t\t}",
"@GetMapping(\"/employee/{id}\")\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Long id) {\n\t\t\n\t\tEmployee employee = emprepo.findById(id).orElseThrow(()-> new ResourceNotFoundException(\"Employee not exist with id: \" + id)); \n\t\t\n\t\treturn ResponseEntity.ok(employee);\n\t}",
"@GetMapping(\"/employee/{id}\")\n public Employee getEmployeeById(@PathVariable(value = \"id\") Integer id){\n\n Employee employee = employeeService.findEmployeeById(id);\n\n return employee;\n }",
"@GetMapping(\"/{id}\")\n public Employee findById(@PathVariable(\"id\") Long id){\n return employeeService.findById(id);\n }",
"@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}",
"@Test\n\tpublic void postCallMethod() throws JsonGenerationException, JsonMappingException, IOException {\n\t\tpostMethod = new RestClient();\n\n\t\t// Header Value to Pass with GET Method (URI is already ready in before Method)\n\t\tHashMap<String, String> header = new HashMap<String, String>();\n\t\theader.put(\"Content-Type\", \"application/json\");\n\n\t\t// Create Java Object (POJO) in which data is stored\n\t\tString name = \"Manish\" + TestUtil.getCurrentDateTimeStamp();\n\t\tSystem.out.println(\"Name: \" + name);\n\t\tEmployee employee = new Employee(name, \"10000\", \"25\", null);\n\n\t\t// Convert POJO into JSON Object\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tmapper.writeValue(new File(System.getProperty(\"user.dir\") + \"/src/main/java/employee.json\"), employee);\n\n\t\t// java Object to JSON in string (Marshelling)\n\t\tString usersJsonString = mapper.writeValueAsString(employee);\n\n\t\t// POST method is called using URI,JSON body and headers and response is saved\n\t\t// in variable\n\t\tresponseUnderPostRequest = postMethod.post(URI, usersJsonString, header);\n\n\t\t// Output of POST call\n\t\t// Validation part (For POST method output is 1.StatusCode,2.Response\n\t\t// JSON,3.Header)\n\t\t// 1. Retrieve Response Status Code and Assert it\n\t\tint StatusCode = responseUnderPostRequest.getStatusLine().getStatusCode();\n\t\tAssert.assertEquals(StatusCode, RESPONSE_STATUS_CODE_200);\n\n\t\t// 2.Retrieve Response JSON Object as a String\n\t\tString jsonString = EntityUtils.toString(responseUnderPostRequest.getEntity(), \"UTF-8\");\n\n\t\t/*\n\t\t * JSONObject jsonObject=new JSONObject(jsonString);\n\t\t * System.out.println(jsonObject);\n\t\t */\n\n\t\t// Convert JSON Object to java object POJO (Unmarshelling) and Assert with\n\t\t// Previous JAVA Object POJO\n\t\tEmployee responseUser = mapper.readValue(jsonString, Employee.class);\n\t\tAssert.assertTrue(responseUser.getName().equals(employee.getName()));\n\t}",
"@GET\n @Path(\"{id}\")\n @Produces({ \"application/json\" })\n public abstract Response find(@PathParam(\"id\") Long id);",
"@GetMapping(\"/employee/{id}\")\r\n\tpublic Employee get(@PathVariable Integer id) {\r\n\t \r\n\t Employee employee = empService.get(id);\r\n\t return employee;\r\n\t \r\n\t}",
"@GET\n @Path(\"/eagerly\")\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployeesEagerly( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees eagerly for given education using \" +\n \"EducationResource.EmployeeResource.getEducatedEmployeesEagerly(educationId) method of REST API\" );\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<EmployeeWrapper> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees eagerly for given education filtered by given params\n employees = new ResourceList<>(\n EmployeeWrapper.wrap(\n employeeFacade.findByMultipleCriteriaEagerly(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n )\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees eagerly for given education without filtering (eventually paginated)\n employees = new ResourceList<>( EmployeeWrapper.wrap(employeeFacade.findByEducationEagerly(education, params.getOffset(), params.getLimit())) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@GetMapping(\"/byCode/{empCode}\")\n\tpublic ResponseEntity<EmployeeMasterDetails> getByEmpCode(@PathVariable String empCode)\n\t{\n\t\treturn ResponseEntity.ok(employeeMasterService.findByCode(empCode)) ;\n\t}",
"public EmployeeResponse getById(int id) throws EmployeeNotFoundException {\n\n Optional<Employee> result=employeeRepository.findById(id);\n if (result.isPresent()){\n EmployeeResponse response=new EmployeeResponse();\n response.setId(result.get().getId());\n response.setName(result.get().getName());\n return response;\n }\n\n throw new EmployeeNotFoundException(\"Employee not found id=\"+id);\n// return response;\n }",
"@GetMapping(value=\"employee/{employeeId}\")\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable(\"employeeId\") int employeeId)\n\t{\n\t\treturn employeeService.getEmployeeById(employeeId);\n\t}",
"@Test\r\n\tpublic void test_getAllEmployeesPage_notfound() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"6\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(404);\r\n\t}",
"@RequestMapping(value=\"getEmploymentById\" , method={RequestMethod.GET})\r\n\tpublic ResponseEntity<JsonResponse<HrmsEmploymentMasterModel>> getEmploymentById(@RequestParam String id) \r\n\t{\r\n\t\tlogger.info(\"Method : getEmploymentById starts\");\r\n\t\t\r\n\t\tlogger.info(\"Method : getEmploymentById ends\");\r\n\t\t\r\n\t\treturn hrmEmploymentMasterDao.getEmploymentById(id);\r\n\t}",
"@GetMapping(\"/one/{id}\")\n\tpublic ResponseEntity<?> getOneEmployee(@PathVariable Integer id) {\n\t\tResponseEntity<?> response = null;\n\t\ttry {\n\t\t\tEmployee employee = service.getOneEmployee(id);\n\t\t\tresponse = new ResponseEntity<Employee>(employee, HttpStatus.OK); // 200\n\t\t} catch (EmployeeNotFoundException enfe) {\n\t\t\tthrow enfe;\n\t\t}\n\t\treturn response;\n\t}",
"@GetMapping\n public List<Map<String, Object>> employee(){\n List<Map<String, Object>> test = jdbcTemplate.queryForList(\"select * from employee\");\n return test;\n }",
"@GetMapping(\"/getRE\")\n\tpublic List<EnquiryDetails> getDataRE()\n\t{\n\t\tString url=\"http://localhost:8083/getclient/getalldatafor_re\";\n\t\tList<EnquiryDetails> list=rt.getForObject(url, List.class);\n\t\tSystem.out.println(list);\n\t\treturn list;\n\t}",
"@GET(API_ROUTE + \"/contactos-empleado/{emp_id}\")\n Call<List<Persona>> getContactsByEmployeeId(@Path(\"emp_id\") long emp_id);",
"@Test\n\tpublic void get01() {\n\t\tResponse response = given().\n\t\t\t\t spec(spec02).\n\t\t\t\t when().\n\t\t\t\t get();\n\t\tresponse.prettyPrint();\n\t\t\n\t\tresponse.\n\t\t then().\n\t\t assertThat()\n\t\t .statusCode(200);\n\t\t\n\t\tJsonPath json = response.jsonPath();\n\t\tSoftAssert softAssert = new SoftAssert();\n\t\t\n\t//10 dan buyuk tum id leri console a yazdir.\n\t\tList<String> idList = json.getList(\"data.findAll{Integer.valueOf(it.id)>10}.id\");\n\t\tSystem.out.println(idList);\n\t\t\n\t//verify\n\t\tsoftAssert.assertEquals(idList.size(), 14, \"Eleman sayisi istenen gibi degil\");\n\t\t\n\t\n\t//30 dan kucuk tum yaslari console a yazdir\n\t\tList<String> ageList = json.getList(\"data.findAll{Integer.valueOf(it.employee_age)<30}.employee_age\");\n\t\tSystem.out.println(ageList);\n\t\t\n\t\t\n\t// Assert that maximum age is 23\n\t\tCollections.sort(ageList);\n\t\tsoftAssert.assertTrue(ageList.get(ageList.size()-1).equals(\"23\"), \"Yas istenen gibi degil\");\n\t\t\n\t\t\n\t//Print all employee names whose salaries are greater than 350000\n\t\tList<String> nameList = json.getList(\"data.findAll{Integer.valueOf(it.employee_salary)>350000}.employee_name\");\n\t\tSystem.out.println(nameList);\n\t\t\n\t\t\n\t//Assert that Charde Marshall is one of the employees whose salary is greater than 350000\t\n\t\tsoftAssert.assertTrue(nameList.contains(\"Charde Marshall\"));\n\t\t\n\t\t\n\t\t\n\t\tsoftAssert.assertAll();\n\t}",
"@GetMapping(\"/employees/{id}\")\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Long id) {\n\t\tEmployee orElseThrow = repo.findById(id).orElseThrow(() -> new ResourceNotFoundException(\"Employee not exist with id \" + id));\n\t\treturn ResponseEntity.ok(orElseThrow);\n\t}",
"@GET\n @Path(\"/multiget/{j}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response sayJsonHello(@PathParam(\"j\") String j) {\n\t StringTokenizer st = new StringTokenizer(j, \",\");\n String res = \"{\" + \"\\n\";\n\t while(st.hasMoreElements())\n\t {\n\t\t String next = st.nextToken();\n\t\t if(map.get(next) == null)\n\t\t return Response.status(404).build();\n\t\t res += next + \" : \" + map.get(next)+ \"\\n\";\n\t }\n\t res += \"}\";\n\t return Response.ok(res).build();\n }",
"@Override\n\tpublic ResponseEntity<Collection<Employee>> findAll() {\n\t\treturn new ResponseEntity<Collection<Employee>>(empService.findAll(),HttpStatus.OK);\n\t}",
"@RequestMapping(value = \"/HrRetirmntNminesInfos/{empId}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<HrNomineeInfo> getHrNomineeInfoByemployeeInfoId(@PathVariable long empId) {\n log.debug(\"REST request to get HrRetirmntNminesInfos : empId: {}\", empId );\n List<HrNomineeInfo> hrNomineInfos = hrNomineeInfoRepository.findAllByEmployeeInfo(empId);\n return hrNomineInfos;\n }",
"@GetMapping(\"/GetAllEmployees\")\r\n public List<Employee> viewAllEmployees() {\r\n return admin.viewAllEmployees();\r\n }",
"@GET\n @Path(\"location/Arovince\")\n @Produces(\"application/json\")\n public String getJson() throws IOException {\n FileWriter file = new FileWriter(\"/home/component/NetBeansProjects/ArovinceAndSchool/web/api/Arovince.json\");\n JSONObject jsonArray = null;\n\n try {\n URL url = new URL(\"https://opend.data.go.th/get-ckan/datastore_search?resource_id=df922923-e009-4dee-92fc-d963a86ce4b8\"); \n HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection();\n httpURLConnection.setRequestMethod(\"GET\");\n httpURLConnection.setRequestProperty(\"api-key\", \"XOe9aVTolOhCbyTU103IqAKTNNNPX8b5\");\n String line = \"\";\n InputStreamReader inputStreamReader = new InputStreamReader(httpURLConnection.getInputStream());\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n StringBuilder response = new StringBuilder();\n\n try {\n while((line = bufferedReader.readLine()) != null) {\n file.write(line);\n response.append(line);\n }\n } catch (IOException var10) {\n }\n\n file.close();\n bufferedReader.close();\n jsonArray = new JSONObject(response.toString());\n return jsonArray.toString(4);\n } catch (Exception var11) {\n return \"\" + var11;\n }\n }",
"@RequestMapping(value = \"/instEmpEduQualis/currentLogin\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<InstEmpEduQuali> currentInstEmpEduQuali() throws Exception{\n // public List<InstEmpEduQuali> currentInstEmpEduQuali() {\n log.debug(\"REST request to get InstEmpSpouseInfo : {}\");\n //return instEmpEduQualiRepository.findAllByLogin();\n String userName = SecurityUtils.getCurrentUserLogin();\n InstEmployee instEmployeeresult=instEmployeeRepository.findOneByEmployeeCode(userName);\n List<InstEmpEduQuali> instEmpEduQualilist=null;\n /*if(instEmployeeresult !=null && instEmployeeresult.getId()>0){\n log.debug(\"--------------------------------employee result id\"+instEmployeeresult.getId());\n instEmpEduQualilist=rptJdbcDao.findListByInstEmployeeId(instEmployeeresult.getId());\n }\n if(instEmpEduQualilist !=null && instEmpEduQualilist.size()>0){\n return instEmpEduQualilist;\n }else{\n return new ArrayList<>();\n }*/\n log.debug(\"-------------userName---------\"+userName+\"----------employee result id\"+instEmployeeresult.getId());\n //return rptJdbcDao.findListByInstEmployeeId(instEmployeeresult.getId());\n instEmpEduQualilist=instEmpEduQualiRepository.findListByInstEmployeeId(instEmployeeresult.getId());\n /*for(InstEmpEduQuali instEmpEduQuali:instEmpEduQualilist){\n instEmpEduQuali.setCertificateCopy(AttachmentUtil.retriveAttachment(\"/backup/teacher_info/\",instEmpEduQuali.getCertificateCopyName()));\n instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName().substring(0, (instEmpEduQuali.getCertificateCopyName().length() - 17)));\n }*/\n for(InstEmpEduQuali instEmpEduQuali:instEmpEduQualilist){\n if(instEmpEduQuali.getCertificateCopyName()!=null){\n instEmpEduQuali.setCertificateCopy(AttachmentUtil.retriveAttachment(\"/backup/teacher_info/\",instEmpEduQuali.getCertificateCopyName()));\n //instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName().substring(0, (instEmpEduQuali.getCertificateCopyName().length() - 17)));\n instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName());\n }\n }\n return instEmpEduQualilist;\n\n }",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String getJson() {\n GsonBuilder gBuilder = new GsonBuilder();\n Gson jObject = gBuilder.create();\n\n try {\n return jObject.toJson(dao.getAll());\n } catch (Exception e) {\n Resposta lResposta = new Resposta();\n\n lResposta.setMensagem(e.getMessage());\n lResposta.setSucesso(false);\n\n return jObject.toJson(lResposta);\n }\n }",
"public String getAPI()\n {\n ResponseEntity<String> person;\n\n /*\n\t\t * Headers for the response type if we want to return JSON response then we\n\t\t * require to add.\n */\n HttpHeaders headers = new HttpHeaders();\n\n /*\n\t\t * Adding of the response header with application/json type\n */\n headers.add(\"Accept\", \"application/json\");\n\n /*\n\t\t * Creation of the Entity object for the adding the headers into request.\n */\n entity = new HttpEntity<>(headers);\n\n /*\n\t\t * Creation of REST TEMPLET object for the executing of the REST calls.\n */\n restTemplate = new RestTemplate();\n\n /*\n\t\t * Adding the basic type of authentication on the REST TEMPLETE.\n */\n restTemplate.getInterceptors()\n .add(new BasicAuthorizationInterceptor(\"Administrator\", \"Oneeight@admin18\"));\n\n /*\n\t\t * Execution of the REST call with basic authentication and JSON response type\n */\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/login?username=Administrator&password=Oneeight@admin18\", HttpMethod.POST, entity, String.class);\n System.out.println(\"\"+person.toString());\n //headers.add(\"Cookie\", \"JSESSIONID=0FC37952D64B545C46969EFEC0E4FD12\");\n headers.add(\"Cookie\", person.getHeaders().getFirst(HttpHeaders.SET_COOKIE));\n entity = new HttpEntity<>(headers);\n person = restTemplate.exchange(\"http://52.172.222.197:8080/versa/analytics/v1.0.0/data/provider/tenants/OneEight/features/SDWAN/?qt=summary&start-date=1daysAgo&end-date=today&q=linkusage(site)&metrics=volume-rx&metrics=volume-tx&metrics=volume-rx&metrics=volume-tx&metrics=bandwidth&ds=aggregate&count=10\", HttpMethod.GET, entity, String.class);\n\n /*\n\t\t * Returning the response body with string format that easily readable.\n */\n return person.getBody();\n }",
"@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<List<Enquiry>> getAll(@RequestParam(value = \"page\" , required = false) Integer offset,\n @RequestParam(value = \"per_page\", required = false) Integer limit)\n throws URISyntaxException {\n Page<Enquiry> page = enquiryRepository.findAll(PaginationUtil.generatePageRequest(offset, limit));\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/enquirys\", offset, limit);\n return new ResponseEntity<List<Enquiry>>(page.getContent(), headers, HttpStatus.OK);\n }",
"@RequestMapping(\"/getAllContacts\")\n\tprivate ResponseEntity<String> getAllContacts() throws JsonProcessingException {\n\t\t\n\t\tList<Contacts> contactlist = c_service.getAllContacts();\t\t\n\t HttpHeaders responseHeaders = new HttpHeaders();\n\t \n\t if (contactlist == null) {\n\t return new ResponseEntity<String>(\"No Users found\", \n\t responseHeaders, HttpStatus.UNAUTHORIZED);\n\t } else {\n\t responseHeaders.add(\"Content-Type\", \"application/json\");\n\t String json = convertListToJson(contactlist);\n\t return new ResponseEntity<String>(json, responseHeaders, HttpStatus.OK); \n\t }\t\t\n\t}",
"@Repository\n@RepositoryRestResource(path = \"employees\")\npublic interface EmployeeRepository extends JpaRepository<Employee, Long> {\n\n /**\n *Retrieve employees ordered be last name\n * With link /api/employees/search/lastname\n */\n @RestResource(path = \"lastname\")\n List<Employee> findAllByOrderByLastNameAsc();\n\n}",
"@ApiOperation(value = \"getEmployeeById controller method\")\r\n\t@GetMapping(value = \"/getEmployeeById/{employeeId}\")\r\n\tpublic ResponseEntity<Employee> getEmployeeById(@PathVariable Integer employeeId) {\r\n\r\n\t\tLog.info(\" Employee Controller Triggerd\");\r\n\r\n\t\tEmployee employee = employeeService.getEmployeeById(employeeId);\r\n\t\treturn new ResponseEntity<Employee>(employee, HttpStatus.OK);\r\n\t}",
"@RequestMapping(value = \"/bankInfoByEmpId/{empId}\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public HrEmpBankAccountInfo getEmpBankInfoByEmpId(@PathVariable long empId) {\n log.debug(\"REST request to get BankInfoByEmpId : empId: {}\", empId);\n HrEmpBankAccountInfo bankInfo = hrEmpBankAccountInfoRepository.findByEmployeeInfo(empId);\n return bankInfo;\n }",
"@WebMethod\n public Employee getEmployeeById(@WebParam(name = \"arg0\") int empId) {\n Connection conn = null;\n Employee emp = null;\n try {\n conn = EmpDBUtil.getConnection();\n PreparedStatement pStmt = conn.prepareStatement(\"select * from EMPLOYEES where EMPLOYEE_ID = ?\");\n pStmt.setInt(1, empId);\n ResultSet rSet = pStmt.executeQuery();\n while (rSet.next()) {\n emp = new Employee();\n emp.setEmployee_id(rSet.getInt(\"EMPLOYEE_ID\"));\n emp.setFirst_name(rSet.getString(\"FIRST_NAME\"));\n emp.setLast_name(rSet.getString(\"LAST_NAME\"));\n emp.setEmail(rSet.getString(\"EMAIL\"));\n emp.setPhone_number(rSet.getString(\"PHONE_NUMBER\"));\n emp.setHire_date(rSet.getDate(\"HIRE_DATE\"));\n emp.setJop_id(rSet.getString(\"JOB_ID\"));\n emp.setSalary(rSet.getInt(\"SALARY\"));\n emp.setCommission_pct(rSet.getDouble(\"COMMISSION_PCT\"));\n emp.setManager_id(rSet.getInt(\"MANAGER_ID\"));\n emp.setDepartment_id(rSet.getInt(\"DEPARTMENT_ID\"));\n }\n \n System.out.println(\"done\");\n\n } catch (SQLException e) {\n e.printStackTrace();\n } finally {\n EmpDBUtil.closeConnection(conn);\n }\n\n return emp;\n }"
] | [
"0.69542915",
"0.69379985",
"0.69146645",
"0.6901053",
"0.6807876",
"0.67913246",
"0.6767327",
"0.6738917",
"0.6684839",
"0.6671205",
"0.6666601",
"0.66363406",
"0.6614194",
"0.65774626",
"0.65668553",
"0.65566146",
"0.65347636",
"0.6534624",
"0.6513419",
"0.6482885",
"0.63339025",
"0.62713385",
"0.62706304",
"0.62644786",
"0.623861",
"0.62306404",
"0.622032",
"0.6147347",
"0.6140251",
"0.61355555",
"0.6133704",
"0.61054754",
"0.61052114",
"0.6095982",
"0.6061934",
"0.6059744",
"0.6049327",
"0.60320187",
"0.6031258",
"0.6026573",
"0.6010893",
"0.60053337",
"0.6000262",
"0.6000076",
"0.59998786",
"0.599073",
"0.5986693",
"0.59816235",
"0.5977406",
"0.59723824",
"0.59415376",
"0.5926603",
"0.5901626",
"0.58830196",
"0.58714145",
"0.5862054",
"0.5837412",
"0.5837041",
"0.5820354",
"0.58190453",
"0.58169687",
"0.5796343",
"0.5794567",
"0.57930446",
"0.5785729",
"0.57848424",
"0.5771471",
"0.5769873",
"0.57687575",
"0.57676226",
"0.57613134",
"0.5754586",
"0.5751164",
"0.57476366",
"0.57431453",
"0.57063323",
"0.570137",
"0.5684338",
"0.566918",
"0.5657695",
"0.5655275",
"0.5644456",
"0.5638097",
"0.56369007",
"0.5617131",
"0.5614049",
"0.5607068",
"0.5599223",
"0.5578543",
"0.5572708",
"0.5571409",
"0.556322",
"0.5558751",
"0.55585974",
"0.5545725",
"0.55422604",
"0.5537644",
"0.5528879",
"0.5522437",
"0.55204666"
] | 0.6700191 | 8 |
/ Given Accept type is JSON And Params are limit=100 When I send a GET request to employees Then status code is 200 And Response content should be json And all data should be return | @Test
public void testJsonPathWithLists() {
Map<String,Integer> requestParamMaps=new HashMap<>();
requestParamMaps.put("limit", 100);
Response response = given().accept(ContentType.JSON).and().params(requestParamMaps)
.when().get(ConfigurationReader.getProperty("hrapp.baseurl")+"/employees/");
assertEquals(response.statusCode(), 200);
JsonPath json = response.jsonPath();
//get all employee ids into arratlist
List<Integer> empIDs = json.getList("items.employee_id");
System.out.println(empIDs);
//assert that there are 100 emp ids
assertEquals(empIDs.size(), 100);
//get all emails and assign in list
List<String> emails = json.getList("items.email");
assertEquals(emails.size(), 100);
//get all employee ids that are greater than 150
List<Integer> empIdList = json.getList("items.findAll{it.employee_id > 150}.employee_id");
System.out.println(empIdList);
//get all employee lastnames, whose salary is more than 7000
List<String> lastNames = json.getList("items.findAll{it.salary > 7000}.last_name");
System.out.println(lastNames);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testWithQueryParametersAndList() {\n\t\tgiven().accept(ContentType.JSON)\n\t\t.and().params(\"limit\",100)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees\")\n\t\t.then().assertThat().statusCode(200)\n\t\t.and().contentType(ContentType.JSON)\n\t\t.and().assertThat().body(\"items.employee_id\", hasSize(100));\n\t\t\n\t}",
"@Test //make sure it comes from testNG\n public void testWithQueryParameterAndList(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"items.employee_id\", hasSize(100));\n }",
"@Test\r\n\tpublic void test_getAllEmployees() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t// .pathParam(\"page\", \"0\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(0))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\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 }",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAll() {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findAll()) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@ApiOperation(value = \"getEmployeeByPagination controller method\")\r\n\t@GetMapping(\"/getEmployeeByPagination/{maxPage}/{ofset}\")\r\n\tpublic ResponseEntity<List<Employee>> getAllEmployeesByPagination(@PathVariable String maxPage,@PathVariable String ofset)\r\n\t{\r\n\t\tLog.info(\" Employee Controller Triggerd\");\r\n\t\tList<Employee> employees=employeeService.getAllEmployeesByPagination(maxPage, ofset);\r\n\t\treturn new ResponseEntity<List<Employee>>(employees,HttpStatus.OK);\r\n\t}",
"@RequestMapping(\"/get\")\n public ResponseEntity<ResponseDTO> getEmployeePayrollData() {\n List<EmployeePayrollData> empDataList ;\n empDataList = employeePayrollService.getEmployeePayrollData();\n ResponseDTO responseDTO = new ResponseDTO(\"Get Call Success\", empDataList);\n log.info(\"get all data\");\n return new ResponseEntity<>(responseDTO, HttpStatus.OK);\n\n }",
"@GetMapping(\"/all\")\n public ResponseEntity responseAllEmployees(){\n return new ResponseEntity<>(hr_service.getAllEmployees(), HttpStatus.OK);\n }",
"@Test\r\n\tpublic void test_getAllEmployeesPage2() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200)//\r\n\t\t\t\t.body(\"number\", equalTo(2))//\r\n\t\t\t\t.body(\"content.size()\", equalTo(10));\r\n\r\n\t}",
"@RequestMapping(value = \"/enquirys\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<List<Enquiry>> getAll(@RequestParam(value = \"page\" , required = false) Integer offset,\n @RequestParam(value = \"per_page\", required = false) Integer limit)\n throws URISyntaxException {\n Page<Enquiry> page = enquiryRepository.findAll(PaginationUtil.generatePageRequest(offset, limit));\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/enquirys\", offset, limit);\n return new ResponseEntity<List<Enquiry>>(page.getContent(), headers, HttpStatus.OK);\n }",
"@RequestLine(\"GET /show\")\n List<Bucket> getAllEmployeesList();",
"@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic String getAllEmployees(){\n\t\tString employeesJsonString = getFileContent();\n\t\treturn employeesJsonString;\n\t}",
"@Test\n public void testJsonPathWithLists(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees\");\n\n Assert.assertEquals(response.statusCode(),200); //to check status code\n\n //First way to use JsonPath\n JsonPath json = response.jsonPath();\n\n //Second way\n //JsonPath json = new JsonPath(response.asString());\n\n //Third way\n //JsonPath json = new JsonPath(new File(FilePath.json));\n\n //get all employee ids into ArrayList\n List<Integer> empIds = json.getList(\"items.employee_id\");\n System.out.println(empIds);\n //assert that there are 100 employee ids\n Assert.assertEquals(empIds.size(), 100);\n\n //get all employee emails and assign into ArrayList\n List<String> empEmails = json.getList(\"items.email\");\n System.out.println(empEmails);\n Assert.assertEquals(empEmails.size(), 100);\n\n //get all employee ids that are greater than 150\n List<Integer> empIdsMoreThan150 = json.getList(\"items.findAll{it.employee_id>150}.employee_id\");\n System.out.println(empIdsMoreThan150);\n\n //get all employees last name whose salary > 15000\n List<String> empSalaryMoreThan7000 = json.getList(\"items.findAll{it.salary>15000}.last_name\");\n System.out.println(empSalaryMoreThan7000);\n\n //get data from saved JSON file\n JsonPath jsonFromFile = new JsonPath(new File(\"/Users/asselkassymbekova/Desktop/employees.json\"));\n List<String> empEmails1 = jsonFromFile.getList(\"items.email\");\n System.out.println(empEmails1);\n\n }",
"@Test\r\n\tpublic void test_getEmployeeById() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"id\", \"2\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employee\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(200);\r\n\t}",
"@Test\n public void testWithJsonPath(){\n Map<String, Integer> rParamMap = new HashMap<>();\n rParamMap.put(\"limit\", 100);\n\n //we are getting the response and assigning it to this variable\n Response response = given().accept(ContentType.JSON) //header\n .and().params(rParamMap) //query param/request param\n .and().pathParams(\"employee_id\", 177) //path param\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\");\n\n //here we are saying get json body and assign it yo jsonpath object\n JsonPath json = response.jsonPath();\n\n System.out.println(json.getInt(\"employee_id\"));\n System.out.println(json.getString(\"last_name\"));\n System.out.println(json.getString(\"job_id\"));\n System.out.println(json.getInt(\"salary\"));\n //we put index to links, because links is an array, but href is just a value of the array\n System.out.println(json.getString(\"links[0].href\")); //to get only the first link\n //we use upper statement to get specific element from array\n\n //assign all href into a List of strings\n List<String> hrefs = json.getList(\"links.href\");\n System.out.println(hrefs);\n }",
"@GetMapping(\"/get_all_employees\")\n public String getAllEmployees(){\n\n Gson gsonBuilder = new GsonBuilder().create();\n List<Employee> initial_employee_list = employeeService.get_all_employees();\n String jsonFromJavaArray = gsonBuilder.toJson(initial_employee_list);\n\n return jsonFromJavaArray;\n }",
"@Test\n //1. adim URL i olusturmak\n public void get01(){\n spec03.pathParam(\"employeePath\",\"employees\");\n\n // 2. adim test datalarini olusturmak\n\n // 3. adim Request olusturma\n Response response = given().\n spec(spec03).\n when().\n get(\"/{employeePath}\");\n // response.prettyPrint();\n // 1. yol EqualTo-- Body ile assert ediyoruz\n response.\n then().\n assertThat().\n statusCode(200).\n body(\"data.employee_name[4]\",equalTo(\"Airi Satou\"),\n \"data[5].employee_salary\",equalTo(\"372000\"),\n \"data.id\",hasSize(24),\n \"data.employee_name\",hasItem(\"Rhona Davidson\"),\n \"data.employee_age\",hasItems(\"21\", \"23\", \"61\"));\n\n // 2. yol Hard Assertion\n // JsonPath ile\n JsonPath json = response.jsonPath();\n Assert.assertEquals(\"Airi Satou\",json.getString(\"data.employee_name[4]\"));\n Assert.assertEquals(\"372000\",json.getString(\"data[5].employee_salary\"));\n // System.out.println(json.getList(\"data.id\"));\n Assert.assertEquals(24,json.getList(\"data.id\").size());\n // System.out.println(json.getList(\"data.employee_name\"));\n Assert.assertTrue(json.getList(\"data.employee_name\").contains(\"Rhona Davidson\"));\n\n List<String> yasListesi = new ArrayList<>();\n yasListesi.add(\"21\");\n yasListesi.add(\"23\");\n yasListesi.add(\"61\");\n Assert.assertTrue(json.getList(\"data.employee_age\").containsAll(yasListesi));\n\n\n\n }",
"@GET\n\t@Path(\"{empID}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getById(@PathParam(\"empID\") int id) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findById(id)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@RequestMapping(value = \"/employeesList\", method = RequestMethod.GET, produces = {\"application/xml\", \"application/json\" })\n\t@ResponseStatus(HttpStatus.OK)\n\tpublic @ResponseBody\n\tEmployeeListVO getListOfAllEmployees() {\n\t\tlog.info(\"ENTERING METHOD :: getListOfAllEmployees\");\n\t\t\n\t\tList<EmployeeVO> employeeVOs = employeeService.getListOfAllEmployees();\n\t\tEmployeeListVO employeeListVO = null;\n\t\tStatusVO statusVO = new StatusVO();\n\t\t\n\t\tif(employeeVOs.size()!=0){\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_0);\n\t\t\tstatusVO.setMessage(AccountantConstants.SUCCESS);\n\t\t}else{\n\t\t\tstatusVO.setCode(AccountantConstants.ERROR_CODE_1);\n\t\t\tstatusVO.setMessage(AccountantConstants.NO_RECORDS_FOUND);\n\t\t}\n\t\t\n\t\temployeeListVO = new EmployeeListVO(employeeVOs, statusVO);\n\t\t\n\t\tlog.info(\"EXITING METHOD :: getListOfAllEmployees\");\n\t\treturn employeeListVO;\n\t}",
"@Test\r\n\tpublic void test_getAllEmployeesPage_notfound() {\r\n\t\tgiven()\r\n\t\t\t\t.contentType(ContentType.JSON)//\r\n\t\t\t\t.queryParam(\"page\", \"6\")//\r\n\t\t\t\t.when()//\r\n\t\t\t\t.get(\"/api/v1/employees\")//\r\n\t\t\t\t.then()//\r\n\t\t\t\t.log()//\r\n\t\t\t\t.body()//\r\n\t\t\t\t.statusCode(404);\r\n\t}",
"@RequestMapping(value = \"/getAllEmployees\", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })\r\n\tpublic List<Employee> getAllEmpoyees(){\r\n\t\treturn repository.getAllEmpoyees();\r\n\t}",
"@RequestMapping(value=\"/employees/all\", method = RequestMethod.GET)\npublic @ResponseBody List<Employee> employeeListRest(){\n\treturn (List<Employee>) employeerepository.findAll();\n}",
"public ResponseEntity<List<Employee>> getAllEmployees() {\n \tList<Employee> emplist=empService.getAllEmployees();\n\t\t\n\t\tif(emplist==null) {\n\t\t\tthrow new ResourceNotFoundException(\"No Employee Details found\");\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<>(emplist,HttpStatus.OK);\t\t\n }",
"@Test\n public void employeeGetsAllTransactionsWithOffsetAndLimitShouldReturnOk() throws Exception{\n mvc.perform(get(\"/transactions?offset=1&limit=4\")\n .header(\"ApiKeyAuth\", \"1234-abcd-5678-efgh\"))\n .andExpect(status().isOk());\n }",
"@GetMapping(\"/getoffer/{empId}\")\n\t public ResponseEntity<List<Offer>> getAllOffers(@PathVariable int empId)\n\t {\n\t\t List<Offer> fetchedOffers=employeeService.getAllOffers(empId);\n\t\t if(fetchedOffers.isEmpty())\n\t\t {\n\t\t\t throw new InvalidEmployeeException(\"No Employee found with id= : \" + empId);\n\t\t }\n\t\t else\n\t\t {\n\t\t\t return new ResponseEntity<List<Offer>>(fetchedOffers,HttpStatus.OK);\n\t\t }\n\t }",
"@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n public final List<EmployeeDTO> findAllEmployees() {\n LOGGER.info(\"getting all employees\");\n return employeeFacade.findAllEmployees();\n }",
"@GetMapping(\"/getEmployees\")\n\t@ResponseBody\n\tpublic List<Employee> getAllEmployees(){\n\t\treturn employeeService.getEmployees();\n\t}",
"@GET\n @Path(\"/eagerly\")\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployeesEagerly( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees eagerly for given education using \" +\n \"EducationResource.EmployeeResource.getEducatedEmployeesEagerly(educationId) method of REST API\" );\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<EmployeeWrapper> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees eagerly for given education filtered by given params\n employees = new ResourceList<>(\n EmployeeWrapper.wrap(\n employeeFacade.findByMultipleCriteriaEagerly(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n )\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees eagerly for given education without filtering (eventually paginated)\n employees = new ResourceList<>( EmployeeWrapper.wrap(employeeFacade.findByEducationEagerly(education, params.getOffset(), params.getLimit())) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@GetMapping(\"/all\")\n public ResponseEntity<?> findAllData() {\n logger.info(\"Start controller call get All Data \");\n ServiceResult serviceResult = new ServiceResult();\n serviceResult.setMessage(\"Get All Data Success\");\n try {\n List<AdCampaign> lstAdCampaigns = adCampaignService.findAll();\n serviceResult.setData(lstAdCampaigns);\n serviceResult.setStatus(ServiceResult.Status.SUCCESS);\n }catch (Exception ex){\n logger.error(\"Error get All Data\");\n serviceResult.setMessage(\"Error\");\n serviceResult.setStatus(ServiceResult.Status.FAILED);\n }\n\n logger.info(\"End controller call get All Data \");\n return new ResponseEntity<ServiceResult>(serviceResult,new HttpHeaders(), HttpStatus.OK);\n }",
"@Test\n\tpublic void testWithPathParameters() {\n\t\tgiven().accept(ContentType.JSON).and().params(\"limit\",100)\n\t\t.and().pathParams(\"id\", 110)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/{id}\") //when we send e request this id will be replaced with 110\n\t\t.then().statusCode(200)\n\t\t.and().assertThat().contentType(ContentType.JSON)\n\t\t.and().body(\"employee_id\", equalTo(110),\n\t\t\t\t\"first_name\",equalTo(\"John\"),\n\t\t\t\t\"last_name\",equalTo(\"Chen\"),\n\t\t\t\t\"email\",equalTo(\"JCHEN\"));\n\t\t\n\t}",
"@GetMapping(value = \"/allEmployees/produces\", produces =\"Application/vnd.company.app-v1+json\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddProd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@Test\n public void testWithPathParameters(){\n given().accept(ContentType.JSON)\n .and().params(\"limit\",100)\n .and().pathParams(\"employee_id\", 110)\n .when().get(ConfigurationReader.getProperty(\"hrapp.baseresturl\")+\"/employees/{employee_id}\")\n .then().assertThat().statusCode(200)\n .and().assertThat().contentType(ContentType.JSON)\n .and().assertThat().body(\"employee_id\", equalTo(110),\n \"first_name\", equalTo(\"John\"),\n \"last_name\", equalTo(\"Chen\"),\n \"email\", equalTo(\"JCHEN\") );\n }",
"@GetMapping(\"/all\")\n\tpublic ResponseEntity<List<Employee>> getAllEmployees() {\n\t\tList<Employee> list = service.getAllEmployees();\n\t\treturn new ResponseEntity<List<Employee>>(list, HttpStatus.OK);\n\t}",
"@Test\n\tpublic void get01() {\n\t\tResponse response = given().\n\t\t\t\t spec(spec02).\n\t\t\t\t when().\n\t\t\t\t get();\n\t\tresponse.prettyPrint();\n\t\t\n\t\tresponse.\n\t\t then().\n\t\t assertThat()\n\t\t .statusCode(200);\n\t\t\n\t\tJsonPath json = response.jsonPath();\n\t\tSoftAssert softAssert = new SoftAssert();\n\t\t\n\t//10 dan buyuk tum id leri console a yazdir.\n\t\tList<String> idList = json.getList(\"data.findAll{Integer.valueOf(it.id)>10}.id\");\n\t\tSystem.out.println(idList);\n\t\t\n\t//verify\n\t\tsoftAssert.assertEquals(idList.size(), 14, \"Eleman sayisi istenen gibi degil\");\n\t\t\n\t\n\t//30 dan kucuk tum yaslari console a yazdir\n\t\tList<String> ageList = json.getList(\"data.findAll{Integer.valueOf(it.employee_age)<30}.employee_age\");\n\t\tSystem.out.println(ageList);\n\t\t\n\t\t\n\t// Assert that maximum age is 23\n\t\tCollections.sort(ageList);\n\t\tsoftAssert.assertTrue(ageList.get(ageList.size()-1).equals(\"23\"), \"Yas istenen gibi degil\");\n\t\t\n\t\t\n\t//Print all employee names whose salaries are greater than 350000\n\t\tList<String> nameList = json.getList(\"data.findAll{Integer.valueOf(it.employee_salary)>350000}.employee_name\");\n\t\tSystem.out.println(nameList);\n\t\t\n\t\t\n\t//Assert that Charde Marshall is one of the employees whose salary is greater than 350000\t\n\t\tsoftAssert.assertTrue(nameList.contains(\"Charde Marshall\"));\n\t\t\n\t\t\n\t\t\n\t\tsoftAssert.assertAll();\n\t}",
"@GET\n @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})\n public Response getEducatedEmployees( @PathParam(\"educationId\") Long educationId,\n @BeanParam EmployeeBeanParam params ) throws ForbiddenException, NotFoundException,\n /* UserTransaction exceptions */ HeuristicRollbackException, RollbackException, HeuristicMixedException, SystemException, NotSupportedException {\n\n RESTToolkit.authorizeAccessToWebService(params);\n logger.log(Level.INFO, \"returning employees for given education using EducationResource.EmployeeResource.getEducatedEmployees(educationId) method of REST API\");\n\n // find education entity for which to get associated employees\n Education education = educationFacade.find(educationId);\n if(education == null)\n throw new NotFoundException(\"Could not find education for id \" + educationId + \".\");\n\n Integer noOfParams = RESTToolkit.calculateNumberOfFilterQueryParams(params);\n\n ResourceList<Employee> employees = null;\n\n if(noOfParams > 0) {\n logger.log(Level.INFO, \"There is at least one filter query param in HTTP request.\");\n\n List<Education> educations = new ArrayList<>();\n educations.add(education);\n\n utx.begin();\n\n // get employees for given education filtered by given params\n employees = new ResourceList<>(\n employeeFacade.findByMultipleCriteria(params.getDescriptions(), params.getJobPositions(), params.getSkills(),\n educations, params.getServices(), params.getProviderServices(), params.getServicePoints(),\n params.getWorkStations(), params.getPeriod(), params.getStrictTerm(), params.getTerms(), params.getRated(),\n params.getMinAvgRating(), params.getMaxAvgRating(), params.getRatingClients(), params.getOffset(), params.getLimit())\n );\n\n utx.commit();\n\n } else {\n logger.log(Level.INFO, \"There isn't any filter query param in HTTP request.\");\n\n // get employees for given education without filtering (eventually paginated)\n employees = new ResourceList<>( employeeFacade.findByEducation(education, params.getOffset(), params.getLimit()) );\n }\n\n // result resources need to be populated with hypermedia links to enable resource discovery\n pl.salonea.jaxrs.EmployeeResource.populateWithHATEOASLinks(employees, params.getUriInfo(), params.getOffset(), params.getLimit());\n\n return Response.status(Status.OK).entity(employees).build();\n }",
"@GetMapping(\"/employees\")\npublic List <Employee> findAlll(){\n\treturn employeeService.findAll();\n\t}",
"@GET\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGetbyId(@PathParam(\"id\") String id) {\n Gson gson = GSONFactory.getInstance();\n Employee employee = getEmployeeById(id);\n\n if (employee == null) {\n Response response = Response.status(404).build();\n return response;\n } else {\n String jsonOutput = gson.toJson(employee);\n Response response = Response.ok().entity(jsonOutput).build();\n return response;\n }\n }",
"public List<EmployeeDto> retrieveEmployees();",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response getEmployee( @NotNull(message = \"Employee ID cannnot be null\")\n @QueryParam(\"empId\") String empId) {\n return null;\n }",
"@RequestMapping(value = GET_ALL_EMPLOYEE_URL_API, method=RequestMethod.GET)\r\n public ResponseEntity<?> getAllEmployee() {\r\n\r\n checkLogin();\r\n\r\n return new ResponseEntity<>(employeeService.getAll(), HttpStatus.OK);\r\n }",
"@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}",
"@Test\n\tpublic void testWithJsonPath() {\n\t\t\t\t\n\t\tResponse response = given().accept(ContentType.JSON)\n\t\t.and().pathParam(\"id\", 110)\n\t\t.when().get(ConfigurationReader.getProperty(\"hrapp.baseurl\")+\"/employees/{id}\");\n\t\t\n\t\tJsonPath json = response.jsonPath(); //get json body and assign to jsonPath object\n\t\t//we are assiging whole response to json object so we can easyly reach and use it \n\t\t\n\t\tSystem.out.println(json.getInt(\"employee_id\"));\n\t\tSystem.out.println(json.getString(\"first_name\"));\n\t\tSystem.out.println(json.getString(\"job_id\"));\n\t\tSystem.out.println(json.getInt(\"salary\"));\n\t\tSystem.out.println(json.getString(\"links[0].href\")); //get specific element from array \n\t \n\t\t//assign all hrefs into a list of strings \n\t\tList<String> hrefs = json.getList(\"links.href\");\n\t\t\n\t\t//everything in arraylist \n\t System.out.println(hrefs);\n\t \n\t //one by one \n\t\tfor(String href:hrefs) {\n\t\t\tSystem.out.println(href);\n\t\t}\n\t}",
"@Override\n\tpublic ResponseEntity<Collection<Employee>> findAll() {\n\t\treturn new ResponseEntity<Collection<Employee>>(empService.findAll(),HttpStatus.OK);\n\t}",
"@GetMapping(\"v1/allEmployees\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterVer(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> getEmployees(){\r\n\t\t\r\n\t\treturn employeeService.getEmployees();\r\n\t\t\r\n\t}",
"@GetMapping(value = \"/allEmployees/header\", headers =\"X-API-VERSION=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAddHdr(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@GET\n\t@Path(\"/search/{empName}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getByName(@PathParam(\"empName\") String name) {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findByName(name)) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}",
"@GET\n @Path(\"/getEmployeeById/{empId}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeById(@PathParam(\"empId\") String empId){\n String output = \"\";\n try {\n Employee employee = new Employee();\n employee = EmployeeFacade.getInstance().getEmployeeById(empId);\n output = gson.toJson(employee);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"public ArrayList<CompanyProtheus> requestCompanysProtheus() {\n\n // Local variables.\n CompanyProtheus[] companysProtheus;\n ArrayList<CompanyProtheus> listCompanysProtheus = new ArrayList<>();\n\n // Define url for request.\n urlPath = \"http://{ipServer}:{portServer}/REST/GET/JWSRUSERS/emp/{userCode}\";\n urlPath = urlPath.replace(\"{ipServer}\", ipServer);\n urlPath = urlPath.replace(\"{portServer}\", portServer);\n urlPath = urlPath.replace(\"{userCode}\", userProtheus.getCode());\n\n try {\n\n // Set URL for request.\n url = new URL(urlPath);\n\n // Set key for authorization basic\n authorizationBasic = \"Basic \" + Base64.encodeToString((userProtheus.getCode()+ \":\" + userProtheus.getPassword()).getBytes() , Base64.DEFAULT);\n\n // Open connection HTTP.\n httpConnection = (HttpURLConnection) url.openConnection();\n\n // set header for request.\n httpConnection.setRequestMethod(\"GET\");\n httpConnection.setRequestProperty(\"Content-type\", \"application/json\");\n httpConnection.setRequestProperty(\"Accept\", \"application/json\");\n httpConnection.setRequestProperty(\"Authorization\", authorizationBasic);\n httpConnection.setDoOutput(true);\n httpConnection.setDoInput(true);\n httpConnection.setConnectTimeout(5000);\n httpConnection.connect();\n\n // Get response.\n bufferedLine = \"\";\n bufferedReader = new BufferedReader(new InputStreamReader(url.openStream()));\n while ((bufferedLine = bufferedReader.readLine()) != null) {\n httpReturn.append(bufferedLine);\n }\n\n // Set userProtheus with json reponse.\n companysProtheus = (CompanyProtheus[]) new Gson().fromJson(httpReturn.toString(), CompanyProtheus[].class);\n listCompanysProtheus = new ArrayList<CompanyProtheus>(Arrays.asList(companysProtheus));\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (ProtocolException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return listCompanysProtheus;\n\n }",
"private String getEmployees() {\n\n String uri = new String(\"http://\" + mRESTServer.getHost() +\n mRESTServer.getContextPath());\n try {\n String result = restTemplate.getForObject(uri, String.class);\n\n System.out.println(result);\n return result+\": (\"+uri+\")\";\n\n } catch (HttpClientErrorException e) {\n /**\n *\n * If we get a HTTP Exception display the error message\n */\n log.error(\"error: \" + e.getResponseBodyAsString());\n\n ObjectMapper mapper = new ObjectMapper();\n ErrorHolder eh = null;\n try {\n eh = mapper.readValue(e.getResponseBodyAsString(), ErrorHolder.class);\n } catch (IOException ignored) {\n }\n\n log.error(\"error: \" + eh.getErrorMessage());\n\n } catch (Exception e) {\n log.error(\"error: \" + e.getMessage());\n\n }\n\n return null;\n }",
"@GetMapping(value = \"allEmployees/param\", params =\"version=1\")\n @ApiOperation(value =\"To get all employees details with address Id filtered\",\n notes= \"It returns all details for a group of employees except the addressId which is not relevant\",\n response= FilteredEmployee.class)\n public MappingJacksonValue retrieveEmployeesFilterAdd(){\n List<FilteredEmployee> filteredEmployees = filteredPersonnel.findAll();\n SimpleBeanPropertyFilter filter = SimpleBeanPropertyFilter.filterOutAllExcept(\"firstName\",\"surname\", \"department\");\n FilterProvider filters = new SimpleFilterProvider().addFilter(\"EmployeeFilter\",filter);\n MappingJacksonValue mapping = new MappingJacksonValue(filteredEmployees);\n mapping.setFilters(filters);\n return mapping;\n }",
"@RequestMapping(value = \"/listEmployees\", method = RequestMethod.GET)\r\n\tpublic Employee employees() {\r\n System.out.println(\"---BEGIN\");\r\n List<Employee> allEmployees = employeeData.findAll();\r\n \r\n System.out.println(\"size of emp == \"+allEmployees.size());\r\n System.out.println(\"---END\");\r\n Employee oneEmployee = allEmployees.get(0);\r\n\t\treturn oneEmployee;\r\n }",
"@Test\n public void getretrieveAllOffersTest() throws IOException {\n\n ObjectMapper mapper = new ObjectMapper();\n RetrieveAllOffersgetResponse response = api.getretrieveAllOffers( null, null);\n\n String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(response);\n System.out.println(json);\n }",
"@GET\n @Path(\"/getEmployeeByName/{empName}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String getEmployeeByName(@PathParam(\"empName\") String empName){\n String output = \"\";\n try {\n Map<String, Employee> employeeMap = new HashMap<String, Employee>();\n employeeMap = EmployeeFacade.getInstance().getEmployeeByName(empName);\n output = gson.toJson(employeeMap);\n \n } catch (IOException e) {\n output = \"Error\";\n }\n return output;\n }",
"@GetMapping(\"/getRE\")\n\tpublic List<EnquiryDetails> getDataRE()\n\t{\n\t\tString url=\"http://localhost:8083/getclient/getalldatafor_re\";\n\t\tList<EnquiryDetails> list=rt.getForObject(url, List.class);\n\t\tSystem.out.println(list);\n\t\treturn list;\n\t}",
"@ResponseBody\r\n\t@RequestMapping(\"/toutiaoApiDB\")\r\n\tpublic String toutiaoApiDB(ModelMap modelMap, HttpServletRequest request, HttpServletResponse response,\r\n\t\t\t@RequestParam(value = \"keyword\", required = true) String keyword,\r\n\t\t\t@RequestParam(value = \"count\", required = true) Integer count,\r\n\t\t\t@RequestParam(value = \"offset\", required = true) Integer offset) {\n\t\tresponse.setHeader(\"Access-Control-Allow-Origin\",\"*\"); // 允许任意域名发起的跨域请求 \r\n\t\tresponse.setHeader(\"Access-Control-Allow-Headers\",\"X-Requested-With,X_Requested_With\");\r\n\r\n\t\tString errobj = null;\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tString url = \"http://www.toutiao.com/search_content/?format=json&keyword=\"+URLEncoder.encode(keyword, \"UTF-8\")+\"&count=\"+count+\"&offset=\"+offset;\r\n\t\t\tSystem.out.println(url);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tMap<String, Integer> brandMap = new HashMap<String, Integer>();\r\n\t\t\tList<Brand> brandList = brandMapper.selectByExample(null);\r\n\t\t\tfor (Brand b : brandList) {\r\n\t\t\t\tbrandMap.put(b.getName().trim(), b.getId());\r\n\t\t\t}\r\n//\t\t\tString result = EHtmlUnit.getAjaxPage(url);//EHttpClientUtil.methodGet(url);\r\n\t\t\tString result = PythonUtil.python(request.getRealPath(\"/getAjaxWeb.py\"), url);\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"result=========================\");\r\n\t\t\tSystem.out.println(result);\r\n\t\t\tresult = HtmlRegexpUtil.filterHtml(result);\r\n\t\t\tSystem.out.println(result);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tJSONObject json = JSONObject.fromObject(result);\r\n\t\t\tJSONArray arr = json.getJSONArray(\"data\");\r\n\t\t\tSystem.out.println(keyword+\"==\"+json.getString(\"return_count\"));\r\n\t\t\tfor (Object object : arr) {\r\n\t\t\t\terrobj = object.toString();\r\n\t\t\t\tArticle a = new Article();\r\n\t\t\t\tJSONObject o = (JSONObject)object;\r\n\t\t\t\t\r\n\t\t\t\tif(!o.has(\"id\"))continue;\t\r\n//\t\t\t\tSystem.out.println(o.getString(\"id\"));\r\n\t\t\t\ta.setWid(o.getLong(\"id\"));\r\n\t\t\t\t\r\n\t\t\t\tif(o.has(\"group_id\"))a.setGid(o.getLong(\"group_id\"));\r\n\t\t\t\tif(o.has(\"item_id\"))a.setItemId(o.getLong(\"item_id\"));\r\n\t\t\t\t\r\n\t\t\t\tif(!o.has(\"title\"))continue;\r\n\t\t\t\ta.setTitle(o.getString(\"title\"));\r\n\t\t\t\ta.setSiteId(1L);\r\n\t\t\t\t\r\n\t\t\t\tif(o.has(\"abstract\"))a.setAbstracts(o.getString(\"abstract\"));\r\n\t\t\t\tif(o.has(\"source\"))a.setAuthor(o.getString(\"source\"));\r\n\t\t\t\ta.setReply(o.getInt(\"comments_count\"));\r\n\t\t\t\ta.setPreReply(0);\r\n\t\t \ta.setSeplyStatus(0);\r\n\t\t \ta.setBrandId(brandMap.get(keyword.trim())==null?0:brandMap.get(keyword.trim()));\r\n\t\t \ta.setKeyword(o.getString(\"keywords\"));\r\n\t\t \ta.setPositive(2);\r\n\t\t \ta.setStatus(0);\r\n\t\t \tif(o.has(\"url\"))a.setUrl(o.getString(\"url\"));\r\n\t\t \tif(o.has(\"share_url\"))a.setShareUrl(o.getString(\"share_url\"));\r\n\t\t \tif(o.has(\"datetime\")){\r\n\t\t \t\ta.setReleaseTime(Long.valueOf(DateUtil.dateToStamp(o.getString(\"datetime\")+\":00\") / 1000).intValue());\r\n\t\t \t}else{\r\n\t\t \t\ta.setReleaseTime(0);\r\n\t\t \t}\r\n\t\t \ta.setCreated(Long.valueOf(System.currentTimeMillis() / 1000).intValue());\r\n\t\t \ta.setUpdated(0);\r\n\t\t \ta.setDeleted(0);\r\n\t\t \ta.setIsDanger(0);\r\n\t\t \t\r\n\t\t \t\r\n\t\t \tArticleExample example = new ArticleExample();\r\n\t\t \texample.createCriteria().andWidEqualTo(a.getWid());\r\n\t\t \tlong c = articleMapper.countByExample(example);\r\n\t\t \tif(c == 0){\r\n\t\t \t\tarticleMapper.insert(a);\r\n\t\t \t}else{\r\n\t\t \t\tList<Article> list = articleMapper.selectByExample(example);\r\n\t\t \t\tArticle article = list.get(0);\r\n\t\t \t\tarticle.setPreReply(article.getReply());\r\n\t\t \t\tarticle.setReply(a.getReply());\r\n\t\t \t\tarticleMapper.updateByPrimaryKey(article);\r\n\t\t \t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn \"{\\\"code\\\":1,\\\"message\\\":\\\"成功\\\"}\";\r\n//\t\t\treturn this.writeJsonObject(json);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(errobj);\r\n\t\t}\r\n\t\treturn \"{\\\"code\\\":2,\\\"message\\\":\\\"失败\\\"}\";\r\n\t}",
"@RequestMapping(value = \"/free-cfdis\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE,\n params = {\"idFree_cfdi\", \"folio_fiscal\",\"rfc_receiver\",\"fromDate\", \"toDate\", \"idState\",\"serie\", \"folio\"})\n @Timed\n public ResponseEntity<List<Free_cfdi>> getAllFree_cfdis(@RequestParam(value = \"idFree_cfdi\") Integer idFree_cfdi,\n @RequestParam(value = \"folio_fiscal\") String folio_fiscal,\n @RequestParam(value = \"rfc_receiver\") String rfc_receiver,\n @RequestParam(value = \"fromDate\") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate fromDate,\n @RequestParam(value = \"toDate\") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate toDate,\n @RequestParam(value = \"idState\") Integer idState,\n @RequestParam(value = \"serie\") String serie,\n @RequestParam(value = \"folio\") String folio,\n Pageable pageable)\n throws URISyntaxException {\n log.debug(\"REST request to get a page of Free_cfdis\");\n\n String login = SecurityUtils.getCurrentUserLogin();\n Optional<User> user = userService.getUserWithAuthoritiesByLogin(login);\n if(user.isPresent()){\n boolean administrator = false;\n for(Authority item: user.get().getAuthorities()){\n if(item.getName().compareTo(\"ROLE_ADMIN\")==0){\n administrator = true;\n }\n }\n if(administrator){\n if (idFree_cfdi == 0 && folio_fiscal.compareTo(\" \") == 0 && rfc_receiver.compareTo(\" \") == 0 &&\n fromDate.toString().compareTo(\"0001-01-01\") == 0 && toDate.toString().compareTo(\"0001-01-01\") == 0 &&\n idState == 0 && serie.compareTo(\" \") == 0 && folio.compareTo(\" \") == 0) {\n log.debug(\"Obtener todos para el admin\");\n Page<Free_cfdi> page = free_cfdiService.findAll(pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/free-cfdis\");\n Long idauditevent = new Long(\"36\");\n Audit_event_type audit_event_type = audit_event_typeService.findOne(idauditevent);\n C_state_event c_state_event;\n Long idstate = new Long(\"1\");\n c_state_event = c_state_eventService.findOne(idstate);\n tracemgService.saveTrace(audit_event_type, c_state_event);\n\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }else\n {\n log.debug(\"Obtener alguno para el admin\");\n LocalDate inicio = fromDate;\n LocalDate datefinal = toDate;\n Page<Free_cfdi> page = free_cfdiService.findCustomAdmin(idFree_cfdi, folio_fiscal, rfc_receiver,\n inicio, datefinal, idState, serie, folio, pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/free-cfdis\");\n Long idauditevent = new Long(\"36\");\n Audit_event_type audit_event_type = audit_event_typeService.findOne(idauditevent);\n C_state_event c_state_event;\n Long idstate = new Long(\"1\");\n c_state_event = c_state_eventService.findOne(idstate);\n tracemgService.saveTrace(audit_event_type, c_state_event);\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }\n }else{\n Free_emitter free_emitter = free_emitterService.findOneByUser(userRepository.findOneByLogin(login).get());\n if(free_emitter != null) {\n Long idauditevent = new Long(\"36\");\n Audit_event_type audit_event_type = audit_event_typeService.findOne(idauditevent);\n C_state_event c_state_event;\n Long idstate = new Long(\"1\");\n c_state_event = c_state_eventService.findOne(idstate);\n tracemgService.saveTrace(audit_event_type, c_state_event);\n\n if (idFree_cfdi == 0 && folio_fiscal.compareTo(\" \") == 0 && rfc_receiver.compareTo(\" \") == 0 &&\n fromDate.toString().compareTo(\"0001-01-01\") == 0 && toDate.toString().compareTo(\"0001-01-01\") == 0 &&\n idState == 0 && serie.compareTo(\" \") == 0 && folio.compareTo(\" \") == 0) {\n log.debug(\"Obtener todos\");\n Page<Free_cfdi> page = free_cfdiService.findByFree_emitter(free_emitter, pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/free-cfdis\");\n\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n } else {\n log.debug(\"Obtener alguno\");\n LocalDate inicio = fromDate;\n LocalDate datefinal = toDate;\n Page<Free_cfdi> page = free_cfdiService.findCustom(idFree_cfdi, folio_fiscal, rfc_receiver,\n inicio, datefinal, idState, serie, folio, free_emitter, pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/free-cfdis\");\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }\n }else\n {\n Long idauditevent = new Long(\"36\");\n Audit_event_type audit_event_type = audit_event_typeService.findOne(idauditevent);\n C_state_event c_state_event;\n Long idstate = new Long(\"2\");\n c_state_event = c_state_eventService.findOne(idstate);\n tracemgService.saveTrace(audit_event_type, c_state_event);\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(\"free_cfdi\", \"notfound\", \"Free CFDI not found\")).body(null);\n }\n }\n }\n Long idauditevent = new Long(\"36\");\n Audit_event_type audit_event_type = audit_event_typeService.findOne(idauditevent);\n C_state_event c_state_event;\n Long idstate = new Long(\"2\");\n c_state_event = c_state_eventService.findOne(idstate);\n tracemgService.saveTrace(audit_event_type, c_state_event);\n return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(\"free_cfdi\", \"notfound\", \"Free CFDI not found\")).body(null);\n\n }",
"Object getAll(WebRequest webRequest, HttpServletResponse response, Model model) throws Exception;",
"@GetMapping(\"/offers\")\n @Timed\n public ResponseEntity<List<OfferDTO>> getAllOffers(Pageable pageable) {\n log.debug(\"REST request to get a page of Offers\");\n Page<OfferDTO> page = offerService.findAll(pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/offers\");\n return ResponseEntity.ok().headers(headers).body(page.getContent());\n }",
"@GetMapping(\"/one/{id}\")\n\tpublic ResponseEntity<?> fetchOneData(@PathVariable(\"id\") Integer id) {\n\t\tResponseEntity<?> res = null;\n\t\ttry {\n\t\t\tEmployee emp = service.getOneEmpObject(id);\n\t\t\tres = new ResponseEntity<Employee>(emp, HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\tres = new ResponseEntity<String>(\"Unable Featch Data \", HttpStatus.INTERNAL_SERVER_ERROR);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn res;\n\t}",
"@PostMapping(\"/J314Authorities.pag\")\n\t@Timed\n\t\n\tpublic ResultExt< Page< J314AuthorityPoj >> getAllPag(HttpServletRequest request,HttpServletResponse response, @Valid @RequestBody J314AuthorityCritPaged pag)\n\t{\n\t\t\n\t\tString params=UtilParams.paramsToString(\"J314AuthorityCritPaged\",pag);\n\n\t\tContexto ctx = Contexto.init();\n\t\tctx.put(Contexto.REQUEST,request);\n\t\tctx.put(Contexto.RESPONSE,response);\n\t\tctx.put(Contexto.CLAVE_SEGURIDAD,\"REST_ENTITY_J314AUTHORITY_GETALLPAG\");\n\t\tctx.put(Contexto.URL_SOLICITADA,\"/J314Authorities.pag\");\n\t\tResult< Page< J314AuthorityPoj >> res=new Result<>();\n\t\tif (log.isInfoEnabled()) log.info(\"Entrada en REST POST:getAllPag(\"+params+\")\"+params);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tif(!verificaPermisos(\"REST_ENTITY_J314AUTHORITY_GETALLPAG\"))\n\t\t\t{\n\t\t\t\tres.addError(new ErrorSinPermiso(\"REST_ENTITY_J314AUTHORITY_GETALLPAG\",\"/J314Authorities.pag\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparams=UtilParams.paramsToString(\"J314AuthorityCritPaged\",pag);\n\t\t\t\tif (log.isInfoEnabled()) log.info(\"Verificado en REST POST:getAllPag(\"+params+\")\"+params);\n\n\t\t\t\tJ314AuthorityCritPaged pag_ = pag;\n\n\t\t\t\tResult< Page< J314Authority > > res_=service.findAll(pag_);\n\t\t\t\tres.setInfoEWI(res_);\n\n\t\t\t\tres.setData(J314AuthorityPoj.toPOJOPage(res_.getData()));\n\n\t\t\t}\n\t\t\taddTiempoSesion();\n\t\t}\tcatch(Exception e)\n\t\t{\n\t\t\tres.addError(new ErrorGeneral(e));\n\t\t\tif (log.isErrorEnabled()) log.error(\"Error en REST POST:getAllPag(\"+params+\"). Excepcion:\"+UtilException.printStackTrace(e));\n\t\t}\n\t\tif (log.isInfoEnabled()) log.info(\"Salida de REST POST:getAllPag(\"+params+\"). Resultado:\"+res.toString());\n\n\t\tResultExt< Page< J314AuthorityPoj > > resFin=new ResultExt<>(res,ctx.getAs(\"ticketStr\"));\n\t\tContexto.close();\n\t\treturn resFin;\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException\n\t{\n\t\tJsonResponse json = new JsonResponse();\n\t\tjson.setSuccess(true);\n\t\tProductManager pm = new ProductManager();\n\t\ttry{\n\t\t\tint limit = Integer.MAX_VALUE;\n\t\t\ttry{ limit = Integer.parseInt(WEB.getParam(\"limit\", request)); }catch(NumberFormatException nfe){}\n\t\t\t\n\t\t\tString method = WEB.getParam(\"method\", request);\n\t\t\tString catIdStr = WEB.getParam(\"categoryId\", request);\n\t\t\tString productIdStr = WEB.getParam(\"productId\", request);\n\t\t\tString searchText = WEB.getParam(\"searchText\", request);\n\t\t\tString sortStr = WEB.getParam(\"sort\", request);\n\t\t\tboolean isLimitedEdition = \"true\".equalsIgnoreCase(WEB.getParam(\"isLimitedEdition\", request));\n\t\t\tboolean isDiscounted = \"true\".equalsIgnoreCase(WEB.getParam(\"isDiscounted\", request));\n\t\t\tInteger catId = null; try{ catId = Integer.parseInt(catIdStr); } catch (NumberFormatException nfe){}\n\t\t\tInteger productId = null; try{ productId = Integer.parseInt(productIdStr); } catch (NumberFormatException nfe){}\n\t\t\t\n\t\t\tswitch(method){\n\t\t\t\tcase \"getProductsByCategoryId\":\n\t\t\t\t\tjson.setPayload(pm.getProductsByCategoryId(catId));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"getProductById\":\n\t\t\t\t\tjson.setPayload(pm.getProductById(productId));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"getProductsBySearch\":\n\t\t\t\t\tjson.setPayload(pm.getProductsBySearch(searchText,catId, isLimitedEdition, isDiscounted, sortStr,limit));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"getAllProducts\":\n\t\t\t\t\tjson.setPayload(pm.getAllProducts());\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t//response.sendError(400,\"Invalid method parameter. Specify a valid param, and consider checking the documentation.\");\n\t\t\t\t\tjson.setSuccess(false);\n\t\t\t\t\tjson.setMessage(\"Invalid method parameter(s)\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}catch(NumberFormatException nfe){\n\t\t\tjson.setMessage(nfe.getMessage());\n\t\t\tjson.setSuccess(false);\n\t\t}\n\t\tresponse.getWriter().println(json.toJson());\n\t}",
"@Test\n public void getretrieveOffersByFilterTest() throws IOException {\n ObjectMapper mapper = new ObjectMapper();\n RetrieveOffersByFiltergetResponse response = api.getretrieveOffersByFilter( null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 3, null, null, null, null, null, null, null, null, null, null, null);\n String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(response);\n System.out.println(json);\n }",
"@RequestMapping(value = \"/instEmpEduQualis/currentLogin\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<InstEmpEduQuali> currentInstEmpEduQuali() throws Exception{\n // public List<InstEmpEduQuali> currentInstEmpEduQuali() {\n log.debug(\"REST request to get InstEmpSpouseInfo : {}\");\n //return instEmpEduQualiRepository.findAllByLogin();\n String userName = SecurityUtils.getCurrentUserLogin();\n InstEmployee instEmployeeresult=instEmployeeRepository.findOneByEmployeeCode(userName);\n List<InstEmpEduQuali> instEmpEduQualilist=null;\n /*if(instEmployeeresult !=null && instEmployeeresult.getId()>0){\n log.debug(\"--------------------------------employee result id\"+instEmployeeresult.getId());\n instEmpEduQualilist=rptJdbcDao.findListByInstEmployeeId(instEmployeeresult.getId());\n }\n if(instEmpEduQualilist !=null && instEmpEduQualilist.size()>0){\n return instEmpEduQualilist;\n }else{\n return new ArrayList<>();\n }*/\n log.debug(\"-------------userName---------\"+userName+\"----------employee result id\"+instEmployeeresult.getId());\n //return rptJdbcDao.findListByInstEmployeeId(instEmployeeresult.getId());\n instEmpEduQualilist=instEmpEduQualiRepository.findListByInstEmployeeId(instEmployeeresult.getId());\n /*for(InstEmpEduQuali instEmpEduQuali:instEmpEduQualilist){\n instEmpEduQuali.setCertificateCopy(AttachmentUtil.retriveAttachment(\"/backup/teacher_info/\",instEmpEduQuali.getCertificateCopyName()));\n instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName().substring(0, (instEmpEduQuali.getCertificateCopyName().length() - 17)));\n }*/\n for(InstEmpEduQuali instEmpEduQuali:instEmpEduQualilist){\n if(instEmpEduQuali.getCertificateCopyName()!=null){\n instEmpEduQuali.setCertificateCopy(AttachmentUtil.retriveAttachment(\"/backup/teacher_info/\",instEmpEduQuali.getCertificateCopyName()));\n //instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName().substring(0, (instEmpEduQuali.getCertificateCopyName().length() - 17)));\n instEmpEduQuali.setCertificateCopyName(instEmpEduQuali.getCertificateCopyName());\n }\n }\n return instEmpEduQualilist;\n\n }",
"public void testGetWithLimit() throws Exception\n {\n Log.log(\"TEST\", \"[GetFileTypeListActionTest.testGetWithLimit] Enter \");\n\n// for (int i=0; i<LIST_COUNT; i++)\n// createTestData(_FILE_TYPE+i, _DESCRIPTION+i);\n\n Long[] uIDs = (Long[])findFileTypesKeys(_FILTER).toArray(new Long[_LIST_COUNT]);\n\n _event = createTestEvent(_FILTER, _MAX_PAGE_ENTRIES);\n try\n {\n _response = performEvent(_event);\n }\n catch (Exception ex)\n {\n Log.err(\"TEST\", \"[GetUserAccountListActionTeset.testGetWithLimit] Error Exit \", ex);\n assertTrue(\"Event Exception\", false);\n }\n\n //check response\n assertNotNull(\"response is null\", _response);\n assertTrue(\"event is not successful\", _response.isEventSuccessful());\n assertEquals(\"Msg code incorrect\", IErrorCode.NO_ERROR, _response.getMessageCode());\n\n Object returnData = _response.getReturnData();\n assertNotNull(\"responsedata is null\", returnData);\n assertTrue(\"response data type incorrect\", returnData instanceof EntityListResponseData);\n\n EntityListResponseData listData = (EntityListResponseData)returnData;\n\n assertEquals(\"Rows remaining is incorrect\", _LIST_COUNT-_MAX_PAGE_ENTRIES, listData.getRowsRemaining());\n assertEquals(\"start row is incorrect\", 0, listData.getStartRow());\n assertNotNull(\"List ID is null\", listData.getListID());\n\n Collection entityList = listData.getEntityList();\n assertNotNull(\"Entity list is null\", entityList);\n assertEquals(\"Entity list count is incorrect\", _MAX_PAGE_ENTRIES, entityList.size());\n\n Object[] entityObjs = entityList.toArray();\n for (int i=0; i<_MAX_PAGE_ENTRIES; i++ )\n {\n assertNotNull(\"Entity is null\", entityObjs[i]);\n assertTrue(\"Entity is not Map\", entityObjs[i] instanceof Map);\n\n Map fileTypeMap = (Map)entityObjs[i];\n\n assertEquals(\"UID is incorrect\", uIDs[i], fileTypeMap.get(IFileType.UID));\n assertEquals(\"FileType incorrect\", _FILE_TYPE+i, fileTypeMap.get(IFileType.FILE_TYPE));\n assertEquals(\"Description incorrect\", _DESCRIPTION+i, fileTypeMap.get(IFileType.DESCRIPTION));\n assertEquals(\"ProgramName is incorrect\", _PROGRAM_NAME+i, fileTypeMap.get(IFileType.PROGRAM_NAME));\n assertEquals(\"ProgramPath is incorrect\", _PROGRAM_PATH+i, fileTypeMap.get(IFileType.PROGRAM_PATH));\n assertEquals(\"Parameters is incorrect\", _PARAMETERS+i, fileTypeMap.get(IFileType.PARAMETERS));\n assertEquals(\"WorkingDirectory is incorrect\", _WORKING_DIR+i, fileTypeMap.get(IFileType.WORKING_DIR));\n }\n Log.log(\"TEST\", \"[GetFileTypeListActionTest.testGetWithLimit] Exit \");\n }",
"public List<Entity> getEntitySearchResults(String type, String name, int limit) {\n\t\t//Type parameter will be one of -> {'Artist', 'Band', 'Label', 'Album', 'Track'}\n\t\tString URL = \"http://localhost:8081\" + type;\n\t\tSystem.out.println(\"Request made to: \" + URL);\n\t\tUriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(URL)\n\t\t\t\t.queryParam(\"name\", name)\n\t\t\t\t.queryParam(\"limit\", limit);\n\t\tUriComponents components = builder.build(false);\n\t\tURI uri = components.toUri();\n\t\tList<Entity> entities = restTemplate.getForObject(uri, List.class);\n\t\treturn entities;\n\t}",
"@GET(\"rest/emprego\")\n Call<List<Posto>> callListPostoSINE();",
"@Test(priority=10)\n\tpublic void campaign_user_with_2000_limit() throws URISyntaxException, ClientProtocolException, IOException, ParseException{\n\t\ttest = extent.startTest(\"campaign_user_with_2000_limit\", \"To validate whether user is able to get campaign through campaign/user api with 2000 limit value\");\n\t\ttest.assignCategory(\"CFA GET /campaign/user API\");\n\t\tList<NameValuePair> nvps = new ArrayList<NameValuePair>();\n\t\tnvps.add(new BasicNameValuePair(\"limit\", String.valueOf(Constants.MAX_LIMIT)));\n\t\tCloseableHttpResponse response = HelperClass.make_get_request(\"/v2/campaign/user\", access_token, nvps);\n\t\tAssert.assertTrue(!(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 401), \"Invalid status code is displayed. \"+ \"Returned Status: \"+response.getStatusLine().getStatusCode()+\" \"+response.getStatusLine().getReasonPhrase());\n\t\ttest.log(LogStatus.INFO, \"Execute campaign/user api method with valid parameter\");\n\t\tBufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));\n\t\tString line = \"\";\n\t\twhile ((line = rd.readLine()) != null) {\t \n\t\t // Convert response to JSON object\t\n\t\t JSONParser parser = new JSONParser();\n\t\t JSONObject response_json = (JSONObject) parser.parse(line);\n\t\t JSONArray camp_data_array = (JSONArray)response_json.get(\"data\");\n\t\t Assert.assertEquals(response_json.get(\"result\"), \"success\", \"API does not return success when valid limit value is entered.\");\n\t\t test.log(LogStatus.PASS, \"API returns success when valid 2000 value is entered.\");\n\t\t Assert.assertEquals(response_json.get(\"err\"), null, \"err is not null when 2000 limit value is entered.\");\n\t\t test.log(LogStatus.PASS, \"err is null when valid limit value is entered.\");\n\t\t // Check whether campaign/users returns number of records defined in limit\n\t\t Assert.assertFalse(camp_data_array.size() == 100, \"campaign/users is returning 100 records\");\n\t\t test.log(LogStatus.PASS, \"Check whether campaign/users returns success when 2000 limit value is passed\");\n\t\t}\n\t}",
"@GetMapping(value = {\"/count\", \"/count/\"})\n public ResponseEntity<Void> getEmployeeCount(){\n employeeService.getEmployeeCount();\n return new ResponseEntity<>(HttpStatus.OK);\n }",
"@Test\n public void given_devEnvironmentAndListStudent_when_callEndPointShowStudentByPage_then_returnStatus200ListStudentWithByPageAndSize() throws Exception {\n Page<Student> studentPage = new PageImpl<>(STUDENT_LIST);\n when(studentRepo.findAll(any(PageRequest.class))).thenReturn(studentPage);\n\n RequestBuilder request = MockMvcRequestBuilders\n .get(\"/students/paging\")\n .accept(MediaType.APPLICATION_JSON)\n .param(\"page\", \"1 \")\n .param(\"size\", \"4\");\n\n mockMvc.perform(request)\n .andExpect(status().isOk())\n .andExpect(content().json(gson.toJson(studentPage.getContent())))\n .andDo(MockMvcResultHandlers.print())\n .andReturn();\n\n }",
"@RequestMapping(value = \"/v2/employees\", method = RequestMethod.GET)\r\n\tpublic List<Employee> employeev2() {\r\n JPAQuery<?> query = new JPAQuery<Void>(em);\r\n QEmployee qemployee = QEmployee.employee;\r\n List<Employee> employees = (List<Employee>) query.from(qemployee).fetch();\r\n // Employee oneEmp = employees.get(0);\r\n\t\treturn employees;\r\n }",
"@GetMapping(produces=\"application/json\" )\n public ResponseEntity<PaginatedResponse> getAllProducts(@RequestParam Map<String, String> requestParams) {\n \n int limit = DEFAULT_LIMIT;\n if (requestParams.containsKey(\"limit\")) {\n limit = Integer.parseInt(requestParams.get(\"limit\"));\n }\n \n int page = FIRST_PAGE;\n if (requestParams.containsKey(\"page\")) {\n page = Integer.parseInt(requestParams.get(\"page\"));\n }\n \n List<Product> products = productDao.findAll(requestParams);\n int numberOfProducts = products.size();\n \n int endValue = (page * limit) + limit;\n if (endValue > numberOfProducts) {\n endValue = numberOfProducts;\n }\n \n LOGGER.debug(\"total: {} page: {} end: {}\", numberOfProducts, page, endValue);\n\n // only provide a page worth of data\n products = products.subList(page * limit, endValue);\n \n // add self links to each product\n products.forEach(p -> {\n p.add(linkTo(methodOn(ProductSearchService.class).getProduct(p.getProductId())).withSelfRel());\n });\n \n return new ResponseEntity<>(new PaginatedResponse(numberOfProducts, requestParams, products, page, limit), HttpStatus.OK);\n }",
"@GetMapping(\"/employees\")\r\n\tpublic List<Employee> list() {\r\n\t return empService.listAll();\r\n\t}",
"Collection<EmployeeDTO> getAll();",
"@GetMapping(\"/employee\")\r\n\tpublic List<Employee> getAllEmployees()\r\n\t{\r\n\t\treturn empdao.findAll();\r\n\t}",
"@RequestMapping(value = \"/employees\")\n\tpublic String getAllEmployess(@RequestParam String user,HttpServletRequest request,HttpServletResponse response,Model mv) throws JsonMappingException, JsonProcessingException\n\t{\n\t\tList<Employee> empList = RestCalls.getAllEmployees();\n\t\tmv.addAttribute(\"empList\",empList);\n\t\tmv.addAttribute(\"auth\", \"true\");\n\t\tmv.addAttribute(\"user\", user);\n\t\treturn \"employeedetails.jsp\";\n\t}",
"@GetMapping(\"/J314Authorities\")\n\t@Timed\n\t\n\tpublic ResultExt< List< J314AuthorityPoj >> getAll(HttpServletRequest request,HttpServletResponse response)\n\t{\n\t\t\n\t\tString params=UtilParams.paramsToString();\n\n\t\tContexto ctx = Contexto.init();\n\t\tctx.put(Contexto.REQUEST,request);\n\t\tctx.put(Contexto.RESPONSE,response);\n\t\tctx.put(Contexto.CLAVE_SEGURIDAD,\"REST_ENTITY_J314AUTHORITY_GETALL\");\n\t\tctx.put(Contexto.URL_SOLICITADA,\"/J314Authorities\");\n\t\tResult< List< J314AuthorityPoj >> res=new Result<>();\n\t\tif (log.isInfoEnabled()) log.info(\"Entrada en REST GET:getAll(\"+params+\")\"+params);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tif(!verificaPermisos(\"REST_ENTITY_J314AUTHORITY_GETALL\"))\n\t\t\t{\n\t\t\t\tres.addError(new ErrorSinPermiso(\"REST_ENTITY_J314AUTHORITY_GETALL\",\"/J314Authorities\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tparams=UtilParams.paramsToString();\n\t\t\t\tif (log.isInfoEnabled()) log.info(\"Verificado en REST GET:getAll(\"+params+\")\"+params);\n\n\t\t\t\tResult< List< J314Authority > > res_=service.findAll();\n\t\t\t\tres.setInfoEWI(res_);\n\n\t\t\t\tres.setData( J314AuthorityPoj.toPOJOList(res_.getData()));\n\n\t\t\t}\n\t\t\taddTiempoSesion();\n\t\t}\tcatch(Exception e)\n\t\t{\n\t\t\tres.addError(new ErrorGeneral(e));\n\t\t\tif (log.isErrorEnabled()) log.error(\"Error en REST GET:getAll(\"+params+\"). Excepcion:\"+UtilException.printStackTrace(e));\n\t\t}\n\t\tif (log.isInfoEnabled()) log.info(\"Salida de REST GET:getAll(\"+params+\"). Resultado:\"+res.toString());\n\n\t\tResultExt< List< J314AuthorityPoj > > resFin=new ResultExt<>(res,ctx.getAs(\"ticketStr\"));\n\t\tContexto.close();\n\t\treturn resFin;\n\t}",
"@Test\n public void testTransplantListEndpointQueryAge() {\n String lowerBound = \"1970-01-01\";\n String upperBound = \"2018-09-27\";\n ResponseEntity response = dataController.getTransplantWaitingListRange(null,null,\"12\",null,upperBound, lowerBound);\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"@Test\n public void testReceiverAgeEndpointCombo() {\n ResponseEntity response = dataController.getReceiverDataAge(\"M\", null, \"Canterbury\");\n assertNotNull(response.getBody());\n assertEquals(HttpStatus.OK, response.getStatusCode());\n }",
"private void getCities(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n\t\t\n\t\tCitiesServiceImpl cities = new CitiesServiceImpl();\n\t\t\n\t\t\n\t\tString parameter = req.getParameter(\"\");\n\t\tList<Cities> select = cities.selectAllId(\"2\");\n\t\t\n\t\t\n\t\t\n\t\tGson gson =new GsonBuilder()\n\t\t.create();\n\t\tString json = gson.toJson(select); \n\t\tSystem.out.println(\"json:\"+json);\n\t\tPrintWriter writer = resp.getWriter();\n\t\twriter.print(json); // 返回数据给前台\n\t\twriter.close();\n\t\n\t}",
"@Test\n\tpublic void test_get_product_pagination_return_200() throws Exception {\n\t\tPrincipal mockPrincipal = Mockito.mock(Principal.class);\n\t\tMockito.when(mockPrincipal.getName()).thenReturn(\"1\");\n\t\tProductDTO expected = DummyData.getProductDto1();\n\t\tMockHttpServletRequestBuilder mockRequest = MockMvcRequestBuilders.request(HttpMethod.GET, \"/?name=Gucci&brand=gucci&color=blue&priceFrom=400&priceTo=500&sort=name,asc&page=0&size=10\")\n\t\t\t\t.principal(mockPrincipal)\n\t\t\t\t.contentType(MediaType.APPLICATION_JSON)\n\t\t\t\t.accept(MediaType.APPLICATION_JSON);\n\n\t\t// Setup when\n\t\twhen(productService.getProductPage(ArgumentMatchers.any(), ArgumentMatchers.any())).thenReturn(Arrays.asList(expected));\n\t\t\n\t\t// Execute the POST request\n\t\tmockMvc.perform(mockRequest)\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t// Validate the response code and content type\n\t\t\t\t.andExpect(MockMvcResultMatchers.content().contentType(MediaType.APPLICATION_JSON))\n\t\t\t\t// Validate the returned fields\n\t\t\t\t.andExpect(jsonPath(\"$\").isArray())\n\t\t\t\t.andExpect(jsonPath(\"$[0].brand\", Is.is(expected.getBrand())))\n\t\t\t\t.andExpect(jsonPath(\"$[0].color\", Is.is(expected.getColor())))\n\t\t\t\t.andExpect(jsonPath(\"$[0].name\", Is.is(expected.getName()))).andReturn();\n\n\t\t// verify\n\t\tverify(productService).getProductPage(ArgumentMatchers.any(), ArgumentMatchers.any());\n\t}",
"@GET\n @Path(\"/\")\n @Produces(\"application/json\")\n public Response all() {\n // Return some cliched textual content\n return Response.ok(\"clients list goes here\", MediaType.APPLICATION_JSON).build();\n }",
"public interface ProductionReportReadService {\n\n /**\n * 根据id查询生产记录单条\n * @param id 主键 id\n * @return ProductionReport 对象\n */\n Response<ProductionReport> findById(Long id);\n /**\n * @param id 主 键\n * @return 状态\n */\n Response<Map<String, Object>> findStatusById(Long id);\n /**\n * 按状态查询当前养殖场的生产记录列表\n */\n Response<Paging<ProductionReport>> pagingProductionReport(Integer pageNo, Integer pageSize,Integer status,Long breedFactoryId);\n\n /**\n *存栏数合计值(只统计当前养殖场已生效,状态写死)\n */\n Response<Map> sumRestockBreedFactoryId(Long breedFactoryId);\n\n\n /**\n *按从日期、到日期和养殖场名称查询本市养殖场生产记录列表\n */\n Response<Paging<ProductionReport>> pagingProductionReports(Integer pageNo, Integer pageSize, Long breedFactoryId, Integer breedType, Date fromDate, Date toDate);\n\n /**\n * 政府端按物种统计存栏数合计值\n */\n Response<List<Map<String , Object>>>sumSpeciesStatistics(Long breedFactoryId);\n\n /**\n * 政府端按物种统计存栏数合计值\n * @param breedFactoryIds 养殖场ids\n * @return List<Map<String, Object>>\n */\n Response<List<Map<String, Object>>> sumChangeQuantityByAnimalType(List<Long> breedFactoryIds);\n\n /**\n * 按从日期、到日期和养殖场名称查询本市养殖场生产记录列表\n * @param pageNo 页码\n * @param pageSize 每页多少条\n * @param fromDate 从日期\n * @param toDate 到日期\n * @param breedFactoryIds 养殖场ids\n * @return Paging<ProductionReport>\n */\n Response<Paging<ProductionReport>> pagingProductionReportByArea(Integer pageNo, Integer pageSize,Date fromDate, Date toDate,List<Long> breedFactoryIds);\n\n /**\n *根据时间起始 状态 提交未提交 养殖厂查询(web端)\n */\n Response<Paging<ProductionReport>> pagingbytimes (Integer pageNo, Integer pageSize, Map<String,Object> criteria);\n\n /**\n * 根据第三种类 分组求和\n * @return List<Map<String , Object>>\n */\n Response<List<Map<String , Object>>> countSumByThirdType(Long breedFactoryId);\n\n ProductionReport findProductByRelateId(Long relateId);\n}",
"@ResponseBody\n\t@GetMapping(\"/employees\")\n\tpublic List<Employee> listEmployees() {\n\t\tList<Employee> theEmployees = employeeDAO.getEmployees();\n\t\t\n\t\treturn theEmployees;\n\t}",
"@CrossOrigin(origins = \"http://localhost:3000\")\n @RequestMapping(value = \"/get\", method = RequestMethod.GET, produces = \"application/json\")\n Page<Student> getStudentsByPagination(@RequestParam(value = \"page\", required = false) int page,\n @RequestParam(value = \"size\", required = false) int size){\n page = page <0 ? PAGINATION_DEFAULT_PAGE : page;\n size = (size <0) ? PAGINATION_DEFAULT_SIZE: size;\n return studentService.findAllByPaging(PageRequest.of(page, size));\n }",
"public String fillRequestBody(){\n\n Gson gson = new Gson();\n ApiSetlistRequestDTO apiSetlistRequestDTO = gson.fromJson(fileOperations.bufferedReader(configurationGet.getApiSetlistRequestJSonBodyResourcePath()), ApiSetlistRequestDTO.class);\n\n apiSetlistRequestDTO.setPage(30303030);\n apiSetlistRequestDTO.setPerPage(8888888);\n apiSetlistRequestDTO.setTotal(300000000);\n apiSetlistRequestDTO.setTotalPages(88888888);\n\n Datum data = new Datum();\n data.setId(10);\n data.setName(\"fghfdasfghgfdsfg\");\n data.setYear(453453);\n data.setColor(\"#f43242\");\n data.setPantoneValue(\"Test dfgfdgfdg Value\");\n\n Datum data2 = new Datum();\n data2.setId(15);\n data2.setName(\"burak\");\n data2.setYear(19);\n data2.setColor(\"#tyuyrefe\");\n data2.setPantoneValue(\"fsd\");\n\n List<Datum> datumList = apiSetlistRequestDTO.getData();\n datumList.set(0,data);\n datumList.set(5,data2);\n\n apiSetlistRequestDTO.setData(datumList);\n\n /*for (Datum data : exampleTestClass.getData()){\n data.setId(10);\n data.setName(\"Sarı\");\n data.setYear(5000);\n data.setColor(\"#999999999\");\n data.setPantoneValue(\"Test Pandone Value\");\n }*/\n\n logger.info(\"Manipule Edilen Data:\" + gson.toJson(apiSetlistRequestDTO));\n\n return gson.toJson(apiSetlistRequestDTO);\n }",
"@Headers({\n \"Accept: application/json\",\n \"User-Agent: Mozilla/5.0\"\n })\n @GET(\"/products/\")\n Call<List<Product>> listProduct();",
"@Override\r\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n WebFunction.JsonHeaderInit(resp);\r\n ArticleService svc=new ArticleService();\r\n JSONObject ResultJson = svc.GetType(\"1\");\r\n WebFunction.ResponseJson(resp, ResultJson);\r\n }",
"@Override\n public Response intercept(Chain chain) throws IOException {\n Request request = chain.request();\n Request.Builder newRequest;\n\n newRequest = request.newBuilder()\n .addHeader(\"Content-type\", \"application/json;charset=UTF-8\")\n .addHeader(\"Accept\", \"application/json\");\n return chain.proceed(newRequest.build());\n }",
"@GetMapping(value=\"/searchEmpData/{fname}\")\n\tpublic List<Employee> getEmployeeByName(@PathVariable (value = \"fname\") String fname)\n\t{\n\t\treturn integrationClient.getEmployees(fname);\n\t}",
"@Test\n public void given_devEnvironmentAndListStudent_when_callEndpointFindAll_then_returnListStudentAndStatus200() throws Exception {\n\n when(studentRepo.findAll()).thenReturn(STUDENT_LIST);\n\n RequestBuilder request = MockMvcRequestBuilders\n .get(\"/students\")\n .accept(MediaType.APPLICATION_JSON);\n\n mockMvc.perform(request)\n .andExpect(status().isOk())\n .andExpect(content().json(gson.toJson(STUDENT_LIST),true))\n .andReturn();\n }",
"@GetMapping(\"/GetAllEmployees\")\r\n public List<Employee> viewAllEmployees() {\r\n return admin.viewAllEmployees();\r\n }",
"@Override\r\n JSONObject doPerform(HttpServletRequest req, HttpServletResponse response) throws Exception {\r\n JSONObject jo = new JSONObject();\r\n try {\r\n JSONObject json;\r\n if (req.getMethod().equals(\"POST\")) {\r\n String js = IOUtils.toString(req.getInputStream(), \"UTF-8\");\r\n json = new JSONObject(js);\r\n } else {\r\n json = new JSONObject(req.getParameter(\"json\"));\r\n }\r\n OfferRecord or = OfferRecord.fromJSON(json);\r\n JSONObject ret = new JSONObject(SolrIndexerCommiter.indexJSON(new JSONObject(JSON.toJSONString(or)), \"offersCore\"));\r\n\r\n// Indexer indexer = new Indexer();\r\n// indexer.indexWanted(or.doc_code,\r\n// UsersController.toKnihovna(req).getCode(),\r\n// or.chci);\r\n return ret;\r\n\r\n } catch (Exception ex) {\r\n LOGGER.log(Level.SEVERE, null, ex);\r\n jo.put(\"error\", ex.toString());\r\n }\r\n return jo;\r\n\r\n }",
"@Override\n public void intercept(RequestInterceptor.RequestFacade request) {\n request.addHeader(\"Accept\", \"application/json\");\n }",
"@GetMapping()\n\tprotected ResponseEntity<Page<Alerta>> getAllAlertas(){\n\t\t\n\t\tPage<Alerta> alertas = service.getAllAlertas(0, 10000);\n\t\t\n\t\tif(alertas == null)\n\t\t\treturn ResponseEntity.notFound().build();\n\t\t\n\t\treturn ResponseEntity.ok(alertas);\n\t}",
"@GET\n @Path(\"/getAll\")\n @Produces(MediaType.APPLICATION_JSON)\n public Response getJson() {\n \n \ttry \n \t{\n \t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", \"*\").entity(servDoctores.getDoctores().toString()).build();\n \t} catch (Exception e) {\n\n \t\te.printStackTrace();\n \t\treturn Response.status(Response.Status.NO_CONTENT).build();\n \t}\n }",
"@RequestMapping(value = \"/drivers\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public ResponseEntity<List<Driver>> getAll(@RequestParam(value = \"page\" , required = false) Integer offset,\n @RequestParam(value = \"per_page\", required = false) Integer limit)\n throws URISyntaxException {\n Page<Driver> page = driverRepository.findAll(PaginationUtil.generatePageRequest(offset, limit));\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/drivers\", offset, limit);\n return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n }",
"public Response getRequestForGetAPI(String endpoint) {\n response = given().contentType(ContentType.JSON)\n .when()\n .get(endpoint)\n .then()\n .extract().response();\n\n System.out.println(\"Response of API :\"+response.getBody().asString());\n\n String body = response.getBody().asString();\n JSONArray responseArray= new JSONArray(body);\n comment.setBody(responseArray);\n return response;\n\n }",
"@GetMapping(value=\"/employes\")\n\tpublic List<Employee> getEmployeeDetails(){\n\t\t\n\t\tList<Employee> employeeList = employeeService.fetchEmployeeDetails();\n\t\treturn employeeList;\t\t\t\t\t\t\n\t}",
"@GetMapping(\"all\")\n @PreAuthorize(\"hasAnyRole('admin', 'customer')\")\n @ApiOperation(value = \"Retrieve all products from database\")\n @ApiResponses(value = {\n @ApiResponse(code = 200, message = \"Products received.\"),\n @ApiResponse(code = 400, message = \"Conflict while parsing.\"),\n @ApiResponse(code = 401, message = \"The user does not have valid authentication credentials for the target resource.\"),\n @ApiResponse(code = 403, message = \"User does not have permission (Authorized but not enough privileges)\"),\n @ApiResponse(code = 404, message = \"The requested resource could not be found.\"),\n @ApiResponse(code = 500, message = \"Server Internal Error at executing request.\")\n })\n // Retrieve all products in database.\n public ResponseEntity<String> getAllProducts() {\n // When request successfully reach controller, each controller will empty security context.\n SecurityContextHolder.getContext().setAuthentication(null);\n // Query database using Data Access Object classes.\n DbResult dbResult = new Select().findAllProducts();\n if (dbResult.isEmpty()) return new ResponseEntity(\"Product not found.\", HttpStatus.NOT_FOUND);\n TreeSet<Product> productSet = dbResult.getResult(TreeSet.class);\n // Each database successful response will be wrapped in a ResponseEntity object after parsed to a Data Transfer Object.\n // In case of exception, the response will be wrapped in a ResponseStatusException object.\n try{\n RequestBodyParse dto = new RequestBodyParse(productSet);\n return new ResponseEntity(dto.getJsonSet().toString(), HttpStatus.OK);\n }\n catch (Exception exc){\n throw new ResponseStatusException(HttpStatus.CONFLICT, exc.getMessage(), exc);\n }\n }"
] | [
"0.7110719",
"0.7079356",
"0.6890686",
"0.6730251",
"0.66303307",
"0.65872496",
"0.6408397",
"0.6403947",
"0.63412714",
"0.63139796",
"0.6301909",
"0.62449795",
"0.6241587",
"0.6230968",
"0.61496496",
"0.6132015",
"0.6123287",
"0.6113715",
"0.60457873",
"0.60377985",
"0.6015158",
"0.60147774",
"0.60081464",
"0.59801733",
"0.59747165",
"0.5966992",
"0.5955574",
"0.5955045",
"0.5915421",
"0.5900255",
"0.5877697",
"0.5876935",
"0.5849495",
"0.58330137",
"0.5824054",
"0.58234805",
"0.58168286",
"0.5816257",
"0.57900685",
"0.57796055",
"0.57741266",
"0.5768542",
"0.57611334",
"0.5760934",
"0.57575536",
"0.57399493",
"0.5739145",
"0.57348824",
"0.5691674",
"0.5683231",
"0.56814784",
"0.5644002",
"0.562576",
"0.56108105",
"0.56062704",
"0.56008875",
"0.559733",
"0.55918515",
"0.5583845",
"0.55811465",
"0.5569918",
"0.5566155",
"0.555701",
"0.55542994",
"0.55535096",
"0.55445176",
"0.5542977",
"0.5542919",
"0.5538703",
"0.5530365",
"0.5520723",
"0.5512479",
"0.55111563",
"0.54940575",
"0.54861295",
"0.54780656",
"0.5476061",
"0.54699653",
"0.5467956",
"0.54648286",
"0.54636383",
"0.5457343",
"0.54416835",
"0.54332846",
"0.54308164",
"0.54298985",
"0.5429351",
"0.54284436",
"0.5427678",
"0.5426215",
"0.5425386",
"0.5422857",
"0.5415656",
"0.541549",
"0.54150903",
"0.54126996",
"0.5401568",
"0.5397096",
"0.5388162",
"0.53877306"
] | 0.6683532 | 4 |
working with json file | @Test
public void readJSONFromFile() {
JsonPath jsonFile = new JsonPath(new File ("C:\\Users\\cmlzd\\Desktop\\employees.json"));
System.out.println(jsonFile.getString("items.email"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Integer loadJSONFile()\n {\n JSONParser parser = new JSONParser();\n try{\n\n Object obj = parser.parse(new FileReader(\"/Users/rnuka/Desktop/sample.json\"));\n JSONObject jsonObj = (JSONObject)obj;\n\n Long age = (Long)jsonObj.get(\"age\");\n System.out.println(\"age:\"+age);\n\n String name = (String)jsonObj.get(\"name\");\n System.out.println(\"name:\" + name);\n\n JSONArray address = (JSONArray)jsonObj.get(\"address\");\n\n for(Object str : address){\n System.out.println(str);\n }\n\n\n\n }catch(Exception e){\n e.printStackTrace();\n }\n return 1;\n }",
"private void readFromJSON(String filename) {\n JSONParser parser = new JSONParser();\n\n try\n {\n Object obj = parser.parse(new FileReader(filename));\n JSONObject jsonObject = (JSONObject) obj;\n Menu drinks = getMenu(jsonObject, \"Drink\");\n Menu types = getMenu(jsonObject, \"Type\");\n Menu toppings = getMenu(jsonObject, \"Toppings\");\n Menu sizes = getMenu(jsonObject, \"Size\");\n menuMap.put(\"Drink\", drinks);\n menuMap.put(\"Size\", sizes);\n menuMap.put(\"Toppings\", toppings);\n menuMap.put(\"Type\", types);\n\n } catch (FileNotFoundException e) {\n System.out.println(\"Not found menu.json, exit now.\");\n System.exit(1);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n }",
"private JSONObject readJSONFile(Path path) throws ExtensionManagementException {\n\n if (Files.exists(path) && Files.isRegularFile(path)) {\n try {\n String jsonString = FileUtils.readFileToString(path.toFile(), UTF8);\n return new JSONObject(jsonString);\n } catch (JSONException e) {\n throw new ExtensionManagementException(\"Error while parsing JSON file: \" + path, e);\n } catch (IOException e) {\n throw new ExtensionManagementException(\"Error while reading JSON file: \" + path, e);\n }\n } else {\n throw new ExtensionManagementException(\"JSON file not found: \" + path);\n }\n }",
"public static void main(String[] args) throws FileNotFoundException {\r\n\t\tJsonParser parser = Json.createParser(new FileReader(JSON_FILE_NAME));\r\n\t\t\r\n\t\t// parse the file\r\n\t\twhile (parser.hasNext()) {\r\n\t\t\tJsonParser.Event event = parser.next();\r\n\t\t\tif (event.equals(JsonParser.Event.KEY_NAME)) {\r\n\t\t\t\tString key = parser.getString();\r\n\t\t\t\tparser.next();\r\n\t\t\t\tString value = parser.getString();\r\n\t\t\t\tSystem.out.printf(\">> %s: %s\\n\", key, value);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}",
"private JsonObject loadJSONFile(String jsonFilePath) throws IOException {\r\n\tInputStream is = new FileInputStream(jsonFilePath);\r\n\tJsonReader jsonReader = Json.createReader(is);\r\n\tJsonObject json = jsonReader.readObject();\r\n\tjsonReader.close();\r\n\tis.close();\r\n\treturn json;\r\n }",
"@Override\n public String toString() {return \"Json-File Reader\";}",
"private static JSONObject fileReader(String path) throws Exception{\r\n return (JSONObject) jsonParser.parse(new String(Files.readAllBytes(Paths.get(path))));\r\n }",
"private static JsonObject readJSON(String path) {\n\n\t\tString fileContents = \"\";\n\t\tBufferedReader reader = null;\n\n\t\ttry {\n\t\t\treader = new BufferedReader(new FileReader(path));\n\t\t} catch (FileNotFoundException e) {\n\t\t\tfail(ErrorMessage.inputFileNotFoundError);\n\t\t}\n\n\t\tString line;\n\n\t\ttry {\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tfileContents += line;\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tfail(ErrorMessage.readFileError);\n\t\t}\n\n\t\ttry {\n\t\t\treader.close();\n\t\t} catch (IOException e) {\n\t\t\tfail(ErrorMessage.closeFileError);\n\t\t}\n\n\t\tJsonObject jsonLicense = Json.createReader(new StringReader(fileContents)).readObject();\n\n\t\treturn jsonLicense;\n\t}",
"public static void initialize() {\r\n\t\tjson = new JSONFile(filePath);\t\r\n\t}",
"public static void readFile(String filename) {\n JSONParser jsonParser = new JSONParser();\n try (Reader reader = new FileReader(filename)) {\n JSONObject jo = (JSONObject) jsonParser.parse(reader);\n\n SHORT_PERIOD = (int) (long) jo.get(\"shortPeriod\");\n LONG_PERIOD = (int) (long) jo.get(\"longPeriod\");\n AVG_AMOUNT_PERIOD = (int) (long) jo.get(\"avgAmountPeriod\");\n SESSION_INTERVAL = (int) (long) jo.get(\"sessionInterval\");\n\n\n } catch (IOException | ParseException e) {\n e.printStackTrace();\n }\n }",
"public static LinkedTreeMap<String, Object> importJsonData( String filePath, boolean assetFile )\n {\n FileReader reader = null;\n LinkedTreeMap<String, Object> fileData = null;\n\n if( assetFile )\n {\n AssetManager mgr = WeatherLionApplication.getAppContext().getAssets();\n String filename;\n\n try\n {\n filename = WeatherLionApplication.OPEN_SOURCE_LICENCE;\n InputStream in = mgr.open( filename, AssetManager.ACCESS_BUFFER );\n Writer writer = new StringWriter();\n char[] buffer = new char[ 1024 ];\n\n try\n {\n Reader assetReader = new BufferedReader( new InputStreamReader( in, StandardCharsets.UTF_8 ) );\n int n;\n\n while ( ( n = assetReader.read( buffer ) ) != -1 )\n {\n writer.write( buffer, 0, n) ;\n }// end of while loop\n }// end of try block\n catch ( IOException e )\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE, e.getMessage(),\n TAG + \"::importJsonData [line: \" +\n UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n\n Gson gson = new Gson();\n\n // convert the file JSON into a list of objects\n fileData = gson.fromJson( writer.toString(),\n new TypeToken<LinkedTreeMap<String, Object>>(){}.getType() );\n\n in.close();\n }// end of try block\n catch ( IOException e )\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE, e.getMessage(),\n TAG + \"::importJsonData [line: \" +\n UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n }// end of if block\n else\n {\n try\n {\n File file = new File( filePath );\n\n // if the is a file present then it will contain a list with at least on object\n if( file.exists() )\n {\n reader = new FileReader( file );\n Gson gson = new Gson();\n\n // convert the file JSON into a list of objects\n fileData = gson.fromJson( reader,\n new TypeToken<LinkedTreeMap<String, Object>>(){}.getType() );\n }// end of if block\n\n }// end of try block\n catch ( FileNotFoundException | JsonSyntaxException e )\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE, e.getMessage(),\n TAG + \"::importJsonData [line: \" +\n UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n finally\n {\n // close the file reader object\n if( reader != null )\n {\n try\n {\n reader.close();\n } // end of try block\n catch (IOException e)\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE,\n e.getMessage(),TAG + \"::importJsonData [line: \"\n + UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n }// end of if block\n }// end of finally block\n }// end of else block\n\n return fileData;\n }",
"private void loadJSON() throws FileNotFoundException\n\t{\n\n\t\tGsonBuilder builder= new GsonBuilder();\n\t\tGson gson = builder.create();\n\t\t\t\t\n\t\t//get a list of folders in the data directory\n\t\t\n\t\tFile[] directories = new File(\"data\").listFiles();\n\n\t\t//Loop through folders in data directory\n\t\tfor(File folder : directories)\n\t\t\t{\n\t\t\t\t//get a list of files inside the folder\n\t\t\t\tFile[] jsonItems = new File(folder.toString()).listFiles();\n\t\t\t\t\n\t\t\t\t//Loop through files inside the folder \n\t\t\t\tfor(File file : jsonItems)\n\t\t\t\t{\n\t\t\t\t\t//Store in directory map... substring to remove the \"data/\" portion... placed by filename to foldername\n\t\t\t\t\tString dir = file.toString().substring(5);\n\t\t\t\t\t\n\t\t\t\t\t//Generate player data from gson\n\t\t\t\t\tJsonReader reader = new JsonReader(new FileReader(file));\n\t\t\t\t\tPlayer player = gson.fromJson(reader, Player.class);\n\t\t\t\t\t\n\t\t\t\t\t//Store it in the map tied to it's directory\n\t\t\t\t\tplayerData.put(dir, player);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"private static JSONTile parse(String configFile) {\n Gson gson = new Gson();\n\n try (BufferedReader reader = new BufferedReader(\n new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8))) {\n return gson.fromJson(reader, JSONTile.class);\n } catch (IOException e) {\n throw new IllegalArgumentException(\"Error when reading file: \" + configFile, e);\n }\n }",
"public static void main(String[] args) throws IOException {\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(\"./output.json\"), \"utf-8\"));\n String line = new Scanner(new File(\"src/movie.json\")).useDelimiter(\"\\\\A\").next();\n System.out.println(line);\n long drama=0;\n long action=0;\n long horror=0;\n long thriller=0;\n long comedy=0;\n long adventure=0;\n\n try {\n JSONParser parser = new JSONParser();\n JSONArray jsonArray = (JSONArray) parser.parse(line);\n Iterator<JSONObject> iterator = jsonArray.iterator();\n while(iterator.hasNext()) {\n JSONObject next = iterator.next();\n switch ((String)next.get(\"장르\")) {\n case \"드라마\":\n drama += Long.parseLong((String)next.get(\"수익(전세계)\"));\n break;\n case \"액션\":\n action += Long.parseLong((String)next.get(\"수익(전세계)\"));\n break;\n case \"호러\":\n horror += Long.parseLong((String)next.get(\"수익(전세계)\"));\n break;\n case \"스릴러\":\n thriller += Long.parseLong((String)next.get(\"수익(전세계)\"));\n break;\n case \"코미디\":\n comedy += Long.parseLong((String)next.get(\"수익(전세계)\"));\n break;\n case \"어드벤처\":\n adventure += Long.parseLong((String)next.get(\"수익(전세계)\"));\n break;\n }\n }\n JSONArray resultArray = new JSONArray();\n JSONObject dramaObj = new JSONObject();\n dramaObj.put(\"장르\", \"드라마\");\n dramaObj.put(\"수익\", drama);\n JSONObject actionObj = new JSONObject();\n actionObj.put(\"장르\", \"액션\");\n actionObj.put(\"수익\", action);\n JSONObject horrorObj = new JSONObject();\n horrorObj.put(\"장르\", \"호러\");\n horrorObj.put(\"수익\", horror);\n JSONObject thrillerObj = new JSONObject();\n thrillerObj.put(\"장르\", \"스릴러\");\n thrillerObj.put(\"수익\", thriller);\n JSONObject comedyObj = new JSONObject();\n comedyObj.put(\"장르\", \"코미디\");\n comedyObj.put(\"수익\", comedy);\n JSONObject adventureObj = new JSONObject();\n adventureObj.put(\"장르\", \"어드벤처\");\n adventureObj.put(\"수익\", adventure);\n\n resultArray.add(dramaObj);\n resultArray.add(actionObj);\n resultArray.add(horrorObj);\n resultArray.add(thrillerObj);\n resultArray.add(comedyObj);\n resultArray.add(adventureObj);\n bw.write(resultArray.toString());\n } catch (ParseException e) {\n e.printStackTrace();\n }\n bw.close();\n }",
"public static void loadPracticeListFromFile() {\n JSONParser jsonParser = new JSONParser();\n\n try (FileReader reader = new FileReader(\"src/practiceList.json\")) {\n // Read JSON file\n Object object = jsonParser.parse(reader);\n\n //Iterate over word list array\n JSONArray wordList = (JSONArray) object;\n for (Object o : wordList) {\n\n JSONObject next = (JSONObject) o;\n String extra = \"\";\n\n if (((String) next.get(\"wordType\")).equalsIgnoreCase(\"verb\")) {\n extra = \"to \";\n }\n\n Word loadedWord = new Word(extra + next.get(\"english\"), (String) next.get(\"welsh\"), (String) next.get(\"wordType\"));\n\n addIntoPracticedWords(loadedWord);\n }\n\n } catch (ParseException | IOException e) {\n System.out.println(\"PracticeList file not found, will be created on exit.\");\n }\n }",
"public static Books readJSON(){\n Gson gson = new GsonBuilder().create();\n Books books = new Books();\n try {\n books = gson.fromJson(new JsonReader(new FileReader(\"books.json\")), Books.class);\n } catch (IOException e){\n e.printStackTrace();\n }\n return books;\n }",
"@Override\n public Object loadFromJson(Context context) {\n Gson gson = new Gson();\n String json = FileManager.getInstance().loadFromFile(getFileName(), context);\n if(json.equals(\"\")) {\n return null;\n }\n\n return gson.fromJson(json, MatchStorage.class);\n\n }",
"private void inflateFromFile() {\n\t\t\n\t\tFile file = null;\t\t\n\t\ttry {\n\t\t\tfile = new File(FILE_PATH);\n\t\t} catch (NullPointerException e) {\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\tFileReader reader = null;\t\t\n\t\ttry {\n\t\t\treader = new FileReader(file);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Can't find source (json file)\");\n\t\t\tSystem.err.println(e.getMessage());\n\t\t\tSystem.exit(1);\n\t\t\t\n\t\t}\n\t\t\n\t\tJSONObject jsonObject = new JSONObject(\n\t\t\t\tnew JSONTokener(reader)\n\t\t\t\t);\n\t\t\n\t\tJSONArray array = jsonObject.getJSONArray(\"students\");\n\t\t\n\t\tfor (int i = 0; i < array.length(); i++) {\t\t\t\n\t\t\tJSONObject student = array.getJSONObject(i);\t\t\t\n\t\t\tString name = student.getString(\"name\");\n\t\t\tString secondName = student.getString(\"secondName\");\n\t\t\tString surname = student.getString(\"surname\");\n\t\t\tString birthday = student.getString(\"birthday\");\n\t\t\tString facultet = student.getString(\"facultet\");\n\t\t\tint groupNumber = student.getInt(\"groupNumber\");\n\t\t\t\n\t\t\tDate dateBirthday = null; \n\t\t\t//делаем Date из строки\t\t\t\n\t\t\ttry {\n\t\t\t\tdateBirthday = new SimpleDateFormat(\"dd.MM.yyyy\").parse(birthday);\n\t\t\t} catch(ParseException e) {\n\t\t\t\tSystem.err.println(\"Can't understand the date format from source.\");\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tstudents.add(\n\t\t\t\t\tStudent.get(name, secondName, surname, dateBirthday, facultet, groupNumber)\n\t\t\t\t\t);\t\t\t\n\t\t}\t\t\t\n\t}",
"@Override\n public void fromFile(final String file) {\n // Model会关心文件路径,所以这里需要这个操作\n this.jsonFile = file;\n final JsonObject data = Ut.ioJObject(this.jsonFile);\n this.fromJson(data);\n }",
"private static void loadJsonFile() throws FileNotFoundException {\n Log.println(Log.INFO, \"FileAccessing\", \"Loading settings file.\");\n StringBuilder stringBuilder = new StringBuilder();\n InputStreamReader inputStreamReader = new InputStreamReader(context.openFileInput(\"settingDetails.json\"), StandardCharsets.UTF_8);\n try (BufferedReader reader = new BufferedReader(inputStreamReader)) {\n String line = reader.readLine();\n while (line != null) {\n stringBuilder.append(line).append('\\n');\n line = reader.readLine();\n }\n } catch (IOException e) {\n Log.println(Log.ERROR, \"FileAccessing\", \"Settings file reading error.\");\n throw new FileNotFoundException();\n }\n if (stringBuilder.toString().equals(\"\")) {\n Log.println(Log.INFO, \"FileAccessing\", \"Settings file does not exist.\");\n throw new FileNotFoundException();\n }\n\n Gson gson = new Gson();\n JsonObject jsonObject = gson.fromJson(stringBuilder.toString(), JsonObject.class);\n if (jsonObject == null) {\n throw new FileNotFoundException();\n }\n JsonArray mappingControls = (JsonArray) jsonObject.get(\"mappingControls\");\n\n TaskDetail.actionToTask.clear();\n for (JsonElement o : mappingControls) {\n JsonObject individualMapping = (JsonObject) o;\n byte combinedAction = individualMapping.get(\"combinedAction\").getAsByte();\n int outerControl = individualMapping.get(\"task\").getAsInt();\n TaskDetail.actionToTask.put(combinedAction, TaskDetail.taskDetails.get(outerControl));\n }\n\n int setting = 0;\n JsonArray generalSettings = (JsonArray) jsonObject.get(\"generalSettings\");\n for (JsonElement o : generalSettings) {\n JsonObject individualSetting = (JsonObject) o;\n int status = individualSetting.get(\"status\").getAsInt();\n SettingDetail.settingDetails.get(setting++).changeSetting(status);\n }\n\n DeviceDetail.deviceDetails.clear();\n JsonArray deviceList = (JsonArray) jsonObject.get(\"devices\");\n for (JsonElement o : deviceList) {\n JsonObject individualDevice = (JsonObject) o;\n String deviceName = individualDevice.get(\"name\").getAsString();\n String deviceMac = individualDevice.get(\"mac\").getAsString();\n DeviceDetail.deviceDetails.add(new DeviceDetail(deviceMac, deviceName));\n }\n\n SensitivitySetting.sensitivitySettings.clear();\n JsonArray sensitivityList = (JsonArray) jsonObject.get(\"sensitivities\");\n for (JsonElement o : sensitivityList) {\n JsonObject individualSensitivity = (JsonObject) o;\n int multiplicativeFactor = individualSensitivity.get(\"factor\").getAsInt();\n int sensitivity = individualSensitivity.get(\"sensitivity\").getAsInt();\n SensitivitySetting.sensitivitySettings.add(new SensitivitySetting(multiplicativeFactor, sensitivity));\n }\n\n int currentDevice = jsonObject.get(\"currentlySelected\").getAsInt();\n DeviceDetail.setIndexSelected(currentDevice);\n\n updateAllSetting(false);\n }",
"private static void initJSONData(String filename, List<JSONObject> list) {\n\n\t\ttry {\n\t\t\t// init transactions list\n\t\t\tString transactionsContent = FileUtils.readFileToString(new File(filename), \"UTF-8\");\n\n\t\t\tJSONArray jArray = (JSONArray) new JSONTokener(transactionsContent).nextValue();\n\t\t\tfor (int i = 0; i < jArray.length(); i++) {\n\t\t\t\tlist.add((JSONObject) jArray.get(i));\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"private void read() {\n\n\t\t\t\tString road=getActivity().getFilesDir().getAbsolutePath()+\"product\"+\".txt\";\n\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(road); \n\t\t\t\t\tFileInputStream fis = new FileInputStream(file); \n\t\t\t\t\tint length = fis.available(); \n\t\t\t\t\tbyte [] buffer = new byte[length]; \n\t\t\t\t\tfis.read(buffer); \n\t\t\t\t\tString res1 = EncodingUtils.getString(buffer, \"UTF-8\"); \n\t\t\t\t\tfis.close(); \n\t\t\t\t\tjson(res1.toString());\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \n\t\t\t}",
"public static String readJsonObject(String filename) {\r\n\t\tBufferedReader br = null;\r\n\t\tFileReader fr = null;\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tString sCurrentLine;\r\n\t\ttry {\r\n\r\n\t\t\tfr = new FileReader(filename);\r\n\t\t\tbr = new BufferedReader(fr);\r\n\t\t\t\r\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\r\n\t\t\t\tsb.append(sCurrentLine);\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (br != null)\r\n\t\t\t\t\tbr.close();\r\n\t\t\t\tif (fr != null)\r\n\t\t\t\t\tfr.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sb.toString();\r\n\t}",
"public String parseJSON(){\r\n String json = null;\r\n try{\r\n InputStream istream = context.getAssets().open(\"restaurantopeninghours.json\");\r\n int size = istream.available();\r\n byte[] buffer = new byte[size];\r\n istream.read(buffer);\r\n istream.close();\r\n json = new String(buffer, \"UTF-8\");\r\n }catch (IOException ex){\r\n ex.printStackTrace();\r\n return null;\r\n }\r\n return json;\r\n }",
"public void init() {\n\n mJokes = new ArrayList<>();\n\n StringBuilder sBuilder = new StringBuilder();\n\n try {\n\n InputStream in = getClass().getResourceAsStream(\"/jokes.json\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n String mLine = reader.readLine();\n while (mLine != null) {\n //process line\n sBuilder.append(mLine);\n mLine = reader.readLine();\n }\n\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n String jsonString = sBuilder.toString();\n\n if( jsonString != null ){\n\n JsonParser parser = new JsonParser();\n JsonObject jsonObject = parser.parse(jsonString).getAsJsonObject();\n\n JsonArray jokesArray = jsonObject.getAsJsonArray(\"jokes\");\n\n for (JsonElement element : jokesArray) {\n String joke = element.getAsJsonObject().get(\"joke\").getAsString();\n mJokes.add(joke);\n }\n }\n\n }",
"public static HashMap<String,String> read_json_file(String filepath){\n HashMap<String,String> map = new HashMap<String,String>();\n try{\n BufferedReader bufferedReader = new BufferedReader(new FileReader(filepath));\n Gson gson = new Gson();\n Object json = gson.fromJson(bufferedReader, Object.class);\n map = new Gson().fromJson(\n json.toString(), new TypeToken<HashMap<String, String>>() {}.getType()\n );\n } catch (FileNotFoundException e ) {\n e.printStackTrace();\n }\n return map;\n }",
"String getJson();",
"String getJson();",
"String getJson();",
"@Test\r\n public void testRevision() {\r\n InputStream inputstream = getClass().getClassLoader().getResourceAsStream(\"sample.json\");\r\n assert inputstream != null;\r\n Reader reader = new InputStreamReader(inputstream);\r\n JsonParser parser = new JsonParser();\r\n JsonElement rootElement = parser.parse(reader);\r\n\r\n RevisionParser revisionParser = new RevisionParser();\r\n List<Revision> revisionList = revisionParser.parse(rootElement);\r\n\r\n for (Revision r: revisionList) {\r\n System.out.println(r);\r\n }\r\n Assert.assertEquals(revisionList.get(0).toString(), \"Name: Monkbot\tTimeStamp: Fri Sep 13 11:10:41 EDT 2019\");\r\n }",
"public TranscriptEntry(String filename) {\n JSONParser jsonParser = new JSONParser();\n try (FileReader reader = new FileReader(filename)){\n Object obj = jsonParser.parse(reader);\n\n JSONObject entry = (JSONObject) obj;\n JSONObject myCourse = (JSONObject) entry.get(\"course\");\n course = parseCourse(myCourse);\n grade = (String) entry.get(\"grade\");\n inProgress = (boolean) entry.get(\"inProgress\");\n courseComplete = (boolean) entry.get(\"courseComplete\");\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"private static String readJsonFile (String fileName) {\n if (!fileName.endsWith(\".json\")){\n throw new IllegalArgumentException(\"Invalid file name\");\n }\n String jsonStr = \"\";\n try{\n isFileExistOrCreatIt(fileName);\n File jsonFile = new File(\"src//main//resources\"+\"//\"+fileName);\n Reader reader = new InputStreamReader(new FileInputStream(jsonFile),\"utf-8\");\n int ch = 0;\n StringBuffer sb = new StringBuffer();\n while((ch = reader.read())!=-1){\n sb.append((char) ch);\n }\n reader.close();\n jsonStr = sb.toString();\n return jsonStr;\n\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }",
"public static String getJSONData( String filePath, boolean assetFile )\n {\n FileReader reader = null;\n String jsonData = null;\n\n if( assetFile )\n {\n AssetManager mgr = WeatherLionApplication.getAppContext().getAssets();\n String filename;\n\n try\n {\n filename = WeatherLionApplication.OPEN_SOURCE_LICENCE;\n InputStream in = mgr.open( filename, AssetManager.ACCESS_BUFFER );\n Writer writer = new StringWriter();\n char[] buffer = new char[ 1024 ];\n\n try\n {\n Reader assetReader = new BufferedReader( new InputStreamReader( in, StandardCharsets.UTF_8 ) );\n int n;\n\n while ( ( n = assetReader.read( buffer ) ) != -1 )\n {\n writer.write( buffer, 0, n) ;\n }// end of while loop\n }// end of try block\n catch ( IOException e )\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE, e.getMessage(),\n TAG + \"::getJSONData [line: \" +\n UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n\n jsonData = writer.toString();\n\n in.close();\n }// end of try block\n catch ( IOException e )\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE, e.getMessage(),\n TAG + \"::getJSONData [line: \" +\n UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n }// end of if block\n else\n {\n try\n {\n File file = new File( filePath );\n\n // if the is a file present then it will contain a list with at least on object\n if( file.exists() )\n {\n reader = new FileReader( file );\n jsonData = reader.toString();\n }// end of if block\n\n }// end of try block\n catch ( FileNotFoundException | JsonSyntaxException e )\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE, e.getMessage(),\n TAG + \"::getJSONData [line: \" +\n UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n finally\n {\n // close the file reader object\n if( reader != null )\n {\n try\n {\n reader.close();\n } // end of try block\n catch (IOException e)\n {\n UtilityMethod.logMessage( UtilityMethod.LogLevel.SEVERE,\n e.getMessage(),TAG + \"::getJSONData [line: \"\n + UtilityMethod.getExceptionLineNumber( e ) + \"]\" );\n }// end of catch block\n }// end of if block\n }// end of finally block\n }// end of else block\n\n return jsonData;\n }",
"String getJSON();",
"private JSONObject getAssetJson(String filename) {\n return new JSONObject(\n resourceHandler.getResourceFileAsString(ResourceHandler.VALORANT_BASE_PATH + \"Data/\" + filename)\n );\n }",
"Gist deserializeGistFromJson(String json);",
"public String readJsonFile(String fileName)\n {\n FileInputStream fileInputStream = null;\n String text;\n StringBuilder stringBuilder = new StringBuilder();\n\n try\n {\n fileInputStream = mainContext.openFileInput(fileName);\n InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n\n while((text = bufferedReader.readLine()) != null)\n {\n stringBuilder.append(text).append(\"\\n\");\n }\n }\n catch (IOException e)\n {\n System.out.println(e.getMessage());\n }\n\n return stringBuilder.toString();\n }",
"public static String getFileType() {return \"json\";}",
"public static void readJSON() throws IOException {\n\t\tBufferedReader br = new BufferedReader(new FileReader(f));\n\t\tString line;\n\t\tif((line = br.readLine()) != null) {\n\t\t\tString [] flightStates = parseJSON(line);\n\t\t\tfor(String state : flightStates) {\n\t\t\t\tFlightState fs = new FlightState(state);\n\t\t\t\tsendToKafka(fs);\n\t\t\t}\n\t\t}\n\t\tbr.close();\n\t}",
"public void ReadJson() {\n System.out.println(\"Read Json Method in the Mother Class\");\n }",
"<T> T readJson(FsPath path, Class<T> clazz);",
"@GetMapping(\"/getJson\")\r\n\tpublic HashMap<String, Object> getJsonValue() throws IOException {\n\r\n\t\tHashMap<String, Object> globalVariable = null;\r\n\t\tObjectMapper mapper = new ObjectMapper();\r\n\t\tString path = \"rules/backUp.json\";\r\n\r\n\t\tResourceLoader resource = new DefaultResourceLoader();\r\n\t\torg.springframework.core.io.Resource resource2 = resource.getResource(\"classpath:\" + path);\r\n\r\n\t\tReader reader = new InputStreamReader(resource2.getInputStream());\r\n\t\tSystem.out.println(\"reader ouput \" + reader.toString());\r\n\t\tString fileData = FileCopyUtils.copyToString(reader);\r\n\t\tSystem.out.println(\" filedate is \" + fileData);\r\n\r\n\t\tTypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {\r\n\t\t};\r\n\t\tHashMap<String, Object> readValue = mapper.readValue(fileData, typeRef);\r\n\t\treturn readValue;\r\n\t}",
"public String fileToString(String file){\n String path = new File(\"./Users/Colin/AndroidStudioProjects/FlightCompare/app/json/flights.json\").getAbsolutePath();\n File fileObj = new File(path);\n Log.d(\"Reading JSON file\", \"File exists: \" + fileObj.exists());\n Log.d(\"Reading JSON file\", \"File is directory: \" + fileObj.isDirectory());\n Log.d(\"Reading JSON file\", \"File can read: \" + fileObj.canRead());\n Log.d(\"Reading JSON file\", \"Current directory: \" + path);\n Log.d(\"Reading JSON file\", \"The path is: \" + file);\n try(Scanner in = new Scanner(new File(file))){\n StringBuilder sb = new StringBuilder();\n while(in.hasNextLine()){\n sb.append(in.nextLine());\n sb.append('\\n');\n }\n in.close();\n\n return sb.toString();\n }\n catch (FileNotFoundException ex){\n ex.printStackTrace();\n }\n return null;\n }",
"public static List<DataItem> importFromJSON(Context context){\n FileReader reader = null;\n File file = new File(Environment.getExternalStorageDirectory(), FILE_NAME);\n\n try {\n //Instantiate FileReader with file\n reader = new FileReader(file);\n //Populate DataItems class and return result\n Gson gson = new Gson();\n DataItems dataItems = gson.fromJson(reader, DataItems.class);\n return dataItems.getDataItems();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return null;\n }",
"public static Quote[] readFromJson(String filename) throws IOException {\n File file = new File(filename);\n file.createNewFile();\n Gson read = new Gson();\n InputStream inStream = new FileInputStream(filename);\n BufferedReader buffer = new BufferedReader(new InputStreamReader(inStream));\n Quote[] quotes = read.fromJson(buffer, Quote[].class);\n buffer.close();\n return quotes;\n }",
"public String generateJsonFileFromParsedTextFileInApp() {\n\t\treturn generateJsonFileFromParsedTextFile(TEXTSAMPLEFILE);\n\t}",
"@Override\n public int importRegionFromJsonFile(String path) {\n ObjectMapper mapper = new ObjectMapper();\n int length = 0;\n try {\n // Convert JSON string from file to Object\n List<Region> regions = mapper.readValue(new File(path), new TypeReference<List<Region>>(){});\n for(Region region: regions){\n regionRepository.save(region);\n }\n length = regions.size();\n } catch (JsonGenerationException e) {\n e.printStackTrace();\n } catch (JsonMappingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return length;\n }",
"public static void main(String[] args) throws IOException{ \n\t\tJsonReader reader = Json.createReader(new FileReader(\"testjson/abcde.json\")); \n\t\tJsonObject jsonob = reader.readObject();\n\t\tSystem.out.println(jsonob.toString());\n\t\tRowColStore parser= new RowColStore(10*1000*1000,\"testjson/abcde.layout\");\n\t\tint objid = 1;\n\t\tparser.insertObject(objid,jsonob,null);\n\t\tparser.insertObject(2,jsonob,null);\n\t\tparser.insertObject(3,jsonob,null);\n\t\t// populate the table \n\n\t\tSystem.out.println(\"get the result out \\n\");\n\t\t// objid, keystr,valstr,valnum,valbool - 5 bytes \n\t\t// read it out \n\t//\tparser.getObject(2);\n\t}",
"public String loadJSONFromAsset() {\n String json = null;\n try {\n json = new String(buffer, \"UTF-8\");\n } catch (UnsupportedEncodingException e1) {\n e1.printStackTrace();\n }\n\n return json;\n }",
"public void parseJson() {\n\n try {\n JSONParser parser = new JSONParser();\n jsonReader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(\"/resources/bangor-library.json\")));\n JSONObject jsonObj = (JSONObject) parser.parse(jsonReader);\n \n String name = (String) jsonObj.get(\"name\");\n libraryName = name;\n JSONArray extractedBooks = (JSONArray) jsonObj.get(\"books\");\n\n Iterator i = extractedBooks.iterator();\n while (i.hasNext()) {\n rec = new LibraryRecord();\n rec.setLib_name(libraryName);\n JSONObject innerObj = (JSONObject) i.next();\n rec.setBook_name(innerObj.get(\"name\").toString());\n rec.setAuth_name(innerObj.get(\"author\").toString());\n rec.setCat_name(innerObj.get(\"category\").toString());\n\n if (!LibraryAccess.bookShelves.isEmpty()) {\n for (LibraryRecord bookSaved : LibraryAccess.bookShelves) {\n if (this.rec.getHashOfContent() == bookSaved.getHashOfContent()) {\n duplicate = true;\n rec = null;\n }\n }\n if (!duplicate) {\n LibraryAccess.addRecord(rec);\n }\n duplicate = false;\n\n } else {\n System.out.println(\"Library empty : Adding records...\");\n LibraryAccess.addRecord(this.rec);\n }\n }\n\n } catch (FileNotFoundException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ParseException ex) {\n Logger.getLogger(JsnParser.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public String loadJSONFromAsset() {\n String json;\n String file = \"assets/words.json\";\n\n try {\n InputStream is = this.getClass().getClassLoader().getResourceAsStream(file);\n int size = is.available();\n byte[] buffer = new byte[size];\n is.read(buffer);\n is.close();\n json = new String(buffer, \"UTF-8\");\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n }",
"private String loadJSONFromAsset(){\n String json = null;\n AssetManager assetManager = getAssets();\n try{\n InputStream IS = assetManager.open(\"datosFases.json\");\n int size = IS.available();\n byte[] buffer = new byte[size];\n IS.read(buffer);\n IS.close();\n json = new String(buffer,\"UTF-8\");\n\n } catch (IOException ex){\n ex.printStackTrace();\n return null;\n }\n\n return json;\n }",
"public void readInventoryMainJsonFile() throws IOException, ParseException {\n\n\t\t// Providing read-only access to JSON data.\n\t\tJSONParser parser = new JSONParser();\n\n\t\t// Reading the external JSON file.\n\t\tFileReader reader = new FileReader(\".\\\\resources\\\\InventoryMain.json\");\n\n\t\t// Creating main object to store JSONParser, JSONObject and JSONArray.\n\t\tObject inventoryMain = parser.parse(reader);\n\n\t\t// Parsing object to JSONObject from InventoryMain.json file.\n\t\tJSONObject inventoryObj = (JSONObject) inventoryMain;\n\n\t\t// Getting the arrays of JSON file.\n\t\tJSONArray riceArray = (JSONArray) inventoryObj.get(\"Rice\");\n\t\tJSONArray pulseArray = (JSONArray) inventoryObj.get(\"Pulses\");\n\t\tJSONArray wheatArray = (JSONArray) inventoryObj.get(\"Wheat\");\n\n\t\t// Getting details of rice.\n\t\tSystem.out.println(\"Details of Rice are: \");\n\t\tfor (int i = 0; i < riceArray.size(); i++) {\n\t\t\tJSONObject riceDetails = (JSONObject) riceArray.get(i);\n\n\t\t\tString name = (String) riceDetails.get(\"name\");\n\t\t\tlong weight = (long) riceDetails.get(\"weight\");\n\t\t\tlong price = (long) riceDetails.get(\"price\");\n\n\t\t\tSystem.out.println(\"\\nName: \" + name);\n\t\t\tSystem.out.println(\"Weight: \" + weight);\n\t\t\tSystem.out.println(\"Price per KG is: \" + price);\n\n\t\t\t// Calculating price of different types of rice.\n\t\t\tlong ricePrice = weight * price;\n\t\t\tSystem.out.println(\"\\nTotal price of \" + riceDetails.get(\"name\") + \" is \" + ricePrice);\n\n\t\t}\n\n\t\t// Getting details of Pulse.\n\t\tSystem.out.println(\"\\nDetails of Pulse are: \");\n\t\tfor (int j = 0; j < pulseArray.size(); j++) {\n\t\t\tJSONObject pulseDetails = (JSONObject) pulseArray.get(j);\n\n\t\t\tString name = (String) pulseDetails.get(\"name\");\n\t\t\tlong weight = (long) pulseDetails.get(\"weight\");\n\t\t\tlong price = (long) pulseDetails.get(\"price\");\n\n\t\t\tSystem.out.println(\"\\nName: \" + name);\n\t\t\tSystem.out.println(\"Weight: \" + weight);\n\t\t\tSystem.out.println(\"Price per KG is: \" + price);\n\n\t\t\t// Calculating price of different types of Pulses.\n\t\t\tlong pulsePrice = weight * price;\n\t\t\tSystem.out.println(\"\\nTotal price of \" + pulseDetails.get(\"name\") + \" is \" + pulsePrice);\n\n\t\t}\n\t\t// Getting details of Wheat.\n\t\tSystem.out.println(\"\\nDetails of Wheat are: \");\n\t\tfor (int i = 0; i < wheatArray.size(); i++) {\n\t\t\tJSONObject wheatDetails = (JSONObject) wheatArray.get(i);\n\n\t\t\tString name = (String) wheatDetails.get(\"name\");\n\t\t\tlong weight = (long) wheatDetails.get(\"weight\");\n\t\t\tlong price = (long) wheatDetails.get(\"price\");\n\n\t\t\tSystem.out.println(\"\\nName: \" + name);\n\t\t\tSystem.out.println(\"Weight: \" + weight);\n\t\t\tSystem.out.println(\"Price per KG is: \" + price);\n\t\t\t// Calculating price of different types of Wheat.\n\t\t\tlong wheatPrice = weight * price;\n\t\t\tSystem.out.println(\"\\nTotal price of \" + wheatDetails.get(\"name\") + \" is \" + wheatPrice);\n\n\t\t}\n\n\t}",
"public void gatherLevelJson(String filename) {\r\n\t\tif(level == 0) { // Get level editor level\r\n\t\t\tPreferences prefs = GDXRoot.getPreferences();\r\n\t\t\tif(prefs.contains(filename)) {\r\n\t\t\t\tlevelAssets = new JsonReader().parse(prefs.getString(filename));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tFileHandle file = Gdx.files.internal(filename);\r\n\t\t\tString text = file.readString();\r\n\t\t\tlevelAssets = new JsonReader().parse(text);//directory.getEntry( String.format(\"level%d\", level), JsonValue.class);\r\n\t\t}\r\n\t}",
"public JSONObject LoadJson(String filename) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tnew FileInputStream(filename), \"UTF-8\"));\n\t\t\tStringBuffer buffer = new StringBuffer(1024);\n\t\t\tString line;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\tbuffer.append(line);\n\t\t\t}\n\t\t\treader.close();\n\n\t\t\treturn new JSONObject(buffer.toString());\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.format(\"[Error]Failed to open file %s!\", filename);\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t} catch (JSONException e) {\n\t\t\tSystem.err.format(\"[Error]Failed to parse json file %s!\", filename);\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"public JSONObject reader_File(JSONObject obj)\n {\n CSVReader reader = null;\n try\n {\n\n String path = obj.get(\"path\").toString(); //retrieve path of file from json obj\n JSONObject json = (JSONObject)obj.get(\"query\"); //retrieve json object that has query from json obj\n\n reader = new CSVReader(new FileReader(path), ',');\n\n String [] nextLine;\n\n //Read one line at a time\n JSONObject json3 = new JSONObject();\n\n //need to use JSONArray\n JSONArray jArr = new JSONArray(); //create an object of JSONArray\n while ((nextLine = reader.readNext()) != null)\n {\n\n JSONObject json2 = search(json, nextLine); //return json object that contains all the value of each lines if query matches\n\n if(!json2.isEmpty()){ //check whether json2 is empty\n jArr.add(json2); //insert json2 in in jsonArray\n\n }\n\n }\n json3.put(\"response\", jArr); //insert jArr in json3\n return json3;\n\n }\n catch (Exception e) {\n e.printStackTrace();\n }\n finally {\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return null;\n }",
"public Tamagotchi read() throws IOException {\n String jsonData = readFile(source);\n JSONObject jsonObject = new JSONObject(jsonData);\n return tamagotchiToJson(jsonObject);\n }",
"@Override\n public boolean load(String file) {\n try {\n BufferedReader br = new BufferedReader(new FileReader(file));\n StringBuilder jsonString = new StringBuilder();\n String line = null;\n line = br.readLine();\n while (line != null) {\n jsonString.append(line);\n line = br.readLine();\n }\n br.close();\n /*\n Create a builder for the specific JSON format\n */\n GsonBuilder gsonBuilder = new GsonBuilder();\n JsonDeserializer<DWGraph_DS> deserializer = new JsonDeserializer<DWGraph_DS>() {\n @Override\n public DWGraph_DS deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException {\n JsonObject jsonObject = json.getAsJsonObject();\n DWGraph_DS graph = new DWGraph_DS();\n JsonArray Nodes = jsonObject.getAsJsonArray(\"Nodes\");\n JsonArray Edges = jsonObject.getAsJsonArray(\"Edges\");\n Iterator<JsonElement> iterNodes = Nodes.iterator();\n while (iterNodes.hasNext()) {\n JsonElement node = iterNodes.next();\n\n graph.addNode(new DWGraph_DS.Node(node.getAsJsonObject().get(\"id\").getAsInt()));\n\n String coordinates[] = node.getAsJsonObject().get(\"pos\").getAsString().split(\",\");\n double coordinatesAsDouble[] = {0, 0, 0};\n for (int i = 0; i < 3; i++) {\n coordinatesAsDouble[i] = Double.parseDouble(coordinates[i]);\n }\n DWGraph_DS.Position pos = new DWGraph_DS.Position(coordinatesAsDouble[0], coordinatesAsDouble[1], coordinatesAsDouble[2]);\n graph.getNode(node.getAsJsonObject().get(\"id\").getAsInt()).setLocation(pos);\n }\n Iterator<JsonElement> iterEdges = Edges.iterator();\n int src, dest;\n double w;\n while (iterEdges.hasNext()) {\n JsonElement edge = iterEdges.next();\n src = edge.getAsJsonObject().get(\"src\").getAsInt();\n dest = edge.getAsJsonObject().get(\"dest\").getAsInt();\n w = edge.getAsJsonObject().get(\"w\").getAsDouble();\n graph.connect(src, dest, w);\n }\n return graph;\n }\n };\n gsonBuilder.registerTypeAdapter(DWGraph_DS.class, deserializer);\n Gson graphGson = gsonBuilder.create();\n G = graphGson.fromJson(jsonString.toString(), DWGraph_DS.class);\n return true;\n } catch (FileNotFoundException e) {\n System.out.println(\"File not found!\");\n e.printStackTrace();\n return false;\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n }\n }",
"private void parseJSON(String response)\n {\n try\n {\n // Using orj.json, get the file string and convert it to an object\n JSONObject object = (JSONObject) new JSONTokener(response).nextValue();\n\n // The Winnipeg Transit JSON results usually have nested values\n // We can identify the request by the first key of the first level\n\n // The method names() will retrieve an JSONArray with the key names\n JSONArray objectNames = object.names();\n\n // Retrieve the first key of the first level\n String firstKey = objectNames.getString(0);\n\n if (firstKey.equals(\"status\"))\n {\n parseStatus(object.getJSONObject(firstKey));\n }\n else if (firstKey.equals(\"stop-schedule\"))\n {\n parseStopSchedule(object.getJSONObject(firstKey));\n }\n }\n catch (JSONException e)\n {\n e.printStackTrace();\n }\n }",
"@Test\r\n public void testRevisionParser() {\r\n JsonParser parser = new JsonParser();\r\n InputStream inputstream = getClass().getClassLoader().getResourceAsStream(\"sample.json\");\r\n assert inputstream != null;\r\n Reader reader = new InputStreamReader(inputstream);\r\n JsonElement rootElement = parser.parse(reader);\r\n JsonObject rootObject = rootElement.getAsJsonObject();\r\n JsonObject pages = rootObject.getAsJsonObject(\"query\").getAsJsonObject(\"pages\");\r\n JsonArray array = null;\r\n for (Map.Entry<String, JsonElement> entry : pages.entrySet()) {\r\n JsonObject entryObject = entry.getValue().getAsJsonObject();\r\n array = entryObject.getAsJsonArray(\"revisions\");\r\n Assert.assertNotNull(array);\r\n }\r\n System.out.println(array);\r\n\r\n }",
"private JSONObject importFlowJSON (Path pathToFolder) {\n // Create a JSONParser to parse the content of the file\n JSONParser parser = new JSONParser();\n\n // The JSONObject instance that will be returned\n JSONObject flow;\n\n try{\n // Read and parse the json file\n flow = (JSONObject) parser.parse(new FileReader(pathToFolder.toString() + \"/\" + FLOW_FILE_NAME));\n // If the file has been found and parsed we return it as a JSONObject\n return flow;\n } catch (ParseException | IOException e) {\n // If the file hasn't been found we return null\n e.printStackTrace();\n return null;\n }\n }",
"public static List<User> getUserFromJson(String filename){\n \tString s = readJsonFile(filename);\n \tList<User> users = JSONObject.parseArray(s, User.class);\n \treturn users;\n }",
"public static OMDBJsonResponse getMoviesFromJSON(File jsonFile)\n {\n Gson gson = new Gson();\n OMDBJsonResponse searchResult = null;\n\n //using try \"with resources\"\n try(\n FileReader fileReader = new FileReader(jsonFile);\n JsonReader jsonReader = new JsonReader(fileReader);\n )\n {\n searchResult = gson.fromJson(jsonReader, OMDBJsonResponse.class);\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return searchResult;\n }",
"public String getJSONString(String fileName){\n\n String line = \"\";\n String jsonString = \"\";\n\n try {\n FileReader fileReader = new FileReader(fileName);\n\n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n while ((line = bufferedReader.readLine()) != null) {\n jsonString+=line+'\\n';\n }\n bufferedReader.close();\n }\n catch (FileNotFoundException ex){\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n }\n catch (IOException ex) {\n System.out.println( \"Error reading file '\" + fileName +\"'\");\n }\n\n return jsonString;\n }",
"static JsonResource forFile( File file ) {\n return new JsonResource() {\n @Override\n public <T> T readFrom( ReadMethod<T> consumer ) throws IOException {\n try ( FileInputStream stream = new FileInputStream(file) ) {\n return consumer.read(stream);\n }\n }\n };\n }",
"private String loadJSONFromAsset() {\n String json = null;\n try {\n //AssetManager assetManager = getAssets();\n InputStream is = getAssets().open(\"sa.json\");\n //InputStream is = getResources().openRawResource(\"sa.json\");\n int size = is.available();\n\n byte[] buffer = new byte[size];\n\n is.read(buffer);\n\n is.close();\n\n json = new String(buffer, \"UTF-8\");\n Log.i(\"Json\",json);\n\n\n } catch (Exception ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n\n }",
"public static JSONArray parsedFile() {\n JSONParser parser = new JSONParser();\n try {\n String filePath = new File(\"\").getAbsolutePath();\n if (!filePath.substring(filePath.length()-3, filePath.length()).equals(\"src\")) {\n filePath = filePath.concat(\"/src\");\n }\n filePath = filePath.concat(\"/cardData/data.json\");\n FileReader file = new FileReader(filePath);\n Object parsedFile = parser.parse(file);\n return (JSONArray) parsedFile;\n } catch (IOException e) {\n e.printStackTrace();\n System.exit(0);\n } catch (ParseException p) {\n System.out.println(\"Caught a Parsing Exception\" + p.getMessage());\n p.printStackTrace();\n System.exit(0);\n }\n return null;\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tprivate void readMapFromFile() {\r\n\t\ttry {\r\n\t\t\tType type = new TypeToken<HashMap<String, Country>>() {}.getType();\r\n\t\t\tthis.daoMap = (HashMap<String, Country>) gson.fromJson(new FileReader(path), type);\r\n\t\t} catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}",
"public String loadJSONFromAsset(Context context) {\n json = null;\n try {\n InputStream is = getApplicationContext().getAssets().open(\"techdrop.json\");\n int size = is.available();\n byte[] buffer = new byte[size];\n is.read(buffer);\n is.close();\n json = new String(buffer, \"UTF-8\");\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n }",
"public JSONDocument parse (File fl){\n JSONDocument temp = null;\n String data = \"\";\n if (fl != null){\n try (FileReader fr = new FileReader(fl)){\n int c;\n while((c = fr.read()) != -1) data += (char)c;\n temp = this.parseString(this.cleanString(data));\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }else throw new IllegalArgumentException(\"File cannot be null\");\n return temp;\n }",
"public native Object parse( Object json, String texturePath );",
"void validateJson();",
"public static JsonObject fileToJson(File jsonFile) {\n Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();\n JsonObject jsonObject = null;\n\n try {\n Reader reader = new FileReader(jsonFile);\n jsonObject = gson.fromJson(reader, JsonObject.class);\n } catch (FileNotFoundException e) {\n //log.error(\"FileNotFound Exception occurred when converting JSON file to JSON Object\", e); //todo: FileNotFound exception occured. error message?\n e.printStackTrace();\n }\n\n return jsonObject;\n }",
"public void load(){\n // Recover docIDs\n try(Reader reader = new FileReader(\"postings/docIDs.json\")){\n this.docIDs = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, String>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/docLengths.json\")){\n this.docLengths = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try(Reader reader = new FileReader(\"postings/titleToNumber.json\")){\n this.titleToNumber = (new Gson()).fromJson(reader,\n new TypeToken<Map<String, Integer>>(){}.getType());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static JsonObject parseFromFile(String file) {\n\t\tJsonObject res = null;\n\t\ttry {\n\t\t\tJsonStreamParser parser = new JsonStreamParser(new FileReader(file));\n\t\t\tif (parser.hasNext())\n\t\t\t\tres = parser.next().getAsJsonObject();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn res;\n\t}",
"public void deserialize(JsonObject src);",
"public void guardarEnJSON () {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String s = gson.toJson(this);\n try {\n FileWriter fw = new FileWriter(\"files/graph.json\");\n fw.write(s);\n fw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public String readJson() {\n\t\t\tif (lastReadChar == ']') {\n\t\t\t\tSystem.out.println(\"Nunca deberia llegar a aca si usa hasNext()\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// Si fue una coma, busco el siguiente '{'\n\t\t\twhile (read()!= '{');\n\t\t\t\n\t\t\tStringBuilder jsonText = new StringBuilder();\n\t\t\tjsonText.append((char) '{');\n\t\t\tlastReadChar = read();\n\t\t\t\n\t\t\twhile (lastReadChar != '}') { \n\t\t\t\tjsonText.append((char) lastReadChar);\n\t\t\t\tlastReadChar = read();\n\t\t\t} jsonText.append('}');\n\t\t\t\n\t\t\t// To satisfy Invariant: find the next ']' or ','\n\t\t\twhile (lastReadChar != ']' && lastReadChar != ',') lastReadChar = read(); \n\t\t\t\n\t\t\t//System.out.println(\"Analizando : \" + jsonText.toString());\n\t\t\treturn jsonText.toString();\n\t\t}",
"public void createJSON(String filePath, JSONObject jsonObject) throws ExistException, UnimplementedException, UnderlyingStorageException {\n \t\tSystem.err.println(jsonObject);\n \t\tjsonObject=cspace264Hack_munge(jsonObject,filePath);\n \t\tautocreateJSON(\"\",jsonObject);\n \t\t// XXX End of here's what we do because of CSPACE-264\t\t\n \t\t// Here's what we should do ->\n \t\t// throw new UnimplementedException(\"Cannot create collectionobject at known path, use autocreateJSON\");\n \t}",
"public static JsonObject getTestVectors(String filename) throws \n IOException {\n InputStream is = JsonUtil.class.getClassLoader().getResourceAsStream(filename);\n JsonReader reader = new JsonReader(new InputStreamReader(is, UTF_8));\n JsonElement elem = JsonParser.parseReader(reader);\n return elem.getAsJsonObject();\n }",
"private static JsonReader readJSONFromAsset(Context context) throws IOException {\n AssetManager assetManager = context.getAssets();\n JsonReader reader;\n try {\n reader = new JsonReader(new InputStreamReader(assetManager.open(\"questionlist.json\")));\n } finally {\n\n }\n return reader;\n }",
"public void getCityJson() throws JSONException {\n String json = null;\n try {\n InputStream inputStream = getAssets().open(\"cities.json\");\n int size = inputStream.available();\n byte[] buffer = new byte[size];\n inputStream.read(buffer);\n inputStream.close();\n json = new String(buffer, \"UTF-8\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n JSONObject jsonObject = new JSONObject(json);\n JSONArray events = jsonObject.getJSONArray(\"cities\");\n for (int j = 0; j < events.length(); j++) {\n JSONObject cit = events.getJSONObject(j);\n City cityData = new City();\n\n cityData.setCityId(Integer.parseInt(cit.getString(\"id\")));\n cityData.setCityName(cit.getString(\"name\"));\n cityData.setStateId(Integer.parseInt(cit.getString(\"state_id\")));\n cityObject.add(cityData);\n }\n }",
"public String loadJSONFromAsset() {\n String json;\n try {\n InputStream is = getAssets().open(\"track_v0649.json\");\n int size = is.available();\n byte[] buffer = new byte[size];\n\n is.read(buffer);\n is.close();\n json = new String(buffer, \"UTF-8\");\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n }",
"public JsonReader(String file) {\n this.file = file;\n }",
"public JSONArray readFromJSON(){\n\n JSONArray jsonArray=null;\n\n try {\n InputStream inputStream =context.getResources().getAssets().open(FILE_NAME);\n int size = inputStream.available();\n byte[] data = new byte[size];\n inputStream.read(data);\n inputStream.close();\n String json = new String(data, \"UTF-8\");\n jsonArray = new JSONArray(json);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return jsonArray;\n }",
"public void testImportJSONFromFile() throws IOException, JsonException {\n final String testPath = TEST_BASE_PATH;\n Map<String, String> props = new HashMap<String, String>();\n String testNode = testClient.createNode(HTTP_BASE_URL + testPath, props);\n urlsToDelete.add(testNode);\n\n props.clear();\n props.put(SlingPostConstants.RP_OPERATION,\n \t\tSlingPostConstants.OPERATION_IMPORT);\n\n String testNodeName = \"testNode_\" + String.valueOf(random.nextInt());\n props.put(SlingPostConstants.RP_NODE_NAME_HINT, testNodeName);\n testFile = getTestFile(getClass().getResourceAsStream(\"/integration-test/servlets/post/testimport.json\"));\n props.put(SlingPostConstants.RP_CONTENT_TYPE, \"json\");\n props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + \"/*\");\n String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,\n \t\ttestFile, SlingPostConstants.RP_CONTENT_FILE, null);\n\n // assert content at new location\n String content = getContent(importedNodeUrl + \".3.json\", CONTENT_TYPE_JSON);\n\n\t\tJsonObject jsonObj = JsonUtil.parseObject(content);\n\t\tassertNotNull(jsonObj);\n\n\t\t//assert the imported content is there.\n String expectedJsonContent = getStreamAsString(getClass().getResourceAsStream(\"/integration-test/servlets/post/importresults.json\"));\n\t\tassertExpectedJSON(JsonUtil.parseObject(expectedJsonContent), jsonObj);\n }",
"private void loadData() {\n FileInputStream fis;\n\n try {\n fis = openFileInput(DATA_FILE);\n user = (User) new JsonReader(fis).readObject();\n fis.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }",
"public static ResponseUserObj parseGSON() throws FileNotFoundException {\n\n Gson gson = new Gson();\n\n ResponseUserObj data = gson.fromJson(new JsonReader(new FileReader(\"classwork/json/example.json\")), ResponseUserObj.class);\n\n return data;\n }",
"public static JSONObject loadMOTD() {\n File JSONFile = new File(plugin.getDataFolder() + \"/motd.json\");\n \n if (!JSONFile.exists()){\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"motd.json was not found in the config directory. Attempting to create a blank file.\");\n boolean worked = saveMOTD(new JSONObject());\n if (worked) Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"motd.json created!\");\n else Logger.getLogger(MOTDHandler.class.getName()).log(Level.INFO, \"JawaToolBox was unable to generate the blank motd.json. This is likely a permissions problem.\");\n return new JSONObject();\n }\n\n try {\n String source = new String(Files.readAllBytes(Paths.get(JSONFile.toURI())));\n return new JSONObject(source);\n } catch (FileNotFoundException ex) {\n return new JSONObject();\n } catch (IOException ex) {\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.SEVERE, \"Something went wrong JawaToolBox wasn't able to read the motd.json. Check directory permissions.\");\n Logger.getLogger(MOTDHandler.class.getName()).log(Level.SEVERE, null, ex);\n return new JSONObject();\n }\n }",
"private void readSettingsFromJson(String jsonFilePath) throws FileNotFoundException {\n File jsonFile = new File(jsonFilePath);\n GsonBuilder builder = new GsonBuilder().setPrettyPrinting();\n Gson gson = builder.create();\n if (jsonFile.exists()) {\n // try to read the settings from provided file\n FileReader fileReader = new FileReader(jsonFile);\n serverConfig = gson.fromJson(fileReader, ServerConfig.class);\n log.info(\"reading config from file {}\", jsonFile.getAbsoluteFile());\n } else {\n // file was not found, fall back to default config\n log.warn(\"settings file {} not found, falling back to default config\", jsonFile.getAbsoluteFile());\n serverConfig = ServerConfig.getDefaultConfig();\n String jsonStr = gson.toJson(serverConfig);\n\n try (PrintWriter out = new PrintWriter(jsonFile)) {\n out.print(jsonStr);\n }\n }\n\n // additionally create a map for easy access to repositories based on identifier\n for (ServerRepository serverRepository : serverConfig.getRepositories()) {\n this.serverRepositories.put(serverRepository.getIdentifier(), serverRepository);\n }\n }",
"@Test\n public void testMapOfJsonables() {\n JsonableTestClassWithMaps jtc = Jsonable.loadFromFile(\"testFiles/mapTest.json\", JsonableTestClassWithMaps.class);\n assertEquals(3, jtc.JsonableMap.size());\n String jsonString = jtc.toJSON().toString();\n assertThat(jsonString, Matchers.containsString(\"\\\"value1\\\":{\\\"detail\\\":\\\"\\\",\\\"data\\\":\\\"Value Name\\\"}\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"value2\\\":{\\\"detail\\\":\\\"Detail Name\\\",\\\"data\\\":\\\"\\\"}\"));\n assertThat(jsonString, Matchers.containsString(\"\\\"value3\\\":{\\\"detail\\\":\\\"Detail Name\\\",\\\"data\\\":\\\"Value Name\\\"}\"));\n }",
"public void testImportJSONFromFileWithoutOptionalName() throws IOException, JsonException {\n final String testPath = TEST_BASE_PATH;\n Map<String, String> props = new HashMap<String, String>();\n String testNode = testClient.createNode(HTTP_BASE_URL + testPath, props);\n urlsToDelete.add(testNode);\n\n props.clear();\n props.put(SlingPostConstants.RP_OPERATION,\n \t\tSlingPostConstants.OPERATION_IMPORT);\n\n testFile = getTestFile(getClass().getResourceAsStream(\"/integration-test/servlets/post/testimport2.json\"));\n props.put(SlingPostConstants.RP_CONTENT_TYPE, \"json\");\n props.put(SlingPostConstants.RP_REDIRECT_TO, SERVLET_CONTEXT + testPath + \"/*\");\n String importedNodeUrl = testClient.createNode(HTTP_BASE_URL + testPath, new NameValuePairList(props), null, true,\n \t\ttestFile, SlingPostConstants.RP_CONTENT_FILE, null);\n\n //make sure the name is what was inside the file.\n assertTrue(importedNodeUrl.endsWith(\"/nodeName\"));\n\n // assert content at new location\n String content = getContent(importedNodeUrl + \".3.json\", CONTENT_TYPE_JSON);\n\n\t\tJsonObject jsonObj = JsonUtil.parseObject(content);\n\t\tassertNotNull(jsonObj);\n\n\t\t//assert the imported content is there.\n String expectedJsonContent = getStreamAsString(getClass().getResourceAsStream(\"/integration-test/servlets/post/importresults.json\"));\n\t\tassertExpectedJSON(JsonUtil.parseObject(expectedJsonContent), jsonObj);\n }",
"public void getStateJson() throws JSONException {\n String json = null;\n try {\n InputStream inputStream = getAssets().open(\"states.json\");\n int size = inputStream.available();\n byte[] buffer = new byte[size];\n inputStream.read(buffer);\n inputStream.close();\n json = new String(buffer, \"UTF-8\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n JSONObject jsonObject = new JSONObject(json);\n JSONArray events = jsonObject.getJSONArray(\"states\");\n for (int j = 0; j < events.length(); j++) {\n JSONObject cit = events.getJSONObject(j);\n State stateData = new State();\n\n stateData.setStateId(Integer.parseInt(cit.getString(\"id\")));\n stateData.setStateName(cit.getString(\"name\"));\n stateData.setCountryId(Integer.parseInt(cit.getString(\"country_id\")));\n stateObject.add(stateData);\n }\n }",
"public static void storeJsonData(JSONObject json) throws JSONException{\n Iterator<String> keys = json.keys();\n while(keys.hasNext()){\n String key = keys.next();\n String val = json.getString(key);\n \n if(val != null){\n map.put(key,val);\n try {\n \t\t\tBufferedWriter out = new BufferedWriter(new FileWriter(file,true));\n \t\t\tout.write(key + \" : \" + val);\n \t\t\tout.newLine();\n \t\t\tout.close();\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n }\n }\n}",
"public static void main(String[] argv) throws ParseException \t\r\n {\r\n JSONParser jsParser = new JSONParser();\r\n\r\n \r\n \r\n Object ob;\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(FILENAME))) \r\n\t\t{\r\n\t\t\tob = jsParser.parse(br);\r\n\t System.out.println(ob);\r\n\r\n\t JSONObject json = (JSONObject) jsParser.parse(ob.toString());\r\n\t \r\n\r\n\t System.out.println(\"name=\" + json.get(\"jeuadmin-result\")); // name=MyNode\r\n\t \r\n JSONArray msgList =(JSONArray) json.get(\"values\");\r\n Iterator<String>iterator = msgList.iterator();\r\n \r\n/*\r\n Iterator<String>iterator = msgList.iterator();\r\n while(iterator.hasNext()) \r\n {\r\n System.out.println(iterator.next());\r\n }\r\n\r\n*/\r\n\t \r\n\t System.out.println(\"name=\" + \"\"); // name=MyNode\r\n\r\n//\t System.out.println(\"width=\" + json.get(\"width\")); // width=200\r\n\t\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t\t\r\n/*\r\n Object ob;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tob = jsParser.parse(txt);\r\n\t System.out.println(ob); // {\"name\":\"MyNode\", \"width\":200, \"height\":100}\r\n\t JSONObject json = (JSONObject) jsParser.parse(txt);\r\n\t System.out.println(\"name=\" + json.get(\"name\")); // name=MyNode\r\n\t System.out.println(\"width=\" + json.get(\"width\")); // width=200\r\n\t\t} \r\n\t\tcatch (ParseException e) \r\n\t\t{\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n*/\r\n\t\t\r\n }",
"List<Gist> deserializeGistsFromJson(String json);",
"@Test\n void getAndFormatJson() {\n g.getJsonFromGitHub();\n String json = g.getJsonString();\n\n boolean isValid;\n try {\n new Gson().fromJson(json, Object.class);\n isValid = true;\n } catch(com.google.gson.JsonSyntaxException ex) {\n isValid = false;\n }\n assertTrue(isValid, \"Invalid JSON\");\n }",
"public void getCityJson() throws JSONException {\n String json = null;\n try {\n InputStream inputStream = getAssets().open(\"cities.json\");\n int size = inputStream.available();\n byte[] buffer = new byte[size];\n inputStream.read(buffer);\n inputStream.close();\n json = new String(buffer, \"UTF-8\");\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n \n \n JSONObject jsonObject = new JSONObject(json);\n JSONArray events = jsonObject.getJSONArray(\"cities\");\n for (int j = 0; j < events.length(); j++) {\n JSONObject cit = events.getJSONObject(j);\n City cityData = new City();\n \n cityData.setCityId(Integer.parseInt(cit.getString(\"id\")));\n cityData.setCityName(cit.getString(\"name\"));\n cityData.setStateId(Integer.parseInt(cit.getString(\"state_id\")));\n cityObject.add(cityData);\n }\n }",
"public static void main(String[] args) throws IOException {\n\t\tjsonData = readFile(\"json.txt\",StandardCharsets.UTF_8 );\n\t\tMessage[] advanceObjectArray = (Message[]) (new Conversion()).getObjectFromJson(jsonData, Message[].class);\n\t\tList<Message> advanceObjectList = Arrays.asList(advanceObjectArray);\n\t\tint index = 0;\n\t\tfor (Message message : advanceObjectList) {\n\t\t\tSystem.out.println(\"---------------------Record # \"+(++index)+\"--------------------\");\n\t\t\tSystem.out.println(\"ObjectId : \" +message.getObjectId());\n\t\t\tSystem.out.println(\"Number : \" +message.getNumber());\n\t\t\tSystem.out.println(\"MessgeId : \" +message.getId());\n\t\t\tSystem.out.println(\"Lat : \" +message.getLatitude());\n\t\t\tSystem.out.println(\"Long : \" +message.getLongitude());\n\t\t\tSystem.out.println(\"LandMark : \" +message.getLandMark());\n\t\t\tSystem.out.println(\"Speed : \" +message.getSpeed());\n\t\t\t\n\t\t\tSystem.out.println(\"---------------------Message Data--------------------\");\n\t\t\tfor (MessageData messageData : message.getMessageData()) {\n\t\t\t\tSystem.out.println(\"DataSourceName : \" +messageData.getDataSourceName());\n\t\t\t\tSystem.out.println(\"DataSourceId : \" +messageData.getDataSourceId());\n\t\t\t\tSystem.out.println(\"Value : \" +messageData.getValue());\n\t\t\t}\n\t\t\tSystem.out.println(\"------------------------------------------------------\");\n\t\t}\n\n\t}",
"public static String loadJSONFromAsset(Context context,String filePath) {\n String json = null;\n try {\n InputStream is = context.getAssets().open(filePath);\n int size = is.available();\n byte[] buffer = new byte[size];\n is.read(buffer);\n is.close();\n json = new String(buffer, ENCODING);\n } catch (IOException ex) {\n ex.printStackTrace();\n return null;\n }\n return json;\n }"
] | [
"0.7034294",
"0.67274934",
"0.66766226",
"0.6570412",
"0.6453847",
"0.64380497",
"0.6413349",
"0.64077926",
"0.6371942",
"0.6368877",
"0.63481486",
"0.63443804",
"0.6318529",
"0.6318397",
"0.62839717",
"0.6247711",
"0.6243326",
"0.6222119",
"0.62145674",
"0.61995554",
"0.618717",
"0.61839175",
"0.61774623",
"0.61747277",
"0.61545897",
"0.6154078",
"0.6150201",
"0.6150201",
"0.6150201",
"0.6122821",
"0.61153847",
"0.60943025",
"0.6091326",
"0.60850614",
"0.6069234",
"0.606196",
"0.6058555",
"0.60473454",
"0.60364866",
"0.6035282",
"0.6031626",
"0.6028755",
"0.6019736",
"0.6013322",
"0.6010985",
"0.60059834",
"0.60044515",
"0.59986436",
"0.5998497",
"0.59968317",
"0.599337",
"0.59909785",
"0.5984754",
"0.598219",
"0.59796613",
"0.596653",
"0.5927834",
"0.59249955",
"0.5918837",
"0.59140736",
"0.5896534",
"0.58940905",
"0.5885165",
"0.5867452",
"0.58631355",
"0.58627087",
"0.58605796",
"0.58524495",
"0.58477175",
"0.5846175",
"0.58449584",
"0.58431625",
"0.5837133",
"0.58300936",
"0.5827534",
"0.5822843",
"0.5812719",
"0.5809398",
"0.5806378",
"0.58042634",
"0.57987034",
"0.57976496",
"0.57859266",
"0.5785905",
"0.57593274",
"0.57584304",
"0.5753187",
"0.5737696",
"0.5735526",
"0.5717103",
"0.57115227",
"0.571142",
"0.57113266",
"0.5709268",
"0.5709212",
"0.570862",
"0.57078856",
"0.5703758",
"0.57023376",
"0.56977206"
] | 0.69465715 | 1 |
The toString() of a contribution def is the name of the method. | static String invokingMethod(ContributionDef def)
{
return MESSAGES.format("invoking-method", def);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String toString() {\n\t\treturn methodName;\n\t}",
"@Override\n public String toString() {\n \treturn \"()\";\n }",
"public String toString () {\n return \"()\";\n }",
"public String toString()\n {\n // import Component.Application.Console.Coherence;\n \n return \"RefAction{Method=\" + getMethod().getName() + \", Target=\" + getTarget() +\n \", Args=\" + Coherence.toString(getArguments()) + '}';\n }",
"public String toString ()\n {\n return \"function:\" + _vname;\n }",
"@Override\n public String toString() {\n StringBuilder builder = new StringBuilder();\n builder.append(accessType.toString());\n if(staticMethod)\n builder.append(\" static \");\n else\n builder.append(\" \");\n builder.append(returnTypeName);\n builder.append(\" \");\n builder.append(name);\n builder.append(\"(\");\n if(arguments != null) {\n Iterator<String> it = arguments.iterator();\n if(it.hasNext()) {\n builder.append(it.next());\n }\n while(it.hasNext()) {\n builder.append(\", \");\n builder.append(it.next());\n }\n }\n builder.append(\")\");\n return builder.toString().trim();\n }",
"@Override\n public String toString() {\n return String.format(\"REIL function %s\", getName());\n }",
"public String toString() {\n return mySelf()+\"!\";\n }",
"public String toString() {\n return mySelf()+\"!\";\n }",
"@Override\n public String toString() {\n String str = \"\";\n\n //TODO: Complete Method\n\n return str;\n }",
"public String toString() ;",
"@Override\n public String toString() {\n return this.name();\n }",
"public String toString() {\n\n\t\treturn Utilities.cutHeadAtLast(this.getClass().getName(), '.');\n\t}",
"public String toString() {\n return this.getName();\n }",
"@Override\n public String toString() {\n return getClass().getSimpleName() + \": call $\" + name.signatureName + (comment == null ? \"\" : \" ;; \\\"\" + comment + \"\\\"\");\n }",
"@Override\n\tpublic String toString() {\n\t\treturn this.name();\n\t}",
"@Override\n\tpublic abstract String toString ();",
"@Override public String toString();",
"@Override\n public String toString();",
"@Override\n public String toString();",
"public String toString(){\n return getName();\n }",
"public String toString() {\n return getQualifiedName();\n }",
"@Override\n\tpublic String toString() {\n\t\tswitch(type) {\n\t\tcase CLOSURE : return \"*\";\n\t\tcase CONCATENATION : return \"\";\n\t\tcase LPAREN : return \"(\";\n\t\tcase RPAREN : return \")\";\n\t\tcase UNION : return \"|\";\n\t\tdefault: return value;\n\t\t}\n\t}",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n String toString();",
"@Override\n String toString();",
"@Override\n\tpublic String toString() {\n\t\treturn this.getFullName();\n\t}",
"@Override\r\n public String toString();",
"public String toString() {\n\t\treturn this.getName() + m_parameterString;\n\t}",
"public String toString() {\r\n\t\tString str;\r\n\t\tstr = (super.toString() + matureToString());\r\n\r\n\t\treturn str;\r\n\t}",
"abstract public String toString ();",
"@Override \n public String toString() {\n return getName() + \"(\" + getClass().getName() + \")\";\n }",
"static String toString(int kind, Class<?> defc, String name, MethodType type) {\n\t\treturn referenceKindToString(kind) + \" \" + defc.getName() + \".\" + name + \":\" + type; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n\t}",
"@Override\n\tpublic String toString();",
"public String toString(){\n return this.name;\n }",
"public String toString() {\n return name();\n }",
"@Override\n public String toString() {\n return this.getName();\n }",
"@Override\n\tString toString();",
"@Override\n public String toString() {\n return this.getName();\n }",
"@Override\n public abstract String toString();",
"@Override\n String toString();",
"@Override\n\tpublic abstract String toString();",
"@Override\r\n\tpublic String toString();",
"public String toString() {\n return (isRelative() ? \"\" : \"(not relative)\") + getName() + \": \" +\n getClassName();\n }",
"@Override()\n public String toString()\n {\n final StringBuilder buffer = new StringBuilder();\n toString(buffer);\n return buffer.toString();\n }",
"public String toString()\r\n/* 67: */ {\r\n/* 68:253 */ return getClass().getName();\r\n/* 69: */ }",
"@Override\r\n String toString();",
"public String toString() {\n return getClass().getName() + \"[\" + paramString() + \"]\";\n }",
"public String toString() {\n\t}",
"@Override\n\tpublic String toString() {\n\t\treturn this.getName();\n\t}",
"@Override\r\n\tpublic String toString(){\r\n\t\treturn this.name;\r\n\t}",
"@Override\n public String toString()\n {\n return (name);\n }",
"public String toString()\r\n\t{\r\n\t\treturn getName();\r\n\t}",
"abstract public String toString();",
"public String toString() {\n return function.toString();\n }",
"@Override\r\n\tpublic String toString() {\n\t\treturn getName();\r\n\t}",
"@Override\n public String toString() {\n return getName();\n }",
"@Override\n public String toString() {\n return getName();\n }",
"@Override\n public String toString() {\n return getName();\n }",
"@Override\n public String toString() {\n return getName();\n }",
"public String toString() {\n return operator + \"(\" + argument + \")\";\n }",
"public String toString() {\n return this.getName();\n }",
"public String toString() {\n return this.getName();\n }",
"public String toString() {return name;}",
"@Override\n\tpublic String toString() {\n\t\treturn getName();\n\t}",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();"
] | [
"0.6881293",
"0.6677619",
"0.65849435",
"0.65392655",
"0.65281487",
"0.65083003",
"0.64848053",
"0.6433976",
"0.6433976",
"0.63080055",
"0.6302094",
"0.6292457",
"0.6288566",
"0.62842506",
"0.62765455",
"0.6260137",
"0.6257211",
"0.624028",
"0.6227977",
"0.6227977",
"0.6227741",
"0.622683",
"0.6216678",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6208068",
"0.6204556",
"0.6204556",
"0.6204556",
"0.6204556",
"0.6204556",
"0.6204556",
"0.6204556",
"0.61994165",
"0.61994165",
"0.6194373",
"0.6192944",
"0.61900085",
"0.61852896",
"0.61726105",
"0.61672616",
"0.6165267",
"0.6161036",
"0.6157021",
"0.61565506",
"0.6145962",
"0.6142578",
"0.6140443",
"0.6138864",
"0.61377704",
"0.61368984",
"0.6135185",
"0.61330247",
"0.61284924",
"0.61266166",
"0.61228365",
"0.61205083",
"0.61149645",
"0.610955",
"0.6107585",
"0.6096336",
"0.6095562",
"0.6090605",
"0.6085941",
"0.6084134",
"0.6079249",
"0.6079249",
"0.6079249",
"0.6079249",
"0.607887",
"0.6073454",
"0.6073454",
"0.6066271",
"0.60570455",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982",
"0.6054982"
] | 0.62770236 | 14 |
On tab change event. | @Override
public void onTabChange() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void tabChanged()\n {\n super.tabChanged();\n }",
"public void tabChange() {\r\n\t}",
"@Override\n\tpublic void onTabChanged(String tabId) {\n\t}",
"@Override\r\n\tpublic void onChange(TabInfo mLastTab) {\n\t\t\r\n\t}",
"private void registerTabChange() {\n view\n .getNationsTabPane()\n .getSelectionModel()\n .selectedItemProperty()\n .addListener((v, oldValue, newValue) -> tabChanged(oldValue, newValue));\n }",
"@Override\n\tpublic void onTabChange() {\n\t\tthis.reset();\n\t}",
"@Override\n public void onTabChanged(String tabId) {\n CTSCLog.d(TAG, \"onTabChanged() tabId = \" + tabId);\n if (tabId.equals(\"auto\")) {\n mTabIndex = TAB_AUTO;\n } else {\n mTabIndex = TAB_MANUAL;\n }\n }",
"void onTabSelectionChanged(int tabIndex);",
"void onTabReselected(int position);",
"@Override\n public void onTabReselected(TabLayout.Tab tab) {}",
"@Override\n public void onTabReselected(TabLayout.Tab tab) {\n\n }",
"@Override\n public void onTabChanged(String tabId) {\n\t\t\t\tif(tabId.equalsIgnoreCase(FocusKeyWord.page_log.toString())&&isFirstInitLogBoolean){\n \tif(isLoadingLog==false)\n \t\tLoadPlayerLog(); \n \tSetFocusToView(refreshButton);\n \tisFirstInitLogBoolean=false;\n }\n else if(tabId.equalsIgnoreCase(FocusKeyWord.page_download.toString())&&isFirstInitDownloadBoolean){\n \tStartDownloadDatas();\n \tisFirstInitDownloadBoolean=false;\n }\n }",
"public void onTabChanged(String tag) {\n\t\tint pos = this.mTabHost.getCurrentTab();\n\t\tthis.mViewPager.setCurrentItem(pos);\n }",
"public void tabSelected();",
"@Override\n public void onTabChanged(LinearLayout selectedTab, int selectedIndex, int oldIndex) {\n Toast.makeText(MainActivity.this,\"Tab \"+ selectedIndex+\" Selected.\",Toast.LENGTH_SHORT).show();\n }",
"@Override\n\t\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\t\n\t\t}",
"private void onTabPaneSelectionChange(Tab newValue) {\n State newState;\n\n if (newValue.equals(tabPreparation)) {\n if (controller.getState().equals(State.MEETING)) {\n AlertHelper.showWarning(LanguageKey.WARNING_CHANGE_TAB_REVERSE);\n }\n newState = State.PREPARATION;\n } else if (newValue.equals(tabMeeting)) {\n if (controller.getState().equals(State.ENDING)) {\n AlertHelper.showWarning(LanguageKey.WARNING_CHANGE_TAB_REVERSE);\n }\n newState = State.MEETING;\n } else if (newValue.equals(tabEnding)) {\n newState = State.ENDING;\n } else {\n Logger logger = Logger.getInstance();\n logger.handleException(new Exception(\"Unexpected behavior!\"));\n return;\n }\n\n controller.changeState(newState);\n }",
"private void tabChanged(final Tab oldTab, final Tab newTab) {\n log.debug(\"Tab changed from {} to {}\", oldTab.getText(), newTab.getText());\n\n Nation newNation = determineNation(newTab.getText());\n\n clearRegionSelection(newNation);\n selectFirstRegion(newNation);\n }",
"public void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t }",
"@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\r\n\t}",
"@Override\r\n\t\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t}",
"@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\r\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\t\n\t}",
"protected abstract void doTabSelectionChanged(int oldIndex, int newIndex);",
"@Override\n\tpublic void onTabChanged(String tabName) {\n\t\tmSelectedTab = tabName;\n\n\t\t// ImageView imgStatus = (ImageView) findViewById(R.id.imgInfoIcon);\n\t\t//\n\t\t// // Get the color of the icon depending on system state\n\t\t// int iconColor = android.graphics.Color.BLACK\n\t\t// if (systemState == Status.ERROR)\n\t\t// iconColor = android.graphics.Color.RED\n\t\t// else if (systemState == Status.WARNING)\n\t\t// iconColor = android.graphics.Color.YELLOW\n\t\t// else if (systemState == Status.OK)\n\t\t// iconColor = android.graphics.Color.GREEN\n\t\t//\n\t\t// // Set the correct new color\n\t\t// imgView.setColorFilter(iconColor, Mode.MULTIPLY);\n\n\t\tif (hMapTabs.get(tabName).size() == 0) {\n\n\t\t\tif (tabName.equals(Const.EVENTS)) {\n\t\t\t\taddFragments(tabName, new EventsFragment(), null, false, true);\n\t\t\t} else if (tabName.equals(Const.FEED)) {\n\t\t\t\taddFragments(tabName, new FeedFragment(), null, false, true);\n\t\t\t} else if (tabName.equals(Const.INFO)) {\n\t\t\t\taddFragments(tabName, new InfoFragment(), null, false,\n\t\t\t\t\t\ttrue);\n\t\t\t}\n\t\t} else {\n\t\t\taddFragments(\n\t\t\t\t\ttabName,\n\t\t\t\t\thMapTabs.get(tabName).get(hMapTabs.get(tabName).size() - 1),\n\t\t\t\t\tnull, false, false);\n\t\t}\n\t}",
"protected abstract void updateTabState();",
"@Override\r\n\t\t\tpublic void onTabChanged(String tabId) {\n\t\t\t\tFragmentManager manager = getFragmentManager();\r\n\t\t\t\tshowFragment = (ShowFragment) manager\r\n\t\t\t\t\t\t.findFragmentByTag(ShowFragment.TAG);\r\n\t\t\t\taddRecordFrag = (AddRecordFrag) manager\r\n\t\t\t\t\t\t.findFragmentByTag(AddRecordFrag.TAG);\r\n\t\t\t\tchartShowFrag = (ChartShowFrag) manager\r\n\t\t\t\t\t\t.findFragmentByTag(ChartShowFrag.TAG);\r\n\t\t\t\tfTransaction = manager.beginTransaction();\r\n\t\t\t\tif (showFragment != null) {\r\n\t\t\t\t\tfTransaction.detach(showFragment);\r\n\t\t\t\t}\r\n\t\t\t\tif (addRecordFrag != null) {\r\n\t\t\t\t\tfTransaction.detach(addRecordFrag);\r\n\t\t\t\t}\r\n\t\t\t\tif (chartShowFrag != null) {\r\n\t\t\t\t\tfTransaction.detach(chartShowFrag);\r\n\t\t\t\t}\r\n\t\t\t\tif (tabId.equalsIgnoreCase(ShowFragment.TAG)) {\r\n\t\t\t\t\tsetShow();\r\n\t\t\t\t\tcurrent = SHOW;\r\n\t\t\t\t} else if (tabId.equalsIgnoreCase(AddRecordFrag.TAG)) {\r\n\t\t\t\t\tsetAddRecord();\r\n\t\t\t\t\tcurrent = ADD;\r\n\t\t\t\t} else if (tabId.equalsIgnoreCase(ChartShowFrag.TAG)) {\r\n\t\t\t\t\tsetChartShow();\r\n\t\t\t\t\tcurrent = CHART;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tswitch (current) {\r\n\t\t\t\t\tcase SHOW:\r\n\t\t\t\t\t\tsetShow();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase ADD:\r\n\t\t\t\t\t\tsetAddRecord();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase CHART:\r\n\t\t\t\t\t\tsetChartShow();\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tfTransaction.commit();\r\n\t\t\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\n\t}",
"@Override\r\n\t\tpublic void onTabReselected(Tab tab, android.app.FragmentTransaction ft) {\n\t\t}",
"public String onTabChange()\n\t{\n\t\tlogger.info(\"-----------Inside onTabChange method()----------------\");\n\t\tSmsController controller=null;\n\t\tlibrarianDataBean.setName(\"\");\n\t\tsetSubjectlistFlag(false);\n\t\ttry{\n\t\tclasSectionList=new ArrayList<String>();\n\t\tApplicationContext ctx = FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());\n\t\tcontroller = (SmsController) ctx.getBean(\"controller\");\n\t\tString personID = (String) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(\"LogID\");\n\t clasSectionList = controller.getClassList(personID);\n\t Collections.sort(clasSectionList);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tlogger.warn(\" exception - \"+e);\n\t\t}\n\t\treturn null;\t\n\t}",
"@Override\n public void onTabChanged(String s) {\n int pos = this.mTabHost.getCurrentTab();\n this.mViewPager.setCurrentItem(pos);\n onSetToolbarTitle(pos);\n }",
"public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {\n }",
"@SuppressLint(\"NewApi\") @Override\n public void onTabReselected(android.app.ActionBar.Tab tab,\n FragmentTransaction ft) {\n }",
"public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {\n }",
"@Override\r\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\r\n\t}",
"public void onTabReselected(Tab tab, android.app.FragmentTransaction ft) {\n }",
"@Override\r\n\t\t\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\r\n\t\t\t}",
"@Override\n\t\tpublic void onTabChanged(String tabId)\n\t\t{\n\t\t\tToast.makeText(AndrewTabActivity.this, \"You Clicked \" + tabId, Toast.LENGTH_SHORT).show();\n\t\t\tdialog_clicked(tabId);\n\t\t}",
"@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n mViewPager.setCurrentItem(tab.getPosition());\n\n if(tab.getPosition() == 2 && !jsonData.equals(\"\") && !integratedUpdated) {\n carCheckIntegratedFragment.letsEnterModifyMode();\n integratedUpdated = true;\n }\n\n if(tab.getPosition() == 1 && !jsonData.equals(\"\") && !frameUpdated) {\n carCheckFrameFragment.letsEnterModifyMode();\n frameUpdated = true;\n }\n }",
"@Override\n public void onTabSelected(TabLayout.Tab tab) {\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n\n // set the current page position\n current_page = tab.getPosition();\n\n // if the current page is the ListMatesFragment, remove the searchView\n if(mToolbar_navig_utils!=null){\n if(current_page==2)\n mToolbar_navig_utils.getSearchView().setVisibility(View.GONE);\n else\n mToolbar_navig_utils.getSearchView().setVisibility(View.VISIBLE);\n }\n\n // refresh title toolbar (different according to the page selected)\n if(mToolbar_navig_utils !=null)\n mToolbar_navig_utils.refresh_text_toolbar();\n\n // Disable pull to refresh when mapView is displayed\n if(tab.getPosition()==0)\n swipeRefreshLayout.setEnabled(false);\n else\n swipeRefreshLayout.setEnabled(true);\n }",
"@Override\n public void onTabChanged(String tabId) {\n FragmentManager fragmentManager = TabMainActivity.this.getSupportFragmentManager();\n FragmentTransaction transaction = fragmentManager.beginTransaction();\n int position = fragmentTabHost.getCurrentTab();\n for (int i = 0; i < list.size(); i++) {\n if (position == i) {\n transaction.show(list.get(i));\n } else {\n transaction.hide(list.get(i));\n }\n }\n transaction.commit();\n//\t viewPage.setCurrentItem(position);\n }",
"public void stateChanged(ChangeEvent e){\r\n \t//logger.info(\"Change event \" + e.getSource());\r\n \tif(e.getSource() == tabbedPane){\r\n \t\tlogger.info(\"Index of the selected tab is \" + tabbedPane.getSelectedIndex()); \r\n \t\tif(tabbedPane.getSelectedIndex() == -1){\r\n \t\t\treturn;\r\n \t\t}\r\n \t\t// Change to the current view\r\n \t\tcurrentView = tabViews.get(tabbedPane.getSelectedIndex());\r\n \t}\r\n }",
"@Override\n\tpublic void onTabChanged(String tabId) {\n\t\tLog.d(\"tabId\",\"id==\"+tabId);\n\t\tMessage msg = new Message();\n\t\tmsg.what = 0x00;\n\t\tmsg.obj = \"auto\";\n\t\tsendDataThread.getHandler().sendMessage(msg);\n\t\tif(tabId.equals(\"specSoil\")){\n\t\t\tToast.makeText(this, \"自动有土栽培模式\", Toast.LENGTH_SHORT).show();\n\t\t\tFragment fragment = new AutoSoilFrag();\n\t\t\tFragmentTransaction ft = getFragmentManager().beginTransaction();\n\t\t\tft.replace(R.id.container_auto, fragment).commit();\n\t\t}\n\t\tif(tabId.equals(\"specnonSoil\")){\n\t\t\tToast.makeText(this, \"自动无土栽培模式\", Toast.LENGTH_SHORT).show();\n\t\t\tFragment fragment = new AutoNonSoilFrag();\n\t\t\tFragmentTransaction ft = getFragmentManager().beginTransaction();\n\t\t\tft.replace(R.id.container_auto, fragment).commit();\n\t\t}\n\t\n\t}",
"public void stateChanged(ChangeEvent e)\r\n {\r\n // If the source is not the JTabbedPane, then return\r\n if (!(e.getSource() instanceof JTabbedPane))\r\n {\r\n return;\r\n }\r\n // Get the selected index.\r\n int index = WatchListTableModule.this.tabPane.getSelectedIndex();\r\n debug(\"TabListener Called - State Changed - Tab Pane index is now [\" + index + \"]\");\r\n\r\n // If we are the same index, then simply return, as we are already\r\n // processing for the this tab\r\n if (index == this.lastIndex)\r\n { // Return - As this is not changing\r\n return;\r\n }\r\n // Record our new index if it is at least 0\r\n this.lastIndex = index;\r\n if (WatchListTableModule.this.MODULE_READY)\r\n {\r\n // Ok We are done with a state change, continue processing.\r\n WatchListTableModule.this.startupWatchListTimers(index);\r\n }\r\n }",
"public void tabChangeHandler(TabChangeEvent event) {\n if (event.getTab().getTitle().equals(NEW_STEP_LABEL)) {\n NewTaskService.addNewStep(stepsValues);\n }\n }",
"@Override\n\tpublic void selectTab(Tab tab) {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void onTabChanged(String tabId) {\n\t\t\t\tif (!tabId.equalsIgnoreCase(\"my orders\")) {\n\t\t\t\t\tCookingOrder.stopCooking();\n\t\t\t\t\tServedOrder.stopServe();\n\t\t\t\t}\n\t\t\t}",
"public void onTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) {\n }",
"@Override\n\tpublic void onTabReselected(ActionBar.Tab tab,\n\t\t\tFragmentTransaction fragmentTransaction) {\n\n\t}",
"public void stateChanged (ChangeEvent e)\r\n\t {\t\t\r\n\t\t int index = tabbedPane.getSelectedIndex();\r\n\t\t m_selectionActive = (index == 0);\r\n\t }",
"private void changeTab(int tabIndex) {\n if (tabIndex == 0){\n showNav();\n tabHost.setCurrentTab(0);\n radioGroup.clearCheck();\n }\n else {\n if (tabHost.getCurrentTab() == tabIndex) {\n // dong filter tab -> main tab\n showNav();\n tabHost.setCurrentTab(0);\n radioGroup.clearCheck();\n } else {\n // mo filter tab\n hideNav();\n tabHost.setCurrentTab(tabIndex);\n }\n }\n }",
"@Override\n\tpublic void onTabReselected(Tab arg0, FragmentTransaction arg1) {\n\n\t}",
"@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\r\n\t\t// on tab selected\r\n\t\t// showing respected fragment view at view pager\r\n\t\tviewPager.setCurrentItem(tab.getPosition());\r\n\t}",
"@Override\n\tpublic void onTabReselected(Tab tab, FragmentTransaction ft) {\n\t\treturn;\n\t}",
"public void applyTab();",
"@Override\n\t\t\tpublic void onTabChanged(String tabId) {\n\t\t\t\t\n\t\t\t\ttabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor(\"#FFBF00\"));\n\t\t\t\tfor(int i=0;i<tabHost.getTabWidget().getChildCount();i++){\n\t\t\t\t\tif(i != tabHost.getCurrentTab()){\n\t\t\t\t\t\ttabHost.getTabWidget().getChildAt(i).setBackgroundResource(R.drawable.tab_fonis);\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"@Override\n\tpublic void onTabChanged(String tabId) {\n\t\tcurrenttab = tabHost.getCurrentTab();\n\t\tif (currenttab == 0) {\n\t\t\tTravellersinfo.setTextColor(Color.parseColor(\"#d16413\"));\n\t\t\tMemberslogin.setTextColor(Color.parseColor(\"#000000\"));\n\t\t\ttravellerssecondrow.setVisibility(View.VISIBLE);\n\t\t} else {\n\t\t\tMemberslogin.setTextColor(Color.parseColor(\"#d16413\"));\n\t\t\tTravellersinfo.setTextColor(Color.parseColor(\"#000000\"));\n\n\t\t\ttravellerssecondrow.setVisibility(View.GONE);\n\t\t}\n\n\t\tfor (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {\n\t\t\ttabHost.getTabWidget().getChildAt(i)\n\t\t\t\t\t.setBackgroundResource(R.drawable.boxtypboders);\n\t\t}\n\n\t\t// Adding bottom image on current tab\n\t\ttabHost.getTabWidget().getChildAt(tabHost.getCurrentTab())\n\t\t\t\t.setBackgroundResource(R.drawable.selectedtab);\n\t}",
"private void initTab()\n {\n \n }",
"@Override\n public void onTabChanged(String tabNumber) {\n for (int i = 0; i < tabHost.getTabWidget().getChildCount(); i++) {\n// tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor(\"#FF0000\")); // unselected\n TextView tv = (TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title); //Unselected Tabs\n tv.setTextColor(Color.parseColor(\"#ffffff\"));\n }\n// tabHost.getTabWidget().getChildAt(tabHost.getCurrentTab()).setBackgroundColor(Color.parseColor(\"#0000FF\")); // selected\n TextView tv = (TextView) tabHost.getCurrentTabView().findViewById(android.R.id.title); //for Selected Tab\n tv.setTextColor(Color.parseColor(\"#ffffff\"));\n\n //Change tab underline indicator color\n TabWidget widget = tabHost.getTabWidget();\n for(int i = 0; i < widget.getChildCount(); i++) {\n View v = widget.getChildAt(i);\n\n // Look for the title view to ensure this is an indicator and not a divider.\n TextView tvv = (TextView)v.findViewById(android.R.id.title);\n if(tvv == null) {\n continue;\n }\n v.setBackgroundResource(R.drawable.tab_widget_bottom_indicator_by_xml);\n }\n\n //Tab Animation part\n currentView = tabHost.getCurrentView();\n if (tabHost.getCurrentTab() > currentTab){\n previousView.setAnimation(outTOLeftAnimation());\n currentView.setAnimation(inFromRightAnimation());\n } else {\n previousView.setAnimation(outTORightAnimation());\n currentView.setAnimation(inFromLeftAnimation());\n }\n\n previousView = currentView;\n currentTab = tabHost.getCurrentTab();\n }",
"@Override\n public void onTabUnselected(TabLayout.Tab tab) {\n\n }",
"@Override\n public void onObservingDifferentTab(Tab tab, boolean hint) {\n if (tab == null || tab == mActiveTab) return;\n\n if (mActiveTab != null && mActiveTab.isInitialized()) {\n TabWebContentsObserver.from(mActiveTab)\n .removeInitWebContentsObserver(mInitWebContentsObserver);\n }\n mActiveTab = tab;\n TabWebContentsObserver.from(tab).addInitWebContentsObserver(\n mInitWebContentsObserver);\n }",
"@Override\r\n\tpublic void onTabReselected(Tab arg0,\r\n\t\t\tandroid.support.v4.app.FragmentTransaction arg1) {\n\r\n\t}",
"@Override\r\n protected void registerChangeListener()\r\n {\r\n getTabbedPane().addChangeListener(this);\r\n }",
"private void showTab(int tab) {\n switch (tab) {\n case OUTING_TAB_EXPENSES:\n switchToExpensesTab();\n break;\n case OUTING_TAB_BUDDIES:\n switchToBuddiesTab();\n break;\n }\n\n this.activeTab = tab;\n }",
"@Override\n public void onTabSelected(Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\n if (tab.getPosition() == 1) {\n HomeFragment homeFragment = (HomeFragment)getSupportFragmentManager()\n .findFragmentByTag(\"android:switcher:\"+viewPager.getId()+\":\"+tab.getPosition());\n homeFragment.init();\n }\n }",
"@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\tvp.setCurrentItem(tab.getPosition());\n\t}",
"@Override\n public void onTabSelected(TabLayout.Tab tab) {\n mViewPager.setCurrentItem(tabLayout.getSelectedTabPosition());\n }",
"@Override\n public void onTabUnselected(TabLayout.Tab tab) {}",
"@Override\r\n\t\t\t\tpublic void onTabChanged(String tabId) {\r\n\t\t\t\t\t for(int i=0;i<mTabHost.getTabWidget().getChildCount();i++)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t mTabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor(\"#96E0D2\"));\r\n\t\t\t\t\t } \r\n\t\t\t\t\t mTabHost.getTabWidget().getChildAt(Integer.parseInt(tabId)).setBackgroundColor(Color.parseColor(\"#65D2BD\"));\r\n\t\t\t\t}",
"private void eric_function()\n\t{\n \ttabHost = (TabHost) findViewById(R.id.mytab1);\n \ttabHost.setup();\n \t \n \t//tabHost.setBackgroundColor(Color.argb(150, 20, 80, 150));\n \ttabHost.setBackgroundResource(R.drawable.ic_launcher);\n \t\n \t\n \t//\n \tTabSpec tabSpec;\n \t// 1\n \ttabSpec = tabHost.newTabSpec(tab_list[0]);\n \ttabSpec.setIndicator(\"a.1\");\n \ttabSpec.setContent(R.id.widget_layout_blue2);\n \ttabHost.addTab(tabSpec);\n \t// 2\n \ttabSpec = tabHost.newTabSpec(tab_list[1]);\n \ttabSpec.setIndicator(\"a2\");\n \ttabSpec.setContent(R.id.widget_layout_green2);\n \ttabHost.addTab(tabSpec); \t\n \t// 3\n \ttabSpec = tabHost.newTabSpec(tab_list[2]);\n \ttabSpec.setIndicator(\"a3\");\n \ttabSpec.setContent(R.id.widget_layout_red2);\n \ttabHost.addTab(tabSpec); \t\n \t//\n\t\ttabHost.setOnTabChangedListener(listener1);\n \t//\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\n public void onTabUnselected(TabLayout.Tab tab) {\n }",
"@Override\n public void onTabSelected(TabLayout.Tab tab) {\n\n this.mPager.setCurrentItem(tab.getPosition());\n }",
"public void tabSelected(TabLayout.Tab tab) {\n clearBackstack();\n FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();\n if (tab.getPosition() == 0) {\n transaction.replace(R.id.home_page_frame_layout, HomeFragment.newInstance(user));\n } else if (tab.getPosition() == 1) {\n transaction.replace(R.id.home_page_frame_layout, WallsFragment.newInstance(user));\n } else if (tab.getPosition() == 2) {\n transaction.replace(R.id.home_page_frame_layout, ProjectsFragment.newInstance(user));\n } else if (tab.getPosition() == 3) {\n transaction.replace(R.id.home_page_frame_layout, UserInfoFragment.newInstance(user));\n }\n transaction.addToBackStack(null);\n transaction.commit();\n }",
"@Override\n public void onTabSelected(TabLayout.Tab tab) {\n super.onTabSelected(tab);\n switch(tab.getPosition())\n {\n case 0:\n searchView.setQueryHint(\"Search Devices...\");\n break;\n\n case 1:\n searchView.setQueryHint(\"Search Actions...\");\n break;\n\n// case 2:\n// searchView.setQueryHint(\"Search Alerts...\");\n// break;\n }\n }",
"public void setSelectedTab(int arg0) {\n\n\t}",
"@Override\n public void bookmarkedStatusHasChanged(Tab tab) {\n mUi.bookmarkedStatusHasChanged(tab);\n }",
"public void contentPanelTabSwitchAction() {\n\t\tComponent selectedComponent = animalsTab.getTabPanel().getSelectedComponent();\n\t\tComponent animalTab = this.animalsTab;\n\t\tif (selectedComponent == animalTab) {\n\t\t\tfillUpAnimalsTable(dateToDisplay);\n\t\t}\n\t}",
"public void propertyChange(PropertyChangeEvent event)\n {\n \t\tif(event.getProperty().equals(\"tabsAsSpaces\") \n \t\t\t|| event.getProperty().equals(\"tabWidth\"))\n \t\t{\n \t\t//System.out.println(\n \t\t\t\t//\"Tab preferences have changed. Resetting the editor.\"\n \t\t\t//);\n \t\t\tISourceViewer sourceViewer = getSourceViewer();\n \t\t\tsourceViewer.getTextWidget().setTabs(\n \t\t\t\tconfiguration.getTabWidth(sourceViewer)\n \t\t\t);\n }\n }",
"public void stateChanged(ChangeEvent evt) {\n\t\t JTabbedPane pane = (JTabbedPane)evt.getSource();\n\n\t\t // Get current tab\n\t\t int sel = pane.getSelectedIndex();\n\t\t if(sel == 0 || sel == 5){\n\t\t \tbtnPrintBrew.setVisible(false);\n\t\t \t\tbtnPrintBrew.setEnabled(false);\n\t\t }else{\n\t\t \tbtnPrintBrew.setVisible(true);\n\t\t \t\tbtnPrintBrew.setEnabled(true);\n\t\t }\n\t\t }",
"public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft)\n {\n // Check if the fragment is already initialized\n if (mFragment == null)\n {\n // If not, instantiate and add it to the activity\n mFragment = Fragment.instantiate(mActivity, mClass.getName());\n ft.add(android.R.id.content, mFragment, mTag);\n }\n else\n {\n // If it exists, simply attach it in order to show it\n ft.attach(mFragment);\n }\n\n if(mTag.equals(MiNoteConstants.NOTES_TAB))\n {\n createNotes(true);\n\n isNoteTabSelected = true;\n\n if(areNoteButtonCreated)\n {\n makeNoteButtonsInvisible();\n }\n }\n else if(mTag.equals(MiNoteConstants.EVENTS_TAB))\n {\n createNotes(false);\n\n isNoteTabSelected = false;\n\n if(areNoteButtonCreated)\n {\n makeNoteButtonsInvisible();\n }\n }\n }",
"@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\n\t\tmAdapter.notifyDataSetChanged();\n\t\tviewPager.setCurrentItem(tab.getPosition());\n\t\n\t}",
"@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\r\n\t\tviewPager.setCurrentItem(tab.getPosition());\r\n\r\n\t}",
"@Override\n public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {\n mTabPager.setCurrentItem(tab.getPosition());\n // jumpFlag = true;\n }",
"public void onTabSelected(Tab tab, android.app.FragmentTransaction ft) {\n FragmentTransaction sft = mActivity.getSupportFragmentManager().beginTransaction();\n // Check if the fragment is already initialized\n MainActivity.tab = tab.getPosition();\n switch (tab.getPosition()) {\n case 0:\n // My List\n // access the actionbar of the MainActivity.java and changes the subtitle\n mActivity.getActionBar().setSubtitle(Html.fromHtml(\"<font color=\\\"#848484\\\">\" + \"My List\" + \"</font>\"));\n break;\n \n case 1:\n // Favorites\n // access the actionbar of the MainActivity.java and changes the subtitle\n mActivity.getActionBar().setSubtitle(Html.fromHtml(\"<font color=\\\"#848484\\\">\" + \"Favorites \" + \"</font>\"));\n break;\n \n case 2:\n // Search\n // access the actionbar of the MainActivity.java and changes the subtitle\n mActivity.getActionBar().setSubtitle(Html.fromHtml(\"<font color=\\\"#848484\\\">\" + \"Search\" + \"</font>\"));\n break;\n\n case 3:\n // Recipes\n // access the actionbar of the MainActivity.java and changes the subtitle\n mActivity.getActionBar().setSubtitle(Html.fromHtml(\"<font color=\\\"#848484\\\">\" + \"Recipes\" + \"</font>\"));\n break;\n\n default:\n break;\n }\n if (mFragment == null) {\n // If not, instantiate and add it to the activity\n mFragment = Fragment.instantiate(mActivity, mClass.getName());\n sft.add(mfragmentContainerId, mFragment, mTag);\n } else {\n // If it exists, simply attach it in order to show it\n sft.attach(mFragment);\n }\n sft.commit();\n }",
"private void setTab() {\n\t\tTabHost.TabSpec showSpec = host.newTabSpec(ShowFragment.TAG);\r\n\t\tshowSpec.setIndicator(showLayout);\r\n\t\tshowSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(showSpec);\r\n\r\n\t\tTabHost.TabSpec addSpec = host.newTabSpec(AddRecordFrag.TAG);\r\n\t\taddSpec.setIndicator(addLayout);\r\n\t\taddSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(addSpec);\r\n\r\n\t\tTabHost.TabSpec chartSpec = host.newTabSpec(ChartShowFrag.TAG);\r\n\t\tchartSpec.setIndicator(chartLayout);\r\n\t\tchartSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(chartSpec);\r\n\t}",
"@Override\n public void onTabSelected(TabLayout.Tab tab) {\n\n viewPager.setCurrentItem(tab.getPosition());\n }",
"@Override\n\tpublic void pressTab() {\n\t\tSystem.out.println(\"Change active control.\");\n\t\t\n\t\tchangeCurrentControl(false);\n\t\t\n\t\tif (getCurrentControlIndex() < getControls().size() - 1) \n\t\t\tsetCurrentControlIndex(getCurrentControlIndex() + 1);\n\t\telse \n\t\t\tsetCurrentControlIndex(0);\n\n\t\tchangeCurrentControl(true);\n\t}",
"@Override\n public void onTabSelected(TabLayout.Tab tab) {\n viewPager.setCurrentItem(tab.getPosition());\n }",
"@Override\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\n\t}",
"@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n viewPager.setCurrentItem(tab.getPosition());\r\n\t\t\r\n\t}",
"public void stateChanged(ChangeEvent e) {\n\t\t\tBasicPane selectedPane = (BasicPane) tabbedPane\n\t\t\t\t\t.getSelectedComponent();\n\t\t\tselectedPane.entryActions();\n\t\t}",
"@Override\n\t\tpublic void onTabUnselected(Tab tab, FragmentTransaction ft) {\n\t\t\t\n\t\t}",
"public void setTabName(String value) {\n this.tabName = value;\n }"
] | [
"0.87266296",
"0.86978096",
"0.82730836",
"0.8040474",
"0.7762915",
"0.7755559",
"0.7658509",
"0.7647288",
"0.7576209",
"0.75618136",
"0.7450596",
"0.74319667",
"0.74094695",
"0.7345992",
"0.7342518",
"0.7283818",
"0.7266816",
"0.71719223",
"0.7166205",
"0.7163557",
"0.7163557",
"0.7150094",
"0.7150003",
"0.7147755",
"0.7147755",
"0.7147755",
"0.71426296",
"0.71369475",
"0.71367645",
"0.71012986",
"0.7094663",
"0.7094663",
"0.7094663",
"0.7094663",
"0.7094663",
"0.70803463",
"0.70769954",
"0.7071419",
"0.70589155",
"0.7058443",
"0.70572966",
"0.70404613",
"0.7020287",
"0.70167434",
"0.7007729",
"0.6998969",
"0.6997304",
"0.69608253",
"0.69178",
"0.69118756",
"0.6908452",
"0.69010675",
"0.68817747",
"0.68747747",
"0.6866515",
"0.6828966",
"0.68259704",
"0.6819296",
"0.67712235",
"0.6697188",
"0.6694445",
"0.66900605",
"0.6688638",
"0.66836804",
"0.6675397",
"0.6656251",
"0.6647028",
"0.66372913",
"0.6636447",
"0.6623946",
"0.66190726",
"0.65964174",
"0.6595541",
"0.65909404",
"0.65844023",
"0.65567636",
"0.65369517",
"0.653203",
"0.6507143",
"0.6501928",
"0.64992017",
"0.6491839",
"0.6488134",
"0.6488035",
"0.6451813",
"0.6447857",
"0.64467907",
"0.6430589",
"0.6426934",
"0.6425112",
"0.64174545",
"0.6413461",
"0.6410694",
"0.6386098",
"0.6383542",
"0.63633895",
"0.634883",
"0.6335265",
"0.63289416",
"0.6327554"
] | 0.8691639 | 2 |
Fetch batch log messages for batch log from database. | public void loadBatchLogMessagesByStudent() {
if (this.loadBatchLogMessagesFromDB) {
this.setAdmissionBatchLogMessages(this.batchLogMessageService.findBatchLogMessagesByStudentId(this.admissionBean.getStudent().getId()));
Collections.sort((List<BatchLogMessage>) this.getAdmissionBatchLogMessages(), new BatchLogMessageComparator(BatchLogMessageComparator.Order.ID));
this.loadBatchLogMessagesFromDB = false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void logBatch(String sql, int repeatTimes, long nanoTime) ;",
"private CompletableFuture<Iterator<T>> batch() {\n return batch.thenCompose(iterator -> {\n if (iterator != null && !iterator.hasNext()) {\n batch = fetch(iterator.position());\n return batch.thenApply(Function.identity());\n }\n return CompletableFuture.completedFuture(iterator);\n });\n }",
"public synchronized List<LogBundle> getLogBundles(final int maxLogCount) {\n if (maxLogCount <= 0) {\n Logger.e(\"Cannot count data without proper maxLogCount\");\n return null;\n }\n\n return queryExecutor(new QueryExecCallback<List<LogBundle>>() {\n @Override\n public List<LogBundle> execute(SQLiteDatabase db) {\n // read logs from DB\n String query = \"SELECT * FROM \" + TABLE_NAME\n + \" ORDER BY \" + Columns.CREATED_AT + \" ASC \"\n + \" LIMIT \" + maxLogCount;\n\n Cursor cursor = db.rawQuery(query, null);\n\n if (cursor == null) {\n return null;\n }\n\n // divide logs by token\n Map<String, LogBundle> logBundleMap = new HashMap<>();\n\n try {\n while (cursor.moveToNext()) {\n String token = getStringFromCursor(cursor, Columns.TOKEN);\n JSONObject json = new JSONObject(getStringFromCursor(cursor, Columns.LOG));\n\n LogBundle logBundle;\n if (logBundleMap.containsKey(token)) {\n logBundle = logBundleMap.get(token);\n } else {\n logBundle = new LogBundle();\n String url = getStringFromCursor(cursor, Columns.URL);\n logBundle.setUrl(url);\n logBundle.setToken(token);\n }\n\n logBundle.addLog(json);\n\n // logBundle별로 last_ID를 가장 최신의 것으로 업데이트 \n logBundle.setLast_ID(getStringFromCursor(cursor, Columns._ID));\n\n logBundleMap.put(token, logBundle);\n }\n } catch (JSONException e) {\n Logger.e(\"Failed to getting logs from DB. \" + e.getMessage());\n } finally {\n cursor.close();\n }\n\n return new ArrayList<>(logBundleMap.values());\n }\n });\n }",
"@Override\n\tpublic List<Log> finLogALL() {\n\t\tString sql = \"SELECT * FROM t_log ORDER BY ASC\";\n\t\tList<Log> list = null;\n\t\ttry {\n\t\t\tlist = qr.query(sql, new BeanListHandler<Log>(Log.class));\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}",
"public abstract List<Log> getAll() throws DatabaseConfigException;",
"public List<Batch> getAll() {\n return batchRepository.findAll();\n }",
"@Override\n public List<LogBundle> execute(SQLiteDatabase db) {\n String query = \"SELECT * FROM \" + TABLE_NAME\n + \" ORDER BY \" + Columns.CREATED_AT + \" ASC \"\n + \" LIMIT \" + maxLogCount;\n\n Cursor cursor = db.rawQuery(query, null);\n\n if (cursor == null) {\n return null;\n }\n\n // divide logs by token\n Map<String, LogBundle> logBundleMap = new HashMap<>();\n\n try {\n while (cursor.moveToNext()) {\n String token = getStringFromCursor(cursor, Columns.TOKEN);\n JSONObject json = new JSONObject(getStringFromCursor(cursor, Columns.LOG));\n\n LogBundle logBundle;\n if (logBundleMap.containsKey(token)) {\n logBundle = logBundleMap.get(token);\n } else {\n logBundle = new LogBundle();\n String url = getStringFromCursor(cursor, Columns.URL);\n logBundle.setUrl(url);\n logBundle.setToken(token);\n }\n\n logBundle.addLog(json);\n\n // logBundle별로 last_ID를 가장 최신의 것으로 업데이트 \n logBundle.setLast_ID(getStringFromCursor(cursor, Columns._ID));\n\n logBundleMap.put(token, logBundle);\n }\n } catch (JSONException e) {\n Logger.e(\"Failed to getting logs from DB. \" + e.getMessage());\n } finally {\n cursor.close();\n }\n\n return new ArrayList<>(logBundleMap.values());\n }",
"@SuppressWarnings(\"unchecked\")\n\t@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED)\n\tpublic List<Batch> findAllCurrent();",
"ReadResponseMessage fetchAllMessages();",
"void addBatch() throws SQLException;",
"void handle(List<FeedEntry> feedEntryBatch);",
"protected void emitBatch(){\n synchronized(this){\n\n revokeSendBatch();\n\n int viewn = getCurrentViewNumber();\n long seqn = getStateLog().getNextPrePrepareSEQ();\n\n PBFTRequestInfo rinfo = getRequestInfo();\n if(!rinfo.hasSomeWaiting()){\n return;\n }\n /* creates a new pre-prepare message */\n PBFTPrePrepare pp = null;\n\n int size = 0;\n\n /* while has not achieved the batch size and there is digests in queue */\n String digest = null;\n while(size < getBatchSize() && (digest = rinfo.getFirtRequestDigestWaiting())!= null){\n if(pp == null){\n pp = new PBFTPrePrepare(viewn, seqn, getLocalServerID());\n }\n pp.getDigests().add(digest);\n rinfo.assign(digest, RequestState.PREPREPARED);\n size += 1;//rinfo.getRequestSize(digest);\n }\n\n if(pp == null){\n return;\n }\n \n /* emits pre-prepare */\n emitPrePrepare(pp);\n //emit(pp, getLocalGroup().minus(getLocalProcess()));\n\n /* update log current pre-prepare */\n handle(pp);\n\n /* if there is digest then it will schedule a send batch */\n if(rinfo.hasSomeWaiting()){\n batch();\n }//end if digest queue is no empty\n\n }//end synchronized(this)\n }",
"public List<BatchJob> findAll() {\r\n\t\treturn dao.findAll();\r\n\t}",
"public void performBatchComplete() {\n ArrayList arrayList = new ArrayList(this.batch);\n this.batch.clear();\n this.mainThreadHandler.sendMessage(this.mainThreadHandler.obtainMessage(8, arrayList));\n logBatch(arrayList);\n }",
"public ArrayList<Log> GetLogs(){\n ArrayList<Log> LL = new ArrayList<>();\n try{\n String query = \"Select * from GeneralLog\";\n Statement stm = mssqlConecction.conn.createStatement();\n ResultSet rs = stm.executeQuery(query);\n while(rs.next()){\n Log l = new Log();\n l.action=rs.getString(\"action\");\n l.date = rs.getDate(\"date\");\n l.table = rs.getString(\"table\");\n l.new_value = rs.getString(\"new_value\");\n l.old_Value = rs.getString(\"old_value\");\n l.username = rs.getString(\"username\");\n LL.add(l);\n }\n return LL;\n }catch(Exception e){\n return null;\n }\n }",
"public int getBatchSize();",
"@SuppressWarnings(\"resource\")\n @Explain(\"We close the statement later, this is just an intermediate\")\n protected void addBatch() throws SQLException {\n prepareStmt().addBatch();\n batchBacklog++;\n if (batchBacklog > batchBacklogLimit) {\n commit();\n }\n }",
"public void addBatch(String sql) throws SQLException {\n\r\n }",
"private void logAllMessages() {\r\n HistoricalMessage message;\r\n SessionProvider provider = SessionProvider.createSystemProvider();\r\n while (!logQueue.isEmpty()) {\r\n message = logQueue.poll();\r\n if (message != null) {\r\n this.addHistoricalMessage(message, provider);\r\n }\r\n }\r\n provider.close();\r\n }",
"private List<Message> returnMessages(Query query, String recipient) {\n List<Message> messages = new ArrayList<>();\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n String idString = entity.getKey().getName();\n UUID id = UUID.fromString(idString);\n String text = (String) entity.getProperty(\"text\");\n long timestamp = (long) entity.getProperty(\"timestamp\");\n String user = (String) entity.getProperty(\"user\");\n recipient = recipient != null ? recipient : (String) entity.getProperty(\"recipient\");\n\n Message message = new Message(id, user, text, timestamp, recipient);\n messages.add(message);\n // An exception can occur here for multiple reasons (Type casting error, any\n // property not existing, key error, etc...)\n } catch (Exception e) {\n System.err.println(\"Error reading message.\");\n System.err.println(entity.toString());\n e.printStackTrace();\n }\n }\n\n return messages;\n }",
"protected ResultBatch queryBatch(String queryTxt, long timeout) throws IOException {\n\n if (queryTxt.charAt(0) == '@') {\n\n QueryDescription pq = prepareQuery(queryTxt);\n\n return queryBatchPrepared(pq.name, EMPTY_FORMATS, EMPTY_BUFFERS, pq.resultFields, timeout);\n }\n else {\n\n QueryResult handler = new QueryResult();\n\n serverConnection.getRequestExecutor().query(queryTxt, handler);\n\n handler.await(timeout, MILLISECONDS);\n\n return handler.getBatch();\n }\n\n }",
"@Override\r\n\tpublic void run() {\n\t\tLogCollateWorker worker = new LogCollateWorker(logDAO);\r\n\t\tworker.mergeOneBatch();\r\n\t}",
"@Override\n\tpublic List<SmsActivityLogger> fetchLogById(int Id) {\n\t\treturn null;\n\t}",
"private void bulkFetchMessageEnvelopes(Folder folder, Message[] messages)\n\t\tthrows MessagingException {\n\t\tFetchProfile fp = new FetchProfile();\n\t\tfp.add(FetchProfile.Item.ENVELOPE);\n\t\tfolder.fetch(messages, fp);\n\t}",
"Future<JobLogEntryDtoCollection> getJobLogEntryDtoCollection(String jobExecutionId, String sortBy, String order, boolean errorsOnly, String entityType, int limit, int offset, String tenantId);",
"public void fetch(){ \n for(int i = 0; i < this.queries.size(); i++){\n fetch(i);\n }\n }",
"public com.sybase.collections.GenericList<com.sybase.persistence.LogRecord> getLogRecords()\n {\n return ru.terralink.mvideo.sap.LogRecordImpl.findByEntity(\"Orders\", keyToString());\n }",
"public List<QlikMessageDto> getMessagesFromDatabase() {\r\n\t\tArrayList<QlikMessageDto> qlikMessages = new ArrayList<QlikMessageDto>();\r\n\r\n\t\ttry {\r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\tConnection conn = DriverManager.getConnection(url, user, password);\r\n\r\n\t\t\tPreparedStatement statement = conn.prepareStatement(sql_getMessagesFromDatabase, Statement.RETURN_GENERATED_KEYS);\r\n\t\t\tResultSet rs = statement.executeQuery();\r\n\r\n\t\t\twhile (rs.next()) {\r\n\t\t\t\tint id = rs.getInt(\"id\");\r\n\t\t\t\tString messagetext = rs.getString(\"messagetext\");\r\n\t\t\t\tboolean ispalindrome = rs.getBoolean(\"ispalindrome\");\r\n\t\t\t\tString createddatetime = rs.getString(\"createddatetime\");\r\n\r\n\t\t\t\tqlikMessages.add(new QlikMessageDto(id, messagetext, ispalindrome, createddatetime));\r\n\t\t\t}\r\n\t\t\tconn.close();\r\n\t\t} catch (ClassNotFoundException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t} catch (SQLException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn qlikMessages;\r\n\t}",
"public org.eclipse.stardust.engine.api.query.LogEntries\n getAllLogEntries(org.eclipse.stardust.engine.api.query.LogEntryQuery query)\n throws org.eclipse.stardust.common.error.WorkflowException;",
"public abstract ArrayList<Log> readUserLogs(User user, int maxEntries);",
"public ArrayList<Message> getMessages(String logUser, String friendUser, String date){\n String dateAux = date.split(\" \")[0];\r\n String lastDay = sdf.format(Timestamp.valueOf(date).getTime() - (24*60*60*1000));\r\n lastDay = lastDay.split(\" \")[0];\r\n ArrayList<Message> myMessageList = new ArrayList<>();\r\n this.query = \"SELECT * FROM cristomessenger.message\\n\" +\r\n \"WHERE ((id_user_orig = \\\"\" + logUser + \"\\\" and id_user_dest = \\\"\" + friendUser + \"\\\") or (\"\r\n + \"id_user_orig = \\\"\" + friendUser + \"\\\" and id_user_dest = \\\"\" + logUser + \"\\\")) and \"\r\n + \"datetime >= \\\"\" + lastDay + \"%\\\" and \" + \"datetime < \\\"\" + date + \"\\\" order by datetime asc;\";\r\n //System.out.println(\"getMessagesDate: \" + date);\r\n try {\r\n this.ConnectDatabase();\r\n this.QuerySQLExecute();\r\n while (this.rs.next()) {\r\n Message MessageAux = new Message();\r\n MessageAux.setTransmitter(this.rs.getString(\"id_user_orig\"));\r\n MessageAux.setReceiver(this.rs.getString(\"id_user_dest\"));\r\n MessageAux.setText(this.rs.getString(\"text\"));\r\n MessageAux.setDate(this.rs.getString(\"datetime\"));\r\n myMessageList.add(MessageAux);\r\n }\r\n //System.out.println(\"getMessages: \" + myMessageList.size());\r\n } catch (SQLException e ) {\r\n System.out.println(e.getMessage());\r\n } finally {\r\n if (this.stmt != null) { \r\n try {\r\n this.stmt.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(UsersModel.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n if (myMessageList.isEmpty()) {\r\n //myMessageList = getTop10Messages(logUser,friendUser,date);\r\n }\r\n return myMessageList;\r\n }",
"@Override\n public Map<Integer, DestinationWorklogDTO> getAllFailedWorklogs() {\n Map<Integer, DestinationWorklogDTO> failedworklogs = new HashMap<>();\n\n try (Connection connection = database.connect();\n PreparedStatement stmt = connection.prepareStatement(GET_ALL_FAILED_WORKLOGS_SQL)) {\n\n ResultSet rs = stmt.executeQuery();\n\n while (rs.next()) {\n failedworklogs.put(rs.getInt(WORKLOG_ID_COLUMN_NAME), destinationWorklogMapper.toDTO(rs));\n }\n\n } catch (SQLException e) {\n logger.logToDatabase(getClass().getName(), \"getAllFailedWorklogs\", e);\n throw new InternalServerErrorException(e.getMessage());\n }\n return failedworklogs;\n }",
"CmsCouponBatch selectByPrimaryKey(String batchNo);",
"private void batchExecution(List<String[]> rowBatch, int columnCount, int[] mapcols, String chunkId, int noOfChunks,\n int maxRetryCount, int retryTimeout) throws SQLException {\n int k = 0; //retry count\n boolean retry = false;\n int rowBatchSize = rowBatch.size();\n do {\n k++;\n try {\n if (connection == null || connection.isClosed()) {\n getJdbcConnection(maxRetryCount, retryTimeout);\n }\n if (preparedStatement == null || preparedStatement.isClosed()) {\n preparedStatement = connection.prepareStatement(jdbcConfig.getJdbcQuery(),\n ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);\n }\n for (int i = 0; i < rowBatchSize; i++) {\n psLineEndWithSeparator(mapcols, columnCount, rowBatch.get(i));\n preparedStatement.addBatch();\n }\n // ++batch_no;\n executeBatch(rowBatchSize, maxRetryCount, retryTimeout);\n batch_records = 0;\n k = 0;\n retry = false;\n datarowstransferred = datarowstransferred + update;\n update = 0;\n not_update = 0;\n } catch (AnaplanRetryableException ae) {\n retry = true;\n }\n } while (k < maxRetryCount && retry);\n // not successful\n if (retry) {\n throw new AnaplanAPIException(\"Could not connect to the database after \" + maxRetryCount + \" retries\");\n }\n }",
"private void getLogs(final CallbackContext callbackContext) {\n final Activity context = cordova.getActivity();\n this.cordova.getThreadPool().execute(new Runnable() {\n public void run() {\n try {\n // TODO: Consultar base de datos.\n List<String> messages = new AppDatabase(context).getMessages();\n\n Log.v(\"Cordova\", \"messages count: \" + messages.size());\n\n String[] payload = messages.toArray(new String[0]);\n\n // Convierte el payLoad a JSON.\n String json = new Gson().toJson(payload);\n\n CordovaPluginJavaConnection.getLogsContext = callbackContext;\n sendResultSuccess(callbackContext, json);\n } catch (Exception ex) {\n errorProcess(callbackContext, ex);\n }\n }\n });\n }",
"EbayLmsLog selectByPrimaryKey(Integer id);",
"@Test\n\tpublic void findAllBatchNotesTest(){\n//\t\tlog.trace(\"GETTING individual notes by Batch\");\n\t\tfinal short weekNum = 2;\n\t\t// get batch notes\n\t\tList<Note> notes = noteDao.findAllBatchNotes(TEST_BATCH_ID, weekNum);\n\t\t\n\t\t// compare with expected\n\t\tassertEquals(notes.size(),1);\n\t\tassertEquals(notes.get(0).getNoteId(),5133);\n\t}",
"private CompletableFuture<AtomicMultimapService.Batch<T>> fetch(int position) {\n return getProxyClient().applyOn(partitionId, service -> nextFunction.apply(service, position))\n .thenCompose(batch -> {\n if (batch == null) {\n return close().thenApply(v -> null);\n }\n return CompletableFuture.completedFuture(batch);\n });\n }",
"Collection<PreprocessingLog> retrievePreprocessingLogs(final Date processingDate) throws SqlDatabaseSystemException;",
"private InflightBatch popBatch() {\n InflightBatch batch =\n new InflightBatch(\n messages, batchedBytes, this.streamName, this.attachSchema, this.streamWriter);\n this.attachSchema = false;\n reset();\n return batch;\n }",
"public RecordSet loadAllProcessDetailHistory(Record inputRecord);",
"@Override\n public void listRecordsIterative(String query, Map<String, Object> params, AuditResultHandler handler) {\n final String operation = \"listRecordsIterative\";\n int attempt = 1;\n\n while (true) {\n try {\n listRecordsIterativeAttempt(query, params, handler);\n return;\n } catch (RuntimeException ex) {\n attempt = baseHelper.logOperationAttempt(null, operation, attempt, ex, null);\n }\n }\n }",
"@Test\r\n\tpublic void testPLFM_1978_getBackupBatch(){\n\t\tList<Long> list = new LinkedList<Long>();\r\n\t\t// pass the empty list should return an empty result\r\n\t\tList<DBOFileHandle> results = migratableTableDAO.getBackupBatch(DBOFileHandle.class, list);\r\n\t\tassertNotNull(results);\r\n\t\tassertEquals(0, results.size());\r\n\t}",
"public int getBatchSize()\r\n/* 23: */ {\r\n/* 24:42 */ return BatchUpdateUtils.this.size();\r\n/* 25: */ }",
"public void addBatch(List<Map<String, String>> batchData);",
"List<ChatMessage> getMessages(int roomId, int count) throws IOException;",
"@Override\n public long readBatchData() throws SQLException {\n return (-1);\n }",
"@SuppressWarnings(\"unchecked\")\n\t@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED)\n\tpublic List<Batch> findAllCurrentWithNotesAndTrainees();",
"@Override\n public SEVISBatchCreateUpdateStudent fetchBatchData(BatchParam batchParam) {\n List<Integer> participantIds = batchParam.getParticipant().stream().map(p -> p.getParticipantGoId()).collect(Collectors.toList());\n // @formatter:on\n\n List<Participant> participants = participantRepository.findByParticipantGoIdIn(participantIds);\n\n // @formatter:off\n // map each participants into Student\n List<Student> students = participants.stream().map(p -> createStudentForUpdate(\"N0000000000\", \"1\", batchParam.getUserId())).collect(Collectors.toList());\n // @formatter:on\n\n students.forEach(s -> s.setProgram(createProgramExtension(true, SevisUtils.convert(LocalDate.now()), \"Explanation\")));\n\n String batchId = SevisUtils.createBatchId();\n SEVISBatchCreateUpdateStudent updateBatch = createUpdateStudentBatch(batchParam.getUserId(), \"P-1-12345\", batchId);\n updateBatch.getUpdateStudent().getStudent().addAll(students);\n\n return updateBatch;\n }",
"public List<com.moseeker.baseorm.db.logdb.tables.pojos.LogEmailSendrecord> fetchById(Integer... values) {\n return fetch(LogEmailSendrecord.LOG_EMAIL_SENDRECORD.ID, values);\n }",
"public ArrayList<LogBean> getAllLogs(int currentPage, int pageSize) {\n\t\treturn ld.queryAllLogs(currentPage, pageSize);\n\t}",
"protected void startBatch() {\n \n }",
"@Scheduled(cron = \"0 59 23 * * SAT\")\n\tpublic void auditLogExportBatchJob() {\n\n\t\ttry {\n\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\tint currentMonth = calendar.get(Calendar.MONTH);\n\t\t\tcalendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);\n\n\t\t\tif (calendar.get(Calendar.MONTH) != currentMonth) {\n\t\t\t\tcalendar.set(Calendar.DAY_OF_MONTH, 1);\n\t\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\t\t\tcalendar.set(Calendar.MINUTE, 0);\n\t\t\t\tcalendar.set(Calendar.SECOND, 0);\n\n\t\t\t\tCalendar toCalendar = Calendar.getInstance();\n\t\t\t\ttoCalendar.set(Calendar.MONTH, currentMonth - 1);\n\t\t\t\ttoCalendar.set(Calendar.DAY_OF_MONTH, toCalendar.getActualMaximum(Calendar.DAY_OF_MONTH));\n\t\t\t\ttoCalendar.set(Calendar.HOUR_OF_DAY, 23);\n\t\t\t\ttoCalendar.set(Calendar.MINUTE, 59);\n\t\t\t\ttoCalendar.set(Calendar.SECOND, 59);\n\n\t\t\t\textractAuditLogByDates(calendar.getTime(), toCalendar.getTime());\n\t\t\t}\n\n\t\t\tCalendar currntMonthCalendar = Calendar.getInstance();\n\t\t\tcurrntMonthCalendar.set(Calendar.DAY_OF_MONTH, 1);\n\t\t\tcurrntMonthCalendar.set(Calendar.HOUR_OF_DAY, 0);\n\t\t\tcurrntMonthCalendar.set(Calendar.MINUTE, 0);\n\t\t\tcurrntMonthCalendar.set(Calendar.SECOND, 0);\n\n\t\t\textractAuditLogByDates(currntMonthCalendar.getTime(), new Date());\n\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"Error while extracting Audit data from prive DB...\");\n\t\t\tLOGGER.error(e);\n\t\t}\n\t}",
"@Override\n public List<Integer> getAllWorklogIds() {\n List<Integer> worklogIds;\n\n try (Connection connection = database.connect();\n PreparedStatement stmt = connection.prepareStatement(GET_ALL_WORKLOG_IDS_SQL)) {\n worklogIds = worklogIdDataMapper.toDTO(stmt.executeQuery());\n } catch (SQLException e) {\n logger.logToDatabase(getClass().getName(), \"getAllWorklogIds\", e);\n throw new InternalServerErrorException(e.getMessage());\n }\n return worklogIds;\n }",
"public gpss.Batch getBatch() {\n if (batchBuilder_ == null) {\n return batch_ == null ? gpss.Batch.getDefaultInstance() : batch_;\n } else {\n return batchBuilder_.getMessage();\n }\n }",
"Future<JournalRecordCollection> getJobExecutionJournalRecords(String jobExecutionId, String sortBy, String order, String tenantId);",
"UsageReport[] getUsageReportsBatch(int batchSize);",
"private synchronized void flush() {\r\n\t\tif (!buffer.isEmpty()) {\r\n\t\t\tfor (final LoggingRecord record : buffer) {\r\n\t\t\t\thandler.handle(record);\r\n\t\t\t}\r\n\t\t\tbuffer.clear();\r\n\t\t}\r\n\t}",
"public int[] executeBatch() throws SQLException {\n return null;\r\n }",
"void addLogToBatch(TelemetryData log) throws IOException;",
"public List<org.nazymko.th.parser.autodao.tables.pojos.ConnectorSyncPageLog> fetchByMessage(String... values) {\n\t\treturn fetch(ConnectorSyncPageLog.CONNECTOR_SYNC_PAGE_LOG.MESSAGE, values);\n\t}",
"private Collection<Message> fetchMessages(Folder folder, Date minDate, Matcher matcher)\n\t\tthrows MessagingException {\n\t\t// Search term not fully implemented on mail servers, but can prevent fetching all email\n\t\tSearchTerm searchTerm = new SentDateTerm(ComparisonTerm.GT, minDate);\n\t\tMessage[] messages = folder.search(searchTerm);\n\t\tlogger.info(\"{} email(s) returned\", messages.length);\n\t\tbulkFetchMessageEnvelopes(folder, messages);\n\t\tList<Message> filteredMessages = new ArrayList<>();\n\t\tfor (Message message : messages) {\n\t\t\tDate sentDate = message.getSentDate();\n\t\t\tif (minDate.after(sentDate)) continue;\n\t\t\tif (!matcher.matches(message)) continue;\n\t\t\tfilteredMessages.add(message);\n\t\t}\n\t\treturn filteredMessages;\n\t}",
"@Test\n public void testBatchSink() throws Exception {\n List<WALEntry> entries = new ArrayList<>(TestReplicationSink.BATCH_SIZE);\n List<Cell> cells = new ArrayList<>();\n for (int i = 0; i < (TestReplicationSink.BATCH_SIZE); i++) {\n entries.add(createEntry(TestReplicationSink.TABLE_NAME1, i, Put, cells));\n }\n TestReplicationSink.SINK.replicateEntries(entries, CellUtil.createCellScanner(cells.iterator()), TestReplicationSink.replicationClusterId, TestReplicationSink.baseNamespaceDir, TestReplicationSink.hfileArchiveDir);\n Scan scan = new Scan();\n ResultScanner scanRes = TestReplicationSink.table1.getScanner(scan);\n Assert.assertEquals(TestReplicationSink.BATCH_SIZE, scanRes.next(TestReplicationSink.BATCH_SIZE).length);\n }",
"public List<Message> loadMessages() throws PersistentDataStoreException {\n\n List<Message> messages = new ArrayList<>();\n\n // Retrieve all messages from the datastore.\n Query query = new Query(\"chat-messages\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n UUID uuid = UUID.fromString((String) entity.getProperty(\"uuid\"));\n UUID conversationUuid = UUID.fromString((String) entity.getProperty(\"conv_uuid\"));\n UUID authorUuid = UUID.fromString((String) entity.getProperty(\"author_uuid\"));\n Instant creationTime = Instant.parse((String) entity.getProperty(\"creation_time\"));\n String content = (String) entity.getProperty(\"content\");\n Message message = new Message(uuid, conversationUuid, authorUuid, content, creationTime);\n messages.add(message);\n } catch (Exception e) {\n // In a production environment, errors should be very rare.\n // Errors which may\n // occur include network errors, Datastore service errors,\n // authorization errors,\n // database entity definition mismatches, or service mismatches.\n throw new PersistentDataStoreException(e);\n }\n }\n\n return messages;\n }",
"void flushBatch();",
"public java.util.Iterator<yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.StreamLogRecord> streamLogs(\n yandex.cloud.api.mdb.clickhouse.v1.ClusterServiceOuterClass.StreamClusterLogsRequest request) {\n return io.grpc.stub.ClientCalls.blockingServerStreamingCall(\n getChannel(), getStreamLogsMethod(), getCallOptions(), request);\n }",
"public List<Message> getMessageAll(){\n return repo.findAll();\n \n }",
"private void batchImport() {\r\n m_jdbcTemplate.batchUpdate(createInsertQuery(),\r\n new BatchPreparedStatementSetter() {\r\n public void setValues(\r\n PreparedStatement ps, int i)\r\n throws SQLException {\r\n int j = 1;\r\n for (String property : m_propertyNames) {\r\n Map params = (Map) m_batch.get(\r\n i);\r\n ps.setObject(j++, params.get(\r\n property));\r\n }\r\n }\r\n\r\n public int getBatchSize() {\r\n return m_batch.size();\r\n }\r\n });\r\n }",
"<H extends ResponseHandler<Result[]>> H nextBatch(H handler);",
"@Override\n\t\tpublic void onMessageBulkDelete(MessageBulkDeleteEvent event)\n\t\t{\n\t\t\t//These are provided with every event in JDA\n\t\t\tJDA jda = event.getJDA(); //JDA, the core of the api.\n\n\t\t\tlong serverId = event.getGuild().getIdLong();\n\t\t\tlong channelId = event.getChannel().getIdLong();\n\n\t\t\tboolean declaredLoggableHit = false;\n\t\t\tfor (DiscordMonitorTargetIdentifier targetid : DiscordMonitor.this.appconfig.logTargets)\n\t\t\t{\n\t\t\t\tif (!targetid.matches(serverId, channelId, null, null, null, MessageEventType.DELETE))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// All conditions passed.\n\t\t\t\tif (!declaredLoggableHit)\n\t\t\t\t{\n\t\t\t\t\tdeclaredLoggableHit = true;\n\t\t\t\t\tSystem.out.print(\"(i) Logging for:\");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \" + targetid.identifierLabel);\n\t\t\t}\n\t\t\tif (declaredLoggableHit)\n\t\t\t\tSystem.out.println();\n\n\t\t\tboolean declaredNotificationHit = false;\n\t\t\tfor (DiscordMonitorTargetIdentifier targetid : DiscordMonitor.this.appconfig.notificationWatchlist)\n\t\t\t{\n\t\t\t\tif (!targetid.matches(serverId, channelId, null, null, null, MessageEventType.DELETE))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t// All conditions passed.\n\t\t\t\tif (!declaredNotificationHit)\n\t\t\t\t{\n\t\t\t\t\tdeclaredNotificationHit = true;\n\t\t\t\t\tSystem.out.print(\"/!\\\\ WATCHLIST HIT:\");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(\" \" + targetid.identifierLabel);\n\t\t\t}\n\t\t\tif (declaredNotificationHit)\n\t\t\t\tSystem.out.println();\n\n\n\t\t\tStringBuilder msg = new StringBuilder(\"\\n\")\n\t\t\t\t.append(\"Time: \").append(OffsetDateTime.now().format(DiscordMonitor.LOG_DATETIME_FORMAT)).append(\" (approximate)\")\n\t\t\t\t.append(\"\\nMESSAGES DELETED:\");\n\t\t\tfor (String msgId : event.getMessageIds())\n\t\t\t\tmsg.append(\" \").append(msgId);\n\n\t\t\t//TODO Poll .sqlite db for previous message details\n\n\t\t\tTextChannel textChannel = (TextChannel)event.getChannel();\n\t\t\tSystem.out.printf(\"(%s)[%s]: %s\\n\\n\", textChannel.getGuild().getName(), textChannel.getName(), msg);\n\t\t}",
"@Override\n public List<MessageEntity> fetchMessages(UserEntity userEntity) {\n Query query = new Query();\n return mongoTemplate.find(query, MessageEntity.class);\n }",
"public void setUserLogs() {\n ResultSet rs = Business.getInstance().getData().getCaseLog();\n try{\n while (rs.next()) {\n userLog.add(new UserLog(rs.getInt(\"userID\"),\n rs.getInt(2),\n rs.getString(\"date\"),\n rs.getString(\"time\")));\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public Request<List<LogStream>> list() {\n String url = baseUrl\n .newBuilder()\n .addPathSegments(LOG_STREAMS_PATH)\n .build()\n .toString();\n\n CustomRequest<List<LogStream>> request = new CustomRequest<>(client, url, \"GET\", new TypeReference<List<LogStream>>() {\n });\n request.addHeader(AUTHORIZATION_HEADER, \"Bearer \" + apiToken);\n return request;\n }",
"public RecordSet loadAllProcessEventHistory(Record inputRecord);",
"public void addBatch() throws SQLException {\n statement.addBatch();\n }",
"private ResultBatch queryBatchPrepared(String statementName,\n FieldFormatRef[] paramFormats, ByteBuf[] paramBuffers,\n ResultField[] resultFields, long timeout) throws IOException {\n\n ExecuteResult handler = new ExecuteResult(resultFields);\n\n serverConnection.getRequestExecutor()\n .execute(null, statementName, paramFormats, paramBuffers, resultFields, 0, handler);\n\n handler.await(timeout, MILLISECONDS);\n\n return handler.getBatch();\n }",
"@Test\n public void getBatchTest() {\n String token = null;\n // List<BatchReturn> response = api.getBatch(token);\n\n // TODO: test validations\n }",
"public List<Batch> getPDList() throws DataAccessException {\n\t\tList<Batch> pd = new ArrayList<>();\n\t\tpd.addAll(findAllByStatus(Status.PENDING));\n\t\tpd.addAll(findAllByStatus(Status.DISCOUNT));\n\t\treturn pd;\n\t}",
"private synchronized boolean sendBatch() {\n if (fPending.isEmpty()) {\n return true;\n }\n\n final long nowMs = Clock.now();\n\n if (this.fHostSelector != null) {\n host = this.fHostSelector.selectBaseHost();\n }\n\n final String httpurl = MRConstants.makeUrl(host, fTopic, props.getProperty(DmaapClientConst.PROTOCOL),\n props.getProperty(DmaapClientConst.PARTITION));\n\n try {\n\n final ByteArrayOutputStream baseStream = new ByteArrayOutputStream();\n OutputStream os = baseStream;\n final String contentType = props.getProperty(DmaapClientConst.CONTENT_TYPE);\n if (contentType.equalsIgnoreCase(MRFormat.JSON.toString())) {\n JSONArray jsonArray = parseJSON();\n os.write(jsonArray.toString().getBytes());\n os.close();\n\n } else if (contentType.equalsIgnoreCase(CONTENT_TYPE_TEXT)) {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA.toString())\n || (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString()))) {\n if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString())) {\n os = new GZIPOutputStream(baseStream);\n }\n for (TimestampedMessage m : fPending) {\n\n os.write((\"\" + m.fPartition.length()).getBytes());\n os.write('.');\n os.write((\"\" + m.fMsg.length()).getBytes());\n os.write('.');\n os.write(m.fPartition.getBytes());\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n\n }\n os.close();\n }\n\n final long startMs = Clock.now();\n if (ProtocolType.DME2.getValue().equalsIgnoreCase(protocolFlag)) {\n\n configureDME2();\n\n this.wait(5);\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), url + subContextPath, nowMs - fPending.peek().timestamp);\n }\n sender.setPayload(os.toString());\n String dmeResponse = sender.sendAndWait(5000L);\n\n logTime(startMs, dmeResponse);\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result =\n postAuth(new PostAuthDataObject().setPath(httpurl).setData(baseStream.toByteArray())\n .setContentType(contentType).setAuthKey(authKey).setAuthDate(authDate)\n .setUsername(username).setPassword(password).setProtocolFlag(protocolFlag));\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AAF_AUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = post(httpurl, baseStream.toByteArray(), contentType, username, password,\n protocolFlag);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.HTTPNOAUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = postNoAuth(httpurl, baseStream.toByteArray(), contentType);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n } catch (InterruptedException e) {\n getLog().warn(\"Interrupted!\", e);\n // Restore interrupted state...\n Thread.currentThread().interrupt();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n }\n return false;\n }",
"void write(Batch batch) throws InfluxDbApiNotFoundException, InfluxDbApiBadrequestException, InfluxDbTransportException;",
"protected int getBatchSize() {\n return mBatchSize;\n }",
"@GetMapping(\"/splitBatchJob\")\n public String splitBatchJob() {\n try {\n JobParameters parameters = new JobParametersBuilder()\n .addString(\"JobId\", \"1\") //mengirim parameter ke job\n .toJobParameters();\n jobLauncher.run(splitImportDataPesertaFromCsv, parameters);\n\n } catch (Exception ex) {\n logger.error(\"ERROR LAUNCH importDataPesertaFromCsvJob : \", ex.getMessage(), ex);\n return \"ERROR LAUNCH importDataPesertaFromCsvJob : \" + ex.getMessage();\n }\n return \"JOB DONE !!\";\n }",
"private void logCurrentSensorEntriesBatch() {\n\t\tentriesRecorded++;\n\n\t\tint targetBatchSize = Constants.MS_FREQUENCY_FOR_CAMERA_CAPTURE / Constants.MS_INS_SAMPLING_FREQUENCY;\n\n\t\tArrayList<SensorEntry> toProcess = new ArrayList<SensorEntry>(this.sensorEntryBatch.subList(0, targetBatchSize));\n\t\tthis.sensorEntryBatch = new ArrayList<SensorEntry>(this.sensorEntryBatch.subList(targetBatchSize,\n\t\t\t\ttargetBatchSize));\n\n\t\tthis.writeBatchToFile(toProcess);\n\t}",
"@Override\n @Transactional\n public void addBulkInsertsAfterExtraction() {\n List<ScrapBook> scrapBooks = new ArrayList<ScrapBook>();\n boolean jobDone = false;\n boolean pause = false;\n while (!jobDone) {\n pause = false;\n int lineCount = 0;\n while (!pause) {\n ++lineCount;\n if (lineCount % 30 == 0) {\n scrapBooks = springJdbcTemplateExtractor.getPaginationList(\"SELECT * FROM ScrapBook\", 1, 30);\n pause = true;\n }\n }\n //convert scrapbook to book and insert into db\n convertedToBookAndInsert(scrapBooks);\n // delete all inserted scrapbooks\n springJdbcTemplateExtractor.deleteCollection(scrapBooks);\n scrapBooks = null;\n if (0 == springJdbcTemplateExtractor.findTotalScrapBook()) {\n jobDone = true;\n }\n }\n }",
"public List<Batch> generatePendingList() throws Exception {\n\t\tList<Batch> res = new ArrayList<>(); // local arraylist\n\t\tList<Batch> batchList = batchDB.findAllNotNotification(); // get batches with no notifications\n\t\tfor (Batch batch : batchList) {\n\t\t\tif (!batch.hasNotification()) { // checks if there is any notifications\n\t\t\t\tLocalDate today = LocalDate.now(); // get the time\n\t\t\t\tLocalDate date = batch.getExpirationDate().minusDays(batch.getWarningPeriod());\n\t\t\t\tif (today.isAfter(date)) { // check if its time to create a notification\n\t\t\t\t\tNotification n = new Notification(-1, null, 5, Status.PENDING); // create a notification with\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pending\n\t\t\t\t\tbatch.setNotification(n);\n\t\t\t\t\tbdb.updateBatch(batch);// save batch the new notification in DB\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthrow new Exception(\"Batch ID: \" + batch.getBatchID() + \" Ingen notifikation\");\n\t\t\t}\n\t\t}\n\t\tres.addAll(findAllByStatus(Status.PENDING)); // get batches with state pending\n\t\treturn res; // returns the list\n\t}",
"List<LogEntry> getLogEntries(Long issueId);",
"public List<logModel> SelecionarTodos(){\n\n List<logModel> logs = new ArrayList<logModel>();\n\n\n //MONTA A QUERY A SER EXECUTADA\n StringBuilder stringBuilderQuery = new StringBuilder();\n stringBuilderQuery.append(\" SELECT * \");\n stringBuilderQuery.append(\" FROM tb_log \");\n\n\n //CONSULTANDO OS REGISTROS CADASTRADOS\n Cursor cursor = databaseUtil.GetConexaoDataBase().rawQuery(stringBuilderQuery.toString(), null);\n\n /*POSICIONA O CURSOR NO PRIMEIRO REGISTRO*/\n cursor.moveToFirst();\n\n\n logModel logModel;\n\n //REALIZA A LEITURA DOS REGISTROS ENQUANTO NÃO FOR O FIM DO CURSOR\n while (!cursor.isAfterLast()){\n\n /* CRIANDO UM NOVO LOG */\n logModel = new logModel();\n\n //ADICIONANDO OS DADOS DO LOG\n logModel.setID(cursor.getInt(cursor.getColumnIndex(\"log_ID\")));\n logModel.setDate(cursor.getString(cursor.getColumnIndex(\"log_date\")));\n logModel.setEvento(cursor.getString(cursor.getColumnIndex(\"log_evento\")));\n\n //ADICIONANDO UM LOG NA LISTA\n logs.add(logModel);\n\n //VAI PARA O PRÓXIMO REGISTRO\n cursor.moveToNext();\n }\n\n //RETORNANDO A LISTA DE LOGS\n return logs;\n\n }",
"public List<SignLog> getAll(String userId) {\n List<SignLog> signLogs = new ArrayList<SignLog>();\n\n Cursor cursor = database.query(DatabaseSQLiteHelper.TABLE_SIGN_LOGS, null,\n DatabaseSQLiteHelper.LOGS_USER_ID + \" = \" + userId, null, null, null, null);\n\n cursor.moveToFirst();\n while (!cursor.isAfterLast()) {\n SignLog log = cursorToItem(cursor);\n signLogs.add(log);\n\n cursor.moveToNext();\n }\n cursor.close();\n return signLogs;\n }",
"private void processLog(File log) {\n BufferedReader in = null;\r\n ArrayList<String> list = new ArrayList<String>();\r\n String lastFrom = \"\";\r\n try {\r\n in = new BufferedReader(new FileReader(log));\r\n String line;\r\n while((line = in.readLine()) != null) {\r\n // lineNum++;\r\n if(line.contains(\"FROM\")) {\r\n // Start over at each FROM, leaving the last one and what\r\n // follows\r\n list.clear();\r\n list.add(line);\r\n lastFrom = line;\r\n } else if(line.contains(\"TO\")) {\r\n list.add(line);\r\n }\r\n }\r\n in.close();\r\n Data data = new Data(log.getName(), lastFrom);\r\n results.add(data);\r\n System.out.printf(\"%s\\n\", log.getName());\r\n for(String item : list) {\r\n System.out.printf(\" %s\\n\", item);\r\n }\r\n } catch(Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }",
"private List[] query() {\n\t\tList[] result = new ArrayList[topics.length];\n\t\tint i = 0;\n\t\tfor(String topic:topics) {\n\t\t\tList<byte[]> bocache = fcache.getList(topic);\n\t\t\tif(bocache == null || bocache.isEmpty()) {\n\t\t\t\tlog.info(\"topic {} has no message in cache\",topic);\n\t\t\t}else {\n\t\t\t\tresult[i++] = bocache;\n\t\t\t}\t\t\n\t\t}\n\t\treturn result;\n\t}",
"public int[] batch(String sql, Object[][] params) throws SQLException {\n logger.debug(\"SQL= \\n\" + sql);\n // Print the parameters to the logger.\n for (Object[] params1 : params) {\n printParams(params1);\n }\n return qr.batch(conn, sql, params);\n }",
"@Override\n public void addBatch( String sql ) throws SQLException {\n throw new SQLException(\"tinySQL does not support addBatch.\");\n }",
"@Override\n public int[] executeBatch() throws SQLException {\n throw new SQLException(\"tinySQL does not support executeBatch.\");\n }",
"@Override\n\t\tpublic void process(EventMessage msg) {\n\t\t\tLogMessage logmsg = (LogMessage) msg;\n\t\t\tString[] records = logmsg.getChunk().split(\"\\n\");\n\t\t\tEventManager.mergeLog(records);\n\t\t}",
"public Long createBatch(Batch batch) {\n\t\treturn batchService.createBatch(batch);\n\t}",
"@Override\n public int[] executeBatch() {\n if (this.batchPos == 0) {\n return new int[0];\n }\n try {\n int[] arrn = this.db.executeBatch(this.pointer, this.batchPos / this.paramCount, this.batch);\n return arrn;\n }\n finally {\n this.clearBatch();\n }\n }",
"public Batch findById(Long id) {\n return batchRepository.getOne(id);\n }",
"private void getAll(){\n if (!LOADED_ALL) {\n Message msg_getpersons = Message.obtain(getPersonsHandlerThread.getHandler());\n msg_getpersons.what = GetPersonsHandlerThread.TASK_GET_PERSONS;\n int table1 = TABLE_ALL;\n msg_getpersons.arg1 = table1;\n Log.d(TAG, \"DbOperationsRunnable: run(): preparing message msg_getperson with following attributes:\");\n Log.d(TAG, \"DbOperationsRunnable: run(): msg_getpersons.what = \" + msg_getpersons.what);\n Log.d(TAG, \"DbOperationsRunnable: run(): msg_getpersons.arg1 = \" + msg_getpersons.arg1);\n Log.d(TAG, \"DbOperationsRunnable: run(): sending message...\");\n msg_getpersons.sendToTarget();\n while (true) {\n if (DONE_TASK_GETPERSONS) {\n DONE_TASK_GETPERSONS = false;\n break;\n }\n }\n LOADED_ALL = true;\n } else {\n persons_list.clear();\n persons_list.addAll(all_list);\n }\n }",
"private String fetchLogEntry(int i) {\n\t\tif (log.size() >= i) {\n\t\t\tLog logEntry = log.get(log.size()-i);\n\t\t\tif (logEntry.getStatus() == Status.ALARM) {\n\t\t\t\treturn logEntry.getTimeStamp()+\"* \"+logEntry.getMessage();\n\t\t\t} else {\n\t\t\t\treturn logEntry.getTimeStamp()+\" \"+logEntry.getMessage();\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}",
"public List<BatchJob> findByExample(BatchJob batchJob) {\r\n\t\treturn dao.findByExample(batchJob);\r\n\t}"
] | [
"0.6057289",
"0.6019333",
"0.5920116",
"0.58931714",
"0.58817106",
"0.58060974",
"0.568556",
"0.5635283",
"0.55839664",
"0.5573754",
"0.5568375",
"0.5561246",
"0.5451022",
"0.54442734",
"0.5439789",
"0.5419353",
"0.5377196",
"0.5371383",
"0.5360406",
"0.5311269",
"0.52801216",
"0.5252851",
"0.52449834",
"0.5232071",
"0.5223035",
"0.5209988",
"0.51912767",
"0.51628643",
"0.5125174",
"0.5123585",
"0.5120141",
"0.5099785",
"0.509777",
"0.5086195",
"0.5083846",
"0.508185",
"0.5066964",
"0.5057239",
"0.50413424",
"0.50265837",
"0.50260943",
"0.50214314",
"0.5017559",
"0.5015161",
"0.5014644",
"0.5009273",
"0.5008517",
"0.5006299",
"0.49971157",
"0.4993616",
"0.49936157",
"0.4983035",
"0.49825016",
"0.49729925",
"0.49698943",
"0.49639893",
"0.495377",
"0.49515927",
"0.49479485",
"0.49466097",
"0.4946312",
"0.49400544",
"0.49345893",
"0.49246943",
"0.4923515",
"0.49091566",
"0.49061048",
"0.490541",
"0.4903754",
"0.48969963",
"0.4896196",
"0.48940593",
"0.4888335",
"0.48850024",
"0.48759353",
"0.48751792",
"0.48722327",
"0.48718375",
"0.48707098",
"0.48607025",
"0.48602805",
"0.48585773",
"0.48568818",
"0.48478508",
"0.48436558",
"0.48398215",
"0.48346648",
"0.48255923",
"0.48211703",
"0.48169094",
"0.48095694",
"0.48056042",
"0.4803032",
"0.4799582",
"0.47993785",
"0.4798163",
"0.47963744",
"0.47901687",
"0.47893998",
"0.4780385"
] | 0.62664545 | 0 |
Listado de todos los viajes | public ArrayList<Viaje> listar(){
ArrayList<Viaje> lista=new ArrayList<Viaje>();
String sql="select * from viaje";
try(Connection con=DB.getConexion();
Statement stm=con.createStatement();){
ResultSet rs=stm.executeQuery(sql);
while(rs.next()){
Viaje v=new Viaje(rs.getInt("id"),rs.getString("destino"),rs.getInt("duracion"),rs.getFloat("precio"));
lista.add(v);
}
}
catch(SQLException sqle){
sqle.printStackTrace();
}
return lista;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String listViaje() {\n\t\t\t//resetForm();\n\t\t\treturn \"/boleta/list.xhtml\";\t\n\t\t}",
"public void Listar() {\n try {\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n this.listaApelaciones.clear();\n setListaApelaciones(apelacionesDao.cargaApelaciones());\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"List<Persona> obtenerTodasLasPersona();",
"public List<ViajeroEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todos\");\n TypedQuery<ViajeroEntity> query = em.createQuery(\"select u from ViajeroEntity u\", ViajeroEntity.class);\n return query.getResultList();\n }",
"private void listarItems() {\r\n // Cabecera\r\n System.out.println(\"Listado de Items\");\r\n System.out.println(\"================\");\r\n\r\n // Criterio de Ordenación/Filtrado\r\n System.out.printf(\"Criterio de Ordenación .: %S%n\", criOrd.getNombre());\r\n System.out.printf(\"Criterio de Filtrado ...: %S%n\", criFil.getNombre());\r\n\r\n // Separados\r\n System.out.println(\"---\");\r\n\r\n // Filtrado > Selección Colección\r\n List<Item> lista = criFil.equals(Criterio.NINGUNO) ? CARRITO : FILTRO;\r\n\r\n // Recorrido Colección\r\n for (Item item : lista) {\r\n System.out.println(item.toString());\r\n }\r\n\r\n // Pausai\r\n UtilesEntrada.hacerPausa();\r\n }",
"public List<Tripulante> buscarTodosTripulantes();",
"@Override\r\n public List<Assunto> buscarTodas() {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"FROM Assunto As a\");\r\n return query.getResultList();\r\n }",
"public void GetVehiculos() {\n String A = \"&LOCATION=POR_ENTREGAR\";\n String Pahtxml = \"\";\n \n try {\n \n DefaultListModel L1 = new DefaultListModel();\n Pahtxml = Aso.SendGetPlacas(A);\n Lsvehiculo = Aso.Leerxmlpapa(Pahtxml);\n Lsvehiculo.forEach((veh) -> {\n System.out.println(\"Placa : \" + veh.Placa);\n L1.addElement(veh.Placa);\n });\n \n Lista.setModel(L1);\n \n } catch (Exception ex) {\n Logger.getLogger(Entrega.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"public String listarSensores(){\r\n String str = \"\";\r\n for(PacienteNuvem x:pacientes){//Para cada paciente do sistema ele armazena uma string com os padroes do protocolo de comunicação\r\n str += x.getNick()+\"-\"+x.getNome()+\"#\";\r\n }\r\n return str;\r\n }",
"List<Entidade> listarTodos();",
"public List<Fortaleza> listarFortalezas(){\r\n return cVista.listarFortalezas();\r\n }",
"public void listarTodosLosVideojuegosRegistrados()\n {\n System.out.println(\"Videojuegos disponibles: \");\n for(Videojuegos videojuego : listaDeVideojuegos) {\n System.out.println(videojuego.getDatosVideojuego());\n }\n }",
"public List<Vendedor> listarVendedor();",
"List<ParqueaderoEntidad> listar();",
"private void carregaLista() {\n listagem = (ListView) findViewById(R.id.lst_cadastrados);\n dbhelper = new DBHelper(this);\n UsuarioDAO dao = new UsuarioDAO(dbhelper);\n //Preenche a lista com os dados do banco\n List<Usuarios> usuarios = dao.buscaUsuarios();\n dbhelper.close();\n UsuarioAdapter adapter = new UsuarioAdapter(this, usuarios);\n listagem.setAdapter(adapter);\n }",
"List<Vehiculo>listar();",
"public List<GrauParentesco> getListTodos();",
"@Override\n public List<Pessoa> todas() {\n this.conexao = Conexao.abrirConexao();\n List<Pessoa> pessoas = new ArrayList<>();\n try {\n String consulta = \"SELECT * FROM pessoa;\";\n PreparedStatement statement = conexao.prepareStatement(consulta);\n ResultSet resut = statement.executeQuery();\n while (resut.next()) {\n pessoas.add(criarPessoa(resut));\n }\n } catch (SQLException ex) {\n Logger.getLogger(PessoasJDBC.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n Conexao.fecharConexao(conexao);\n }\n if (pessoas.size() > 0) {\n return Collections.unmodifiableList(pessoas);\n } else {\n return Collections.EMPTY_LIST;\n }\n\n }",
"private void listar() throws Exception{\n int resId=1;\n List<PlatoDia> lista = this.servicioRestaurante.listarMenuDia(resId);\n this.modelListEspecial.clear();\n lista.forEach(lse -> {\n this.modelListEspecial.addElement(\"ID: \" + lse.getId() \n + \" NOMBRE: \" + lse.getNombre()\n + \" DESCRIPCION: \" + lse.getDescripcion()\n + \" PRECIO: \" + lse.getPrecio()\n + \" ENTRADA: \"+lse.getEntrada() \n + \" PRINCIPIO: \"+lse.getPrincipio()\n + \" CARNE: \"+lse.getCarne()\n + \" BEBIDA: \"+lse.getBebida()\n + \" DIA: \"+lse.getDiaSemana());\n });\n }",
"public static List<ViajeEntidad> getListaViajesEntidad(){\n List<ViajeEntidad> viajes = new ArrayList<>();\n Date date = new Date();\n ViajeEntidadPK viajePK = new ViajeEntidadPK();\n TaxiEntidad taxiByPkPlacaTaxi = new TaxiEntidad();\n ClienteEntidad clienteByPkCorreoCliente = new ClienteEntidad();\n clienteByPkCorreoCliente.setPkCorreoUsuario(\"gerente11@gerente.com\");\n TaxistaEntidad taxistaByCorreoTaxi = new TaxistaEntidad();\n taxistaByCorreoTaxi.setPkCorreoUsuario(\"gerente11@gerente.com\");\n OperadorEntidad agendaOperador = new OperadorEntidad();\n agendaOperador.setPkCorreoUsuario(\"gerente11@gerente.com\");\n\n viajePK.setPkPlacaTaxi(\"CCC11\");\n viajePK.setPkFechaInicio(\"2019-01-01 01:01:01\");\n viajes.add(new ViajeEntidad(viajePK, \"2019-01-01 02:01:01\",\"5000\", 2, \"origen\",\"destino\", \"agenda\", \"agenda2\", taxiByPkPlacaTaxi, clienteByPkCorreoCliente, taxistaByCorreoTaxi, agendaOperador));\n viajePK.setPkPlacaTaxi(\"DDD11\");\n viajes.add(new ViajeEntidad(viajePK, \"2019-01-01 02:01:01\",\"5000\", 2, \"origen\",\"destino\", \"agenda\", \"agenda2\", taxiByPkPlacaTaxi, clienteByPkCorreoCliente, taxistaByCorreoTaxi, agendaOperador));\n viajePK.setPkPlacaTaxi(\"EEE11\");\n viajes.add(new ViajeEntidad(viajePK, \"2019-01-01 02:01:01\",\"5000\", 2, \"origen\",\"destino\", \"agenda\", \"agenda2\", taxiByPkPlacaTaxi, clienteByPkCorreoCliente, taxistaByCorreoTaxi, agendaOperador));\n\n return viajes;\n }",
"public List<Tripulante> obtenerTripulantes();",
"@Override\n public Retorno_MsgObj obtenerLista() {\n PerManejador perManager = new PerManejador();\n\n return perManager.obtenerLista(\"Inscripcion.findAll\", null);\n }",
"public void listar() {\n\t\t\n\t}",
"public void obtenerLista(){\n listaInformacion = new ArrayList<>();\n for (int i = 0; i < listaPersonales.size(); i++){\n listaInformacion.add(listaPersonales.get(i).getId() + \" - \" + listaPersonales.get(i).getNombre());\n }\n }",
"List<Plaza> consultarPlazas();",
"public static List getAllNames() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT naziv FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String naziv = result.getString(\"naziv\");\n polovniautomobili.add(naziv);\n\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }",
"private void listaContatos() throws SQLException {\n limpaCampos();\n BdLivro d = new BdLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\");\n\n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }",
"public List<Vaso> todos() {\n return new ArrayList<>(vasos); // Faz uma copia da lista estatica onde quem modifica externamente nao modifica internamente. Para nao perder o encapsulamento\n }",
"public void listarHospedes() {\n System.out.println(\"Hospedes: \\n\");\n if (hospedesCadastrados.isEmpty()) {\n// String esta = hospedesCadastrados.toString();\n// System.out.println(esta);\n System.err.println(\"Não existem hospedes cadastrados\");\n } else {\n String esta = hospedesCadastrados.toString();\n System.out.println(esta);\n // System.out.println(Arrays.toString(hospedesCadastrados.toArray()));\n }\n\n }",
"List<Pacote> buscarPorTransporte(Transporte transporte);",
"public void listar(){\n if (!esVacia()) {\n // Crea una copia de la lista.\n NodoEmpleado aux = inicio;\n // Posicion de los elementos de la lista.\n int i = 0;\n System.out.print(\"-> \");\n // Recorre la lista hasta llegar nuevamente al incio de la lista.\n do{\n // Imprime en pantalla el valor del nodo.\n System.out.print(i + \".[ \" + aux.getEmpleado() + \" ]\" + \" -> \");\n // Avanza al siguiente nodo.\n aux = aux.getSiguiente();\n // Incrementa el contador de la posi�n.\n i++;\n }while(aux != inicio);\n }\n }",
"@Override\n public List<Venda> listar() {\n String sql = \"SELECT v FROM venda v\";\n TypedQuery<Venda> query = em.createQuery(sql, Venda.class);\n List<Venda> resultList = query.getResultList();\n\n return resultList;\n }",
"@Override\n\tpublic List<CLIENTE> listarTodos() {\n\t\t\n\t\tString sql = \"SELECT * FROM CLIENTE\";\n\t\t\n\t\tList<CLIENTE> listaCliente = new ArrayList<CLIENTE>();\n\t\t\n\t\tConnection conexao;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tconexao = JdbcUtil.getConexao();\n\t\t\t\n\t\t\tPreparedStatement ps = conexao.prepareStatement(sql);\n\t\t\t\n\t\t\tResultSet res = ps.executeQuery();\n\t\t\t\n\t\t\twhile(res.next()){\n\t\t\t\t\n\t\t\t\tcliente = new CLIENTE();\n\t\t\t\tcliente.setNomeCliente(res.getString(\"NOME_CLIENTE\"));\n\t\t\t\t\n\t\t\t\tlistaCliente.add(cliente);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tps.close();\n\t\t\tconexao.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn listaCliente;\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic List<Empresa> listarTodos() {\n\t\tList<Empresa> lista = new ArrayList<Empresa>();\n\t\t\n\t\ttry {\n\t\t\tlista = empresaDAO.listarTodosDesc();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn lista;\n\t}",
"protected void cargarOfertas(List<ViajeCabecera> listaViajes){\n\n\t\tpanelOfertas.removeAll();\n\t\t\n\t\tint i = 0;\n\t\t\n\t\tfor (ViajeCabecera viaje : listaViajes) {\t\t\n\t\t\tagregarPanelOferta(viaje, i);\n\t\t\ti++;\n\t\t}\n\t\t\n\t}",
"private void listaContatos() throws SQLException {\n limpaCampos();\n DAOLivro d = new DAOLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\"); \n \n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }",
"private void listViewPendentes(List<Compra> listAll) {\n\t\t\n\t}",
"public ArrayList<DataCliente> listarClientes();",
"public ArrayList<DatosNombre> listaNombre(){\n \n ArrayList<DatosNombre> respuesta = new ArrayList<>();\n Connection conexion = null;\n JDBCUtilities conex = new JDBCUtilities();\n \n try{\n conexion= conex.getConnection();\n \n String query = \"SELECT usuario, contrasenia, nombre\"\n + \" FROM empleado\"\n + \" WHERE estado=true\";\n \n PreparedStatement statement = conexion.prepareStatement(query);\n ResultSet resultado = statement.executeQuery();\n \n while(resultado.next()){\n DatosNombre consulta = new DatosNombre();\n consulta.setUsuario(resultado.getString(1));\n consulta.setContrasenia(resultado.getString(2));\n consulta.setNombreAnt(resultado.getString(3));\n \n respuesta.add(consulta);\n }\n }catch(SQLException e){\n JOptionPane.showMessageDialog(null, \"Error en la consulta \" + e);\n }\n return respuesta;\n }",
"public List<Empleado> buscarTodos() {\n\t\tList<Empleado> listEmpleados;\n\t\tQuery query = entityManager.createQuery(\"SELECT e FROM Empleado e WHERE estado = true\");\n\t\tlistEmpleados = query.getResultList();\n\t\tIterator iterator = listEmpleados.iterator();\n\t\twhile(iterator.hasNext())\n\t\t{\n\t\t\tSystem.out.println(iterator.next());\n\t\t}\n\t\treturn listEmpleados;\n\t}",
"public void MostrarListas (){\n Nodo recorrer=inicio; // esto sirve para que el elemento de la lista vaya recorriendo conforme se inserta un elemento\r\n System.out.println(); // esto nos sirve para dar espacio a la codificacion de la lista al imprimir \r\n while (recorrer!=null){ // esta secuencia iterativa nos sirve para repetir las opciones del menu\r\n System.out.print(\"[\" + recorrer.dato +\"]--->\");\r\n recorrer=recorrer.siguiente;\r\n }\r\n }",
"public ListaPracownikow() {\n generujPracownikow();\n //dodajPracownika();\n }",
"public void listarQuartos() {\n System.out.println(\"Quartos: \\n\");\n\n if (quartosCadastrados.size() > 0) {\n String esta = quartosCadastrados.toString();\n System.out.println(esta);\n } else {\n System.err.println(\"Não existem quartos cadastrados\");\n }\n\n }",
"public void listar(){\r\n // Verifica si la lista contiene elementoa.\r\n if (!esVacia()) {\r\n // Crea una copia de la lista.\r\n Nodo aux = inicio;\r\n // Posicion de los elementos de la lista.\r\n int i = 0;\r\n // Recorre la lista hasta el final.\r\n while(aux != null){\r\n // Imprime en pantalla el valor del nodo.\r\n System.out.print(i + \".[ \" + aux.getValor() + \" ]\" + \" -> \");\r\n // Avanza al siguiente nodo.\r\n aux = aux.getSiguiente();\r\n // Incrementa el contador de la posión.\r\n i++;\r\n }\r\n }\r\n }",
"@Override\n\tpublic List<Estadoitem> listar() {\n\t\treturn estaitemdao.listar();\n\t}",
"public List<Filme> listar() {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Criando a consulta ao BD\r\n TypedQuery consulta = gerenciador.createQuery(\r\n \"Select f from Filme f\", Filme.class);\r\n\r\n //Retornar a lista de atores\r\n return consulta.getResultList();\r\n\r\n }",
"public abstract List<Usuario> seleccionarTodos();",
"public void listar() {\n\n if (!vacia()) {\n\n NodoEnteroSimple temp = head;\n\n int i = 0;\n\n while (temp != null) {\n\n System.out.print(i + \".[ \" + temp.getValor() + \" ]\" + \" -> \");\n\n temp = temp.getSiguiente();\n\n i++;\n }\n }\n \n }",
"public List<ReceitaDTO> listarReceitas() {\n return receitaOpenHelper.listar();\n }",
"public List<Usuario> listarUsuarios(boolean Vigente){\r\n return cVista.listarUsuarios(Vigente);\r\n }",
"public void ouvrirListe(){\n\t\n}",
"public ArrayList<DataUsuario> listarUsaurios();",
"public void listar()\n\t{\n\t\tdatabase.list().forEach(\n\t\t\t(entidade) -> { IO.println(entidade.print() + \"\\n\"); }\n\t\t);\n\t}",
"public List<PerfilTO> buscarTodos();",
"List<Oficios> buscarActivas();",
"public List<Usuario> listarTodos() {\n List<Usuario> r = new ArrayList<>();\n try {\n try (Connection cnx = bd.obtenerConexion(Credenciales.BASE_DATOS, Credenciales.USUARIO, Credenciales.CLAVE);\n Statement stm = cnx.createStatement();\n ResultSet rs = stm.executeQuery(CMD_LISTAR2)) {\n while (rs.next()) {\n r.add(new Usuario(\n rs.getString(\"cedula\"),\n rs.getString(\"apellido1\"),\n rs.getString(\"apellido2\"),\n rs.getString(\"nombre\")\n ));\n }\n }\n } catch (SQLException ex) {\n System.err.printf(\"Excepción: '%s'%n\",\n ex.getMessage());\n }\n return r;\n }",
"public List<Ejemplar> getAll();",
"public List<GrupoLocalResponse> buscarTodos();",
"public List<Location> listarPorAnunciante() throws SQLException {\r\n \r\n //OBJETO LISTA DE COMODOS\r\n List<Location> enderecos = new ArrayList<>(); \r\n \r\n //OBJETO DE CONEXÃO COM O BANCO\r\n Connection conn = ConnectionMVC.getConnection();\r\n \r\n //OBJETO DE INSTRUÇÃO SQL\r\n PreparedStatement pStatement = null;\r\n \r\n //OBJETO CONJUNTO DE RESULTADOS DA TABELA IMOVEL\r\n ResultSet rs = null;\r\n \r\n try {\r\n \r\n //INSTRUÇÃO SQL DE LISTAR IMÓVEIS\r\n pStatement = conn.prepareStatement(\"select * from pessoa inner join anuncio inner join imagem inner join imovel inner join location inner join comodo\");\r\n \r\n //OBJETO DE RESULTADO DA INSTRUÇÃO\r\n rs = pStatement.executeQuery();\r\n \r\n //PERCORRER OS DADOS DA INSTRUÇÃO\r\n while(rs.next()) {\r\n \r\n //OBJETO UTILIZADO PARA BUSCA\r\n Location endereco = new Location();\r\n \r\n //PARAMETROS DE LISTAGEM\r\n endereco.setCep(rs.getString(\"cep\"));\r\n endereco.setRua(rs.getString(\"rua\"));\r\n endereco.setNumero(rs.getInt(\"numero\"));\r\n endereco.setBairro(rs.getString(\"bairro\"));\r\n endereco.setCidade(rs.getString(\"cidade\"));\r\n endereco.setUf(rs.getString(\"uf\"));\r\n\r\n //OBJETO ADICIONADO A LISTA\r\n enderecos.add(endereco); \r\n }\r\n \r\n //MENSAGEM DE ERRO\r\n } catch (SQLException ErrorSql) {\r\n JOptionPane.showMessageDialog(null, \"Erro ao listar do banco: \" +ErrorSql,\"erro\", JOptionPane.ERROR_MESSAGE);\r\n\r\n //FINALIZAR/FECHAR CONEXÃO\r\n }finally {\r\n ConnectionMVC.closeConnection(conn, pStatement, rs);\r\n } \r\n return enderecos;\r\n }",
"@Override\n public Retorno_MsgObj obtenerLista() {\n PerManejador perManager = new PerManejador();\n\n return perManager.obtenerLista(\"Curso.findAll\", null);\n }",
"public List<Permiso> obtenerTodosActivos();",
"@Override\n\tpublic List<Paciente> listar() {\n\t\treturn dao.findAll();\n\t}",
"public String listar() {\n DocumentoVinculadoDAO documentoVinculadoDAO = new DocumentoVinculadoDAO();\n lista = documentoVinculadoDAO.listarStatus(1);\n return \"listar\";\n\n }",
"public List listar() {\n Query query = Database.manager.createNamedQuery(\"StatussistemaDTO.findAll\");\n query.setHint(QueryHints.MAINTAIN_CACHE, HintValues.FALSE);// evita consulta em cache\n List lista = query.getResultList();\n return lista;\n }",
"public void listaTemas() {\n\t\ttemas = temaEJB.listarTemas();\n\t}",
"public static List getAllUrl() {\n List polovniautomobili = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT url FROM polovni\";\n try (PreparedStatement ps = CONNECTION.prepareStatement(query)) {\n ResultSet result = ps.executeQuery();\n while (result.next()) {\n String naziv = result.getString(\"url\");\n polovniautomobili.add(naziv);\n\n }\n\n ps.close();\n CONNECTION.close();\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n Logger.getLogger(Register.class.getName()).log(Level.SEVERE, null, ex);\n }\n return polovniautomobili;\n }",
"public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}",
"List<Averia> listarAverias() throws BusinessException;",
"public void mostrarLista() {\n\n Nodo recorrer = temp;\n while (recorrer != null) {\n\n System.out.println(\"[ \" + recorrer.getDato() + \"]\");\n recorrer = recorrer.getSiguiente();\n\n }\n\n }",
"@Override\n\tpublic List<Cozinha> listar() { /* Cria uma Lista para buscar elementos da tabela Cozinha no banco */\n\t\treturn manager.createQuery(\"from Cozinha\", Cozinha.class) /*\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * Esta criando uma consulta com todo os elementos\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t * que tem dentro de Cozinha\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t.getResultList(); /* Está me retornando os Resultados da Lista Cozinha */\n\t}",
"private void listarEntidades() {\r\n\t\tsetListEntidades(new ArrayList<EntidadDTO>());\r\n\t\tgetListEntidades().addAll(entidadController.encontrarTodos());\r\n\t\tif (!getListEntidades().isEmpty()) {\r\n\t\t\tfor (EntidadDTO entidadDTO : getListEntidades()) {\r\n\t\t\t\t// Conversión de decimales.\r\n\t\t\t\tDouble porcentaje = entidadDTO.getPorcentajeValorAsegurable() * 100;\r\n\t\t\t\tdouble por = Math.round(porcentaje * Math.pow(10, 2)) / Math.pow(10, 2);\r\n\t\t\t\tentidadDTO.setPorcentajeValorAsegurable(por);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void Lista(){\n\t\tcabeza = null;\n\t\ttamanio = 0;\n\t}",
"@Override\n public ArrayList<Asesor> getListaAsesores() {\n ArrayList<Asesor> listaAsesores = new ArrayList();\n ConexionSQL conexionSql = new ConexionSQL();\n Connection conexion = conexionSql.getConexion();\n try{\n PreparedStatement orden = conexion.prepareStatement(\"select * from asesor\");\n ResultSet resultadoConsulta = orden.executeQuery();\n String numeroPersonal;\n String nombre;\n String idioma;\n String telefono;\n String correo;\n Asesor asesor;\n while(resultadoConsulta.next()){\n numeroPersonal = resultadoConsulta.getString(1);\n nombre = resultadoConsulta.getString(4) +\" \"+ resultadoConsulta.getString(6) +\" \"+ resultadoConsulta.getString(5);\n idioma = resultadoConsulta.getString(2);\n telefono = resultadoConsulta.getString(8);\n correo = resultadoConsulta.getString(7);\n asesor = new Asesor(numeroPersonal, nombre, idioma,telefono,correo);\n listaAsesores.add(asesor);\n }\n }catch(SQLException | NullPointerException excepcion){\n Logger logger = Logger.getLogger(\"Logger\");\n logger.log(Level.WARNING, \"La conexión podría ser nula | la sentencia SQL esta mal\");\n }\n return listaAsesores;\n }",
"public List<Temas> ListarTemas(){\n try{\r\n Statement smtm = _cn.createStatement();\r\n \r\n List<Temas> temas = new ArrayList<>();\r\n \r\n ResultSet result = smtm.executeQuery(\"SELECT * FROM tema ORDER BY Id;\");\r\n \r\n while(result.next()){\r\n Temas tema = new Temas();\r\n tema.setId(result.getInt(\"Id\"));\r\n tema.setNombre(result.getString(\"Nombre\"));\r\n tema.setURL_Imagen(result.getString(\"URL_Imagen\"));\r\n \r\n temas.add(tema);\r\n }\r\n \r\n return temas;\r\n \r\n }\r\n catch(Exception e){\r\n return null;\r\n }\r\n }",
"public void mostrarLista(){\n Nodo recorrer = inicio;\n while(recorrer!=null){\n System.out.print(\"[\"+recorrer.edad+\"]-->\");\n recorrer=recorrer.siguiente;\n }\n System.out.println(recorrer);\n }",
"public static List<Endereco> listar() {\n\t\t\tConnection conexao = ConectaPostgreSQL.geraConexao();\n\t\t\t// variavel lista de ass\n\t\t\tList<Endereco> acessos = new ArrayList<Endereco>();\n\t\t\t// executa o SQL no banco de endereco\n\t\t\tStatement consulta = null;\n\t\t\t// contém os endereco consultado da tabela\n\t\t\tResultSet resultado = null;\n\t\t\t// objeto as\n\t\t\t// Endereco as = null;\n\t\t\t// consulta SQL\n\t\t\tString sql = \"select distinct * from Endereco\";\n\t\t\ttry {\n\t\t\t\t// consulta => objeto que executa o SQL no banco de endereco\n\t\t\t\tconsulta = conexao.createStatement();\n\t\t\t\t// resultado => objeto que contém os endereco consultado da tabela\n\t\t\t\t// Endereco\n\t\t\t\tresultado = consulta.executeQuery(sql);\n\t\t\t\t// Lê cada as\n\n\t\t\t\twhile (resultado.next()) {\n\t\t\t\t\tEndereco endereco = new Endereco();\n\t\t\t\t\tendereco.setBairro(resultado.getString(\"bairro\"));\n\t\t\t\t\tendereco.setCep(resultado.getString(\"cep\"));\n\t\t\t\t\tendereco.setCidade(resultado.getString(\"cidade\"));\n\t\t\t\t\tendereco.setEstado(resultado.getString(\"estado\"));\n\t\t\t\t\tendereco.setNumero(resultado.getInt(\"numero\"));\n\t\t\t\t\tendereco.setRua(resultado.getString(\"rua\"));\n\t\t\t\t\t// insere o as na lista\n\t\t\t\t\tacessos.add(endereco);\n\n\t\t\t\t}\n\n\t\t\t} catch (SQLException e) {\n\t\t\t\tthrow new RuntimeException(\"Erro ao buscar um acesso a serviços: \" + e);\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tconsulta.close();\n\t\t\t\t\tresultado.close();\n\t\t\t\t\tconexao.close();\n\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\tthrow new RuntimeException(\"Erro ao fechar a conexao \" + e);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// retorna lista de ass\n\t\t\treturn acessos;\n\t\t}",
"@Override\n public List listar() {\n return instalaciones.getAll();\n }",
"@Override\n\tpublic List<Usuario> obtenerTodas() {\n\t\treturn lista;\n\t}",
"List<TipoHuella> listarTipoHuellas();",
"@Override\n\tpublic List<Message> findAll() {\n\t\tSystem.err.println(\"Vao dây\" + url);\n\t\tfor (Message massage : messRepository.findAll()) {\n\t\t\tSystem.err.println(\"massage ==>\" + massage.getUsername());\n\t\t}\n\t\treturn (List<Message>) messRepository.findAll();\n\t}",
"public ArrayList<ProductoDTO> mostrartodos() {\r\n\r\n\r\n PreparedStatement ps;\r\n ResultSet res;\r\n ArrayList<ProductoDTO> arr = new ArrayList();\r\n try {\r\n\r\n ps = conn.getConn().prepareStatement(SQL_READALL);\r\n res = ps.executeQuery();\r\n while (res.next()) {\r\n\r\n arr.add(new ProductoDTO(res.getInt(1), res.getString(2), res.getString(3), res.getInt(4), res.getInt(5), res.getString(6), res.getString(7), res.getString(8), res.getString(9)));\r\n }\r\n } catch (SQLException ex) {\r\n JOptionPane.showMessageDialog(null, \"error vuelva a intentar\");\r\n } finally {\r\n conn.cerrarconexion();\r\n\r\n }\r\n return arr;\r\n\r\n }",
"List<Receta> getAllWithUSer();",
"public List<String> getListe()\n\t\t\t{\n\t\t\t\treturn personnes;\n\t\t\t}",
"public void listarProvincia() {\n provincias = JPAFactoryDAO.getFactory().getProvinciaDAO().find();\n// for(int i=0;i<provincias.size();i++ ){\n// System.out.println(\"lista:\"+provincias.get(i).getNombreprovincia());\n// }\n }",
"public List<GoleadoresDTO> listarTodo(int idTorneo,Connection conexion) throws MiExcepcion {\n ArrayList<GoleadoresDTO> listarGoleadores = new ArrayList();\n\n try {\n String query = \"SELECT DISTINCT usuarios.primerNombre, \" +\n\" usuarios.primerApellido, tablagoleadores.numeroGoles, tablagoleadores.idEquipo, \"+ \n\" tablagoleadores.idTorneo,tablagoleadores.idJugador, \" +\n\" equipo.nombre \" +\n\" FROM tablagoleadores \" +\n\" INNER JOIN jugadoresporequipo \" +\n\" ON tablagoleadores.idJugador = jugadoresporequipo.codigoJugador \" +\n\" INNER JOIN usuarios \" +\n\" ON jugadoresporequipo.codigoJugador = usuarios.idUsuario \" +\n\" INNER JOIN equiposdeltorneo \" +\n\" ON tablagoleadores.idEquipo = equiposdeltorneo.equipoCodigo \" +\n\" INNER JOIN equipo \" +\n\" ON equiposdeltorneo.equipoCodigo = equipo.codigo \" +\n\" INNER JOIN torneo \" +\n\" ON tablagoleadores.idTorneo = torneo.idTorneo \" +\n\" WHERE tablagoleadores.idTorneo = ? \" +\n\" AND equiposdeltorneo.torneoIdTorneo=? \" +\n\" ORDER BY numeroGoles DESC\";\n statement = conexion.prepareStatement(query);\n statement.setInt(1, idTorneo);\n statement.setInt(2, idTorneo);\n rs = statement.executeQuery();\n //mientras que halla registros cree un nuevo dto y pasele la info\n while (rs.next()) {\n //crea un nuevo dto\n GoleadoresDTO gol = new GoleadoresDTO();\n UsuariosDTO usu = new UsuariosDTO();\n EquipoDTO equipo = new EquipoDTO();\n //le pasamos los datos que se encuentren\n gol.setNumeroGoles(rs.getInt(\"numeroGoles\"));\n gol.setIdEquipo(rs.getInt(\"idEquipo\"));\n gol.setIdTorneo(rs.getInt(\"idTorneo\"));\n gol.setIdJugador(rs.getLong(\"idJugador\"));\n usu.setPrimerNombre(rs.getString(\"primerNombre\"));\n usu.setPrimerApellido(rs.getString(\"primerApellido\"));\n gol.setUsu(usu);//paso el usuario al objeto \n equipo.setNombre(rs.getString(\"nombre\"));\n gol.setEquipo(equipo);\n //agregamos el objeto dto al arreglo\n listarGoleadores.add(gol);\n\n }\n } catch (SQLException sqlexception) {\n throw new MiExcepcion(\"Error listando goles\", sqlexception);\n\n } \n// finally {\n// try{\n// if (statement != null) {\n// statement.close(); \n// }\n// }catch (SQLException sqlexception) {\n// throw new MiExcepcion(\"Error listando goles\", sqlexception);\n//\n// }\n// }\n //devolvemos el arreglo\n return listarGoleadores;\n\n }",
"List<Reservation> trouverlisteDeReservationAyantUneDateDenvoieDeMail();",
"@Override\r\n\tpublic List<Evento> listar() {\n\t\treturn repository.findAll();\r\n\t}",
"public List<Produto> buscarProdutos(){\n return new ArrayList<>();\n }",
"@Override\r\n public List<Prova> consultarTodosProva() throws Exception {\n return rnProva.consultarTodos();\r\n }",
"public void listarCarros() {\n System.err.println(\"Carros: \\n\");\n if (carrosCadastrados.isEmpty()) {\n System.err.println(\"Nao existem carros cadastrados\");\n } else {\n System.err.println(Arrays.toString(carrosCadastrados.toArray()));\n }\n }",
"public void mostrarlistafininicio(){\n if(!estavacia()){\n String datos=\"<=>\";\n nododoble auxiliar=fin;\n while(auxiliar!=null){\n datos=datos+\"[\"+auxiliar.dato+\"]<=>\";\n auxiliar=auxiliar.anterior;\n }\n JOptionPane.showMessageDialog(null,datos,\n \"Mostraando lista de fin a inicio\",JOptionPane.INFORMATION_MESSAGE);\n }}",
"@Override\r\n\tpublic List<ReservaBean> traeTodos() throws Exception {\n\t\treturn null;\r\n\t}",
"public List<Cliente> consultarClientes();",
"public List<Veiculo> listarTodosVeiculos(){\n\t\tList<Veiculo> listar = null;\n\t\t\n\t\ttry{\n\t\t\tlistar = veiculoDAO.listarTodosVeiculos();\n\t\t}catch(Exception e){\n\t\t\te.getMessage();\n\t\t}\n\t\treturn listar;\n\t}",
"public void mostrarlistafininicio(){\n if(!estaVacia()){\n String datos = \"<=>\";\n NodoBus auxiliar = fin;\n while(auxiliar!=null){\n datos = datos + \"(\" + auxiliar.dato +\")->\";\n auxiliar = auxiliar.ant;\n JOptionPane.showMessageDialog(null, datos, \"Mostrando lista de fin a inicio\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }",
"public void listarProducto() {\n }",
"public void menuListados() {\n\t\tSystem.out.println(\"MENU LISTADOS\");\n\t\tSystem.out.println(\"1. Personas con la misma actividad\");\n\t\tSystem.out.println(\"2. Cantidad de personas con la misma actividad\");\n\t\tSystem.out.println(\"0. Salir\");\n\t}",
"public List<Usuario> listar() {\n return listaUse;\n }",
"public List getTrabajadores();",
"public void llenarListas(PaseoEntity entity) {\r\n ofertas = new ArrayList<OfertaDTO>();\r\n List<OfertaEntity> ofertasEntities = entity.getOfertas();\r\n if (ofertasEntities == null) {\r\n return;\r\n }\r\n for (OfertaEntity of : ofertasEntities) {\r\n ofertas.add(new OfertaDTO(of));\r\n }\r\n fotos = new ArrayList<FotoDTO>();\r\n if (entity.getOfertas() == null || entity.getOfertas().isEmpty() || entity.getOfertas().get(0) == null) {\r\n return;\r\n }\r\n if (entity.getOfertas().get(0).getVisitas() == null || entity.getOfertas().get(0).getVisitas().isEmpty()) {\r\n\r\n return;\r\n }\r\n List<FotoEntity> lista = entity.getOfertas().get(0).getVisitas().get(0).getFotos();\r\n if (lista != null) {\r\n\r\n for (FotoEntity fotoEntity : lista) {\r\n fotos.add(new FotoDTO(fotoEntity));\r\n }\r\n }\r\n }"
] | [
"0.70981264",
"0.69505185",
"0.69276345",
"0.6907974",
"0.68732834",
"0.68561745",
"0.6833967",
"0.678919",
"0.67496645",
"0.6737431",
"0.67347246",
"0.6725515",
"0.6721679",
"0.6707614",
"0.6684192",
"0.6648739",
"0.6603598",
"0.6598822",
"0.65920883",
"0.65766263",
"0.6531844",
"0.65179837",
"0.6502621",
"0.6501001",
"0.6498919",
"0.6490145",
"0.6485736",
"0.6472475",
"0.646688",
"0.6460772",
"0.6458509",
"0.64485586",
"0.6437227",
"0.64342284",
"0.6423079",
"0.6419452",
"0.6417658",
"0.639878",
"0.6387428",
"0.63857085",
"0.6383231",
"0.63793993",
"0.6376532",
"0.6374571",
"0.63740045",
"0.63536876",
"0.63531065",
"0.6341963",
"0.63416713",
"0.6341256",
"0.6340073",
"0.6337991",
"0.6336339",
"0.6333716",
"0.63280475",
"0.632474",
"0.6321104",
"0.6314385",
"0.6314334",
"0.6313374",
"0.63105357",
"0.6307633",
"0.630603",
"0.6301378",
"0.6286996",
"0.62869865",
"0.6272359",
"0.6262674",
"0.62536895",
"0.62460923",
"0.62421024",
"0.62413",
"0.624068",
"0.62391984",
"0.62189883",
"0.6212438",
"0.6212383",
"0.62122715",
"0.6211989",
"0.6206664",
"0.6200572",
"0.6199227",
"0.61943346",
"0.6190973",
"0.61790156",
"0.6177414",
"0.6170681",
"0.61694205",
"0.6160265",
"0.615895",
"0.6158621",
"0.6157858",
"0.6155034",
"0.6154767",
"0.6154439",
"0.6147228",
"0.6139188",
"0.61377716",
"0.6137571",
"0.61364657"
] | 0.69159585 | 3 |
This version of createSaveSCMPluginConfigRequest is for input file based upload | private SaveSCMPluginConfigRequest createSaveSCMPluginConfigRequest(SaveSCMPluginConfigRequest input, String inputFile, String oasVersion, String languageTarget){
String outputFolder = FilenameUtils.getFullPath(inputFile);
outputFolder = getOutputFolder(outputFolder);
SaveSCMPluginConfigRequest saveSCMPluginConfigRequest = new SaveSCMPluginConfigRequest.Builder(input.getOwner(), input.getApi(), input.getVersion())
.saveSCMPluginConfigRequest(input)
.oas(oasVersion)
.target(languageTarget)
.outputFolder(outputFolder)
.managedPaths(new String[]{FilenameUtils.getName(inputFile)})
.outputFile(FilenameUtils.getName(inputFile))
.build();
return saveSCMPluginConfigRequest;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void logSaveSCMPluginConfigRequestDetailsPriorToRequest(SaveSCMPluginConfigRequest saveSCMPluginConfigRequest){\n getLog().info(String.format(\"Provisioning %s Plugin Integration for %s\", scmProvider, saveSCMPluginConfigRequest.getApi()));\n getLog().debug(new SCMIntegrationPluginConfiguration(saveSCMPluginConfigRequest).toString());\n }",
"@Override\n public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {\n\n iniLocation = formData.getString(\"iniLocation\");\n iniContents = formData.getString(\"iniContents\");\n commandG2Z = formData.getString(\"commandG2Z\");\n commandZ2G = formData.getString(\"commandZ2G\");\n\n String iniFullPath;\n\n if (System.getProperty(\"JENKINS_HOME\") != null) {\n iniFullPath = System.getProperty(\"JENKINS_HOME\") + \"/\" + iniLocation;\n } else {\n if (System.getProperty(\"user.home\") != null) {\n iniFullPath = System.getProperty(\"user.home\") + \"/\" + iniLocation;\n } else {\n iniFullPath = \"/var/lib/jenkins\" + \"/\" + iniLocation;\n }\n }\n\n File file = new File(iniFullPath);\n\n try {\n if (!file.exists()) {\n if (!(file.getParentFile().exists())) {\n if (!(file.getParentFile().mkdirs())) {\n throw new IOException(\"Unable to create directory \" + iniFullPath );\n }\n }\n if (!(file.createNewFile())) {\n throw new IOException(\"Unable to create file \" + iniFullPath );\n }\n }\n } catch (IOException e) {\n System.out.println(\"File could not be created or opened: \" + iniFullPath);\n e.printStackTrace();\n }\n\n if (file.exists()) {\n try (Writer fstream = new OutputStreamWriter(new FileOutputStream(iniFullPath), \"UTF8\");) {\n fstream.write(iniContents);\n fstream.flush();\n fstream.close();\n System.out.println(\"File written Succesfully: \" + iniFullPath);\n } catch (IOException e) {\n System.out.println(\"File write NOT Succesfully: \" + iniFullPath);\n e.printStackTrace();\n }\n }\n save();\n return super.configure(req,formData);\n }",
"@Override\n public void saveConfig() {\n IPathManager pm = PathManagerFactory.getPathManager();\n LocalizationContext context = pm.getContext(\n LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);\n String newFileName = getExistingConfigFilePath();\n ILocalizationFile locFile = pm.getLocalizationFile(context,\n newFileName);\n\n try {\n statusHandler.info(\"Saving -- \" + locFile.getPath());\n try (SaveableOutputStream os = locFile.openOutputStream()) {\n jaxb.marshalToStream(mesoCfgXML, os);\n os.save();\n }\n } catch (Exception e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Failed to save \" + getExistingConfigFilePath(), e);\n }\n }",
"public void save() {\n\t\tif (fileConfiguration == null || configFile == null)\n\t\t\treturn;\n\n\t\ttry {\n\t\t\tgetConfig().save(configFile);\n\t\t} catch (final IOException e) {\n\t\t\tplugin.getLogger().severe(String.format(\"[%s] Could not save config to %s : %s\", plugin.getName(), configFile, e));\n\t\t}\n\t}",
"@Override\n public void setMultipartConfig(MultipartConfigElement elem) {\n }",
"@Override\n public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {\n req.bindParameters(this, \"ArtifactUploader\");\n return super.configure(req, formData);\n }",
"@RequestMapping(value = \"/serviceconfig/ssh/editfile/{ip}/{cc}\", method = RequestMethod.POST)\n\tpublic String sshSaveConfFile(HttpServletRequest request, HttpSession session,\n\t\t\t@PathVariable(value = \"ip\") String ip, @PathVariable(value = \"cc\") String c, ModelMap mm,\n\t\t\tRedirectAttributes redirectAtt) throws IOException {\n\t\t// Lay thong tin user và token tren session\n\t\tUser user = (User) session.getAttribute(\"user\");\n\t\tString cc = (String) session.getAttribute(\"cc\");\n\t\t// lay thong tin server cua user\n\t\tString configText = request.getParameter(\"sshconfig\");\n\t\t// System.out.println(configText);\n\t\t// kiem tra thong tin user dang nhap\n\t\tif (user != null && cc.equals(c)) {\n\t\t\tfor (Server server : user.getServers()) {\n\t\t\t\tif (server.getServerAddress().equals(ip)) {\n\t\t\t\t\tServer sv = new Server(server);\n\t\t\t\t\tsv.setServerUsername((String) session.getAttribute(\"sudouser\"));\n\t\t\t\t\tsv.setServerPassword((String) session.getAttribute(\"sudopass\"));\n\t\t\t\t\tSSHConfig sshConf = new SSHConfig();\n\t\t\t\t\tsshConf.uploadStringToServer(sv, configText);\n\t\t\t\t\t_log.info(\"Upload SSH Config to server\");\n\t\t\t\t\tredirectAtt.addFlashAttribute(\"displaysuccess\", \"block\");\n\t\t\t\t\tredirectAtt.addFlashAttribute(\"message\", \"Upload file Success!\");\n\t\t\t\t\t// restart service\n\t\t\t\t\tsshConf.Restart(sv);\n\t\t\t\t\treturn \"redirect:/serviceconfig/ssh/editfile/\" + ip + \"/\" + cc;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"redirect:/login\";\n\t\t}\n\t\treturn \"redirect:/\";\n\t}",
"private FileObject makeConfigFile(TemplatePair p, NrfConfig configObj){\n ST tmpl_sd = getConfigGroup().getInstanceOf(\"sdk_config\");\n tmpl_sd.add(\"config\", configObj);\n FileObject sdk_config_file = new FileObject();\n sdk_config_file.setSubPath(\"config/\");\n sdk_config_file.setFileName( p.getValue()+\".h\");\n sdk_config_file.setContent(tmpl_sd.render());\n return sdk_config_file;\n }",
"void setConfigFileName( String s );",
"private void saveConfiguration() {\n }",
"@POST\n @Consumes(\"application/x-www-form-urlencoded\")\n @Produces(MediaType.APPLICATION_JSON)\n public AtsConfiguration createConfig(MultivaluedMap<String, String> form, @Context UriInfo uriInfo);",
"@Override\n public PluginDescriptor getPluginDescriptor()\n {\n GuiConfigDescriptor guiDescriptor = new GuiConfigDescriptor(\"Complete the configuration below and enable this instance in your dynamic client registration policy to support Open Banking conformant client registration requests.\");\n\n FieldDescriptor issuer = new TextFieldDescriptor(Constants.ISSUER_FIELD_NAME, \"Value of the iss claim expected in the received software statement JWT.\");\n issuer.addValidator(new RequiredFieldValidator());\n issuer.setDefaultValue(Constants.DEFAULT_OPEN_BANKING_ISSUER);\n guiDescriptor.addField(issuer);\n\n FieldDescriptor jwksEndpointUrl = new TextFieldDescriptor(Constants.JWKS_URL_FIELD_NAME, \"A set of JSON Web Keys (JWKs) are downloaded from this endpoint and used for software statement JWT signature verification.\");\n jwksEndpointUrl.addValidator(new RequiredFieldValidator());\n jwksEndpointUrl.setDefaultValue(Constants.DEFAULT_JWKS_URL_FIELD_NAME);\n guiDescriptor.addField(jwksEndpointUrl);\n\n FieldDescriptor requestJwtAudienceField = new TextFieldDescriptor(Constants.AUDIENCE_FIELD_NAME, \"Value of the aud claim expected in the received request JWT.\");\n guiDescriptor.addField(requestJwtAudienceField);\n\n FieldDescriptor ecAlgorithm = new CheckBoxFieldDescriptor(Constants.ECDSA_ALGORITHM_FIELD_NAME,\n \"Allow the \" + Constants.ECDSA_ALGORITHM_FIELD_NAME + \" algorithm to be used for signatures.\");\n //The Open Banking specification states that PS256 or ES256 algorithms should be used for signing.\n //ECDSA is the only algorithm type enabled by default as PingFederate supports RSA-PSS only when configured with a Hardware Security Module (HSM).\n ecAlgorithm.setDefaultValue(Boolean.TRUE.toString());\n guiDescriptor.addField(ecAlgorithm);\n\n FieldDescriptor pssAlgorithm = new CheckBoxFieldDescriptor(Constants.RSA_PSS_ALGORITHM_FIELD_NAME,\n \"Allow the \" + Constants.RSA_PSS_ALGORITHM_FIELD_NAME + \" algorithm to be used for signatures.\");\n guiDescriptor.addField(pssAlgorithm);\n\n FieldDescriptor rsaAlgorithm = new CheckBoxFieldDescriptor(Constants.RSA_ALGORITHM_FIELD_NAME,\n \"Allow the \" + Constants.RSA_ALGORITHM_FIELD_NAME + \" algorithm to be used for signatures.\");\n guiDescriptor.addField(rsaAlgorithm);\n\n FieldDescriptor enableRevokedJwksValidation = new CheckBoxFieldDescriptor(Constants.ENABLE_REVOKED_JWKS_VALIDATION_FIELD_NAME,\n \"Consider revoked JWKS during signature validation.\");\n enableRevokedJwksValidation.setDefaultValue(Boolean.TRUE.toString());\n guiDescriptor.addAdvancedField(enableRevokedJwksValidation);\n\n\n guiDescriptor.addValidator(configuration -> {\n\n Field jwksUrlField = configuration.getField(Constants.JWKS_URL_FIELD_NAME);\n String jwksUriValue = jwksUrlField.getValue();\n\n List<String> errors = new ArrayList<>();\n\n if (StringUtils.isBlank(jwksUriValue))\n {\n errors.add(Constants.JWKS_URL_FIELD_NAME + \" is required to verify the request payload.\");\n }\n else\n {\n FieldValidator httpURLValidator = new HttpURLValidator();\n httpURLValidator.validate(jwksUrlField);\n }\n\n if(!(configuration.getBooleanFieldValue(Constants.ECDSA_ALGORITHM_FIELD_NAME) ||\n configuration.getBooleanFieldValue(Constants.RSA_PSS_ALGORITHM_FIELD_NAME) ||\n configuration.getBooleanFieldValue(Constants.RSA_ALGORITHM_FIELD_NAME)))\n {\n errors.add(\"At least one of the signature algorithms should be selected.\");\n }\n\n if (!errors.isEmpty())\n {\n throw new ValidationException(errors);\n }\n });\n\n DynamicClientRegistrationPluginDescriptor pluginDescriptor = new DynamicClientRegistrationPluginDescriptor(TYPE, this, guiDescriptor, VERSION);\n pluginDescriptor.setSupportsExtendedContract(false);\n\n return pluginDescriptor;\n }",
"public static String saveMscgenPath(String mscgen_path){\n\t\t//File pluginDir = new File(ConfluenceHomeGlobalConstants.PLUGINS_DIR+\"/Addteq-Mscgen-Editor-Settings\");\n\t\tFile pluginDir = new File(BootstrapUtils.getBootstrapManager().getApplicationHome());\n\t\tFile mscgenSettingFile=null;\n\t\tWriter writer;\n\t\tif (!pluginDir.exists()){\n\t\t\tpluginDir.mkdirs();\n\t\t}\n\t\ttry {\n\t\t\t\n\t\t\tmscgenSettingFile= new File(pluginDir, \"Addteq-MscgenEditorSettings.cfg\");\n\t\t\tFileOutputStream mscgenSettingOutputStream = new FileOutputStream(mscgenSettingFile);\n\t\t\twriter = new BufferedWriter(new OutputStreamWriter(mscgenSettingOutputStream));\n\t\t\twriter.write(mscgen_path);\n\t\t\twriter.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t//file not found\n\t\t\tSystem.out.println(\"File not found.\");\n\t\t\t//e.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t//io\n\t\t\tSystem.out.println(\"IOException..\");\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\treturn mscgenSettingFile.getAbsolutePath();\t\n\t}",
"String uploadFileFromBody(AmazonS3 connection,\n String bucketName,\n String path,\n String body,\n Boolean usingFilePicker,\n Date expiryDateTime)\n throws InterruptedException, AppsmithPluginException {\n\n byte[] payload;\n MultipartFormDataDTO multipartFormDataDTO;\n try {\n multipartFormDataDTO = objectMapper.readValue(\n body,\n MultipartFormDataDTO.class);\n } catch (IOException e) {\n throw new AppsmithPluginException(\n AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n \"Unable to parse content. Expected to receive an object with `data` and `type`\"\n );\n }\n if (multipartFormDataDTO == null) {\n throw new AppsmithPluginException(\n AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n \"Could not find any data. Expected to receive an object with `data` and `type`\"\n );\n }\n if (Boolean.TRUE.equals(usingFilePicker)) {\n\n String encodedPayload = (String) multipartFormDataDTO.getData();\n /*\n * - For files uploaded using Filepicker.xyz.base64, body format is \"<content-type>;base64,<actual-\n * base64-encoded-payload>\".\n * - Strip off the redundant part in the beginning to get actual payload.\n */\n if (encodedPayload.contains(BASE64_DELIMITER)) {\n List<String> bodyArrayList = Arrays.asList(encodedPayload.split(BASE64_DELIMITER));\n encodedPayload = bodyArrayList.get(bodyArrayList.size() - 1);\n }\n\n try {\n payload = Base64.getDecoder().decode(encodedPayload);\n } catch (IllegalArgumentException e) {\n throw new AppsmithPluginException(\n AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n \"File content is not base64 encoded. File content needs to be base64 encoded when the \" +\n \"'File Data Type: Base64/Text' field is selected 'Yes'.\"\n );\n }\n } else {\n payload = ((String) multipartFormDataDTO.getData()).getBytes();\n }\n\n InputStream inputStream = new ByteArrayInputStream(payload);\n TransferManager transferManager = TransferManagerBuilder.standard().withS3Client(connection).build();\n final ObjectMetadata objectMetadata = new ObjectMetadata();\n // Only add content type if the user has mentioned it in the body\n if (multipartFormDataDTO.getType() != null) {\n objectMetadata.setContentType(multipartFormDataDTO.getType());\n }\n transferManager.upload(bucketName, path, inputStream, objectMetadata).waitForUploadResult();\n\n ArrayList<String> listOfFiles = new ArrayList<>();\n listOfFiles.add(path);\n ArrayList<String> listOfUrls = getSignedUrls(connection, bucketName, listOfFiles, expiryDateTime);\n if (listOfUrls.size() != 1) {\n throw new AppsmithPluginException(\n AppsmithPluginError.PLUGIN_ERROR,\n \"Appsmith has encountered an unexpected error when fetching url from AmazonS3 after file \" +\n \"creation. Please reach out to Appsmith customer support to resolve this.\"\n );\n }\n String signedUrl = listOfUrls.get(0);\n\n return signedUrl;\n }",
"void saveRequestToFile(MovilizerRequest request, Path filePath);",
"@Override\n public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {\n save();\n return super.configure(req, formData);\n }",
"public static String aPluginConfiguration() {\n return \"{\\\"Application\\\":\\\"PIS\\\",\\\"ASPSP\\\":[\" +\n \"{\\\"AspspId\\\":\\\"1409\\\",\\\"Name\\\":[\\\"La Banque Postale\\\"],\\\"CountryCode\\\":\\\"FR\\\",\\\"BIC\\\":\\\"PSSTFRPP\\\"},\" +\n \"{\\\"AspspId\\\":\\\"1601\\\",\\\"Name\\\":[\\\"BBVA\\\"],\\\"CountryCode\\\":\\\"ES\\\",\\\"BIC\\\":\\\"BBVAESMM\\\"},\" +\n \"{\\\"AspspId\\\":\\\"1410\\\", \\\"BIC\\\":\\\"PSSTFRPT\\\", \\\"CountryCode\\\":\\\"FR\\\", \\\"Name\\\":[ \\\"La Banque\\\"], \\\"Details\\\":[ { \\\"Api\\\":\\\"POST /payments\\\", \\\"Fieldname\\\":\\\"DebtorAccount\\\", \\\"Type\\\":\\\"MANDATORY\\\", \\\"ProtocolVersion\\\":\\\"BG_V_1_3_0\\\" }, { \\\"Api\\\":\\\"POST /payments\\\", \\\"Fieldname\\\":\\\"PaymentProduct\\\", \\\"Type\\\":\\\"SUPPORTED\\\", \\\"Value\\\":\\\"Instant\\\", \\\"ProtocolVersion\\\":\\\"BG_V_1_3_0\\\" } ] }\"+\n \"],\\\"MessageCreateDateTime\\\":\\\"2019-11-15T16:52:37.092+0100\\\",\\\"MessageId\\\":\\\"6f31954f-7ad6-4a63-950c-a2a363488e\\\"}\";\n }",
"public ConfigAPI(FileType type, boolean addMissingOptions, JavaPlugin plugin) {\n this.plugin = plugin;\n\n switch (type)\n {\n case CONFIG :\n fileName = \"config.yml\";\n break;\n case LANG:\n fileName = \"lang.yml\";\n break;\n case BUFFS:\n fileName = \"buffs.yml\";\n break;\n case CONSOLE:\n fileName = \"console.yml\";\n break;\n case EVENTS:\n fileName = \"events.yml\";\n break;\n }\n\n this.file = new File(plugin.getDataFolder(), fileName);\n this.configuration = YamlConfiguration.loadConfiguration(file);\n\n //Copy contents of internal config file\n Reader defaultStream = null;\n try {\n defaultStream = new InputStreamReader(plugin.getResource(fileName), \"UTF8\");\n if (defaultStream != null) {\n this.defaultConfig = YamlConfiguration.loadConfiguration(defaultStream);\n }\n } catch (Exception ex) {}\n\n saveDefaultConfig();\n\n if (addMissingOptions)\n {\n addMissingOptions();\n }\n }",
"Map<String, Object> createConfig(Request request, String configtype);",
"@Override\n\tpublic void onSaveConfigClicked(IBlurb player) {\n\n\t}",
"public SmooksTransformModel setConfig(String config);",
"public boolean configure(StaplerRequest req, JSONObject o) throws FormException {\n \trhapsodyClPath = o.getString(\"rhapsodyClPath\");\n \tlicenseServerPath = o.getString(\"licenseServerPath\");\n save();\n return super.configure(req, o);\n }",
"public void saveFiBcoinPayconfig(FiBcoinPayconfig fiBcoinPayconfig);",
"public void saveMixerSettingsLocally() {\n\t\tFileChooser fileChooser = new FileChooser();\n\t\tExtensionFilter filter = new ExtensionFilter(\"TXT files (*.txt)\", \"*.txt\");\n\t\tfileChooser.getExtensionFilters().add(filter);\n\t\tFile file = fileChooser.showSaveDialog(mainContainer.getScene().getWindow());\n\t\tString fullPath;\n\t\ttry {\n\t\t\tfullPath = file.getAbsolutePath();\n\t\t\tif (!fullPath.endsWith(\".txt\")) {\n\t\t\t\tfullPath = fullPath + \".txt\";\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tFileWriter writeFile = new FileWriter(fullPath);\n\t\t\t\twriteFile.write(Double.toString(sliderPitch.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderEchoLength.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderDecay.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderGain.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderFlangerLength.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderWetness.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Double.toString(sliderLfoFrequency.getValue()) + \"\\n\");\n\t\t\t\twriteFile.write(Float.toString((float) sliderLowPass.getValue()) + \"\\n\");\n\t\t\t\twriteFile.close();\n\t\t\t\tAlert alert = new Alert(AlertType.INFORMATION);\n\t\t\t\talert.setTitle(bundle.getString(\"sMSsaveAlert1Title\"));\n\t\t\t\talert.setHeaderText(bundle.getString(\"sMSsaveAlert1Header\"));\n\t\t\t\talert.showAndWait();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\t\talert.setTitle(bundle.getString(\"mSSaveAlertTitle\"));\n\t\t\t\talert.setHeaderText(bundle.getString(\"mSSaveAlertHeader\"));\n\t\t\t\talert.setContentText(bundle.getString(\"mSSaveAlertContent\"));\n\t\t\t\talert.showAndWait();\n\t\t\t}\n\t\t} catch (Exception e) {\n\n\t\t}\n\t}",
"UploadResponse uploadDocumentSync(InputStream documentInputStream, String filename,\n long systemId, String password, String documentPool,\n String documentKey, String language, String ackKey);",
"public interface ScmFxConfiguration {\n\n void save(Profile.Section section);\n void load(Profile.Section section);\n\n}",
"@Override\r\n public void validateParameters(PluginRequest request) {\n }",
"public void forceDefaultConfig()\n {\n plugin.saveResource(fileName, true);\n }",
"private Configtx.ConfigSignature signChannelConfigUpdate(Configtx.ConfigUpdate configUpdate){\n HFClient hfClient = chaincodeService.getHfClient();\n byte[] bytes = new byte[24];\n new Random().nextBytes(bytes);\n Common.SignatureHeader signatureHeader = Common.SignatureHeader.newBuilder().setCreator(ByteString.copyFromUtf8(hfClient.getUserContext().getName())).setNonce(ByteString.copyFrom(bytes)).build();\n byte[] signatureHeaderBytes = signatureHeader.toByteArray();\n byte[] configUpdateBytes = configUpdate.toByteArray();\n\n byte[] concat = Arrays.copyOf(signatureHeaderBytes, signatureHeaderBytes.length + configUpdateBytes.length);\n System.arraycopy(configUpdateBytes, 0, concat, signatureHeaderBytes.length, configUpdateBytes.length);\n byte[] signature = null;\n try {\n signature = hfClient.getCryptoSuite().sign(hfClient.getUserContext().getEnrollment().getKey(), concat);\n } catch (CryptoException e) {\n e.printStackTrace();\n }\n Configtx.ConfigSignature configSignature = Configtx.ConfigSignature.newBuilder().setSignatureHeader(signatureHeader.toByteString()).setSignature(ByteString.copyFrom(signature)).build();\n return configSignature;\n }",
"public ConfigurationFileManager(Plugin plugin, Class<T> configClass, int saveInterval, String fileName)\n\t{\n\t\tthis.plugin = plugin;\n\t\tthis.fileName = fileName;\n\t\ttry {\n\t\t\tmodel = configClass.newInstance();\n\t\t\tmodel.init(YamlUtil.getConfiguration(plugin, \"/\", fileName + \".yml\"));\n\t\t\tgetConfigClass().onLoad(getConfigClass().getConfig());\n\t\t} catch (Exception e)\n\t\t{\n\t\t\tBukkit.getLogger().info(\"[MGLib] Error occurred while trying ot initialized config file.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif(saveInterval > 0) savetask.start(Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, this::saveConfig, 20 * saveInterval, 20 * saveInterval));\n\t}",
"private void updateConfigurationFromPlugins(URL file) throws IOException {\n \n \t\t// get the actual plugin path\n \t\tURL[] pluginPath = BootLoader.getPluginPath(file);\n \t\tif (pluginPath == null || pluginPath.length == 0)\n \t\t\treturn;\n \n \t\t// create a temp configuration and populate it based on plugin path\n \t\tPlatformConfiguration tempConfig = new PlatformConfiguration((URL) null);\n \t\tfor (int i = 0; i < pluginPath.length; i++) {\n \t\t\tString entry = pluginPath[i].toExternalForm();\n \t\t\tString sitePortion;\n \t\t\tString pluginPortion;\n \t\t\tint ix;\n \t\t\tif (entry.endsWith(\"/\")) { //$NON-NLS-1$\n \t\t\t\t// assume directory path in the form <site>/plugins/\n \t\t\t\t// look for -------------------------------^\n \t\t\t\tix = findEntrySeparator(entry, 2); // second from end\n \t\t\t\tsitePortion = entry.substring(0, ix + 1);\n \t\t\t\tpluginPortion = entry.substring(ix + 1);\n \t\t\t\tif (!pluginPortion.equals(\"plugins/\")) //$NON-NLS-1$\n \t\t\t\t\tcontinue; // unsupported entry ... skip it (\"fragments/\" are handled)\n \t\t\t\tpluginPortion = null;\n \t\t\t} else {\n \t\t\t\t// assume full path in the form <site>/<pluginsDir>/<some.plugin>/plugin.xml\n \t\t\t\t// look for --------------------------^\n \t\t\t\tix = findEntrySeparator(entry, 3); // third from end\n \t\t\t\tsitePortion = entry.substring(0, ix + 1);\n \t\t\t\tpluginPortion = entry.substring(ix + 1);\n \t\t\t}\n \t\t\tif (ix == -1)\n \t\t\t\tcontinue; // bad entry ... skip it\n \n \t\t\tURL siteURL = null;\n \t\t\ttry {\n \t\t\t\tsiteURL = new URL(sitePortion);\n \t\t\t\tif (siteURL.getProtocol().equals(\"file\")) { //$NON-NLS-1$\n \t\t\t\t\tFile sf = new File(siteURL.getFile());\n \t\t\t\t\tString sfn = sf.getAbsolutePath().replace(File.separatorChar, '/');\n \t\t\t\t\tif (!sfn.endsWith(\"/\")) //$NON-NLS-1$\n \t\t\t\t\t\tsfn += \"/\"; //$NON-NLS-1$\n \t\t\t\t\tsiteURL = new URL(\"file:\" + sfn); //$NON-NLS-1$\n \t\t\t\t}\n \t\t\t} catch (MalformedURLException e) {\n \t\t\t\tcontinue; // bad entry ... skip it\n \t\t\t}\n \n \t\t\t// configure existing site or create a new one for the entry\n \t\t\tISiteEntry site = tempConfig.findConfiguredSite(siteURL);\n \t\t\tISitePolicy policy;\n \t\t\tif (site == null) {\n \t\t\t\t// new site\n \t\t\t\tif (pluginPortion == null)\n \t\t\t\t\tpolicy = tempConfig.createSitePolicy(ISitePolicy.USER_EXCLUDE, null);\n \t\t\t\telse\n \t\t\t\t\tpolicy = tempConfig.createSitePolicy(ISitePolicy.USER_INCLUDE, new String[] { pluginPortion });\n \t\t\t\tsite = tempConfig.createSiteEntry(siteURL, policy);\n \t\t\t\ttempConfig.configureSite(site);\n \t\t\t} else {\n \t\t\t\t// existing site\n \t\t\t\tpolicy = site.getSitePolicy();\n \t\t\t\tif (policy.getType() == ISitePolicy.USER_EXCLUDE)\n \t\t\t\t\tcontinue; // redundant entry ... skip it\n \t\t\t\tif (pluginPortion == null) {\n \t\t\t\t\t// directory entry ... change policy to exclusion (with empty list)\n \t\t\t\t\tpolicy = tempConfig.createSitePolicy(ISitePolicy.USER_EXCLUDE, null);\n \t\t\t\t} else {\n \t\t\t\t\t// explicit entry ... add it to the inclusion list\n \t\t\t\t\tArrayList list = new ArrayList(Arrays.asList(policy.getList()));\n \t\t\t\t\tlist.add(pluginPortion);\n \t\t\t\t\tpolicy = tempConfig.createSitePolicy(ISitePolicy.USER_INCLUDE, (String[]) list.toArray(new String[0]));\n \t\t\t\t}\n \t\t\t\tsite.setSitePolicy(policy);\n \t\t\t}\n \t\t}\n \n \t\t// merge resulting site(s) into the specified configuration\n \t\tISiteEntry[] tempSites = tempConfig.getConfiguredSites();\n \t\tfor (int i = 0; i < tempSites.length; i++) {\n \t\t\tconfigureSite(tempSites[i], true /*replace*/\n \t\t\t);\n \t\t}\n \t}",
"MovilizerRequest prepareUploadRequest(Long systemId, String password, MovilizerRequest request);",
"private PluginConfig(String configType) {\n\t\tthis.configType = configType;\n\t}",
"private File processMultipartForm() {\n\n File storeDirectory = Configuration\n .getParameterValueAsFile(PENDING_DIR);\n\n int fileSizeLimit = Configuration\n .getParameterValueAsInt(METADATA_MAX_BYTES);\n\n DiskFileItemFactory factory = new DiskFileItemFactory();\n factory.setSizeThreshold(fileSizeLimit);\n\n RestletFileUpload upload = new RestletFileUpload(factory);\n\n List<FileItem> items;\n\n try {\n Request request = getRequest();\n items = upload.parseRequest(request);\n } catch (FileUploadException e) {\n throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST, e\n .getMessage(), e);\n }\n\n for (FileItem fi : items) {\n if (fi.getName() != null) {\n String uuid = UUID.randomUUID().toString();\n File file = new File(storeDirectory, uuid);\n try {\n fi.write(file);\n return file;\n } catch (Exception consumed) {\n }\n }\n }\n\n throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,\n \"no valid file uploaded\");\n }",
"List<String> uploadMultipleFilesFromBody(AmazonS3 connection,\n String bucketName,\n String path,\n String body,\n Boolean usingFilePicker,\n Date expiryDateTime)\n throws InterruptedException, AppsmithPluginException {\n\n\n List<MultipartFormDataDTO> multipartFormDataDTOs;\n try {\n multipartFormDataDTOs = Arrays.asList(objectMapper.readValue(\n body,\n MultipartFormDataDTO[].class));\n } catch (IOException e) {\n throw new AppsmithPluginException(\n AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n \"Unable to parse content. Expected to receive an object with `data` and `type`\"\n );\n }\n\n ArrayList<String> listOfFiles = new ArrayList<>();\n multipartFormDataDTOs.forEach(multipartFormDataDTO -> {\n final String filePath = path + multipartFormDataDTO.getName();\n byte[] payload;\n if (Boolean.TRUE.equals(usingFilePicker)) {\n\n String encodedPayload = (String) multipartFormDataDTO.getData();\n /*\n * - For files uploaded using Filepicker.xyz.base64, body format is \"<content-type>;base64,<actual-\n * base64-encoded-payload>\".\n * - Strip off the redundant part in the beginning to get actual payload.\n */\n if (encodedPayload.contains(BASE64_DELIMITER)) {\n List<String> bodyArrayList = Arrays.asList(encodedPayload.split(BASE64_DELIMITER));\n encodedPayload = bodyArrayList.get(bodyArrayList.size() - 1);\n }\n\n try {\n payload = Base64.getDecoder().decode(encodedPayload);\n } catch (IllegalArgumentException e) {\n throw new AppsmithPluginException(\n AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n \"File content is not base64 encoded. File content needs to be base64 encoded when the \" +\n \"'File Data Type: Base64/Text' field is selected 'Yes'.\"\n );\n }\n } else {\n payload = ((String) multipartFormDataDTO.getData()).getBytes();\n }\n\n InputStream inputStream = new ByteArrayInputStream(payload);\n TransferManager transferManager = TransferManagerBuilder.standard().withS3Client(connection).build();\n final ObjectMetadata objectMetadata = new ObjectMetadata();\n // Only add content type if the user has mentioned it in the body\n if (multipartFormDataDTO.getType() != null) {\n objectMetadata.setContentType(multipartFormDataDTO.getType());\n }\n try {\n transferManager.upload(bucketName, filePath, inputStream, objectMetadata).waitForUploadResult();\n } catch (InterruptedException e) {\n throw new AppsmithPluginException(\n AppsmithPluginError.PLUGIN_ERROR,\n \"File upload interrupted.\"\n );\n }\n\n listOfFiles.add(filePath);\n });\n\n return getSignedUrls(connection, bucketName, listOfFiles, expiryDateTime);\n }",
"@Override\n\tpublic boolean isSaveAsAllowed() {\n\t\treturn true;\n\t}",
"Path fileToUpload();",
"public void saveConfig () {\n if (fileConfiguration == null || config == null) {\n \n if (debug) {\n log.info(\"Can't save config - null\");\n }\n \n return;\n } else {\n try {\n getConfig().save(config);\n } catch (IOException e) {\n log.severe(\"Something happened while saving \" + configName);\n }\n if (debug) {\n log.info(\"Saved \" + configName + \" successfully.\");\n }\n }\n }",
"UploadResponse uploadDocumentSync(InputStream documentInputStream, String filename,\n long systemId, String password, String documentPool,\n String documentKey, String language, String ackKey,\n Integer connectionTimeoutInMillis);",
"public IConfiguration configToConvert() {\n\t\tString inputFiles = jTextFieldInputFiles.getText();\n\t\tString outputFile = jTextFieldOutputFile.getText();\n\t\tif (inputFiles.length() > 0)\n\t\t\tmodifications.insertPoolSource(inputFiles);\n\t\tif (outputFile.length() > 0)\n\t\t\tmodifications.insertPoolOutputModule(outputFile);\n\t\tif (asFragment()) {\n\t\t\tmodifications.filterAllEDSources(true);\n\t\t\tmodifications.filterAllOutputModules(true);\n\t\t}\n\t\tmodifier.modify(modifications);\n\t\treturn modifier;\n\t}",
"@Override\n public void configure(ConfigurationElement config) throws CoreException {\n programName = getConfigString(config, \"programName\");\n if (programName == null) {\n throw new CoreException(\"Missing DefaultOperatorAction property 'programName'.\");\n }\n dialogTitle = getValue(config, \"dialogTitle\", programName);\n xmlFileName = getValue(config, \"xmlFileName\", ParamUtils.NO_XML_FILE_SPECIFIED);\n //multiIFile = getValue(config, \"multiIFile\", \"false\");\n \n super.configure(config);\n if (programName.equals(OCSSW.OCSSW_INSTALLER)) {\n OCSSW.checkOCSSW();\n }\n super.setEnabled(programName.equals(OCSSW.OCSSW_INSTALLER) || OCSSW.isOCSSWExist());\n }",
"public void save() {\n if (worldOreConfig == null) {\n return;\n }\n\n final WorldOreConfig worldOreConfig;\n\n if (!(this.worldOreConfig instanceof ConfigurationSerializable)) {\n worldOreConfig = new WorldOreConfigYamlImpl(this.worldOreConfig.getName(), this.worldOreConfig.getConfigType(), this.worldOreConfig.getOreSettings(), this.worldOreConfig.getBiomeOreSettings());\n } else {\n worldOreConfig = this.worldOreConfig;\n }\n\n final Config config = new Config(file);\n\n config.set(\"value\", worldOreConfig);\n\n try {\n config.options().header(\"This file is machine generated, please use the in game commands and gui to change values. \\nModifying this file per hand on your own risk.\").copyHeader(true);\n config.save(file);\n } catch (final IOException e) {\n throw new RuntimeException(\"Unexpected error while saving WorldOreConfig \" + worldOreConfig.getName() + \" to disk!\", e);\n }\n }",
"public Long createFileUpload(FileUpload fileUpload, InputStream fileInputStream) throws AppException;",
"private void createConfigFile() {\n\t\tFile configFile = new File(projectRoot, SC_CONFIG_FILENAME);\n\t\tif (configFile.exists())\n\t\t\treturn;\n\n\t\tServiceCutterConfig config = createInitialServiceCutterConfig();\n\t\ttry {\n\t\t\tFileWriter writer = new FileWriter(configFile);\n\t\t\twriter.write(new Yaml().dumpAs(config, Tag.MAP, FlowStyle.BLOCK));\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new ContextMapperApplicationException(\"Could not create '.servicecutter.yml' file!\", e);\n\t\t}\n\t}",
"ResourceFilesType createResourceFilesType();",
"@Override\n\tpublic int saveAutoMLConfig(MultipartFile file, String usecase, String configuration, Integer trainingPerc,\n\t\t\tString predictionColumn, String numOfModels ,String taskDetails, String predictionType) throws InsightsCustomException {\n\t\t\t\n\t\tint id = -1;\n\t\tbyte[] fileBytes;\n\t\tboolean isExists = autoMLConfigDAL.isUsecaseExisting(usecase);\n\t\tif (isExists) {\n\t\t\tlog.error(\"AutoMLSerive======= unable to save record as usecase {} already exists\", usecase);\n\t\t\tthrow new InsightsCustomException(\"usecase already exists \" + usecase);\n\t\t} \n\t\telse {\t\n\t\t\ttry {\n\t\t\t\tString folderPath = new File(ConfigOptions.ML_DATA_STORAGE_RESOLVED_PATH + ConfigOptions.FILE_SEPERATOR + usecase).getCanonicalPath();\n\t\t\t\tFile destfolder = new File(folderPath);\n\t\t\t\tif (destfolder.mkdirs()) {\n\t\t\t\t\tlog.debug(\"AutoML========== Usecasefolder is created {}\", destfolder.getCanonicalPath());\n\t\t\t\t}\n\t\t\t\tString filename = file.getOriginalFilename();\n\t\t\t\tString filePath = folderPath + ConfigOptions.FILE_SEPERATOR + filename;\n\t\t\t\tfile.transferTo(new File(filePath));\n\t\t\t\tfileBytes= FileUtils.readFileToByteArray(new File(filePath));\n\t\t\t} catch (Exception e) {\n\t\t\t\tlog.debug(\"AutoML========== Exception while creating folder {}\", e.getMessage());\n\t\t\t\tthrow new InsightsCustomException(\"Unable to create folder\");\n\t\t\t}\t\t\n\t\t\t\n\t\t\t/* Save record in DB and create workflow */\n\t\t\tJsonArray taskList = JsonUtils.parseStringAsJsonArray(taskDetails);\n\t\t\tboolean runImmediate = true;\n\t\t\tboolean reoccurence = false;\n\t\t\tString schedule = WorkflowTaskEnum.WorkflowSchedule.ONETIME.name();\n\t\t\tboolean isActive = true;\n\t\t\tString workflowStatus = WorkflowTaskEnum.WorkflowStatus.NOT_STARTED.name();\n\t\t\tString workflowType = \"AUTOML\";\n\t\t\tString workflowId = WorkflowTaskEnum.WorkflowType.AUTOML.getValue() + \"_\"\n\t\t\t\t\t+ InsightsUtils.getCurrentTimeInSeconds();\n\t\t\tInsightsWorkflowConfiguration workflowConfig = workflowService.saveWorkflowConfig(workflowId, isActive,\n\t\t\t\t\treoccurence, schedule, workflowStatus, workflowType, taskList, 0, null, runImmediate);\n\t\t\tAutoMLConfig mlConfig = new AutoMLConfig();\n\t\t\tmlConfig.setUseCaseName(usecase);\n\t\t\tmlConfig.setConfigJson(configuration);\n\t\t\tmlConfig.setIsActive(true);\n\t\t\tmlConfig.setPredictionColumn(predictionColumn);\n\t\t\tmlConfig.setNumOfModels(numOfModels);\n\t\t\tmlConfig.setTrainingPerc(trainingPerc);\n\t\t\tmlConfig.setMojoDeployed(\"\");\n\t\t\tmlConfig.setCreatedDate(InsightsUtils.getCurrentTimeInEpochMilliSeconds());\n\t\t\tmlConfig.setUseCaseFile(file.getOriginalFilename());\n\t\t\tmlConfig.setWorkflowConfig(workflowConfig);\n\t\t\tmlConfig.setStatus(workflowStatus);\n\t\t\tmlConfig.setPredictionType(predictionType);\n\t\t\tmlConfig.setFile(fileBytes);\n\t\t\tid = autoMLConfigDAL.saveMLConfig(mlConfig);\n\t\t\tlog.debug(id);\n\n\t\t}\n\t\treturn id;\n\t}",
"private SubmitConfigSourceRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"void savePreset(String name);",
"private Settings manageSettings(Data loadedData) {\n Dialog<Settings> dialog = new Dialog<>();\n dialog.setTitle(\"Settings\");\n dialog.setHeaderText(\"Please specify the settings for the file you are uploading.\");\n\n Label label1 = new Label(\"ZAMS phase is: \");\n Label label2 = new Label(\"Include phases: \");\n\n //ZAMS\n ChoiceBox choiceBox = new ChoiceBox();\n choiceBox.getItems().add(\"-\");\n choiceBox.setValue(\"-\");\n choiceBox.getItems().addAll(loadedData.getCurrentPhases());\n\n //Phases\n List<CheckBox> phaseBoxes = new ArrayList<>();\n List<Short> availablePhases = new ArrayList<>(loadedData.getCurrentPhases());\n GridPane allowedPhasesPane = new GridPane();\n availablePhases.sort(Comparator.naturalOrder());\n if (Data.getCurrentData().getCurrentPhases().size() > 12) {\n allowedPhasesPane.add(new Label(\"Too many\"), 0, 0);\n allowedPhasesPane.add(new Label(\"phases!\"), 0, 1);\n } else {\n for (int i = 0; i < availablePhases.size(); i++) {\n CheckBox checkBox = new CheckBox(availablePhases.get(i).toString());\n phaseBoxes.add(checkBox);\n allowedPhasesPane.add(checkBox, i % 3, i / 3);\n checkBox.setSelected(true);\n }\n }\n\n GridPane grid = new GridPane();\n grid.add(label1, 1, 1);\n grid.add(choiceBox, 2, 1);\n grid.add(label2, 1, 2);\n grid.add(allowedPhasesPane, 2, 2);\n dialog.getDialogPane().setContent(grid);\n\n ButtonType buttonTypeOk = new ButtonType(\"Upload file\", ButtonBar.ButtonData.OK_DONE);\n dialog.getDialogPane().getButtonTypes().add(buttonTypeOk);\n\n dialog.setResultConverter(new Callback<ButtonType, Settings>() {\n @Override\n public Settings call(ButtonType b) {\n if (b==buttonTypeOk) {\n HashSet<Short> selectedPhases = new HashSet<>();\n for (CheckBox checkBox : phaseBoxes) {\n if (checkBox.isSelected()) { selectedPhases.add(Short.parseShort(checkBox.getText())); }\n }\n Short zams = null;\n if (choiceBox.getValue() != \"-\") {\n zams = Short.parseShort(choiceBox.getValue().toString());\n }\n return new Settings(selectedPhases, zams, false);\n }\n return null;\n }\n });\n\n Stage stage = (Stage) dialog.getDialogPane().getScene().getWindow();\n stage.getIcons().add(new Image(this.getClass().getResource(\"/settings.png\").toString()));\n\n dialog.getDialogPane().getChildren().stream().filter(node -> node instanceof Label).forEach(node\n -> ((Label)node).setMinHeight(Region.USE_PREF_SIZE)); //fix for broken linux dialogues\n Optional<Settings> result = dialog.showAndWait();\n return result.orElse(null);\n }",
"@Override\n public void processPlugin(HttpServletRequest request, HttpServletResponse response, DynamicClient dynamicClient, Map<String, Object> inParameters)\n throws ClientRegistrationException\n {\n String contentType = request.getHeader(CONTENT_TYPE);\n if (contentType != null && !contentType.toLowerCase().contains(MEDIA_TYPE_JWT))\n {\n throw new ClientRegistrationException(Response.Status.UNSUPPORTED_MEDIA_TYPE,\n ClientRegistrationException.ErrorCode.invalid_payload, \"This plugin only handles JWT request type.\");\n }\n\n String pluginId = this.configuration.getId();\n String requestJwt = (String) inParameters.get(DynamicClientRegistrationPlugin.IN_PARAMETER_NAME_REQUEST_BODY);\n\n processJwt(dynamicClient, pluginId, requestJwt);\n\n }",
"com.google.cloud.documentai.v1beta2.InputConfigOrBuilder getInputConfigOrBuilder();",
"@Override\n\tpublic void saveSettings() {\n\n\t}",
"private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {\n \n if(!validateFileName())\n return;\n if(props != null) {\n\n FileOutputStream fout = null;\n try {\n String sjn = serviceJarTf.getText();\n props.setProperty(SERVICE_JAR_NAME, sjn);\n \n boolean isCopyToServerCp = copyJarCB.isSelected();\n if(isCopyToServerCp)\n props.setProperty(COPY_JAR_TO_SERVERCLASSPATH,Boolean.toString(isCopyToServerCp));\n else\n props.remove(COPY_JAR_TO_SERVERCLASSPATH);\n \n fout = new FileOutputStream(serviceProps);\n props.store(fout, sjn);\n fout.flush();\n \n } catch (Exception ex) {\n Exceptions.printStackTrace(ex);\n } finally {\n try {\n fout.close();\n } catch (Exception ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n } else {\n\n FileOutputStream fout = null;\n try {\n String sjn = serviceJarTf.getText();\n props = new Properties();\n props.setProperty(SERVICE_JAR_NAME, sjn);\n fout = new FileOutputStream(serviceProps);\n props.store(fout, sjn);\n fout.flush();\n \n } catch (Exception ex) {\n Exceptions.printStackTrace(ex);\n } finally {\n try {\n fout.close();\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n }\n }\n }\n \n dispose();\n}",
"public int uploadContent(HashMap<String, String> info);",
"public void handle(ActionEvent e) {\n\t\t\t\tif(!setConfiguration()) return;\r\n\t \t\r\n\t FileChooser fileChooser = new FileChooser();\r\n\t fileChooser.setTitle(\"Save Settings\");\r\n\t fileChooser.setInitialFileName(\"Settings\");\r\n\t fileChooser.getExtensionFilters().add(new ExtensionFilter(\"Categorizer Settings\", \"*.csf\"));\r\n\t File file = fileChooser.showSaveDialog(new Stage());\r\n\t if(file == null) return;\r\n\t try {\r\n\t\t\t\t\tm_Categorizer.saveSettings(file);\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\t\talert.setContentText(\"Cannot save file\");\r\n\t\t\t\t\talert.showAndWait();\r\n\t\t\t\t}\r\n\r\n\t }",
"@POST\r\n\t@Path(\"/uploadgraph\")\r\n\t@Consumes(MediaType.MULTIPART_FORM_DATA)\r\n\tpublic Response uploadGraph(@FormDataParam(\"file\") InputStream fileInputStream,\r\n\t\t\t@HeaderParam(\"x-session-token\") String sSessionId, @QueryParam(\"workspace\") String sWorkspace,\r\n\t\t\t@QueryParam(\"name\") String sName, @QueryParam(\"description\") String sDescription,\r\n\t\t\t@QueryParam(\"public\") Boolean bPublic) throws Exception {\r\n\r\n\t\tUtils.debugLog(\"ProcessingResources.uploadGraph( InputStream, Session: \" + sSessionId + \", Ws: \" + sWorkspace + \", Name: \" + sName + \", Descr: \" + sDescription + \", Public: \" + bPublic + \" )\");\r\n\t\t\r\n\t\tOutputStream oOutStream = null;\r\n\r\n\t\ttry {\r\n\t\t\t// Check authorization\r\n\t\t\tif (Utils.isNullOrEmpty(sSessionId)) {\r\n\t\t\t\tUtils.debugLog(\"ProcessingResources.uploadGraph( InputStream, Session: \" + sSessionId + \", Ws: \" + sWorkspace + \", Name: \" + sName + \", Descr: \" + sDescription + \", Public: \" + bPublic + \" ): invalid session\");\r\n\t\t\t\treturn Response.status(401).build();\r\n\t\t\t}\r\n\t\t\tUser oUser = Wasdi.getUserFromSession(sSessionId);\r\n\r\n\t\t\tif (oUser == null) return Response.status(401).build();\r\n\t\t\tif (Utils.isNullOrEmpty(oUser.getUserId())) return Response.status(401).build();\r\n\r\n\t\t\tString sUserId = oUser.getUserId();\r\n\r\n\t\t\t// Get Download Path\r\n\t\t\tString sDownloadRootPath = Wasdi.getDownloadPath(m_oServletConfig);\r\n\r\n\t\t\tFile oWorkflowsPath = new File(sDownloadRootPath + \"workflows/\");\r\n\r\n\t\t\tif (!oWorkflowsPath.exists()) {\r\n\t\t\t\toWorkflowsPath.mkdirs();\r\n\t\t\t}\r\n\r\n\t\t\t// Generate Workflow Id and file\r\n\t\t\tString sWorkflowId = UUID.randomUUID().toString();\r\n\t\t\tFile oWorkflowXmlFile = new File(sDownloadRootPath + \"workflows/\" + sWorkflowId + \".xml\");\r\n\r\n\t\t\tUtils.debugLog(\"ProcessingResources.uploadGraph: workflow file Path: \" + oWorkflowXmlFile.getPath());\r\n\r\n\t\t\t// save uploaded file\r\n\t\t\tint iRead = 0;\r\n\t\t\tbyte[] ayBytes = new byte[1024];\r\n\r\n\t\t\toOutStream = new FileOutputStream(oWorkflowXmlFile);\r\n\r\n\t\t\twhile ((iRead = fileInputStream.read(ayBytes)) != -1) {\r\n\t\t\t\toOutStream.write(ayBytes, 0, iRead);\r\n\t\t\t}\r\n\r\n\t\t\toOutStream.flush();\r\n\t\t\t// Close it in the finally clause\r\n\t\t\t//oOutStream.close();\r\n\r\n\t\t\t// Create Entity\r\n\t\t\tSnapWorkflow oWorkflow = new SnapWorkflow();\r\n\t\t\toWorkflow.setName(sName);\r\n\t\t\toWorkflow.setDescription(sDescription);\r\n\t\t\toWorkflow.setFilePath(oWorkflowXmlFile.getPath());\r\n\t\t\toWorkflow.setUserId(sUserId);\r\n\t\t\toWorkflow.setWorkflowId(sWorkflowId);\r\n\r\n\t\t\tif (bPublic == null) oWorkflow.setIsPublic(false);\r\n\t\t\telse oWorkflow.setIsPublic(bPublic.booleanValue());\r\n\r\n\t\t\tif (Wasdi.getActualNode() != null) {\r\n\t\t\t\toWorkflow.setNodeCode(Wasdi.getActualNode().getNodeCode());\r\n\t\t\t\toWorkflow.setNodeUrl(Wasdi.getActualNode().getNodeBaseAddress());\r\n\t\t\t}\r\n\r\n\t\t\t// Read the graph\r\n\t\t\tGraph oGraph = GraphIO.read(new FileReader(oWorkflowXmlFile));\r\n\r\n\t\t\t// Take the nodes\r\n\t\t\tNode[] aoNodes = oGraph.getNodes();\r\n\r\n\t\t\tfor (int iNodes = 0; iNodes < aoNodes.length; iNodes++) {\r\n\t\t\t\tNode oNode = aoNodes[iNodes];\r\n\t\t\t\t// Search Read and Write nodes\r\n\t\t\t\tif (oNode.getOperatorName().equals(\"Read\")) {\r\n\t\t\t\t\toWorkflow.getInputNodeNames().add(oNode.getId());\r\n\t\t\t\t} else if (oNode.getOperatorName().equals(\"Write\")) {\r\n\t\t\t\t\toWorkflow.getOutputNodeNames().add(oNode.getId());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Save the Workflow\r\n\t\t\tSnapWorkflowRepository oSnapWorkflowRepository = new SnapWorkflowRepository();\r\n\t\t\toSnapWorkflowRepository.insertSnapWorkflow(oWorkflow);\r\n\r\n\t\t} catch (Exception oEx) {\r\n\t\t\tUtils.debugLog(\"ProcessingResources.uploadGraph: \" + oEx);\r\n\t\t\treturn Response.serverError().build();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tif (oOutStream != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\toOutStream.close();\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception oEx) {\r\n\t\t\t\t\tUtils.debugLog(\"ProcessingResources.uploadGraph: Error \" + oEx.toString());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Response.ok().build();\r\n\t}",
"private File storeToUploadDir(InputStream is, String packageName) throws IOException {\n File uploadedFile = new File(uploadDir, FileType.APPDF.addExtension(random.nextInt() + \"_\" + packageName));\n ReadableByteChannel rbc = Channels.newChannel(is);\n FileOutputStream fos = new FileOutputStream(uploadedFile);\n fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);\n return uploadedFile;\n }",
"com.google.cloud.documentai.v1beta2.InputConfig getInputConfig();",
"private void setAndWriteFiles()\n\t{\n\t\tSensorConfiguration config = new SensorConfiguration();\n\t\tString versionMajor = ConfigurationInterface_v1_0.VERSION.substring(0,\n\t\t\t\tConfigurationInterface_v1_0.VERSION.indexOf('.'));\n\t\tString versionMinor = ConfigurationInterface_v1_0.VERSION\n\t\t\t\t.substring(ConfigurationInterface_v1_0.VERSION.indexOf('.') + 1);\n\t\tconfig.setConfigurationInterfaceVersion(versionMajor, versionMinor);\n\n\t\tStartModes startModes = new StartModes();\n\t\t// set startMode for sensorConfiguration\n\t\tfor (StartMode element : startModes.getStartModeList())\n\t\t{\n\t\t\tif (element.getName().equals(\"DEFINED_TIME\"))\n\t\t\t{\n\t\t\t\tconfig.setStartMode(element);\n\t\t\t}\n\t\t}\n\n\t\tConfigurationSets configSets = new ConfigurationSets();\n\t\t// set configurationSet for sensorConfiguration\n\t\tfor (ConfigurationSet element : configSets.getConfigSetList())\n\t\t{\n\t\t\tif (element.getName().equals(\"mesana\"))\n\t\t\t{\n\n\t\t\t\tconfig.setConfigurationSet(element);\n\t\t\t}\n\t\t}\n\n\t\tif (config.getStartMode().getName().equals(\"DEFINED_TIME\"))\n\t\t{\n\n\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\tcalendar.set(Calendar.DAY_OF_MONTH, 10);\n\t\t\tcalendar.set(Calendar.HOUR_OF_DAY, 5);\n\t\t\tcalendar.set(Calendar.MINUTE, 11);\n\t\t\tDate date = calendar.getTime();\n\t\t\tconfig.setRecordingStartTime(date);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconfig.setRecordingStartTime(null);\n\t\t}\n\t\t\n\t\tconfig.setRecordingDuration(12000);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tConnectionManager.getInstance().currentSensor(0).setSensorConfiguration(config);\n\t\t\t\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeConfigFile();\n\t\t\t\n\t\t\t// write Encrypted data to sensor\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeEncryptedParameters(\"123456789abcd12\");\n\t\t\t\n\t\t\tint index = customerList.getSelectionIndex();\n\t\t\tif (index >= 0 && index <= mCollect.getList().size())\n\t\t\t{\n\t\t\t\tString linkId = mCollect.getList().get(index).getLinkId();\n\t\t\t\tconfig.addParameter(\"LinkId\", linkId);\n\t\t\t}\n\t\t\t// write custom data to additional file in sensor\n\t\t\tConnectionManager.getInstance().currentSensor(0).writeCustomFile();\n\t\t}\n\t\tcatch (SensorNotFoundException e)\n\t\t{\n\t\t\tstatusBar.setText(e.getMessage());\n\t\t}\n\t}",
"public ObjectStoreSinkConnectorConfig(ConfigDef config, Map<String, String> parsedConfig) {\n super(config, parsedConfig);\n }",
"@FXML\n public void saveFile(Event e) {\n String outputData = output.getText();\n\n File file = chooser.showSaveDialog(save.getScene().getWindow());\n\n if(file != null) {\n createFile(outputData, file);\n }\n }",
"@Override\n public boolean configure(final StaplerRequest req, final JSONObject formData)\n throws FormException {\n // Grab apiKey and hostname\n apiKey = Secret.fromString(fixEmptyAndTrim(formData.getString(\"apiKey\")));\n hostname = formData.getString(\"hostname\");\n\n // Grab blacklist, strip whitespace, remove duplicate commas, and make lowercase\n blacklist = formData.getString(\"blacklist\")\n .replaceAll(\"\\\\s\",\"\")\n .replaceAll(\",,\",\"\")\n .toLowerCase();\n\n // Grab tagNode and coerse to a boolean\n if ( formData.getString(\"tagNode\").equals(\"true\") ) {\n tagNode = true;\n } else {\n tagNode = false;\n }\n\n // Persist global configuration information\n save();\n return super.configure(req, formData);\n }",
"protected CallbackResult handleCommandRequestConfigFilesResp(String extra) throws RobotCoreException {\n fileList = robotConfigFileManager.deserializeXMLConfigList(extra);\n warnIfNoFiles();\n populate();\n return CallbackResult.HANDLED;\n }",
"@Override\n\tpublic Result uploadFile(String requestUri, File uploadFile,\n\t\t\tFile uploadPath, HashMap<String, ContentBody> extraParts) {\n\t\treturn super.uploadFile(requestUri, uploadFile, uploadPath, extraParts);\n\t}",
"public void save() {\n try {\n ConfigurationProvider.getProvider(YamlConfiguration.class).save(this.configuration, this.getConfigurationFile());\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public interface PluginConfigType {\n public static final String PLUGIN_PROPERTY_NAME_PREFIX = \"pluginProperty_\";\n\n /**\n * Render the configuration item to the given writer. This should result in some form control element.\n * The name of the form control should be \"pluginProperty_\" followed by the pluginConfig.getKey().\n *\n * @param writer The writer to render to\n * @param pluginConfig The configuration to render\n * @param value The value to render\n * @throws IOException If an error occured\n */\n void render(JspWriter writer, PluginConfig pluginConfig, String value) throws IOException;\n\n /**\n * Validate the value entered the user\n * \n * @param pluginConfig The config to validate against\n * @param value The value to validate\n * @return null if validation passed, or a error message if not\n */\n String validate(PluginConfig pluginConfig, String value);\n\n}",
"private void setupFiles(){\n\t\t// Copies the default configuration files to the workspace \n\t\ttry{\n\t\t\tBundle bundle = Platform.getBundle(Activator.PLUGIN_ID);\n\t\t\tIPath destBasePath = Platform.getStateLocation(bundle);\n\t\t\tpropertiesFile = destBasePath.append(PreferencesConstants.PROP_BUNDLE_STATE_PATH).toFile();\n\t\t\tif(!propertiesFile.exists()){\n\n\t\t\t\tURI sourceBaseURI = bundle.getEntry(PreferencesConstants.DEFAULT_CONFIG_BUNDLE_PATH).toURI();\n\t\t\t\t//TODO: fix the item below?\n\t\t\t\tEnumeration<URL> entries = bundle.findEntries(PreferencesConstants.DEFAULT_CONFIG_BUNDLE_PATH, null, true);\n\t\t\t\tfor(; entries != null && entries.hasMoreElements();){\n\t\t\t\t\tURL url = entries.nextElement();\n\t\t\t\t\tURI uri = url.toURI();\n\t\t\t\t\tURI relativeURI = sourceBaseURI.relativize(uri);\n\t\t\t\t\tIPath destPath = destBasePath.append(relativeURI.toString());\n\n\t\t\t\t\tif(destPath.hasTrailingSeparator()){\n\t\t\t\t\t\t// it's a folder\n\t\t\t\t\t\tdestPath.toFile().mkdirs();\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t// it's a file\n\t\t\t\t\t\tURL contentURL = FileLocator.resolve(url);\n\t\t\t\t\t\tSystemUtils.blt(contentURL.openStream(), new FileOutputStream(destPath.toFile()));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//now save the destination paths to the System properties\n\t\t\t//save the report paths\n\t\t\tString reportTemplatePath = destBasePath.append(PreferencesConstants.DEFAULT_REPORT_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_REPORT_TEMPLATE_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE, \n\t\t\t\t\treportTemplatePath);\n\t\t\tSystem.out.println(\"report template file: \" + reportTemplatePath);\t\t\n\t\t\t\n\t\t\tString reportPath = destBasePath.append(PreferencesConstants.DEFAULT_REPORT_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_REPORT_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT, \n\t\t\t\t\treportPath);\t\t\t\n\t\t\tSystem.out.println(\"report file: \" + reportPath);\t\t\t\n\t\t\t\n\t\t\t//save the rule paths\n\t\t\tString ruleSessionPath = destBasePath.append(PreferencesConstants.DEFAULT_RULE_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_RULE_SESSION_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION, \n\t\t\t\t\truleSessionPath);\t\t\t\n\t\t\tSystem.out.println(\"rule session file: \" + ruleSessionPath);\t\t\t\t\t\n\t\t\t\n\t\t\tString ruleSessionOutPath = destBasePath.append(PreferencesConstants.DEFAULT_RULE_PATH\n\t\t\t\t\t+ PreferencesConstants.DEFAULT_RULE_SESSION_OUT_URL).toPortableString();\n\t\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT, \n\t\t\t\t\truleSessionOutPath);\t\t\t\n\t\t\tSystem.out.println(\"rule session out file: \" + ruleSessionOutPath);\t\t\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t\t\n\t\t/*\n\t\tString pluginName = Activator.PLUGIN_ID;\n\t\tBundle bundle = Platform.getBundle(pluginName);\n\n\t\tString propFileStr = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.PROP_URL);\n\t\tFile sourcePropFile = new File(propFileStr);\n\n\t\t//propertiesFile = new File(fixedPath);\n\t\tIWorkspace workspace = ResourcesPlugin.getWorkspace();\n\t\tIWorkspaceRoot root = workspace.getRoot();\n\t\tIPath location = root.getLocation();\n\t\t//location.toString()\n\t\t//String path = location.toString() + location.SEPARATOR + \".metadata\" \n\t\t//\t+ location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\t\tString path = location.toString() + location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\t\t//URL entry = Platform.getInstallLocation().getURL();\n\t\t//String path = entry.toString() + location.SEPARATOR + PreferencesConstants.PROP_BASE_URL;\n\n\t\tFile usersResourceDir = new File(path);\n\t\tpropertiesFile = new File(path + PreferencesConstants.PROP_URL);\n\t\tSystem.out.println(\"properties file \" + propertiesFile.getAbsolutePath());\n\t\tFile reportDir;\n\t\tFile ruleDir;\n\t\tif(!usersResourceDir.exists()){\n\t\t\ttry{\n\t\t\t\tSystemUtils.createDirectory(usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy the properties file\n\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyFile(sourcePropFile, propertiesFile);\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\n\t\t\t//copy report directory\n\t\t\tString fixedReportPath = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.DEFAULT_REPORT_PATH);\n\t\t\treportDir = new File(fixedReportPath);\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyDirectory(reportDir, usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\t//copy rule directory\n\t\t\tString fixedRulePath = getFixedPath(bundle, PreferencesConstants.PROP_BASE_URL + PreferencesConstants.DEFAULT_RULE_PATH);\n\t\t\truleDir = new File(fixedRulePath);\n\t\t\ttry{\n\t\t\t\tSystemUtils.copyDirectory(ruleDir, usersResourceDir);\n\t\t\t}\n\t\t\tcatch(IOException e){\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tSystem.out.println(\"success\");\n\t\t}\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_TEMPLATE_URL);\n\t\tSystem.out.println(\"report template file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_REPORT_TEMPLATE));\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_REPORT, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_REPORT_URL.substring(1));\n\t\tSystem.out.println(\"report file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_REPORT));\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_SESSION_URL.substring(1));\n\t\tSystem.out.println(\"rule session file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION));\n\n\t\tSystem.setProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT, usersResourceDir.toString() + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_PATH.substring(1) + usersResourceDir.separator + PreferencesConstants.DEFAULT_RULE_SESSION_OUT_URL.substring(1));\n\t\tSystem.out.println(\"rule session file: \" + System.getProperty(PreferencesConstants.DEFAULT_PROP_RULE_SESSION_OUT));\n\t\t*/\n\t}",
"public ISysConfig getSysConfig() {\n ISysConfig sc = new DefaultSysConfig(AOConstants.AO_CONFIG_NAME);\n\n // Fill in the current values.\n sc.putParameter(StringParameter.getInstance(ISPDataObject.VERSION_PROP, getVersion()));\n sc.putParameter(DefaultParameter.getInstance(AltairConstants.WAVELENGTH_PROP, getWavelength()));\n sc.putParameter(DefaultParameter.getInstance(AltairConstants.ADC_PROP, getAdc()));\n sc.putParameter(DefaultParameter.getInstance(AltairConstants.CASS_ROTATOR_PROP, getCassRotator()));\n sc.putParameter(DefaultParameter.getInstance(AltairConstants.ND_FILTER_PROP, getNdFilter()));\n // note: the values for field lens and guide star type are provided by the mode\n sc.putParameter(DefaultParameter.getInstance(AltairConstants.FIELD_LENSE_PROP, getFieldLens()));\n sc.putParameter(DefaultParameter.getInstance(AltairConstants.GUIDESTAR_TYPE_PROP, getGuideStarType()));\n return sc;\n }",
"Map<String, Object> updateConfig(Request request, String configtype, String id);",
"public SGSParamFile(SGSParam param, StyxGridServiceInstance instance) throws StyxException\n {\n // The file is named after the parameter name\n super(new InMemoryFile(param.getName()));\n this.param = param;\n this.instance = instance;\n if (this.getJSAPParameter().getDefault() != null)\n {\n // TODO: We are only allowing a single default value\n this.setParameterValue(this.getJSAPParameter().getDefault()[0]);\n this.valueSet = true;\n }\n }",
"private void saveFile(InputStream uploadedInputStream,\r\n String serverLocation) {\r\n \r\n try {\r\n OutputStream outpuStream = new FileOutputStream(new File(serverLocation));\r\n int read = 0;\r\n byte[] bytes = new byte[1024];\r\n \r\n outpuStream = new FileOutputStream(new File(serverLocation));\r\n while ((read = uploadedInputStream.read(bytes)) != -1) {\r\n outpuStream.write(bytes, 0, read);\r\n }\r\n outpuStream.flush();\r\n outpuStream.close();\r\n } catch (IOException e) {\r\n \r\n e.printStackTrace();\r\n }\r\n \r\n }",
"private void saveFileOnServer(Iterator<FileItem> fileItemsIterator, String fileType) throws Exception {\n FileItem fileItem = fileItemsIterator.next();\n\n // save file\n String newFileName = _sessionId;\n if (fileType.equalsIgnoreCase(\"netFile\")) {\n newFileName += \".net\";\n XMLTree m = XMLTree.getInstance();\n m.setNetFilePath(newFileName);\n } else {\n newFileName += \".xml\";\n }\n\n File file = new File(DATA_PATH + newFileName);\n fileItem.write(file);\n\n // if the file is xml, validate it\n if (!fileType.equalsIgnoreCase(\"netFile\")) {\n SimApi.setSimulatorScenarioXmlPath(file.getAbsolutePath());\n XMLTree m = XMLTree.getInstance();\n m.parse(true);\n } else {\n// try {\n// SimApi.parseNetFile(file);\n// } catch (IOException ex) {\n// throw new Exception(\"Net file is not a valid NET file.\");\n// }\n }\n\n // file info\n System.out.println(\"FileName = \" + fileItem.getName());\n System.out.println(\"Absolute Path at server = \" + file.getAbsolutePath());\n }",
"private void saveSettings() {\n // Serialize the mIncludes map into a compact String. The mIncludedBy map can be\n // inferred from it.\n String encoded = encodeMap(mIncludes);\n\n try {\n if (encoded.length() >= 2048) {\n // The maximum length of a setting key is 2KB, according to the javadoc\n // for the project class. It's unlikely that we'll\n // hit this -- even with an average layout root name of 20 characters\n // we can still store over a hundred names. But JUST IN CASE we run\n // into this, we'll clear out the key in this name which means that the\n // information will need to be recomputed in the next IDE session.\n mProject.setPersistentProperty(CONFIG_INCLUDES, null);\n } else {\n String existing = mProject.getPersistentProperty(CONFIG_INCLUDES);\n if (!encoded.equals(existing)) {\n mProject.setPersistentProperty(CONFIG_INCLUDES, encoded);\n }\n }\n } catch (CoreException e) {\n AdtPlugin.log(e, \"Can't store include settings\");\n }\n }",
"public interface GeoServerPluginConfigurator {\r\n \r\n /**\r\n * Get the list of Resources used by the plugin.\r\n * \r\n * @return\r\n * @throws IOException\r\n */\r\n public List<Resource> getFileLocations() throws IOException;\r\n \r\n /**\r\n * Allows the plugin to store its configuration on the target {@link GeoServerResourceLoader}.\r\n * This way we delegate the plugin to save its configuration since it is the only\r\n * on who knows how to do it better.\r\n * \r\n * @param resourceLoader\r\n * @throws IOException\r\n */\r\n public void saveConfiguration(GeoServerResourceLoader resourceLoader) throws IOException;\r\n \r\n /**\r\n * Allows the plugin to reload its configuration from the target {@link GeoServerResourceLoader}.\r\n * This way we delegate the plugin to load its configuration since it is the only\r\n * on who knows how to do it better.\r\n * \r\n * @param resourceLoader\r\n * @throws IOException\r\n */\r\n public void loadConfiguration(GeoServerResourceLoader resourceLoader) throws IOException;\r\n\r\n}",
"void saveConfig() {\r\n\t\ttry {\r\n\t\t\tPrintWriter out = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(\"open-ig-mapeditor-config.xml\"), 64 * 1024), \"UTF-8\"));\r\n\t\t\ttry {\r\n\t\t\t\tout.printf(\"<?xml version='1.0' encoding='UTF-8'?>%n\");\r\n\t\t\t\tout.printf(\"<mapeditor-config>%n\");\r\n\t\t\t\tout.printf(\" <window x='%d' y='%d' width='%d' height='%d' state='%d'/>%n\", getX(), getY(), getWidth(), getHeight(), getExtendedState());\r\n\t\t\t\tout.printf(\" <language id='%s'/>%n\", ui.languageEn.isSelected() ? \"en\" : \"hu\");\r\n\t\t\t\tout.printf(\" <splitters main='%d' preview='%d' surfaces='%d'/>%n\", split.getDividerLocation(), toolSplit.getDividerLocation(), featuresSplit.getDividerLocation());\r\n\t\t\t\tout.printf(\" <editmode type='%s'/>%n\", ui.buildButton.isSelected());\r\n\t\t\t\tout.printf(\" <tabs selected='%d'/>%n\", propertyTab.getSelectedIndex());\r\n\t\t\t\tout.printf(\" <lights preview='%d' map='%s'/>%n\", alphaSlider.getValue(), Float.toString(alpha));\r\n\t\t\t\tout.printf(\" <filter surface='%s' building='%s'/>%n\", XML.toHTML(filterSurface.getText()), XML.toHTML(filterBuilding.getText()));\r\n\t\t\t\tout.printf(\" <allocation worker='%s' strategy='%d'/>%n\", ui.allocationPanel.availableWorkers.getText(), ui.allocationPanel.strategies.getSelectedIndex());\r\n\t\t\t\tout.printf(\" <view buildings='%s' minimap='%s' textboxes='%s' zoom='%s' standard-fonts='%s' placement-hints='%s'/>%n\", ui.viewShowBuildings.isSelected(), \r\n\t\t\t\t\t\tui.viewSymbolicBuildings.isSelected(), ui.viewTextBackgrounds.isSelected(), Double.toString(renderer.scale), ui.viewStandardFonts.isSelected()\r\n\t\t\t\t\t\t, ui.viewPlacementHints.isSelected());\r\n\t\t\t\tout.printf(\" <custom-surface-names>%n\");\r\n\t\t\t\tfor (TileEntry te : surfaceTableModel.rows) {\r\n\t\t\t\t\tout.printf(\" <tile id='%s' type='%s' name='%s'/>%n\", te.id, XML.toHTML(te.surface), XML.toHTML(te.name));\r\n\t\t\t\t}\r\n\t\t\t\tout.printf(\" </custom-surface-names>%n\");\r\n\t\t\t\tout.printf(\" <custom-building-names>%n\");\r\n\t\t\t\tfor (TileEntry te : buildingTableModel.rows) {\r\n\t\t\t\t\tout.printf(\" <tile id='%s' type='%s' name='%s'/>%n\", te.id, XML.toHTML(te.surface), XML.toHTML(te.name));\r\n\t\t\t\t}\r\n\t\t\t\tout.printf(\" </custom-building-names>%n\");\r\n\t\t\t\tout.printf(\" <recent>%n\");\r\n\t\t\t\tfor (int i = ui.fileRecent.getItemCount() - 1; i >= 2 ; i--) {\r\n\t\t\t\t\tout.printf(\" <entry file='%s'/>%n\", XML.toHTML(ui.fileRecent.getItem(i).getText()));\r\n\t\t\t\t}\r\n\t\t\t\tout.printf(\" </recent>%n\");\r\n\t\t\t\tout.printf(\"</mapeditor-config>%n\");\r\n\t\t\t} finally {\r\n\t\t\t\tout.close();\r\n\t\t\t}\r\n\t\t} catch (IOException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}",
"public static YamlConfiguration createConfig(String name) {\r\n if (!name.endsWith(\".yml\")) {\r\n \tname += \".yml\";\r\n }\r\n \r\n if (plugin.getResource(name) != null){\r\n \tplugin.saveResource(name, false);\r\n \treturn getConfig(name);\r\n } else {\r\n \tFile file = new File(plugin.getDataFolder(),name);\r\n if (!file.exists()) {\r\n plugin.getDataFolder().mkdir();\r\n try {\r\n file.createNewFile();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n return YamlConfiguration.loadConfiguration(file);// returns the newly created configuration object.\r\n }\r\n }",
"void saveServerConfig(String serverName,\n String methodName,\n OMAGServerConfig serverConfig) throws OMAGInvalidParameterException\n {\n OMAGServerConfigStore serverConfigStore = getServerConfigStore(serverName, methodName);\n\n if (serverConfigStore != null)\n {\n if (serverConfig != null)\n {\n serverConfigStore.saveServerConfig(serverConfig);\n }\n else\n {\n /*\n * If the server config is null we delete the file rather than have an empty file hanging around.\n */\n serverConfigStore.removeServerConfig();\n }\n }\n }",
"public static void savePlayerConfig(String name, FileConfiguration config) {\r\n if (!name.endsWith(\".yml\")) {\r\n \tname += \".yml\";\r\n }\r\n File file = new File(plugin.getDataFolder() + File.separator + \"players\", name);\r\n try {\r\n config.save(file);\r\n } catch (IOException e) {\r\n \tFPSCaste.log(\"Could not save: \" + name + \", is the disk full?\", Level.WARNING);\r\n }\r\n\t\t}",
"public final File createParametersFile(final int taskid,\n final Path tmpPath) {\n File file = null;\n\n BufferedReader br = null;\n FileReader fr = null;\n try {\n fr = new FileReader(\"/home/futuregateway/FutureGateway/\"\n + \"fgAPIServer/apps/kepler-batch/models-mapping.json\");\n br = new BufferedReader(fr);\n\n String jsonsmapping = \"\";\n String sCurrentLine;\n while ((sCurrentLine = br.readLine()) != null) {\n jsonsmapping += sCurrentLine;\n }\n JSONObject jm = JSONFactoryUtil.createJSONObject(jsonsmapping);\n JSONArray modelsmapping = jm.getJSONArray(\"models\");\n\n String jsonString = \"{\";\n jsonString += \"\\\"parameters\\\": {\";\n jsonString += \"\\\"futuregateway_uri\\\": \\\"\" + fgURL + \"\\\",\";\n jsonString += \"\\\"authorization_token\\\": \\\"\" + token + \"\\\",\";\n jsonString += \"\\\"task_id\\\": \\\"\" + taskid + \"\\\",\";\n jsonString += \"\\\"config_json\\\": \\\"[\";\n\n for (int i = 0; i < models.length; i++) {\n String modelname = models[i];\n for (int j = 0; j < modelsmapping.length(); j++) {\n JSONObject modelmapping = modelsmapping.getJSONObject(j);\n String name = modelmapping.getString(\"model\");\n if (name.equals(modelname)) {\n String host = modelmapping.getString(\"host\");\n String port = modelmapping.getString(\"port\");\n String username = modelmapping.getString(\"username\");\n String password = modelmapping.getString(\"password\");\n String cores = modelmapping.getString(\"cores\");\n if (i == models.length - 1) {\n jsonString += \"{\\\\\\\"host\\\\\\\":\\\\\\\"\" + host\n + \"\\\\\\\",\\\\\\\"port\\\\\\\":\\\\\\\"\" + port\n + \"\\\\\\\",\\\\\\\"login\\\\\\\":\\\\\\\"\"\n + username + \"\\\\\\\",\\\\\\\"password\\\\\\\":\\\\\\\"\"\n + password + \"\\\\\\\",\\\\\\\"argument\\\\\\\":\\\\\\\"\"\n + cores + \" \"\n + modelname + \" \" + scenario + \" \"\n + timeFrequency + \" \" + percentile + \" \"\n + historicalTimeMin + \"_\"\n + historicalTimeMax\n + \" \" + scenarioTimeMin + \"_\"\n + scenarioTimeMax\n + \" \" + latmin + \":\" + latmax + \"|\"\n + lonmin\n + \":\" + lonmax + \" r360x180\\\\\\\"}\";\n } else {\n jsonString += \"{\\\\\\\"host\\\\\\\":\\\\\\\"\" + host\n + \"\\\\\\\",\\\\\\\"port\\\\\\\":\\\\\\\"\" + port\n + \"\\\\\\\",\\\\\\\"login\\\\\\\":\\\\\\\"\"\n + username + \"\\\\\\\",\\\\\\\"password\\\\\\\":\\\\\\\"\"\n + password\n + \"\\\\\\\",\\\\\\\"argument\\\\\\\":\\\\\\\"\" + cores + \" \"\n + modelname + \" \" + scenario + \" \"\n + timeFrequency + \" \" + percentile + \" \"\n + historicalTimeMin + \"_\"\n + historicalTimeMax\n + \" \" + scenarioTimeMin + \"_\"\n + scenarioTimeMax\n + \" \" + latmin + \":\" + latmax\n + \"|\" + lonmin\n + \":\" + lonmax + \" r360x180\\\\\\\"},\";\n }\n }\n }\n }\n jsonString += \"]\\\",\";\n jsonString += \"\\\"token_service_uri\\\": \\\"https://fgw01.ncg.ingrid\"\n + \".pt/api/jsonws/iam.token/get-token\\\",\";\n jsonString += \"\\\"token_service_user\\\": \\\"admin@fgapiserver\"\n + \".indigo.eu\\\",\";\n jsonString += \"\\\"token_service_password\\\": \\\"3t>145.v9u+CtVv\\\"\";\n jsonString += \"}\";\n jsonString += \"}\";\n jsonString += \"\\n\";\n\n file = new File(tmpPath + \"/parameters.json\");\n file.createNewFile();\n System.out.println(\"file: \" + tmpPath + \"/parameters.json\");\n FileWriter fileWriter = new FileWriter(file);\n fileWriter.write(jsonString);\n fileWriter.flush();\n fileWriter.close();\n } catch (IOException | JSONException e) {\n e.printStackTrace();\n } finally {\n try {\n if (br != null) {\n br.close();\n }\n if (fr != null) {\n fr.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n return file;\n }",
"public Config(HG plugin)\r\n/* 38: */ {\r\n/* 39:46 */ if (!new File(plugin.getDataFolder(), \"config.yml\").exists())\r\n/* 40: */ {\r\n/* 41:47 */ Util.log(\"Config not found. Generating default config!\");\r\n/* 42:48 */ plugin.saveDefaultConfig();\r\n/* 43: */ }\r\n/* 44:51 */ config = plugin.getConfig().getRoot();\r\n/* 45:52 */ config.options().copyDefaults(true);\r\n/* 46:53 */ plugin.reloadConfig();\r\n/* 47:54 */ config = plugin.getConfig();\r\n/* 48: */ \r\n/* 49:56 */ spawnmobs = config.getBoolean(\"settings.spawn-mobs\");\r\n/* 50:57 */ spawnmobsinterval = config.getInt(\"settings.spawn-mobs-interval\") * 20;\r\n/* 51:58 */ freeroam = config.getInt(\"settings.free-roam\");\r\n/* 52:59 */ trackingstickuses = config.getInt(\"settings.trackingstick-uses\");\r\n/* 53:60 */ playersfortrackingstick = config.getInt(\"settings.players-for-trackingstick\");\r\n/* 54:61 */ maxchestcontent = config.getInt(\"settings.max-chestcontent\");\r\n/* 55:62 */ teleAtEnd = config.getBoolean(\"settings.teleport-at-end\");\r\n/* 56:63 */ maxTeam = config.getInt(\"settings.max-team-size\");\r\n/* 57:64 */ giveReward = config.getBoolean(\"reward.enabled\");\r\n/* 58:65 */ cash = config.getInt(\"reward.cash\");\r\n/* 59:66 */ maxTeam = config.getInt(\"settings.max-team-size\");\r\n/* 60:67 */ giveReward = config.getBoolean(\"reward.enabled\");\r\n/* 61:68 */ cash = config.getInt(\"reward.cash\");\r\n/* 62:69 */ breakblocks = config.getBoolean(\"rollback.allow-block-break\");\r\n/* 63:70 */ blocks = config.getIntegerList(\"rollback.editable-blocks\");\r\n/* 64:71 */ randomChest = config.getBoolean(\"random-chest.enabled\");\r\n/* 65:72 */ randomChestInterval = config.getInt(\"random-chest.interval\") * 20;\r\n/* 66:73 */ randomChestMaxContent = config.getInt(\"random-chest.max-chestcontent\");\r\n/* 67:75 */ if (giveReward) {\r\n/* 68: */ try\r\n/* 69: */ {\r\n/* 70:77 */ Vault.setupEconomy();\r\n/* 71: */ }\r\n/* 72: */ catch (NoClassDefFoundError e)\r\n/* 73: */ {\r\n/* 74:79 */ Util.log(\"Unable to setup vault! Rewards will not be given out..\");\r\n/* 75:80 */ giveReward = false;\r\n/* 76: */ }\r\n/* 77: */ }\r\n/* 78:84 */ ItemStack i = new ItemStack(Material.FIREWORK, 64);\r\n/* 79:85 */ FireworkMeta fm = (FireworkMeta)i.getItemMeta();\r\n/* 80:86 */ List<Color> c = new ArrayList();\r\n/* 81:87 */ c.add(Color.ORANGE);\r\n/* 82:88 */ c.add(Color.RED);\r\n/* 83:89 */ FireworkEffect e = FireworkEffect.builder().flicker(true).withColor(c).withFade(c).with(FireworkEffect.Type.BALL_LARGE).trail(true).build();\r\n/* 84:90 */ fm.addEffect(e);\r\n/* 85:91 */ fm.setPower(3);\r\n/* 86:92 */ i.setItemMeta(fm);\r\n/* 87: */ \r\n/* 88:94 */ firework = i;\r\n/* 89: */ }",
"@Override\n\tpublic void save(Object o, String file) {\n\t\t\n\t}",
"void publishPlugin(byte[] jarFile);",
"public GenAmazonS3Config() {\n }",
"public interface UploadFileService {\n\tpublic String saveFile(MultipartFile file);\n\tResource findFileByName(String nameFile);\n\tpublic String saveFileVer(MultipartFile file, String pathToSave);\n}",
"public void saveConfigXml() {\n // Save the xml object to disk\n IPathManager pm = PathManagerFactory.getPathManager();\n LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC,\n LocalizationLevel.SITE);\n\n LocalizationFile newXmlFile = pm.getLocalizationFile(lc,\n CONFIG_FILE_NAME);\n\n if (newXmlFile.getFile().getParentFile().exists() == false) {\n // System.out.println(\"Creating new directory\");\n\n if (newXmlFile.getFile().getParentFile().mkdirs() == false) {\n // System.out.println(\"Could not create new directory...\");\n }\n }\n\n try {\n // System.out.println(\"Saving -- \"\n // + newXmlFile.getFile().getAbsolutePath());\n jaxb.marshalToXmlFile(configXml, newXmlFile.getFile()\n .getAbsolutePath());\n newXmlFile.save();\n\n lf = newXmlFile;\n } catch (Exception e) {\n statusHandler.handle(Priority.ERROR, \"Couldn't save config file.\",\n e);\n }\n }",
"public MonitoredMultiPartRequest(HttpServletRequest request, String saveDir, int maxSize) {\r\n \tsuper(request, saveDir, maxSize);\r\n }",
"abstract public void setMspluginsDir(String path);",
"@Override\n\tpublic boolean isSaveAsAllowed() {\n\t\treturn false;\n\t}",
"public String getInitParameter(String s) {\n if (\"deleteFiles\".equalsIgnoreCase(s))\n return \"false\";\n return Integer.toString(32 * 1024);\n }",
"@Override\r\n\tpublic boolean isSaveAsAllowed() {\r\n\t\treturn false;\r\n\t}",
"public static void encodeConfig(MessageFactory factory, String name, String type, Object value, Config current) {\n\n //Sorry but no inheritance in this case...\n\n if (TYPE_INT.equals(type)) {\n IntParameter defaultParam = null;\n for (IntParameter param : current.getInts()) {\n if (param.getName().equals(name)) {\n defaultParam = param;\n break;\n }\n }\n\n if (defaultParam == null) {\n defaultParam = factory.newFromType(IntParameter._TYPE);\n defaultParam.setName(name);\n current.getInts().add(defaultParam);\n }\n\n defaultParam.setValue((Integer)value);\n\n } else\n\n if (TYPE_BOOL.equals(type)) {\n BoolParameter defaultParam = null;\n for (BoolParameter param : current.getBools()) {\n if (param.getName().equals(name)) {\n defaultParam = param;\n break;\n }\n }\n\n if (defaultParam == null) {\n defaultParam = factory.newFromType(BoolParameter._TYPE);\n defaultParam.setName(name);\n current.getBools().add(defaultParam);\n }\n\n defaultParam.setValue((Boolean)value);\n } else\n\n if (TYPE_STR.equals(type)) {\n StrParameter defaultParam = null;\n for (StrParameter param : current.getStrs()) {\n if (param.getName().equals(name)) {\n defaultParam = param;\n break;\n }\n }\n\n if (defaultParam == null) {\n defaultParam = factory.newFromType(StrParameter._TYPE);\n defaultParam.setName(name);\n current.getStrs().add(defaultParam);\n }\n\n defaultParam.setValue((String)value);\n } else\n\n if (TYPE_DBL.equals(type)) {\n DoubleParameter defaultParam = null;\n for (DoubleParameter param : current.getDoubles()) {\n if (param.getName().equals(name)) {\n defaultParam = param;\n break;\n }\n }\n\n if (defaultParam == null) {\n defaultParam = factory.newFromType(DoubleParameter._TYPE);\n defaultParam.setName(name);\n current.getDoubles().add(defaultParam);\n }\n\n defaultParam.setValue((Double)value);\n }\n }",
"public Upload(String fileName, Configuration cfg) {\n this.fileName = fileName;\n this.cfg = cfg;\n }",
"public Config createConfig(String filename);",
"public void saveXMLConfig() {\n\n\t\t// Get the Carma namespace\n\t\tNamespace ns = Namespace.getNamespace(\"Carma\",\n\t\t\t\t\"http://www.mmarray.org\");\n\n\t\t// Update NameServers. First remove them all, then add since\n\t\t// the number of them could have changed\n\t\tElement nameserversElement = _root.getChild(\"pdbi\", ns)\n\t\t .getChild(\"nameServers\", ns);\n\t\tnameserversElement.removeChildren(\"nameServer\", ns);\n\n\t\t// Set the new children one at a time\n\t\tfor (int i = 0; i < _nameservers.size(); i++) {\n\t\t\t nameserversElement.addContent( new Element(\"nameServer\", ns).\n\t\t\t addContent(new Element(\"identifier\", ns).\n\t\t\t\t setText((String)_nameservers.get(i))));\n\t\t}\n\n\t\t// Update NameServerPorts. First remove them all, then add since\n\t\t// the number of them could have changed\n\t\tElement nameserverPortsElement = _root.getChild(\"pdbi\", ns)\n\t\t .getChild(\"nameServerPorts\", ns);\n\t\tnameserverPortsElement.removeChildren(\"nameServerPort\", ns);\n\n\t\t// Set the new children one at a time\n\t\tfor (int i = 0; i < _nameserverPorts.size(); i++) {\n\t\t\t nameserverPortsElement.addContent( new Element(\"nameServerPort\",\n\t\t\t ns).\n\t\t\t addContent(new Element(\"pidentifier\", ns).\n\t\t\t\t setText((String)_nameserverPorts.get(i))));\n\t\t}\n\n\t\t// Update obsRecord Event Channel Name\n\t\t_root.getChild(\"server\", ns)\n\t\t .getChild(\"obsRecordEventChannelName\", ns)\n\t\t .setText(_obsRecordEventChannelName);\n\t}",
"private void saveOptions(HttpSession p_session,\n HttpServletRequest p_request)\n throws EnvoyServletException\n {\n SessionManager sessionMgr =\n (SessionManager)p_session.getAttribute(SESSION_MANAGER);\n\n String toField = (String)p_request.getParameter(\"toField\");\n List addedOptions = new ArrayList();\n if (toField != null && !toField.equals(\"\"))\n {\n String[] values = toField.split(\",\");\n for (int i=0; i < values.length; i++)\n {\n addedOptions.add(values[i]);\n }\n }\n // update the added options in the session manager.\n sessionMgr.setAttribute(\n WebAppConstants.ADDED_NOTIFICATION_OPTIONS, addedOptions);\n\n // now check for the options hash map\n HashMap optionsHash = (HashMap)sessionMgr.getAttribute(\"optionsHash\");\n if (optionsHash == null)\n {\n optionsHash = new HashMap();\n sessionMgr.setAttribute(\"optionsHash\", optionsHash);\n }\n\n String enabled = p_request.getParameter(\n UserParamNames.NOTIFICATION_ENABLED) == null ? \"0\" : \"1\";\n // Store the main notification flag\n optionsHash.put(UserParamNames.NOTIFICATION_ENABLED, enabled);\n // now let's set the other notification options\n List availableOptions = (List)sessionMgr.getAttribute(\n WebAppConstants.AVAILABLE_NOTIFICATION_OPTIONS);\n int size = availableOptions.size();\n for (int i = 0; i < size; i++)\n {\n String option = (String)availableOptions.get(i);\n String value = addedOptions.contains(option) ? \"1\" : \"0\";\n optionsHash.put(option, value);\n }\n }",
"public ISysConfig getSysConfig() {\n ISysConfig sc = new DefaultSysConfig(SeqConfigNames.INSTRUMENT_CONFIG_NAME);\n\n // Fill in the current values.\n sc.putParameter(StringParameter.getInstance(ISPDataObject.VERSION_PROP, getVersion()));\n sc.putParameter(DefaultParameter.getInstance(DISPERSER_PROP.getName(), getDisperser()));\n sc.putParameter(DefaultParameter.getInstance(WAVELENGTH_PROP.getName(), getWavelength()));\n sc.putParameter(DefaultParameter.getInstance(EXPOSURE_TIME_PROP.getName(), getExposureTime()));\n sc.putParameter(DefaultParameter.getInstance(POS_ANGLE_PROP.getName(), getPosAngle()));\n sc.putParameter(DefaultParameter.getInstance(COADDS_PROP.getName(), getCoadds()));\n\n return sc;\n }",
"public static FileResult showSaveFileDialog() {\n\t\tJFileChooser chooser = new JFileChooser();\n\t\tchooser.setFileFilter(new FileFilter() {\n\t\t\t@Override\n\t\t\tpublic String getDescription() {\n\t\t\t\treturn \"Configuration files (.config)\";\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean accept(File f) {\n\t\t\t\treturn f.getName().endsWith(\".config\");\n\t\t\t}\n\t\t});\n\t\tboolean ok = JFileChooser.APPROVE_OPTION == chooser.showSaveDialog(null);\n\t\tFile file = chooser.getSelectedFile();\n\t\tif (ok && ! file.getName().endsWith(\".config\")) {\n\t\t\tfile = new File(file.getParent(), file.getName() + \".config\");\n\t\t}\n\t\treturn new FileResult(file, ok);\n\t}",
"void writeConfiguration(String fileName) throws IOException;",
"private final void config() {\n\t\tfinal File configFile = new File(\"plugins\" + File.separator\n\t\t\t\t+ \"GuestUnlock\" + File.separator + \"config.yml\");\n\t\tif (!configFile.exists()) {\n\t\t\tthis.plugin.saveDefaultConfig();\n\t\t\tMain.INFO(\"Created default configuration-file\");\n\t\t}\n\t}",
"public FormShortcutConfig(final IPluginContext context, final IPluginConfig config) {\n super(context, config);\n }"
] | [
"0.5635933",
"0.5445986",
"0.4966425",
"0.49253386",
"0.48274738",
"0.48162657",
"0.47802326",
"0.47174063",
"0.46291974",
"0.46057406",
"0.4565986",
"0.4556447",
"0.45330602",
"0.45111078",
"0.4493061",
"0.44880214",
"0.44437006",
"0.44096214",
"0.44091955",
"0.44066533",
"0.43735343",
"0.4354625",
"0.4349384",
"0.43432805",
"0.43047324",
"0.4302647",
"0.42928448",
"0.4287695",
"0.4281319",
"0.42749476",
"0.4271374",
"0.42572138",
"0.42454937",
"0.42404628",
"0.4232595",
"0.42195383",
"0.42166924",
"0.42165792",
"0.41940257",
"0.41911367",
"0.41866234",
"0.41729656",
"0.41725838",
"0.4168095",
"0.41671848",
"0.41631502",
"0.41566935",
"0.41523683",
"0.41485435",
"0.41478232",
"0.41315833",
"0.4127967",
"0.4125546",
"0.41206145",
"0.4117855",
"0.41118476",
"0.41024905",
"0.4099007",
"0.40988296",
"0.40915796",
"0.40907815",
"0.4090606",
"0.40901807",
"0.40865356",
"0.4076247",
"0.40752313",
"0.40701324",
"0.4061851",
"0.40598652",
"0.40555894",
"0.4054397",
"0.4052554",
"0.40499985",
"0.40496266",
"0.40455684",
"0.4038799",
"0.40376756",
"0.40265787",
"0.40260205",
"0.40238538",
"0.40133306",
"0.4012266",
"0.4011931",
"0.40108067",
"0.40072507",
"0.40041676",
"0.4002948",
"0.4002229",
"0.3997957",
"0.39960378",
"0.399366",
"0.39883226",
"0.39881676",
"0.3987964",
"0.3981564",
"0.3977665",
"0.39727944",
"0.39712745",
"0.3960348",
"0.39593646"
] | 0.76188755 | 0 |
Used to format the output folder as SwaggerHub expects it. | private String getOutputFolder(String path){
//Remove the portion of the path which is prior to our repositories file path
path = StringUtils.removeStart(FilenameUtils.getFullPath(path), REPOSITORY_LOCATION);
//Return the path without leading and ending / and ensures the file path uses forward slashes instead of backslashes
return StringUtils.strip(StringUtils.strip(path,"/"),"\\").replace("\\", "/");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void initializeOutputFolder() {\n\t\tString default_folder = PropertiesFile.getInstance().getProperty(\"default_folder\");\n\t\t\n\t\t// The file has to exist and is a directory (Not just a child file)\n\t\tString fullQualifiedFolderName = getFullyQualifiedFileName(default_folder);\n\t\tFile defaultDir = new File(fullQualifiedFolderName);\n\t\tif (!checkFolder(fullQualifiedFolderName)) {\n\t\t\tboolean dirCreated = defaultDir.mkdir();\n\t\t\tif(dirCreated == false) {\n\t\t\t\tlog.error(\"Could not create generation folder\");\n\t\t\t}\n\t\t} else\n\t\t\tdeleteFolderRecursively(defaultDir);\n\t}",
"public void writeOutput() {\n // Create json object to be written\n Map<String, Object> jsonOutput = new LinkedHashMap<>();\n // Get array of json output objects for consumers\n List<Map<String, Object>> jsonConsumers = writeConsumers();\n // Add array for consumers to output object\n jsonOutput.put(Constants.CONSUMERS, jsonConsumers);\n // Get array of json output objects for distributors\n List<Map<String, Object>> jsonDistributors = writeDistributors();\n // Add array for distributors to output objects\n jsonOutput.put(Constants.DISTRIBUTORS, jsonDistributors);\n // Get array of json output objects for producers\n List<Map<String, Object>> jsonProducers = writeProducers();\n // Add array for producers to output objects\n jsonOutput.put(Constants.ENERGYPRODUCERS, jsonProducers);\n // Write to output file and close\n try {\n ObjectMapper mapper = new ObjectMapper();\n ObjectWriter writer = mapper.writer(new DefaultPrettyPrinter());\n writer.writeValue(Paths.get(outFile).toFile(), jsonOutput);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public File getOutput(){\n return outputDir;\n }",
"public Path getOutputPath() {\n\t\t\n\t\tString name = getSimulationName();\t\t\n\t\tint l = name.length();\n\t\tString sim_name = name.substring(0, l-11); // \"_SIM_FOLDER\" contains 11 character\n\t\t\n\t\tPath path = Paths.get(outpath + \"\\\\\"+ sim_name);\n\t\tif(!Files.exists(path)) {\n\t\t try {\n\t\t Files.createDirectories(path);\n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t }\n\t\t}\n\t\treturn path;\n\t}",
"public static String getGeneratorOutputFolder() {\n\t\treturn getOutputFolderName() + \"/\" + PropertiesFile.getInstance().getProperty(\"output_qualifier\");\n\t}",
"public String formatFilePath(){\n StringBuilder returnResult = new StringBuilder();\n String temp;\n temp = StringUtil.removeHttpPrefix(uri);\n returnResult.append(DEFAULT_DIRECTORY).append(\"\\\\\").append(temp);\n return returnResult.toString();\n }",
"public folderize() {\n }",
"static Path improvedOutputDirectory(CalcConfig config) {\n Path out = config.output.directory;\n if (out.toString().equals(CalcConfig.DEFAULT_OUT)) {\n return (config.rate.valueFormat == ValueFormat.POISSON_PROBABILITY) ? Paths.get(\"eq-prob\")\n : Paths.get(\"eq-rate\");\n }\n return out;\n }",
"private void writeToFiles(Context resultContext) throws IOException {\n\t\tMap<String, Map<Object, ArrayList<Object>>> keyValMappingByBaseOutputPath = resultContext.getKeyValMappingsByBaseOutputPath(); \n\t\t//Write key & value to each baseOutputPath's \n\t\tPath targetOutputDir = null;\n\t\tMap<Object, ArrayList<Object>> keyValMapping = null;\n\t\tPath finalOutputBaseDir = this.config.getFinalOutputDir();\n\t\tfor (String baseOutputPath: keyValMappingByBaseOutputPath.keySet()) {\n\t\t\tif (baseOutputPath.equals(\"\")) {\n\t\t\t\t//Regular output goes into the mapper output buffer directory.\n\t\t\t\ttargetOutputDir = this.config.getMapOutputBufferDir();\n\t\t\t}else {\n\t\t\t\t//Multiple output to a particular outputPath which was \n\t\t\t\t//specified by user goes into the final output directory. \n\t\t\t\ttargetOutputDir = Paths.get(finalOutputBaseDir.toString(), baseOutputPath);\n\t\t\t}\n\t\t\tkeyValMapping = keyValMappingByBaseOutputPath.get(baseOutputPath);\n\t\t\tthis.writeEachMapping(targetOutputDir, keyValMapping);\n\t\t};\n\t}",
"public static String getOutputFolderName() {\n\t\treturn PropertiesFile.getSystemRoot()+PropertiesFile.getInstance().getProperty(\"default_folder\");\n\t}",
"public String getOutputFolder() {\n return txtOutputFolder().getText();\n }",
"private void createOutputFiles(){\n\t\tFile folder = new File(C.appFolderPath + C.DEBUG_FOLDER);\n\t\tboolean success = true;\n\t\tif(folder.exists()){\n\t\t\t// erase the folder\n\t\t\tDeleteRecursive(folder);\n\t\t}\n\t\t\n\t\t// create necessary folders\n\t\tif (!folder.exists()) {\n\t\t success = folder.mkdir();\n\t\t Log.d(C.LOG_TAG, \"folder is not existed, create one\");\n\t\t} else {\n\t\t\tLog.e(C.LOG_TAG, \"ERROR: folder has not been deleted\");\n\t\t}\n\t\tFile monitorFolder = new File(C.appFolderPath + C.DEBUG_FOLDER + logFolder);\n\t\tmonitorFolder.mkdir();\n\n\t\ttry {\n\t\t\tmMatlabOutFile = new PrintWriter(new FileOutputStream(new File(C.appFolderPath+ C.DEBUG_FOLDER +\"matlab.txt\"),true));\n\t\t\tmMatlabOutFile.println(inputPrefix+audioSettingName);\n\t\t\tmMatlabOutFile.println(RECODER_CHANNEL_CNT);\n\t\t\tmMatlabOutFile.println(C.DEFAULT_VOL);\n\t\t\tmMatlabOutFile.close();\n\t\t\tmMatlabOutFile = null;\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(C.LOG_TAG, \"ERROR: can't open sensor file to write\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public Path outputDir() {\n return dir;\n }",
"public void handleOutput(String outputFolder) {\n\t\t\n\t\tFile source = new File(getFolder()+File.separator+outputFolder);\n\t\tif(source.isDirectory()){\n\t\t\t// get results\n\t\t\tFile file = new File(source+File.separator+Feedback.OUTPUT_FILE);\n\t\t\tif(file.isFile()){\n\t\t\t\tlogger.debug(Module.COMMAND, \"Collecting Feedback: \"+file.getAbsolutePath());\n\t\t\t\ttry{\n\t\t\t\t\tFeedback feedback = new Feedback();\n\t\t\t\t\tfeedback.deserialize(file.getAbsolutePath());\n\t\t\t\t\tfor(Result result : feedback.results){\n\t\t\t\t\t\tresultManager.addResult(result);\n\t\t\t\t\t}\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tlogger.error(Module.COMMAND, e);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// copy output\n\t\t\tFile destination = new File(historyFolder+File.separator+outputFolder);\n\t\t\tif(destination.mkdirs()){\n\t\t\t\tlogger.debug(Module.COMMAND, \"Collecting Output: \"+source.getAbsolutePath());\n\t\t\t\ttry{\n\t\t\t\t\tFileTools.copyFolder(source.getAbsolutePath(), destination.getAbsolutePath());\n\t\t\t\t\tartifacts.add(new Artifact(\"Output [\"+outputFolder+\"]\", destination));\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tlogger.error(Module.COMMAND, e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public String getDirectoryPath() { return DirectoryManager.OUTPUT_RESULTAT + \"/\" + directoryName;}",
"public void createModuleGeneratedXMLPath() {\n\t\tString[] onlyFolderNames = new String[] {\n\t\t\tmInstance.getModuleGeneratedXMLPath(),\n\t\t\tmModuleName\n\t\t};\n\t\t\n\t\tmModuleGeneratedXMLPath = StringUtils.makeFilePath (onlyFolderNames, false);\n\t}",
"interface WithOutputDirectories {\n /**\n * Specifies outputDirectories.\n * @param outputDirectories the outputDirectories parameter value\n * @return the next definition stage\n */\n WithCreate withOutputDirectories(List<OutputDirectory> outputDirectories);\n }",
"private void cleanOutputFolder(String output) {\n \t\tFile[] files = new File[1];\n \t\tfiles[0] = new File(output);\n \t\tcleanFolder(files);\n \t}",
"@OutputDirectory\n public File getDestinationDir() {\n return _destinationDir;\n }",
"public String getOutputSubdir() {\n return m_optionalOutputSubDir;\n }",
"public String getPrideOutputFolder() {\n\n \n return prideOutputFolder;\n\n }",
"private static void exportResource(String resourcePathName, File outFolder) throws Exception {\n InputStream stream = null;\n try {\n // note that each / is a directory down in the \"jar tree\" been the jar the root of the\n // tree\n stream = DeployManagementModuleFlow.class.getResourceAsStream(resourcePathName);\n if (stream == null) {\n throw new Exception(\"Cannot get resource \\\"\" + resourcePathName\n + \"\\\" from Jar file.\");\n }\n File outFile = new File(outFolder, new File(resourcePathName).getName());\n outFile.getParentFile().mkdirs();\n Files.copy(stream, outFile.toPath());\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n }",
"void setOutputPath(String outputPath);",
"public String getOutputDirectory() {\n return outputDirectory;\n }",
"public static String getOutputFolderName(String analysisType) {\n\t\tString outputFolderName;\n\t\tif(analysisType.equals(\"NCI\")) outputFolderName = \"NorthCarolinaI\" ;\n\t\telse if(analysisType.equals(\"NCII\")) outputFolderName = \"NorthCarolinaII\" ;\n\t\telse if(analysisType.equals(\"NCIII\")) outputFolderName = \"NorthCarolinaIII\" ;\n\t\telse if(analysisType.equals(\"TripleTestCross\"))outputFolderName = \"TripleTestCross\";\n\t\telse if(analysisType.equals(\"GriffingI\")) outputFolderName = \"DiallelGMI\";\n\t\telse if(analysisType.equals(\"GriffingII\")) outputFolderName = \"DiallelGMII\";\n\t\telse if(analysisType.equals(\"GriffingIII\")) outputFolderName = \"DiallelGMIII\";\n\t\telse if(analysisType.equals(\"GriffingIV\")) outputFolderName = \"DiallelGMIV\";\n\t\telse if(analysisType.equals(\"SingleEnv\"))outputFolderName = \"SingleSite\";\n\t\telse if(analysisType.equals(\"twoStageMultiEnv\")) outputFolderName = \"TwoStageMultiSite\";\n\t\telse if(analysisType.equals(\"oneStageMultiEnv\"))outputFolderName = \"OneStageMultiSite\";\n\t\telse if(analysisType.equals(\"GMASummaryStat\")) outputFolderName = \"GenerationMean\";\n\t\telse if(analysisType.equals(\"GMARawData\")) outputFolderName = \"GenerationMeanRawData\";\n\t\telse if(analysisType.equals(\"QTL\")) outputFolderName = \"QTL\";\n\t\telse if(analysisType.equals(\"selectionIndex\")) outputFolderName = \"SelectionIndex\";\n\t\telse if(analysisType.equals(\"stabilityModels\")) outputFolderName = \"stabilityModels\"; \n\t\telse if(analysisType.equals(\"MultiplicativeModels\")) outputFolderName = \"MultiplicativeModels\"; \n\t\telse if(analysisType.equals(\"GeneralLinearModel\")) outputFolderName = \"GeneralLinearModel\";\n\t\telse outputFolderName = \"unknown analysis\";\n\t\t\n\t\treturn \"(\"+ outputFolderName+\"_\"+DataManipulationManager.getTimeStamp()+\")\\\\\";\n\t}",
"public String outputFileDir() {\n return outputFileDir;\n }",
"public File toOutputFile(File source, String basePath, String outName) {\n String path = basePath != null ? basePath : source.getParent();\r\n if (path == null) path = \"\";\r\n // if the configured path is absolute we take it, otherwise we append it\r\n if (directory != null && directory.startsWith(File.separator)) {\r\n path = directory;\r\n }\r\n if (directory != null) {\r\n if (path.length() > 0) {\r\n path += File.separator + directory;\r\n } else {\r\n path += directory;\r\n }\r\n }\r\n // setting the name\r\n path += File.separator + buildName(FilenameUtils.getBaseName(source.getName()), name != null ? name : outName, namePrefix, nameSuffix);\r\n\r\n return FileUtil.newFile(path);\r\n }",
"public File getOutputDirectory() {\n\t\treturn outputDirectory;\n\t}",
"private void markOutputDirSuccessful(JobContext context) throws IOException {\r\n JobConf conf = context.getJobConf();\r\n // get the o/p path\r\n Path outputPath = FileOutputFormat.getOutputPath(conf);\r\n if (outputPath != null) {\r\n // get the filesys\r\n FileSystem fileSys = outputPath.getFileSystem(conf);\r\n // create a file in the output folder to mark the job completion\r\n Path filePath = new Path(outputPath, SUCCEEDED_FILE_NAME);\r\n fileSys.create(filePath).close();\r\n }\r\n }",
"static void createOutputStructure(final File dir) throws MojoExecutionException {\n if (!dir.exists() && !dir.mkdirs()) {\n throw new MojoExecutionException(\"could not create output directory \" + dir.getAbsolutePath());\n }\n }",
"private void createDirectories()\r\n\t{\r\n\t\t// TODO: Do some checks here\r\n\t\tFile toCreate = new File(Lunar.OUT_DIR + Lunar.PIXEL_DIR\r\n\t\t\t\t\t\t\t\t\t+ Lunar.PROCESSED_DIR);\r\n\t\ttoCreate.mkdirs();\r\n\t\ttoCreate = null;\r\n\t\ttoCreate = new File(Lunar.OUT_DIR + Lunar.ROW_DIR + Lunar.PROCESSED_DIR);\r\n\t\ttoCreate.mkdirs();\r\n\t\ttoCreate = null;\r\n\t}",
"@Override\n protected void createRootDir() {\n }",
"private static void setOutputProcessor(File outputDir, Launcher spoon, Environment environment) {\n JavaOutputProcessor outProcessor = spoon.createOutputWriter(); // Spoon 8\r\n environment.setDefaultFileGenerator(outProcessor); // Define output folder (needed for the output type: classes)\r\n\r\n // spoon.setOutputDirectory(IoUtils.getCanonicalPath(outputDir)); // Define output folder AGAIN (needed for the\r\n spoon.setSourceOutputDirectory(SpecsIo.getCanonicalPath(outputDir));// Define output folder AGAIN\r\n spoon.setBinaryOutputDirectory(SpecsIo.getCanonicalPath(outputDir)); // Define output folder AGAIN (needed for\r\n }",
"public String getOutputPath() {\n\t\treturn outputPath;\n\t}",
"private boolean shouldMarkOutputDir(JobConf conf) {\r\n return conf.getBoolean(SUCCESSFUL_JOB_OUTPUT_DIR_MARKER, true);\r\n }",
"public String getOutputPath()\n {\n return __m_OutputPath;\n }",
"public void writeToDir() {\n\t\ttry{\n\t\t\tString dirPath = Paths.get(\".\").toAbsolutePath().normalize().toString()+\"/\";\n\t\t\tString path = dirPath + filename; //get server dir path\n\t\t\tSystem.out.println(\"output file path is: \" + path);\n\t\t\tFileOutputStream out = new FileOutputStream(path);\n out.write(img);\n out.close();\n PL.fsync();\n\t\t}catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n\tpublic void generateDirectories() {\n\t\tFile file = new File(\"Data/My Contacts/\");\n\n\t\tif (!file.exists()) {\n\t\t\tfile.mkdirs();\n\t\t}\n\t}",
"protected void createHMetisOutFilePath() {\n\t\tString file = \"\";\n\t\tfile += \"TEMP_GRAPH_FILE.hgr.part.\";\n\t\tfile += this.getPartitioner().getPartition().getNumBlock();\n\t\tthis.setHMetisOutFile(file);\t\n\t}",
"@BeforeClass\n public static void createOutputDir() throws OfficeException {\n\n // Ensure we start with a fresh output directory\n final File outputDir = new File(OUTPUT_DIR);\n FileUtils.deleteQuietly(outputDir);\n outputDir.mkdirs();\n }",
"private void outputFolderButtonActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser chooser = new JFileChooser();\n chooser.setDialogTitle(\"Select Output Folder\");\n chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n File workingDirectory = new File(System.getProperty(\"user.dir\"));\n chooser.setCurrentDirectory(workingDirectory);\n if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {\n outputFile = chooser.getSelectedFile();\n outputFolderLabel.setText(getFileName(chooser.getSelectedFile()));\n }\n }",
"@Override\n public void setOutputDir(String outputDir) {\n this.outputDir = outputDir;\n }",
"@Nullable\n @Override\n public IFile getOutputRoot() {\n return myTempModuleLocation.findChild(\"src_gen\");\n }",
"private String getOutputFileName(JCas pJCas) {\n String returnValue = null;\n \n String name = getSourceName(pJCas);\n \n if ((this.outputProjectDirectorySaved.startsWith(\"/\")) || (this.outputProjectDirectorySaved.startsWith(\"\\\\\"))\n || (this.outputProjectDirectorySaved.indexOf(\":\") == 1))\n returnValue = this.outputProjectDirectorySaved + \"/\" + name + \".txt.knowtator.xml\";\n else\n returnValue = this.homeDir + \"/\" + this.eHostWorkSpaceName + \"/\" + this.projectName + \"/saved/\" + name\n + \".txt.knowtator.xml\";\n \n return returnValue;\n }",
"public void setOutputFolder(String text) {\n txtOutputFolder().setText(text);\n }",
"interface WithOutputDirectories {\n /**\n * Specifies outputDirectories.\n * @param outputDirectories the outputDirectories parameter value\n * @return the next update stage\n */\n Update withOutputDirectories(List<OutputDirectory> outputDirectories);\n }",
"public void generateOutputFile(String inputFile) {\n\n String outputFile = properties.getProperty(\"output.directory\")\n + properties.getProperty(\"output.file.distinct\");\n\n\n try (PrintWriter out = new PrintWriter(new BufferedWriter(\n new FileWriter(outputFile)))){\n\n loopThroughTokens(out);\n\n\n } catch (FileNotFoundException fileNotFound) {\n fileNotFound.printStackTrace();\n } catch (IOException inputOutputException) {\n inputOutputException.printStackTrace();\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n }",
"public static void createOutputDirectoryPath(String path){\n \n new File(path).mkdirs();\n \n }",
"public File transform(final Swagger swagger) throws Exception {\n\t\tapplication.getDoc().add(addDoc(swagger.getInfo().getTitle(), swagger.getInfo().getDescription()));\n\t\tResources resources = objectFactory.createResources();\n\t\tapplication.getResources().add(resources);\n\n\t\t/**\n\t\t * look for end point URL This is required for AI\n\t\t */\n\t\tString protocol = \"\";\n\n\t\tString baseURI = null;\n\t\tif (swagger.getHost() != null) {\n\t\t\tbaseURI = swagger.getHost();\n\t\t}\n\t\tif (null != baseURI && (!baseURI.contains(ParserConstants.http.toString()) || !baseURI.contains(ParserConstants.https.toString()))) {\n\t\t\tif (null != swagger.getSchemes() && swagger.getSchemes().size() > 0) {\n\t\t\t\tprotocol = swagger.getSchemes().get(0).toString() + \"://\";\n\t\t\t\tprotocol = protocol.toLowerCase();\n\t\t\t} else {\n\t\t\t\tprotocol = ParserConstants.http.value();\n\t\t\t}\n\t\t}\n\t\tString basePath = \"\";\n\t\tif (null != swagger.getBasePath() && !swagger.getBasePath().isEmpty()) {\n\t\t\tbasePath = swagger.getBasePath();\n\t\t}\n\n\t\tif (null != baseURI) {\n\t\t\tresources.setBase(protocol + baseURI + basePath);\n\t\t}\n\t\t\n\t\tif(null!=resources.getBase()){\n\t\t\tlogger.info(\"end point : \" + resources.getBase());\n\t\t}else{\n\t\t\tthrow new Exception(\"End point URL not present\");\n\t\t}\n\t\t/**\n\t\t * enumerates different parameters type such as headers,query\n\t\t */\n\t\tfor (Map.Entry<String, Path> path : swagger.getPaths().entrySet()) {\n\t\t\tResource resource = objectFactory.createResource();\n\t\t\tresource.setId(path.getKey().replace('/', '_').replace('{', '_').replace('}', '_'));\n\t\t\tresource.setPath(path.getKey());\n\n\t\t\tif (path.getValue().getParameters() != null) {\n\t\t\t\tfor (Parameter param : path.getValue().getParameters()) {\n\t\t\t\t\tParam params = objectFactory.createParam();\n\t\t\t\t\tparams.setName(param.getName());\n\t\t\t\t\tparams.getDoc().add(addDoc(param.getName(), param.getDescription()));\n\t\t\t\t\tparams.setStyle(ParamStyle.fromValue(param.getIn()));\n\t\t\t\t\tparams.setRequired(param.getRequired());\n\t\t\t\t\tparams.setType(new QName(\"\"));\n\t\t\t\t\tresource.getParam().add(params);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * check for operation name, resource base etc.\n\t\t\t */\n\t\t\tfor (Entry<HttpMethod, Operation> op : path.getValue().getOperationMap().entrySet()) {\n\t\t\t\tMethod method = objectFactory.createMethod();\n\t\t\t\tmethod.getDoc().add(addDoc(op.getValue().getOperationId(), op.getValue().getSummary()));\n\t\t\t\tmethod.setId(op.getValue().getOperationId());\n\t\t\t\tmethod.setName(op.getKey().name().toUpperCase());\n\n\t\t\t\tRequest req = objectFactory.createRequest();\n\t\t\t\t/**\n\t\t\t\t * check tyoe of request, namespace etc.\n\t\t\t\t */\n\t\t\t\tif (op.getValue().getConsumes() != null) {\n\t\t\t\t\tfor (String mime : op.getValue().getConsumes()) {\n\t\t\t\t\t\tRepresentation representation = objectFactory.createRepresentation();\n\t\t\t\t\t\trepresentation.setElement(new QName(ParserConstants.tns_prefix.value() + path.getKey()));\n\t\t\t\t\t\trepresentation.setMediaType(mime);\n\t\t\t\t\t\treq.getRepresentation().add(representation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (op.getValue().getParameters() != null) {\n\t\t\t\t\tfor (Parameter param : op.getValue().getParameters()) {\n\t\t\t\t\t\tParam parameter = null;\n\t\t\t\t\t\tparameter = objectFactory.createParam();\n\t\t\t\t\t\tparameter.setName(param.getName());\n\t\t\t\t\t\tparameter.getDoc().add(addDoc(param.getName(), param.getDescription()));\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * check input parameter type like header, query etc.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (null != param.getIn() && (param.getIn().equalsIgnoreCase(ParserConstants.query.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.header.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.template.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.matrix.toString())\n\t\t\t\t\t\t\t\t|| param.getIn().equalsIgnoreCase(ParserConstants.plain.toString()))) {\n\t\t\t\t\t\t\tparameter.setStyle(ParamStyle.fromValue(param.getIn()));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparameter.setRequired(param.getRequired());\n\t\t\t\t\t\tparameter.setType(new QName(\"\"));\n\t\t\t\t\t\treq.getParam().add(parameter);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//set the request\n\t\t\t\tmethod.setRequest(req);\n\n\t\t\t\t//set the response\n\t\t\t\tResponse res = objectFactory.createResponse();\n\t\t\t\tfor (String mime : op.getValue().getProduces()) {\n\t\t\t\t\tRepresentation representation = objectFactory.createRepresentation();\n\t\t\t\t\trepresentation.setElement(new QName(ParserConstants.tns_prefix.value() + path.getKey()));\n\t\t\t\t\trepresentation.setMediaType(mime);\n\t\t\t\t\tres.getRepresentation().add(representation);\n\t\t\t\t}\n\t\t\t\tfor (Entry<String, io.swagger.models.Response> response : op.getValue().getResponses().entrySet()) {\n\t\t\t\t\tres.getDoc().add(addDoc(response.getKey(), response.getValue().getDescription()));\n\t\t\t\t}\n\t\t\t\tmethod.getResponse().add(res);\n\t\t\t\tresource.getMethodOrResource().add(method);\n\t\t\t}\n\t\t\tresources.getResource().add(resource);\n\t\t}\n\n\t\tfor (Entry<String, Model> def : swagger.getDefinitions().entrySet()) {\n\t\t\tif (null != def.getValue().getProperties())\n\t\t\t\tschema.appendChild(js2wadl(def.getKey(), def.getValue().getProperties()));\n\t\t}\n\n\t\t/**\n\t\t * by default store the converted swagger into file\n\t\t */\n\t\tJAXBContext jaxbContext = JAXBContext.newInstance(ParserConstants.jaxb_tns.value());\n\t\tMarshaller marshaller = jaxbContext.createMarshaller();\n\t\tmarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true));\n\t\tFile file = new File(ParserConstants.File_Name.value());\n\t\tmarshaller.marshal(application, file);\n\t\treturn file;\n\t}",
"@Test\n\tpublic void testSetGetOutputFileFolder() {\n\t\tString path = \"a\" + File.separator + \"path\";\n\t\toutput.setOutputFileFolder(path);\n\t\tboolean result = output.getOutputFileFolder() != null &&\n\t\t\t\toutput.getOutputFileFolder() == path;\n\t\tassertTrue(result);\n\t}",
"private void write(){\n\t\ttry {\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(doc);\n\t\t\t\n\t\t\tString pathSub = ManipXML.class.getResource(path).toString();\n\t\t\tpathSub = pathSub.substring(5, pathSub.length());\n\t\t\tStreamResult result = new StreamResult(pathSub);\n\t\t\t\n\t\t\ttransformer.transform(source, result);\n\t\t} catch (TransformerConfigurationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (TransformerException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public File getDefaultOutputDir() {\n File out = _mkdir(XPreferencesFactory.kDefaultReportsOutputDir.getDir(false));\r\n String dn = NamingConventions.createNiceEnglishDate_for_dirs();\r\n return _mkdir(new File(out, dn));\r\n }",
"public static String getOutputDir() {\n outputDir = getProperty(\"outputDir\");\n if (outputDir == null) outputDir = \"./\";\n return outputDir;\n }",
"public String getOutputPath(String inputPath) {\n String fileName;\n String ext = \"\";\n if (inputPath.indexOf(\".\") > 0) {\n int dotIndex = inputPath.lastIndexOf(\".\");\n fileName = inputPath.substring(0, dotIndex);\n ext = inputPath.substring(dotIndex, inputPath.length());\n } else {\n fileName = inputPath;\n }\n return fileName + \"_chk\" + ext;\n }",
"private void createRequiredDirectory(String outdir, String className) throws IOException\r\n\t{\n\t\tString workingdirectory = System.getProperty(\"user.dir\");\r\n\t\t\r\n\t\t//used to create directory\r\n\t\tscreenshotDir = new File(workingdirectory +\"/custom-test-report\");\r\n\t\tscreenshotDir.mkdir();\r\n\t\t\r\n\t\tscreenshotDir = new File(workingdirectory +\"/custom-test-report/Failure_Screenshot\");\r\n\t\tscreenshotDir.mkdir();\r\n\t\t\r\n\t\tscreenshotDir = new File(workingdirectory + \"/custom-test-report\" + \"/\" + className);\r\n\t\tscreenshotDir.mkdir();\r\n\t}",
"public final File getValidationOutputFolder() {\n\t\treturn validationOutputFolder;\n\t}",
"public abstract String FileOutput();",
"public void setOutput(File file){\n outputDir = file;\n }",
"public static String getOutputFolder() {\n\n if ((m_sOutputFolder == null) || m_sOutputFolder.trim().equals(\"\")) {\n return System.getProperty(\"user.home\");\n }\n else {\n return m_sOutputFolder;\n }\n\n }",
"@Override\n\tpublic String generatePathStr(String component,\n\t\t\tString outputName) throws RemoteException {\n\t\treturn \"/user/\" + userName + \"/tmp/redsqirl_\" + component + \"_\" + outputName\n\t\t\t\t+ \"_\" + RandomString.getRandomName(8)+\".txt\";\n\t}",
"private void createresultDir() throws IOException\n\t{\n\t\tString datepattern = \"yyyy-MM-dd\";\n\t\tSimpleDateFormat sdf =new SimpleDateFormat(datepattern);\n\t\t RESULTDIR = Parameters.RESULT_LOCAL_DIR+'/'+sdf.format(new Date());\n\t\t boolean exists = (new File(Parameters.RESULT_LOCAL_DIR)).exists();\n\t\t if (!exists)\n\t\t\t (new File(Parameters.RESULT_LOCAL_DIR)).mkdirs();\n\t\t exists = (new File(RESULTDIR)).exists();\n\t\t if (!exists)\n\t\t\t (new File(RESULTDIR)).mkdirs();\n\t\t boolean append = true;\n\t FileHandler fh = new FileHandler(RESULTDIR+\"/report.log\", append);\n\t fh.setFormatter(new LogFormatter());\n\t logfile.addHandler(fh);\n\t}",
"public static File createOutputFolder(String fileName, String analysisType) {\n\t\tProjectExplorerManager projExpMan = new ProjectExplorerManager();\n\t\t\n\t\tString dataFileName = fileName.replaceAll(\".csv\", \"\");\n\t\tString outputFolderPath = ((ProjectExplorerTreeNodeModel)projExpMan.getOutputFolder(ProjectExplorerView.projectTree).getData()).getProjectFile().getAbsolutePath();\n\t\tString newFolderName = getOutputFolderName(analysisType);\n\t\t\n\t\tFile outputFolder = new File(outputFolderPath+\"//\"+dataFileName+newFolderName);\n\t\tif(!outputFolder.exists()) outputFolder.mkdir();\n\t\t\n\t\treturn outputFolder;\n\t}",
"public static void writeToFile(String context, String outputFileName) throws IOException {\n KubernetesDataHolder dataHolder = KubernetesContext.getInstance().getDataHolder();\n outputFileName = dataHolder.getOutputDir() + File\n .separator + extractBalxName(dataHolder.getBalxFilePath()) + outputFileName;\n DeploymentModel deploymentModel = dataHolder.getDeploymentModel();\n JobModel jobModel = dataHolder.getJobModel();\n // Priority given for job, then deployment.\n if (jobModel != null && jobModel.isSingleYAML()) {\n outputFileName =\n dataHolder.getOutputDir() + File.separator + extractBalxName(dataHolder.getBalxFilePath()) + YAML;\n } else if (jobModel == null && deploymentModel != null && deploymentModel.isSingleYAML()) {\n outputFileName =\n dataHolder.getOutputDir() + File.separator + extractBalxName(dataHolder.getBalxFilePath()) + YAML;\n \n }\n File newFile = new File(outputFileName);\n // append if file exists\n if (newFile.exists()) {\n Files.write(Paths.get(outputFileName), context.getBytes(StandardCharsets.UTF_8), StandardOpenOption.APPEND);\n return;\n }\n //create required directories\n if (newFile.getParentFile().mkdirs()) {\n Files.write(Paths.get(outputFileName), context.getBytes(StandardCharsets.UTF_8));\n return;\n }\n Files.write(Paths.get(outputFileName), context.getBytes(StandardCharsets.UTF_8));\n }",
"public String getOutputPath () \n\t{\n\t\treturn outputPathTextField.getText();\n\t}",
"private String formatRootPathForDisplay(File root) {\n\t\t\tString s = root.getPath();\n\t\t\treturn s.length() > 1 && s.endsWith(\"\\\\\") ? s.substring(0, s.length() - 1) : s;\n\t\t}",
"public Path getOutputBase() {\n return outputBase;\n }",
"void setOutputFormat(String outputFormat);",
"@OutputDirectory\n public DirectoryProperty getObjectFileDir() {\n return objectFileDir;\n }",
"public String getOutputFilePath() {\t\n\t\treturn outputFilePath; \n\t}",
"public void setPrideOutputFolder(String prideOutputFolder) {\n \n this.prideOutputFolder = prideOutputFolder;\n\n }",
"@Override\n\tpublic void pathGenerated() {\n\n\t}",
"static void writePublicResources(File moduleOutputDir, ModuleDef module,\n TreeLogger compileLogger) throws UnableToCompleteException, IOException {\n ResourceOracleImpl publicResources = module.getPublicResourceOracle();\n for (String pathName : publicResources.getPathNames()) {\n File file = new File(moduleOutputDir, pathName);\n File parent = file.getParentFile();\n if (!parent.isDirectory() && !parent.mkdirs()) {\n compileLogger.log(Type.ERROR, \"cannot create directory: \" + parent);\n throw new UnableToCompleteException();\n }\n Files.asByteSink(file).writeFrom(publicResources.getResourceAsStream(pathName));\n }\n }",
"private static void prepareOutputFile() {\n try {\n outputFileBuffer = new BufferedWriter(new FileWriter(PATH+OUTPUT_FILE_NAME));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void cleanFolder(File outputFolder)\n {\n File[] files = outputFolder.listFiles();\n for (File file : files)\n {\n if (file.isDirectory())\n {\n cleanFolder(file);\n }\n else\n {\n if (file.delete())\n {\n Main.out(\"Deleted: \" + file);\n }\n else\n {\n Main.warn(\"Failed to delete file: \" + file);\n }\n }\n }\n }",
"@SuppressWarnings(\"unused\")\n public void SaveJsonCollectionsToFiles(){\n try {\n String formattedDate = FileNameUtils.DATE_FORMAT.format(new Date());\n ObjectWriter writer = mapper.writer(new DefaultPrettyPrinter());\n writer.writeValue(new File(FileNameUtils.GetValuesFileName(formattedDate)), jsonObjects);\n }\n catch(IOException exp){\n System.err.println(\"Error while creating JSON file. Reason: \" + exp.getMessage());\n }\n }",
"public File getOutputFilePath() {\n return outputFile;\n }",
"@Nullable\n @Override\n public Path getPathToOutputFile() {\n return null; // I mean, seriously? OK.\n }",
"private void toFile(OutputData data) {\n if(data == null) {\r\n JOptionPane.showMessageDialog(this, \"Dane wynikowe nie zostały jeszcze umieszczone w pamieci\");\r\n return;\r\n }\r\n\r\n // Sprawdzenie sciezki zapisu\r\n String filePath = this.outputFileSelector.getPath();\r\n if(filePath.length() <= 5) {\r\n JOptionPane.showMessageDialog(this, \"Nie można zapisać wyniku w wybranej lokacji!\");\r\n return;\r\n }\r\n\r\n // Zapisujemy plik na dysk\r\n try{\r\n PrintWriter writer = new PrintWriter(filePath, \"UTF-8\");\r\n OutputDataFormatter odf = new OutputDataFormatter(this.outputData);\r\n\r\n String userPattern = this.outputFormatPanel.getPattern();\r\n writer.write(odf.getParsedString(userPattern.length() < 2 ? defaultFormatting : userPattern));\r\n\r\n writer.close();\r\n } catch (IOException e) {\r\n JOptionPane.showMessageDialog(this, \"Wystąpił błąd IO podczas zapisu.\");\r\n }\r\n\r\n }",
"public static String buildPathToTestOutputDir(String relpath) {\n return String.format(\"%s/src/test/resources/test_output/%s\", System.getProperty(\"user.dir\"), relpath);\n }",
"@Override\n public void fileGenerated(@NotNull String outputRoot, @NotNull String relativePath) {\n IntelliJEvent e = new IntelliJEvent(System.currentTimeMillis(), TYPE, \"file_generated\");\n e.addExtraData(\"root\", StringUtil.md5Encode(outputRoot));\n e.addExtraData(\"path\", StringUtil.md5Encode(relativePath));\n Persistence.getInstance().add(e);\n }",
"@Test\r\n public void exportGeneratorName() throws Exception\r\n {\n Document doc = new Document();\r\n \r\n // Use https://docs.aspose.com/words/net/generator-or-producer-name-included-in-output-documents/ to know how to check the result.\r\n OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(); { saveOptions.setExportGeneratorName(false); }\r\n \r\n doc.save(getArtifactsDir() + \"OoxmlSaveOptions.ExportGeneratorName.docx\", saveOptions);\r\n //ExEnd\r\n }",
"public File generateMarshaller(Class<?> type, List<PropertyDescriptor> propertyDescriptors, SerializationStrategy serializationStrategy, File outputFolder)\r\n\t\t\tthrows IOException {\n\t\tList<PropertyDescriptor> propertyDescriptorsCopy = new ArrayList<PropertyDescriptor>(propertyDescriptors);\r\n\t\tCollections.sort(propertyDescriptorsCopy);\r\n\r\n\t\tString packageName = type.getPackage() != null ? type.getPackage().getName() : \"lightning\";\r\n\t\tString className = type.getName().replace(packageName + \".\", \"\") + \"LightningGeneratedMarshaller\";\r\n\r\n\t\tFile packageFolder = new File(outputFolder, packageName.replace(\".\", \"/\"));\r\n\t\tif (!packageFolder.exists()) {\r\n\t\t\tpackageFolder.mkdirs();\r\n\t\t}\r\n\r\n\t\tFile outputFile = new File(packageFolder, className + \".java\");\r\n\r\n\t\tlogger.info(\"Generating source :\" + outputFile.getAbsolutePath());\r\n\r\n\t\tFileOutputStream stream = new FileOutputStream(outputFile);\r\n\t\tOutputStreamWriter writer = new OutputStreamWriter(stream, charset);\r\n\r\n\t\tVelocityContext context = new VelocityContext();\r\n\r\n\t\tcontext.put(\"support\", new Support());\r\n\t\tcontext.put(\"packageName\", packageName);\r\n\t\tcontext.put(\"className\", className);\r\n\t\tcontext.put(\"properties\", propertyDescriptorsCopy);\r\n\t\tcontext.put(\"strategy\", serializationStrategy.name());\r\n\r\n\t\tmarshallerTemplate.merge(context, writer);\r\n\r\n\t\twriter.flush();\r\n\t\twriter.close();\r\n\r\n\t\treturn outputFile;\r\n\t}",
"private void exportConfiguration() {\n if (!Files.exists(languageConfigPath)) this.saveResource(\"language.yml\", false);\n if (!Files.exists(propertiesConfigPath)) this.saveResource(\"properties.yml\", false);\n }",
"private void manageDirectories() throws IOException {\n\t\tFileManager.copyFolder(RefactoringPlugin.getDynamicRefactoringsDir(),\n\t\t\t\t\"./testdata/XML/Writer/availableRefactorings\");\n\t\tFileManager.emptyDirectories(RefactoringPlugin\n\t\t\t\t.getDynamicRefactoringsDir());\n\t\tFileManager.deleteDirectories(\n\t\t\t\tRefactoringPlugin.getDynamicRefactoringsDir(), false);\n\t}",
"static Path getOutputPath(Configuration conf, String name) {\n String root = conf.get(WORKING_DIR, \"tmp/reasoning\");\n return new Path(root + \"/\" + name);\n }",
"public void setOutputPath(String path) {\n\t\tthis.outputPath = path;\n\t}",
"private static File prepareTempFolder() {\n File result;\n try {\n result = java.nio.file.Files.createTempDirectory(\n DCOSService.class.getSimpleName()).toFile();\n System.out.println(result.toString());\n\n return result;\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }",
"interface WithFolderPath {\n /**\n * Specifies the folderPath property: The folder path of the source control. Path must be relative..\n *\n * @param folderPath The folder path of the source control. Path must be relative.\n * @return the next definition stage.\n */\n WithCreate withFolderPath(String folderPath);\n }",
"@Override\n\t\t\tpublic Result createOutput(String ns, String file)\n\t\t\t\t\tthrows IOException {\n\t\t\t\tStreamResult res = new StreamResult(writer);\n\t\t\t\tres.setSystemId(\"no-id\");\n\t\t\t\treturn res;\n\t\t\t}",
"@Override\r\n\tpublic String getOutputFile() {\n\t\t\r\n\t\treturn fileOutputPath;\r\n\t}",
"public static String toFolderPathFormat( String inStr ) {\r\n\t\tif( inStr == null ||\r\n\t\t\tinStr.length() == 0\t)\r\n\t\t{\r\n\t\t\treturn \"/\";\r\n\t\t}\r\n\t\t\r\n\t\tif( inStr.charAt( inStr.length() - 1 ) != '/' )\r\n\t\t{\r\n\t\t\treturn inStr + \"/\";\r\n\t\t}\r\n\t\t\r\n\t\treturn inStr;\r\n\t}",
"interface WithFolderPath {\n /**\n * Specifies the folderPath property: The folder path of the source control. Path must be relative..\n *\n * @param folderPath The folder path of the source control. Path must be relative.\n * @return the next definition stage.\n */\n Update withFolderPath(String folderPath);\n }",
"public void createOutput() {\n\t\tsetOutput(new Output());\n\t}",
"public String getpathOutput() {\r\n\t\treturn pathOutput;\r\n\t}",
"private void outputFile() {\n // Define output file name\n Scanner sc = new Scanner(System.in);\n System.out.println(\"What do you want to call this file?\");\n String name = sc.nextLine();\n\n // Output to file\n Path outputFile = Paths.get(\"submissions/\" + name + \".java\");\n try {\n Files.write(outputFile, imports);\n if (imports.size() > 0)\n Files.write(outputFile, Collections.singletonList(\"\"), StandardOpenOption.APPEND);\n Files.write(outputFile, lines, StandardOpenOption.APPEND);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void outputToFile(String filemame)\n {\n }",
"public String getOutPutFilePath() {\n\t\t// Create the entire filename\n\t\tString fileName=FILE_OUT_PATH+ FILENAME + \"NO_LINE_NUMBERS\" + \".txt\";\t\n\t\treturn(fileName);\n\t}",
"public final void setValidationOutputFolder(final File cValidationOutputFolder) {\n\t\tthis.validationOutputFolder = cValidationOutputFolder;\n\t}",
"private final void directory() {\n\t\tif (!this.plugin.getDataFolder().isDirectory()) {\n\t\t\tif (!this.plugin.getDataFolder().mkdirs()) {\n\t\t\t\tMain.SEVERE(\"Failed to create directory\");\n\t\t\t} else {\n\t\t\t\tMain.INFO(\"Created directory sucessfully!\");\n\t\t\t}\n\t\t}\n\t}",
"public InvolvedFilesReporter(String outputDir) {\n super(outputDir + File.separator,\n SIMPLE_FILE_NAME, ReportingConstants.REPORT_FILE_EXTENSION);\n this.outputDirectory = outputDir;\n }"
] | [
"0.59426427",
"0.59306574",
"0.59131813",
"0.58645684",
"0.57951915",
"0.5763508",
"0.5735926",
"0.57125795",
"0.57105756",
"0.5667264",
"0.5652652",
"0.5610349",
"0.5597687",
"0.5594869",
"0.5579716",
"0.55740416",
"0.5509431",
"0.5491775",
"0.54442096",
"0.5429814",
"0.5416648",
"0.5391815",
"0.5347991",
"0.53099275",
"0.5306292",
"0.52855283",
"0.5272452",
"0.5271001",
"0.5256704",
"0.5240195",
"0.5237088",
"0.5222927",
"0.52200615",
"0.52119744",
"0.5196753",
"0.5195678",
"0.5186772",
"0.51728255",
"0.51622087",
"0.51609457",
"0.51518",
"0.51472324",
"0.51430225",
"0.51225275",
"0.5093305",
"0.5088756",
"0.5084707",
"0.50641817",
"0.5055211",
"0.5044174",
"0.50393087",
"0.5033703",
"0.49942",
"0.49903104",
"0.49838465",
"0.49803007",
"0.49735117",
"0.49730417",
"0.4972793",
"0.49669603",
"0.49620515",
"0.49335152",
"0.4931547",
"0.49223062",
"0.49172494",
"0.49124134",
"0.490837",
"0.48958224",
"0.4889875",
"0.48831627",
"0.48749715",
"0.48744336",
"0.48715013",
"0.48609254",
"0.4860152",
"0.48498446",
"0.48408207",
"0.4838996",
"0.48341253",
"0.4833696",
"0.48229036",
"0.48092288",
"0.48068672",
"0.48067918",
"0.4806195",
"0.48053846",
"0.47952527",
"0.4794959",
"0.47926226",
"0.4789491",
"0.47885734",
"0.4785216",
"0.47782642",
"0.47742397",
"0.47683293",
"0.47656986",
"0.47651964",
"0.47578138",
"0.47489646",
"0.47450024"
] | 0.6085151 | 0 |
Check the object and return a list of fields that are empty from the list of requiredFields | private List<String> returnEmptyRequiredFields(List<String> requiredFields, Object givenObject){
return requiredFields.stream()
.filter(x -> {
try {
return StringUtils.isEmpty((String) givenObject.getClass().getDeclaredField(x).get(givenObject));
} catch (Exception e) {
//Not going to try and scmOrganization for exceptions; if there is an exception we probably have greater issues than an empty/null field
getLog().debug(String.format("Unable to ascertain if %s is null/empty",x));
return true;
}
})
.collect(Collectors.toList());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract List<String> requiredFields();",
"protected abstract List<TemporalField> validFields();",
"protected boolean isAllRequiredTxtFieldsFilled() {\r\n JTextField[] txtFields = {\r\n txtFieldFirstName, txtFieldLastName,\r\n txtFieldDateOfBirth, txtFieldIBAN,\r\n txtFieldState, txtFieldHouseNumber,\r\n txtFieldPostcode, txtFieldLocation,\r\n txtFieldCountry, txtFieldState\r\n };\r\n\r\n for (JTextField txtField : txtFields) {\r\n if (txtField.getText().equals(\"\")) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }",
"@Test\n\tpublic void testCheckForEmptyFields() {\n\t\t\n\t\t// Case 1: when all fields are present\n\t\tRequestData requestDataObj1 = new RequestData();\n\t\trequestDataObj1.setDomain(\"PBTV\");\n\t\trequestDataObj1.setOwningBusinessEntity(\"CH\");\n\t\trequestDataObj1.setSourceSystemName(\"CDI\");\n\t\tboolean expectedResponse1 = true;\n\t\tboolean response1 = tokenisationMainObj.checkForEmptyFields(requestDataObj1);\n\t\tassertEquals(response1, expectedResponse1);\n\n\t\t// Case 2: when any of them is empty\n\t\tRequestData requestDataObj2 = new RequestData();\n\t\trequestDataObj2.setDomain(\"PBTV\");\n\t\trequestDataObj2.setOwningBusinessEntity(\"CH\");\n\t\trequestDataObj2.setSourceSystemName(\"\");\n\t\tboolean expectedResponse2 = false;\n\t\tboolean response2 = tokenisationMainObj.checkForEmptyFields(requestDataObj2);\n\t\tassertEquals(response2, expectedResponse2);\n\t}",
"public List<String> getFields() {\n if (!Strings.isNullOrEmpty(fields)) {\n return Arrays.asList(fields.split(\",\"));\n } else {\n return Collections.emptyList();\n }\n }",
"private void fillMandatoryFields() {\n\n }",
"public static boolean checkMandatoryFields(Object obj) {\n\n\t\tif (obj instanceof UserDTO) {\n\n\t\t\tUserDTO userDTO = (UserDTO) obj;\n\n\t\t\tif (userDTO.getPasscode().trim().isEmpty()) {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"private void checkForEmptyFields() throws EmptyTextFieldException {\n\n if (date == null || title.equals(\"\") || function.equals(\"\") || protagonist.equals(\"\")\n || source.equals(\"\") || references.equals(\"\") || description.equals(\"\")) {\n throw new EmptyTextFieldException();\n }\n }",
"protected abstract List<TemporalField> invalidFields();",
"private boolean haveEmptyField() {\n return getTextID(FIRST_NAME).isEmpty() ||\n getTextID(LAST_NAME).isEmpty() ||\n getTextID(ADDRESS).isEmpty();\n }",
"@Test\r\n\tpublic void getRelatedFieldsArrayEmpty() {\r\n\t\tassertEquals(\"relatedFields should be empty\", 0, testObj.getRelatedFieldsArray().length);\r\n\t}",
"@Test(priority=1)\n\tpublic void testWhenFieldsAreEmpty() {\n\t\tsignup.clearAllFields();\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\n\t\t// when all fields are empty errors list is greater than 2\n\t\t// the best way to do it is to have a list of all expected values and compare it with the actual received strings\n\t\tAssert.assertTrue(3<errors.size());\n\t}",
"public static boolean checkMandatoryFieldsRegistration(Object obj) {\n\n\t\tif (obj instanceof UserDTO) {\n\n\t\t\tUserDTO userDTO = (UserDTO) obj;\n\n\t\t\tif (userDTO.getPasscode().trim().isEmpty()) {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public Boolean getAllowEmptyFields() {\n return (Boolean) getExtProperty(\"allowEmptyFields\", DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS);\n }",
"@Override\r\n\tpublic Field[] getExcludedFields() {\n\t\treturn null;\r\n\t}",
"public boolean isSetFields() {\n return this.fields != null;\n }",
"private boolean noFieldsEmpty() {\n if ( nameField.getText().isEmpty()\n || addressField.getText().isEmpty()\n || cityField.getText().isEmpty()\n || countryComboBox.getSelectionModel().getSelectedItem() == null\n || divisionComboBox.getSelectionModel().getSelectedItem() == null\n || postalField.getText().isEmpty()\n || phoneField.getText().isEmpty() ) {\n errorLabel.setText(rb.getString(\"fieldBlank\"));\n return false;\n }\n return true;\n }",
"public void checkFields(){\n }",
"@Test\r\n\tpublic void getNativeFieldsArrayEmpty() {\r\n\t\tassertEquals(\"nativeFields should be empty\", 0, testObj.getNativeFieldsArray().length);\r\n\t}",
"private void populateEmptyFields(DublinCoreMetadataCollection dublinCoreMetadata, Set<String> emptyFields) {\n for (String field : emptyFields) {\n try {\n dublinCoreMetadata.addField(dublinCoreProperties.get(field), \"\", getListProvidersService());\n } catch (Exception e) {\n logger.error(\"Skipping metadata field '{}' because of error: {}\", field, ExceptionUtils.getStackTrace(e));\n }\n }\n }",
"public boolean fieldsAreFilled(){\r\n boolean filled = true;\r\n if(txtFName.getText().trim().isEmpty() | txtFEmail.getText().trim().isEmpty() | txtFPhone.getText().trim().isEmpty()){\r\n filled = false;\r\n }\r\n return filled;\r\n }",
"void isArrayEmpty(ArrayList<UserContactInfo> contactDeatailsList);",
"public static boolean checkMandatoryFieldsUpdateUser(Object obj) {\n\n\t\tif (obj instanceof UpdateUserDTO) {\n\n\t\t\tUpdateUserDTO updateUserDTO = (UpdateUserDTO) obj;\n\n\t\t\tif (updateUserDTO.getFirstName().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getLastName().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getAddress1().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getCity().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getState().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getZipCode().trim().isEmpty()\n\t\t\t\t\t|| updateUserDTO.getNewEmailId().trim().isEmpty()\n\n\t\t\t) {\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"public static boolean isNull_fields_allowed() {\n return null_fields_allowed;\n }",
"private boolean CheckAllRequiredFields() {\n\t\tboolean res = true;\n\t\tres &= CheckParkSelection();\n\t\tres &= CheckDateSelection();\n\t\tres &= CheckVisitorHour();\n\t\tres &= CheckEmail();\n\t\tres &= CheckPhoneNumber();\n\t\treturn res;\n\t}",
"public void testFields()\n {\n TestUtils.testNoAddedFields(getTestedClass(), null);\n }",
"java.util.List<com.sagas.meta.model.MetaFieldData> \n getFieldsList();",
"private static List<Field> getValidFields(final Field[] fields, final boolean returnFinalFields) {\n final List<Field> validFields = new ArrayList<Field>();\n\n for (final Field field : fields) {\n if (!Modifier.isStatic(field.getModifiers()) && (returnFinalFields || !Modifier.isFinal(field.getModifiers()))) {\n validFields.add(field);\n }\n }\n return validFields;\n }",
"static List<Place.Field> getPlaceFields(Place.Field... placeFieldsToOmit) {\n List<Place.Field> placeFields = new ArrayList<>(Arrays.asList(Place.Field.values()));\n placeFields.removeAll(Arrays.asList(placeFieldsToOmit));\n\n return placeFields;\n }",
"private void fillMandatoryFields_custom() {\n\n }",
"private boolean fieldsFilled(){\n return !editTextEmail.getText().toString().isEmpty() &&\n !editTextPassword.getText().toString().isEmpty();\n }",
"List<Field> getFields();",
"public List<Integer> getFreeFields() {\n List<Integer> freeFields = new ArrayList<>();\n for (int i = 1; i <= 9; i++) {\n if (getAt(i) == 0) {\n freeFields.add(i);\n }\n }\n return freeFields;\n }",
"java.lang.String getFields();",
"public static boolean checkEmptyFields(Node... itemToCheck) {\n List<Node> failedFields = new ArrayList<>();\n toolTip.setStyle(\"-fx-background-color: linear-gradient(#FF6B6B , #FFA6A6 );\"\n + \" -fx-font-weight: bold;\");\n hackTooltipStartTiming(toolTip);\n for (Node n : arrayToList(itemToCheck)) {\n // Validate TextFields\n if (n instanceof TextField) {\n TextField textField = (TextField) n;\n textField.textProperty().addListener((ObservableValue<? extends String> observable, String oldValue, String newValue) -> {\n removeToolTipAndBorderColor(textField, toolTip);\n });\n if (textField.getText() == null || textField.getText().trim().equals(\"\")) {\n failedFields.add(n);\n addToolTipAndBorderColor(textField, toolTip);\n } else {\n removeToolTipAndBorderColor(textField, toolTip);\n }\n } // Validate Combo Box\n else if (n instanceof ComboBox) {\n ComboBox comboBox = (ComboBox) n;\n comboBox.valueProperty().addListener((ObservableValue observable, Object oldValue, Object newValue) -> {\n removeToolTipAndBorderColor(comboBox, toolTip);\n });\n if (comboBox.getValue() == null) {\n failedFields.add(n);\n addToolTipAndBorderColor(comboBox, toolTip);\n } else {\n removeToolTipAndBorderColor(comboBox, toolTip);\n }\n } // Validate TextArea\n else if (n instanceof TextArea) {\n TextArea textArea = (TextArea) n;\n textArea.textProperty().addListener((ObservableValue<? extends String> observable, String oldValue, String newValue) -> {\n removeToolTipAndBorderColor(textArea, toolTip);\n });\n if (textArea.getText() == null || textArea.getText().trim().equals(\"\")) {\n failedFields.add(n);\n addToolTipAndBorderColor(textArea, toolTip);\n } else {\n removeToolTipAndBorderColor(textArea, toolTip);\n }\n }\n //ADD YOUR VALIDATION HERE\n //TODO\n }\n\n return failedFields.isEmpty();\n }",
"private List<String> getExcludedFields() {\n List<String> temp = new ArrayList<>();\n temp.add(\"_rallyAPIMajor\");\n temp.add(\"_rallyAPIMinor\");\n temp.add(\"_ref\");\n temp.add(\"_refObjectUUID\");\n temp.add(\"_objectVersion\");\n temp.add(\"_refObjectName\");\n temp.add(\"ObjectUUID\");\n temp.add(\"VersionId\");\n temp.add(\"_type\");\n return temp;\n }",
"java.util.List<Field>\n getFieldsList();",
"java.util.List<? extends com.sagas.meta.model.MetaFieldDataOrBuilder> \n getFieldsOrBuilderList();",
"private void scanFields(TupleAccessor tuple) {\n for ( int i = 0; i < fieldCount; i++ ) {\n FieldAccessor field = tuple.getField( i );\n isNull[i] = field.isNull();\n }\n }",
"public final boolean hasAllRequiredField() {\n EditText editText = (EditText) _$_findCachedViewById(C2723R.C2726id.etUserName);\n Intrinsics.checkExpressionValueIsNotNull(editText, \"etUserName\");\n CharSequence obj = editText.getText().toString();\n int length = obj.length() - 1;\n int i = 0;\n boolean z = false;\n while (i <= length) {\n boolean z2 = obj.charAt(!z ? i : length) <= ' ';\n if (!z) {\n if (!z2) {\n z = true;\n } else {\n i++;\n }\n } else if (!z2) {\n break;\n } else {\n length--;\n }\n }\n String obj2 = obj.subSequence(i, length + 1).toString();\n EditText editText2 = (EditText) _$_findCachedViewById(C2723R.C2726id.etPassword);\n Intrinsics.checkExpressionValueIsNotNull(editText2, \"etPassword\");\n CharSequence obj3 = editText2.getText().toString();\n int length2 = obj3.length() - 1;\n int i2 = 0;\n boolean z3 = false;\n while (i2 <= length2) {\n boolean z4 = obj3.charAt(!z3 ? i2 : length2) <= ' ';\n if (!z3) {\n if (!z4) {\n z3 = true;\n } else {\n i2++;\n }\n } else if (!z4) {\n break;\n } else {\n length2--;\n }\n }\n String obj4 = obj3.subSequence(i2, length2 + 1).toString();\n if (TextUtils.isEmpty(obj2) || TextUtils.isEmpty(obj4)) {\n return false;\n }\n return true;\n }",
"public static List<EntryFieldLabel> validates(PartData partData) {\n List<EntryFieldLabel> invalidFields = new ArrayList<>();\n\n if (StringUtils.isEmpty(partData.getName()))\n invalidFields.add(EntryFieldLabel.NAME);\n\n if (partData.getBioSafetyLevel() == null)\n invalidFields.add(EntryFieldLabel.BIO_SAFETY_LEVEL);\n\n if (StringUtils.isEmpty(partData.getStatus()))\n invalidFields.add(EntryFieldLabel.STATUS);\n\n if (StringUtils.isEmpty(partData.getCreator()))\n invalidFields.add(EntryFieldLabel.CREATOR);\n\n if (StringUtils.isEmpty(partData.getCreatorEmail()))\n invalidFields.add(EntryFieldLabel.CREATOR_EMAIL);\n\n if (StringUtils.isEmpty(partData.getShortDescription()))\n invalidFields.add(EntryFieldLabel.SUMMARY);\n\n return invalidFields;\n }",
"public boolean externalFilled() {\n return firstName != null && !firstName.isEmpty()\n || lastName != null && !lastName.isEmpty()\n || email != null && !email.isEmpty();\n }",
"private boolean verifyObligedFields() {\n if(label.getText().toString().isEmpty() || label.getText().toString().equals(\"\"))\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.label_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(category.getSelectedItem().toString().isEmpty())\n {\n Toast.makeText(ExpenseCardViewDetails.this, R.string.category_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(cost.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.cost_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n if(dateDue.getText().toString().isEmpty()){\n Toast.makeText(ExpenseCardViewDetails.this, R.string.date_due_must_be_filled, Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }",
"public static String errorMessageForRequiredFields(HashMap<String, String> requiredFields){\n String errorMessage = \"\";\n for(String fieldName: requiredFields.keySet()){\n if(requiredFields.get(fieldName).isBlank()){\n errorMessage += \"- \"+fieldName + \" is required!\\n\";\n }\n }\n if(!errorMessage.isBlank()){\n errorMessage = \"Please solve the following errors:\\n\" +errorMessage;\n }\n return errorMessage;\n }",
"public boolean hasFieldErrors();",
"@Override\n\tprotected String[] ignoreFields() {\n\t\treturn null;\n\t}",
"java.util.List<com.google.rpc.BadRequest.FieldViolation> \n getFieldViolationsList();",
"@Override\n\tprotected boolean verifyFields() {\n\t\treturn false;\n\t}",
"public PDUsPage verifyAllFieldsReadOnly(){\n\t\tString[] Fields = { \"PDUs_ReadOnlyName_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyManufacturer_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyModelId_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlySerialNumber_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyLocation_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyIPAddress_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyInputPower_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyGoLiveDate_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyShortDescription_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyOperationalStatus_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlyOwnerGroup_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlySystemManager_Xpath\",\n\t\t\t\t\"PDUs_ReadOnlySystemManagerMan_Xpath\"};\n\n\t\tString[] FieldsDesc = {\"Name\",\n\t\t\t\t\"Manufacturer\",\n\t\t\t\t\"Model Id\",\n\t\t\t\t\"Serial Number\",\n\t\t\t\t\"Location\",\n\t\t\t\t\"IP Address\",\n\t\t\t\t\"Input Power\",\n\t\t\t\t\"Go Live Date\",\n\t\t\t\t\"Short Description\",\n\t\t\t\t\"Operational Status\",\n\t\t\t\t\"CI Owner Group\",\n\t\t\t\t\"System Manager\",\n\t\t\t\t\"Secondary System Manager\"\n\t\t};\n\n\t\tverifyDisabledFieldsByXpath(Fields, FieldsDesc);\n\n\t\treturn this;\n\n\t}",
"@Override\n public JsonNode required(String fieldName) {\n return _reportRequiredViolation(\"Node of type %s has no fields\",\n ClassUtil.nameOf(getClass()));\n }",
"public static FieldValidator anyButNull() {\n return isNotNull();\n }",
"private boolean checkFields() {\n\t\tboolean status = true;\n\n\t\treturn status;\n\t}",
"private boolean fieldsAreFilled(){\n return !textboxName.isEnabled() && !textboxInitialValue.isEnabled();\n }",
"public void testFieldMatchCriteriaEmptyField() {\r\n try {\r\n new FieldMatchCriteria(\" \", \"str\");\r\n fail(\"testFieldMatchCriteriaEmptyField is failure.\");\r\n } catch (IllegalArgumentException iae) {\r\n // pass\r\n } catch (Exception e) {\r\n fail(\"testFieldMatchCriteriaEmptyField is failure.\");\r\n }\r\n }",
"boolean hasField0();",
"private Collection getFieldsValidationList ()\n\t{\n\t\tArrayList list = new ArrayList();\n\t\tModel model = getModel();\n\t\tString className = getClassName();\n\t\tPersistenceClassElement persistenceClass = \n\t\t\tgetPersistenceClass(className);\n\n\t\tif (persistenceClass != null)\n\t\t{\n\t\t\tPersistenceFieldElement[] fields = persistenceClass.getFields();\n\t\t\tint i, count = ((fields != null) ? fields.length : 0);\n\t\t\tIterator iterator = \n\t\t\t\tgetMappingClass(className).getFields().iterator();\n\n\t\t\tfor (i = 0; i < count; i++)\n\t\t\t{\n\t\t\t\tPersistenceFieldElement field = fields[i];\n\n\t\t\t\tlist.add(createFieldExistenceComponent(field));\n\n\t\t\t\t// even though this is really the validation step, we \n\t\t\t\t// only want to add the others if the field exists\n\t\t\t\tif (model.hasField(className, field.getName()))\n\t\t\t\t{\n\t\t\t\t\tlist.add(createFieldPersistenceComponent(field));\n\t\t\t\t\tlist.add(createFieldPersistenceTypeComponent(field));\n\t\t\t\t\tlist.add(createFieldConsistencyComponent(field));\n\n\t\t\t\t\tif (isLegalRelationship(field))\n\t\t\t\t\t{\n\t\t\t\t\t\tRelationshipElement rel = (RelationshipElement)field;\n\n\t\t\t\t\t\t/* user modifiable collection class not yet supported\n\t\t\t\t\t\tlist.add(createCollectionClassComponent(rel));*/\n\t\t\t\t\t\tlist.add(createElementClassComponent(rel));\n\t\t\t\t\t\tlist.add(createRelatedClassMatchesComponent(rel));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (iterator.hasNext())\n\t\t\t{\n\t\t\t\tMappingFieldElement field = \n\t\t\t\t\t(MappingFieldElement)iterator.next();\n\t\t\t\tString fieldName = field.getName();\n\n\t\t\t\t// only check this if it is not in the jdo model\n\t\t\t\tif (persistenceClass.getField(fieldName) == null)\n\t\t\t\t{\n\t\t\t\t\tlist.add(createFieldExistenceComponent(field));\n\n\t\t\t\t\t// even though this is really the validation step, we \n\t\t\t\t\t// only want to add the others if the field exists\n\t\t\t\t\tif (model.hasField(className, fieldName))\n\t\t\t\t\t\tlist.add(createFieldConsistencyComponent(field));\n\t\t\t\t}\n\n\t\t\t\tif (!isRelationship(field))\n\t\t\t\t\tlist.add(createColumnOverlapComponent(field));\n\n\t\t\t\t// preliminary fix for CR6239630\n\t\t\t\tif (Boolean.getBoolean(\"AllowManagedFieldsInDefaultFetchGroup\")) // NOI18N\n\t\t \t\t{\n // Do nothing - AllowManagedFieldsInDefaultFetchGroup: \n // disabled single model validation test; \n // may use checked read/write access to managed fields\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tlist.add(createFieldDefaultFetchGroupComponent(field));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}",
"public String validateFields() {\n return vm.validateFields1();\n }",
"public String[] getAllFilledAnnotationFields();",
"java.util.List<? extends FieldOrBuilder>\n getFieldsOrBuilderList();",
"public ArrayList<String> getDataFields() {\n\t\tif (containerType != null && \n\t\t\t\t!length.getText().toString().matches(\"\") &&\n\t\t\t\t!width.getText().toString().matches(\"\") && \n\t\t\t\t!height.getText().toString().matches(\"\")) {\n\t\t\t\n\t\t\tArrayList<String> dataFields = new ArrayList<String>();\n\t\t\tdataFields.add(containerType);\n\t\t\tdataFields.add(length.getText().toString());\n\t\t\tdataFields.add(width.getText().toString());\n\t\t\tdataFields.add(height.getText().toString());\n\t\t\treturn dataFields;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tToast.makeText(context, \"Please enter data in all fields before saving\", Toast.LENGTH_SHORT).show();\n\t\t\treturn null;\n\t\t}\n\t}",
"private boolean checkFields() {\n boolean test = true;\n if (fname.isEmpty()) {\n test = false;\n }\n if (lname.isEmpty()) {\n test = false;\n }\n if (cin.isEmpty()) {\n test = false;\n }\n if (typeCompte.equals(\"Bancaire\")) {\n if (decouvertNF.isEmpty())\n test = false;\n } else if (typeCompte.equals(\"Epargne\")) {\n if (tauxInteretNF.isEmpty())\n test = false;\n }\n if (s_datePK.getValue() == null) {\n s_datePK.setStyle(\"-fx-border-color:red;-fx-border-radius:3px;-fx-border-size: 1px;\");\n test = false;\n }\n\n return test;\n }",
"private void validateEmptyElements()\n {\n // Check if something is missing\n if (_dietTreatment.getName().length() < 1)\n {\n getErrors().add(\"Kein Name angegeben.\");\n }\n\n // TODO: check that at least one user is TREATING!\n if (_dietTreatment.getSystemUsers().isEmpty())\n {\n getErrors().add(\"Kein verantwortlicher User angegeben.\");\n }\n\n if (_dietTreatment.getPatientStates().isEmpty())\n {\n getErrors().add(\"Keine Zuweisungsdiagnose angegeben.\");\n }\n }",
"private void clearFields(){\r\n fields.forEach(e -> e.clear());\r\n }",
"public void assertNotEmpty(Object[] objArr) {\n if (objArr == null || objArr.length == 0) {\n throw new IllegalArgumentException(\"Arguments is null or its length is empty\");\n }\n }",
"boolean hasField4();",
"boolean hasField3();",
"@Test void testZeroFields() {\n final List<RexLiteral> row = ImmutableList.of();\n final Function<RelBuilder, RelNode> relFn =\n b -> b.values(ImmutableList.of(row, row),\n b.getTypeFactory().builder().build())\n .build();\n fixture().withRel(relFn)\n .returnsRows(\"[]\", \"[]\");\n }",
"synchronized public Set<String> getFields() {\n return Collections.unmodifiableSet(new HashSet<>(fields));\n }",
"public void setAllowEmptyFields(Boolean allowEmptyFields) {\n setExtProperty(\"allowEmptyFields\", DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS, allowEmptyFields);\n }",
"List<FieldRestrictions> fieldRestrictions();",
"private void checkFieldsForEmptyValues() {\n String s1 = edtEmail.getText().toString();\n String s2 = edtDisplayName.getText().toString();\n String s3 = edtPaswd.getText().toString();\n\n if (s1.equals(\"\") || s2.equals(\"\") || s3.equals(\"\")) { //disables the button\n btnRegister.setEnabled(false);\n } else { //enables the button\n btnRegister.setEnabled(true);\n }\n }",
"public PDUsPage verifyAllMandatoryFieldsforPDUs(){\n\t\tString[] mandatoryFields = {\"PDUs_Name_Xpath\",\n\t\t\t\t\"PDUs_OwnerGroupReadOnly_Xpath\",\n\t\t\"PDUs_SystemManagerManReadOnly_Xpath\"};\n\n\t\tString[] mandatoryFieldsDesc = {\"Name\",\n\t\t\t\t\"CI Owner Group\",\"System Manager\"};\n\n\t\tverifyMandatoryFields(mandatoryFields, mandatoryFieldsDesc);\n\n\t\treturn this;\n\n\t}",
"private List<String> rmDupInfo(List<String> fields) {\n Set<String> seen = new HashSet<>();\n List<String> uniqueNonEmptyFields = new ArrayList<>();\n for (String i : fields) {\n if (i.isEmpty() || i.equals(\".\")) {\n continue;\n } else {\n String fieldName = i.split(\"=\")[0];\n if (!seen.contains(fieldName)) {\n uniqueNonEmptyFields.add(i);\n seen.add(fieldName);\n }\n }\n }\n return uniqueNonEmptyFields;\n }",
"private boolean checkfields() {\n try {\n Integer.parseInt(checknum.getText().toString());\n Integer.parseInt(banknum.getText().toString());\n Integer.parseInt(branchnum.getText().toString());\n Integer.parseInt(accountnum.getText().toString()); //was commented\n\n } catch (NumberFormatException e) { // at least one of these numbers is not Integer\n return false;\n }\n\n if (checknum.getText().toString().equals(null) || banknum.getText().toString().equals(null) ||branchnum.getText().toString().equals(null)|| accountnum.getText().toString().equals(null))\n return false; // At least one of the fields is empty\n\n return true;\n }",
"public GetFieldsOutput() {\n\t\tsuper();\n\t\tthis.succeed = null;\n\t\tthis.failed = null;\n\t\tthis.invalid = null;\n\t}",
"@Test (priority = 2)\n\tpublic void TC2_CheckAllFields_Exisit ()\n\n\t{\n\t\tCreateUserPage UserObj = new CreateUserPage (driver);\n\n\t\t// This is to Validate If all fields of create user page are existing\n\t\tUserObj.Validate_AllFields_Exsist();\n\t\n\n\t}",
"boolean hasField1();",
"@Override\n\tpublic List<Field> getAll() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic List<String> listSearchableFields() {\n\t\tList<String> listSearchableFields = new ArrayList<String>();\n\t\tlistSearchableFields.addAll(super.listSearchableFields());\n\n\t\tlistSearchableFields.add(\"firstName\");\n\n\t\tlistSearchableFields.add(\"lastName\");\n\n\t\tlistSearchableFields.add(\"contactDetails.phone\");\n\n\t\tlistSearchableFields.add(\"contactDetails.secondaryPhone\");\n\n\t\tlistSearchableFields.add(\"contactDetails.city\");\n\n\t\treturn listSearchableFields;\n\t}",
"@Test(timeout=100)\r\n\tpublic void testEmptyFields() {\r\n\t\tString [] r1 = {\"a\",\"\",\"c\"}; // 3 fields\r\n\t\tString [] r2 = {\"\",\"\",\"c\"}; // 3 fields\r\n\t\tString [] r3 = {\"\",\"b\"}; // 2 fields\r\n\t\tString [] r4 = {\"a\",\"\",\"\",\"\",\"\",\"d\"}; // many fields\r\n\t\twriteArrayToLine(r1);\r\n\t\twriteArrayToLine(r2);\r\n\t\twriteArrayToLine(r3);\r\n\t\twriteArrayToLine(r4);\r\n\t\tout.close();\r\n\t\t\r\n\t\tCSVReader csv = new CSVReader(getInstream());\r\n\t\tassertTrue( csv.hasNext() );\r\n\t\tassertArrayEquals( r1, csv.next() );\r\n\t\tassertArrayEquals( r2, csv.next() );\r\n\t\tassertArrayEquals( r3, csv.next() );\r\n\t\tassertArrayEquals( r4, csv.next() );\r\n\t}",
"@Override\n public java.util.List<Field> getFieldsList() {\n return fields_;\n }",
"public java.util.List<Field> getFieldsList() {\n if (fieldsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(fields_);\n } else {\n return fieldsBuilder_.getMessageList();\n }\n }",
"private boolean isAnyEmpty(){\n //get everything\n return (fname.getText().toString().trim().length() == 0)\n || (lname.getText().toString().trim().length() == 0)\n || (email.getText().toString().trim().length() == 0)\n || (password.getText().toString().trim().length() == 0);\n }",
"public List<StatefullComponent> getFields() {\n\t\treturn null;\r\n\t}",
"private boolean validateRequiredFields(StringBuffer b){\n boolean result = true;\n\n if (!TextFieldHelper.isNumericFieldValid(this.goalValue, \" Цель: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.startWeightValue, \" Исходный вес: \", b) ||\n !TextFieldHelper.isNumericFieldValid(this.heightValue, \" Рост: \", b) ||\n !CalendarHelper.isFieldValid(startProgramDateValue, \" Старт программы: \", b) ||\n !new ComboBoxFieldHelper<Client>().isFieldValid(clientFIOValue, \" Клиент: \", b))\n {\n result = false;\n }\n\n return result;\n }",
"private String[] getDefinedFields(ObjectSet<?> pObjectSet) {\r\n\t\tString[] returnedValue = null;\r\n\t\tList<String> fieldsList = new ArrayList<String>();\r\n\t\t\r\n\t\tif (pObjectSet != null) {\r\n\t\t\tif (pObjectSet.getDataMappings().size() > 0) {\r\n\t\t\t\tfor(DataMapping mapping : pObjectSet.getDataMappings()) {\r\n\t\t\t\t\tif (!mapping.virtual && !mapping.IsCollection) {\r\n\t\t\t\t\t\tif (mapping.DataBaseDataType != Entity.DATATYPE_ENTITY) {\r\n\t\t\t\t\t\t\tfieldsList.add(mapping.DataBaseFieldName);\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\t\r\n\t\tif (fieldsList.size() > 0) {\r\n\t\t\treturnedValue = fieldsList.toArray(new String[fieldsList.size()]);\r\n\t\t}\r\n\t\t\r\n\t\treturn returnedValue;\r\n\t}",
"private void checkRequiredFields() {\n // check the fields which should be non-null\n if (configFileName == null || configFileName.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configFileName' should not be null.\");\n }\n if (configNamespace == null || configNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'configNamespace' should not be null.\");\n }\n if (searchBundleManagerNamespace == null\n || searchBundleManagerNamespace.trim().length() == 0) {\n throw new DAOConfigurationException(\n \"The 'searchBundleManagerNamespace' should not be null.\");\n }\n if (entityManager == null) {\n throw new DAOConfigurationException(\n \"The 'entityManager' should not be null.\");\n }\n }",
"Fields fields();",
"public boolean check(){\n for(TextField texts:textFields){\n if(texts.getText().isEmpty()){\n return false;\n }\n }\n return true;\n }",
"public static void validateRequiredEntries(FlightMap flightMap, String... keys) {\n for (String key : keys) {\n if (null == flightMap.getRaw(key)) {\n throw new MissingRequiredFieldsException(\n String.format(\"Required entry with key %s missing from flight map.\", key));\n }\n }\n }",
"protected Vector collectFields() {\n Vector fields = new Vector(1);\n fields.addElement(this.getField());\n return fields;\n }",
"Set<String> getRequiredColumns();",
"public List<String> getNotExportedSearchableFields() {\n return Collections.unmodifiableList(notExportedSearchableFields);\n }",
"boolean getFieldTypeIdNull();",
"public List<String> requiredMembers() {\n return this.requiredMembers;\n }",
"public ArrayList<GOlrField> getFields() {\n\n ArrayList<GOlrField> collection = new ArrayList<GOlrField>();\n\n // Plonk them all in to our bookkeeping.\n for (GOlrField field : unique_fields.values()) {\n collection.add(field);\n }\n\n return collection;\n }",
"public Set<String> findMissingDataFields(String tableName,\n\t\t\tList<String> colList, List<String> valueList) {\n\t\tDatabaseTable dtB = annotatedTableSchema.get(tableName);\n\t\treturn dtB.findMisingDataField(colList, valueList);\n\t}",
"java.util.List<? extends com.google.rpc.BadRequest.FieldViolationOrBuilder> \n getFieldViolationsOrBuilderList();",
"public static List<String> getRequiredAttributes() {\n\t\treturn TestObject.REQUIRED_ATTRIBUTES;\n\t}",
"public String[] getFieldValues()\n {\n String[] fieldValues = new String[3];\n if(formattedFirstName.getValue() != null)\n fieldValues[0] = ((String) formattedFirstName.getValue()).trim();\n else\n fieldValues[0] = \"\";\n if(formattedLastName.getValue() != null)\n fieldValues[1] = ((String) formattedLastName.getValue()).trim();\n else\n fieldValues[1] = \"\";\n if(formattedTitleOfWork.getValue() != null)\n fieldValues[2] = ((String) formattedTitleOfWork.getValue()).trim();\n else\n fieldValues[2] = \"\";\n return fieldValues;\n }"
] | [
"0.7581546",
"0.6627878",
"0.6552302",
"0.6404947",
"0.6359654",
"0.6356638",
"0.62707263",
"0.6243074",
"0.6230201",
"0.6203083",
"0.6078496",
"0.6054001",
"0.60230356",
"0.5928048",
"0.5908173",
"0.59029365",
"0.58806765",
"0.5877657",
"0.5839706",
"0.5762202",
"0.57266766",
"0.5711516",
"0.571008",
"0.5690456",
"0.5675855",
"0.5665467",
"0.56459177",
"0.56330544",
"0.5631262",
"0.56048745",
"0.5604179",
"0.5594306",
"0.5593538",
"0.5587758",
"0.55866057",
"0.55846804",
"0.5574888",
"0.55663276",
"0.55596364",
"0.55511206",
"0.5547448",
"0.55266416",
"0.5522161",
"0.5502068",
"0.54975843",
"0.5492723",
"0.54696393",
"0.5463612",
"0.5462499",
"0.5459928",
"0.544836",
"0.5445313",
"0.544329",
"0.5438196",
"0.5431308",
"0.5421361",
"0.5420851",
"0.54002637",
"0.53823006",
"0.5377646",
"0.5372626",
"0.5370525",
"0.5367775",
"0.5355637",
"0.5347721",
"0.5345066",
"0.53220814",
"0.5315255",
"0.53098196",
"0.5303424",
"0.5295631",
"0.5291118",
"0.5288614",
"0.52819014",
"0.5275456",
"0.52718276",
"0.5270629",
"0.52649635",
"0.52581024",
"0.52441865",
"0.52341336",
"0.52267575",
"0.52176744",
"0.52112985",
"0.5199177",
"0.5194076",
"0.5191228",
"0.5173445",
"0.51663744",
"0.5147301",
"0.5129561",
"0.5119764",
"0.51158065",
"0.51111096",
"0.5108823",
"0.5108822",
"0.510129",
"0.50967705",
"0.5095792",
"0.5094233"
] | 0.8709427 | 0 |
Log out request details prior to making a request to SwaggerHub to save a SCMPluginConfig | private void logSaveSCMPluginConfigRequestDetailsPriorToRequest(SaveSCMPluginConfigRequest saveSCMPluginConfigRequest){
getLog().info(String.format("Provisioning %s Plugin Integration for %s", scmProvider, saveSCMPluginConfigRequest.getApi()));
getLog().debug(new SCMIntegrationPluginConfiguration(saveSCMPluginConfigRequest).toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected Object handleTokenEndpointRequest(String requestId) {\n\t\tenv.removeObject(\"client_authentication\");\n\t\treturn super.handleTokenEndpointRequest(requestId);\n\t}",
"@CrossOrigin(origins = AppConstants.CORS)\n\t@RequestMapping(value = {UrlConstants.API_LOGOUT+\"org\"}, method = RequestMethod.POST)\n\tpublic void logOut() {\n\t\t try {\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"efregt\");\n\t\t}\n\t}",
"protected void saveToken(HttpServletRequest request) {\r\n Logger l = LogUtils.enterLog(getClass(), \"saveToken\", request);\r\n\r\n saveToken(request, getTokenConstant());\r\n\r\n l.exiting(getClass().getName(), \"saveToken\");\r\n }",
"@Override\n public void logOut() {\n }",
"@Override\n\tpublic String logout_request() {\n\t\treturn null;\n\t}",
"public void disableCurlLogging() {\n curlConfiguration = null;\n }",
"public void logOut() {\n\t\tToken.getIstance().setHashPassword(null);\n\t}",
"void logoutRequest() throws Exception;",
"public void clearLoginInfo(){\n ProfileSharedPreferencesRepository.getInstance(application).clearLoginInfo();\n }",
"@Override\n protected void afterAuthenticating() {\n }",
"@Override\n public void onFailure(@NonNull Exception e) {\n\n logOutNow();\n\n }",
"@Override\n\tpublic void validateConfigurationWithoutLogin() {\n\t\tcheckAuthorization();\n\t}",
"public void logOutAdministrator() {\n logOutGeneral();\n }",
"@Step(\"Log out\")\n public void logOut() {\n open();\n sighOutButton.click();\n }",
"private void clearLoginReq() {\n if (reqCase_ == 6) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"@Override\n public void destroy() {\n LOGGER.warn(\"Destroy filtro de RequestResponse\");\n }",
"public void logOut() {\n sp.edit().clear().commit();\n }",
"private void exposePluginRequestContext(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {\n\n OpenAksessPlugin plugin = (OpenAksessPlugin) request.getAttribute(PluginDelegatingHandlerMapping.DELEGATED_PLUGIN_ATTR);\n\n if(plugin!= null) {\n model.put(PluginRequestContext.PLUGIN_REQUEST_CONTEXT_ATTRIBUTE, new DefaultPluginRequestContext(plugin, request, response, getServletContext(), model));\n }\n }",
"@ApiOperation(value=\"Login\", notes=\"Login action\")\n @RequestMapping(value=\"/user/logout\",method= RequestMethod.POST)\n @ResponseBody\n public RetObject logoutHomeconnect(@ApiParam(value = \"account logout\", required = true)@RequestHeader(value = \"PlatID\", required = true) String platID,@RequestHeader(value = \"AppID\", required = false) String appID,\n @RequestHeader HttpHeaders httpHeaders,\n\t\t\t\t\t@RequestHeader(value = \"AccessToken\", required = true) String AccessToken,\n @RequestBody(required = false) LoginReqVO body){\n String url = \"/api/translator/user/logout\";\n RetObject result = RetObject.fail();\n Map<String,String> headerMap = new HashedMap();\n headerMap.put(\"PlatID\", platID);\n headerMap.put(\"AppID\", appID);\n String headers = getJSONString(headerMap);\n String bodyText = getJSONString(body);\n Error headerError = validateHeaders(platID,appID);\n Error bodyError = validateLoginBodyError(body);\n if (bodyError == null && headerError == null){\n result = RetObject.success();\n }\n return result;\n}",
"static void logout() {\n\t\tserver.clearSharedFiles(username);\n\t\tserver.clearNotSharedFiles(username);\n\t}",
"public void logOut() {\r\n\t\tthis.modoAdmin = false;\r\n\t\tthis.usuarioConectado = null;\r\n\t}",
"@Override\n public void onCanceled() {\n\n logOutNow();\n\n }",
"void logSystemDetails() throws CometApiException {\n sendSynchronously(restApiClient::logSystemDetails, SystemUtils.readSystemDetails());\n }",
"public static void makeUnlogged() {\n\t\tMemberSessionFacade.removeAttribute(ConfigKeys.LOGGED);\n//\t\tControllerUtils.addCookie(ConfigKeys.LOGGED, null);\n\t}",
"@SuppressWarnings(\"rawtypes\")\n protected void setInformationPlugin(HttpServletRequest req, OperationPlugin operationPlugin) {\n\n // Request attributes\n //\n Hashtable<String, Object> attributes = new Hashtable<String, Object>();\n\n for (Enumeration e = req.getAttributeNames(); e.hasMoreElements();) {\n\n String attName = (String) e.nextElement();\n\n attributes.put(attName, req.getAttribute(attName));\n }\n\n operationPlugin.setAttributes(attributes);\n\n // Request parameters\n //\n Hashtable<String, Object> parameters = new Hashtable<String, Object>();\n\n for (Enumeration e = req.getParameterNames(); e.hasMoreElements();) {\n\n String attName = (String) e.nextElement();\n\n parameters.put(attName, req.getParameter(attName));\n }\n\n operationPlugin.setParameters(parameters);\n\n // Request session attributes\n //\n Hashtable<String, Object> sessionAttributes = new Hashtable<String, Object>();\n\n for (Enumeration e = req.getSession().getAttributeNames(); e.hasMoreElements();) {\n\n String attName = (String) e.nextElement();\n\n sessionAttributes.put(attName, req.getSession().getAttribute(attName));\n }\n\n operationPlugin.setSessionAttributes(sessionAttributes);\n\n // Resource boundle\n operationPlugin.setResourceBundle(getResourceBundle(req));\n }",
"@Override\n\tpublic void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {\n\t\tsuper.modifyHandshake(sec, request, response);\n\t\tHttpSession session = (HttpSession)request.getHttpSession();\n\t\tsec.getUserProperties().put(\"session\",session);\t\t\n\t}",
"@Override\n\tpublic void logout() {\n\t}",
"private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }",
"@Override\r\n\tpublic void logout() {\n\t\t\r\n\t}",
"@Override\n public void onError(Request request, Throwable exception) {\n LOGGER.severe(\"Server part (poptavka-core) doesn't respond during user logging out, exception=\"\n + exception.getMessage());\n eventBus.displayError(0, null);\n }",
"private void logout(){\n StringRequest request = new StringRequest(Request.Method.GET, Constant.LOGOUT, response -> {\n try {\n JSONObject object = new JSONObject(response);\n if(object.getBoolean(\"success\")){\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.clear();\n editor.apply();\n Toast.makeText(getApplicationContext(),\"Log Out Success\",Toast.LENGTH_SHORT).show();\n// startActivity(new Intent(getBaseContext(), AuthActivity.class));\n startActivity(new Intent(DashboardActivity.this, AuthActivity.class));\n }\n }catch (JSONException e){\n e.printStackTrace();\n }\n// dialog.dismiss();\n }, error -> {\n //error if fail to connect\n error.printStackTrace();\n// dialog.dismiss();\n }){\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n String token = sharedPreferences.getString(\"token\",\"\");\n HashMap<String, String> map = new HashMap<>();\n map.put(\"Authorization\",\"Bearer\"+token);\n return map;\n }\n };\n RequestQueue queue = Volley.newRequestQueue(getBaseContext());\n queue.add(request);\n\n }",
"private void logout() {\n getSharedPreferences(HELP_CATEGORIES, MODE_PRIVATE).edit().clear().apply();\n getSharedPreferences(LOGIN, MODE_PRIVATE).edit().putBoolean(IS_LOGGED_IN, false).apply();\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(URL + \"/nuh/logout\")\n .build();\n AsyncTask.execute(() -> {\n try {\n client.newCall(request).execute();\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }",
"public void logout() {\n \n }",
"void logoff();",
"@Override\n public void onCancel(AuthCancellation cancellation) {\n System.out.println(\"Cancel \" + cancellation);\n // Reset the UI to a ready-to-login state\n }",
"public void logout() {\n\n // Instance, user and token become null\n instance = null;\n user = null;\n authtoken = null;\n\n // Switch all the settings back to true\n isLifeStoryLinesOn = true;\n isFamilyTreeLinesOn = true;\n isSpouseLinesOn = true;\n isFatherSideOn = true;\n isMotherSideOn = true;\n isMaleEventsOn = true;\n isFemaleEventsOn = true;\n\n //Take care of resetting boolean logics use throughout app\n isLoggedIn = false;\n personOrSearch = false;\n startLocation = null;\n eventID = null;\n\n // Clear all lists\n\n people.clear();\n events.clear();\n personEvents.clear();\n currentPersonEvents.clear();\n eventTypes.clear();\n\n childrenMap.clear();\n maleSpouse.clear();\n femaleSpouse.clear();\n paternalAncestorsMales.clear();\n paternalAncestorsFemales.clear();\n maternalAncestorsMales.clear();\n maternalAncestorsFemales.clear();\n }",
"public void logoff() {\n CNHudsonUtil.logoff(this.cna);\n this.cna = null;\n }",
"public static void tearDown() {\n reset();\n clear();\n APIConfig.getInstance().setAppId(null, null);\n APIConfig.getInstance().setDeviceId(null);\n APIConfig.getInstance().setToken(null);\n APIConfig.getInstance().setUserId(null);\n Leanplum.setApplicationContext(null);\n }",
"private void clearGetTokenReq() {\n if (reqCase_ == 4) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"public void reset() {\n mHsConfig = null;\n mLoginRestClient = null;\n mThirdPidRestClient = null;\n mProfileRestClient = null;\n mRegistrationResponse = null;\n\n mSupportedStages.clear();\n mRequiredStages.clear();\n mOptionalStages.clear();\n\n mUsername = null;\n mPassword = null;\n mEmail = null;\n mPhoneNumber = null;\n mCaptchaResponse = null;\n mTermsApproved = false;\n\n mShowThreePidWarning = false;\n mDoesRequireIdentityServer = false;\n }",
"@Override\n public void handleTokenExpiration(){\n JWTToken.removeTokenSharedPref(this);\n }",
"@After\n\tpublic void reset() {\n\t\tWhitebox.setInternalState(TinylogLogger.class, ProviderRegistry.getLoggingProvider());\n\t}",
"public PreOauth2SSOGatewayFilter() {\n super(Config.class);\n }",
"@Override\n public void Logout() {\n\t \n }",
"private void saveConfiguration() {\n }",
"@PostConstruct\r\n\tpublic void demoOnly() {\r\n\t\t// Can't do this in the constructor because the RestTemplate injection\r\n\t\t// happens afterwards.\r\n\t\tlogger.warning(\"The RestTemplate request factory is \"\r\n\t\t\t\t+ restTemplate.getRequestFactory());\r\n\t}",
"public void destroy() {\n\t\texcludeItem = null;\r\n\t\tloginPage=null;\r\n\t\tloaginAction=null;\r\n\t\tauthority = null;\r\n\t}",
"void logout(HttpServletRequest request);",
"private void debugAuthentcation() {\n\n\t\t/*\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: serviceName: \" +\n\t\t * serviceName + \", baseUrl: \" + baseUrl + \" username: \" + username +\n\t\t * \" password: \" + password);\n\t\t * XPagesUtil.showErrorMessage(\"bluemix util: service name: \" +\n\t\t * serviceName + \", hardcodedBaseUrl: \" + hardcodedBaseUrl +\n\t\t * \" hardcodedUsername: \" + hardcodedUsername + \" hardcodedPassword: \" +\n\t\t * hardcodedPassword);\n\t\t */\n\t}",
"public static void initApiSession(HttpServletRequest request, String modifiedBaseUrl, IApplicationSettings settings)\n {\n ViewLearningToolRequestParams parameters = getParams(request.getParameterMap());\n try\n {\n // Validate if the request is not expired and if the signature is valid\n validateQueryString(String.format(\"%s?%s\", modifiedBaseUrl,request.getQueryString()), settings.getSharedSecret(), settings.getRequestLifetimeInMinutes(), parameters);\n } catch (Exception ex)\n {\n throw new RuntimeException(ex);\n }\n\n // Store received parameters to the session state\n storeParametersToSession(parameters, request.getSession(), settings.getApplicationKey(), settings.getSharedSecret());\n }",
"void stopAuthentication() {\n stop(false);\n }",
"@Override\r\n public void validateParameters(PluginRequest request) {\n }",
"@AfterGroups(groups = {\"SUPER_ADMIN\", \"REGION_ADMIN\", \"OFFICER\"})\n protected void logout() throws Exception {\n final SecurityClient securityClient = SecurityClientFactory.getSecurityClient();\n securityClient.logout();\n }",
"public static void initApiSession(HttpServletRequest request, IApplicationSettings settings)\n {\n \n ViewLearningToolRequestParams parameters = getParams(request.getParameterMap());\n ValidateQueryString(request, settings, parameters);\n // Store received parameters to the session state\n storeParametersToSession(parameters, request.getSession(), settings.getApplicationKey(), settings.getSharedSecret());\n }",
"private void logout()\r\n {\r\n LogoutRequest request = new LogoutRequest();\r\n request.setUsername(username);\r\n this.sendRequest(request);\r\n }",
"public void clearAllAuthInfo();",
"public void saveGlobalSigns()\n\t{\n\t\tplugin.fileio.saveGlobalSigns();\n\t}",
"public void afterPropertiesSet() {\n\t\tgetHttpInvokerRequestExecutor();\n\t\tlogger.info(\"remote webservice serviceUrl:\"+getServiceUrl()+\" retryIntervalMills:\"+Arrays.toString(retryIntervalMills));\n\t}",
"@Override\n\tpublic void processRequest(HttpRequest request, HttpResponse response) throws Exception {\n\t\tresponse.setHeaderField( \"Server-Name\", \"Las2peer 0.1\" );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\t\n\t\t\n\t\t\n\t\tif(authenticate(request,response))\n\t\t\tif(invoke(request,response));\n\t\t\t\t//logout(_currentUserId);\n\t \n\t\n\t\t//connector.logMessage(request.toString());\n\t\t\n\t\t\n\t}",
"public void logOut() {\n Logger.d(TAG,\"login#logOut\");\n Logger.d(TAG,\"login#stop reconnecting\");\n //\t\teverlogined is enough to stop reconnecting\n everLogined = false;\n isLocalLogin = false;\n reqLoginOut();\n }",
"private static void hackRequestForSwitchingInsecureScheme() {\n// Logger.debug(\"SCOPE -> hackRequestForSwitchingInsecureScheme\");\n Http.Request.current().secure = false;\n hackRequestPort();\n }",
"public WebConnector() {\n\t\tsuper.setFieldValues();\n\t\tagentIdToSessionId = new HashMap<>();\n\t\tsessions = new HashMap<>();\n\t\tsecureRandom = new SecureRandom();\n\t\tthis.logger.setLevel(Level.SEVERE);\n\t}",
"void logHTTPRequest(HttpServletRequest request, Logger logger, List parameterNamesToObfuscate);",
"public void logPlayerOut() {\n if (sessionInfo.isPlayerInParty())\n {\n leaveParty();\n }\n LogDispatcher.getInstance().onLogRequestReceived(new ConcreteSimpleLoggingRequest(LoggingRequest.Severity.INFO, null, \"Logged out\"));\n player.resetValues();\n }",
"public void Logout() {\n \t\t\t\n \t\t}",
"Map<String, Object> deleteConfig(Request request, String type, String id);",
"public void configureSession(URLConnection co) throws IOException {\n\t\tco.setRequestProperty(\"Authorization\", \"OreApi session=\\\"\" + this.sessionManager.getOrCreateSession() + \"\\\"\");\n\t}",
"@Override\n\tpublic String login_request() {\n\t\treturn null;\n\t}",
"public void logoutpackged() {\n\n editor.remove(IS_LOGIN);\n editor.remove(KEY_NAME);\n editor.remove(KEY_EMAIL);\n editor.remove(KEY_ID);\n// editor.remove(KEY_IMAGEURI);\n editor.remove(PROFILE_IMG_URL);\n editor.remove(PROFILE_IMG_PATH);\n// editor.remove(KEY_LANGUAGE);\n editor.commit();\n\n /* Intent i = new Intent(context, SelectLanguage.class);\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n context.startActivity(i);\n ((Activity) context).finish();*/\n\n }",
"protected final void clearAuthenticationAttributes(HttpServletRequest request) {\r\n HttpSession session = request.getSession(false);\r\n\r\n if (session == null) {\r\n return;\r\n }\r\n\r\n session.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);\r\n }",
"@PreAuthorize(\"isAuthenticated()\")\n @GetMapping(\"/logout\")\n @ResponseStatus(HttpStatus.OK)\n public ResponseEntity<Boolean> logout(HttpServletRequest request) {\n auditTrailUtil.printLogDetailStartTime(Constants.ExecutionType.START_EXECUTION, \"User Management\", \"logout\");\n String authHeader = request.getHeader(\"Authorization\");\n if (authHeader != null) {\n //TODO AUDIT TRAIL LOGOUT\n userService.createLogoutAuditTrail();\n String tokenValue = authHeader.replace(\"Bearer\", \"\").trim();\n OAuth2AccessToken accessToken = tokenStore.readAccessToken(tokenValue);\n tokenStore.removeAccessToken(accessToken);\n }\n auditTrailUtil.printLogDetailStartTime(Constants.ExecutionType.END_EXECUTION, \"User Management\", \"logout\");\n return ResponseEntity.ok().body(Boolean.TRUE);\n }",
"public void logout() {\n getRequest().getSession().invalidate();\n }",
"public void turnOffListenInitialValuesRequest()\n\t{\n\t\tlistenInitialValuesRequest = false;\n\t}",
"private static void hackRequestForSwitchingSecureScheme() {\n// Logger.debug(\"SCOPE -> hackRequestForSwitchingSecureScheme\");\n Http.Request.current().secure = true;\n hackRequestPort();\n }",
"@Override\r\n\t\t\t\t\tpublic void onLoginCancel() {\n\t\t\t\t\t\tTypeSDKLogger.d( \"onLoginCancel\");\r\n\t\t\t\t\t}",
"private void removeSpUserInfo() {\n\t\tPreferencesHelper preferencesHelper = new PreferencesHelper(\n\t\t\t\tChangeLoginActivity.this);\n\t\tpreferencesHelper.remove(\"uid\");\n\t\tpreferencesHelper.remove(\"LOGIN_USER_EMAIL\");\n\t\tpreferencesHelper.remove(\"nickName\");\n\t\tpreferencesHelper.remove(\"LOGIN_USER_ICON\");\n\t\tpreferencesHelper.remove(\"LOGIN_USER_ALREADY_LOGIN\");\n\t\tpreferencesHelper.remove(\"LOGIN_PASSWORD\");\n\t\tpreferencesHelper.remove(\"LOGIN_USER_ID\");\n\t\tpreferencesHelper.remove(\"LOGIN_USER_NAME\");\n\t\tpreferencesHelper.remove(\"LOGIN_USER_PHONE\");\n\t}",
"@RequestMapping(value = \"/logout\", method = RequestMethod.PATCH)\n public void logout(@RequestHeader(\"X-CS-Auth\") String auth,\n @RequestHeader(\"X-CS-Session\") String sessionId) {\n sessionService.logout();\n }",
"private SaveSCMPluginConfigRequest createSaveSCMPluginConfigRequest(SaveSCMPluginConfigRequest input, String inputFile, String oasVersion, String languageTarget){\n\n String outputFolder = FilenameUtils.getFullPath(inputFile);\n outputFolder = getOutputFolder(outputFolder);\n\n SaveSCMPluginConfigRequest saveSCMPluginConfigRequest = new SaveSCMPluginConfigRequest.Builder(input.getOwner(), input.getApi(), input.getVersion())\n .saveSCMPluginConfigRequest(input)\n .oas(oasVersion)\n .target(languageTarget)\n .outputFolder(outputFolder)\n .managedPaths(new String[]{FilenameUtils.getName(inputFile)})\n .outputFile(FilenameUtils.getName(inputFile))\n .build();\n\n return saveSCMPluginConfigRequest;\n }",
"protected void shutdown()\n throws SwiftletException {\n if (config == null)\n return;\n if (traceSpace.enabled) traceSpace.trace(getName(), \"shutdown ...\");\n rlgroups.clear();\n groups.clear();\n users.clear();\n publicRLGroup = null;\n publicGroup = null;\n authenticationOff = true;\n config = null;\n if (traceSpace.enabled) traceSpace.trace(getName(), \"shutdown: done.\");\n }",
"@Override\n\tpublic void destroy() {\n\t\tlogService=null;\n\t\tnoInterceptUrlRegxList=null;\n\n\t}",
"void preTokenRequest() throws MsalUiRequiredException, MsalUserCancelException,\n MsalServiceException, MsalClientException {\n mAuthRequestParameters.getAuthority().resolveEndpoints(\n mAuthRequestParameters.getRequestContext(),\n mAuthRequestParameters.getLoginHint()\n );\n }",
"public void shutdown() {\n\t\tinternalShutdown();\n\t\tC4JPluginLogging.getDefault().removeLogManager(this); \n\t}",
"public void afterPropertiesSet() {\n super.afterPropertiesSet();\n\n debug(\"Plugin validated\");\n\n }",
"@Override\n\tpublic void saveRequest(HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\tif (!justUseSavedRequestOnGet || \"GET\".equals(request.getMethod())) {\n\t\t\tDefaultSavedRequest savedRequest = new DefaultSavedRequest(request,\n\t\t\t\t\tportResolver);\n\n\t\t\tif (createSessionAllowed || request.getSession(false) != null) {\n\t\t\t\t// Store the HTTP request itself. Used by\n\t\t\t\t// AbstractAuthenticationProcessingFilter\n\t\t\t\t// for redirection after successful authentication (SEC-29)\n\t\t\t\trequest.getSession().setAttribute(WebAttributes.SAVED_REQUEST,\n\t\t\t\t\t\tsavedRequest);\n\t\t\t\tlogger.debug(\"DefaultSavedRequest added to Session: \"\n\t\t\t\t\t\t+ savedRequest);\n\t\t\t}\n\t\t}\n\n\t}",
"protected void setInformationPlugin(HttpServletRequest req, GenericAction genericAction) {\n\n // Set multipart fields\n genericAction.setMultipartFields(getMultipartFields());\n\n // Request attributes\n //\n Hashtable<String, Object> attributes = new Hashtable<String, Object>();\n\n for (Enumeration e = req.getAttributeNames(); e.hasMoreElements();) {\n\n String attName = (String) e.nextElement();\n\n attributes.put(attName, req.getAttribute(attName));\n }\n\n genericAction.setAttributes(attributes);\n\n // Request parameters\n //\n Hashtable<String, Object> parameters = new Hashtable<String, Object>();\n\n for (Enumeration e = req.getParameterNames(); e.hasMoreElements();) {\n\n String attName = (String) e.nextElement();\n\n parameters.put(attName, req.getParameter(attName));\n }\n\n genericAction.setParameters(parameters);\n\n // Request session attributes\n //\n Hashtable<String, Object> sessionAttributes = new Hashtable<String, Object>();\n\n for (Enumeration e = req.getSession().getAttributeNames(); e.hasMoreElements();) {\n\n String attName = (String) e.nextElement();\n\n sessionAttributes.put(attName, req.getSession().getAttribute(attName));\n }\n\n genericAction.setSessionAttributes(sessionAttributes);\n\n // Resource boundle\n genericAction.setResourceBundle(getResourceBundle(req));\n }",
"private void revokeLogin(long studentID) throws Exception {\n String url = MASTER_URL + MEMBERS + studentID + \".api\";\n\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n con.setDoOutput(true);\n // request method\n con.setRequestMethod(\"PUT\");\n\n // request headers\n con.setRequestProperty(\"token\", USER_TOKEN);\n con.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\n String data = \"user[login_enabled]=0\";\n\n OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());\n\n writer.write(data);\n writer.close();\n\n con.getResponseCode();\n }",
"@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tMap<String, Object> model=modelAndView.getModel();\n\t\tif(model.containsKey(RetInfos.SUCCESS))\n\t\t{\n\t\t\trequest.getSession().removeAttribute( CommonConstants.SSM_TOKEN );\n\t\t}\n\t\t\n\t\tsuper.postHandle(request, response, handler, modelAndView);\n\t}",
"@ApiOperation(value=\"Login\", notes=\"Login action\")\n @RequestMapping(value=\"/user/unregister\",method= RequestMethod.POST)\n @ResponseBody\n public RetObject unregisterHomeconnect(@ApiParam(value = \"account unregister\", required = true)@RequestHeader(value = \"PlatID\", required = true) String platID,@RequestHeader(value = \"AppID\", required = false) String appID,\n @RequestHeader HttpHeaders httpHeaders,\n @RequestBody(required = false) BSHDeviceReqVO body){\n String url = \"/v1/user/unregister\";\n RetObject result = RetObject.tokenError();\n Map<String,String> headerMap = new HashedMap();\n headerMap.put(\"PlatID\", platID);\n headerMap.put(\"AppID\", appID);\n String headers = getJSONString(headerMap);\n String bodyText = getJSONString(body);\n Error headerError = validateHeaders(platID,appID);\n Error bodyError = validateRequestBodyUserID(body);\n if (bodyError == null && headerError == null){\n result = RetObject.success();\n }\n return result;\n}",
"@Override\n public void performLogout(){\n }",
"@Override\n\tpublic void credite() {\n\t\t\n\t}",
"protected void beforeSessionManagerDestroyed() {\n }",
"void stopAuthentication() {\n if (biometricPrompt != null) {\n biometricPrompt.cancelAuthentication();\n biometricPrompt = null;\n }\n }",
"public static void logout() {\n userId = -1;\n aisId = -1;\n \n name = \"\";\n role = \"\";\n roleFromDatabase = \"\";\n \n lastAction = LocalDateTime.now().minusYears(100);\n }",
"@POST\n @Path(\"/\")\n public Response logout() {\n if (!FeatureFlags.API_SESSION_AUTH.enabled()) {\n return error(Response.Status.INTERNAL_SERVER_ERROR, \"This endpoint is only available when session authentication feature flag is enabled\");\n }\n if (!session.getUser().isAuthenticated()) {\n return error(Response.Status.BAD_REQUEST, \"No valid session cookie was sent in the request\");\n }\n session.setUser(null);\n session.setStatusDismissed(false);\n return ok(\"User logged out\");\n }",
"private void clearLoginRes() {\n if (rspCase_ == 6) {\n rspCase_ = 0;\n rsp_ = null;\n }\n }",
"private void removePlugIn(WebSocketConnector aConnector, Token aToken) {\n\t\tif (mService == null) {\n\t\t\tmService = new AdminPlugInService(NS_ADMIN, mNumberOfDays, getServer());\n\t\t}\n\n\t\tif (mLog.isDebugEnabled()) {\n\t\t\tmLog.debug(\"Processing 'removePlugIn'...\");\n\t\t}\n\n\t\tgetServer().sendToken(aConnector, mService.removePlugIn(aConnector, aToken));\n\t}",
"@Before\n public void setup() throws IOException, SAXException {\n j.jenkins.setSecurityRealm(realm);\n client = j.createWebClient();\n logout(client);\n\n app = ListAppender.getListAppender(\"AuditList\").clear();\n }",
"private void initialize()\r\n {\r\n this.workspace = null;\r\n this.currentUser = null;\r\n this.created = new Date();\r\n this.securityInfo = null;\r\n }",
"public void postRequest() {\n apiUtil = new APIUtil();\n // As this is an API call , we are not setting up any base url but defining the individual calls\n apiUtil.setBaseURI(configurationReader.get(\"BaseURL\"));\n //This is used to validate the get call protected with basic authentication mechanism\n basicAuthValidation();\n scenario.write(\"Request body parameters are :-\");\n SamplePOJO samplePOJO = new SamplePOJO();\n samplePOJO.setFirstName(scenarioContext.getContext(\"firstName\"));\n samplePOJO.setLastName(scenarioContext.getContext(\"lastName\"));\n\n ObjectMapper objectMapper = new ObjectMapper();\n try {\n apiUtil.setRequestBody(objectMapper.writeValueAsString(samplePOJO));\n } catch (JsonProcessingException e) {\n e.printStackTrace();\n }\n }",
"@Override\n\tpublic void undo() {\n\t\tsecurity.off();\n\t}"
] | [
"0.5515865",
"0.5298604",
"0.51935166",
"0.5145339",
"0.4968647",
"0.49077016",
"0.4876369",
"0.48761368",
"0.48144177",
"0.4794052",
"0.47741774",
"0.4729749",
"0.47026467",
"0.47001538",
"0.4695604",
"0.46892327",
"0.46774557",
"0.4676658",
"0.46710178",
"0.4658941",
"0.464964",
"0.46368885",
"0.4635444",
"0.46254537",
"0.4624271",
"0.46151763",
"0.46099606",
"0.46083352",
"0.457602",
"0.45744684",
"0.4564879",
"0.4564682",
"0.45591682",
"0.45555916",
"0.45425558",
"0.45381084",
"0.45377368",
"0.45320752",
"0.4530974",
"0.4529217",
"0.45245883",
"0.45194185",
"0.45147094",
"0.45128077",
"0.45118037",
"0.45092854",
"0.45067972",
"0.4506041",
"0.4492602",
"0.44852006",
"0.44834876",
"0.44768322",
"0.44710776",
"0.44707137",
"0.44705194",
"0.44659358",
"0.44656733",
"0.4465283",
"0.44597262",
"0.44549966",
"0.44516346",
"0.44394502",
"0.44360083",
"0.4434882",
"0.44348413",
"0.44228786",
"0.4421263",
"0.44199437",
"0.441387",
"0.4411577",
"0.44097862",
"0.44079047",
"0.4405261",
"0.4404092",
"0.4398939",
"0.43888846",
"0.43878108",
"0.43768024",
"0.4371731",
"0.43696344",
"0.43631852",
"0.43626305",
"0.4357736",
"0.43562847",
"0.4349237",
"0.43462676",
"0.43304083",
"0.43292165",
"0.43277124",
"0.4322739",
"0.43225464",
"0.43209925",
"0.43206573",
"0.4314898",
"0.43110794",
"0.43099266",
"0.43096852",
"0.43059337",
"0.43051592",
"0.4301921"
] | 0.6004736 | 0 |
Returns a function that will return if a build should fail due to user configuration and the response to a request made | private Predicate<Response> shouldErrorFailBuild(boolean skipFailures){
return x -> skipFailures || x.isSuccessful();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }",
"@Override\r\n protected Result check() throws Exception {\n try {\r\n Response response = webTarget.request().get();\r\n\r\n if (!response.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL)) {\r\n\r\n return Result.unhealthy(\"Received status: \" + response.getStatus());\r\n }\r\n\r\n return Result.healthy();\r\n } catch (Exception e) {\r\n\r\n return Result.unhealthy(e.getMessage());\r\n }\r\n }",
"boolean isFailure();",
"String failureReason();",
"default boolean checkForError(HttpResponse response) {\n parameters.clear();\n\n\n if (response.getStatusCode() == 500) {\n System.out.println(\"Internal server error\");\n return true;\n } else if (response.getStatusCode() == 400) {\n System.out.println(\"Your input was not as expected. Use \\\"help\\\"-command to get more help.\");\n System.out.println(response.getBody());\n return true;\n } else if (response.getStatusCode() == 404) {\n System.out.println(\"The resource you were looking for could not be found. Use \\\"help\\\"-command to get more help.\");\n }\n\n return false;\n\n }",
"public boolean needsProblem();",
"boolean isSuccessful();",
"@Override\n\tpublic void onConfigurationFailure(ITestResult itr) {\n\t\t\n\t}",
"@Override\n boolean isFailed() {\n return false;\n }",
"boolean isFail();",
"Response build(HttpStatus errorStatus);",
"public void validateSettings() {\n \n \t\ttry {\n \t\t\tfinal String serverUrl = getServerUrl();\n \t\t\tfinal String newUserId = getUserName();\n \t\t\tfinal String newPassword = getPassword();\n \t\t\tfinal boolean isAnonymous = isAnonymousAccess();\n \t\t\tfinal String newEncoding = getCharacterEncoding();\n \t\t\tfinal String httpAuthUser = getHttpAuthUserId();\n \t\t\tfinal String httpAuthPass = getHttpAuthPassword();\n \t\t\tfinal boolean checkVersion = repositoryVersionCombo.getSelectionIndex() == 0;\n \t\t\tfinal String[] version = new String[1];\n \t\t\tgetWizard().getContainer().run(true, false, new IRunnableWithProgress() {\n \t\t\t\tpublic void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {\n \t\t\t\t\tif (monitor == null) {\n \t\t\t\t\t\tmonitor = new NullProgressMonitor();\n \t\t\t\t\t}\n \t\t\t\t\ttry {\n \t\t\t\t\t\tmonitor.beginTask(\"Validating server settings\", IProgressMonitor.UNKNOWN);\n \t\t\t\t\t\tBugzillaClient client = null;\n \t\t\t\t\t\tif (!isAnonymous && version != null) {\n \t\t\t\t\t\t\tclient = BugzillaClientFactory.createClient(serverUrl, newUserId, newPassword,\n \t\t\t\t\t\t\t\t\thttpAuthUser, httpAuthPass, newEncoding);\n \t\t\t\t\t\t\tclient.validate();\t\t\t\t\t\t\t\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (checkVersion && client != null) {\n \t\t\t\t\t\t\tRepositoryConfiguration config = client.getRepositoryConfiguration();\n \t\t\t\t\t\t\tif (config != null) {\n \t\t\t\t\t\t\t\tversion[0] = config.getInstallVersion();\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t}\n \t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\tthrow new InvocationTargetException(e);\n \t\t\t\t\t} finally {\n \t\t\t\t\t\tmonitor.done();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t});\n \n \t\t\t// getWizard().getContainer().run(true, false, new\n \t\t\t// IRunnableWithProgress() {\n \t\t\t// public void run(IProgressMonitor monitor) throws\n \t\t\t// InvocationTargetException, InterruptedException {\n \t\t\t// monitor.beginTask(\"Validating server settings\",\n \t\t\t// IProgressMonitor.UNKNOWN);\n \t\t\t// try {\n \t\t\t//\n \t\t\t// // Check that the server exists and we can connect\n \t\t\t// // (proxy or not)\n \t\t\t// Proxy proxySettings =\n \t\t\t// TasksUiPlugin.getDefault().getProxySettings();\n \t\t\t// WebClientUtil.openUrlConnection(serverURL, proxySettings, false,\n \t\t\t// httpAuthUser, httpAuthPass);\n \t\t\t//\n \t\t\t// if (!isAnonymous) {\n \t\t\t// // Server exists, connect to service and validate\n \t\t\t// // credentials\n \t\t\t// BugzillaClient.validateCredentials(proxySettings, serverUrl,\n \t\t\t// newEncoding, newUserId,\n \t\t\t// newPassword);\n \t\t\t// }\n \t\t\t//\n \t\t\t// if (checkVersion) {\n \t\t\t// RepositoryConfiguration config =\n \t\t\t// BugzillaCorePlugin.getRepositoryConfiguration(true,\n \t\t\t// serverUrl, proxySettings, newUserId, newPassword, newEncoding);\n \t\t\t//\n \t\t\t// if (config != null) {\n \t\t\t// version[0] = config.getInstallVersion();\n \t\t\t// }\n \t\t\t// }\n \t\t\t//\n \t\t\t// } catch (Exception e) {\n \t\t\t// throw new InvocationTargetException(e);\n \t\t\t// } finally {\n \t\t\t// monitor.done();\n \t\t\t// }\n \t\t\t// }\n \t\t\t// });\n \n \t\t\tif (version[0] != null) {\n \t\t\t\tsetBugzillaVersion(version[0]);\n \t\t\t}\n \n \t\t\tif (!testing) {\n \t\t\t\tMessageDialog.openInformation(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,\n \t\t\t\t\t\t\"Authentication credentials are valid.\");\n \t\t\t}\n \t\t} catch (InvocationTargetException e) {\n \t\t\tif (e.getCause() instanceof MalformedURLException) {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG, \"Server URL is invalid.\");\n \t\t\t} else if (e.getCause() instanceof LoginException) {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,\n \t\t\t\t\t\t\"Unable to authenticate with server.\\n\\n\" + e.getCause().getMessage());\n \t\t\t} else if (e.getCause() instanceof IOException) {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG,\n \t\t\t\t\t\t\"No Bugzilla server found at url\");\n \t\t\t} else {\n \t\t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG, MESSAGE_FAILURE_UNKNOWN);\n \t\t\t}\n \t\t} catch (InterruptedException e) {\n \t\t\tMessageDialog.openWarning(null, IBugzillaConstants.TITLE_MESSAGE_DIALOG, MESSAGE_FAILURE_UNKNOWN);\n \t\t}\n \n \t\tsuper.getWizard().getContainer().updateButtons();\n \t}",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"public Result check(ConfigContext context)\n {\n Result result;\n result = super.getInitializedResult();\n //<addition author=\"irfan@sun.com\" [bug/RFE]-id=\"\" >\n // 8.0 XML Verifier\n /*try {\n Server server = (Server)context.getRootConfigBean();\n JmsService jms = server.getJmsService();\n String httpPort = jms.getPort();\n try {\n if(StaticTest.isPortValid(Integer.parseInt(httpPort))) \n result.passed(\"Valid Port\");\n else\n result.failed(\"Invalid JMSService Port - \" + httpPort);\n }\n catch(NumberFormatException e) {\n result.failed(\"Invalid JMSService Port Number - \" + httpPort);\n }\n // Bug : 4713369\n try {\n String timeout = jms.getInitTimeoutInSeconds();\n if(Integer.parseInt(timeout) < 0)\n result.failed(smh.getLocalString(getClass().getName()+\".initTimeoutNegative\",\"Init Timeout cannot be negative number\"));\n else\n result.passed(\"** Passed ** \");\n } catch(NumberFormatException e) {\n result.failed(smh.getLocalString(getClass().getName()+\".initTimeoutInvalid\",\"Init Timeout : invalid number\"));\n }\n }\n catch(Exception ex) {\n //<addition author=\"irfan@sun.com\" [bug/rfe]-id=\"logging\" >\n /*ex.printStackTrace();\n result.failed(\"Exception : \" + ex.getMessage());\n // Logging\n _logger.log(Level.FINE, \"serverxmlverifier.exception\", ex);\n result.failed(\"Exception : \" + ex.getMessage());\n //</addition>\n }*/\n //</addition>\n return result;\n }",
"private CommentedConfiguration flagAsFailed() {\n creationFailure = true;\n return this;\n }",
"@Override\n boolean canFail() {\n return true;\n }",
"@Override\n public String getGerritCmdBuildNotBuilt() {\n return \"CHANGE=<CHANGE>\"\n + \" CHANGE_ID=<CHANGE_ID>\"\n + \" PATCHSET=<PATCHSET>\"\n + \" VERIFIED=<VERIFIED>\"\n + \" CODEREVIEW=<CODE_REVIEW>\"\n + \" NOTIFICATION_LEVEL=<NOTIFICATION_LEVEL>\"\n + \" REFSPEC=<REFSPEC>\"\n + \" MSG='No Builds Executed <BUILDS_STATS>'\";\n }",
"String getFailureMessage();",
"public String getUrlPassStatus()\r\n\t{\r\n\t\t\r\n\t\tUrlPassLevel FinalResultForBaseUrl ;\r\n\t\tUrlPassLevel FinalResultForRedirectionUrl ;\r\n\t\tUrlPassLevel FinalResultForUrl ;\r\n\r\n\t\tif(Configuration.CheckUrlRedirection && this.isErrorPage)\r\n\t\t\treturn Configuration.getConstant(\"Display_Message_For_Failed_Url\");\r\n\t\t\r\n\t\tif(!Configuration.CheckUrlPattern)\r\n\t\t\treturn Configuration.getConstant(\"Display_Message_For_Passed_Url\");\r\n\t\t\t\t\r\n\r\n\t\tif(Configuration.CheckUrlRedirection && this.exceptionType.equals(UrlExceptionLevel.IgnorePatternMatching))\r\n\t\t{\r\n\t\t\tif(this.isErrorPage)\r\n\t\t\t\treturn Configuration.getConstant(\"Display_Message_For_Failed_Url\");\r\n\t\t\telse\r\n\t\t\t\treturn Configuration.getConstant(\"Display_Message_For_Passed_Url\");\r\n\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\tif(this.isBaseUrlLocalized)\r\n\t\t{\r\n\t\t\tif(this.followsExactConfigUrlPattern)\r\n\t\t\t\tFinalResultForBaseUrl = UrlPassLevel.Passed;\r\n\t\t\telse if(this.followsConfigUrlPattern)\r\n\t\t\t\tFinalResultForBaseUrl = UrlPassLevel.PassedWithException;\r\n\t\t\telse\r\n\t\t\t\tFinalResultForBaseUrl = UrlPassLevel.Failed;\r\n\t\t\t\r\n\t\t}else\r\n\t\t{\r\n\t\t\tif(this.getExceptionType().equals(UrlExceptionLevel.UnlocalizedBaseUrl))\r\n\t\t\t\tFinalResultForBaseUrl = UrlPassLevel.Passed;\r\n\t\t\telse if(this.configUrlPattern.equals(this.configEngUrl))\r\n\t\t\t\tFinalResultForBaseUrl = UrlPassLevel.PassedWithException;\r\n\t\t\telse\r\n\t\t\t\tFinalResultForBaseUrl = UrlPassLevel.Failed;\r\n\t\t}\r\n\t\t\r\n\t\tif(Configuration.CheckUrlRedirection)\r\n\t\t{\r\n\t\t\tif(this.isRedirectedUrlLocalized)\r\n\t\t\t{\r\n\t\t\t\tif(this.followsExactConfigRedirectedUrlPattern)\r\n\t\t\t\t\tFinalResultForRedirectionUrl = UrlPassLevel.Passed;\r\n\t\t\t\telse if(this.followsConfigRedirectedUrlPattern)\r\n\t\t\t\t\tFinalResultForRedirectionUrl = UrlPassLevel.PassedWithException;\r\n\t\t\t\telse\r\n\t\t\t\t\tFinalResultForRedirectionUrl = UrlPassLevel.Failed;\r\n\t\t\t\t\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\tif((this.getExceptionType().equals(UrlExceptionLevel.UnlocalizedBaseUrl))\r\n\t\t\t\t\t\t||this.getExceptionType().equals(UrlExceptionLevel.UnlocalizedRedirectedUrl))\r\n\t\t\t\t\tFinalResultForRedirectionUrl = UrlPassLevel.Passed;\r\n\t\t\t\telse if(this.configRedirectedUrlPattern.equals(this.configEngRedirectedUrl))\r\n\t\t\t\t\tFinalResultForRedirectionUrl = UrlPassLevel.PassedWithException;\r\n\t\t\t\telse\r\n\t\t\t\t\tFinalResultForRedirectionUrl = UrlPassLevel.Failed;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tFinalResultForRedirectionUrl = UrlPassLevel.Passed;\r\n\t\t\r\n\t\t\t\r\n\t\tif(FinalResultForRedirectionUrl.equals(FinalResultForBaseUrl))\r\n\t\t\tFinalResultForUrl = FinalResultForBaseUrl;\r\n\t\t\r\n\t\telse if( FinalResultForBaseUrl.equals(UrlPassLevel.Failed) || FinalResultForRedirectionUrl.equals(UrlPassLevel.Failed) )\r\n\t\t\tFinalResultForUrl = UrlPassLevel.Failed;\r\n\r\n\t\telse if( FinalResultForBaseUrl.equals(UrlPassLevel.PassedWithException) || FinalResultForRedirectionUrl.equals(UrlPassLevel.PassedWithException) )\r\n\t\t\tFinalResultForUrl = UrlPassLevel.PassedWithException;\r\n\t\t\r\n\t\telse\r\n\t\t\tFinalResultForUrl = UrlPassLevel.Passed;\r\n\r\n\r\n\t\t\r\n\t\tif(FinalResultForUrl.equals(UrlPassLevel.Passed))\r\n\t\t\treturn Configuration.getConstant(\"Display_Message_For_Passed_Url\");\r\n\t\telse if(FinalResultForUrl.equals(UrlPassLevel.PassedWithException))\r\n\t\t\treturn Configuration.getConstant(\"Display_Message_For_PassedWithException_Url\");\r\n\t\telse\r\n\t\t\treturn Configuration.getConstant(\"Display_Message_For_Failed_Url\");\r\n\t}",
"protected abstract BuildFailureException newBuildFailureException(int errorCount);",
"public void onConfigurationFailure(ITestResult arg0) {\n\t\t System.out.println(arg0.getMethod());\n\t\tif (arg0.getMethod().isBeforeMethodConfiguration()) {\n\n\t\t\t// beforeResult = arg0;\n\t\t\tObject[] parameters = arg0.getParameters();\n\t\t\tString methodName = null;\n\t\t\tif (parameters.length > 0) {\n\t\t\t\tif (parameters[1] instanceof Method) {\n\t\t\t\t\tmethodName = ((Method) parameters[1]).getName();\n\t\t\t\t\tString fullyQualifiedMethodName = arg0.getMethod().getInstance().getClass().getName() + \".\"\n\t\t\t\t\t\t\t+ methodName;\n\t\t\t\t\tlistOfBeforeResultsPerTestCase.put(fullyQualifiedMethodName, arg0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (arg0.getMethod().isAfterMethodConfiguration()) {\n\t\t\t// mAfterMethodConfigResult.put(testname, arg0);\n\t\t\t//generateResultReport(arg0);\n\t\t} else if (arg0.getMethod().isBeforeSuiteConfiguration()) {\n\t\t\tcreateSuiteReport(arg0.getTestContext());\n\t\t} else if (arg0.getMethod().isAfterSuiteConfiguration()) {\n\t\t\tclosingSuiteReport(arg0.getTestContext().getSuite());\n\t\t}\n\t}",
"public void doCheckRhapsodyConfiguration(StaplerRequest req, StaplerResponse rsp, @QueryParameter final String value) throws IOException, ServletException {\n new FormFieldValidator(req,rsp,null) {\n /**\n * The real check goes here. In the end, depending on which\n * method you call, the browser shows text differently.\n */\n protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify a configuration\");\n else {\n \t\t//TODO add more checks\n \t\tok();\n }\n }\n }.process();\n }",
"Object getFailonerror();",
"Object getFailonerror();",
"protected boolean isFailureOrRecovery(AbstractBuild<?, ?> build) {\n if (build.getResult() == Result.FAILURE || build.getResult() == Result.UNSTABLE) {\n return true;\n } else if (build.getResult() == Result.SUCCESS) {\n AbstractBuild<?, ?> previousBuild = build.getPreviousBuild();\n if (previousBuild != null && previousBuild.getResult() != Result.SUCCESS) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"private boolean checkProperties(IConfiguration buildcfg, AVRProjectProperties props) {\n\n\t\tboolean perconfig = ProjectPropertyManager.getPropertyManager(fProject).isPerConfig();\n\t\tString source = perconfig ? SOURCE_BUILDCONFIG : SOURCE_PROJECT;\n\n\t\t// Check that a Programmer has been selected\n\t\tif (props.getAVRDudeProperties().getProgrammer() == null) {\n\t\t\tString message = MessageFormat.format(MSG_NOPROGRAMMER, source);\n\t\t\tMessageDialog.openError(getShell(), TITLE_UPLOAD, message);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the MCU is valid for avrdude\n\t\tString mcuid = props.getMCUId();\n\t\tif (!AVRDude.getDefault().hasMCU(mcuid)) {\n\t\t\tString message = MessageFormat.format(MSG_WRONGMCU, AVRMCUidConverter.id2name(mcuid));\n\t\t\tMessageDialog.openError(getShell(), TITLE_UPLOAD, message);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that there is actually anything to upload\n\t\tList<String> actionlist = props.getAVRDudeProperties().getActionArguments(buildcfg, true);\n\t\tif (actionlist.size() == 0) {\n\t\t\tString message = MessageFormat.format(MSG_NOACTIONS, source);\n\t\t\tMessageDialog.openWarning(getShell(), TITLE_UPLOAD, message);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check all referenced files\n\t\t// It would be cumbersome to go through all possible cases. Instead we\n\t\t// convert all action arguments back to AVRDudeActions and get the\n\t\t// filename from it.\n\t\tIPath invalidfile = null;\n\t\tString formemtype = null;\n\t\tfor (String argument : actionlist) {\n\t\t\tAVRDudeAction action = AVRDudeAction.getActionForArgument(argument);\n\t\t\tString filename = action.getFilename();\n\t\t\tif (filename == null)\n\t\t\t\tcontinue;\n\t\t\tIPath rawfile = new Path(filename);\n\t\t\tIPath unresolvedfile = rawfile;\n\t\t\tIPath resolvedfile = rawfile;\n\t\t\tif (!rawfile.isAbsolute()) {\n\t\t\t\t// The filename is relative to the build folder. Get the build\n\t\t\t\t// folder and append our filename. Then resolve any macros\n\t\t\t\tunresolvedfile = buildcfg.getBuildData().getBuilderCWD().append(rawfile);\n\t\t\t\tresolvedfile = new Path(BuildMacro.resolveMacros(buildcfg, unresolvedfile\n\t\t\t\t\t\t.toString()));\n\t\t\t}\n\t\t\tFile realfile = resolvedfile.toFile();\n\t\t\tif (!realfile.canRead()) {\n\t\t\t\tinvalidfile = unresolvedfile;\n\t\t\t\tformemtype = action.getMemType().toString();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (invalidfile != null) {\n\t\t\tString message = MessageFormat.format(MSG_MISSING_FILE, invalidfile.toString(),\n\t\t\t\t\tformemtype);\n\t\t\tMessageDialog.openError(getShell(), TITLE_UPLOAD, message);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the fuses and locks are valid (if they are to be uploaded)\n\t\tfor (FuseType type : FuseType.values()) {\n\n\t\t\tif (props.getAVRDudeProperties().getBytesProperties(type, buildcfg).getWrite()) {\n\t\t\t\tBaseBytesProperties bytesproperties = props.getAVRDudeProperties()\n\t\t\t\t\t\t.getBytesProperties(type, buildcfg);\n\t\t\t\tif (bytesproperties.getMCUId() == null) {\n\t\t\t\t\t// A non-existing file has been selected as source for the fuses\n\t\t\t\t\tString message = MessageFormat.format(MSG_MISSING_FUSES_FILE, type.toString(),\n\t\t\t\t\t\t\tbytesproperties.getFileNameResolved());\n\t\t\t\t\tMessageDialog.openError(getShell(), TITLE_UPLOAD, message);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (!bytesproperties.isCompatibleWith(props.getMCUId())) {\n\t\t\t\t\tString fusesmcuid = AVRMCUidConverter.id2name(bytesproperties.getMCUId());\n\t\t\t\t\tString propsmcuid = AVRMCUidConverter.id2name(props.getMCUId());\n\t\t\t\t\tString message = MessageFormat.format(MSG_INVALIDFUSEBYTE, type.toString(),\n\t\t\t\t\t\t\tfusesmcuid, propsmcuid, source);\n\t\t\t\t\tMessageDialog.openError(getShell(), TITLE_UPLOAD, message);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Everything is OK\n\t\treturn true;\n\t}",
"@Test(expected = UsernameNotFoundException.class)\n public void createNewComputerBuildFailure() {\n ComputerBuild computerBuild = createComputerBuild(SAMPLE_BUDGET_COMPUTER_BUILD_NAME, SAMPLE_GAMING_COMPUTER_BUILD_DESCRIPTION);\n computerBuildService.createNewComputerBuild(computerBuild);\n }",
"@Test(priority=1)\r\n\tpublic void validateStatusCode()\r\n\t{\r\n\t\tgiven()\r\n\t\t.get(\"https://reqres.in/api/users/2\")\r\n\t\t.then()\r\n\t\t.statusCode(200);\r\n\t\t\r\n\t}",
"boolean hasIsSuccess();",
"@Test\n public void testRunConditionalWorkflowFailedPreviousResponse() {\n StepWorkflow.ConditionalBuilder<Integer, Integer> andSometimesConditional = unsuccessfulBuilderOfSupplierException.andSometimes(subStepSupplierDataTwo);\n StepWorkflow.Builder<Object> butOnlyIfBuilder = andSometimesConditional.butOnlyIf(new Object(), ignored -> true);\n assertEquals(subStepSupplierException, butOnlyIfBuilder.start.step);\n assertNotNull(butOnlyIfBuilder.start.next);\n assertEquals(butOnlyIfBuilder.start.next.step, butOnlyIfBuilder.end.step);\n assertNull(butOnlyIfBuilder.end.next);\n\n // Create and validate then() Builder\n StepWorkflow.Builder<Integer> thenBuilder = butOnlyIfBuilder.then(subStepSupplierDataThree);\n assertEquals(subStepSupplierException, thenBuilder.start.step);\n assertNotNull(thenBuilder.start.next);\n assertEquals(subStepSupplierDataThree, thenBuilder.end.step);\n assertEquals(subStepSupplierException, thenBuilder.start.step);\n assertNotNull(thenBuilder.start.next.step);\n assertNull(thenBuilder.end.next);\n\n // Run and validate build()\n StepWorkflow<Integer> buildStepWorkflow = thenBuilder.build();\n assertEquals(thenBuilder.start, buildStepWorkflow.start);\n assertEquals(thenBuilder.end, buildStepWorkflow.end);\n\n // Call run() and validate return StepWorkflowResponse\n StepWorkflowResponse<Integer> response = buildStepWorkflow.run();\n assertFalse(response.wasSuccessful());\n assertNull(response.getData());\n assertEquals(integrationException, response.getException());\n }",
"boolean hadErrors();",
"boolean isFailOnError() {\n return failOnError;\n }",
"protected void performGenericAuthorizationEndpointErrorResponseValidation() {\n\t\tcallAndContinueOnFailure(CheckStateInAuthorizationResponse.class, ConditionResult.FAILURE);\n\t\t// as https://tools.ietf.org/html/draft-ietf-oauth-iss-auth-resp is still a draft we only warn if the value is wrong,\n\t\t// and do not require it to be present.\n\t\tcallAndContinueOnFailure(ValidateIssInAuthorizationResponse.class, ConditionResult.WARNING, \"OAuth2-iss-2\");\n\t\tcallAndContinueOnFailure(EnsureErrorFromAuthorizationEndpointResponse.class, ConditionResult.FAILURE, \"OIDCC-3.1.2.6\");\n\t\tcallAndContinueOnFailure(RejectAuthCodeInAuthorizationEndpointResponse.class, ConditionResult.FAILURE, \"OIDCC-3.1.2.6\");\n\t\tcallAndContinueOnFailure(CheckForUnexpectedParametersInErrorResponseFromAuthorizationEndpoint.class, ConditionResult.WARNING, \"OIDCC-3.1.2.6\");\n\t\tcallAndContinueOnFailure(CheckErrorDescriptionFromAuthorizationEndpointResponseErrorContainsCRLFTAB.class, ConditionResult.WARNING, \"RFC6749-4.1.2.1\");\n\t\tcallAndContinueOnFailure(ValidateErrorDescriptionFromAuthorizationEndpointResponseError.class, ConditionResult.FAILURE,\"RFC6749-4.1.2.1\");\n\t\tcallAndContinueOnFailure(ValidateErrorUriFromAuthorizationEndpointResponseError.class, ConditionResult.FAILURE,\"RFC6749-4.1.2.1\");\n\t}",
"public void requestForgetLastBuildState() {\n \t\trequestForgetState = true;\n \t}",
"static void return_unconditionally(String passed){\n\t\tcomplete_return_requirements();\n\t}",
"protected void validateConfiguration() {}",
"public void onFailure();",
"@Test\n public void testFailureFailsToResolve() throws NoSuchAlgorithmException, ComponentInitializationException {\n resolver.resolve = false;\n ActionTestingSupport.assertEvent(action.execute(requestCtx), EventIds.INVALID_SEC_CFG);\n }",
"@POST\n public FormValidation doValidate(\n @QueryParameter String kernel,\n @QueryParameter String launchTimeout,\n @QueryParameter String maxResults)\n throws Exception {\n\n if (Util.fixEmptyAndTrim(kernel) != null) {\n try{\n // Disable GRPC internal exceptions due to SEVERE log message when closing kernel interpreter\n GRPC_IO_LOGGER.setLevel(Level.OFF);\n IPythonUserConfig userConfig = new IPythonUserConfig(kernel, Integer.parseInt(launchTimeout)*1000, Integer.parseInt(maxResults), \".\");\n try (InterpreterManager interpreterManager = new IPythonInterpreterManager(userConfig)) {\n interpreterManager.initiateInterpreter();\n if (interpreterManager.testConnection()) {\n return FormValidation.ok(\"Connection Successful\");\n } else {\n return FormValidation.error(\"Connection failed\");\n }\n } catch (InterpreterException exception) {\n return FormValidation.error(\"No \" + kernel + \" kernel available\");\n }\n } catch (NumberFormatException ex){\n return FormValidation.error(\"Number/s is/are not valid \");\n }finally {\n GRPC_IO_LOGGER.setLevel(GRPC_IO_LOGGER_ORIGINAL_LEVEL);\n }\n }\n return FormValidation.warning(\"kernel name is required. Click on help for more info\");\n }",
"protected boolean shouldSend(XMLLogHelper logHelper) throws CruiseControlException {\n if (logHelper.isBuildSuccessful()) {\n if (reportSuccess.equalsIgnoreCase(\"always\")) {\n return true;\n }\n if (reportSuccess.equalsIgnoreCase(\"fixes\")) {\n if (logHelper.wasPreviousBuildSuccessful()) {\n LOG.debug(\n \"reportSuccess is set to 'fixes', not sending emails for repeated successful builds.\");\n return false;\n } else {\n return true;\n }\n }\n if (reportSuccess.equalsIgnoreCase(\"never\")) {\n LOG.debug(\n \"reportSuccess is set to 'never', not sending emails for successful builds.\");\n return false;\n }\n } else { //build wasn't successful\n if (!logHelper.wasPreviousBuildSuccessful()\n && logHelper.isBuildNecessary()\n && !spamWhileBroken) {\n \n LOG.debug(\"spamWhileBroken is set to false, not sending email\");\n return false;\n }\n }\n return true;\n }",
"public BuildException getException() {\n return failure;\n }",
"private boolean checkBackend() {\n \ttry{\n \t\tif(sendRequest(generateURL(0,\"1\")) == null ||\n \tsendRequest(generateURL(1,\"1\")) == null)\n \t\treturn true;\n \t} catch (Exception ex) {\n \t\tSystem.out.println(\"Exception is \" + ex);\n\t\t\treturn true;\n \t}\n\n \treturn false;\n \t}",
"public boolean configurationIsValid() {\n\t\tif (this.maxThreadNumberResourceWorker + this.maxThreadNumberSeedWorker != this.maxThreadNumber) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Thread number configuration is wrong.\"));\n\t\t\treturn false;\n\t\t} else if (seedList == null || seedList.size() == 0) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Seed list is empty.\"));\n\t\t\treturn false;\n\t\t} else if (StringUtils.isEmpty(workspacePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Workspace path is not set correctly.\"));\n\t\t\treturn false;\n\t\t} else if (!Files.exists(runtimeBasePath)) {\n\t\t\tlog.error(Logging.format(\"Confirguation error: Runtime directory ({}) does not exist.\", runtimeBasePath));\n\t\t\treturn false;\n\t\t}\n\t\tlog.info(Logging.format(\"Configuration check is passed.\"));\n\t\treturn true;\n\t}",
"public boolean buildWebRequest(Document requestDoc, MDCheckData data, List<MDCheckRequest> requests, boolean testing) throws KettleException {\n\t\treturn false;\n\n\t}",
"@Override\n protected Result check()\n {\n return this.gitLabModeInfos.isEmpty() ? Result.unhealthy(\"No GitLab modes available\") : Result.healthy();\n }",
"@Override\n public void checkConfiguration() {\n }",
"public boolean getSendErrorToClient();",
"public void onApiRequestFailed();",
"public boolean checkSelf() {\n\t\tboolean ok = true;\n\t\tif (controller == null) {\n\t\t\tSystem.err.println(\"CRParameters :: controller not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (scenario.length() == 0 && controller.getWorld().getHasScenarios()) {\n\t\t\tSystem.err.println(\"CRParameters :: scenario not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (reportFolderName.length() == 0) {\n\t\t\tSystem.err.println(\"CRParameters :: report folder not set\");\n\t\t\tok = false;\n\t\t}\n\t\tif (trialDuration <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: trial duration not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\tif (numOfRuns <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: number of runs not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\tif (numOfTrials <= 0) {\n\t\t\tSystem.err.println(\"CRParameters :: number of trials not set or 0\");\n\t\t\tok = false;\n\t\t}\n\t\treturn ok;\n\t}",
"@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n // Hide Progress Dialog\n prgDialog.hide();\n // When Http response code is '400'\n if(statusCode == 400){\n Toast.makeText(getApplicationContext(), \"Error Creating Donation!!\", Toast.LENGTH_LONG).show();\n }\n // When Http response code is '500'\n else if(statusCode == 500){\n Toast.makeText(getApplicationContext(), \"Something went wrong at server end\", Toast.LENGTH_LONG).show();\n }\n // When Http response code other than 400, 500\n else{\n Toast.makeText(getApplicationContext(), \"Unexpected Error occcured! [Most common Error: Device might not be connected to Internet or remote server is not up and running]\", Toast.LENGTH_LONG).show();\n }\n }",
"public abstract List<Requirement> getFailedChecks();",
"boolean getIsOk();",
"public String networkFailureMessage();",
"void notSupported(String errorcode);",
"boolean hasBuild();",
"@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tfail(\"Request failure: \" + caught.getMessage());\n\t\t\t}",
"@Test\n void testFailure_unrecognizedStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=foo\"));\n }",
"public void notifyBuildFailedToStart(SRunningBuild arg0, Set<SUser> sUsers) {\n\t\t\r\n\t}",
"public boolean wasOkay();",
"@Test\n void testFailure_illegalStatus() {\n assertThrows(\n IllegalArgumentException.class,\n () ->\n runCommandForced(\n \"--client=NewRegistrar\",\n \"--registrar_request=true\",\n \"--reason=Test\",\n \"--domain_name=example.tld\",\n \"--apply=clientRenewProhibited\"));\n }",
"public void testCheckinExceptions() {\n boolean buildEx = false;\n\n // Set up a sosCheckin task\n sosCheckin.setProject(project);\n // No options set - SosServerPath should fail\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"sosserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException SosServerPath\", buildEx);\n buildEx = false;\n\n // Set SosServerPath - Username should fail\n sosCheckin.setSosServerPath(SOS_SERVER_PATH);\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"username attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException Username\", buildEx);\n buildEx = false;\n\n // Set Username - VssServerPath should fail\n sosCheckin.setUsername(SOS_USERNAME);\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"vssserverpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException VssServerPath\", buildEx);\n buildEx = false;\n\n // Set VssServerPath - ProjectPath should fail\n sosCheckin.setVssServerPath(VSS_SERVER_PATH);\n try {\n commandline = sosCheckin.buildCmdLine();\n } catch (BuildException be) {\n if (be.getMessage().compareTo(\"projectpath attribute must be set!\") == 0) {\n buildEx = true;\n }\n }\n assertTrue(\"CheckinException ProjectPath\", buildEx);\n\n // Set ProjectPath - All required options set\n sosCheckin.setProjectPath(VSS_PROJECT_PATH);\n try {\n commandline = sosCheckin.buildCmdLine();\n buildEx = true;\n } catch (BuildException be) {\n buildEx = false;\n }\n assertTrue(\"CheckinException All required options set\", buildEx);\n }",
"protected String onFailure() {\n // Do nothing.\n return \"\";\n }",
"@Test\n public void testBuildDefer() throws Exception {\n mockHttpClient = mock(OptimizelyHttpClient.class);\n\n projectConfigManager = builder()\n .withOptimizelyHttpClient(mockHttpClient)\n .withSdkKey(\"sdk-key\")\n .build(true);\n assertEquals(\"sdk-key\", projectConfigManager.getSDKKey());\n }",
"@Override\n protected Result check() throws Exception { \n try {\n GetOSVersionRes res = this.service.getOSVersion(new GetOSVersionReq());\n // only return the OS name to avoid any potential\n // security problem if the version was exposed...\n return Result.healthy(res.getReturn().getOs().getOsName());\n } catch(Exception e) {\n return Result.unhealthy(e.getMessage());\n }\n }",
"public String formInternalError() \r\n {\r\n return formError(\"500 Internal server error\",\"Server broke\");\r\n }",
"private void canCreateBuildErrorSet(List<String> errorSet, List<String> naSet, String name, int max, int used, int required)\n {\n if(max == 0 && used < 0)\n {\n naSet.add(name + \" ::: Resource information not available.\");\n }\n else if(max == 0 && required > 0)\n {\n naSet.add(name + \" ::: not possible to validate. Information about the resource was not received from the API. \" +\n \"Received ::: Quota: \" + max + \", Available: \" + (max - used) + \", Required: \" + required + \".\");\n }\n //else if(used > max)\n //{\n // naSet.add(name + \" ::: API seems to work incorrectly: used resources cannot be bigger than quota.\");\n //}\n //else if((max - used) <= required)\n else if(!canCreateCheck(max, used, required))\n {\n errorSet.add(name + \" ::: Quota: \" + max + \", Available: \" + (max - used) + \", Required: \" + required + \".\");\n }\n }",
"public abstract R createFailedResult(Status status);",
"@Override\n\tpublic boolean isFailureMode() {\n\t\treturn false;\n\t}",
"@GetMapping(\"setup\")\n @ResponseBody\n public FutError setup() {\n String dataDir = FileUtils.dataDir;\n String listDir = dataDir + File.separator + \"lists\";\n Boolean createDir = fileUtils.createFolder(dataDir);\n Boolean createListDir = fileUtils.createFolder(listDir);\n Boolean createAccountsList = fileUtils.createDataFile(\"accounts\");\n Boolean createAccountExpanded = fileUtils.createDataFile(\"accountDetails\");\n\n FutError futError = null;\n\n if (createDir == null) {\n futError = new FutError();\n String err = \"Something went wrong creating data folder!\";\n futError.setMessage(err);\n log.error(err);\n }\n\n if (createListDir == null) {\n futError = new FutError();\n String err = \"Something went wrong creating lists folder!\";\n futError.setMessage(err);\n log.error(err);\n }\n\n if (createAccountsList == null) {\n futError = new FutError();\n String err = \"Something went wrong creating account list file.\";\n futError.setMessage(err);\n log.error(err);\n }\n\n if (createAccountExpanded == null) {\n futError = new FutError();\n String err = \"Something went wrong creating account expanded file.\";\n futError.setMessage(err);\n log.error(err);\n }\n\n return futError;\n }",
"TestClassExecutionResult assertConfigMethodFailed(String name);",
"@Test\n public void testValidator() throws Exception {\n\n // No warnings/error\n Device device = buildDevice();\n List<Issue> issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 0);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 0);\n\n // Error for missing statusReason\n device = buildDevice().toBuilder().statusReason(Collections.emptyList()).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 1);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 0);\n\n // Warning for statusReason\n device = buildDevice().toBuilder().statusReason(Arrays.asList(\n CodeableConcept.builder().coding(Coding.builder().system(Uri.of(\"http://terminology.hl7.org/CodeSystem/device-status-reason\")).code(Code.of(\"invalidCode\")).build()).build(),\n CodeableConcept.builder().coding(Coding.builder().system(Uri.of(\"invalidSystem\")).code(Code.of(\"online\")).build()).build()\n )).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 0);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 2);\n\n // Warning for type\n device = buildDevice().toBuilder()\n .type(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"tlh\")).build()).build()).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 0);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 1);\n\n // Error for type\n device = buildDevice().toBuilder()\n .type(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"invalidLanguage\")).build()).build()).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 2);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 1);\n\n // Warning and error for specialization.systemType\n device = buildDevice().toBuilder().specialization(Arrays.asList(\n Specialization.builder().systemType(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"tlh\")).build()).build()).build(),\n Specialization.builder().systemType(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"invalidSystem\")).build()).build()).build())).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 2);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 2);\n\n // Warning and error for safety\n device = buildDevice().toBuilder().safety(Arrays.asList(\n CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"tlh\")).build()).build(),\n CodeableConcept.builder().coding(Coding.builder().system(Uri.of(\"invalidSystem\")).code(Code.of(ENGLISH_US)).build()).build()\n )).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 2);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 2);\n\n // Warning for test-language-primary-extension\n device = buildDevice().toBuilder()\n .extension(Collections.singletonList(Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-primary-extension\")\n .value(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"tlh\")).build()).build()).build())).build();\n issues = FHIRValidator.validator().validate(device);\n issues.forEach(System.out::println);\n assertEquals(FHIRValidationUtil.countErrors(issues), 0);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 1);\n\n // Error for test-language-primary-extension\n device = buildDevice().toBuilder()\n .extension(Collections.singletonList(Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-primary-extension\")\n .value(CodeableConcept.builder().coding(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"invalidLanguage\")).build()).build()).build())).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 2);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 1);\n assertEquals(FHIRValidationUtil.countInformation(issues), 1);\n\n // Warning for test-language-secondary-extension\n device = buildDevice().toBuilder()\n .extension(Collections.singletonList(Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-secondary-extension\")\n .value(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"tlh\")).build()).build())).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 0);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 2);\n\n // Error for test-language-secondary-extension\n device = buildDevice().toBuilder()\n .extension(Collections.singletonList(Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-secondary-extension\")\n .value(Coding.builder().system(Uri.of(ValidationSupport.BCP_47_URN)).code(Code.of(\"invalidLanguage\")).build()).build())).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 2);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 2);\n assertEquals(FHIRValidationUtil.countInformation(issues), 1);\n\n // Warning for test-language-tertiary-extension\n device = buildDevice().toBuilder()\n .extension(Collections.singletonList(Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-tertiary-extension\")\n .value(Code.of(\"tlh\")).build())).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 0);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 2);\n\n // Error for test-language-tertiary-extension\n device = buildDevice().toBuilder()\n .extension(Collections.singletonList(Extension.builder().url(\"http://ibm.com/fhir/StructureDefinition/test-language-tertiary-extension\")\n .value(Code.of(\"invalidLanguage\")).build())).build();\n issues = FHIRValidator.validator().validate(device);\n assertEquals(FHIRValidationUtil.countErrors(issues), 2);\n assertEquals(FHIRValidationUtil.countWarnings(issues), 2);\n }",
"private boolean checkExecution() {\n if (!checkPhoneStatusOK()) {\n return false;\n }\n if (!checkBatteryLevelOK()) {\n return false;\n }\n return true;\n }",
"private void validateBuildParameters() {\n if (TextUtils.isEmpty(consumerKey)) {\n throw new IllegalArgumentException(\"CONSUMER_KEY not set\");\n }\n if (TextUtils.isEmpty(consumerSecret)) {\n throw new IllegalArgumentException(\"CONSUMER_SECRET not set\");\n }\n if (TextUtils.isEmpty(token)) {\n throw new IllegalArgumentException(\"TOKEN not set, the user must be logged it\");\n }\n if (TextUtils.isEmpty(tokenSecret)) {\n throw new IllegalArgumentException(\"TOKEN_SECRET not set, the user must be logged it\");\n }\n }",
"protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please type in the License Server\");\n else {\n \t//TODO add more checks\n \tok();\n }\n }",
"public Boolean checkIfValidBuild(){\r\n int buildValue = 0;\r\n for (Card card: userChosenCards){\r\n buildValue += card.getNumValue();\r\n }\r\n\r\n buildValue += card.getNumValue();\r\n\r\n switch (option){\r\n case 1:\r\n if(userChosenCards.size() == 0){\r\n Toast.makeText(ChooseTableCardActivity.this,\r\n \"Invalid Build - Cannot create a build with just one card\",\r\n Toast.LENGTH_LONG).show();\r\n return false;\r\n }\r\n\r\n return player.checkBuildValueInHand(player.getPlayerHandVec(), buildValue);\r\n case 2:\r\n if (buildValue == round.getBuilds().get(player.getId()).getNumValue()){\r\n return true;\r\n }\r\n return false;\r\n }\r\n return false;\r\n }",
"void onFailure(String description);",
"boolean isSuccess();",
"boolean isSuccess();",
"boolean isSuccess();",
"boolean isSuccess();",
"boolean isSuccess();",
"boolean isSuccess();",
"boolean isSuccess();",
"@Test(expected=IllegalStateException.class)\n public void ongoingConfiguration_withRequestsRecordingDisabled() {\n initJadler().withRequestsRecordingDisabled();\n \n try {\n verifyThatRequest();\n fail(\"request recording disabled, verification must fail\");\n }\n finally {\n closeJadler();\n }\n }",
"java.lang.Boolean hasUploadDownloadConfig(java.lang.String userName) throws com.ctb.exception.CTBBusinessException;",
"public interface HttpConfig {\n\n // http code\n int SUCCESS = 1;\n int FORBIDDEN = 403;\n int NOT_FOUND = 404;\n int REQUEST_TIMEOUT = 408;\n int INTERNAL_SERVER_ERROR = 500;\n int BAD_GATEWAY = 502;\n int SERVICE_UNAVAILABLE = 503;\n int GATEWAY_TIMEOUT = 504;\n\n // error code\n int UNKNOWN_ERROR = -100;\n int PARSE_ERROR = -101;\n int PERMISSION_ERROR = -102;\n int HTTP_EXCEPTION = -103;\n int SOCKET_TIMEOUT_EXCEPTION = -104;\n int CONNECT_EXCEPTION = -105;\n int NOT_NET_EXCEPTION = -106;\n int SSL_EXCEPTION = -107;\n\n // timeout period\n int TIME_OUT = 15 * 1000;\n}",
"public boolean isSuccess();",
"public boolean isSuccess();",
"private String processPaymentStatus() {\n\t\treturn new Random().nextBoolean() ? \"success\" : \"failure\";\n\t}",
"default boolean pollOnExecutionFailed() {\n return false;\n }",
"@Override\n\tpublic void setFailureMode(boolean arg0) {\n\n\t}",
"protected void check() throws IOException, ServletException {\n if(value.length()==0)\n error(\"please specify the path to the RhapsodyCL.exe file\");\n else if(!value.contains(\"RhapsodyCL.exe\")) {\n \terror(\"didn't find RhapsodyCL.exe in the path !\");\n }else{\n \tok(); \t\n }\n }",
"public interface RequestResponse {\n /**\n * Checks if the request was successful and returned no error.\n * @return true if the request was successful\n */\n boolean isSuccessful();\n\n /**\n * Gets HTTP status code received by the server as a reaction to the request.\n * @return response status code\n */\n int getStatusCode();\n\n /**\n * Gets HTTP status message received by the server as a reaction to the request.\n * @return response status message\n */\n String getStatusMessage();\n\n /**\n * <p>Checks, if the request failed because of rate limitation.</p>\n * <p>If this happens, you probably used too many similar requests (like add reaction) one after another.\n * If this happens because of spamming requests, try waiting after each one with {@link Future#get()}.\n * If this happens randomly, it can be caused by different modules doing same actions. Try again.</p>\n * <p><b>Warning:</b> if you exceed the limits too often, you risk getting banned.</p>\n * @return true if the request failed due to rate limit\n */\n boolean isRateLimited();\n}",
"public String formServerNotFound()\r\n {\r\n return formError(\"503 Gateway timeout\",\"The requested server was not found\");\r\n }",
"private boolean validate(Map<String,String> requestMap){\r\n\t\tboolean result = false;\r\n\t\tString zip = requestMap.get(PublicAPIConstant.ZIP);\r\n\t\tString soStatus = requestMap.get(PublicAPIConstant.SO_STATUS);\r\n\t\tList<String> soStatusList = new ArrayList<String>();\r\n\r\n\t\tif (null != soStatus) {\r\n\t\t\tStringTokenizer strTok = new StringTokenizer(\r\n\t\t\t\t\tsoStatus,\r\n\t\t\t\t\tPublicAPIConstant.SEPARATOR, false);\r\n\t\t\tint noOfStatuses = strTok.countTokens();\r\n\t\t\tfor (int i = 1; i <= noOfStatuses; i++) {\r\n\t\t\t\tsoStatusList.add(new String(strTok\r\n\t\t\t\t\t\t.nextToken()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tInteger pageSize = Integer.parseInt(requestMap.get(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET));\r\n\t\t\r\n\t\tif(null!=zip&&zip.length() != 5){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.ZIP);\r\n\t\t\treturn result;\t\r\n\t\t}\r\n\t\tList<Integer> pageSizeSetValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_10,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_20,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_50,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_100,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_200,\r\n\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET_500);\t\t\r\n\t\tif(!pageSizeSetValues.contains(pageSize)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.PAGE_SIZE_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\t\r\n\t\tList<String> soStatusValues = Arrays.asList(\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_POSTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACCEPTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_ACTIVE,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_CLOSED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_COMPLETED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_DRAFTED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PROBLEM,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_EXPIRED,\r\n\t\t\t\tPublicAPIConstant.SOSTATUS_SET_PENDINGCANCEL\r\n\t\t);\t\t\r\n\t\tif(!soStatusValues.containsAll(soStatusList)){\r\n\t\t\trequestMap.put(PublicAPIConstant.ERROR_FIELD, \r\n\t\t\t\t\tPublicAPIConstant.SO_STATUS_SET);\r\n\t\t\treturn result;\t\r\n\t\t}\t\r\n\t\tresult = true;\r\n\t\treturn result;\r\n\t}",
"public int failureLevel(){\n return RESULT_WARNING;\n }",
"int getReturnCode();",
"int getReturnCode();",
"@Override\n\t\t\t\t\t\t\tpublic void HttpFail(int ErrCode) {\n\n\t\t\t\t\t\t\t}",
"public ConfigurationServerFailureException() {\n\t\tsuper();\n\t}"
] | [
"0.55627847",
"0.5494074",
"0.5476653",
"0.5442306",
"0.5421832",
"0.5353629",
"0.5165075",
"0.513827",
"0.51382405",
"0.50987244",
"0.50932515",
"0.50782394",
"0.50498086",
"0.50414026",
"0.50303674",
"0.4995234",
"0.4992827",
"0.4976047",
"0.49757567",
"0.4966005",
"0.49492496",
"0.49489427",
"0.49454314",
"0.49454314",
"0.49355823",
"0.49276304",
"0.48991823",
"0.48733544",
"0.48708552",
"0.48676986",
"0.4866718",
"0.4864242",
"0.48586327",
"0.48538685",
"0.48371446",
"0.4830193",
"0.48296708",
"0.48279196",
"0.48248798",
"0.4823097",
"0.48045462",
"0.4803452",
"0.48031852",
"0.4802025",
"0.47960252",
"0.4790836",
"0.47759375",
"0.47685364",
"0.47593203",
"0.47573328",
"0.47530735",
"0.47498316",
"0.47493294",
"0.4745904",
"0.47454792",
"0.47348744",
"0.4727559",
"0.4723387",
"0.4718895",
"0.47125405",
"0.46980488",
"0.469649",
"0.4695342",
"0.46950486",
"0.46920764",
"0.46918017",
"0.46878412",
"0.46776515",
"0.4672463",
"0.46703285",
"0.46688575",
"0.46673235",
"0.4665048",
"0.46605673",
"0.46566182",
"0.46543983",
"0.46530938",
"0.46530938",
"0.46530938",
"0.46530938",
"0.46530938",
"0.46530938",
"0.46530938",
"0.46467805",
"0.4642464",
"0.46388644",
"0.463852",
"0.463852",
"0.463755",
"0.46346846",
"0.4623031",
"0.4622187",
"0.46221834",
"0.46206218",
"0.46205586",
"0.4618402",
"0.46158245",
"0.46158245",
"0.46155322",
"0.46113232"
] | 0.59094757 | 0 |
final LayoutInflater inflater = getActivity().getLayoutInflater(); view = inflater.inflate(R.layout.progress_dialog_custom, null); _________________DIALOG FRAG DESIGN________________________________ | public Dialog onCreateDialog(Bundle savedInstanceState) {
final Dialog dialog = new Dialog(getContext());
dialog.setContentView(R.layout.progress_dialog_custom);
// dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawableResource(R.color.progressBarBckgrnd);
// dialog.setMonthName("Title...");
// set the custom dialog components - title, ProgressBar and button
ProgressBar prog = dialog.findViewById(R.id.myprogress);
GifImageView givImageView = dialog.findViewById(R.id.gifLoad);
try {
GifDrawable gifFromAssets = null;
gifFromAssets = new GifDrawable(getContext().getAssets(), "load.gif");
givImageView.setImageDrawable(gifFromAssets);
} catch (IOException e) {
e.printStackTrace();
}
return dialog;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@SuppressLint(\"InflateParams\")\r\n\t@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\r\n\t\tView view = (View) inflater.inflate(R.layout.customprogress, null);\r\n//\t\tButton buttonPositive = (Button) view.findViewById(R.id.dialog_button_positive);\r\n//\t\tButton buttonNegative = (Button) view.findViewById(R.id.dialog_button_negative);\r\n\t\tmProgressBar = (ProgressBar) view.findViewById(R.id.progress_bar);\r\n\t\tmProgressTextView = (TextView) view.findViewById(R.id.progress_txt);\r\n\t\tmProgressBarfile = (ProgressBar) view.findViewById(R.id.progress_bar2);\r\n\t\tmProgressTextViewFile = (TextView) view.findViewById(R.id.progress_txt2);\r\n\r\n//\t\tbuttonNegative.setOnClickListener(this);\r\n//\t\tbuttonPositive.setEnabled(false);\r\n//\t\tbuttonPositive.setOnClickListener(this);\r\n\t\tgetDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);\r\n\t\treturn view;\r\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_loading_dialog, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n ctx = getActivity();\n View view = inflater.inflate(getLayoutID(),null);\n mPreenter = createPresenter();\n loading = new MyProgressLoading(ctx, R.style.DialogStyle);\n sp = ctx.getSharedPreferences(SpUtiles.SP_Mode,Context.MODE_PRIVATE);\n HideUtil.init(getActivity());\n unbinder = ButterKnife.bind(this, view);\n initView();\n initData();\n initListener();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState)\n {\n return inflater.inflate(R.layout.fragment_progress, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_progress, container, false);\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = requireActivity().getLayoutInflater();\n final View view = inflater.inflate(R.layout.on_click_dialog, null);\n builder.setView(view);\n\n\n\n\n\n\n\n\n return builder.create();\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dialog_customer_info, container, false);\n if (getDialog()!=null){\n getDialog().requestWindowFeature( STYLE_NO_TITLE );\n\n int width = ViewGroup.LayoutParams.MATCH_PARENT;\n int height = ViewGroup.LayoutParams.MATCH_PARENT;\n getDialog().getWindow().setLayout(width, height);\n }\n\n progressBar = view.findViewById( R.id.progress_circular );\n layoutContent = view.findViewById( R.id.layoutContent );\n layoutMonthlyRecharge = view.findViewById( R.id.layoutMonthlyRecharge );\n\n operatorName = view.findViewById(R.id.operatorName);\n customerName = view.findViewById( R.id.customerName );\n balance = view.findViewById( R.id.balance );\n nextRechargeDate = view.findViewById( R.id.nextRechargeDate );\n monthlyRecharge = view.findViewById( R.id.monthlyRecharge );\n planName = view.findViewById( R.id.planName );\n deleteBtn = view.findViewById( R.id.imageButtonClose );\n\n // --- Click Action\n deleteBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n FragmentDialogCustomerInfo.this.dismiss();\n }\n });\n\n if (callDTHInfo == null){\n // Query...\n DBQuery.queryToGetCustomerInfo( this, s_Username, s_Password, s_provider, s_mobile );\n\n }else {\n setData();\n }\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_curr_day_progress, container, false);\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_estim, container, false);\r\n progressDialog = CreateProgressDialog().create();\r\n ctx = getContext();\r\n\r\n bindUI(view);\r\n Events();\r\n Estim.getEstim(getContext(), progressDialog);\r\n\r\n return view;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_hint_dialog, container, false);\n \n cancel_btn = (ImageView) view.findViewById(R.id.cancel_btn);\n confirm_btn = (TextView) view.findViewById(R.id.confirm_btn);\n hint_image = (ImageView) view.findViewById(R.id.hint_icon);\n hint_text = (TextView) view.findViewById(R.id.hint_text);\n\n Glide.with(getActivity()).load(R.drawable.snack_bar_icon).into(hint_image);\n hint_text.setText(hint);\n \n cancel_btn.setOnClickListener(this);\n confirm_btn.setOnClickListener(this);\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.alert_dialog_fragment, container, false);\n }",
"protected LayoutInflater getInflater(){\n return getActivity().getLayoutInflater();\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_varification_dialog, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dialog, container, false);\n mUnbinder = ButterKnife.bind(this, view);\n return view;\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_my_dialog, container, false);\n recyclerView = (RecyclerView) view.findViewById(R.id.dialogrecycle);\n recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));\n\n getDialog().setTitle(\"Search Results: Select One\");\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n sharedPreferences = getActivity().getSharedPreferences(\"VALUES\", Context.MODE_PRIVATE);\n currentTheme = sharedPreferences.getInt(\"THEME\", 0);\n\n //inflate theme_dialog.xml\n view = inflater.inflate(R.layout.theme_dialog, container);\n\n // remove title (already defined in theme_dialog.xml)\n getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);\n\n // Declare buttons and onClick methods\n dialogButtons();\n\n setUltimoThemeBooton(currentTheme);\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_ranking_settings_dialog, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_login, container, false);\n\n nameEdit = (EditText) view.findViewById(R.id.name);\n phoneEdit = (EditText) view.findViewById(R.id.mobno);\n loginButton = (Button) view.findViewById(R.id.log_btn);\n\n loginButton.setOnClickListener(this);\n\n progress = new ProgressDialog(getActivity());\n progress.setMessage(\"Registering ...\");\n progress.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n progress.setIndeterminate(true);\n progress.setCanceledOnTouchOutside(false);\n\n return view;\n }",
"@Override\r\n\tpublic Dialog onCreateDialog(Bundle savedInstanceState) {\n\r\n\t\tAlertDialog.Builder builder = new Builder(this.getActivity());\r\n\t\tView view = LayoutInflater.from(getActivity()).inflate(\r\n\t\t\t\tR.layout.load_dialog, null);\r\n\r\n\t\tbuilder.setView(view);\r\n\t\tbuilder.setCancelable(false);\r\n\t\tdialog=builder.create();\r\n\t\treturn dialog;\r\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_sensor_dialog, container, false);\n getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);\n this.spinner_sensor_type = (Spinner)view.findViewById(R.id.sensor_dialog_spinner_sensor_type);\n this.sensor_deep = (EditText)view.findViewById(R.id.sensor_dialog_edit_deep);\n this.sensor_description = (EditText)view.findViewById(R.id.sensor_dialog_edit_description);\n this.spinner_sensor_type.setAdapter(new ArrayAdapter<SensorType>(getActivity(), android.R.layout.simple_list_item_1, SensorType.values()));\n Button button = (Button)view.findViewById(R.id.btnNewSensor);\n //button.setOnClickListener(this);\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.fragment_roads, container, false);\n\n mRecyclerView = (RecyclerView) view.findViewById(R.id.RecyclerView);\n mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));\n progressBar = (ProgressBar) view.findViewById(R.id.progress_bar);\n\n\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_alarm, container, false);\n timepick=view.findViewById(R.id.time);\n Button cancel=view.findViewById(R.id.cancel);\n\n timepick.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n DialogFragment timePicker=new TimePicker(\"alarm\");\n timePicker.show(getFragmentManager(),\"timepicker\");\n }\n });\n\n cancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n androidx.fragment.app.Fragment fragment=new All();\n FragmentManager fragmentManager=getFragmentManager();\n FragmentTransaction fragmentTransaction=fragmentManager.beginTransaction();\n fragmentTransaction.replace(R.id.frag,fragment);\n fragmentTransaction.commit();\n }\n });\n\n return view;\n }",
"@Override public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_profile, container, false);\n progressDialog = new ProgressDialog(getActivity());\n textViewUserName = (TextView) view.findViewById(R.id.textViewUserName);\n textViewAge = (TextView) view.findViewById(R.id.textViewAge);\n textViewGender = (TextView) view.findViewById(R.id.textViewGender);\n textViewExperience = (TextView) view.findViewById(R.id.textViewExperience);\n\n imageViewProfile = (ImageView) view.findViewById(R.id.imageViewProfile);\n\n buttonEditProfile = (Button) view.findViewById(R.id.buttonEditProfile);\n buttonMyVideo = (Button) view.findViewById(R.id.buttonMyVideo);\n buttonMyStory = (Button) view.findViewById(R.id.buttonMyStory);\n buttonSignIn=(Button)view.findViewById(R.id.buttonSingnIn);\n\n return view;\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n View view = getActivity().getLayoutInflater().inflate(R.layout.rollback_detail_dialog, new LinearLayout(getActivity()), false);\n\n initUI(view);\n // clickEvents();\n\n /*\n assert getArguments() != null;\n voucherTypes = (ArrayList<VoucherType>) getArguments().getSerializable(\"warehouses\");\n voucherType=\"\";\n*/\n\n Dialog builder = new Dialog(getActivity());\n builder.requestWindowFeature(Window.FEATURE_NO_TITLE);\n builder.setContentView(view);\n return builder;\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view =inflater.inflate(R.layout.invoice, container, false);\n sharedPreferences = getContext().getSharedPreferences(PREF_NAME, PRIVATE_MODE);\n securitycode = sharedPreferences.getString(\"SOC_CODE\", null);\n // amnt =\"1500\";\n paydialog = new ProgressDialog(getContext());\n paydialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);\n paydialog.setMessage(\"Please wait..\");\n paydialog.setIndeterminate(true);\n paydialog.setCanceledOnTouchOutside(false);\n paybutton = (Button) view.findViewById(R.id.paybuttonid);\n paybutton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n ProceedToPay();\n }\n });\n\n GetUserData();\n GetSocityInfo();\n\n return view;\n }",
"@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n Objects.requireNonNull(getDialog().getWindow())\n .getAttributes().windowAnimations = R.style.DialogAnimation2;\n Objects.requireNonNull(getDialog().getWindow()).setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n }\n View view = inflater.inflate(R.layout.fragment_fragment__levels, container, false);\n msj = view.findViewById(R.id.tv_msj_level_modal);\n msj2 = view.findViewById(R.id.tv_msj_level_modal2);\n Typeface custom_font = Typeface.createFromAsset(getActivity().getAssets(), \"fonts/font.ttf\");\n msj.setTypeface(custom_font);\n msj2.setTypeface(custom_font);\n pp1 = view.findViewById(R.id.iv1pp);\n pp0_5 = view.findViewById(R.id.iv0_5pp);\n ll1 = view.findViewById(R.id.iv1ll);\n ll0_5 = view.findViewById(R.id.iv0_5ll);\n note_button = view.findViewById(R.id.iv2);\n note_image = view.findViewById(R.id.image_skin);\n switch_autoplay = view.findViewById(R.id.switch_autoplay);\n avBar= view.findViewById(R.id.seekBar_av);\n tv_FD=view.findViewById(R.id.tv_fd);\n /*TextView tv1 = view.findViewById(R.id.tvsped);\n TextView tv2 = view.findViewById(R.id.tvsped2);\n TextView tv3 = view.findViewById(R.id.tvsped3);\n TextView tv4 = view.findViewById(R.id.tvsped4);*/\n TextView tv5 = view.findViewById(R.id.title_apear);\n tvRush = view.findViewById(R.id.tvrush);\n tvJudge = view.findViewById(R.id.tv_judge);\n TextView title3 = view.findViewById(R.id.tv_msj_level_modal3);\n title3.setTypeface(custom_font);\n tv5.setTypeface(custom_font);\n //tvRush.setTypeface(custom_font);\n tvJudge.setTypeface(custom_font);\n switch_autoplay.setTypeface(custom_font);\n tvRush.setOnClickListener(v -> {\n ParamsSong.rush += 0.1f;\n if (ParamsSong.rush > 1.5f) {\n ParamsSong.rush = 0.8f;\n }\n songList.playSoundPool(songList.spSelect);\n setTxtRush();\n });\n switch_autoplay.setChecked(ParamsSong.autoplay);\n switch_autoplay.setOnCheckedChangeListener((buttonView, isChecked) -> ParamsSong.autoplay = isChecked);\n tvJudge.setOnClickListener(v -> {\n ParamsSong.judgment = (ParamsSong.judgment + 1) % 7;\n setTxtJudge();\n songList.playSoundPool(songList.spSelect);\n });\n setTxtJudge();\n setTxtRush();\n\n\n pp1.setOnClickListener(v -> {\n velocity += 1;\n changeVelocity();\n songList.playSoundPool(songList.spSelect);\n\n });\n\n pp0_5.setOnClickListener(v -> {\n velocity += 0.5f;\n songList.playSoundPool(songList.spSelect);\n changeVelocity();\n });\n\n ll1 = view.findViewById(R.id.iv1ll);\n ll1.setOnClickListener(v -> {\n velocity -= 1;\n songList.playSoundPool(songList.spSelect);\n changeVelocity();\n });\n ll0_5.setOnClickListener(v -> {\n velocity -= 0.5f;\n songList.playSoundPool(songList.spSelect);\n changeVelocity();\n });\n tv_FD.setOnClickListener(v->{\n ParamsSong.FD=!ParamsSong.FD;\n setFD();\n });\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n skins = NoteSkin.arraySkin(getContext());\n indexNS = ParamsSong.skinIndex;\n setImageNS();\n }\n avBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n int av=progress*10;\n ParamsSong.av=av;\n if (av==0){\n msj.setText(\"AV OFF\");\n msj2.setText(\"Velocity \" + ParamsSong.speed);\n\n }\n else {\n setAv();\n\n }\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {}\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) { }\n });\n note_button.setOnClickListener(v -> changeNS());\n note_image.setOnClickListener(v -> changeNS());\n\n if (ParamsSong.av>0){\n avBar.setProgress(ParamsSong.av/10);\n setAv();\n }else{\n changeVelocity();}\n setFD();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n\n queue= Volley.newRequestQueue(getContext());\n pd= new ProgressDialog(getContext());\n pd.setProgressStyle(pd.STYLE_SPINNER);\n pd.setTitle(\"Login __ !\");\n pd.setMessage(\"Plz Wait ___ !\");\n alertDialog= new AlertDialog.Builder(getContext()).create();\n alertDialog.setTitle(\"Message\");\n\n\n\n\n View rootview = inflater.inflate(R.layout.fragment_booking_history, container, false);\n list= (ListView) rootview.findViewById(R.id.listHistory);\n tdisplay= (TextView) rootview.findViewById(R.id.display);\n\n\n\n findBooking();\n return rootview;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dasboard_vendedor, container, false);\n\n mProgress1 = (ProgressBar) view.findViewById(R.id.progressBar);\n mProgress2 = (ProgressBar) view.findViewById(R.id.progressBar2);\n\n txtFinal = (TextView) view.findViewById(R.id.txtFinal);\n txtPromedio = (TextView) view.findViewById(R.id.txtPromedio);\n txtFinalPedido = (TextView) view.findViewById(R.id.txtFinalPedido);\n txtPromediopedido = (TextView) view.findViewById(R.id.txtPromediopedido);\n txtPorCum = (TextView) view.findViewById(R.id.txtPorCum);\n txtPorEfec = (TextView) view.findViewById(R.id.txtPorEfec);\n\n funcionesGenerales = new FuncionesGenerales(getActivity());\n controllerIndicadores = new ControllerIndicadores(getActivity());\n controllerLogin = new ControllerLogin(getActivity());\n\n return view;\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n // Get the layout inflater\n LayoutInflater inflater = getActivity().getLayoutInflater();\n \n // Inflate and set the layout for the dialog\n // Pass null as the parent view because its going in the dialog layout\n View view = inflater.inflate(R.layout.signin_dialog, null);\n view.findViewById(R.id.sign_in_button).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mHelper.beginUserInitiatedSignIn();\n SignInDialogFragment.this.dismiss();\n }\n });\n builder.setView(view);\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_all_ads, container, false);\n\n\n progressBar=view.findViewById(R.id.allAds_progressBar);\n allAds_swiperefreshlayout=view.findViewById(R.id.allAds_swiperefreshlayout);\n\n ///jsut dumy data for test\n\n\n FillData(view);\n\n HandleLoadingAds();\n\n RefreshData();\n\n return view;\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 }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_form,container,false);\n nameEditText=view.findViewById(R.id.nameEditText);\n progressSeekBar=view.findViewById(R.id.progressSeekBar);\n threadButton = view.findViewById(R.id.threadButton);\n saveButton = view.findViewById(R.id.saveButton);\n return view;\n }",
"@Override\n\t\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\t\tBundle savedInstanceState) {\n\n\t\t\tView rootView = inflater.inflate(R.layout.status_update_layout, container,\n\t\t\t\t\tfalse);\n\t\t\tgetDialog().getWindow().setBackgroundDrawableResource(android.R.color.white);\n\t\t\tgetDialog().setTitle(\"Post Status Update\"); \n\n\t\t\tstatusLayoutHandle(rootView);\n\n\t\t\treturn rootView;\n\t\t}",
"private View getProgressView(final BottomSheetDialog dialog) {\n LayoutInflater inflater = LayoutInflater.from(context);\n View view = inflater.inflate(R.layout.dialog_progress, null, false);\n\n ImageButton imgBtnProgressClose = (ImageButton) view.findViewById(R.id.imgBtnProgressClose);\n RecyclerView recycleViewProgress = (RecyclerView) view.findViewById(R.id.recycleViewProgress);\n recycleViewProgress.setLayoutManager(new LinearLayoutManager(context));\n ProgressAdapter progressAdapter = new ProgressAdapter(context, progressHistory);\n recycleViewProgress.setAdapter(progressAdapter);\n\n imgBtnProgressClose.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n dialog.dismiss();\n }\n });\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n view = inflater.inflate(R.layout.fragment_atsc, container, false);\n mtextView = inflater.inflate(R.layout.dialog_text_layout,null,false);\n// mlayout = inflater.inflate(R.layout.dialog_text_layout,(ViewGroup) container.findViewById(R.id.dialog));\n mContext = this.getActivity();\n\n WindowManager wm = (WindowManager) getContext()\n .getSystemService(Context.WINDOW_SERVICE);\n\n width = wm.getDefaultDisplay().getWidth();\n height = wm.getDefaultDisplay().getHeight();\n// TextView txt_content = (TextView)view.findViewById(R.id.txt_atsccontent);\n// txt_content.setText(\"第一个Fragment\");\n\n Log.e(\"HEHE\", \"1日狗\");\n initView();\n initListener();\n return view;\n }",
"@Override\n public void onClick(View view) {\n dialog = new Dialog(getActivity());\n dialog.getWindow().getAttributes().windowAnimations = R.style.up_down;\n dialog.setContentView(R.layout.add_food_fragment);\n dialog.setCancelable(true);\n Window window = dialog.getWindow();\n window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);\n if (dialog != null && dialog.getWindow() != null) {\n dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n }\n initDialog();\n\n\n //Spinner to show list add Food Ways\n spinner();\n\n dialog.show();\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view=inflater.inflate(R.layout.fragment_language_dialog, container, false);\n jalang=(EditText)view.findViewById(R.id.jalang);\n jalanglevel=(Spinner)view.findViewById(R.id.jalanglevel);\n saveslangd=(Button)view.findViewById(R.id.saveslangd);\n cancellangd=(Button)view.findViewById(R.id.cancellangd);\n saveslangd.setOnClickListener(this);\n cancellangd.setOnClickListener(this);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_site_progress_add, container, false);\n setHasOptionsMenu(true);\n ButterKnife.bind(this, view);\n\n initializeUI();\n bindData();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n setHasOptionsMenu(true);\n view = inflater.inflate(R.layout.fragment_orders_open, container, false);\n wdProgressDialog = new WDProgressDialog(getActivity());\n icons = new Icons(getActivity());\n\n // set current month and year\n month = Calendar.getInstance().get(Calendar.MONTH);\n year = Calendar.getInstance().get(Calendar.YEAR);\n\n return view;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_wait_, container, false);\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n v= inflater.inflate(R.layout.fragment_blank, container, false);\n ButterKnife.bind(this,v);\n progressDialog=new ProgressDialog(getContext());\n showMessage(\"Loading\");\n initRecycler();\n retrofitObject();\n loadData();\n return v;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_trangchu, container, false);\n recyclerview_douong_124= (RecyclerView)view.findViewById(R.id.listview);\n progressBar_124=view.findViewById(R.id.progressBar);\n\n return view; }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_fragment_tip_calc, container, false);\n }",
"private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_main_story,null);\n mSwipeRefreshLayout = (SwipeRefreshLayout)view.findViewById(R.id.mainFragment_swipeRefreshLayout);\n\n mProgressDialog = new ProgressDialog(getActivity());\n mProgressDialog.setMessage(\"正在载入\");\n mProgressDialog.show();\n mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_red_light);\n mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {\n @Override\n public void onRefresh() {\n fetchData();\n }\n });\n\n mSwipeRefreshLayout.setRefreshing(true);\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n showDialog_Cacgiaodich();\n return inflater.inflate(R.layout.cacgiaodich_activity, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);\n mView = inflater.inflate(R.layout.fragment_bottom_sheet, container, false);\n slideUpTo(mView);\n return mView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_timetable, container, false);\n\n getActivity().setTitle(\"Timetable\");\n // toolbar = (Toolbar) view.findViewById(R.id.toolbar);\n// loadingIndicator = (ProgressBar) view.findViewById(R.id.pb_loading_indicator);\n// loadingIndicator.setVisibility(View.VISIBLE);\n\n loadingIndicator = (ProgressBar) view.findViewById(R.id.pb_loading_indicator);\n\n loadingIndicator.setVisibility(View.VISIBLE);\n\n viewPager = (ViewPager) view.findViewById(R.id.viewpager);\n setupViewPager(viewPager);\n\n tabLayout = (TabLayout) view.findViewById(R.id.tabs);\n tabLayout.setupWithViewPager(viewPager);\n\n\n\n return view;\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View view = inflater.inflate(R.layout.rider_tracking_fragment, container, false);\n\n //getting reference to the widgets in layout\n progressBar = view.findViewById(R.id.viewTrackingProgressBar);\n message = view.findViewById(R.id.viewTrackingMessage);\n //method call to get bookings\n getPlacedBookings(view, getContext());\n\n return view;\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), R.style.AppTheme_profile3);\n\n // clone the inflater using the ContextThemeWrapper\n LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);\n v = localInflater.inflate(R.layout.fragment_profile_3, null);\n\n// ////TypefaceHelper.typeface(v, App.getHelveticaNeueArabic());\n return v;\n\n }",
"private AlertDialog cargando() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n\n LayoutInflater inflater = getLayoutInflater();\n\n @SuppressLint(\"InflateParams\") View v = inflater.inflate(R.layout.loading, null);\n\n\n builder.setView(v);\n builder.setCancelable(false);\n\n return builder.create();\n\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n // Get the layout inflater\n LayoutInflater inflater = getActivity().getLayoutInflater();\n View rootView = inflater.inflate(R.layout.filter_dialog, null);\n\n\n\n /* Inflate and set the layout for the dialog */\n /* Pass null as the parent view because its going in the dialog layout*/\n builder.setView(rootView)\n /* Add action buttons */\n .setPositiveButton(R.string.filter, new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int id) {\n addShoppingList();\n }\n });\n\n return builder.create();\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){\n View layout = inflater.inflate(R.layout.setup_chatroom_dialog, container, false);\n Button setupButton = (Button)layout.findViewById(R.id.setup_chatRoom_dialog_setup_button);\n Button cancelButton = (Button)layout.findViewById(R.id.setup_chatRoom_dialog_cancel_button);\n editText = (EditText)layout.findViewById(R.id.setup_chatRoom_dialog_edit_text);\n setupButton.setOnClickListener(setupListener);\n cancelButton.setOnClickListener(cancelListener);\n return layout;\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(R.string.dialog_fire_missiles)\n .setPositiveButton(R.string.fire, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n });\n return builder.create();\n }",
"@Nullable\n @Override\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n\n\n view = inflater.inflate(LAYOUT, container, false);\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n rootView = inflater.inflate(R.layout.fragment_set_gender, container, false);\n\n progressDialog = new ProgressDialog(getContext());\n\n menBtn = rootView.findViewById(R.id.men);\n menBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n switchType();\n }\n });\n womenBtn = rootView.findViewById(R.id.women);\n womenBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n switchType();\n }\n });\n switchType();\n\n nextBtn = rootView.findViewById(R.id.nextBtn);\n nextBtn.setOnClickListener(this);\n\n if(!User.getOwnerAccount().isFacebookUser()) {\n nextBtn.setText(\"Next\");\n nextBtn.setTextColor(Color.rgb(0, 0, 0));\n nextBtn.setBackgroundColor(Color.rgb(255, 255, 255));\n }\n\n\n return rootView;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View root = inflater.inflate(R.layout.fragment_dialog_add_hole, container, false);\n butOk = root.findViewById(R.id.butOk);\n butCancelar = root.findViewById(R.id.butCancelar);\n latLng = root.findViewById(R.id.lntLng);\n address = root.findViewById(R.id.ads);\n latLng.setText(latlng);\n address.setText(ad);\n\n butOk.setOnClickListener(this);\n butCancelar.setOnClickListener(this);\n\n return root;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view= inflater.inflate(R.layout.fragment_upload_new, container, false);\n findViewByIds(view);\n return view;\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflator = getActivity().getLayoutInflater();\n View view = inflator.inflate(R.layout.informationdialog, datePicker);\n builder.setView(view);\n init(view);\n Dialog dialog = builder.create();\n\n //Dialog will not close automatically until user click on cancle button.\n setCancelable(false);\n return dialog;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n\n View view = inflater.inflate(R.layout.layout_answer_support, container, false);\n// getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n\n\n mAnswer = (TextView) view.findViewById(R.id.answer_textview);\n mOk = (Button) view.findViewById(R.id.answer_support_btn_ok);\n\n mOk.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n getDialog().dismiss();\n }\n });\n\n Bundle mArgs = getArguments();\n String test = mArgs.getString(\"answer\");\n mAnswer.setText(test);\n\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dialog, container, false);\n\n youTubePlayerView = view.findViewById(R.id.youtube_player_view);\n getLifecycle().addObserver(youTubePlayerView);\n initPictureInPicture(youTubePlayerView);\n\n youTubePlayerView.addYouTubePlayerListener(new AbstractYouTubePlayerListener() {\n @Override\n public void onReady(@NonNull YouTubePlayer youTubePlayer) {\n String videoId = \"SQNtGoM3FVU\";\n youTubePlayer.loadVideo(videoId, 0);\n }\n });\n return view;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_completed, container, false);\r\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n\r\n View v = inflater.inflate(R.layout.fragment_donor_dash, container, false);\r\n\r\n\r\n\r\n return v;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_synchronous_content, container, false);\n ButterKnife.bind(this, view);\n\n initProgress();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.first_step_layout, container, false);\n initView();\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n //get a reference to this dialog so that it can be passed to listener callback methods\n mDialog = this;\n\n //get fragment arguments to set up the view with\n Bundle arguments = getArguments();\n if (arguments != null) {\n mTrackInfo = arguments.getStringArrayList(TopTracksActivity.KEY_TRACK_INFO_ARRAY_LIST);\n Log.i(TAG, \"arguments are not null and mTrackInfo is \" + mTrackInfo);\n } else {\n Log.i(TAG, \"onCreateView called and arguments are null!\");\n }\n // Inflate the layout to use as dialog or embedded fragment\n View view = inflater.inflate(R.layout.fragment_track_player, container, false);\n\n TextView artistTextView = (TextView) view.findViewById(R.id.track_player_artist);\n artistTextView.setText(mTrackInfo.get(TopTracksFragment.COL_ARTIST_NAME));\n\n TextView albumTextView = (TextView) view.findViewById(R.id.track_player_album);\n albumTextView.setText(mTrackInfo.get(TopTracksFragment.COL_ALBUM_NAME));\n\n TextView trackTextView = (TextView) view.findViewById(R.id.track_player_song);\n trackTextView.setText(mTrackInfo.get(TopTracksFragment.COL_TRACK_NAME));\n\n mElapsedTimeTextView = (TextView) view.findViewById(R.id.track_player_elapsed_time);\n\n mTimeLeftTextView = (TextView) view.findViewById(R.id.track_player_time_left);\n\n ImageView imageView = (ImageView) view.findViewById(R.id.track_player_album_art);\n\n\n String albumImageUrl = mTrackInfo.get(TopTracksFragment.COL_ALBUM_IMAGE_URL);\n if (albumImageUrl.length() > 0) {\n Picasso.with(getActivity()).load(albumImageUrl).placeholder(R.drawable.default_placeholder).error(R.drawable.default_placeholder)\n .resize(600, 600).centerCrop().into(imageView);\n } else {\n Picasso.with(getActivity()).load(R.drawable.default_placeholder)\n .resize(600, 600).centerCrop().into(imageView);\n }\n\n SeekBar seekBar = (SeekBar) view.findViewById(R.id.track_player_seek_bar);\n seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {\n @Override\n public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {\n mListener.onProgressChanged(seekBar, progress, fromUser);\n\n double progressDouble = (double)progress/1000;\n double timeLeftDouble = 30 - (double)progress/1000;\n mElapsedTimeTextView.setText(\"0:\" + String.format(\"%02d\", Math.round(progressDouble)));\n mTimeLeftTextView.setText(\"0:\" + String.format(\"%02d\", Math.round(timeLeftDouble)));\n }\n\n @Override\n public void onStartTrackingTouch(SeekBar seekBar) {\n\n }\n\n @Override\n public void onStopTrackingTouch(SeekBar seekBar) {\n\n }\n });\n\n ImageButton previousButton = (ImageButton) view.findViewById(R.id.track_player_previous);\n previousButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mListener.onPreviousClick(mDialog);\n }\n });\n mPauseButton = (ImageButton) view.findViewById(R.id.track_player_pause);\n if (getArguments().getBoolean(TopTracksActivity.KEY_IS_TRACK_PAUSED)) {\n mPauseButton.setSelected(true);\n }\n mPauseButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mListener.onPlayPauseClick(mDialog);\n }\n });\n ImageButton nextButton = (ImageButton) view.findViewById(R.id.track_player_next);\n nextButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mListener.onNextClick(mDialog);\n }\n });\n Log.i(TAG, \"track player view successfully updated\");\n\n\n\n return view;\n\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.layout_dialog_fragment, container, false);\n\n mRecyclerView = (RecyclerView) v.findViewById(R.id.recycle_myorder_history);\n mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));\n //setadapter\n adapter = new OrderHistoryDialogFragmentAdapter(getActivity(), feedItemList);\n mRecyclerView.setAdapter(adapter);\n adapter.notifyDataSetChanged();\n //get your recycler view and populate it.\n return v;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.fragment_step, container, false);\n\n tv = (TextView) v.findViewById(R.id.tvStep);\n tv.setText(\" # \" + \"\\n\" + \"steps\");\n pBar = (ProgressBar) v.findViewById(R.id.progressBarStep);\n pBar.setSecondaryProgress(pBar.getMax());\n\n //using animation to fill the data points\n ObjectAnimator animator = ObjectAnimator.ofInt(pBar, \"progress\", progress);\n //setting the time for 750 miliseconds\n animator.setDuration(750);\n animator.setInterpolator(new DecelerateInterpolator());\n animator.start();\n //Adding listner to show the endpoint result\n animator.addListener(new Animator.AnimatorListener() {\n @Override\n public void onAnimationStart(Animator animation) {\n tv.setText(\" # \" + \"\\n\" + \"steps\");\n }\n @Override\n public void onAnimationEnd(Animator animation) {\n tv.setText(\"\" + progress + \" \" + \"\\n\" + \"steps\");\n }\n @Override\n public void onAnimationCancel(Animator animation) {\n }\n @Override\n public void onAnimationRepeat(Animator animation) {\n tv.setText(\" # \" + \"\\n\" + \"steps\");\n }\n });\n return v;\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 }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n Dialog dialog = new Dialog(getContext(), R.style.alert_dialog_style);\n dialog.setCancelable(false);\n dialog.setCanceledOnTouchOutside(false);\n View view = View.inflate(getContext(), R.layout.loading, null);\n dialog.setContentView(view);\n return dialog;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_contest_search_dialog, container, false);\n\n initUi(view);\n\n setInitialData();\n\n getData(IApiEvent.REQUEST_SEARCH_NEWS_FEED_MIRROR_CODE);\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_settings_dialog_planned_basal_injections, container, false);\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 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_pending, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n parent = inflater.inflate(R.layout.frag_file, container, false);\n initViews();\n setListeners();\n return parent;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v= inflater.inflate(R.layout.fragment_apple, container, false);\n circularProgressBar = v.findViewById(R.id.circularProgressBarNO2);\n text = v.findViewById(R.id.textViewNO2);\n// Intent k = getIntent();\n// double value = getIntent().getDoubleExtra(\"NO2\",0);\n// text.setText(String.valueOf(value));\n ////for(int i=0;i<5;i++){\n circularProgressBar.setProgressWithAnimation(20f, Long.valueOf(2000)); // =1s\n\n // }\n\n\n// Set Progress Max\n circularProgressBar.setProgressMax(100f);\n\n// Set ProgressBar Color\n circularProgressBar.setProgressBarColor(Color.BLACK);\n// or with gradient\n // circularProgressBar.setProgressBarColorStart(Color.GREEN);\n // circularProgressBar.setProgressBarColorEnd(Color.RED);\n // circularProgressBar.setProgressBarColorDirection(CircularProgressBar.GradientDirection.TOP_TO_BOTTOM);\n\n// Set background ProgressBar Color\n circularProgressBar.setBackgroundProgressBarColor(Color.GRAY);\n// or with gradient\n// circularProgressBar.setBackgroundProgressBarColorStart(Color.WHITE);\n// circularProgressBar.setBackgroundProgressBarColorEnd(Color.WHITE);\n// circularProgressBar.setBackgroundProgressBarColorDirection(CircularProgressBar.GradientDirection.TOP_TO_BOTTOM);\n\n// Set Width\n circularProgressBar.setProgressBarWidth(7f); // in DP\n circularProgressBar.setBackgroundProgressBarWidth(3f); // in DP\n\n// Other\n circularProgressBar.setRoundBorder(true);\n circularProgressBar.setStartAngle(180f);\n circularProgressBar.setProgressDirection(CircularProgressBar.ProgressDirection.TO_RIGHT);\n return v;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_common_skill, container, false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n viewModel = new ViewModelProvider(requireActivity()).get(MainActivityViewModel.class);\n if (binding == null) {\n binding = FragmentProfileServiceInfoBinding.inflate(inflater, container, false);\n }\n dialog = Utils.buildProgressDialog(requireActivity());\n generalDialog.buildGeneralDialog(viewModel.getApplication().getApplicationContext(), new DialogData(\"\", \"\", \"OK\", \"\", View.GONE));\n generalDialog.binding.footer.dialogBtnFooterPositive.setOnClickListener(v -> generalDialog.dialog.dismiss());\n viewModel.getBaseData().setTitleBarName(\"Facility Profile\");\n specialityRemovedNotifier.addObserver(this);\n specialityAddedNotifier.addObserver(this);\n ApiCalls.getInstance().addObserver(this);\n attachAdapters();\n attachListeners();\n addTextWatchers();\n setData();\n return binding.getRoot();\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_game_result, container, false);\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n View vi = inflater.inflate(R.layout.fragment_fees, container, false);\n\n\n infobtn = (ImageView)vi.findViewById(R.id.infobtn);\n\n infobtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n new MaterialDialog.Builder(getActivity())\n .title(\"Consultation fees\")\n .content(\"This fees is indicative and might vary. \\n NOTE:Fees is payable at clinic. There are NO charges for booking an appointment.\")\n .positiveText(\"DISMISS\")\n .negativeText(\"\")\n .show();\n }\n });\n\n\n return vi;\n }",
"@Nullable\r\n @Override\r\n public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_up_del_work_type, container, false);\r\n\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view= inflater.inflate(R.layout.fragment_notification, container, false);\n\n\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_duration_num_days, container, false);\n TextView durationTextView = view.findViewById(R.id.fragmentDurationTextView);\n durationTextViewBottomText = view.findViewById(R.id.fragmentDurationBottomText);\n durationTextView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n displayNumPicker();\n }\n });\n return view;\n }",
"@Override\r\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\r\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_endgame_tab, container, false);\r\n getSpinnerValues(view);\r\n sets(view);\r\n return view;\r\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n return inflater.inflate(R.layout.fragment_fracment01, container, false);\n\n }",
"@SuppressWarnings(\"deprecation\")\n\t@Override\n\tprotected Dialog onCreateDialog(int id) {\n\t\tswitch (id) {\n\t\tcase DIALOG_PROGRESS:\n\t\t\treturn new ProgressDialog(ParentActivity.this);\n\t\t}\n\t\treturn super.onCreateDialog(id);\n\t}",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n activity = (InitializeDineOrderActivity) getActivity();\n View view = inflater.inflate(R.layout.fragment_items_added_success, container, false);\n unbinder = ButterKnife.bind(this, view);\n //animate(imageView);\n return view;\n\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 final View v = inflater.inflate(R.layout.fragemnt_reserve, container, false);\n\n\n\n\n return v;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_add_meals, container, false);\n return view;\n\n\n }",
"@Override\n public void onClick(View arg0) {\n final Dialog dialog = new Dialog(SpinnerAcitivity.this);\n // Include dialog.xml file\n dialog.setContentView(R.layout.dialog);\n // Set dialog title\n //dialog.setTitle(\"Custom Dialog\");\n\n // set values for custom dialog components - text, image and button\n TextView text = (TextView) dialog.findViewById(R.id.textDialog);\n// text.setText(\"Thank you for yor response!\");\n ImageView image = (ImageView) dialog.findViewById(R.id.imageDialog);\n// image.setImageResource(R.drawable.icon);\n\n dialog.show();\n\n Button declineButton = (Button) dialog.findViewById(R.id.declineButton);\n // if decline button is clicked, close the custom dialog\n declineButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n // Close dialog\n dialog.dismiss();\n }\n });\n\n\n }",
"public void showProgress2(){\n// if (mHandler==null){\n// mHandler = new Handler(Looper.getMainLooper());\n// }\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n loadingDialog = new Dialog(BaseActivity.this);\n loadingDialog.setTitle(\"Loading data..\");\n loadingDialog.setContentView(R.layout.loading);\n loadingDialog.show();\n\n }\n });\n// mHandler.post(new Runnable() {\n// @Override\n// public void run() {\n// loadingDialog = new Dialog(BaseActivity.this);\n// loadingDialog.setTitle(\"Loading data..\");\n// loadingDialog.setContentView(R.layout.loading);\n// loadingDialog.show();\n//\n// }\n// });\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 = inflater.inflate(R.layout.fragment_feedback, container, false);\n self = getActivity();\n initUI(view);\n initControlUI();\n initData();\n return view;\n }",
"private void showProgressDialog(){\n progressDialog=ProgressDialog.show(context,\"\",\"Loading...Please wait...\");\n\n\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = getActivity().getLayoutInflater();\n View view = inflater.inflate(R.layout.complete_workout_dialog,null);\n builder.setView(view);\n completeScore = view.findViewById(R.id.score_edit_text);\n completeTime = view.findViewById(R.id.time_edit_text);\n\n // Inflate and set the layout for the dialog\n // Pass null as the parent view because its going in the dialog layout\n // Add action buttons\n builder.setMessage(\"\")\n .setPositiveButton(\"Ok \", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n completeWorkoutListener.onCompletedWorkoutSelected(completeScore.getText().toString(), completeTime.getText().toString());\n }\n })\n .setNegativeButton(\" Cancel\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // User cancelled the dialog\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.fragment_near_peoples, container, false);\n getActivity().setTitle(\"Share Card\");\n initUI();\n\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, final ViewGroup container,\n Bundle savedInstanceState) {\n\n\n return inflater.inflate(R.layout.fragment_splash, container, false);\n }"
] | [
"0.7908598",
"0.7835852",
"0.7627",
"0.7623773",
"0.75451654",
"0.7539376",
"0.7419215",
"0.7373794",
"0.73403364",
"0.7336543",
"0.7300852",
"0.7244701",
"0.7207259",
"0.71925855",
"0.7189118",
"0.7131582",
"0.711035",
"0.71023124",
"0.7071469",
"0.70269054",
"0.702064",
"0.6907135",
"0.68996674",
"0.6894332",
"0.6883939",
"0.6860263",
"0.68447936",
"0.6827172",
"0.6821009",
"0.6816202",
"0.6790562",
"0.67904645",
"0.6779982",
"0.677157",
"0.67686075",
"0.6760553",
"0.67589235",
"0.67573005",
"0.67550486",
"0.6752873",
"0.67486846",
"0.67433614",
"0.6727773",
"0.67209226",
"0.6715606",
"0.6705831",
"0.66753656",
"0.66697216",
"0.66576165",
"0.66561574",
"0.6650418",
"0.66422844",
"0.6637972",
"0.6618698",
"0.6612643",
"0.6602807",
"0.6595728",
"0.6588262",
"0.65852356",
"0.65822685",
"0.6580151",
"0.65653604",
"0.65607935",
"0.655705",
"0.655672",
"0.65562356",
"0.65545946",
"0.65402985",
"0.65402156",
"0.6532404",
"0.65293354",
"0.6527069",
"0.65233177",
"0.65173435",
"0.6512911",
"0.65036577",
"0.64935434",
"0.64865965",
"0.64845794",
"0.64843595",
"0.64821655",
"0.6480477",
"0.6477753",
"0.6474959",
"0.64703655",
"0.6469926",
"0.64647627",
"0.6457277",
"0.6455492",
"0.64548427",
"0.6449726",
"0.64487225",
"0.644566",
"0.6445127",
"0.64421284",
"0.64399",
"0.6436566",
"0.6433118",
"0.6430818",
"0.64299315"
] | 0.72656846 | 11 |
/ An href has the following format: $base.$prefix$id | @Override
public String getIdFromHref(String href) {
int spos = href.indexOf("#");
if (spos == -1) {
throw new IllegalArgumentException(href + " is not a valid href");
}
String ns = href.substring(0, spos);
int dpos = ns.indexOf(".");
if (dpos == -1) {
throw new IllegalArgumentException(href + " is not a valid href");
}
String prefix = ns.substring(dpos + 1, ns.length());
if (!this.prefix.equals(prefix)) {
throw new IllegalArgumentException("Expected href with prefix=" + this.prefix);
}
return href.substring(spos + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getHref();",
"private String buildUriFromId(String baseUri, String id){\n\t\treturn baseUri + \"/\" + id;\n\t}",
"private String externalLink2Anchor(String href) {\n\t\t\n\t\tString replaceText = null;\n\t\tString id = baseId + \"-\" + UUID.uuid(4);\n\t\tString target = (openLinksinNewTab) ? \"_blank\" : \"_self\";\n\t\t\n\t\tLinkInfo pli = new LinkInfo(id, LinkType.EXTERNAL, href, target);\n\t\tparserResult.linkInfos.add(pli);\n\t\treplaceText = \"<a id='\" + id + \"' target='\" + target + \"' href='\" + href + \"'\";\n\t\t\n\t\treturn replaceText;\n\t}",
"public String createHrefForTag(final String tag) {\n\t\treturn this.tagUrlPrefix + tag;\n\t}",
"public static String getObjidFromHref(final String href) {\r\n return href.substring(href.lastIndexOf('/') + 1);\r\n }",
"URL format(ShortLink shortLink);",
"static String makeAuId(String baseUrlPath) {\n String baseUrlHost = \"import%2Elockss%2Eorg\";\n return PLUGIN_KEY + \"&base_url~http%3A%2F%2F\" + baseUrlHost + \"%2F\"\n\t+ baseUrlPath;\n }",
"private static String addLinks(String apparatus) {\n\t\tif (apparatus.contains(\"EDR\")) {\n\t\t\tString[] components = apparatus.split(\"\\\\s\");\n\t\t\tStringBuilder displayApparatus = new StringBuilder();\n\t\t\tfor (String component : components) {\n\t\t\t\tif (component.startsWith(\"EDR\")) {\n\t\t\t\t\t// know the EDR id is 9 characters\n\t\t\t\t\tString edrid = \"\";\n\t\t\t\t\tif( component.length() >= 9 ) {\n\t\t\t\t\t\tedrid = component.substring(0, 9);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tedrid = component;\n\t\t\t\t\t\tSystem.out.println(\"This edrID is too short to update apparatus: \" + component);\n\t\t\t\t\t}\n\t\t\t\t\tdisplayApparatus.append(\" <a href=\\\"\");\n\t\t\t\t\tdisplayApparatus.append(URL_BASE);\n\t\t\t\t\t// clean up the component -- remove punctuation\n\t\t\t\t\tdisplayApparatus.append(edrid);\n\t\t\t\t\tdisplayApparatus.append(\"\\\" title=\\\"See Details\\\">\");\n\t\t\t\t\tdisplayApparatus.append(component);\n\t\t\t\t\tdisplayApparatus.append(\"</a> \");\n\t\t\t\t} else {\n\t\t\t\t\tdisplayApparatus.append(component + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn displayApparatus.toString();\n\t\t} else {\n\t\t\treturn apparatus;\n\t\t}\n\t}",
"public String getUniqueLink(String prefix) {\n\t\tString ans = this.edutility.getSHA256(prefix);\n\t\treturn ans;\n\t}",
"public String createHrefForGroup(final String name) {\n\t\treturn this.groupUrlPrefix + name;\n\t}",
"private static URL buildURL(List<String> args) throws MalformedURLException {\n\n\t\tfinal String IDList = args.stream().map(id -> id.toString() + \",\").reduce(\"\", String::concat);\n\n\t\treturn new URL(String.format(BASE_URL, IDList));\n\t}",
"String getLink();",
"private String calculateTargetHref(URL clickUrl) {\n\t\tString resourceHref = clickUrl.toString();\n\t\ttry {\n\t\t\tresourceHref = URLDecoder.decode(resourceHref,\n\t\t\t\t\tConstants.CHARACTER_ENCODING);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tlog.error(e.getMessage());\n\t\t}\n\t\tresourceHref = resourceHref.substring(ImageLoaderCache.IMAGE_URL_PREFIX\n\t\t\t\t.length());\n\n\t\tif (resourceHref.startsWith(\"#\")) {\n\t\t\treturn resourceHref;\n\t\t}\n\t\tif (currentResource != null\n\t\t\t\t&& StringUtils.isNotBlank(currentResource.getHref())) {\n\t\t\tint lastSlashPos = currentResource.getHref().lastIndexOf('/');\n\t\t\tif (lastSlashPos >= 0) {\n\t\t\t\tresourceHref = currentResource.getHref().substring(0,\n\t\t\t\t\t\tlastSlashPos + 1)\n\t\t\t\t\t\t+ resourceHref;\n\t\t\t}\n\t\t}\n\t\treturn resourceHref;\n\t}",
"private String getHref(HttpServletRequest request)\n {\n String respath = request.getRequestURI();\n if (respath == null)\n \trespath = \"\";\n String codebaseParam = getRequestParam(request, CODEBASE, null);\n int idx = respath.lastIndexOf('/');\n if (codebaseParam != null)\n if (respath.indexOf(codebaseParam) != -1)\n idx = respath.indexOf(codebaseParam) + codebaseParam.length() - 1;\n String href = respath.substring(idx + 1); // Exclude /\n href = href + '?' + request.getQueryString();\n return href;\n }",
"public String createHrefForUser(final String name) {\n\t\treturn this.userUrlPrefix + name;\n\t}",
"public String createHrefForResource(final String userName, final String intraHash) {\n\t\treturn this.userUrlPrefix + userName + this.postsUrlDelimiter + intraHash;\n\t}",
"private String generateUrl(String code) {\n return prefix + recognizeType(code) + code;\n }",
"private HTMLElement generateLinkElement(String href, int indentLevel) {\n \t\tHTMLElement link = new FormattedHTMLElement(\n \t\t\t\tIIntroHTMLConstants.ELEMENT_LINK, indentLevel, true);\n \t\tlink.addAttribute(IIntroHTMLConstants.ATTRIBUTE_RELATIONSHIP,\n \t\t\t\tIIntroHTMLConstants.LINK_REL);\n \t\tlink.addAttribute(IIntroHTMLConstants.ATTRIBUTE_STYLE,\n \t\t\t\tIIntroHTMLConstants.LINK_STYLE);\n \t\tif (href != null)\n \t\t\tlink.addAttribute(IIntroHTMLConstants.ATTRIBUTE_HREF, href);\n \t\treturn link;\n \t}",
"private String generateURL(Integer instanceID, String key) {\n\t\treturn \"http://\" + databaseInstances[instanceID] + \"/target?targetID=\" + key;\n\t}",
"String nextLink();",
"public String href() {\r\n if (parent == null) {\r\n return name;\r\n //return encodedName();\r\n } else {\r\n //return parent.href() + encodedName();\r\n return parent.href() + name;\r\n }\r\n }",
"private Text href() {\n\t\tText href = text();\r\n\r\n\t\tif (syntaxError)\r\n\t\t\treturn null;\r\n\r\n\t\treturn href;\r\n\t}",
"public String getLink();",
"private HTMLElement newtdhref(String contenido, String vinculo) {\n/* 356 */ HTMLElement td = (HTMLElement)this.pagHTML.createElement(\"td\");\n/* 357 */ Element enlace = this.pagHTML.createElement(\"a\");\n/* 358 */ Node hijo = this.pagHTML.createTextNode(contenido);\n/* 359 */ enlace.appendChild(hijo);\n/* 360 */ Attr donde = this.pagHTML.createAttribute(\"href\");\n/* 361 */ donde.setValue(vinculo);\n/* 362 */ enlace.setAttributeNode(donde);\n/* 363 */ td.appendChild(enlace);\n/* 364 */ td.setAttributeNode(newAttr(\"class\", \"ctd\"));\n/* 365 */ return td;\n/* */ }",
"private String generateUrl(List<String> codes) {\n StringBuilder builder = new StringBuilder();\n for (String code : codes) {\n builder.append(\",\");\n builder.append(recognizeType(code));\n builder.append(code);\n }\n builder = builder.delete(0, 1);\n return prefix + builder.toString();\n }",
"Uri mo1686a();",
"public void setHref(String href)\r\n\t{\r\n\t\t_href = href;\r\n\t}",
"private String urlLink(final String url, final String name) {\n Tag aTag = new Tag(\"a\");\n aTag.add(name);\n aTag.addParameter(\"href\", baseUrl + url);\n return aTag.toString();\n }",
"public String link() {\n return DevRant.BASE_URL + DevRant.RANT_URL + '/' + getId();\n }",
"HtmlPage clickLink();",
"String link(@SuppressWarnings(\"rawtypes\") Map params);",
"SimpleLink createSimpleLink();",
"public void setHref(String href) {\r\n this.href = href;\r\n }",
"public String generateLink_Id() {\n\t\tString Link_Id = \"L\" + String.valueOf(rand.genRandomDigits(7));\n\t\twhile (registerDao.checkLinkIdIfExist(Link_Id)) {\n\t\t\tLink_Id = \"C\" + String.valueOf(rand.genRandomDigits(7));\n\t\t}\n\t\treturn Link_Id;\n\t}",
"FullUriTemplateString baseUri();",
"@Override\n protected void onComponentTag(final ComponentTag _tag)\n {\n super.onComponentTag(_tag);\n _tag.setName(\"a\");\n _tag.put(\"href\", \"#\");\n onComponentTagInternal(_tag);\n }",
"private void createIndexLink()\r\n \t{\r\n \t\tif (pageTitle.contains(\"Ruby on Rails\")) {\r\n \t\t\tSimpleLogger.verbose(\" TOC file: not creating index link (no stichwort.htm*\");\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tSimpleLogger.verbose(\" TOC file: creating index link...\");\r\n \t\tElement indexLink = (Element) xPathQuery(XPath.TOC_HEADING_2.query).get(0).copy();\r\n \t\tString fileExtension = \".htm\";\r\n \t\tif (((Element) indexLink.getChild(0)).getAttribute(\"href\").getValue().contains(\".html\"))\r\n \t\t\tfileExtension = \".html\";\r\n \t\t((Element) indexLink.getChild(0)).getAttribute(\"href\").setValue(\"stichwort\" + fileExtension);\r\n \t\t((Text) indexLink.getChild(0).getChild(0)).setValue(\"Index\");\r\n \t\tbodyTag.appendChild(indexLink);\r\n \r\n \t}",
"private HTMLElement generateAnchorElement(IntroLink link, int indentLevel) {\n \t\tHTMLElement anchor = new FormattedHTMLElement(\n \t\t\t\tIIntroHTMLConstants.ELEMENT_ANCHOR, indentLevel, true);\n \t\tif (link.getId() != null)\n \t\t\tanchor.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ID, link.getId());\n \t\tanchor.addAttribute(IIntroHTMLConstants.ATTRIBUTE_CLASS,\n \t\t\t\tIIntroHTMLConstants.ANCHOR_CLASS_LINK);\n \t\tif (link.getUrl() != null)\n \t\t\tanchor.addAttribute(IIntroHTMLConstants.ATTRIBUTE_HREF, link\n \t\t\t\t\t.getUrl());\n \t\treturn anchor;\n \t}",
"public String getURI(int index) {\n/* 96 */ String ns = this.m_dh.getNamespaceOfNode(this.m_attrs.item(index));\n/* 97 */ if (null == ns)\n/* 98 */ ns = \"\"; \n/* 99 */ return ns;\n/* */ }",
"public String getHref() {\n return href;\n }",
"public static String getFormattedLink(String link) {\n\t\tString result = link;\n\t\tif (StringUtils.isNotBlank(result)) {\n\t\t\tif (!result.toLowerCase().startsWith(Constants.PREFIX_HTTP)\n\t\t\t\t\t|| !result.toLowerCase().startsWith(Constants.PREFIX_HTTPS)) {\n\t\t\t\tif (!Constants.EXTENSION_PATTERN_LINK.matcher(result).matches() && !result.startsWith(\"#\")) {\n\t\t\t\t\tresult += Constants.SUFFIX_HTML;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public String getIdFromHrefValue(final String val) {\r\n String result = null;\r\n // FIXME it's no objid pattern\r\n Pattern PATTERN_OBJID_ATTRIBUTE = Pattern.compile(\".*\\\\/([^\\\"\\\\/]*)\");\r\n\r\n Matcher m1 = PATTERN_OBJID_ATTRIBUTE.matcher(val);\r\n if (m1.find()) {\r\n result = m1.group(1);\r\n }\r\n return result;\r\n }",
"private String idToShortURL(int n)\n {\n char map[] = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\".toCharArray();\n\n StringBuffer shorturl = new StringBuffer();\n\n // Convert given integer id to a base 62 number\n while (n > 0)\n {\n // use above map to store actual character\n // in short url\n shorturl.append(map[n%62]);\n n = n/62;\n }\n\n // Reverse shortURL to complete base conversion\n\n\n return shorturl.reverse().toString();\n }",
"public void setHref(String href) {\n this.href = href;\n }",
"private String getAnchorTagDataPart(String string) {\r\n string = string.toLowerCase();\r\n \r\n /*this data should be in the form of <a herf=\"action.jsp&objected=1.1.1.1\">Value</a>*/\r\n int anchorBegin = string.indexOf(\"<a \");\r\n int anchorEnd = string.indexOf(\"</a>\");\r\n /*If the string is not of above specified format i.e. not begining with '<a' or ending with '</a>' \r\n then return the original string.*/ \r\n if(anchorBegin == -1 || anchorEnd == -1)\r\n return string;\r\n /*\r\n * Remove the </a> part from the stirng\r\n * Now the string becomes <a herf=\"action.jsp&objected=1.1.1.1\">Value\r\n * */\r\n string = string.substring(anchorBegin, anchorEnd);\r\n /*Now get the index of '>' and return the sub string of string.indexOf('>') + 1*/\r\n string = string.substring(string.indexOf('>') + 1);\r\n \r\n return string;\r\n }",
"public String createHrefForResource(final String userName, final String intraHash, final Date date) {\n\t\treturn this.userUrlPrefix + userName + this.postsUrlDelimiter + intraHash + PARTS_DELIMITER + dateFormat.format(date);\n\t}",
"private static File getAssetLinkFile(MD5Key id) {\n \t\treturn new File(cacheDir.getAbsolutePath() + File.separator + id + \".lnk\");\n \t}",
"public String genLink (String request, Array filters){\n \n }",
"public void setHref(Reference href) {\n this.href = href;\n }",
"public abstract String toUrl(Object inNode);",
"protected String validAnchor(String id) {\n if (!DoxiaUtils.isValidId(id)) {\n String linkAnchor = DoxiaUtils.encodeId(id);\n\n LOGGER.debug(\"Modified invalid link '{}' to '{}'\", id, linkAnchor);\n\n return linkAnchor;\n }\n\n return id;\n }",
"protected String newLinkName(){\n\t\treturn \"WomoEvtLnk_\" + linkNr++;\n\t}",
"private String link2Anchor(String expression, LinkType type) {\n\t\tString replaceText = null;\n\n\t\tint index = expression.indexOf(\"|\");\n\t\tif (index > 0) {\n\t\t\tString pageName = expression.substring(0, index);\n\t\t\tpageName = StringUtils.removeAllFormatting(pageName);\n\t\t\tpageName = StringUtils.unescapeXML(pageName);\n\t\t\tString id = baseId + \"-\" + UUID.uuid(4);\n\n\t\t\tString linkText = expression.substring(index + 1).trim();\t\n\t\t\treplaceText = this.getReplaceText(id, linkText, expression, type);\n\t\t\t\n\t\t\tLinkInfo pli = new LinkInfo(id, type, pageName, \"\");\n\t\t\tparserResult.linkInfos.add(pli);\n\t\t}\n\n\t\treturn replaceText;\n\t}",
"private Hyperlink makeHyperlink(){\n\t\tHyperlink ret = new Hyperlink();\n\t\tret.setId(\"variable\");\n\t\tret.setOnMouseClicked(e -> clickedVariable(ret));\n\t\tvBox.getChildren().add(ret);\n\t\treturn ret;\n\t}",
"LINK createLINK();",
"@Test\n\tpublic void testGetLinksRelativeLink() {\n\t\tList<String> results = helper\n\t\t\t\t.getLinks(\"drop tables; <A HREF=\\\"/test\\\"> junk junk\", \"http://www.bobbylough.com\");\n\t\tassertEquals(1, results.size());\n\t\tassertEquals(\"http://www.bobbylough.com/test\", results.get(0));\n\t}",
"String link(@SuppressWarnings(\"rawtypes\") Map params, String encoding);",
"private String makeJspUrl(String result) {\n String path = this.jspUrlPattern\n .replaceAll(\"\\\\$\\\\{action\\\\}\", id.getActionName())\n .replaceAll(\"\\\\$\\\\{method\\\\}\", id.getMethodName())\n .replaceAll(\"\\\\$\\\\{result\\\\}\", result);\n logger.debug(\"path for target: '{}', result: '{}' is '{}'\", id, result, path);\n return path;\n }",
"public String getHref() {\r\n return href;\r\n }",
"private static String getDeprecatedUrlKey(int id) {\n return id + \"_url\";\n }",
"public java.lang.String getLinkid(){\r\n return localLinkid;\r\n }",
"public String getLink(String link,long id) throws IllegalArgumentException, UnsupportedEncodingException \n\t{\n\t\treturn link+userToken.generateToken(id);\n\t}",
"private void buildBS60Url() {\n url = \"http://q.lizone.net/index/index/BSline/res/60/label/\" + dataItem.label;//API 2.0\n }",
"public Hyperlink(){\n this.href = \"\";\n this.text = new TextSpan(\"\");\n }",
"private static URL absolutize(URL baseURL, String href) \n throws MalformedURLException, BadHrefAttributeException {\n \n Element parent = new Element(\"c\");\n parent.setBaseURI(baseURL.toExternalForm());\n Element child = new Element(\"c\");\n parent.appendChild(child);\n child.addAttribute(new Attribute(\n \"xml:base\", \"http://www.w3.org/XML/1998/namespace\", href));\n URL result = new URL(child.getBaseURI());\n if (!\"\".equals(href) && result.equals(baseURL)) {\n if (! baseURL.toExternalForm().endsWith(href)) {\n throw new BadHrefAttributeException(href \n + \" is not a syntactically correct IRI\");\n }\n }\n return result;\n \n }",
"public String createInternalLinkGoTo(String id, int objectNumber)\n {\n IDNode node = (IDNode)idReferences.get(id); // retrieve id node\n node.createInternalLinkGoTo(objectNumber); // create Internal Link GoTo object\n return node.getInternalLinkGoToReference(); //return Internal Link Go To object reference\n }",
"public String GenerateRifiutaAssegnamentoLink(String id_cliente, String id_autista, String id_automezzo,String data){\n if(id_autista!=null && id_cliente!=null &&id_automezzo!=null){\n return \"<a class='rifiuta-link' href='rifiuta-assegnamento?id_automezzo=\"+id_automezzo+\"&id_cliente=\"+id_cliente+\"&id_autista=\"+id_autista+\"&data=\"+data+\"'>Rifiuta</a>\";\n }\n return \"Non disponibile\";\n }",
"public String mo10346a() {\n return \"DeepLink.ChangeID\";\n }",
"String translateNamespacePrefixToUri(String prefix, Object element);",
"public DefaultHref(String baseUrl)\r\n {\r\n this.parameters = new HashMap();\r\n setFullUrl(baseUrl);\r\n }",
"private void writeLink() throws SAXException, IOException {\n if (state.uri != null && state.uri.trim().length() > 0) {\n xhtml.startElement(\"a\", \"href\", state.uri);\n xhtml.characters(state.hrefAnchorBuilder.toString());\n xhtml.endElement(\"a\");\n } else {\n try {\n //if it isn't a uri, output this anyhow\n writeString(state.hrefAnchorBuilder.toString());\n } catch (IOException e) {\n handleCatchableIOE(e);\n }\n }\n state.hrefAnchorBuilder.setLength(0);\n state.inLink = false;\n state.uri = null;\n\n }",
"public URI getHref() {\n return entityLinks.linkForItemResource(Hunt.class, id).toUri();\n }",
"public static String getIconUrl(long id, String icon) {\n String url = \"http://pic.qiushibaike.com/system/avtnew/%s/%s/thumb/%s\";\n return String.format(url, id / 10000, id, icon);\n }",
"String getLinkName();",
"public static String getArticleHref(Element content) {\n Elements texts = content.select(\".text a\");\n return BBC_URL + texts.attr(\"href\");\n }",
"private String makeBitstreamLink(Item item, Bitstream bitstream)\n {\n String name = bitstream.getName();\n StringBuilder result = new StringBuilder(contextPath);\n result.append(\"/bitstream/item/\").append(String.valueOf(item.getID()));\n // append name although it isn't strictly necessary\n try\n {\n if (name != null)\n {\n result.append(\"/\").append(Util.encodeBitstreamName(name, \"UTF-8\"));\n }\n }\n catch (UnsupportedEncodingException uee)\n {\n // just ignore it, we don't have to have a pretty\n // name on the end of the url because the sequence id will\n // locate it. However it means that links in this file might\n // not work....\n }\n result.append(\"?sequence=\").append(String.valueOf(bitstream.getSequenceID()));\n return result.toString();\n }",
"void addLink(byte start, byte end);",
"Link createLink();",
"public String hyperlink1_action() {\n try {\n String primaryid = (String)hyperlink1.getValue();\n getSessionBean1().getProcesseddatasetRowSet().setObject(\n 1, primaryid);\n //dbssearch.Page1.processeddatasetDataProvider.refresh();\n }catch (Exception e) {\n log(\"Exception Raised:\" + e.getMessage());\n }\n return \"case1\";\n }",
"public String getDownloadLink() {\r\n\t\tString site = MySoup.getSite();\r\n\t\tString authKey = MySoup.getAuthKey();\r\n\t\tString passKey = MySoup.getPassKey();\r\n\t\tString downloadLink = site + \"torrents.php?action=download&id=\" + id + \"&authkey=\" + authKey + \"&torrent_pass=\" + passKey;\r\n\t\treturn downloadLink;\r\n\t}",
"public String getHref() {\n return href;\n }",
"public LinkImpl(String href) {\n this.href = href;\n }",
"public URL makeFullUrl(String scrapedString, URL base);",
"public String compileUrl(UrlBuilder baseUrl, String resource, String id) {\n return compileUrlBuilder(baseUrl, resource, id).toString();\n }",
"@ApiModelProperty(value = \"Unique reference of the entity\")\n\n\n public String getHref() {\n return href;\n }",
"public String getHref()\r\n\t{\r\n\t\treturn _href;\r\n\t}",
"@Override\n\tpublic String shortenUrl(String longUrl){\n\t\tString encodedUrl = \"\";\n\t\tInteger hashKey = (int) UUID.nameUUIDFromBytes(longUrl.getBytes()).getMostSignificantBits();\n\t\tencodedUrl = Integer.toString(hashKey, 36);\n\t\treturn \"http://localhost:8080/URLShortner/short/\" +encodedUrl;\n\t}",
"protected String getIdentifier() {\n return getBaseUrl() + normalizePath(getRequest().getPath());\n }",
"public String reverseLink(String str) {\n int pip = str.indexOf(BundlesDT.DELIM, str.indexOf(BundlesDT.DELIM)+1);\n\treturn str.substring(pip+1,str.length()) + BundlesDT.DELIM + str.substring(0,pip);\n }",
"private String getJiaoDaUrl(MesItemHolder holder) {\n StringBuilder url = new StringBuilder(holder.getBaseUrl());\n if(holder.isPull()){\n url.append(\"?modcode=jygl_xjhxxck&subsyscode=zpfw&type=searchXjhxx&xjhType=all\");\n }else{\n\n url.append(\"?ype=goPager&requestPager=pager&pageMethod=next¤tPage=\"+(holder.getPager()-1));\n }\n return url.toString();\n }",
"private String findLink(BasicPanel panel, Element e)\n {\n String uri = null;\n\n for (Node node = e; node.getNodeType() == Node.ELEMENT_NODE; node = node.getParentNode())\n {\n uri = panel.getSharedContext().getNamespaceHandler().getLinkUri((Element) node);\n\n if (uri != null)\n {\n try\n {\n URI linkUri = getLinkUri(uri);\n String target = panel.getSharedContext().getNamespaceHandler().getAttributeValue((Element) node, \"target\");\n logger.debug(\"link target: \" + target);\n if (EXTERNAL_TARGET.equalsIgnoreCase(target))\n {\n logger.info(\"launch external browser for \" + uri);\n BareBonesBrowserLaunch.openURL(linkUri.toString());\n uri = null;\n }\n else if (EXTERNAL_MORE_ASSIGNMENT.equalsIgnoreCase(target))\n {\n if (showMoreInfo != null)\n {\n logger.info(\"show more assignment with \" + uri);\n showMoreInfo.showMoreInfo(linkUri, MoreInfoTypes.ASSIGNMENT, eloUri);\n }\n else\n {\n logger.info(\"could not show more assignment (showMoreInfo==null) with \" + uri);\n }\n uri = null;\n }\n else if (EXTERNAL_MORE_RESOURCES.equalsIgnoreCase(target))\n {\n if (showMoreInfo != null)\n {\n logger.info(\"show more resources with \" + uri);\n showMoreInfo.showMoreInfo(linkUri, MoreInfoTypes.RESOURCES, eloUri);\n }\n else\n {\n logger.info(\"could not show more resources (showMoreInfo==null) with \" + uri);\n }\n uri = null;\n }\n break;\n }\n catch (URISyntaxException ex)\n {\n logger.error(\"error in uri\", ex);\n }\n }\n }\n\n return uri;\n }",
"protected String getNextID(String prefix) {\n return String.format(\"%s-%s\", prefix, UUID.randomUUID().toString()) ;\n }",
"@When(\"^Click on Compose hyperlink icon$\")\npublic void click_on_Compose_hyperlink_icon() throws Throwable \n{\n\tWebElement p=driver.findElement(By.partialLinkText(\"Compose\"));\n p.click();\n System.out.println(\"Page title after link click : \" + driver.getTitle());\n \n\n\n}",
"@DSSource({DSSourceKind.FILE_INFORMATION})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.376 -0500\", hash_original_method = \"AC6673E983BE229DBE393CCBB4A72E75\", hash_generated_method = \"03FD0CE5F473571E708DB9317FA1B856\")\n \npublic String getURI (String prefix)\n {\n return currentContext.getURI(prefix);\n }",
"@Override\n public AbstractLink constructLink(String id) {\n return new ExternalLink(id, Model.of(WicketUtil.getContextPath() + \"/settings/system\"));\n }",
"private String buildLink(String posterPath) {\n return \"http://image.tmdb.org/t/p/w92\" + posterPath;\n }",
"public String getHyperlinkBase()\r\n {\r\n return (m_hyperlinkBase);\r\n }",
"public String getLinkName();",
"public StacLink href(String href) {\n this.href = href;\n return this;\n }",
"public String urlBuilder(int year, int month, int day){\n\t\tStringBuilder url = new StringBuilder(baseUrl);\n\t\turl.append(year);\n\t\turl.append(\"/\");\n\t\tif(month<10)url.append('0');//if month is one digit we pad zero to url\n\t\turl.append(month);\n\t\turl.append(\"/\");\n\t\tif(day<10)url.append('0');//if day is one digit we pad zero to url\n\t\turl.append(day);\n\t\turl.append(\".xml\");\n\t\treturn url.toString();\n\t}"
] | [
"0.6393971",
"0.6285216",
"0.62768793",
"0.59119016",
"0.5870693",
"0.5839278",
"0.5832323",
"0.5743275",
"0.57402384",
"0.57004654",
"0.56947345",
"0.56911457",
"0.5683167",
"0.5603644",
"0.55467826",
"0.5500921",
"0.54876876",
"0.54613537",
"0.54589087",
"0.54007316",
"0.5388464",
"0.53867424",
"0.5359784",
"0.53295386",
"0.5329059",
"0.5315511",
"0.5299776",
"0.5257588",
"0.52485913",
"0.52479",
"0.52383226",
"0.52381366",
"0.523249",
"0.52267396",
"0.5218263",
"0.5213797",
"0.5204065",
"0.5197384",
"0.519134",
"0.51679206",
"0.51622355",
"0.516112",
"0.5150657",
"0.513799",
"0.5133006",
"0.5119416",
"0.51147336",
"0.51143444",
"0.5110395",
"0.51102",
"0.5109735",
"0.5101725",
"0.5094153",
"0.5090215",
"0.50900215",
"0.508141",
"0.5073677",
"0.5071229",
"0.50654215",
"0.50546247",
"0.5041685",
"0.50395024",
"0.50366545",
"0.5031885",
"0.50297296",
"0.50257385",
"0.5024735",
"0.5015462",
"0.50143176",
"0.5011464",
"0.5007766",
"0.50007176",
"0.4996237",
"0.499425",
"0.4988544",
"0.49862048",
"0.49829215",
"0.4980968",
"0.49755445",
"0.49754944",
"0.4973517",
"0.49709243",
"0.4969251",
"0.4964621",
"0.49639234",
"0.49620807",
"0.4961508",
"0.49601907",
"0.4953585",
"0.49529675",
"0.49524096",
"0.49512467",
"0.4924966",
"0.4913262",
"0.49079",
"0.490382",
"0.48979342",
"0.48978648",
"0.48869824",
"0.48865306"
] | 0.6208509 | 3 |
Returns a BiFunction that evaluates the given expression where the two parameters are "x" and "y" | @SuppressWarnings("unchecked")
public static BiFunction<Double, Double, Double> compileDoubleBiFunction(String expression) {
// check for obviously invalid expressions
if (expression == null || expression.length() == 0)
return null;
return (BiFunction<Double, Double, Double>)
createNewInstance( "java.util.function.BiFunction<Double, Double, Double>",
"Double apply(Double x, Double y)",
expression);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@FunctionalInterface\npublic interface BiIntFunction {\n int apply(int var1, int var2);\n}",
"public Function(Point x, Point y) {\n double delta = (x.y - y.y) / (x.x - y.x);\n a = -1 * delta;\n b = -(x.y - delta * x.x);\n }",
"abstract double apply(double x, double y);",
"public boolean apply(int x0, int y0, int x, int y);",
"public interface Function2<X1,X2,Y> {\n\tY apply(X1 x1, X2 x2);\n}",
"public int f(int x, int y) {\n switch (function_id) {\n case 1:\n return x + y;\n case 2:\n return x * y;\n default:\n throw new RuntimeException(\"Not Implement\");\n }\n }",
"static <A, B, R> Supplier<R> bind(BiFunction<A, B, R> f, A firstParam, B secondParam) {\n return () -> f.apply(firstParam, secondParam);\n }",
"static <X, Y, Z> Function<Function<X, Y>,\n Function<Function<Y, Z>,\n Function<X, Z>>> higherAndThen() {\n return x -> y -> z -> y.apply(x.apply(z));\n }",
"@FunctionalInterface\npublic interface BiFunction<I1,I2,O,E extends Exception> {\n\n\tpublic O apply(I1 first, I2 second) throws E;\n\n}",
"public static double function(double x, double y)\r\n\t{\r\n\t\treturn (1-cos(PI * x)) * pow((1.23456 + cos(1.06512 * y)), 2) * \r\n\t\t\t\texp(-(pow(x, 2)) - (pow(y, 2)));\r\n\t}",
"static <A, B, R> Function<B, R> bind(BiFunction<A, B, R> f, A firstParam) {\n return secondParam -> f.apply(firstParam, secondParam);\n }",
"static <T> Function<T,SibillaValue> apply(BinaryOperator<SibillaValue> op, Function<T,SibillaValue> f1, Function<T, SibillaValue> f2) {\n return arg -> op.apply(f1.apply(arg), f2.apply(arg));\n }",
"public static void main(String[] args) {\n System.out.println(getInt());\n// Function<Integer, Integer> increment = num -> ++num;\n// System.out.println(increment.apply(2));\n// Function<Integer, Integer> incrementTwoTimes = increment.andThen(increment);\n// System.out.println(incrementTwoTimes.apply(2));\n//\n// BiFunction <Integer, Integer, Integer> biIncrement = (number1, number) -> number1 + number ;\n// System.out.println(biIncrement.apply(increment.apply(2), increment.apply(2)));\n }",
"public static void main(String[] args) {\n\t\tFunction<Integer, Integer> f = (x) -> x+20;\r\n\t\tSystem.out.println(f.apply(20));\r\n\t\tFunction<Integer, Double> f1 = (x) -> x+20.0;\r\n\t\tSystem.out.println(f1.apply(20));\r\n\t\tFunction<String, Integer> f2 = (str) -> str.length();\r\n\t\tSystem.out.println(f2.apply(\"Aditya Mukherjee\"));\r\n\t\r\n\t\r\n//\t Function Chaining\r\n\t\tFunction<Integer, Integer> f3 = (x) -> 2*x;\r\n\t\tFunction<Integer, Integer> f4 = (x) -> x*x*x;\r\n//\t\tAND THEN FUNCTION\r\n\t\tSystem.out.println(\"And Then Output \"+f3.andThen(f4).apply(2));\r\n//\t\tCOMPOSE FUNCTION\r\n\t\tSystem.out.println(\"Compose Output \"+f3.compose(f4).apply(2));\r\n//\tBIFUNCTION\r\n\t\tBiFunction<Integer, Integer, Integer> bf = (x,y) -> x+y;\r\n\t\tSystem.out.println(bf.apply(20, 30));\r\n\t\r\n\t}",
"int f(int x, int y);",
"public static void main(String[] arg) {\n\r\n System.out.println(incrementByOneFunction.apply(2));\r\n\r\n System.out.println(multipleByTen.apply(12));\r\n\r\n System.out.println(addByOneThenMulByTen.apply(19));\r\n\r\n // BiFunction takes two argument and produce one result\r\n\r\n System.out.println(incrementByOneAndMultiplyBiFunction.apply(4,100));\r\n }",
"public static <T, R> BiFunction<T, T, R> apply22(BiFunction<T, T, R> function) {\n return (arg1, arg2) -> function.apply(arg2, arg2);\n }",
"static long andOperator(long x, long y)\n {\n long res = 0; // Initialize result\n while (x > 0 && y > 0) {\n // Find positions of MSB in x and y\n int msb_p1 = msbPos(x);\n int msb_p2 = msbPos(y);\n // If positions are not same, return\n if (msb_p1 != msb_p2)\n break;\n // Add 2^msb_p1 to result\n long msb_val = (1 << msb_p1);\n res = res + msb_val;\n // subtract 2^msb_p1 from x and y.\n x = x - msb_val;\n y = y - msb_val;\n }\n return res;\n }",
"static <T, U> BiFunction<T,U,SibillaValue> apply(BinaryOperator<SibillaValue> op, BiFunction<T, U, SibillaValue> f1, BiFunction<T, U, SibillaValue> f2) {\n return (t,u) -> op.apply(f1.apply(t, u), f2.apply(t, u));\n }",
"public static void main(String[] args) {\n Function<String, Integer> func = x -> x.length();\n Integer apply = func.apply(\"hello\");\n System.out.println(apply);\n\n // Function (Take Integer argument and return also an Integer argument multiply by 2)\n Function<Integer, Integer> func2 = x -> x * 2;\n System.out.println(func2.apply(25));\n\n // Use andThen 1. call function func 2. then call function func2\n Integer result = func.andThen(func2).apply(\"hello\");\n System.out.println(result);\n\n Integer y = 2;\n Function<Integer, Integer> nf = x -> x * 4;\n System.out.println(nf.apply(y + 5));\n }",
"public static void main(String[] args) {\r\n\t\t\r\n\t\t//Calling normal method with 2 arguments\r\n\t\tint a = incBy1AndMul(5, 100);\r\n\t\tSystem.out.println(a);\r\n \r\n\t\t//Calling BiFunction i.e. passing 2 arguments\r\n\t\tint b = biIncBy1andMulByY.apply(5, 100);\r\n\t\tSystem.out.println(b);\r\n\t}",
"public static BinaryExpression andAssign(Expression expression0, Expression expression1, Method method, LambdaExpression lambdaExpression) { throw Extensions.todo(); }",
"public static BinaryExpression and(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"double apply(double x, double y) {\n switch (this) {\n case PLUS: return x + y;\n case MINUS: return x - y;\n case TIMES: return x * y;\n case DEVICE: return x / y;\n }\n throw new AssertionError(\"unknwon op: \" + this);\n }",
"@FunctionalInterface\n private interface TwoParameterFunction<T, U, R> {\n R apply(T t, U u);\n }",
"public Integer perform (IExpression left, IExpression right);",
"public abstract Operand execute(Operand first, Operand second);",
"int apply(int x, int y, int origin);",
"public static BinaryExpression andAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression equal(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public abstract int apply(int lhs, int rhs);",
"public interface BinaryFunction<T1, T2, R> {\n\n\t/**\n\t * Invoke the function.\n\t * @param arg1 The first argument.\n\t * @param arg2 The second argument.\n\t * @return The result of the function.\n\t */\n\tpublic R invoke(T1 arg1, T2 arg2);\n\t\n}",
"public static void main(String[] args) {\n\t\tA i2 = (a,b) -> a+b;\r\n\t\t//B i2 = new B();\r\n\t\tSystem.out.println(i2.add(\"10\",30));\r\n\t\t//System.out.println(i.squrtIt(10));\r\n\t\t\r\n\t}",
"public static BinaryExpression andAlso(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression andAssign(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"static <T, U, R> BiFunction<T, U, R> biFunction(BiFunction<T, U, R> biFunction) {\n return biFunction;\n }",
"public static BinaryExpression andAlso(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"public static BinaryExpression and(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"public interface Function2<T, U, K> {\n\n /**\n * This method is a composition of two functions:\n * it acts as g(f(x, y))) where f is the Function2 class object\n * and g is a Function1 class object.\n * @param g one-argument function,\n * the outer function of the composition\n * @param <V> outer function range type parameter\n * @return function of one argument that represents g(f(x, y))\n */\n default <V> Function2<T, U, V> compose(@NotNull final Function1<? super K, ? extends V> g) {\n return (t, u) -> g.apply(Function2.this.apply(t, u));\n }\n\n /**\n * This method binds the first argument with a provided value.\n * @param newFirstArgument argument to be bound\n * @return new function object with a bound first argument\n */\n default Function1<U, K> bind1(T newFirstArgument) {\n return u -> Function2.this.apply(newFirstArgument, u);\n }\n\n /**\n * This method binds the second argument with a provided value.\n * @param newSecondArgument argument to be bound\n * @return new function object with a bound second argument\n */\n default Function1<T, K> bind2(U newSecondArgument) {\n return t -> Function2.this.apply(t, newSecondArgument);\n }\n\n /**\n * This method implements currying:\n * instead of a two-argument function we get\n * two one-argument functions.\n * @return function g such that g(x)(y) == f.apply(x, y)\n */\n default Function1<T, Function1<U, K>> curry() {\n return this::bind1;\n }\n\n /**\n * This method applies the function to provided arguments.\n * @param arg1 first argument\n * @param arg2 second argument\n * @return result of function application\n */\n K apply(T arg1, U arg2);\n}",
"public static Function<Integer, Integer> compose(Function<Integer, Integer> f1, Function<Integer, Integer> f2) {\n return arg -> f1.apply(f2.apply(arg));\n }",
"public static <T, U, R, A2 extends U> Function<T, R> bind2(BiFunction<T, U, R> function, A2 arg2) {\n return (arg1) -> function.apply(arg1, arg2);\n }",
"static <T> Function<T, SibillaValue> apply(DoubleBinaryOperator op, Function<T,SibillaValue> f1, Function<T,SibillaValue> f2) {\n return arg -> SibillaValue.of(op.applyAsDouble(f1.apply(arg).doubleOf(), f2.apply(arg).doubleOf()));\n }",
"public double returnValue(double x, double y);",
"static DoubleUnaryOperator convert(double f, double b) {\n\t\treturn (double x) -> f * x + b;\n\t}",
"public static void doTest(Function<String, Integer> f1, Function<Integer, Integer> f2) {\n Integer n2 = f1.andThen(f2).apply(\"5\");\n System.out.println(n2);\n }",
"public static Expression atan2(final Expression yValue, final Expression xValue) {\n return new Expression(\"$atan2\", List.of(yValue, xValue));\n }",
"private static ExpSem apply(ExpSem exp1, ExpSem exp2,\n BiFunction<Value,Value,Value> fun)\n {\n if (exp1 instanceof ExpSem.Single)\n {\n ExpSem.Single e1 = (ExpSem.Single)exp1;\n if (exp2 instanceof ExpSem.Single)\n {\n ExpSem.Single e2 = (ExpSem.Single)exp2;\n return (ExpSem.Single)(Context c)->\n {\n Value v1 = e1.apply(c);\n Value v2 = e2.apply(c);\n return fun.apply(v1, v2);\n };\n }\n else\n {\n ExpSem.Multiple e2 = (ExpSem.Multiple)exp2;\n return (ExpSem.Multiple)(Context c)->\n {\n Value v1 = e1.apply(c);\n Seq<Value> s2 = e2.apply(c);\n return s2.apply((Value v2)-> fun.apply(v1, v2));\n };\n }\n }\n else\n {\n ExpSem.Multiple e1 = (ExpSem.Multiple)exp1;\n if (exp2 instanceof ExpSem.Single)\n {\n ExpSem.Single e2 = (ExpSem.Single)exp2;\n return (ExpSem.Multiple)(Context c)->\n {\n Seq<Value> s1 = e1.apply(c);\n Value v2 = e2.apply(c);\n return s1.apply((Value v1)-> fun.apply(v1, v2));\n };\n }\n else\n {\n ExpSem.Multiple e2 = (ExpSem.Multiple)exp2;\n return (ExpSem.Multiple)(Context c)->\n {\n Seq<Value> s1 = e1.apply(c);\n Seq<Value> s2 = e2.apply(c);\n return s1.applyJoin((Value v1)->\n s2.apply((Value v2)-> fun.apply(v1, v2)));\n };\n }\n }\n }",
"public static BinaryExpression coalesce(Expression expression0, Expression expression1, LambdaExpression lambdaExpression) { throw Extensions.todo(); }",
"public static BinaryExpression exclusiveOrAssign(Expression expression0, Expression expression1, Method method, LambdaExpression lambdaExpression) { throw Extensions.todo(); }",
"int test(S2Point a0, S2Point ab1, S2Point a2, S2Point b0, S2Point b2);",
"public static <T, R> BiFunction<T, T, R> apply21(BiFunction<T, T, R> function) {\n return (arg1, arg2) -> function.apply(arg2, arg1);\n }",
"@Override\n public Function<List<? extends A>, B> apply(final Function2<? super A, ? super B, B> arg1, final B arg2) {\n return new Function<List<? extends A>, B>() {\n @Override\n public B apply(List<? extends A> arg) {\n B acc = arg2;\n Collections.reverse(arg);\n for (A element : arg) {\n acc = arg1.apply(element, acc);\n }\n return acc;\n }\n };\n }",
"public static void main(String[] args) {\n BiPredicate<Integer,String> biPredicate = (number,str)->{\n return number<10 && str.length()>5;\n };\n System.out.println(biPredicate.test(3,\"Renga\"));\n\n //Takes 2 input and returns an output of any type.\n BiFunction<Integer,String,Boolean> biFunction = (number,str)->{\n return number<10 && str.length()>5;\n };\n System.out.println(biFunction.apply(2,\"kkk\"));\n\n //Takes 2 input and returns nothing.\n BiConsumer<Integer,String> biConsumer = (s1,s2)->{\n System.out.println(s1);\n System.out.println(s2);\n };\n biConsumer.accept(12,\"10\");\n }",
"public static BinaryExpression lessThanOrEqual(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"IntervalTupleList evaluate(Interval x);",
"static <A, B, C, R> Function<C, R> bind(TriFunction<A, B, C, R> f, A firstParam, B secondParam) {\n return thirdParam -> f.apply(firstParam, secondParam, thirdParam);\n }",
"public static BinaryExpression exclusiveOr(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"static <A, B, C, R> BiFunction<B, C, R> bind(TriFunction<A, B, C, R> f, A firstParam) {\n return (secondParam, thirdParam) -> f.apply(firstParam, secondParam, thirdParam);\n }",
"public static BinaryExpression exclusiveOr(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression coalesce(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public interface Function2<T, U, R> {\n R apply(T t, U u);\n\n /**\n * Method to create composition: after(this(x, y)).\n *\n * @param after function to apply after.\n * @param <V> return type of after.\n * @return composition of functions.\n */\n default <V> Function2<T, U, V> compose(Function1<? super R, ? extends V> after) {\n return (t, u) -> after.apply(this.apply(t, u));\n }\n\n /**\n * Method to bind 1st parameter of function.\n *\n * @param firstParameter value of 1st argument to bind.\n * @return function from 1 arguments that waits for the second argument.\n */\n default Function1<U, R> bind1(T firstParameter) {\n return (u) -> apply(firstParameter, u);\n }\n\n /**\n * Method to bind 2nd parameter of function.\n *\n * @param secondParameter value of 2nd argument to bind.\n * @return function from 1 arguments that waits for the first argument.\n */\n default Function1<T, R> bind2(U secondParameter) {\n return (t) -> apply(t, secondParameter);\n }\n\n /**\n * Method to curry function, second parameter will be bind.\n *\n * @param parameter parameter to set.\n * @return function from 1 argument(1st argument of Function2).\n */\n default Function1<T, R> curry(U parameter) {\n return bind2(parameter);\n }\n}",
"public static <A, B, C> Function<A, C> combine(Function<A, B> functionOne, Function<B, C> functionTwo) {\n// return functionTwo.compose(functionOne);\n return (A a) -> functionTwo.apply(functionOne.apply(a));\n }",
"default Function1<T, R> bind2(U secondParameter) {\n return (t) -> apply(t, secondParameter);\n }",
"public static float map(float x, float a1, float a2, float b1, float b2) {\r\n return b1 + (b2 - b1) * (x - a1) / (a2 - a1);\r\n }",
"public static <A, B> Function<Tuple2<A, B>, Tuple2<A, B>> withB(@Nullable final B b) {\n final class WithBFunction implements Function<Tuple2<A, B>, Tuple2<A, B>>, Serializable {\n private static final long serialVersionUID = -3772229372311193449L;\n\n @Override\n public Tuple2<A, B> apply(Tuple2<A, B> input) {\n return input.withB(b);\n }\n }\n return new WithBFunction();\n }",
"public static <T, R> BiFunction<T, T, R> apply11(BiFunction<T, T, R> function) {\n return (arg1, arg2) -> function.apply(arg1, arg1);\n }",
"public static BinaryExpression powerAssign(Expression expression0, Expression expression1, Method method, LambdaExpression lambdaExpression) { throw Extensions.todo(); }",
"static <T, U> BiFunction<T, U, SibillaValue> apply(DoubleBinaryOperator op, BiFunction<T, U, SibillaValue> f1, BiFunction<T, U, SibillaValue> f2) {\n return (t, u) -> SibillaValue.of(op.applyAsDouble(f1.apply(t, u).doubleOf(), f2.apply(t, u).doubleOf()));\n }",
"void visitOperandFunction(ArgumentFunction operand);",
"public static BinaryExpression exclusiveOrAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression power(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static BinaryExpression exclusiveOrAssign(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"public static BinaryExpression assign(Expression left, Expression right) { throw Extensions.todo(); }",
"IntervalTupleList evaluate(double low, double high);",
"@FunctionalInterface\npublic interface PairingFunction<X> extends Function<X, Pair<X, ? extends Comparable>> {\n Comparator<Pair<?, ? extends Comparable>> COMPARATOR = Comparator.comparing(Pair::getValue);\n\n Pair<X, ? extends Comparable> apply(X obj);\n}",
"public static BinaryExpression equal(Expression expression0, Expression expression1, boolean liftToNull, Method method) { throw Extensions.todo(); }",
"default Function1<T, K> bind2(U newSecondArgument) {\n return t -> Function2.this.apply(t, newSecondArgument);\n }",
"public static BinaryExpression greaterThanOrEqual(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"@Override\r\n\tpublic int calculate(int a, int b) {\n\t\treturn (a + b) * 2;\r\n\t}",
"private int convert(int x, int y) {\n\treturn (150 * y) + x;\n }",
"static <A, B, R> BiFunction<B, A, R> flip(BiFunction<A, B, R> f) {\n return (a, b) -> f.apply(b, a);\n }",
"public interface BinaryOperators<T> {\n\n\t/** BinaryOperator<T> extends BiFunction<T,T,T> */\n\tT apply(T t1, T t2);\n\n\t/** DoubleBinaryOperator */\n\tdouble applyAsDouble(double left, double right);\n\n\t/** IntBinaryOperator */\n\tint applyAsInt(int left, int right);\n\n\t/** LongBinaryOperator */\n\tlong applyAsLong(long left, long right);\n\n}",
"@Override\n\tpublic double evaluateExpression(ArrayList<MembershipFunction> inputs) {\n\t\treturn Math.max(left.evaluateExpression(inputs), right.evaluateExpression(inputs));\n\t}",
"public interface Function1<A,B> {\n\tB apply(A a);\n}",
"public MathObject evaluate(Function input);",
"public static BinaryExpression makeBinary(ExpressionType binaryType, Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"private Point methodTwo(BigInteger xp, BigInteger xq, BigInteger yp,\n\t\t\tBigInteger yq) {\n\t\tPoint res = new Point();\n\t\tBigInteger s = (THREE.multiply(xp.multiply(xp)).add(a)).mod(zp)\n\t\t\t\t.multiply(yp.add(yp).modInverse(zp)).mod(zp);\n\t\tres.setX(s.multiply(s).subtract(xp).subtract(xq).mod(zp));\n\t\tres.setY(s.multiply(xp.subtract(res.getX())).subtract(yp).mod(zp));\n\t\treturn res;\n\t}",
"public static double f2_a(double a, double m, double[] x, double[] y) {\r\n\t\tdouble f2_a = 0;\r\n\t\tdouble part1 = 0;\r\n\t\tdouble part2 = 0;\r\n\t\tfor (int i = 0; i < x.length; i++) {\r\n\t\t\tpart1 = part1 + Math.log(x[i]) * Math.pow(x[i], 2 * m);\r\n\t\t\tpart2 = part2 + Math.log(x[i]) * Math.pow(x[i], m) * y[i];\r\n\t\t}\r\n\t\tf2_a = 2 * a * part1 - part2;\r\n\t\treturn f2_a;\r\n\t}",
"@Ignore\n\t@Test\n\tpublic void test2() {\n\t\tfinal LogicalExpression conj = TestServices\n\t\t\t\t.getCategoryServices()\n\t\t\t\t.readSemantics(\n\t\t\t\t\t\t\"(conj:<<e,t>,<<e,t>,t>> (lambda $0:e (next_to:<e,<e,t>> $0 colorado:e)) (lambda $1:e (next_to:<e,<e,t>> $1 nm:e)))\");\n\t\tfinal LogicalExpression func = TestServices\n\t\t\t\t.getCategoryServices()\n\t\t\t\t.readSemantics(\n\t\t\t\t\t\t\"(lambda $0:<e,t> (lambda $1:e (and:<t*,t> ($0 $1) (named:<e,<e,t>> $1 springfield:e))))\");\n\t\tfinal LogicalExpression expected = TestServices\n\t\t\t\t.getCategoryServices()\n\t\t\t\t.readSemantics(\n\t\t\t\t\t\t\"(lambda $0:e (and:<t*,t> (next_to:<e,<e,t>> $0 colorado:e) (next_to:<e,<e,t>> $0 nm:e) (named:<e,<e,t>> $0 springfield:e)))\");\n\t\tfinal LogicalExpression actual = services.applyCoordination(func, conj);\n\t\tAssert.assertEquals(expected, actual);\n\t}",
"public static BinaryExpression power(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"public static double[][] function(double[] x, double[]y)\r\n\t{\r\n\t\tdouble[][] z = new double[y.length][x.length];\r\n\t\tfor (int i = 0; i < x.length; i++)\r\n\t\t\tfor (int j = 0; j < y.length; j++)\r\n\t\t\t{\r\n\t\t\t\t// EVALUATE THE FUNCTION\r\n\t\t\t\tz[j][i] = function(x[i], y[j]);\r\n\t\t\t\t\r\n\t\t\t\t// MAKE THE FIRST VALUE OF THE TABLE TO BE THE HIGHEST & LOWEST\r\n\t\t\t\tif (j == 0 && i == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\thighest[0] = x[0];\r\n\t\t\t\t\thighest[1] = y[0];\r\n\t\t\t\t\thighest[2] = z[j][i];\r\n\t\t\t\t\tlowest[0] = x[0];\r\n\t\t\t\t\tlowest[1] = y[0];\r\n\t\t\t\t\tlowest[2] = z[j][i];\r\n\t\t\t\t}\r\n\t\t\t\t// THERE IS A NEW HIGHEST\r\n\t\t\t\tif (z[j][i] > highest[2])\r\n\t\t\t\t{\r\n\t\t\t\t\t// MAKE THE SECOND HIGHEST TAKE THE VALUES OF THE OLD HIGHEST\r\n\t\t\t\t\tsecondHighest[0] = highest[0];\r\n\t\t\t\t\tsecondHighest[1] = highest[1];\r\n\t\t\t\t\tsecondHighest[2] = highest[2];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// MAKE THE HIGHEST TAKE THE VALUES OF THE NEW HIGHEST\r\n\t\t\t\t\thighest[0] = x[i];\r\n\t\t\t\t\thighest[1] = y[j];\r\n\t\t\t\t\thighest[2] = z[j][i];\r\n\t\t\t\t}\r\n\t\t\t\t// THERE IS A NEW LOWEST\r\n\t\t\t\tif (z[j][i] < lowest[2])\r\n\t\t\t\t{\r\n\t\t\t\t\tsecondLowest[0] = lowest[0];\r\n\t\t\t\t\tsecondLowest[1] = lowest[1];\r\n\t\t\t\t\tsecondLowest[2] = lowest[2];\r\n\t\t\t\t\t\r\n\t\t\t\t\tlowest[0] = x[i];\r\n\t\t\t\t\tlowest[1] = y[j];\r\n\t\t\t\t\tlowest[2] = z[j][i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\treturn z;\r\n\t}",
"default Function1<U, K> bind1(T newFirstArgument) {\n return u -> Function2.this.apply(newFirstArgument, u);\n }",
"public interface JacobiFunction {\n\n double[][] f(double[] x, double[] params);\n}",
"public Object lambda4(Object a, Object b) {\n Object[] objArr = new Object[2];\n objArr[0] = C1259lists.cons(C1259lists.car.apply1(this.elt), a);\n Object[] objArr2 = objArr;\n objArr2[1] = C1259lists.cons(C1259lists.cadr.apply1(this.elt), b);\n return misc.values(objArr2);\n }",
"public static BinaryExpression powerAssign(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static void twoSum(Node x, Node y) {\n int lenX = x.getlength();\n int lenY = y.getlength();\n int lenLong = Math.max(lenX, lenY);\n Node result = new Node();\n int carryOn = 0;\n\n for (int i = 0; i < lenLong; i++) {\n int curposX = lenX - i - 1;\n int curposY = lenY - i - 1;\n int digitX = 0;\n int digitY = 0;\n if (curposX < 0) {\n digitX = 0;\n } else {\n digitX = x.get(curposX);\n }\n if (curposY < 0) {\n digitY = 0;\n } else {\n digitY = y.get(curposY);\n }\n // System.out.printf(\"x: %d y: %d \\n\", digitX, digitY);\n result = result.add(digitX + digitY, 0);\n\n }\n // result.printList();\n result = twoSumRegulate(result);\n System.out.println(\"the two sum result is:\");\n result.printList();\n }",
"public static double linearInterpolation(double x, double x1, double x2, double y1, double y2)\n\t{\n\t\tif(x2 == x1) throw new IllegalArgumentException(\"The two points may not have the same x-coordinate.\");\n\t\tdouble slope = slope(x1, x2, y1, y2);\n\t\treturn linearInterpolation(x, x1, y1, slope);\n\t}",
"public static int method(int x, int y){\n\n\t\tx = x + 2;\n\t\t//at this point, x is now equal to 12. (x = 10 + 2)\n\n\t\ty = x + 5;\n\t\t/*\n\t\t\tat this point, y is now equal to 17 (y = 12 + 5)\n\t\t\tremember, we just set x to 12 in the line before.\n\t\t*/\n\n\t\t//return 12 + 17\n\t\treturn x + y;\n\t\t//return 29\n\t}",
"public static BinaryExpression add(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static void main(String[] args) {\n\t\t\n\t\tFunction<Integer, Double> half = a -> a / 2.0;\n\t\t\n\t\tSystem.out.println(half.apply(10));\n\t\t\n\t\t\n\t\t//example of andThen()\n\t\t\n\t\thalf = half.andThen(a -> 3 * a);\n\t\t\n\t\tSystem.out.println(half.apply(10));\n\t\t\n\t\t//example of compose()\n\t\t//This returns a composed function wherein the parameterized function\n\t\t//will be executed first and the nthe first one. If evaluation of either\n\t\t//function throws an error, it is relayed to the caller of the composed function\n\t\t\n\t\t\n\t}"
] | [
"0.6207992",
"0.6023601",
"0.60223436",
"0.5787052",
"0.5694682",
"0.56851333",
"0.56843",
"0.56801295",
"0.56554675",
"0.5587979",
"0.5578863",
"0.5518717",
"0.5511377",
"0.5486699",
"0.54629636",
"0.5455598",
"0.54470164",
"0.5445293",
"0.53907454",
"0.5357451",
"0.53398716",
"0.532381",
"0.5284727",
"0.52555007",
"0.52461225",
"0.5237068",
"0.5231637",
"0.5231035",
"0.52308947",
"0.52226",
"0.5222113",
"0.52185905",
"0.5203838",
"0.51986223",
"0.5185398",
"0.5175482",
"0.51582146",
"0.51489556",
"0.51488",
"0.5138612",
"0.51289207",
"0.5126753",
"0.51216245",
"0.51136345",
"0.51123923",
"0.510152",
"0.50898004",
"0.5086932",
"0.50516",
"0.50411105",
"0.5022965",
"0.5013536",
"0.50124043",
"0.50114167",
"0.50062627",
"0.49945283",
"0.49932292",
"0.4986919",
"0.49838942",
"0.49838883",
"0.4976689",
"0.49761355",
"0.49723423",
"0.49684894",
"0.49678582",
"0.4961264",
"0.49600312",
"0.49512196",
"0.49314827",
"0.49116433",
"0.48950753",
"0.48858315",
"0.48772722",
"0.4870911",
"0.4867769",
"0.486587",
"0.48574394",
"0.48417675",
"0.48314497",
"0.48290724",
"0.48272198",
"0.48271015",
"0.4825536",
"0.48114103",
"0.48111656",
"0.4810766",
"0.48086128",
"0.48065737",
"0.47927102",
"0.47906166",
"0.47733054",
"0.47685257",
"0.4754785",
"0.47486478",
"0.47415614",
"0.4728419",
"0.4723468",
"0.4718027",
"0.4716752",
"0.47036588"
] | 0.5571002 | 11 |
Compiles an instance of the given interface that computes the given function. | public static Object compileCustomFunction(Class iface, String expression, String... params) {
// check for obviously invalid expressions
if (expression == null || expression.length() == 0)
return null;
// class must be an interface
if (!iface.isInterface())
return null;
String signature;
try {
Method[] methods = iface.getMethods();
// must be a functional interface
if (methods.length != 1)
return null;
Method method = methods[0];
Class<?> returnType = method.getReturnType();
Class<?>[] paramTypes = method.getParameterTypes();
// method must return a value
if (returnType == Void.class)
return null;
String paramString = "";
// add parameter types and names to the parameter list
for (int i=0; i < params.length; i++) {
if (i > 0)
paramString += ", ";
paramString += paramTypes[i].getCanonicalName() + " " + params[i];
}
// build the method signature
signature = returnType.getCanonicalName() + " " +
method.getName() + "(" +
paramString + ")";
} catch (SecurityException e) {
e.printStackTrace();
return null;
}
return createNewInstance(iface.getCanonicalName(),
signature,
expression);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface IntFunc {\n int apply(int input);\n}",
"public interface IOptimizableFuncExpr {\n public AbstractFunctionCallExpression getFuncExpr();\n\n public int getNumLogicalVars();\n\n public int getNumConstantVals();\n\n public LogicalVariable getLogicalVar(int index);\n\n public void setLogicalExpr(int index, ILogicalExpression logExpr);\n\n public ILogicalExpression getLogicalExpr(int index);\n\n public void setFieldName(int index, List<String> fieldName);\n\n public List<String> getFieldName(int index);\n\n public void setFieldType(int index, IAType fieldName);\n\n public IAType getFieldType(int index);\n\n public void setOptimizableSubTree(int index, OptimizableOperatorSubTree subTree);\n\n public OptimizableOperatorSubTree getOperatorSubTree(int index);\n\n public IAlgebricksConstantValue getConstantVal(int index);\n\n public int findLogicalVar(LogicalVariable var);\n\n public int findFieldName(List<String> fieldName);\n\n public void substituteVar(LogicalVariable original, LogicalVariable substitution);\n\n public void setPartialField(boolean partialField);\n\n public boolean containsPartialField();\n\n public void setSourceVar(int index, LogicalVariable var);\n\n public LogicalVariable getSourceVar(int index);\n}",
"public interface Function {\n double f(double x);\n}",
"public interface Function {\n double f(double x);\n}",
"public abstract void compile();",
"public interface TransformFunc<FROM, TO>\r\n{\r\n TO transform(FROM source);\r\n}",
"public static <T> File generateEvalClass(String name, String code, Class<T> functionalInterface,\n String[] paramNames, String[] imports, Class<?>[] parametrizationClasses)\n throws StructuralIntercessionException {\n Method m = MemberFinder.getMethod(functionalInterface);\n boolean[] genericMap = genericMap(m);\n CompilationUnit cu = new CompilationUnit();\n cu.setPackage(getEvalPackage());\n if (imports != null) {\n List<ImportDeclaration> importList = new ArrayList<ImportDeclaration>();\n for (String imp : imports) {\n ImportDeclaration id = new ImportDeclaration();\n id.setName(new NameExpr(imp));\n importList.add(id);\n }\n cu.setImports(importList);\n }\n ClassOrInterfaceDeclaration type = getType(name, cu);\n\n List<ClassOrInterfaceType> interfaces = getGenericInterface(parametrizationClasses, functionalInterface);\n type.setImplements(interfaces);\n\n String evalName = m.getName();\n\n java.lang.reflect.Type[] paramClasses = MemberFinder.resolveGenericParameters(m, parametrizationClasses);\n java.lang.reflect.Type returnClass = MemberFinder.resolveGenericReturn(m, parametrizationClasses);\n Class<?>[] exceptions = m.getExceptionTypes();\n\n code = checkCode(code, returnClass.getTypeName());\n\n MethodDeclaration method = getEvalMethod(code, paramNames, paramClasses, returnClass, evalName, genericMap,\n exceptions);\n ASTHelper.addMember(type, method);\n return createFile(GENERATED_EVAL_PACKAGE + \".\" + name, cu.toString());\n }",
"@FunctionalInterface\npublic interface MyFunc {\n\n public String getValue(String str);\n}",
"public interface IExpressionRuntime\n{\n Object evaluate();\n}",
"public interface Calculator {\n public int exec(int a, int b);\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 interface Function<IN, OUT> {\n\n /**\n * Compute the result of applying the function to the input argument\n *\n * @param in the input object\n * @return the function result\n */\n OUT apply( IN in );\n\n}",
"public interface JavaCode {\n\n /**\n * Get an unique identification code for an object\n * TODO: This method is not reliable as hash codes are not unique, should use an UUID generator singleton instead.\n *\n * @param obj the object\n * @return the unique identification code\n */\n static int getUniqueID(Object obj) {\n return obj.hashCode();\n }\n\n /**\n * Compiles this code. If an object implements both {@link JavaCode}\n * and {@link JavaExpression}, only one of this method and\n * {@link JavaExpression#compileExpression(Subroutine, JavaScope)} should be called.\n *\n * @param subroutine the subroutine which this code belongs to\n * @param parent the parent scope of this code\n * @throws JTAException if an error occurs\n */\n void compileCode(Subroutine subroutine, JavaScope parent) throws JTAException;\n}",
"@FunctionalInterface\ninterface Payment{\n\tvoid pay(int amount);\n}",
"public interface MyFunc {\n int func(int n);\n}",
"public interface ICalculator {\n\n int calculate(String exp);\n\n}",
"private interface IPsi {\n public double f(int n);\n }",
"public interface UniMathOp {\n public double run(double a);\n}",
"public interface C12049l<T> extends Callable<T> {\n T call();\n}",
"public interface Calculate {\n int add(int a, int b);\n}",
"public interface IFaci {\n}",
"public interface ICalculation {\n int add(int a,int b);\n int sub(int a,int b);\n int mul(int a,int b);\n int div(int a,int b);\n}",
"public interface Func<T, R> {\n R call(T t);\n}",
"public interface IAlgorithm {\n void go();\n}",
"public interface FitnessCalc1 {\n public double utilityFunction(Individual X);\n public double function(double x, Individual X);\n}",
"<C> IfExp<C> createIfExp();",
"public interface FunctionEvaluator {\n\t/*\n\t * Evaluate the given function if possible. Otherwise should return null.\n\t */\n\tpublic MathObject evaluate(Function input);\n}",
"public void implementFunctionalInterface1() {\n\t\tSystem.out.println(\"\\n\\n************Implement Functional Interfaces - 1**********\");\n\t\tMyFunctionalInterface lambda = () -> System.out.println(\"Executing...\");\n\t\tlambda.execute();\n\t}",
"@FunctionalInterface\npublic interface FoldImplementation {\n void main(String[] args);\n}",
"public interface Operation {\n\tdouble evaluate(double x, double y);\n}",
"public MathObject evaluate(Function input);",
"public interface CalculatorFunction {\r\n CalculatorNode calculate(CalculatorNode[] arguments);\r\n}",
"public interface IFunction {\r\n void setFunctions(String tag);\r\n}",
"public interface Function extends Scriptable, Callable\n{\n /**\n * Call the function.\n *\n * Note that the array of arguments is not guaranteed to have\n * length greater than 0.\n *\n * @param cx the current Context for this thread\n * @param scope the scope to execute the function relative to. This is\n * set to the value returned by getParentScope() except\n * when the function is called from a closure.\n * @param thisObj the JavaScript <code>this</code> object\n * @param args the array of arguments\n * @return the result of the call\n */\n public Object call(Context cx, Scriptable scope, Scriptable thisObj,\n Object[] args);\n\n /**\n * Call the function as a constructor.\n *\n * This method is invoked by the runtime in order to satisfy a use\n * of the JavaScript <code>new</code> operator. This method is\n * expected to create a new object and return it.\n *\n * @param cx the current Context for this thread\n * @param scope an enclosing scope of the caller except\n * when the function is called from a closure.\n * @param args the array of arguments\n * @return the allocated object\n */\n public Scriptable construct(Context cx, Scriptable scope, Object[] args);\n}",
"public interface SummaryFunction<T> {\n\n public T compute(IVariable<T> var);\n}",
"public static <T> File generateEvalClass(String name, String code, Class<T> functionalInterface,\n String[] paramNames, Class<?>[] parametrizationClasses) throws StructuralIntercessionException {\n return generateEvalClass(name, code, functionalInterface, paramNames, null, parametrizationClasses);\n }",
"public void implementFunctionalInterface2() {\n\t\tSystem.out.println(\"\\n\\n************Implement Functional Interfaces - 2**********\");\n\t\t// Functional Interface Implementations:\n\t\tMathOperation addition = (int a, int b) -> a + b;\n\t\t// without type declaration - Type is optional in lambda expression\n\t\tMathOperation subtraction = (a, b) -> a - b;\n\t\t// Curly braces are mandatory when you use the return statement\n\t\tMathOperation multiplication = (int a, int b) -> {\n\t\t\treturn a * b;\n\t\t};\n\t\tMathOperation division = (a, b) -> a / b;\n\n\t\t// Method Calls:\n\t\tSystem.out.println(\"10 + 5 = \" + addition.operation(10, 5));\n\t\tSystem.out.println(\"10 - 5 = \" + subtraction.operation(10, 5));\n\t\tSystem.out.println(\"10 x 5 = \" + multiplication.operation(10, 5));\n\t\tSystem.out.println(\"10 / 5 = \" + division.operation(10, 5));\n\t}",
"public T execute() {\n return GraalCompiler.compile(this);\n }",
"public static <T extends CompilationResult> T compileGraph(StructuredGraph graph, ResolvedJavaMethod installedCodeOwner, Providers providers, Backend backend,\n PhaseSuite<HighTierContext> graphBuilderSuite, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, Suites suites, LIRSuites lirSuites, T compilationResult,\n CompilationResultBuilderFactory factory) {\n return compile(new Request<>(graph, installedCodeOwner, providers, backend, graphBuilderSuite, optimisticOpts, profilingInfo, suites, lirSuites, compilationResult, factory));\n }",
"I createI();",
"public interface IExecutorBase {\n <T> T call(ICallable<T> callable) throws Exception;\n\n <T1, T2> IMVal2<T1, T2> call(ICallable<T1> callable1, ICallable<T2> callable2) throws Exception;\n\n <T1, T2, T3> IMVal3<T1, T2, T3> call(ICallable<T1> callable1, ICallable<T2> callable2, ICallable<T3> callable3) throws Exception;\n}",
"private static Object createNewInstance(String implement, String header, String expression) {\n\n\t\t// a feeble attempt at preventing arbitrary code execution\n\t\t// by limiting expressions to a single statement.\n\t\t// Otherwise the expression can be something like:\n\t\t// \tf(); } Object f() { System.exit(0); return null\n\t\tif (expression.contains(\";\"))\n\t\t\treturn null;\n\n\t\t// since we might create multiple expressions, we need their names to be unique\n\t\tString className = \"MyExpression\" + classNum++;\n\n\t\t// if we compile the class susseccfully, try and instantiate it\n\t\tif (writeAndCompile(className, implement, header, expression)) {\n\t\t\ttry {\n\t\t\t\tFile classFile = new File(path + className + \".class\");\n\t\t\t\t// load the class into the JVM, and try and get an instance of it\n\t\t\t\t//Class<?> newClass = ClassLoader.getSystemClassLoader().loadClass(className);\n\n\t\t\t\tURLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { classFile.toURI().toURL() });\n\t\t\t\tClass<?> newClass = Class.forName(className, true, classLoader);\n\n\t\t\t\t// delete the class file, so we leave no trace\n\t\t\t\t// this is okay because we already loaded the class\n\t\t\t\ttry {\n\t\t\t\t\tclassFile.delete();\n\n\t\t\t\t// meh, we tried\n\t\t\t\t} catch (Exception e) {}\n\n\t\t\t\treturn newClass.newInstance();\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\t//System.out.println(\"Couldn't load class\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Couldn't write / compile source\");\n\t\t}\n\n\t\t// the class didn't compile\n\t\treturn null;\n\t}",
"public <T> T asInterface(Class<T> interf) {\n\t return interf.cast(Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class<?> [] { interf }, new RascalFunctionInvocationHandler(this, interf)));\n\t}",
"@FunctionalInterface\npublic interface Line {\n\n int line(int m, int x, int c);\n\n default void eq() {\n\n }\n}",
"public interface Function {\n /**\n * Get the name of this function.\n *\n * @return The name of the function.\n */\n String getName();\n\n /**\n * Execute this function.\n */\n void execute();\n}",
"@FunctionalInterface\r\npublic interface Command {\r\n\tpublic void execute();\r\n}",
"public interface IFactory {\n Operation CreateOperation();\n\n}",
"<C, O> OperationCallExp<C, O> createOperationCallExp();",
"public interface ICompilerWorker extends IWorker {\n}",
"OpFunction createOpFunction();",
"public interface Calculator {\n double calculate(double start, double end, double step);\n}",
"public interface IFunction {\n\n @Nonnull\n String name();\n\n String process(@Nonnull final Map<String, String> args, @Nonnull final Context context);\n\n public boolean isApplicable(@Nonnull final String functionName,\n @Nonnull final Set<String> keys,\n @Nonnull final Collection<String> values,\n @Nonnull final String raw);\n}",
"@Override\n\tpublic void compile() {\n\t\t\n\t}",
"@FunctionalInterface\npublic interface BytecodeConsumer {\n\n\t/** Performs this operation on the given argument.\n\t * @param opcode the opcode of the instruction at the specified location\n\t * @param code the array of code instructions\n\t * @param location the location in the array at which the current instruction is location\n\t */\n\tvoid accept(Opcodes opcode, byte[] code, int location);\n\n}",
"public interface FitClosure {\n public void execute() throws Exception;\n}",
"@FunctionalInterface\ninterface ConverterInterface<F, T> {\n T convert(F from);\n}",
"public interface OperatorInterface {\n public Object call(Engine engine, List<?> args);\n}",
"public abstract Object eval();",
"@Test\n public void multipleClassTest() throws CharSequenceCompilerException, InstantiationException, IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {\n String s = \"public interface MyPredicate { public boolean accept(int i); }\";\n // Implementation for even numbers\n String s2 = \"public class EvenPredicate implements MyPredicate { public boolean accept(int i) { return i%2==0;}}\";\n\n Map<String, CharSequence> classesToCompile = new LinkedHashMap<String, CharSequence>();\n\n // put them in wrong order\n classesToCompile.put(\"EvenPredicate\", s2);\n classesToCompile.put(\"MyPredicate\", s);\n\n // Compile them\n CharSequenceCompiler<Object> compiler = new CharSequenceCompiler<Object>();\n Map<String, Class<Object>> compileClasses = compiler.compile(classesToCompile);\n\n // Invoke accept method\n Class<Object> implementationClass = compileClasses.get(\"EvenPredicate\");\n Object object = implementationClass.newInstance();\n Method method = implementationClass.getMethod(\"accept\", int.class);\n boolean res = (Boolean) method.invoke(object, 2);\n assertTrue(res);\n\n Class<Object> interfaceClass = compileClasses.get(\"MyPredicate\");\n\n try {\n interfaceClass.newInstance();\n fail(\"Can't instantiate an interface!\");\n } catch (InstantiationException e) {\n\n }\n }",
"interface MyFunctionalInterface {\n\tpublic void execute();\n\n\tpublic default void print(String text) {\n\t\tSystem.out.println(text);\n\t}\n\n\tpublic static void print(String text, PrintWriter writer) throws IOException {\n\t\twriter.write(text);\n\t}\n}",
"public interface IFunctionService extends IBaseService<Function, Long> {\r\n\r\n\r\n}",
"public interface JacobiFunction {\n\n double[][] f(double[] x, double[] params);\n}",
"public interface IMul {\n Var mul(Var var);\n\n}",
"public interface BinaryFunction<T1, T2, R> {\n\n\t/**\n\t * Invoke the function.\n\t * @param arg1 The first argument.\n\t * @param arg2 The second argument.\n\t * @return The result of the function.\n\t */\n\tpublic R invoke(T1 arg1, T2 arg2);\n\t\n}",
"public interface GameMovesLogic extends Function<InputState, Output>, CustomizedValidators<InputState> {\r\n\r\n}",
"@FunctionalInterface\n\tpublic interface Expression<V> {\n\t\tV getExpressionResult(Program p);\n\t}",
"public interface ObjectiveFunctionI {\n public void setData(chromosome chromosome1, int indexOfObjective);\n public void setOriginalSolution(chromosome originalChromosome);\n\n public void setFirstImplement(boolean firstImplement);\n public void calcObjective();\n public chromosome getchromosome();\n //public double[] getObjectiveValues(int index);\n //public double getMinObjectiveValue();\n //public double getMaxObjectiveValue();\n}",
"public interface Executable {\n\tvoid execute();\n}",
"@FunctionalInterface\npublic interface QuadFunction<P1, P2, P3, P4, R> extends MethodFinder {\n\n R apply(P1 p1, P2 p2, P3 p3, P4 p4);\n\n}",
"@Override\n\tpublic Type generateIntermediateCode(Function fun) {\n\t\tErrorList err = ErrorList.getInstance();\n\t\tFunctionDeclaration funDec = null;\n\t\tif(Semantic.globalFuntionTable.containsKey(id))\n\t\t\tfunDec = Semantic.globalFuntionTable.get(id);\n\t\telse \n\t\t\terr.addException(new SemanticException(id, super.getLine(), 8));\n\t\t\n\t\tfor(int i = argsList.size() - 1; i >= 0; i--){\n\t\t\tOperation op = new Operation(OperandType.PUSH, fun.getCurrBlock());\n\t\t\tType paramType = argsList.get(i).generateIntermediateCode(fun);\n\t\t\tif(funDec != null){\n\t\t\t\tif(funDec.getParameters().get(i) == null || funDec.getParameters().get(i).getType() != paramType ||\n\t\t\t\t\t\t(fun.getSymbolTable().get(id) != null && (funDec.getParameters().get(i).isArray() != \n\t\t\t\t\t\tfun.getSymbolTable().get(id).isArray()))){\n\t\t\t\t\terr.addException(new SemanticException(id, super.getLine(), 11));\n\t\t\t\t}\n\t\t\t}\n\t\t\tOperand oper = null;\n\t\t\tif(argsList.get(i) instanceof LiteralExpression){\n\t\t\t\tObject num = ((LiteralExpression)argsList.get(i)).getNumber();\n\t\t\t\tif(num.getClass() == Integer.class)\n\t\t\t\t\toper = new Operand(OperandType.INT, (int)num);\n\t\t\t\telse\n\t\t\t\t\toper = new Operand(OperandType.FLOAT, (double)num);\n\t\t\t}\n\t\t\telse \n\t\t\t\toper = new Operand(OperandType.REG, argsList.get(i).getRegNum());\n\t\t\top.setSrcOperand(0, oper);\n\t\t\tfun.getCurrBlock().appendOperation(op);\n\t\t}\n\t\tOperation op = new Operation(OperandType.CALL, fun.getCurrBlock());\n\t\t//Attribute\n\t\tOperand oper = new Operand(OperandType.FUNC_NAME, getId());\n\t\top.setSrcOperand(0, oper);\n\t\tfun.getCurrBlock().appendOperation(op);\n\t\t\n\t\top = new Operation(OperandType.MOV, fun.getCurrBlock());\n\t\toper = new Operand(OperandType.RET, \"ret\");\n\t\top.setSrcOperand(0, oper);\n\t\t\n\t\tsuper.setRegNum(fun.getNewRegisterNum());\n\t\toper = new Operand(OperandType.REG, super.getRegNum());\n\t\top.setDestOperand(0, oper);\n\t\tfun.getCurrBlock().appendOperation(op);\n\t\tif(funDec != null)\n\t\t\treturn funDec.getType();\n\t\telse\n\t\t\treturn Type.NULL;\n\t}",
"public static void main(String[] args) {\n Foo fooByIC= new Foo() {\n @Override\n public void method(String string) {\n System.out.println(string);\n }\n };\n Foo fooByIc2=new Foo() {\n @Override\n public void method(String string) {\n System.out.println(string+\" \"+string);\n }\n };\n fooByIC.method(\"test\");\n fooByIc2.method(\"test\");\n\n //TODO call testFunctional with fooByIC\n testFunctional(\"test2\",fooByIc2);\n //TODO call testFunctional with a lambda\n testFunctional(\"test3\",s-> System.out.println(s.toUpperCase()+\"lambda\"));\n //TODO call testFunctional with a different lambda\n testFunctional(\"4\",s-> {\n try {\n\n\n Integer number = Integer.parseInt(s);\n System.out.println(number*number);\n }\n catch (NumberFormatException ex)\n {\n System.out.println(\"Not a number\");\n }\n\n });\n testFunctional(2,3,(a,b)->a+b);\n\n\n }",
"interface ccf {\n void a();\n}",
"public interface Calculator {\n\n int add(int i, int j);\n\n\n int subtract(int i, int j);\n}",
"public interface FunctionTest {\n public void testReport(int succCount, int actualSize);\n}",
"public interface Executable extends ParameterizedBehavior, Exceptionable {\n\n /**\n * @return This member usable as a function with semantics and result depending on this instance, and the used arguments\n */\n PolymorphicInvokable asLambda();\n\n /**\n * Returns the parameters needed by this instance to be invoked.<br>\n * Depending on the instance definition this may be 0, 1, or N parameters\n *\n * @return The set of parameters (in the needed order)\n */\n Nary<ExecutableParameter> parameters();\n\n /**\n * @return The instance that represents the return type of this executable.<br>\n */\n TypeInstance returnType();\n\n}",
"public interface Operation {\n int operate(int args1, int args2);\n}",
"@FunctionalInterface\npublic interface FuncInterface {\n\n BigDecimal bal = BigDecimal.ZERO;\n\n void add(BigDecimal balance);\n\n default BigDecimal getBalance(){\n return bal;\n }\n\n static BigDecimal sum(BigDecimal num){\n return bal.add(num);\n }\n\n}",
"public static void main(String[] args) {\n\n CompareInterface compareInterface = (i1,i2)->{\n if(i1>i2)\n return true;\n else\n return false;\n\n };\n System.out.println(compareInterface.iCompare(10,20));\n\n//(2) Increment the number by 1 and return incremented value Parameter (int) Return int\n IncrementInterface incrementInterface =(i1)->{\n return i1+=1;\n };\n System.out.println(\"Incremented Value : \"+incrementInterface.increament( 10));\n\n//(3) Concatination of 2 string Parameter (String , String ) Return (String)\n ConcatInterface concatInterface = (String::concat);\n System.out.println(\"Concatinated String : \"+ concatInterface.concat(\"Helo \", \"World\"));\n\n//(4) Convert a string to uppercase and return . Parameter (String) Return (String)\n ToUpperCaseInterface toUpperCaseInterface = (String::toUpperCase);\n System.out.println(toUpperCaseInterface.toUpperCase(\"aakash sinha\"));\n }",
"@FunctionalInterface\n public interface Function<T>\n {\n /**\n * Return calculated memoizable value.\n *\n * @param args the functions arguments.\n * @return the value generated by function.\n */\n T call( @Nonnull final Object... args );\n }",
"public interface Function1<A,B> {\n\tB apply(A a);\n}",
"public interface IFunctions {\n\t/**\n\t * Interprets the function.\n\t * @param commandDict: command dictionary for current workspace.\n\t * @param varDict: variable dictionary for current workspace.\n\t * @return value that the function evaluates to.\n\t * @throws ClassNotFoundException\n\t */\n\tdouble interpret(CommandDictionary commandDict, VariableDictionary varDict) throws ClassNotFoundException;\n\n\t/**\n\t * Gets the children of the function.\n\t * @return list of children.\n\t */\n\tList<IFunctions> getChildren();\n\n\t/**\n\t * Returns a string representation of the function.\n\t * @return string representation of the function.\n\t */\n\tString toString();\n}",
"public interface Function2<X1,X2,Y> {\n\tY apply(X1 x1, X2 x2);\n}",
"public abstract void compute();",
"public SQLFederationExecutionPlan compile(final ExecutionPlanCacheKey cacheKey, final boolean useCache) {\n return sqlStatementCompilerEngine.compile(cacheKey, useCache);\n }",
"public interface ComputeService {\n\n\n Integer add(int a, int b);\n}",
"public interface ViewCompiler {\n\n /**\n * Compiles source code into a MapDelegate.\n *\n * @param source The source code to compile into a Mapper.\n * @param language The language of the source.\n * @return A compiled Mapper.\n */\n @InterfaceAudience.Public\n Mapper compileMap(String source, String language);\n\n /**\n * Compiles source code into a ReduceDelegate.\n *\n * @param source The source code to compile into a Reducer.\n * @param language The language of the source.\n * @return A compiled Reducer\n */\n @InterfaceAudience.Public\n Reducer compileReduce(String source, String language);\n\n}",
"@FunctionalInterface\npublic interface ITierConverter<TIER> {\n TIER convert(Block block, int meta);\n}",
"public interface IInvocation {\n void invoke();\n}",
"public abstract int compute(int i1, int i2);",
"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}",
"public Biseccion(InterfaceB funcion) { // En el constructor de la clase se recibe un parametro de tipo interface (InterfaseB)\n f = funcion; // al atributo f se le pasa el parametro que se esta recibiendo (funcion);\n \n }",
"<C, PM> IterateExp<C, PM> createIterateExp();",
"public interface ICalculator {\n String add(String num1, String num2);\n}",
"public interface IntegralFunction{\n \tdouble function(double x);\n}",
"public interface IEval {\n String Evaluate(Integer otherChoice);\n\n\n}",
"public static void main(String[] args) {\n Interface i = () -> System.out.println(\"om sai ram ji\");\n i.m1();\n /*using Annonymous inner class*/\n// Interface i4= new Test(){\n// System.out.print(\"Annoymous inner class invoked\");\n// };\n\n\n /*using Method Reference for refering static method*/\n Interface i1 = Test::m3;\n i1.m1();\n\n /*using Method Reference for refering non static method*/\n Test t = new Test();\n Interface i2 = t::m2;\n i2.m1();\n\n }",
"private Expression transform(Expression exp)\n {\n return UseContracts.execute(exp, fun, callers);\n }",
"@FunctionalInterface\npublic interface PlayerMageArenaCreatureFactory {\n /**\n * Create the player mage arena creature.\n * @param player player\n * @return ArenaCreature\n */\n ArenaCreature createPlayerMageArenaCreature(Player player);\n}",
"public void generateByteCode(Optimizer opt) {}",
"@FunctionalInterface\n public interface PReturn {\n\n //functional interfaces: one abstract method, as many instance or static methods as you'd like.\n public int returnInt(int x);\n //public abstract int returnInt2(String x);\n\n //new to java 8: default methods (cannot be used with @FunctionalInterfaces\n //public default int returnInt(int x) { return x; }\n\n //new to java 8: static methods now in interfaces\n public static boolean isIReturn(Object obj) { return obj instanceof IReturn; }\n}"
] | [
"0.6037759",
"0.5822947",
"0.5803906",
"0.5803906",
"0.5801747",
"0.57703066",
"0.5699306",
"0.56746185",
"0.56135553",
"0.5560351",
"0.5557812",
"0.55488265",
"0.55030143",
"0.54897267",
"0.5489676",
"0.5460214",
"0.5438591",
"0.53876776",
"0.53796643",
"0.5368392",
"0.53601074",
"0.53576034",
"0.53335196",
"0.53290594",
"0.53284633",
"0.5314215",
"0.5271368",
"0.5269019",
"0.5261215",
"0.52576953",
"0.52320546",
"0.5223298",
"0.5222106",
"0.52004117",
"0.51905155",
"0.5187418",
"0.51764554",
"0.5151865",
"0.51509994",
"0.5120475",
"0.51132417",
"0.51121503",
"0.51055384",
"0.5099333",
"0.50961095",
"0.5094438",
"0.5090246",
"0.5076858",
"0.5070742",
"0.5059108",
"0.5053916",
"0.5047605",
"0.5026932",
"0.50267875",
"0.50205386",
"0.501959",
"0.50060594",
"0.50008404",
"0.49941316",
"0.4992666",
"0.49918148",
"0.4989557",
"0.4985148",
"0.49840662",
"0.49763724",
"0.4975206",
"0.4962307",
"0.49521378",
"0.49294904",
"0.4921934",
"0.49175957",
"0.49165487",
"0.49151468",
"0.49149367",
"0.4912229",
"0.49115434",
"0.49033254",
"0.490216",
"0.49009842",
"0.48902634",
"0.4883195",
"0.48826048",
"0.4881718",
"0.48779556",
"0.48763672",
"0.48705745",
"0.48590747",
"0.4856563",
"0.48563805",
"0.48525152",
"0.4843743",
"0.48370373",
"0.48347893",
"0.48345712",
"0.4831808",
"0.48273352",
"0.48215887",
"0.48183078",
"0.48090848",
"0.4807633"
] | 0.6592835 | 0 |
Writes the .java file, compiles it to a class, and returns true if everything was successful. | private static boolean writeAndCompile(String className, String implement, String header, String expression) {
// build the class
String classData = String.format(classBase, className, implement, header, expression);
String classFileName = className + ".java";
// write the .java file
try (PrintWriter out = new PrintWriter(path + classFileName)) {
out.println(classData);
} catch (FileNotFoundException e) {
e.printStackTrace();
return false;
}
// compile the file
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
int result;
if (compiler == null) {
System.out.println("No Compiler! Trying external tools..");
try {
com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();
result = javac.compile(new String[] {path + classFileName});
} catch (NoClassDefFoundError e) {
System.out.println("No external tools found!");
return false;
}
//return false;
} else
result = compiler.run(null, null, null, path + classFileName);
// delete the .java file, just because
try {
new File(path + classFileName).delete();
// meh, we tried
} catch (Exception e) {}
// if result is 0, compilation was successful
return result == 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void compileToJava();",
"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 }",
"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 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 }",
"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 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 }",
"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 }",
"private void ensureCorrectJavaFormat(File javaFile) throws FileNotFoundException, IOException\n\t{\n\t\tFile temp = new File(\"action.temp\");\n\t\tPrintWriter printer = new PrintWriter(new BufferedWriter(new FileWriter(temp)));\n\t\tString fileName = javaFile.getName();\n\t\tString directoryName = javaFile.getParentFile().getName();\n\t\ttry(BufferedReader buffyTheFileSlayer = new BufferedReader(new FileReader(javaFile)))\n\t\t{\n\t\t\tboolean foundPackage = false;\n\t\t\tboolean foundClass = false;\n\t\t\tString line;\n\t\t\twhile((line = buffyTheFileSlayer.readLine()) != null)\n\t\t\t{\n\t\t\t\tif(!foundPackage && line.matches(\"package .+\"))\n\t\t\t\t{\n\t\t\t\t\tfoundPackage = true;\n\t\t\t\t\tif(!line.matches(\".*\" + directoryName + \".*\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = \"package \" + directoryName + \";\";\n\t\t\t\t\t}\n\t\t\t\t} else if(!foundClass && line.matches(\"public class .+ implements ActionNode\"))\n\t\t\t\t{\n\t\t\t\t\tfoundClass = true;\n\t\t\t\t\tif(!line.matches(\".*\" + fileName + \".*\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = \"public class \" + fileName + \" extends ActionNode\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprinter.println(line);\n\t\t\t}\n\t\t\tprinter.close();\n\t\t\tjavaFile.delete();\n\t\t\ttemp.renameTo(javaFile);\n\t\t}\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 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}",
"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 boolean openAndCompile(final File file)\n {\n if(!this.openFile(file))\n {\n return false;\n }\n\n return this.compile();\n }",
"protected Object compileAndLoad() throws IOException {\n String generatedSource = printJCodeModel();\n return compileAndLoadSource(generatedSource, TEST_CLASS_NAME);\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 }",
"@Override\r\n public boolean close() {\r\n\r\n if (clearOutputFolder) {\r\n if (!args.hasValue(LaraiKeys.OUTPUT_FOLDER)) {\r\n KadabraLog.warning(\"No output folder defined, skipping cleaning\");\r\n } else {\r\n try {\r\n FileUtils.cleanDirectory(outputDir);\r\n } catch (final IOException e) {\r\n KadabraLog.warning(\"Output folder could not be cleaned before code generation: \" + e.getMessage());\r\n }\r\n }\r\n\r\n }\r\n\r\n if (args.get(JavaWeaverKeys.WRITE_CODE)) {\r\n if (prettyPrint) {\r\n spoon.prettyprint();\r\n spoon = newSpoon(Arrays.asList(temp), outputDir);\r\n // spoon.getEnvironment().setNoClasspath(true);\r\n // spoon.getEnvironment().setNoClasspath(false);\r\n buildAndProcess();\r\n spoon.prettyprint();\r\n } else {\r\n // System.out.println(\"PRESERVE? \" + spoon.getEnvironment().isPreserveLineNumbers());\r\n spoon.prettyprint();\r\n }\r\n }\r\n\r\n // Write XML files\r\n jApp.getAndroidResources().write(outputDir);\r\n\r\n // writeCode(temp, outputDir, true);\r\n\r\n if (reportGear.isActive()) {\r\n\r\n KadabraLog.info(\"REPORT: \");\r\n KadabraLog.info(\"Advised Join Points: \" + reportGear.getAdvisedJoinPoints().size());\r\n }\r\n return true;\r\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}",
"private static int compile(String filename) throws Exception {\n\t\tInputStream inp = new BufferedInputStream(new FileInputStream(filename));\n\t\tParser parser = new Parser(inp);\n\t\tjava_cup.runtime.Symbol parseTree = null;\n\t\ttry {\n\t\t\tparseTree = parser.parse();\n\t\t} catch (Throwable e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new Error(e.toString());\n\t\t} finally {\n\t\t\tinp.close();\n\t\t}\n\t\t\n\t\tDecls tree = (Decls) parseTree.value;\n\t\t\n\t\tSemantic semant = new Semantic();\n\t\tsemant.checkProg(tree);\n\t\tif (semant.hasError()) {\n\t\t\tsemant.printErrors();\n\t\t\treturn 1;\n\t\t} else {\n\t\t\t//System.out.println(\"Semant: OK\");\n\t\t\tLabel.fcount = 0;\n\t\t\t\n\t\t\tLabel topLabel = new Label(\"main\");\n\t\t\tLevel topLevel = new Level();\n\t\t\tTranslate translate = new Translate();\n\t\t\ttranslate.transProg(tree, topLabel, topLevel);\n\t\t\tList<CompileUnit> units = translate.getUnits();\n\t\t\t\n\t\t\t//=============================== Optimize =================================\n\t\t\tAnalyzer analyzer = new Analyzer();\n\t\t\tLabelEliminator le = new LabelEliminator();\n\t\t\t\n\t\t\tfor (CompileUnit u : units) {\n\t\t\t\t//System.out.println(u.getQuads().get(0));\n\t\t\t\tu.replaceBranches(analyzer);\n\t\t\t\tu.findBasicBlocks(analyzer);\n\t\t\t\tu.findLiveness(analyzer);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tfor (CompileUnit u: units) {\n\t\t\t\tList<Quad> qs = u.getQuads();\n\t\t\t\tfor (Quad q: qs) {\n\t\t\t\t\tif (q instanceof MoveL)\n\t\t\t\t\t\t((MoveL)q).src.used = true;\n\t\t\t\t}\n\t\t\t\tGotoCompression.process(u);\n\t\t\t}\n\t\t\t\n\t\t\tLocalCopyPropagation lcp = new LocalCopyPropagation();\n\t\t\tDeadCodeEliminator dce = new DeadCodeEliminator();\n\t\t\tAvailableExpressionAnalyzer aea = new AvailableExpressionAnalyzer();\n\t\t\tCommonExpressionEliminator cse = new CommonExpressionEliminator();\n\t\t\tfor (CompileUnit u : units) {\n\t\t\t\tList<Quad> oldQuads = new LinkedList<Quad>();\n\t\t\t\t//int cnt = 0;\n\t\t\t\tdo {\n\t\t\t\t\toldQuads.clear();\n\t\t\t\t\toldQuads.addAll(u.getQuads());\n\t\t\t\t\t\n\t\t\t\t\tdo {\n\t\t\t\t\t\tu.findBasicBlocks(analyzer);\n\t\t\t\t\t\taea.analyze(u.getBasicBlocks());\n\t\t\t\t\t\t//System.out.println(++cnt);\n\t\t\t\t\t}\n\t\t\t\t\twhile (cse.eliminate(u));\n\n\t\t\t\t\tfor (BasicBlock bb : u.getBasicBlocks()) {\n\t\t\t\t\t\tlcp.process(bb);\n\t\t\t\t\t}\n\n\t\t\t\t\tu.findLiveness(analyzer);\n\t\t\t\t\tdce.process(u);\n\t\t\t\t\tu.findBasicBlocks(analyzer);\n\t\t\t\t\tu.findLiveness(analyzer);\n\t\t\t\t\twhile (le.eliminate(u));\n\t\t\t\t}\n\t\t\t\twhile (!u.getQuads().equals(oldQuads));\n\t\t\t}\n\t\t\t\n\t\t\t//========================================================================\n\t\t\tCodegen codegen = new Codegen();\n\t\t\tcodegen.gen(new Assem(\".data\"));\n\t\t\tcodegen.gen(new Assem(\".align 2\"));\n\t\t\tcodegen.gen(new Assem(\".globl args\"));\n\t\t\tcodegen.gen(new Assem(\"!args:\\t.space %\", (Translate.maxArgc + 1) * 4));\n\t\t\tcodegen.gen(new Assem(\".align 2\"));\n\t\t\tfor (DataFrag df: translate.getDataFrags())\n\t\t\t\tif (df.label.used)\n\t\t\t\t\tcodegen.gen(df.gen());\n\t\t\t\n\t\t\tcodegen.gen(new Assem(\".text\"));\n\t\t\tcodegen.gen(new Assem(\".align 2\"));\n\t\t\tcodegen.gen(new Assem(\".globl main\"));\n\t\t\t\n\t\t\tfor (CompileUnit u: units)\n\t\t\t\tcodegen.gen(u, new LinearScan(u, analyzer));/**/\n\n\t\t\t//System.out.println((System.nanoTime() - start) / 1000000 + \" ms\");\n\t\t\t//PrintStream out = System.out;\n\t\t\tPrintStream out = new PrintStream(new BufferedOutputStream(new FileOutputStream(\"assem.s\")));\n\t\t\tout.println(\"########################################\");\n\t\t\tout.println(\"############### CODE GEN ###############\");\n\t\t\tout.println(\"########################################\");\n\t\t\tcodegen.flush(out);\n\t\t\tout.println(\"########################################\");\n\t\t\tout.println(\"############# RUNTIME CODE #############\");\n\t\t\tout.println(\"########################################\");\n\t\t\t//Scanner scanner = new Scanner(new FileInputStream(new File(\"runtime.s\")));\n\t\t\t//while (scanner.hasNextLine()) {\n\t\t\t//\tout.println(scanner.nextLine());\n\t\t\t//}\n\t\t\t//scanner.close();\n\t\t\tout.close();\n\t\t\treturn 0;\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 abstract void compile();",
"private static void test1() throws ParseException, IOException {\n\t\n\tFile classFile = new File(\"/home/sebastian/workspace3.7/yuigwt/java-tools/org/sgx/gwtjavatools/delegate/JYUIDelegateMethods.java\");\n\t\n// InputStream in = ParserTest.class.getClassLoader().getResourceAsStream(\"/java-tools/org/sgx/gwtjavatools/delegate/JYUIDelegateMethods.java\");//new FileInputStream(\"test.java\");\n\n\tFileInputStream in = new FileInputStream(classFile); \n\t\n CompilationUnit cu;\n try {\n // parse the file\n cu = JavaParser.parse(in);\n } finally {\n in.close();\n }\n\n // visit and print the methods names\n new MethodVisitor().visit(cu, null);\n\n // prints the resulting compilation unit to default system output\n// System.out.println(cu.toString());\n}",
"public static void write() throws IOException {\n VelocityContext context = new VelocityContext();\n\n //Put the data model in context object\n context.put(\"packageName\", packageName);\n context.put(\"className\", className);\n List<Attribute> attributes = new ArrayList<>();\n attributes.add(new Attribute(\"id\", \"int\"));\n attributes.add(new Attribute(\"firstName\", \"String\"));\n attributes.add(new Attribute(\"lastName\", \"String\"));\n attributes.add(new Attribute(\"dob\", \"LocalDate\"));\n context.put(\"attributes\", attributes);\n\n //Merge the template with context data\n StringWriter stringWriter = new StringWriter();\n Velocity.mergeTemplate(\"class.vm\", context, stringWriter);\n\n //Write to file\n FileWriter fw = null;\n try {\n fw = new FileWriter(\"output/User.java\");\n fw.write(stringWriter.toString());\n } finally {\n if (fw != null) {\n fw.close();\n }\n }\n }",
"public boolean writeDataFile();",
"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 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}",
"private void fileWrite(String outDir, String fileName, boolean isExtern)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// create file\n\t\t\tFile hFile = new File(outDir + fileName + \".h\");\n\t\t\tFile cFile = new File(outDir + fileName + \".c\");\n\t\t\t\n\t\t\t// create new file\n\t\t\thFile.createNewFile();\n\t\t\tcFile.createNewFile();\n\t\t\t\n\t\t\t// create file writer\n\t\t\tFileWriter hFileWriter = new FileWriter(hFile);\n\t\t\tFileWriter cFileWriter = new FileWriter(cFile);\n\n\t\t\tString variable = new String(\"const unsigned char \" + fileName + \"[\" + String.format(\"0x%x\", this.dataContent.length) + \"]\");\n\t\t\t\n\t\t\t// write .h file\n\t\t\thFileWriter.write(\"#ifndef _\" + fileName + \"_\\r\\n\");\n\t\t\thFileWriter.write(\"#define _\" + fileName + \"_\\r\\n\");\n\t\t\tif(isExtern)\n\t\t\t{\n\t\t\t\thFileWriter.write(\"\\r\\n\");\n\t\t\t\thFileWriter.write(\"#ifdef __cplusplus\\r\\n\");\n\t\t\t\thFileWriter.write(\"extern \\\"C\\\" {\\r\\n\");\n\t\t\t\thFileWriter.write(\"#endif\\r\\n\");\n\t\t\t\thFileWriter.write(\"\\r\\n\");\n\t\t\t}\n\t\t\t\n\t\t\thFileWriter.write(\"extern \" + variable + \";\\r\\n\");\n\t\t\t\n\t\t\tif(isExtern)\n\t\t\t{\n\t\t\t\thFileWriter.write(\"\\r\\n\");\n\t\t\t\thFileWriter.write(\"#ifdef __cplusplus\\r\\n\");\n\t\t\t\thFileWriter.write(\"}\\r\\n\");\n\t\t\t\thFileWriter.write(\"#endif\\r\\n\");\n\t\t\t\thFileWriter.write(\"\\r\\n\");\n\t\t\t}\n\t\t\thFileWriter.write(\"#endif\\t// _\" + fileName + \"_\\r\\n\");\n\t\t\thFileWriter.flush();\n\n\t\t\t// write .c file\n\t\t\tcFileWriter.write(variable + \" = {\");\n\t\t\tint counter = 0;\n\t\t\tfor(byte value : this.dataContent)\n\t\t\t{\n\t\t\t\tif(--counter < 0)\n\t\t\t\t{\n\t\t\t\t\tcFileWriter.write(\"\\r\\n\\t\");\n\t\t\t\t\tcounter = 15;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcFileWriter.write(String.format(\"0x%02x,\", value));\n\t\t\t}\n\t\t\tcFileWriter.write(\"\\r\\n};\\r\\n\");\n\t\t\tcFileWriter.flush();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Failed file write : \" + e.getMessage());\n\t\t}\n\t}",
"public boolean compile(String name, String source) {\n\t return compile(source);\n\t}",
"private void generate() throws FileNotFoundException {\n if (clazz.isInterface())\n generateInterface();\n writer.close();\n }",
"private boolean compileFile() {\n \n JFileChooser jfc=new JFileChooser();\n jfc.setCurrentDirectory(new File(\"Users/\"+System.getProperty(\"user.name\")+\"/Desktop\"));\n jfc.setDialogTitle(WED_ZERO.lang.getInstruct().get(1)[35]);\n jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n jfc.setAcceptAllFileFilterUsed(false);\n jfc.setVisible(true);\n if (jfc.showSaveDialog(panel)==JFileChooser.APPROVE_OPTION) {\n try {\n new AlternativeSav(FileManaging.processLoc(jfc.getCurrentDirectory(), jfc.getSelectedFile()), Button);\n return true;\n } catch (IOException ex) {\n ERROR.ERROR_363(Launch.frame);\n return false;\n }\n }\n return false;\n \n }",
"private void createFile(String packageName, String enclosingName, String methodName, String returnType) {\n try {\n JavaFileObject jfo = mFiler.createSourceFile(enclosingName, new Element[]{});\n Writer writer = jfo.openWriter();\n writer.write(brewCode(packageName, enclosingName, methodName, returnType));\n writer.flush();\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"private static void compile(\n File macroFile,\n File destinationDirectory,\n String destinationPackage,\n boolean generateCode,\n Strictness strictness,\n Verbosity verbosity)\n throws ParserException, LexerException {\n\n switch (verbosity) {\n case INFORMATIVE:\n case VERBOSE:\n System.out.println(\"Compiling \\\"\" + macroFile + \"\\\"\");\n break;\n }\n\n Start ast;\n\n try {\n FileReader fr = new FileReader(macroFile);\n BufferedReader br = new BufferedReader(fr);\n PushbackReader pbr = new PushbackReader(br, 1024);\n\n switch (verbosity) {\n case VERBOSE:\n System.out.println(\" Parsing\");\n break;\n }\n\n ast = new Parser(new CustomLexer(pbr)).parse();\n\n pbr.close();\n br.close();\n fr.close();\n }\n catch (IOException e) {\n throw CompilerException.inputError(macroFile.toString(), e);\n }\n\n ObjectMacroFront.globalIndex\n = ObjectMacroFront.verifySemantics(ast, strictness, verbosity);\n\n if (generateCode) {\n ObjectMacroFront.generateIntermediateFile(verbosity,\n destinationDirectory, macroFile);\n }\n\n }",
"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}",
"private boolean buildFile(IFile file) {\n \t\t/* \n \t\t * We want to compile each source file in .gf with these commands:\n \t\t * i --retain HelloEng.gf\n \t\t * ss -strip -save\n \t\t * \n \t\t * Shell command: echo \"ss -strip -save\" | gf -retain HelloEng.gf\n \t\t */\n \t\tString filename = file.getName();\n \t\tString buildDir = getBuildDirectory(file);\n \t\t\n \t\tArrayList<String> command = new ArrayList<String>();\n \t\tcommand.add(gfPath);\n \t\tcommand.add(\"--retain\");\n \t\tif (USE_INDIVIDUAL_FOLDERS) {\n \t\t\tcommand.add(String.format(\"..%1$s..%1$s%2$s\", java.io.File.separator, filename));\n \t\t} else {\n \t\t\tcommand.add(\"..\" + java.io.File.separator + filename);\n \t\t}\n \t\t\n \t\ttry {\n \t\t\t// Check the build directory and try to create it\n \t\t\tFile buildDirFile = new File(buildDir);\n \t\t\tif (!buildDirFile.exists()) {\n \t\t\t\tbuildDirFile.mkdir();\n \t\t\t}\n \t\t\t\n \t\t\t// Piece together our GF process\n \t\t\tProcessBuilder b = new ProcessBuilder(command);\n \t\t\tb.directory(buildDirFile);\n //\t\t\tb.redirectErrorStream(true);\n \t\t\tProcess process = b.start();\n \t\t\t\n \t\t\t// Feed it our commands, then quit\n \t\t\tBufferedWriter processInput = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));\n \t\t\tprocessInput.write(\"ss -strip -save\");\n \t\t\tprocessInput.newLine();\n \t\t\tprocessInput.flush();\n \t\t\tprocessInput.write(\"quit\");\n \t\t\tprocessInput.newLine();\n \t\t\tprocessInput.flush();\n \t\t\t\n //\t\t\tBufferedReader processError = new BufferedReader(new InputStreamReader(process.getErrorStream()));\n //\t\t\tString err_str;\n //\t\t\twhile ((err_str = processError.readLine()) != null) {\n//\t\t\t\tSystem.out.println(err_str);\n //\t\t\t}\n \t\t\tBufferedReader processOutput = new BufferedReader(new InputStreamReader(process.getInputStream()));\n \t\t\tString out_str;\n \t\t\twhile ((out_str = processOutput.readLine()) != null) {\n\t\t\t\tSystem.out.println(out_str);\n \t\t\t}\n \t\t\t\n \t\t\t// Tidy up\n \t\t\tprocessInput.close();\n //\t\t\tprocessOutput.close();\n \t\t\tprocess.waitFor();\n \t\t\treturn true;\n \t\t\t\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t} catch (InterruptedException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\t\n \t\treturn false;\t\t\n \t}",
"private boolean isJavaFile(File file){\n\t\tif(file.isFile())\n\t\t\treturn file.getName().toLowerCase().endsWith(\".java\");\n\t\treturn false;\n\t}",
"private int run(Iterable<String> args) throws IOException {\n Path outputErrors = null;\n boolean expectFailure = false;\n boolean expectWarnings = false;\n boolean exportTestFunctions = false;\n\n // Compiler flags we want to read.\n Path jsOutputFile = null;\n Path createSourceMap = null;\n\n // Parse flags in an ad-hoc manner.\n List<String> passThroughArgs = new ArrayList<>(1024);\n PeekingIterator<String> iargs = Iterators.peekingIterator(args.iterator());\n while (iargs.hasNext()) {\n String arg = iargs.next();\n switch (arg) {\n case \"--output_errors\":\n outputErrors = Paths.get(iargs.next());\n continue;\n case \"--expect_failure\":\n expectFailure = true;\n continue;\n case \"--expect_warnings\":\n expectWarnings = true;\n continue;\n case \"--export_test_functions\":\n exportTestFunctions = true;\n continue;\n case \"--js_output_file\":\n jsOutputFile = Paths.get(iargs.peek());\n break;\n case \"--create_source_map\":\n createSourceMap = Paths.get(iargs.peek());\n break;\n default:\n break;\n }\n passThroughArgs.add(arg);\n }\n\n // Run the compiler, capturing error messages.\n boolean failed = false;\n Compiler compiler = new Compiler();\n LightweightMessageFormatter errorFormatter = new LightweightMessageFormatter(compiler);\n errorFormatter.setColorize(true);\n JsCheckerErrorManager errorManager = new JsCheckerErrorManager(errorFormatter);\n compiler.setErrorManager(errorManager);\n Runner runner = new Runner(passThroughArgs, compiler, exportTestFunctions);\n if (runner.shouldRunCompiler()) {\n failed |= runner.go() != 0;\n }\n failed |= runner.hasErrors();\n\n // Output error messages based on diagnostic settings.\n if (!expectFailure && !expectWarnings) {\n for (String line : errorManager.stderr) {\n System.err.println(line);\n }\n System.err.flush();\n }\n if (outputErrors != null) {\n Files.write(outputErrors, errorManager.stderr, UTF_8);\n }\n if (failed && expectFailure) {\n // If we don't return nonzero, Bazel expects us to create every output file.\n if (jsOutputFile != null) {\n Files.write(jsOutputFile, EMPTY_BYTE_ARRAY);\n }\n if (createSourceMap != null) {\n Files.write(createSourceMap, EMPTY_BYTE_ARRAY);\n }\n }\n if (!failed && expectFailure) {\n System.err.println(\"ERROR: Expected failure but didn't fail.\");\n }\n return failed == expectFailure ? 0 : 1;\n }",
"private static void writeClass( Writer writer, String packageName, PluginDescriptor pluginDescriptor )\n throws IOException\n {\n if ( packageName.length() > 0 )\n {\n writer.write( \"package \" + packageName + \";\" + LS );\n writer.write( LS );\n }\n \n writeImports( writer );\n writer.write( LS );\n \n writeMojoJavadoc( writer, pluginDescriptor );\n \n writer.write( \"public class HelpMojo\" + LS );\n writer.write( \" extends AbstractMojo\" + LS );\n writer.write( \"{\" + LS );\n \n writeVariables( writer );\n \n writer.write( LS );\n \n writeExecute( writer, pluginDescriptor );\n \n writer.write( LS );\n writeUtilities( writer );\n writer.write( \"}\" + LS );\n }",
"@Override\n\tpublic void outAClass(AClass node) {\n\t\tcreateConstructor();\n\t\tString directory = this.fileName.substring(0,\n\t\t\t\tthis.fileName.lastIndexOf(File.separatorChar));\n\t\ttry{\n\t\t\tcg.getJavaClass().dump( directory +\"/\" + node.getType().getText() + \".class\");\n\t\t}catch (IOException e ){\n\t\t\tErrorList.add(node,\"Could not save file : \" + e.getMessage() , fileName); \n\t\t}\n\t\tcurrentClass = null; \n\t}",
"CodeWriter(File outputFile) throws IOException\n {\n writer = new PrintWriter(outputFile);\n }",
"public CompilationEngine(File input, File output) throws IOException {\n writer = new PrintWriter(Files.newBufferedWriter(Paths.get(output.getPath().replace(INPUT_FILE_SUFFIX, OUTPUT_FILE_SUFFIX))));\n jackTokenizer = new JackTokenizer(input);\n }",
"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}",
"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 boolean isCompiled() {\n return state == State.COMPILED || state == State.CHECKED\n || state == State.GRAVEYARD;\n }",
"public static void main(String[] args) {\n\n\t\t// File file=new File(\"./testClasses/binarysearch.java\");\n\t\tCharStream input = null;\n\t\tif (args.length > 0) {\n\t\t\ttry {\n\t\t\t\tinput = CharStreams.fromFileName(args[0]);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(BGSTYLE + RED + BOLD + UNDERLINE\n\t\t\t\t\t\t+ \"THE GIVEN FILE PATH IS WRONG!\" + RESET);\n\t\t\t\tSystem.out.println(YELLOW + BOLD\n\t\t\t\t\t\t+ \"IF EXECUTING THE JAR, CHECK YOUR COMMAND \"\n\t\t\t\t\t\t+ \" java -jar MJCompiler <filePath> \\n\"\n\t\t\t\t\t\t+ \"OTHERWISE CHECK THE MAIN METHOD\" + RESET);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\n\t\t\ttry {\n\t\t\t\tinput = CharStreams.fromFileName(\"./testFiles/factorial.java\");\n\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(BGSTYLE + RED + BOLD + UNDERLINE\n\t\t\t\t\t\t+ \"THE GIVEN FILE PATH IS WRONG!!\" + RESET);\n\t\t\t\tSystem.out.println(YELLOW + BOLD\n\t\t\t\t\t\t+ \"IF EXECUTING THE JAR, CHECK YOUR COMMAND \"\n\t\t\t\t\t\t+ \" java -jar MJCompiler <filePath> \\n\"\n\t\t\t\t\t\t+ \"OTHERWISE CHECK THE MAIN METHOD\" + RESET);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tMiniJavaLexer lexer = new MiniJavaLexer(input);\n\t\tMiniJavaParser parser = new MiniJavaParser(new BufferedTokenStream(\n\t\t\t\tlexer));\n\t\tParseTree tree = parser.program();\n\t\tTrees.inspect(tree, parser);\n\n\t\t// ---------PrintVisitor-------------\n\t\tPrintVisitor pv = new PrintVisitor();\n\t\tpv.visitMiniJava(tree);\n\n\t\t// --------SymbolTableVisitor--------\n\t\tSymbolTableVisitor symbolTableVisitor = new SymbolTableVisitor();\n\t\tSymbolTable visitedST = (SymbolTable) symbolTableVisitor.visit(tree);\n\t\tif (symbolTableVisitor.getErrorFlag()) {\n\t\t\tSystem.err\n\t\t\t\t\t.println(BGSTYLE\n\t\t\t\t\t\t\t+ RED\n\t\t\t\t\t\t\t+ \"THE PROGRAM COTAINS ERRORS! \\n CHECK CONSOLE AND PARSE TREE WINDOW FOR MORE INFO!\");\n\t\t} else {\n\t\t\tvisitedST.printTable();\n\t\t\tvisitedST.resetTable();\n\n\t\t\t// ------TypeCheckVisitor\n\t\t\tTypeCheckVisitor tcv = new TypeCheckVisitor(visitedST);\n\t\t\ttcv.visit(tree);\n\t\t\tif (tcv.getErrorCount() > 0) {\n\t\t\t\tSystem.err.println(\"The Program contains \"\n\t\t\t\t\t\t+ tcv.getErrorCount() + \" Type Errors!\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"TypeChecking Done With No Errors!\");\n\t\t\t}\n\t\t}\n\n\t}",
"public boolean mustCompile() {\n return true;\n }",
"@Test(timeout = 4000)\n public void test012() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180370));\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"\");\n String[] stringArray0 = new String[0];\n classWriter0.visit(1, 1, \"InnerClasses\", \"\", \"EQIUR?\", stringArray0);\n classWriter0.newField(\"\", \"\", \"\\\"\");\n String[] stringArray1 = new String[4];\n stringArray1[0] = \"\\\"\";\n stringArray1[1] = \"char\";\n stringArray1[2] = \"boolean\";\n stringArray1[3] = \" ,G\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, (-1983180370), \" ,G\", \"<T'RwU+)i.UKJX>\", \"\", stringArray1, true, true);\n methodWriter0.visitCode();\n }",
"public ClassCreator(){\n\n\n\t\tScanner fin = null;\n\n\t\ttry {\n\t\t\tString[] nameHandler = fileName.split(\"\\\\.\");\n\n\t\t\tString className = nameHandler[0].replaceAll(\" |_|\\\\s$|0|1|2|3|4|5|6|7|8|9\", \"\");\n\n\n\t\t\t//Setting Up Scanners/PrintWriter\n\t\t\tfin = new Scanner(new File(fileName));\n\n\n\t\t\tPrintWriter pw = new PrintWriter(className + \".java\");\n\n\n\t\t\tString[] prop = fin.nextLine().split(\"\\t\");\n\t\t\tString[] data = fin.nextLine().split(\"\\t\");\n\n\t\t\tfor(int i = 0; i<prop.length; i++) {\n\t\t\t\tpropertyList.add(new Properties(prop[i].replaceAll(\"\\\\s\", \"\"), getDataType(data[i])));\n\t\t\t}\n\n\t\t\t//Imports\n\t\t\tpw.println(\"import java.util.Scanner;\\n\\n\");\n\t\t\t\n\t\t\t//Class Line\n\t\t\tpw.println(\"\\npublic class \" + className + \" {\");\n\n\t\t\t//Properties\n\t\t\tpw.println(\"\\n\\t//======================================================= Properties\\n\");\n\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateProperty());\n\t\t\t}\n\n\t\t\t//Constructors\n\t\t\tpw.println(\"\\n\\t//======================================================= Constructors\\n\");\n\n\t\t\t//================= Workhorse Constructor\n\t\t\tpw.print(\"\\tpublic \" + className + \"(\");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).getDataType() + \" \" + propertyList.get(i).getFieldName() + \", \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).getDataType() + \" \" \n\t\t\t\t\t+ propertyList.get(propertyList.size()-1).getFieldName() + \"){\\n\");\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateSetCall(p));\n\t\t\t}\n\t\t\tpw.println(\"\\t}\\n\");\n\n\t\t\t//================= Scanner Constructor\n\t\t\tpw.print(\"\\tpublic \" + className + \"(Scanner fin) throws Exception {\\n\");\n\t\t\tpw.println(\"\\t\\tString[] parts = fin.nextLine().split(\\\"\\\\t\\\");\");\n\t\t\tint arrayCount = 0;\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tif(p.getDataType().equals(\"int\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Integer.parseInt(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"double\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Double.parseDouble(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"long\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Long.parseLong(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse if(p.getDataType().equals(\"boolean\")) {\n\t\t\t\t\tpw.println(p.generateSetCall(\"Boolean.parseBoolean(parts[\" + arrayCount + \"])\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tpw.println(p.generateSetCall(\"parts[\" + arrayCount + \"]\"));\n\t\t\t\t\tarrayCount++;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tpw.println(\"\\n\\t}\");\n\n\t\t\t//Methods\n\t\t\tpw.println(\"\\n\\t//======================================================= Methods\\n\");\n\n\t\t\t\t//Equals\n\t\t\tpw.println(\"\\tpublic boolean equals(Object obj) {\");\n\t\t\tpw.println(\"\\t\\tif(!(obj instanceof \" + className + \")) return false;\");\n\t\t\tpw.println(\"\\t\\t\" + className + \" \" + className.substring(0,1).toLowerCase() + \" = (\" + className + \")obj;\");\n\t\t\tpw.println(\"\\t\\treturn getEqualsString().equals(\" + className.substring(0,1).toLowerCase() + \".getEqualsString());\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\t//EqualsHelper\n\t\t\tpw.println(\"\\n\\tprivate String getEqualsString() {\");\n\t\t\tpw.print(\"\\t\\treturn \");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).getFieldName() + \" + \\\"~\\\" + \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).getFieldName() + \";\\n\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\t//toString\n\t\t\tpw.println(\"\\n\\tpublic String toString() {\");\n\t\t\tpw.print(\"\\t\\treturn \\\"\");\n\t\t\tfor(int i=0; i<propertyList.size()-1; i++) {\n\t\t\t\tpw.print(propertyList.get(i).generateUpperCase() + \": \\\" + \" + propertyList.get(i).getFieldName() + \" + \\\", \");\n\t\t\t}\n\t\t\tpw.print(propertyList.get(propertyList.size()-1).generateUpperCase() + \": \\\" + \" + propertyList.get(propertyList.size()-1).getFieldName() + \";\\n\");\n\t\t\tpw.println(\"\\t}\");\n\t\t\t\n\t\t\t\n\t\t\t//Getters/Setters\n\t\t\tpw.println(\"\\n\\t//======================================================= Getters/Setters\\n\");\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateGetter());\n\t\t\t}\n\t\t\tpw.println();\n\t\t\tfor(Properties p: propertyList) {\n\t\t\t\tpw.println(p.generateSetter());\n\t\t\t}\n\n\t\t\t//End of the file code\n\t\t\tpw.print(\"\\n\\n}\");\n\t\t\tfin.close();\n\t\t\tpw.close();\n\n\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error: \" + e.getMessage());\n\t\t} finally { //Checked Last after try\n\t\t\ttry {fin.close();} catch (Exception e) {} //Just Double Checking\n\n\t\t}\n\n\n\n\n\t}",
"public void compile(MindFile f) {\n \t\t\n \t}",
"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 doGeneration(Class<?> clazz);",
"@Test(timeout = 4000)\n public void test029() throws Throwable {\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter((-4015));\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \"dVw2Z7M){e/Y(#j\", \"dVw2Z7M){e/Y(#j\", \"dVw2Z7M){e/Y(#j\", (String[]) null, false, false);\n methodWriter0.visitInsn((-4015));\n FieldWriter fieldWriter0 = classWriter0.firstField;\n classWriter0.firstField = null;\n Object[] objectArray0 = new Object[7];\n objectArray0[0] = (Object) \"+t1`X]_2(_63\";\n Attribute attribute0 = new Attribute(\"zLWhmp0G*{\");\n ClassReader classReader0 = null;\n try {\n classReader0 = new ClassReader(\"dVw2Z7M){e/Y(#j\");\n fail(\"Expecting exception: IOException\");\n \n } catch(Throwable e) {\n //\n // Class not found\n //\n verifyException(\"org.objectweb.asm.jip.ClassReader\", e);\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}",
"@Test(timeout = 4000)\n public void test099() throws Throwable {\n Label label0 = new Label();\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"e5AO^\");\n ClassWriter classWriter0 = new ClassWriter((-2463));\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"e5AO^\");\n classWriter0.newConst(\"Cpd7(e\");\n String[] stringArray0 = new String[9];\n stringArray0[0] = \"Fj)3/|(;sZXz$\";\n stringArray0[1] = \"e5AO^\";\n stringArray0[2] = \"e5AO^\";\n stringArray0[3] = \"~)yCTRxQ#s$y[Ly%\";\n stringArray0[4] = \"Fj)3/|(;sZXz$\";\n stringArray0[5] = \"e5AO^\";\n stringArray0[6] = \"Cpd7(e\";\n stringArray0[7] = \"Cpd7(e\";\n stringArray0[8] = \"Cpd7(e\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \"e5AO^\", \"~)yCTRxQ#s$y[Ly%\", \"e5AO^\", stringArray0, false, false);\n methodWriter0.visitJumpInsn(1, label0);\n classWriter0.newNameTypeItem(\"Cpd7(e\", \"Cpd7(e\");\n label0.successor = label0;\n Label label1 = new Label();\n methodWriter0.visitJumpInsn(1, label0);\n methodWriter0.visitJumpInsn(2, label0.successor);\n methodWriter0.visitInsn(1);\n classWriter0.index = 2330;\n methodWriter0.visitLdcInsn(\"e5AO^\");\n methodWriter0.visitFrame(3, 268435455, stringArray0, 3239, stringArray0);\n methodWriter0.visitTypeInsn(2330, \"~hm$aI6.7xL0\");\n int int0 = methodWriter0.getSize();\n assertEquals(85, int0);\n }",
"public JavaCodeGenerator(String filename)\n throws IOException {\n this(filename, new CodeStyle());\n }",
"private void translator(File inputFile) throws IOException {\n Parser fileParser = new Parser(inputFile);\n CodeWriter writer = new CodeWriter(inputFile);\n String outputName = inputFile.getPath().replace(\".vm\", \".asm\");\n writer.setFileName(inputFile.getName().replace(\".vm\", \"\"));\n\n Path outputPath = Paths.get(outputName);\n PrintWriter out = new PrintWriter(Files.newBufferedWriter(outputPath));\n\n String line;\n while (fileParser.hasMoreCommends()) {\n line = fileParser.adanvce();\n fileParser.lineAnalizer(line); // updates parser fields\n int CommendType = fileParser.getCommendType();\n\n switch (CommendType) {\n case Parser.C_ARITHMETIC:\n writer.writeArithmetic(fileParser.getArg1());\n break;\n case Parser.C_PUSH:\n case Parser.C_POP:\n writer.writePushPop(CommendType, fileParser.getArg1(), fileParser.getArg2());\n break;\n }\n\n }\n fileParser.close();\n writer.close();\n }",
"private void createValidationFile(final Class Class_, final String simpleName) throws Exception {\n final SessionFactory SessionFactory = HibernateUtil.getSingleton().getSessionFactoryLocal();\n final ClassMetadata classMetadata = SessionFactory.getClassMetadata(Class_);\n final String[] propertyNames = classMetadata.getPropertyNames();\n \n //Create the path\n final String className = simpleName + \"sValidator\";\n final String path = \"../era_easyretail/src/main/java/com/era/easyretail/validators\";\n final String finalClassPath = path + \"/\" + className + \".java\";\n \n //Get file content\n final String fileContent = this.getValidationFileContent(Class_,simpleName,propertyNames);\n \n //If the file exists delete it\n final File File = new File(finalClassPath); \n if(File.exists()){\n File.delete();\n }\n \n //Create the file\n File.createNewFile();\n \n //Write to the file\n try ( //Write the class\n FileWriter writer = new FileWriter(File)) { \n writer.write(fileContent);\n }\n }",
"public static void main (String [] args) throws Exception {\n if(args.length < 1){\n System.err.println(\"Usage: java Main <inputFile1> <inputFile2> ... <inputFileN> \");\n System.exit(1);\n }\n\n FileInputStream fis = null;\n\n\n try{\n\n for (String s: args) {\n System.out.println(\"Type check on program: \"+s);\n System.out.print(\"\\n\"); \n\n //Parsing the input program.\n fis = new FileInputStream(s);\n MiniJavaParser parser = new MiniJavaParser(fis);\n System.err.println(\"Program parsed successfully.\");\n System.out.print(\"\\n\"); \n Goal root = parser.Goal(); \n \n //If the parsing was successful, we move on to the FirstVisitor which will create the Symbol Table and perform declaration checks.\n FirstVisitor eval = new FirstVisitor();\n\n boolean decl_error = false;\n\n try{ \n root.accept(eval, null);\n }catch(Exception ouch){ //If we encounter any declaration errors, the semantic check ends. \n\n System.out.println(\"We encountered at least one declaration error! \"); \n System.out.print(\"\\n\"); \n decl_error = true;\n\n }\n\n //We encountered a declaration error, so now we move on to the next program.\n if(decl_error == true){\n continue;\n }\n \n //Checking if the symbol table has a object from a class that was never declared. If so, we stop the semantic check.\n //This is the only check performed in the main function. All other checks are in the Visitor files.\n for (int counter = 0; counter < eval.idList.size(); counter++) { \t\t \n String id_check = eval.idList.get(counter);\n if( !(eval.visitor_sym.classId_table.containsKey(id_check)) ){\n\n System.out.println(\"We encountered at least one declaration error! \"); \n System.out.print(\"\\n\"); \n decl_error = true;\n \n }\n }\n \n if(decl_error == true){\n continue;\n }\n\n \n //Our program is free of declaration errors, so now we go to the second visitor which will perform type checking.\n SecondVisitor eval2 = new SecondVisitor(eval.visitor_sym);\n \n boolean type_error = false;\n\n try{\n root.accept(eval2, null);\n }catch(Exception ouch){ //If we encounter any type errors, the semantic check ends. \n System.out.println(\"We encountered at least one type error! \"); \n System.out.print(\"\\n\"); \n type_error = true;\n }\n\n //We encountered a type error, so now we move on to the next program.\n if (type_error == true){\n continue;\n }\n \n\n System.out.println(\"Our program is free of type errors, moving on to the offset table: \"); \n System.out.print(\"\\n\"); \n\n //Creating the offset table with the OffsetTable class.\n OffsetTable ot = new OffsetTable(eval.visitor_sym);\n ot.OutputCreator();\n System.out.print(\"\\n\"); \n\n }\n\n }\n\n catch(ParseException ex){\n System.out.println(ex.getMessage());\n }\n\n catch(FileNotFoundException ex){\n System.err.println(ex.getMessage());\n }\n\n finally{\n\n try{\n if(fis != null) fis.close();\n }\n catch(IOException ex){\n System.err.println(ex.getMessage());\n }\n }\n\n\n }",
"@Test(timeout = 4000)\n public void test103() throws Throwable {\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter((-4015));\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n int int0 = MethodWriter.SAME_FRAME;\n FileSystemHandling fileSystemHandling1 = new FileSystemHandling();\n String[] stringArray0 = new String[5];\n stringArray0[0] = \"dVw2ZwM){e/Y(#j\";\n stringArray0[1] = \"<T'RwU+).UKJX>\";\n stringArray0[2] = \"char\";\n stringArray0[3] = \"dVw2ZwM){e/Y(#j\";\n stringArray0[4] = \"<T'RwU+).UKJX>\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \"char\", \"<T'RwU+).UKJX>\", \"char\", stringArray0, true, false);\n methodWriter0.classReaderOffset = 1;\n Item item0 = new Item();\n Integer integer0 = new Integer(64);\n methodWriter0.visitLdcInsn(\"dVw2ZwM){e/Y(#j\");\n ByteVector byteVector0 = new ByteVector(26);\n int int1 = methodWriter0.getSize();\n assertEquals(6, int1);\n }",
"public String build(String buildPath, boolean verbose)\n throws RunnerException {\n \n // run the preprocessor\n editor.status.progressUpdate(20);\n String primaryClassName = preprocess(buildPath);\n\n // compile the program. errors will happen as a RunnerException\n // that will bubble up to whomever called build().\n Compiler compiler = new Compiler();\n if (compiler.compile(this, buildPath, primaryClassName, verbose)) {\n size(buildPath, primaryClassName);\n return primaryClassName;\n }\n return null;\n }",
"public boolean compile(String source) {\n\t return compile(source, true);\n\t}",
"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 void dumpClassBytesToFile ()\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int lastSlash =\n\t\t\t\tclassInternalName.lastIndexOf('/');\n\t\t\tfinal String pkg =\n\t\t\t\tclassInternalName.substring(0, lastSlash);\n\t\t\tfinal Path tempDir = Paths.get(\"debug\", \"jvm\");\n\t\t\tfinal Path dir = tempDir.resolve(Paths.get(pkg));\n\t\t\tFiles.createDirectories(dir);\n\t\t\tfinal String base = classInternalName.substring(lastSlash + 1);\n\t\t\tfinal Path classFile = dir.resolve(base + \".class\");\n\t\t\tFiles.write(classFile, stripNull(classBytes));\n\t\t}\n\t\tcatch (final IOException e)\n\t\t{\n\t\t\tInterpreter.log(\n\t\t\t\tInterpreter.loggerDebugJVM,\n\t\t\t\tLevel.WARNING,\n\t\t\t\t\"unable to write class bytes for generated class {0}\",\n\t\t\t\tclassInternalName);\n\t\t}\n\t}",
"protected void compileSFile(IModuleToolContext context, File srcFile, File outFile, String cflags) throws IOException {\n\t\tString command = AsInvocation.getAsCommand(context) + \" -o $\" + EcobuildFileUtil.getCanonicalPath(outFile) + \"$ \" + srcFile.getName();\n\t\tnew AsInvocation(context, context.getModuleSourceFolder(), command, context.getLogger()).invoke();\n\t}",
"public static boolean isJavaSourceFile(String f) {\n\t\tString ext = FilenameUtils.getExtension(f);\n\t\tif (ext.endsWith(\"java\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public void compile(Template t, TemplateModel model, Writer out) throws TemplateCompileException;",
"void reportCompileSucceed(final String className)\n {\n this.printMessage(UtilText.concatenate(\"Succeed to compile :\\n\", className, \"\\n\\n------------\\n\\n\"));\n this.endCompilation();\n this.fireCompilationSucceed(className);\n }",
"public void saveBeforeCompile() { }",
"public void saveBeforeCompile() { }",
"@Test(timeout = 4000)\n public void test058() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-1983180370));\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"/||OC]6QKvi*G\");\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n String[] stringArray0 = new String[2];\n stringArray0[0] = \"?t|o'XqH!B#u5<FG2z\";\n stringArray0[1] = \"?t|o'XqH!B#u5<FG2z\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 17, \"?t|o'XqH!B#u5<FG2z\", \"?t|o'XqH!B#u5<FG2z\", \"/||OC]6QKvi*G\", stringArray0, false, false);\n methodWriter0.visitVarInsn(17, 2);\n MethodWriter methodWriter1 = classWriter0.firstMethod;\n methodWriter1.visitIntInsn(17, 172);\n MethodWriter methodWriter2 = classWriter0.firstMethod;\n methodWriter2.visitInsn(1);\n assertSame(methodWriter2, methodWriter1);\n }",
"public static void main(String[] args) {\n File file = new File(\"./src/testcode.c\");\n \n Compiler compiler = new Compiler(file);\n compiler.compile();\n }",
"@Test(timeout = 4000)\n public void test108() throws Throwable {\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter((-4015));\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, true);\n FileSystemHandling.shouldThrowIOException((EvoSuiteFile) null);\n String[] stringArray0 = new String[6];\n stringArray0[0] = \"dVw2Z7M){e/Y(#j\";\n stringArray0[1] = \"+5vu,cm9U5+I\";\n stringArray0[2] = \"P{Vxct7w\";\n stringArray0[3] = \"dVw2Z7M){e/Y(#j\";\n stringArray0[4] = \"P{Vxct7w\";\n stringArray0[5] = \"+5vu,cm9U5+I\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 928, \"P{Vxct7w\", \"+5vu,cm9U5+I\", \"+5vu,cm9U5+I\", stringArray0, false, false);\n classWriter0.lastMethod = methodWriter0;\n MethodWriter methodWriter1 = new MethodWriter(classWriter0, 2, \"dVw2Z7M){e/Y(#j\", \"dVw2Z7M){e/Y(#j\", \"dVw2Z7M){e/Y(#j\", (String[]) null, false, true);\n methodWriter1.visitInsn(14);\n FieldWriter fieldWriter0 = classWriter0.firstField;\n classWriter0.firstField = null;\n Label label0 = new Label();\n Frame frame0 = new Frame();\n label0.frame = frame0;\n methodWriter1.visitLabel(label0);\n Attribute attribute0 = new Attribute(\"org.objectweb.asm.jip.ClassAdapter\");\n ClassReader classReader0 = null;\n try {\n classReader0 = new ClassReader(\"+5vu,cm9U5+I\");\n fail(\"Expecting exception: IOException\");\n \n } catch(Throwable e) {\n //\n // Class not found\n //\n verifyException(\"org.objectweb.asm.jip.ClassReader\", e);\n }\n }",
"private boolean compilationRequired( String module, File output )\n throws MojoExecutionException\n {\n GwtModule gwtModule = readModule( module );\n if ( gwtModule.getEntryPoints().length == 0 )\n {\n // No entry-point, this is a secondary module : compiling this one will fail\n // with '[ERROR] Module has no entry points defined'\n return false;\n }\n\n if ( force )\n {\n return true;\n }\n\n String modulePath = gwtModule.getPath();\n String outputTarget = modulePath + \"/\" + modulePath + \".nocache.js\";\n\n // Require compilation if no js file present in target.\n if ( !new File( output, outputTarget ).exists() )\n {\n return true;\n }\n\n // js file allreay exists, but may not be up-to-date with project source files\n SingleTargetSourceMapping singleTargetMapping = new SingleTargetSourceMapping( \".java\", outputTarget );\n StaleSourceScanner scanner = new StaleSourceScanner();\n scanner.addSourceMapping( singleTargetMapping );\n\n Collection<File> compileSourceRoots = new HashSet<File>();\n classpathBuilder.addSourcesWithActiveProjects( getProject(), compileSourceRoots, SCOPE_COMPILE );\n classpathBuilder.addResourcesWithActiveProjects( getProject(), compileSourceRoots, SCOPE_COMPILE );\n for ( File sourceRoot : compileSourceRoots )\n {\n if ( !sourceRoot.isDirectory() )\n {\n continue;\n }\n try\n {\n if ( !scanner.getIncludedSources( sourceRoot, output ).isEmpty() )\n {\n getLog().debug( \"found stale source in \" + sourceRoot + \" compared with \" + output );\n return true;\n }\n }\n catch ( InclusionScanException e )\n {\n throw new MojoExecutionException( \"Error scanning source root: \\'\" + sourceRoot + \"\\' \"\n + \"for stale files to recompile.\", e );\n }\n }\n return false;\n }",
"public void testSimpleImplementation() throws Exception {\n\n\t\t// Create the source\n\t\tStringWriter buffer = new StringWriter();\n\t\tPrintWriter source = new PrintWriter(buffer);\n\t\tsource.println(\"package net.officefloor.test;\");\n\t\tsource.println(\"public class SimpleImpl implements \" + Simple.class.getName().replace('$', '.') + \" {\");\n\t\tsource.println(\" public String getMessage() {\");\n\t\tsource.println(\" return \\\"TEST\\\";\");\n\t\tsource.println(\" }\");\n\t\tsource.println(\"}\");\n\t\tsource.flush();\n\n\t\t// Compile the source\n\t\tJavaSource javaSource = this.compiler.addSource(\"net.officefloor.test.SimpleImpl\", buffer.toString());\n\t\tClass<?> clazz = javaSource.compile();\n\n\t\t// Ensure can use without class compatibility issues\n\t\tSimple simple = (Simple) clazz.getConstructor().newInstance();\n\t\tassertEquals(\"Incorrect compiled result\", \"TEST\", simple.getMessage());\n\t}",
"public File writeDriverFile(List<Class<?>> allClasses,\n\t\t\tString driverClassName) {\n\t\tFile file = new File(getDir(), driverClassName + \".java\");\n\t\tPrintStream out = createTextOutputStream(file);\n\t\ttry {\n\t\t\toutputPackageName(out);\n\t\t\tout.println(\"import junit.framework.*;\");\n\t\t\tout.println(\"import junit.textui.*;\");\n\t\t\tout.println(\"\");\n\t\t\tout.println(\"public class \" + driverClassName\n\t\t\t\t\t+ \" extends TestCase {\");\n\t\t\tout.println(\"\");\n\t\t\tout.println(\" public static void main(String[] args) {\");\n\t\t\tout.println(\" TestRunner runner = new TestRunner();\");\n\t\t\tout\n\t\t\t\t\t.println(\" TestResult result = runner.doRun(suite(), false);\");\n\t\t\tout.println(\" if (! result.wasSuccessful()) {\");\n\t\t\tout.println(\" System.exit(1);\");\n\t\t\tout.println(\" }\");\n\t\t\tout.println(\" }\");\n\t\t\tout.println(\"\");\n\t\t\tout.println(\" public \" + driverClassName + \"(String name) {\");\n\t\t\tout.println(\" super(name);\");\n\t\t\tout.println(\" }\");\n\t\t\tout.println(\"\");\n\t\t\tout.println(\" public static Test suite() {\");\n\t\t\tout.println(\" TestSuite result = new TestSuite();\");\n\t\t\tfor (String junitTestsClassName : createdSequencesAndClasses\n\t\t\t\t\t.keySet()) {\n\t\t\t\tint numSubSuites = createdSequencesAndClasses.get(\n\t\t\t\t\t\tjunitTestsClassName).size();\n\t\t\t\tfor (int i = 0; i < numSubSuites; i++)\n\t\t\t\t\tout.println(\" result.addTest(new TestSuite(\"\n\t\t\t\t\t\t\t+ junitTestsClassName + i + \".class));\");\n\t\t\t}\n\t\t\tout.println(\" return result;\");\n\t\t\tout.println(\" }\");\n\t\t\twriteCheckException(out);\n\t\t\tout.println(\"\");\n\t\t\tout.println(\"}\");\n\t\t} finally {\n\t\t\tif (out != null)\n\t\t\t\tout.close();\n\t\t}\n\t\treturn file;\n\t}",
"void saveSimpleCodesToFile() {\n\t\tPrintWriter writer;\r\n\t\ttry {\r\n\t\t\t//writer = new PrintWriter(pathStr + \"/../pt.iscte.pidesco.codegenerator/Settings/Code.cg\", \"UTF-8\");\r\n\t\t\twriter = new PrintWriter(\"Code.cg\", \"UTF-8\");\r\n\t\t\tfor (SimpleCode sc : SimpleCodeMap.values()) {\r\n\t\t\t\twriter.print(sc.getCodeName() + \"-CGSeparator-\" + sc.resultCodeToWrite());\r\n\t\t\t\twriter.print(\"-CGCodeSeparator-\");\r\n\t\t\t}\r\n\t\t\twriter.close();\r\n\t\t} catch (FileNotFoundException | UnsupportedEncodingException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public static boolean analyze(String filename, ParseTree parseTree, Set<Integer> sinks) throws Exception {\n\t\t\n\t\tboolean ret = true;\n\t\t\n\t\tDEBUG_MODE = 0;\n\t\tfunlib = new FunctionLibrary();\n\t\t\n\t try {\n\t \tString jaDir = \"/home/ruoyu/PROJECTS/JAnalyzer\";\n\t \t\n\t \tParseNode root = parseTree.getRoot();\n\t \t//Dumper.dumpDot(parseTree, jaDir, \"parseTree\");\n\t \tutils.ParseTreeUtils.printParseNode(root, \"\");\n\t \t\n\t \tAST ast = new AST(parseTree.getRoot());\n\t \t\n\t \t/*\n\t \tPreprocess preprs = new Preprocess(ast);\n\t \tpreprs.process();\n\t \t*/\n\t \t\n\t \tPhpFile phpFile = new PhpFile(ast, sinks);\n\t \tphpFile.printPhpFile();\n\t \t\n\t \t\n\t \t/*\n\t \tPreprocess preprs = new Preprocess(doc);\n\t \tpreprs.process();\n\t \t\n\t \t\n\t \t// output to a file, for debugging purpose only\n\t\t\tTransformerFactory transformerFactory = TransformerFactory.newInstance();\n\t\t\tTransformer transformer = transformerFactory.newTransformer();\n\t\t\tDOMSource source = new DOMSource(doc);\n\t\t\tStreamResult result = new StreamResult(new File(\"/home/ruoyu/PROJECTS/JAnalyzer/preprocess.xml\"));\n\t\t\ttransformer.transform(source, result);\n\t \t\n\t \tElement root = doc.getDocumentElement();\n\t \t*/\n\t \t//System.out.println(\"Root element :\" + root.getNodeName()); \n\t \t \t\n\t \t// Initialize the PhpFile\n\t \t// ASSUMPTION: root always has a direct child \"scalar:array\" which contains a list of statements\n\t \t\n\t \t\n\t \t/*\n\t \tPhpFile phpFile = new PhpFile(parseTree, sinks);\n\t \tphpFile.printPhpFile();\n\t \t\n\t \tVCGenerator generator = new VCGenerator(phpFile, jaDir + \"/JAnalyzer.smt2\");\n\t \tgenerator.generate();\n\t \tThread.sleep(1000);\n\t \t\n\t \t\n\t \tp = Runtime.getRuntime().exec(new String[]{\"bash\",\"-c\", \"/home/ruoyu/PROJECTS/JAnalyzer/cvc4-2014-04-18-x86_64-linux-opt \" + jaDir + \"/JAnalyzer.smt2 > \" + jaDir + \"/result\"});\n\t \tThread.sleep(200);\n\t \t\n\t \tSystem.out.println(\"RESULT>>>>>>>>>>>>>>>>>>>>>\");\n\t \t BufferedReader br = new BufferedReader(new FileReader(jaDir + \"/result\"));\n\t \t String line = br.readLine();\n\t \t \n\t \t if (line.charAt(0) == 'u') ret = false;\n\t \t \n\t \t while (line != null) {\n\t \t System.out.println(line);\n\t \t line = br.readLine();\n\t \t }\n\t \t */\n\t \t\n\t \t/*\n\t \tSystem.out.println(\"Output:>>>>>>>>>>>>>\");\n\t \tOutputStream os = p.getOutputStream();\n\t \tPrintStream prtOs = new PrintStream(os);\n\t \tprtOs.println();\n \n\t \tSystem.out.println(\"Error:>>>>>>>>>>>>>\");\n\t \tInputStream es = p.getErrorStream();\n\t \tPrintStream prtEs = new PrintStream(os);\n\t \tprtEs.println();\n\t\t\t*/\n\t \t\n\t } catch (Exception e) {\n\t \t\n\t \te.printStackTrace();\n\t \treturn ret;\n\t \n\t }\n\t \n\t return ret;\n\t}",
"public void buildClassTree() {\n\t\twriter.writeClassTree();\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 }",
"public boolean writeWordFile() throws Exception {\n\n InputStream is = null;\n FileOutputStream fos = null;\n\n // 1 Cannot find source file, return false\n File inputFile = new File(this.inputPath);\n if (!inputFile.exists()) {\n return false;\n }\n\n File outputFile = new File(this.outputPath);\n // 2 If the target path does not exist, create a new path\n if (!outputFile.getParentFile().exists()) {\n outputFile.getParentFile().mkdirs();\n }\n\n try {\n\n // 3 Write html file content to doc file\n is = new FileInputStream(inputFile);\n POIFSFileSystem poifs = new POIFSFileSystem();\n DirectoryEntry directory = poifs.getRoot();\n directory.createDocument(\n \"WordDocument\", is);\n\n fos = new FileOutputStream(this.outputPath);\n poifs.writeFilesystem(fos);\n\n System.out.println(\"Conversion of word files is complete!\");\n\n return true;\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (fos != null) {\n fos.close();\n }\n if (is != null) {\n is.close();\n }\n }\n\n return false;\n }",
"public void compile(Template t, TemplateModel model, OutputStream out) throws TemplateCompileException;",
"public void parseFile(String fileLocation) {\n\t\tString sourceCode = null;\n\t\ttry {\n\t\t\tsourceCode = FileUtils.readFileToString(new File(fileLocation), \"ISO-8859-1\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// just in case somehow things escape the try-catch statement\n\t\tif(sourceCode == null) {\n\t\t\tthrow new IllegalStateException(\"[ERROR]: source code is null!\");\n\t\t}\n\n\t\t// create parser and set properties\n\t\tASTParser parser = ASTParser.newParser(AST.JLS8);\n\t\tparser.setUnitName(fileLocation);\n\t\tparser.setEnvironment(null, null, null, true);\n\t\tparser.setSource(sourceCode.toCharArray());\n\t\tparser.setKind(ASTParser.K_COMPILATION_UNIT);\n\t\tparser.setResolveBindings(true);\n\t\tparser.setBindingsRecovery(true);\n\t\tparser.setStatementsRecovery(true);\n\n\t\tfinal CompilationUnit cu = (CompilationUnit) parser.createAST(null);\n\n//\t\tfor (Comment comment : (List<Comment>) cu.getCommentList()) {\n//\t\t\tcomment.accept(new ASTRefactor.CommentVisitor(cu, sourceCode));\n//\t\t}\n\n\t\tcu.accept(new ASTVisitor() {\n\t\t\tpublic boolean visit(AnonymousClassDeclaration node) {\n\t\t\t\tJavaClass co = new JavaClass();\n\n\t\t\t\tif(configProperties.get(\"AnonymousClassDeclaration\")) {\n\t\t\t\t\tITypeBinding binding = node.resolveBinding();\n\n\t\t\t\t\tint startLine = cu.getLineNumber(node.getStartPosition());\n\t\t\t\t\tint endLine = cu.getLineNumber(node.getStartPosition() + node.getLength() - 1);\n\n\t\t\t\t\tco.setIsAnonymous(binding.isAnonymous());\n\t\t\t\t\tco.setColumnNumber(cu.getColumnNumber(node.getStartPosition()));\n\t\t\t\t\tco.setEndLine(endLine);\n\t\t\t\t\tco.setLineNumber(startLine);\n\n\t\t\t\t\tSystem.out.println(startLine);\n\n\t\t\t\t\tco.setNumberOfCharacters(node.getLength());\n\t\t\t\t\tco.setFileName(fileLocation);\n\n\t\t\t\t\tList<String> genericParametersList = new ArrayList<>();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif(binding.isGenericType()) {\n\t\t\t\t\t\t\tco.setIsGenericType(binding.isGenericType());\n\t\t\t\t\t\t\tfor(Object o : binding.getTypeParameters()) {\n\t\t\t\t\t\t\t\tgenericParametersList.add(o.toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tco.setIsGenericType(false);\n\t\t\t\t\t}\n\t\t\t\t\tco.setGenericParametersList(genericParametersList);\n\n\t\t\t\t\tco.setHasComments(hasComments);\n\t\t\t\t\tco.setSourceCode(getClassSourceCode(fileLocation, startLine, endLine));\n\t\t\t\t\tco.setStartCharacter(node.getStartPosition());\n\t\t\t\t\tco.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\t\t\t\t\tco.setImportList(importList);\n\t\t\t\t\tco.setPackage(packageObject);\n\t\t\t\t\tco.setIsAnonymous(true);\n\t\t\t\t}\n\n\t\t\t\tentityStack.push(co);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic void endVisit(AnonymousClassDeclaration node) {\n\t\t\t\tif(configProperties.get(\"AnonymousClassDeclaration\")) {\n\t\t\t\t\tJavaClass temp = (JavaClass) entityStack.pop();\n\n\t\t\t\t\ttemp.setIsInnerClass(true);\n\n\t\t\t\t\ttemp.setComplexities();\n\t\t\t\t\ttemp.setMethodDeclarationNames();\n\t\t\t\t\ttemp.setMethodInvocationNames();\n\n\t\t\t\t\tif(!containingClass.isEmpty()) {\n\t\t\t\t\t\ttemp.setContainingClass(containingClass);\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tentityStack.peek().addEntity(temp, Entity.EntityType.CLASS);\n\t\t\t\t\t} catch (EmptyStackException e) {\n\t\t\t\t\t\t// should not be possible\n\t\t\t\t\t}\n\n\t\t\t\t\tfileModel.addJavaClass(temp);\n\n\t\t\t\t\thasComments = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic boolean visit(CatchClause node) {\n\t\t\t\tif(inMethod && configProperties.get(\"CatchClause\")) {\n\t\t\t\t\tSimpleName name = node.getException().getName();\n\n\t\t\t\t\tSuperEntityClass cco = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t);\n\t\t\t\t\tcco.setType(node.getException().getType());\n\t\t\t\t\tentityStack.peek().addEntity(cco, Entity.EntityType.CATCH_CLAUSE);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ConditionalExpression node){\n\t\t\t\tif(inMethod && configProperties.get(\"ConditionalExpression\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.CONDITIONAL_EXPRESSION\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(DoStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"DoStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.DO_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(EnhancedForStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"EnhancedForStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.FOR_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(FieldDeclaration node) {\n\t\t\t\tif(configProperties.get(\"FieldDeclaration\")) {\n\t\t\t\t\tType nodeType = node.getType();\n\n\t\t\t\t\tfor(Object v : node.fragments()) {\n\t\t\t\t\t\tSimpleName name = ((VariableDeclarationFragment) v).getName();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSuperEntityClass fdEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\tnodeType,\n\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif(nodeType.isArrayType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isParameterizedType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isPrimitiveType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isSimpleType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + nodeType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ForStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"ForStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t), Entity.EntityType.FOR_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(IfStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"IfStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t), Entity.EntityType.IF_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ImportDeclaration node) {\n\t\t\t\tif(configProperties.get(\"ImportDeclaration\")) {\n\t\t\t\t\tName name = node.getName();\n\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\timportList.add(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(InfixExpression node){\n\t\t\t\tif(inMethod && configProperties.get(\"InfixExpression\")) {\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnode.getOperator().toString(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getLeftOperand().getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getLeftOperand().getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.INFIX_EXPRESSION\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(MethodDeclaration node) {\n\t\t\t\tinMethod = true;\n\t\t\t\tMethodDeclarationObject md = new MethodDeclarationObject();\n\n\t\t\t\tif(configProperties.get(\"MethodDeclaration\")) {\n\t\t\t\t\tSimpleName name = node.getName();\n\t\t\t\t\tboolean isStatic = false;\n\t\t\t\t\tboolean isAbstract = false;\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t}\n\n\t\t\t\t\t// is method declaration abstract?\n\t\t\t\t\tint mod = node.getModifiers();\n\t\t\t\t\tif(Modifier.isAbstract(mod)) {\n\t\t\t\t\t\tisAbstract = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// is method declaration static?\n\t\t\t\t\tif(Modifier.isStatic(mod)) {\n\t\t\t\t\t\tisStatic = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tIMethodBinding binding = node.resolveBinding();\n\n\t\t\t\t\t// get type of each parameter\n\t\t\t\t\tList<String> parameterTypes = new ArrayList<>();\n\t\t\t\t\tfor(Object obj : node.parameters()) {\n\t\t\t\t\t\tITypeBinding tb = ((SingleVariableDeclaration) obj).getType().resolveBinding();\n\t\t\t\t\t\tString fqn;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfqn = tb.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfqn = name.toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparameterTypes.add(fqn);\n\t\t\t\t\t}\n\n\t\t\t\t\tmd.setColumnNumber(cu.getColumnNumber(name.getStartPosition()));\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmd.setDeclaringClass(binding.getDeclaringClass().getQualifiedName());\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tmd.setDeclaringClass(null);\n\t\t\t\t\t}\n\t\t\t\t\tmd.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\t\t\t\t\tmd.setEndLine(cu.getLineNumber(node.getStartPosition() + node.getLength() - 1));\n\t\t\t\t\tmd.setFullyQualifiedName(fullyQualifiedName);\n\n\t\t\t\t\tmd.setIsAbstract(isAbstract);\n\t\t\t\t\tmd.setIsConstructor(node.isConstructor());\n\n\t\t\t\t\t// to avoid API from setting constructor return type to void\n\t\t\t\t\tif(node.isConstructor()) {\n\t\t\t\t\t\tmd.setReturnType(null);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmd.setReturnType(binding.getReturnType().getQualifiedName());\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tmd.setReturnType(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// get generic parameters\n\t\t\t\t\tList<String> genericParametersList = new ArrayList<>();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif(binding.isGenericMethod()) {\n\t\t\t\t\t\t\tmd.setIsGenericType(binding.isGenericMethod());\n\t\t\t\t\t\t\tfor(Object o : binding.getTypeParameters()) {\n\t\t\t\t\t\t\t\tgenericParametersList.add(o.toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tmd.setIsGenericType(false);\n\t\t\t\t\t}\n\n\t\t\t\t\tmd.setGenericParametersList(genericParametersList);\n\t\t\t\t\tmd.setIsStatic(isStatic);\n\t\t\t\t\tmd.setIsVarargs(node.isVarargs());\n\t\t\t\t\tmd.setLineNumber(cu.getLineNumber(name.getStartPosition()));\n\t\t\t\t\tmd.setName(name.toString());\n\t\t\t\t\tmd.setNumberOfCharacters(node.getLength());\n\t\t\t\t\tmd.setParametersList(node.parameters());\n\t\t\t\t\tmd.setParameterTypesList(parameterTypes);\n\t\t\t\t\tmd.setStartCharacter(name.getStartPosition());\n\n\t\t\t\t\tif(node.thrownExceptionTypes().size() > 0) {\n\t\t\t\t\t\tfor(Object o : node.thrownExceptionTypes()) {\n\t\t\t\t\t\t\tmd.addThrowsException(o.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tentityStack.push(md);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic void endVisit(MethodDeclaration node) {\n\t\t\t\tMethodDeclarationObject temp = (MethodDeclarationObject) entityStack.pop();\n\n\t\t\t\tif(configProperties.get(\"MethodDeclaration\")) {\n\t\t\t\t\ttemp.setComplexities();\n\t\t\t\t\ttemp.setMethodDeclarationNames();\n\t\t\t\t\ttemp.setMethodInvocationNames();\n\t\t\t\t\tentityStack.peek().addEntity(temp, Entity.EntityType.METHOD_DECLARATION);\n\t\t\t\t}\n\n\t\t\t\tinMethod = false;\n\t\t\t}\n\n\t\t\tpublic boolean visit(MethodInvocation node) {\n\t\t\t\tif(configProperties.get(\"MethodInvocation\")) {\n\t\t\t\t\tSimpleName name = node.getName();\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t}\n\n\t\t\t\t\t// get declaring class\n\t\t\t\t\tIMethodBinding binding = node.resolveMethodBinding();\n\t\t\t\t\tString declaringClass;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdeclaringClass = binding.getDeclaringClass().getQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tdeclaringClass = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// get calling class\n\t\t\t\t\tString callingClass;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcallingClass = node.getExpression().resolveTypeBinding().getQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tcallingClass = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// get argument types\n\t\t\t\t\tList<String> argumentTypes = new ArrayList<>();\n\t\t\t\t\tfor(Object t : node.arguments()) {\n\t\t\t\t\t\tITypeBinding tb = ((Expression)t).resolveTypeBinding();\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\targumentTypes.add(tb.getQualifiedName());\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\targumentTypes.add(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tMethodInvocationObject mio = new MethodInvocationObject();\n\t\t\t\t\tmio.setName(name.toString());\n\t\t\t\t\tmio.setFullyQualifiedName(fullyQualifiedName);\n\t\t\t\t\tmio.setDeclaringClass(declaringClass);\n\t\t\t\t\tmio.setCallingClass(callingClass);\n\t\t\t\t\tmio.setArguments(node.arguments());\n\t\t\t\t\tmio.setArgumentTypes(argumentTypes);\n\t\t\t\t\tmio.setLineNumber(cu.getLineNumber(name.getStartPosition()));\n\t\t\t\t\tmio.setEndLine(cu.getLineNumber(node.getStartPosition() + node.getLength() - 1));\n\t\t\t\t\tmio.setStartCharacter(name.getStartPosition());\n\t\t\t\t\tmio.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\t\t\t\t\tmio.setColumnNumber(cu.getColumnNumber(name.getStartPosition()));\n\t\t\t\t\tentityStack.peek().addEntity(mio, Entity.EntityType.METHOD_INVOCATION);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(PackageDeclaration node){\n\t\t\t\tif(configProperties.get(\"PackageDeclaration\")) {\n\t\t\t\t\tName name = node.getName();\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tpackageObject = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tnode.getName().toString(),\n\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(SingleVariableDeclaration node) {\n\t\t\t\tif(configProperties.get(\"SingleVariableDeclaration\")) {\n\t\t\t\t\tSimpleName name = node.getName();\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t}\n\n\t\t\t\t\tSuperEntityClass svdEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\tnode.getType(),\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t);\n\n\t\t\t\t\tif(node.getType().isArrayType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isParameterizedType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isPrimitiveType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isSimpleType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isUnionType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.UNION);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + node.getType());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(SwitchStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"SwitchStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tSuperEntityClass sso = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t);\n\n\t\t\t\t\tList<SuperEntityClass> switchCaseList = new ArrayList<>();\n\n\t\t\t\t\tfor(Object s : node.statements()) {\n\t\t\t\t\t\tif(s instanceof SwitchCase) {\n\t\t\t\t\t\t\tString expression;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\texpression = ((SwitchCase) s).getExpression().toString();\n\t\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\t\texpression = \"Default\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitchCaseList.add(\n\t\t\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpression,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(((SwitchCase) s).getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(((SwitchCase)s).getStartPosition())\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsso.addEntities(switchCaseList, Entity.EntityType.SWITCH_CASE);\n\t\t\t\t\tentityStack.peek().addEntity(sso, Entity.EntityType.SWITCH_STATEMENT);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ThrowStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"ThrowStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.THROW_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(TryStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"TryStatement\")) {\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Try Statement\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.TRY_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(TypeDeclaration node) {\n\t\t\t\tJavaClass co = new JavaClass();\n\n\t\t\t\tif(configProperties.get(\"TypeDeclaration\")) {\n\t\t\t\t\tif(node.isInterface()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tint startLine = cu.getLineNumber(node.getStartPosition());\n\t\t\t\t\t\tint endLine = cu.getLineNumber(node.getStartPosition() + node.getLength() - 1);\n\n\t\t\t\t\t\tITypeBinding binding = node.resolveBinding();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = node.getName().getFullyQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = node.getName().toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(containingClass.isEmpty()) {\n\t\t\t\t\t\t\tcontainingClass = node.getName().toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tco.setIsAnonymous(binding.isAnonymous());\n\t\t\t\t\t\tco.setColumnNumber(cu.getColumnNumber(node.getStartPosition()));\n\t\t\t\t\t\tco.setEndLine(endLine);\n\t\t\t\t\t\tco.setLineNumber(startLine);\n\t\t\t\t\t\tco.setName(node.getName().toString());\n\t\t\t\t\t\tco.setNumberOfCharacters(node.getLength());\n\t\t\t\t\t\tco.setFileName(fileLocation);\n\t\t\t\t\t\tco.setFullyQualifiedName(fullyQualifiedName);\n\n\t\t\t\t\t\t// get generic parameters\n\t\t\t\t\t\tList<String> genericParametersList = new ArrayList<>();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif(binding.isGenericType()) {\n\t\t\t\t\t\t\t\tco.setIsGenericType(binding.isGenericType());\n\t\t\t\t\t\t\t\tfor(Object o : binding.getTypeParameters()) {\n\t\t\t\t\t\t\t\t\tgenericParametersList.add(o.toString());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tco.setIsGenericType(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tco.setGenericParametersList(genericParametersList);\n\n\t\t\t\t\t\tco.setHasComments(hasComments);\n\t\t\t\t\t\tco.setImportList(importList);\n\t\t\t\t\t\tco.setPackage(packageObject);\n\t\t\t\t\t\tco.setSourceCode(getClassSourceCode(fileLocation, startLine, endLine));\n\t\t\t\t\t\tco.setStartCharacter(node.getStartPosition());\n\t\t\t\t\t\tco.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\n\t\t\t\t\t\tif(node.getSuperclassType() != null) {\n\t\t\t\t\t\t\tco.setSuperClass(node.getSuperclassType().toString());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(node.superInterfaceTypes().size() > 0) {\n\t\t\t\t\t\t\tfor(Object o : node.superInterfaceTypes()) {\n\t\t\t\t\t\t\t\tco.addImplementsInterface(o.toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tint mod = node.getModifiers();\n\t\t\t\t\t\tif(Modifier.isAbstract(mod)) {\n\t\t\t\t\t\t\tco.setIsAbstract(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tco.setIsAbstract(false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tentityStack.push(co);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic void endVisit(TypeDeclaration node) {\n\t\t\t\tJavaClass temp = (JavaClass) entityStack.pop();\n\n\t\t\t\tif(!node.isInterface() && configProperties.get(\"TypeDeclaration\")) {\n\t\t\t\t\t// check if current class is an inner class\n\t\t\t\t\tboolean isInnerClass = true;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tentityStack.peek();\n\t\t\t\t\t} catch (EmptyStackException e) {\n\t\t\t\t\t\tisInnerClass = false;\n\t\t\t\t\t}\n\t\t\t\t\ttemp.setIsInnerClass(isInnerClass);\n\n\t\t\t\t\ttemp.setComplexities();\n\t\t\t\t\ttemp.setMethodDeclarationNames();\n\t\t\t\t\ttemp.setMethodInvocationNames();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif(!containingClass.isEmpty()) {\n\t\t\t\t\t\t\ttemp.setContainingClass(containingClass);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tentityStack.peek().addEntity(temp, Entity.EntityType.CLASS);\n\n\t\t\t\t\t} catch (EmptyStackException e) {\n\t\t\t\t\t\tcontainingClass = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tfileModel.addJavaClass(temp);\n\t\t\t\t}\n\n\t\t\t\thasComments = false;\n\t\t\t}\n\n\t\t\tpublic boolean visit(VariableDeclarationStatement node) {\n\t\t\t\tif(configProperties.get(\"VariableDeclarationStatement\")) {\n\t\t\t\t\tType nodeType = node.getType();\n\n\t\t\t\t\tfor(Object v : node.fragments()) {\n\t\t\t\t\t\tSimpleName name = ((VariableDeclarationFragment) v).getName();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSuperEntityClass vdsEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\tnodeType,\n\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif(nodeType.isArrayType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isParameterizedType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isPrimitiveType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isSimpleType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + nodeType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(VariableDeclarationExpression node) {\n\t\t\t\tif(configProperties.get(\"VariableDeclarationExpression\")) {\n\t\t\t\t\tType nodeType = node.getType();\n\n\t\t\t\t\tfor(Object v : node.fragments()) {\n\t\t\t\t\t\tSimpleName name = ((VariableDeclarationFragment) v).getName();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSuperEntityClass vdeEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\tnodeType,\n\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif(nodeType.isArrayType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isParameterizedType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isPrimitiveType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isSimpleType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + nodeType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(WhileStatement node){\n\t\t\t\tif(inMethod && configProperties.get(\"WhileStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.WHILE_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(WildcardType node) {\n\t\t\t\tif(inMethod && configProperties.get(\"WildcardType\")) {\n\t\t\t\t\tSuperEntityClass wo = new SuperEntityClass();\n\t\t\t\t\two.setName(\"Wildcard\");\n\n\t\t\t\t\tString bound;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tbound = node.getBound().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tbound = \"none\";\n\t\t\t\t\t}\n\n\t\t\t\t\two.setBound(bound);\n\t\t\t\t\two.setType(((ParameterizedType) node.getParent()).getType());\n\t\t\t\t\two.setLineNumber(cu.getLineNumber(node.getStartPosition()));\n\t\t\t\t\two.setColumnNumber(cu.getColumnNumber(node.getStartPosition()));\n\t\t\t\t\tentityStack.peek().addEntity(wo, Entity.EntityType.WILDCARD);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t});\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}",
"public void execute()\n throws BuildException\n {\n if (_resinHome == null)\n throw new BuildException(\"resinHome is required by jspc\");\n\n if (_rootDirectory == null)\n throw new BuildException(\"rootDirectory is required by jspc\");\n\n File resinJar = new File(_resinHome,\n \"lib\" + File.separatorChar + \"resin.jar\");\n\n if (! resinJar.exists())\n throw new BuildException(\"resinHome '\"\n + _resinHome\n + \"' does not appear to be valid\");\n\n Java java = new Java(this);\n java.setFailonerror(true);\n java.setFork(true);\n java.setJar(resinJar);\n\n List<String> args = new ArrayList<String>();\n args.add(\"jspc\");\n args.add(\"-app-dir\");\n args.add(_rootDirectory.getPath());\n\n for (String arg : args)\n java.createArg().setLine(arg);\n\n log(java.getCommandLine().toString(), _level.intValue());\n\n java.executeJava();\n }",
"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 <egagnon@j-meg.com> 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 }",
"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 void generateAndwriteToFile() {\n List<GeneratedJavaFile> gjfs = generate();\n if (gjfs == null || gjfs.size() == 0) {\n return;\n }\n for (GeneratedJavaFile gjf : gjfs) {\n writeToFile(gjf);\n }\n }",
"private boolean exportResult(){\n System.out.println(\"Writing to \" + \"out_\" + inputFile);\n return true;\n }",
"@Test\n @Ignore\n\tpublic void compareCPPFiles() throws IOException \n\t{\n\t\tFile javaDir = new File(\"bigTest/java\");\n\t\tFile cppDir = new File(\"bigTest/cpp\");\n\n\t\tjavaDir.mkdirs();\n\t\tcppDir.mkdirs();\n\n\t\tint nCpp = 0;\n\t\tfor (File f : cppDir.listFiles())\n\t\t\tif (f.isFile() && GeoTessModel.isGeoTessModel(f))\n\t\t\t\t++nCpp;\n\n\t\tArrayList<String> files = new ArrayList<String>(100);\n\n\t\tfor (File javaFile : javaDir.listFiles())\n\t\t\tif (javaFile.isFile() && GeoTessModel.isGeoTessModel(javaFile))\n\t\t\t\tfiles.add(javaFile.getCanonicalPath());\n\n\t\tCollections.sort(files);\n\n\t\tint nCompared = 0;\n\n\t\tfor (String s : files)\n\t\t{\n\t\t\tFile javaFile = new File(s);\n\t\t\tFile cppFile = new File(cppDir, javaFile.getName());\n\t\t\t\n\t\t\t//System.out.println(javaFile.getCanonicalPath());\n\t\t\t\n\t\t\tif (cppFile.exists())\n\t\t\t{\n\t\t\t\tGeoTessModel javamodel = new GeoTessModel(javaFile, \"../../resources/permanent_files/\",\n\t\t\t\t\t\tOptimizationType.MEMORY);\n\n\t\t\t\tGeoTessModel cppmodel = new GeoTessModel(cppFile, \"../../resources/permanent_files/\",\n\t\t\t\t\t\tOptimizationType.MEMORY);\n\n\t\t\t\tboolean eq = javamodel.equals(cppmodel);\n\n\t\t\t\t//System.out.printf(\"Comparing files %s and %s%n\", javaFile.getCanonicalFile(), cppFile.getCanonicalPath());\n\n\t\t\t\tif (!eq)\n\t\t\t\t\tSystem.out.printf(\"File %s are not equal%n\", s);\n\n\t\t\t\tassertTrue(eq);\n\n\t\t\t\t++nCompared;\n\t\t\t}\n\n\t\t}\n\n//\t\tSystem.out.printf(\" compareCPPFiles(): Njava=%d Ncpp=%d Ncomparisons=%d%n\", \n//\t\t\t\tfiles.size(), nCpp, nCompared);\n\t}",
"private boolean writeToFile() {\n\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\n\t\ttry {\n\t\t\tString content = getAsXmlString();\n\n\t\t\tfw = new FileWriter(FILENAME + \"w\");\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\tbw.write(content);\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (bw != null)\n\t\t\t\t\tbw.close();\n\n\t\t\t\tif (fw != null)\n\t\t\t\t\tfw.close();\n\n\t\t\t\treturn true;\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public boolean exportClasses(File target) {\n \n if (projectData != null){\n\n return exportClasses.exportAnnotatedClasses(projectData, target);\n }\n return false;\n\n }",
"public boolean process(File file) throws IOException;",
"@Test(timeout = 4000)\n public void test083() throws Throwable {\n Label label0 = new Label();\n FileSystemHandling.appendStringToFile((EvoSuiteFile) null, \"oc[MfnZM[~MHOK iO\");\n ClassWriter classWriter0 = new ClassWriter((-2450));\n classWriter0.newInteger((-2450));\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n classWriter0.newConst(\"Code\");\n String[] stringArray0 = new String[9];\n stringArray0[0] = \"Fj)3/|(;sZXz$\";\n stringArray0[1] = \"Code\";\n stringArray0[2] = \"oc[MfnZM[~MHOK iO\";\n stringArray0[3] = \"~)yCTRxQ#s$y[Ly%\";\n stringArray0[4] = \"Fj)3/|(;sZXz$\";\n stringArray0[5] = \"oc[MfnZM[~MHOK iO\";\n stringArray0[6] = \"Code\";\n stringArray0[7] = \"oc[MfnZM[~MHOK iO\";\n stringArray0[8] = \"Code\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 3, \"\\\".3t\\\"0\", \"~)yCTRxQ#s$y[Ly%\", \"\\\".3t\\\"0\", stringArray0, true, false);\n Label label1 = new Label();\n byte[] byteArray0 = new byte[0];\n label1.resolve(methodWriter0, 168, byteArray0);\n classWriter0.newNameTypeItem(\"Code\", \"Fj)3/|(;sZXz$\");\n Label label2 = new Label();\n methodWriter0.visitFieldInsn(3, \"oc[MfnZM[~MHOK iO\", \"oc[MfnZM[~MHOK iO\", \"*/TEiGBLds&\");\n methodWriter0.visitLdcInsn(\"java/lang/dyn/Dynamic\");\n }",
"public boolean compiling()\n {\n return this.compiling.get();\n }",
"private void outputFile() {\n // Define output file name\n Scanner sc = new Scanner(System.in);\n System.out.println(\"What do you want to call this file?\");\n String name = sc.nextLine();\n\n // Output to file\n Path outputFile = Paths.get(\"submissions/\" + name + \".java\");\n try {\n Files.write(outputFile, imports);\n if (imports.size() > 0)\n Files.write(outputFile, Collections.singletonList(\"\"), StandardOpenOption.APPEND);\n Files.write(outputFile, lines, StandardOpenOption.APPEND);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public static void main(String[] args) throws IOException{\n\tFile data = new File(\"src/example.dat\");\r\n\r\n\t DataOutputStream out = new DataOutputStream(\r\n\t\t\t\t\t\t\t new BufferedOutputStream(\r\n\t\t\t\t\t\t\t new FileOutputStream(data)));\r\n\t out.writeInt(5);\r\n\t out.writeChar('c');\r\n\t out.writeBoolean(true);\r\n\t out.writeUTF(\"Java\");\r\n\t out.writeChar('\\n');\r\n\t out.writeChars(\"End of file\");\r\n\t out.close();\r\n }",
"public static void main(String[] args) {\n String file = System.getProperty(\"user.dir\") + \"\\\\src\\\\\" + TaskB.class.getName().replace(\".\", File.separator);\n String fileIn = file + \".java\";\n String fileOut = file + \".txt\";\n StringBuilder convert = new StringBuilder();\n try (BufferedReader reader = new BufferedReader(\n new FileReader(fileIn))) {\n Boolean commentOne = false;\n Boolean commentTwo = false;\n String chars = \"\";\n\n // text\n\n while (reader.ready()) {\n if (reader.ready()) {\n char currchar = (char) reader.read();\n chars = chars + currchar;\n\n if (chars.equals(\"/\" + \"*\")) {\n commentOne = true;\n commentTwo = true;\n convert.deleteCharAt(convert.length() - 1);\n }\n\n if (chars.equals(\"/\" + \"/\")) {\n commentOne = true;\n commentTwo = false;\n convert.deleteCharAt(convert.length() - 1);\n }\n\n // text\n\n if (!commentOne) {\n convert.append(chars.substring(chars.length() - 1));\n }\n\n if (chars.equals(\"\\r\\n\") && commentOne && !commentTwo) {\n commentOne = false;\n commentTwo = false;\n convert.append(chars);\n }\n\n if (chars.equals(\"*\" + \"/\") && commentOne && commentTwo) {\n commentOne = false;\n commentTwo = false;\n }\n chars = Character.toString(currchar);\n }\n\n /*\nmay be the end\n */\n }\n PrintWriter out = new PrintWriter(new FileWriter(fileOut));\n System.out.print(convert);\n out.print(convert);\n out.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n // the end!\n }\n }",
"@Test(timeout = 4000)\n public void test074() throws Throwable {\n FileSystemHandling fileSystemHandling0 = new FileSystemHandling();\n ClassWriter classWriter0 = new ClassWriter((-4015));\n FileSystemHandling.setPermissions((EvoSuiteFile) null, false, false, false);\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \"dVw2Z7M){e/Y(#j\", \"dVw2Z7M){e/Y(#j\", \"dVw2Z7M){e/Y(#j\", (String[]) null, false, true);\n MethodWriter methodWriter1 = classWriter0.lastMethod;\n int int0 = 191;\n Label label0 = new Label();\n FieldWriter fieldWriter0 = classWriter0.firstField;\n Label label1 = new Label();\n Label label2 = new Label();\n methodWriter0.visitLabel(label2);\n Attribute attribute0 = new Attribute(\"MTLxVk>zR~^G\");\n ClassReader classReader0 = null;\n try {\n classReader0 = new ClassReader(\"+5vu,cm9U5+I\");\n fail(\"Expecting exception: IOException\");\n \n } catch(Throwable e) {\n //\n // Class not found\n //\n verifyException(\"org.objectweb.asm.jip.ClassReader\", e);\n }\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 static void parse(FileWriter classCsvWriter, FileWriter methodCsvWriter, String path) {\n try {\n File[] fileArray = new File(path).listFiles();\n if (fileArray != null) {\n for (File f : fileArray) {\n if (f.getName().endsWith(\".java\")) { // to deal with the .txt files.\n ParsedClass pc = Parser.parse(f); // to read the files\n\n System.out.println(\"Parsing class : \" + pc.getClassName() + \" ...\");\n\n classCsvWriter.append(pc.getPath());\n classCsvWriter.append(\",\");\n classCsvWriter.append(pc.getClassName());\n classCsvWriter.append(\",\");\n classCsvWriter.append(Integer.toString(pc.getClassLoc()));\n classCsvWriter.append(\",\");\n classCsvWriter.append(Integer.toString(pc.getClassCloc()));\n classCsvWriter.append(\",\");\n classCsvWriter.append(Double.toString(pc.getClassDc()));\n classCsvWriter.append(\",\");\n classCsvWriter.append(Integer.toString(pc.getClassWmc()));\n classCsvWriter.append(\",\");\n classCsvWriter.append(Double.toString(pc.getClassBc()));\n classCsvWriter.append(\"\\n\");\n\n for (Method m : pc.getMethods()) {\n System.out.println(\"Parsing method : \" + m.getName() + \" ...\");\n methodCsvWriter.append(m.getPath());\n methodCsvWriter.append(\",\");\n methodCsvWriter.append(pc.getClassName());\n methodCsvWriter.append(\",\");\n methodCsvWriter.append(m.getName());\n if (m.getArguments().compareTo(\"\") != 0) {\n methodCsvWriter.append(\"_\");\n methodCsvWriter.append(m.getArguments());\n }\n methodCsvWriter.append(\",\");\n methodCsvWriter.append(Integer.toString(m.getLoc()));\n methodCsvWriter.append(\",\");\n methodCsvWriter.append(Integer.toString(m.getCloc()));\n methodCsvWriter.append(\",\");\n methodCsvWriter.append(Double.toString(m.getDc()));\n methodCsvWriter.append(\",\");\n methodCsvWriter.append(Integer.toString(m.getCc()));\n methodCsvWriter.append(\",\");\n methodCsvWriter.append(Double.toString(m.getBc()));\n methodCsvWriter.append(\"\\n\");\n }\n } else if (!f.getName().contains(\".\")) {\n System.out.println(\"File found : \" + f.getName() + \" ...\");\n parse(classCsvWriter, methodCsvWriter, path + \"/\" + f.getName());\n }\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void checkCompleteCompilationStatus(String classpath) {\n\t\tpluginConfiguration.getLog().info(\"Check full project compilation status with classpath: \" + classpath);\n\t\tGeneratedSourceCompiler compilerPortFacadeImpl = GeneratedSourceCompilerFactory.getGeneratedSourceCompiler(\n\t\t\t\tpluginConfiguration.getLog(), null, pluginConfiguration.getTargetSourceFolder(),\n\t\t\t\tpluginConfiguration.getTargetClassFolder(), classpath, pluginConfiguration.getSourceEncoding());\n\t\tassertTrue(compilerPortFacadeImpl.compileAllSources(), \"Full project compilation status\");\n\t}",
"public static void main(String[] args) {\n String filePath=args[0];\n Parser parser = new Parser(filePath);\n Code code = new Code();\n SymbolTable symbol = new SymbolTable();\n initSymbol(filePath, parser, symbol);\n String fileOutputPath=filePath.replace(\".asm\",\".hack\");\n Parser parser1 = new Parser(filePath);\n\n try {\n BufferedWriter writer = new BufferedWriter(new FileWriter(fileOutputPath ,true));\n PrintWriter emptyFile = new PrintWriter(fileOutputPath);\n emptyFile.print(\"\");\n emptyFile.close();\n\n //count the num of var in the program\n int numVariables = 16;\n while (parser1.hasMoreCommands()) {\n parser1.advance();\n String type = parser1.commandType();\n StringBuilder binCommand=new StringBuilder();\n switch (type) {\n case \"A_COMMAND\":\n //get the symbol\n String commandSymbol= parser1.symbol();\n Integer address=0;\n if(isNumeric(commandSymbol)){\n address=Integer.parseInt(commandSymbol);\n }\n //check if the symbol don't exist in the symbol Table and add it\n else if (!symbol.contain(commandSymbol)) {\n symbol.addEntry(commandSymbol, numVariables);\n address=symbol.getAddress(commandSymbol);\n numVariables++;\n }\n //get the symbol value from the symbol table\n else if(symbol.contain((commandSymbol))){\n address=symbol.getAddress(commandSymbol);\n }\n\n binCommand.append(Integer.toBinaryString(address));\n int j=binCommand.length();\n for (int i = 0; i < 16 - j; i++) {\n binCommand.insert(0, \"0\");\n }\n writer.append(binCommand.toString());\n writer.append('\\n');\n binCommand.setLength(0);\n break;\n case \"C_COMMAND\":\n //write the c command\n binCommand.append(\"111\");\n binCommand.append(code.comp(parser1.comp()));\n binCommand.append(code.dest(parser1.dest()));\n binCommand.append(code.jump(parser1.jump()));\n writer.append(binCommand.toString());\n writer.append('\\n');\n binCommand.setLength(0);\n break;\n }\n }\n\n writer.close();\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }",
"public void generateCode(ClassScope classScope, ClassFile classFile) {\n\t\t\n\t\tint problemResetPC = 0;\n\t\tclassFile.codeStream.wideMode = false; // reset wideMode to false\n\t\tif (this.ignoreFurtherInvestigation) {\n\t\t\t// method is known to have errors, dump a problem method\n\t\t\tif (this.binding == null)\n\t\t\t\treturn; // handle methods with invalid signature or duplicates\n\t\t\tint problemsLength;\n\t\t\tIProblem[] problems =\n\t\t\t\tthis.scope.referenceCompilationUnit().compilationResult.getProblems();\n\t\t\tIProblem[] problemsCopy = new IProblem[problemsLength = problems.length];\n\t\t\tSystem.arraycopy(problems, 0, problemsCopy, 0, problemsLength);\n\t\t\tclassFile.addProblemMethod((/*@OwnPar*/ /*@NoRep*/ AbstractMethodDeclaration)this, this.binding, problemsCopy);\n\t\t\treturn;\n\t\t}\n\t\t// regular code generation\n\t\ttry {\n\t\t\tproblemResetPC = classFile.contentsOffset;\n\t\t\tthis.generateCode(classFile);\n\t\t} catch (AbortMethod e) {\n\t\t\t// a fatal error was detected during code generation, need to restart code gen if possible\n\t\t\tif (e.compilationResult == CodeStream.RESTART_IN_WIDE_MODE) {\n\t\t\t\t// a branch target required a goto_w, restart code gen in wide mode.\n\t\t\t\ttry {\n\t\t\t\t\tclassFile.contentsOffset = problemResetPC;\n\t\t\t\t\tclassFile.methodCount--;\n\t\t\t\t\tclassFile.codeStream.wideMode = true; // request wide mode \n\t\t\t\t\tthis.generateCode(classFile); // restart method generation\n\t\t\t\t} catch (AbortMethod e2) {\n\t\t\t\t\tint problemsLength;\n\t\t\t\t\tIProblem[] problems =\n\t\t\t\t\t\tthis.scope.referenceCompilationUnit().compilationResult.getAllProblems();\n\t\t\t\t\tIProblem[] problemsCopy = new IProblem[problemsLength = problems.length];\n\t\t\t\t\tSystem.arraycopy(problems, 0, problemsCopy, 0, problemsLength);\n\t\t\t\t\tclassFile.addProblemMethod((/*@OwnPar*/ /*@NoRep*/ AbstractMethodDeclaration)this, this.binding, problemsCopy, problemResetPC);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// produce a problem method accounting for this fatal error\n\t\t\t\tint problemsLength;\n\t\t\t\tIProblem[] problems =\n\t\t\t\t\tthis.scope.referenceCompilationUnit().compilationResult.getAllProblems();\n\t\t\t\tIProblem[] problemsCopy = new IProblem[problemsLength = problems.length];\n\t\t\t\tSystem.arraycopy(problems, 0, problemsCopy, 0, problemsLength);\n\t\t\t\tclassFile.addProblemMethod((/*@OwnPar*/ /*@NoRep*/ AbstractMethodDeclaration)this, this.binding, problemsCopy, problemResetPC);\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.71809566",
"0.6323811",
"0.62346876",
"0.6232912",
"0.6222869",
"0.6151658",
"0.5978224",
"0.58254117",
"0.5581913",
"0.55790347",
"0.55579615",
"0.5553373",
"0.55088353",
"0.5383113",
"0.5360941",
"0.53520036",
"0.5346077",
"0.53183335",
"0.5317883",
"0.52963257",
"0.5293263",
"0.5291089",
"0.52669305",
"0.5249746",
"0.52268374",
"0.522431",
"0.5201336",
"0.51959217",
"0.51723576",
"0.5169852",
"0.5167575",
"0.5157238",
"0.5135163",
"0.51296854",
"0.50864184",
"0.50679743",
"0.50671476",
"0.5042124",
"0.5035582",
"0.5032243",
"0.50082886",
"0.49993485",
"0.4997345",
"0.49904943",
"0.49833387",
"0.4974218",
"0.49586844",
"0.49533576",
"0.49517047",
"0.49369565",
"0.49331373",
"0.4929939",
"0.4926706",
"0.49251205",
"0.4923328",
"0.49216604",
"0.49162441",
"0.4902383",
"0.48920712",
"0.4875392",
"0.48732585",
"0.48676705",
"0.48639268",
"0.4859191",
"0.48453298",
"0.48453298",
"0.48344836",
"0.4833701",
"0.48320737",
"0.4807987",
"0.47953352",
"0.47939703",
"0.47811103",
"0.47707546",
"0.47677296",
"0.47673795",
"0.47616595",
"0.47581708",
"0.47471547",
"0.4746925",
"0.4744169",
"0.47287408",
"0.4727708",
"0.4726374",
"0.4720697",
"0.47137514",
"0.4698175",
"0.4696188",
"0.46868575",
"0.46830946",
"0.46818787",
"0.46767324",
"0.46712342",
"0.4664536",
"0.46607214",
"0.46595517",
"0.4659062",
"0.46542072",
"0.46520427",
"0.46481895"
] | 0.7304744 | 0 |
Tries creating a new class and instantiating it. Returns an instance of that class if it is successful, or null if it fails. | private static Object createNewInstance(String implement, String header, String expression) {
// a feeble attempt at preventing arbitrary code execution
// by limiting expressions to a single statement.
// Otherwise the expression can be something like:
// f(); } Object f() { System.exit(0); return null
if (expression.contains(";"))
return null;
// since we might create multiple expressions, we need their names to be unique
String className = "MyExpression" + classNum++;
// if we compile the class susseccfully, try and instantiate it
if (writeAndCompile(className, implement, header, expression)) {
try {
File classFile = new File(path + className + ".class");
// load the class into the JVM, and try and get an instance of it
//Class<?> newClass = ClassLoader.getSystemClassLoader().loadClass(className);
URLClassLoader classLoader = URLClassLoader.newInstance(new URL[] { classFile.toURI().toURL() });
Class<?> newClass = Class.forName(className, true, classLoader);
// delete the class file, so we leave no trace
// this is okay because we already loaded the class
try {
classFile.delete();
// meh, we tried
} catch (Exception e) {}
return newClass.newInstance();
} catch (Exception e) {
e.printStackTrace();
//System.out.println("Couldn't load class");
return null;
}
} else {
System.out.println("Couldn't write / compile source");
}
// the class didn't compile
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Object createInstance() throws InstantiationException, IllegalAccessException {\n\t\treturn classType.newInstance();\n\t}",
"@Override\r\n\tpublic T createInstance() {\r\n\t\ttry {\r\n\t\t\treturn getClassType().newInstance();\r\n\t\t} catch (Exception e) {\r\n\t\t\tLogger.getLogger(AbstractCRUDBean.class.getSimpleName()).log(Level.ALL, e.getMessage());\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"Class createClass();",
"@SuppressWarnings(\"unchecked\")\n public T newInstance()\n throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n if (constructor_ == null) {\n constructor_ = getRawClass().getConstructor();\n }\n\n return (T)constructor_.newInstance();\n }",
"public T safeNewInstance() {\n try {\n return newInstance();\n } catch (NoSuchMethodException e) {\n throw new IllegalArgumentException(e);\n } catch (IllegalAccessException e) {\n throw new IllegalArgumentException(e);\n } catch (InvocationTargetException e) {\n throw new IllegalArgumentException(e);\n } catch (InstantiationException e) {\n throw new IllegalArgumentException(e);\n }\n }",
"public static Object createObject(String className) {\n try {\n Class<?> aClass = Class.forName(className);\n return createObject(aClass);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public static synchronized <T> T instantiate(Class<T> clazz) {\n try {\n return clazz.getDeclaredConstructor().newInstance();\n } catch (Exception e) {\n throw new FlywayException(\"Unable to instantiate class \" + clazz.getName() + \" : \" + e.getMessage(), e);\n }\n }",
"@SuppressWarnings({\"unchecked\"})\n // Must be synchronized for the Maven Parallel Junit runner to work\n public static synchronized <T> T instantiate(String className, ClassLoader classLoader) {\n try {\n return (T) Class.forName(className, true, classLoader).getDeclaredConstructor().newInstance();\n } catch (Exception e) {\n throw new FlywayException(\"Unable to instantiate class \" + className + \" : \" + e.getMessage(), e);\n }\n }",
"private static Object getInstance( final String className ) {\n if( className == null ) return null;\n return java.security.AccessController.doPrivileged(\n new java.security.PrivilegedAction<Object>() {\n public Object run() {\n try {\n ClassLoader cl =\n Thread.currentThread().getContextClassLoader();\n if (cl == null)\n cl = ClassLoader.getSystemClassLoader();\n return Class.forName( className, true,cl).newInstance();\n } catch( Exception e ) {\n new ErrorManager().error(\n \"Error In Instantiating Class \" + className, e,\n ErrorManager.GENERIC_FAILURE );\n }\n return null;\n }\n }\n );\n }",
"Instance createInstance();",
"protected Object createBeanMatchingType(MappingContext mappingContext) {\n // clazz is never null given the only path that leads to this method already performs that check\n final Class<?> clazz = mappingContext.getTypeInformation().getSafeToWriteClass();\n try {\n return clazz.getDeclaredConstructor().newInstance();\n } catch (ReflectiveOperationException e) {\n throw new ConfigMeMapperException(mappingContext, \"Could not create object of type '\"\n + clazz.getName() + \"'. It is required to have a default constructor\", e);\n }\n }",
"NamedClass createNamedClass();",
"static <T> T instantiate(Class<T> type) {\n\n\n try {\n final Constructor<T> constructor = type.getDeclaredConstructor();\n return constructor.newInstance();\n } catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {\n e.printStackTrace();\n }\n\n\n return null;\n }",
"private Airbag safeInstantiateAirbag() {\n Airbag airbag;\n\n try { \n // Check if airbag module is available\n // It is not safe to instantiate or use a type from an optional module.\n airbag = new Airbag();\n }\n catch (NoClassDefFoundError exception) {\n // The airbag module is not available\n airbag = null;\n }\n\n return airbag;\n }",
"public Game getNewInstance() {\n try {\n return classObj.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(\"Error generating \" + this + \" game\");\n }\n }",
"public static Object createObject( String className )\n throws WfControllerException\n {\n Object object = null;\n try\n {\n Class classDefinition = Class.forName( className );\n object = classDefinition.newInstance();\n }\n catch ( InstantiationException e )\n {\n WfControllerException controlException = new WfControllerException( e.getMessage() );\n throw controlException;\n }\n catch ( IllegalAccessException e )\n {\n WfControllerException controlException = new WfControllerException( e.getMessage() );\n throw controlException;\n }\n catch ( ClassNotFoundException e )\n {\n WfControllerException controlException = new WfControllerException( e.getMessage() );\n throw controlException;\n }\n return object;\n }",
"public Object newInstance( Class<?> clazz )\n {\n return newInstance( Thread.currentThread().getContextClassLoader(),\n clazz );\n \n }",
"public T newInstance();",
"public static <T> T createObject(Class<T> clas) throws InstantiationException {\n return createObject(clas, null); //If there's no arguments then it should be null.\n }",
"private Decryptor createDecryptor(String decryptorClass) {\n\t\tif(decryptor != null) {\n\t\t\treturn decryptor;\n\t\t}\n\n\t\tif (logger.isTraceEnabled()) {\n\t\t\tlogger.trace(\"creating decryptor {}\", decryptorClass);\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tClass<?> typeClass = Class.forName(decryptorClass);\n\t\t\t\n\t\t\tif (!typeClass.isInterface()) {\n\t\t\t\treturn (Decryptor) typeClass.getConstructor().newInstance();\n\t\t\t}else {\n\t\t\t\tlogger.error(\"Please specify an implementing class of com.networknt.decrypt.Decryptor.\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(e.getMessage());\n\t\t\tthrow new RuntimeException(\"Unable to construct the decryptor due to lack of decryption password.\", e);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"private static Object getObjectInstance(String className) {\n\t\ttry {\n\t\t\treturn Class.forName(className).newInstance();\n\t\t} catch (InstantiationException e) {\n\t\t\tlogger.error(\"(InstantiationException) Unable to instanziate the class : \" + className, e);\n\t\t} catch (IllegalAccessException e) {\n\t\t\tlogger.error(\"(IllegalAccessException) Unable to instanziate the class : \" + className, e);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tlogger.error(\"(ClassNotFoundException) Unable to instanziate the class : \" + className, e);\n\t\t} catch (Throwable e) {\n\t\t\tlogger.error(\"(Generic Exception) Unable to instanziate the class : \" + className, e);\n\t\t}\n\t\treturn null;\n\t}",
"public Object createNew(String typename, Object... args) \n\t\tthrows \tIllegalAccessException, \n\t\t\tInstantiationException, \n\t\t\tClassNotFoundException,\n\t\t\tNoSuchMethodException,\n\t\t\tInvocationTargetException \n\t{\n\t\tswitch(args.length) \n\t\t{\n\t\tcase 1 : return Class.forName(typename).getConstructor(args[0].getClass()).newInstance(args[0]);\n\t\tcase 2 : return Class.forName(typename).getConstructor(args[0].getClass(), args[1].getClass()).\n\t\t\tnewInstance(args[0], args[1]);\n\t\t}\n\t\treturn null;\n\t}",
"public static Object createObject(String className) throws Exception {\n return createObject(Class.forName(className));\n }",
"public static Object createInstance(String className, Class<?>[] argumentTypes, Object[] arguments) \n {\n if(className == null) \n {\n throw new IllegalArgumentException(\"ClassName must be specified\");\n }\n if(argumentTypes == null) \n {\n throw new IllegalAnnotationException(\"ArgumentTypes must be specified. Use empty array if no arguments\");\n }\n if(arguments == null) \n {\n throw new IllegalAnnotationException(\"Arguments must be specified. Use empty array if no arguments\");\n }\n try \n {\n Class<?> implClass = loadClass(className); \n Constructor<?> constructor = findConstructor(implClass, argumentTypes);\n return constructor.newInstance(arguments);\n }\n catch (Exception e) \n {\n throw new RuntimeException(\n \"Could not create new instance of \" + className + \", missing package from classpath?\", e);\n } \n }",
"public static ModelLearnable newInstancebyClassName(Class modelClassName) {\r\n try {\r\n return (ModelLearnable) modelClassName.newInstance();\r\n } catch (InstantiationException e) {\r\n e.printStackTrace();\r\n } catch (IllegalAccessException e) {\r\n e.printStackTrace();\r\n }\r\n return null;\r\n }",
"protected T createNewBean() throws InstantiationException {\n try {\n return beanClass.getConstructor().newInstance();\n } catch (final InstantiationException |\n IllegalAccessException |\n IllegalArgumentException |\n InvocationTargetException |\n NoSuchMethodException |\n SecurityException e) {\n // fold it all into one type of exception\n throw new InstantiationException(e.getMessage());\n }\n }",
"private T createInternalT(Class type) {\n\t\ttry {\n\t\t return (T)(type.newInstance());\n\t\t} catch( Exception e ) {\n\t\t return null;\n\t\t}\n\t}",
"public T Create(String input) {\n\t\t\n\t\tArrayList<String> params = ParseInput(input);\n\n\t\tClass<T> cls = classMap.get(params.get(0));\n\n\t\tif(cls == null) {\n\t\t\t//Class is not registered, error.\n\t\t\tMain.error(params.get(0) + \" is not recognized by Factory\");\n\t\t}\n\n\t\ttry{\n\t\t Method make = cls.getDeclaredMethod(\"Make\",new Class[] {ArrayList.class});\n\t\t T ret = cls.cast(make.invoke(null,new Object[]{params}));\n\t\t return ret;\n\t\t} catch(java.lang.NoSuchMethodException e){\n\t\t\tMain.error(params.get(0) + \" does not have required Make method\");\n\t\t} catch(java.lang.IllegalAccessException e){\n\t\t\tMain.error(\"Access problems with constructor for \" +\n\t\t\t\t params.get(0));\n\t\t} catch(java.lang.reflect.InvocationTargetException e){\n\t\t Main.error(\"Make method for \" + params.get(0) +\n\t\t\t \" threw an exception. Check code\");\n\t\t} catch(java.lang.Exception e){\n\t\t Main.error(\"Problems with \"+params.get(0)+\"; check code.\");\n\t\t}\n\n\t\t//We never get here\n\t\tMain.error(\"Reached end of creation method without creating \"\n\t\t\t + params.get(0));\n\t\treturn null;\n\t}",
"public static <T> T instanceOrConstruct(String classname, String readable) throws ConfigurationException\n {\n Class<T> cls = FBUtilities.classForName(classname, readable);\n try\n {\n Field instance = cls.getField(\"instance\");\n return cls.cast(instance.get(null));\n }\n catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e)\n {\n // Could not get instance field. Try instantiating.\n return construct(cls, classname, readable);\n }\n }",
"public static <C> C newInstance(C obj) {\n try {\n //System.out.println(obj.getClass().getSimpleName());\n C c = (C) obj.getClass().newInstance();\n return c;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }",
"public T getNewInstance() {\n T value = null;\n Class<T> tClass = (Class<T>) ((ParameterizedType) this.getClass().getGenericSuperclass()).getActualTypeArguments()[0];\n try {\n value = tClass.newInstance();\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n return value;\n }",
"public static Object createObject(String className, Class<?>[] parameterTypes, Object[] initargs) {\n try {\n Class<?> aClass = Class.forName(className);\n return createObject(aClass, parameterTypes, initargs);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public static Object newInstance(String classname) {\n return newInstance(classname, Object.class);\n }",
"Reproducible newInstance();",
"public static Object createTaskObject(){\n try {\n\n return taskModel.make()\n .load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.WRAPPER)\n .getLoaded()\n .newInstance();\n\n\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n return null;\n }",
"public static Object createObject(Class objClass) throws Exception {\n return objClass.newInstance();\n }",
"@Override\r\n\tpublic CMObject newInstance()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\treturn this.getClass().getDeclaredConstructor().newInstance();\r\n\t\t}\r\n\t\tcatch(final Exception e)\r\n\t\t{\r\n\t\t\tLog.errOut(ID(),e);\r\n\t\t}\r\n\t\treturn new StdBehavior();\r\n\t}",
"public static final XalanNodeAssociationManager createInstance() {\n String className = null;\n try {\n className = System.getProperty(XalanNodeAssociationManager.class.getName()+\".implementation\");\n } catch( SecurityException e ) {\n // a security manager might reject this call\n }\n if(className!=null) {\n // use specified one.\n try {\n return (XalanNodeAssociationManager)Class.forName(className).newInstance();\n } catch( Exception e ) {\n e.printStackTrace();\n return null;\n }\n } else {\n // guess from the version number of Xalan\n int ver = XSLProcessorVersion.VERSION*100 + XSLProcessorVersion.RELEASE;\n if( Debug.debug )\n System.err.println(\"Xalan version: \"+ver);\n if( ver>202 )\n return new XalanNodeAssociationManager_2_5();\n else\n return new XalanNodeAssociationManager_2_0();\n }\n }",
"public static Object newInstance(String className, Object... args) {\n try {\n Class<?> clazz = Class.forName(className);\n Constructor<?>[] constructors = clazz.getDeclaredConstructors();\n for (Constructor<?> constructor : constructors) {\n Class<?>[] types = constructor.getParameterTypes();\n if (types.length == args.length) {\n int matched = 0;\n for (; matched<types.length; matched++) {\n if (!types[matched].isAssignableFrom(args[matched].getClass())) {\n break;\n }\n }\n if (matched == args.length) {\n constructor.setAccessible(true);\n return constructor.newInstance(args);\n }\n }\n }\n } catch (Exception e) {\n Logger.w(\"Reflection\", \"newInstance \" + className + \" \" + e.toString());\n }\n return null;\n }",
"public static Bot newInstance(final String className) throws ClassNotFoundException, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t NoSuchMethodException, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t InstantiationException, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IllegalAccessException, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t IllegalArgumentException, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t InvocationTargetException{\n\t return (Bot) Class.forName(className).getConstructor().newInstance();\n\t}",
"ClassInstanceCreationExpression getClass_();",
"public Class<? extends T> getClassToInstantiate() {\r\n return classToInstantiate;\r\n }",
"public static Object createObject(String className, Class<?> parameterType, Object initarg) {\n try {\n Class<?> aClass = Class.forName(className);\n return createObject(aClass, parameterType, initarg);\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public static NewExpression new_(Class type) { throw Extensions.todo(); }",
"T create();",
"T create();",
"public static JavaType createForClass(Class<?> clazz) {\n return new JavaType(clazz);\n }",
"public static Object createObject(Class<?> clazz, Class<?>[] parameterTypes, Object[] initargs) {\n try {\n Constructor<?> declaredConstructor = clazz.getDeclaredConstructor(parameterTypes);\n declaredConstructor.setAccessible(true);\n return declaredConstructor.newInstance(initargs);\n } catch (NoSuchMethodException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public static C10067G m32839a() {\n String str = \"newInstance\";\n try {\n Class<?> unsafeClass = Class.forName(\"sun.misc.Unsafe\");\n Field f = unsafeClass.getDeclaredField(\"theUnsafe\");\n f.setAccessible(true);\n return new C10063C(unsafeClass.getMethod(\"allocateInstance\", new Class[]{Class.class}), f.get(null));\n } catch (Exception e) {\n try {\n Method getConstructorId = ObjectStreamClass.class.getDeclaredMethod(\"getConstructorId\", new Class[]{Class.class});\n getConstructorId.setAccessible(true);\n int constructorId = ((Integer) getConstructorId.invoke(null, new Object[]{Object.class})).intValue();\n Method newInstance = ObjectStreamClass.class.getDeclaredMethod(str, new Class[]{Class.class, Integer.TYPE});\n newInstance.setAccessible(true);\n return new C10064D(newInstance, constructorId);\n } catch (Exception e2) {\n try {\n Method newInstance2 = ObjectInputStream.class.getDeclaredMethod(str, new Class[]{Class.class, Class.class});\n newInstance2.setAccessible(true);\n return new C10065E(newInstance2);\n } catch (Exception e3) {\n return new C10066F();\n }\n }\n }\n }",
"public T instantiatePrivate() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n Constructor<T> constructor = clazz.getDeclaredConstructor();\n constructor.setAccessible(true);\n return constructor.newInstance();\n }",
"public static StaticFactoryInsteadOfConstructors getInstance(Object optionalParameters){\n return new StaticFactoryInsteadOfConstructors();\n }",
"public org.objenesis.instantiator.ObjectInstantiator newInstantiatorOf(final java.lang.Class r4) {\n /*\n r3 = this;\n boolean r0 = com.esotericsoftware.kryo.util.Util.IS_ANDROID\n r1 = 1\n if (r0 != 0) goto L_0x002a\n java.lang.Class r0 = r4.getEnclosingClass()\n if (r0 == 0) goto L_0x001d\n boolean r0 = r4.isMemberClass()\n if (r0 == 0) goto L_0x001d\n int r0 = r4.getModifiers()\n boolean r0 = java.lang.reflect.Modifier.isStatic(r0)\n if (r0 != 0) goto L_0x001d\n r0 = 1\n goto L_0x001e\n L_0x001d:\n r0 = 0\n L_0x001e:\n if (r0 != 0) goto L_0x002a\n com.esotericsoftware.reflectasm.ConstructorAccess r0 = com.esotericsoftware.reflectasm.ConstructorAccess.get(r4) // Catch:{ Exception -> 0x002a }\n com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy$1 r2 = new com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy$1 // Catch:{ Exception -> 0x002a }\n r2.<init>(r0, r4) // Catch:{ Exception -> 0x002a }\n return r2\n L_0x002a:\n r0 = 0\n r2 = r0\n java.lang.Class[] r2 = (java.lang.Class[]) r2 // Catch:{ Exception -> 0x0033 }\n java.lang.reflect.Constructor r0 = r4.getConstructor(r2) // Catch:{ Exception -> 0x0033 }\n goto L_0x003c\n L_0x0033:\n java.lang.Class[] r0 = (java.lang.Class[]) r0 // Catch:{ Exception -> 0x0042 }\n java.lang.reflect.Constructor r0 = r4.getDeclaredConstructor(r0) // Catch:{ Exception -> 0x0042 }\n r0.setAccessible(r1) // Catch:{ Exception -> 0x0042 }\n L_0x003c:\n com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy$2 r1 = new com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy$2 // Catch:{ Exception -> 0x0042 }\n r1.<init>(r0, r4) // Catch:{ Exception -> 0x0042 }\n return r1\n L_0x0042:\n org.objenesis.strategy.InstantiatorStrategy r0 = r3.fallbackStrategy\n if (r0 != 0) goto L_0x00c1\n boolean r0 = r4.isMemberClass()\n if (r0 == 0) goto L_0x0073\n int r0 = r4.getModifiers()\n boolean r0 = java.lang.reflect.Modifier.isStatic(r0)\n if (r0 == 0) goto L_0x0058\n goto L_0x0073\n L_0x0058:\n com.esotericsoftware.kryo.KryoException r0 = new com.esotericsoftware.kryo.KryoException\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r2 = \"Class cannot be created (non-static member class): \"\n r1.append(r2)\n java.lang.String r4 = com.esotericsoftware.kryo.util.Util.className(r4)\n r1.append(r4)\n java.lang.String r4 = r1.toString()\n r0.<init>(r4)\n throw r0\n L_0x0073:\n java.lang.StringBuilder r0 = new java.lang.StringBuilder\n java.lang.StringBuilder r1 = new java.lang.StringBuilder\n r1.<init>()\n java.lang.String r2 = \"Class cannot be created (missing no-arg constructor): \"\n r1.append(r2)\n java.lang.String r2 = com.esotericsoftware.kryo.util.Util.className(r4)\n r1.append(r2)\n java.lang.String r1 = r1.toString()\n r0.<init>(r1)\n java.lang.String r4 = r4.getSimpleName()\n java.lang.String r1 = \"\"\n boolean r4 = r4.equals(r1)\n if (r4 == 0) goto L_0x00b7\n java.lang.String r4 = \"\\n\\tThis is an anonymous class, which is not serializable by default in Kryo. Possible solutions: \"\n r0.append(r4)\n java.lang.String r4 = \"1. Remove uses of anonymous classes, including double brace initialization, from the containing \"\n r0.append(r4)\n java.lang.String r4 = \"class. This is the safest solution, as anonymous classes don't have predictable names for serialization.\"\n r0.append(r4)\n java.lang.String r4 = \"\\n\\t2. Register a FieldSerializer for the containing class and call \"\n r0.append(r4)\n java.lang.String r4 = \"FieldSerializer#setIgnoreSyntheticFields(false) on it. This is not safe but may be sufficient temporarily. \"\n r0.append(r4)\n java.lang.String r4 = \"Use at your own risk.\"\n r0.append(r4)\n L_0x00b7:\n com.esotericsoftware.kryo.KryoException r4 = new com.esotericsoftware.kryo.KryoException\n java.lang.String r0 = r0.toString()\n r4.<init>(r0)\n throw r4\n L_0x00c1:\n org.objenesis.instantiator.ObjectInstantiator r4 = r0.newInstantiatorOf(r4)\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.esotericsoftware.kryo.Kryo.DefaultInstantiatorStrategy.newInstantiatorOf(java.lang.Class):org.objenesis.instantiator.ObjectInstantiator\");\n }",
"public org.python.types.Type __new__(org.python.types.Type cls);",
"private Object createObject(final Class<? extends AModule> clazz)\n\t{\n\t\ttry\n\t\t{\n\t\t\tConstructor<? extends AModule> constructor = clazz.getDeclaredConstructor();\n\t\t\tconstructor.setAccessible(true);\n\t\t\treturn constructor.newInstance();\n\t\t} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException\n\t\t\t\t| IllegalArgumentException e)\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"Error constructing module\", e);\n\t\t}\n\t}",
"private static Object createObject(String className, String namespace) {\n try {\n // get constructor\n Constructor<?> constructor = Class.forName(className).getConstructor(new Class[] {String.class});\n // create object\n return constructor.newInstance(new Object[] {namespace});\n } catch (ClassNotFoundException cnfe) {\n throw new ReviewerStatisticsConfigurationException(\n \"error occurs when trying to create object via reflection.\", cnfe);\n } catch (NoSuchMethodException nsme) {\n throw new ReviewerStatisticsConfigurationException(\n \"error occurs when trying to create object via reflection.\", nsme);\n } catch (InstantiationException ie) {\n throw new ReviewerStatisticsConfigurationException(\n \"error occurs when trying to create object via reflection.\", ie);\n } catch (IllegalAccessException iae) {\n throw new ReviewerStatisticsConfigurationException(\n \"error occurs when trying to create object via reflection.\", iae);\n } catch (InvocationTargetException ite) {\n throw new ReviewerStatisticsConfigurationException(\n \"error occurs when trying to create object via reflection.\", ite);\n }\n }",
"NewClass1 createNewClass1();",
"protected static <T extends Base> T createInstance(Class<? extends Base> clazz) {\n try {\n Constructor<?> constructor = clazz.getConstructor();\n T item = (T)constructor.newInstance();\n return item;\n } catch(NoSuchMethodException ex) {\n throw new MongomanException(clazz.getName() + \" All subclasses of Base Class must implement a constructor that takes no arguments\");\n } catch(IllegalAccessException | IllegalArgumentException | InstantiationException | InvocationTargetException ex) {\n throw new MongomanException(ex);\n }\n }",
"public Class findClass(String name) {\n Class c = ( Class ) cache.get( name ) ;\n\n if ( c != null ) {\n return c ;\n }\n\n // Break the name into path names\n String p = parseClassName( name ) ;\n File path = null ;\n\n // Search the current user defined class path.\n for (int i=0;i<paths.size();i++) {\n String pathName = paths.elementAt(i) + p ;\n path = new File( pathName ) ;\n if ( path.exists() && path.isFile() )\n break ;\n else\n path = null ;\n }\n\n if ( path == null )\n return null ;\n\n byte[] b = loadClassData( path);\n\n // Process this class by creating a new \"stub\". Give it\n // a different name to distinguish it from any existing\n // class of the same name.\n ByteArrayInputStream bs = new ByteArrayInputStream( b ) ;\n DataInputStream ds = new DataInputStream( bs ) ;\n ClassObject classObject = new ClassObject() ;\n try {\n classObject.read( ds ) ;\n }\n catch ( IOException e ) {\n return null ;\n }\n\n return defineClass(name, b, 0, b.length);\n }",
"public CMObject newInstance();",
"public static Board create(final Class board) {\n if (board.equals(standard)) {\n return new StandardBoard();\n } else if (board.equals(gothic)) {\n return new Gothic();\n } else if (board.equals(empty)) {\n return new EmptyBoard();\n } else {\n /* Throw exception? */\n return null;\n }\n }",
"private Instantiation(){}",
"public T create()\n {\n IProxyFactory<T> proxyFactory = getProxyFactory(type);\n T result = proxyFactory.createProxy();\n return result;\n }",
"public T getAutoInstance(String devName) {\n S settings = sGen.apply(devName);\n for (Class clz : subClasses) {\n T device;\n try {\n device = (T) clz.getDeclaredConstructor(sClass).newInstance(settings);\n } catch (InvocationTargetException e) { \n if (e.getCause() instanceof Device.IDException) {\n continue; //This just means the device wasn't identified. Try the next device\n } else {\n throw new RuntimeException(e.getCause());\n }\n } catch (NoSuchMethodException | InstantiationException | IllegalAccessException me) {\n throw new RuntimeException(me);\n }\n Globals.mm().logs().logMessage(String.format(\"Autofinder found device of type %s for device label %s.\", device.getClass().toString(), devName));\n return device; //We only get this far if the object successfully initializes.\n }\n return null; //Nothing was identified.\n }",
"public SaveObject createFromClass(SaveObjectKind kind, String className) throws IllegalAccessException, InstantiationException {\n Class<?> clazz = getClazzByAnnotation(className);\n if (clazz == null) {\n if (!missingTypes.contains(className)) {\n missingTypes.add(className);\n }\n LOGGER.log(Level.INFO, \"Unknown className \" + className);\n //TODO throw new NotImplementedException($\"Unknown className \" + className);\n throw new NotImplementedException();\n } else {\n switch (kind) {\n case Actor:\n return (SaveActor) clazz.newInstance();\n case Component:\n return (SaveComponent) clazz.newInstance();\n default:\n//TODO throw new NotImplementedException($\"Unknown SaveObject kind {kind}\");\n throw new NotImplementedException();\n }\n }\n }",
"public static Object create(String className, Class<?>[] argTypes, Object[] argValues)\r\n\t\t\tthrows CreateObjectException {\r\n\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tClass<?> clz = Class.forName(className);\r\n\t\t\tif (argTypes == null) {\r\n\t\t\t\treturn clz.newInstance();\r\n\r\n\t\t\t} else {\r\n\t\t\t\tConstructor<?> c = clz.getConstructor(argTypes);\r\n\t\t\t\treturn c.newInstance(argValues);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new CreateObjectException(e);\r\n\t\t}\r\n\t}",
"private Pokemon createPokemonFromClass(Class<?extends Pokemon> cl, Coord position) {\n\t\tConstructor<? extends Pokemon> con = null;\n\t\ttry {\n\t\t\tcon = cl.getConstructor(Environment.class, Coord.class, Movement.class);\n\t\t} catch (NoSuchMethodException | SecurityException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tPokemon evolution = null;\n\t\ttry {\n\t\t\tevolution = con.newInstance(this, position, Movement.Down);\n\t\t} catch (InstantiationException\n\t\t\t\t| IllegalAccessException\n\t\t\t\t| IllegalArgumentException\n\t\t\t\t| InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn evolution;\n\t}",
"protected CastorSupport getInstanceOfCastorSupport(ClassLoader clsLdr) {\n CastorSupport retCastorSupport = null;\n boolean oldAPIJar = true;\n try {\n // getComplexType() was added in 5.0.4\n Method getComplexType = CastorSupport.class.getDeclaredMethod(\"getComplexType\", new Class[0]);\n oldAPIJar = (getComplexType == null);\n } catch (Exception e) {\n oldAPIJar = true;\n }\n \n if (oldAPIJar) {\n retCastorSupport = new CastorSupportImpl();\n } else {\n retCastorSupport = CastorSupport.getInstance(clsLdr);\n }\n \n return retCastorSupport;\n }",
"private static PacketAnalyzer loadInstance(String analyzerClassName) {\n PacketAnalyzer packetAnalyzer = null;\n try {\n \t//System.out.println(\"--- Looking for : \" + analyzerClassName);\n packetAnalyzer = (PacketAnalyzer) Class.forName(analyzerClassName).newInstance();\n //System.out.println(\"--- Found : \" + analyzerClassName);\n } catch (InstantiationException e) {\n e.printStackTrace();\n //System.out.println(\"--- Creating the default PacketAnalyzer (InstantiationException) ---\");\n packetAnalyzer = new PacketAnalyzer();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n //System.out.println(\"--- Creating the default PacketAnalyzer (IllegalAccessException) ---\");\n packetAnalyzer = new PacketAnalyzer();\n } catch (ClassNotFoundException e) {\n //System.out.println(\"--- PacketAnalyzer subclass \" + analyzerClassName + \" not found ---\");\n //System.out.println(\"--- Creating the default PacketAnalyzer ---\");\n packetAnalyzer = new PacketAnalyzer();\n }\n return packetAnalyzer;\n }",
"public static <T> T newInstance(Class<T> clazz) throws ReflectionException {\n\t\treturn newInstance(clazz, new Class[]{}, new Object[]{});\n\t}",
"public abstract boolean create(T newInstance);",
"@SuppressWarnings(\"unchecked\")\n\tpublic static <T> T instantiateUnsafe(Class<T> cls) throws RuntimeException {\n\t\treturn (T) ReflectionUtils.invokeMethod(getUnsafe(), \"allocateInstance\", cls);\n\t}",
"public static synchronized Object getInstance(String classname) {\n\n Object singleton = map.get(classname);\n\n if(singleton != null) {\n dbgLog.fine(\"Registry.getInstance(): already-registered case\");\n return singleton;\n }\n try {\n singleton = Class.forName(classname).newInstance();\n } catch(ClassNotFoundException cnf) {\n cnf.printStackTrace();\n } catch(InstantiationException ie) {\n ie.printStackTrace();\n } catch(IllegalAccessException ia) {\n ia.printStackTrace();\n } catch(Exception e) {\n e.printStackTrace();\n }\n map.put(classname, singleton);\n dbgLog.fine(\"Registry.getInstance(): not-registered case\");\n return singleton;\n }",
"public Object createObject() {\n return klass.__call__().__tojava__(interfaceType);\n }",
"protected ParserAbstract createRegisterInstance(\n\t\t\tClass<? extends ParserAbstract> className)\n\t\t\tthrows InstantiationException, IllegalAccessException {\n\t\tClass<? extends ParserAbstract> parserClass = ParserList\n\t\t\t\t.findParserClass(className.getSimpleName().toLowerCase());\n\t\tassert (parserClass != null);\n\t\treturn parserClass.newInstance();\n\t}",
"public <TPage extends BasePage> TPage GetInstance(Class<TPage> pageClass) {\r\n\t\ttry {\r\n\t\t\treturn pageClass.getDeclaredConstructor(WebDriver.class, WebDriverWait.class).newInstance(this.driver, this.wait);\r\n\t\t\t\r\n\t\t}catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public static <T> T construct(String classname, String readable) throws ConfigurationException\n {\n Class<T> cls = FBUtilities.classForName(classname, readable);\n return construct(cls, classname, readable);\n }",
"YobBuilderOrBuiltObject(String qualifiedClassName,\n ClassLoader registeredAppClassLoader) {\n try {\n yangDefaultClass =\n registeredAppClassLoader.loadClass(qualifiedClassName);\n yangBuilderClass = yangDefaultClass.getDeclaredClasses()[0];\n setBuilderObject(yangBuilderClass.newInstance());\n } catch (ClassNotFoundException e) {\n log.error(L_FAIL_TO_LOAD_CLASS, qualifiedClassName);\n throw new YobException(E_FAIL_TO_LOAD_CLASS + qualifiedClassName);\n } catch (InstantiationException | IllegalAccessException e) {\n log.error(L_FAIL_TO_CREATE_OBJ, qualifiedClassName);\n throw new YobException(E_FAIL_TO_CREATE_OBJ + qualifiedClassName);\n } catch (NullPointerException e) {\n log.error(L_REFLECTION_FAIL_TO_CREATE_OBJ, qualifiedClassName);\n throw new YobException(E_REFLECTION_FAIL_TO_CREATE_OBJ +\n qualifiedClassName);\n }\n }",
"public Object createComponent( final String implementationKey )\n throws Exception\n {\n final Class clazz = getClassLoader().loadClass( implementationKey );\n return clazz.newInstance();\n }",
"protected Object buildNewInstanceUsingDefaultConstructor() throws DescriptorException {\n try {\n if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){\n try {\n return AccessController.doPrivileged(new PrivilegedInvokeConstructor(this.getDefaultConstructor(), (Object[])null));\n } catch (PrivilegedActionException exception) {\n Exception throwableException = exception.getException();\n if (throwableException instanceof InvocationTargetException){\n throw DescriptorException.targetInvocationWhileConstructorInstantiationOfFactory(this.getDescriptor(), throwableException);\n } else if (throwableException instanceof IllegalAccessException){\n throw DescriptorException.illegalAccessWhileConstructorInstantiationOfFactory(this.getDescriptor(), throwableException); \n } else {\n throw DescriptorException.instantiationWhileConstructorInstantiationOfFactory(this.getDescriptor(), throwableException); \n }\n }\n } else {\n return PrivilegedAccessHelper.invokeConstructor(this.getDefaultConstructor(), (Object[])null);\n }\n } catch (InvocationTargetException exception) {\n throw DescriptorException.targetInvocationWhileConstructorInstantiation(this.getDescriptor(), exception);\n } catch (IllegalAccessException exception) {\n throw DescriptorException.illegalAccessWhileConstructorInstantiation(this.getDescriptor(), exception);\n } catch (InstantiationException exception) {\n throw DescriptorException.instantiationWhileConstructorInstantiation(this.getDescriptor(), exception);\n } catch (NoSuchMethodError exception) {\n // This exception is not documented but gets thrown.\n throw DescriptorException.noSuchMethodWhileConstructorInstantiation(this.getDescriptor(), exception);\n } catch (NullPointerException exception) {\n // Some JVMs will throw a NULL pointer exception here\n throw DescriptorException.nullPointerWhileConstructorInstantiation(this.getDescriptor(), exception);\n }\n }",
"public void _createInstance() {\n requiredMethod(\"getAvailableServiceNames()\");\n\n if (services.length == 0) {\n services = (String[]) tEnv.getObjRelation(\"XMSF.serviceNames\");\n\n if (services == null) {\n log.println(\"No service to create.\");\n tRes.tested(\"createInstance()\", true);\n\n return;\n }\n }\n\n String needArgs = (String) tEnv.getObjRelation(\"needArgs\");\n\n if (needArgs != null) {\n log.println(\"The \" + needArgs + \n \" doesn't support createInstance without arguments\");\n tRes.tested(\"createInstance()\", true);\n\n return;\n }\n\n boolean res = true; \n\n for (int k = 0; k < services.length; k++) {\n try {\n log.println(\"Creating Instance: \" + services[k]);\n\n Object Inst = oObj.createInstance(services[k]);\n res = (Inst != null);\n } catch (com.sun.star.uno.Exception ex) {\n log.println(\"Exception occurred during createInstance()\");\n ex.printStackTrace(log);\n res = false;\n }\n }\n\n tRes.tested(\"createInstance()\", res);\n }",
"public abstract <T> T create(Object object, Class<T> clazz);",
"private static final Object newObjectFromString(Class<?> type, String message) {\r\n Constructor<?> constructor;\r\n try {\r\n constructor = type.getDeclaredConstructor(String.class);\r\n constructor.setAccessible(true);\r\n } catch (Exception ex) {\r\n throw new RuntimeException(String.format(MSG_MISSINGCONSTRUCTOR, type.getSimpleName(), ex.getMessage()), ex);\r\n }\r\n try {\r\n return constructor.newInstance(message);\r\n } catch (Exception ex) {\r\n throw new RuntimeException(String.format(MSG_COULDNOTINSTANTIATECLASS, type.getName(), type.getSimpleName()), ex);\r\n }\r\n }",
"private Class<?> loadClass(String className) {\n try {\n return Class.forName(className);\n } catch (ClassNotFoundException ignore) {\n return null;\n }\n }",
"private GraphObject instantiateGraphObject( String tagname ) {\n// Global.info( \"Instantiating object of type \" + tagname );\n if ( CharGerXMLTagNameToClassName.isEmpty() ) {\n loadCharGerKeyWordToClassTable();\n }\n String t = CharGerXMLTagNameToClassName.getProperty( tagname, \"DUMMY\" );\n if ( t.equals( \"DUMMY\" ) ) {\n return null;\n }\n\n GraphObject go = null;\n Class objClass = null;\n try {\n objClass = Class.forName( \"charger.obj.\" + t );\n go = (GraphObject)objClass.newInstance();\n } catch ( ClassNotFoundException ex ) {\n Global.error( \"Parsing an illegal object tag \" + tagname );\n } catch ( InstantiationException ex ) {\n Global.error( \"Parsing an illegal object tag \" + tagname );\n } catch ( IllegalAccessException ex ) {\n Global.error( \"Parsing an illegal object tag \" + tagname );\n }\n\n return go;\n }",
"JDefinedClass objectFactory();",
"protected Injector createInjector() {\n FactoryFinder finder = new FactoryFinder();\n try {\n return (Injector)finder.newInstance(\"Injector\");\n } catch (NoFactoryAvailableException e) {\n return new ReflectionInjector();\n } catch (IllegalAccessException e) {\n throw new RuntimeCamelException(e);\n } catch (InstantiationException e) {\n throw new RuntimeCamelException(e);\n } catch (IOException e) {\n throw new RuntimeCamelException(e);\n } catch (ClassNotFoundException e) {\n throw new RuntimeCamelException(e);\n }\n }",
"private <T> T newInstance(Class clazz, Class fieldType) {\n T fieldInstance = null;\n try {\n fieldInstance = (T) clazz.newInstance();\n } catch (InstantiationException ex) {\n //Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, fieldType.getName() + \" besitzt keinen Default-Konstruktor!\", ex);\n fieldInstance = constructorInjection(clazz);\n } catch (IllegalAccessException ex) {\n try {//Prüfen ob getInstance verfügbar ist und wenn möglich aufrufen.\n Method getInstanceMethod = fieldType.getMethod(\"getInstance\");\n fieldInstance = (T) getInstanceMethod.invoke(null);\n } catch (NoSuchMethodException ex1) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, fieldType.getName() + \" besitzt keinen public Default-Konstruktor!\", ex1);\n } catch (SecurityException ex1) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, null, ex1);\n } catch (IllegalAccessException ex1) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, fieldType.getName() + \" getInstance() ist nicht public!\", ex1);\n } catch (IllegalArgumentException ex1) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, fieldType.getName() + \" getInstance() benötigt zusätzliche Argumente\", ex1);\n } catch (InvocationTargetException ex1) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, fieldType.getName() + \" getInstance() warf eine Exeption\", ex1);\n }\n }\n return fieldInstance;\n }",
"private Role createRole( String className, Agent agent ) {\n// System.out.println(\"Attempting to create class \" + className);\n Class cl = null;\n try {\n cl = Class.forName( \"tns.roles.\" + className );\n } catch ( ClassNotFoundException e ) {\n System.err.println( \"Can't find your darned class.\" );\n System.exit( 0 );\n } // end try-catch\n\n Constructor c = null;\n Object o = null;\n try {\n c = cl.getConstructor(new Class[] {Agent.class});\n o = c.newInstance(new Object[] {agent});\n } catch (NoSuchMethodException e) {\n System.err.println(\"Can't find you class' constructor.\");\n System.exit(0);\n } catch (SecurityException e) {\n System.err.println(\"Security Exception. Can't access your class.\");\n System.exit(0);\n } catch ( InstantiationException e ) {\n System.err.println( \"Can't make your darned class.\" );\n System.exit( 0 );\n } catch ( IllegalAccessException e ) {\n System.err.println( \"Can't access your darned class.\" );\n System.exit( 0 );\n } catch (IllegalArgumentException e) {\n System.err.println(\"Can't create your class. Illegal arguments.\");\n System.exit(0);\n } catch (InvocationTargetException e) {\n System.err.println(\"Can't create your class. Contructor threw an exception.\");\n System.exit(0);\n } // end try-catch\n\n return (Role)o;\n\n }",
"DsmlClass createDsmlClass();",
"<T> T newInstance(URI description) throws EnvironmentException;",
"@Override\n protected T createInstance() throws Exception {\n return this.isSingleton() ? this.builder().build() : XMLObjectSupport.cloneXMLObject(this.builder().build());\n }",
"protected Class getAClass (String className) throws ClassNotFoundException {\n int dot_index = className.lastIndexOf(\".\");\n if (dot_index == -1) { // native class or string\n if (className.equals (\"String\"))\n return String.class;\n else if (className.equals (\"int\"))\n return int.class;\n\t\t\telse if (className.equals (\"long\"))\n return long.class;\n else if (className.equals (\"boolean\"))\n return boolean.class;\n else if (className.equals (\"char\"))\n\t\t\t\treturn char.class;\n else if (className.equals (\"double\"))\n return double.class;\n else if (className.equals (\"Date\") || className.equals (\"Timestamp\"))\n return Class.forName(\"java.sql.Timestamp\");\n else // try native classes\n return Class.forName(\"java.lang.\" + className);\n }\n else { //use class loader\n return Class.forName(className);\n }\n }",
"protected Object buildNewInstanceUsingFactory() throws DescriptorException {\n try {\n // If the method is static, the first argument is ignored and can be null\n if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){\n try {\n return AccessController.doPrivileged(new PrivilegedMethodInvoker(this.getMethod(), this.getFactory(), new Object[0]));\n } catch (PrivilegedActionException exception) {\n Exception throwableException = exception.getException();\n if (throwableException instanceof IllegalAccessException) {\n throw DescriptorException.illegalAccessWhileMethodInstantiation(this.getMethod().toString(), this.getDescriptor(), throwableException);\n } else {\n throw DescriptorException.targetInvocationWhileMethodInstantiation(this.getMethod().toString(), this.getDescriptor(), throwableException);\n }\n }\n } else {\n return PrivilegedAccessHelper.invokeMethod(this.getMethod(), this.getFactory(), new Object[0]);\n }\n } catch (IllegalAccessException exception) {\n throw DescriptorException.illegalAccessWhileMethodInstantiation(this.getMethod().toString(), this.getDescriptor(), exception);\n } catch (InvocationTargetException exception) {\n throw DescriptorException.targetInvocationWhileMethodInstantiation(this.getMethod().toString(), this.getDescriptor(), exception);\n } catch (NullPointerException exception) {\n // Some JVMs will throw a NULL pointer exception here\n throw DescriptorException.nullPointerWhileMethodInstantiation(this.getMethod().toString(), this.getDescriptor(), exception);\n }\n }",
"public <T> T createInstance(final Class<T> type, final String moduleName, final String className,\n\t\t\tfinal Object... args) {\n\n\t\tfinal PyObject importer = getImporter();\n\t\tsetClasspath(importer);\n\n\t\tfinal PyObject instance = createObject(getPythonClass(importer, moduleName, className), args);\n\n\t\t// coerce into java type\n\t\treturn (T) instance.__tojava__(type);\n\t}",
"public static StaticFactoryInsteadOfConstructors newInstance() {\n return new StaticFactoryInsteadOfConstructors();\n }",
"public static CommandType createClass(String name) {\n\t\t\n\t\tif(counter < MAX) {\n\t\t\tcounter ++;\n\t\t\treturn new CommandType(name);\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(\"Es können keine CommandType Objekte mehr erstellt werden!\");\n\t\t\treturn null;\n\t\t}\n\t\t\t\n\t}",
"private static synchronized void createInstance() {\r\n\t\tif (instance == null)\r\n\t\t\tinstance = new LOCFacade();\r\n\t}",
"private Class loadClass(ClassInfo classInfo) {\n Class type = null;\n try {\n URLClassLoader classLoader = new URLClassLoader(new URL[]{\n new File(classInfo.getPath()).toURI().toURL()\n });\n type = classLoader.loadClass(classInfo.getName());\n } catch (MalformedURLException ex) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, \"Class url stimmt nicht. Ggf. hat der ClassIndexer einen falschen Pfad!\", ex);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(CDIC.class.getName()).log(Level.SEVERE, \"Klasse konnte nicht gefunden werden!\", ex);\n }\n return type;\n }",
"private SceneGraphObject createNode( String className, Class[] parameterTypes, Object[] parameters ) {\n SceneGraphObject ret;\n Constructor constructor;\n\n try {\n Class state = Class.forName( className );\n constructor = state.getConstructor( parameterTypes );\n ret = (SceneGraphObject)constructor.newInstance( parameters );\n\t} catch(ClassNotFoundException e1) {\n if (control.useSuperClassIfNoChildClass())\n ret = createNodeFromSuper( className, parameterTypes, parameters );\n else\n throw new SGIORuntimeException( \"No State class for \"+\n\t\t\t\t\t\tclassName );\n\t} catch( IllegalAccessException e2 ) {\n\t throw new SGIORuntimeException( \"Broken State class for \"+\n\t\t\t\t\t\tclassName+\" - IllegalAccess\" );\n\t} catch( InstantiationException e3 ) {\n\t throw new SGIORuntimeException( \"Broken State class for \"+\n\t\t\t\t\t\tclassName );\n } catch( java.lang.reflect.InvocationTargetException e4 ) {\n\t throw new SGIORuntimeException( \"InvocationTargetException for \"+\n\t\t\t\t\t\tclassName );\n } catch( NoSuchMethodException e5 ) {\n for(int i=0; i<parameterTypes.length; i++)\n System.err.println( parameterTypes[i].getName() );\n System.err.println(\"------\");\n\t throw new SGIORuntimeException( \"Invalid constructor for \"+\n\t\t\t\t\t\tclassName );\n }\n\n return ret;\n }",
"public static GeoCoderInterface createGeoCoder(){\n\t\tif (Config.default_geo_api.equals(OSM)){\n\t\t\t//TODO: implement\n\t\t\tDebugger.println(\"GeoFactory - unknown GeoCoderInterface: \" + Config.default_geo_api, 1);\n\t\t\treturn null;\n\t\t}else if (Config.default_geo_api.equals(GOOGLE)){\n\t\t\treturn new GeoCoderGoogle();\n\t\t}else if (Config.default_geo_api.equals(GRAPHHOPPER)){\n\t\t\treturn new GeoCoderGraphhopper();\n\t\t}else{\n\t\t\tDebugger.println(\"GeoFactory - unknown GeoCoderInterface: \" + Config.default_geo_api, 1);\n\t\t\treturn null;\n\t\t}\n\t}"
] | [
"0.73002625",
"0.7287553",
"0.68843853",
"0.66722745",
"0.6605439",
"0.64805186",
"0.64233375",
"0.63778853",
"0.6319219",
"0.6280341",
"0.6229666",
"0.6211203",
"0.62088484",
"0.61313474",
"0.60833997",
"0.6008049",
"0.6004845",
"0.5992475",
"0.5961943",
"0.5951397",
"0.5928826",
"0.5847516",
"0.5841319",
"0.58099866",
"0.5798099",
"0.5786038",
"0.57776254",
"0.5774849",
"0.57647645",
"0.5762528",
"0.57333934",
"0.5729497",
"0.5692979",
"0.5689247",
"0.56652486",
"0.5637438",
"0.56248057",
"0.5618491",
"0.56098104",
"0.5574824",
"0.5569007",
"0.55641663",
"0.55494004",
"0.55395603",
"0.552394",
"0.552394",
"0.5521714",
"0.55158824",
"0.55142426",
"0.55115324",
"0.5446462",
"0.5445954",
"0.5444383",
"0.543037",
"0.54160994",
"0.53992707",
"0.5394335",
"0.53907377",
"0.5389682",
"0.5373467",
"0.5363643",
"0.5361454",
"0.5361337",
"0.5341628",
"0.5340859",
"0.5330258",
"0.53260314",
"0.5325158",
"0.53234226",
"0.5316406",
"0.53003526",
"0.5298608",
"0.52945435",
"0.52919555",
"0.5284232",
"0.5282686",
"0.5278746",
"0.5274701",
"0.52729845",
"0.5266554",
"0.5265677",
"0.5265202",
"0.5261484",
"0.52597904",
"0.5256437",
"0.52518845",
"0.5250692",
"0.52314675",
"0.5227251",
"0.5225398",
"0.52242255",
"0.52231467",
"0.5220191",
"0.52196497",
"0.52118486",
"0.5209819",
"0.5209102",
"0.52045256",
"0.51930994",
"0.51921016"
] | 0.5558095 | 42 |
/ ========== Constructors ========== | public Weeks(BigDecimal numUnits) { super(numUnits); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Constructor() {\r\n\t\t \r\n\t }",
"public Constructor(){\n\t\t\n\t}",
"public CyanSus() {\n\n }",
"private TMCourse() {\n\t}",
"public Pitonyak_09_02() {\r\n }",
"public CSSTidier() {\n\t}",
"public PSRelation()\n {\n }",
"public Basic() {}",
"public Phl() {\n }",
"public RngObject() {\n\t\t\n\t}",
"public Orbiter() {\n }",
"private Rekenhulp()\n\t{\n\t}",
"public Libro() {\r\n }",
"public Trening() {\n }",
"public Coche() {\n super();\n }",
"public Curso() {\r\n }",
"public Cohete() {\n\n\t}",
"public Rol() {}",
"public _355() {\n\n }",
"public Chick() {\n\t}",
"public AirAndPollen() {\n\n\t}",
"public Clade() {}",
"public TTau() {}",
"public Tbdtokhaihq3() {\n super();\n }",
"public Odontologo() {\n }",
"public Lanceur() {\n\t}",
"public Anschrift() {\r\n }",
"private Instantiation(){}",
"public Chauffeur() {\r\n\t}",
"protected GeometricObject() \n\t{\n\t\tdateCreated = new java.util.Date();\n\t}",
"Composite() {\n\n\t}",
"private NfkjBasic()\n\t\t{\n\t\t\t\n\t\t}",
"public Tigre() {\r\n }",
"public Ov_Chipkaart() {\n\t\t\n\t}",
"public JSFOla() {\n }",
"protected abstract void construct();",
"public Soil()\n\t{\n\n\t}",
"public Resource() {\n }",
"public Resource() {\n }",
"public lo() {}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"public Magazzino() {\r\n }",
"private SingleObject()\r\n {\r\n }",
"public Pasien() {\r\n }",
"public SlanjePoruke() {\n }",
"public Mitarbeit() {\r\n }",
"private Node() {\n\n }",
"public mapper3c() { super(); }",
"public Steganography() {}",
"public EnsembleLettre() {\n\t\t\n\t}",
"public Node(){\n\n\t\t}",
"public ChaCha()\n\t{\n\t\tsuper();\n\t}",
"public Cgg_jur_anticipo(){}",
"public Demo() {\n\t\t\n\t}",
"private MApi() {}",
"public CD() {}",
"public SgaexpedbultoImpl()\n {\n }",
"public Genret() {\r\n }",
"private Ognl() {\n }",
"public Stat() {\n }",
"public Data() {}",
"public Rook()\n {\n super();\n }",
"public Tbdcongvan36() {\n super();\n }",
"public Livro() {\n\n\t}",
"private TbusRoadGraph() {}",
"public Zeffit()\n {\n // TODO: initialize instance variable(s)\n }",
"private Composite() {\n }",
"public CMN() {\n\t}",
"public Husdjurshotell(){}",
"public Self__1() {\n }",
"public SimOI() {\n super();\n }",
"public Node(){}",
"private Converter()\n\t{\n\t\tsuper();\n\t}",
"private TAPosition()\n {\n\n }",
"public Carrinho() {\n\t\tsuper();\n\t}",
"public Parser()\n {\n //nothing to do\n }",
"public Boop() {\n\t\tsuper();\n\t}",
"public Naive() {\n\n }",
"@Override\r\n\tpublic void init() {}",
"public Mannschaft() {\n }",
"public Goodsinfo() {\n super();\n }",
"@Override\n public void construct() throws IOException {\n \n }",
"private IndexBitmapObject() {\n\t}",
"public ExamMB() {\n }",
"public Stat()\n {\n // empty constructor\n }",
"public MyLinkedList() \n\t{\n\t\t\n\t}",
"private SimpleRepository() {\n \t\t// private ct to disallow external object creation\n \t}",
"@Override\n public void init() {}",
"public Excellon ()\n {}",
"public Ruby() {}",
"protected Betaling()\r\n\t{\r\n\t\t\r\n\t}",
"public HGDClient() {\n \n \t}",
"private SIModule(){}",
"public AntrianPasien() {\r\n\r\n }",
"public OVChipkaart() {\n\n }",
"public Catelog() {\n super();\n }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"private OMUtil() { }",
"public Data() {\n }",
"public Data() {\n }",
"protected Asignatura()\r\n\t{}"
] | [
"0.8159992",
"0.7545638",
"0.70005924",
"0.6866126",
"0.6857596",
"0.68256223",
"0.68141675",
"0.6806672",
"0.6803208",
"0.67969316",
"0.67855865",
"0.67639923",
"0.67579687",
"0.67429316",
"0.67355293",
"0.67277163",
"0.6710523",
"0.67074996",
"0.66881347",
"0.6685789",
"0.66856354",
"0.66763455",
"0.6669738",
"0.6659222",
"0.6658133",
"0.66422546",
"0.6642137",
"0.66355604",
"0.66209364",
"0.6612803",
"0.66067266",
"0.6588072",
"0.65722847",
"0.6564924",
"0.65422237",
"0.6541535",
"0.65329736",
"0.6513142",
"0.6513142",
"0.6511894",
"0.6510111",
"0.65029126",
"0.6499916",
"0.6493089",
"0.64900863",
"0.6489247",
"0.64818656",
"0.64779943",
"0.64756125",
"0.64741683",
"0.64708656",
"0.6469839",
"0.64674234",
"0.646663",
"0.6453872",
"0.6448999",
"0.64476013",
"0.64458364",
"0.6444284",
"0.6441447",
"0.64395624",
"0.6437042",
"0.6431301",
"0.64261454",
"0.64236027",
"0.64218044",
"0.6421386",
"0.64213145",
"0.6420044",
"0.6415527",
"0.64109594",
"0.6405005",
"0.64025027",
"0.6400758",
"0.6400048",
"0.6399441",
"0.639871",
"0.6398639",
"0.6396405",
"0.63963246",
"0.6389586",
"0.63865167",
"0.6384939",
"0.6383848",
"0.63823485",
"0.6368374",
"0.63637096",
"0.6362946",
"0.6362908",
"0.6359569",
"0.635466",
"0.6352925",
"0.634976",
"0.6349286",
"0.63457745",
"0.6334362",
"0.6331613",
"0.63294125",
"0.6328321",
"0.6328321",
"0.63261294"
] | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("Enter the name");
String name=s.nextLine();
System.out.println("Enter the address");
String address=s.nextLine();
System.out.println("Number of room");
int room=s.nextInt();
System.out.println("Number of persons");
int persons=s.nextInt();
System.out.println("AC OR Non-AC");
String ac=s.next();
System.out.println("Booking Date");
String booking=s.next();
System.out.println("Checkout Date");
String checkout=s.next();
LocalDate ds=LocalDate.parse(booking);
LocalDate de=LocalDate.parse(checkout);
long total=ChronoUnit.DAYS.between(ds, de);
long total=0;int p=(person%2);
System.out.println("Reg-Details: ");
System.out.println("Name : "+name);
System.out.println("Address : "+address);
System.out.println("No.of rooms : "+room);
System.out.println("No.of.Guest : "+persons);
int ac_amount=0,flag=0;
if(ac.equals("AC"))
{
ac_amount=100;
flag=1;
}
else
{
ac_amount=0;
flag=0;
}
if(flag==1)
System.out.println("AC :Yes");
else
System.out.println("AC :No");
int rent=500,flag1=0;;
if(persons==(room*2)+1)
{
int amount=(int)((500+ac_amount)*(persons*total))+250;
System.out.print("Amount :"+amount);
}
else
{
int amount=(int)((500+ac_amount)*(persons*total));
System.out.print("Amount :"+amount);
}
} | {
"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 |
Retreive A SINGLE USER BY ID | @GetMapping("/user/{id}")
public ResponseEntity<User> singleUser(@PathVariable("id") int id) {
User user = userDao.getUserById(id);
return new ResponseEntity<User>(user, HttpStatus.OK);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"User getUser(Long id);",
"User getUserById(int id);",
"User getUserById(Long id);",
"User getUserById(Long id);",
"@Override\r\n\tpublic User getUserById(int id) {\n\t\treturn userMapper.selById(id);\r\n\t}",
"@Override\n\tpublic User getOne(Integer id) {\n\t\treturn userDao.getOne(id);\n\t}",
"public User getUserById(Long id) throws Exception;",
"@Override\n\tpublic User selectUserById(int id) {\n\t\tUser user = null;\n\t\ttry {\n\t\t\tuser = (User) client.queryForObject(\"selectUserById\", id);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn user;\n\n\t}",
"public User getUser(String id) {\n return repository.getUser(id).get(0);\n }",
"@Override\r\n\tpublic User getUserByID(int id) {\n\t\treturn userMapper.getUserByID(id);\r\n\t}",
"public User read(String id);",
"public User getUser(long id){\n User user = userRepository.findById(id);\n if (user != null){\n return user;\n } else throw new UserNotFoundException(\"User not found for user_id=\" + id);\n }",
"public User getUserById(int id) {\n System.out.println(id + this.userDao.selectId(id).getUsername());\n\n return this.userDao.selectId(id);\n }",
"@Override\n\tpublic User getUser(int id) {\n\t\treturn userRepository.findById(id);\n\t}",
"@Override\n\tpublic User getUserById(int id) {\n\t\treturn userDao.getUserById(id);\n\t}",
"UserDetails get(String id);",
"public UserRow getUser(int id) throws AdminPersistenceException {\n return (UserRow) getUniqueRow(SELECT_USER_BY_ID, id);\n }",
"public User findById(Long id){\n return userRepository.findOne(id);\n }",
"public User getUserById(String id){\n\t\tUser e;\n\t\tfor (int i = 0 ; i < users.size() ; i++){\n\t\t\te = users.get(i);\n\t\t\tif (e.getId().equals(id))\n\t\t\t\treturn e;\n\t\t}\n\t\treturn null;\n\t}",
"public Users getUser(Integer id) {\r\n\t\treturn usDao.findById(id, true);\r\n\r\n\t}",
"private User getUser(Long id) {\n\t\tEntityManager mgr = getEntityManager();\n\t\tUser user = null;\n\t\ttry {\n\t\t\tuser = mgr.find(User.class, id);\n\t\t} finally {\n\t\t\tmgr.close();\n\t\t}\n\t\treturn user;\n\t}",
"public User getUser(int id){\n \n Session session = HibernateUtil.getSessionFactory().openSession();\n Transaction tx = null;\n User user = null;\n try {\n tx = session.beginTransaction();\n\n // Add restriction to get user with username\n Criterion emailCr = Restrictions.idEq(id);\n Criteria cr = session.createCriteria(User.class);\n cr.add(emailCr);\n user = (User)cr.uniqueResult();\n tx.commit();\n } catch (HibernateException e) {\n if (tx != null)\n tx.rollback();\n log.fatal(e);\n } finally {\n session.close();\n }\n return user;\n }",
"public static User findUserById(int id) {\n\n User user = null;\n User targetUser = new User();\n IdentityMap<User> userIdentityMap = IdentityMap.getInstance(targetUser);\n\n String findUserById = \"SELECT * FROM public.member \"\n + \"WHERE id = '\" + id + \"'\";\n\n PreparedStatement stmt = DBConnection.prepare(findUserById);\n\n try {\n ResultSet rs = stmt.executeQuery();\n while(rs.next()) {\n user = load(rs);\n }\n DBConnection.close(stmt);\n rs.close();\n\n } catch (SQLException e) {\n System.out.println(\"Exception!\");\n e.printStackTrace();\n }\n if(user != null) {\n targetUser = userIdentityMap.get(user.getId());\n if(targetUser == null) {\n userIdentityMap.put(user.getId(), user);\n return user;\n }\n else\n return targetUser;\n }\n return user;\n }",
"@Override\r\n public IUser getUserByUserId(String id)\r\n {\r\n EntityManager em = getEntityManager();\r\n\r\n try\r\n {\r\n return em.find(User.class, id);\r\n }\r\n finally\r\n {\r\n em.close();\r\n }\r\n }",
"@Override\r\n\tpublic User user(int id) {\r\n\t\tMap<String,String> map = getOne(SELECT_USERS+ WHERE_ID, id);\r\n\t\tif(map!= null){\r\n\t\t\treturn IMappable.fromMap(User.class, map);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public User getUserById(Long userId);",
"User findUserById(Long id) throws Exception;",
"public User findUserById(int id);",
"User get(Key id);",
"public User getUser(long id) {\n\t\tfactory = new Configuration().configure().buildSessionFactory();\n\t\tsession = factory.getCurrentSession();\n\t\tsession.beginTransaction();\n\t\tQuery query = session.createQuery(\"from User where idUser = :id \");\n\t\tquery.setParameter(\"id\", id);\n\t\tList<User> list = query.getResultList();\n\t\tsession.close();\n\t\treturn list.get(0);\n\t\t\n\t}",
"User findOne(Long id);",
"User findUserById(int id);",
"public User getUser(Integer id)\n\t{\n\t\t// Create an user -1 for when it isn't in the list\n\t\tUser searchUser = new User();\n\t\t// Index: User's position in the list\n\t\tint index = this.getUserById(id.intValue());\n\t\t// If the user is in the list execute the action\n\t\tif(index != -1)\n\t\t{\n\t\t\tsearchUser = this.usersList.get(index);\n\t\t}\n\t\t\n\t\treturn searchUser;\n\t}",
"User find(long id);",
"@Override\r\n\tpublic User findByIdUser(Integer id) {\n\t\treturn userReposotory.findById(id).get();\r\n\t}",
"public User getUserById(int id) {\n\t\treturn userDao.getUserById(id);\r\n\t}",
"public User getSingleUser(Integer id) {\n\n /*\n * Use the ConnectionFactory to retrieve an open\n * Hibernate Session.\n *\n */\n Session session = ConnectionFactory.getInstance().getSession();\n List results = null;\n try {\n\n results = session.find(\"from User as user where user.userId = ?\",\n new Object[]{id},\n new Type[]{Hibernate.INTEGER});\n\n\n\n } /*\n * If the object is not found, i.e., no Item exists with the\n * requested id, we want the method to return null rather\n * than throwing an Exception.\n *\n */ catch (ObjectNotFoundException onfe) {\n return null;\n } catch (HibernateException e) {\n /*\n * All Hibernate Exceptions are transformed into an unchecked\n * RuntimeException. This will have the effect of causing the\n * user's request to return an error.\n *\n */\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n if (results.isEmpty()) {\n return null;\n } else {\n return (User) results.get(0);\n }\n\n }",
"@Override\n\tpublic User getUserById(String id) {\n\t\tUser user = null;\n\t\tConnection connection = null;\n\t\ttry{\n\t\t\tconnection = BaseDao.getConnection();\n\t\t\tuser = userMapper.getUserById(connection,id);\n\t\t}catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t\tuser = null;\n\t\t}finally{\n\t\t\tBaseDao.closeResource(connection, null, null);\n\t\t}\n\t\treturn user;\n\t}",
"public PrototypeUser getUserById(Long id) {\n\t\treturn userDao.findById(id);\r\n\t}",
"@Override\n public User getUserById(int id) {\n Session session = this.sessionFactory.getCurrentSession(); \n User u = (User) session.load(User.class, new Integer(id));\n logger.info(\"User loaded successfully, User details=\"+u);\n return u;\n }",
"public User getUser(Integer id) {\n\t\treturn null;\n\t}",
"public User getUserById(int userId) {\n return this.userDao.selectByPrimaryKey(userId); \r\n }",
"User get(int userId) throws UserNotFoundException, SQLException;",
"public User selectByPrimaryKey(Long id) {\r\n User key = new User();\r\n key.setId(id);\r\n User record = (User) getSqlMapClientTemplate().queryForObject(\"spreader_tb_user.ibatorgenerated_selectByPrimaryKey\", key);\r\n return record;\r\n }",
"public User getById(int id) {\n\t\treturn userDao.getById(id);\n\t}",
"User getOne(long id) throws NotFoundException;",
"public User user(long id) {\n\t\tOptional<User> user = repository.findById(id);\n\n\t\tif (user.isPresent()) {\n\t\t\treturn user.get();\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\n\t}",
"public User getUser(long id) {\n\t\tUser user = null;\n\t\t\n\t\tString queryString = \n\t\t\t \"PREFIX sweb: <\" + Config.NS + \"> \" +\n\t\t\t \"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \" +\n\t\t\t \"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \" +\n\t\t\t \"PREFIX foaf: <http://xmlns.com/foaf/0.1/>\" +\n\t\t\t \"select * \" +\n\t\t\t \"where { \" +\n\t\t\t \t\"?user sweb:id \" + id + \".\" +\n\t\t\t \"} \\n \";\n\n\t Query query = QueryFactory.create(queryString);\n\t \n\t QueryExecution qe = QueryExecutionFactory.create(query, this.model);\n\t ResultSet results = qe.execSelect();\n\t \n\t while(results.hasNext()) {\n\t \tQuerySolution solution = results.nextSolution() ;\n\t Resource currentResource = solution.getResource(\"user\");\n\n\t user = this.buildUserFromResource(currentResource);\n\t \n\t user.setTweets(this.getTweetsByUserId(id));\n\t user.setVisited(this.getVenuesVisitedByUserId(id));\n\t user.setInContact(this.getInContactForUserId(id));\n\t }\n\t \n\t return user;\n\t}",
"public User selectoneuser(int id) {\n\t\tUser user = null;\n\t\tuser = new User();\n\t\tSystem.out.println(\"Userdao的id=\" + id);\n\t\tConnection conn = null;\n\t\tString sql = \"select * from users where id=\" + id;\n\t\tResultSet rs = null;\n\t\ttry {\n\t\t\tconn = ConnectDB.getconnect();\n\t\t\tPreparedStatement pstmt = conn.prepareStatement(sql);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tuser.setId(rs.getInt(\"id\"));\n user.setUsername(rs.getString(\"username\"));\n user.setPassword(rs.getString(\"password\"));\n user.setPhonenumber(rs.getString(\"phonenumber\"));\n user.setEmail(rs.getString(\"email\"));\n\t\t\t}\n\t\t\tpstmt.close();\n\t\t\tconn.close();\n\t\t\treturn user;\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"bookdao查询当前id结果失败\");\n\t\t}\n\t\treturn user;\n\t}",
"public User getUser(Long userId);",
"SysUser selectByPrimaryKey(Long userId);",
"public User getUser(int id) {\n User user = null;\n Session session = null;\n try {\n session = openSession();\n user = (User) session.get(User.class, id);\n } catch (HibernateException he) {\n logger.error(\"Hibernate Exception: \" + he);\n } catch (Exception e) {\n logger.error(\"Exception: \" + e);\n } finally {\n if (session != null) {\n session.close();\n }\n }\n return user;\n }",
"public User getUserById(String id) {\n // return userRepo.findById(id);\n\n return null;\n }",
"public User getUser(int id) {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic User1 getById(int userId) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\treturn (User1) session.get(User1.class, userId);\r\n\t}",
"@Override\r\n\tpublic User searchUser(Integer id) {\n\t\treturn userReposotory.getById(id);\r\n\t}",
"Optional<JUser> readById(Long id);",
"@Override\n\tpublic SimpleUser getSimpleUser(int idUser) {\n\t\treturn dao.getSimpleUser(idUser);\n\t}",
"public User findById(Long id);",
"public User getUserById(Serializable id) {\n\t\treturn (User)this.userDao.getEntryById(id);\r\n\t}",
"public User getUserFromId(final long id) {\n LOG.info(\"Getting user with id {}\", id);\n return userRepo.get(id);\n }",
"public User getUser(Long id) {\n\t\treturn userRepo.findByUserId(id);\n\t}",
"public User getUserById(Integer id) {\n\t\treturn userMapper.selectByPrimaryKey(id);\n\t}",
"@GetMapping(\"/list/{id}\")\n\tpublic User one(@PathVariable int id) {\n\t\treturn userService.findOne(id);\n\t}",
"public Object findUserById(long id) throws AccessException {\r\n if(userRepo.findById(id) == null) {\r\n throw new NoSuchElementException(\"No such user with \" + id + \" exist\");\r\n }\r\n\r\n BasicUserDetails authenticatedUser = (BasicUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n if(authenticatedUser.getId() != id)\r\n throw new AccessException(\"Cannot request user different than the authenticated user\");\r\n\r\n return userRepo.findById(id).getPrivateUser();\r\n }",
"public User getById(int id) {\n\t\t return (User)sessionFactory.getCurrentSession().get(User.class, id);\n\t}",
"public User getUserData(String id);",
"public User findOneUser(int id) {\n\t\treturn userMapper.findOneUser(id);\r\n\t}",
"@Override\n public User getUserById(int userId) {\n return this.userDao.selectByPrimaryKey(userId);\n }",
"@Override\r\n\tpublic User findById(int id) {\n\t\treturn userDAO.findById(id);\r\n\t}",
"User findOneById(long id);",
"private User findById(String id) {\n User result = new NullUserOfDB();\n for (User user : this.users) {\n if (user.getId().equals(id)) {\n result = user;\n break;\n }\n }\n return result;\n }",
"@Override\r\n\tpublic User getById(Integer id) {\n\t\treturn null;\r\n\t}",
"User findById(Long id);",
"@Override\r\n\tpublic Userinfo findbyid(int id) {\n\t\treturn userDAO.searchUserById(id);\r\n\t}",
"public User getUserFromID(String id) {\r\n // Gets the collection of users and creates a query\r\n MongoCollection<Document> users = mongoDB.getCollection(\"Users\");\r\n Document query = new Document(\"_id\", new ObjectId(id));\r\n\r\n // Loops over users found matching the details, returning the first one\r\n for (User user : users.find(query, User.class)) {\r\n return user;\r\n }\r\n\r\n // Returns null if none are found\r\n return null;\r\n }",
"UserInfo getUserById(Integer user_id);",
"@Override\r\n\tpublic LocalUser get(int id) {\n\t\treturn userDao.get(id);\r\n\t}",
"@RequestMapping(method=RequestMethod.GET, value=\"{id}\")\n\tpublic User getUser(@PathVariable Long id) {\n\t\treturn RestPreconditions.checkFound(repo.findByUserId(id));\n\t}",
"AdminUser selectByPrimaryKey(Integer id);",
"AdminUser selectByPrimaryKey(Integer id);",
"User getUser(String userId);",
"@Override\n\tpublic AppUser getUserById(int id) {\n\t\tAppUser user = store.get(id);\n return user;\n\t\t\n\t}",
"@Override\n\tpublic User findUserById(int id) {\n\t\treturn userDao.findUserById(id);\n\t}",
"@Override\r\n\tpublic TbUser findUserById(Long id) {\n\t\tTbUser tbUser = tbUserMapper.selectByPrimaryKey(id);\r\n\t\treturn tbUser;\r\n\t}",
"@Transactional\r\n\tpublic User getUserById(int id) {\n\t\treturn cuser.getUserById(id);\r\n\t}",
"public static User selectById(int id) {\n User user = new User();\n\n try (PreparedStatement ps = DBConnection.getConnection().prepareStatement(GET_BY_ID)){\n ps.setInt(1, id);\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n user.setUserId(rs.getInt(\"User_ID\"));\n user.setUserName(rs.getString(\"User_Name\"));\n user.setPassword(rs.getString(\"Password\"));\n user.setDateCreated(rs.getObject(\"Create_Date\", LocalDateTime.class));\n user.setCreatedBy(rs.getString(\"Created_By\"));\n user.setLastUpdate(rs.getTimestamp(\"Last_Update\"));\n user.setLastUpdatedBy(rs.getString(\"Last_Updated_By\"));\n //\n }\n } catch (SQLException err) {\n err.printStackTrace();\n }\n\n return user;\n }",
"public com.ims.dataAccess.tables.pojos.User fetchOneByUserid(Integer value) {\n return fetchOne(User.USER.USERID, value);\n }",
"@Override\n\tpublic User findByUserid(Serializable id) {\n\t\treturn this.userDao.findById(id);\n\t}",
"public static User getUser(String id){\n\t\tWSResponse response = null;\n\t\tUser user = null;\n\t\ttry{\n\t\tPromise<WSResponse> result = WS.url(Utils.getApiUrl()+Urls.GET_ONE_USER+id)\n\t\t\t\t\t\t\t\t\t\t.setContentType(Urls.CONTENT_TYPE_JSON)\n\t\t\t\t\t\t\t\t\t\t.get();\n\t\tresponse = result.get(10000);\n\t\tuser = new Gson().fromJson(response.getBody(), User.class);\n\t\t} catch(Exception exception){\n\t\t\tController.flash(Messages.ERROR, Messages.CANT_LOAD_USERS + exception);\n\t\t}\n\t\treturn user;\n\t}",
"public UserTO getUser (String id);",
"public User getSingleUserCurrentEmployee(Integer id) {\n\n /*\n * Use the ConnectionFactory to retrieve an open\n * Hibernate Session.\n *\n */\n Session session = ConnectionFactory.getInstance().getSession();\n List results = null;\n try {\n\n results = session.find(\"from User as user where user.userId = ? and currentEmployee='true'\",\n new Object[]{id},\n new Type[]{Hibernate.INTEGER});\n\n\n\n } /*\n * If the object is not found, i.e., no Item exists with the\n * requested id, we want the method to return null rather\n * than throwing an Exception.\n *\n */ catch (ObjectNotFoundException onfe) {\n return null;\n } catch (HibernateException e) {\n /*\n * All Hibernate Exceptions are transformed into an unchecked\n * RuntimeException. This will have the effect of causing the\n * user's request to return an error.\n *\n */\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n if (results.isEmpty()) {\n return null;\n } else {\n return (User) results.get(0);\n }\n\n }",
"User findUser(String userId);",
"public User getUser(String id) {\n\t\treturn null;\r\n\t}",
"@Override\r\n public Dorm findById(Integer id) {\n return userMapper.findById(id);\r\n }",
"User findById(long id);",
"User selectByPrimaryKey(String id);",
"public User getUserByID(long id)throws SQLException, ClassNotFoundException ;",
"public userreg showuser(String id) {\n\t\t\n\t\ttry{\n\t\t\tSession s = sessionFactory.openSession();\n\t\t\tTransaction t =s.getTransaction();\n\t\t\tt.begin();\n\t\t\tuserreg usr=s.get(userreg.class, id);\n\t\t\tt.commit();\n\t\t\ts.close();\n\t\t\treturn usr;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}",
"@Override\n public User findById(long id) {\n return dao.findById(id);\n }"
] | [
"0.81722796",
"0.81696755",
"0.81051624",
"0.81051624",
"0.8010532",
"0.7957359",
"0.7868448",
"0.78675115",
"0.7828805",
"0.7813528",
"0.77796257",
"0.77668893",
"0.7720128",
"0.77179766",
"0.77160704",
"0.7711062",
"0.7707422",
"0.7693406",
"0.7691206",
"0.76867414",
"0.768513",
"0.7674545",
"0.76515514",
"0.76401454",
"0.7628443",
"0.7628012",
"0.7627479",
"0.76212746",
"0.76190084",
"0.7612768",
"0.7609803",
"0.760695",
"0.7603777",
"0.760346",
"0.75775754",
"0.7572152",
"0.7545807",
"0.7544373",
"0.75381494",
"0.75370336",
"0.7531904",
"0.7515176",
"0.7513729",
"0.75033915",
"0.7503025",
"0.7501218",
"0.7500991",
"0.7498631",
"0.7497227",
"0.7494835",
"0.7492891",
"0.7481761",
"0.74813026",
"0.7479884",
"0.7478316",
"0.747596",
"0.7473626",
"0.74694365",
"0.74625176",
"0.7462428",
"0.7461867",
"0.7459078",
"0.7447486",
"0.7446494",
"0.74307066",
"0.74293894",
"0.74251497",
"0.7418624",
"0.7417969",
"0.74177146",
"0.74008703",
"0.73989636",
"0.7397241",
"0.7394476",
"0.73936236",
"0.738923",
"0.7387967",
"0.7383585",
"0.7375743",
"0.73746485",
"0.73746485",
"0.73706216",
"0.7366356",
"0.73636764",
"0.73537445",
"0.73529303",
"0.7351917",
"0.7342896",
"0.7341843",
"0.7341805",
"0.7340409",
"0.73284394",
"0.7324719",
"0.732373",
"0.73237044",
"0.73213047",
"0.7320999",
"0.73122156",
"0.73045343",
"0.7303155"
] | 0.7377117 | 78 |
Update A SINGLE USER BY ID | @PutMapping("/user/{id}")
public ResponseEntity<User> updateUser(@PathVariable("id") int id, @RequestBody User user) {
User currentUser = userDao.getUserById(id);
if (currentUser == null) {
return new ResponseEntity<User>(HttpStatus.NOT_FOUND);
} else {
currentUser.setFullName(user.getFullName());
currentUser.setUserName(user.getUserName());
currentUser.setEmail(user.getEmail());
userDao.update(currentUser);
return new ResponseEntity<User>(currentUser, HttpStatus.OK);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int updateUserById( User user);",
"void updateUserById(String username, User userData);",
"public User updateUser(User user);",
"public void update(User user);",
"public void updateUser(long userID) {\n \t}",
"@Override\n\tpublic boolean updateUser(Integer Id, User user) {\n\t\treturn false;\n\t}",
"public boolean update(User u);",
"void editUser(String uid, User newUser);",
"User modifyUser(Long user_id, User user);",
"public User updateUser(long id, UserDto userDto);",
"void updateUser(int id, UpdateUserDto updateUserDto);",
"void update(User user);",
"void update(User user);",
"public void updateUser(User user) {\n\t\t\r\n\t}",
"UpdateUserDto getUserWithId(int id);",
"public void updateUser(int uid, String name, String phone, String email, String password, int money, int credit);",
"ManageUserResponse updateUser(UserUpdateRequest user, Long userId);",
"public void updateUser() {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n Statement stmt = conn.createStatement();\n String query = \"update users set first_name='\" + firstName + \"', \";\n query += \"last_name='\" + lastName + \"', \";\n query += \"phone_number='\" + phoneNumber + \"', \";\n query += \"email='\" + email + \"', \";\n query += \"address='\" + address + \"', \";\n query += \"id_city='\" + idCity + \"' \";\n query += \"where id_user = \" + id;\n stmt.executeUpdate(query);\n\n User updatedUser = findUser(id);\n updatedUser.setFirstName(firstName);\n updatedUser.setLastName(lastName);\n updatedUser.setPhoneNumber(phoneNumber);\n updatedUser.setEmail(email);\n updatedUser.setIdCity(idCity);\n updatedUser.setAddress(address);\n\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n }",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"public void update(User obj) {\n\t\t\n\t}",
"@Headers({\n \"Content-Type:application/json\"\n })\n @PUT(\"administrators/{id}\")\n Call<Void> updateUser(\n @retrofit2.http.Path(\"id\") Integer id, @retrofit2.http.Body UserBody userBody\n );",
"@Override\r\n\tpublic void update(User1 userId) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tUser1 user = (User1) session.get(User1.class, (Serializable) userId);\r\n\t\tsession.update(user);\r\n\t}",
"void update(User user) throws SQLException;",
"void updateUser(@Nonnull User user);",
"int updateByPrimaryKey(BaseUser record);",
"@Override\n\tpublic void update(User objetc) {\n\t\tuserDao.update(objetc);\n\t}",
"@Override\n\tpublic void update(Connection conn, User user,Long id) throws SQLException {\n\t\tString updateSql=\"update tbl_user set name=?,password=?,email=?where id=?\";\n\t\tPreparedStatement ps=conn\n\t\t\t\t.prepareCall(updateSql);\n\t\tps.setString(1, user.getName());\n\t\tps.setString(2, user.getPassword());\n\t\tps.setString(3, user.getEmail());\n\t\tps.setLong(4, id);\n\t\tps.execute();\n\t}",
"@Override\n\tpublic void updateUser(user theUser) {\n\t}",
"public void updateUser(Person user) {\n\t\t\n\t}",
"User editUser(User user);",
"int updateByPrimaryKey(UUser record);",
"@Override\n\tpublic void updateUser(User pUser) {\n\t\t\n\t}",
"void updateUser(User entity) throws UserDaoException;",
"int updateByPrimaryKey(AdminUser record);",
"int updateByPrimaryKey(AdminUser record);",
"void updateUser(UserDTO user);",
"@Override\n\tpublic void updateUser(User user)\n\t{\n\n\t}",
"int updateByPrimaryKey(UserEntity record);",
"int updateByPrimaryKey(SysUser record);",
"UserEntity updateUser(UserEntity userEntity);",
"public void editUser(User user) {\n\t\t\n\t}",
"public void updateUser(int id, User user) {\n\t\tEntityManager entityManager = HandleConnectionToDB.getEntityManager();\n\t\tUser userFind = entityManager.find(User.class, id);\n\n\t\tentityManager.getTransaction().begin();\n\t\tuserFind.setPicture(user.getPicture());\n\t\tuserFind.setPassword(user.getPassword());\n\t\tuserFind.setUsername(user.getUsername());\n\t\tentityManager.getTransaction().commit();\n\t}",
"public void update(User u) {\n\r\n\t}",
"ResponseMessage updateUser(final User user);",
"@Override\r\n\tpublic int updateUser(Users user) {\n\t\treturn 0;\r\n\t}",
"public void updateUser(User oldUser, User newUser) ;",
"@Override\n\tpublic void updateOne(User u) {\n\t\tdao.updateInfo(u);\n\t}",
"int updateByPrimaryKey(Userinfo record);",
"public int updateUser(User user) {\n\t\t\n\t\treturn 1;\n\t}",
"UpdateUserResult updateUser(UpdateUserRequest updateUserRequest);",
"int updateByPrimaryKey(UserDO record);",
"public static int update(User u){ \n int status=0; \n try{ \n //membuka koneksi\n Connection con=Koneksi.openConnection();\n //melakukan query database untuk merubah data berdasarkan id atau primary key\n PreparedStatement ps=con.prepareStatement( \n \"update t_user set user_name=?,nama_lengkap=?,password=?,hak_akses=? where id=?\"); \n ps.setString(1,u.getUserName()); \n ps.setString(2,u.getNamaLengkap()); \n ps.setString(3,u.getPassword()); \n ps.setString(4,u.getHakAkses()); \n ps.setInt(5,u.getId()); \n status=ps.executeUpdate(); \n }catch(Exception e){System.out.println(e);} \n return status; \n }",
"public Account update(Account user);",
"void updateUser(Integer id, Long version, UserBuilder userBuilder);",
"int updateByPrimaryKey(RoleUser record);",
"void setUser(User user, int id) {\n this.user = user;\n this.id = id;\n }",
"E update(IApplicationUser user, ID id, U updateDto);",
"int updateByPrimaryKey(RegsatUser record);",
"@Override\r\n\tpublic int updateByPrimaryKey(User record) {\n\t\treturn userDao.updateByPrimaryKey(record);\r\n\t}",
"@Override\n public boolean updateUserById(User user ) {\n boolean tag=false;\n this.sqlSession = MyBatisUtils.getSqlSession();\n tag = this.sqlSession.getMapper(UserDao.class).updateUserInfoById(user);\n sqlSession.commit();\n return tag;\n }",
"int updateByPrimaryKey(SysRoleUser record);",
"int updateByPrimaryKeySelective(User record);",
"int updateByPrimaryKeySelective(User record);",
"int updateByPrimaryKeySelective(User record);",
"int updateByPrimaryKeySelective(User record);",
"int updateByPrimaryKeySelective(User record);",
"int updateByPrimaryKeySelective(User record);",
"int updateByPrimaryKeySelective(User record);",
"int updateByPrimaryKeySelective(User record);",
"@Override\r\n\tpublic int updateByPrimaryKeySelective(User record) {\n\t\treturn userDao.updateByPrimaryKeySelective(record);\r\n\t}",
"@Override\n\tpublic int update(Users user) {\n\t\treturn userDAO.update(user);\n\t}",
"@Override\r\n\tpublic void updateUser(User user) throws ToDoListDAOException{\r\n\t\t// TODO Auto-generated method stub\r\n\t\t Session session = factory.openSession();\r\n\t\t try\r\n\t\t {\r\n\t\t session.beginTransaction();\r\n\t\t Query query = session.createQuery(\"from User where userName = :user\");\r\n\t\t User ifUserExist =(User) query.setParameter(\"user\",user.getUserName()).uniqueResult();\r\n\t\t long id = ifUserExist.getId();\r\n\t\t Query query2 = session.createQuery(\"UPDATE User SET password = :pass , userName= :user\" +\r\n\t\t \" where id = :d\");\r\n\t\t query2.setParameter(\"pass\", user.getPassword());\r\n\t\t query2.setParameter(\"user\", user.getUserName());\r\n\t\t query2.setParameter(\"d\", id);\r\n\t\t query2.executeUpdate();\r\n\t\t session.getTransaction().commit();\r\n\t\t \r\n\t\t }\r\n\t\t catch (HibernateException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t if(session.getTransaction()!=null) session.getTransaction().rollback();\r\n\t\t }\r\n\t\t finally\r\n\t\t {\r\n\t\t\t if(session != null) \r\n\t\t\t\t{ \r\n\t\t\t\t\tsession.close(); \r\n\t\t\t\t} \r\n\t\t } \r\n\t}",
"public void update(com.conurets.inventory.model.User model) throws InventoryException {\n }",
"public User update(User user)throws Exception;",
"public int Edituser(Long userid, Long brokerId, String firstname,\r\n\t\tString lastname, String address, String city, String eMail, Long phone,\r\n\t\tLong pincode) throws SQLException {\n\tLong useridd=null;\r\n\trs=DbConnect.getStatement().executeQuery(\"select user_id from customer where login_id=\"+userid+\"\");\r\n\tif(rs.next())\r\n\t{\r\n\t\tuseridd=rs.getLong(1);\r\n\t}\r\n\tint i=DbConnect.getStatement().executeUpdate(\"update customer set address='\"+address+\"',city='\"+city+\"',e_mail='\"+eMail+\"',phone=\"+phone+\",pincode=\"+pincode+\" where user_id=\"+useridd+\"\");\r\n\treturn i;\r\n}",
"public String updateUser(){\n\t\tusersservice.update(usersId, username, password, department, role, post, positionId);\n\t\treturn \"Success\";\n\t}",
"private void editUser(){\n getDeviceLocation();\n ProxyBuilder.SimpleCallback<User> callback = returnedUser-> responseEdit(returnedUser);\n ServerManager.editUserProfile(userManager,callback);\n }",
"int updateByPrimaryKey(LikeUser record);",
"int updateByPrimaryKeySelective(UUser record);",
"private static void updateUserTest(Connection conn) {\n\t\t\n\t\ttry {\n\t\t\tUser existingUser = User.loadUserById(conn, 3); // User user = User.loadUserById(conn, 3);\n\t\t\t// the same id is preserved\n\t\t\texistingUser.setUsername(\"jo\");\n\t\t\texistingUser.setEmail(\"jo@wp.pl\");\n\t\t\texistingUser.setUserGroupId(2);\n\t\t\texistingUser.saveToDB(conn);\n\t\t\t\n\t\t\t/*Następnie\tnależy\tsprawdzić,\tczy:\n\t\t\t\t1.\t Czy\twpis\tw\tbazie\tdanych\tma\twszystkie\n\t\t\t\tdane\todpowiednio\tponastawiane?\n\t\t\t\t2.\t Czy\tobiekt\tma\tnastawione\tpoprawne\tid? - czyli niezmienione, bo nie mamy settera dla id\n\t\t\t\t3.\t Czy\tnie\tdodał\tsię\tnowy\twpis\tw\tbazie?*/\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"@Override\r\n\tpublic int updateUser(User user, String userName) {\n\t\treturn 0;\r\n\t}",
"public void setIdUser(int value) {\n this.idUser = value;\n }",
"@Override\n\tpublic Usuario updateUsuario(Long id, Usuario usr) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic int update(TbUser user) {\n\t\treturn new userDaoImpl().update(user);\n\t}",
"int updateByPrimaryKeySelective(AdminUser record);",
"int updateByPrimaryKeySelective(AdminUser record);",
"int updateByPrimaryKeySelective(RegsatUser record);",
"int updateByPrimaryKey(WbUser record);",
"int updateByPrimaryKey(LitemallUserFormid record);",
"@Override\n public User update(User user) {\n return dao.update(user);\n }",
"int updateByPrimaryKey(R_dept_user record);",
"@Override\n\tpublic ApplicationResponse updateUser(String id, UserRequest request) {\n\t\tUserEntity user = null;\n\t\tOptional<UserEntity> userEntity = repository.findById(id);\n\t\tif (userEntity.isPresent()) {\n\t\t\tuser = userEntity.get();\n\t\t\tif (!StringUtils.isEmpty(request.getFirstName())) {\n\t\t\t\tuser.setFirstName(request.getFirstName());\n\t\t\t}\n\t\t\tif (!StringUtils.isEmpty(request.getSurName())) {\n\t\t\t\tuser.setSurName(request.getSurName());\n\t\t\t}\n\t\t\tif (!StringUtils.isEmpty(request.getDob())) {\n\t\t\t\tuser.setDob(request.getDob());\n\t\t\t}\n\t\t\tif (!StringUtils.isEmpty(request.getTitle())) {\n\t\t\t\tuser.setTitle(request.getTitle());\n\t\t\t}\n\t\t\tuser = repository.save(user);\n\t\t\treturn new ApplicationResponse(true, \"Success\", enitytomodel.apply(user));\n\t\t} else {\n\t\t\tthrow new UserNotFoundException(\"User not found\");\n\t\t}\n\t}",
"public User updateone_user(User user) {\n\t\tConnection conn=null;\t\t\t\n\t\tString sql = \"update users set username=?,password=?,phonenumber=?,email=? where id=?\";\n\t\t\n\t\ttry {\n\t \t conn =ConnectDB.getconnect();\n\t\t\t\t\tPreparedStatement pstmt=conn.prepareStatement(sql);\t\n\t\t\t\tpstmt.setString(1, user.getUsername());\n\t\t\t\tpstmt.setString(2,user.getPassword());\n\t\t\t\tpstmt.setString(3,user.getPhonenumber());\n\t\t\t\tpstmt.setString(4, user.getEmail());\n\t\t\t\tpstmt.setInt(5, user.getId());\n\t\t\t\t System.out.println(\"userDAO修改的user.getUsername()=\"+user.getUsername());\n\t\t\t\t\n\t\t\tpstmt.executeUpdate();\n\t\t\t\tpstmt.close();\n\t\t\t\tconn.close();\n\t\t\t\treturn user;\n\t\t\t\t}catch (Exception e) {\n\t\t\t\t\te.printStackTrace() ;\n\t\t\t\t System.out.println(\"修改一行数据失败\");\n\t\t\t\t}\t\n\t\treturn user;\n\t}"
] | [
"0.8160323",
"0.7944637",
"0.7816186",
"0.76653206",
"0.7640054",
"0.7613651",
"0.76066417",
"0.75891465",
"0.7563335",
"0.7509599",
"0.7505321",
"0.7502035",
"0.7502035",
"0.74622405",
"0.73577315",
"0.7343817",
"0.73416287",
"0.73290217",
"0.7320184",
"0.7320184",
"0.7320184",
"0.7320184",
"0.7320184",
"0.7320184",
"0.7320184",
"0.7320184",
"0.7320184",
"0.73138875",
"0.72922117",
"0.7267235",
"0.72483045",
"0.7224313",
"0.7217218",
"0.7213663",
"0.72046375",
"0.717159",
"0.7171549",
"0.71658456",
"0.71425045",
"0.7140616",
"0.71303254",
"0.7130271",
"0.7130271",
"0.71300673",
"0.7108236",
"0.7100551",
"0.7089394",
"0.7074207",
"0.70732987",
"0.70731694",
"0.70617634",
"0.7038568",
"0.70080453",
"0.6995763",
"0.6994314",
"0.6992314",
"0.6989819",
"0.69822234",
"0.69770014",
"0.6969829",
"0.6958254",
"0.69548905",
"0.69386077",
"0.69378066",
"0.693743",
"0.6936006",
"0.6923563",
"0.6920093",
"0.691948",
"0.69159806",
"0.69159806",
"0.69159806",
"0.69159806",
"0.69159806",
"0.69159806",
"0.69159806",
"0.69159806",
"0.6913655",
"0.69001967",
"0.6883298",
"0.6880553",
"0.6871645",
"0.68644345",
"0.68622947",
"0.68576527",
"0.68576306",
"0.6855177",
"0.6842385",
"0.6836498",
"0.68324083",
"0.6826059",
"0.6823748",
"0.68182063",
"0.68182063",
"0.68047905",
"0.6803253",
"0.6803083",
"0.68003887",
"0.6796083",
"0.6795808",
"0.67956114"
] | 0.0 | -1 |
Delete A Single by user | @DeleteMapping("/user/{id}")
public ResponseEntity<User> deleteUser(@PathVariable("id") int id) {
User currentUser = userDao.getUserById(id);
if (currentUser == null) {
return new ResponseEntity<User>(HttpStatus.NOT_FOUND);
} else {
userDao.delete(currentUser);
return new ResponseEntity<User>(HttpStatus.NO_CONTENT);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void delete(User user);",
"void delete(User user);",
"public boolean delete(User user);",
"public User delete(User user);",
"boolean delete(User user);",
"public User delete(String user);",
"public void delete(User user)throws Exception;",
"public void delete(User obj) {\n\t\t\n\t}",
"@Override\n\tpublic void deleteUser(user theUser) {\n\t\t\n\t}",
"void deleteUser(String deleteUserId);",
"void deleteUser(int id);",
"public void delete(User usuario);",
"public void deleteUser(User userToDelete) throws Exception;",
"@Override\n\tpublic void deleteOne(User u) {\n\t\tdao.deleteOne(u);\n\t}",
"void deleteUser(String userId);",
"public void deleteUser(long userId);",
"@Override\r\n\tpublic void delete(UserMain user) {\n\t\tusermaindao.delete(user);\r\n\t}",
"public void delete(String username);",
"@Override\n\tpublic void deleteUser(User user)\n\t{\n\n\t}",
"@Override\n\tpublic void delete(User entity) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(User entity) {\n\t\tuserlist.remove(String.valueOf(entity.getDni()));\n\t}",
"void deleteUserById(Integer id);",
"void deleteUserById(Long id);",
"@Override\r\n\tpublic int delete(User user) {\n\t\treturn 0;\r\n\t}",
"public boolean delete(int userId);",
"public void delete(User user){\n userRepository.delete(user);\n }",
"void deleteUser( String username );",
"public void deleteUser(String username);",
"public void deleteUser(String name);",
"@Override\n\tpublic void delete(User user) throws DAOException {\n\t\t\n\t}",
"public void deleteUser(ExternalUser userMakingRequest, String userId);",
"public void deleteUser(Integer uid);",
"public void deleteUserById(Long userId);",
"@Override\n public void delete(User user) {\n dao.delete(user);\n }",
"@Override\n\tpublic void deleteUser(String id) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic String delete(User user) {\n\t\treturn null;\n\t}",
"void deleteUser(User user, String token) throws AuthenticationException;",
"int deleteByPrimaryKey(Integer user);",
"boolean delete(int id, int userId);",
"@Override\n\tpublic void deleteItem(Long id) {\n\t\tUser user = new User();\n\t\tuser.setId(id);\n\t\tuserRepository.delete(user);\n\t\tSystem.out.println(\"user deleted with succes !\");\n\t}",
"public void delete(User user) {\n repository.delete(user);\n }",
"void deleteUser(String username) throws UserDaoException;",
"void DeleteCompteUser(int id);",
"@Override\n\tpublic void deleteUser(String userId) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(User user)\n\t{\n\t\tuserDAO.delete(user);\n\t}",
"@Override\r\n\tpublic void delete(User user) {\n\t\tint iRet = dao.delete(user);\r\n\t\tif(iRet != 1){\r\n\t\t\tlogger.error(\"删除失败\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.info(\"删除成功\");\r\n\t}",
"@Override\n\tpublic void deleteUserById(Integer id) {\n\n\t}",
"@Override\r\n\tpublic void delete(User user) {\n\t\tuserDao.delete(user);\r\n\t}",
"public void destroy(User user);",
"public void deleteUser(IndividualUser user) {\n try{\n PreparedStatement s = sql.prepareStatement(\"DELETE FROM Users WHERE userName=? AND id=? AND firstName=? AND lastName=?;\");\n s.setString(1, user.getId());\n s.setInt(2,user.getIdNum());\n s.setString(3, user.getFirstName());\n s.setString(4, user.getLastName());\n s.execute();\n s.close();\n } catch (SQLException e) {\n sqlException(e);\n }\n }",
"@Override\n\tpublic void deleteUser(User user) {\n\t\topenSession().createQuery(\"DELETE FROM User where userId =\" + user.getUserId()).executeUpdate();\n\t\t\n\t}",
"public void deleteUser(int userid) {\n\t\t\n\t}",
"public void deleteUser(Integer id) throws BadRequestException;",
"int deleteByPrimaryKey(String pkUserid);",
"@Override\n\tpublic Boolean deleteUser(User user) {\n\t\treturn null;\n\t}",
"@RolesAllowed(\"admin\")\n @DELETE\n public Response delete() {\n synchronized (Database.users) {\n User user = Database.users.remove(username);\n if (user == null) {\n return Response.status(404).\n type(\"text/plain\").\n entity(\"User '\" + username + \"' not found\\r\\n\").\n build();\n } else {\n Database.usersUpdated = new Date();\n synchronized (Database.contacts) {\n Database.contacts.remove(username);\n }\n }\n }\n return Response.ok().build();\n }",
"@Override\n\tpublic void delete(String username) throws Exception {\n\t\t\n\t}",
"public void delete() throws NotFoundException {\n\tUserDA.delete(this);\n }",
"@Override\n public boolean deleteUser(User user) {\n return false;\n }",
"@Override\n\tpublic User delete(User t) {\n\t\treturn null;\n\t}",
"public void deleteUser(long id){\n userRepository.deleteById(id);\n }",
"@Override\r\n\tpublic void deleteByUser(User user) {\n\t\tuserReposotory.delete(user);\r\n\t}",
"void deleteUser(int id) throws DataAccessException;",
"@Override\r\n\tpublic void deleteByIdUser(int id) {\n\t\tuserReposotory.deleteById(id);\r\n\t}",
"public EdcTerminal delete (EdcTerminal object,ActionUser user) throws Exception{\r\n\t\t\r\n\t\t\r\n\t\tobject.setDeletedTime (new java.sql.Timestamp (System.currentTimeMillis()));\r\n\t\tobject.setDeletedStatus(1);\r\n\t\t\r\n\t\tif (user != null){\r\n\t\t\tif (user.getUser() != null){\r\n\t\t\t\tobject.setDeletedBy(user.getUser().getUsername());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tedcTerminalDao.update (object);\r\n\t\treturn object;\r\n\t}",
"@Delete({\r\n \"delete from umajin.user_master\",\r\n \"where user_id = #{user_id,jdbcType=INTEGER}\"\r\n })\r\n int deleteByPrimaryKey(Integer user_id);",
"public void delete(User user) {\n\t\tuserDao.delete(user);\n\t}",
"public EdcTerminal delete (java.io.Serializable pkey,ActionUser user) throws Exception{\r\n\t\tEdcTerminal object = edcTerminalDao.get (pkey);\r\n\r\n\t\t\r\n\t\tobject.setDeletedTime (new java.sql.Timestamp (System.currentTimeMillis()));\r\n\t\tobject.setDeletedStatus(1);\r\n\t\t\r\n\t\tif (user != null){\r\n\t\t\tif (user.getUser() != null){\r\n\t\t\t\tobject.setDeletedBy(user.getUser().getUsername());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tedcTerminalDao.update (object);\r\n\t\treturn object;\r\n\t}",
"@Override\r\n\tpublic int deleteUser(Users user) {\n\t\treturn 0;\r\n\t}",
"public void deleteExercise(User user) {\n\n\t}",
"public void deleteAccount(String userName) {\n\n }",
"int deleteByExample(UUserExample example);",
"@Override\n\tpublic void delete(Connection conn, User user) throws SQLException {\n\t\tString deleteSql=\"delete from tbl_user where id=?\";\n\t\tPreparedStatement ps=conn\n\t\t\t\t.prepareCall(deleteSql);\n\t\tps.setLong(1, user.getId());\n\t\tps.execute();\n\t\t\n\t}",
"@Override\n\tpublic void deleteUser(NguoiDung nd) {\n\n\t}",
"int deleteByPrimaryKey(String userId);",
"int deleteByPrimaryKey(String userId);",
"int deleteByPrimaryKey(String userId);",
"@Override\n public boolean deleteUser(User user) {\n return controller.deleteUser(user);\n }",
"@Override\n\tpublic int delete(Users user) {\n\t\t\n\t\treturn userDAO.delete(user);\n\t}",
"public void deleteUser(Userlist user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USERLIST, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getID())});\n db.close();\n }",
"@Override\n\tpublic void deleteUser() {\n\t\tLog.d(\"HFModuleManager\", \"deleteUser\");\n\t}",
"public void deleteUtente(String user)\n\t{\n\t\tUtente daCanc=retriveByUsername(user);\n\t\tem.remove(em.merge(daCanc));\n\t}",
"public void deleteUser(User user) {\n\t\tdelete(user);\r\n\t}",
"int deleteByExample(UserTExample example);",
"public void deleteUsuario(Usuario usuario) {\n\t\t\n\t}",
"public Boolean DeleteUser(User user){\n\t\t\treturn null;\n\t\t}",
"@Override\n\tpublic int delete(String username) {\n\t\tUsers user = userDAO.read(username);\n\t\treturn delete(user);\n\t}",
"@Override\r\n\tpublic User delete(String id) {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic void delete(UserServer obj) {\n\t\ttry {\n\t\t\tstat = conn.prepareStatement(\" DELETE FROM client \" + \" WHERE idclient = ? \");\n\t\t\tstat.setInt(1, obj.getId());\n\t\t\tstat.execute();\n\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n\tpublic User delete(Integer id) {\n\t\treturn null;\n\t}",
"DeleteUserResult deleteUser(DeleteUserRequest deleteUserRequest);",
"@Override\n\tpublic void delete(String userId) throws Exception {\n\t\tdao.delete(userId);\n\t}",
"public String deleteUser(){\n\t\tusersservice.delete(usersId);\n\t\treturn \"Success\";\n\t}",
"@Override\r\n\tpublic void delete(Usuario t) {\n\t\t\r\n\t}",
"int deleteByPrimaryKey(Long userId);",
"int deleteByPrimaryKey(Long userId);",
"int deleteByPrimaryKey(Long userId);",
"public void deleteUser(User user) {\n\t\t\r\n\t\tsessionFactory.getCurrentSession().delete(user);\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void delete(Unidade obj) {\n\n\t}",
"public static int delete(User u){ \n int status=0; \n try{ \n //membuka koneksi\n Connection con=Koneksi.openConnection(); \n //melakukan query database untuk menghapus data berdasarkan id atau primary key\n PreparedStatement ps=con.prepareStatement(\"delete from t_user where id=?\"); \n ps.setInt(1,u.getId()); \n status=ps.executeUpdate(); \n }catch(Exception e){System.out.println(e);} \n\n return status; \n }",
"public void deleteUser(User user) {\n update(\"DELETE FROM user WHERE id = ?\",\n new Object[] {user.getId()});\n }"
] | [
"0.81607884",
"0.81607884",
"0.8071202",
"0.80488384",
"0.801818",
"0.79487497",
"0.7867568",
"0.78395206",
"0.7736434",
"0.7727804",
"0.77022415",
"0.76576537",
"0.7648785",
"0.7637391",
"0.763248",
"0.7629366",
"0.7622387",
"0.7591764",
"0.7585424",
"0.756183",
"0.75497884",
"0.75413316",
"0.7540713",
"0.75382566",
"0.7492121",
"0.74479336",
"0.73997176",
"0.7384656",
"0.73623115",
"0.73489326",
"0.73469",
"0.734578",
"0.7318311",
"0.7311879",
"0.730542",
"0.7295705",
"0.7293325",
"0.72586983",
"0.72467047",
"0.72455245",
"0.7242032",
"0.71984905",
"0.7192767",
"0.71707255",
"0.7156519",
"0.7155282",
"0.7149442",
"0.7147781",
"0.71437687",
"0.7135875",
"0.71266824",
"0.710879",
"0.7102956",
"0.70998126",
"0.70838374",
"0.7049785",
"0.7034012",
"0.7031106",
"0.70302415",
"0.7028801",
"0.7025105",
"0.701082",
"0.6999999",
"0.6996428",
"0.69940555",
"0.69791853",
"0.6975303",
"0.69704616",
"0.69652414",
"0.6963473",
"0.69552827",
"0.69504035",
"0.693198",
"0.69150496",
"0.6914222",
"0.6914222",
"0.6914222",
"0.6910069",
"0.69012654",
"0.68995917",
"0.68963015",
"0.68752426",
"0.6874611",
"0.68729013",
"0.68650883",
"0.6863061",
"0.68619365",
"0.6855779",
"0.68538207",
"0.6850815",
"0.685033",
"0.68349415",
"0.68336624",
"0.6829865",
"0.68283623",
"0.68283623",
"0.68283623",
"0.6827447",
"0.6826439",
"0.68257105",
"0.6821908"
] | 0.0 | -1 |
from class: kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.2 / JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, kotlin.coroutines.Continuation] / JADX WARNING: Removed duplicated region for block: B:10:0x0024 / JADX WARNING: Removed duplicated region for block: B:16:0x005e / JADX WARNING: Removed duplicated region for block: B:22:0x009a A[RETURN] / JADX WARNING: Removed duplicated region for block: B:23:0x009b A[PHI: r10 PHI: (r10v2 java.lang.Object) = (r10v3 java.lang.Object), (r10v1 java.lang.Object) binds: [B:21:0x0098, B:12:0x0028] A[DONT_GENERATE, DONT_INLINE], RETURN] | @Override // kotlinx.coroutines.flow.FlowCollector
/* Code decompiled incorrectly, please refer to instructions dump. */
public java.lang.Object emit(java.lang.Object r9, kotlin.coroutines.Continuation r10) {
/*
r8 = this;
boolean r0 = r10 instanceof kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1
if (r0 == 0) goto L_0x0013
r0 = r10
kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r0 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r0
int r1 = r0.label
r2 = -2147483648(0xffffffff80000000, float:-0.0)
r3 = r1 & r2
if (r3 == 0) goto L_0x0013
int r1 = r1 - r2
r0.label = r1
goto L_0x0018
L_0x0013:
kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r0 = new kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1
r0.<init>(r10)
L_0x0018:
java.lang.Object r10 = r0.result
java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
int r2 = r0.label
r3 = 2
r4 = 1
if (r2 == 0) goto L_0x005e
if (r2 == r4) goto L_0x0044
if (r2 != r3) goto L_0x003c
java.lang.Object r8 = r0.L$6
kotlinx.coroutines.flow.FlowCollector r8 = (kotlinx.coroutines.flow.FlowCollector) r8
java.lang.Object r8 = r0.L$4
kotlin.coroutines.Continuation r8 = (kotlin.coroutines.Continuation) r8
java.lang.Object r8 = r0.L$2
kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r8 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r8
java.lang.Object r8 = r0.L$0
kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2 r8 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2) r8
kotlin.ResultKt.throwOnFailure(r10)
goto L_0x009b
L_0x003c:
java.lang.IllegalStateException r8 = new java.lang.IllegalStateException
java.lang.String r9 = "call to 'resume' before 'invoke' with coroutine"
r8.<init>(r9)
throw r8
L_0x0044:
java.lang.Object r8 = r0.L$6
kotlinx.coroutines.flow.FlowCollector r8 = (kotlinx.coroutines.flow.FlowCollector) r8
java.lang.Object r9 = r0.L$5
java.lang.Object r2 = r0.L$4
kotlin.coroutines.Continuation r2 = (kotlin.coroutines.Continuation) r2
java.lang.Object r4 = r0.L$3
java.lang.Object r5 = r0.L$2
kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2$1 r5 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.AnonymousClass1) r5
java.lang.Object r6 = r0.L$1
java.lang.Object r7 = r0.L$0
kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2 r7 = (kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2) r7
kotlin.ResultKt.throwOnFailure(r10)
goto L_0x0084
L_0x005e:
kotlin.ResultKt.throwOnFailure(r10)
kotlinx.coroutines.flow.FlowCollector r10 = kotlinx.coroutines.flow.FlowCollector.this
kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1 r2 = r2
kotlin.jvm.functions.Function2 r2 = r2.$action$inlined
r0.L$0 = r8
r0.L$1 = r9
r0.L$2 = r0
r0.L$3 = r9
r0.L$4 = r0
r0.L$5 = r9
r0.L$6 = r10
r0.label = r4
java.lang.Object r2 = r2.invoke(r9, r0)
if (r2 != r1) goto L_0x007e
return r1
L_0x007e:
r7 = r8
r4 = r9
r6 = r4
r8 = r10
r2 = r0
r5 = r2
L_0x0084:
r0.L$0 = r7
r0.L$1 = r6
r0.L$2 = r5
r0.L$3 = r4
r0.L$4 = r2
r0.L$5 = r9
r0.L$6 = r8
r0.label = r3
java.lang.Object r10 = r8.emit(r9, r0)
if (r10 != r1) goto L_0x009b
return r1
L_0x009b:
return r10
*/
throw new UnsupportedOperationException("Method not decompiled: kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override // kotlinx.coroutines.flow.Flow\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public java.lang.Object collect(kotlinx.coroutines.flow.FlowCollector<? super T> r12, kotlin.coroutines.Continuation<? super kotlin.Unit> r13) {\n /*\n // Method dump skipped, instructions count: 254\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlinx.coroutines.flow.StateFlowImpl.collect(kotlinx.coroutines.flow.FlowCollector, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"public java.lang.Object mo13025a(boolean r18, kotlin.coroutines.Continuation<? super kotlin.Unit> r19) {\n /*\n r17 = this;\n r0 = r17\n r1 = r19\n boolean r2 = r1 instanceof p008c.p009a.p024e.p026b.C0963b.C0971h\n if (r2 == 0) goto L_0x0017\n r2 = r1\n c.a.e.b.b$h r2 = (p008c.p009a.p024e.p026b.C0963b.C0971h) r2\n int r3 = r2.f1092b\n r4 = -2147483648(0xffffffff80000000, float:-0.0)\n r5 = r3 & r4\n if (r5 == 0) goto L_0x0017\n int r3 = r3 - r4\n r2.f1092b = r3\n goto L_0x001c\n L_0x0017:\n c.a.e.b.b$h r2 = new c.a.e.b.b$h\n r2.<init>(r0, r1)\n L_0x001c:\n java.lang.Object r1 = r2.f1091a\n java.lang.Object r9 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r3 = r2.f1092b\n r10 = 4\n r11 = 3\n r4 = 1\n r5 = 2\n if (r3 == 0) goto L_0x00a4\n if (r3 == r4) goto L_0x0093\n if (r3 == r5) goto L_0x0072\n if (r3 == r11) goto L_0x0053\n if (r3 != r10) goto L_0x004b\n java.lang.Object r3 = r2.f1098h\n java.util.List r3 = (java.util.List) r3\n java.lang.Object r3 = r2.f1097g\n java.util.Map r3 = (java.util.Map) r3\n java.lang.Object r3 = r2.f1096f\n org.mobileid.requester.web_service.Response r3 = (org.mobileid.requester.web_service.Response) r3\n java.lang.Object r3 = r2.f1095e\n java.lang.String r3 = (java.lang.String) r3\n java.lang.Object r2 = r2.f1094d\n c.a.e.b.b r2 = (p008c.p009a.p024e.p026b.C0963b) r2\n kotlin.ResultKt.throwOnFailure(r1)\n goto L_0x01c5\n L_0x004b:\n java.lang.IllegalStateException r1 = new java.lang.IllegalStateException\n java.lang.String r2 = \"call to 'resume' before 'invoke' with coroutine\"\n r1.<init>(r2)\n throw r1\n L_0x0053:\n java.lang.Object r3 = r2.f1098h\n java.util.List r3 = (java.util.List) r3\n java.lang.Object r4 = r2.f1097g\n java.util.Map r4 = (java.util.Map) r4\n java.lang.Object r5 = r2.f1096f\n org.mobileid.requester.web_service.Response r5 = (org.mobileid.requester.web_service.Response) r5\n java.lang.Object r6 = r2.f1095e\n java.lang.String r6 = (java.lang.String) r6\n boolean r7 = r2.f1099i\n java.lang.Object r8 = r2.f1094d\n c.a.e.b.b r8 = (p008c.p009a.p024e.p026b.C0963b) r8\n kotlin.ResultKt.throwOnFailure(r1)\n r13 = r5\n r14 = r6\n r6 = r3\n r3 = r8\n goto L_0x01ad\n L_0x0072:\n java.lang.Object r3 = r2.f1098h\n java.util.List r3 = (java.util.List) r3\n java.lang.Object r4 = r2.f1097g\n java.util.Map r4 = (java.util.Map) r4\n java.lang.Object r5 = r2.f1096f\n org.mobileid.requester.web_service.Response r5 = (org.mobileid.requester.web_service.Response) r5\n java.lang.Object r6 = r2.f1095e\n java.lang.String r6 = (java.lang.String) r6\n boolean r7 = r2.f1099i\n java.lang.Object r8 = r2.f1094d\n c.a.e.b.b r8 = (p008c.p009a.p024e.p026b.C0963b) r8\n kotlin.ResultKt.throwOnFailure(r1)\n r1 = r3\n r15 = r4\n r13 = r5\n r14 = r6\n r12 = r8\n r8 = r7\n goto L_0x018c\n L_0x0093:\n java.lang.Object r3 = r2.f1095e\n java.lang.String r3 = (java.lang.String) r3\n boolean r4 = r2.f1099i\n java.lang.Object r6 = r2.f1094d\n c.a.e.b.b r6 = (p008c.p009a.p024e.p026b.C0963b) r6\n kotlin.ResultKt.throwOnFailure(r1)\n r13 = r3\n r14 = r4\n r12 = r6\n goto L_0x00c5\n L_0x00a4:\n kotlin.ResultKt.throwOnFailure(r1)\n c.a.e.c.a r1 = r0.f1032c\n java.lang.String r3 = r1.mo13035a()\n if (r3 == 0) goto L_0x01cc\n org.mobileid.time_key.web_service.TimeKeyWebService r1 = r0.f1031b\n r2.f1094d = r0\n r6 = r18\n r2.f1099i = r6\n r2.f1095e = r3\n r2.f1092b = r4\n java.lang.Object r1 = r1.synchronizeKeys(r3, r2)\n if (r1 != r9) goto L_0x00c2\n return r9\n L_0x00c2:\n r12 = r0\n r13 = r3\n r14 = r6\n L_0x00c5:\n org.mobileid.requester.web_service.Response r1 = (org.mobileid.requester.web_service.Response) r1\n org.mobileid.requester.web_service.Error r3 = r1.getError()\n if (r3 == 0) goto L_0x00d0\n kotlin.Unit r1 = kotlin.Unit.INSTANCE\n return r1\n L_0x00d0:\n java.lang.Object r3 = r1.getResult()\n java.util.Map r3 = (java.util.Map) r3\n r4 = 0\n if (r12 == 0) goto L_0x01cb\n if (r3 == 0) goto L_0x010e\n java.util.LinkedHashMap r6 = new java.util.LinkedHashMap\n r6.<init>()\n java.util.Set r3 = r3.entrySet()\n java.util.Iterator r3 = r3.iterator()\n L_0x00e8:\n boolean r7 = r3.hasNext()\n if (r7 == 0) goto L_0x010f\n java.lang.Object r7 = r3.next()\n java.util.Map$Entry r7 = (java.util.Map.Entry) r7\n org.mobileid.access.key.TimeKey$Companion r8 = org.mobileid.access.key.TimeKey.Companion\n java.lang.Object r15 = r7.getKey()\n java.lang.String r15 = (java.lang.String) r15\n boolean r8 = r8.isTimeKeyPrefix(r15)\n if (r8 == 0) goto L_0x00e8\n java.lang.Object r8 = r7.getKey()\n java.lang.Object r7 = r7.getValue()\n r6.put(r8, r7)\n goto L_0x00e8\n L_0x010e:\n r6 = r4\n L_0x010f:\n boolean r3 = r6 instanceof java.util.Map\n if (r3 != 0) goto L_0x0115\n r15 = r4\n goto L_0x0116\n L_0x0115:\n r15 = r6\n L_0x0116:\n if (r15 == 0) goto L_0x01c8\n c.a.a.c$a r3 = p008c.p009a.p010a.C0837c.f761k\n android.content.Context r6 = r12.f1030a\n java.util.List r3 = p008c.p009a.p010a.C0837c.C0838a.m367a((p008c.p009a.p010a.C0837c.C0838a) r3, (android.content.Context) r6, (org.mobileid.access.key_sort.Sort) r4, (int) r5)\n java.util.ArrayList r4 = new java.util.ArrayList\n r4.<init>()\n java.util.Iterator r3 = r3.iterator()\n L_0x0129:\n boolean r6 = r3.hasNext()\n if (r6 == 0) goto L_0x0146\n java.lang.Object r6 = r3.next()\n r7 = r6\n org.mobileid.access.key.Key r7 = (org.mobileid.access.key.Key) r7\n org.mobileid.access.key.TimeKey$Companion r8 = org.mobileid.access.key.TimeKey.Companion\n java.lang.String r7 = r7.getName()\n boolean r7 = r8.isStorageTimeKeyId(r7)\n if (r7 == 0) goto L_0x0129\n r4.add(r6)\n goto L_0x0129\n L_0x0146:\n java.util.ArrayList r8 = new java.util.ArrayList\n r3 = 10\n int r3 = kotlin.collections.CollectionsKt.collectionSizeOrDefault(r4, r3)\n r8.<init>(r3)\n java.util.Iterator r3 = r4.iterator()\n L_0x0155:\n boolean r4 = r3.hasNext()\n if (r4 == 0) goto L_0x0169\n java.lang.Object r4 = r3.next()\n org.mobileid.access.key.Key r4 = (org.mobileid.access.key.Key) r4\n java.lang.String r4 = r4.getId()\n r8.add(r4)\n goto L_0x0155\n L_0x0169:\n r2.f1094d = r12\n r2.f1099i = r14\n r2.f1095e = r13\n r2.f1096f = r1\n r2.f1097g = r15\n r2.f1098h = r8\n r2.f1092b = r5\n java.lang.String r5 = \"DEACTIVATED\"\n r3 = r12\n r4 = r15\n r6 = r8\n r7 = r14\n r16 = r8\n r8 = r2\n java.lang.Object r3 = r3.mo13032b(r4, r5, r6, r7, r8)\n if (r3 != r9) goto L_0x0187\n return r9\n L_0x0187:\n r8 = r14\n r14 = r13\n r13 = r1\n r1 = r16\n L_0x018c:\n r2.f1094d = r12\n r2.f1099i = r8\n r2.f1095e = r14\n r2.f1096f = r13\n r2.f1097g = r15\n r2.f1098h = r1\n r2.f1092b = r11\n java.lang.String r5 = \"FROZEN\"\n r3 = r12\n r4 = r15\n r6 = r1\n r7 = r8\n r11 = r8\n r8 = r2\n java.lang.Object r3 = r3.mo13032b(r4, r5, r6, r7, r8)\n if (r3 != r9) goto L_0x01a9\n return r9\n L_0x01a9:\n r6 = r1\n r7 = r11\n r3 = r12\n r4 = r15\n L_0x01ad:\n r2.f1094d = r3\n r2.f1099i = r7\n r2.f1095e = r14\n r2.f1096f = r13\n r2.f1097g = r4\n r2.f1098h = r6\n r2.f1092b = r10\n java.lang.String r5 = \"FROZEN\"\n r8 = r2\n java.lang.Object r1 = r3.mo13028a(r4, r5, r6, r7, r8)\n if (r1 != r9) goto L_0x01c5\n return r9\n L_0x01c5:\n kotlin.Unit r1 = kotlin.Unit.INSTANCE\n return r1\n L_0x01c8:\n kotlin.Unit r1 = kotlin.Unit.INSTANCE\n return r1\n L_0x01cb:\n throw r4\n L_0x01cc:\n kotlin.Unit r1 = kotlin.Unit.INSTANCE\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p008c.p009a.p024e.p026b.C0963b.mo13025a(boolean, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"public java.lang.Object mo13022a(java.lang.String r18, kotlin.coroutines.Continuation<? super java.lang.Boolean> r19) {\n /*\n r17 = this;\n r0 = r17\n r1 = r19\n boolean r2 = r1 instanceof p008c.p009a.p024e.p026b.C0963b.C0970g\n if (r2 == 0) goto L_0x0017\n r2 = r1\n c.a.e.b.b$g r2 = (p008c.p009a.p024e.p026b.C0963b.C0970g) r2\n int r3 = r2.f1086b\n r4 = -2147483648(0xffffffff80000000, float:-0.0)\n r5 = r3 & r4\n if (r5 == 0) goto L_0x0017\n int r3 = r3 - r4\n r2.f1086b = r3\n goto L_0x001c\n L_0x0017:\n c.a.e.b.b$g r2 = new c.a.e.b.b$g\n r2.<init>(r0, r1)\n L_0x001c:\n java.lang.Object r1 = r2.f1085a\n java.lang.Object r3 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r4 = r2.f1086b\n r5 = 0\n r6 = 2\n r7 = 1\n if (r4 == 0) goto L_0x0051\n if (r4 == r7) goto L_0x0045\n if (r4 != r6) goto L_0x003d\n java.lang.Object r3 = r2.f1090f\n java.lang.String r3 = (java.lang.String) r3\n java.lang.Object r3 = r2.f1089e\n java.lang.String r3 = (java.lang.String) r3\n java.lang.Object r2 = r2.f1088d\n c.a.e.b.b r2 = (p008c.p009a.p024e.p026b.C0963b) r2\n kotlin.ResultKt.throwOnFailure(r1)\n goto L_0x00a1\n L_0x003d:\n java.lang.IllegalStateException r1 = new java.lang.IllegalStateException\n java.lang.String r2 = \"call to 'resume' before 'invoke' with coroutine\"\n r1.<init>(r2)\n throw r1\n L_0x0045:\n java.lang.Object r4 = r2.f1089e\n java.lang.String r4 = (java.lang.String) r4\n java.lang.Object r8 = r2.f1088d\n c.a.e.b.b r8 = (p008c.p009a.p024e.p026b.C0963b) r8\n kotlin.ResultKt.throwOnFailure(r1)\n goto L_0x0066\n L_0x0051:\n kotlin.ResultKt.throwOnFailure(r1)\n c.a.e.c.a r1 = r0.f1032c\n r2.f1088d = r0\n r4 = r18\n r2.f1089e = r4\n r2.f1086b = r7\n java.lang.Object r1 = r1.mo13034a(r2)\n if (r1 != r3) goto L_0x0065\n return r3\n L_0x0065:\n r8 = r0\n L_0x0066:\n c.a.e.c.a r1 = r8.f1032c\n java.lang.String r1 = r1.mo13035a()\n if (r1 == 0) goto L_0x00b7\n org.mobileid.time_key.web_service.TimeKeyWebService r15 = r8.f1031b\n org.mobileid.time_key.web_service.ActionOnKeyBody r14 = new org.mobileid.time_key.web_service.ActionOnKeyBody\n java.util.Locale r9 = java.util.Locale.getDefault()\n java.lang.String r10 = \"Locale.getDefault()\"\n kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r9, r10)\n if (r4 == 0) goto L_0x00af\n java.lang.String r10 = r4.toUpperCase(r9)\n java.lang.String r9 = \"(this as java.lang.String).toUpperCase(locale)\"\n kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r10, r9)\n r12 = 0\n r13 = 4\n r16 = 0\n r9 = r14\n r11 = r1\n r7 = r14\n r14 = r16\n r9.<init>(r10, r11, r12, r13, r14)\n r2.f1088d = r8\n r2.f1089e = r4\n r2.f1090f = r1\n r2.f1086b = r6\n java.lang.Object r1 = r15.activateKey(r7, r2)\n if (r1 != r3) goto L_0x00a1\n return r3\n L_0x00a1:\n org.mobileid.requester.web_service.Response r1 = (org.mobileid.requester.web_service.Response) r1\n java.lang.Object r1 = r1.getResult()\n if (r1 == 0) goto L_0x00aa\n r5 = 1\n L_0x00aa:\n java.lang.Boolean r1 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r5)\n return r1\n L_0x00af:\n java.lang.NullPointerException r1 = new java.lang.NullPointerException\n java.lang.String r2 = \"null cannot be cast to non-null type java.lang.String\"\n r1.<init>(r2)\n throw r1\n L_0x00b7:\n java.lang.Boolean r1 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r5)\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p008c.p009a.p024e.p026b.C0963b.mo13022a(java.lang.String, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"public final /* synthetic */ java.lang.Object mo13028a(java.util.Map<java.lang.String, ? extends java.util.Map<java.lang.String, java.lang.String>> r11, java.lang.String r12, java.util.List<java.lang.String> r13, boolean r14, kotlin.coroutines.Continuation<? super kotlin.Unit> r15) {\n /*\n r10 = this;\n boolean r0 = r15 instanceof p008c.p009a.p024e.p026b.C0963b.C0964a\n if (r0 == 0) goto L_0x0013\n r0 = r15\n c.a.e.b.b$a r0 = (p008c.p009a.p024e.p026b.C0963b.C0964a) r0\n int r1 = r0.f1034b\n r2 = -2147483648(0xffffffff80000000, float:-0.0)\n r3 = r1 & r2\n if (r3 == 0) goto L_0x0013\n int r1 = r1 - r2\n r0.f1034b = r1\n goto L_0x0018\n L_0x0013:\n c.a.e.b.b$a r0 = new c.a.e.b.b$a\n r0.<init>(r10, r15)\n L_0x0018:\n java.lang.Object r15 = r0.f1033a\n java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r2 = r0.f1034b\n r3 = 1\n if (r2 == 0) goto L_0x005c\n if (r2 != r3) goto L_0x0054\n java.lang.Object r11 = r0.f1046n\n org.mobileid.access.key.TimeKey r11 = (org.mobileid.access.key.TimeKey) r11\n java.lang.Object r11 = r0.f1044l\n java.util.Iterator r11 = (java.util.Iterator) r11\n java.lang.Object r12 = r0.f1043k\n java.lang.Iterable r12 = (java.lang.Iterable) r12\n java.lang.Object r13 = r0.f1042j\n java.util.List r13 = (java.util.List) r13\n java.lang.Object r14 = r0.f1041i\n java.util.List r14 = (java.util.List) r14\n java.lang.Object r2 = r0.f1040h\n java.util.Map r2 = (java.util.Map) r2\n boolean r4 = r0.f1047o\n java.lang.Object r5 = r0.f1039g\n java.util.List r5 = (java.util.List) r5\n java.lang.Object r6 = r0.f1038f\n java.lang.String r6 = (java.lang.String) r6\n java.lang.Object r7 = r0.f1037e\n java.util.Map r7 = (java.util.Map) r7\n java.lang.Object r8 = r0.f1036d\n c.a.e.b.b r8 = (p008c.p009a.p024e.p026b.C0963b) r8\n kotlin.ResultKt.throwOnFailure(r15)\n goto L_0x00e2\n L_0x0054:\n java.lang.IllegalStateException r11 = new java.lang.IllegalStateException\n java.lang.String r12 = \"call to 'resume' before 'invoke' with coroutine\"\n r11.<init>(r12)\n throw r11\n L_0x005c:\n kotlin.ResultKt.throwOnFailure(r15)\n java.util.LinkedHashMap r2 = new java.util.LinkedHashMap\n r2.<init>()\n java.util.Set r15 = r11.entrySet()\n java.util.Iterator r15 = r15.iterator()\n L_0x006c:\n boolean r4 = r15.hasNext()\n if (r4 == 0) goto L_0x00a1\n java.lang.Object r4 = r15.next()\n java.util.Map$Entry r4 = (java.util.Map.Entry) r4\n java.lang.Object r5 = r4.getValue()\n java.util.Map r5 = (java.util.Map) r5\n java.lang.String r6 = \"status\"\n java.lang.Object r5 = r5.get(r6)\n java.lang.String r5 = (java.lang.String) r5\n boolean r5 = kotlin.jvm.internal.Intrinsics.areEqual((java.lang.Object) r5, (java.lang.Object) r12)\n java.lang.Boolean r5 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r5)\n boolean r5 = r5.booleanValue()\n if (r5 == 0) goto L_0x006c\n java.lang.Object r5 = r4.getKey()\n java.lang.Object r4 = r4.getValue()\n r2.put(r5, r4)\n goto L_0x006c\n L_0x00a1:\n java.util.List r15 = r10.mo13029a((java.util.Map<java.lang.String, ? extends java.util.Map<java.lang.String, java.lang.String>>) r2)\n java.util.ArrayList r4 = new java.util.ArrayList\n r4.<init>()\n r5 = r15\n java.util.ArrayList r5 = (java.util.ArrayList) r5\n java.util.Iterator r5 = r5.iterator()\n L_0x00b1:\n boolean r6 = r5.hasNext()\n if (r6 == 0) goto L_0x00d5\n java.lang.Object r6 = r5.next()\n r7 = r6\n org.mobileid.access.key.TimeKey r7 = (org.mobileid.access.key.TimeKey) r7\n java.lang.String r7 = r7.getId()\n boolean r7 = r13.contains(r7)\n r7 = r7 ^ r3\n java.lang.Boolean r7 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r7)\n boolean r7 = r7.booleanValue()\n if (r7 == 0) goto L_0x00b1\n r4.add(r6)\n goto L_0x00b1\n L_0x00d5:\n java.util.Iterator r5 = r4.iterator()\n r8 = r10\n r7 = r11\n r6 = r12\n r12 = r4\n r11 = r5\n r5 = r13\n r13 = r12\n r4 = r14\n r14 = r15\n L_0x00e2:\n boolean r15 = r11.hasNext()\n if (r15 == 0) goto L_0x0110\n java.lang.Object r15 = r11.next()\n r9 = r15\n org.mobileid.access.key.TimeKey r9 = (org.mobileid.access.key.TimeKey) r9\n r0.f1036d = r8\n r0.f1037e = r7\n r0.f1038f = r6\n r0.f1039g = r5\n r0.f1047o = r4\n r0.f1040h = r2\n r0.f1041i = r14\n r0.f1042j = r13\n r0.f1043k = r12\n r0.f1044l = r11\n r0.f1045m = r15\n r0.f1046n = r9\n r0.f1034b = r3\n java.lang.Object r15 = r8.mo13024a((org.mobileid.access.key.TimeKey) r9, (kotlin.coroutines.Continuation<? super kotlin.Unit>) r0)\n if (r15 != r1) goto L_0x00e2\n return r1\n L_0x0110:\n kotlin.Unit r11 = kotlin.Unit.INSTANCE\n return r11\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p008c.p009a.p024e.p026b.C0963b.mo13028a(java.util.Map, java.lang.String, java.util.List, boolean, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"public final /* synthetic */ java.lang.Object mo13032b(java.util.Map<java.lang.String, ? extends java.util.Map<java.lang.String, java.lang.String>> r17, java.lang.String r18, java.util.List<java.lang.String> r19, boolean r20, kotlin.coroutines.Continuation<? super kotlin.Unit> r21) {\n /*\n r16 = this;\n r0 = r16\n r1 = r21\n boolean r2 = r1 instanceof p008c.p009a.p024e.p026b.C0963b.C0969f\n if (r2 == 0) goto L_0x0017\n r2 = r1\n c.a.e.b.b$f r2 = (p008c.p009a.p024e.p026b.C0963b.C0969f) r2\n int r3 = r2.f1071b\n r4 = -2147483648(0xffffffff80000000, float:-0.0)\n r5 = r3 & r4\n if (r5 == 0) goto L_0x0017\n int r3 = r3 - r4\n r2.f1071b = r3\n goto L_0x001c\n L_0x0017:\n c.a.e.b.b$f r2 = new c.a.e.b.b$f\n r2.<init>(r0, r1)\n L_0x001c:\n java.lang.Object r1 = r2.f1070a\n java.lang.Object r3 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r4 = r2.f1071b\n r5 = 1\n if (r4 == 0) goto L_0x0060\n if (r4 != r5) goto L_0x0058\n java.lang.Object r4 = r2.f1083n\n org.mobileid.access.key.TimeKey r4 = (org.mobileid.access.key.TimeKey) r4\n java.lang.Object r4 = r2.f1081l\n java.util.Iterator r4 = (java.util.Iterator) r4\n java.lang.Object r6 = r2.f1080k\n java.lang.Iterable r6 = (java.lang.Iterable) r6\n java.lang.Object r7 = r2.f1079j\n java.util.List r7 = (java.util.List) r7\n java.lang.Object r8 = r2.f1078i\n java.util.List r8 = (java.util.List) r8\n java.lang.Object r9 = r2.f1077h\n java.util.Map r9 = (java.util.Map) r9\n boolean r10 = r2.f1084o\n java.lang.Object r11 = r2.f1076g\n java.util.List r11 = (java.util.List) r11\n java.lang.Object r12 = r2.f1075f\n java.lang.String r12 = (java.lang.String) r12\n java.lang.Object r13 = r2.f1074e\n java.util.Map r13 = (java.util.Map) r13\n java.lang.Object r14 = r2.f1073d\n c.a.e.b.b r14 = (p008c.p009a.p024e.p026b.C0963b) r14\n kotlin.ResultKt.throwOnFailure(r1)\n goto L_0x00eb\n L_0x0058:\n java.lang.IllegalStateException r1 = new java.lang.IllegalStateException\n java.lang.String r2 = \"call to 'resume' before 'invoke' with coroutine\"\n r1.<init>(r2)\n throw r1\n L_0x0060:\n kotlin.ResultKt.throwOnFailure(r1)\n java.util.LinkedHashMap r9 = new java.util.LinkedHashMap\n r9.<init>()\n java.util.Set r1 = r17.entrySet()\n java.util.Iterator r1 = r1.iterator()\n L_0x0070:\n boolean r4 = r1.hasNext()\n if (r4 == 0) goto L_0x00a7\n java.lang.Object r4 = r1.next()\n java.util.Map$Entry r4 = (java.util.Map.Entry) r4\n java.lang.Object r6 = r4.getValue()\n java.util.Map r6 = (java.util.Map) r6\n java.lang.String r7 = \"status\"\n java.lang.Object r6 = r6.get(r7)\n java.lang.String r6 = (java.lang.String) r6\n r7 = r18\n boolean r6 = kotlin.jvm.internal.Intrinsics.areEqual((java.lang.Object) r6, (java.lang.Object) r7)\n java.lang.Boolean r6 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r6)\n boolean r6 = r6.booleanValue()\n if (r6 == 0) goto L_0x0070\n java.lang.Object r6 = r4.getKey()\n java.lang.Object r4 = r4.getValue()\n r9.put(r6, r4)\n goto L_0x0070\n L_0x00a7:\n r7 = r18\n java.util.List r8 = r0.mo13029a((java.util.Map<java.lang.String, ? extends java.util.Map<java.lang.String, java.lang.String>>) r9)\n java.util.ArrayList r6 = new java.util.ArrayList\n r6.<init>()\n r1 = r8\n java.util.ArrayList r1 = (java.util.ArrayList) r1\n java.util.Iterator r1 = r1.iterator()\n L_0x00b9:\n boolean r4 = r1.hasNext()\n if (r4 == 0) goto L_0x00de\n java.lang.Object r4 = r1.next()\n r10 = r4\n org.mobileid.access.key.TimeKey r10 = (org.mobileid.access.key.TimeKey) r10\n java.lang.String r10 = r10.getId()\n r11 = r19\n boolean r10 = r11.contains(r10)\n java.lang.Boolean r10 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r10)\n boolean r10 = r10.booleanValue()\n if (r10 == 0) goto L_0x00b9\n r6.add(r4)\n goto L_0x00b9\n L_0x00de:\n r11 = r19\n java.util.Iterator r4 = r6.iterator()\n r13 = r17\n r10 = r20\n r14 = r0\n r12 = r7\n r7 = r6\n L_0x00eb:\n boolean r1 = r4.hasNext()\n if (r1 == 0) goto L_0x0120\n java.lang.Object r1 = r4.next()\n r15 = r1\n org.mobileid.access.key.TimeKey r15 = (org.mobileid.access.key.TimeKey) r15\n java.lang.String r5 = r15.getId()\n r2.f1073d = r14\n r2.f1074e = r13\n r2.f1075f = r12\n r2.f1076g = r11\n r2.f1084o = r10\n r2.f1077h = r9\n r2.f1078i = r8\n r2.f1079j = r7\n r2.f1080k = r6\n r2.f1081l = r4\n r2.f1082m = r1\n r2.f1083n = r15\n r1 = 1\n r2.f1071b = r1\n java.lang.Object r5 = r14.mo13023a(r5, r10, r2)\n if (r5 != r3) goto L_0x011e\n return r3\n L_0x011e:\n r5 = 1\n goto L_0x00eb\n L_0x0120:\n kotlin.Unit r1 = kotlin.Unit.INSTANCE\n return r1\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p008c.p009a.p024e.p026b.C0963b.mo13032b(java.util.Map, java.lang.String, java.util.List, boolean, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"@org.jetbrains.annotations.Nullable\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final java.lang.Object invokeSuspend(@org.jetbrains.annotations.NotNull java.lang.Object r12) {\n /*\n r11 = this;\n java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r1 = r11.label\n r2 = 3\n r3 = 2\n r4 = 1\n if (r1 == 0) goto L_0x005c\n if (r1 == r4) goto L_0x004a\n if (r1 == r3) goto L_0x0031\n if (r1 != r2) goto L_0x0029\n java.lang.Object r1 = r11.L$4\n java.lang.Object r5 = r11.L$3\n kotlinx.coroutines.channels.ChannelIterator r5 = (kotlinx.coroutines.channels.ChannelIterator) r5\n java.lang.Object r6 = r11.L$2\n java.lang.Object r6 = r11.L$1\n java.util.HashSet r6 = (java.util.HashSet) r6\n java.lang.Object r7 = r11.L$0\n kotlinx.coroutines.channels.ProducerScope r7 = (kotlinx.coroutines.channels.ProducerScope) r7\n kotlin.ResultKt.throwOnFailure(r12)\n r12 = r7\n r7 = r0\n r0 = r11\n goto L_0x00c2\n L_0x0029:\n java.lang.IllegalStateException r12 = new java.lang.IllegalStateException\n java.lang.String r0 = \"call to 'resume' before 'invoke' with coroutine\"\n r12.<init>(r0)\n throw r12\n L_0x0031:\n java.lang.Object r1 = r11.L$3\n kotlinx.coroutines.channels.ChannelIterator r1 = (kotlinx.coroutines.channels.ChannelIterator) r1\n java.lang.Object r5 = r11.L$2\n java.lang.Object r6 = r11.L$1\n java.util.HashSet r6 = (java.util.HashSet) r6\n java.lang.Object r7 = r11.L$0\n kotlinx.coroutines.channels.ProducerScope r7 = (kotlinx.coroutines.channels.ProducerScope) r7\n kotlin.ResultKt.throwOnFailure(r12)\n r8 = r5\n r5 = r1\n r1 = r12\n r12 = r7\n r7 = r0\n r0 = r11\n goto L_0x00a9\n L_0x004a:\n java.lang.Object r1 = r11.L$2\n kotlinx.coroutines.channels.ChannelIterator r1 = (kotlinx.coroutines.channels.ChannelIterator) r1\n java.lang.Object r5 = r11.L$1\n java.util.HashSet r5 = (java.util.HashSet) r5\n java.lang.Object r6 = r11.L$0\n kotlinx.coroutines.channels.ProducerScope r6 = (kotlinx.coroutines.channels.ProducerScope) r6\n kotlin.ResultKt.throwOnFailure(r12)\n r7 = r0\n r0 = r11\n goto L_0x0084\n L_0x005c:\n kotlin.ResultKt.throwOnFailure(r12)\n kotlinx.coroutines.channels.ProducerScope r12 = r11.f5420p$\n java.util.HashSet r1 = new java.util.HashSet\n r1.<init>()\n kotlinx.coroutines.channels.ReceiveChannel r5 = r11.$this_distinctBy\n kotlinx.coroutines.channels.ChannelIterator r5 = r5.iterator()\n r6 = r12\n r12 = r11\n r10 = r5\n r5 = r1\n r1 = r10\n L_0x0071:\n r12.L$0 = r6\n r12.L$1 = r5\n r12.L$2 = r1\n r12.label = r4\n java.lang.Object r7 = r1.hasNext(r12)\n if (r7 != r0) goto L_0x0080\n return r0\n L_0x0080:\n r10 = r0\n r0 = r12\n r12 = r7\n r7 = r10\n L_0x0084:\n java.lang.Boolean r12 = (java.lang.Boolean) r12\n boolean r12 = r12.booleanValue()\n if (r12 == 0) goto L_0x00ce\n java.lang.Object r12 = r1.next()\n kotlin.jvm.functions.Function2 r8 = r0.$selector\n r0.L$0 = r6\n r0.L$1 = r5\n r0.L$2 = r12\n r0.L$3 = r1\n r0.label = r3\n java.lang.Object r8 = r8.invoke(r12, r0)\n if (r8 != r7) goto L_0x00a3\n return r7\n L_0x00a3:\n r10 = r8\n r8 = r12\n r12 = r6\n r6 = r5\n r5 = r1\n r1 = r10\n L_0x00a9:\n boolean r9 = r6.contains(r1)\n if (r9 != 0) goto L_0x00c8\n r0.L$0 = r12\n r0.L$1 = r6\n r0.L$2 = r8\n r0.L$3 = r5\n r0.L$4 = r1\n r0.label = r2\n java.lang.Object r8 = r12.send(r8, r0)\n if (r8 != r7) goto L_0x00c2\n return r7\n L_0x00c2:\n r8 = r6\n java.util.Collection r8 = (java.util.Collection) r8\n r8.add(r1)\n L_0x00c8:\n r1 = r5\n r5 = r6\n r6 = r12\n r12 = r0\n r0 = r7\n goto L_0x0071\n L_0x00ce:\n kotlin.Unit r12 = kotlin.Unit.INSTANCE\n return r12\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlinx.coroutines.channels.ChannelsKt__Channels_commonKt$distinctBy$1.invokeSuspend(java.lang.Object):java.lang.Object\");\n }",
"@Override\n public void toogleFold() {\n }",
"FlowKt__ZipKt$combine$$inlined$unsafeFlow$1$lambda$1(Continuation continuation, FlowKt__ZipKt$combine$$inlined$unsafeFlow$1 flowKt__ZipKt$combine$$inlined$unsafeFlow$1) {\n super(3, continuation);\n this.this$0 = flowKt__ZipKt$combine$$inlined$unsafeFlow$1;\n }",
"private void m76769g() {\n C1592h.m7855a((Callable<TResult>) new C23441a<TResult>(this), C1592h.f5958b);\n }",
"@Override\n public void onNext(Void aVoid) {\n }",
"@Override\n\tprotected void flowThrough(Object in, Object d, Object out) {\n\t\t\n\t}",
"@Override\n public <U> Comparator<Object> thenComparing(final Function<?, ? extends U> p0, final Comparator<? super U> p1) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1793)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1790)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper.getLowerBound(MetadataHelper.java:1240)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2278)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2256)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2233)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2246)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.adapt(MetadataHelper.java:1312)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2708)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2692)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visitParameterizedType(DefaultTypeVisitor.java:65)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.asSubType(MetadataHelper.java:720)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:926)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:770)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:766)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2515)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"FlowSequence createFlowSequence();",
"public final /* synthetic */ java.lang.Object mo13031b(java.lang.String r14, kotlin.coroutines.Continuation<? super kotlin.Unit> r15) {\n /*\n r13 = this;\n boolean r0 = r15 instanceof p008c.p009a.p024e.p026b.C0963b.C0967d\n if (r0 == 0) goto L_0x0013\n r0 = r15\n c.a.e.b.b$d r0 = (p008c.p009a.p024e.p026b.C0963b.C0967d) r0\n int r1 = r0.f1060b\n r2 = -2147483648(0xffffffff80000000, float:-0.0)\n r3 = r1 & r2\n if (r3 == 0) goto L_0x0013\n int r1 = r1 - r2\n r0.f1060b = r1\n goto L_0x0018\n L_0x0013:\n c.a.e.b.b$d r0 = new c.a.e.b.b$d\n r0.<init>(r13, r15)\n L_0x0018:\n java.lang.Object r15 = r0.f1059a\n java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r2 = r0.f1060b\n r3 = 2\n r4 = 1\n if (r2 == 0) goto L_0x0059\n if (r2 == r4) goto L_0x0049\n if (r2 != r3) goto L_0x0041\n java.lang.Object r14 = r0.f1066h\n org.mobileid.time_key.util.TimeKeyParams r14 = (org.mobileid.time_key.util.TimeKeyParams) r14\n java.lang.Object r14 = r0.f1065g\n org.mobileid.requester.web_service.Response r14 = (org.mobileid.requester.web_service.Response) r14\n java.lang.Object r14 = r0.f1064f\n java.lang.String r14 = (java.lang.String) r14\n java.lang.Object r14 = r0.f1063e\n java.lang.String r14 = (java.lang.String) r14\n java.lang.Object r14 = r0.f1062d\n c.a.e.b.b r14 = (p008c.p009a.p024e.p026b.C0963b) r14\n kotlin.ResultKt.throwOnFailure(r15)\n goto L_0x00c0\n L_0x0041:\n java.lang.IllegalStateException r14 = new java.lang.IllegalStateException\n java.lang.String r15 = \"call to 'resume' before 'invoke' with coroutine\"\n r14.<init>(r15)\n throw r14\n L_0x0049:\n java.lang.Object r14 = r0.f1064f\n java.lang.String r14 = (java.lang.String) r14\n java.lang.Object r2 = r0.f1063e\n java.lang.String r2 = (java.lang.String) r2\n java.lang.Object r5 = r0.f1062d\n c.a.e.b.b r5 = (p008c.p009a.p024e.p026b.C0963b) r5\n kotlin.ResultKt.throwOnFailure(r15)\n goto L_0x0085\n L_0x0059:\n kotlin.ResultKt.throwOnFailure(r15)\n c.a.e.c.a r15 = r13.f1032c\n java.lang.String r15 = r15.mo13035a()\n if (r15 == 0) goto L_0x00c3\n org.mobileid.time_key.web_service.TimeKeyWebService r2 = r13.f1031b\n org.mobileid.time_key.web_service.ActionOnKeyBody r11 = new org.mobileid.time_key.web_service.ActionOnKeyBody\n r8 = 0\n r9 = 4\n r10 = 0\n r5 = r11\n r6 = r14\n r7 = r15\n r5.<init>(r6, r7, r8, r9, r10)\n r0.f1062d = r13\n r0.f1063e = r14\n r0.f1064f = r15\n r0.f1060b = r4\n java.lang.Object r2 = r2.deactivateKey(r11, r0)\n if (r2 != r1) goto L_0x0080\n return r1\n L_0x0080:\n r5 = r13\n r12 = r2\n r2 = r14\n r14 = r15\n r15 = r12\n L_0x0085:\n org.mobileid.requester.web_service.Response r15 = (org.mobileid.requester.web_service.Response) r15\n java.lang.Object r6 = r15.getResult()\n java.lang.Boolean r6 = (java.lang.Boolean) r6\n java.lang.Boolean r7 = kotlin.coroutines.jvm.internal.Boxing.boxBoolean(r4)\n boolean r6 = kotlin.jvm.internal.Intrinsics.areEqual((java.lang.Object) r6, (java.lang.Object) r7)\n r4 = r4 ^ r6\n if (r4 == 0) goto L_0x009b\n kotlin.Unit r14 = kotlin.Unit.INSTANCE\n return r14\n L_0x009b:\n org.mobileid.time_key.util.TimeKeyParams$a r4 = org.mobileid.time_key.util.TimeKeyParams.Companion\n android.content.Context r6 = r5.f1030a\n org.mobileid.time_key.util.TimeKeyParams r4 = r4.mo60138a(r6)\n kotlinx.coroutines.MainCoroutineDispatcher r6 = kotlinx.coroutines.Dispatchers.getMain()\n c.a.e.b.b$e r7 = new c.a.e.b.b$e\n r8 = 0\n r7.<init>(r5, r4, r8)\n r0.f1062d = r5\n r0.f1063e = r2\n r0.f1064f = r14\n r0.f1065g = r15\n r0.f1066h = r4\n r0.f1060b = r3\n java.lang.Object r14 = kotlinx.coroutines.BuildersKt.withContext(r6, r7, r0)\n if (r14 != r1) goto L_0x00c0\n return r1\n L_0x00c0:\n kotlin.Unit r14 = kotlin.Unit.INSTANCE\n return r14\n L_0x00c3:\n kotlin.Unit r14 = kotlin.Unit.INSTANCE\n return r14\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p008c.p009a.p024e.p026b.C0963b.mo13031b(java.lang.String, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"SequenceFlow createSequenceFlow();",
"static public void callForeachRDD (org.apache.spark.streaming.api.java.JavaDStream<byte[]> jdstream, org.apache.spark.streaming.api.python.PythonTransformFunction pfunc) { throw new RuntimeException(); }",
"@Override\n public Comparator<Object> thenComparing(final Comparator<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"public void c() {\n /*\n r14 = this;\n io.b.o<? super U> r0 = r14.actual\n r1 = 1\n r2 = 1\n L_0x0004:\n boolean r3 = r14.d()\n if (r3 == 0) goto L_0x000b\n return\n L_0x000b:\n io.b.e.c.d<U> r3 = r14.queue\n if (r3 == 0) goto L_0x0023\n L_0x000f:\n boolean r4 = r14.d()\n if (r4 == 0) goto L_0x0016\n return\n L_0x0016:\n java.lang.Object r4 = r3.poll()\n if (r4 != 0) goto L_0x001f\n if (r4 != 0) goto L_0x000f\n goto L_0x0023\n L_0x001f:\n r0.a(r4)\n goto L_0x000f\n L_0x0023:\n boolean r3 = r14.done\n io.b.e.c.d<U> r4 = r14.queue\n java.util.concurrent.atomic.AtomicReference<io.b.e.e.d.i$a<?, ?>[]> r5 = r14.observers\n java.lang.Object r5 = r5.get()\n io.b.e.e.d.i$a[] r5 = (io.b.e.e.d.i.a[]) r5\n int r6 = r5.length\n int r7 = r14.maxConcurrency\n r8 = 2147483647(0x7fffffff, float:NaN)\n r9 = 0\n if (r7 == r8) goto L_0x0044\n monitor-enter(r14)\n java.util.Queue<io.b.m<? extends U>> r7 = r14.sources // Catch:{ all -> 0x0041 }\n int r7 = r7.size() // Catch:{ all -> 0x0041 }\n monitor-exit(r14) // Catch:{ all -> 0x0041 }\n goto L_0x0045\n L_0x0041:\n r0 = move-exception\n monitor-exit(r14) // Catch:{ all -> 0x0041 }\n throw r0\n L_0x0044:\n r7 = 0\n L_0x0045:\n if (r3 == 0) goto L_0x0067\n if (r4 == 0) goto L_0x004f\n boolean r3 = r4.isEmpty()\n if (r3 == 0) goto L_0x0067\n L_0x004f:\n if (r6 != 0) goto L_0x0067\n if (r7 != 0) goto L_0x0067\n io.b.e.h.c r1 = r14.errors\n java.lang.Throwable r1 = r1.a()\n java.lang.Throwable r2 = io.b.e.h.f.f33557a\n if (r1 == r2) goto L_0x0066\n if (r1 != 0) goto L_0x0063\n r0.a()\n goto L_0x0066\n L_0x0063:\n r0.a((java.lang.Throwable) r1)\n L_0x0066:\n return\n L_0x0067:\n if (r6 == 0) goto L_0x0106\n long r3 = r14.lastId\n int r7 = r14.lastIndex\n if (r6 <= r7) goto L_0x0077\n r10 = r5[r7]\n long r10 = r10.id\n int r12 = (r10 > r3 ? 1 : (r10 == r3 ? 0 : -1))\n if (r12 == 0) goto L_0x0098\n L_0x0077:\n if (r6 > r7) goto L_0x007a\n r7 = 0\n L_0x007a:\n r10 = r7\n r7 = 0\n L_0x007c:\n if (r7 >= r6) goto L_0x008f\n r11 = r5[r10]\n long r11 = r11.id\n int r13 = (r11 > r3 ? 1 : (r11 == r3 ? 0 : -1))\n if (r13 != 0) goto L_0x0087\n goto L_0x008f\n L_0x0087:\n int r10 = r10 + 1\n if (r10 != r6) goto L_0x008c\n r10 = 0\n L_0x008c:\n int r7 = r7 + 1\n goto L_0x007c\n L_0x008f:\n r14.lastIndex = r10\n r3 = r5[r10]\n long r3 = r3.id\n r14.lastId = r3\n r7 = r10\n L_0x0098:\n r3 = 0\n r4 = 0\n L_0x009a:\n if (r3 >= r6) goto L_0x00fd\n boolean r10 = r14.d()\n if (r10 == 0) goto L_0x00a3\n return\n L_0x00a3:\n r10 = r5[r7]\n L_0x00a5:\n boolean r11 = r14.d()\n if (r11 == 0) goto L_0x00ac\n return\n L_0x00ac:\n io.b.e.c.e<U> r11 = r10.queue\n if (r11 != 0) goto L_0x00b1\n goto L_0x00b9\n L_0x00b1:\n java.lang.Object r12 = r11.poll() // Catch:{ Throwable -> 0x00e2 }\n if (r12 != 0) goto L_0x00d8\n if (r12 != 0) goto L_0x00a5\n L_0x00b9:\n boolean r11 = r10.done\n io.b.e.c.e<U> r12 = r10.queue\n if (r11 == 0) goto L_0x00d2\n if (r12 == 0) goto L_0x00c7\n boolean r11 = r12.isEmpty()\n if (r11 == 0) goto L_0x00d2\n L_0x00c7:\n r14.b(r10)\n boolean r4 = r14.d()\n if (r4 == 0) goto L_0x00d1\n return\n L_0x00d1:\n r4 = 1\n L_0x00d2:\n int r7 = r7 + 1\n if (r7 != r6) goto L_0x00fb\n r7 = 0\n goto L_0x00fb\n L_0x00d8:\n r0.a(r12)\n boolean r12 = r14.d()\n if (r12 == 0) goto L_0x00b1\n return\n L_0x00e2:\n r4 = move-exception\n io.b.c.b.b(r4)\n r10.b()\n io.b.e.h.c r11 = r14.errors\n r11.a(r4)\n boolean r4 = r14.d()\n if (r4 == 0) goto L_0x00f5\n return\n L_0x00f5:\n r14.b(r10)\n int r3 = r3 + 1\n r4 = 1\n L_0x00fb:\n int r3 = r3 + r1\n goto L_0x009a\n L_0x00fd:\n r14.lastIndex = r7\n r3 = r5[r7]\n long r5 = r3.id\n r14.lastId = r5\n goto L_0x0107\n L_0x0106:\n r4 = 0\n L_0x0107:\n if (r4 == 0) goto L_0x0129\n int r3 = r14.maxConcurrency\n if (r3 == r8) goto L_0x0004\n monitor-enter(r14)\n java.util.Queue<io.b.m<? extends U>> r3 = r14.sources // Catch:{ all -> 0x0126 }\n java.lang.Object r3 = r3.poll() // Catch:{ all -> 0x0126 }\n io.b.m r3 = (io.b.m) r3 // Catch:{ all -> 0x0126 }\n if (r3 != 0) goto L_0x0120\n int r3 = r14.wip // Catch:{ all -> 0x0126 }\n int r3 = r3 - r1\n r14.wip = r3 // Catch:{ all -> 0x0126 }\n monitor-exit(r14) // Catch:{ all -> 0x0126 }\n goto L_0x0004\n L_0x0120:\n monitor-exit(r14) // Catch:{ all -> 0x0126 }\n r14.a(r3)\n goto L_0x0004\n L_0x0126:\n r0 = move-exception\n monitor-exit(r14) // Catch:{ all -> 0x0126 }\n throw r0\n L_0x0129:\n int r2 = -r2\n int r2 = r14.addAndGet(r2)\n if (r2 != 0) goto L_0x0004\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.b.e.e.d.i.b.c():void\");\n }",
"public final void process(Void input)\n/* */ {\n/* 53 */ if (!this.processingThread.compareAndSet(null, Thread.currentThread())) {\n/* 54 */ String msg = \"Pipeline stage is already being processed by another thread\";\n/* 55 */ Thread otherThread = (Thread)this.processingThread.get();\n/* 56 */ if (otherThread != null) {\n/* 57 */ msg = msg + \" [\" + otherThread.getName() + \"]\";\n/* */ }\n/* 59 */ throw new ConcurrentModificationException(msg);\n/* */ }\n/* */ try\n/* */ {\n/* 63 */ while (!this.stop) {\n/* 64 */ I i = this.queue.take();\n/* */ try {\n/* 66 */ invokeNext(i);\n/* */ } catch (Exception e) {\n/* 68 */ onError(i, e);\n/* */ } catch (Throwable t) {\n/* 70 */ onUnrecoverableError(i, t);\n/* 71 */ throw t;\n/* */ }\n/* */ }\n/* */ } catch (InterruptedException e) {\n/* 75 */ Exceptions.rethrowAsRuntimeException(e);\n/* */ } catch (Exception e) {\n/* 77 */ Throwables.propagate(e);\n/* */ } finally {\n/* */ try {\n/* 80 */ this.stopWaitLatch.countDown();\n/* */ } finally {\n/* 82 */ this.processingThread.set(null);\n/* */ }\n/* */ }\n/* */ }",
"@Override\n public Comparator<Object> thenComparingLong(final ToLongFunction<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"@io.reactivex.annotations.CheckReturnValue\n @io.reactivex.annotations.BackpressureSupport(io.reactivex.annotations.BackpressureKind.FULL)\n @org.jetbrains.annotations.NotNull\n @io.reactivex.annotations.SchedulerSupport(\"none\")\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static final <T, R> io.reactivex.Flowable<kotlin.Pair<T, R>> combineLatest(@org.jetbrains.annotations.NotNull io.reactivex.Flowable<T> r2, @org.jetbrains.annotations.NotNull io.reactivex.Flowable<R> r3) {\n /*\n java.lang.String r0 = \"$receiver\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r2, r0)\n java.lang.String r0 = \"flowable\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r3, r0)\n org.a.b r2 = (org.a.b) r2\n org.a.b r3 = (org.a.b) r3\n io.reactivex.rxkotlin.FlowableKt$combineLatest$2 r0 = io.reactivex.rxkotlin.FlowableKt$combineLatest$2.INSTANCE\n kotlin.jvm.functions.Function2 r0 = (kotlin.jvm.functions.Function2) r0\n if (r0 == 0) goto L_0x001a\n io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_BiFunction$0 r1 = new io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_BiFunction$0\n r1.<init>(r0)\n r0 = r1\n L_0x001a:\n io.reactivex.functions.BiFunction r0 = (io.reactivex.functions.BiFunction) r0\n io.reactivex.Flowable r2 = io.reactivex.Flowable.combineLatest((org.a.b<? extends T1>) r2, (org.a.b<? extends T2>) r3, (io.reactivex.functions.BiFunction<? super T1, ? super T2, ? extends R>) r0)\n java.lang.String r3 = \"Flowable.combineLatest(t…able, BiFunction(::Pair))\"\n kotlin.jvm.internal.Intrinsics.checkExpressionValueIsNotNull(r2, r3)\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.reactivex.rxkotlin.FlowableKt.combineLatest(io.reactivex.Flowable, io.reactivex.Flowable):io.reactivex.Flowable\");\n }",
"public interface FusibleFlow<T> extends Flow<T> {\n Flow<T> fuse(CoroutineContext coroutineContext, int i, BufferOverflow bufferOverflow);\n\n /* compiled from: ChannelFlow.kt */\n public static final class DefaultImpls {\n public static /* synthetic */ Flow fuse$default(FusibleFlow fusibleFlow, CoroutineContext coroutineContext, int i, BufferOverflow bufferOverflow, int i2, Object obj) {\n if (obj == null) {\n if ((i2 & 1) != 0) {\n coroutineContext = EmptyCoroutineContext.INSTANCE;\n }\n if ((i2 & 2) != 0) {\n i = -3;\n }\n if ((i2 & 4) != 0) {\n bufferOverflow = BufferOverflow.SUSPEND;\n }\n return fusibleFlow.fuse(coroutineContext, i, bufferOverflow);\n }\n throw new UnsupportedOperationException(\"Super calls with default arguments not supported in this target, function: fuse\");\n }\n }\n}",
"@io.reactivex.annotations.CheckReturnValue\n @io.reactivex.annotations.BackpressureSupport(io.reactivex.annotations.BackpressureKind.FULL)\n @org.jetbrains.annotations.NotNull\n @io.reactivex.annotations.SchedulerSupport(\"none\")\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static final <T, R, U> io.reactivex.Flowable<kotlin.Triple<T, R, U>> combineLatest(@org.jetbrains.annotations.NotNull io.reactivex.Flowable<T> r2, @org.jetbrains.annotations.NotNull io.reactivex.Flowable<R> r3, @org.jetbrains.annotations.NotNull io.reactivex.Flowable<U> r4) {\n /*\n java.lang.String r0 = \"$receiver\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r2, r0)\n java.lang.String r0 = \"flowable1\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r3, r0)\n java.lang.String r0 = \"flowable2\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r4, r0)\n org.a.b r2 = (org.a.b) r2\n org.a.b r3 = (org.a.b) r3\n org.a.b r4 = (org.a.b) r4\n io.reactivex.rxkotlin.FlowableKt$combineLatest$3 r0 = io.reactivex.rxkotlin.FlowableKt$combineLatest$3.INSTANCE\n kotlin.jvm.functions.Function3 r0 = (kotlin.jvm.functions.Function3) r0\n if (r0 == 0) goto L_0x0021\n io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_Function3$0 r1 = new io.reactivex.rxkotlin.FlowableKt$sam$io_reactivex_functions_Function3$0\n r1.<init>(r0)\n r0 = r1\n L_0x0021:\n io.reactivex.functions.Function3 r0 = (io.reactivex.functions.Function3) r0\n io.reactivex.Flowable r2 = io.reactivex.Flowable.combineLatest(r2, r3, r4, r0)\n java.lang.String r3 = \"Flowable.combineLatest(t…le2, Function3(::Triple))\"\n kotlin.jvm.internal.Intrinsics.checkExpressionValueIsNotNull(r2, r3)\n return r2\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.reactivex.rxkotlin.FlowableKt.combineLatest(io.reactivex.Flowable, io.reactivex.Flowable, io.reactivex.Flowable):io.reactivex.Flowable\");\n }",
"@Test\n public void testTripleParallel() throws Exception {\n WorkflowJob job = r.jenkins.createProject(WorkflowJob.class, \"TripleParallel\");\n job.setDefinition(new CpsFlowDefinition(\n \"echo 'test stage'\\n\"+ // Id 3, Id 2 before that has the FlowStartNode\n \"parallel 'unit':{\\n\" + // Id 4 starts parallel, Id 7 is the block start for the unit branch\n \" echo \\\"Unit testing...\\\"\\n\" + // Id 10\n \"},'integration':{\\n\" + // Id 11 is unit branch end, Id 8 is the branch start for integration branch\n \" echo \\\"Integration testing...\\\"\\n\" + // Id 12\n \"}, 'ui':{\\n\" + // Id 13 in integration branch end, Id 9 is branch start for UI branch\n \" echo \\\"UI testing...\\\"\\n\" + // Id 14\n \"}\", // Node 15 is UI branch end node, Node 16 is Parallel End node, Node 17 is FlowEndNode\n true));\n WorkflowRun b = r.assertBuildStatusSuccess(job.scheduleBuild2(0));\n FlowExecution exec = b.getExecution();\n ForkScanner f = new ForkScanner();\n List<FlowNode> heads = exec.getCurrentHeads();\n f.setup(heads);\n TestVisitor visitor = new TestVisitor();\n f.visitSimpleChunks(visitor, new BlockChunkFinder());\n sanityTestIterationAndVisiter(heads);\n\n List<TestVisitor.CallEntry> parallels = visitor.calls.stream()\n .filter(\n predicateForCallEntryType(TestVisitor.CallType.PARALLEL_BRANCH_START)\n .or(\n predicateForCallEntryType(TestVisitor.CallType.PARALLEL_BRANCH_END)))\n .collect(Collectors.toList());\n Assert.assertEquals(6, parallels.size());\n\n // Visiting from partially completed branches\n // Verify we still get appropriate parallels callbacks for a branch end\n // even if in-progress and no explicit end node\n ArrayList<FlowNode> ends = new ArrayList<>();\n ends.add(exec.getNode(\"11\"));\n ends.add(exec.getNode(\"12\"));\n ends.add(exec.getNode(\"14\"));\n Assert.assertEquals(new DepthFirstScanner().allNodes(ends).size(),\n new ForkScanner().allNodes(ends).size());\n visitor = new TestVisitor();\n f.setup(ends);\n f.visitSimpleChunks(visitor, new BlockChunkFinder());\n sanityTestIterationAndVisiter(ends);\n\n // Specifically test parallel structures\n parallels = visitor.calls.stream()\n .filter(\n predicateForCallEntryType(TestVisitor.CallType.PARALLEL_BRANCH_START)\n .or(\n predicateForCallEntryType(TestVisitor.CallType.PARALLEL_BRANCH_END)))\n .collect(Collectors.toList());\n Assert.assertEquals(6, parallels.size());\n Assert.assertEquals(18, visitor.calls.size());\n\n // Test the least common ancestor implementation with triplicate\n FlowNode[] branchHeads = {exec.getNode(\"7\"), exec.getNode(\"8\"), exec.getNode(\"9\")};\n ArrayDeque<ForkScanner.ParallelBlockStart> starts = f.leastCommonAncestor(new HashSet<>(Arrays.asList(branchHeads)));\n Assert.assertEquals(1, starts.size());\n ForkScanner.ParallelBlockStart pbs = starts.pop();\n Assert.assertEquals(exec.getNode(\"4\"), pbs.forkStart);\n Assert.assertEquals(3, pbs.unvisited.size());\n Assert.assertTrue(pbs.unvisited.contains(exec.getNode(\"7\")));\n Assert.assertTrue(pbs.unvisited.contains(exec.getNode(\"8\")));\n Assert.assertTrue(pbs.unvisited.contains(exec.getNode(\"9\")));\n }",
"public static final void forEachBlock(@org.jetbrains.annotations.NotNull java.io.File r3, int r4, @org.jetbrains.annotations.NotNull kotlin.jvm.functions.Function2<? super byte[], ? super java.lang.Integer, kotlin.Unit> r5) {\n /*\n java.lang.String r0 = \"$this$forEachBlock\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r3, r0)\n java.lang.String r0 = \"action\"\n kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(r5, r0)\n r0 = 512(0x200, float:7.175E-43)\n int r4 = kotlin.ranges.RangesKt.coerceAtLeast((int) r4, (int) r0)\n byte[] r4 = new byte[r4]\n java.io.FileInputStream r0 = new java.io.FileInputStream\n r0.<init>(r3)\n java.io.Closeable r0 = (java.io.Closeable) r0\n r3 = 0\n r1 = r0\n java.io.FileInputStream r1 = (java.io.FileInputStream) r1 // Catch:{ Throwable -> 0x0031 }\n L_0x001d:\n int r2 = r1.read(r4) // Catch:{ Throwable -> 0x0031 }\n if (r2 <= 0) goto L_0x002b\n java.lang.Integer r2 = java.lang.Integer.valueOf(r2) // Catch:{ Throwable -> 0x0031 }\n r5.invoke(r4, r2) // Catch:{ Throwable -> 0x0031 }\n goto L_0x001d\n L_0x002b:\n kotlin.io.CloseableKt.closeFinally(r0, r3)\n return\n L_0x002f:\n r4 = move-exception\n goto L_0x0033\n L_0x0031:\n r3 = move-exception\n throw r3 // Catch:{ all -> 0x002f }\n L_0x0033:\n kotlin.io.CloseableKt.closeFinally(r0, r3)\n throw r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.io.i.forEachBlock(java.io.File, int, kotlin.jvm.functions.Function2):void\");\n }",
"public Object lambda87(Object list, Object otherLists) {\n frame65 frame65;\n Object callWithValues;\n new frame65();\n frame65 frame652 = frame65;\n frame652.staticLink = this;\n frame65 frame653 = frame652;\n frame653.list = list;\n frame653.other$Mnlists = otherLists;\n if (srfi1.isNullList(frame653.list) != Boolean.FALSE) {\n callWithValues = this.staticLink.abort.apply2(LList.Empty, LList.Empty);\n } else {\n callWithValues = call_with_values.callWithValues(frame653.lambda$Fn67, frame653.lambda$Fn68);\n }\n return callWithValues;\n }",
"void test() {\n @Source(CAMERA) @Sink(INTERNET) byte @Source(CAMERA) @Sink(INTERNET) [] invariant = notCompleted;\n\n // This line used to issue an error but was fixed when transitioning to better type variables\n // check version history for more information if this line is failing\n flowCompleted = notCompleted;\n\n @Source(CAMERA) @Sink({FILESYSTEM, INTERNET}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] a = null;\n @Source(CAMERA) @Sink({INTERNET, FILESYSTEM}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] b = a;\n\n @Source(CAMERA) @Sink({INTERNET, FILESYSTEM}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] aCorrect = null;\n @Source(CAMERA) @Sink({INTERNET, FILESYSTEM}) byte @Source(CAMERA) @Sink({FILESYSTEM, INTERNET})[] bCorrect = aCorrect;\n }",
"@Test\n public void testParallelPropagationLoopBack3SitesNtoNTopologyPutFromOneDS() {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));\n Integer tkPort = vm2.invoke(() -> WANTestBase.createFirstRemoteLocator(3, lnPort));\n\n createCacheInVMs(lnPort, vm3, vm6);\n createCacheInVMs(nyPort, vm4, vm7);\n createCacheInVMs(tkPort, vm5);\n vm3.invoke(WANTestBase::createReceiver);\n vm4.invoke(WANTestBase::createReceiver);\n vm5.invoke(WANTestBase::createReceiver);\n\n // site1\n vm3.invoke(() -> WANTestBase.createSender(\"ln1\", 2, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ln1\", 2, true, 100, 10, false, false, null, true));\n\n vm3.invoke(() -> WANTestBase.createSender(\"ln2\", 3, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ln2\", 3, true, 100, 10, false, false, null, true));\n\n // site2\n vm4.invoke(() -> WANTestBase.createSender(\"ny1\", 1, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny1\", 1, true, 100, 10, false, false, null, true));\n\n vm4.invoke(() -> WANTestBase.createSender(\"ny2\", 3, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny2\", 3, true, 100, 10, false, false, null, true));\n\n // site3\n vm5.invoke(() -> WANTestBase.createSender(\"tk1\", 1, true, 100, 10, false, false, null, true));\n vm5.invoke(() -> WANTestBase.createSender(\"tk2\", 2, true, 100, 10, false, false, null, true));\n\n // create PR\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln1,ln2\", 0,\n 1, isOffHeap()));\n vm6.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln1,ln2\", 0,\n 1, isOffHeap()));\n\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny1,ny2\", 0,\n 1, isOffHeap()));\n vm7.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny1,ny2\", 0,\n 1, isOffHeap()));\n\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"tk1,tk2\", 0,\n 1, isOffHeap()));\n\n // start all the senders\n vm3.invoke(() -> WANTestBase.startSender(\"ln1\"));\n vm3.invoke(() -> WANTestBase.startSender(\"ln2\"));\n vm6.invoke(() -> WANTestBase.startSender(\"ln1\"));\n vm6.invoke(() -> WANTestBase.startSender(\"ln2\"));\n\n vm4.invoke(() -> WANTestBase.startSender(\"ny1\"));\n vm4.invoke(() -> WANTestBase.startSender(\"ny2\"));\n vm7.invoke(() -> WANTestBase.startSender(\"ny1\"));\n vm7.invoke(() -> WANTestBase.startSender(\"ny2\"));\n\n vm5.invoke(() -> WANTestBase.startSender(\"tk1\"));\n vm5.invoke(() -> WANTestBase.startSender(\"tk2\"));\n\n // pause senders on all the sites\n vm3.invoke(() -> WANTestBase.pauseSender(\"ln1\"));\n vm3.invoke(() -> WANTestBase.pauseSender(\"ln2\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ln1\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ln2\"));\n\n vm4.invoke(() -> WANTestBase.pauseSender(\"ny1\"));\n vm4.invoke(() -> WANTestBase.pauseSender(\"ny2\"));\n vm7.invoke(() -> WANTestBase.pauseSender(\"ny1\"));\n vm7.invoke(() -> WANTestBase.pauseSender(\"ny2\"));\n\n vm5.invoke(() -> WANTestBase.pauseSender(\"tk1\"));\n vm5.invoke(() -> WANTestBase.pauseSender(\"tk2\"));\n\n // this is required since sender pause doesn't take effect immediately\n Wait.pause(1000);\n\n // do puts on site1\n vm3.invoke(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 100));\n\n // verify queue size on site1 and site3\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ln1\", 100));\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ln2\", 100));\n\n // resume sender (from site1 to site2) on site1\n vm3.invoke(() -> WANTestBase.resumeSender(\"ln1\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ln1\"));\n\n // validate region size on site2\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n\n // verify queue size on site2 (sender 2 to 1)\n // should remain at 0 as the events from site1 should not go back to site1\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny1\", 0));\n\n // verify queue size on site2 (sender 2 to 3)\n // should remain at 0 as events from site1 will reach site3 directly..site2 need not send to\n // site3 again\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny2\", 0));\n\n // do more puts on site3\n vm5.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 200));\n\n // resume sender (from site3 to site2) on site3\n vm5.invoke(() -> WANTestBase.resumeSender(\"tk2\"));\n\n // validate region size on site2\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n\n // verify queue size on site2 (sender 2 to 3)\n // should remain at 0 as the events from site3 should not go back to site3\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny2\", 0));\n\n // verify queue size on site2 (sender 2 to 1)\n // should remain at 0 as events from site3 will reach site1 directly..site2 need not send to\n // site1 again\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ny1\", 0));\n\n // resume all senders\n vm3.invoke(() -> WANTestBase.resumeSender(\"ln2\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ln2\"));\n\n vm4.invoke(() -> WANTestBase.resumeSender(\"ny1\"));\n vm4.invoke(() -> WANTestBase.resumeSender(\"ny2\"));\n vm7.invoke(() -> WANTestBase.resumeSender(\"ny1\"));\n vm7.invoke(() -> WANTestBase.resumeSender(\"ny2\"));\n\n vm5.invoke(() -> WANTestBase.resumeSender(\"tk1\"));\n\n // validate region size on all sites\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n }",
"private void m14210a(java.io.IOException r4, java.io.IOException r5) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r3 = this;\n r0 = f12370a;\n if (r0 == 0) goto L_0x000f;\n L_0x0004:\n r0 = f12370a;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1 = 1;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1 = new java.lang.Object[r1];\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r2 = 0;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r1[r2] = r5;\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n r0.invoke(r4, r1);\t Catch:{ InvocationTargetException -> 0x000f, InvocationTargetException -> 0x000f }\n L_0x000f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.internal.connection.RouteException.a(java.io.IOException, java.io.IOException):void\");\n }",
"@Override\n public Comparator<Object> thenComparingInt(final ToIntFunction<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"protected java.util.List x (java.lang.String r19){\n /*\n r18 = this;\n r0 = r18;\n r2 = r0.K;\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\n r2 = (java.util.List) r2;\n if (r2 == 0) goto L_0x000f;\n L_0x000e:\n return r2;\n L_0x000f:\n r12 = java.util.Collections.emptyList();\n r2 = r18.bp();\n r3 = r18.TaskHandler(r19);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r4 = r2.setDrawable(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n if (r4 != 0) goto L_0x0026;\n L_0x0021:\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0026:\n r13 = r2.getScaledMaximumFlingVelocity(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r14 = new java.io.ByteArrayOutputStream;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r14.<creatCallTask>(r2);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13, r14);\t Catch:{ all -> 0x00f2 }\n r2 = r14.toByteArray();\t Catch:{ all -> 0x00f2 }\n r2 = com.duokan.kernel.DkUtils.decodeSimpleDrm(r2);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r4 = \"UTF-8\";\n r3.<creatCallTask>(r2, r4);\t Catch:{ all -> 0x00f2 }\n r2 = new org.json.JSONObject;\t Catch:{ all -> 0x00f2 }\n r2.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n if (r2 != 0) goto L_0x0055;\n L_0x004a:\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0055:\n r3 = \"pictures\";\n r15 = com.duokan.reader.common.getPhysicalYPixels.setDrawable(r2, r3);\t Catch:{ all -> 0x00f2 }\n r16 = new java.util.ArrayList;\t Catch:{ all -> 0x00f2 }\n r2 = r15.length();\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.<creatCallTask>(r2);\t Catch:{ all -> 0x00f2 }\n r2 = 0;\n L_0x0067:\n r3 = r15.length();\t Catch:{ all -> 0x00f2 }\n if (r2 >= r3) goto L_0x00d0;\n L_0x006d:\n r3 = r15.getJSONObject(r2);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_md5\";\n r7 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_url\";\n r6 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_size\";\n r8 = r3.getLong(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"width\";\n r10 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"height\";\n r11 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r4 = \".\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r2);\t Catch:{ all -> 0x00f2 }\n r4 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r17 = \"file:///stuffs/\";\n r0 = r17;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r7);\t Catch:{ all -> 0x00f2 }\n r3 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n r3 = r18;\n r3 = r3.setDrawable(r4, r5, r6, r7, r8, r10, r11);\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.add(r3);\t Catch:{ all -> 0x00f2 }\n r2 = r2 + 1;\n goto L_0x0067;\n L_0x00d0:\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r1 = r16;\n r2.putIfAbsent(r0, r1);\t Catch:{ all -> 0x00f2 }\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\t Catch:{ all -> 0x00f2 }\n r2 = (java.util.List) r2;\t Catch:{ all -> 0x00f2 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n r18.bq();\n goto L_0x000e;\n L_0x00f2:\n r2 = move-exception;\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n throw r2;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n L_0x00fa:\n r2 = move-exception;\n r2 = r12;\n L_0x00fc:\n r18.bq();\n goto L_0x000e;\n L_0x0101:\n r2 = move-exception;\n r18.bq();\n throw r2;\n L_0x0106:\n r3 = move-exception;\n goto L_0x00fc;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.duokan.reader.domain.bookshelf.jv.MyContextWrapper(java.lang.String):java.util.List\");\n }",
"@Override // kotlin.jvm.functions.Function3\n public final Object invoke(Object obj, Object[] objArr, Continuation<? super Unit> continuation) {\n return ((FlowKt__ZipKt$combine$$inlined$unsafeFlow$1$lambda$1) create((FlowCollector) obj, objArr, continuation)).invokeSuspend(Unit.INSTANCE);\n }",
"@org.jetbrains.annotations.Nullable\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public java.lang.Object run(@org.jetbrains.annotations.NotNull com.sumsub.sns.core.domain.GetConfigUseCase.Params r9, @org.jetbrains.annotations.NotNull kotlin.coroutines.Continuation<? super com.sumsub.sns.core.domain.model.Either<? extends java.lang.Exception, com.sumsub.sns.core.data.model.AppConfig>> r10) {\n /*\n r8 = this;\n boolean r9 = r10 instanceof com.sumsub.sns.core.domain.GetConfigUseCase.a\n if (r9 == 0) goto L_0x0013\n r9 = r10\n com.sumsub.sns.core.domain.GetConfigUseCase$a r9 = (com.sumsub.sns.core.domain.GetConfigUseCase.a) r9\n int r0 = r9.b\n r1 = -2147483648(0xffffffff80000000, float:-0.0)\n r2 = r0 & r1\n if (r2 == 0) goto L_0x0013\n int r0 = r0 - r1\n r9.b = r0\n goto L_0x0018\n L_0x0013:\n com.sumsub.sns.core.domain.GetConfigUseCase$a r9 = new com.sumsub.sns.core.domain.GetConfigUseCase$a\n r9.<init>(r8, r10)\n L_0x0018:\n java.lang.Object r10 = r9.a\n java.lang.Object r6 = t6.p.a.a.getCOROUTINE_SUSPENDED()\n int r0 = r9.b\n r7 = 2\n r1 = 1\n if (r0 == 0) goto L_0x003e\n if (r0 == r1) goto L_0x0034\n if (r0 != r7) goto L_0x002c\n kotlin.ResultKt.throwOnFailure(r10)\n goto L_0x006e\n L_0x002c:\n java.lang.IllegalStateException r9 = new java.lang.IllegalStateException\n java.lang.String r10 = \"call to 'resume' before 'invoke' with coroutine\"\n r9.<init>(r10)\n throw r9\n L_0x0034:\n java.lang.Object r0 = r9.d\n com.sumsub.sns.core.domain.GetConfigUseCase r0 = (com.sumsub.sns.core.domain.GetConfigUseCase) r0\n kotlin.ResultKt.throwOnFailure(r10) // Catch:{ Exception -> 0x003c }\n goto L_0x0058\n L_0x003c:\n r10 = move-exception\n goto L_0x0062\n L_0x003e:\n kotlin.ResultKt.throwOnFailure(r10)\n com.sumsub.sns.core.data.source.common.CommonRepository r0 = r8.getCommonRepository() // Catch:{ Exception -> 0x0060 }\n java.lang.String r10 = r8.b // Catch:{ Exception -> 0x0060 }\n r2 = 0\n r4 = 2\n r5 = 0\n r9.d = r8 // Catch:{ Exception -> 0x0060 }\n r9.b = r1 // Catch:{ Exception -> 0x0060 }\n r1 = r10\n r3 = r9\n java.lang.Object r10 = com.sumsub.sns.core.data.source.common.CommonRepository.DefaultImpls.getConfig$default(r0, r1, r2, r3, r4, r5) // Catch:{ Exception -> 0x0060 }\n if (r10 != r6) goto L_0x0057\n return r6\n L_0x0057:\n r0 = r8\n L_0x0058:\n com.sumsub.sns.core.data.model.AppConfig r10 = (com.sumsub.sns.core.data.model.AppConfig) r10\n com.sumsub.sns.core.domain.model.Either$Right r1 = new com.sumsub.sns.core.domain.model.Either$Right\n r1.<init>(r10)\n return r1\n L_0x0060:\n r10 = move-exception\n r0 = r8\n L_0x0062:\n r1 = 0\n r9.d = r1\n r9.b = r7\n java.lang.Object r10 = r0.onWrapException(r10, r9)\n if (r10 != r6) goto L_0x006e\n return r6\n L_0x006e:\n com.sumsub.sns.core.domain.model.Either$Left r9 = new com.sumsub.sns.core.domain.model.Either$Left\n r9.<init>(r10)\n return r9\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.sumsub.sns.core.domain.GetConfigUseCase.run(com.sumsub.sns.core.domain.GetConfigUseCase$Params, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"@Test\n public void testParallelPropagationLoopBack() {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));\n\n // create receiver on site1 and site2\n createCacheInVMs(lnPort, vm2, vm4, vm5);\n vm2.invoke(WANTestBase::createReceiver);\n createCacheInVMs(nyPort, vm3, vm6, vm7);\n vm3.invoke(WANTestBase::createReceiver);\n\n // create senders on site1\n vm2.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm4.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm5.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n\n // create senders on site2\n vm3.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n\n // create PR on site1\n vm2.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n\n // create PR on site2\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n vm6.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n vm7.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n\n // start sender on site1\n startSenderInVMs(\"ln\", vm2, vm4, vm5);\n\n\n // start sender on site2\n startSenderInVMs(\"ny\", vm3, vm6, vm7);\n\n\n // pause senders on site1\n vm2.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n vm4.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n vm5.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n\n // pause senders on site2\n vm3.invoke(() -> WANTestBase.pauseSender(\"ny\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ny\"));\n vm7.invoke(() -> WANTestBase.pauseSender(\"ny\"));\n\n // this is required since sender pause doesn't take effect immediately\n Wait.pause(1000);\n\n // Do 100 puts on site1\n vm2.invoke(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 100));\n // do next 100 puts on site2\n vm3.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 200));\n // verify queue size on both sites\n vm2.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n vm4.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n vm5.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm6.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm7.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n\n // resume sender on site1\n vm2.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm4.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm5.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n\n // validate events reached site2 from site1\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n\n // on site2, verify queue size again\n // this ensures that loopback is not happening since the queue size is same as before\n // the event coming from site1 are not enqueued again\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm6.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n vm7.invoke(() -> WANTestBase.verifyQueueSize(\"ny\", 100));\n\n // resume sender on site2\n vm3.invoke(() -> WANTestBase.resumeSender(\"ny\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ny\"));\n vm7.invoke(() -> WANTestBase.resumeSender(\"ny\"));\n\n // validate region size on both the sites\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n }",
"@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp\", line = 574,\n FQN=\"clang::CodeGen::CodeGenFunction::GenerateCXXGlobalDtorsFunc\", NM=\"_ZN5clang7CodeGen15CodeGenFunction26GenerateCXXGlobalDtorsFuncEPN4llvm8FunctionERKSt6vectorISt4pairINS2_6WeakVHEPNS2_8ConstantEESaISA_EE\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.clang.codegen/llvmToClangType -split-class=clang::CodeGen::CodeGenFunction@this ${LLVM_SRC}/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp -nm=_ZN5clang7CodeGen15CodeGenFunction26GenerateCXXGlobalDtorsFuncEPN4llvm8FunctionERKSt6vectorISt4pairINS2_6WeakVHEPNS2_8ConstantEESaISA_EE\")\n//</editor-fold>\npublic final void GenerateCXXGlobalDtorsFunc(Function /*P*/ Fn, \n final /*const*/std.vector<std.pair<WeakVH, Constant /*P*/ >> /*&*/ DtorsAndObjects) {\n {\n ApplyDebugLocation NL = null;\n ApplyDebugLocation AL = null;\n JavaCleaner $c$ = $createJavaCleaner();\n try {\n NL = ApplyDebugLocation.CreateEmpty(/*Deref*/$this());\n $this().StartFunction(new GlobalDecl(), $this().getContext().VoidTy.$QualType(), Fn, \n $this().getTypes().arrangeNullaryFunction(), $c$.track(new FunctionArgList())); $c$.clean();\n // Emit an artificial location for this function.\n AL = ApplyDebugLocation.CreateArtificial(/*Deref*/$this());\n \n // Emit the dtors, in reverse order from construction.\n for (/*uint*/int i = 0, e = DtorsAndObjects.size(); i != e; ++i) {\n Value /*P*/ Callee = DtorsAndObjects.$at$Const(e - i - 1).first.$Value$P();\n CallInst /*P*/ CI = $this().Builder.CreateCall_Value$P_ArrayRef$Value$P_Twine$C_MDNode$P(Callee, \n new ArrayRef<Value /*P*/ >(DtorsAndObjects.$at$Const(e - i - 1).second, true));\n {\n // Make sure the call and the callee agree on calling convention.\n Function /*P*/ F = dyn_cast_Function(Callee);\n if ((F != null)) {\n CI.setCallingConv(F.getCallingConv());\n }\n }\n }\n } finally {\n if (AL != null) { AL.$destroy(); }\n if (NL != null) { NL.$destroy(); }\n $c$.$destroy();\n }\n }\n \n $this().FinishFunction();\n}",
"public static final <R> java.lang.Object callSuspendBy(kotlin.reflect.KCallable<? extends R> r4, java.util.Map<kotlin.reflect.KParameter, ? extends java.lang.Object> r5, kotlin.coroutines.Continuation<? super R> r6) {\n /*\n boolean r0 = r6 instanceof kotlin.reflect.full.KCallables$callSuspendBy$1\n if (r0 == 0) goto L_0x0014\n r0 = r6\n kotlin.reflect.full.KCallables$callSuspendBy$1 r0 = (kotlin.reflect.full.KCallables$callSuspendBy$1) r0\n int r1 = r0.label\n r2 = -2147483648(0xffffffff80000000, float:-0.0)\n r1 = r1 & r2\n if (r1 == 0) goto L_0x0014\n int r6 = r0.label\n int r6 = r6 - r2\n r0.label = r6\n goto L_0x0019\n L_0x0014:\n kotlin.reflect.full.KCallables$callSuspendBy$1 r0 = new kotlin.reflect.full.KCallables$callSuspendBy$1\n r0.<init>(r6)\n L_0x0019:\n java.lang.Object r6 = r0.result\n java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r2 = r0.label\n r3 = 1\n if (r2 == 0) goto L_0x003e\n if (r2 != r3) goto L_0x0036\n java.lang.Object r4 = r0.L$2\n kotlin.jvm.internal.Ref$ObjectRef r4 = (kotlin.jvm.internal.Ref.ObjectRef) r4\n java.lang.Object r4 = r0.L$1\n java.util.Map r4 = (java.util.Map) r4\n java.lang.Object r4 = r0.L$0\n kotlin.reflect.KCallable r4 = (kotlin.reflect.KCallable) r4\n kotlin.ResultKt.throwOnFailure(r6)\n goto L_0x007b\n L_0x0036:\n java.lang.IllegalStateException r4 = new java.lang.IllegalStateException\n java.lang.String r5 = \"call to 'resume' before 'invoke' with coroutine\"\n r4.<init>(r5)\n throw r4\n L_0x003e:\n kotlin.ResultKt.throwOnFailure(r6)\n boolean r6 = r4.isSuspend()\n if (r6 != 0) goto L_0x004c\n java.lang.Object r4 = r4.callBy(r5)\n return r4\n L_0x004c:\n boolean r6 = r4 instanceof kotlin.reflect.KFunction\n if (r6 == 0) goto L_0x00b8\n kotlin.jvm.internal.Ref$ObjectRef r6 = new kotlin.jvm.internal.Ref$ObjectRef\n r6.<init>()\n kotlin.reflect.jvm.internal.KCallableImpl r2 = kotlin.reflect.jvm.internal.UtilKt.asKCallableImpl(r4)\n if (r2 == 0) goto L_0x009f\n r6.element = r2\n r0.L$0 = r4\n r0.L$1 = r5\n r0.L$2 = r6\n r0.label = r3\n kotlin.coroutines.Continuation r0 = (kotlin.coroutines.Continuation) r0\n T r6 = r6.element\n kotlin.reflect.jvm.internal.KCallableImpl r6 = (kotlin.reflect.jvm.internal.KCallableImpl) r6\n java.lang.Object r6 = r6.callDefaultMethod$kotlin_reflection(r5, r0)\n java.lang.Object r5 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n if (r6 != r5) goto L_0x0078\n kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineSuspended(r0)\n L_0x0078:\n if (r6 != r1) goto L_0x007b\n return r1\n L_0x007b:\n kotlin.reflect.KType r5 = r4.getReturnType()\n kotlin.reflect.KClassifier r5 = r5.getClassifier()\n java.lang.Class<kotlin.Unit> r0 = kotlin.Unit.class\n kotlin.reflect.KClass r0 = kotlin.jvm.internal.Reflection.getOrCreateKotlinClass(r0)\n boolean r5 = kotlin.jvm.internal.Intrinsics.areEqual((java.lang.Object) r5, (java.lang.Object) r0)\n if (r5 == 0) goto L_0x009e\n kotlin.reflect.KType r4 = r4.getReturnType()\n boolean r4 = r4.isMarkedNullable()\n if (r4 != 0) goto L_0x009e\n kotlin.Unit r4 = kotlin.Unit.INSTANCE\n java.lang.Object r4 = (java.lang.Object) r4\n return r4\n L_0x009e:\n return r6\n L_0x009f:\n kotlin.reflect.jvm.internal.KotlinReflectionInternalError r5 = new kotlin.reflect.jvm.internal.KotlinReflectionInternalError\n java.lang.StringBuilder r6 = new java.lang.StringBuilder\n r6.<init>()\n java.lang.String r0 = \"This callable does not support a default call: \"\n r6.append(r0)\n r6.append(r4)\n java.lang.String r4 = r6.toString()\n r5.<init>(r4)\n java.lang.Throwable r5 = (java.lang.Throwable) r5\n throw r5\n L_0x00b8:\n java.lang.IllegalArgumentException r5 = new java.lang.IllegalArgumentException\n java.lang.StringBuilder r6 = new java.lang.StringBuilder\n r6.<init>()\n java.lang.String r0 = \"Cannot callSuspendBy on a property \"\n r6.append(r0)\n r6.append(r4)\n java.lang.String r4 = \": suspend properties are not supported yet\"\n r6.append(r4)\n java.lang.String r4 = r6.toString()\n r5.<init>(r4)\n java.lang.Throwable r5 = (java.lang.Throwable) r5\n throw r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.reflect.full.KCallables.callSuspendBy(kotlin.reflect.KCallable, java.util.Map, kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final java.lang.Object invokeSuspend(java.lang.Object r12) {\n /*\n // Method dump skipped, instructions count: 255\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlinx.coroutines.channels.ChannelsKt__Channels_commonKt$dropWhile$1.invokeSuspend(java.lang.Object):java.lang.Object\");\n }",
"public interface Task<C extends FlowContext> extends Func1<C, Completable> {\n}",
"@Test\n public void testAbstractScanner() throws Exception {\n WorkflowJob job = r.jenkins.createProject(WorkflowJob.class, \"SimpleLinear\");\n job.setDefinition(new CpsFlowDefinition(\n \"sleep 2 \\n\" +\n \"echo 'donothing'\\n\" +\n \"echo 'doitagain'\",\n true));\n\n /* Flow structure (ID - type)\n 2 - FlowStartNode\n 3 - SleepStep\n 4 - EchoStep\n 5 - EchoStep\n 6 - FlowEndNode\n */\n\n WorkflowRun b = r.assertBuildStatusSuccess(job.scheduleBuild2(0));\n FlowExecution exec = b.getExecution();\n List<FlowNode> heads = exec.getCurrentHeads();\n FlowNode intermediateNode = exec.getNode(\"4\");\n AbstractFlowScanner linear = new LinearScanner();\n\n // ## Bunch of tests for convertToFastCheckable ##\n Assert.assertEquals(Collections.emptySet(), linear.convertToFastCheckable(null));\n Assert.assertEquals(Collections.emptySet(), linear.convertToFastCheckable(new ArrayList<>()));\n\n Collection<FlowNode> coll = linear.convertToFastCheckable(Collections.singletonList(intermediateNode));\n Assert.assertTrue(\"Singleton set used for one element\", coll instanceof AbstractSet);\n Assert.assertEquals(1, coll.size());\n\n Collection<FlowNode> multipleItems = Arrays.asList(exec.getNode(\"3\"), exec.getNode(\"2\"));\n coll = linear.convertToFastCheckable(multipleItems);\n Assert.assertTrue(\"Original used for short list\", coll instanceof List);\n Assert.assertEquals(2, coll.size());\n\n coll = linear.convertToFastCheckable(new LinkedHashSet<>(multipleItems));\n Assert.assertTrue(\"Original used where set\", coll instanceof LinkedHashSet);\n\n multipleItems = new ArrayList<>();\n for (int i=0; i < 3; i++) {\n multipleItems.add(intermediateNode);\n }\n coll = linear.convertToFastCheckable(multipleItems);\n Assert.assertTrue(\"Original used for short list\", coll instanceof List);\n Assert.assertEquals(3, coll.size());\n\n multipleItems = new ArrayList<>();\n for (int i=0; i < 10; i++) {\n multipleItems.add(intermediateNode);\n }\n coll = linear.convertToFastCheckable(multipleItems);\n Assert.assertTrue(\"Original used for short list\", coll instanceof HashSet);\n Assert.assertEquals(1, coll.size());\n\n\n // Setup, return false if no nodes to iterate, else true\n FlowNode lastNode = heads.get(0);\n FlowNode nullNode = null;\n Collection<FlowNode> nullColl = null;\n\n Assert.assertTrue(linear.setup(heads, null));\n Assert.assertTrue(linear.setup(heads, Collections.emptySet()));\n Assert.assertFalse(linear.setup(nullColl, heads));\n Assert.assertFalse(linear.setup(nullColl, null));\n Assert.assertFalse(linear.setup(heads, heads));\n Assert.assertTrue(linear.setup(heads));\n Assert.assertFalse(linear.setup(nullColl));\n Assert.assertFalse(linear.setup(Collections.emptySet()));\n Assert.assertTrue(linear.setup(lastNode));\n Assert.assertTrue(linear.setup(lastNode, nullColl));\n Assert.assertFalse(linear.setup(nullNode));\n Assert.assertFalse(linear.setup(nullNode, heads));\n Assert.assertFalse(linear.setup(nullNode, nullColl));\n Assert.assertTrue(linear.setup(Arrays.asList(intermediateNode, lastNode), Collections.singleton(intermediateNode)));\n Assert.assertEquals(lastNode, linear.myCurrent);\n\n // First match, with no blacklist\n int[] ids = {6, 5, 4, 3, 2};\n FlowNode firstEchoNode = exec.getNode(\"5\");\n FlowExecution nullExecution = null;\n\n Assert.assertEquals(firstEchoNode, linear.findFirstMatch(heads, Collections.emptySet(), FlowTestUtils.MATCH_ECHO_STEP));\n Assert.assertEquals(firstEchoNode, linear.findFirstMatch(heads, FlowTestUtils.MATCH_ECHO_STEP));\n Assert.assertEquals(firstEchoNode, linear.findFirstMatch(lastNode, FlowTestUtils.MATCH_ECHO_STEP));\n Assert.assertEquals(firstEchoNode, linear.findFirstMatch(exec, FlowTestUtils.MATCH_ECHO_STEP));\n Assert.assertNull(linear.findFirstMatch(nullColl, FlowTestUtils.MATCH_ECHO_STEP));\n Assert.assertNull(linear.findFirstMatch(Collections.emptySet(), FlowTestUtils.MATCH_ECHO_STEP));\n Assert.assertNull(linear.findFirstMatch(nullNode, FlowTestUtils.MATCH_ECHO_STEP));\n Assert.assertNull(linear.findFirstMatch(nullExecution, FlowTestUtils.MATCH_ECHO_STEP));\n\n\n // Filtered nodes\n FlowTestUtils.assertNodeOrder(\"Filtered echo nodes\", linear.filteredNodes(heads, FlowTestUtils.MATCH_ECHO_STEP), 5, 4);\n FlowTestUtils.assertNodeOrder(\"Filtered echo nodes\", linear.filteredNodes(heads, Collections.singleton(intermediateNode), FlowTestUtils.MATCH_ECHO_STEP), 5);\n Assert.assertEquals(0, linear.filteredNodes(heads, null, Predicates.alwaysFalse()).size());\n Assert.assertEquals(0, linear.filteredNodes(nullNode, FlowTestUtils.MATCH_ECHO_STEP).size());\n Assert.assertEquals(0, linear.filteredNodes(Collections.emptySet(), FlowTestUtils.MATCH_ECHO_STEP).size());\n\n // Same filter using the filterator\n linear.setup(heads);\n ArrayList<FlowNode> collected = new ArrayList<>();\n Filterator<FlowNode> filt = linear.filter(FlowTestUtils.MATCH_ECHO_STEP);\n while (filt.hasNext()) {\n collected.add(filt.next());\n }\n FlowTestUtils.assertNodeOrder(\"Filterator filtered echo nodes\", collected, 5, 4);\n\n\n // Visitor pattern tests\n FlowTestUtils.CollectingVisitor visitor = new FlowTestUtils.CollectingVisitor();\n linear.visitAll(Collections.emptySet(), visitor);\n Assert.assertEquals(0, visitor.getVisited().size());\n visitor.reset();\n\n linear.visitAll(heads, visitor);\n FlowTestUtils.assertNodeOrder(\"Visiting all nodes\", visitor.getVisited(), 6, 5, 4, 3, 2);\n\n // And visiting with blacklist\n visitor.reset();\n linear.visitAll(heads, Collections.singleton(intermediateNode), visitor);\n FlowTestUtils.assertNodeOrder(\"Visiting all nodes with blacklist\", visitor.getVisited(), 6, 5);\n\n // Tests for edge cases of the various basic APIs\n linear.myNext = null;\n Assert.assertFalse(linear.hasNext());\n try {\n linear.next();\n Assert.fail(\"Should throw NoSuchElement exception\");\n } catch (NoSuchElementException nsee) {\n // Passing case\n }\n Assert.assertSame(linear.iterator(), linear);\n try {\n linear.remove();\n Assert.fail(\"Should throw UnsupportedOperation exception\");\n } catch (UnsupportedOperationException usoe) {\n // Passing case\n }\n }",
"@Override\n public <U extends Comparable<? super U>> Comparator<Object> thenComparing(final Function<?, ? extends U> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1793)\n // at com.strobel.assembler.metadata.MetadataHelper$5.visitWildcard(MetadataHelper.java:1790)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:21)\n // at com.strobel.assembler.metadata.MetadataHelper.getLowerBound(MetadataHelper.java:1240)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2278)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitWildcard(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.WildcardType.accept(WildcardType.java:83)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2256)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.adaptRecursive(MetadataHelper.java:2233)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2246)\n // at com.strobel.assembler.metadata.MetadataHelper$Adapter.visitParameterizedType(MetadataHelper.java:2222)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.adapt(MetadataHelper.java:1312)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2708)\n // at com.strobel.assembler.metadata.MetadataHelper$11.visitClassType(MetadataHelper.java:2692)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visitParameterizedType(DefaultTypeVisitor.java:65)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedGenericType.accept(CoreMetadataFactory.java:653)\n // at com.strobel.assembler.metadata.DefaultTypeVisitor.visit(DefaultTypeVisitor.java:25)\n // at com.strobel.assembler.metadata.MetadataHelper.asSubType(MetadataHelper.java:720)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:926)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:770)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:766)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2515)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"@Override protected void compute2() {\n addToPendingCount(_env.peekAry().numCols()-1);\n int nchks=0;\n for (int i =0; i < _argcnt; ++i)\n nchks+=_env.peekAryAt(-i).anyVec().nChunks();\n\n _espc = new long[nchks+1];\n int coffset = _env.peekAry().anyVec().nChunks();\n long[] first_espc = _env.peekAry().anyVec().get_espc();\n System.arraycopy(first_espc, 0, _espc, 0, first_espc.length);\n for (int i=1; i< _argcnt; ++i) {\n long roffset = _espc[coffset];\n long[] espc = _env.peekAryAt(-i).anyVec().get_espc();\n int j = 1;\n for (; j < espc.length; j++)\n _espc[coffset + j] = roffset+ espc[j];\n coffset += _env.peekAryAt(-i).anyVec().nChunks();\n }\n\n Key[] keys = _env.peekAry().anyVec().group().addVecs(_env.peekAry().numCols());\n _vecs = new Vec[keys.length];\n for (int i=0; i<_vecs.length; ++i)\n _vecs[i] = new Vec( keys[i], _espc, null, _env.peekAry().vec(i).get_type());\n\n for (int i=0; i < Math.min(_maxP, _vecs.length); ++i) forkVecTask(i);\n }",
"@Test\n public void testParallelScan() throws Exception {\n WorkflowJob job = r.jenkins.createProject(WorkflowJob.class, \"Convoluted\");\n job.setDefinition(new CpsFlowDefinition(\n \"echo 'first'\\n\" +\n \"def steps = [:]\\n\" +\n \"steps['1'] = {\\n\" +\n \" echo 'do 1 stuff'\\n\" +\n \"}\\n\" +\n \"steps['2'] = {\\n\" +\n \" echo '2a'\\n\" +\n \" echo '2b'\\n\" +\n \"}\\n\" +\n \"parallel steps\\n\" +\n \"echo 'final'\",\n true));\n\n /* Flow structure (ID - type)\n 2 - FlowStartNode (BlockStartNode)\n 3 - Echostep\n 4 - ParallelStep (StepStartNode) (start branches)\n 6 - ParallelStep (StepStartNode) (start branch 1), ParallelLabelAction with branchname=1\n 7 - ParallelStep (StepStartNode) (start branch 2), ParallelLabelAction with branchname=2\n 8 - EchoStep, (branch 1) parent=6\n 9 - StepEndNode, (end branch 1) startId=6, parentId=8\n 10 - EchoStep, (branch 2) parentId=7\n 11 - EchoStep, (branch 2) parentId = 10\n 12 - StepEndNode (end branch 2) startId=7 parentId=11,\n 13 - StepEndNode (close branches), parentIds = 9,12, startId=4\n 14 - EchoStep\n 15 - FlowEndNode (BlockEndNode)\n */\n\n WorkflowRun b = r.assertBuildStatusSuccess(job.scheduleBuild2(0));\n FlowExecution exec = b.getExecution();\n Collection<FlowNode> heads = b.getExecution().getCurrentHeads();\n\n AbstractFlowScanner scanner = new LinearScanner();\n scanner.setup(heads);\n FlowTestUtils.assertNodeOrder(\"Linear\", scanner, 15, 14, 13, 9, 8, 6, 4, 3, 2);\n scanner.setup(heads, Collections.singleton(exec.getNode(\"9\")));\n FlowTestUtils.assertNodeOrder(\"Linear\", scanner, 15, 14, 13, 12, 11, 10, 7, 4, 3, 2);\n\n\n // Depth first scanner and with blacklist\n scanner = new DepthFirstScanner();\n scanner.setup(heads);\n\n // Compatibility test for ordering\n FlowTestUtils.assertNodeOrder(\"FlowGraphWalker\", new FlowGraphWalker(exec), 15, 14, 13,\n 9, 8, 6, // Branch 1\n 4, 3, 2, // Before parallel\n 12, 11, 10, 7); // Branch 2\n FlowTestUtils.assertNodeOrder(\"Depth first\", new FlowGraphWalker(exec), 15, 14, 13,\n 9, 8, 6, // Branch 1\n 4, 3, 2, // Before parallel\n 12, 11, 10, 7); // Branch 2\n scanner.setup(heads, Collections.singleton(exec.getNode(\"9\")));\n FlowTestUtils.assertNodeOrder(\"Linear\", scanner, 15, 14, 13, 12, 11, 10, 7, 4, 3, 2);\n\n scanner.setup(Arrays.asList(exec.getNode(\"9\"), exec.getNode(\"12\")));\n FlowTestUtils.assertNodeOrder(\"Depth-first scanner from inside parallels\", scanner, 9, 8, 6, 4, 3, 2, 12, 11, 10, 7);\n\n // We're going to test the ForkScanner in more depth since this is its natural use\n scanner = new ForkScanner();\n scanner.setup(heads);\n FlowTestUtils.assertNodeOrder(\"ForkedScanner\", scanner, 15, 14, 13,\n 12, 11, 10, 7,// One parallel\n 9, 8, 6, // other parallel\n 4, 3, 2); // end bit\n scanner.setup(heads, Collections.singleton(exec.getNode(\"9\")));\n FlowTestUtils.assertNodeOrder(\"ForkedScanner\", scanner, 15, 14, 13, 12, 11, 10, 7, 4, 3, 2);\n\n // Test forkscanner midflow\n scanner.setup(exec.getNode(\"14\"));\n FlowTestUtils.assertNodeOrder(\"ForkedScanner\", scanner, 14, 13,\n 12, 11, 10, 7, // Last parallel\n 9, 8, 6, // First parallel\n 4, 3, 2); // end bit\n\n // Test forkscanner inside a parallel\n List<FlowNode> startingPoints = Arrays.asList(exec.getNode(\"9\"), exec.getNode(\"12\"));\n scanner.setup(startingPoints);\n FlowTestUtils.assertNodeOrder(\"ForkedScanner\", scanner, 9, 8, 6, 12, 11, 10, 7, 4, 3, 2);\n\n startingPoints = Arrays.asList(exec.getNode(\"9\"), exec.getNode(\"11\"));\n scanner.setup(startingPoints);\n FlowTestUtils.assertNodeOrder(\"ForkedScanner\", scanner, 9, 8, 6, 11, 10, 7, 4, 3, 2);\n\n\n // Filtering at different points within branches\n List<FlowNode> blackList = Arrays.asList(exec.getNode(\"6\"), exec.getNode(\"7\"));\n Assert.assertEquals(4, scanner.filteredNodes(heads, blackList, FlowTestUtils.MATCH_ECHO_STEP).size());\n Assert.assertEquals(4, scanner.filteredNodes(heads, Collections.singletonList(exec.getNode(\"4\")), FlowTestUtils.MATCH_ECHO_STEP).size());\n blackList = Arrays.asList(exec.getNode(\"6\"), exec.getNode(\"10\"));\n Assert.assertEquals(3, scanner.filteredNodes(heads, blackList, FlowTestUtils.MATCH_ECHO_STEP).size());\n }",
"@Test\n public void testIssue41() {\n testIssue41Internal(dfa -> Minimizer.minimize(dfa.transitionGraphView()));\n testIssue41Internal(dfa -> new Minimizer<Integer, Property<Character, Void>>().performMinimization(dfa.transitionGraphView()));\n }",
"@Override\n @SuppressWarnings(\"unchecked\")\n public List<DataSink<?>> translateInto(Flow flow) {\n DAG<FlinkOperator<Operator<?, ?>>> dag = flowToDag(flow);\n\n BatchExecutorContext executorContext = new BatchExecutorContext(env, (DAG) dag,\n accumulatorFactory, settings);\n\n // translate each operator to proper Flink transformation\n dag.traverse().map(Node::get).forEach(op -> {\n Operator<?, ?> originalOp = op.getOriginalOperator();\n Translation<Operator<?, ?>> tx = translations.get(originalOp.getClass());\n if (tx == null) {\n throw new UnsupportedOperationException(\n \"Operator \" + op.getClass().getSimpleName() + \" not supported\");\n }\n // ~ verify the flowToDag translation\n Preconditions.checkState(\n tx.accept == null || Boolean.TRUE.equals(tx.accept.apply(originalOp)));\n\n DataSet<?> out = tx.translator.translate(op, executorContext);\n\n // save output of current operator to context\n executorContext.setOutput(op, out);\n });\n\n // process all sinks in the DAG (leaf nodes)\n final List<DataSink<?>> sinks = new ArrayList<>();\n dag.getLeafs()\n .stream()\n .map(Node::get)\n .filter(op -> op.output().getOutputSink() != null)\n .forEach(op -> {\n\n final DataSink<?> sink = op.output().getOutputSink();\n sinks.add(sink);\n DataSet<?> flinkOutput =\n Objects.requireNonNull(executorContext.getOutputStream(op));\n\n flinkOutput.output(new DataSinkWrapper<>((DataSink) sink));\n });\n\n return sinks;\n }",
"public interface C0840a {\n /* renamed from: a */\n Object mo12923a(String str, Continuation<? super Unit> continuation);\n}",
"void a(bu var1_1, f var2_2, Map var3_3, double var4_4, double var6_5) {\n block6 : {\n var14_6 = fj.z;\n var8_7 = M.b();\n var9_8 = var2_2.a();\n while (var9_8.f()) {\n var10_9 = var9_8.a();\n if (var14_6) break block6;\n if (!var10_9.e() || var1_1.i((y.c.d)var10_9).bendCount() > 1) ** GOTO lbl-1000\n var11_10 = var1_1.i((y.c.d)var10_9);\n var12_11 = var11_10.getSourceRealizer();\n if (var1_1.i((y.c.d)var10_9).bendCount() == 0) {\n var11_10.appendBend(var11_10.getSourcePort().a(var12_11), var11_10.getSourcePort().b(var12_11) - 20.0 - var12_11.getHeight());\n }\n this.a(var1_1, var4_4, var6_5, (y.c.d)var10_9, true, false, false, var10_9.c());\n if (var14_6) lbl-1000: // 2 sources:\n {\n var8_7.a(var10_9, true);\n var8_7.a((Object)var3_3.get(var10_9), true);\n }\n var9_8.g();\n if (!var14_6) continue;\n }\n var1_1.a(as.a, var8_7);\n }\n var9_8 = new as();\n var9_8.a(5.0);\n var9_8.b(false);\n var9_8.a(true);\n try {\n var10_9 = new bI(1);\n var10_9.a(false);\n var10_9.b(true);\n var10_9.d().a(true);\n var10_9.a(var1_1, (ah)var9_8);\n return;\n }\n finally {\n var1_1.d_(as.a);\n }\n }",
"@java.lang.Deprecated\n /* renamed from: a */\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public static synchronized void m13804a(android.content.Context r3, com.facebook.C6787r.C6788a r4) {\n /*\n java.lang.Class<com.facebook.r> r0 = com.facebook.C6787r.class\n monitor-enter(r0)\n java.lang.Boolean r1 = f12487s // Catch:{ all -> 0x0088 }\n boolean r1 = r1.booleanValue() // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0012\n if (r4 == 0) goto L_0x0010\n r4.mo20141a() // Catch:{ all -> 0x0088 }\n L_0x0010:\n monitor-exit(r0)\n return\n L_0x0012:\n java.lang.String r1 = \"applicationContext\"\n com.facebook.internal.C6697T.m13461a(r3, r1) // Catch:{ all -> 0x0088 }\n r1 = 0\n com.facebook.internal.C6697T.m13460a(r3, r1) // Catch:{ all -> 0x0088 }\n com.facebook.internal.C6697T.m13466b(r3, r1) // Catch:{ all -> 0x0088 }\n android.content.Context r1 = r3.getApplicationContext() // Catch:{ all -> 0x0088 }\n f12481m = r1 // Catch:{ all -> 0x0088 }\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n m13810b(r1) // Catch:{ all -> 0x0088 }\n java.lang.String r1 = f12472d // Catch:{ all -> 0x0088 }\n boolean r1 = com.facebook.internal.C6694S.m13436b(r1) // Catch:{ all -> 0x0088 }\n if (r1 != 0) goto L_0x0080\n r1 = 1\n java.lang.Boolean r1 = java.lang.Boolean.valueOf(r1) // Catch:{ all -> 0x0088 }\n f12487s = r1 // Catch:{ all -> 0x0088 }\n boolean r1 = m13817g() // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0041\n m13812c() // Catch:{ all -> 0x0088 }\n L_0x0041:\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n boolean r1 = r1 instanceof android.app.Application // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0056\n boolean r1 = com.facebook.C6557O.m12974e() // Catch:{ all -> 0x0088 }\n if (r1 == 0) goto L_0x0056\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n android.app.Application r1 = (android.app.Application) r1 // Catch:{ all -> 0x0088 }\n java.lang.String r2 = f12472d // Catch:{ all -> 0x0088 }\n com.facebook.p127a.p130b.C6602h.m13083a(r1, r2) // Catch:{ all -> 0x0088 }\n L_0x0056:\n com.facebook.internal.C6670D.m13313f() // Catch:{ all -> 0x0088 }\n com.facebook.internal.C6678J.m13355d() // Catch:{ all -> 0x0088 }\n android.content.Context r1 = f12481m // Catch:{ all -> 0x0088 }\n com.facebook.internal.C6712c.m13522a(r1) // Catch:{ all -> 0x0088 }\n com.facebook.internal.G r1 = new com.facebook.internal.G // Catch:{ all -> 0x0088 }\n com.facebook.o r2 = new com.facebook.o // Catch:{ all -> 0x0088 }\n r2.<init>() // Catch:{ all -> 0x0088 }\n r1.<init>(r2) // Catch:{ all -> 0x0088 }\n f12480l = r1 // Catch:{ all -> 0x0088 }\n java.util.concurrent.FutureTask r1 = new java.util.concurrent.FutureTask // Catch:{ all -> 0x0088 }\n com.facebook.p r2 = new com.facebook.p // Catch:{ all -> 0x0088 }\n r2.<init>(r4, r3) // Catch:{ all -> 0x0088 }\n r1.<init>(r2) // Catch:{ all -> 0x0088 }\n java.util.concurrent.Executor r2 = m13822l() // Catch:{ all -> 0x0088 }\n r2.execute(r1) // Catch:{ all -> 0x0088 }\n monitor-exit(r0)\n return\n L_0x0080:\n com.facebook.FacebookException r1 = new com.facebook.FacebookException // Catch:{ all -> 0x0088 }\n java.lang.String r2 = \"A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.\"\n r1.<init>(r2) // Catch:{ all -> 0x0088 }\n throw r1 // Catch:{ all -> 0x0088 }\n L_0x0088:\n r3 = move-exception\n monitor-exit(r0)\n throw r3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.facebook.C6787r.m13804a(android.content.Context, com.facebook.r$a):void\");\n }",
"public final void a() {\n /*\n r25 = this;\n r1 = r25\n int r0 = r25.getAndIncrement()\n if (r0 == 0) goto L_0x0009\n return\n L_0x0009:\n java.util.concurrent.atomic.AtomicReference<io.reactivex.internal.operators.flowable.cq$b<T>[]> r2 = r1.e\n java.lang.Object r0 = r2.get()\n io.reactivex.internal.operators.flowable.cq$b[] r0 = (io.reactivex.internal.operators.flowable.cq.b[]) r0\n r3 = 1\n r4 = r0\n r5 = 1\n L_0x0014:\n java.lang.Object r0 = r1.h\n io.reactivex.internal.b.j<T> r6 = r1.j\n if (r6 == 0) goto L_0x0023\n boolean r8 = r6.isEmpty()\n if (r8 == 0) goto L_0x0021\n goto L_0x0023\n L_0x0021:\n r8 = 0\n goto L_0x0024\n L_0x0023:\n r8 = 1\n L_0x0024:\n boolean r0 = r1.a(r0, r8)\n if (r0 == 0) goto L_0x002b\n return\n L_0x002b:\n if (r8 != 0) goto L_0x0156\n int r0 = r4.length\n int r9 = r4.length\n r12 = 0\n r13 = 0\n r14 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n L_0x0036:\n r16 = -9223372036854775808\n if (r12 >= r9) goto L_0x0053\n r7 = r4[r12]\n long r18 = r7.get()\n int r20 = (r18 > r16 ? 1 : (r18 == r16 ? 0 : -1))\n if (r20 == 0) goto L_0x004e\n long r10 = r7.c\n long r10 = r18 - r10\n long r10 = java.lang.Math.min(r14, r10)\n r14 = r10\n goto L_0x0050\n L_0x004e:\n int r13 = r13 + 1\n L_0x0050:\n int r12 = r12 + 1\n goto L_0x0036\n L_0x0053:\n r9 = 1\n if (r0 != r13) goto L_0x0093\n java.lang.Object r0 = r1.h\n java.lang.Object r7 = r6.poll() // Catch:{ all -> 0x005e }\n goto L_0x0075\n L_0x005e:\n r0 = move-exception\n r6 = r0\n io.reactivex.c.b.throwIfFatal(r6)\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.cancel()\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.error(r6)\n r1.h = r0\n r7 = 0\n L_0x0075:\n if (r7 != 0) goto L_0x0079\n r6 = 1\n goto L_0x007a\n L_0x0079:\n r6 = 0\n L_0x007a:\n boolean r0 = r1.a(r0, r6)\n if (r0 == 0) goto L_0x0081\n return\n L_0x0081:\n int r0 = r1.i\n if (r0 == r3) goto L_0x0090\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.request(r9)\n L_0x0090:\n r6 = 1\n goto L_0x0165\n L_0x0093:\n r0 = r8\n r8 = 0\n L_0x0095:\n long r11 = (long) r8\n int r13 = (r11 > r14 ? 1 : (r11 == r14 ? 0 : -1))\n if (r13 >= 0) goto L_0x0139\n java.lang.Object r0 = r1.h\n java.lang.Object r13 = r6.poll() // Catch:{ all -> 0x00a1 }\n goto L_0x00b8\n L_0x00a1:\n r0 = move-exception\n r13 = r0\n io.reactivex.c.b.throwIfFatal(r13)\n java.util.concurrent.atomic.AtomicReference<org.b.d> r0 = r1.g\n java.lang.Object r0 = r0.get()\n org.b.d r0 = (org.b.d) r0\n r0.cancel()\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.error(r13)\n r1.h = r0\n r13 = 0\n L_0x00b8:\n if (r13 != 0) goto L_0x00bc\n r7 = 1\n goto L_0x00bd\n L_0x00bc:\n r7 = 0\n L_0x00bd:\n boolean r0 = r1.a(r0, r7)\n if (r0 == 0) goto L_0x00c4\n return\n L_0x00c4:\n if (r7 != 0) goto L_0x0135\n java.lang.Object r0 = io.reactivex.internal.util.NotificationLite.getValue(r13)\n int r11 = r4.length\n r12 = 0\n r13 = 0\n L_0x00cd:\n if (r12 >= r11) goto L_0x0103\n r3 = r4[r12]\n long r22 = r3.get()\n int r24 = (r22 > r16 ? 1 : (r22 == r16 ? 0 : -1))\n if (r24 == 0) goto L_0x00f1\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n int r24 = (r22 > r20 ? 1 : (r22 == r20 ? 0 : -1))\n r22 = r6\n r23 = r7\n if (r24 == 0) goto L_0x00eb\n long r6 = r3.c\n long r6 = r6 + r9\n r3.c = r6\n L_0x00eb:\n org.b.c<? super T> r3 = r3.f8109a\n r3.onNext(r0)\n goto L_0x00fb\n L_0x00f1:\n r22 = r6\n r23 = r7\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n r13 = 1\n L_0x00fb:\n int r12 = r12 + 1\n r6 = r22\n r7 = r23\n r3 = 1\n goto L_0x00cd\n L_0x0103:\n r22 = r6\n r23 = r7\n r20 = 9223372036854775807(0x7fffffffffffffff, double:NaN)\n int r8 = r8 + 1\n java.lang.Object r0 = r2.get()\n io.reactivex.internal.operators.flowable.cq$b[] r0 = (io.reactivex.internal.operators.flowable.cq.b[]) r0\n if (r13 != 0) goto L_0x0120\n if (r0 == r4) goto L_0x0119\n goto L_0x0120\n L_0x0119:\n r6 = r22\n r0 = r23\n r3 = 1\n goto L_0x0095\n L_0x0120:\n if (r8 == 0) goto L_0x0133\n int r3 = r1.i\n r4 = 1\n if (r3 == r4) goto L_0x0133\n java.util.concurrent.atomic.AtomicReference<org.b.d> r3 = r1.g\n java.lang.Object r3 = r3.get()\n org.b.d r3 = (org.b.d) r3\n long r6 = (long) r8\n r3.request(r6)\n L_0x0133:\n r4 = r0\n goto L_0x0165\n L_0x0135:\n r23 = r7\n r0 = r23\n L_0x0139:\n if (r8 == 0) goto L_0x014c\n int r3 = r1.i\n r6 = 1\n if (r3 == r6) goto L_0x014d\n java.util.concurrent.atomic.AtomicReference<org.b.d> r3 = r1.g\n java.lang.Object r3 = r3.get()\n org.b.d r3 = (org.b.d) r3\n r3.request(r11)\n goto L_0x014d\n L_0x014c:\n r6 = 1\n L_0x014d:\n r7 = 0\n int r3 = (r14 > r7 ? 1 : (r14 == r7 ? 0 : -1))\n if (r3 == 0) goto L_0x0157\n if (r0 == 0) goto L_0x0165\n goto L_0x0157\n L_0x0156:\n r6 = 1\n L_0x0157:\n int r0 = -r5\n int r5 = r1.addAndGet(r0)\n if (r5 == 0) goto L_0x0168\n java.lang.Object r0 = r2.get()\n r4 = r0\n io.reactivex.internal.operators.flowable.cq$b[] r4 = (io.reactivex.internal.operators.flowable.cq.b[]) r4\n L_0x0165:\n r3 = 1\n goto L_0x0014\n L_0x0168:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.reactivex.internal.operators.flowable.cq.c.a():void\");\n }",
"public final h.c.b<java.lang.Object> g() {\n /*\n r2 = this;\n h.c.b<java.lang.Object> r0 = r2.f15786a\n if (r0 == 0) goto L_0x0005\n goto L_0x001d\n L_0x0005:\n h.c.e r0 = r2.b()\n h.c.c$b r1 = h.c.c.f14536c\n h.c.e$b r0 = r0.get(r1)\n h.c.c r0 = (h.c.c) r0\n if (r0 == 0) goto L_0x001a\n h.c.b r0 = r0.c(r2)\n if (r0 == 0) goto L_0x001a\n goto L_0x001b\n L_0x001a:\n r0 = r2\n L_0x001b:\n r2.f15786a = r0\n L_0x001d:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.coroutines.jvm.internal.ContinuationImpl.g():h.c.b\");\n }",
"@Test\n\tpublic abstract void testTransform4();",
"@Override\n\tvoid collect() {\n\t\t\n\t}",
"public final void run() {\n /*\n r11 = this;\n java.util.ArrayList r4 = new java.util.ArrayList\n r4.<init>()\n java.util.List r0 = r11.f7254\n java.util.Iterator r6 = r0.iterator()\n goto L_0x00fb\n L_0x000d:\n java.lang.Object r0 = r6.next()\n o.刴 r0 = (p004o.C1530) r0\n r5 = r0\n o.鑺 r7 = r11.f7255 // Catch:{ 櫂 -> 0x00f5 }\n r8 = r5\n java.lang.String r0 = \"consume\"\n r7.mo4508(r0) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r0 = r8.f7295 // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r1 = \"inapp\"\n boolean r0 = r0.equals(r1) // Catch:{ 櫂 -> 0x00f5 }\n if (r0 != 0) goto L_0x0045\n o.櫂 r0 = new o.櫂 // Catch:{ 櫂 -> 0x00f5 }\n java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r2 = \"Items of type '\"\n r1.<init>(r2) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r2 = r8.f7295 // Catch:{ 櫂 -> 0x00f5 }\n java.lang.StringBuilder r1 = r1.append(r2) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r2 = \"' can't be consumed.\"\n java.lang.StringBuilder r1 = r1.append(r2) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r1 = r1.toString() // Catch:{ 櫂 -> 0x00f5 }\n r2 = -1010(0xfffffffffffffc0e, float:NaN)\n r0.<init>(r2, r1) // Catch:{ 櫂 -> 0x00f5 }\n throw r0 // Catch:{ 櫂 -> 0x00f5 }\n L_0x0045:\n java.lang.String r9 = r8.f7289 // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r10 = r8.f7290 // Catch:{ RemoteException -> 0x00c2 }\n if (r9 == 0) goto L_0x0053\n java.lang.String r0 = \"\"\n boolean r0 = r9.equals(r0) // Catch:{ RemoteException -> 0x00c2 }\n if (r0 == 0) goto L_0x009d\n L_0x0053:\n java.lang.StringBuilder r0 = new java.lang.StringBuilder // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r1 = \"Can't consume \"\n r0.<init>(r1) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r0 = r0.append(r10) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r1 = \". No token.\"\n java.lang.StringBuilder r0 = r0.append(r1) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r5 = r0.toString() // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r0 = r7.f8316 // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r2 = \"In-app billing error: \"\n r1.<init>(r2) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r1 = r1.append(r5) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r1 = r1.toString() // Catch:{ RemoteException -> 0x00c2 }\n android.util.Log.e(r0, r1) // Catch:{ RemoteException -> 0x00c2 }\n o.櫂 r0 = new o.櫂 // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r2 = \"PurchaseInfo is missing token for sku: \"\n r1.<init>(r2) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r1 = r1.append(r10) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r2 = \" \"\n java.lang.StringBuilder r1 = r1.append(r2) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r1 = r1.append(r8) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r1 = r1.toString() // Catch:{ RemoteException -> 0x00c2 }\n r2 = -1007(0xfffffffffffffc11, float:NaN)\n r0.<init>(r2, r1) // Catch:{ RemoteException -> 0x00c2 }\n throw r0 // Catch:{ RemoteException -> 0x00c2 }\n L_0x009d:\n o.鷭 r0 = r7.f8308 // Catch:{ RemoteException -> 0x00c2 }\n android.content.Context r1 = r7.f8307 // Catch:{ RemoteException -> 0x00c2 }\n r1.getPackageName() // Catch:{ RemoteException -> 0x00c2 }\n int r7 = r0.mo4540() // Catch:{ RemoteException -> 0x00c2 }\n if (r7 == 0) goto L_0x00da\n p004o.C1782.m2448(r7) // Catch:{ RemoteException -> 0x00c2 }\n o.櫂 r0 = new o.櫂 // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r2 = \"Error consuming sku \"\n r1.<init>(r2) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.StringBuilder r1 = r1.append(r10) // Catch:{ RemoteException -> 0x00c2 }\n java.lang.String r1 = r1.toString() // Catch:{ RemoteException -> 0x00c2 }\n r0.<init>(r7, r1) // Catch:{ RemoteException -> 0x00c2 }\n throw r0 // Catch:{ RemoteException -> 0x00c2 }\n L_0x00c2:\n r9 = move-exception\n o.櫂 r0 = new o.櫂 // Catch:{ 櫂 -> 0x00f5 }\n java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r2 = \"Remote exception while consuming. PurchaseInfo: \"\n r1.<init>(r2) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.StringBuilder r1 = r1.append(r8) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r1 = r1.toString() // Catch:{ 櫂 -> 0x00f5 }\n r2 = -1001(0xfffffffffffffc17, float:NaN)\n r0.<init>(r2, r1, r9) // Catch:{ 櫂 -> 0x00f5 }\n throw r0 // Catch:{ 櫂 -> 0x00f5 }\n L_0x00da:\n o.ậ r0 = new o.ậ // Catch:{ 櫂 -> 0x00f5 }\n java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r2 = \"Successful consume of sku \"\n r1.<init>(r2) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r2 = r5.f7290 // Catch:{ 櫂 -> 0x00f5 }\n java.lang.StringBuilder r1 = r1.append(r2) // Catch:{ 櫂 -> 0x00f5 }\n java.lang.String r1 = r1.toString() // Catch:{ 櫂 -> 0x00f5 }\n r2 = 0\n r0.<init>(r2, r1) // Catch:{ 櫂 -> 0x00f5 }\n r4.add(r0) // Catch:{ 櫂 -> 0x00f5 }\n goto L_0x00fb\n L_0x00f5:\n r5 = move-exception\n o.ậ r0 = r5.f7614\n r4.add(r0)\n L_0x00fb:\n boolean r0 = r6.hasNext()\n if (r0 != 0) goto L_0x000d\n o.鑺 r5 = r11.f7255\n java.lang.String r0 = \"\"\n r5.f8306 = r0\n r0 = 0\n r5.f8310 = r0\n o.鑺$鷭 r0 = r11.f7253\n if (r0 == 0) goto L_0x011c\n android.os.Handler r0 = r11.f7252\n o.閇 r1 = new o.閇\n o.鑺$鷭 r2 = r11.f7253\n java.util.List r3 = r11.f7254\n r1.<init>(r11, r2, r3, r4)\n r0.post(r1)\n L_0x011c:\n o.鑺$if r0 = r11.f7251\n if (r0 == 0) goto L_0x012e\n android.os.Handler r0 = r11.f7252\n o.祽 r1 = new o.祽\n o.鑺$if r2 = r11.f7251\n java.util.List r3 = r11.f7254\n r1.<init>(r11, r2, r3, r4)\n r0.post(r1)\n L_0x012e:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p004o.C1509.run():void\");\n }",
"@Test\n public void testParallelPropagationLoopBack3Sites() {\n // Create locators\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(2, lnPort));\n Integer tkPort = vm2.invoke(() -> WANTestBase.createFirstRemoteLocator(3, lnPort));\n\n // create cache and receivers on all the 3 sites\n createCacheInVMs(lnPort, vm3, vm6);\n createReceiverInVMs(vm3, vm6);\n createCacheInVMs(nyPort, vm4, vm7);\n createReceiverInVMs(vm4, vm7);\n createCacheInVMs(tkPort, vm5);\n createReceiverInVMs(vm5);\n\n\n // create senders on all the 3 sites\n vm3.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm6.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n\n vm4.invoke(() -> WANTestBase.createSender(\"ny\", 3, true, 100, 10, false, false, null, true));\n vm7.invoke(() -> WANTestBase.createSender(\"ny\", 3, true, 100, 10, false, false, null, true));\n\n vm5.invoke(() -> WANTestBase.createSender(\"tk\", 1, true, 100, 10, false, false, null, true));\n\n // create PR on the 3 sites\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n vm6.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 0, 100,\n isOffHeap()));\n\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n vm7.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 0, 100,\n isOffHeap()));\n\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"tk\", 0, 100,\n isOffHeap()));\n\n // start senders on all the sites\n startSenderInVMs(\"ln\", vm3, vm6);\n\n startSenderInVMs(\"ny\", vm4, vm7);\n\n vm5.invoke(() -> WANTestBase.startSender(\"tk\"));\n\n // pause senders on site1 and site3. Site2 has the sender running to pass along events\n vm3.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n vm6.invoke(() -> WANTestBase.pauseSender(\"ln\"));\n\n vm5.invoke(() -> WANTestBase.pauseSender(\"tk\"));\n\n // do puts on site1\n vm3.invoke(() -> WANTestBase.doPuts(getTestMethodName() + \"_PR\", 100));\n\n // do more puts on site3\n vm5.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 100, 200));\n\n // verify queue size on site1 and site3\n vm3.invoke(() -> WANTestBase.verifyQueueSize(\"ln\", 100));\n vm5.invoke(() -> WANTestBase.verifyQueueSize(\"tk\", 100));\n\n // resume sender on site1 so that events reach site2 and from there to site3\n vm3.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm6.invoke(() -> WANTestBase.resumeSender(\"ln\"));\n vm6.invoke(() -> waitForSenderRunningState(\"ln\"));\n vm3.invoke(() -> waitForSenderRunningState(\"ln\"));\n\n // validate region size on site2 (should have 100) and site3 (should have 200)\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n\n // verify queue size remains same on site3 which means event loopback did not happen\n // this means events coming from site1 are not enqueued back into the sender\n vm5.invoke(() -> WANTestBase.verifyQueueSize(\"tk\", 100));\n\n // resume sender on site3\n vm5.invoke(() -> WANTestBase.resumeSender(\"tk\"));\n vm5.invoke(() -> waitForSenderRunningState(\"tk\"));\n\n // validate region size\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 200));\n }",
"public final void m18179a(java.lang.Throwable r4) {\n /*\n r3 = this;\n r0 = 0\n java.lang.Object[] r0 = new java.lang.Object[r0]\n java.lang.String r1 = \"Refresh Account failed\"\n p686n.p687a.Timber.m44528b(r4, r1, r0)\n g.e.b.d.r$b r4 = new g.e.b.d.r$b\n r4.<init>(r3)\n r3.updateState(r4)\n com.bamtechmedia.dominguez.core.d r4 = r3.f12932d\n boolean r4 = r4.mo13695j()\n if (r4 != 0) goto L_0x0051\n io.reactivex.disposables.Disposable r4 = r3.f12929a\n if (r4 != 0) goto L_0x0051\n com.bamtechmedia.dominguez.core.d r4 = r3.f12932d\n io.reactivex.Completable r4 = r4.mo13697n()\n g.n.a.c0 r0 = r3.getViewModelScope()\n g.n.a.h r0 = p163g.p503n.p504a.C11793e.m37930a(r0)\n java.lang.Object r4 = r4.mo30048a(r0)\n java.lang.String r0 = \"this.`as`(AutoDispose.au…isposable<Any>(provider))\"\n kotlin.jvm.internal.Intrinsics.checkReturnedValueIsNotNull(r4, r0)\n g.n.a.v r4 = (p163g.p503n.p504a.C11839v) r4\n g.e.b.d.r$c r0 = new g.e.b.d.r$c\n r0.<init>(r3)\n g.e.b.d.s r1 = new g.e.b.d.s\n r1.<init>(r0)\n g.e.b.d.r$d r0 = p163g.p201e.p203b.p204d.C5419r.C5423d.f12939c\n if (r0 == 0) goto L_0x0049\n g.e.b.d.t r2 = new g.e.b.d.t\n r2.<init>(r0)\n r0 = r2\n L_0x0049:\n io.reactivex.functions.Consumer r0 = (p520io.reactivex.functions.Consumer) r0\n io.reactivex.disposables.Disposable r4 = r4.mo29926a(r1, r0)\n r3.f12929a = r4\n L_0x0051:\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: p163g.p201e.p203b.p204d.C5419r.m18179a(java.lang.Throwable):void\");\n }",
"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 }",
"@Test(timeout = 4000)\n public void test052() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter((-32768));\n String[] stringArray0 = new String[2];\n stringArray0[0] = \" u]{2y%.,\";\n stringArray0[1] = \"s4#6U\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, (-1023), \"R$_Ff!sF,uE4P'wGFDy\", \"s4#6U\", \"oc[MfnZM[~MHOK iO\", stringArray0, false, false);\n Object[] objectArray0 = new Object[8];\n objectArray0[0] = (Object) methodWriter0;\n objectArray0[1] = (Object) \" u]{2y%.,\";\n objectArray0[2] = (Object) \" u]{2y%.,\";\n objectArray0[3] = (Object) \" u]{2y%.,\";\n Object object0 = new Object();\n objectArray0[4] = object0;\n objectArray0[5] = (Object) \" u]{2y%.,\";\n objectArray0[6] = (Object) \" u]{2y%.,\";\n objectArray0[0] = (Object) \"R$_Ff!sF,uE4P'wGFDy\";\n // Undeclared exception!\n try { \n methodWriter0.visitFrame(1, 3205, objectArray0, (-1274), stringArray0);\n fail(\"Expecting exception: ClassCastException\");\n \n } catch(ClassCastException e) {\n //\n // java.lang.Object cannot be cast to org.objectweb.asm.jip.Label\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }",
"public interface Transformers {\n\n /**\n * Returns a function which takes a Result and, if it's a success, applies the mapping value to that\n * success, otherwise returning the original failure.\n */\n static <IS, OS, F> Function<Result<IS, F>, Result<OS, F>> onSuccess(Function<IS, OS> mappingFunction) {\n return attempt(mappingFunction.andThen(Result::success));\n }\n\n /**\n * Returns a Consumer which takes a Result and, if it's a Success, passes it to the provided consumer.\n */\n static <S, F> ConsumableFunction<Result<S, F>> onSuccessDo(Consumer<S> consumer) {\n return r -> r.then(onSuccess(peek(consumer)));\n }\n\n /**\n * Returns a function which takes a Result with an Exception failure type and, if it's a success, applies\n * the mapping value to that success, returning a new success unless an exception is thrown, when it\n * returns a failure of that exception. If the input was a failure, it returns that failure.\n */\n static <IS, OS, X extends Exception> Function<Result<IS, Exception>, Result<OS, Exception>> onSuccessTry(\n ThrowingLambdas.ThrowingFunction<IS, OS, X> throwingFunction\n ) {\n return attempt(tryTo(throwingFunction));\n }\n\n\n /**\n * Returns a function which takes a Result and, if it's a success, applies the mapping value\n * to that success, returning a new success unless an exception is thrown, when it\n * returns a failure of the exception-mapper applied to the exception.\n * If the input was a failure, it returns that failure.\n */\n static <IS, OS, F, X extends Exception> Function<Result<IS, F>, Result<OS, F>> onSuccessTry(\n ThrowingLambdas.ThrowingFunction<IS, OS, X> throwingFunction,\n Function<Exception, F> exceptionMapper\n ) {\n return attempt(tryTo(throwingFunction).andThen(onFailure(exceptionMapper)));\n }\n\n /**\n * Returns a function which takes a Result and, if it's a success, applies the provided function\n * to that success - generating a new Result - and returns that Result. Otherwise, returns the\n * original failure.\n */\n static <IS, OS, F, OF extends F> Function<Result<IS, F>, Result<OS, F>> attempt(Function<IS, Result<OS, OF>> mappingFunction) {\n return r -> r.either(mappingFunction.andThen(onFailure((Function<OF, F>) (fv) -> HigherOrderFunctions.upcast(fv))), Result::failure);\n }\n\n /**\n * Returns a function which takes a Result and, if it's a failure, applies the provided function\n * to that failure. Otherwise, returns the original success.\n */\n static <S, IF, OF> Function<Result<S, IF>, Result<S, OF>> onFailure(Function<IF, OF> mappingFunction) {\n return recover(mappingFunction.andThen(Result::failure));\n }\n\n /**\n * Returns a consumer which takes a Result and, if it's a failure, passes it to the provided consumer\n */\n static <S, F> ConsumableFunction<Result<S, F>> onFailureDo(Consumer<F> consumer) {\n return r -> r.then(onFailure(peek(consumer)));\n }\n\n /**\n * Takes a Result of a Stream as a success or a single failure, and returns a Stream of Results\n * containing all the successes, or the single failure.\n *\n * The main use-case for this is to follow mapping over tryTo() on a function which was designed to\n * be flat-mapped over.\n */\n static <S, F> Function<Result<Stream<S>, F>, Stream<Result<S, F>>> unwrapSuccesses() {\n return r -> r.either(\n successes -> successes.map(Result::success),\n failure -> Stream.of(Result.failure(failure))\n );\n }\n\n /**\n * Returns a function which takes a Result and, if it's a failure, applies the provided function to\n * that failure - generating a new Result - and returns that Result. Otherwise, return the original\n * success.\n */\n static <S, IF, OF, OS extends S> Function<Result<S, IF>, Result<S, OF>> recover(Function<IF, Result<OS, OF>> recoveryFunction) {\n return r -> r.either(Result::success, recoveryFunction.andThen(onSuccess((Function<OS, S>) (fv) -> HigherOrderFunctions.upcast(fv))));\n }\n\n /**\n * Returns a function which takes a Result, and converts failures to successes and vice versa.\n */\n static <S, F> Function<Result<S, F>, Result<F, S>> invert() {\n return r -> r.either(Result::failure, Result::success);\n }\n\n /**\n * Returns a function which takes a Result whose success type is itself a Result, and merges the failure cases\n * so we have a flat Result.\n *\n * Note that *most of the time* this shouldn't be required, and indicates using onSuccess() when attempt() would\n * be more appropriate.\n *\n * There are some situations though where we do end up with constructs like this: one example\n * is when a function which returns a Result can throw exceptions (eg, when a Result-returning handler is passed\n * into a database context). Passing that call into a tryTo() will yield a success type of the inner Result, wrapped\n * in an outer Result for the tryTo().\n *\n * If the failure types of the inner and outer failure types do not match, you'll need to either first convert the\n * failures of the outer Result or use the overload which maps the failures of the inner Result.\n */\n static <S, F> Function<Result<Result<S, F>, F>, Result<S, F>> mergeFailures() {\n return attempt(i -> i);\n }\n\n /**\n * Returns a function which takes a Result whose success type is itself a Result, and merges the failure cases\n * so we have a flat Result.\n *\n * Note that *most of the time* this shouldn't be required, and indicates using onSuccess() when attempt() would\n * be more appropriate.\n *\n * There are some situations though where we do end up with constructs like this: one example\n * is when a function which returns a Result can throw exceptions (eg, when a Result-returning handler is passed\n * into a database context). Passing that call into a tryTo() will yield a success type of the inner Result, wrapped\n * in an outer Result for the tryTo().\n *\n * In these cases, it's more likely the inner failure type is domain-specific, so the default approach is to map the\n * outer failure to the inner failure and then merge.\n */\n static <S, F1, F2> Function<Result<Result<S, F1>, F2>, Result<S, F1>> mergeFailures(Function<F2, F1> failureMapper) {\n return r -> r.then(onFailure(failureMapper)).then(mergeFailures());\n }\n}",
"@Test\n @Issue(\"JENKINS-41685\")\n public void testParallelsWithDuplicateEvents() throws Exception {\n //https://gist.github.com/vivek/ccf3a4ef25fbff267c76c962d265041d\n WorkflowJob job = r.jenkins.createProject(WorkflowJob.class, \"ParallelInsanity\");\n job.setDefinition(new CpsFlowDefinition(\"\" +\n \"echo 'first stage'\\n\" +\n \"parallel left : {\\n\" +\n \" echo 'run a bit'\\n\" +\n \" echo 'run a bit more'\\n\" +\n \" semaphore 'wait1'\\n\" +\n \"}, right : {\\n\" +\n \" echo 'wozzle'\\n\" +\n \" semaphore 'wait2'\\n\" +\n \"}\\n\" +\n \"echo 'last stage'\\n\" +\n \"echo \\\"last done\\\"\\n\",\n true));\n ForkScanner scan = new ForkScanner();\n ChunkFinder labelFinder = new NoOpChunkFinder();\n WorkflowRun run = job.scheduleBuild2(0).getStartCondition().get();\n SemaphoreStep.waitForStart(\"wait1/1\", run);\n SemaphoreStep.waitForStart(\"wait2/1\", run);\n\n TestVisitor test = new TestVisitor();\n List<FlowNode> heads = run.getExecution().getCurrentHeads();\n scan.setup(heads);\n scan.visitSimpleChunks(test, labelFinder);\n\n SemaphoreStep.success(\"wait1\"+\"/1\", null);\n SemaphoreStep.success(\"wait2\"+\"/1\", null);\n r.waitForCompletion(run);\n\n int atomEventCount = 0;\n int parallelBranchEndCount = 0;\n int parallelStartCount = 0;\n for (TestVisitor.CallEntry ce : test.calls) {\n switch (ce.type) {\n case ATOM_NODE:\n atomEventCount++;\n break;\n case PARALLEL_BRANCH_END:\n parallelBranchEndCount++;\n break;\n case PARALLEL_START:\n parallelStartCount++;\n break;\n default:\n break;\n }\n }\n\n sanityTestIterationAndVisiter(heads);\n Assert.assertEquals(10, atomEventCount);\n Assert.assertEquals(1, parallelStartCount);\n Assert.assertEquals(2, parallelBranchEndCount);\n }",
"@android.support.annotation.RequiresApi(api = 23)\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final synchronized void c(int r11) {\n /*\n r10 = this;\n monitor-enter(r10)\n r8 = 1\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Integer r2 = java.lang.Integer.valueOf(r11) // Catch:{ all -> 0x004b }\n r9 = 0\n r1[r9] = r2 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16805(0x41a5, float:2.3549E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r2 = java.lang.Integer.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r2 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n boolean r1 = com.meituan.robust.PatchProxy.isSupport(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x003a\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Integer r0 = java.lang.Integer.valueOf(r11) // Catch:{ all -> 0x004b }\n r1[r9] = r0 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16805(0x41a5, float:2.3549E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r0 = java.lang.Integer.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r0 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n com.meituan.robust.PatchProxy.accessDispatch(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n monitor-exit(r10)\n return\n L_0x003a:\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n boolean r1 = r1 instanceof com.ss.android.medialib.camera.IESHwCamera // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x0049\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n com.ss.android.medialib.camera.IESHwCamera r1 = (com.ss.android.medialib.camera.IESHwCamera) r1 // Catch:{ all -> 0x004b }\n r1.c((int) r11) // Catch:{ all -> 0x004b }\n r10.o = r11 // Catch:{ all -> 0x004b }\n L_0x0049:\n monitor-exit(r10)\n return\n L_0x004b:\n r0 = move-exception\n monitor-exit(r10)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ss.android.medialib.camera.g.c(int):void\");\n }",
"@Test\n public void testBasicScanWithBlock() throws Exception {\n WorkflowJob job = r.jenkins.createProject(WorkflowJob.class, \"Convoluted\");\n job.setDefinition(new CpsFlowDefinition(\n \"echo 'first'\\n\" +\n \"timeout(time: 10, unit: 'SECONDS') {\\n\" +\n \" echo 'second'\\n\" +\n \" echo 'third'\\n\" +\n \"}\\n\" +\n \"sleep 1\",\n true));\n /* Flow structure (ID - type)\n 2 - FlowStartNode\n 3 - EchoStep\n 4 - TimeoutStep\n 5 - TimeoutStep with BodyInvocationAction\n 6 - EchoStep\n 7 - EchoStep\n 8 - StepEndNode (BlockEndNode), startId=5\n 9 - StepEndNode (BlockEndNode), startId = 4\n 10 - SleepStep\n 11 - FlowEndNode\n */\n\n WorkflowRun b = r.assertBuildStatusSuccess(job.scheduleBuild2(0));\n Predicate<FlowNode> matchEchoStep = FlowTestUtils.predicateMatchStepDescriptor(\"org.jenkinsci.plugins.workflow.steps.EchoStep\");\n FlowExecution exec = b.getExecution();\n Collection<FlowNode> heads = exec.getCurrentHeads();\n\n // Linear analysis\n LinearScanner linearScanner = new LinearScanner();\n linearScanner.setup(heads);\n FlowTestUtils.assertNodeOrder(\"Linear scan with block\", linearScanner, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2);\n linearScanner.setup(exec.getNode(\"7\"));\n FlowTestUtils.assertNodeOrder(\"Linear scan with block from middle \", linearScanner, 7, 6, 5, 4, 3, 2);\n\n LinearBlockHoppingScanner linearBlockHoppingScanner = new LinearBlockHoppingScanner();\n\n // // Test block jump core\n FlowNode headCandidate = exec.getNode(\"8\");\n Assert.assertEquals(exec.getNode(\"4\"), linearBlockHoppingScanner.jumpBlockScan(headCandidate, Collections.emptySet()));\n Assert.assertTrue(\"Setup should return true if we can iterate\", linearBlockHoppingScanner.setup(headCandidate, null));\n\n // Test the actual iteration\n linearBlockHoppingScanner.setup(heads);\n Assert.assertFalse(linearBlockHoppingScanner.hasNext());\n linearBlockHoppingScanner.setup(exec.getNode(\"8\"));\n FlowTestUtils.assertNodeOrder(\"Hopping over one block\", linearBlockHoppingScanner, 4, 3, 2);\n linearBlockHoppingScanner.setup(exec.getNode(\"7\"));\n FlowTestUtils.assertNodeOrder(\"Hopping over one block\", linearBlockHoppingScanner, 7, 6, 5, 4, 3, 2);\n\n // Test the black list in combination with hopping\n linearBlockHoppingScanner.setup(exec.getNode(\"8\"), Collections.singleton(exec.getNode(\"5\")));\n Assert.assertFalse(linearBlockHoppingScanner.hasNext());\n linearBlockHoppingScanner.setup(exec.getNode(\"8\"), Collections.singleton(exec.getNode(\"4\")));\n Assert.assertFalse(linearBlockHoppingScanner.hasNext());\n }",
"@Override\n public void func_104112_b() {\n \n }",
"@android.support.annotation.RequiresApi(api = 23)\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public final synchronized void b(boolean r11) {\n /*\n r10 = this;\n monitor-enter(r10)\n r8 = 1\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Byte r2 = java.lang.Byte.valueOf(r11) // Catch:{ all -> 0x004b }\n r9 = 0\n r1[r9] = r2 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16804(0x41a4, float:2.3547E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r2 = java.lang.Boolean.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r2 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n boolean r1 = com.meituan.robust.PatchProxy.isSupport(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x003a\n java.lang.Object[] r1 = new java.lang.Object[r8] // Catch:{ all -> 0x004b }\n java.lang.Byte r0 = java.lang.Byte.valueOf(r11) // Catch:{ all -> 0x004b }\n r1[r9] = r0 // Catch:{ all -> 0x004b }\n com.meituan.robust.ChangeQuickRedirect r3 = f29525a // Catch:{ all -> 0x004b }\n r4 = 0\n r5 = 16804(0x41a4, float:2.3547E-41)\n java.lang.Class[] r6 = new java.lang.Class[r8] // Catch:{ all -> 0x004b }\n java.lang.Class r0 = java.lang.Boolean.TYPE // Catch:{ all -> 0x004b }\n r6[r9] = r0 // Catch:{ all -> 0x004b }\n java.lang.Class r7 = java.lang.Void.TYPE // Catch:{ all -> 0x004b }\n r2 = r10\n com.meituan.robust.PatchProxy.accessDispatch(r1, r2, r3, r4, r5, r6, r7) // Catch:{ all -> 0x004b }\n monitor-exit(r10)\n return\n L_0x003a:\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n boolean r1 = r1 instanceof com.ss.android.medialib.camera.IESHwCamera // Catch:{ all -> 0x004b }\n if (r1 == 0) goto L_0x0049\n com.ss.android.medialib.camera.IESCameraInterface r1 = r10.f29527c // Catch:{ all -> 0x004b }\n com.ss.android.medialib.camera.IESHwCamera r1 = (com.ss.android.medialib.camera.IESHwCamera) r1 // Catch:{ all -> 0x004b }\n r1.c((boolean) r11) // Catch:{ all -> 0x004b }\n r10.n = r11 // Catch:{ all -> 0x004b }\n L_0x0049:\n monitor-exit(r10)\n return\n L_0x004b:\n r0 = move-exception\n monitor-exit(r10)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.ss.android.medialib.camera.g.b(boolean):void\");\n }",
"@Converted(kind = Converted.Kind.AUTO_NO_BODY,\n source = \"${LLVM_SRC}/llvm/lib/Analysis/LoopAccessAnalysis.cpp\", line = 1831,\n FQN=\"llvm::LoopAccessInfo::addRuntimeChecks\", NM=\"_ZNK4llvm14LoopAccessInfo16addRuntimeChecksEPNS_11InstructionERKNS_15SmallVectorImplISt4pairIPKNS_22RuntimePointerChecking16CheckingPtrGroupES8_EEE\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.analysis/llvmToClangType ${LLVM_SRC}/llvm/lib/Analysis/LoopAccessAnalysis.cpp -nm=_ZNK4llvm14LoopAccessInfo16addRuntimeChecksEPNS_11InstructionERKNS_15SmallVectorImplISt4pairIPKNS_22RuntimePointerChecking16CheckingPtrGroupES8_EEE\")\n //</editor-fold>\n public std.pair<Instruction /*P*/ , Instruction /*P*/ > addRuntimeChecks(Instruction /*P*/ Loc, \n final /*const*/ SmallVectorImpl<std.pair</*const*/ RuntimePointerChecking.CheckingPtrGroup /*P*/ , /*const*/ RuntimePointerChecking.CheckingPtrGroup /*P*/ > > /*&*/ PointerChecks) /*const*/ {\n throw new UnsupportedOperationException(\"EmptyBody\");\n }",
"private static void backPressureFix() {\n\t\tFlowable.range(1, 1000000)\n\t\t//below map will run in sequential\n\t\t//since sequential it has to complete whole task then only it can allow consumer to start\n\t\t\t.map(item -> {\n\t\t\t\tSystem.out.println(\"Produced item \"+item +\" using thread \"+Thread.currentThread().getName());\n\t\t\t\treturn item;\n\t\t\t})\n\t\t\t.observeOn(Schedulers.io())\n\t\t\t//.subscribeOn(Schedulers.io())//with this whole pipelein runs in seprate thread paralleley\n\t\t\t//below will run in concurrent\n\t\t\t.subscribe(item ->{\n\t\t\t\t//mimcing slowness\n\t\t\t\tThreadUtil.sleep(300);\n\t\t\t\tSystem.out.println(\"Consumed item \"+item +\" using thread \"+Thread.currentThread().getName());\n\t\t\t})\n\t\t\t\n\t\t\t;\n\t\t\n\t\t//since running in async we need to sleep\n\t\tThreadUtil.sleep(10000000);\n\t\t\t\n\t}",
"@CompileStatic\npublic interface Stream<T> {\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n default <X> Stream<X> flatMap(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper) {\n\n return flatMap(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name name of the operation\n * @param mapper mapper returning iterable of values to be flattened into output\n * @return the remapped stream\n */\n <X> Stream<X> flatMap(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Iterable<X>> mapper);\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param mapper the mapping closure\n * @return remapped stream\n */\n default <X> Stream<X> map(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper) {\n\n return map(null, mapper);\n }\n\n /**\n * Remap the stream.\n *\n * @param <X> type parameter\n * @param name stable name of the mapping operator\n * @param mapper the mapping closure\n * @return remapped stream\n */\n <X> Stream<X> map(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<X> mapper);\n\n /**\n * Filter stream based on predicate\n *\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n default Stream<T> filter(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate) {\n\n return filter(null, predicate);\n }\n\n /**\n * Filter stream based on predicate\n *\n * @param name name of the filter operator\n * @param predicate the predicate to filter on\n * @return filtered stream\n */\n Stream<T> filter(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Boolean> predicate);\n\n /**\n * Assign event time to elements.\n *\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n default Stream<T> assignEventTime(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner) {\n\n return assignEventTime(null, assigner);\n }\n\n /**\n * Assign event time to elements.\n *\n * @param name name of the assign event time operator\n * @param assigner assigner of event time\n * @return stream with elements assigned event time\n */\n Stream<T> assignEventTime(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> assigner);\n\n /**\n * Add window to each element in the stream.\n *\n * @return stream of pairs with window\n */\n default Stream<Pair<Object, T>> withWindow() {\n return withWindow(null);\n }\n\n /**\n * Add window to each element in the stream.\n *\n * @param name stable name of the mapping operator\n * @return stream of pairs with window\n */\n Stream<Pair<Object, T>> withWindow(@Nullable String name);\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @return stream of pairs with timestamp\n */\n default Stream<Pair<T, Long>> withTimestamp() {\n return withTimestamp(null);\n }\n\n /**\n * Add timestamp to each element in the stream.\n *\n * @param name stable name of mapping operator\n * @return stream of pairs with timestamp\n */\n Stream<Pair<T, Long>> withTimestamp(@Nullable String name);\n\n /** Print all elements to console. */\n void print();\n\n /**\n * Collect stream as list. Note that this will result on OOME if this is unbounded stream.\n *\n * @return the stream collected as list.\n */\n List<T> collect();\n\n /**\n * Test if this is bounded stream.\n *\n * @return {@code true} if this is bounded stream, {@code false} otherwise\n */\n boolean isBounded();\n\n /**\n * Process this stream as it was unbounded stream.\n *\n * <p>This is a no-op if {@link #isBounded} returns {@code false}, otherwise it turns the stream\n * into being processed as unbounded, although being bounded.\n *\n * <p>This is an optional operation and might be ignored if not supported by underlying\n * implementation.\n *\n * @return Stream viewed as unbounded stream, if supported\n */\n default Stream<T> asUnbounded() {\n return this;\n }\n\n /**\n * Convert elements to {@link StreamElement}s.\n *\n * @param <V> type of value\n * @param repoProvider provider of {@link Repository}\n * @param entity the entity of elements\n * @param keyExtractor extractor of keys\n * @param attributeExtractor extractor of attributes\n * @param valueExtractor extractor of values\n * @param timeExtractor extractor of time\n * @return stream with {@link StreamElement}s inside\n */\n <V> Stream<StreamElement> asStreamElements(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Persist this stream to replication.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param replicationName name of replication to persist stream to\n * @param target target of the replication\n */\n void persistIntoTargetReplica(\n RepositoryProvider repoProvider, String replicationName, String target);\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n */\n default void persistIntoTargetFamily(RepositoryProvider repoProvider, String targetFamilyname) {\n persistIntoTargetFamily(repoProvider, targetFamilyname, 10);\n }\n\n /**\n * Persist this stream to specific family.\n *\n * <p>Note that the type of the stream has to be already {@link StreamElement StreamElements} to\n * be persisted to the specified family. The family has to accept given {@link\n * AttributeDescriptor} of the {@link StreamElement}.\n *\n * @param repoProvider provider of {@link Repository}.\n * @param targetFamilyname name of target family to persist the stream into\n * @param parallelism parallelism to use when target family is bulk attribute family\n */\n void persistIntoTargetFamily(\n RepositoryProvider repoProvider, String targetFamilyname, int parallelism);\n\n /**\n * Persist this stream as attribute of entity\n *\n * @param <V> type of value extracted\n * @param repoProvider provider of repository\n * @param entity the entity to store the stream to\n * @param keyExtractor extractor of key for elements\n * @param attributeExtractor extractor for attribute for elements\n * @param valueExtractor extractor of values for elements\n * @param timeExtractor extractor of event time\n */\n <V> void persist(\n RepositoryProvider repoProvider,\n EntityDescriptor entity,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<CharSequence> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\")\n Closure<CharSequence> attributeExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<Long> timeExtractor);\n\n /**\n * Directly write this stream to repository. Note that the stream has to contain {@link\n * StreamElement}s (e.g. created by {@link #asStreamElements}.\n *\n * @param repoProvider provider of repository\n */\n void write(RepositoryProvider repoProvider);\n\n /**\n * Create time windowed stream.\n *\n * @param millis duration of tumbling window\n * @return time windowed stream\n */\n WindowedStream<T> timeWindow(long millis);\n\n /**\n * Create sliding time windowed stream.\n *\n * @param millis duration of the window\n * @param slide duration of the slide\n * @return sliding time windowed stream\n */\n WindowedStream<T> timeSlidingWindow(long millis, long slide);\n\n /**\n * Create session windowed stream.\n *\n * @param <K> type of key\n * @param keyExtractor extractor of key\n * @param gapDuration duration of the gap between elements per key\n * @return session windowed stream\n */\n <K> WindowedStream<Pair<K, T>> sessionWindow(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n long gapDuration);\n\n /**\n * Create calendar-based windowed stream.\n *\n * @param window the resolution of the calendar window (\"days\", \"weeks\", \"months\", \"years\")\n * @param count number of days, weeks, months, years\n * @param timeZone time zone of the calculation\n * @return calendar windowed stream\n */\n WindowedStream<T> calendarWindow(String window, int count, TimeZone timeZone);\n\n /**\n * Group all elements into single window.\n *\n * @return globally windowed stream.\n */\n WindowedStream<T> windowAll();\n\n /**\n * Merge two streams together.\n *\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(Stream<T> other) {\n return union(Arrays.asList(other));\n }\n\n /**\n * Merge two streams together.\n *\n * @param name name of the union operator\n * @param other the other stream(s)\n * @return merged stream\n */\n default Stream<T> union(@Nullable String name, Stream<T> other) {\n return union(name, Arrays.asList(other));\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param streams other streams\n * @return merged stream\n */\n default Stream<T> union(List<Stream<T>> streams) {\n return union(null, streams);\n }\n\n /**\n * Merge multiple streams together.\n *\n * @param name name of the union operator\n * @param streams other streams\n * @return merged stream\n */\n Stream<T> union(@Nullable String name, List<Stream<T>> streams);\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param stateUpdate update (accumulation) function for the state the output is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKeyUnsorted(\n null, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, true);\n }\n\n /**\n * Transform this stream using stateful processing without time-sorting.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @return the statefully reduced stream\n */\n default <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKeyUnsorted(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate) {\n\n return reduceValueStateByKey(\n name, keyExtractor, valueExtractor, initialState, outputFn, stateUpdate, false);\n }\n\n /**\n * Transform this stream using stateful processing.\n *\n * @param <K> type of key\n * @param <S> type of value state\n * @param <V> type of intermediate value\n * @param <O> type of output value\n * @param name optional name of the stateful operation\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialState closure providing initial state value for key\n * @param stateUpdate update (accumulation) function for the state\n * @param outputFn function for outputting values (when function returns {@code null} the output\n * is discarded\n * @param sorted {@code true} if the input to the state update function should be time-sorted\n * @return the statefully reduced stream\n */\n <K, S, V, O> Stream<Pair<K, O>> reduceValueStateByKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<S> initialState,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<O> outputFn,\n @ClosureParams(value = FromString.class, options = \"S, V\") Closure<S> stateUpdate,\n boolean sorted);\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n default <K, V> Stream<Pair<K, V>> integratePerKey(\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner) {\n\n return integratePerKey(null, keyExtractor, valueExtractor, initialValue, combiner);\n }\n\n /**\n * Transform this stream to another stream by applying combining transform in global window\n * emitting results after each element added. That means that the following holds: * the new\n * stream will have exactly the same number of elements as the original stream minus late elements\n * dropped * streaming semantics need to define allowed lateness, which will incur real time\n * processing delay * batch semantics use sort per key\n *\n * @param <K> key type\n * @param <V> value type\n * @param name optional name of the transform\n * @param keyExtractor extractor of key\n * @param valueExtractor extractor of value\n * @param initialValue closure providing initial value of state for key\n * @param combiner combiner of values to final value\n * @return the integrated stream\n */\n <K, V> Stream<Pair<K, V>> integratePerKey(\n @Nullable String name,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<K> keyExtractor,\n @ClosureParams(value = FromString.class, options = \"T\") Closure<V> valueExtractor,\n @ClosureParams(value = FromString.class, options = \"K\") Closure<V> initialValue,\n @ClosureParams(value = FromString.class, options = \"V,V\") Closure<V> combiner);\n\n /** Reshuffle the stream via random key. */\n default Stream<T> reshuffle() {\n return reshuffle(null);\n }\n\n /**\n * Reshuffle the stream via random key.\n *\n * @param name name of the transform\n */\n @SuppressWarnings(\"unchecked\")\n Stream<T> reshuffle(@Nullable String name);\n}",
"@Test\n public void concurrencyTest() throws Exception {\n ArrayList<Long> objIds = instrSetup(new Callable<ArrayList<Long>>() {\n\n /**\n * An internal class that defines a task for creating multiple\n * objects of instrumented types and returning their identifiers as\n * a {@link Long}{@code []}.\n *\n * @author Nikolay Pulev <N.Pulev@sms.ed.ac.uk>\n */\n class GeneratorOfUninstrumentedObjects implements Callable<List<Long>> {\n\n private int nrItems = 0;\n\n public GeneratorOfUninstrumentedObjects(int nrItems) {\n this.nrItems = nrItems;\n }\n\n @Override\n public List<Long> call() {\n List<Long> objIds = new ArrayList<Long>(nrItems); /* Stores generated ids. */\n Object obj = null; /* a reusable reference */\n\n /* Create many objects & store their obj ids into an array. */\n for (int i = 0; i < nrItems; i++) {\n switch (i % 4) {\n case 0:\n obj = new Object();\n break;\n case 1:\n obj = new String(\"A string\");\n break;\n case 2:\n obj = new Integer(1);\n break;\n case 3:\n obj = new ConcurrentHashMap<Integer, String>();\n break;\n default:\n break;\n }\n objIds.add(new Long(InstanceIdentifier.INSTANCE.getId(obj)));\n }\n\n return objIds;\n }\n }\n\n /**\n * An internal class that defines a task for creating multiple\n * objects of uninstrumented types and returning their identifiers\n * as a {@link Long}{@code []}.\n *\n * @author Nikolay Pulev <N.Pulev@sms.ed.ac.uk>\n */\n class GeneratorOfInstrumentedObjects implements Callable<List<Long>> {\n\n private int nrItems = 0;\n\n public GeneratorOfInstrumentedObjects(int nrItems) {\n this.nrItems = nrItems;\n }\n\n @Override\n public List<Long> call() {\n List<Long> objIds = new ArrayList<Long>(nrItems); /* Stores generated ids. */\n Object obj = null; /* a reusable reference */\n\n /* Create many objects & store their obj ids into an array. */\n for (int i = 0; i < nrItems; i++) {\n obj = new MickeyMaus(5);\n objIds.add(Long.valueOf(InstanceIdentifier.INSTANCE.getId(obj)));\n }\n\n return objIds;\n }\n }\n\n @Override\n public ArrayList<Long> call() {\n ExecutorService pool = Executors.newFixedThreadPool(100);\n ArrayList<Future<List<Long>>> futures = new ArrayList<Future<List<Long>>>();\n for (int i = 0; i < 100; i++) {\n futures.add(pool.submit(new GeneratorOfUninstrumentedObjects(100)));\n futures.add(pool.submit(new GeneratorOfInstrumentedObjects(100)));\n }\n\n ArrayList<Long> result = new ArrayList<Long>();\n for (Future<List<Long>> future : futures) {\n try {\n result.addAll(future.get());\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }\n\n return result;\n }\n });\n\n /* Check if all assigned identifiers are non-negative & unique. */\n for (int i = 0; i < objIds.size(); i++) {\n Assert.assertEquals(\"ID greater than 0: \", true, objIds.get(i) > (long) 0);\n for (int j = i + 1; j < i; j++) {\n Assert.assertEquals(\"IDs different: \", true, objIds.get(i) != objIds.get(j));\n }\n }\n }",
"public int forEachByte(ByteProcessor processor)\r\n/* 661: */ {\r\n/* 662:670 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 663:671 */ return super.forEachByte(processor);\r\n/* 664: */ }",
"@Override\r\n\tpublic Node visitSequential(SequentialContext ctx) {\n\t\treturn super.visitSequential(ctx);\r\n\t}",
"public JBlock _finally() {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 0: iconst_0 \n // 1: nop \n // 2: nop \n // 3: nop \n // 4: aload_3 \n // 5: nop \n // 6: lconst_0 \n // 7: nop \n // 8: iaload \n // 9: nop \n // 10: ldc2_w \"Lcom/sun/codemodel/JFormatter;\"\n // 13: nop \n // 14: fload_0 /* this */\n // 15: nop \n // 16: nop \n // 17: nop \n // 18: lload_2 \n // 19: nop \n // 20: iconst_0 \n // 21: nop \n // 22: nop \n // LocalVariableTable:\n // Start Length Slot Name Signature\n // ----- ------ ---- ---- -----------------------------\n // 0 23 0 this Lcom/sun/codemodel/JTryBlock;\n // \n // The error that occurred was:\n // \n // java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number\n // at com.strobel.assembler.ir.StackMappingVisitor$InstructionAnalyzer.execute(StackMappingVisitor.java:935)\n // at com.strobel.assembler.ir.StackMappingVisitor$InstructionAnalyzer.visit(StackMappingVisitor.java:398)\n // at com.strobel.decompiler.ast.AstBuilder.performStackAnalysis(AstBuilder.java:2030)\n // at com.strobel.decompiler.ast.AstBuilder.build(AstBuilder.java:108)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:210)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:757)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:655)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:532)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:499)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:141)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:130)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:105)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:317)\n // at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:238)\n // at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:123)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"@Override\r\n\tpublic Node visitSequence(SequenceContext ctx) {\n\t\treturn super.visitSequence(ctx);\r\n\t}",
"public Object lambda58(Object x) {\n frame42 frame42;\n new frame42();\n frame42 frame422 = frame42;\n frame422.staticLink = this;\n frame42 frame423 = frame422;\n frame423.f130x = x;\n return srfi1.every$V(frame423.lambda$Fn42, this.lists, new Object[0]);\n }",
"@Converted(kind = Converted.Kind.AUTO,\n source = \"${LLVM_SRC}/llvm/lib/IR/Module.cpp\", line = 414,\n FQN=\"llvm::Module::materializeAll\", NM=\"_ZN4llvm6Module14materializeAllEv\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.llvm.ir/llvmToClangType ${LLVM_SRC}/llvm/lib/IR/Module.cpp -nm=_ZN4llvm6Module14materializeAllEv\")\n //</editor-fold>\n public std.error_code materializeAll() {\n if (!Materializer.$bool()) {\n return new std.error_code();\n }\n std.unique_ptr<GVMaterializer> M = new std.unique_ptr<GVMaterializer>(JD$Move.INSTANCE, std.move(Materializer));\n return M.$arrow().materializeModule();\n }",
"public void mo3613a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:14)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r4 = this;\n r0 = r4.f18081b;\n monitor-enter(r0);\n r1 = r4.f18080a;\t Catch:{ all -> 0x001f }\n if (r1 == 0) goto L_0x0009;\t Catch:{ all -> 0x001f }\n L_0x0007:\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n return;\t Catch:{ all -> 0x001f }\n L_0x0009:\n r1 = 1;\t Catch:{ all -> 0x001f }\n r4.f18080a = r1;\t Catch:{ all -> 0x001f }\n r2 = r4.f18081b;\t Catch:{ all -> 0x001f }\n r3 = r2.f12200d;\t Catch:{ all -> 0x001f }\n r3 = r3 + r1;\t Catch:{ all -> 0x001f }\n r2.f12200d = r3;\t Catch:{ all -> 0x001f }\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n r0 = r4.f18083d;\n okhttp3.internal.C2933c.m14194a(r0);\n r0 = r4.f18082c;\t Catch:{ IOException -> 0x001e }\n r0.m14100c();\t Catch:{ IOException -> 0x001e }\n L_0x001e:\n return;\n L_0x001f:\n r1 = move-exception;\n monitor-exit(r0);\t Catch:{ all -> 0x001f }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: okhttp3.c.a.a():void\");\n }",
"private Expression transform(Expression exp)\n {\n return UseContracts.execute(exp, fun, callers);\n }",
"@Override\r\n public void afterVisit() {\n final MethodCallUtils.EnclosingRefs enclosing = \r\n MethodCallUtils.getEnclosingInstanceReferences(\r\n thisExprBinder, expr,\r\n superClassDecl,\r\n context.theReceiverNode, getEnclosingSyntacticDecl());\r\n /* The transformer will already be set in the map correctly for these\r\n * effects when they are original generated. We are just modifying\r\n * the lock and evidence information for the effects.\r\n */\r\n for (final Effect e : newContext.theEffects.build()) {\r\n Effect maskedEffect = e.mask(thisExprBinder);\r\n if (maskedEffect != null) {\r\n // Mask again if the effect is on the receiver of the anonymous class\r\n if (maskedEffect.affectsReceiver(newContext.theReceiverNode)) {\r\n context.theEffects.add(\r\n Effect.effect(\r\n maskedEffect.getSource(), maskedEffect.isRead(),\r\n new EmptyTarget(new EmptyEvidence(Reason.UNDER_CONSTRUCTION)),\r\n new MaskedEffectEvidence(maskedEffect),\r\n maskedEffect.getNeededLocks()));\r\n } else {\r\n final Target target = maskedEffect.getTarget();\r\n \r\n final TargetEvidence te = target.getEvidence();\r\n if (te instanceof EmptyEvidence\r\n && ((EmptyEvidence) te).getReason() == Reason.METHOD_CALL) {\r\n /* Special case: empty effect that carries lock preconditions */\r\n final ImmutableSet.Builder<NeededLock> newLockSet = ImmutableSet.builder();\r\n for (final NeededLock lock : maskedEffect.getNeededLocks()) {\r\n newLockSet.add(lock.replaceEnclosingInstanceReference(enclosing));\r\n }\r\n context.theEffects.add(\r\n Effect.empty(maskedEffect.getSource(),\r\n new EmptyEvidence(Reason.METHOD_CALL), \r\n ImmutableSet.of(getEvidence()), newLockSet.build()));\r\n } else if (target instanceof InstanceTarget) {\r\n final IRNode ref = target.getReference();\r\n \r\n final IRNode newRef = enclosing.replace(ref);\r\n if (newRef != null) {\r\n final IRNode objectExpr = thisExprBinder.bindThisExpression(newRef);\r\n final Target newTarget = new InstanceTarget(\r\n objectExpr, target.getRegion(),\r\n new EnclosingRefEvidence(maskedEffect.getSource(), ref, newRef));\r\n final Set<NeededLock> newLocks = new HashSet<>();\r\n for (final NeededLock lock : maskedEffect.getNeededLocks()) {\r\n newLocks.add(lock.replaceEnclosingInstanceReference(enclosing));\r\n }\r\n elaborateInstanceTarget(\r\n context.bcaQuery, lockFactory, thisExprBinder, lockModel.get(),\r\n maskedEffect.getSource(), maskedEffect.isRead(), newTarget, getEvidence(),\r\n newLocks, context.theEffects);\r\n } else {\r\n /* XXX: Not sure if it is possible to get here. External\r\n * variable references are turned into ANyInstance targets\r\n * during elaboration.\r\n */\r\n /* 2012-08-24: We have to clean the type to make sure it is not a \r\n * type formal.\r\n */\r\n IJavaType type = thisExprBinder.getJavaType(ref);\r\n if (type instanceof IJavaTypeFormal) {\r\n type = TypeUtil.typeFormalToDeclaredClass(\r\n thisExprBinder.getTypeEnvironment(), (IJavaTypeFormal) type);\r\n }\r\n context.theEffects.add(Effect.effect(\r\n maskedEffect.getSource(), maskedEffect.isRead(),\r\n new AnyInstanceTarget(\r\n (IJavaReferenceType) type, target.getRegion(),\r\n new UnknownReferenceConversionEvidence(\r\n maskedEffect, ref, (IJavaReferenceType) type)),\r\n getEvidence(), maskedEffect.getNeededLocks()));\r\n }\r\n } else {\r\n context.theEffects.add(\r\n maskedEffect.updateEvidence(target.getEvidence(), ImmutableSet.of(getEvidence())));\r\n }\r\n }\r\n }\r\n }\r\n }",
"public Object lambda54(Object x) {\n frame38 frame38;\n new frame38();\n frame38 frame382 = frame38;\n frame382.staticLink = this;\n frame38 frame383 = frame382;\n frame383.f128x = x;\n return srfi1.every$V(frame383.lambda$Fn38, this.lists, new Object[0]);\n }",
"public Object lambda56(Object x) {\n frame40 frame40;\n new frame40();\n frame40 frame402 = frame40;\n frame402.staticLink = this;\n frame40 frame403 = frame402;\n frame403.f129x = x;\n return srfi1.every$V(frame403.lambda$Fn40, this.lists, new Object[0]);\n }",
"protected abstract Object transform(Object o);",
"@Override\n public void applyRequiredDecoration(final Control target) {\n // This method could not be decompiled.\n // \n // Original Bytecode:\n // \n // 0: aload_1 /* target */\n // 1: invokestatic invokestatic !!! ERROR\n // 4: ifeq 29\n // 7: aload_0 /* this */\n // 8: aload_1 /* target */\n // 9: invokevirtual org/controlsfx/validation/decoration/AbstractValidationDecoration.createRequiredDecorations:(Ljavafx/scene/control/Control;)Ljava/util/Collection;\n // 12: invokeinterface java/util/Collection.stream:()Ljava/util/stream/Stream;\n // 17: aload_0 /* this */\n // 18: aload_1 /* target */\n // 19: invokedynamic accept:(Lorg/controlsfx/validation/decoration/AbstractValidationDecoration;Ljavafx/scene/control/Control;)Ljava/util/function/Consumer;\n // 24: invokeinterface java/util/stream/Stream.forEach:(Ljava/util/function/Consumer;)V\n // 29: return \n // LocalVariableTable:\n // Start Length Slot Name Signature\n // ----- ------ ---- ------ -------------------------------------------------------------------\n // 0 30 0 this Lorg/controlsfx/validation/decoration/AbstractValidationDecoration;\n // 0 30 1 target Ljavafx/scene/control/Control;\n // \n // The error that occurred was:\n // \n // java.lang.IllegalArgumentException: Argument 'typeArguments' must not have any null elements.\n // at com.strobel.core.VerifyArgument.noNullElementsAndNotEmpty(VerifyArgument.java:145)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedType.makeGenericType(CoreMetadataFactory.java:570)\n // at com.strobel.assembler.metadata.CoreMetadataFactory.makeParameterizedType(CoreMetadataFactory.java:156)\n // at com.strobel.assembler.metadata.signatures.Reifier.visitClassTypeSignature(Reifier.java:125)\n // at com.strobel.assembler.metadata.signatures.ClassTypeSignature.accept(ClassTypeSignature.java:46)\n // at com.strobel.assembler.metadata.MetadataParser.parseTypeSignature(MetadataParser.java:123)\n // at com.strobel.assembler.ir.MetadataReader.readAttributeCore(MetadataReader.java:180)\n // at com.strobel.assembler.metadata.ClassFileReader.readAttributeCore(ClassFileReader.java:261)\n // at com.strobel.assembler.ir.MetadataReader.readAttribute(MetadataReader.java:50)\n // at com.strobel.assembler.ir.MetadataReader.readAttributes(MetadataReader.java:40)\n // at com.strobel.assembler.metadata.ClassFileReader.readAttributeCore(ClassFileReader.java:203)\n // at com.strobel.assembler.ir.MetadataReader.inflateAttribute(MetadataReader.java:367)\n // at com.strobel.assembler.ir.MetadataReader.inflateAttributes(MetadataReader.java:344)\n // at com.strobel.assembler.metadata.ClassFileReader.defineMethods(ClassFileReader.java:979)\n // at com.strobel.assembler.metadata.ClassFileReader.readClass(ClassFileReader.java:441)\n // at com.strobel.assembler.metadata.ClassFileReader.readClass(ClassFileReader.java:366)\n // at com.strobel.assembler.metadata.MetadataSystem.resolveType(MetadataSystem.java:124)\n // at com.strobel.decompiler.NoRetryMetadataSystem.resolveType(DecompilerDriver.java:463)\n // at com.strobel.assembler.metadata.MetadataSystem.resolveCore(MetadataSystem.java:76)\n // at com.strobel.assembler.metadata.MetadataResolver.resolve(MetadataResolver.java:104)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedType.resolve(CoreMetadataFactory.java:589)\n // at com.strobel.assembler.metadata.MetadataResolver.resolve(MetadataResolver.java:128)\n // at com.strobel.assembler.metadata.CoreMetadataFactory$UnresolvedType.resolve(CoreMetadataFactory.java:599)\n // at com.strobel.assembler.metadata.MethodReference.resolve(MethodReference.java:172)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2428)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferBinaryExpression(TypeAnalysis.java:2104)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1531)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1551)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:757)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:655)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:532)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:499)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:141)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:130)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:105)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at com.strobel.decompiler.DecompilerDriver.decompileType(DecompilerDriver.java:317)\n // at com.strobel.decompiler.DecompilerDriver.decompileJar(DecompilerDriver.java:238)\n // at com.strobel.decompiler.DecompilerDriver.main(DecompilerDriver.java:123)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"@Override\n public Comparator<Object> thenComparingDouble(final ToDoubleFunction<?> p0) {\n // This method could not be decompiled.\n // \n // Could not show original bytecode, likely due to the same error.\n // \n // The error that occurred was:\n // \n // java.lang.NullPointerException\n // at com.strobel.assembler.metadata.WildcardType.containsGenericParameters(WildcardType.java:55)\n // at com.strobel.assembler.metadata.TypeReference.containsGenericParameters(TypeReference.java:48)\n // at com.strobel.assembler.metadata.MethodReference.containsGenericParameters(MethodReference.java:79)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferCall(TypeAnalysis.java:2497)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1029)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:778)\n // at com.strobel.decompiler.ast.TypeAnalysis.doInferTypeForExpression(TypeAnalysis.java:1656)\n // at com.strobel.decompiler.ast.TypeAnalysis.inferTypeForExpression(TypeAnalysis.java:803)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:672)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:655)\n // at com.strobel.decompiler.ast.TypeAnalysis.runInference(TypeAnalysis.java:365)\n // at com.strobel.decompiler.ast.TypeAnalysis.run(TypeAnalysis.java:96)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:109)\n // at com.strobel.decompiler.ast.AstOptimizer.optimize(AstOptimizer.java:42)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:214)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformCall(AstMethodBodyBuilder.java:1162)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:1009)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformByteCode(AstMethodBodyBuilder.java:554)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformExpression(AstMethodBodyBuilder.java:540)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformNode(AstMethodBodyBuilder.java:392)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.transformBlock(AstMethodBodyBuilder.java:333)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:294)\n // at com.strobel.decompiler.languages.java.ast.AstMethodBodyBuilder.createMethodBody(AstMethodBodyBuilder.java:99)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethodBody(AstBuilder.java:782)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createMethod(AstBuilder.java:675)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addTypeMembers(AstBuilder.java:552)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeCore(AstBuilder.java:519)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createTypeNoCache(AstBuilder.java:161)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.createType(AstBuilder.java:150)\n // at com.strobel.decompiler.languages.java.ast.AstBuilder.addType(AstBuilder.java:125)\n // at com.strobel.decompiler.languages.java.JavaLanguage.buildAst(JavaLanguage.java:71)\n // at com.strobel.decompiler.languages.java.JavaLanguage.decompileType(JavaLanguage.java:59)\n // at us.deathmarine.luyten.FileSaver.doSaveJarDecompiled(FileSaver.java:192)\n // at us.deathmarine.luyten.FileSaver.access$300(FileSaver.java:45)\n // at us.deathmarine.luyten.FileSaver$4.run(FileSaver.java:112)\n // at java.lang.Thread.run(Unknown Source)\n // \n throw new IllegalStateException(\"An error occurred while decompiling this method.\");\n }",
"public void mo2485a() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/79094208.run(Unknown Source)\n*/\n /*\n r2 = this;\n r0 = r2.f11863a;\n monitor-enter(r0);\n r1 = r2.f11873l;\t Catch:{ all -> 0x002a }\n if (r1 != 0) goto L_0x0028;\t Catch:{ all -> 0x002a }\n L_0x0007:\n r1 = r2.f11872k;\t Catch:{ all -> 0x002a }\n if (r1 == 0) goto L_0x000c;\t Catch:{ all -> 0x002a }\n L_0x000b:\n goto L_0x0028;\t Catch:{ all -> 0x002a }\n L_0x000c:\n r1 = r2.f11875n;\t Catch:{ all -> 0x002a }\n if (r1 == 0) goto L_0x0015;\n L_0x0010:\n r1 = r2.f11875n;\t Catch:{ RemoteException -> 0x0015 }\n r1.cancel();\t Catch:{ RemoteException -> 0x0015 }\n L_0x0015:\n r1 = r2.f11870i;\t Catch:{ all -> 0x002a }\n m14216b(r1);\t Catch:{ all -> 0x002a }\n r1 = 1;\t Catch:{ all -> 0x002a }\n r2.f11873l = r1;\t Catch:{ all -> 0x002a }\n r1 = com.google.android.gms.common.api.Status.zzfnm;\t Catch:{ all -> 0x002a }\n r1 = r2.mo3568a(r1);\t Catch:{ all -> 0x002a }\n r2.m14217c(r1);\t Catch:{ all -> 0x002a }\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n return;\t Catch:{ all -> 0x002a }\n L_0x0028:\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n return;\t Catch:{ all -> 0x002a }\n L_0x002a:\n r1 = move-exception;\t Catch:{ all -> 0x002a }\n monitor-exit(r0);\t Catch:{ all -> 0x002a }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.common.api.internal.BasePendingResult.a():void\");\n }",
"public static void main(String[] args) throws Exception {\n \t\n \tbyte[] fileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/main/re/bytecode/obfuscat/pass/vm/VMRefImpl.class\").toURI()));\n \tDSLParser p = new DSLParser();\n \tMap<String, Function> functions = p.processFile(fileData);\n \tFunction refF = MergedFunction.mergeFunctions(functions, \"process\"); // functions.get(\"process\");\n \t\n \t\n \t\n \tfileData = Files.readAllBytes(Paths.get(new File(System.getProperty(\"user.dir\")+\"/bin/test/re/bytecode/obfuscat/samples/Sample8.class\").toURI()));\n \tp = new DSLParser();\n functions = p.processFile(fileData);\n \n \tFunction f = MergedFunction.mergeFunctions(functions, \"entry\");\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//Function f = Obfuscat.buildFunction(\"Test\", map);\n \t\n \t\n\t\t//HashMap<String, Object> map = new HashMap<String, Object>();\n\t\t//map.put(\"data\", new byte[] { 1, 2, 3, 4 });\n\t\t//Function f = Obfuscat.buildFunction(\"KeyBuilder\", map );\n\t\n \tf = Obfuscat.applyPass(f, \"Flatten\");\n\t\tf = Obfuscat.applyPass(f, \"OperationEncode\");\n\t\t\n\t\tint[] gen = new VMCodeGenerator(new Context(System.currentTimeMillis()), f).generate();\n\n\t\tbyte[] vmcode = new byte[gen.length];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (int i = 0; i < gen.length; i++) {\n\t\t\tsb.append(String.format(\"%02X\", gen[i] & 0xFF));\n\t\t\tvmcode[i] = (byte) gen[i];\n\t\t}\n\n\t\tSystem.out.println(sb.toString());\n\n\t\tSystem.out.println(\"=========================================\");\n\n\t\t\n\t\tSystem.out.println(f.getBlocks().get(0));\n\t\t\n\t\tEmulateFunction eFB = new EmulateFunction(f);\n\t\tbyte[] arr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Original => \"+eFB.run(-1, arr));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Java Reference => \"+VMRefImpl.process(vmcode, f.getData() ,new Object[]{0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\n\t\t\n\t\tEmulateFunction eFRef = new EmulateFunction(refF);\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulated Reference => \"+eFRef.run(-1, gen, f.getData(), new Object[] {0, arr}));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\t\tEmulateFunction eFPass = new EmulateFunction(Obfuscat.applyPass(f, \"Virtualize\"));\n\t\tarr = new byte[] {0, 0, 0, 0};\n\t\tSystem.out.println(\"Emulate Pass VM => \"+eFPass.run(-1, arr ));\n\t\tSystem.out.println(Arrays.toString(arr));\n\t\t\n\n }",
"@Override\n public void onCompleted(Flow flow) {}",
"@SuppressWarnings(\"unchecked\")\n public static Transformation<?> apply(\n StreamExecutionEnvironment env, Transformation<?> transformation) throws Exception {\n if (env.getConfiguration().get(PythonOptions.PYTHON_OPERATOR_CHAINING_ENABLED)) {\n final Field transformationsField =\n StreamExecutionEnvironment.class.getDeclaredField(\"transformations\");\n transformationsField.setAccessible(true);\n final List<Transformation<?>> transformations =\n (List<Transformation<?>>) transformationsField.get(env);\n final Tuple2<List<Transformation<?>>, Transformation<?>> resultTuple =\n optimize(transformations, transformation);\n transformationsField.set(env, resultTuple.f0);\n return resultTuple.f1;\n } else {\n return transformation;\n }\n }",
"@Override\r\n\tpublic void visit(BlockExpression blockExpression) {\n\r\n\t}",
"public final void m51744c() {\n C9706a.m40168a(this.f42405d.hasExtractedFrames(), (Exception) new LoopsEngineCreationException(\"There is no valid frames to create Loop videos\"));\n this.f42403b.add(this.f42405d.observeExtractedFrames().a(this.f42407f.observeCroppingRectangle().f(), C11967a.f38901a).a(new C11968b(this)).b(this.f42406e.computation()).a(this.f42406e.ui()).a(new C11969c(this), C11970d.f38904a));\n }",
"public Object lambda78(Object list, Object otherLists) {\n frame59 frame59;\n Object callWithValues;\n new frame59();\n frame59 frame592 = frame59;\n frame592.staticLink = this;\n frame59 frame593 = frame592;\n frame593.list = list;\n frame593.other$Mnlists = otherLists;\n if (srfi1.isNullList(frame593.list) != Boolean.FALSE) {\n callWithValues = this.staticLink.abort.apply2(LList.Empty, LList.Empty);\n } else {\n callWithValues = call_with_values.callWithValues(frame593.lambda$Fn59, frame593.lambda$Fn60);\n }\n return callWithValues;\n }",
"interface C15937b {\n /* renamed from: a */\n void mo13368a();\n\n /* renamed from: a */\n void mo13369a(int i, int i2, int i3, boolean z);\n\n /* renamed from: a */\n void mo13370a(int i, int i2, List<C15929a> list) throws IOException;\n\n /* renamed from: a */\n void mo13371a(int i, long j);\n\n /* renamed from: a */\n void mo13372a(int i, ErrorCode errorCode);\n\n /* renamed from: a */\n void mo13373a(int i, ErrorCode errorCode, ByteString byteString);\n\n /* renamed from: a */\n void mo13374a(boolean z, int i, int i2);\n\n /* renamed from: a */\n void mo13375a(boolean z, int i, int i2, List<C15929a> list);\n\n /* renamed from: a */\n void mo13376a(boolean z, int i, BufferedSource bufferedSource, int i2) throws IOException;\n\n /* renamed from: a */\n void mo13377a(boolean z, C15943j c15943j);\n }",
"public String visit(MessageSend n, MethodType argu) {\r\n\r\n //argu.SetTransferedArg();\r\n String temp1 = n.f0.accept(this, argu);\r\n this.callCounter++;\r\n String classType = this.callMap.get(callCounter);\r\n //String classType = argu.getThisType();\r\n //argu.CleanTransferedArg();\r\n //System.out.println(classType);\r\n\r\n n.f2.accept(this, argu);\r\n Integer vtableOffset = methodOffsets.get(classType + \".\" + n.f2.f0.toString())/8;\r\n\r\n emit(\"; \" + classType + \".\" + n.f2.f0.toString() + \" \" + \": \" + vtableOffset.toString() + \"\\n\");\r\n String temp2 = newTemp();\r\n emit(temp2 + \" = bitcast \" + temp1 + \" to i8***\\n\");\r\n String temp3 = newTemp();\r\n emit(temp3 + \" = load i8**, i8*** \" + temp2 + \"\\n\");\r\n String temp4 = newTemp();\r\n String temp5 = newTemp();\r\n String temp6 = newTemp();\r\n String temp7 = newTemp();\r\n emit(temp4 + \" = getelementptr i8*, i8** \" + temp3 + \", i32 \" + vtableOffset + \"\\n\");\r\n emit(temp5 + \"= load i8*, i8** \" + temp4 + \"\\n\");\r\n\r\n\r\n emit(temp6 + \" = bitcast i8* \" + temp5 + \" to \" + typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).returnType) + \" (i8*\");\r\n for(String arg : symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).arguments.keySet()){\r\n emit(\", \" + typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).arguments.get(arg)[0]));\r\n }\r\n emit(\")*\\n\");\r\n\r\n n.f4.accept(this, argu);\r\n\r\n emit(temp7 + \" = call \" + typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).returnType) + \" \" + temp6 + \"(\" + temp1);\r\n for(String arg : argu.tempCallArgumentsCodeG.values()){\r\n emit(\", \" + arg);\r\n }\r\n\r\n\r\n argu.tempCallArgumentsCodeG.clear();\r\n /*\r\n %_4 = bitcast i8* %_3 to i8***\r\n %_5 = load i8**, i8*** %_4\r\n %_6 = getelementptr i8*, i8** %_5, i32 0\r\n %_7 = load i8*, i8** %_6\r\n %_8 = bitcast i8* %_7 to i1 (i8*,i32)*\r\n\t %_9 = call i1 %_8(i8* %_3, i32 16)\r\n */\r\n\r\n emit(\")\\n\");\r\n\r\n return typeConverter(symbolTable.classes.get(classType).methods.get(n.f2.f0.toString()).returnType) + \" \" + temp7;\r\n }",
"ASTFoldCombine() { super(null); }",
"O transform(R result);",
"@Override\n public void run(Map<String, LogicalInput> inputs,\n Map<String, LogicalOutput> outputs) throws Exception {\n try {\n Class<?> clazz = Class.forName(\"org.apache.tez.common.ProgressHelper\");\n Constructor<?> ctor = clazz.getConstructor(Map.class, ProcessorContext.class, String.class);\n progressHelper = ctor.newInstance(inputs, getContext(), this.getClass().getSimpleName());\n Method scheduleProgressTaskService = clazz.getMethod(\"scheduleProgressTaskService\", long.class, long.class);\n scheduleProgressTaskService.invoke(progressHelper, 100,\n Math.max(1000, conf.getInt(TezConfiguration.TEZ_TASK_AM_HEARTBEAT_INTERVAL_MS,\n TezConfiguration.TEZ_TASK_AM_HEARTBEAT_INTERVAL_MS_DEFAULT) - 50));\n }\n catch (IllegalAccessException | IllegalArgumentException | InstantiationException | InvocationTargetException\n | ClassNotFoundException | NoSuchMethodException | SecurityException e) {\n // ignore\n }\n\n try {\n initializeInputs(inputs);\n\n initializeOutputs(outputs);\n\n\n List<PhysicalOperator> leaves = null;\n\n if (!execPlan.isEmpty()) {\n leaves = execPlan.getLeaves();\n // TODO: Pull from all leaves when there are multiple leaves/outputs\n leaf = leaves.get(0);\n }\n\n LOG.info(\"Aliases being processed per job phase (AliasName[line,offset]): \" + conf.get(\"pig.alias.location\"));\n\n runPipeline(leaf);\n\n if (Boolean.valueOf(conf.get(JobControlCompiler.END_OF_INP_IN_MAP, \"false\"))\n && !execPlan.endOfAllInput) {\n // If there is a stream in the pipeline or if this map job belongs to merge-join we could\n // potentially have more to process - so lets\n // set the flag stating that all map input has been sent\n // already and then lets run the pipeline one more time\n // This will result in nothing happening in the case\n // where there is no stream or it is not a merge-join in the pipeline\n execPlan.endOfAllInput = true;\n runPipeline(leaf);\n }\n\n // Calling EvalFunc.finish()\n UDFFinishVisitor finisher = new UDFFinishVisitor(execPlan,\n new DependencyOrderWalker<PhysicalOperator, PhysicalPlan>(\n execPlan));\n try {\n finisher.visit();\n } catch (VisitorException e) {\n int errCode = 2121;\n String msg = \"Error while calling finish method on UDFs.\";\n throw new VisitorException(msg, errCode, PigException.BUG, e);\n }\n\n if (!fileOutputs.isEmpty()) {\n while (!getContext().canCommit() && !isAborted) {\n Thread.sleep(100);\n }\n if (isAborted) {\n return;\n }\n for (MROutput fileOutput : fileOutputs){\n fileOutput.flush();\n if (fileOutput.isCommitRequired()) {\n fileOutput.commit();\n }\n }\n }\n\n // send event containing parallelism to sorting job of order by / skewed join\n if (conf.getBoolean(ESTIMATE_PARALLELISM, false)) {\n int parallelism = 1;\n if (sampleMap!=null && sampleMap.containsKey(ESTIMATED_NUM_PARALLELISM)) {\n parallelism = (Integer)sampleMap.get(ESTIMATED_NUM_PARALLELISM);\n }\n String sortingVertex = conf.get(SORT_VERTEX);\n // Should contain only 1 output for sampleAggregation job\n LOG.info(\"Sending numParallelism \" + parallelism + \" to \" + sortingVertex);\n VertexManagerEvent vmEvent = VertexManagerEvent.create(\n sortingVertex, ByteBuffer.wrap(Ints.toByteArray(parallelism)));\n List<Event> events = Lists.newArrayListWithCapacity(1);\n events.add(vmEvent);\n getContext().sendEvents(events);\n }\n } catch (Exception e) {\n LOG.error(\"Encountered exception while processing: \", e);\n abortOutput();\n throw e;\n }\n }",
"public final void m55608a(@org.jetbrains.annotations.NotNull com.tinder.pushnotifications.usecase.NotifyPushServer.NotifyReason r3) {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n*/\n /*\n r2 = this;\n r0 = \"request\";\n kotlin.jvm.internal.C2668g.b(r3, r0);\n r0 = com.tinder.pushnotifications.usecase.NotifyPushServer.NotifyReason.APP_OPENED;\n if (r3 != r0) goto L_0x000e;\n L_0x0009:\n r3 = r2.f46002b;\t Catch:{ SecurityException -> 0x000e }\n r3.cancelAll();\t Catch:{ SecurityException -> 0x000e }\n L_0x000e:\n r3 = r2.f46003c;\n r3 = r3.d();\n if (r3 == 0) goto L_0x005f;\n L_0x0016:\n r3 = r2.f46005e;\n r3 = r3.a();\n r3 = r3.getLanguage();\n r3 = rx.Single.a(r3);\n r0 = new com.tinder.pushnotifications.usecase.NotifyPushServer$a;\n r0.<init>(r2);\n r0 = (rx.functions.Func1) r0;\n r3 = r3.d(r0);\n r0 = new com.tinder.pushnotifications.usecase.NotifyPushServer$b;\n r0.<init>(r2);\n r0 = (rx.functions.Func1) r0;\n r3 = r3.c(r0);\n r0 = com.tinder.pushnotifications.usecase.NotifyPushServer.C17888c.f55780a;\n r0 = (rx.functions.Func1) r0;\n r3 = r3.a(r0);\n r0 = r2.f46001a;\n r0 = r0.notifyPushServerAppOpen();\n r3 = r3.b(r0);\n r0 = rx.schedulers.Schedulers.io();\n r3 = r3.b(r0);\n r0 = com.tinder.pushnotifications.usecase.NotifyPushServer.C18651d.f58120a;\n r0 = (rx.functions.Action0) r0;\n r1 = com.tinder.pushnotifications.usecase.NotifyPushServer.C18652e.f58121a;\n r1 = (rx.functions.Action1) r1;\n r3.a(r0, r1);\n L_0x005f:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tinder.pushnotifications.usecase.NotifyPushServer.a(com.tinder.pushnotifications.usecase.NotifyPushServer$NotifyReason):void\");\n }",
"public interface Mailbox<Msg>\n/* */ extends AutoCloseable\n/* */ {\n/* */ default void close() {}\n/* */ \n/* */ default <Source> CompletableFuture<Source> b(Function<? super Mailbox<Source>, ? extends Msg> var0) {\n/* 19 */ CompletableFuture<Source> var1 = new CompletableFuture<>();\n/* 20 */ Msg var2 = var0.apply(a(\"ask future procesor handle\", var1::complete));\n/* 21 */ a(var2);\n/* 22 */ return var1;\n/* */ }\n/* */ \n/* */ default <Source> CompletableFuture<Source> c(Function<? super Mailbox<Either<Source, Exception>>, ? extends Msg> var0) {\n/* 26 */ CompletableFuture<Source> var1 = new CompletableFuture<>();\n/* 27 */ Msg var2 = var0.apply(a(\"ask future procesor handle\", var1 -> {\n/* */ var1.ifLeft(var0::complete);\n/* */ var1.ifRight(var0::completeExceptionally);\n/* */ }));\n/* 31 */ a(var2);\n/* 32 */ return var1;\n/* */ }\n/* */ \n/* */ static <Msg> Mailbox<Msg> a(String var0, Consumer<Msg> var1) {\n/* 36 */ return new Mailbox<Msg>(var0, var1)\n/* */ {\n/* */ public String bi() {\n/* 39 */ return this.a;\n/* */ }\n/* */ \n/* */ \n/* */ public void a(Msg var0) {\n/* 44 */ this.b.accept(var0);\n/* */ }\n/* */ \n/* */ \n/* */ public String toString() {\n/* 49 */ return this.a;\n/* */ }\n/* */ };\n/* */ }\n/* */ \n/* */ String bi();\n/* */ \n/* */ void a(Msg paramMsg);\n/* */ }",
"private final java.util.Map<java.lang.String, java.lang.String> m11967c() {\n /* JADX: method processing error */\n/*\nError: java.lang.NullPointerException\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.searchTryCatchDominators(ProcessTryCatchRegions.java:75)\n\tat jadx.core.dex.visitors.regions.ProcessTryCatchRegions.process(ProcessTryCatchRegions.java:45)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.postProcessRegions(RegionMakerVisitor.java:63)\n\tat jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:58)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)\n\tat jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:17)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:34)\n\tat jadx.core.ProcessClass.processDependencies(ProcessClass.java:56)\n\tat jadx.core.ProcessClass.process(ProcessClass.java:39)\n\tat jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:282)\n\tat jadx.api.JavaClass.decompile(JavaClass.java:62)\n\tat jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)\n\tat jadx.api.JadxDecompiler$$Lambda$8/509891820.run(Unknown Source)\n*/\n /*\n r7 = this;\n r0 = new java.util.HashMap;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r0.<init>();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1 = r7.f10169c;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r2 = r7.f10170d;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r3 = f10168i;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r4 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r5 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r6 = 0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1 = r1.query(r2, r3, r4, r5, r6);\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n if (r1 == 0) goto L_0x0031;\n L_0x0014:\n r2 = r1.moveToNext();\t Catch:{ all -> 0x002c }\n if (r2 == 0) goto L_0x0028;\t Catch:{ all -> 0x002c }\n L_0x001a:\n r2 = 0;\t Catch:{ all -> 0x002c }\n r2 = r1.getString(r2);\t Catch:{ all -> 0x002c }\n r3 = 1;\t Catch:{ all -> 0x002c }\n r3 = r1.getString(r3);\t Catch:{ all -> 0x002c }\n r0.put(r2, r3);\t Catch:{ all -> 0x002c }\n goto L_0x0014;\n L_0x0028:\n r1.close();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n goto L_0x0031;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n L_0x002c:\n r0 = move-exception;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n r1.close();\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n throw r0;\t Catch:{ SecurityException -> 0x0032, SecurityException -> 0x0032 }\n L_0x0031:\n return r0;\n L_0x0032:\n r0 = \"ConfigurationContentLoader\";\n r1 = \"PhenotypeFlag unable to load ContentProvider, using default values\";\n android.util.Log.e(r0, r1);\n r0 = 0;\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzsi.c():java.util.Map<java.lang.String, java.lang.String>\");\n }",
"@Issue(\"JENKINS-38536\")\n @Test\n public void testParallelCorrectEndNodeForVisitor() throws Exception {\n // Verify that SimpleBlockVisitor actually gets the *real* last node not just the last declared branch\n WorkflowJob jobPauseFirst = r.jenkins.createProject(WorkflowJob.class, \"PauseFirst\");\n jobPauseFirst.setDefinition(new CpsFlowDefinition(\"\" +\n \"echo 'primero stage'\\n\" +\n \"parallel 'wait' : {sleep 1; semaphore 'wait1';}, \\n\" +\n \" 'final': { echo 'succeed';} \",\n true));\n\n WorkflowJob jobPauseSecond = r.jenkins.createProject(WorkflowJob.class, \"PauseSecond\");\n jobPauseSecond.setDefinition(new CpsFlowDefinition(\"\" +\n \"echo 'primero stage'\\n\" +\n \"parallel 'success' : {echo 'succeed'}, \\n\" +\n \" 'pause':{ sleep 1; semaphore 'wait2'; }\\n\",\n true));\n\n WorkflowJob jobPauseMiddle = r.jenkins.createProject(WorkflowJob.class, \"PauseMiddle\");\n jobPauseMiddle.setDefinition(new CpsFlowDefinition(\"\" +\n \"echo 'primero stage'\\n\" +\n \"parallel 'success' : {echo 'succeed'}, \\n\" +\n \" 'pause':{ sleep 1; semaphore 'wait3'; }, \\n\" +\n \" 'final': { echo 'succeed-final';} \",\n true));\n testParallelFindsLast(jobPauseFirst, \"wait1\");\n testParallelFindsLast(jobPauseSecond, \"wait2\");\n testParallelFindsLast(jobPauseMiddle, \"wait3\");\n }",
"public static final <R> java.lang.Object callSuspend(kotlin.reflect.KCallable<? extends R> r4, java.lang.Object[] r5, kotlin.coroutines.Continuation<? super R> r6) {\n /*\n boolean r0 = r6 instanceof kotlin.reflect.full.KCallables$callSuspend$1\n if (r0 == 0) goto L_0x0014\n r0 = r6\n kotlin.reflect.full.KCallables$callSuspend$1 r0 = (kotlin.reflect.full.KCallables$callSuspend$1) r0\n int r1 = r0.label\n r2 = -2147483648(0xffffffff80000000, float:-0.0)\n r1 = r1 & r2\n if (r1 == 0) goto L_0x0014\n int r6 = r0.label\n int r6 = r6 - r2\n r0.label = r6\n goto L_0x0019\n L_0x0014:\n kotlin.reflect.full.KCallables$callSuspend$1 r0 = new kotlin.reflect.full.KCallables$callSuspend$1\n r0.<init>(r6)\n L_0x0019:\n java.lang.Object r6 = r0.result\n java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n int r2 = r0.label\n r3 = 1\n if (r2 == 0) goto L_0x003a\n if (r2 != r3) goto L_0x0032\n java.lang.Object r4 = r0.L$1\n java.lang.Object[] r4 = (java.lang.Object[]) r4\n java.lang.Object r4 = r0.L$0\n kotlin.reflect.KCallable r4 = (kotlin.reflect.KCallable) r4\n kotlin.ResultKt.throwOnFailure(r6)\n goto L_0x007f\n L_0x0032:\n java.lang.IllegalStateException r4 = new java.lang.IllegalStateException\n java.lang.String r5 = \"call to 'resume' before 'invoke' with coroutine\"\n r4.<init>(r5)\n throw r4\n L_0x003a:\n kotlin.ResultKt.throwOnFailure(r6)\n boolean r6 = r4.isSuspend()\n if (r6 != 0) goto L_0x004d\n int r6 = r5.length\n java.lang.Object[] r5 = java.util.Arrays.copyOf(r5, r6)\n java.lang.Object r4 = r4.call(r5)\n return r4\n L_0x004d:\n boolean r6 = r4 instanceof kotlin.reflect.KFunction\n if (r6 == 0) goto L_0x00a3\n r0.L$0 = r4\n r0.L$1 = r5\n r0.label = r3\n kotlin.coroutines.Continuation r0 = (kotlin.coroutines.Continuation) r0\n kotlin.jvm.internal.SpreadBuilder r6 = new kotlin.jvm.internal.SpreadBuilder\n r2 = 2\n r6.<init>(r2)\n r6.addSpread(r5)\n r6.add(r0)\n int r5 = r6.size()\n java.lang.Object[] r5 = new java.lang.Object[r5]\n java.lang.Object[] r5 = r6.toArray(r5)\n java.lang.Object r6 = r4.call(r5)\n java.lang.Object r5 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()\n if (r6 != r5) goto L_0x007c\n kotlin.coroutines.jvm.internal.DebugProbesKt.probeCoroutineSuspended(r0)\n L_0x007c:\n if (r6 != r1) goto L_0x007f\n return r1\n L_0x007f:\n kotlin.reflect.KType r5 = r4.getReturnType()\n kotlin.reflect.KClassifier r5 = r5.getClassifier()\n java.lang.Class<kotlin.Unit> r0 = kotlin.Unit.class\n kotlin.reflect.KClass r0 = kotlin.jvm.internal.Reflection.getOrCreateKotlinClass(r0)\n boolean r5 = kotlin.jvm.internal.Intrinsics.areEqual((java.lang.Object) r5, (java.lang.Object) r0)\n if (r5 == 0) goto L_0x00a2\n kotlin.reflect.KType r4 = r4.getReturnType()\n boolean r4 = r4.isMarkedNullable()\n if (r4 != 0) goto L_0x00a2\n kotlin.Unit r4 = kotlin.Unit.INSTANCE\n java.lang.Object r4 = (java.lang.Object) r4\n return r4\n L_0x00a2:\n return r6\n L_0x00a3:\n java.lang.IllegalArgumentException r5 = new java.lang.IllegalArgumentException\n java.lang.StringBuilder r6 = new java.lang.StringBuilder\n r6.<init>()\n java.lang.String r0 = \"Cannot callSuspend on a property \"\n r6.append(r0)\n r6.append(r4)\n java.lang.String r4 = \": suspend properties are not supported yet\"\n r6.append(r4)\n java.lang.String r4 = r6.toString()\n r5.<init>(r4)\n java.lang.Throwable r5 = (java.lang.Throwable) r5\n throw r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.reflect.full.KCallables.callSuspend(kotlin.reflect.KCallable, java.lang.Object[], kotlin.coroutines.Continuation):java.lang.Object\");\n }",
"@Converted(kind = Converted.Kind.MANUAL_SEMANTIC,\n source = \"${LLVM_SRC}/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp\", line = 324,\n old_source = \"${LLVM_SRC}/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp\", old_line = 323,\n FQN=\"EmitBlockID\", NM=\"_ZL11EmitBlockIDjPKcRN4llvm15BitstreamWriterERNS1_15SmallVectorImplIyEE\",\n cmd=\"jclank.sh -java-options=${SPUTNIK}/modules/org.clang.frontend/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp -nm=_ZL11EmitBlockIDjPKcRN4llvm15BitstreamWriterERNS1_15SmallVectorImplIyEE\")\n//</editor-fold>\npublic static void EmitBlockID(/*uint*/int ID, /*const*/char$ptr/*char P*/ Name, \n BitstreamWriter /*&*/ Stream, \n SmallVectorImplULong /*&*/ Record) {\n Record.clear();\n Record.push_back($uint2ullong(ID));\n Stream.EmitRecord(BlockInfoCodes.BLOCKINFO_CODE_SETBID.getValue(), Record);\n \n // Emit the block name if present.\n if (!(Name != null) || Name.$at(0) == 0) {\n return;\n }\n \n Record.clear();\n Name = Native.$tryClone(Name);\n while ((Name.$star() != 0)) {\n Record.push_back($char2ullong(Name.$postInc().$star()));\n }\n \n Stream.EmitRecord(BlockInfoCodes.BLOCKINFO_CODE_BLOCKNAME.getValue(), Record);\n}",
"@Override\r\n\tpublic Node visitDataParallelPattern(DataParallelPatternContext ctx) {\n\t\treturn super.visitDataParallelPattern(ctx);\r\n\t}",
"public Object\n call() throws Exception { \n final ConstArray<?> argv;\n try {\n argv = deserialize(m,\n ConstArray.array(lambda.getGenericParameterTypes()));\n } catch (final BadSyntax e) {\n /*\n * strip out the parsing information to avoid leaking\n * information to the application layer\n */ \n throw (Exception)e.getCause();\n }\n \n // AUDIT: call to untrusted application code\n final Object r = Reflection.invoke(bubble(lambda), target,\n argv.toArray(new Object[argv.length()]));\n return Fulfilled.isInstance(r) ? ((Promise<?>)r).call() : r;\n }"
] | [
"0.65355384",
"0.57048273",
"0.55133414",
"0.5475599",
"0.53816843",
"0.5358155",
"0.53085643",
"0.51967883",
"0.5151509",
"0.5141977",
"0.5123301",
"0.5114863",
"0.5101187",
"0.5091331",
"0.5083185",
"0.5080738",
"0.50704926",
"0.5031141",
"0.50111747",
"0.50101596",
"0.50068796",
"0.49869525",
"0.49747705",
"0.49693406",
"0.49351662",
"0.4917358",
"0.4914109",
"0.49091458",
"0.4881125",
"0.4873973",
"0.4868035",
"0.48357475",
"0.48312712",
"0.48261058",
"0.48057812",
"0.48055205",
"0.48036623",
"0.4802657",
"0.4787543",
"0.47866708",
"0.47534657",
"0.47518262",
"0.4736419",
"0.47316614",
"0.47235513",
"0.47072735",
"0.47061428",
"0.46978527",
"0.46840623",
"0.46819556",
"0.46680686",
"0.46631357",
"0.4658005",
"0.46393526",
"0.4636794",
"0.46335363",
"0.4611284",
"0.4606988",
"0.45989424",
"0.45820084",
"0.45818612",
"0.4572207",
"0.4567256",
"0.45635337",
"0.4562407",
"0.45602518",
"0.45552805",
"0.45544252",
"0.45511195",
"0.45509416",
"0.45477647",
"0.45399085",
"0.45334527",
"0.45324475",
"0.45311058",
"0.45298493",
"0.4526375",
"0.45261076",
"0.45255026",
"0.45248634",
"0.4518801",
"0.4518792",
"0.45155615",
"0.45142043",
"0.45137432",
"0.45134196",
"0.45049435",
"0.45008153",
"0.44985417",
"0.4494033",
"0.44919232",
"0.44846424",
"0.44807532",
"0.44800782",
"0.4479245",
"0.44769877",
"0.44767007",
"0.44643986",
"0.44638306",
"0.44609308"
] | 0.7917707 | 0 |
Convert the given object to string with each line indented by 4 spaces (except the first line). | private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String toIndentedString(Object object) {\n if (object == null) {\n return EndpointCentralConstants.NULL_STRING;\n }\n return object.toString().replace(EndpointCentralConstants.LINE_BREAK,\n EndpointCentralConstants.LINE_BREAK + EndpointCentralConstants.TAB_SPACES);\n }",
"private String toIndentedString(Object o)\n/* */ {\n/* 128 */ if (o == null) {\n/* 129 */ return \"null\";\n/* */ }\n/* 131 */ return o.toString().replace(\"\\n\", \"\\n \");\n/* */ }",
"private String toIndentedString( Object o )\n {\n if ( o == null )\n {\n return \"null\";\n }\n return o.toString().replace( \"\\n\", \"\\n \" );\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }",
"private String toIndentedString(Object o) {\n if (o == null) {\n return \"null\";\n }\n return o.toString().replace(\"\\n\", \"\\n \");\n }"
] | [
"0.7884939",
"0.7549351",
"0.74972624",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987",
"0.74616987"
] | 0.0 | -1 |
MyThread thread = new MyThread(); thread.doSomething(); | public static void main(String[] args) throws InterruptedException {
Thread otherThread = new Thread(() -> {
Thread.currentThread().start();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void startThread();",
"ThreadStart createThreadStart();",
"public Thread getThread();",
"public void createThread() {\n }",
"public static void main(String args[ ]){\r\nMythread rt = new Mythread(); /* main thread created the runnable object*/\r\nThread t = new Thread(rt); /*main thread creates child thread and passed the runnable object*/\r\nt.start();\r\nfor(int i=0; i<10; i++){\r\nSystem.out.println(\"Main Thread\");\r\n}\r\n}",
"public void run(){\n //logic to execute in a thread \n }",
"public void start ()\n {\n Thread th = new Thread (this);\n // start this thread\n th.start ();\n\n }",
"public interface MainThread {\n void post(Runnable runnable);\n}",
"public IThread createThread() throws IllegalWriteException, BBException;",
"private void startNormalThread() {\n customThread = new CustomThread();\n customThread.start();\n }",
"public void start() {\n\t\tmyThread = new Thread(this); myThread.start();\n\t}",
"public static void main(String[] args) {\n\t\tMyThread m = new MyThread();\n\t\tThread m2 = new Thread(new MyRunable());\n\t\tm.start();\n\t\t\n\t\t\n\t\tm2.start();\n\t}",
"public void start() {\r\n isRunning = true;\r\n Thread thread = new myThread();\r\n thread.start();\r\n }",
"public void doWork() {\n Thread thread = new Thread( hva != null ? hva : this);\n thread.start();\n }",
"@Override\n\tpublic Thread newThread(Runnable r) {\n\t\t\n\t\tThread th = new Thread(r,\" custum Thread\");\n\t\treturn th;\n\t}",
"CarThread(Car car) {\n this.car = car;\n thread = new Thread(this);\n }",
"public void setThread(Thread t);",
"public static void main(String[] args) {\n\t\tMyThread thread = new MyThread();\r\n\t\tthread.setName(\"MyThread\");\r\n\t\tThread t1 = new Thread(thread);\r\n\t\tSystem.out.println(\"begin=\" + System.currentTimeMillis());\r\n\t\tt1.setName(\"T1\");\r\n\t\tt1.start();\r\n\t\tSystem.out.println(\"end=\" + System.currentTimeMillis());\r\n\t}",
"public static void main(String[] args) {\n\t\n System.out.println(ANSI_Black+\"Hello from Main thread\");\n\tThread extendThread = new ThreadExtendsExample();\n\textendThread.setName(\"ThreadByExtends1~\");\n\textendThread.start();\n\t\n\t//java.lang.IllegalThreadStateException, same thread cannot be started again\n\t//extendThread.start();\n\tThread extendThread2 = new ThreadExtendsExample();\n\textendThread2.setName(\"ThreadByExtends2~\");\n\textendThread2.start();\n\t\n\t\n\t\n\tThreadImplExample implThread = new ThreadImplExample();\n\timplThread.run();\n\t\n\t\n\tThread runnableThread = new Thread(new ThreadImplExample());\n\trunnableThread.start();\n\t\n\t\n\t\n\tSystem.out.println(ANSI_Black+\"Hello Again from Main thread\");\n\t\n}",
"@Override\n // Thread creation\n // Run method from the Runnable class.\n public void run() {\n p.println(\"Current thread = \" + Thread.currentThread().getName());\n // Shows when a task is being executed concurrently with another thread,\n // then puts the thread to bed (I like saying that)\n try {\n p.println(\"Doing a task during : \" + name);\n Thread.currentThread().sleep(time);\n }\n // Exception for when a thread is interrupted.\n catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args){\r\n\t\tMythread2 mt = new Mythread2(); /* main thread created the child thread*/\r\n\t\t\tmt.start();\r\n\t\tfor(int i=0; i<10; i++){\r\n\t\t\t\tSystem.out.print(\"Main Thread\");\r\n\t\t\t\t\t}\r\n}",
"public static void main(String[] args) {\n Thread thread=new Thread(new MyRunnable(),\"firstThread\");\n thread.start();\n System.out.println(thread.getName());\n }",
"public static void main(String[] args) {\n Runnable myRunnable = new TestThread();\n Thread t1 = new Thread(myRunnable,\"t1\");\n Thread t2 = new Thread(myRunnable,\"t2\");\n t1.start();\n t2.start();\n }",
"@Override\r\n public Thread newThread(Runnable r) {\n Thread t = new Thread(r, \"example-runner\");\r\n t.setDaemon(true);\r\n return t;\r\n }",
"private static void ThreadCreationOldWay() {\r\n\t\tThread t1 = new Thread(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tSystem.out.println(\"This is a runnable method done in old fashion < 1.8\");\r\n\t\t\t}\r\n\t\t});\r\n\t\tt1.start();\r\n\t}",
"public interface IWeakThread {\n\n void runThread(int tag);\n\n}",
"NetThread(){}",
"public static void main(String[] args) {\n\t\tMyThread mt = new MyThread();\n\t\t// We can assign a name\n\t\tmt.setName(\"Thread 1\");\n\t\tmt.start();\n\t\t\n\t\tMyThreads2 mt2 = new MyThreads2();\n\t\tThread t = new Thread(mt2);\n\t\t\n\t\t//New Thread\n\t\tThread t2 = new Thread(mt2);\n\t\tThread t3 = new Thread(mt2); \n\t\tt.setName(\"Thread 2\");\n\t\tt2.setName(\"Thread 3\");\n\t\tt3.setName(\"Thread 4\");\n\t\tt.start();\n\t\tt2.start();\n\t\tt3.start();\n\t\t\n\t}",
"public static void main(String[] args) {\r\n\t\tMyThread thread = new MyThread();\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t\tfixedExecutorService.execute(thread);\r\n\t}",
"private static void createThreadUsingAnonymousInnerClass() {\n\t\tRunnable rn = new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"My Anonymous Inner Class thread is executed.\");\n\t\t\t}\n\t\t};\n\n\t\tThread th = new Thread(rn);\n\t\tth.start();\n\t}",
"public Thread startThread() {\n Thread thread = createThread();\n thread.start();\n return thread;\n }",
"public interface ThreadApi {\n Future executeInBackground(Runnable task);\n boolean executeInMainThread(Runnable task);\n boolean executeInMainThread(Runnable task, long delay);\n}",
"public void startThread(VirtualThread newThread) {\n\t\tlog.debug(\"**** CREATING A THREAD? ****\");\n\t}",
"public static void main(String args[]) {\n\t\t (new Thread(new Threads_and_Executors())).start();\r\n}",
"public boolean postThread(IThread thread) throws IllegalWriteException, BBException;",
"@Override\r\n\tpublic Thread newThread(Runnable arg0) {\n\t\treturn null;\r\n\t}",
"public interface ThreadExecutor extends Executor {\n}",
"public interface IHttpThreadExecutor {\n public void addTask(Runnable runnable);\n}",
"private Thread createThreadFor(Agent ag) {\n ProcessData data = getDataFor(ag);\n\n data.thread = new Thread(threadGroup, ag);\n data.thread.setPriority(THREAD_PRIORITY);\n\n return data.thread;\n }",
"public MyRunnable(){\t\n\t}",
"public Thread getThread(int type, String name, Runnable r);",
"private static void demoRunnable() {\n new Thread(() -> System.out.println(Thread.currentThread().getName()), \"thread-λ\").start();\n new Thread(ToLambdaP5::printThread, \"thread-method-ref\").start();\n }",
"public void start() {\n thread = new Thread(this);\n thread.setPriority(Thread.MIN_PRIORITY);\n thread.start();\n }",
"private Timer() {\n myThread = new TimerThread();\n myThread.start();\n }",
"public void start()\n\t{\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t}",
"public TicketBoothClient()\n {\n Thread myThread = new Thread(this);\n myThread.start();\n }",
"NewThread (String threadname) {\r\n name = threadname;\r\n t = new Thread(this, name); // Constructor de un nuevo thread\r\n System.out.println(\"Nuevo hilo: \" +t);\r\n t.start(); // Aquí comienza el hilo\r\n }",
"public static void main(String[] args) {\n\t\tMyThread1 t = new MyThread1();\r\n\t\tt.start();\r\n//executed by main thread\r\n\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t\tSystem.out.println(\"main thread\");\r\n\t\t}\r\n\t}",
"public Thread getThread() {\n return thread;\n }",
"void start() {\n\tsleepThread = new Thread(this);\n\tsleepThread.start();\n }",
"public void start(){\n thread.start();\n }",
"public static void main(String[] args) {\n\t\tMyThread mythread=new MyThread();\n\t\tmythread.start();\n\t while(true) {\n\t \tSystem.out.println(\"Main方法正在运行\");\n\t }\n\t}",
"public void doSomething() {\n\t}",
"@Override\n protected Thread createThread(final Runnable runnable, final String name) {\n return new Thread(runnable, Thread.currentThread().getName() + \"-exec\");\n }",
"private void go() {\n\n new Thread(this).start();\n }",
"public void startThread(){\n\t\trunning = true;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t}",
"PythonThread(Python python, String code) {\n this.python = python;\n this.code = code;\n this.ptf = new PythonTraceFunction();\n this.py = new PythonInterpreter();\n }",
"private static native Object setupMainThread0(Object thread);",
"public synchronized Thread getThread() {\n return thread;\n }",
"@Test\n @DisplayName(\"Plain Runnable\")\n void testRunnable() {\n Runnable task = this::printThreadName;\n\n task.run();\n\n Thread thread = new Thread(task);\n thread.start();\n\n System.out.println(\"Done!\");\n }",
"private void start(){\n isRunning = true;\n thread = new Thread(this);\n thread.start();\n }",
"void runInThread(Runnable runnable) {\n try {\n Thread thread = new Thread(runnable::run);\n thread.start();\n } catch (Exception ex) {\n log.info(ex.getMessage());\n }\n\n }",
"public static void main(String[] args) {\n Employee emp=new Employee();\n emp.start();\n Student stu=new Student();\n Thread t1=new Thread(stu);\n t1.start();\n\t}",
"public void run(){\n System.out.println(\"Thread class extends \" + getName());\n }",
"public void start() {\n // EFFECTS: starts a new thread from this instance.\n (new Thread(instance)).start();\n }",
"private LogRecord createLogRecordInOtherThread() {\n class MyThread extends Thread {\n\n LogRecord record;\n\n public void run() {\n record = new LogRecord(Level.INFO, \"foobar\");\n }\n\n public LogRecord getRecord() {\n return record;\n }\n };\n\n MyThread theThread = new MyThread();\n try {\n theThread.start();\n theThread.join();\n return theThread.getRecord();\n } catch (InterruptedException _) {\n return null;\n }\n }",
"public static void main(String[] args) {\n\r\n System.out.println(Thread.currentThread().getName());\r\n System.out.println(Thread.currentThread().getId());\r\n\r\n MyFirstThread helloThread1 = new MyFirstThread();\r\n MyFirstThread helloThread2 = new MyFirstThread();\r\n helloThread1.start();\r\n helloThread2.start();\r\n\r\n\r\n }",
"public static void main(String[] args) throws InterruptedException, ExecutionException {\n\t\tMyThread myThread=new MyThread();\n\t\t//用Excutors 线程执行器类创建可扩展的线程池\n\t\tExecutorService executor=Executors.newCachedThreadPool();\n\t\t//将实现类对象提交到线程池进行管理\n\t\tFuture<Object> result1=executor.submit(myThread);\n\t\tFuture<Object> result2=executor.submit(myThread);\n\t\texecutor.shutdown();\n\t\tSystem.out.println(result1.get());\n\t\tSystem.out.println(result2.get());\n\t}",
"@Override\n public void threadStarted() {\n }",
"public void run(){\n String threadName = Thread.currentThread().getName();\n System.out.println(\"Hello \" + threadName);\n }",
"public static void main(String[] args) {\n\t\tThread t = new MyThread() {\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\"Foo\");\n\t\t\t}\n\t\t};\n\t\tt.start();\n\t}",
"public void run(){\r\nfor(int i=0; i<10; i++){\r\nSystem.out.println(\"Child Thread\");\r\n}\r\n}",
"public void run(){\r\nfor(int i=0; i<10; i++){\r\nSystem.out.println(\"Child Thread\");\r\n}\r\n}",
"private static void tickOnThread() {\n final Thread thread = new Thread(new Runnable(){\n @Override\n public void run() {\n tick(true);\n }\n });\n thread.start();\n }",
"private void startRunnableThread() {\n customRunnable = new CustomRunnable();\n customThread = new CustomThread(customRunnable);\n customRunnable.setTag(customThread.tag);\n customThread.start();\n\n }",
"public static void main(String[] args) {\n\t\tMythread t1 = new Mythread(\"First\");\n\t\tMythread t2 = new Mythread(\"Second\");\n\t\tt1.start();\n\t\tt2.start();\n\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\n\t\t\t\t\t\t\"ok, here is \" + Thread.currentThread().getName() + \" \" + \"thread, i'll do something here..\");\n\t\t\t}",
"public static void main(String[] args) {\n\t\tRunnable r= new Runnable() \r\n\t\t{\r\n\t\t\tpublic void run(){\r\n\t\t\t\tfor(int i=0; i<=5;i++) {\r\n\t\t\t\t\tSystem.out.println(\"Child Thread\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n//\t\tThread class 't' reference variable is calling Runnable implementation class\r\n\t\tSystem.out.println(\"Thread Class calling Runnable Interfface 'r' \");\r\n\t\tThread t = new Thread(r);\r\n\t\tt.start();\r\n\t\tfor(int i=0; i<=5;i++) {\r\n\t\t\tSystem.out.println(\"Main Thread\");\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n Thread thread = new Thread(\"New Thread\") {\n public void run(){\n System.out.println(\"run by: \" + getName());\n }\n };\n\n thread.start();\n System.out.println(thread.getName());\n\n }",
"private VirtualThread createThread(String threadName) {\n\t\tJavaObjectReference threadObj = new JavaObjectReference(new LazyClassfile(\"java/lang/Thread\"));\n\t\t\n\t\t// TODO: We should invoke constructors here...\n\t\tthreadObj.setValueOfField(\"priority\", new JavaInteger(1));\n\t\tthreadObj.setValueOfField(\"name\", JavaArray.str2char(vm,threadName));\n\t\tthreadObj.setValueOfField(\"group\", new JavaObjectReference(bcl.load(\"java/lang/ThreadGroup\")));\n\t\t\n\t\tmainThread = new VirtualThread(vm, rda, threadName, threadObj);\n\t\tthreadAreas.add(mainThread);\n\t\treturn mainThread;\n\t}",
"public static void main(String[] args)\n {\n Runnable r1=()->{ \n System.out.println(\"Thread1 is running...\");}; \n Thread t1=new Thread(r1); \n t1.start(); \n }",
"private SingletonThreadSafeExample(){\n this.invoke++;\n }",
"public void toThread() {\n\t\t// TODO Auto-generated method stub\n\t\tnew Thread(this).start();\n\t\tclient.start();\n\t}",
"public void start() {\n\t\tai = new Thread(this);\n\t\tai.start();\n\t}",
"public static void main(String[] args) throws InterruptedException {\n\t\tMyThread mt=new MyThread(\"MyThread\");\n\t\tThread.sleep(100);\n\t\tmt.suspend();\n\t\tThread.sleep(100);\n\t\t\n\t\tmt.resume();\n\t\tThread.sleep(100);\n\t\t\n\t\tmt.suspend();\n\t\tThread.sleep(100);\n\t\t\n\t\tmt.resume();\n\t\tThread.sleep(100);\n\t\t\n\t\tmt.stop();\n\t}",
"void pauseThread();",
"public void run() {\n\n\n }",
"public void start() {\n\t\tif(t == null) {\n\t\t\tt = new Thread(this);\n\t\t\tt.start();\n\t\t}\n\t}",
"@Override\n\t\t\tpublic Thread newThread(final Runnable r) {\n\t\t\t\tint id = threadNumber.getAndIncrement();\n\t\t\t\tString threadName = leftPad(String.valueOf(id), 2, \"0\");\n\t\t\t\tThread th = new Thread(r);\n\t\t\t\tth.setName(threadName);\n\t\t\t\tth.setDaemon(false);\n\t\t\t\treturn th;\n\t\t\t}",
"public static void main(String[] args) {\n MyThread t1 = new MyThread();\n /**\n * 启动线程是用start()方法,然后线程自动调用run()方法,但是线程并不是立马就运行,\n * 而是进入就绪状态,等待CPU的调度才运行\n */\n t1.start();//启动线程\n for (int i = 0; i < 1000; i++) {\n System.out.println(\"In main i=\" + i);\n }\n }",
"private static void createThreadUsingLambdaExpressions() {\n\t\tRunnable r = () -> {System.out.println(\"Lambda Expression thread is executed.\");};\n\t\tThread t = new Thread(r);\n\t\tt.start();\n\t}",
"public static void main(String[] args)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tThread t1 = new Thread(new MyThread1_RunnableInterface(1,\"Hello from Thread1\"));\n\t\t\t\tThread t2 = new Thread(new MyThread1_RunnableInterface(2,\"Hello from Thread2\"));\n\t\t\t\tThread t3 = new Thread(new MyThread1_RunnableInterface(3,\"Hello from Thread3\"));\n\t\t\t\t\n t1.start();\n t2.start();\n t3.start();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t}",
"@Test\n public void construtorTest() {\n ThreadObserveSample person = new ThreadObserveSample(\"test\");\n }",
"public interface Startable extends Runnable {\n \n /**\n * Waits until the thread this object is running in is finished before returning.\n */\n public void join();\n \n /**\n * Checks whether the component is done with its work.\n * @return <code>true</code> if the component is finished its work\n */\n public boolean isDone();\n \n /**\n * Sets the thread that this object is running in.\n * \n * @param t the thread that this object is running in\n */\n public void setThread(Thread t);\n\n /**\n * Gets the thread that this object is running in.\n * \n * @return the thread that this object is running in\n */\n public Thread getThread();\n\n}",
"public static void main(String[] args) {\n\t\tThreadTest test= new ThreadTest();\n\t\ttest.start();\n\t\t\n\t\t// creating thread by implementing Runnable interface\n\t\tRunnable runnable = new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tSystem.out.println(\" Creating thread by implement Runnable Interface\");\n\t\t\t}\n\t\t};\n\t\t\t\n\t\tThread test2 = new Thread(runnable);\n\t\ttest2.start();\n\t\t\n\t\t// Runnable is a Functional Interface which having only one abstract method\n\t\tRunnable functionalInterface = ()-> System.out.println(\" creating thread using lembda expression\");\n\t\tThread test3 = new Thread(functionalInterface);\n\t\ttest3.start();\n\t\t\n\n\n\t\t\n\t}",
"public static void initCommunicationClientThread(){\r\n new CommunicationClientThread();\r\n }",
"public void run()\n {\n\n }",
"public interface PostExecutionThread {\n Scheduler getScheduler();\n}",
"public interface PostExecutionThread {\n Scheduler getScheduler();\n}",
"public interface PostExecutionThread {\n Scheduler getScheduler();\n}",
"private void start() {\r\n\t\tif (running)\r\n\t\t\treturn;\r\n\t\trunning = true;\r\n\t\tthread = new Thread(this);//creates threat to run program on\r\n\t\tthread.start();\r\n\t}"
] | [
"0.71132904",
"0.6979189",
"0.6938112",
"0.6894396",
"0.66764736",
"0.664843",
"0.6478095",
"0.64706063",
"0.6382352",
"0.6375288",
"0.63399833",
"0.6303274",
"0.6285086",
"0.62676585",
"0.62455875",
"0.6226251",
"0.6219716",
"0.6194815",
"0.6179112",
"0.6174754",
"0.61006844",
"0.60738325",
"0.60624784",
"0.6043742",
"0.60371333",
"0.6011265",
"0.5999409",
"0.59862137",
"0.5985614",
"0.5957119",
"0.595012",
"0.5922325",
"0.5906795",
"0.58948535",
"0.58835435",
"0.58579785",
"0.5840695",
"0.58245945",
"0.5820528",
"0.58051693",
"0.57683456",
"0.5762227",
"0.57509065",
"0.57336074",
"0.5729562",
"0.56971276",
"0.56904685",
"0.5687001",
"0.56855184",
"0.567563",
"0.5645073",
"0.56344116",
"0.5629522",
"0.5622705",
"0.56188107",
"0.56161857",
"0.5615687",
"0.5611248",
"0.5610097",
"0.56065",
"0.5600009",
"0.55975765",
"0.5588863",
"0.55793065",
"0.55784255",
"0.5569727",
"0.5566876",
"0.5555396",
"0.55480784",
"0.55417377",
"0.55175656",
"0.5516793",
"0.5516793",
"0.55159616",
"0.55104244",
"0.54990125",
"0.5497576",
"0.5491982",
"0.5476338",
"0.5476139",
"0.5474317",
"0.5468351",
"0.5464643",
"0.5453933",
"0.5451965",
"0.54472244",
"0.54463255",
"0.5441416",
"0.5439143",
"0.54345506",
"0.5429301",
"0.54242086",
"0.54214627",
"0.5418223",
"0.5417103",
"0.54139924",
"0.54110265",
"0.5406838",
"0.5406838",
"0.5406838",
"0.5405271"
] | 0.0 | -1 |
Used to process usage events | public void collectUsageAndProcessUsageRecords(LoadBalancer lb, UsageEvent event, Calendar eventTime) throws UsageEventCollectionException {
LOG.debug("Processing Usage Records for load balancer: " + lb.getId());
List<SnmpUsage> usages = getUsage(lb);
usageEventProcessor.processUsageEvent(usages, lb, event, eventTime);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void incrementUsageCount() {\n usageCount++;\n }",
"@Override\n\t\tpublic long usage() {\n\t\t\t\n\t\t\treturn super.usage();\n\t\t}",
"public final void onUsed()\r\n {\r\n // ILogger::instance()->logInfo(\"GPUProgram %s being used\", _name.c_str());\r\n }",
"public void listen() {\n DeviceManager cpuUsage = new CPUUsageManager();\n cpuUsage.printStatus();\n \n }",
"public void processEvent(Event event) {\n\t\t\n\t}",
"private SensorData collectCPUUsageInfo() throws SigarException {\n \n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Collecting CPU Usage Information\");\n }\n SensorData data = new SensorData();\n \n CpuPerc cpuPerc = sigar.getCpuPerc();\n \n data.add(SensorAttributeConstants.CPUConstants.CPU_IDLE, (cpuPerc.getIdle() * 100));\n data.add(SensorAttributeConstants.CPUConstants.CPU_USAGE_USER, (cpuPerc.getUser() * 100));\n data.add(SensorAttributeConstants.CPUConstants.CPU_USAGE_SYSTEM, (cpuPerc.getSys() * 100));\n data.add(SensorAttributeConstants.CPUConstants.CPU_USAGE_TOTAL, (cpuPerc.getCombined() * 100));\n \n return data;\n }",
"public void processEvents(Events events) {\n\n log.info(\"events processed: [{}]\", events.toString());\n }",
"void onUpdate(long diskUsageSample);",
"public void doService() {\n EventManager eventManager = new EventManager();\n while (!queue.isEmpty()) {\n Event firstEvent = queue.poll();\n if (!(firstEvent instanceof ServerBackEvent) &&\n !(firstEvent instanceof ServerRestEvent)) {\n System.out.println(firstEvent);\n } \n Event nextEvent = eventManager.getNext(servers, gen, firstEvent, stats, probability);\n if (nextEvent != null) {\n queue.add(nextEvent);\n }\n }\n System.out.println(stats);\n \n\n }",
"public void testWatcherUsageStatsTests() {\n long watchCount = randomLongBetween(5, 20);\n for (int i = 0; i < watchCount; i++) {\n watcherClient().preparePutWatch(\"_id\" + i).setSource(watchBuilder()\n .trigger(schedule(cron(\"0/5 * * * * ? 2050\")))\n .input(simpleInput())\n .addAction(\"_id\", loggingAction(\"whatever \" + i)))\n .get();\n }\n\n XPackUsageRequest request = new XPackUsageRequest();\n XPackUsageResponse usageResponse = client().execute(XPackUsageAction.INSTANCE, request).actionGet();\n Optional<XPackFeatureSet.Usage> usage = usageResponse.getUsages().stream()\n .filter(u -> u instanceof WatcherFeatureSetUsage)\n .findFirst();\n assertThat(usage.isPresent(), is(true));\n WatcherFeatureSetUsage featureSetUsage = (WatcherFeatureSetUsage) usage.get();\n\n long activeWatchCount = (long) ((Map) featureSetUsage.stats().get(\"count\")).get(\"active\");\n assertThat(activeWatchCount, is(watchCount));\n }",
"@Override\n public void handleEvents(List<Event> processorEvents) {\n\n }",
"public void objectUsed(PoolEvent evt) {\n if (!trackLastUsed) return;\n setLastUsed(evt.getSource());\n }",
"@Scheduled(fixedRate = 2000)\n private void doSendRpcUsage() {\n List<MethodCallDTO> items = stats.values()\n .stream()\n .map(stat -> new MethodCallDTO(\n stat.name,\n stat.count.longValue(),\n stat.lastCall.longValue(),\n stat.lastResult.get(),\n stat.curl))\n .sorted((s1, s2) -> s1.getMethodName().compareTo(s2.getMethodName()))\n .collect(Collectors.toList());\n\n clientMessageService.sendToTopic(\"/topic/rpcUsage\", items);\n }",
"public void process(WatchedEvent event) {\n\t\t\n\t}",
"public void processAppBatteryUsage() {\n create();\n\n SensorManager sensorManager = (SensorManager) mContext\n .getSystemService(Context.SENSOR_SERVICE);\n final int which = mStatsType;\n final int speedSteps = mPowerProfile.getNumSpeedSteps();\n final double[] powerCpuNormal = new double[speedSteps];\n final long[] cpuSpeedStepTimes = new long[speedSteps];\n for (int p = 0; p < speedSteps; p++) {\n powerCpuNormal[p] = mPowerProfile.getAveragePower(PowerProfile.POWER_CPU_ACTIVE, p);\n }\n final double averageCostPerByte = getAverageDataCost();\n long uSecTime = mStats.computeBatteryRealtime(SystemClock.elapsedRealtime() * 1000, which);\n long appWakelockTime = 0;\n // BatterySipper osApp = null;\n mStatsPeriod = uSecTime;\n SparseArray<? extends Uid> uidStats = mStats.getUidStats();\n final int NU = uidStats.size();\n for (int iu = 0; iu < NU; iu++) {\n Uid u = uidStats.valueAt(iu);\n double power = 0;\n double highestDrain = 0;\n String packageWithHighestDrain = null;\n //mUsageList.add(new AppUsage(u.getUid(), new double[] {power}));\n Map<String, ? extends BatteryStats.Uid.Proc> processStats = u.getProcessStats();\n long cpuTime = 0;\n long cpuFgTime = 0;\n long wakelockTime = 0;\n long gpsTime = 0;\n if (processStats.size() > 0) {\n // Process CPU time\n for (Map.Entry<String, ? extends BatteryStats.Uid.Proc> ent : processStats\n .entrySet()) {\n Log.print(\"Process name = \" + ent.getKey());\n Uid.Proc ps = ent.getValue();\n final long userTime = ps.getUserTime(which);\n final long systemTime = ps.getSystemTime(which);\n final long foregroundTime = ps.getForegroundTime(which);\n cpuFgTime += foregroundTime * 10; // convert to millis\n final long tmpCpuTime = (userTime + systemTime) * 10; // convert to millis\n int totalTimeAtSpeeds = 0;\n // Get the total first\n for (int step = 0; step < speedSteps; step++) {\n cpuSpeedStepTimes[step] = ps.getTimeAtCpuSpeedStep(step, which);\n totalTimeAtSpeeds += cpuSpeedStepTimes[step];\n }\n if (totalTimeAtSpeeds == 0)\n totalTimeAtSpeeds = 1;\n // Then compute the ratio of time spent at each speed\n double processPower = 0;\n for (int step = 0; step < speedSteps; step++) {\n double ratio = (double) cpuSpeedStepTimes[step] / totalTimeAtSpeeds;\n processPower += ratio * tmpCpuTime * powerCpuNormal[step];\n }\n cpuTime += tmpCpuTime;\n power += processPower;\n if (packageWithHighestDrain == null || packageWithHighestDrain.startsWith(\"*\")) {\n highestDrain = processPower;\n packageWithHighestDrain = ent.getKey();\n } else if (highestDrain < processPower && !ent.getKey().startsWith(\"*\")) {\n highestDrain = processPower;\n packageWithHighestDrain = ent.getKey();\n }\n }\n Log.print(\"Max drain of \" + highestDrain + \" by \" + packageWithHighestDrain);\n }\n if (cpuFgTime > cpuTime) {\n if (cpuFgTime > cpuTime + 10000) {\n Log.print(\"WARNING! Cputime is more than 10 seconds behind Foreground time\");\n }\n cpuTime = cpuFgTime; // Statistics may not have been gathered yet.\n }\n power /= 1000;\n\n // Process wake lock usage\n Map<String, ? extends BatteryStats.Uid.Wakelock> wakelockStats = u.getWakelockStats();\n for (Map.Entry<String, ? extends BatteryStats.Uid.Wakelock> wakelockEntry : wakelockStats\n .entrySet()) {\n Uid.Wakelock wakelock = wakelockEntry.getValue();\n // Only care about partial wake locks since full wake locks\n // are canceled when the user turns the screen off.\n BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL);\n if (timer != null) {\n wakelockTime += timer.getTotalTimeLocked(uSecTime, which);\n }\n }\n wakelockTime /= 1000; // convert to millis\n appWakelockTime += wakelockTime;\n\n // Add cost of holding a wake lock\n power += (wakelockTime * mPowerProfile.getAveragePower(PowerProfile.POWER_CPU_AWAKE)) / 1000;\n\n // Add cost of data traffic\n long tcpBytesReceived = u.getTcpBytesReceived(mStatsType);\n long tcpBytesSent = u.getTcpBytesSent(mStatsType);\n power += (tcpBytesReceived + tcpBytesSent) * averageCostPerByte;\n\n // Add cost of keeping WIFI running.\n long wifiRunningTimeMs = u.getWifiRunningTime(uSecTime, which) / 1000;\n mAppWifiRunning += wifiRunningTimeMs;\n power += (wifiRunningTimeMs * mPowerProfile.getAveragePower(PowerProfile.POWER_WIFI_ON)) / 1000;\n\n // Process Sensor usage\n Map<Integer, ? extends BatteryStats.Uid.Sensor> sensorStats = u.getSensorStats();\n for (Map.Entry<Integer, ? extends BatteryStats.Uid.Sensor> sensorEntry : sensorStats\n .entrySet()) {\n Uid.Sensor sensor = sensorEntry.getValue();\n int sensorType = sensor.getHandle();\n BatteryStats.Timer timer = sensor.getSensorTime();\n long sensorTime = timer.getTotalTimeLocked(uSecTime, which) / 1000;\n double multiplier = 0;\n switch (sensorType) {\n case Uid.Sensor.GPS:\n multiplier = mPowerProfile.getAveragePower(PowerProfile.POWER_GPS_ON);\n gpsTime = sensorTime;\n break;\n default:\n android.hardware.Sensor sensorData = sensorManager.getDefaultSensor(sensorType);\n if (sensorData != null) {\n multiplier = sensorData.getPower();\n Log.print(\"Got sensor \" + sensorData.getName() + \" with power = \"\n + multiplier);\n }\n }\n power += (multiplier * sensorTime) / 1000;\n }\n\n // Log.print(\"UID \" + u.getUid() + \": power=\" + power);\n Log.print(\"PACKAGE \" + packageWithHighestDrain + \": power=\" + power);\n\n // // Add the app to the list if it is consuming power\n // if (power != 0 || u.getUid() == 0) {\n // BatterySipper app = new BatterySipper(getActivity(), mRequestQueue, mHandler,\n // packageWithHighestDrain, DrainType.APP, 0, u,\n // new double[] {power});\n // app.cpuTime = cpuTime;\n // app.gpsTime = gpsTime;\n // app.wifiRunningTime = wifiRunningTimeMs;\n // app.cpuFgTime = cpuFgTime;\n // app.wakeLockTime = wakelockTime;\n // app.tcpBytesReceived = tcpBytesReceived;\n // app.tcpBytesSent = tcpBytesSent;\n // if (u.getUid() == Process.WIFI_UID) {\n // mWifiSippers.add(app);\n // } else if (u.getUid() == Process.BLUETOOTH_GID) {\n // mBluetoothSippers.add(app);\n // } else {\n // mUsageList.add(app);\n // }\n // if (u.getUid() == 0) {\n // osApp = app;\n // }\n // }\n // if (u.getUid() == Process.WIFI_UID) {\n // mWifiPower += power;\n // } else if (u.getUid() == Process.BLUETOOTH_GID) {\n // mBluetoothPower += power;\n // } else {\n // if (power > mMaxPower) mMaxPower = power;\n // mTotalPower += power;\n // }\n // if (DEBUG) Log.i(TAG, \"Added power = \" + power);\n }\n\n // The device has probably been awake for longer than the screen on\n // time and application wake lock time would account for. Assign\n // this remainder to the OS, if possible.\n // if (osApp != null) {\n // long wakeTimeMillis = mStats.computeBatteryUptime(\n // SystemClock.uptimeMillis() * 1000, which) / 1000;\n // wakeTimeMillis -= appWakelockTime - (mStats.getScreenOnTime(\n // SystemClock.elapsedRealtime(), which) / 1000);\n // if (wakeTimeMillis > 0) {\n // double power = (wakeTimeMillis\n // * mPowerProfile.getAveragePower(PowerProfile.POWER_CPU_AWAKE)) / 1000;\n // osApp.wakeLockTime += wakeTimeMillis;\n // osApp.value += power;\n // osApp.values[0] += power;\n // if (osApp.value > mMaxPower) mMaxPower = osApp.value;\n // mTotalPower += power;\n // }\n // }\n }",
"public abstract String usage();",
"public void run() {\n long num = numEvents.get();\n long lastnum = lastNumEvents.get();\n long evps = (num-lastnum)/App.METRICS_PER_SECOND;\n lastNumEvents.set(num);\n System.out.println(\"Consumer[\"+\n nnaammee+\"]: cursorRestarts=\"+cursorRestarts.get()\n +\" numEvents=\"+num\n +\" events/second=\"+evps\n +\" totalNumEvents=\"+totalNumEvents.get());\n }",
"@Override\n\t\t\tpublic void onEvent(ObjectEvent event) {\n\t\t\t\t\n\t\t\t\tRankTempInfo rankInfo = RankServerManager.getInstance().getRankTempInfo(player.getPlayerId());\n\t\t\t\tif(rankInfo!=null){\n\t\t\t\t\tgetTask().updateProcess((int)rankInfo.getSoul());\n\t\t\t\t}\n\t\t\n\t\t\t\t\n\t\t\t}",
"public void processZeroUsageEvent(LoadBalancer lb, UsageEvent event, Calendar eventTime) throws UsageEventCollectionException {\n List<Host> hosts = null;\n try {\n hosts = gatherHostsData(lb);\n } catch (EntityNotFoundException e) {\n LOG.error(String.format(\"On %s event, load balancer %d was assigned to host %d and it does not exist.\", event.name(), lb.getId(), lb.getHost().getId()));\n }\n\n if (hosts != null && !hosts.isEmpty()) {\n List<SnmpUsage> snmpUsages = new ArrayList<SnmpUsage>();\n for (Host h : hosts) {\n SnmpUsage snmpUsage = new SnmpUsage();\n snmpUsage.setHostId(h.getId());\n snmpUsage.setLoadbalancerId(lb.getId());\n snmpUsage.setBytesIn(0L);\n snmpUsage.setBytesInSsl(0L);\n snmpUsage.setBytesOutSsl(0L);\n snmpUsage.setBytesOut(0L);\n snmpUsages.add(snmpUsage);\n }\n usageEventProcessor.processUsageEvent(snmpUsages, lb, event, eventTime);\n } else {\n LOG.error(\"Hosts data invalid, this shouldn't happen... Verify DB for data and notify developer immediately. \");\n throw new UsageEventCollectionException(\"Hosts data invalid, please contact support.\");\n }\n }",
"public abstract void onProcess();",
"public void process(EventData event) throws Exception {\n\t\tevent.getDoc().put(\"dimm\", memory());\n\t\tevent.getDoc().put(\"battery\", batteries());\n\t\tevent.getDoc().put(\"chassis\", chassis());\n\t\tevent.getDoc().put(\"pwrsupplies\", pwrsupplies());\n\t\tevent.getDoc().put(\"storage\", storage());\n\t\tevent.getDoc().put(\"fans\", fans());\n\n\t}",
"public abstract void processEvent(Object event);",
"@Override\n\t\t\tpublic void onProcess(int process) {\n\t\t\t}",
"@Override\n\tpublic void processEvent(Event e) {\n\n\t}",
"@Override\n\t\tpublic synchronized void SubGHzEvent(SubGHzEventObject evt){\n\t\t\tif(evt.getEventType() == SubGHzEventObject.DATA_AVAILABLE){\n\t\t\t\tString inputLine;\n\t\t\t\ttry {\n\t\t\t\t\tinputLine=input.readLine();\n\t\t\t\t\tSystem.out.println(inputLine);\n\t\t\t\t} catch(Exception e) {\n\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"protected static void printUsage() {\n\t}",
"public static void getCpuUsage(){\r\n CPUmeasurement currentCpuUsage = new CPUmeasurement();\r\n cpuUsageList.add(currentCpuUsage);\r\n //CPUmeasurement.printCpuUsage(currentCpuUsage);\r\n }",
"EventUses createEventUses();",
"protected void additionalProcessing() {\n\t}",
"EventUse createEventUse();",
"public void handleSensorEvents(){\n\t}",
"public void updateStatisticsHandler(Object sender, Object arg) {\n\t\tif (sender.getClass() == CustomerArrivalEvent.class) {\n\t\t\tupdateStatsCAE();\n\t\t}else if(sender.getClass() == ServiceCompletionEvent.class){\n\t\t\tupdateStatsSCE((Customer) arg);\n\t\t}\n\t}",
"@Override\r\n\tpublic void processEvent() {\n\t\tint VolumeButtonEvent = (Integer) pdu.getRawPayload()[0];\r\n\t\t//System.out.println(\"number of objects \" + numObjects);\r\n\t}",
"public DataUsage getusageData(int uid)\n {\n Calendar calendar=Calendar.getInstance();\n long to=calendar.getTimeInMillis();\n calendar.add(Calendar.DAY_OF_MONTH,-30);\n long from=calendar.getTimeInMillis();\n\n double total=0;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {\n NetworkStatsManager service=context.getSystemService(NetworkStatsManager.class);\n NetworkStats bucket= null;\n try {\n bucket = service.queryDetailsForUid(ConnectivityManager.TYPE_WIFI,\"\",from,to,uid);\n double received=0;\n double send=0;\n\n //get the details along with the time of data usage of an application\n while (bucket.hasNextBucket())\n {\n NetworkStats.Bucket tempbucket=new NetworkStats.Bucket();\n bucket.getNextBucket(tempbucket);\n received=(double)tempbucket.getRxBytes()+received;\n send=(double)tempbucket.getTxBytes()+send;\n }\n bucket.close();\n DataUsage temp =new DataUsage();\n double uploaded=send/(1024*1024);\n double downloaded=received/(1024*1024);\n\n total=(received+send)/(1024*1024);\n\n temp.setDownload(\"\"+String.format(\"%.2f\",downloaded));\n temp.setUpload(\"\"+String.format(\"%.2f\",uploaded));\n temp.setTotal(\"\"+String.format(\"%.2f\",total));\n return temp;\n\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n\n }\n\n return null;\n }",
"void incUsage() {\n incUsage(1);\n }",
"@Override\n\tpublic void processItemInformation(ProcessItemInformationObjectEvent e, String message) {\n\t\t\n\t}",
"private void process () {\r\n\r\n ArrayList<String> anomaly;\r\n ArrayList<DataInfo> tmp = new ArrayList<>();\r\n int appState, screenState, screenOrientation, closeToObject, opID;\r\n long permissionCount;\r\n double scanDuration;\r\n String packageName, permission, accessTime;\r\n\r\n // get the data in the given scope (from offset, limit rows)\r\n Cursor cursor = sqliteDBHelper.get_data(\"SELECT \" + SqliteDBStructure.PACKAGE_NAME + \", \"\r\n + SqliteDBStructure.PERMISSION + \", \"\r\n + SqliteDBStructure.DATA_AGGREGATE + \".\" + SqliteDBStructure.ACCESS_TIME + \", \"\r\n + SqliteDBStructure.APP_STATE + \", \"\r\n + SqliteDBStructure.SCREEN_STATE + \", \"\r\n + SqliteDBStructure.SCREEN_ORIENTATION + \", \"\r\n + SqliteDBStructure.CLOSE_TO_OBJECT\r\n + \" FROM \" + SqliteDBStructure.DATA_AGGREGATE\r\n + \" JOIN \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \" ON \"\r\n + SqliteDBStructure.DATA_AGGREGATE + \".\" + SqliteDBStructure.ACCESS_TIME + \" = \" + SqliteDBStructure.INFO_AT_ACCESSTIME + \".\" + SqliteDBStructure.ACCESS_TIME\r\n + \" LIMIT \" + limit + \" OFFSET \" + offset);\r\n\r\n try {\r\n if (cursor != null) {\r\n cursor.moveToFirst();\r\n\r\n while (!cursor.isAfterLast()) {\r\n packageName = cursor.getString(cursor.getColumnIndexOrThrow(SqliteDBStructure.PACKAGE_NAME));\r\n opID = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.PERMISSION));\r\n permission = Permission.opIDToName(opID);\r\n accessTime = cursor.getString(cursor.getColumnIndexOrThrow(SqliteDBStructure.ACCESS_TIME));\r\n appState = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.APP_STATE));\r\n screenState = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.SCREEN_STATE));\r\n screenOrientation = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.SCREEN_ORIENTATION));\r\n closeToObject = cursor.getInt(cursor.getColumnIndexOrThrow(SqliteDBStructure.CLOSE_TO_OBJECT));\r\n\r\n permissionCount = DatabaseUtils.longForQuery(sqliteDBHelper.getReadableDatabase(), \"SELECT COUNT(*) FROM \" + SqliteDBStructure.DATA_AGGREGATE + \" WHERE \" + SqliteDBStructure.PACKAGE_NAME + \" = '\" + packageName + \"' \" + \" AND \" + SqliteDBStructure.PERMISSION + \" = '\" + opID + \"';\", null);\r\n\r\n //Scan duration in Minutes\r\n scanDuration = (((double) stop_scan_time.getTime() + (double) start_scan_time.getTime()) / 1000 )/ 60;\r\n //check for anomaly by ruleset class\r\n anomaly = RuleSet.checkForAnomaly(packageName, permission, permissionCount, appState, screenState, screenOrientation, closeToObject, scanDuration, context);\r\n\r\n //Send data to server or save it locally, if no valid internet connection is available\r\n if (networking) {\r\n sendRawData(packageName, permission, accessTime, appState, screenState, screenOrientation, closeToObject);\r\n if (anomaly.get(0).equals(\"1\"))\r\n MyClient.POST_Anomaly(packageName, permission, anomaly.get(1), \"0\");\r\n } else {\r\n saveRawData(packageName, permission, accessTime, appState, screenState, screenOrientation, closeToObject);\r\n if (anomaly.get(0).equals(\"1\"))\r\n saveAnomaliesImage(packageName, permission, anomaly.get(1), 0);\r\n }\r\n\r\n // create a info object which holds all the necessary information about that data block and store it temporarily in a list\r\n DataInfo info = new DataInfo(packageName, Permission.opIDToDescription(opID), accessTime, permissionCount, anomaly.get(0), anomaly.get(1), scanTime, 0);\r\n tmp.add(info);\r\n\r\n // should the size of the temporary list exceeds MaxBatchSize, write list to the local DB and clear the temp list afterwards \r\n // technically this cannot happen but we are working with threads here so better be safe than sorry\r\n // temp list should not be to big, because we have have to hold task amount of temp list, with each containing around MaxBatchSize entries, in memory at the same time\r\n if (tmp.size() > MaxBatchSize) {\r\n bulkInsertIntoDataAnalyzing(tmp);\r\n tmp.clear();\r\n }\r\n\r\n cursor.moveToNext();\r\n }\r\n\r\n }\r\n } finally {\r\n if (cursor != null) {\r\n cursor.close();\r\n }\r\n }\r\n\r\n // write the data stored in the temp list to the local DB \r\n if (tmp.size() > 0) {\r\n bulkInsertIntoDataAnalyzing(tmp);\r\n tmp.clear();\r\n }\r\n // inform the progress dialog that a task has been finished\r\n updateProgressDialog();\r\n // decrease the amount of ongoing tasks by 1\r\n decreaseTasks();\r\n }",
"final private static void usage () {\n\t\t usage_print () ;\n\t\t System.exit (0) ;\n }",
"public void testUidImportanceListener() throws Exception {\n final Parcel data = Parcel.obtain();\n ServiceConnectionHandler conn = new ServiceConnectionHandler(mContext, mServiceIntent,\n WAIT_TIME);\n ServiceConnectionHandler conn2 = new ServiceConnectionHandler(mContext, mService2Intent,\n WAIT_TIME);\n\n ActivityManager am = mContext.getSystemService(ActivityManager.class);\n\n ApplicationInfo appInfo = mContext.getPackageManager().getApplicationInfo(\n SIMPLE_PACKAGE_NAME, 0);\n UidImportanceListener uidForegroundListener = new UidImportanceListener(mContext,\n appInfo.uid, ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE, WAIT_TIME);\n\n InstrumentationRegistry.getInstrumentation().getUiAutomation().revokeRuntimePermission(\n STUB_PACKAGE_NAME, android.Manifest.permission.PACKAGE_USAGE_STATS);\n boolean gotException = false;\n try {\n uidForegroundListener.register();\n } catch (SecurityException e) {\n gotException = true;\n }\n assertTrue(\"Expected SecurityException thrown\", gotException);\n\n InstrumentationRegistry.getInstrumentation().getUiAutomation().grantRuntimePermission(\n STUB_PACKAGE_NAME, android.Manifest.permission.PACKAGE_USAGE_STATS);\n /*\n Log.d(\"XXXX\", \"Invoke: \" + cmd);\n Log.d(\"XXXX\", \"Result: \" + result);\n Log.d(\"XXXX\", SystemUtil.runShellCommand(getInstrumentation(), \"dumpsys package \"\n + STUB_PACKAGE_NAME));\n */\n uidForegroundListener.register();\n\n UidImportanceListener uidGoneListener = new UidImportanceListener(mContext,\n appInfo.uid, ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED, WAIT_TIME);\n uidGoneListener.register();\n\n WatchUidRunner uidWatcher = new WatchUidRunner(getInstrumentation(), appInfo.uid,\n WAIT_TIME);\n\n try {\n // First kill the processes to start out in a stable state.\n conn.bind();\n conn2.bind();\n IBinder service1 = conn.getServiceIBinder();\n IBinder service2 = conn2.getServiceIBinder();\n conn.unbind();\n conn2.unbind();\n try {\n service1.transact(IBinder.FIRST_CALL_TRANSACTION, data, null, 0);\n } catch (RemoteException e) {\n }\n try {\n service2.transact(IBinder.FIRST_CALL_TRANSACTION, data, null, 0);\n } catch (RemoteException e) {\n }\n service1 = service2 = null;\n\n // Wait for uid's processes to go away.\n uidGoneListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // And wait for the uid report to be gone.\n uidWatcher.waitFor(WatchUidRunner.CMD_GONE, null);\n\n // Now bind and see if we get told about the uid coming in to the foreground.\n conn.bind();\n uidForegroundListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // Also make sure the uid state reports are as expected. Wait for active because\n // there may be some intermediate states as the process comes up.\n uidWatcher.waitFor(WatchUidRunner.CMD_ACTIVE, null);\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_FG_SERVICE);\n\n // Pull out the service IBinder for a kludy hack...\n IBinder service = conn.getServiceIBinder();\n\n // Now unbind and see if we get told about it going to the background.\n conn.unbind();\n uidForegroundListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n uidWatcher.waitFor(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n // Now kill the process and see if we are told about it being gone.\n try {\n service.transact(IBinder.FIRST_CALL_TRANSACTION, data, null, 0);\n } catch (RemoteException e) {\n // It is okay if it is already gone for some reason.\n }\n\n uidGoneListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n uidWatcher.expect(WatchUidRunner.CMD_IDLE, null);\n uidWatcher.expect(WatchUidRunner.CMD_GONE, null);\n\n // Now we are going to try different combinations of binding to two processes to\n // see if they are correctly combined together for the app.\n\n // Bring up both services.\n conn.bind();\n conn2.bind();\n uidForegroundListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // Also make sure the uid state reports are as expected.\n uidWatcher.waitFor(WatchUidRunner.CMD_ACTIVE, null);\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_FG_SERVICE);\n\n // Bring down one service, app state should remain foreground.\n conn2.unbind();\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // Bring down other service, app state should now be cached. (If the processes both\n // actually get killed immediately, this is also not a correctly behaving system.)\n conn.unbind();\n uidGoneListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n uidWatcher.waitFor(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n // Bring up one service, this should be sufficient to become foreground.\n conn2.bind();\n uidForegroundListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_FG_SERVICE);\n\n // Bring up other service, should remain foreground.\n conn.bind();\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // Bring down one service, should remain foreground.\n conn.unbind();\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // And bringing down other service should put us back to cached.\n conn2.unbind();\n uidGoneListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n uidWatcher.waitFor(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n } finally {\n data.recycle();\n uidWatcher.finish();\n uidForegroundListener.unregister();\n uidGoneListener.unregister();\n }\n }",
"private static void collectProfilingData() throws ClassNotFoundException, IOException{\r\n\r\n //TODO - clean lists in each iteration (when data packet is received)\r\n List<MemoryMeasurement> memoryData;\r\n List<CPUmeasurement> cpuData;\r\n List<ThreadMeasurement> threadData;\r\n List<ClassMeasurement> classData;\r\n Map<String, TimeMeasurement> methodRunList;\r\n String message = null;\r\n\r\n do{\r\n message = (String)serverObjectInputStream.readObject();\r\n\r\n if(message.equals(\"DATA\")){\r\n System.out.println(\"Server: packet received: \" + message);\r\n\r\n ProfilingPacketType.deserializePacket();\r\n memoryData = ProfilingPacketType.memoryUsageList;\r\n //System.out.println(\"MemoryData: \" + memoryData);\r\n ProfilingMemoryPage.prepareMemoryData(memoryData);\r\n cpuData = ProfilingPacketType.cpuUsageList;\r\n ProfilingCPUPage.prepareData(cpuData);\r\n //printCpuData(cpuData);\r\n threadData = ProfilingPacketType.threadList;\r\n ProfilingThreadsPage.prepareData(threadData);\r\n //System.out.println(\"Received thread data: \" + threadData.size());\r\n classData = ProfilingPacketType.classUsageList;\r\n ProfilingClassesPage.prepareData(classData);\r\n //System.out.println(classData.size());\r\n methodRunList = ProfilingPacketType.methodTimeList;\r\n ProfilingMethodsPage.prepareData(methodRunList);\r\n //printMethodRuns(methodRunList);\r\n\r\n ProfilingOverviewPage.getProfilingData();\r\n ProfilingVMSummaryPage.collectVMData();\r\n\r\n }\r\n\r\n }while (!message.equals(Attributes.PROFILING_PACKET_MESSAGE_TERMINATE));\r\n throw new EOFException(\"Agent has finished it's job.\");\r\n }",
"public static void getClassUsage(){\r\n ClassMeasurement classMeasurement = new ClassMeasurement();\r\n classUsageList.add(classMeasurement);\r\n //ClassMeasurement.printClassMeasurement(classMeasurement);\r\n }",
"void parseEventList() {\n\t\tfor (int eventsId : events.keySet()) {\n\t\t\tfinal Event event = events.get(eventsId);\n\t\t\tif (users.get(event.getUser().getName()).isActiveStatus()\n\t\t\t\t\t&& !event.isViewed()\n\t\t\t\t\t&& event.getInnerSisdate().compareTo(\n\t\t\t\t\t\t\tnew GregorianCalendar()) >= 0) {\n\t\t\t\tevent.setViewed(true);\n\t\t\t\tfinal SimpleDateFormat fm = new SimpleDateFormat(\n\t\t\t\t\t\t\"dd.MM.yyyy-HH:mm:ss\");\n\t\t\t\tt.schedule(new TimerTask() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tif (event.isActive()) {\n\t\t\t\t\t\t\tgenerateEventMessage(\"User \"\n\t\t\t\t\t\t\t\t\t+ event.getUser().getName()\n\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t+ fm.format(event.getInnerSisdate()\n\t\t\t\t\t\t\t\t\t\t\t.getTime()) + \" \" + event.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, event.getInnerSisdate().getTime());\n\n\t\t\t}\n\t\t}\n\n\t}",
"private void collectCpuMemoryUsage(){\r\n\t\tHmDomain hmDomain = CacheMgmt.getInstance().getCacheDomainByName(\"home\");\r\n\t\tfloat cpuUsage = LinuxSystemInfoCollector.getInstance().getCpuInfo() * 100;\r\n\t\tfloat memoryUsage = 0;\r\n\t\ttry {\r\n\t\t\tlong count[] = LinuxSystemInfoCollector.getInstance().getMemInfo();\r\n\t\t\tif(count[0] != 0){\r\n\t\t\t\tmemoryUsage = ((float)(count[0] - count[1] - count[2] - count[3]) * 100 / count[0]);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tBeLogTools.error(HmLogConst.M_PERFORMANCE,\"calculate memory usage failure.\", e);\r\n\t\t}\r\n\t\tCpuMemoryUsage cmu = new CpuMemoryUsage();\r\n\t\tcmu.setCpuUsage(cpuUsage);\r\n\t\tcmu.setMemUsage(memoryUsage);\r\n\t\tcmu.setOwner(hmDomain);\r\n\t\tcmu.setTimeStamp((new Date()).getTime());\r\n\t\ttry {\r\n\t\t\tQueryUtil.createBo(cmu);\r\n\t\t} catch (Exception e) {\r\n\t\t\tBeLogTools.error(HmLogConst.M_PERFORMANCE,\"create CpuMemoryUsage failure.\", e);\r\n\t\t}\r\n\t}",
"@Override\n public void onEvent(Event event) {\n if (event.getClass() != MessageReceivedEvent.class)\n return;\n MessageReceivedEvent msgEvent = (MessageReceivedEvent) event;\n\n String threadName = Thread.currentThread().getName();\n\n for (Command command : commands) {\n if (!command.match(msgEvent))\n continue;\n\n LOG.info(\"Dispatching event to command {}\", command);\n\n // Metrics\n METRICS_RUNNING.labels(command.toString(), threadName)\n .inc();\n Histogram.Timer timer = METRICS_LATENCY.labels(command.toString(), threadName)\n .startTimer();\n\n // Invoke\n Object ret = null;\n try {\n ret = command.getMethod().invoke(command.getInstance(), event);\n } catch (InvocationTargetException ex) {\n // Exception in listener's code\n //todo better logging\n LOG.error(ex.getTargetException());\n continue;\n } catch (IllegalAccessException ex) {\n // Should never happen\n throw new RuntimeException(ex);\n } finally {\n // Metrics\n Runnable endMetrics = () -> {\n LOG.debug(\"Finished dispatching event for {}\", command);\n METRICS_RUNNING.labels(command.toString(), threadName)\n .dec();\n timer.observeDuration();\n };\n\n if (ret instanceof CompletionStage) {\n CompletionStage<?> future = (CompletionStage<?>) ret;\n future.thenRunAsync(endMetrics);\n } else {\n endMetrics.run();\n }\n }\n }\n }",
"@Override\n public void run() {\n MemUsage memUsage = new MemUsage();\n Runtime run = Runtime.getRuntime();\n String memPath = \"/proc/\" + processId + \"/status\";\n LOG.info(\"Reading the file for memory: \" + memPath);\n String currentTime;\n File statusFile;\n float pcpu;\n int pmem;\n ProcessInfoBean processInfoBean = new ProcessInfoBean();\n processInfoBean.setLocalHostIp(ip);\n processInfoBean.setProceeName(processName);\n while (running) {\n pcpu = getCPUUsageByTopCommond(run, cmd);\n if (pcpu != -1) {\n statusFile = new File(memPath);\n if (statusFile.exists()) {\n pmem = memUsage.getMemUsage(statusFile);\n if (pmem != -1) {\n currentTime = TimeUtils.getCurrentTime();//获取系统当前时间\n processInfoBean.setUpdateTime(currentTime);\n processInfoBean.setCpuUsage(pcpu);\n processInfoBean.setMemUsage(pmem);\n processInfoBean.setPid(Integer.parseInt(processId));\n processInfoDao.insert_process_monitor(processInfoBean);\n MybatisUtils.session.commit();\n try {\n Thread.sleep(intervalTime);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }\n }\n }\n }",
"private void updateStatsCAE(){\n\t\tupdateQueueSize();\n\t}",
"private void eventProcessingStarted() {\n\t\tsynchronized(processingCounterMutex) {\n\t\t\tprocessingCounter++;\n\t\t}\n\t}",
"public interface MonitoringEventListener {\n\n /**\n * Callback for received STDOUT lines.\n * \n * @param line stdout line\n */\n void appendStdout(String line);\n\n /**\n * Callback for received STDERR lines.\n * \n * @param line stderr line\n */\n void appendStderr(String line);\n\n /**\n * Callback for additional user information lines (validation, progress, ...).\n * \n * @param line information line\n */\n void appendUserInformation(String line);\n}",
"protected void onTick() {\n\t\t\t\tDFAgentDescription template = new DFAgentDescription();\r\n\t\t\t\tServiceDescription sd = new ServiceDescription();\r\n\t\t\t\tsd.setType(\"TractorDT\");\r\n\t\t\t\ttemplate.addServices(sd);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tDFAgentDescription[] result = DFService.search(myAgent, template);\r\n\t\t\t\t\tDTAgents = new AID[result.length];\r\n\t\t\t\t\tfor (int i = 0; i < result.length; ++i) {\r\n\t\t\t\t\t\tDTAgents[i] = result[i].getName();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (FIPAException fe) {\r\n\t\t\t\t\tfe.printStackTrace();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//System.out.println(\"DigitalTwin request being performed\");\r\n\t\t\t\t// Perform a Fuel Usage request\r\n\t\t\t\tmyAgent.addBehaviour(new DataRequestPerformer());// add behaviour here)\r\n\t\t\t}",
"void handleEvent(int event, String remainder) {\n switch (event) {\n case DISCONNECTED:\n handleNetworkStateChange(NetworkInfo.DetailedState.DISCONNECTED, remainder);\n break;\n\n case CONNECTED:\n handleNetworkStateChange(NetworkInfo.DetailedState.CONNECTED, remainder);\n break;\n\n case SCAN_RESULTS:\n mWifiStateTracker.notifyScanResultsAvailable();\n break;\n\n case TERMINATING:\n supplicantConnected = false;\n mWifiStateTracker.notifySupplicantLost();\n break;\n\n case UNKNOWN:\n break;\n }\n }",
"public void onEvent(EventIterator events) {\n\n }",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t\t \n\t\t\t}",
"public void processOffers(List<OfferPublishedEvent> events) {\n }",
"private void updateCpuStats() {\n\t\tmNumStatsUpdated = 0;\n\t\tList<String> stats = ShellHelper.getProc(CPU_STAT_PROC);\n\t\tif (stats == null || stats.isEmpty()) return;\n\t\t\n\t\tString[] parts = null;\n\t\tString line = null;\n\t\tfor (int i = 0; i < stats.size(); ++i) {\n\t\t\tline = stats.get(i);\n\t\t\tif (line.startsWith(\"cpu\")) { //TODO if 0% usage the cpu is omitted\n\t\t\t\tparts = line.split(\"\\\\s+\");\t\t\t\t\n\t\t\t\tif (parts[0].endsWith(String.valueOf(i - 1))) {\n\t\t\t\t\tif (mLogicalCpus.size() >= i &&\n\t\t\t\t\t\t\tmLogicalCpus.get(i - 1).getCpuStat().update(parts)) {\t\t\t\t\t\n\t\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mCpuStat.update(parts)) {\n\t\t\t\t\t++mNumStatsUpdated;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic void accept(GCSEvent event, Context context) {\n\t\tlogger.info(\"Processing file: \" + event.name);\n\n\t\t//Set the source for file to be processed\n\t\tImageSource src = ImageSource.newBuilder().setImageUri(\"gs://\" + event.bucket + \"/\" + event.name).build();\n\t\tImage img = Image.newBuilder().setSource(src).build();\n\n\t\tList<String> labels = getLabels(img);\n\t\t\n\t\tif (labels != null) {\n\t\t\tpublishLabels(event.name, labels);\n\t\t} else {\n\t\t\tlogger.log(Level.SEVERE, \"Unable to publish labels\");\n\t\t}\n\t}",
"private void doEvents() {\n\t\tapplyEvents(generateEvents());\t\t\n\t}",
"public void checkEvents()\n\t{\n\t\t((MBoxStandalone)events).processMessages();\n\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\n\t\t\t}",
"@Override\r\n\tprotected void processInWifiEvent(InWifiEvent arg0) {\n\t\t\r\n\t}",
"@objid (\"f29e2e4a-e5e9-43fa-b193-525c198df148\")\n EList<Message> getUsage();",
"@Override\n public void ProcessEvent(XMSEvent evt){\n FunctionLogger logger=new FunctionLogger(\"ProcessEvent\",this,myLogger);\n logger.args(evt);\n if(evt.getCall() == myInboundCall){\n ProcessInboundEvent(evt);\n } else if(evt.getCall() == myOutboundCall){\n ProcessOutboundEvent(evt);\n } else{\n logger.error(\"Event Received for an unknown Call. Ignoring\");\n }\n \n }",
"public DGUsage getUsage() {\n return usage_;\n }",
"public void handle(Object e){\n\t\tif(e.getClass().equals(GetResultRequestEvent.class)){\n\t\t\tgetResults((GetResultRequestEvent)e);\n\t\t}else if(e.getClass().equals(RefreshAllDataEvent.class)){\n\t\t\ttf.getData(app);\n\t\t}else if(e.getClass().equals(ExportDataEvent.class)){\n\t\t\ttf.exportItemDB();\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}",
"@Override\n\t\t\tpublic void handleEvent(Event event) {\n\t\t\t}",
"public XmlWorkerUserstats(){\r\n \t\tthis.statsDS = new UserstatsDS();\r\n \t\titemResolver = new hModItemResolver(new File(statsDS.getDataFolder(),\"items.txt\"));\r\n \t\tresolveCats = new String[]{\"blockdestroy\", \"blockcreate\", \"itemdrop\", \"itempickup\"};\r\n \t}",
"@Override\r\n\tprotected void processTakeout() {\n\r\n\t}",
"@Override\r\n\tprotected void processTakeout() {\n\r\n\t}",
"void postEvent(final StorageManagerEvent event)\n {\n // Notify all listeners. Use a local copy of the ccList so it does not\n // change while we are using it.\n CallerContext ccList = this.ccList;\n if (ccList != null)\n {\n // Execute the runnable in each caller context in ccList\n ccList.runInContext(new Runnable()\n {\n public void run()\n {\n // Notify listeners. Use a local copy of data so that it\n // does not change while we are using it.\n CallerContextManager ccm = (CallerContextManager) ManagerManager.getInstance(CallerContextManager.class);\n CallerContext cc = ccm.getCurrentContext();\n CCData data = getCCData(cc);\n if ((data != null) && (data.listeners != null)) data.listeners.notifyChange(event);\n }\n });\n }\n }",
"private void createEvents() {\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tmCpuinfo = ShellHelper.getProc(CPU_INFO_PROC);\n\t\t\t\tupdateCpuStats();\n\t\t\t\tfor (LogicalCpu c : mLogicalCpus) {\n\t\t\t\t\tc.updateFrequency();\n\t\t\t\t\tc.updateGovernor();\n\t\t\t\t\tc.updateTimeInFrequency();\n\t\t\t\t\tc.updateTotalTransitions();\n\t\t\t\t}\n\t\t\t}",
"public Long usage() {\n return this.usage;\n }",
"public void service(Event event)\n\t{\n\t\tif(event instanceof SystemReady)\n\t\t\tsystemReady();\n\n\t\tif(event instanceof ExecDoneEvent)\n\t\t\texecDone((ExecDoneEvent)event);\n\n\t\tif(event instanceof ExecPlanEvent)\n\t\t\tservicePlan();\n\t}",
"public static void performanceCountEnable(int event) { }",
"private void updateOsMetrics()\n {\n Driver.updateOsMetric();\n }",
"void inProcessing(String statusMsg);",
"void onBusEvent(Event event);",
"public void processEvent(Packet packet) {\r\n\t\tint eventCode = packet.eventCode;\r\n\t\t\r\n\t\tswitch(eventCode) {\r\n\t\t\tcase 0: registerPeer(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 2: insertFile(packet);\r\n\t\t\t //forwardPacket(packet);\r\n\t\t\t break;\r\n\t\t\tcase 3: findFile(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 4: processFileLocation(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 5: fileTransferReq(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 6: recFile(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 7: passingDHT(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 8: peerQuitting(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 9: updateDHTPeerQuit(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"@Before\n public void setUp() {\n meter = new Meter<Events>(Events.values());\n //// set up some metrics that you want to track\n // sum of all puts to the read counter (total bytes read)\n meter.addCountMetric(Events.bytes_read, \"totalBytesReceived\");\n // max read size\n meter.addMaxMetric(Events.bytes_read, \"maxReadSize\");\n // average read size\n meter.addAverageMetric(Events.bytes_read, \"avgReadSize\");\n // rate metric = count / time since last reset (bytes read per second)\n meter.addRateMetric(Events.bytes_read, \"inBPS\");\n }",
"public void reportGlobalUsageEventLocked(int event) {\n synchronized (this.mService) {\n try {\n ActivityManagerService.boostPriorityForLockedSection();\n this.mService.reportGlobalUsageEventLocked(event);\n } catch (Throwable th) {\n while (true) {\n ActivityManagerService.resetPriorityAfterLockedSection();\n throw th;\n }\n }\n }\n ActivityManagerService.resetPriorityAfterLockedSection();\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String name = request.getParameter(GenericConstants.COMPONENT_PNAME);\n \n RealTimeSUStateHelper suRTHelper = new RealTimeSUStateHelper(name);\n String responseData = suRTHelper.getServiceUnitsState();\n response.setStatus(HttpServletResponse.SC_OK);\n response.setHeader(RealTimeStatisticServlet.CONTENT_TYPE_HEADER, \n RealTimeStatisticServlet.CONTENT_TYPE_VALUE);\n response.setHeader(RealTimeStatisticServlet.CACHE_CONTROL_HEADER, \n RealTimeStatisticServlet.CACHE_CONTROL_VALUE);\n \n // Write out the message on the response stream\n OutputStream outputStream = response.getOutputStream();\n try {\n outputStream.write(responseData.getBytes());\n } catch (IOException e2) {\n }\n outputStream.flush();\n \n }",
"public void onEventMainThread(BaseEvent unused) {\n }",
"private StatisticsEvent(Manager manager, Restaurant res) {\n\t\tsuper(TYPE.STATISTICS, res);\n\t\tthis.manager = manager;\n\t}",
"@Override\r\n\t\t\tpublic void handle(final HttpServerRequest req) {\n\t\t\t\tString startTime = \"1355562000000\"; //--multi-dist\r\n\t\t\t\tIterator<EventInfo> iter = \r\n\t\t\t\t\t\tdataService.events()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(EventInfo.class).iterator();\r\n\t\t\t\tEventCounter multiCounter = new EventCounter(\"/multi\");\r\n\t\t\t\tint processed = 0;\r\n\t\t\t\twhile (iter.hasNext() && processed < limit) {\r\n\t\t\t\t\tEventInfo event = iter.next();\r\n\t\t\t\t\tmultiCounter.countEvent(event);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treq.response.setChunked(true);\r\n\t\t\t\tmultiCounter.printDistance(req, \"multidist\");\r\n\t\t\t\t//multiCounter.printResponse(req, \"multidist\");\r\n\t\t\t\t//use response time data\r\n\t\t\t\tIterator<ResponseInfo> respIter = \r\n\t\t\t\t\t\tdataService.response()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(ResponseInfo.class).iterator();\r\n\t\t\t\tResponseCounter responseCounter = new ResponseCounter();\r\n\t\t\t\tprocessed = 0;\r\n\t\t\t\twhile (respIter.hasNext() && processed < limit) {\r\n\t\t\t\t\tResponseInfo resp = respIter.next();\r\n\t\t\t\t\tresponseCounter.count(resp);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\tresponseCounter.printResponse(req, \"multidist\");\r\n\r\n\t\t\t\treq.response.end();\r\n\t\t\t}",
"@Override\n public Text getUsage(CommandSource source) {\n return usage;\n }",
"public void processEvent(SimEvent ev) {\n switch(ev.getTag()) {\n case OBSERVE: //It is my custom event\n //I must observe the datacenter\n balanceLoadCheck();\n //Observation loop, re-observe in `delay` seconds\n send(this.getId(), delay, OBSERVE, null);\n }\n }",
"private void handleAnalysis()\n {\n try {\n InstanceInfo instances = scaler.getInstanceInfo(serviceRef);\n if (handleMemoryLoadIssues(instances)) {\n return;\n }\n governor.recordInstances(serviceRef, instances);\n ScalingAction action;\n if (firstRun) {\n LOG.info(\"Performing initial scaling checks for service {}\", serviceRef);\n action = handleFirstRun(instances);\n firstRun = false;\n } else {\n LOG.debug(\"Scaling checks for service {}\", serviceRef);\n action = analyser.analyseWorkload(instances);\n }\n\n action = governor.govern(serviceRef, action);\n\n switch (action.getOperation()) {\n case SCALE_UP:\n scaleUp(instances, action.getAmount());\n break;\n case SCALE_DOWN:\n scaleDown(instances, action.getAmount());\n break;\n case NONE:\n default:\n break;\n }\n } catch (ScalerException e) {\n LOG.warn(\"Failed analysis run for service {}\", serviceRef, e);\n }\n }",
"public void processEvent(GovernanceEngineEvent event)\n {\n if (listener != null)\n {\n // todo\n }\n }",
"public static void getMemoryUsage(){\r\n MemoryMeasurement actMemoryStatus = new MemoryMeasurement();\r\n //MemoryMeasurement.printMemoryUsage(actMemoryStatus);\r\n memoryUsageList.add(actMemoryStatus);\r\n }",
"@Override\r\n\tpublic void onEvent(Event arg0) {\n\r\n\t}",
"protected void ProcessOutboundEvent(XMSEvent evt){\n switch(evt.getEventType()){\n case CALL_CONNECTED:\n System.out.println(\"***** Outbound call connected *****\");\n SetOutboundCallState(OutboundCallStates.CALLCONNECTED);\n ConnectCalls();\n break;\n case CALL_RECORD_END:\n \n break; \n case CALL_SENDDTMF_END:\n System.out.println(\"***** END_DTMF *****\");\n System.out.println(\"***** ReJoin Calls *****\");\n ConnectCalls();\n \n break; \n case CALL_DTMF:\n \n System.out.println(\"***** outbound CALL_DTMF *****\");\n System.out.println(\"data=\" + evt.getData());\n myInboundCall.SendInfo(\"DTMF_\" + evt.getData());\n \n break; \n case CALL_INFO:\n \n System.out.println(\"***** Outbound CALL_INFO *****\");\n System.out.println(\"data=\" + evt.getData());\n myInboundCall.SendInfo(evt.getData());\n\n break;\n case CALL_PLAY_END:\n //May need to do something here\n break;\n case CALL_DISCONNECTED: // The far end hung up will simply wait for the media\n System.out.println(\"***** outbound CALL_Disconnected *****\");\n DisconnectCalls();\n break;\n default:\n System.out.println(\"Unknown Event Type!!\");\n }\n }",
"private EventsCollector() {\n\t\tsuper();\n\t}",
"@Override\n\tprotected void processPostUpdateStream(KStream<String, Event> events) {\n\n\t}",
"private void onAccess() {\n ctx.itHolder().checkWeakQueue();\n\n checkRemoved();\n }"
] | [
"0.6379818",
"0.6077357",
"0.6050395",
"0.5982814",
"0.5928744",
"0.59066266",
"0.58811396",
"0.5856947",
"0.5754626",
"0.5689704",
"0.5653257",
"0.56286085",
"0.5625844",
"0.5613909",
"0.55950487",
"0.5581968",
"0.5569089",
"0.55410826",
"0.55337733",
"0.5507083",
"0.5472094",
"0.54507315",
"0.5430108",
"0.54281306",
"0.5410409",
"0.53646827",
"0.5360878",
"0.535329",
"0.534056",
"0.5330348",
"0.5302094",
"0.5293848",
"0.52736026",
"0.526924",
"0.5262562",
"0.52579814",
"0.5251086",
"0.5250147",
"0.52440226",
"0.52206945",
"0.52145165",
"0.52129185",
"0.5206328",
"0.5201771",
"0.5191231",
"0.5187819",
"0.5179816",
"0.51779145",
"0.51766",
"0.51684815",
"0.5165719",
"0.5159369",
"0.5159369",
"0.51524854",
"0.51503617",
"0.51467675",
"0.51466465",
"0.5145203",
"0.5142678",
"0.5142678",
"0.5142678",
"0.5142678",
"0.5142678",
"0.5130797",
"0.5122779",
"0.5120518",
"0.51180553",
"0.51147133",
"0.5105491",
"0.5105491",
"0.5105491",
"0.5098707",
"0.5086342",
"0.5086342",
"0.5083909",
"0.50838834",
"0.5061422",
"0.5059488",
"0.5059002",
"0.50543475",
"0.5052485",
"0.50491434",
"0.50460297",
"0.5037326",
"0.50336874",
"0.5032822",
"0.5031644",
"0.50264096",
"0.5020589",
"0.5017869",
"0.50162643",
"0.5016008",
"0.5015264",
"0.50132024",
"0.50121534",
"0.5009745",
"0.5008423",
"0.49954617",
"0.4994911",
"0.49936885"
] | 0.61642206 | 1 |
Used to process events that will not have usage, such as Create event with specified hosts. | public void processZeroUsageEvent(LoadBalancer lb, UsageEvent event, Calendar eventTime) throws UsageEventCollectionException {
List<Host> hosts = null;
try {
hosts = gatherHostsData(lb);
} catch (EntityNotFoundException e) {
LOG.error(String.format("On %s event, load balancer %d was assigned to host %d and it does not exist.", event.name(), lb.getId(), lb.getHost().getId()));
}
if (hosts != null && !hosts.isEmpty()) {
List<SnmpUsage> snmpUsages = new ArrayList<SnmpUsage>();
for (Host h : hosts) {
SnmpUsage snmpUsage = new SnmpUsage();
snmpUsage.setHostId(h.getId());
snmpUsage.setLoadbalancerId(lb.getId());
snmpUsage.setBytesIn(0L);
snmpUsage.setBytesInSsl(0L);
snmpUsage.setBytesOutSsl(0L);
snmpUsage.setBytesOut(0L);
snmpUsages.add(snmpUsage);
}
usageEventProcessor.processUsageEvent(snmpUsages, lb, event, eventTime);
} else {
LOG.error("Hosts data invalid, this shouldn't happen... Verify DB for data and notify developer immediately. ");
throw new UsageEventCollectionException("Hosts data invalid, please contact support.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void handleEvents(List<Event> processorEvents) {\n\n }",
"private void createEvents() {\n\t}",
"public void processOffers(List<OfferPublishedEvent> events) {\n }",
"@Override\n public void processDeleteHostEventBefore(final Host host) {\n\n }",
"public void removeEvents(){\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n List<EventTrigger> eventTriggers = new ArrayList<EventTrigger>(eventGroup.getValue());\n for(EventTrigger trigger : eventTriggers){\n if(trigger.getServer()==this) { // do not send own events...\n ESRemoveEvent esre = new ESRemoveEvent(annotation, trigger.getTrigger());\n for(EventShare es : EventShare.getEventShareServers()){\n if(es!=this) {\n if (es.isShareOut()) {\n try {\n es.getEventBusServer().write(esre);\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n }\n }\n HandlerRegistry.getHandlers().get(eventGroup.getKey()).remove(trigger);\n System.out.println(HandlerRegistry.getHandlers());\n }\n }\n }\n }",
"private void createEvents()\r\n\t{\r\n\t\teventsCount.add(new Event(RequestMethod.PUT, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.GET, 0));\r\n\t\teventsCount.add(new Event(RequestMethod.POST, 0));\r\n\t}",
"public void processEvents(Events events) {\n\n log.info(\"events processed: [{}]\", events.toString());\n }",
"private void queryEvents() {\n ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n // include data referred by user key\n query.include(Event.KEY_HOST);\n // limit query to latest 20 items\n query.setLimit(30);\n // order posts by creation date (newest first)\n query.addDescendingOrder(\"createdAt\");\n // start an asynchronous call for events\n query.findInBackground(new FindCallback<Event>() {\n @Override\n public void done(List<Event> events, com.parse.ParseException e) {\n\n // check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n\n // for debugging purposes let's print every event description to logcat\n for (Event event : events) {\n Log.i(TAG, \"Event: \" + event.getDescription() + \", username: \" + event.getHost().getUsername());\n }\n\n // save received events to list and notify adapter of new data\n allEvents.addAll(events);\n }\n\n });\n }",
"public void UnPostAllEvents();",
"public void transmitEvents(){\n Log.info(\"Transmitting Events\", EventShare.class);\n for(Entry<Class, List<EventTrigger>> eventGroup: HandlerRegistry.getHandlers().entrySet()){\n String annotation = eventGroup.getKey().getName();\n for(EventTrigger trigger : eventGroup.getValue()){\n if(trigger.getServer()!=this) { // do not send own events...\n if(trigger.getMethod()!=null){ // its a local event\n if(trigger.getMethod().isAnnotationPresent(ES.class)){\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }else {\n try {\n eventBusServer.write(new ESSharedEvent(annotation, trigger.getTrigger()));\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }\n }\n }",
"void processEvents() throws NotConnectedException\n\t{\n\t\tboolean requestResume = false;\n\t\tboolean requestHalt = m_requestHalt;\n\n\t\twhile(m_session != null && m_session.getEventCount() > 0)\n\t\t{\n\t\t\tDebugEvent e = m_session.nextEvent();\n\n\t\t\tif (e instanceof TraceEvent)\n\t\t\t{\n\t\t\t\tdumpTraceLine(e.information);\n\t\t\t}\n\t\t\telse if (e instanceof SwfLoadedEvent)\n\t\t\t{\n\t\t\t\thandleSwfLoadedEvent((SwfLoadedEvent)e);\n\t\t\t}\n\t\t\telse if (e instanceof SwfUnloadedEvent)\n\t\t\t{\n\t\t\t\thandleSwfUnloadedEvent((SwfUnloadedEvent)e);\n\t\t\t}\n\t\t\telse if (e instanceof BreakEvent)\n\t\t\t{\n\t\t\t\t// we ignore these for now\n\t\t\t}\n\t\t\telse if (e instanceof FileListModifiedEvent)\n\t\t\t{\n\t\t\t\t// we ignore this\n\t\t\t}\n\t\t\telse if (e instanceof FunctionMetaDataAvailableEvent)\n\t\t\t{\n\t\t\t\t// we ignore this\n\t\t\t}\n\t\t\telse if (e instanceof FaultEvent)\n\t\t\t{\n\t\t\t\tif ( handleFault((FaultEvent)e) )\n\t\t\t\t\trequestResume = true;\n\t\t\t\telse\n\t\t\t\t\trequestHalt = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\t\targs.put(\"type\", e); //$NON-NLS-1$\n\t\t\t\targs.put(\"info\", e.information); //$NON-NLS-1$\n\t\t\t\terr(getLocalizationManager().getLocalizedTextString(\"unknownEvent\", args)); //$NON-NLS-1$\n\t\t\t}\n\t\t}\n\n\t\t// only if we have processed a fault which requested a resume and no other fault asked for a break\n\t\t// and we are suspended and it was due to us that the stop occurred!\n\t\tif (requestResume && !requestHalt && m_session.isSuspended() && m_session.suspendReason() == SuspendReason.Fault)\n\t\t\tm_requestResume = true;\n\t}",
"@Override\n public synchronized void processEvent(GovernanceEngineEvent event)\n {\n if ((listenerMap != null) && (event != null))\n {\n for (String connectorId : listenerMap.keySet())\n {\n if (connectorId != null)\n {\n WatchdogListener watchdogListener = listenerMap.get(connectorId);\n\n if (watchdogListener != null)\n {\n watchdogListener.processEvent(event);\n }\n }\n }\n }\n }",
"public void processEvent(Event event) {\n\t\t\n\t}",
"void parseEventList() {\n\t\tfor (int eventsId : events.keySet()) {\n\t\t\tfinal Event event = events.get(eventsId);\n\t\t\tif (users.get(event.getUser().getName()).isActiveStatus()\n\t\t\t\t\t&& !event.isViewed()\n\t\t\t\t\t&& event.getInnerSisdate().compareTo(\n\t\t\t\t\t\t\tnew GregorianCalendar()) >= 0) {\n\t\t\t\tevent.setViewed(true);\n\t\t\t\tfinal SimpleDateFormat fm = new SimpleDateFormat(\n\t\t\t\t\t\t\"dd.MM.yyyy-HH:mm:ss\");\n\t\t\t\tt.schedule(new TimerTask() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tif (event.isActive()) {\n\t\t\t\t\t\t\tgenerateEventMessage(\"User \"\n\t\t\t\t\t\t\t\t\t+ event.getUser().getName()\n\t\t\t\t\t\t\t\t\t+ \" \"\n\t\t\t\t\t\t\t\t\t+ fm.format(event.getInnerSisdate()\n\t\t\t\t\t\t\t\t\t\t\t.getTime()) + \" \" + event.getText());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, event.getInnerSisdate().getTime());\n\n\t\t\t}\n\t\t}\n\n\t}",
"@Override\n public void processPrepareMaintenaceEventBefore(final Long hostId) {\n\n }",
"private void initEvents() {\r\n\t\teventPool = new EventPool();\r\n\t\teventPool.addEvent(new BlockGeneratorEvent(this));\r\n\t\teventPool.addEvent(new BlockOffScreenEvent(this));\r\n\t\teventPool.addEvent(new DeathEvent(myDropThis, this));\r\n\t}",
"@Test\n public void testDuoEvent() throws Exception {\n String processId = \"test\";\n deploy(new ProcessDefinition(processId, Arrays.<AbstractElement>asList(\n new StartEvent(\"start\"),\n new SequenceFlow(\"f1\", \"start\", \"gw1\"),\n new InclusiveGateway(\"gw1\"),\n\n new SequenceFlow(\"f2\", \"gw1\", \"ev1\"),\n new IntermediateCatchEvent(\"ev1\", \"ev1\"),\n new SequenceFlow(\"f3\", \"ev1\", \"gw2\"),\n\n new SequenceFlow(\"f4\", \"gw1\", \"ev2\"),\n new IntermediateCatchEvent(\"ev2\", \"ev2\"),\n new SequenceFlow(\"f5\", \"ev2\", \"gw2\"),\n\n new InclusiveGateway(\"gw2\"),\n new SequenceFlow(\"f6\", \"gw2\", \"end\"),\n new EndEvent(\"end\")\n )));\n\n // ---\n\n String key = UUID.randomUUID().toString();\n getEngine().start(key, processId, null);\n\n // ---\n\n assertActivations(key, processId,\n \"start\",\n \"f1\",\n \"gw1\",\n \"f2\",\n \"ev1\",\n \"f4\",\n \"ev2\");\n assertNoMoreActivations();\n\n // ---\n\n getEngine().resume(key, \"ev1\", null);\n\n // ---\n\n assertActivations(key, processId,\n \"f3\",\n \"gw2\");\n assertNoMoreActivations();\n\n // ---\n\n getEngine().resume(key, \"ev2\", null);\n\n // ---\n\n assertActivations(key, processId,\n \"f5\",\n \"gw2\",\n \"f6\",\n \"end\");\n assertNoMoreActivations();\n }",
"protected void clearOutEvents() {\n\t}",
"protected void clearOutEvents() {\n\t}",
"@Override\n public void processDeletHostEventAfter(final Host host) {\n }",
"@Override\n public void process(WatchedEvent event) {\n if (Event.EventType.None.equals(event.getType())) {\n return;\n }\n\n Stat stat = null;\n try {\n stat = zkClient.exists(zkDir, null, true);\n } catch (KeeperException e) {\n // ignore , it is not a big deal\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n\n boolean resetWatcher = false;\n try {\n resetWatcher = fireEventListeners(zkDir);\n } finally {\n if (Event.EventType.None.equals(event.getType())) {\n log.debug(\"A node got unwatched for {}\", zkDir);\n } else {\n if (resetWatcher) setConfWatcher(zkDir, this, stat);\n else log.debug(\"A node got unwatched for {}\", zkDir);\n }\n }\n }",
"@Override\n public void processCancelMaintenaceEventBefore(final Long hostId) {\n\n }",
"private void prepareAgents() {\n\t\tGodsProperties.setGodsStatus(GodsStatus.PREPARING);\n\n\t\t// Send prepare events to all agents\n\t\tfor (String host : GodsProperties.getHosts()) {\n\n\t\t\tPrepareEvent prepareEvent = new PrepareEvent(1);\n\n\t\t\tint[] slotsRange = getSlotRangeFor(host);\n\t\t\tprepareEvent.setSlotsRange(slotsRange);\n\n\t\t\tControlCenter.getInstance().notifyAgent(host, prepareEvent);\n\t\t\tlog.info(\"Sent Prepare Event to:\" + host + \" with slots range: [\"\n\t\t\t\t\t+ slotsRange[0] + \" - \" + slotsRange[1] + \"]\");\n\t\t}\n\t}",
"public abstract void processEvent(Object event);",
"@Override\n public void processPrepareMaintenaceEventAfter(final Long hostId) {\n\n }",
"public void checkEvents()\n\t{\n\t\t((MBoxStandalone)events).processMessages();\n\t}",
"public void process(WatchedEvent event) {\n\t\t\n\t}",
"@Override\n\tpublic void handleEvent(EnOceanMessage data) {\n\t}",
"public void excludeHosts( String hosts ) {\n\t\tflags.addExcludedHost( hosts ) ;\n\t}",
"@Override //to be moved to Cloud service\r\n\tpublic void createEvent(String eventName) {\n\t\t\r\n\t}",
"public void handle_PushedEvents()\r\n {\r\n if (rh2PushedEvents != null)\r\n {\r\n int index;\r\n for (index = 0; index < rh2PushedEvents.size(); index++)\r\n {\r\n CPushedEvent pEvt = rh2PushedEvents.get(index);\r\n if (pEvt != null)\r\n {\r\n if (pEvt.code != 0)\r\n {\r\n // Effectue l'un des evenements\r\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n rhCurParam0 = pEvt.param;\r\n rhCurOi = pEvt.oi;\r\n switch (pEvt.routine)\r\n {\r\n case 0:\r\n handle_GlobalEvents(pEvt.code);\r\n break;\r\n case 1:\r\n handle_Event(pEvt.pHo, pEvt.code);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n rh2PushedEvents.clear();\r\n }\r\n }",
"public void onEventMainThread(BaseEvent unused) {\n }",
"BasicEvents createBasicEvents();",
"@Override\n\tpublic List generateScheduledEventData(List<Meeting> meetings) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic void processEvent(Event e) {\n\n\t}",
"@Override\n public void processCancelMaintenaceEventAfter(final Long hostId) {\n\n }",
"private void registerGlobalEvents() {\n\t\tsubmit(new CycleEvent());\n\t\tsubmit(new CleanupEvent());\n\t\tsubmit(new FloorItemEvent());\n\t}",
"void asyncEventPing();",
"@Override\n public List<ProcessEvent> getAvailableEventsByStateName(\n List<ProcessEvent> processEvents, String processStateName)\n {\n List<ProcessEvent> allEvents = new ArrayList<>();\n for (ProcessEvent processEventValue : processEvents)\n {\n if (processStateName.endsWith(processEventValue.getInitialState().getInternalName()))\n {\n allEvents.add(processEventValue);\n }\n }\n return allEvents;\n }",
"@Override\n public void unknown(String arg0, Object[] arg1, SinkEventAttributes arg2)\n {\n }",
"public final void reportUncertain() {\n mHandler.post(() -> {\n synchronized (mLock) {\n ITimeZoneProviderManager manager = mManager;\n if (manager != null) {\n try {\n TimeZoneProviderEvent thisEvent =\n TimeZoneProviderEvent.createUncertainEvent(\n SystemClock.elapsedRealtime());\n if (shouldSendEvent(thisEvent)) {\n manager.onTimeZoneProviderEvent(thisEvent);\n mLastEventSent = thisEvent;\n }\n } catch (RemoteException | RuntimeException e) {\n Log.w(TAG, e);\n }\n }\n }\n });\n }",
"@Override\r\n\tprotected void processIsNotDefinedEvent(InNotDefinedEvent arg0) {\n\t\t\r\n\t}",
"protected void dispatchSetupEvents() {\r\n TimedEvent e = null;\r\n while ((e = scenarioQueue.peek()) != null && e.time < 0) {\r\n scenarioQueue.poll();\r\n disp.dispatchEvent(e);\r\n }\r\n }",
"public void processEvent(K1 key, RawRecordContainer value, List<DataTypeHandler<K1>> handlers, Multimap<String,NormalizedContentInterface> fields,\n Context context) throws Exception {\n IngestHelperInterface previousHelper = null;\n\n for (DataTypeHandler<K1> handler : handlers) {\n if (log.isTraceEnabled())\n log.trace(\"executing handler: \" + handler.getClass().getName());\n\n // gather the fields\n IngestHelperInterface thisHelper = handler.getHelper(value.getDataType());\n\n // This handler has no helper for the event's data type. Therefore, we should\n // just move on to the next handler. This can happen, for example, with the\n // edge handler, depending on the event's data type.\n if (thisHelper == null) {\n if (log.isTraceEnabled())\n log.trace(\"Aborting processing due to null ingest helper\");\n continue;\n }\n\n // Try to only parse the event once. Parse the event on the first pass and only if\n // the BaseIngestHelper class differs. The same class used by different handlers\n // *should* produce the same result.\n if (null == previousHelper || !previousHelper.getClass().getName().equals(thisHelper.getClass().getName())) {\n fields.clear();\n Throwable e = null;\n for (Map.Entry<String,NormalizedContentInterface> entry : getFields(value, handler).entries()) {\n // noinspection ThrowableResultOfMethodCallIgnored\n if (entry.getValue().getError() != null) {\n e = entry.getValue().getError();\n }\n fields.put(entry.getKey(), entry.getValue());\n }\n if (e != null) {\n throw new FieldNormalizationError(\"Failed getting all fields\", e);\n }\n\n // Event based metrics\n if (metricsEnabled) {\n metricsLabels.clear();\n metricsLabels.put(\"dataType\", value.getDataType().typeName());\n\n metricsService.collect(Metric.EVENT_COUNT, metricsLabels.get(), fields, 1L);\n metricsService.collect(Metric.BYTE_COUNT, metricsLabels.get(), fields, (long) value.getRawData().length);\n }\n\n previousHelper = thisHelper;\n }\n\n Collection<FieldValidator> fieldValidators = validators.get(value.getDataType().outputName());\n for (FieldValidator validator : fieldValidators) {\n validator.validate(value, fields);\n }\n\n executeHandler(key, value, fields, handler, context);\n\n context.progress();\n }\n }",
"@Override\n public void ProcessEvent(XMSEvent evt){\n FunctionLogger logger=new FunctionLogger(\"ProcessEvent\",this,myLogger);\n logger.args(evt);\n if(evt.getCall() == myInboundCall){\n ProcessInboundEvent(evt);\n } else if(evt.getCall() == myOutboundCall){\n ProcessOutboundEvent(evt);\n } else{\n logger.error(\"Event Received for an unknown Call. Ignoring\");\n }\n \n }",
"@Override\n\tpublic Set<Event> getEventsToProcess(Context baseContext) {\n\t\tSet<Event> eventsToProcess = new HashSet<Event>();\n\t\teventsToProcess.add(Event.ElectricOn);\n\t\teventsToProcess.add(Event.ElectricOff);\n\t\teventsToProcess.add(Event.Heat);\n\t\teventsToProcess.add(Event.Water);\n\t\treturn eventsToProcess;\n\t}",
"@Override\n\tpublic void processToolEvent(PluginEvent toolEvent) {\n\t\t//do nothing\n\t}",
"@Override\n\tpublic boolean processEvent(MsgEvent event) throws IllegalArgumentException {\r\n\t\tboolean result = false;\r\n\t\tif (fsm != null && !shuttingDown) {\r\n\t\t\tq.add(event);\r\n\t\t\t// We have some special processing to do if the event\r\n\t\t\t// is a Publish message\r\n\t\t\tif (event.getEventName().equals(SIPConstants.PUBLISH)) \r\n\t\t\t\tupdateStatus(event);\r\n\t\t\t\t\r\n\t\t\tif (processDuplicates && event.isDuplicate()) \r\n\t\t\t\tresult = fsm.processEvent(event);\r\n\t\t\t\t\t\r\n\t\t\telse if (!event.isDuplicate()) \r\n\t\t\t\tresult = fsm.processEvent(event);\r\n\t\t\t\t\r\n\t\t\telse\r\n\t\t\t\tlogger.info(PC2LogCategory.Model, subCat, \r\n\t\t\t\t\t\"Dropping duplicate event.\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\telse if (!event.equals(EventConstants.SHUTDOWN)) {\r\n\t\t\tlogger.info(PC2LogCategory.Model, subCat, \"Model \" \r\n\t\t\t\t\t+ name + \" unable to add event(\" + event.getEventName() \r\n\t\t\t\t\t+ \") to QUEUE because fsm=\" + fsm + \" and shutting down=\" \r\n\t\t\t\t\t+ shuttingDown);\r\n\t\t\treturn false;\r\n\t\t}\r\n return result;\r\n\t \r\n\t}",
"public void processEvent(SimEvent ev) {\n switch(ev.getTag()) {\n case OBSERVE: //It is my custom event\n //I must observe the datacenter\n balanceLoadCheck();\n //Observation loop, re-observe in `delay` seconds\n send(this.getId(), delay, OBSERVE, null);\n }\n }",
"public static List<Event> generateExpiredEvents() {\n\t\tEvent event1 = Event.create(0);\r\n\t\tevent1.infoStore().add(Info.create(1, 2, 3));\r\n\t\tList<Event> events = new ArrayList<Event>();\r\n\t\tevents.add(event1);\r\n\t\treturn events;\r\n\t}",
"private static void send() {\n Map<String, ArrayList<Event>> eventsByStream = new HashMap<>();\n for (Event event : QUEUE) {\n String stream = event.getStream();\n if (!eventsByStream.containsKey(stream) || eventsByStream.get(stream) == null) {\n eventsByStream.put(stream, new ArrayList<>());\n }\n eventsByStream.get(stream).add(event);\n }\n for (String stream : eventsByStream.keySet()) {\n if (Prefs.INSTANCE.isEventLoggingEnabled()) {\n sendEventsForStream(STREAM_CONFIGS.get(stream), eventsByStream.get(stream));\n }\n }\n }",
"@Override\n\tpublic BaseMsg handle(BaseEvent event) {\n\t\treturn null;\n\t}",
"public void collectWithoutErrors() {\r\n\t\ttry {\r\n\t\t\t// reevaluate each time to disable or reenable at runtime\r\n\t\t\tif (isNodesMonitoringDisabled()) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcollectWithoutErrorsNow();\r\n\t\t} catch (final Throwable t) { // NOPMD\r\n\t\t\tLOG.warn(\"exception while collecting data\", t);\r\n\t\t}\r\n\t}",
"public void process(EventData event) throws Exception {\n\t\tevent.getDoc().put(\"dimm\", memory());\n\t\tevent.getDoc().put(\"battery\", batteries());\n\t\tevent.getDoc().put(\"chassis\", chassis());\n\t\tevent.getDoc().put(\"pwrsupplies\", pwrsupplies());\n\t\tevent.getDoc().put(\"storage\", storage());\n\t\tevent.getDoc().put(\"fans\", fans());\n\n\t}",
"@EventHandler\n public void handleAll(DomainEvent event) {\n }",
"@Override\n\tprotected void processPostUpdateStream(KStream<String, Event> events) {\n\n\t}",
"public void doService() {\n EventManager eventManager = new EventManager();\n while (!queue.isEmpty()) {\n Event firstEvent = queue.poll();\n if (!(firstEvent instanceof ServerBackEvent) &&\n !(firstEvent instanceof ServerRestEvent)) {\n System.out.println(firstEvent);\n } \n Event nextEvent = eventManager.getNext(servers, gen, firstEvent, stats, probability);\n if (nextEvent != null) {\n queue.add(nextEvent);\n }\n }\n System.out.println(stats);\n \n\n }",
"protected abstract Set<Event> createEvents(String[] dataset);",
"@Override\n public void processDiscoverEventAfter(final Map<? extends ServerResource, Map<String, String>> resources) {\n\n }",
"public TaskBookBuilder addUnfinishedEventTasks() {\n final Iterable<EventTask> taskList = (new TypicalEventTasks()).getEventTasks();\n final List<EventTask> toAdd = new ArrayList<EventTask>();\n TaskUnfinishedPredicate predicate = new TaskUnfinishedPredicate(referenceDateTime);\n for (EventTask eventTask : taskList) {\n if (predicate.test(eventTask)) {\n toAdd.add(eventTask);\n }\n }\n return addEventTasks(toAdd);\n }",
"protected ServiceEvent(ServiceEvent event) {\n eventSenderClass=event.eventSenderClass;\n eventSenderID=event.eventSenderID;\n }",
"private void apply(ShipArrived event) {\n }",
"private EventsCollector() {\n\t\tsuper();\n\t}",
"void dispatchEvent(DistributedEvent event);",
"@KafkaHandler(isDefault = true)\n public void ignoreUnhandledEvents(Object event) {\n log.trace(\"Ignoring event={} with no handler\", event);\n }",
"@Override\n public boolean usesEvents()\n {\n return false;\n }",
"public void generateEvent(Dictionary matchDictionary, Dictionary events)\n throws Exception {\n\t\tServiceReference listeners[] = Activator.getContext().getServiceReferences(\n\t\t\t\tUPnPEventListener.class.getName(), null);\n\t\tfor (int i=0; i>listeners.length; i++) {\n\t\t\t// get listener filter \n\t\t\tFilter filter = (Filter) listeners[i].getProperty(\n\t\t\t\t\tUPnPEventListener.UPNP_FILTER); \n\t\t\t// evaluate filter\n\t\t\tif (filter.match(matchDictionary)) {\n\t\t\t\t((UPnPEventListener) listeners[i]).notifyUPnPEvent(\n\t\t\t\t\t\t(String) matchDictionary.get(UPnPDevice.UDN),\n\t\t\t\t\t\t(String) matchDictionary.get(UPnPService.ID), \n\t\t\t\t\t\tevents);\n\t\t\t}\n\t\t}\n\t}",
"EventUses createEventUses();",
"@Test\n public void unstartedSenderShouldNotAddReceivedEventsIntoTmpDropped() {\n Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(2));\n Integer nyPort = vm1.invoke(() -> WANTestBase.createFirstRemoteLocator(1, lnPort));\n\n // create receiver on site-ln and site-ny\n createCacheInVMs(lnPort, vm2, vm4);\n createReceiverInVMs(vm2, vm4);\n createCacheInVMs(nyPort, vm3, vm5);\n createReceiverInVMs(vm3, vm5);\n\n // create senders on site-ny, Note: sender-id is its destination, i.e. ny\n vm2.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n vm4.invoke(() -> WANTestBase.createSender(\"ny\", 1, true, 100, 10, false, false, null, true));\n\n // create senders on site-ln, Note: sender-id is its destination, i.e. ln\n vm3.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n vm5.invoke(() -> WANTestBase.createSender(\"ln\", 2, true, 100, 10, false, false, null, true));\n\n // create PR on site-ny\n vm2.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n vm4.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ny\", 1, 100,\n isOffHeap()));\n\n // create PR on site-ln\n vm3.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n vm5.invoke(() -> WANTestBase.createPartitionedRegion(getTestMethodName() + \"_PR\", \"ln\", 1, 100,\n isOffHeap()));\n\n // start sender on site-ny\n startSenderInVMs(\"ny\", vm2, vm4);\n\n // do 100 puts on site-ln\n vm3.invoke(() -> WANTestBase.doPutsFrom(getTestMethodName() + \"_PR\", 0, 100));\n\n // verify site-ny have 100 entries\n vm3.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n vm5.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 100));\n\n // verify tmpDroppedEvents should be 100 at site-ln, because the sender is not started yet\n vm3.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ln\", 100));\n vm5.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ln\", 100));\n\n // verify site-ln has not received the events from site-ny yet\n vm2.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 0));\n vm4.invoke(() -> WANTestBase.validateRegionSize(getTestMethodName() + \"_PR\", 0));\n\n // start sender on site-ln\n startSenderInVMsAsync(\"ln\", vm3, vm5);\n\n // verify tmpDroppedEvents should be 0 now at site-ny\n vm3.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ln\", 0));\n vm5.invoke(() -> WANTestBase.verifyTmpDroppedEventSize(\"ln\", 0));\n\n vm3.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ln\"));\n vm5.invoke(() -> WANTestBase.validateParallelSenderQueueAllBucketsDrained(\"ln\"));\n }",
"public void handleTopologyUpdateEvent() {\n\t\t\n\t\tif(!Constants.MY_ADDR.equals(Constants.CLIENT_ADDR))\n\t\t{\n\t\t\tif(RoutingInterface.instance().isConnected(session.getDestination()))\n\t\t\t{\n\t\t\t\t// Disable EOR\n\t\t\t\tsessionManager.setLive();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Enable EOR and put it into DT...\n\t\t\t\tsessionManager.setDT();\n\t\t\t}\n\t\t}\n\t}",
"public void processEvents() {\n for(InputEvent event : events) {\n KeyInputEvent keyEvent = (event instanceof KeyInputEvent) ? (KeyInputEvent) event : null;\n if(keyEvent == null) continue;\n\n KeyInputEvent.Type type = keyEvent.getType();\n InputKey key = keyEvent.getKey();\n\n if(type == KeyInputEvent.Type.PRESS) {\n keyStates.put(key, true);\n justPressedKeys.add(keyEvent.getKey());\n } else if(type == KeyInputEvent.Type.RELEASE) {\n keyStates.put(key, false);\n justReleasedKeys.add(keyEvent.getKey());\n }\n }\n }",
"private void execute() {\n this.waitForFinish();\n this.stop();\n logger.info(\"Finished eventing test {}\", this.getClass().getSimpleName());\n Event currentEvent = null;\n Map<Long, Integer> orderVerifyMap = new HashMap<Long, Integer>();\n while((currentEvent =eventRecievedList.poll()) != null)\n {\n \tInteger index = (Integer)currentEvent.getProperty(\"index\");\n \tLong threadId = (Long)currentEvent.getProperty(\"thread\");\n\n \tif(index != null && threadId != null){\n \t\tInteger previousIndex = orderVerifyMap.get(threadId);\n \t\tif(previousIndex == null)\n \t\t{\n \t\t\tif(index != 0)\n \t\t\t{\n \t\t\t\tSystem.out.println(\"Event \" + index + \" recieved first for thread \" + threadId);\n \t\t\t}\n \t\t\torderVerifyMap.put(threadId, index);\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif(previousIndex > index)\n \t\t\t{\n \t\t\t\tSystem.out.println(\"Events for thread \" + threadId + \" out of order. Event \" + previousIndex + \" recieved before \" + index);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\torderVerifyMap.put(threadId, index);\n \t\t\t}\n \t\t}\n \t}\n }\n try {\n Thread.sleep(15 * 1000);\n } catch (final InterruptedException ie) {\n // ignore\n }\n }",
"@Override\n\tpublic void process(Exchange arg0) throws Exception {\n\t\t\n\t}",
"public interface EventFilter {\n\n /**\n * Filter an event\n *\n * @param eventName\n * name of the event to filter\n * @param params\n * objects sent with the event\n * @param eventBus\n * event bus used to fire the event\n * @return false if event should be stopped, true otherwise\n */\n boolean filterEvent(String eventName, Object[] params, Object eventBus);\n}",
"@Test\n public void testSingleEvent() throws Exception {\n String processId = \"test\";\n deploy(new ProcessDefinition(processId, Arrays.<AbstractElement>asList(\n new StartEvent(\"start\"),\n new SequenceFlow(\"f1\", \"start\", \"gw1\"),\n new InclusiveGateway(\"gw1\"),\n new SequenceFlow(\"f2\", \"gw1\", \"ev\"),\n new IntermediateCatchEvent(\"ev\", \"ev\"),\n new SequenceFlow(\"f3\", \"ev\", \"gw2\"),\n new InclusiveGateway(\"gw2\"),\n new SequenceFlow(\"f4\", \"gw2\", \"end\"),\n new EndEvent(\"end\")\n )));\n\n // ---\n\n String key = UUID.randomUUID().toString();\n getEngine().start(key, processId, null);\n\n // ---\n\n getEngine().resume(key, \"ev\", null);\n\n // ---\n\n assertActivations(key, processId,\n \"start\",\n \"f1\",\n \"gw1\",\n \"f2\",\n \"ev\",\n \"f3\",\n \"gw2\",\n \"f4\",\n \"end\");\n assertNoMoreActivations();\n }",
"public void printEeventList() {\n PriorityQueue<Event> events = this.getEventList();\n while (!events.isEmpty()) {\n Event event = events.poll();\n if (!(event instanceof ServerRestEvent || event instanceof ServerBackEvent)) {\n System.out.println(event);\n }\n\n }\n }",
"@Scheduled(fixedDelay = 1000, initialDelay = 1000)\n public void processLocalEvents() {\n List<StockLocalEventStore> list = repository.findBySent(false);\n for (int i = 0; i < list.size(); i++) {\n publishAndUpdateLocalEvents(list.get(i));\n }\n }",
"@Test\n public void test02SendEvents() throws Exception{\n Event event1 = restService.registerEvent(createEvent(\"ACCOUNTS\", createMap(Object.class, \"date\", \"Yesterday\")));\n assertNotNull(event1.getId());\n Event event2 = restService.registerEvent(createEvent(\"TRANSACTIONS\", createMap(Object.class, \"date\", \"Yesterday\")));\n assertNotNull(event2.getId());\n Event event3 = restService.registerEvent(createEvent(\"PRODUCTS\", createMap(Object.class, \"date\", \"Yesterday\")));\n assertNotNull(event3.getId());\n Event event4 = restService.registerEvent(createEvent(\"ACCOUNTS\", createMap(Object.class, \"date\", \"Today\")));\n assertNotNull(event4.getId());\n Event event5 = restService.registerEvent(createEvent(\"TRANSACTIONS\", createMap(Object.class, \"date\", \"Today\")));\n assertNotNull(event5.getId());\n Event event6 = restService.registerEvent(createEvent(\"PRODUCTS\", createMap(Object.class, \"date\", \"Today\")));\n assertNotNull(event6.getId());\n Event event7 = restService.registerEvent(createEvent(\"ACCOUNTS\", createMap(Object.class, \"date\", \"Tomorrow\", \"premise\", \"PC2\")));\n assertNotNull(event7.getId());\n Event event8 = restService.registerEvent(createEvent(\"TRANSACTIONS\", createMap(Object.class, \"date\", \"Tomorrow\", \"premise\", \"PC2\")));\n assertNotNull(event8.getId());\n Event event9 = restService.registerEvent(createEvent(\"PRODUCTS\", createMap(Object.class, \"date\", \"Tomorrow\", \"premise\", \"PC2\")));\n assertNotNull(event9.getId());\n delay(10);\n\n //yesterday events\n List<CallbackData> list = restService.findCallbackInstancesBy(event1.getId(), null, null, null, 0, 0);\n// assertEquals(5, list.size());\n assertEquals(4, list.size());\n list = restService.findCallbackInstancesBy(event2.getId(), null, null, null, 0, 0);\n assertEquals(1, list.size());\n list = restService.findCallbackInstancesBy(event3.getId(), null, null, null, 0, 0);\n assertEquals(4, list.size());\n //today\n list = restService.findCallbackInstancesBy(event4.getId(), null, null, null, 0, 0);\n assertEquals(4, list.size());\n list = restService.findCallbackInstancesBy(event5.getId(), null, null, null, 0, 0);\n assertEquals(1, list.size());\n list = restService.findCallbackInstancesBy(event6.getId(), null, null, null, 0, 0);\n assertEquals(4, list.size());\n //premise\n list = restService.findCallbackInstancesBy(event7.getId(), null, null, null, 0, 0);\n assertEquals(5, list.size());\n list = restService.findCallbackInstancesBy(event8.getId(), null, null, null, 0, 0);\n assertEquals(2, list.size());\n list = restService.findCallbackInstancesBy(event9.getId(), null, null, null, 0, 0);\n assertEquals(5, list.size());\n\n //Event status check\n EventEntity evt = eventRepo.eventById(Long.parseLong(event1.getId()));\n assertEquals(evt.getStatus(), Constants.EVENT_INSTANCE_STATUS_PROCESSED);\n assertEquals(evt.getId(), Long.parseLong(event1.getId()));\n\n }",
"private void initializeEvents() {\r\n\t}",
"public void handleCreateTask(SelectEvent event) {\n\t}",
"private void handleServers() throws XMLStreamException {\n printf(\"FOUND SERVERS\");\n\n while (skipToStartButNotPast(SERVER, SERVERS)) {\n handleServer();\n }\n }",
"protected void normalizeEventTimes()\n {\n this.m_eventStartTime = (this.event_start_time == EASMessage.IMMEDIATE_START_TIME) ? System.currentTimeMillis()\n : (this.event_start_time * 1000L) + EASMessage.START_TIME_EPOCH;\n\n this.m_eventExpirationTime = (this.event_duration == EASMessage.INDEFINITE_EVENT_DURATION) ? Long.MAX_VALUE\n : this.m_eventStartTime + (this.event_duration * 60L * 1000L);\n }",
"private void deletePastEvents() {\n Date now = new Date(); //gets the current date\n ArrayList<Integer> listofEventIDS = eventManager.getListOfEventIDs(); //gets list of all eventIDs in the system\n //checks every eventID, and if its in the past, then deletes everything related to that event\n for (Integer eventID: listofEventIDS) {\n //if the event happened before right now, delete the event, and remove all attendees that are attending that event, organizer, speaker and free up the room.\n if (eventManager.getEvent(eventID).getTime().before(now)){\n ArrayList<String> peopleAttending = eventManager.getEvent(eventID).getAttendees(); //list of userid of all people attending\n\n for (String attendeeID: peopleAttending){\n //check if attendee is a organizer attending the event\n if (organizerManager.userExist(attendeeID)){\n organizerManager.removeEvent(eventID, attendeeID);\n }\n //if its not a organizer, it must be a attendee\n else {\n attendeeManager.removeEvent(eventID,attendeeID);\n }\n }\n //NOTE: THIS WORKS RIGHT NOW BECAUSE WE ONLY HAVE 1 SPEAKER, IN PHASE 2 WE WILL HAVE MULTIPLE SPEAKERS\n speakerManager.getSpeaker(eventManager.getEvent(eventID).getSpeakerID()).removeAssignEvent(eventID);\n String organizerOfThisEvent = eventManager.getEvent(eventID).getOrganizerID(); //gets the userid of the organizer of this event\n //in the organizer's list of events that he/she created, this event is removed.\n organizerManager.removeEvent(eventID, organizerOfThisEvent);\n //removes the event from the room. NOTE THIS IS NOT NECESSARY AS YOU WILL NEVER BE ABLE TO ASSIGN A ROOM IN THE PAST, BUT JUST AS A SAFETY MEASURE.\n roomManager.removeEventFromRoom(eventManager.getEvent(eventID).getLocation(), eventID, eventManager.getTime(eventID));\n // and finally removes the event object itself from the event manager.\n eventManager.removeEvent(eventID);\n }\n }\n }",
"void resetReceivedEventsCount();",
"@Override\r\n protected Map<String, Object> executeImpl(SiteInfo singleSite, String eventName,\r\n WebScriptRequest req, JSONObject json, Status status, Cache cache) \r\n {\n Date fromDate = parseDate(req.getParameter(\"from\"));\r\n Date toDate = parseDate(req.getParameter(\"to\"));\r\n \r\n // What should we do about repeating events? First or all?\r\n boolean repeatingFirstOnly = true;\r\n String repeatingEvents = req.getParameter(\"repeating\");\r\n if (repeatingEvents != null)\r\n {\r\n if (\"first\".equals(repeatingEvents))\r\n {\r\n repeatingFirstOnly = true;\r\n }\r\n else if (\"all\".equals(repeatingEvents))\r\n {\r\n repeatingFirstOnly = false;\r\n }\r\n }\r\n else\r\n {\r\n // Fall back to the icky old way of guessing it from \r\n // the format of the from date, which differs between uses!\r\n if (fromDate != null)\r\n {\r\n String fromDateS = req.getParameter(\"from\");\r\n if (fromDateS.indexOf('-') != -1)\r\n {\r\n // Apparently this is the site calendar dashlet...\r\n repeatingFirstOnly = true;\r\n }\r\n if (fromDateS.indexOf('/') != -1)\r\n {\r\n // This is something else, wants all events in range\r\n repeatingFirstOnly = false;\r\n }\r\n }\r\n }\r\n \r\n // One site, or all the user's ones?\r\n List<SiteInfo> sites = new ArrayList<SiteInfo>();\r\n if (singleSite != null)\r\n {\r\n // Just one\r\n sites.add(singleSite);\r\n }\r\n else\r\n {\r\n // All their sites (with optional limit)\r\n int max = 0;\r\n String strMax = req.getParameter(\"size\");\r\n if (strMax != null && strMax.length() != 0)\r\n {\r\n max = Integer.parseInt(strMax);\r\n }\r\n sites = siteService.listSites(AuthenticationUtil.getRunAsUser(), max);\r\n }\r\n \r\n // We need to know the Site Names, and the NodeRefs of the calendar containers\r\n String[] siteShortNames = new String[sites.size()];\r\n Map<NodeRef, SiteInfo> containerLookup = new HashMap<NodeRef, SiteInfo>();\r\n for (int i=0; i<sites.size(); i++)\r\n {\r\n SiteInfo site = sites.get(i);\r\n siteShortNames[i] = site.getShortName();\r\n \r\n try\r\n {\r\n containerLookup.put(\r\n siteService.getContainer(site.getShortName(), CalendarServiceImpl.CALENDAR_COMPONENT), \r\n site);\r\n }\r\n catch (AccessDeniedException e)\r\n {\r\n // You can see the site, but not the calendar, so skip it\r\n // This means you won't have any events in it anyway\r\n }\r\n }\r\n \r\n \r\n // Get the entries for the list\r\n PagingRequest paging = buildPagingRequest(req);\r\n PagingResults<CalendarEntry> entries = \r\n calendarService.listCalendarEntries(siteShortNames, fromDate, toDate, paging);\r\n\r\n boolean resortNeeded = false;\r\n List<Map<String, Object>> results = new ArrayList<Map<String,Object>>();\r\n for (CalendarEntry entry : entries.getPage())\r\n {\r\n // Build the object\r\n Map<String, Object> result = new HashMap<String, Object>();\r\n result.put(RESULT_NAME, entry.getSystemName());\r\n result.put(RESULT_TITLE, entry.getTitle());\r\n result.put(\"description\", entry.getDescription());\r\n result.put(\"where\", entry.getLocation());\r\n result.put(RESULT_START, entry.getStart());\r\n result.put(RESULT_END, entry.getEnd());\r\n result.put(\"duration\", buildDuration(entry));\r\n result.put(\"tags\", entry.getTags());\r\n result.put(\"isoutlook\", entry.isOutlook());\r\n result.put(\"allday\", CalendarEntryDTO.isAllDay(entry));\r\n \r\n // Identify the site\r\n SiteInfo site = containerLookup.get(entry.getContainerNodeRef());\r\n result.put(\"site\", site);\r\n result.put(\"siteName\", site.getShortName());\r\n result.put(\"siteTitle\", site.getTitle());\r\n \r\n // Replace nulls with blank strings for the JSON\r\n for (String key : result.keySet())\r\n {\r\n if (result.get(key) == null)\r\n {\r\n result.put(key, \"\");\r\n }\r\n }\r\n \r\n // Save this one\r\n results.add(result);\r\n \r\n // Handle recurring as needed\r\n boolean orderChanged = handleRecurring(entry, result, results, fromDate, repeatingFirstOnly);\r\n if (orderChanged)\r\n {\r\n resortNeeded = true;\r\n }\r\n }\r\n \r\n // If the recurring events meant dates changed, re-sort\r\n if (resortNeeded)\r\n {\r\n Collections.sort(results, new Comparator<Map<String, Object>>() \r\n {\r\n public int compare(Map<String, Object> resultA,\r\n Map<String, Object> resultB) \r\n {\r\n Date startA = (Date)resultA.get(RESULT_START);\r\n Date startB = (Date)resultB.get(RESULT_START);\r\n \r\n int cmp = startA.compareTo(startB);\r\n if (cmp == 0)\r\n {\r\n Date endA = (Date)resultA.get(RESULT_END);\r\n Date endB = (Date)resultB.get(RESULT_END);\r\n cmp = endA.compareTo(endB);\r\n if (cmp == 0)\r\n {\r\n String nameA = (String)resultA.get(RESULT_NAME);\r\n String nameB = (String)resultB.get(RESULT_NAME);\r\n return nameA.compareTo(nameB);\r\n }\r\n return cmp;\r\n }\r\n return cmp;\r\n }\r\n });\r\n }\r\n \r\n // All done\r\n Map<String, Object> model = new HashMap<String, Object>();\r\n model.put(\"events\", results);\r\n return model;\r\n }",
"void onNetworkEvent(NetworkEvent event);",
"private void sendLocalEventData() {\n\n if(!localUnsentEvents.isEmpty()){\n\n Event event = localUnsentEvents.get(0);\n int eventIndex = event.getIndex();\n int eventNumber = event.getType();\n\n System.out.println(\"EVENT: \" + event);\n System.out.println(\"INDEX: \" + eventIndex);\n\n getJSON(hostUrl + sendLocalEventScript.getFilename()\n + \"?matchId=\" + matchId\n + \"&player=\" + assignedPlayer\n + \"&event=\" + eventNumber\n + \"&eventIndex=\" + eventIndex,\n 2000);\n\n lastSentLocalEventIndex = eventIndex;\n localUnsentEvents.remove(0);\n\n }\n\n }",
"public void byeHost(Host aHost);",
"public void processEvent(Packet packet) {\r\n\t\tint eventCode = packet.eventCode;\r\n\t\t\r\n\t\tswitch(eventCode) {\r\n\t\t\tcase 0: registerPeer(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 2: insertFile(packet);\r\n\t\t\t //forwardPacket(packet);\r\n\t\t\t break;\r\n\t\t\tcase 3: findFile(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 4: processFileLocation(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 5: fileTransferReq(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 6: recFile(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 7: passingDHT(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 8: peerQuitting(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 9: updateDHTPeerQuit(packet);\r\n\t\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"EventUse createEventUse();",
"public ServiceEvent() {\n // eventSenderID and eventSenderClass are initialized by the OperatingSystem! \n }",
"private void doEvents() {\n\t\tapplyEvents(generateEvents());\t\t\n\t}",
"protected void beforeConsume() {\n // Do nothing\n }",
"@Override\r\n\tprotected void processInWifiEvent(InWifiEvent arg0) {\n\t\t\r\n\t}",
"final void postEventPrivate(AWTEvent theEvent) {\n synchronized(this) {\n int id = theEvent.getID();\n if (nextQueue != null) {\n // Forward event to top of EventQueue stack.\n nextQueue.postEventPrivate(theEvent);\n } else if (theEvent instanceof PeerEvent &&\n (((PeerEvent)theEvent).getFlags() & \n PeerEvent.PRIORITY_EVENT) != 0) {\n postEvent(theEvent, HIGH_PRIORITY);\n } else if (id == PaintEvent.PAINT ||\n id == PaintEvent.UPDATE) {\n postEvent(theEvent, LOW_PRIORITY);\n } else {\n postEvent(theEvent, NORM_PRIORITY);\n }\n }\n }",
"void forAllHostsDo(Closure action);",
"void onIssueCreatedEvent(T event);",
"public void onEvent(EventIterator events) {\n\n }",
"@Override\n public void onMemberUnreachable(final Member member) {\n if(clusterReadView.isLeader()){\n LOGGER.info(\"I AM the LEADER and I am notifying other Scoop aware clients about [unreachableMember={}]\", member);\n\n final Event event = new Event();\n event.setEventType(UNREACHABLE_MEMBER_EVENT_TYPE);\n event.setOrderingKey(\"scoop-system\"); // TODO better ordering key?\n\n final HashMap<String, Object> metadata = Maps.newHashMap();\n metadata.put(\"id\", UUID.randomUUID().toString());\n\n final Map<String, String> bodyMap = Maps.newHashMap();\n bodyMap.put(UNREACHABLE_MEMBER_EVENT_BODY_KEY, member.address().toString());\n event.setBody(bodyMap);\n\n postEvent(scoopTopic, event);\n }\n else {\n LOGGER.debug(\"received event about [unreachableMember={}] but I am NOT the LEADER -> ignored\", member);\n }\n }",
"public void clearEvents()\n {\n ClientListener.INSTANCE.clear();\n BackingMapListener.INSTANCE.clear();\n }"
] | [
"0.60585195",
"0.5742309",
"0.5732564",
"0.56454456",
"0.5619379",
"0.5540402",
"0.5539439",
"0.5502828",
"0.5500075",
"0.548726",
"0.53803873",
"0.53613865",
"0.53324264",
"0.5329808",
"0.530376",
"0.52700704",
"0.52556264",
"0.5242356",
"0.5242356",
"0.52373934",
"0.52048564",
"0.520164",
"0.5191058",
"0.5182462",
"0.51643157",
"0.50867474",
"0.50693965",
"0.5048911",
"0.5023059",
"0.50161064",
"0.50151074",
"0.5004222",
"0.49932325",
"0.49799615",
"0.49785703",
"0.497454",
"0.49743658",
"0.49673593",
"0.49547693",
"0.49540704",
"0.49532896",
"0.49514428",
"0.49491626",
"0.49198192",
"0.4912761",
"0.49116307",
"0.48981905",
"0.48913056",
"0.4888956",
"0.4886824",
"0.488164",
"0.48533523",
"0.48526078",
"0.4851771",
"0.48504555",
"0.48391652",
"0.4822899",
"0.4822599",
"0.481728",
"0.48066068",
"0.4806295",
"0.48058033",
"0.4804102",
"0.4798213",
"0.47961998",
"0.47852725",
"0.47847307",
"0.478416",
"0.4783218",
"0.47759598",
"0.47662082",
"0.47488585",
"0.4748567",
"0.47334647",
"0.47277102",
"0.47216377",
"0.470753",
"0.4703767",
"0.47007063",
"0.4700673",
"0.46952516",
"0.46933454",
"0.46915966",
"0.4689998",
"0.468675",
"0.46810603",
"0.4674938",
"0.46710593",
"0.4662111",
"0.4659199",
"0.46588957",
"0.4648757",
"0.46456227",
"0.4631667",
"0.46302977",
"0.46266684",
"0.46258497",
"0.46181524",
"0.46114892",
"0.46105662"
] | 0.58408415 | 1 |
Fait un nombre aleatoire de croisements sur des individus avec une proba probability | public void croisements(double probability) {
Random rand = new Random();
int nbCroisements = rand.nextInt(10);
for (int i = 0; i < nbCroisements; i++) {
int index1 = 0, index2 = 0;
while(index1 == index2) {
index1 = rand.nextInt(this.individus.size());
index2 = rand.nextInt(this.individus.size());
}
if(rand.nextDouble() <= probability) {
this.individus.get(index1).cross(this.individus.get(index2));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }",
"public void calcularEntropia(){\n //Verificamos si será con la misma probabilida o con probabilidad\n //especifica\n if(contadorEstados == 0){\n //Significa que será con la misma probabilidad por lo que nosotros\n //calcularemos las probabilidades individuales\n for(int i = 0; i < numEstados; i++){\n probabilidadEstados[i] = 1.0 / numEstados;\n }\n }\n for(int i = 0; i < numEstados; i++){\n double logEstado = Math.log10(probabilidadEstados[i]);\n logEstado = logEstado * (-1);\n double logDos = Math.log10(2);\n double divisionLog = logEstado / logDos;\n double entropiaTmp = probabilidadEstados[i] * divisionLog;\n resultado += entropiaTmp;\n }\n }",
"public void calculateProbabilities(){\n\t}",
"public void carroPulando() {\n\t\tpulos++;\n\t\tpulo = (int) (PULO_MAXIMO/10);\n\t\tdistanciaCorrida += pulo;\n\t\tif (distanciaCorrida > distanciaTotalCorrida) {\n\t\t\tdistanciaCorrida = distanciaTotalCorrida;\n\t\t}\n\t}",
"private void figureOutProbability() {\n\t\tMysqlDAOFactory mysqlFactory = (MysqlDAOFactory) DAOFactory\n\t\t\t\t.getDAOFactory(DAOFactory.MYSQL);\n\n\t\tstaticPr = new StaticProbability(trialId);\n\t\tstatisticPr = new StatisticProbability(trialId);\n\t\tstaticProbability = staticPr.getProbability();\n\t\tstatisticProbability = statisticPr.getProbability();\n\n\t\tfor (Entry<Integer, BigDecimal> entry : staticProbability.entrySet()) {\n\t\t\ttotalProbability.put(\n\t\t\t\t\tentry.getKey(),\n\t\t\t\t\tentry.getValue().add(statisticProbability.get(entry.getKey())).setScale(2));\n\t\t}\n\n\t\tBigDecimal summaryProbability = BigDecimal.valueOf(0);\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tsummaryProbability = summaryProbability.add(entry.getValue());\n\t\t}\n\t\t\n\t\t// figures out probability\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tentry.setValue(entry.getValue().divide(summaryProbability, 2,\n\t\t\t\t\tBigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Total probability -> \" + totalProbability);\n\t\t\n\t\t// figures out and sets margin\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tBigDecimal probability = entry.getValue();\n\t\t\tBigDecimal winCoefficient = (BigDecimal.valueOf(1.).divide(\n\t\t\t\t\tprobability, 2, BigDecimal.ROUND_HALF_UP))\n\t\t\t\t\t.multiply(BigDecimal.valueOf(1.).subtract(Constants.MARGIN));\n\t\t\tentry.setValue(winCoefficient.setScale(2, BigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Winning coefficient -> \" + totalProbability);\n\t\t\n\t\t// updates info in db\n\t\tTrialHorseDAO trialHorseDAO = mysqlFactory.getTrialHorseDAO();\n\t\tTrialHorseDTO trialHorseDTO = null;\n\t\tfor(Entry<Integer, BigDecimal> entry : totalProbability.entrySet()){\n\t\t\ttrialHorseDTO = trialHorseDAO.findTrialHorseByTrialIdHorseId(trialId, entry.getKey());\n\t\t\ttrialHorseDTO.setWinCoefficient(entry.getValue());\n\t\t\ttrialHorseDAO.updateTrialHorseInfo(trialHorseDTO);\n\t\t}\t\n\t}",
"public static void promedio(int [] Grado1, int NNEstudent){\nint aux=0;\nfor(int i=0;i<NNEstudent;i++){\naux=Grado1[i]+aux;}\nint promedio;\npromedio=aux/NNEstudent;\nSystem.out.println(aux);\nSystem.out.println(\"el promedio de las edades es:\");\nSystem.out.println(promedio);\n}",
"protected float computeProbs(int n)\n\t{\n\t\tfloat Cmi = 0;\n\t\t// Compute probabilities\n\t\tfor (int k = 0; k < bins; k++)\n\t\tfor (int l = 0; l < bins; l++)\n\t\t{\n\t\t float Pkl = Puv[k*bins+l];\n\t\t if (Pkl > 0)\n\t\t\t Cmi -= Pkl / n * Math.log(n * Pkl / (Pu[k] * Pv[l]));\n\t\t}\n\t\treturn Cmi;\n\t}",
"void CalculateProbabilities()\n\t{\n\t int i;\n\t double maxfit;\n\t maxfit=fitness[0];\n\t for (i=1;i<FoodNumber;i++)\n\t {\n\t if (fitness[i]>maxfit)\n\t maxfit=fitness[i];\n\t }\n\n\t for (i=0;i<FoodNumber;i++)\n\t {\n\t prob[i]=(0.9*(fitness[i]/maxfit))+0.1;\n\t }\n\n\t}",
"public void colocarCompu(){\n int aux1;\n int aux2;\n \n for(int sub=0;sub<5;sub++){\n do{\n aux1=(int)(Math.random()*10);\n aux2=(int)(Math.random()*10);\n }while(proyectofinal.barc[aux1][aux2]!=0);\n \n \n proyectofinal.barc[aux1][aux2]=1;\n proyectofinal.barcosC ++ ;\n }\n }",
"public void generaClaves()\n {\n n = p.multiply(q);\n // ed = (p-1)*(q-1)\n ed = p.subtract(BigInteger.valueOf(1));\n ed = ed.multiply(q.subtract(BigInteger.valueOf(1)));\n // Elegimos un numero primo entre 1 menor que ed\n do e = new BigInteger(2 * tamPrimo, new Random());\n while((e.compareTo(ed) != -1) ||\n\t\t (e.gcd(ed).compareTo(BigInteger.valueOf(1)) != 0));\n // d = e^1 mod ed\n d = e.modInverse(ed);\n }",
"public int Promedio(List<Integer>num){\n \n Iterator i = num.iterator();\n int suma = 0;\n int conteo = 0;\n int promedio;\n \n while(i.hasNext()){\n suma += (int)i.next();\n conteo++;\n }\n promedio = suma/conteo;\n return promedio;\n }",
"public void probabiltDistribution() {\r\n\t\tfor (int k = 0; k < 1000; k++) {\r\n\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\trandomGrid[i][j] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdeployComputerShips();\r\n\t\t\tfor (int i = 0; i < 9; i++) {\r\n\t\t\t\tfor (int j = 0; j < 11; j++) {\r\n\t\t\t\t\tprobabilityGrid[i][j] = probabilityGrid[i][j] + randomGrid[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public double contagionProbability(Person p)\n\t{\n\t\tif(p.getAge()<=18)\n\t\t{\n\t\t\treturn con_18*p.contagionProbability();\n\t\t}\n\t\tif(p.getAge()>18 && p.getAge()<=55)\n\t\t{\n\t\t\treturn con_18_55*p.contagionProbability();\n\t\t}\n\t\treturn con_up55*p.contagionProbability();\n\t}",
"public void calcP() {\r\n\t\tthis.setP(sick/people.size());\r\n\t}",
"public void createProbsMap() {\n\t\tif(this.counts == null) {\n\t\t\tcreateCountMap();\n\t\t}\n\t\t\n\t\tMap<String, Double> result = new HashMap<String, Double>();\n\t\t\n\t\t// Make the counts and get the highest probability found \n\t\tdouble highestProb = 0.00;\n\t\tdouble size = (double) this.getData().size();\n\t\tfor(Entry<String, Integer> entry : counts.entrySet()) {\n\t\t\tdouble value = (double) entry.getValue();\n\t\t\tresult.put(entry.getKey(), value / size);\n\t\t\t\n\t\t\tif(value/size > highestProb) {\n\t\t\t\thighestProb = value/size;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fill the highest probilities \n\t\tList<String> highestProbs = new ArrayList<String>();\n\t\tfor(Entry<String, Integer> entry : counts.entrySet()) {\n\t\t\tdouble value = (double) entry.getValue();\n\t\t\t\n\t\t\tif(value/size == highestProb) {\n\t\t\t\thighestProbs.add(entry.getKey());\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.highestProbs = highestProbs;\n\t\tthis.highestProb = highestProb;\n\t\tthis.probs \t\t = result;\n\t}",
"public static double probabilityThreeSixes() {\n int count = 0;\n int amount = 0;\n for (int i = 0; i < 10000; i++) {\n amount = 0;\n for (int j = 0; j < 18; j++) {\n if ((int) (Math.random() * 6) + 1 == 6)\n amount++;\n if (amount == 3) {\n count++;\n break; }\n }\n }\n return ((double) count / (double) 10000) * 100;\n }",
"public void siguinteProbabilidad(double probabilidad){\n probabilidadEstados[contadorEstados] = probabilidad;\n probabilidadTotal += probabilidad;\n contadorEstados += 1;\n }",
"float genChance();",
"private ArrayList<ParCharProb> calcularProbabilidadLista(ArrayList<ParCharProb> lista) {\n\t\tdouble cantidadElementos = 0;\r\n\t\tParCharProb par;\r\n\t\tIterator<ParCharProb> it = lista.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tpar = it.next();\r\n\t\t\tcantidadElementos += par.getFrecuencia();\r\n\t\t}\r\n\t\t\r\n\t\tit = lista.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tpar = it.next();\r\n\t\t\tpar.setProbabilidad((double) par.getFrecuencia()/(double) cantidadElementos);\r\n\t\t}\r\n\t\treturn lista;\r\n\t}",
"private void genProbes(int numProbes) {\n if (numProbes == 0) {\n return;\n }\n Dimension dim = layoutPanel.getLayoutSize();\n int height = dim.height;\n int width = dim.width;\n int size = height * width;\n float ratio = (float) numProbes / size;\n\n layoutPanel.probedNList = getRegularPointsIndex(ratio);\n }",
"public Percolation(int n) {\n this.count = n;\n\n\n }",
"public int probabilidadesHastaAhora(){\n return contadorEstados + 1;\n }",
"public double getPrize();",
"public Perso designerCible(){\r\n\t\tRandom rand = new Random();\r\n\t\tint x = rand.nextInt((int)provocGlob);\r\n\t\tboolean trouve =false;\r\n\t\tdouble cpt=0;\r\n\t\tPerso res=groupe.get(0);\r\n\t\tfor(Perso pers : groupeAble){\r\n\t\t\tcpt+=pers.getProvoc();\r\n\t\t\tif(cpt>x && !trouve){\r\n\t\t\t\tres=pers;\r\n\t\t\t\ttrouve=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}",
"public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }",
"@Override\n\tpublic double probability() {\n\t\treturn 0;\n\n\t}",
"public ArrayList<Integer> obtenerYi(){\n ArrayList<Integer> res = new ArrayList<Integer>();\n int cont;\n \n for (float p:probabilidades){\n cont=0;\n while (Math.pow(base, cont)<1/p)\n cont++;\n res.add(cont);\n }\n return res;\n }",
"private double getPerc(int n) {\n\t\tdouble total = n*n;\n\t\tPercolation p = new Percolation(n);\n\t\twhile(!p.percolates()) {\n\t\t\tint row = StdRandom.uniform(n)+ 1;\n\t\t\tint col = StdRandom.uniform(n) + 1;\n\t\t\tp.open(row, col);\n\t\t}\n\t\tdouble openSites = (double)(p.numberOfOpenSites());\n\t\treturn openSites/total;\n\t}",
"float getSpecialProb();",
"public static void main(String[] args) {\r\n Scanner sc = new Scanner(System.in);\r\n double a = sc.nextDouble();\r\n double b = sc.nextDouble();\r\n double p = a/(a+b);\r\n int n = 6;\r\n double bd = 0.0;\r\n for(int i = 3 ; i <= n ;i++)\r\n {\r\n bd = bd + bionomial(n,i,p);\r\n }\r\n System.out.println(Math.round(bd*1000.00)/1000.00);\r\n }",
"private int getPoisson() {\n\t\treturn (int) (-INCOMING_MY * Math.log(Math.random()));\n\t}",
"public void precioFinal(){\r\n if(getConsumoEnergetico() == Letra.A){\r\n precioBase = 100+precioBase;\r\n }\r\n else if((getConsumoEnergetico() == Letra.B)){\r\n precioBase = 80+precioBase;\r\n }\r\n else if(getConsumoEnergetico() == Letra.C){\r\n precioBase = 60+precioBase;\r\n }\r\n else if((getConsumoEnergetico() == Letra.D)){\r\n precioBase = 50+precioBase;\r\n }\r\n else if(getConsumoEnergetico() == Letra.E){\r\n precioBase = 30+precioBase;\r\n }\r\n else if((getConsumoEnergetico() == Letra.F)){\r\n precioBase = 10+precioBase;\r\n }\r\n else{\r\n aux=1;\r\n System.out.println(\"...No existe...\");\r\n }\r\n if (aux==0){\r\n peso();\r\n }\r\n \r\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 void realizaProcessamentoCartaoChance() throws Exception {\n if (indiceChance == 1) {\n DeslocarJogador(jogadorAtual(), 40);\n this.listaJogadores.get(jogadorAtual()).addDinheiro(200);\n\n } else if (indiceChance == 2) {\n DeslocarJogador(jogadorAtual(), 24);\n } else if (indiceChance == 3) {\n if (this.posicoes[this.jogadorAtual()] == 40 || this.posicoes[this.jogadorAtual()] > 11) {\n this.listaJogadores.get(jogadorAtual()).addDinheiro(200);\n }\n DeslocarJogador(jogadorAtual(), 11);\n\n\n } else if (indiceChance == 4) {\n if (this.posicoes[this.jogadorAtual()] < 12 || this.posicoes[this.jogadorAtual()] > 28) {\n DeslocarJogador(jogadorAtual(), 12);\n } else {\n DeslocarJogador(jogadorAtual(), 28);\n }\n } else if (indiceChance == 5 || indiceChance == 16) {\n if (this.posicoes[jogadorAtual()] < 5 || this.posicoes[jogadorAtual()] > 35) {\n DeslocarJogador(jogadorAtual(), 5);\n } else if (this.posicoes[jogadorAtual()] < 15) {\n DeslocarJogador(jogadorAtual(), 15);\n } else if (this.posicoes[jogadorAtual()] < 25) {\n DeslocarJogador(jogadorAtual(), 25);\n } else if (this.posicoes[jogadorAtual()] < 35) {\n DeslocarJogador(jogadorAtual(), 35);\n }\n\n int jogador = this.jogadorAtual();\n Lugar lugar = this.tabuleiro.get(this.posicoes[jogador] - 1);\n String nomeDono = (String) Donos.get(this.posicoes[jogador]);\n if (this.isUmJogador(nomeDono)) {\n Jogador possivelDono = this.getJogadorByName(nomeDono);\n if (this.isPosicaoFerrovia(this.posicoes[jogador])) {\n this.print(\"\\tO dono eh \" + possivelDono.getNome());\n }\n this.pagarFerrovia(possivelDono.getId(), jogador, 50, lugar.getNome());\n }\n\n } else if (indiceChance == 6) {\n this.listaJogadores.get(jogadorAtual()).addDinheiro(50);\n } else if (indiceChance == 7) {\n DeslocarJogador(jogadorAtual(), this.posicoes[jogadorAtual()] - 3);\n this.pagarEventuaisTaxas(jogadorAtual());\n } else if (indiceChance == 8) {\n DeslocarJogador(jogadorAtual(), 10);\n adicionaNaPrisao(listaJogadores.get(jogadorAtual()));\n\n } else if (indiceChance == 9) {\n int GastosRua = this.listaJogadores.get(jogadorAtual()).getQuantidadeDeCasas() * 25;\n GastosRua = GastosRua + this.listaJogadores.get(jogadorAtual()).getQuantidadeDeHoteis() * 10;\n this.listaJogadores.get(jogadorAtual()).retirarDinheiro(GastosRua);\n } else if (indiceChance == 10) {\n this.listaJogadores.get(jogadorAtual()).retirarDinheiro(15);\n } else if (indiceChance == 11) {\n\n this.listaJogadores.get(jogadorAtual()).ganharCartaoSaidaDePrisao(\"chance\");\n this.cardChancePrisaoEmPosse = true;\n } else if (indiceChance == 12) {\n if (this.posicoes[this.jogadorAtual()] > 5) {\n this.listaJogadores.get(jogadorAtual()).addDinheiro(200);\n }\n DeslocarJogador(jogadorAtual(), 5);\n if (this.posicoes[this.jogadorAtual()] > 5) {\n this.listaJogadores.get(jogadorAtual()).addDinheiro(200);\n }\n } else if (indiceChance == 13) {\n DeslocarJogador(jogadorAtual(), 39);\n } else if (indiceChance == 14) {\n int debito = numeroDeJogadores * 50 - 50;\n this.listaJogadores.get(jogadorAtual()).retirarDinheiro(debito);\n for (int i = 0; i < numeroDeJogadores; i++) {\n if (i != jogadorAtual()) {\n this.listaJogadores.get(i).addDinheiro(50);\n }\n }\n } else if (indiceChance == 15) {\n this.listaJogadores.get(jogadorAtual()).addDinheiro(150);\n }\n\n\n\n if (indiceChance < 16) {\n indiceChance++;\n } else {\n indiceChance = 1;\n }\n }",
"private int randomPiece() {\n return (int)(Math.random()*N_PIECES);\n }",
"public Chromosone() {\n Random rand = new Random();\n for(int i=0;i<=75;i++)\n {\n int rnd = rand.nextInt(2);// [1,0...]\n\n Val.add(rnd);\n }\n }",
"public void chooseProp(Joueur joueur){\n int nb;\n int[] tab = new int[5];\n Random randomCode = new Random();\n int pif = this.listprop.length;\n System.out.println(\"pif \"+pif);\n nb = randomCode.nextInt(pif);\n for(int i =0; i<5; i++){\n tab[i] = this.listprop[nb][i];\n }\n this.propositions = tab;\n }",
"public static int ruolette(ArrayList<Integer> fitvalores, ArrayList<int[]> poblacion, int semilla){ \n int totalfitnes = 0;\n int totalfitnesnuevo = 0;\n int indtablero = 0;\n int semi=semilla;\n int tpoblacion=poblacion.size();\n int []nuevofitness = new int [fitvalores.size()];\n double []nproporcion = new double [fitvalores.size()];\n ArrayList <Double> proporcion = new ArrayList<>();//proporcion j la ruleta\n ArrayList <Double> ruleta = new ArrayList<>();\n //obtener el max fitnes\n for(int i=0;i<fitvalores.size();i++){ //total de fitnes\n totalfitnes=totalfitnes+fitvalores.get(i);\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el nuevo fittnes inverso\n double pro=(tpoblacion*tpoblacion-tpoblacion)-fitvalores.get(i);\n nuevofitness[i]= (int) pro;\n // System.out.println(\"nuevo fitnes\"+nuevofitness[i]);\n } \n for(int i=0;i<fitvalores.size();i++){ //total de fitnes nuevo o inverso\n totalfitnesnuevo=(totalfitnesnuevo+nuevofitness[i]);//para que los mejores casos usen mas espacio\n }\n \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n double var1=nuevofitness[i];\n double var2=totalfitnesnuevo;\n double pro=var1/var2;\n nproporcion[i]=pro;\n //System.out.println(\"nueva proporcion \"+nproporcion[i]);\n } \n ruleta.add(nproporcion[0]);\n // System.out.println(\"primera propporniaso \"+nproporcion[0]);\n for(int i=1;i<fitvalores.size();i++){ //poner datos en la ruleta\n double var1=ruleta.get(i-1);\n double var2=nproporcion[i];\n ruleta.add(var1+var2);\n //System.out.println(\"ruleta \"+ruleta.get(i));\n }\n double num=randomadec(0,1,semi);\n // System.out.println(\"numero random dec \"+num); \n for(int i=0;i<fitvalores.size();i++){ //poner datos en el array proporcion\n // System.out.println(ruleta.get(i));\n if(num<ruleta.get(i)){\n indtablero=i;\n //System.out.println(\"se guardo el tablero \"+indtablero);\n break;\n }\n }\n return indtablero;//esto devuelve el indice del tablero ganador en la ruleta\n }",
"public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }",
"public static double probabilityOneSix() {\n int count = 0;\n for (int j = 0; j < 10000; j++) {\n for (int i = 0; i < 6; i++) {\n if ((int) (Math.random() * 6) + 1 == 6) {\n count++;\n break; } }\n }\n return ((double) count / (double) 10000) * 100;\n }",
"public int initialiser()\n\t{\n\n\t\tint nombreE;\n\t\tint k = 0;\n\t\t//int max = randInt(2,10);\n\t\ttableauPeres_ = new Case[longueur_][longueur_];\n\t\tint i, j = 0;\n\t\tfor(i=0; i<longueur_; ++i)\n\t\t{\n\t\t\tfor(j=0; j<longueur_; ++j)\n\t\t\t{\n\t\t\t\ttableauPeres_[i][j] = new Case(i, j, 0);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Combien d'étoiles souhaitez vous pour chaque joueur ?\");\n\t\tnombreE = clavier.nextInt();\n\t\twhile (k < nombreE)\n\t\t{\n\t\t\taddEtoile(\"bleu\");\n\t\t\taddEtoile(\"rouge\");\n\t\t\t++k;\n\t\t}\n\t\treturn nombreE;\n\t}",
"public int promedio() {\r\n // calculo y redondeo del promedio\r\n promedio = Math.round(nota1B+nota2B);\r\n // paso de Double a Int\r\n return (int) promedio;\r\n }",
"private List<Integer> generateProb() {\n Integer[] randArr = new Integer[numCols*numRows];\n\n int start = 0;\n int end;\n for(int i = 0; i < myStateMap.size(); i++) {\n double prob = myStateMap.get(i).getProb();\n end = (int) (prob * numCols * numRows + start);\n for(int j = start; j < end; j++) {\n if(end > randArr.length) {\n break;\n }\n randArr[j] = myStateMap.get(i).getType();\n }\n start = end;\n }\n\n List<Integer> arr = new ArrayList<>(Arrays.asList(randArr));\n Collections.shuffle(arr);\n return arr;\n }",
"private List<ProbabilityOfDefault> getPDs(Scenario s) {\n\t\t\r\n\t\tCountry ctry = getCountry();\r\n\t\t\r\n\t\tDouble probGrowth = ctry.getProbabilityOfGrowth();\r\n\t\tDouble probRecession = ctry.getProbabilityOfRecession();\r\n\t\t\r\n\t\tList<ProbabilityOfDefault> adjustedPDs = new ArrayList<>();\r\n\t\t\r\n\t\tfor (ProbabilityOfDefault pd : rating.getPDs()) {\r\n\t\t\tProbabilityOfDefault newPd = pd;\r\n\t\t\tnewPd.setPD((probGrowth * pd.getGrowthPD()) + (probRecession * pd.getRecessionPD()));\r\n\t\t\tadjustedPDs.add(newPd);\r\n\t\t}\r\n\t\t\r\n\t\tCollections.sort(adjustedPDs);\r\n\t\treturn adjustedPDs;\r\n\t}",
"private double getProbOfClass(int catIndex) {\r\n\t\treturn (classInstanceCount[catIndex] + mCategoryPrior)\r\n\t\t\t\t/ (classInstanceCount[0] + classInstanceCount[1] + mCategories.length\r\n\t\t\t\t\t\t* mCategoryPrior);\r\n\t}",
"public static double probabilityTwoSixes() {\n int count = 0;\n int amount = 0;\n for (int i = 0; i < 10000; i++) {\n amount = 0;\n for (int j = 0; j < 12; j++) {\n if ((int) (Math.random() * 6) + 1 == 6)\n amount++;\n if (amount == 2) {\n count++;\n break; }\n }\n }\n return ((double) count / (double) 10000) * 100;\n }",
"public ChocolateDistribution(int noOfChocolate, int noOfStudents) {\n this.noOfChocolate = noOfChocolate;\n this.noOfStudents = noOfStudents;\n }",
"private void peso(){\r\n if(getPeso()>80){\r\n precioBase+=100;\r\n }\r\n else if ((getPeso()<=79)&&(getPeso()>=50)){\r\n precioBase+=80;\r\n }\r\n else if ((getPeso()<=49)&&(getPeso()>=20)){\r\n precioBase+=50;\r\n }\r\n else if ((getPeso()<=19)&&(getPeso()>=0)){\r\n precioBase+=10;\r\n }\r\n }",
"private int newFigure(Random rnd) {\r\n\t\t/** while the figure exists or = 0, find a new figure */\r\n\r\n\t\tbyte hulp = 0;\r\n\t\tdo {\r\n\t\t\thulp = (byte) (1 + rnd.nextInt(Constants.DIMENSION * Constants.DIMENSION));\r\n\t\t} while (exists(hulp) || (hulp < Constants.MIN));\r\n\t\tConstants.logger.debug(hulp);\r\n\t\treturn hulp;\r\n\t}",
"public void buildPriors() {\n\t\t// grab the list of all class labels for this fold\n\t\tList<List<String>> classListHolder = dc.getClassificationFold();\n\t\tint totalClasses = 0; // track ALL class occurrences for this fold\n\t\tint[] totalClassOccurrence = new int[classes.size()]; // track respective class occurrence\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tif (i == testingFold) {\n\t\t\t\tcontinue; // skip testing fold\n\t\t\t} else {\n\t\t\t\tcurrentFold = i;\n\t\t\t} // end if\n\n\t\t\t// grab the list of all classes for this current fold\n\t\t\tList<String> classList = classListHolder.get(currentFold);\n\t\t\t// track the total number of classes in this fold and their occurrences\n\t\t\ttotalClasses += classList.size();\n\t\t\t// for each class occurrence, match it to a class and track its occurrence\n\t\t\tfor (String className : classList) {\n\t\t\t\tfor (int j = 0; j < classes.size(); j++) {\n\t\t\t\t\tif (className.equals(classes.get(j))) {\n\t\t\t\t\t\ttotalClassOccurrence[j]++;\n\t\t\t\t\t} // end if\n\t\t\t\t} // end for\n\t\t\t} // end for\n\t\t} // end for\n\n\t\t// divide a particular class occurrence by total number of classes across training set\n\t\tfor (int i = 0; i < classPriors.length; i++) {\n\t\t\tclassPriors[i] = totalClassOccurrence[i] / totalClasses;\n\t\t} // end for\n\t}",
"private int getGroupSize(double positiveProbability)\n {\n if (positiveProbability < eightIndividualsGroupMaxProbability)\n return 8;\n\n if (positiveProbability < fourIndividualsGroupMaxProbability)\n return 4;\n\n if (positiveProbability < twoIndividualsGroupMaxProbability)\n return 2;\n\n return 1;\n }",
"public static void main(String[] args) {\n\r\n\t\tScanner tastatura = new Scanner(System.in);\r\n\t\tint pismo = 0;\r\n\t\tint brojBacanja = 0;\r\n\t\tint ishodBacanja = 0;\r\n\t\tint brojPisma = 0;\r\n\t\tint brojGlava = 0;\r\n//\t\tdouble kolicnkZaPismo = (double) brojPisma/brojBacanja;\r\n//\t\tdouble kolicnikZaGlavu = (double) brojGlava/brojBacanja;\r\n\t\t//ne moze ovde\r\n\t\t\r\n\t\twhile (true) {\r\n\t\t\tSystem.out.print(\"Koliko puta zelite da bacite novcic: \");\r\n\t\t\tbrojBacanja = tastatura.nextInt();\r\n\t\t\t\r\n\t\t\tif(brojBacanja == 0) break; \r\n\t\t\t\tbrojPisma = 0;\r\n\t\t\t\tbrojGlava = 0;\r\n\t\t\r\n\t\t\tfor (int i = 0; i<brojBacanja; i++) {\r\n\t\t\t\tishodBacanja = (int) (Math.random() + 0.5);\r\n\t\t\t\tif(ishodBacanja == pismo)\r\n\t\t\t\t\tbrojPisma++; \r\n\t\t\t\t\t//++ znaci ako je u zagradi tacno izvrsava se to nesti++\r\n\t\t\t\telse \r\n\t\t\t\t\tbrojGlava++;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdouble kolicnkZaPismo = (double) brojPisma/brojBacanja; //obavezno 2x double\r\n\t\t\tdouble kolicnikZaGlavu = (double) brojGlava/brojBacanja;\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Kolicnik za pisma: \" + kolicnkZaPismo);\r\n\t\t\tSystem.out.println(\"Kolicnik za glavu: \" + kolicnikZaGlavu);\r\n\t\t\tSystem.out.println(\"Pismo je palo \" + brojPisma +\" puta\");\r\n\t\t\tSystem.out.println(\"Glava je pala \" + brojGlava + \" puta\");\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"***Za izlaz ukucajte 0 ***\");\r\n\t\t\t\r\n// u zadatku\t\t\t\r\n//\t\t\tSystem.out.print(\"Broj pisma Broj glava\");\r\n//\t\t\tSystem.out.print(\" Broj pisma / Broj bacanja\");\r\n//\t\t\tSystem.out.println(\" Broj glava / Broj bacanja\");\r\n//\t\t\t\r\n//\t\t\tSystem.out.printf(\"%8d %12d %17.2f %25.2f\\n \" , \r\n//\t\t\t\t\tbrojPisma, brojGlava,\r\n//\t\t\t\t\t(double) brojPisma / brojBacanja,\r\n//\t\t\t\t\t(double) brojGlava / brojBacanja);\r\n\t\t}\r\n\t}",
"public int getNumGruppoPacchetti();",
"private double calcProbability(int index) {\n\t\treturn (double) fitnesses[index] / sumOfFitnesses();\n\t}",
"private Map<String,Double> getPromedioHabilidades(Cuadrilla cuadrilla){\n\t\tSystem.out.println(\"#### getPromedioHabilidades ######\");\n\t\tdouble proprod= 0, protrae= 0, prodorm = 0, prodcaa = 0;\n\t\tint cantper = 0;\n\t\tfor (CuadrillasDetalle cd : cuadrilla.getCuadrillasDetalles()) {\n\t\t\t\n\t\t\tList<TecnicoCompetenciaDetalle> tcds = \tcd.getTecnico().getTecnicoCompetenciaDetalles();\n\t\t\tfor (TecnicoCompetenciaDetalle tcd : tcds) {\n\t\t\t\tInteger codigoComp = tcd.getCompetencia().getCodigoCompetencia();\n\t\t\t\tswitch(codigoComp){\n\t\t\t\t\tcase COMPETENCIA_PRODUCTIVIDAD:\n\t\t\t\t\t\tproprod = proprod+ tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_TRABAJO_EQUIPO:\n\t\t\t\t\t\tprotrae = protrae + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_ORIENTACION_METAS:\n\t\t\t\t\t\tprodorm = prodorm + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_CALIDAD_ATENCION:\n\t\t\t\t\t\tprodcaa = prodcaa +tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcantper++;\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\t// promedio de las competencias de los tenicos de cada cuadrilla\n\t\tproprod = proprod/cantper; \n\t\tprotrae = protrae/cantper;\n\t\tprodorm = prodorm/cantper;\n\t\tprodcaa = prodcaa/cantper;\n\n\t\tMap<String, Double> mpproms = new LinkedHashMap<String,Double>();\n\t\tmpproms.put(\"proprod\", proprod);\n\t\tmpproms.put(\"protrae\", protrae);\n\t\tmpproms.put(\"prodorm\", prodorm);\n\t\tmpproms.put(\"prodcaa\", prodcaa);\n\t\n\t\treturn mpproms;\n\t\t\n\t}",
"public int nombrePions(Couleur uneCouleur) {\n\t\tCollection<Pion> pions = mesPions.values();\n\t\tint nb = 0;\n\t\tfor (Pion p: pions) {\n\t\t\tif (p.aMemeCouleur(uneCouleur))\n\t\t\tnb++; \n\t\t}\n\t\treturn nb; \n }",
"private double [] uniformDiscreteProbs(int numStates) \n {\n double [] uniformProbs = new double[2 * numStates];\n for(int i = 0; i < 2 * numStates; i++)\n uniformProbs[i] = (1.0 / (2 * numStates));\n return uniformProbs;\n }",
"@Test\n\tpublic void priorsAreReasonable() {\n\t\tdouble tot = 0;\n\t\tboolean zeroPrior = false;\n\t\tfor(NewsGroup g: groups) {\n\t\t\tdouble p = g.getPrior();\n\t\t\ttot+=p;\n\t\t\tif(p == 0.0) {\n\t\t\t\tzeroPrior = true;\n\t\t\t}\n\t\t}\n\t\tassertTrue((tot == 1) && !zeroPrior);\n\t}",
"public static void Promedio(){\n int ISumaNotas=0;\n int IFila=0,ICol=0;\n int INota;\n float FltPromedio;\n for(IFila=0;IFila<10;IFila++)\n {\n ISumaNotas+=Integer.parseInt(StrNotas[IFila][1]);\n }\n FltPromedio=ISumaNotas/10;\n System.out.println(\"El promedio de la clase es:\"+FltPromedio);\n }",
"private void genProb() {\n\t\tint row;\n\t\tint column;\n\t\tint removed1;\n\t\tint removed2;\n\n\t\tfor (int i = 0; i < DIFFICULTY / 2;) {\n\t\t\trow = rand.nextInt(9);\n\t\t\tcolumn = rand.nextInt(9);\n\t\t\twhile (problem[row][column] == 0 || (row == 4 && column == 4)) {\n\t\t\t\trow = rand.nextInt(9);\n\t\t\t\tcolumn = rand.nextInt(9);\n\t\t\t}\n\n\t\t\t// Clearing random boxes.\n\t\t\tremoved1 = problem[row][column];\n\t\t\tremoved2 = problem[8 - row][8 - column];\n\t\t\tproblem[row][column] = 0;\n\t\t\tproblem[8 - row][8 - column] = 0;\n\n\t\t\tcopy(problem, comp);\n\n\t\t\tif (!solve(0, 0, 0, comp)) { // Case of unsolvable.\n\t\t\t\t// Putting back original values.\n\t\t\t\tproblem[row][column] = removed1;\n\t\t\t\tproblem[8 - row][8 - column] = removed2;\n\t\t\t} else {\n\t\t\t\tif (unique()) { // Case of solution is unique.\n\t\t\t\t\ti++;\n\t\t\t\t} else { // Case of solution is not unique.\n\t\t\t\t\t// Putting back original values.\n\t\t\t\t\tproblem[row][column] = removed1;\n\t\t\t\t\tproblem[8 - row][8 - column] = removed2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }",
"public void calcularIndicePlasticidad(){\r\n\t\tindicePlasticidad = limiteLiquido - limitePlastico;\r\n\t}",
"@Override\n public void subida(){\n // si es mayor a la eperiencia maxima sube de lo contrario no\n if (experiencia>(100*nivel)){\n System.out.println(\"Acabas de subir de nivel\");\n nivel++;\n System.out.println(\"Nievel: \"+nivel);\n }else {\n\n }\n }",
"public double getNajvacsie() {\n\t\tif ((cislo1 >= cislo2) && (cislo1 >= cislo3)) {\n\t\t\tprve = cislo1;\n\t\t} else if ((cislo2 >= cislo1) && (cislo2 >= cislo3)) {\n\t\t\tprve = cislo2;\n\t\t} else if ((cislo3 >= cislo1) && (cislo3 >= cislo2)) {\n\t\t\tprve = cislo3;\n\t\t}\n\t\treturn prve;\n\n\t}",
"private static BigInteger numOfFlipsRequired(BigInteger numOfCards,BigInteger bi0,BigInteger bi3,BigInteger bi1){\n \n if(numOfCards.equals(bi0)){\n return bi0;\n }else if(numOfCards.compareTo(bi3) == -1){\n return bi1;\n }else if(numOfCards.mod(bi3).compareTo(bi0) == 0){\n return numOfCards.divide(bi3);\n }else{\n return numOfCards;\n }\n \n \n // return numOfFlips;\n }",
"public void aggiungiPecoraCasualmente() {\n\t\tif (((int) (Math.random() * 3)) >= 1) {\n\t\t\tPecoraAdulta nuovaPecoraAdulta = new PecoraAdulta();\n\t\t\tpecore.add(nuovaPecoraAdulta);\n\t\t\tif (nuovaPecoraAdulta.isMaschio())\n\t\t\t\tnumMontoni++;\n\t\t\telse\n\t\t\t\tnumPecoreFemmine++;\n\t\t} else {\n\t\t\tpecore.add(new Agnello());\n\t\t\tnumeroAgelli++;\n\t\t}\n\t}",
"private void recolteNourriture() {\r\n\t\t\t//1pop recolte toute la case\r\n\t\t\tint tempNourr = 0;\r\n\t\t\tint totalPop = population + populationColoniale;\r\n\t\t\tint limite = (totalPop < caseOwned.size()) ? totalPop : caseOwned.size();\r\n\t\t\tfor(int id = 0; id < limite; id++) {\r\n\t\t\t\ttempNourr += caseOwned.get(id).getFood();\r\n\t\t\t}\r\n\t\t\t//animaux\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Bétail) * 10; //Ca mange de l'herbe, ça se tente.\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Cervidés) * 7.5; //CARIBOUUUUUUUUU !!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Crabe) * 2; //ca pique les pied, a mort!!\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Elephants) * 30; //polution sonore\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Moutons) * 5; //kébab landais\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Poissons) * 5; //croustibat\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Chevaux) * 7; //lasagnes\r\n\t\t\ttempNourr += howManyAnimal(Animaux.Baleines) * 50; //*bruit de baleine virile*\r\n\t\t\t//aplication des bonus\r\n\t\t\ttempNourr *= (1 + (0.15 * scienceLvl) + (0.05 * (bonheur - baseBonheur))); // +15% par scienceLvl +5% par bonheur excedentaire, -5% par bonheur négatif\r\n\t\t\t\r\n\t\t\tnourriture += tempNourr;\r\n\t\t\t//bonus de conservation grâce au sel\r\n\t\t\tif(howManyRessource(StrategicRessource.Sel) > 0 && nourriture > 0) nourriture *= 1.10;\r\n\t\t\t//limitation de stockage\r\n\t\t\tint stockageMax = caseOwned.size() * 100 * scienceLvl;\r\n\t\t\tif(nourriture > stockageMax) nourriture = stockageMax;\r\n\t\t}",
"public int getPrecios()\r\n {\r\n for(int i = 0; i < motos.size(); i++)\r\n {\r\n precio_motos += motos.get(i).getCoste();\r\n }\r\n \r\n return precio_motos;\r\n }",
"public int getProteksi(){\n\t\treturn (getTotal() - getPromo()) * protectionCost / 100;\n\t}",
"public int getNumPrimo()\n {\n return numPrimo;\n\n }",
"private void setPrice(Integer nb_numeros, Integer nb_n_chances) {\n\t\tInteger base = null;\n\t\tif (nb_numeros == 5) {\n\t\t\tbase = 2;\n\t\t}\n\t\telse if (nb_numeros == 6) {\n\t\t\tbase = 12;\n\t\t}\n\t\telse if (nb_numeros == 7) {\n\t\t\tbase = 42;\n\t\t}\n\t\telse if (nb_numeros == 8) {\n\t\t\tbase = 112;\n\t\t}\n\t\telse if (nb_numeros == 9) {\n\t\t\tbase = 252;\n\t\t}\n\t\telse {\n\t\t\tbase = 0;\n\t\t}\n\t\tthis.price = base*nb_n_chances;\n\t}",
"protected final int calculateInterst1(int pr){\n\t\t return pr*10*1/100;\n\t }",
"public static void main(String[] args) {\n int numeros[] = {2, 3, 4, 2, 4, 5, 6, 2, 1, 2};\n //Creamos segundo arreglo con iguall tamaño que el arreglo nùmeros\n int cuadrados[] = new int[numeros.length];\n //Arreglo para almacenar el proceso de la operación\n String procesos[] = new String[numeros.length];\n //Creamos ciclo de repeticiòn para recorrer arreglo \n for (int indice = 0; indice < numeros.length; indice++) {\n int cuadrado = numeros[indice] * numeros[indice];\n //Almacenamos el proceso de la opreaciòn en el arreglo cuadrados\n cuadrados[indice] = cuadrado;\n \n //Almacenar resultado en el arreglo procesos\n procesos[indice] = numeros[indice] + \"x\" + numeros[indice];\n }\n //Ciclo de repetición para mostrar arreglos\n String print_numeros = \"numeros - \";\n String print_cuadrados = \"cuadrados - \";\n String print_procesos = \"procesoss - \";\n for (int indice = 0; indice < numeros.length; indice++) {\n print_numeros = print_numeros + numeros[indice] + \", \";\n print_cuadrados = print_cuadrados + cuadrados[indice] + \", \";\n print_procesos = print_procesos + procesos[indice] + \", \";\n\n }\n System.out.println(print_numeros);\n System.out.println(print_cuadrados);\n System.out.println(print_procesos);\n \n //suma solo numeros pares\n int acumulador_pares=0;\n for (int indice = 0; indice < 10; indice++) {\n boolean par= detectar_par(numeros[indice]);\n if (par == true) {\n acumulador_pares = acumulador_pares + numeros[indice];\n \n }\n }\n System.out.println(\"La suma de los nùmeros pares es: \"+acumulador_pares);\n \n }",
"@Override\r\n public void ingresarCapacidad(){\r\n double capacidad = Math.pow(alto, 3);\r\n int capacidadInt = Double.valueOf(capacidad).intValue();\r\n super.capacidad = capacidadInt;\r\n super.cantidadRestante = capacidadInt;\r\n System.out.println(capacidadInt);\r\n }",
"public static void main(String[] args) {\n\t\tint pencils = 534;\n\t\tint students = 30;\n\t\t\n\t\t//학생 한 명이 가지는 연필 수\n\t\tString pencilsPerStudent = (pencils / students + \"개\");\n\t\tSystem.out.println(pencilsPerStudent);\n\t\t\n\t\t//남은 연필 수\n\t\tString pencilsLeft = (pencils % students + \"개\");\n\t\t// 1) 나머지 구하기 연산 (% --> mod)\n\t\t// 2) 전체연필 - (학생한명이 가지는 연필수*학생수)\n\t\tSystem.out.println(pencilsLeft);\n\t\t\n\t\t\n\t}",
"public double poisson(double alfa){\n double b = Math.exp(-alfa);\n\n int x = 0;\n\n double p=1;\n while(p > b){\n double u = rnd.getNextPseudoaleatoreo();\n p = p * u;\n x = x + 1;\n }\n\n return x;\n }",
"Batiment choixBatiment(Partie partie, int nbDoublon, Plateau plateau);",
"int givePropScore(int propSize, int crownNum) throws Exception;",
"public static int getObstacleProbability() {\n\t\tif(SHOW_OBSTACLES){\n\t\t\treturn RANDOM_OBSTACLE_COUNT;\n\t\t}\n\t\treturn 0;\n\t}",
"public int precioFinal(){\r\n int monto=super.PrecioFinal();\r\n\t \t \r\n\t if (pulgadas>40){\r\n\t monto+=precioBase*0.3;\r\n\t }\r\n\t if (sintonizador){\r\n\t monto+=50;\r\n\t }\r\n\t \r\n\t return monto;\r\n\t }",
"private int getPrize(int matchingNumbersCount)\r\n\t{\r\n\t\tswitch(matchingNumbersCount)\r\n\t\t{\r\n\t\tcase 3:\r\n\t\t\treturn 25;\r\n\t\tcase 4:\r\n\t\t\treturn 100;\r\n\t\tcase 5:\r\n\t\t\treturn 1000;\r\n\t\tcase 6:\r\n\t\t\treturn 1000000;\r\n\t\tdefault:\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}",
"private Double getProzent(Double points)\r\n \t{\r\n \t\treturn points / totalPoints;\r\n \t}",
"public void generatePriority() {\n\t\tpriority = .25 * frequency + .25 * age + .25 * links + .25 * money;\n\t}",
"abstract double leftProbability();",
"public int getCoeficienteBernua()\n {\n return potenciaCV;\n }",
"public double[] proportionPercentage(){\n if(!this.pcaDone)this.pca();\n return this.proportionPercentage;\n }",
"private void generisiPolje() {\r\n\t\tint polje = rnd.nextInt(broj_slobodnih);\r\n\t\tint vrijednost = rnd.nextInt(4);\r\n\t\tif(vrijednost == 0)\r\n\t\t\tvrijednost = 4;\r\n\t\telse\r\n\t\t\tvrijednost = 2;\r\n\t\t\r\n\t\tint brojac = 0;\r\n\t\tfor(int i = 0 ; i < 4 ; i++)\r\n\t\t\tfor(int j = 0 ; j < 4 ; j++) {\r\n\t\t\t\tif(tabela[i][j] == 0) {\r\n\t\t\t\t\tif(brojac == polje)\r\n\t\t\t\t\t\ttabela[i][j] = vrijednost;\r\n\t\t\t\t\tbrojac++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tbroj_slobodnih--;\r\n\t}",
"public void notaFinal() {\n\n for (int i = 0; i <= (nombres.size() - 1); i++) {\n\n notaFinal.add((notas.get(0) + notas.get(1) + notas.get(2)) / 3);\n\n }\n\n }",
"private int siguientePrimo(int n)\r\n {\r\n if (n%2 == 0) n++;\r\n for (; !esPrimo(n); n+=2);\r\n return n;\r\n }",
"public String randomBirthsRepartition() {\n System.out.println(\"There is a lot of agriculture ! New births are coming...\");\n double randomPercentage = ThreadLocalRandom.current().nextInt(1, 10 + 1);\n double extraPartisans = (randomPercentage / 100) * this.getNumberOfPartisans();\n int numberOfBirths = (int)extraPartisans;\n while (extraPartisans >= 1) {\n Faction randomFaction = getRandomFaction(this.factions);\n randomFaction.setNumberOfPartisans(randomFaction.getNumberOfPartisans() + 1);\n extraPartisans--;\n }\n return (int) numberOfBirths + \" births were counted.\";\n }",
"private int aleatorizarNaipe() {\n\t\tint aux;\n\t\taux = r.getIntRand(4);\n\t\treturn aux;\n\t}",
"public scala.collection.immutable.IndexedSeq<java.lang.Object> getQuantiles (scala.collection.Iterable<java.lang.Object> probabilities) { throw new RuntimeException(); }",
"public double getProbRecombinacion() {\n return getDouble(params.probRecombinacion, PROP_PROB_RECOMB, 0.5);\n }",
"public Algoritmo(int numIndividuos, int profundidad, int numGeneraciones) {\n\t\tthis.numIndividuos = numIndividuos;\n\t\tthis.profundidad = profundidad;\n\t\tthis.numGeneraciones = numGeneraciones;\n\t}",
"private double calculaz(double v) { //funcion de densidad de probabilidad normal\n double N = Math.exp(-Math.pow(v, 2) / 2) / Math.sqrt(2 * Math.PI);\n return N;\n }",
"public void enfermarTodosConProbabilidad50() {\n for (Persona p : super.getMundo().getListaDoctores()) {\n if (super.getMundo().getRandom1and2() == 1) {\n super.getMundo().enfermarPersona(p);\n }\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n if (super.getMundo().getRandom1and2() == 1)\n super.getMundo().enfermarPersona(p);\n }\n for (Persona p : super.getMundo().getListaAlbaniles()) {\n if (super.getMundo().getRandom1and2() == 1)\n super.getMundo().enfermarPersona(p);\n }\n for (Persona p : super.getMundo().getListaHerreros()) {\n if (super.getMundo().getRandom1and2() == 1)\n super.getMundo().enfermarPersona(p);\n }\n for (Persona p : super.getMundo().getListaCocineros()) {\n if (super.getMundo().getRandom1and2() == 1)\n super.getMundo().enfermarPersona(p);\n }\n }",
"public NeighborhoodDistribution(int divisions) {this.divisions=divisions;}",
"public abstract int getCntPoa();",
"private int getRandomPiece() {\r\n return new Random().nextInt(Constants.NUM_PIECES);\r\n }",
"public void percentualGordura(){\n\n s0 = 4.95 / denscorp;\n s1 = s0 - 4.50;\n percentgord = s1 * 100;\n\n }"
] | [
"0.6405168",
"0.6360279",
"0.6213755",
"0.6188027",
"0.61769885",
"0.6176743",
"0.61339384",
"0.6110461",
"0.60912806",
"0.6050574",
"0.5950641",
"0.5923614",
"0.58726007",
"0.5854229",
"0.5841975",
"0.58405286",
"0.58355755",
"0.5831419",
"0.5823512",
"0.58165395",
"0.5764205",
"0.57585144",
"0.57435423",
"0.57434785",
"0.571654",
"0.5716527",
"0.57147413",
"0.5687678",
"0.5680182",
"0.5679264",
"0.56754565",
"0.5673651",
"0.56729233",
"0.5665625",
"0.56637317",
"0.5655558",
"0.56483275",
"0.56263584",
"0.56224686",
"0.5619879",
"0.5617888",
"0.5612557",
"0.5610418",
"0.5606627",
"0.55810887",
"0.5563969",
"0.55568385",
"0.5550442",
"0.5548498",
"0.55466545",
"0.55423856",
"0.5534223",
"0.5531296",
"0.5530533",
"0.5516386",
"0.55109394",
"0.5496977",
"0.54967445",
"0.54931396",
"0.54911435",
"0.5479285",
"0.54775375",
"0.54767567",
"0.5474765",
"0.54746187",
"0.54737794",
"0.5472448",
"0.54699665",
"0.54599595",
"0.5453831",
"0.54517305",
"0.5450662",
"0.5445582",
"0.54356384",
"0.54333186",
"0.5426114",
"0.5421264",
"0.5419792",
"0.5419018",
"0.54048413",
"0.54013276",
"0.53974026",
"0.5396259",
"0.5391805",
"0.5384219",
"0.5380022",
"0.5378882",
"0.53785336",
"0.53779465",
"0.53758526",
"0.5372378",
"0.53695244",
"0.53663087",
"0.53602284",
"0.5356937",
"0.5356152",
"0.53553164",
"0.534746",
"0.5345655",
"0.53442764"
] | 0.6776414 | 0 |
Retourne un individu en en piochant deux au hasard, puis en choisissant le meilleur avec une probabilite de 75% | public Individu selection() {
// Pioche au hasard deux individus differents
Random rand = new Random();
int index1 = 0, index2 = 0;
index1 = rand.nextInt(this.individus.size());
while(index1 == index2) {
index2 = rand.nextInt(this.individus.size());
}
//double fitness1 =
double fitness1 = this.individus.get(index1).fitness();
double fitness2 = this.individus.get(index2).fitness();
// Determine le meilleur du moins bon
Individu better, worse;
if(fitness1 > fitness2) {
better = this.individus.get(index1);
worse = this.individus.get(index2);
} else {
worse = this.individus.get(index1);
better = this.individus.get(index2);
}
// Dans 75% des cas, onp rend le meilleur des deux
if(rand.nextDouble() <= 0.75) {
return better;
} else {
return worse;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void ex() {\n int inches = 86; \n int pie = 12; //1 pie = 12 inches \n //Operaciones para obtener la cantidad de pies e inches\n int cant = inches / pie; \n int res = inches % pie;\n //Muestra de resultados\n System.out.println(inches + \" pulgadas es equivalente a\\n \" + \n cant + \" pies \\n \" + res + \" pulgadas \");\n }",
"static void sueldo7diasl(){\nSystem.out.println(\"Ejemplo estructura Condicional Multiple 1 \");\nString descuenta=\"\";\n//datos de entrada xd\nint ganancias= teclado.nextInt();\nif(ganancias<=150){\ndescuenta=\"0.5\";\n}else if (ganancias>150 && ganancias<300){\n descuenta=\"0.7\";}\n else if (ganancias>300 && ganancias<450){\n descuenta=\"0.9\";}\n //datos de salida:xd\n System.out.println(\"se le descuenta : \"+descuenta);\n}",
"public void percentualGordura(){\n\n s0 = 4.95 / denscorp;\n s1 = s0 - 4.50;\n percentgord = s1 * 100;\n\n }",
"int getPercentageHeated();",
"double getPerimetro();",
"float getSpecialProb();",
"public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }",
"@Override\n public double getHonorario() {\n return super.getHonorario() * 1.05;\n }",
"public double calculatedConsuption(){\nint tressToSow=0;\n\nif (getKiloWatts() >=1 && getKiloWatts() <= 1000){\n\ttressToSow = 8;\n}\nelse if (getKiloWatts() >=1001 && getKiloWatts ()<=3000){\n\ttressToSow = 35;\n}\nelse if (getKiloWatts() > 3000){\n\ttressToSow=500;\n}\nreturn tressToSow;\n}",
"public double getHeuristicValue(Object state) {\n\n LinternaEstado estado = (LinternaEstado) state;\n\n double heuristica = 0.0;\n int[] actual = estado.getCalzada();\n int aux = 0;\n for (int i = 0; i < 5; i++) {\n if (actual[i] == 1)\n aux = aux + estado.getTiempo(i);\n }\n heuristica = (aux / actual[6]) * 100; //lo dejo sin multiplicar¿¿¿\n return heuristica;\n }",
"int accidentVelo()\r\n\t{\r\n\t\tdouble rand = Math.random()*100;\r\n\t\tSystem.out.println(rand);\r\n\t\tif ((double)rand <= 0.5) {\r\n\t\t\tSystem.out.println(\"Finalement vous auriez du y aller à pied. Vous vous vider de votre sang sur le bord du trottoir.\");\r\n\t\t\treturn 0.5;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"@Override\n public double tuition(){\n return 2500;\n }",
"public int probabilidadesHastaAhora(){\n return contadorEstados + 1;\n }",
"public void calcularSalario(){\n // 1% do lucro mensal\n double percentagemLucro = 0.01 * lucroMensal;\n // valor fixo igual ao dobro do dos empregados sem especialização, acrescido\n //de um prémio que corresponde a 1% do lucro mensal nas lojas da região.\n setSalario(1600 + percentagemLucro);\n\n }",
"double getPerimetro(){\n return 2 * 3.14 * raggio;\n }",
"private void peso(){\r\n if(getPeso()>80){\r\n precioBase+=100;\r\n }\r\n else if ((getPeso()<=79)&&(getPeso()>=50)){\r\n precioBase+=80;\r\n }\r\n else if ((getPeso()<=49)&&(getPeso()>=20)){\r\n precioBase+=50;\r\n }\r\n else if ((getPeso()<=19)&&(getPeso()>=0)){\r\n precioBase+=10;\r\n }\r\n }",
"@Override\n\tpublic double tinhTienLai() {\n\t\tdouble tienLai=0;\n\t\tif(soThangGui>=kyHan){\n\t\t\t tienLai=soTienGui*laiSuat*soThangGui;\n\t\t}\n\t\treturn tienLai;\n\t}",
"public abstract float perimetro();",
"private static void estadisticaClase() {\n int numeroAlumnos;\n int aprobados = 0, suspensos = 0; // definición e instanciación de varias a la vez\n int suficentes = 0, bienes = 0, notables = 0, sobresalientes = 0;\n float totalNotas = 0;\n float media;\n Scanner in = new Scanner(System.in);\n\n // Salismos del bucle sólo si nos introduce un número positivo\n do {\n System.out.println(\"Introduzca el número de alumnos/as: \");\n numeroAlumnos = in.nextInt();\n } while (numeroAlumnos <= 0);\n\n // Como sabemos el número de alumnos es un bucle definido\n for (int i = 1; i <= numeroAlumnos; i++) {\n float nota = 0;\n\n // nota solo existe dentro de este for, por eso la definimos aquí.\n do {\n System.out.println(\"Nota del alumno \" + i + \" [0-10]: \");\n nota = in.nextFloat();\n } while (nota < 0 || nota > 10);\n\n // Sumamos el total de notas\n totalNotas += nota;\n\n if (nota < 5) {\n suspensos++;\n } else if (nota >= 5 && nota < 6) {\n aprobados++;\n suficentes++;\n } else if (nota >= 6 && nota < 7) {\n aprobados++;\n bienes++;\n } else if (nota >= 7 && nota < 9) {\n aprobados++;\n notables++;\n } else if (nota >= 9) {\n aprobados++;\n sobresalientes++;\n }\n }\n // De esta manera redondeo a dos decimales. Tengo que hacer un casting porque de Double quiero float\n // Si no debería trabajar con double siempre.\n media = (float) (Math.round((totalNotas / numeroAlumnos) * 100.0) / 100.0);\n\n // Sacamos las estadísticas\n System.out.println(\"Número de alumnos/as: \" + numeroAlumnos);\n System.out.println(\"Número de aprobados/as: \" + aprobados);\n System.out.println(\"Número de suspensos: \" + suspensos);\n System.out.println(\"Nota media: \" + media);\n System.out.println(\"Nº Suficientes: \" + suficentes);\n System.out.println(\"Nº Bienes: \" + bienes);\n System.out.println(\"Nº Notables: \" + notables);\n System.out.println(\"Nº Sobresalientes: \" + sobresalientes);\n\n\n }",
"double getExtremeSpikeProbability();",
"public double p(double t) {\r\n\r\n double Util = Umin + (1 - f(t)) * (Umax - Umin) ;\r\n // too soon to receive such low utility\r\n if(negotiationSession.getTime() < 0.7 && Util < 0.75){\r\n Util = 0.75 ;\r\n }\r\n return Util;\r\n }",
"public double quaterlyHealthInsurance(){\n return (this.healthInsurancePerAnnum*4)/12;\n }",
"public float perimetro() {\n return (lado * 2 + base);\r\n }",
"public void adjust_FineFuelMoisture(){\r\n\t// If FFM is one or less we set it to one\t\t\r\n\tif ((FFM-1)<=0){\r\n\t\tFFM=1;\r\n\t}else{\r\n\t\t//add 5 percent FFM for each Herb stage greater than one\r\n\t\tFFM=FFM+(iherb-1)*5;\r\n\t}\r\n}",
"public double getPowerUpProbabilityPillar() {\n \t\treturn 0.15;\n \t}",
"@Override\r\n\tpublic float chekearDatos(){\r\n\t\t\r\n\t\tfloat monto = 0f;\r\n\t\tfloat montoPorMes = creditoSolicitado/plazoEnMeses;\r\n\t\tdouble porcentajeDeSusIngesosMensuales = (cliente.getIngresosMensuales()*0.7);\r\n\t\t\r\n\t\tif(cliente.getIngresoAnual()>=15000f && montoPorMes<=porcentajeDeSusIngesosMensuales){\r\n\t\t\t\r\n\t\t\tmonto = this.creditoSolicitado;\r\n\t\t\tsetEstadoDeSolicitud(true);\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t\treturn monto;\r\n\t}",
"public int promedio() {\r\n // calculo y redondeo del promedio\r\n promedio = Math.round(nota1B+nota2B);\r\n // paso de Double a Int\r\n return (int) promedio;\r\n }",
"int getRemainderPercent();",
"public void calcularQuinA(){\n sueldoQuinAd = sueldoMensual /2;\n\n }",
"public void calcularEntropia(){\n //Verificamos si será con la misma probabilida o con probabilidad\n //especifica\n if(contadorEstados == 0){\n //Significa que será con la misma probabilidad por lo que nosotros\n //calcularemos las probabilidades individuales\n for(int i = 0; i < numEstados; i++){\n probabilidadEstados[i] = 1.0 / numEstados;\n }\n }\n for(int i = 0; i < numEstados; i++){\n double logEstado = Math.log10(probabilidadEstados[i]);\n logEstado = logEstado * (-1);\n double logDos = Math.log10(2);\n double divisionLog = logEstado / logDos;\n double entropiaTmp = probabilidadEstados[i] * divisionLog;\n resultado += entropiaTmp;\n }\n }",
"@Override\r\n public void hallarPerimetro() {\r\n this.perimetro = this.ladoA*3;\r\n }",
"public void coupCritique(Personnage ennemi, double valeur) throws InterruptedException { // Allows a critical strike\n\t\tint x;\n\t\tx = (int) (Math.random() * 10);\n\t\tif (x <= valeur) { // Proba valeur+1/10\n\t\t\tennemi.setHp(ennemi.getHp() - (this.getStrength()));\n\t\t\tUtilitaire.lettreParLettre(\"Coup critique !!!\");\n\t\t}\n\n\t}",
"float getBonusPercentHP();",
"public void popier() {\n Scanner input1 = new Scanner(System.in);\n //Ivedame vaiku skaiciu\n Scanner input2 = new Scanner(System.in);\n //Idame tevu skaiciu\n Scanner input3 = new Scanner(System.in);\n\n System.out.println(\"Iveskite atlyginimą ant popieriaus: \");\n double atlyginimas = input1.nextDouble();\n\n System.out.println(\"Iveskite turimų vaikų iki 18 metų skaičių.\");\n int vaikai = input2.nextInt();\n if (vaikai == 0) {\n\n //Apskaiciuojame NPD\n double npd = 310 - 0.5 * (atlyginimas - 380);\n if (npd >= 0)\n System.out.println(\"NPD: \" + npd);\n else\n System.out.println(\"NPD: \" + 0);\n\n //Bendras NPD\n double bnpd = npd;\n System.out.println(\"Bendras NPD: \" + bnpd);\n\n //Darbuotojo mokesciai\n System.out.println(\"\\nDarboutojo mokesčiai:\");\n\n //Apskaiciuojame GPM\n //Gauname neapmokestinama dali\n double nep = atlyginimas - bnpd;\n\n //GPM 15%\n double gpm = nep * 1.15 - nep;\n System.out.printf(\"Pajamu mokestis (GPM): %.2f %n\", gpm);\n\n //Apskaiciuojame PSD 6%\n double psd = atlyginimas * 1.06 - atlyginimas;\n System.out.printf(\"Sveikatos draudimas (PSD): %.2f %n\", psd);\n\n //Apskaiciuojame pensija ir soc draudima 3%\n double soc = atlyginimas * 1.03 - atlyginimas;\n System.out.printf(\"Pensijų ir soc. Draudimas: %.2f %n\", soc);\n\n\n //Darbdavio mokesciai\n System.out.println(\"\\nDabdavio mokami mokesčiai:\");\n\n //Sodros imoka 30.98%\n double sod = atlyginimas * 1.3098 - atlyginimas;\n System.out.printf(\"Sodros įmoka (VSD): %.2f %n\", sod);\n\n // Imoka i garantini fonda 0.2%\n double gar = atlyginimas * 1.002 - atlyginimas;\n System.out.printf(\"Įmokos į Garantinį fondą: %.2f %n\", gar);\n\n //Uzmokestis i rankas\n double rank = atlyginimas - gpm - psd - soc;\n System.out.printf(\"%nUžmokestis gaunamas į rankas: %.2f %n\", rank);\n\n //Darbo vietos kaina\n double viet = atlyginimas + sod + gar;\n System.out.printf(\"Darbo vietos kaina darbdaviui: %.2f\", viet);\n\n\n } else {\n\n System.out.println(\"Keliese auginate vaikus?\");\n int tevai = input3.nextInt();\n\n\n //Apskaiciuojame NPD\n double npd = 310 - 0.5 * (atlyginimas - 380);\n if (npd >= 0)\n System.out.println(\"NPD: \" + npd);\n else\n System.out.println(\"NPD: \" + 0);\n\n //Apskaiciuojame PNPD\n double pnpd = (200 * vaikai) / tevai;\n System.out.println(\"PNPD: \" + pnpd);\n\n //Bendras NPD\n double bnpd = npd + pnpd;\n System.out.println(\"Bendras NPD: \" + bnpd);\n\n //Darbuotojo mokesciai\n System.out.println(\"\\nDarboutojo mokesčiai:\");\n\n //Apskaiciuojame GPM\n //Gauname neapmokestinama dali\n double nep = atlyginimas - bnpd;\n\n //GPM 15%\n double gpm = nep * 1.15 - nep;\n System.out.printf(\"Pajamu mokestis (GPM): %.2f %n\", gpm);\n\n //Apskaiciuojame PSD 6%\n double psd = atlyginimas * 1.06 - atlyginimas;\n System.out.printf(\"Sveikatos draudimas (PSD): %.2f %n\", psd);\n\n //Apskaiciuojame pensija ir soc draudima 3%\n double soc = atlyginimas * 1.03 - atlyginimas;\n System.out.printf(\"Pensijų ir soc. Draudimas: %.2f %n\", soc);\n\n\n //Darbdavio mokesciai\n System.out.println(\"\\nDabdavio mokami mokesčiai:\");\n\n //Sodros imoka 30.98%\n double sod = atlyginimas * 1.3098 - atlyginimas;\n System.out.printf(\"Sodros įmoka (VSD): %.2f %n\", sod);\n\n // Imoka i garantini fonda 0.2%\n double gar = atlyginimas * 1.002 - atlyginimas;\n System.out.printf(\"Įmokos į Garantinį fondą: %.2f %n\", gar);\n\n //Uzmokestis i rankas\n double rank = atlyginimas - gpm - psd - soc;\n System.out.printf(\"%nUžmokestis gaunamas į rankas: %.2f %n\", rank);\n\n //Darbo vietos kaina\n double viet = atlyginimas + sod + gar;\n System.out.printf(\"Darbo vietos kaina darbdaviui: %.2f\", viet);\n\n }\n\n\n\n }",
"private void figureOutProbability() {\n\t\tMysqlDAOFactory mysqlFactory = (MysqlDAOFactory) DAOFactory\n\t\t\t\t.getDAOFactory(DAOFactory.MYSQL);\n\n\t\tstaticPr = new StaticProbability(trialId);\n\t\tstatisticPr = new StatisticProbability(trialId);\n\t\tstaticProbability = staticPr.getProbability();\n\t\tstatisticProbability = statisticPr.getProbability();\n\n\t\tfor (Entry<Integer, BigDecimal> entry : staticProbability.entrySet()) {\n\t\t\ttotalProbability.put(\n\t\t\t\t\tentry.getKey(),\n\t\t\t\t\tentry.getValue().add(statisticProbability.get(entry.getKey())).setScale(2));\n\t\t}\n\n\t\tBigDecimal summaryProbability = BigDecimal.valueOf(0);\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tsummaryProbability = summaryProbability.add(entry.getValue());\n\t\t}\n\t\t\n\t\t// figures out probability\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tentry.setValue(entry.getValue().divide(summaryProbability, 2,\n\t\t\t\t\tBigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Total probability -> \" + totalProbability);\n\t\t\n\t\t// figures out and sets margin\n\t\tfor (Entry<Integer, BigDecimal> entry : totalProbability.entrySet()) {\n\t\t\tBigDecimal probability = entry.getValue();\n\t\t\tBigDecimal winCoefficient = (BigDecimal.valueOf(1.).divide(\n\t\t\t\t\tprobability, 2, BigDecimal.ROUND_HALF_UP))\n\t\t\t\t\t.multiply(BigDecimal.valueOf(1.).subtract(Constants.MARGIN));\n\t\t\tentry.setValue(winCoefficient.setScale(2, BigDecimal.ROUND_HALF_UP));\n\t\t}\n\t\tlog.info(\"Winning coefficient -> \" + totalProbability);\n\t\t\n\t\t// updates info in db\n\t\tTrialHorseDAO trialHorseDAO = mysqlFactory.getTrialHorseDAO();\n\t\tTrialHorseDTO trialHorseDTO = null;\n\t\tfor(Entry<Integer, BigDecimal> entry : totalProbability.entrySet()){\n\t\t\ttrialHorseDTO = trialHorseDAO.findTrialHorseByTrialIdHorseId(trialId, entry.getKey());\n\t\t\ttrialHorseDTO.setWinCoefficient(entry.getValue());\n\t\t\ttrialHorseDAO.updateTrialHorseInfo(trialHorseDTO);\n\t\t}\t\n\t}",
"public void daiMedicina() {\n System.out.println(\"Vuoi curare \" + nome + \" per 200 Tam? S/N\");\n String temp = creaturaIn.next();\n if (temp.equals(\"s\") || temp.equals(\"S\")) {\n puntiVita += 60;\n soldiTam -= 200;\n }\n checkStato();\n }",
"private double convert() {\n\t\t// modulus is private, but we have the getter\n\t\treturn riskNeutralProbabilityUp * (randomGenerator.getModulus() - 1);\n\t}",
"int range(){\n return fuelcap*mpg;\n }",
"public int prIce_Per_GUeSt(int NO_OF_PEOPLE){\r\n if (NO_OF_PEOPLE>50){\r\n price_per_guest=lower_price_per_guest;\r\n System.out.println(\"PER_PERSON_PRICE = \"+lower_price_per_guest);\r\n int total_price = price_per_guest* NO_OF_PEOPLE;\r\n return total_price;\r\n }\r\n else\r\n {price_per_guest=Highest_price_per_guest;\r\n int total_price = price_per_guest* NO_OF_PEOPLE;\r\n System.out.println(\"PER_PERSON_PRICE = \"+Highest_price_per_guest);\r\n return total_price;}\r\n }",
"public double getHonesty(){\n\t\treturn (this.pct_honest);\n\t}",
"@Override\n public double salario() {\n return 2600 * 1.10;\n }",
"@Override\n public void tirar() {\n if ( this.probabilidad == null ) {\n super.tirar();\n this.valorTrucado = super.getValor();\n return;\n }\n \n // Necesitamos conocer la probabilidad de cada número, trucados o no, para ello tengo que saber\n // primero cuantos números hay trucados y la suma de sus probabilidades. \n // Con esto puedo calcular la probabilidad de aparición de los números no trucados.\n \n int numeroTrucados = 0;\n double sumaProbalidadesTrucadas = 0;\n double probabilidadNoTrucados = 0;\n \n for ( double p: this.probabilidad ) { // cálculo de la suma números y probabilidades trucadas\n if ( p >= 0 ) {\n numeroTrucados++;\n sumaProbalidadesTrucadas += p;\n }\n }\n \n if ( numeroTrucados < 6 ) { // por si estuvieran todos trucados\n probabilidadNoTrucados = (1-sumaProbalidadesTrucadas) / (6-numeroTrucados);\n }\n\n double aleatorio = Math.random(); // me servirá para escoger el valor del dado\n \n // Me quedo con la cara del dado cuya probabilidad de aparición, sumada a las anteriores, \n // supere el valor aleatorio\n double sumaProbabilidades = 0;\n this.valorTrucado = 0;\n do {\n ++this.valorTrucado;\n if (this.probabilidad[this.valorTrucado-1] < 0) { // no es una cara del dado trucada\n sumaProbabilidades += probabilidadNoTrucados;\n } else {\n sumaProbabilidades += this.probabilidad[this.valorTrucado-1];\n }\n \n } while (sumaProbabilidades < aleatorio && valorTrucado < 6);\n \n \n }",
"@Override\n public int calculerPerimetre() {\n return (int)(rayon * 2 * Math.PI);\n }",
"public void toiGianPhanSo(){\n int x = timUSCLN(tuSo,mauSo);\n\n tuSo/=x;\n mauSo/=x;\n }",
"@Override\n\tpublic double fiyatlandir() {\n\t\treturn 7.95;\n\t}",
"public boolean muerteInesperada() {\n r = new Random();\r\n return Float.compare(r.nextFloat(), probMuerte) <= 0;\r\n }",
"int getSoilMoistureLevel(int soilMoistureMM);",
"private void giveScords(){\n \t//bingo 題數, seconds花費秒數\n \tint totalSec = (int)seconds;\n \t\n \tif(correct){\n \t\tif(totalSec<=5){\n \t\t\tuserPoints = userPoints + 150;\n \t\t}else if(totalSec<=10){\n \t\t\tuserPoints = userPoints + 125;\n \t\t}else if(totalSec<=15){\n \t\t\tuserPoints = userPoints + 100;\n \t\t}else if(totalSec<=20){\n \t\t\tuserPoints = userPoints + 80;\n \t\t}\n \t}\n }",
"float genChance();",
"public void calcular() {\n int validar, c, d, u;\n int contrasena = 246;\n c = Integer.parseInt(spiCentenas.getValue().toString());\n d = Integer.parseInt(spiDecenas.getValue().toString());\n u = Integer.parseInt(spiUnidades.getValue().toString());\n validar = c * 100 + d * 10 + u * 1;\n //Si es igual se abre.\n if (contrasena == validar) {\n etiResultado.setText(\"Caja Abierta\");\n }\n //Si es menor nos indica que es mas grande\n if (validar < contrasena) {\n etiResultado.setText(\"El número secreto es mayor\");\n }\n //Si es mayot nos indica que es mas pequeño.\n if (validar > contrasena) {\n etiResultado.setText(\"El número secreto es menor\");\n }\n }",
"public void sueldo(){\n if(horas <= 40){\n sueldo = horas * cuota;\n }else {\n if (horas <= 50) {\n sueldo = (40 * cuota) + ((horas - 40) * (cuota * 2));\n } else {\n sueldo = ((40 * cuota) + (10 * cuota * 2)) + ((horas - 50) + (cuota * 3));\n }\n }\n\n }",
"public static double provjera() {\r\n\t\t\t\t\r\n\t\t\t\tdouble broj = 0;\t\r\n\t\t\t\tboolean provjera = true;\t\r\n\t\t\t\tdo {\r\n\t\t\t\t\t//ucitavanje unosa i provjera da li je int\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbroj = unos.nextDouble();\t\r\n\t\t\t\t\t\t//ako je sve ok, vrati broj\t\r\n\t\t\t\t\t\tprovjera = false;\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//hvata greska i trazi ponovni unos\r\n\t\t\t\t\tcatch (InputMismatchException ex) {\t\r\n\t\t\t\t\t\tSystem.out.println(\"Pogresan unos. Pokusajte ponovo: \");\r\n\t\t\t\t\t\tunos.nextLine();\r\n\t\t\t\t\t}\r\n\t\t\t\t} while (provjera);\r\n\t\t\t\t\r\n\t\t\t\treturn broj;\r\n\t\t}",
"public double people(double precis,double plagiarism,double poster,double video,double presentation,double portfolio,double reflection,double examination,double killerRobot)\n {\n double a = ((4%100)*precis)/100;\n double b = ((8%100)*plagiarism)/100;\n double c = ((12%100)*poster)/100;\n double d = ((16%100)*video)/100;\n double e = ((12%100)*presentation)/100;\n double f = ((10%100)*portfolio)/100;\n double g = ((10%100)*reflection)/100;\n double h = ((16%100)*examination)/100;\n double i = ((12%100)*killerRobot)/100;\n double grade = ((a+b+c+d+e+f+g+h+i)/8);//*100;\n return grade;\n }",
"int getToughness(Unit unit);",
"@Override\n public double perimetro() {\n return 4 * this.lado;\n }",
"public double dlugoscOkregu() {\n\t\treturn 2 * Math.PI * promien;\n\t}",
"float getWetness();",
"float getMonatl_kosten();",
"@Override\n public float calculaPreu(PreuTipusHabitacio p) {\n return p.getPreu() * this.perc;\n }",
"protected final int calculateInterst1(int pr){\n\t\t return pr*10*1/100;\n\t }",
"public int getProteksi(){\n\t\treturn (getTotal() - getPromo()) * protectionCost / 100;\n\t}",
"public int getCoeficienteBernua()\n {\n return potenciaCV;\n }",
"public float perimetro(){\r\n return 2*(float)Math.PI*radio;\r\n }",
"@Override\n\tpublic double ChuVi() {\n\n\t\treturn (banKinh*2*P);\n\t}",
"int getSatMod(){\n return getPercentageValue(\"satMod\");\n }",
"@Override\n\tpublic String StatistiqueNbrRisuqe(){\n float m= accountRepository.NbrStatus(\"a risque\");\n float s=accountRepository.NbrStatus(\"Stable\");\n float res =( m / s)*100;\n return res+\"%\";\n\n\t}",
"public int precioFinal(){\r\n int monto=super.PrecioFinal();\r\n\t \t \r\n\t if (pulgadas>40){\r\n\t monto+=precioBase*0.3;\r\n\t }\r\n\t if (sintonizador){\r\n\t monto+=50;\r\n\t }\r\n\t \r\n\t return monto;\r\n\t }",
"private double gradeQuiz() {\n int numCorrect = getNumberCorrect();\n double percentage = (numCorrect / numQuestions) * 100;\n return percentage;\n }",
"int getSat(){\n return getPercentageValue(\"sat\");\n }",
"protected abstract float _getGrowthChance();",
"public static void Promedio(){\n int ISumaNotas=0;\n int IFila=0,ICol=0;\n int INota;\n float FltPromedio;\n for(IFila=0;IFila<10;IFila++)\n {\n ISumaNotas+=Integer.parseInt(StrNotas[IFila][1]);\n }\n FltPromedio=ISumaNotas/10;\n System.out.println(\"El promedio de la clase es:\"+FltPromedio);\n }",
"@Override\r\n public void convert(int wa) {\n hasil1 = wa / menit;\r\n String wat = Integer.toString(hasil1);\r\n hasil = wat + \" Menit \";\r\n }",
"public int getHealthGain();",
"public static void main(String[] args) {\n int work=6*5*17;\n System.out.println(work);\n\n // Print the percentage of the coding hours in the semester if the average\n // work hours weekly is 52\n float avrage=52;\n float all =17*24*7;\n float parcantage = (52*17)/all*100;\n System.out.println(parcantage+\"%\");\n\n\n\n }",
"@Override\n\tpublic double DienTich() {\n\t\treturn (Math.sqrt(banKinh)*P);\n\t}",
"@Override\n public void cantidad_Punteria(){\n punteria=69.5+05*nivel+aumentoP;\n }",
"public static double exercise04(){\n double belarusSquare = 207.595;\n double ukraineSquare = 603.628;\n\n double relation = belarusSquare / ukraineSquare;\n System.out.println(\"Sootnowenie plowadi dvuh stran \\t \" + relation);\n return belarusSquare;\n }",
"public void hallarPerimetroEscaleno() {\r\n this.perimetro = this.ladoA+this.ladoB+this.ladoC;\r\n }",
"@Override\n\tpublic double DienTich() {\n\t\treturn (canhGoc*canhGoc);\n\t}",
"public void hallarPerimetroIsosceles() {\r\n this.perimetro = 2*(this.ladoA+this.ladoB);\r\n }",
"public float calcular(float dinero, float precio) {\n // Cálculo del cambio en céntimos de euros \n cambio = Math.round(100 * dinero) - Math.round(100 * precio);\n // Se inicializan las variables de cambio a cero\n cambio1 = 0;\n cambio50 = 0;\n cambio100 = 0;\n // Se guardan los valores iniciales para restaurarlos en caso de no \n // haber cambio suficiente\n int de1Inicial = de1;\n int de50Inicial = de50;\n int de100Inicial = de100;\n \n // Mientras quede cambio por devolver y monedas en la máquina \n // se va devolviendo cambio\n while(cambio > 0) {\n // Hay que devolver 1 euro o más y hay monedas de 1 euro\n if(cambio >= 100 && de100 > 0) {\n devolver100();\n // Hay que devolver 50 céntimos o más y hay monedas de 50 céntimos\n } else if(cambio >= 50 && de50 > 0) {\n devolver50();\n // Hay que devolver 1 céntimo o más y hay monedas de 1 céntimo\n } else if (de1 > 0){\n devolver1();\n // No hay monedas suficientes para devolver el cambio\n } else {\n cambio = -1;\n }\n }\n \n // Si no hay cambio suficiente no se devuelve nada por lo que se\n // restauran los valores iniciales\n if(cambio == -1) {\n de1 = de1Inicial;\n de50 = de50Inicial;\n de100 = de100Inicial;\n return -1;\n } else {\n return dinero - precio;\n }\n }",
"public int getWorth() { return 1; }",
"public double hci(double out,double device,double design,double hciExam)\n {\n double a = ((12.5%100)*out)/100;\n double b = ((12.5%100)*device)/100;\n double c = ((25%100)*design)/100;\n double d = ((50%100)*hciExam)/100;\n double grade = ((a+b+c+d)/8);//*100;\n return grade;\n }",
"int getLumOff(){\n return getPercentageValue(\"lumOff\");\n }",
"@Override\n\tpublic double compete() {\n\t\tdouble result=MyTools.getRandomNum(500, 800);\n\t\tsetThisResult(result);\n\t\treturn result;\n\t}",
"public double calcularPerimetro() {\n\t\treturn 2 * (base + altura);\n\t}",
"int getHPValue();",
"public double periculosidade(double salario) {\n\t\t\tsalario = salario * 0.3;\r\n\t\t\t// atribui o valor de 30% ao salario e somando eles.\r\n\t\t\t// salarioTotal = salario + salarioTotal;\r\n\r\n\t\t\treturn salario; // So atribuir esse valor no salario\r\n\t\t\r\n\t}",
"int getHPPerSecond();",
"public float impuestoAplicado();",
"private Map<String,Double> getPromedioHabilidades(Cuadrilla cuadrilla){\n\t\tSystem.out.println(\"#### getPromedioHabilidades ######\");\n\t\tdouble proprod= 0, protrae= 0, prodorm = 0, prodcaa = 0;\n\t\tint cantper = 0;\n\t\tfor (CuadrillasDetalle cd : cuadrilla.getCuadrillasDetalles()) {\n\t\t\t\n\t\t\tList<TecnicoCompetenciaDetalle> tcds = \tcd.getTecnico().getTecnicoCompetenciaDetalles();\n\t\t\tfor (TecnicoCompetenciaDetalle tcd : tcds) {\n\t\t\t\tInteger codigoComp = tcd.getCompetencia().getCodigoCompetencia();\n\t\t\t\tswitch(codigoComp){\n\t\t\t\t\tcase COMPETENCIA_PRODUCTIVIDAD:\n\t\t\t\t\t\tproprod = proprod+ tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_TRABAJO_EQUIPO:\n\t\t\t\t\t\tprotrae = protrae + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_ORIENTACION_METAS:\n\t\t\t\t\t\tprodorm = prodorm + tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase COMPETENCIA_CALIDAD_ATENCION:\n\t\t\t\t\t\tprodcaa = prodcaa +tcd.getGradoCompetencia().doubleValue();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcantper++;\t\t\t\n\t\t}\n\t\t\t\t\t\n\t\t// promedio de las competencias de los tenicos de cada cuadrilla\n\t\tproprod = proprod/cantper; \n\t\tprotrae = protrae/cantper;\n\t\tprodorm = prodorm/cantper;\n\t\tprodcaa = prodcaa/cantper;\n\n\t\tMap<String, Double> mpproms = new LinkedHashMap<String,Double>();\n\t\tmpproms.put(\"proprod\", proprod);\n\t\tmpproms.put(\"protrae\", protrae);\n\t\tmpproms.put(\"prodorm\", prodorm);\n\t\tmpproms.put(\"prodcaa\", prodcaa);\n\t\n\t\treturn mpproms;\n\t\t\n\t}",
"public static float pu2mw(float pwr) {return pwr*100F;}",
"public double getNecrosisPercentage()\r\n \t{\r\n \t\treturn necrosisPercentage;\r\n \t}",
"public float getChance()\n {\n return 1.0f;\n }",
"public int calcularIMC(){\r\n\t\t//Calculamos el peso de la persona\r\n\t\tdouble pesoActual=peso/(Math.pow(altura, 2));\r\n\t\t//Segun el peso, devuelve un codigo\r\n\t\tif (pesoActual>=18.75 && pesoActual<=24.9){\r\n\t\t\treturn NORMAL;\r\n\t\t}else if(pesoActual<18.75){\r\n \t\t\treturn DELGADO;\r\n \t\t}else{\r\n \t\t\treturn SOBREPESO;\r\n \t\t}\r\n \t}",
"public float calcularPerimetro(){\n return baseMayor+baseMenor+(medidaLado*2);\n }",
"int getPulsePercentage();",
"double getMissChance();",
"@Override\n\tprotected double calcularImpuestoVehiculo() {\n\t\treturn this.getValor() * 0.003;\n\t}",
"public double mediaHabitantes() {\r\n\treturn totalHabitantes() / numCiudades();\r\n \r\n }"
] | [
"0.666467",
"0.6657302",
"0.6365765",
"0.6354436",
"0.6259165",
"0.6249999",
"0.62325627",
"0.614709",
"0.611902",
"0.60839045",
"0.60445845",
"0.604384",
"0.6014643",
"0.60083157",
"0.59793913",
"0.5972709",
"0.5964756",
"0.5927717",
"0.59082574",
"0.5898447",
"0.58914953",
"0.5890593",
"0.5874062",
"0.5860535",
"0.5855817",
"0.5852724",
"0.5849496",
"0.58494925",
"0.5835607",
"0.5832845",
"0.58322084",
"0.58308715",
"0.5823526",
"0.5823114",
"0.5822829",
"0.5814121",
"0.5807852",
"0.5794694",
"0.5793949",
"0.578526",
"0.57836616",
"0.577355",
"0.5768992",
"0.5765702",
"0.576309",
"0.57593906",
"0.5751482",
"0.57429624",
"0.57414937",
"0.57387114",
"0.5736041",
"0.5730038",
"0.57292473",
"0.5726555",
"0.57252294",
"0.5719448",
"0.57183594",
"0.57183075",
"0.57180184",
"0.57163674",
"0.57077783",
"0.5707184",
"0.5704173",
"0.5699328",
"0.56964236",
"0.5687924",
"0.5687236",
"0.5685667",
"0.567903",
"0.5677656",
"0.5676367",
"0.56743956",
"0.56697655",
"0.5660579",
"0.5646195",
"0.5645959",
"0.5640145",
"0.5636861",
"0.56312805",
"0.5625945",
"0.5622418",
"0.562228",
"0.56167173",
"0.5615085",
"0.5612293",
"0.56059605",
"0.56044364",
"0.56043005",
"0.5603636",
"0.5596611",
"0.5586423",
"0.5584528",
"0.55839086",
"0.5581021",
"0.55727124",
"0.5562758",
"0.55604744",
"0.55600214",
"0.5558877",
"0.55500704"
] | 0.61026084 | 9 |
Created by SS on 2016/06/09. | public interface IfStatementReceiver {
default IfSqlParseResult receive(Select statement) {
return null;
}
default IfSqlParseResult receive(Insert statement) {
return null;
}
default IfSqlParseResult receive(Update statement) {
return null;
}
default IfSqlParseResult receive(Delete statement) {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public void mo38117a() {\n }",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n protected void getExras() {\n }",
"protected boolean func_70814_o() { return true; }",
"private void poetries() {\n\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void interr() {\n\t}",
"public void gored() {\n\t\t\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"private void kk12() {\n\n\t}",
"public Pitonyak_09_02() {\r\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \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\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"private void init() {\n\n\t}",
"private void m50366E() {\n }",
"public void mo6081a() {\n }",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n public void init() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n void init() {\n }",
"@Override\n protected void init() {\n }",
"@Override\r\n\tpublic void init() {}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\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 }",
"protected MetadataUGWD() {/* intentionally empty block */}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void init() {}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tprotected void initialize() {\n\n\t}",
"public void mo12930a() {\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"public void mo12628c() {\n }",
"public void mo21877s() {\n }",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"public void mo55254a() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}"
] | [
"0.59416574",
"0.5848951",
"0.5764757",
"0.5741721",
"0.5740864",
"0.5740864",
"0.5720067",
"0.5717008",
"0.5699098",
"0.56623894",
"0.5651534",
"0.561687",
"0.56143343",
"0.5587393",
"0.5542929",
"0.55221534",
"0.5519282",
"0.55178297",
"0.55054164",
"0.5504753",
"0.550189",
"0.5489143",
"0.5481576",
"0.548014",
"0.54791856",
"0.5467939",
"0.5467939",
"0.5467939",
"0.5467939",
"0.5467939",
"0.54646933",
"0.5444761",
"0.5436571",
"0.5435424",
"0.541409",
"0.5409984",
"0.5409984",
"0.5409984",
"0.5409984",
"0.5409984",
"0.5409984",
"0.5409984",
"0.54064107",
"0.5405733",
"0.53862673",
"0.5386083",
"0.5379646",
"0.5379646",
"0.5369753",
"0.5369753",
"0.5367979",
"0.5364093",
"0.53592384",
"0.53574985",
"0.53574985",
"0.53574985",
"0.5349575",
"0.5344936",
"0.5344936",
"0.5344936",
"0.53366005",
"0.5336167",
"0.53326523",
"0.53287387",
"0.5326907",
"0.5326903",
"0.5323101",
"0.5323101",
"0.5323101",
"0.53193384",
"0.53154755",
"0.5315174",
"0.5315174",
"0.5315174",
"0.5315174",
"0.5315174",
"0.5315174",
"0.53117126",
"0.5311412",
"0.53073967",
"0.53070986",
"0.53019357",
"0.5299572",
"0.52967316",
"0.5296519",
"0.52962977",
"0.5292347",
"0.5290231",
"0.52890474",
"0.5283888",
"0.5282748",
"0.5282748",
"0.52778065",
"0.5274319",
"0.52720517",
"0.52658206",
"0.5263044",
"0.5262761",
"0.52610594",
"0.52540106",
"0.52527785"
] | 0.0 | -1 |
Do we add an ID to the pathway to create a certain friend request? | @ResponseStatus(HttpStatus.CREATED)
@RequestMapping(value = "", method = RequestMethod.POST)
public FriendsList createRequest(@Valid @RequestBody NewFriendRequestDTO friendRequestDTO, Principal principal) {
FriendsList friendsList = buildRequestFromRequestDTO(friendRequestDTO);
friendsList = friendListDAO.newRequest(friendsList);
if(friendsList.isApproved()) {
return friendsList;
}
return friendsList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Future<Person> createRelationship( String personId, String friendId );",
"boolean hasFriendId();",
"public void acceptFriendRequest(Friend friend);",
"void addFriendWithPhoneNumber(Friend friend, String phoneNumber);",
"void acceptRequest(Friend pendingRequest);",
"java.lang.String getFriendId();",
"java.lang.String getFriendId();",
"@RequestMapping(method = RequestMethod.POST, value = \"/friendship/{userId}/{friendId}\")\n public ResponseEntity<Friendship> newFriendship(\n @PathVariable(value = \"userId\") Long userId,\n @PathVariable(value = \"friendId\") Long friendId) {\n\n // TODO re-implement to be able to retrieve Long ID values from POST body\n\n // handle bad, malformed, and absent fields in input\n if (!isValidIdValue(userId) || !isValidIdValue(friendId)) {\n return new ResponseEntity(null, null, HttpStatus.NOT_ACCEPTABLE);\n }\n\n // TODO check that friendship does not exist already before adding a new one\n boolean isFriend = friendshipService.isFriend(userId, friendId);\n\n Friendship newFriendship = new Friendship(userId, friendId);\n Friendship createdFriend = friendshipService.newFriendship(newFriendship);\n return new ResponseEntity(createdFriend, null, HttpStatus.CREATED);\n\n }",
"public Builder setFriendId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000080;\n friendId_ = value;\n \n return this;\n }",
"public static int friendRequest(int senderid, int friendid){\n try {\n Statement st = conn.createStatement();\n String sqlString = String.format(\"UPDATE users SET friendreq = friendreq || '{%d}' WHERE userid = %d\", senderid, friendid);\n int rowAffected = st.executeUpdate(sqlString);\n System.out.println(\"affected \" + rowAffected +\"rows\");\n st.close();\n return SUCCESS;\n }catch (SQLException e){\n return SERVER_FAILURE;\n }\n }",
"public Friend createFriend();",
"public Friend createFriendWithAddress(String address);",
"public static void acceptRequest(String userId, String userEmail, String userName,\n String friendId, String friendEmail, String friendName) {\n // add user data to a map\n Map<String, Object> thisMap = new HashMap<>();\n thisMap.put(Const.FRIEND_ID_KEY, userId);\n thisMap.put(Const.USER_EMAIL_KEY, userEmail);\n thisMap.put(Const.USER_NAME_KEY, userName);\n\n // add friend data to a map\n Map<String, Object> otherMap = new HashMap<>();\n otherMap.put(Const.FRIEND_ID_KEY, friendId);\n otherMap.put(Const.USER_EMAIL_KEY, friendEmail);\n otherMap.put(Const.USER_NAME_KEY, friendName);\n\n // get a reference to the db\n FirebaseFirestore store = FirebaseFirestore.getInstance();\n\n Log.d(Const.TAG, \"acceptFriendRequest: access db \" + Thread.currentThread().getId());\n\n // delete the friend request\n store.collection(Const.USERS_COLLECTION)\n .document(userId)\n .collection(Const.USER_F_REQUESTS_COLLECTION)\n .document(friendId)\n .delete();\n\n // add each user to the friends sub-collection of the other user\n store.collection(Const.USERS_COLLECTION)\n .document(friendId)\n .collection(Const.USER_FRIENDS_COLLECTION)\n .document(userId)\n .set(thisMap);\n store.collection(Const.USERS_COLLECTION)\n .document(userId)\n .collection(Const.USER_FRIENDS_COLLECTION)\n .document(friendId)\n .set(otherMap);\n }",
"private void addFriend(String userId, String ownId) {\n String error = \"Adding friend failed!\";\n Map<String, Object> requested = new HashMap<>();\n requested.put(\"id\", userId);\n requested.put(\"status\", \"requested\");\n\n UserDatabase userDb = new UserDatabase(ownId);\n userDb.getChildCollection(\"friends\").document(userId).set(requested)\n .addOnSuccessListener(success -> {\n requested.clear();\n requested.put(\"id\", ownId);\n requested.put(\"status\", \"pending\");\n\n UserDatabase userDb1 = new UserDatabase(userId);\n userDb1.getChildCollection(\"friends\").document(ownId)\n .set(requested)\n .addOnSuccessListener(success1 -> userDb1.getChildCollection(\"unmessaged\")\n .document(ownId)\n .delete()\n .addOnSuccessListener(success2 -> userDb.getChildCollection(\"unmessaged\")\n .document(userId)\n .delete()\n .addOnSuccessListener(success3 -> {\n Map<String, Object> notification = new HashMap<>();\n notification.put(\"userId\", Login.getUserId());\n notification.put(\"notificationType\", \"New Friend\");\n Date mDate = new Date();\n long timeInMilliseconds = mDate.getTime();\n notification.put(\"createdAt\", timeInMilliseconds);\n\n FirebaseFirestore db = FirebaseFirestore.getInstance();\n db.collection(\"users\" + \"/\" + userId + \"/notifications\")\n .add(notification);\n\n buttonCancelRequest(userId, ownId);\n })\n .addOnFailureListener(fail -> handleError(error, fail)))\n .addOnFailureListener(fail -> handleError(error, fail)));\n })\n .addOnFailureListener(fail -> handleError(error, fail));\n }",
"AddFriendFromSelf.Rsp getAddFriendFromSelfRsp();",
"private static Integer canAddFriend(Integer userId, Integer receiverId, DatabaseConnection dc) {\n\t\t// Validate inputs\n\t\tif(userId == null || receiverId == null || userId < 1 || receiverId < 1 || dc == null) {\n\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed due to bad inputs\");\n\t\t\treturn KFAILURE;\n\t\t}\n\n\t\t// Verify user isn;t adding himself\n\t\tif(userId == receiverId) {\n\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed because userid = receiverid\");\t\t\t\n\t\t\treturn KSELF;\n\t\t}\n\n\t\t// Verify the two aren't already friends\n\t\tString query1 = \"SELECT datefriended FROM \" + friendsTable + \" WHERE \" + colFriend1 + \"=\" + userId + \" AND \" + colFriend2 + \"=\" + receiverId + \" LIMIT 1;\";\n\t\tString query2 = \"SELECT datefriended FROM \" + friendsTable + \" WHERE \" + colFriend2 + \"=\" + userId + \" AND \" + colFriend1 + \"=\" + receiverId + \" LIMIT 1;\";\n\t\ttry {\n\t\t\tResultSet rs = dc.executeQuery(query1);\n\t\t\tif (rs.first()) {\n\t\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed. You are already friends\");\n\t\t\t\treturn KFRIENDS;\n\t\t\t}\n\t\t\trs = dc.executeQuery(query2);\n\t\t\tif (rs.first()) {\n\t\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed. You are already friends\");\n\t\t\t\treturn KFRIENDS;\n\t\t\t} \n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed. SQLException\");\n\t\t\treturn KFAILURE;\n\t\t}\n\n\t\t// Check that no friend requests have been sent before\n\t\tString query3 = \"SELECT id FROM \" + messagesTable + \" WHERE \" + colSenderId + \"=\" + userId + \" AND \" + colReceiverId + \"=\" + receiverId + \" AND \" + colMsgType + \"=\" + friendRequestType + \" LIMIT 1;\";\n\t\tString query4 = \"SELECT id FROM \" + messagesTable + \" WHERE \" + colReceiverId + \"=\" + userId + \" AND \" + colSenderId + \"=\" + receiverId + \" AND \" + colMsgType + \"=\" + friendRequestType + \" LIMIT 1;\";\n\t\ttry {\n\t\t\tResultSet rs = dc.executeQuery(query3);\n\t\t\tif (rs.first()) {\n\t\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed. Request already pending\");\n\t\t\t\treturn KPENDING;\n\t\t\t}\n\t\t\trs = dc.executeQuery(query4);\n\t\t\tif (rs.first()) {\n\t\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed. Request already received from this person\");\n\t\t\t\treturn KCONFIRM;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"\\tAddFriendServlet.canAddFriend(): Failed. SQLException\");\n\t\t\treturn KFAILURE;\n\t\t}\n\n\t\t// User is not adding himself. User is not already friends with receiver. The user and the receiver have not previously sent each other a friend request.\n\t\treturn KSUCCESS;\t\t\n\t}",
"public boolean hasFriendId() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }",
"public boolean hasFriendId() {\n return ((bitField0_ & 0x00000080) == 0x00000080);\n }",
"public Builder setFriendId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n friendId_ = value;\n onChanged();\n return this;\n }",
"public void addFriend(String friend)\n\t{\n\t\tif(m_friends.size() < 10)\n\t\t{\n\t\t\tm_friends.add(friend);\n\t\t\tm_database.query(\"INSERT INTO `pn_friends` VALUES ((SELECT id FROM `pn_members` WHERE username = '\" + MySqlManager.parseSQL(m_username)\n\t\t\t\t\t+ \"'), (SELECT id FROM `pn_members` WHERE username = '\" + MySqlManager.parseSQL(friend) + \"')) ON DUPLICATE KEY UPDATE friendId = (SELECT id FROM `pn_members` WHERE username = '\"\n\t\t\t\t\t+ MySqlManager.parseSQL(friend) + \"');\");\n\t\t\tServerMessage addFriend = new ServerMessage(ClientPacket.FRIEND_ADDED);\n\t\t\taddFriend.addString(friend);\n\t\t\tgetSession().Send(addFriend);\n\t\t}\n\t}",
"public boolean addFriend(Neighbor requestedTo){\n boolean isAdded=false;\n try{\n database = dbH.getReadableDatabase();\n dbH.openDataBase();\n ContentValues values = new ContentValues();\n values.put(\"Username\", requestedTo.getInstanceName());\n values.put(\"deviceID\", requestedTo.getDeviceAddress());\n values.put(\"IP\", requestedTo.getIpAddress().getHostAddress());\n Log.i(TAG,\"Adding.. \"+requestedTo.getDeviceAddress());\n isAdded=database.insert(\"Friend\", null, values)>0;\n dbH.close();\n\n }\n catch(SQLException e){\n e.printStackTrace();\n }\n return isAdded;\n }",
"public void addFriendUI() throws IOException\n {\n System.out.println(\"Add friendship: id user1;id user2\");\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String line = reader.readLine();\n String[] a = line.split(\";\");\n Long id1 = Long.parseLong(a[0]);\n Long id2 = Long.parseLong(a[1]);\n Friendship friendship = new Friendship();\n friendship.setId(new Tuple<>(id1, id2));\n try\n {\n Friendship newFriendship = service.addFriendship(friendship);\n if(newFriendship != null)\n System.out.println(\"Friendship already exists for \" + friendship.getId().toString());\n else\n System.out.println(\"Friendship added successfully!\");\n }\n catch (ValidationException ex)\n {\n System.out.println(ex.getMessage());\n }\n catch (IllegalArgumentException ex)\n {\n System.out.println(ex.getMessage());\n }\n }",
"@Test\r\n\tpublic void testOutgoingFriendRequest() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tp1.nonDatabase = true;\r\n\t\tassertTrue(p1.newOutgoingFriendRequest(\"test\"));\r\n\t\tassertFalse(p1.newOutgoingFriendRequest(\"test\")); // Fail if duplicate\r\n\t}",
"public synchronized void addFriendRequest(FriendRequest req) {\n \t\t((List<FriendRequest>) getVariable(\"friendRequest\")).add(req);\n \t}",
"private boolean friendAlreadyAdded(User user, Object requestedUser) {\n List<UserContact> friendList = null;\n User friendToBe = null;\n try {\n DAO dao = new Query();\n friendList = user.getFriends(dao);\n dao.open();\n if (requestedUser instanceof String) {\n friendToBe = (User) dao.get(User.class, (String) requestedUser);\n } else if (requestedUser instanceof Request) {\n Request request = (Request) requestedUser;\n friendToBe = (User) dao.get(User.class, request.getFromId());\n }\n dao.close();\n } catch (Exception e) {\n //e.printStackTrace();\n }\n if (friendList != null && friendToBe != null) {\n if (friendList.contains(friendToBe.asContact())) {\n return true;\n }\n }\n return false;\n }",
"AddFriendFromOther.Rsp getAddFriendFromOtherRsp();",
"FriendList.Req getFriendlistReq();",
"public Builder setFriendIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000080;\n friendId_ = value;\n \n return this;\n }",
"public static ExecutionResult lookupFriendship(Universe universe, Node person, Node friend) {\n ExecutionEngine engine = new ExecutionEngine(universe.getGraphDb());\n String query = \"START p=node(\" + person.getId() + \"), s=node(\" + friend.getId() + \") MATCH (p)-[r:\" + RelationshipTypes.FRIENDS_WITH + \"]->s RETURN s.name\";\n return engine.execute(query);\n }",
"public static Friend sendFriendRequest(String accessToken, Integer friendId) {\n JsonObject jsonObject = new JsonObject();\n\n jsonObject.add(\"friend\", new JsonObject());\n\n try {\n JsonElement element = NetworkUtil.postWebService(jsonObject, NetworkUtil.FRIENDS_URI + \"/\" + friendId + FRIENDS_SEND_REQUEST_URI, accessToken);\n Log.i(Constants.TAG, \"result:\" + element.toString());\n if (element != null) {\n Gson gson = new Gson();\n\n Log.i(Constants.TAG, \"RETURNED : jsonObject:\" + element.getAsJsonObject().get(\"friend\").toString());\n Friend friend = gson.fromJson(\n element.getAsJsonObject().get(\"friend\"),\n Friend.class\n );\n return friend;\n } else {\n return null;\n }\n } catch (APICallException e) {\n Log.e(Constants.TAG, \"HTTP ERROR when confirming friend request - STATUS:\" + e.getMessage(), e);\n return null;\n } catch (IOException e) {\n Log.e(Constants.TAG, \"IOException when confirming friend request\", e);\n return null;\n } // end try-catch\n }",
"public synchronized boolean hasFriendRequest(FriendRequest req) {\n \t\treturn indexOfFriendRequest(req) != -1;\n \t}",
"@Test\r\n\tpublic void testConfirmFriendRequest() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tp1.receiveFriendRequest(\"JavaLord\", \"JavaLordDisplayName\");\r\n\t\tassertTrue(p1.hasFriendRequest(\"JavaLord\"));\r\n\t\tp1.confirmFriendRequest(\"JavaLord\");\r\n\t\tassertFalse(p1.hasFriendRequest(\"JavaLord\"));\r\n\t}",
"@Override\n\tpublic void add() {\n\t\tperson.addRelationship(\"Friend\", friend);\n\t}",
"public static Task<Void> sendRequest(String friendId, String userId, Map<String, Object> data) {\n return FirebaseFirestore.getInstance()\n .collection(Const.USERS_COLLECTION)\n .document(friendId)\n .collection(Const.USER_F_REQUESTS_COLLECTION)\n .document(userId)\n .set(data);\n }",
"AddFriend.AToServer getAddFriendAToServer();",
"public void addFriend(String friend){\n friends.add(friend);\n }",
"public FriendList createFriendList();",
"void addNewFriend(String actorId, String objectId, Date eventTime);",
"boolean hasResMineID();",
"public Friend findFriend(Address addr);",
"AddFriend.BToServer getAddFriendBToServer();",
"public static Task<Void> addUserFriend(String userId, String friendId) {\n // map to contain the friend id\n Map<String, Object> data = new HashMap<>();\n data.put(Const.FRIEND_ID_KEY, friendId);\n\n // add the friend to the friends sub-collection\n return FirebaseFirestore.getInstance()\n .collection(Const.USERS_COLLECTION)\n .document(userId)\n .collection(Const.USER_FRIENDS_COLLECTION)\n .document(friendId)\n .set(data);\n }",
"void relationshipCreate( long id, int typeId, long startNodeId,\n long endNodeId );",
"java.lang.String getRequestID();",
"public boolean isAlreadyAdd(Friend friend){\n List<Friend> friendList = Resources.owner.getFriendList();\n boolean isYou = Resources.owner.getUsername().equals(friend.getUsername());\n return friendList.contains(friend) || isYou;\n }",
"private static Integer canDeleteFriend(Integer userId, Integer friendId, DatabaseConnection dc) {\n\t\t// Validate inputs\n\t\tif(userId == null || friendId == null || userId < 1 || friendId < 1 || dc == null) {\n\t\t\tSystem.out.println(\"\\tDeleteFriendServlet.canDeleteFriend(): Failed due to bad inputs\");\n\t\t\treturn KFAILURE;\n\t\t}\n\n\t\t// Verify user isn't deleting himself\n\t\tif(userId == friendId) {\n\t\t\tSystem.out.println(\"\\tDeleteFriendServlet.canDeleteFriend(): Failed because userid = receiverid\");\t\t\t\n\t\t\treturn KSELF;\n\t\t}\n\n\t\t// Verify the two are already friends\n\t\tString query1 = \"SELECT datefriended FROM \" + friendsTable + \" WHERE \" + colFriend1 + \"=\" + userId + \" AND \" + colFriend2 + \"=\" + friendId + \" LIMIT 1;\";\n\t\tString query2 = \"SELECT datefriended FROM \" + friendsTable + \" WHERE \" + colFriend2 + \"=\" + userId + \" AND \" + colFriend1 + \"=\" + friendId + \" LIMIT 1;\";\n\t\ttry {\n\t\t\tboolean friends = false;\n\t\t\tResultSet rs = dc.executeQuery(query1);\n\t\t\tif (rs.first()) {\n\t\t\t\tfriends = true;\n\t\t\t}\n\t\t\trs = dc.executeQuery(query2);\n\t\t\tif (rs.first()) {\n\t\t\t\tfriends = true;\n\t\t\t}\n\t\t\tif (!friends) return KNOTFRIENDS;\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"\\tDeleteFriendServlet.canDeleteFriend(): Failed. SQLException\");\n\t\t\treturn KFAILURE;\n\t\t}\n\n\t\t// User is not deleting himself. User is friends with receiver.\n\t\treturn KSUCCESS;\t\t\n\t}",
"public static Friend confirmFriendRequest(String accessToken, Integer friendId) {\n JsonObject jsonObject = new JsonObject();\n\n jsonObject.add(\"friend\", new JsonObject());\n\n try {\n JsonElement element = NetworkUtil.postWebService(jsonObject, NetworkUtil.FRIENDS_URI + \"/\" + friendId + FRIENDS_CONFIRM_REQUEST_URI, accessToken);\n Log.i(Constants.TAG, \"result:\" + element.toString());\n if (element != null) {\n Gson gson = new Gson();\n\n Log.i(Constants.TAG, \"RETURNED : jsonObject:\" + element.getAsJsonObject().get(\"friend\").toString());\n Friend friend = gson.fromJson(\n element.getAsJsonObject().get(\"friend\"),\n Friend.class\n );\n return friend;\n } else {\n return null;\n }\n } catch (APICallException e) {\n Log.e(Constants.TAG, \"HTTP ERROR when confirming friend request - STATUS:\" + e.getMessage(), e);\n return null;\n } catch (IOException e) {\n Log.e(Constants.TAG, \"IOException when confirming friend request\", e);\n return null;\n } // end try-catch\n }",
"@Test\r\n\tpublic void testDenyFriendRequest() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tp1.receiveFriendRequest(\"JavaLord\", \"JavaLordDisplayName\");\r\n\t\tassertTrue(p1.hasFriendRequest(\"JavaLord\"));\r\n\t\tassertTrue(p1.denyFriendRequest(\"JavaLord\"));\r\n\t\tassertFalse(p1.denyFriendRequest(\"JavaLord\"));\r\n\t}",
"@RequestMapping(value=\"/updateFriend/{friendid}\", method=RequestMethod.PUT)\r\n\tpublic ResponseEntity<Friend> updateFriend(@PathVariable(\"friendid\") int friendid, @RequestBody Friend friend)\r\n\t{\r\n\t\tFriend updatefriend = friendDAO.getParticularFriend(friendid);\r\n\t\t//updatefriend.setUser_id(friend.getUser_id());\r\n\t\tupdatefriend.setStatus(friend.getStatus());\r\n\t\tfriendDAO.addOrUpdateFriend(updatefriend);\r\n\t\treturn new ResponseEntity<Friend>(updatefriend,HttpStatus.OK);\r\n\t}",
"private boolean sendFriendRequest(Integer senderid, Integer receiverid, HttpSession session, DatabaseConnection dc, ServletContext sc) {\n\t\t// Populate all message fields\n\t\tSiteManager sm = (SiteManager) sc.getAttribute(\"SiteManager\");\n\t\tInteger msgId = sm.popNextMessageID();\n\t\tString date = FormatDateTime.getCurrentSystemDate();\n\t\tString time = FormatDateTime.getCurrentSystemTime();\n\t\tBoolean opened = false;\n\t\tInteger replied = 0;\n\t\tString subject = null;\n\t\tString body = null;\n\n\t\t// Send the request\n\t\tusers.Message msg = new users.Message(msgId, friendRequestType, date, time, senderid, receiverid, opened, replied, subject, body);\n\t\tupdateDatabase(msg,dc);\n\n\t\t// Update the user and return success\n\t\tusers.User user = (users.User) session.getAttribute(\"user\");\t\t\n\t\tif (user != null) user.messages.add(msg);\n\t\treturn true;\n\t}",
"private void setAddFriendFromSelfRsp(AddFriendFromSelf.Rsp value) {\n if (value == null) {\n throw new NullPointerException();\n }\n rsp_ = value;\n rspCase_ = 13;\n }",
"public static void deleteRequest(String userId, String friendId) {\n Log.d(Const.TAG, \"deleteRequest: \" + Thread.currentThread().getId());\n FirebaseFirestore.getInstance()\n .collection(Const.USERS_COLLECTION)\n .document(userId)\n .collection(Const.USER_F_REQUESTS_COLLECTION)\n .document(friendId)\n .delete();\n }",
"public void addFriendship(int u1, int u2) {\n\t\tUser usr=users.get(u1);\n\t\tUser friend=users.get(u2);\n\t\tif(usr!=null &&friend!=null) {\n\t\t\tusr.addFriend(friend);\n\t\t}else {\n\t\t\tSystem.err.printf(\"user(%d) or friend(%d) doesn't exist\\n\",u1,u2);\n\t\t}\n\t}",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n User.hasNewFriend = true;\n JSONObject jsonObject = new JSONObject();\n try {\n jsonObject.put(\"user_id\", User.ID);\n jsonObject.put(\"friend_id\", friendId);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n final String url = URLs.SEND_AGREE_FRIEND_REQUEST;\n Map<String, String> params = new HashMap();\n params.put(\"json\", jsonObject.toString());\n\n JsonObjectFormRequest request = new JsonObjectFormRequest(Request.Method.POST, url, params, new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n try {\n if (!response.getString(\"result\").equals(\"success\")){\n Toast.makeText(context, context.getString(R.string.time_out), Toast.LENGTH_LONG);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n\n }\n });\n MySingleton.getInstance(context).addToRequestQueue(request);\n }",
"public Builder clearFriendId() {\n bitField0_ = (bitField0_ & ~0x00000080);\n friendId_ = getDefaultInstance().getFriendId();\n \n return this;\n }",
"II addId();",
"public void addFriendList(FriendList list);",
"private void addFriend() {\n \tif (!friend.getText().equals(\"\")) {\n\t\t\tif (currentProfile != null) {\n\t\t\t\tif (!database.containsProfile(friend.getText())) {\n\t\t\t\t\tcanvas.showMessage(friend.getText() + \" profile does not exists\");\n\t\t\t\t} else if (isfriendsBefore()) {\n\t\t\t\t\tcanvas.showMessage(friend.getText() + \" is already a friend\");\n\t\t\t\t} else {\n\t\t\t\t\tmakeTheTwoFriends();\n\t\t\t\t\tcanvas.displayProfile(currentProfile);\n\t\t\t\t\tcanvas.showMessage(friend.getText() + \" added as friend\");\n\t\t\t\t}\n\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcanvas.showMessage(\"Select a profile to add friends\");\n\t\t\t}\n\t\t}\n\t}",
"private void acceptFriend(String userId, String ownId) {\n String error = \"Adding friend failed!\";\n Map<String, Object> accepted = new HashMap<>();\n accepted.put(\"id\", userId);\n accepted.put(\"status\", \"accepted\");\n UserDatabase userDb = new UserDatabase(userId);\n userDb.getChildCollection(\"unmessaged\").document(ownId).set(new HashMap<>()).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n e.printStackTrace();\n Toast.makeText(ViewProfileActivity.this, \"Adding friend failed!\", Toast.LENGTH_SHORT).show();\n }\n });\n userDb = new UserDatabase(ownId);\n userDb.getChildCollection(\"unmessaged\").document(userId).set(new HashMap<>()).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n e.printStackTrace();\n Toast.makeText(ViewProfileActivity.this, \"Adding friend failed!\", Toast.LENGTH_SHORT).show();\n }\n });\n userDb = new UserDatabase(ownId);\n userDb.getChildCollection(\"friends\")\n .document(userId)\n .set(accepted)\n .addOnSuccessListener(success -> {\n accepted.clear();\n accepted.put(\"id\", ownId);\n accepted.put(\"status\", \"accepted\");\n UserDatabase userDb1 = new UserDatabase(userId);\n userDb1.getChildCollection(\"friends\")\n .document(ownId)\n .set(accepted)\n .addOnSuccessListener(success1 -> {\n\n buttonRemoveFriend(userId, ownId);\n updateFriendsCount(userId, ownId, true);\n })\n .addOnFailureListener(fail -> handleError(error, fail));\n })\n .addOnFailureListener(fail -> handleError(error, fail));\n }",
"private static long newId() {\n return REQUEST_ID.getAndIncrement();\n }",
"public void addFriend() {\n\n /* if (ageOK == true) {\n for (int i = 0; i < listRelationships.size(); i++) {\n if (firstFriend.equalsIgnoreCase(list.get(i).getFirstFriend())) {\n listRelationships.get(i).setFriends(secondFriend);\n System.out.println(listRelationships.get(i));\n System.out.println();\n\n } else if (secondFriend.equalsIgnoreCase(list.get(i).getSecondFriend())) {\n listRelationships.get(i).setFriends(firstFriend);\n System.out.println(listRelationships.get(i));\n System.out.println();\n }\n }\n } */\n }",
"public Trip(long tripId, long serverRefId, String tripName, String destinationName, String creator, Date date, ArrayList<Person> friends)\n\t{\n\t\tthis.tripId = tripId;\n\t\tthis.serverRefId = serverRefId;\n\t\tthis.tripName = tripName;\n\t\tthis.destinationName = destinationName;\n\t\tthis.creator = creator;\n\t\tthis.date = date;\n\t\tthis.friends = friends;\n\t}",
"public void makeAndSendAgentID(){\n sendID(id, x, y);\n }",
"private boolean isRequestAlreadySent(String friendName)\r\n\t{\r\n\t\tlogger.debug(\"->->->->-> Inside isUserExist method ->->->->->\");\r\n\t\tString loggedInUserName = (String) httpSession.getAttribute(\"loggedInUserName\");\r\n\t\tlogger.debug(\"UserName in isRequestAlreadySent :\"+loggedInUserName);\r\n\t\tif(friendDAO.getFriendWithUserNameAndFriendName(loggedInUserName,friendName)==null){\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"@Override\n public void RelationshipAdded(boolean ok) {\n final Intent i = new Intent(this,ELFStaff.class);\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n }",
"Boolean sendFollowRequest(User user);",
"void addIdentificationRequest(Identification request);",
"@PostMapping(value = \"/customers/{phoneNo}/friends\", consumes = MediaType.APPLICATION_JSON_VALUE)\n\tpublic void saveFriend(@PathVariable Long phoneNo, @RequestBody FriendFamilyDTO friendDTO) {\n\t\tlogger.info(\"Creation request for customer {} with data {}\", phoneNo, friendDTO);\n\t\tcustService.saveFriend(phoneNo, friendDTO);\n\t}",
"@RequestMapping(value=\"/addFriend/{friendName}\", method=RequestMethod.POST)\r\n\tpublic ResponseEntity<Friend> sendFriendRequest(@PathVariable(\"friendName\") String friendName)\r\n\t{\r\n\t\tlogger.debug(\"->->->->-> calling method sendFriendRequest ->->->->->\");\r\n\t\tString loggedInUserName = (String) httpSession.getAttribute(\"loggedInUserName\");\r\n\t\tlogger.debug(loggedInUserName+\" is sending friend request to \"+friendName);\r\n\t\t\r\n\t\t// Check if the friend is available in Users table or not \r\n\t\tif(isUserExist(friendName)==false){\r\n\t\t\tfriend.setErrCode(\"404\");\r\n\t\t\tfriend.setErrMessage(\"No user exist with the id : \"+friendName);\r\n\t\t}\r\n\t\t\r\n\t\t// Check if the user has already sent the friend request\r\n\t\tif(isRequestAlreadySent(friendName)){\r\n\t\t\tfriend.setErrCode(\"404\");\r\n\t\t\tfriend.setErrMessage(\"You have already sent the friend request to : \"+friendName);\r\n\t\t}\r\n\t\t\r\n\t\t// If previously not sent, send a new friend request\r\n\t\telse{\r\n\t\t\tlogger.debug(\"->->->->-> Sending Friend Request ->->->->->\");\r\n\t\t\tfriend.setFriendName(friendName);\r\n\t\t\tfriend.setUserName(loggedInUserName);\r\n\t\t\tfriend.setStatus(\"NEW\");\r\n\t\t\tfriend.setIsOnline(\"NO\");\r\n\t\t\tif(friendDAO.addOrUpdateFriend(friend)){\r\n\t\t\t\tlogger.debug(\"->->->-> Friend Request sent successfully ->->->->\");\r\n\t\t\t\tfriend.setErrCode(\"200\");\r\n\t\t\t\tfriend.setErrMessage(\"Friend request sent Successfully\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tlogger.debug(\"->->->->-> Could not send Friend request ->->->->->\");\r\n\t\t\t\tfriend.setErrCode(\"404\");\r\n\t\t\t\tfriend.setErrMessage(\"Could not send Friend request. Please contact Admin!\");\r\n\t\t\t}\r\n\t\t\t//logger.debug(\"->->->->-> Friend request sent Successfully ->->->->->\");\r\n\t\t}\r\n\t\treturn new ResponseEntity<Friend>(friend,HttpStatus.OK);\r\n\t}",
"public Builder setFriendIdBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n friendId_ = value;\n onChanged();\n return this;\n }",
"protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tLong id = Long.parseLong(req.getParameter(\"making_friend_id\"));\n\t\tMakingFriend makingFriend = ObjectifyService.ofy().load().type(MakingFriend.class).id(id).now();\n\t\tmakingFriend.setStatus(\"1\");\n\t\tObjectifyService.ofy().save().entity(makingFriend);\n\t\tresp.sendRedirect(\"list_friend_sending_request.jsp\");\n\t}",
"boolean hasReceiverID();",
"Relationship createRelationship();",
"public void addFriend(String name, String friendsSchedule) {\n\n // loads the friend's schedule from the passed in friendsSchedule xml\n // stream\n // writes to the model\n Schedule temp = readWrite.loadSchedules(friendsSchedule, this);\n Log.i(TAG, \"temp is: \" + temp);\n buddies.add(temp);\n\n Log.i(TAG, \"buddies.size() - 1 is: \" + (buddies.size() - 1));\n Log.i(TAG, \"buddies.size() - 1 is: \" + buddies.get(buddies.size() - 1));\n // gets the just added friend's schedule and changes its name to\n // the passed in value\n // necessary because all schedules are sent as \"MySchedule\"\n buddies.get(buddies.size() - 1).setWhosSchedule(name);\n\n\n // update observers\n setChanged();\n notifyObservers();\n }",
"@RequestMapping(value = \"/follow/add\", method = RequestMethod.POST, produces = \"application/json\")\n\t@ResponseBody\n\tpublic boolean switchFollower(HttpServletRequest request, @RequestParam String followeeID) throws Exception {\n\t\tSystem.out.println(\"reached controller\");\n\t\tboolean flag = false;\n\t\tint id = Integer.parseInt(followeeID);\n\t\tHttpSession session = request.getSession();\n\t\tUser follower = (User) session.getAttribute(\"user\");\n\t\ttry {\n\t\t\tUser followee = (User) followerDao.get(id);\n\t\t\tif (isPresent(followee, follower)) {\n\t\t\t\tflag = followerDao.removeFollower(followee,follower);\n\t\t\t} else {\n//\t\t\t\tfollowee.getFollowers().add(follower);\n//\t\t\t\tSystem.out.println(\"added\");\n\t\t\t\tflag = followerDao.addFollower(followee,follower);\n\t\t\t}\n\n\t\t} catch (FollowerException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn flag;\n\n\t}",
"@GET\n\t@Path(\"/{id}\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Friend getFriendById(@PathParam(\"id\") int idToSearch) {\n\t\tFriend searchedfrnd=\tfcs.getFriendById(idToSearch);\n\t\treturn searchedfrnd;\n\n\t}",
"public boolean addRequest(int requestId) throws Exception{\n return true;\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.WhoOwnsWhom addNewWhoOwnsWhom();",
"private void setAddFriendAToServer(AddFriend.AToServer value) {\n if (value == null) {\n throw new NullPointerException();\n }\n req_ = value;\n reqCase_ = 1;\n }",
"public synchronized int indexOfFriendRequest(FriendRequest req) {\n \t\t// We assume that only the user that can respond to the request has it saved \n \t\tif(!req.getFriendUsername().equals(this.getUsername())) return -1;\n \t\t// Find the given request among ours\n \t\tfor (int i = 0; i < this.getNumberOfFriendRequests(); i++) {\n \t\t\tif(req.getFromUser().equals(this.getFriendRequest(i).getFromUser())) {\n \t\t\t\treturn i;\n \t\t\t}\n \t\t}\n \t\treturn -1;\n \t}",
"public boolean addFriend(String requester, String recipientNick) {\n if (requester == null\n || recipientNick == null\n || requester.equals(recipientNick)\n ) {\n return false;\n }\n User requesterUser = this.onlineUsers.get(requester);\n if (requesterUser == null\n || !this.exists(recipientNick)\n || requesterUser.hasFriend(recipientNick)\n ) {\n return false;\n }\n requesterUser.addFriend(recipientNick);\n User recipientUser = this.loadUserOnlineInfo(recipientNick);\n recipientUser.addFriend(requester);\n List<User> updates = new ArrayList<>(2);\n // This section implements the storage updates policy\n if (this.policy == Policy.IMMEDIATELY) {\n updates.add(recipientUser);\n updates.add(requesterUser);\n } else if (Policy.ON_SESSION_CLOSE.equals(this.policy)\n && !this.isOnline(recipientNick)\n ) {\n updates.add(recipientUser);\n }\n // In general do not add anything to the collection\n if (!updates.isEmpty()) {\n this.writeLock.lock();\n try {\n JSONMapper.copyAndUpdate(\n this.onlinePath,\n updates,\n UserViews.Online.class\n );\n } catch (IOException e) {\n e.printStackTrace();\n return false;\n } finally {\n this.writeLock.unlock();\n }\n }\n return true;\n }",
"DeleteFriend.AToServer getDeleteFriendAToServer();",
"public void addFriend(String friendName) {\n\t if(friends.contains(friendName)) {\n\t\t return;\n\t }\n\t friends.add(friendName);\n }",
"private AddFriend(com.google.protobuf.GeneratedMessageLite.Builder builder) {\n super(builder);\n\n }",
"private void buttonAddFriend(String userId, String ownId) {\n friendsButton.setText(\"Add Friend\");\n friendsButton.setOnClickListener(view -> addFriend(userId, ownId));\n profileOptions.setVisibility(View.GONE);\n }",
"void createRelationshipTypeToken( int id, String name );",
"public int Add_Friend(String username,Object friend) {\n\t\tif(friend!=null && friend instanceof valueobject.Friend){\r\n\t\t\tDAO.all_interface friendDao = DB.ObjectFactory.getFriendDao();\r\n\t\t\tUser one = DB.ObjectFactory.getUserObject();\r\n\t\t\tone.setName(username);\r\n\t\t\tint userid = this.GetKey(one);\r\n\t\t\tFriend frd = (Friend)friend;\r\n\t\t\tfrd.setUserid(userid);\r\n\t\t\tint i = friendDao.Add((Object)frd);\r\n\t\t\tif(i==friendDao.OPERATE_SUCCESS){\r\n\t\t\t\treturn this.OPERATE_OK;\r\n\t\t\t}else if(i==friendDao.OPERATE_ERROR){\r\n\t\t\t\treturn this.OPERATE_ERROR;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this.OTHER_ERROR;\r\n\t}",
"public void addFriend(FriendContent user) {\n\n try {\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(ADD_FRIEND);\n stringBuilder.append(URLEncoder.encode(UserContent.sUserID, \"UTF-8\"));\n stringBuilder.append(\"&fid=\");\n stringBuilder.append(URLEncoder.encode(user.getFrenID(), \"UTF-8\"));\n stringBuilder.append(\"&fname=\");\n stringBuilder.append(URLEncoder.encode(user.getFrenName(), \"UTF-8\"));\n stringBuilder.append(\"&femail=\");\n stringBuilder.append(URLEncoder.encode(user.getFrenEmail()));\n\n Log.i(TAG, \"Url is \" +stringBuilder.toString());\n CreateHangoutTask addFriendAsyncTask = new CreateHangoutTask();\n addFriendAsyncTask.execute(stringBuilder.toString());\n Toast toast = Toast.makeText(this, \"Friend added!\", Toast.LENGTH_SHORT);\n toast.show();\n\n Intent splashReturn = new Intent(this, SplashActivity.class);\n splashReturn.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(splashReturn);\n }\n catch (Exception e) {\n Toast.makeText(this, \"Couldn't register, Something wrong with the URL\" + e.getMessage(),\n Toast.LENGTH_SHORT). show();\n }\n }",
"public synchronized void sendID(int id, int x, int y){\n LinkedList<Node> returnPath = new LinkedList<Node>();\n returnPath.add(this);\n LinkedList<Node> path = pathsToBaseStation.getFirst();\n Node nextNode = path.getFirst();\n while(!liveNeighbors.contains(nextNode)){\n pathsToBaseStation.removeFirst();\n if(pathsToBaseStation.size()>=1) {\n path = pathsToBaseStation.getFirst();\n nextNode = path.getFirst();\n }\n }\n path.removeFirst();\n nextNode.passID(id,x,y,path,returnPath);\n }",
"org.hl7.fhir.Identifier addNewIdentifier();",
"public boolean hasFriend(String friend){\n return friends.contains(friend);\n }",
"@Test\r\n\tpublic void testAddFriend() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tFriend p2 = new Friend(\"Dave\");\r\n\t\tassertTrue(p1.addFriend(p2));\r\n\t\tassertFalse(p1.addFriend(p2));\r\n\t}",
"private boolean isFriend() {\r\n\r\n return isContactableUser() && !StringUtils.isBlank(friendFeed.getContact().getContactId());\r\n }",
"public Call inviteAddress(Address addr);",
"public boolean isFriendRelationship() {\n return friendRelationship;\n }",
"com.google.protobuf.ByteString\n getFriendIdBytes();",
"com.google.protobuf.ByteString\n getFriendIdBytes();",
"public interface FriendDao {\n\n Friend checkIfAreFriends(Long userId1, Long userId2);\n FriendRequest checkIfFriendRequestExists(Long userId1, Long userId2);\n void createFriendRequest(FriendRequest friendRequest);\n void createFriend(Friend friend);\n void deleteFriendRequest(Long user1, Long user2);\n List<Friend> getFriendsById(Long id);\n}",
"@PostMapping(\"/{id}/sendfriendrequest\")\n\tpublic String addFriend(HttpSession session, @ModelAttribute(\"friend\")Friend friend, Model viewModel, @PathVariable(\"id\")Long uid, BindingResult result) {\n\t\tUser user = this.uServ.findUserById(uid); //Page owner\n\t\tviewModel.addAttribute(\"user\", user);\n\t\t\n\t\tLong loginUserId = (Long)session.getAttribute(\"userId\"); //Login user\n\t\tUser loginUser = this.uServ.findUserById(loginUserId);\n\t\tviewModel.addAttribute(\"sender\", loginUser);\n\t\t\n\t\tif(result.hasErrors()) {\n\t\t\treturn \"redirect:/main/\"+uid;\n\t\t}\n\t\tthis.fServ.requestFriend(loginUser, user);\n\t\treturn \"redirect:/main/\"+uid;\n\n\t}",
"public void addFriendToPatient(final String newFriendTz, final Patient patient, final boolean makeAdmin, final Context context){\n db.collection(Constants.USERS_COLLECTION_FIELD).whereEqualTo(Constants.TZ_FIELD, newFriendTz).get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\n @Override\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\n boolean userExists = false;\n if (task.isSuccessful()){\n for (QueryDocumentSnapshot doc : task.getResult()){\n final User friendAsUser = doc.toObject(User.class);\n userExists = true;\n // update patient from db\n db.collection(Constants.PATIENTS_COLLECTION_FIELD).document(patient.getId()).get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {\n @Override\n public void onSuccess(DocumentSnapshot documentSnapshot) {\n Patient dbPatient = documentSnapshot.toObject(Patient.class);\n if (dbPatient == null){\n Toast.makeText(context, \"DB Error :(\", Toast.LENGTH_SHORT).show();\n return;\n }\n if (dbPatient.hasFriendWithId(friendAsUser.getId())){\n Toast.makeText(context, \"Already his friend!\", Toast.LENGTH_SHORT).show();\n return;\n }\n dbPatient.addFriend(friendAsUser.getId(), makeAdmin);\n updatePatientInDatabase(dbPatient);\n Toast.makeText(context, \"Friend added!\", Toast.LENGTH_SHORT).show();\n }\n });\n }\n }\n if (!userExists){\n Toast.makeText(context, \"Not a valid User!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }"
] | [
"0.68329805",
"0.6570034",
"0.64235294",
"0.62324655",
"0.61285555",
"0.6111475",
"0.6111475",
"0.6029834",
"0.59642196",
"0.5958503",
"0.59362125",
"0.5880578",
"0.58322704",
"0.5798458",
"0.57946193",
"0.5783367",
"0.576509",
"0.57606256",
"0.5686003",
"0.56532127",
"0.5649534",
"0.56425846",
"0.56351984",
"0.5581122",
"0.5547261",
"0.5494647",
"0.5485897",
"0.5451684",
"0.5448547",
"0.54345787",
"0.54317653",
"0.54147816",
"0.5381246",
"0.538124",
"0.537882",
"0.53562725",
"0.53173566",
"0.5308523",
"0.5303351",
"0.5303016",
"0.5277721",
"0.5263227",
"0.5260099",
"0.52032936",
"0.51929027",
"0.5162335",
"0.5148403",
"0.512158",
"0.5110026",
"0.5107903",
"0.50876796",
"0.5085402",
"0.5075143",
"0.50613225",
"0.50613004",
"0.5054939",
"0.50513613",
"0.50431615",
"0.50397116",
"0.50372565",
"0.5034458",
"0.5024149",
"0.50221056",
"0.5020073",
"0.5010086",
"0.49996656",
"0.49990258",
"0.49916077",
"0.49820054",
"0.49796033",
"0.4977342",
"0.49762172",
"0.49702185",
"0.49621797",
"0.4952769",
"0.494842",
"0.49377915",
"0.49346524",
"0.4932883",
"0.49263763",
"0.49135882",
"0.4913538",
"0.49070328",
"0.49015197",
"0.48940077",
"0.48878887",
"0.48876408",
"0.48832467",
"0.48796582",
"0.48703268",
"0.4870152",
"0.4869216",
"0.48636395",
"0.48585257",
"0.4842161",
"0.48386368",
"0.48386368",
"0.4837681",
"0.48278448",
"0.48225302"
] | 0.49832526 | 68 |
Do we add an ID to the pathway to delete a certain friend request? | @ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(value = "", method = RequestMethod.DELETE)
public void deleteRequest(@Valid @RequestBody NewFriendRequestDTO friendRequestDTO, Principal principal) {
FriendsList friendsList = buildRequestFromRequestDTO(friendRequestDTO);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int deleteFriendRequest(int myid, int requestid){\n try {\n Statement st = conn.createStatement();\n String sqlString = String.format(\"UPDATE users SET friendreq = array_remove(friendreq, '%d') WHERE userid=%d;\", requestid, myid);\n st.execute(sqlString);\n st.close();\n return SUCCESS;\n\n }catch (SQLException e){\n throw new RuntimeException(e);\n }\n }",
"public static void deleteRequest(String userId, String friendId) {\n Log.d(Const.TAG, \"deleteRequest: \" + Thread.currentThread().getId());\n FirebaseFirestore.getInstance()\n .collection(Const.USERS_COLLECTION)\n .document(userId)\n .collection(Const.USER_F_REQUESTS_COLLECTION)\n .document(friendId)\n .delete();\n }",
"private boolean deleteFriend(Integer userid, Integer friendid, DatabaseConnection dc) {\n\t\t// Send the deletion\n\t\tupdateDatabase(userid,friendid,dc);\n\n\t\t// Do we need to update the user like we do for sendFriendRequest?\n\t\t\n\t\treturn true;\n\t}",
"int deleteByPrimaryKey(Long myFriendId);",
"public boolean deleteFriend(String friendID){\n boolean isDeleted=false;\n try{\n database=dbH.getReadableDatabase();\n dbH.openDataBase();\n isDeleted=database.delete(\"Friend\",\"deviceID=\"+\"'\"+friendID+\"'\",null)==1;\n Log.i(TAG,\"Is friend deleted? \"+isDeleted);\n dbH.close();\n }\n catch(SQLException e){\n e.printStackTrace();\n }\n return isDeleted;\n }",
"int deleteByExample(ImMyFriendExample example);",
"Boolean delete(HttpServletRequest request, Long id);",
"public void deleteFriend(String friend){\n friends.remove(friend);\n }",
"private void clearDeleteFriendAToServer() {\n if (reqCase_ == 14) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"@DELETE\n public void delete(@PathParam(\"id\") String id) {\n }",
"void delete(String id);",
"void delete(String id);",
"void delete(String id);",
"void delete(String id);",
"void delete(String id);",
"void delete(String id);",
"public void delete(int singerId);",
"public int deleteRoute(RouteEntry rtEntry);",
"int deleteRoute(List<String> routeID);",
"public void delete(int id);",
"public int Delete_Friend(Object key) {\n\t\tDAO.all_interface friendDao = DB.ObjectFactory.getFriendDao();\r\n\t\tint i = friendDao.Delete(key);\r\n\t\tif(i == friendDao.OPERATE_SUCCESS){\r\n\t\t\treturn this.OPERATE_OK;\r\n\t\t}else if(i==friendDao.OPERATE_ERROR){\r\n\t\t\treturn this.OPERATE_ERROR;\r\n\t\t}else{\r\n\t\t\treturn this.OTHER_ERROR;\r\n\t\t}\r\n\t}",
"void delete(ID id);",
"void delete(Integer id);",
"void delete(Integer id);",
"@GetMapping(\"/deleteFriend/{id}\")\n\tpublic String DeleteTask(@PathVariable(\"id\")Long fid) {\n\t\tthis.fServ.delete(fid);\n\t\treturn \"redirect:/tasks\";\n\t}",
"@GetMapping(\"/deleteFriend/{id}\")\n\tpublic String DeleteTask(@PathVariable(\"id\")Long fid) {\n\t\tthis.fServ.delete(fid);\n\t\treturn \"redirect:/tasks\";\n\t}",
"private static Integer canDeleteFriend(Integer userId, Integer friendId, DatabaseConnection dc) {\n\t\t// Validate inputs\n\t\tif(userId == null || friendId == null || userId < 1 || friendId < 1 || dc == null) {\n\t\t\tSystem.out.println(\"\\tDeleteFriendServlet.canDeleteFriend(): Failed due to bad inputs\");\n\t\t\treturn KFAILURE;\n\t\t}\n\n\t\t// Verify user isn't deleting himself\n\t\tif(userId == friendId) {\n\t\t\tSystem.out.println(\"\\tDeleteFriendServlet.canDeleteFriend(): Failed because userid = receiverid\");\t\t\t\n\t\t\treturn KSELF;\n\t\t}\n\n\t\t// Verify the two are already friends\n\t\tString query1 = \"SELECT datefriended FROM \" + friendsTable + \" WHERE \" + colFriend1 + \"=\" + userId + \" AND \" + colFriend2 + \"=\" + friendId + \" LIMIT 1;\";\n\t\tString query2 = \"SELECT datefriended FROM \" + friendsTable + \" WHERE \" + colFriend2 + \"=\" + userId + \" AND \" + colFriend1 + \"=\" + friendId + \" LIMIT 1;\";\n\t\ttry {\n\t\t\tboolean friends = false;\n\t\t\tResultSet rs = dc.executeQuery(query1);\n\t\t\tif (rs.first()) {\n\t\t\t\tfriends = true;\n\t\t\t}\n\t\t\trs = dc.executeQuery(query2);\n\t\t\tif (rs.first()) {\n\t\t\t\tfriends = true;\n\t\t\t}\n\t\t\tif (!friends) return KNOTFRIENDS;\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"\\tDeleteFriendServlet.canDeleteFriend(): Failed. SQLException\");\n\t\t\treturn KFAILURE;\n\t\t}\n\n\t\t// User is not deleting himself. User is friends with receiver.\n\t\treturn KSUCCESS;\t\t\n\t}",
"void delete(int id);",
"void delete(int id);",
"public void deleteRequest(String requestID) {\n try {\n SQLiteDatabase db = this.getWritableDatabase();\n db.execSQL(\"DELETE FROM \" + TABLE_NAME + \" WHERE _id = '\" + requestID + \"'\");\n db.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public boolean deletePeople(Long id);",
"private void cancelRequest(String userId, String ownId) {\n String error = \"Failed to cancel friend request\";\n UserDatabase userDb = new UserDatabase(ownId);\n userDb.getChildCollection(\"friends\").document(userId).delete()\n .addOnSuccessListener(success -> {\n UserDatabase userDb1 = new UserDatabase(userId);\n userDb1.getChildCollection(\"friends\").document(ownId).delete()\n .addOnSuccessListener(success1 -> buttonAddFriend(userId, ownId))\n .addOnFailureListener(fail -> handleError(error, fail));\n })\n .addOnFailureListener(fail -> handleError(error, fail));\n }",
"DeleteFriend.AToServer getDeleteFriendAToServer();",
"Integer delete(int id);",
"boolean hasFriendId();",
"public void deleteById(int theId);",
"void delete(long id) throws NotFoundException;",
"boolean delete(int id, int userId);",
"@Test\r\n\tpublic void testDeleteFriend() {\r\n\t\tPerson p1 = new Person(0);\r\n\t\tFriend p2 = new Friend(\"Dave\");\r\n\t\tassertTrue(p1.addFriend(p2));\r\n\t\tassertTrue(p1.deleteFriend(p2));\r\n\t\tassertFalse(p1.deleteFriend(p2));\r\n\t}",
"public void delete(String id);",
"public void delete(String id);",
"public void delete(String id);",
"public void delete(String id);",
"public void delete(String id);",
"public synchronized boolean removeFriendRequest(FriendRequest req) {\n \t\tint i = indexOfFriendRequest(req);\n \t\tif(i == -1) return false;\n \t\tgetFriendRequests().remove(i);\n \t\treturn true;\n \t}",
"void deleteByIdWithResponse(String id, String referer, Context context);",
"public boolean delete(String id);",
"public boolean delete(String id);",
"@Override\n public void onClick(View v) {\n WriteBatch batch = db.batch();\n batch.delete(usersReference.document(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .collection(\"FriendList\").document(documentID));\n batch.delete(usersReference.document(documentID).collection(\"FriendList\")\n .document(FirebaseAuth.getInstance().getCurrentUser().getUid()));\n batch.commit().addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n if (getActivity() != null)\n Toast.makeText(getActivity(), \"Cancelled friend request\", Toast.LENGTH_SHORT).show();\n mAddFriendButton.setText(\"Add Friend\");\n mAddFriendButton.setEnabled(true);\n }\n });\n }",
"LinkedService deleteByIdWithResponse(String id, Context context);",
"void delete(long id);",
"void delete(long id);",
"void delete(long id);",
"@Override\n public void delete(int id) {\n }",
"public void delete(Integer id);",
"public void delete(Integer id);",
"public void delete(Integer id);",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(int id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(String id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(String id) {\n\t\t\n\t}",
"int delTravelByIdRoute(Long id_route);",
"@DeleteMapping(\"/delete_person/{id}\")\n public void delete(@PathVariable(\"id\") int id ){\n persons.remove(id);\n }",
"public Boolean unfollow(User main, User friend){\n SQLiteDatabase db = getWritableDatabase();\n db.beginTransaction();\n\n String whereClauses = UHF_ID + \"=\" + main.getId() + \" AND \" + UHF_FRIEND + \"=\" + friend.getId();\n try {\n db.delete(UHF_TABLE, whereClauses , null);\n db.setTransactionSuccessful();\n return true;\n } catch (Exception e) {\n Log.d(\"SQL\", e.getMessage());\n return false;\n } finally {\n db.endTransaction();\n }\n }",
"void deleteUser(int id);",
"public void deleteGoal(Goal goal_1);",
"@Override\n\tpublic void delete(int id) {\n\t}",
"void delete(long idToDelete);",
"@DeleteMapping(\"/delete_person\")\n public void delete_user (@RequestParam(\"id\") int id){\n persons.remove(id);\n }",
"public void deleteRequest(String requestName) {\n\n }",
"void delete(int id) throws Exception;",
"public void deleteCrime(UUID id) {\n\n }",
"public void delete(int id) {\n\n\t}",
"int delete(long id);",
"void delete( Integer id );",
"private void discoverDelete(RoutingContext rctx) {\n rctx.response().end(new ObjectBuilder().build());\n }",
"@Override\n\tpublic void delete(String id) {\n\n\t}",
"public void delete(K id);",
"void deleteByIdWithResponse(String id, Boolean force, Context context);",
"@Override\n\t\tpublic boolean delete(int id) {\n\t\t\t\treturn false;\n\t\t}",
"@Override\r\n\tpublic void delete(String id) {\n\t\t\r\n\t}",
"private void delete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString string = request.getParameter(\"id\");\r\n\t\tservice.delete(Integer.valueOf(string));\r\n\t\trequest.getRequestDispatcher(\"NoticeServlet?service=NoticeGuanLi\").forward(request, response);\r\n\r\n\t}",
"@Override\r\n\tpublic void delete(int id) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void delete(String id) {\n\r\n\t}",
"public void delete(Integer id) {\n\r\n\t}",
"boolean delete(ID id);",
"private void setDeleteFriendAToServer(DeleteFriend.AToServer value) {\n if (value == null) {\n throw new NullPointerException();\n }\n req_ = value;\n reqCase_ = 14;\n }",
"public void deleteFriend(String user, String friend){\n try {\n statement = connection.createStatement();\n statement.executeUpdate(\"DELETE FROM \"+ user + \" WHERE friend='\" + friend +\"'\");\n statement.executeUpdate(\"DELETE FROM \"+friend + \" WHERE friend='\"+user+\"'\");\n }catch (SQLException ex){ex.printStackTrace();}\n\n }",
"public abstract void delete(String ID);",
"public void deleteUser(Integer id) throws BadRequestException;",
"@Override\n\tpublic void delete(long id) {\n\t\t\n\t}",
"@Override\n\tpublic void delete(long id) {\n\t\t\n\t}",
"@Override\n public boolean delete(Integer id) {\n return false;\n }",
"@Override\n\tpublic void delete(Integer id) {\n\t\t\n\t}",
"public deleteFriendRequest(Context context){\n super();\n this.context = context;\n setStrings();\n }",
"public void deleteReply() {\n\r\n\t}",
"int deleteByExample(EpermissionDOExample example);",
"int deleteByExample(OfUserWechatExample example);"
] | [
"0.6736045",
"0.67285013",
"0.6683065",
"0.65134144",
"0.6367925",
"0.6319681",
"0.6176061",
"0.6155656",
"0.6097246",
"0.60590917",
"0.60521525",
"0.60521525",
"0.60521525",
"0.60521525",
"0.60521525",
"0.60521525",
"0.60486937",
"0.5962451",
"0.59620327",
"0.59618187",
"0.5960956",
"0.59411204",
"0.5932836",
"0.5932836",
"0.59290886",
"0.59290886",
"0.5916941",
"0.59101206",
"0.59101206",
"0.58747005",
"0.58597225",
"0.5849797",
"0.5846026",
"0.58393365",
"0.5837534",
"0.58359563",
"0.58281386",
"0.58163965",
"0.5815792",
"0.580887",
"0.580887",
"0.580887",
"0.580887",
"0.580887",
"0.5789933",
"0.57865447",
"0.5781582",
"0.5781582",
"0.57597184",
"0.5754314",
"0.5751623",
"0.5751623",
"0.5751623",
"0.57499725",
"0.57493573",
"0.57493573",
"0.57493573",
"0.5747861",
"0.5747861",
"0.5747861",
"0.5747861",
"0.5730996",
"0.5730996",
"0.5729482",
"0.5727765",
"0.5722743",
"0.5717516",
"0.57173204",
"0.5715234",
"0.5710373",
"0.57064307",
"0.57063687",
"0.56979376",
"0.56960547",
"0.56902623",
"0.56802595",
"0.5677117",
"0.5672984",
"0.5672807",
"0.56699705",
"0.56679046",
"0.56639314",
"0.5663069",
"0.5662859",
"0.56624395",
"0.5661552",
"0.5661439",
"0.56602657",
"0.56590974",
"0.56571174",
"0.5654035",
"0.5634976",
"0.5632657",
"0.5632657",
"0.5627931",
"0.5617491",
"0.56148946",
"0.56140417",
"0.5612622",
"0.5612588"
] | 0.576965 | 48 |
Use OKHttp to send GET API poll request | public ServiceInfo getServiceStatus(String url) throws IOException {
Request request = new Request.Builder().url(url).build();
Response response = client.newCall(request).execute();
serviceInfo = new ServiceInfo(response.code(),
response.message(),response.receivedResponseAtMillis());
return serviceInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String poll();",
"@Test\n\t \n\t public void getApi() {\n\t\t \n\t\t Response getIt=get(\"https://reqres.in/api/users?page=2\");\n\t\t getIt.prettyPrint();\n\t\t System.out.println(getIt.getStatusCode());\n\t\t System.out.println(getIt.getTime());\n\t\t \n\t\t //to validate\n\t\t int validGstatus=getIt.getStatusCode();\n\t\t Assert.assertEquals(validGstatus,200);\n\t\t \n\t }",
"public void GetCall(String url) throws ClientProtocolException, IOException {\n\t\tCloseableHttpClient httpclient=HttpClients.createDefault();\n\t\tHttpGet httpget=new HttpGet(url);\n\t//lohith\n\t\tCloseableHttpResponse closeablehttpresponse=httpclient.execute(httpget);\n\t\tint responsestatuscode=closeablehttpresponse.getStatusLine().getStatusCode();\n\t\tSystem.out.println(\"responsestatuscode: \"+responsestatuscode);\n\t\t\n\t\tString response=EntityUtils.toString(closeablehttpresponse.getEntity(),\"UTF-8\");\n\t\tSystem.out.println(\"ClientResponse: \"+response);\n\t\tJSONObject jsonobject= new JSONObject(response);\n\t\t\n\t\tSystem.out.println(\"jsonobject: \"+jsonobject);\n\t\t\n\t\t\n\t}",
"public interface PocketbitsAPI {\n @GET(\"/api/ticker/\")\n Observable<PocketBitsBean> getPocketbitsTicker();\n}",
"public void getRequestCall(String url, String tag) {\n AppController.getInstance().cancelPendingRequests(tag);\n\n JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET,\n url, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n Log.d(\"TAG\", response.toString());\n try {\n runOnMainThread(response);\n } catch (JSONException ex) {\n ex.getMessage();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n VolleyLog.d(\"TAG\", \"Error: \" + error.getMessage());\n }\n })\n\n {\n /**\n * Passing some request headers\n * */\n @Override\n public Map<String, String> getHeaders() throws AuthFailureError {\n HashMap<String, String> headers = new HashMap<>();\n headers.put(\"Content-Type\", \"application/json; charset=utf-8\");\n return headers;\n }\n };\n\n //Adding policy for socket time out\n RetryPolicy policy = new DefaultRetryPolicy(DefaultRetryPolicy.DEFAULT_TIMEOUT_MS, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);\n jsonObjReq.setRetryPolicy(policy);\n\n // Adding request to request queue\n AppController.getInstance().addToRequestQueue(jsonObjReq, tag);\n }",
"private void doPing()\r\n {\r\n requestQueue.add( new ChargerHTTPConn( weakContext,\r\n CHARGE_NODE_JSON_DATA, \r\n PING_URL,\r\n SN_HOST,\r\n null, \r\n cookieData,\r\n false,\r\n token,\r\n secret ) );\r\n }",
"GetResponse() {\n\t}",
"@Override\n\tprotected String doInBackground(String... params) {\n\t\t RESTClient request=new RESTClient(getURL());\n\t try {\n\t\t\t\trequest.Execute(RequestMethod.GET);\n\t\t\t\treturn request.getResponse();\n\t\t\t} \n\t catch (Exception e) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn null;\n\t\t\t}\n\t \n\t}",
"public interface DataKPU {\n @GET(\"open/v1/api.php?cmd=wilayah_browse&\")\n Call<RWilayah> wilayah_browse(@Query(\"wilayah_id\") String idWil);\n}",
"public interface HttpService {\n//banner/query?type=1\n // public static final String BASE_URL=\"http://112.124.22.238:8081/course_api/\";\n @GET(\"banner/query\")\n Call<List<HeaderBean>> getHeaderData(@Query(\"type\") String type);\n @GET(\"campaign/recommend\")\n Call<List<RecommendBean>> getRecommendData();\n}",
"private void requestServerToGetInformation() {\n Net net = Net.getInstance();\n Log.i(TAG, \"requestServerToGetInformation: Start connect server\");\n net.get(AppConstant.SERVER_COMBO_URL, new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n Log.i(TAG, \"onFailure: connect error; \" + e.getMessage());\n }\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n // get the JSON from responses.\n String jsonStr = response.body().string();\n Log.i(TAG, \"onResponse: --------------------------------\" + jsonStr);\n parseJsonAndUpdateView(jsonStr.trim());\n }\n });\n }",
"public Response poll() {\n response = poll(monitor, jwt, boundary, tlsClientParameters);\n return response;\n }",
"public interface APIInterface {\n @GET(\"/data/price\")\n Call<Object> compareCurrency(@Query(\"fsym\")String fsym, @Query(\"tsyms\") String tsyms);\n @GET(\"/api/data/coinlist/\")\n Call<CurrencyResource> CoinsList();\n}",
"private void fetchEverything() {\n ApiNewsMethods newsEverything = retrofit.create(ApiNewsMethods.class);\n newsEverything.getEverything(\"bitcoin\"/*topic input by user*/, newsApiKey).enqueue(new Callback<NewsModelClass>() {\n @Override\n public void onResponse(Call<NewsModelClass> call, Response<NewsModelClass> response) {\n if(response.isSuccessful()) {\n newsModelBody = response.body();\n Log.d(\"myBODY\", newsModelBody.getStatus());\n //text to speech object of the response fetched\n newsUIChanges();\n } else {\n Log.d(\"mySTRING\", \"DID NOT OCCUR\");\n }\n }\n\n @Override\n public void onFailure(Call<NewsModelClass> call, Throwable t) {\n }\n\n });\n }",
"Task poll();",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\thandlHttpRequest(url, trackerinfo.get_info_hash(), Settings.PEER_DEFAULT_ID);\n\t\t\t\t\t}",
"private JSONObject sendRequestWithOkHttp(int page) {\n JSONObject json = null;\n String url = \"\";\n if (chatroom_id != null) {\n url = String.format(\"http://13.112.156.96/api/asgn3/get_messages?%s&%s\", \"chatroom_id=\" + chatroom_id, \"page=\" + page);\n }\n OkHttpClient client = new OkHttpClient();\n Log.d(GET, url);\n Request request = new Request.Builder()\n .url(url)\n .build();\n try {\n Response response = client.newCall(request).execute();\n String responseData = response.body().string();\n json = new JSONObject(responseData);\n Log.d(GET, String.valueOf(json.get(\"status\")));\n } catch (Exception e) {\n e.printStackTrace();\n Log.d(GET, \"GET Request error\");\n }\n return json;\n }",
"private static String executeRequest(String url) throws IOException {\n\n\t\tLog.d(RiotJsonRequest.class.getSimpleName() , url);\n\t\t\n\t\tSocket s = new Socket(IP, PORT);\n\t\tPrintStream ps = new PrintStream(s.getOutputStream());\n\t\t//Log.d(RiotJsonRequest.class.getSimpleName() , \"PS OPENED\");\n\t\tBufferedReader r = new BufferedReader(new InputStreamReader(\n\t\t\t\ts.getInputStream()));\n\t\t//Log.d(RiotJsonRequest.class.getSimpleName() , \"BR OPENED\");\n\t\tps.println(url);\n\t\t//Log.d(RiotJsonRequest.class.getSimpleName() , \"URL PRNTED\");\n\t\tString response = r.readLine();\n\t\t//Log.d(RiotJsonRequest.class.getSimpleName() , \"RESPONSE: \" + response);\n\t\treturn response;\n\n\t\t// boolean unsuccessful = true;\n\t\t// int tries = 0;\n\t\t// String response = \"\";\n\t\t// while(unsuccessful && tries != 3){\n\t\t// unsuccessful = false;\n\t\t// URL requestUrl = new URL(url);\n\t\t// HttpsURLConnection connection = (HttpsURLConnection)\n\t\t// requestUrl.openConnection();\n\t\t// try{\n\t\t// Log.d(RiotJsonRequest.class.getSimpleName() , url);\n\t\t// connection.setRequestMethod(\"GET\");\n\t\t// connection.getResponseCode();\n\t\t//\n\t\t// //connection.\n\t\t//\n\t\t// connection.connect();\n\t\t//\n\t\t//\n\t\t//\n\t\t//\n\t\t// //Needs error checking on connection\n\t\t//\n\t\t// InputStream in = new\n\t\t// BufferedInputStream(connection.getInputStream());\n\t\t// BufferedReader reader = new BufferedReader(new\n\t\t// InputStreamReader(in));\n\t\t// StringBuffer buffer = new StringBuffer();\n\t\t// String line;\n\t\t//\n\t\t// //reads response in and appends it to buffer\n\t\t// do{\n\t\t// line = reader.readLine();\n\t\t// buffer.append(line);\n\t\t// }while (line != null);\n\t\t//\n\t\t// //disconnects the HttpURLConnection so other requests can be made\n\t\t// connection.disconnect();\n\t\t// //Log.d(RiotJsonRequest.class.getSimpleName() , \"RECEIVED: \" +\n\t\t// buffer.toString());\n\t\t// response = buffer.toString();\n\t\t// }catch(Exception e){\n\t\t// String code = Integer.toString(connection.getResponseCode());\n\t\t// Log.d(RiotJsonRequest.class.getSimpleName() , \"CODE: \" + code);\n\t\t// if(code.equals(\"404\")){\n\t\t// return code;\n\t\t// }\n\t\t// unsuccessful = true;\n\t\t// tries++;\n\t\t// connection.disconnect();\n\t\t// connection = null;\n\t\t// requestUrl = null;\n\t\t// try {\n\t\t// Thread.sleep(1000);\n\t\t// } catch (InterruptedException e1) {\n\t\t// e1.printStackTrace();\n\t\t// }\n\t\t// }\n\t\t// }\n\t\t// return response;\n\t}",
"@Override\n\tpublic PollingResponse msgPolling(PollingRequest param) {\n\t\treturn null;\n\t}",
"@GET\n @Path(\"/ping\")\n\tpublic Response ping() {\n\t\tlog.debug(\"Ping check ok\");\n return Response.status(Response.Status.OK).entity(1).build();\n \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 }",
"public interface ApiServer {\n\n @GET(\"musicDetails?id=604392760\")\n Observable<BaseResponseBean<BasicResponseBean>> getCall();\n\n}",
"public abstract T poll();",
"public void apicall(String str) {\n URL url = null;\n try {\n url = new URL(str);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.setRequestProperty(\"Accept\", \"application/json\");\n\n if (conn.getResponseCode() != HTTP_ERROR) {\n throw new RuntimeException(\"Failed: HTTP error code: \" + conn.getResponseCode());\n }\n\n BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), \"UTF-8\"));\n data = \"\";\n String buffer;\n while ((buffer = br.readLine()) != null) {\n data += buffer;\n }\n conn.disconnect();\n br.close();\n } catch (MalformedURLException e) {\n System.out.println(\"Malformed URL\");\n } catch (IOException e) {\n System.out.println(\"Cannot open url\");\n }\n }",
"String getEEapi(String url, Map<String, String> params, int expectedStatus);",
"void getRequests();",
"HttpApiResponse run(HttpApiRequest request, ThingifierApiConfig config);",
"private static String get_request(String uri, boolean isChecking, String token) throws IOException {\r\n URL url = new URL(uri);\r\n HttpURLConnection connection = (HttpURLConnection) url.openConnection();\r\n connection.setRequestProperty(\"Content-Type\", \"application/json\");\r\n connection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 Edg/88.0.705.74\");\r\n if (isChecking) {\r\n connection.setRequestProperty(\"Authorization\", token);\r\n }\r\n connection.setRequestMethod(\"GET\");\r\n InputStream responseStream = connection.getInputStream();\r\n if (debug) {\r\n System.out.println(\"GET - \"+connection.getResponseCode());\r\n }\r\n try (Scanner scanner = new Scanner(responseStream)) {\r\n String responseBody = scanner.useDelimiter(\"\\\\A\").next();\r\n if (debug) {\r\n System.out.println(responseBody);\r\n }\r\n return responseBody;\r\n } catch (Exception e) {\r\n return \"ERROR\";\r\n }\r\n }",
"public Activity poll();",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"public interface ApiInterface {\n\n @GET(\"v1/volumes\")\n Call<ResponseBody> getlist(@Query(\"q\") String str);\n\n}",
"public interface ApiService {\n\n\n public static final String BASE_URL = \"http://112.124.22.238:8081/course_api/cniaoplay/\";\n\n// @GET(\"featured\")\n// public Call<PageBean<AppInfo>> getApps(@Query(\"p\") String jsonParam);\n\n @GET(\"featured\")\n public Observable<BaseBean<PageBean<AppInfo>>> getApps(@Query(\"p\") String jsonParam);\n\n}",
"@Test\n public void doRequestURL() throws IOException, NoSuchAlgorithmException, KeyManagementException {\n doRequest(\"https://login.cloud.huawei.com/oauth2/v2/token\");\n\n\n //doRequestWithOutHttps(\"https://124.74.46.118:7012/business/service\");\n //doRequestWithOutHttpsPool(\"https://124.74.46.118:7012/business/service\");\n }",
"@GET(\"system/status\")\n Call<InlineResponse200> getStatus();",
"public interface d2ticker {\n @GET(\"/match/{id}\")\n void getMatchesList(@Path(\"id\") long id, Callback<Api> api);\n}",
"private static String useAPI(String urlString) throws IOException {\n String inline = \"\";\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"GET\");\n conn.connect();\n\n int responsecode = conn.getResponseCode();\n if(responsecode == 200) {\n Scanner sc = new Scanner(url.openStream());\n while(sc.hasNext()) {\n inline += sc.nextLine();\n }\n sc.close();\n conn.disconnect();\n return inline;\n }\n conn.disconnect();\n return \"[]\";\n }",
"public interface PokeApiService {\n\n @GET(\"qvqk-dtmf.json\")\n Call<ArrayList<ViasRespuesta>> obtenerListaPokemon();\n}",
"@Test(priority = 2)\r\n\tpublic void getresponse(){\n\t\t\r\n\t\tString resData = get(\"http://samples.openweathermap.org/data/2.5/weather?q=London,uk&appid=b6907d289e10d714a6e88b30761fae22\").asString();\t\r\n\t\tSystem.out.println(resData);\r\n\t\t\r\n\t\tlong time = get(\"\").getTime();\r\n\t\t\r\n\t\tSystem.out.println(\"Response time \" + time);\r\n\t}",
"private void sendPollAction() {\n\t\t\tAsyncCallback<BmUpdateResult> callback = new AsyncCallback<BmUpdateResult>() {\n\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tif (caught instanceof StatusCodeException && ((StatusCodeException) caught).getStatusCode() == 0) {}\n\t\t\t\t\telse showErrorMessage(this.getClass().getName() + \"-sendPollAction() ERROR: \" + caught.toString());\n\t\t\t\t}\n\n\t\t\t\tpublic void onSuccess(BmUpdateResult result) {\n\t\t\t\t\tstopLoading();\n\t\t\t\t\tif (result.hasErrors())\n\t\t\t\t\t\tshowSystemMessage(\"Error al Enviar Encuesta: \" + result.errorsToString());\n\t\t\t\t\telse {\n\t\t\t\t\t\tshowSystemMessage(\"Encuesta Enviada. \"+\n\t\t\t\t\t\t\t\t\"<a href=\\\"\" + GWT.getHostPageBaseURL() + \n\t\t\t\t\t\t\t\t\"/frm/flex_customerpoll.jsp?h=\" + new Date().getTime() + \"proj&w=EXT&z=\" + \n\t\t\t\t\t\t\t\tGwtUtil.encryptId(bmoProject.getId()) + \"&r=interv\" + (new Date().getTime() * 456) +\"\\\" target='_blank'><br>Ver Encuesta</a>\"\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Llamada al servicio RPC\n\t\t\ttry {\n\t\t\t\tif (!isLoading()) {\n\t\t\t\t\tstartLoading();\n\t\t\t\t\tgetUiParams().getBmObjectServiceAsync().action(bmoProject.getPmClass(), bmoProject, BmoProject.ACTION_SENDPOLL, \"\" + bmoProject.getId(), callback);\n\t\t\t\t}\n\t\t\t} catch (SFException e) {\n\t\t\t\tshowErrorMessage(this.getClass().getName() + \"-sendPollAction() ERROR: \" + e.toString());\n\t\t\t}\n\t\t}",
"int poll();",
"public static void simple() throws IOException {\n OkHttpClient client = new OkHttpClient()\n .newBuilder()\n .connectTimeout(5, TimeUnit.SECONDS)\n .build();\n\n Request request = new Request.Builder()\n .url(\"http://www.ncq8.com/test.php\")\n .header(\"X-TEST\", \"test\")\n .header(\"User-Agent\", \"Chrome\")\n .build();\n\n\n Response response = client.newCall(request).execute();\n\n // 响应代码\n if (!response.isSuccessful()) {\n throw new IOException(\"服务器端错误: \" + response);\n }\n int httpCode = response.code();\n System.out.println(\"Status Code:\" + httpCode);\n\n // 单个响应头\n String server = response.header(\"Server\");\n System.out.println(\"Server:\" + server);\n\n // 响应头数组\n Headers headers = response.headers();\n for (int i = 0; i < headers.size(); i++) {\n System.out.println(headers.name(i) + \":\" +headers.value(i));\n }\n\n // 正文\n ResponseBody body = response.body();\n System.out.println(body.contentType().charset());\n System.out.println(body.contentType().type());\n System.out.println(body.contentLength());\n System.out.println(body.string());\n }",
"public interface ApiService {\n @GET(\"/lista_pokemons.php\")\n void getPokemons(Callback<List<PokemonEntity>> response);\n\n\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 }",
"public void request(@NonNull WikiSite wiki, @NonNull Callback cb) {\n cb.success(Compilation.getMockInfoForTesting()); // returning mock info for dev/testing\n\n /*cancel();\n Retrofit retrofit = RetrofitFactory.newInstance(getEndpoint(wiki), wiki);\n Service service = retrofit.create(Service.class);\n call = request(service);\n call.enqueue(new CallbackAdapter(cb));*/\n }",
"private HttpResponse executeHttpGet(String apiUrl) throws OAuthMessageSignerException,\r\n\t\t\tOAuthExpectationFailedException, OAuthCommunicationException, IOException {\r\n\t\tHttpGet httprequest = new HttpGet(apiUrl);\r\n\t\tgetOAuthConsumer().sign(httprequest);\r\n\t\tHttpClient client = new DefaultHttpClient();\r\n\t\tHttpResponse httpresponse = client.execute(httprequest);\r\n\t\tint statusCode = httpresponse.getStatusLine().getStatusCode();\r\n\t\tSystem.out.println(statusCode + \":\" + httpresponse.getStatusLine().getReasonPhrase());\r\n\t\treturn httpresponse;\r\n\t}",
"private void showWeb() throws IOException{\n\n InputStream inputStream;\n BufferedReader bufferedReader;\n PrintWriter out;\n String request;\n String response;\n String[] requestParam;\n String[] requestParamButton;\n String path;\n String sensorDataIndex;\n String message = \"Don't have a Products\";\n String historyURL = \"/history\";\n String listURL = \"/list\";\n String invoiceURL = \"/invoice\";\n String testBadURL = \"/testError\";\n String buyForURL = \"/buyFor\";\n String pathForRefresh = \"\";\n String topic =\"\";\n //For test Status\n String httpStatus = \"\";\n\n try{\n inputStream = socket.getInputStream();\n bufferedReader = new BufferedReader(new InputStreamReader(inputStream));\n request = bufferedReader.readLine();\n if(!request.isEmpty()){\n System.out.println(request);\n requestParam = request.split(\" \");\n path = requestParam[1];\n System.out.println(path);\n if(!path.isEmpty()){\n requestParamButton = path.split(\":\");\n System.out.println(\"requestParamButton lenght is : \" + requestParamButton.length\n + \" last index have \" + requestParamButton[requestParamButton.length - 1]);\n sensorDataIndex = requestParamButton[requestParamButton.length - 1];\n }else{\n sensorDataIndex = \"0\";\n }\n //sensorDataIndex = \"0\";\n\n if(path.contains(buyForURL)){\n manuelOrder(sensorDataIndex);\n message = makeOneStringList();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"List of products : \";\n pathForRefresh = listURL;\n }\n if(path.equals(invoiceURL)){\n message = makeOneStringInvoice();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"Invoise : \";\n pathForRefresh = invoiceURL;\n }\n if(path.equals(historyURL)){\n message = makeOneStringHistory();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"History of products : \";\n pathForRefresh = historyURL;\n }\n if(path.equals(listURL)){\n message = makeOneStringList();\n httpStatus = \"HTTP/1.1 200\";\n topic = \"List of products : \";\n pathForRefresh = listURL;\n /** compare Data from actualSensorData with response Data */\n //testShowList(message);\n }\n /** if path not equals /list or /history will be BAD REQUEST with status 400 */\n if(!path.equals(listURL) && !path.equals(historyURL) && !path.equals(invoiceURL) && !path.contains(buyForURL)){\n message = \"<h1 style='color:red'> BAD REQUEST, ALLOWED ONLY HTTP GET /list or /history REQUESTS </h1>\";\n httpStatus = \"HTTP/1.1 400\";\n topic = \"<h1 style='color:red'> ERROR </h1>\";\n pathForRefresh = testBadURL;\n }\n\n }\n\n /** Color test */\n //testColor(message,httpStatus);\n\n out = new PrintWriter(socket.getOutputStream());\n out.println(httpStatus);\n out.println(\"Content-type: text/html\");\n out.println(\"Server-name: myServer\");\n response = \"<html>\" + \"<head>\"\n + \"<meta http-equiv=\\\"refresh\\\" content=\\\"2\\\"; url=localhost:8282\" + pathForRefresh + \">\"\n + \"<meta charset='utf-8'>\" // Umlauts\n + \"<link rel=\\\"icon\\\" href=\\\"data:;base64,iVBORw0KGgo=\\\">\" // How to prevent favicon.ico requests?\n + \"<title>My Web Server</title></head>\"\n + \"<h1>Your request: \" + request + \"</h3>\"\n + \"<table width=\\\"200\\\">\"\n + \"<td><h3><a href=\\\"/list \\\">List</a></h3></td>\"\n + \"<td><h3><a href=\\\"/history \\\">History</a></h3></td>\"\n + \"<td><h3><a href=\\\"/testError \\\">TestError</a></h3></td>\"\n + \"<td><h3><a href=\\\"/invoice \\\">Invoice</a></h3></td>\"\n + \"<td><h3><a href=\\\"/buyFor \\\">BuyFor</a></h3></td>\"\n + \"</table>\"\n + \"<h1>\" + topic + \"</h1>\"\n + \"<table width=\\\"200\\\">\"\n + \"<h3>\" + message + \"</h3>\"\n + \"</table>\"\n + \"</html>\";\n out.println(\"Content-length: \" + response.length());\n out.println(\"\");\n out.println(response);\n out.flush();\n //out.close();\n //bufferedReader.close();\n }\n catch (IOException e)\n {\n System.out.println(\"Failed respond to client request: \" + e.getMessage());\n }\n\n }",
"private void probeIotasApi(String ip) throws JSONException, IOException {\n\n DefaultHttpClient httpClient = new DefaultHttpClient();\n HttpEntity httpEntity = null;\n HttpResponse httpResponse = null;\n\n HttpGet httpGet = new HttpGet(\"http://\" + ip + \"/iotas\");\n httpResponse = httpClient.execute(httpGet);\n\n int httpStatus = httpResponse.getStatusLine().getStatusCode();\n\n if(httpStatus == 200)\n {\n httpEntity = httpResponse.getEntity();\n String jsonResult = EntityUtils.toString(httpEntity);\n\n if(jsonResult!=null)\n {\n log.debug(\"json result: \" + jsonResult);\n\n JSONObject jsonObject = new JSONObject(jsonResult);\n\n String hostName = jsonObject.getString(\"host_name\");\n String apiVersion = jsonObject.getString(\"version\");\n\n log.debug(\"Found Holiday \" +hostName+ \" with IOTAS API version: \" + apiVersion);\n serviceResults.addServiceResult(new ServiceResult(\"http://\" + ip, hostName, ServiceResult.ScanType.TCP_SCAN));\n callbackListener.onScanResults(serviceResults);\n }\n }\n\n // let exceptions bubble\n }",
"public interface EPAsyncResponseListener {\n public void getJokesfromEndpoint(String result);\n}",
"@GET\n @Path(\"{thingName}/{status}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String recieveAlarm(@PathParam(\"thingName\") String thingName, \n @PathParam(\"status\") String status,@Context UriInfo info) {\n\n MultivaluedMap queryMap = info.getQueryParameters();\n Iterator itr = queryMap.keySet().iterator();\n HashMap<String, String> dataMap = new HashMap<>(); \n while(itr.hasNext()){\n Object key = itr.next();\n Object value = queryMap.getFirst(key);\n dataMap.put(key.toString(), value.toString());\n }\n ThingInfoMap thingInfoMap = new ThingInfoMap(thingName, new Timestamp(new Date().getTime()).toString(),status);\n thingInfoMap.setContent(dataMap);\n \n int alarmID = database.addAlarm(thingInfoMap);\n Dweet newDweet;\n if(alarmID != -1){\n thingInfoMap.setAlarmID(alarmID);\n newDweet = new Dweet(\"succeeded\", \"sending\", \"alarm\", thingInfoMap);\n newDweet.setTo(\"myMobileA\"); // it's not included in database\n String warningMsg = gson.toJson(newDweet);\n //send alarm to mobile use GCM\n sendToMobileByGCM(warningMsg);\n return warningMsg;\n } else {\n newDweet = new Dweet(\"failed\", \"alarm is failed to added\");\n return gson.toJson(newDweet);\n }\n\n }",
"public interface ApiService {\n\n @GET(\"/api/v1/rates/daily/\")\n Call<List<ExchangeRate>> getTodayExchangeRates();\n\n}",
"public void run() {\n\t\t\t\tHttpURLConnection connection = null;\r\n\t\t\t\tStringBuilder response = new StringBuilder();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tURL url = new URL(address);\r\n\t\t\t\t\tconnection = (HttpURLConnection) url.openConnection();\r\n\t\t\t\t\tconnection.setRequestMethod(\"GET\");\r\n\t\t\t\t\tconnection.setConnectTimeout(8000);\r\n\t\t\t\t\tconnection.setReadTimeout(8000);\r\n\t\t\t\t\tconnection.setDoInput(true);\r\n\t\t\t\t\t//connection.setDoOutput(true);\r\n\t\t\t\t\tint responseCode = connection.getResponseCode();\r\n\t\t\t\t\tLog.d(\"HttpUtil\", String.valueOf(responseCode));\r\n\t\t\t\t\tif(responseCode != 200){\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Fail\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tInputStream in = connection.getInputStream();\r\n\t\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\r\n\t\t\t\t\t\tString line;\r\n\t\t\t\t\t\twhile((line = reader.readLine()) != null){\r\n\t\t\t\t\t\t\tresponse.append(line);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Success\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onFinish(response.toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onError(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}finally{\r\n\t\t\t\t\tif(connection != null){\r\n\t\t\t\t\t\tconnection.disconnect();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}",
"public interface ApiService {\n @GET(\"h5game/index/mixlist\")\n Flowable<DataInfo<List<ResultsBean>>> homeFeeds();\n//?app_channel=1000&&push_id=0e47900897c7481e2ec077612a0e1471&system=android&appid=60fa5580-06ca-4f5c-8d5c-0fa41a9d0c7e&phone_version=23&versionNum=213&gouzai_id=G-54e0a4f6ffd6caeac01087c88eb3bfdd&product_type=SM-G9006W&openid=&pno=1&net_stat=1&psize=20&gouzaiId=G-54e0a4f6ffd6caeac01087c88eb3bfdd&version=2.1.3-debug&manufacturer=samsung&channel=1000\n @GET(\"h5game/user/history/list\")\n Flowable<DataInfo<GameInfos>> playHistory();\n}",
"public interface MyCall {\n String URL=\"http://news-at.zhihu.com/api/4/\";\n @GET(\"news/latest\")\n Observable<b_Zhuihu1> getData1();\n @GET(\"sections \")\n Observable<b_Zhihu2> getData2();\n @GET(\"news/hot\")\n Observable<b_Zhihu3>getData3();\n\n String URL2=\"http://api.tianapi.com/wxnew/\";\n @GET(\"?key=52b7ec3471ac3bec6846577e79f20e4c&num=10&page=1\")\n Observable<b_Weixing> getData4();\n\n}",
"public ResponseEvent get(OID oids[]) throws IOException {\n PDU pdu = new PDU();\n for (OID oid : oids) {\n pdu.add(new VariableBinding(oid));\n }\n pdu.setType(PDU.GET);\n ResponseEvent event = mSnmp.send(pdu, getTarget(), null);\n if (event != null) {\n return event;\n }\n throw new RuntimeException(\"GET timed out\");\n }",
"@Test\n void getTest() {\n URI uri = URI.create(endBody + \"/get\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.get(uri);\n\n // check if it received OK\n assertEquals(200, response.statusCode());\n }",
"@Override\n protected String doInBackground(Void... params) {\n if(myApiService == null) {\n MyApi.Builder builder = new MyApi.Builder(AndroidHttp.newCompatibleTransport(), new AndroidJsonFactory(), null)\n // Local testing url (emulator is 10.0.2.2 or use local machine ip)\n // .setRootUrl(\"http://10.0.2.2:8080/_ah/api/\")\n .setRootUrl(\"https://androidjokes-155120.appspot.com/_ah/api/\");\n\n myApiService = builder.build();\n }\n\n // Grab a joke\n try {\n return myApiService.getJoke().execute().getData();\n } catch (IOException e) {\n return e.getMessage();\n }\n }",
"public void notifyHTTPRequest(String url);",
"public interface ApiService {\n @GET(\"get_currency_rates.php\")\n Call<List<Currency>> getRates();\n}",
"@WorkerThread\n public static void makeRpcRequest(Context app, String url, JsonRpcRequestListener listener) {\n\n //https://api-eth.elaphant.app/api/1/eth/getLogs?fromBlock=0\n // &toBlock=latest\n // &topic0=0xdac17f958d2ee523a2206206994597c13d831ec7\n // &topic1=0x000000000000000000000000544976511F2B6237b0b4Fe8fbd271B08164dD1b6\n // &topic1_2_opr=or\n // &topic2=0x000000000000000000000000544976511F2B6237b0b4Fe8fbd271B08164dD1b6\n Request request = new Request.Builder()\n .url(url)\n .header(\"Content-Type\", \"application/json; charset=utf-8\")\n .header(\"Accept\", \"application/json\")\n .build();\n\n\n APIClient.BRResponse resp = APIClient.getInstance(app).sendRequest(request, true);\n String responseString = resp.getBodyText();\n\n if (listener != null) {\n listener.onRpcRequestCompleted(responseString);\n }\n\n// try {\n// String responseString = urlPost(url, payload.toString());\n// if (listener != null) {\n// listener.onRpcRequestCompleted(responseString);\n// }\n// } catch (Exception e) {\n// e.printStackTrace();\n// }\n\n// try {\n// String tmp = urlGET(app, \"https://api-eth.elaphant.app/api/1/eth/token/balance?address=0x289B44672d8499A51130d65d2087A151c4e45966&contractaddress=0xa8cac329f783edac931815c5466e283d48c9d7f7\");\n// Log.d(\"test\", \"test\");\n// } catch (Exception e) {\n// e.printStackTrace();\n// }\n }",
"public void get(IRequest request, IHttpListener listener) {\n if (request != null) {\n request.getParams().getGetBuilder().url(request.getUrl()).id(request.getRequestId()).\n build().execute(new HttpResponse(listener, request.getParserType()));\n } else {\n throw new RuntimeException(\"Request param is null\");\n }\n }",
"public interface GateWay {\n @GET(\"retrofit-demo.php?company_no=123\")\n Call<EmployeeList> getEmployee();\n}",
"public void getRequest_withBasicAuth() {\n apiUtil = new APIUtil();\n // As this is an API call , we are not setting up any base url but defining the individual calls\n apiUtil.setBaseURI(configurationReader.get(\"BaseURL\"));\n //This is used to validate the get call protected with basic authentication mechanism\n basicAuthValidation();\n }",
"public interface LooksoftMainApi {\n @GET(\"main\")\n Call<Data> loadData();\n}",
"public interface HttpGetHandler {\n void setListener(HttpGetResponseListener listener);\n void execute(String url, String tag);\n void cancelRequest(String tag);\n void unregisterListener();\n}",
"E poll();",
"public interface ApiInterface {\n String HOST = \"http://fanyi.youdao.com/\";\n String IMG_HOST = \"http://www.bing.com/\";\n\n @GET(\"openapi.do\")\n Observable<Translation> getTranslation(@Query(\"keyfrom\") String keyfrom,\n @Query(\"key\") String key,\n @Query(\"type\") String type,\n @Query(\"doctype\") String doctype,\n @Query(\"version\") String version,\n @Query(\"q\") String q);\n\n @GET(\"HPImageArchive.aspx\")\n Observable<BackImg> getBackgroundImg(@Query(\"format\") String format,\n @Query(\"idx\") int idx,\n @Query(\"n\") int n);\n\n\n\n}",
"@Override\n protected String doInBackground(String... params){\n\n try {\n //1. Create okHttp Client object\n OkHttpClient client = new OkHttpClient();\n\n Endpoint endpoint = new Endpoint();\n\n //2. Define request being sent to the server\n\n Request request = new Request.Builder()\n .url(endpoint.getUrl())\n .header(\"Connection\", \"close\")\n .build();\n\n //3. Transport the request and wait for response to process next\n Response response = client.newCall(request).execute();\n String result = response.body().string();\n setCode(response.code());\n return result;\n }\n catch(Exception e) {\n return null;\n }\n }",
"@Test\n public void getRequest1() {\n str = METHOD_GET + \"/JavaPower.gif \" + HTTP_VERSION + ENDL +\n HOST_HEADER + \": www.devresource.org\" + ENDL +\n ACCEPT + \": text/html\" + ENDL +\n \"Range-Unit: 3388 | 1024\";\n request = new HttpRequest(str, IP_ADDRESS, HOST);\n\n assertEquals(request.getMethod(), HttpMethod.GET);\n assertEquals(request.getUrn(), \"/JavaPower.gif\");\n assertEquals(request.getHeader(ACCEPT), \"text/html\");\n assertEquals(request.getHeader(\"Range-Unit\"), \"3388 | 1024\");\n assertEquals(request.getHeader(NONEXISTENT_VAR), \"\");\n assertEquals(request.getParameter(NONEXISTENT_VAR), \"\");\n }",
"@Override\n public HealthCheckResponse call() {\n HealthCheckResponseBuilder hcrb = HealthCheckResponse.named(\"WorldClockAPIHealtCheck\");\n try(Socket socket = new Socket()) {\n socket.connect(new InetSocketAddress(\"worldclockapi.com\", 80), 1000);\n hcrb.up();\n } catch (IOException e) {\n hcrb.down();\n }\n return hcrb.build();\n }",
"public interface ApiService {\n @GET(\"charts/transactions-per-second\")\n Observable<Chart> getChartsTransactionsPerSecond(@Query(\"timespan\") String timespan,\n @Query(\"rollingAverage\") String rollingAverage, @Query(\"start\") String start,\n @Query(\"format\") String format, @Query(\"sampled\") String sampled);\n\n @GET(\"stats\")\n Observable<Stat> getStats();\n\n @GET(\"pools?timespan=5days\")\n Observable<Pool> getPools(@Query(\"timespan\") String timespan);\n}",
"public interface Server {\n\n @GET\n Call<CalonModel> getCalon(@Url String url);\n\n}",
"public interface ApiService {\n @GET(\"questcms/floorplan\")\n Call<List<FloorPlan>> listFloorPlan();\n}",
"public void ping() {\n JsonNode rootNode = get(\"ping\");\n\n // TODO verify that the response was \"Pong!\"\n JsonNode dataNode = rootNode.get(\"data\");\n String pong = dataNode.asText();\n }",
"public ServiceResponse getRequest(String url) throws IOException {\n HttpClient client = HttpClientBuilder.create().build();\n HttpGet request = new HttpGet(url);\n HttpResponse httpResponse = client.execute(request);\n ServiceResponse response = new ServiceResponse(httpResponse.getStatusLine().getStatusCode());\n response.setReader(new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent())));\n return response;\n }",
"private String gatewayRequest(String url) {\n final ProgressDialog pDialog = new ProgressDialog(mCtx);\n pDialog.setMessage(\"Loading...\");\n pDialog.show();\n\n JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET,\n url, null,\n new Response.Listener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n manageResponse(response);\n //manageResponse(getDevicesMoke());\n\n pDialog.hide();\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(TAG, \"Error: \" + error.getMessage());\n // hide the progress dialog\n pDialog.hide();\n }\n });\n HttpHandler.getInstance(mCtx).addToRequestQueue(jsonObjReq);\n return \"\";\n\n }",
"public interface GetTicketListener extends ResponseListener {\n \n /**\n * Operation was successful.\n */\n String STATUS_GET_TICKET_OK = \"get_ticket_ok\";\n /**\n * Check that you specified a valid API key.\n */\n String STATUS_WRONG_INPUT = \"wrong_input\";\n \n /**\n * Called when the API request has completed.\n * \n * @param ticket\n * The ticket which you can use to load an authentication\n * webpage. See\n * http://developers.box.net/w/page/12923915/ApiAuthentication\n * @param status\n * See http://developers.box.net/w/page/12923936/\n * ApiFunction_get_ticket for possible status codes that may be\n * returned\n */\n void onComplete(String ticket, String status);\n}",
"R get() throws IOException, ClientProtocolException;",
"private String getResultByUrl(String url) {\r\n\r\n\t\tRequestConfig.Builder requestBuilder = RequestConfig.custom();\r\n\t\trequestBuilder = requestBuilder.setConnectTimeout(75000);\r\n\t\trequestBuilder = requestBuilder.setConnectionRequestTimeout(75000);\r\n\t\trequestBuilder.setSocketTimeout(75000);\r\n\r\n\t\tHttpClientBuilder builder = HttpClientBuilder.create();\r\n\t\tbuilder.setDefaultRequestConfig(requestBuilder.build());\r\n\t\tclient = builder.build();\r\n\r\n\t\trequest = new HttpGet(url);\r\n\t\trequest.addHeader(\"Accept\", \"application/json\");\r\n\r\n\t\tHttpResponse response = null;\r\n\t\tString r = \"\";\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < 7; i++) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Sending request: \" + url);\r\n\t\t\t\t\tresponse = client.execute(request);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (ConnectionPoolTimeoutException e) {\r\n\t\t\t\t\tSystem.out.println(\"Connection timeout. Trying again...\");\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(10);\r\n\t\t\t\t\t} catch (InterruptedException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Response Code : \"\r\n\t\t\t\t\t+ response.getStatusLine().getStatusCode());\r\n\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(response.getEntity()\r\n\t\t\t\t\t.getContent()));\r\n\r\n\t\t\tStringBuffer result = new StringBuffer();\r\n\t\t\tString line = \"\";\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tresult.append(line);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(result + \"\\n\");\r\n\t\t\ttry {\r\n\t\t\t\tTimeUnit.SECONDS.sleep(1);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tr = result.toString();\r\n\t\t\tGson gson = new GsonBuilder().setPrettyPrinting().create();\r\n\r\n\t\t\tJsonObject jsonResult = gson.fromJson(result.toString(),\r\n\t\t\t\t\tJsonObject.class);\r\n\t\t\tif (jsonResult.get(\"backoff\") != null) {\r\n\t\t\t\tint backoff = (jsonResult.get(\"backoff\")).getAsInt();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Received backoff. Waiting for \"\r\n\t\t\t\t\t\t\t+ backoff + \"seconds...\");\r\n\t\t\t\t\tTimeUnit.SECONDS.sleep(backoff + 5);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn r;\r\n\t}",
"public interface CurrenciesApiInterface {\n @GET(Constants.LATEST)\n Call<ResponseBody> getCurrencies();\n}",
"private String makeHttpRequest(URL url) throws IOException {\n String jsonResponse = \"\";\n HttpURLConnection urlConnection = null;\n InputStream inputStream = null;\n try {\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.setReadTimeout(10000 /* milliseconds */);\n urlConnection.setConnectTimeout(15000 /* milliseconds */);\n urlConnection.connect();\n if (urlConnection.getResponseCode() == 200) {\n inputStream = urlConnection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n return jsonResponse;\n }\n\n } catch (IOException e) {\n Log.e(LOG_TAG, \"Problem Http Request\", e);\n } catch (Exception e) {\n Log.e(LOG_TAG, \"Problem Http Request\", e);\n } finally {\n if (urlConnection != null) {\n urlConnection.disconnect();\n }\n if (inputStream != null) {\n // function must handle java.io.IOException here\n inputStream.close();\n }\n }\n return jsonResponse;\n }",
"HeartBeat.Req getHeartBeatReq();",
"@GET(\"/api/data/coinlist/\")\n Call<CoinsResponse> getCoins();",
"@SuppressWarnings(\"unchecked\")\n\t@GET\n @Path(\"get/{hash}\")\n @Produces(\"application/json\")\n public Response getIt(@PathParam(\"hash\") String curHash) {\n \t\n \tJSONObject resp = new JSONObject();\n \t\n \tOnlineStatus on = OnlineStatus.getInstance(); \n \t\n \t// Find SA\n \tint saID = SADAO.hashToId(curHash);\n \t\n \tif (saID == 0) {\n \t\tresp.put(\"Error\", \"Hash not in database\");\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n \t\n \t//if SA is set for exit\n \tif(on.isForExit(curHash)){\n \t\tresp.put(\"Signal\" , \"Kill\");\n \t\ton.exited(curHash);\n \t\t\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n \t\n \t// Update SAs Online Status\n \ton.update(curHash);\n \t\n \t// Find jobs for SA\n \tLinkedList<Job> jobsToSendToSa = JobDAO.getAllSAJobs(saID);\n \t\n \tif(jobsToSendToSa.size() > 0){\n \t\tSystem.out.println(\"Sending to SA \"+curHash+\" the following job(s) :\");\n \t}\n \tfor (Job j : jobsToSendToSa) {\n \t\tj.print();\n \t}\n \t\n \t// Create JSON and Sent\n \tObjectMapper mapper = new ObjectMapper();\n \t\n \ttry{\n \t\t\n \t\tString jsonInString = mapper.writeValueAsString(jobsToSendToSa);\n \t\t\n \t\treturn Response.status(200).entity(jsonInString).build();\n \t\n \t}catch (JsonProcessingException ex){\n \t\t\n \t\tSystem.out.println(ex.getMessage());\n \t\t\n \t\tresp.put(\"Error\", ex.getMessage());\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n }",
"@Override\n public void run() {\n\n new Thread() {\n\n @Override\n public void run() {\n HttpGet requestForTest = new HttpGet(\"http://m.google.com\");\n try {\n new DefaultHttpClient().execute(requestForTest); // can last...\n responded = true;\n } catch (Exception e) {}\n }\n\n }.start();\n\n try {\n int waited = 0;\n while(!responded && (waited < timeout)) {\n sleep(100);\n if(!responded ) { \n waited += 100;\n }\n }\n } \n catch(InterruptedException e) {} // do nothing \n finally { \n if (!responded) { handler.sendEmptyMessage(0); } \n else { handler.sendEmptyMessage(1); }\n }\n\n }",
"public interface IHomeItemDataListener {\n// http://api.mglife.me/v2/home/0?offset=0&limit=20\n\n @GET(\"v2/home/{index}?\")\n Call<HomeItemBean> getHomeItemData(@Path(\"index\") String index, @Query(\"offset\") String offset, @Query(\"limit\") String limit);\n}",
"@Test\n\tpublic void latest_Client() throws ClientProtocolException, IOException\n {\n CloseableHttpClient httpclinet2=HttpClientBuilder.create().build();\n \n // 2 Url purpose\n HttpGet httpget= new HttpGet(\"https://reqres.in\");\n \n // 3 Add Header\n\t httpget.addHeader(\"Authorization\",\"Bearer_ HGHKHGKHGKGKHGHGHJGKHGK\");\n\t \n\t /*********4 execute the API and store response************/ \n\t CloseableHttpResponse response= httpclinet2.execute(httpget);\n\t \n\t // Read the status code\n\t int i= response.getStatusLine().getStatusCode();\n\t System.out.println(i);\n\t Assert.assertEquals(200, i);\n\t \n\t //Print the response and store the response in string, here you cannot directly store the response and print.\n\t HttpEntity entity= response.getEntity();\n\t String data=EntityUtils.toString(entity);\n\t System.out.println(data);\n\t \n\t //GetJson value using Rest Assured Jsonpath value\n\t JsonPath json=new JsonPath(data);\n\t String dataapi=json.getString(\"Meta_.id\");\n\t System.out.println(dataapi);\n\t \n\t //working on Jway API alternative of jpath to retrieve the value.\n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n }",
"private static String sendGET(final Long id) {\n return \"\";\r\n }",
"private String sendGetRequest() throws IOException {\n\t\tString inline = \"\";\n\t\tURL url = new URL(COUNTRYAPI);\n\t\tHttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\t\tconn.setRequestMethod(\"GET\");\n\t\tconn.connect();\n\t\tint responsecode = conn.getResponseCode();\n\t\tif (responsecode != 200) {\n\t\t\tthrow new RuntimeException(\"HttpResponseCode: \" + responsecode);\n\t\t} else {\n\t\t\tScanner sc = new Scanner(url.openStream());\n\t\t\twhile (sc.hasNext()) {\n\t\t\t\tinline += sc.nextLine();\n\t\t\t}\n\t\t\tsc.close();\n\t\t}\n\t\treturn inline.toString();\n\t}",
"public interface HttpListener {\n public void onHttpOk(BaseResponse response);\n public void onHttpErr(String code,String msg);\n}",
"public static Response requestViaSocket(String path) {\n BufferedReader br = null;\n try {\n Socket s = new Socket(QOS_HOST, QOS_PORT);\n PrintWriter pw = new PrintWriter(s.getOutputStream());\n pw.println(\"GET \" + path + \" HTTP/1.1\");\n pw.println(\"Host: \" + QOS_HOST + \":\" + QOS_PORT);\n pw.println(\"\");\n pw.flush();\n\n br = new BufferedReader(new InputStreamReader(s.getInputStream()));\n StringBuilder sb = new StringBuilder();\n String line = null;\n boolean start = false;\n while ((line = br.readLine()) != null) {\n if (start) {\n sb.append(line).append(\"\\n\");\n }\n if (line.equals(QOS_RESPONSE_START_LINE)) {\n start = true;\n }\n }\n String result = sb.toString().trim();\n return new Response(result);\n } catch (Exception e) {\n return new Response(e.getMessage(), false);\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n // ignore\n }\n }\n }\n }",
"private static String makeHTTPRequest(URL url) throws IOException {\n\n // Create an empty json string\n String jsonResponse = \"\";\n\n //IF url is null, return early\n if (url == null) {\n return jsonResponse;\n }\n\n // Create an Http url connection, and an input stream, making both null for now\n HttpURLConnection connection = null;\n InputStream inputStream = null;\n\n try {\n\n // Try to open a connection on the url, request that we GET info from the connection,\n // Set read and connect timeouts, and connect\n connection = (HttpURLConnection) url.openConnection();\n connection.setRequestMethod(\"GET\");\n connection.setReadTimeout(10000 /*Milliseconds*/);\n connection.setConnectTimeout(15000 /*Milliseconds*/);\n connection.connect();\n\n // If response code is 200 (aka, working), then get and read from the input stream\n if (connection.getResponseCode() == 200) {\n\n Log.v(LOG_TAG, \"Response code is 200: Aka, everything is working great\");\n inputStream = connection.getInputStream();\n jsonResponse = readFromStream(inputStream);\n\n } else {\n // if response code is not 200, Log error message\n Log.v(LOG_TAG, \"Error Response Code: \" + connection.getResponseCode());\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n Log.v(LOG_TAG, \"Error making http request: \" + e);\n } finally {\n // If connection and inputStream are NOT null, close and disconnect them\n if (connection != null) {\n connection.disconnect();\n }\n\n if (inputStream != null) {\n // Closing the input stream could throw an IOException, which is why\n // the makeHttpRequest(URL url) method signature specifies that an IOException\n // could be thrown.\n inputStream.close();\n }\n }\n\n return jsonResponse;\n }",
"java.lang.String getResponse();",
"public interface Api {\n\n// root url after add multiple servlets\n\n String BASE_URL = \"https://simplifiedcoding.net/demos/\";\n\n @GET(\"marvel\")\n Call<List<Modelclass>> getmodelclass();\n\n\n\n}",
"public interface WeatherApi {\n @GET(\"weather\")\n Observable<Weather> getWeather(@Query(\"q\") String cityName, @Query(\"units\") String units, @Query(\"APPID\") String openWeatherApiKey);\n\n @GET(\"weather\")\n Call<Weather> getWeather2(@Query(\"q\") String cityName, @Query(\"units\") String units, @Query(\"APPID\") String openWeatherApiKey);\n}",
"public interface ApiCall {\n\n @GET(\"news_feeds\")\n Call<NewsFeedResponse> getNewsFeed(@Query(\"city\") String city, @Query(\"page\") String page);\n\n @GET(\"news\")\n Call<FeedContent> getSingleNewsArticle(@Query(\"city\") String city, @Query(\"news_id\") String newsId);\n\n @GET(\"get_latest_app\")\n Call<FeedHeaderContentResponse> getFeedHeaderResponse(@Query(\"app_name\") String appName, @Query(\"installed_version\") String installedVersion);\n\n @GET(\"jokes\")\n Call<List<JokesResponse>> getAllJokes(@Query(\"page\") String page);\n\n @GET(\"single_joke\")\n Call<SingleJokeResponse> getSingleJoke(@Query(\"joke_id\") String jokeId);\n}",
"public String doHttpGet(String url, final String ...head);",
"public interface MaximApiService {\n @GET(\"\")\n Observable<MaximModel> getPriceMaxim();\n}",
"public interface GsonAPIService {\n\n @Get(\"{query}/pm10.json\")\n @Head(\"Cache-Control:max-age=640000\")\n Call<List<PM25>> getWeather(@Path(\"query\") String query, @Query(\"city\") String city, @Query(\"token\") String token);\n}",
"public void doGet( )\n {\n \n }",
"public interface PokemonService {\n @GET(\"pokemon/?limit=151\")\n Call<ListResponse> listPokemon();\n}",
"@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}"
] | [
"0.60004944",
"0.5902642",
"0.5855425",
"0.5799983",
"0.57639223",
"0.5763695",
"0.5743552",
"0.57158625",
"0.5612556",
"0.5611636",
"0.5599146",
"0.55806464",
"0.5579266",
"0.54957265",
"0.5473096",
"0.5469456",
"0.54647285",
"0.5464088",
"0.5458231",
"0.54573184",
"0.5455457",
"0.54539526",
"0.544077",
"0.54357797",
"0.5430068",
"0.5417251",
"0.5401394",
"0.53952587",
"0.53875244",
"0.53827757",
"0.53805596",
"0.5368744",
"0.53677326",
"0.5363222",
"0.53520066",
"0.53520006",
"0.53452975",
"0.53406775",
"0.53381735",
"0.533806",
"0.53107446",
"0.53077877",
"0.5306041",
"0.53053916",
"0.5305282",
"0.52988666",
"0.5286178",
"0.527378",
"0.5272462",
"0.5269667",
"0.52669775",
"0.5259164",
"0.5254652",
"0.5251875",
"0.52475536",
"0.5243895",
"0.5240599",
"0.5239879",
"0.5236655",
"0.5234342",
"0.5228824",
"0.5222742",
"0.5217938",
"0.5215275",
"0.52148795",
"0.5206043",
"0.52047026",
"0.52037764",
"0.519964",
"0.51861054",
"0.51808155",
"0.5180652",
"0.51781714",
"0.51765686",
"0.517298",
"0.5167856",
"0.51608974",
"0.51566905",
"0.5151922",
"0.51515436",
"0.5150065",
"0.5146694",
"0.5142634",
"0.51424986",
"0.51391256",
"0.5136863",
"0.5133032",
"0.51262176",
"0.5124032",
"0.51201224",
"0.5118955",
"0.5117178",
"0.51153857",
"0.51135886",
"0.5110785",
"0.51095665",
"0.5108664",
"0.5103252",
"0.51019025",
"0.50976956",
"0.50954473"
] | 0.0 | -1 |
Persists the service status information to the database | public void saveServiceStatusInfo(ServiceInfo serviceInfo){
serviceInfoRepository.save(serviceInfo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void saveService();",
"public void saveService(){\r\n \tif(editService != null){\r\n \t\tint id = editService.getId();\r\n \t\ttry {\r\n\t \t\tif(id == 0){\r\n\t \t\t\tthis.getLog().info(\" addService()\");\r\n\t \t\t\tserviceList.addNewServiceToDB(editService.getDisplayServiceName(), editService.getServiceName(), editService.getUrl());\r\n\t \t\t}else{\r\n\t \t\t\tthis.getLog().info(\" updateService(\" + id + \")\");\r\n\t \t\t\tserviceList.updateAlgorithmParameterToDB(editService);\r\n\t \t\t}\r\n\t \t\tthis.getServiceList().populateServiceListFromDB();\r\n\t\t\t} catch (DataStorageException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n \t}\r\n }",
"public void salvarStatus(StatusDefinicao status) throws Exception {\n new StatusDao().salvarAtualizar(status);\n }",
"public void setStatusService(StatusService statusService) {\r\n this.statusService = statusService;\r\n }",
"public static void trackerAdd(Status s) throws ClassNotFoundException, SQLException{\n\t\tClass.forName(\"org.h2.Driver\");\n\t\tConnection conn = DriverManager.getConnection(DB, user, pass);\n\t\t\n\t\tDB_Interface.insertStatus(conn, s);\n\t\tconn.close();\n\t}",
"public void operationSave() {\n\r\n\t\tstatusFeldSave();\r\n\t}",
"@Override\n\tpublic void saveTestCaseStatus(TestCaseStatus testCaseStatus) {\n\t\t\n\t}",
"public void syncUpService(JSONObject obj) {\n ArrayList<ServiceModel> serviceModel = getServiceModelJSON(obj);\n insertServiceSQLite(serviceModel);\n }",
"@Override\n\tpublic void save(ServiceFee entites) {\n\t\tservicefeerepo.save(entites);\n\t}",
"public synchronized void changeServiceStatus() {\n\t\tthis.serviced = true;\n\t}",
"public void save(XmlWriter w) throws Throwable {\n w.add(\"status\", new String[] { \"time\", new SimpleDateFormat(DateTime.DATE_TIME_FORMAT).format(_time) },\n _state);\n }",
"public void saveOrUpdateServiceCat(ServiceCat serviceItem) {\r\n\t\ttry {\r\n\t\t\tsession.saveOrUpdate(serviceItem);\r\n\t\t} catch (Exception e) {\r\n\t\t\ttransaction.rollback();\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"private void storeExecutionStatus(FederatedQueryExecutionStatus executionStatus) throws ResourceException {\n managedResource.setFederatedQueryExecutionStatus(executionStatus);\n }",
"@Override\r\n\t@Transactional\r\n\tpublic void doService() {\n\t\tTbookingrecord booking = new Tbookingrecord();\r\n\t\tbooking.setId(Long.valueOf(31622L));\r\n\t\tbooking.setInstrumentid(2);\r\n\t\tbooking.setUserid(3);\r\n\t\tmappper.insertSelective(booking);\r\n\t\tlogger.debug(booking);\r\n\t\t//int i = 1/0;\r\n\t}",
"private void updateStatus(boolean success) {\n if (success) {\n try {\n callSP(buildSPCall(MODIFY_STATUS_PROC));\n } catch (SQLException exception) {\n logger.error(\"Error updating dataset_system_log with modify entries. \", exception);\n }\n\n try {\n callSP(buildSPCall(COMPLETE_STATUS_PROC, success));\n } catch (SQLException exception) {\n logger.error(\"Error updating dataset_system_log with for merge completion. \",\n exception);\n }\n } else {\n try {\n callSP(buildSPCall(COMPLETE_STATUS_PROC, success));\n } catch (SQLException exception) {\n logger.error(\"Error updating dataset_system_log with for merge completion. \",\n exception);\n }\n }\n }",
"public void addServiceType(ServiceType serviceType){\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tsession.beginTransaction();\n\t\tsession.saveOrUpdate(serviceType);\n\t\tsession.getTransaction().commit();\n\t\tsession.close();\n\t}",
"public void setStatus(ServiceTaskStatus status) {\n\t\tthis.status = status;\n\t}",
"public void onSaveService(final ForwardEvent event) {\r\n\t\t// Get the listitem from the event's target (button)\r\n\t\t// parent(hbox)->parent(listcell)->parent(listitem)\r\n\t\tfinal Listitem li = (Listitem) event.getOrigin().getTarget().getParent().getParent().getParent();\r\n\t\tfinal MasterService service = (MasterService) li.getValue();\r\n\r\n\t\t// save the service\r\n\t\tfinal IPaymentDAO paymentDAO = (IPaymentDAO) SpringUtil.getBean(\"paymentDAO\");\r\n\t\tpaymentDAO.addMasterService(service);\r\n\r\n\t\t// Get the listmodel and update this service in it\r\n\t\tfinal ListModelList services = (ListModelList) page.getAttribute(\"serviceslist\");\r\n\t\tint indx = getListIndex(service, services);\r\n\t\tservices.set(indx, service);\r\n\t\tpage.setAttribute(\"serviceslist\", services);\r\n\t\tfinal Listbox lstservice = (Listbox) Path.getComponent(page, \"lstservice\");\r\n\t\tlstservice.setModel(services);\r\n\t\tlstservice.invalidate();\r\n\t\tClients.evalJavaScript(\"$.jGrowl(\\\"Successfully Saved the service\\\", {life:2000});\");\r\n\t}",
"@Override\n\t\tprotected void postUpdate(EspStatusDTO t) throws SQLException {\n\t\t\t\n\t\t}",
"public void gravar(StatussistemaDTO statussistemaDTO) {\n Database.manager.getTransaction().begin();\n if (statussistemaDTO.getIdStatussistema() == 0) {\n Database.manager.persist(statussistemaDTO); // gravar\n } else {\n Database.manager.merge(statussistemaDTO); // atualizar\n }\n Database.manager.getTransaction().commit();\n\n }",
"public void saveStrategyStatus() throws JSystemTraderException {\r\n int rowCount = getRowCount();\r\n for (int row = 0; row < rowCount; row++) {\r\n Object[] rowData = getRow(row);\r\n\r\n String strategyName = getStrategyForRow(row).getClass().getName();\r\n jprefs.putBoolean(strategyStatusPrefix + strategyName, (Boolean) rowData[0]);\r\n }\r\n }",
"public TransactionStatus internalSaveTransactionStatus(HfgwUserContext userContext, TransactionStatus transactionStatus, Map<String,Object> options) throws Exception \n\t{\n\t\t\n\t\t\n\t\tsynchronized(transactionStatus){ \n\t\t\t//will be good when the transactionStatus loaded from this JVM process cache.\n\t\t\t//also good when there is a ram based DAO implementation\n\t\t\t//make changes to TransactionStatus.\n\t\t\tif (transactionStatus.isChanged()){\n\t\t\t\n\t\t\t}\n\t\t\ttransactionStatus = saveTransactionStatus(userContext, transactionStatus, options);\n\t\t\treturn transactionStatus;\n\t\t\t\n\t\t}\n\n\t}",
"public boolean save() {\n return save(Datastore.fetchDefaultService(), false);\n }",
"@Override\n\tpublic Integer insertServices(com.easybooking.model.BookedServices services) {\n\t\tint i = 0 ;\n\t\tSessionFactory factory = HibernateUtil.getSesssionFactory();\n\t\tSession session = factory.openSession();\n\t\tsession.beginTransaction();\n\t\tsession.save(services);\n\t\tsession.getTransaction().commit();\n\t\tsession.close();\n\t\tfactory.close();\n\t\treturn i;\n\t}",
"public void writeToServiceFile()\r\n {\r\n\ttry(ObjectOutputStream toServiceFile = \r\n new ObjectOutputStream(new FileOutputStream(\"listfiles/servicelist.dta\")))\r\n\t{\r\n toServiceFile.writeObject(serviceList);\r\n\t}\r\n\tcatch(NotSerializableException nse)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Service objektene er ikke \"\r\n + \"serialiserbare.\\nIngen registrering på fil!\"\r\n + nse.getMessage(), \"Feilmelding\", \r\n JOptionPane.ERROR_MESSAGE);\r\n\t}\r\n\tcatch(IOException ioe)\r\n\t{\r\n JOptionPane.showMessageDialog(null, \"Det oppsto en feil ved skriving \"\r\n + \"til fil.\\n\" + ioe.getMessage());\r\n\t}\r\n }",
"public void save() {\r\n\t\ttry {\r\n\t\t\tthis.iniObjects();\r\n\t\t\tGxyService currentService = getGxyService();\r\n\t\t\tCompassSession session = new CobooCompass().getCompass().openSession();\r\n\t\t\tCompassTransaction tx = session.beginLocalTransaction();\r\n\t\t\tPerson person = null;\r\n\t\t\tCompassHits hits = session.find(\"ResidentpersonId:\" + this.personId.getHValue());\r\n\t\t\tif (hits.length() > 0) {\r\n\t\t\t\tCompassHit hit = hits.hit(0);\r\n\t\t\t\tperson = (Person) hit.getData();\r\n\t\t\t} else {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tCalendar cal = Calendar.getInstance();\r\n\t\t\tcal.setTime(this.visitTime[visitNo]);\r\n\t\t\tString StrYear = String.valueOf(cal.get(Calendar.YEAR));\r\n\r\n\t\t\tInfo gxyInfo = person.getGxyInfo();\r\n\t\t\tList<YearService> servicesOfYear = new ArrayList<YearService>();\r\n\t\t\tif (gxyInfo == null) {\r\n\t\t\t\tInfo Info = new GxyInfo();\r\n\t\t\t\tInfo.setIf_gxy(true);\r\n\t\t\t\tInfo.setDiagTime(new Date());\r\n\t\t\t\tperson.setGxyInfo(Info);\r\n\t\t\t\tgxyInfo = Info;\r\n\t\t\t} // else {\r\n\t\t\t\r\n\t\t\tservicesOfYear = gxyInfo.getYearServices();\r\n\t\t\tboolean found = false;\r\n\t\t\tfor (YearService ys : servicesOfYear) {\r\n\t\t\t\tif (ys.getYear().equals(StrYear)) {\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\tGxyService[] gxyServices = ys.getServicesOfYear();\r\n\t\t\t\t\tgxyServices[visitNo] = currentService;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif (!found) {\r\n\t\t\t\tYearService newYs = new YearService();\r\n\t\t\t\tnewYs.setYear(StrYear);\r\n\t\t\t\tGxyService[] gxyServices = newYs.getServicesOfYear();\r\n\t\t\t\tfor (int i = 0; i < gxyServices.length; i++) {\r\n\t\t\t\t\tgxyServices[i] = new GxyService();\r\n\t\t\t\t\tgxyServices[i].setId(System.nanoTime());\r\n\t\t\t\t}\r\n\t\t\t\tgxyServices[visitNo] = currentService;\r\n\t\t\t\tservicesOfYear.add(newYs);\r\n\r\n\t\t\t}\r\n\t\t\t// }\r\n\t\t\tgxyInfo.setYearServices(servicesOfYear);\r\n\t\t\tperson.setGxyInfo(gxyInfo);\r\n\r\n\t\t\t// session.save(this.doctors[this.visitNo]);\r\n\t\t\t// gxyInfo.setId(System.nanoTime());\r\n\r\n\t\t\tsession.save(currentService);\r\n\t\t\tsession.save(person);\r\n\t\t\ttx.commit();\r\n\t\t\tsession.close();\r\n\t\t\tsuper.saveFile(this);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void atualizarStatusSolicitacaoServicoSara() {\n\t\tList<SolicitacaoServico> solicitacoes = new ArrayList<>();\n\t\ttry {\n\t\tgetSolicitacaoServicoDAO().beginTransaction();\n\t\tsolicitacoes = getSolicitacaoServicoDAO().getSolicitacaoServicoNaoFinalizadas();\n\t\tgetSolicitacaoServicoDAO().closeTransaction();\n\t\t\n\t\tfor(SolicitacaoServico s : solicitacoes) {\n\t\t\tif(s.getStatusServicos() != StatusServicos.CRIA_OS_SARA) {\n\t\t\tString status = getSolicitacaoServicoDAO().getStatusServerSara(s.getSolicitacao().getNumeroATI(), s.getOS());\n\t\t\tif(status.equals(\"OS_GERADA\")) {\n\t\t\t\ts.setStatusServicos(StatusServicos.OS_GERADA);\n\t\t\t}else \n\t\t\t\tif(status.equals(\"OS_INICIADA\")) {\n\t\t\t\t\ts.setStatusServicos(StatusServicos.OS_INICIADA);\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t\tif(status.equals(\"FINALIZADO\")) {\n\t\t\t\t\t\ts.setStatusServicos(StatusServicos.FINALIZADO);\n\t\t\t\t\t}\n\t\t\tgetDAO().beginTransaction();\n\t\t\talterar(s.getSolicitacao(), \"Alteração de Status do serviço\",s.getSolicitacao().getUltResponsavel());\n\t\t\tgetDAO().commitAndCloseTransaction();\n\t\t\t}\n\t\t\n\t\t}\n\t\t}catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}",
"public void updateStoredServices() {\n\t\ttableModelStoredServices.setData(((PswGenCtl) ctl).getServices().getServices());\n\t}",
"@Override\n\tpublic Integer updateServices(com.easybooking.model.BookedServices services) {\n\t\tint i = 0 ;\n\t\tSessionFactory factory = HibernateUtil.getSesssionFactory();\n\t\tSession session = factory.openSession();\n\t\tsession.beginTransaction();\n\t\tsession.update(services);\n\t\tsession.getTransaction().commit();\n\t\tsession.close();\n\t\tfactory.close();\n\t\treturn i;\n\t}",
"@Override\r\n\tpublic sn.ucad.master.assurance.bo.Service ajoutService(sn.ucad.master.assurance.bo.Service service) {\n\t\treturn serviceRepository.save(service);\r\n\t}",
"public void saveProgress() {\n\t\tsaveUsers();\n\t\tsaveMaterials();\n\t\tsaveBorrowings();\n\t}",
"public void save(HrCStatitem entity);",
"@Override\n public boolean commitSMO() {\n return true;\n }",
"int insert(StatusByUser record);",
"@Override\n\tprotected void save() throws Exception {\n\t\t//turn the list of data into a unique list of tickets\n\t\tMap<String, ExtTicketVO> tickets= new HashMap<>(data.size());\n\t\tfor (SOHDRFileVO dataVo : data) {\n\t\t\t//035 are harvests and all we care about\n\t\t\tif (\"035\".equals(dataVo.getSoType())) {\n\t\t\t\tExtTicketVO vo = transposeTicketData(dataVo, new ExtTicketVO());\n\t\t\t\ttickets.put(vo.getTicketId(), vo);\n\t\t\t}\n\t\t}\n\n\t\tpopulateTicketDBData(tickets);\n\n\t\ttickets = removeGhostRecords(tickets);\n\n\t\t//don't bother with the rest of this class if we have no tickets\n\t\tif (tickets.isEmpty()) return;\n\n\t\tdecomissionUnits(tickets.keySet()); //ticket\n\n\t\tpurgePartShipments(tickets.keySet()); //calls purgeShipments to cascade deletion\n\n\t\tsetDispositionCode(tickets); //ticket_data attr_dispositionCode\tNONREPAIRABLE\n\n\t\tcorrectLedgerEntries(tickets);\n\t}",
"@Override\n\tpublic void persist() throws EventManagementException {\n\t\t\n\t}",
"public void saveState() {\n table.saveState(store);\n }",
"public void insertStatus(JobStatus status, String userId) throws DatabaseException, IllegalArgumentException;",
"private void saveOrderStatus(final FraudOrderStatusRequest fraudOrderResponse)\n\t{\n\t\tfor (final FraudOrderStatus fraudOrderStatus : fraudOrderResponse.getOrders())\n\t\t{\n\t\t\tfinal BaseStoreModel baseStoreModel = getBaseStoreService().getCurrentBaseStore();\n\t\t\tfinal OrderModel order = fraudOrderStatusDao.findOrderByCodeAndStore(fraudOrderStatus.getMerchantReferenceNumber(),\n\t\t\t\t\tbaseStoreModel);\n\t\t\tsaveOrderStatus(fraudOrderStatus, order);\n\t\t}\n\t}",
"boolean store(List<Person> persons) throws ServiceException;",
"@Override\r\n\tpublic void add(snstatus sns) {\n\t\tsuper.getHibernateTemplate().save(sns); \r\n\t}",
"public Services(){\n ID = new SimpleDateFormat(\"yyyyMMdd_HHmmss\").format(new Date());\n state = STATUS_IN_PROGRESS;\n name = \"\";\n date = \"\";\n description = \"\";\n note = \"\";\n mileage = 000000;\n }",
"protected void saveHistoryData() throws RemoteHomeManagerException {\n int expected = (isCurrentState()) ? 1 : 0;\n if (isEnabledScheduler()) {\n Boolean action = getLightSchedule().getCurrentSchedule();\n expected = action?1:0;\n }\n HistoryData history = new HistoryData();\n history.setDeviceId(getDeviceId());\n history.setDataName(\"ONOFF\");\n history.setDataValue(((isCurrentState())?1:0)+\"|\"+expected);\n history.setDataTimestamp();\n m.getPersistance().addHistoryData(history);\n RemoteHomeManager.log.debug(\"Saved history data: \"+history.toString());\n }",
"public void save() {\r\n try {\r\n FileOutputStream fos = new FileOutputStream(REPO_STATE_FILE_NAME);\r\n fos.write(CodecUtils.toJson(this).getBytes());\r\n fos.close();\r\n } catch (Exception e) {\r\n Logging.logError(e);\r\n }\r\n }",
"void transStatus()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif(passenger != null && status.equals(\"soon\"))\r\n\t\t\t{\r\n\t\t\t\tService s_temp = new Service(passenger);\r\n\t\t\t\tdes = passenger.loc;\r\n\t\t\t\tmakeService(loc.i*80+loc.j,des.i*80+des.j);\r\n\t\t\t\tstatus = \"stop\";\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tstatus = \"serve\";\r\n\t\t\t\tdes = passenger.des;\r\n\t\t\t\ts_temp.path.add(loc);\r\n\t\t\t\tmakeService(loc.i*80+loc.j,des.i*80+des.j,s_temp.path);\r\n\t\t\t\tstatus = \"stop\";\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tcredit += 3;\r\n\t\t\t\tser_times += 1;\r\n\t\t\t\tservices.add(s_temp);\r\n\t\t\t\t//refresh:\r\n\t\t\t\tstatus = \"wait\";\r\n\t\t\t\tpassenger = null;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Sorry to catch Exception!\");\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic void save() {\n\r\n\t\ts.save();\r\n\r\n\t}",
"@Override\r\n\tpublic int save(SpUser t) {\n\t\treturn 0;\r\n\t}",
"@Override\r\n public boolean insertActiveStatus(ActiveStatusModel pStatusModel) {\r\n jdbcTemplate.update(SQL_INSERT, new Object[]{pStatusModel.getName(), pStatusModel.getDescription()});\r\n return true;\r\n }",
"public void buildAccountStatus() {\n try (PreparedStatement prep = Database.getConnection()\n .prepareStatement(\"CREATE TABLE IF NOT EXISTS account_status (user_id\"\n + \" TEXT UNIQUE, status INT, FOREIGN KEY (user_id) REFERENCES users\"\n + \"(id)\" + \" ON DELETE CASCADE ON UPDATE CASCADE);\")) {\n prep.executeUpdate();\n } catch (final SQLException e) {\n e.printStackTrace();\n }\n }",
"void save() {\r\n if (actionCompleted) {\r\n forget();\r\n } else {\r\n AccountSettings.stateStored = new Bundle();\r\n save(AccountSettings.stateStored);\r\n }\r\n }",
"public TRptConfigStatus createTRptConfigStatus(final TRptConfigStatus tRptConfigStatus) {\n\t\tLOGGER.info(\"=========== Create TRptConfigStatus ===========\");\n\t\treturn genericDAO.store(tRptConfigStatus);\n\t}",
"public static void putStatusOffline()\n {\n try\n {\n DatabaseData.updateUserStatusOffline(userId);\n }catch(Exception e) {\n putStatusOffline();\n }\n }",
"@Override\r\n\tpublic void save() {\n\t\tSystem.out.println(\"UserServiceImplÍ┤đđ┴╦\");\r\n\t\tuserDao.save();\r\n\t}",
"public void storeAndCommit() {\n \tsynchronized(mDB.lock()) {\n \t\ttry {\n \t \t\tstoreWithoutCommit();\n \t \t\tcheckedCommit(this);\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \t}\n }",
"private void saveNameToLocalStorage(String phNumber, int status) {\n db.addName(phNumber, status);\n Name n = new Name(phNumber, status);\n names.add(n);\n\n\n\n }",
"@Override\n public void persist() {\n }",
"private Boolean persistRecords() {\n\t\t//Declarations\n\t\tBoolean persisted = false;\n\t\t\n\t\ttry{\t\t\t\t\t\n\t\t\t//Create the DB Handler\n\t\t\tDBHandler dbHandler = new DBHandler();\t\t\t\n\t\t\tDate date = new Date();\n\t\t\t\t\t\t\n\t\t\t//Set the updated time\n\t\t\t_medicalData.setUpdatedOn(date.toString());\n\t\t\t\n\t\t\t//Store the data to data store\n\t\t\tpersisted = dbHandler.storeData(_medicalData);\t\t\t\t\t\t\n\t\t}catch(Exception ex){\n\t\t\tpersisted = false;\n\t\t}\n\t\t\n\t\treturn persisted;\t\t\n\t}",
"@Override\n public void saveTransactionDetails(TransactionInfo transactionInfo) {\n repositoryService.saveTransactionDetails(transactionInfo);\n update(\"transactions\", String.class, TransactionInfo.class, LocalDateTime.now().toString(), transactionInfo);\n }",
"private void actuallyWriteData() {\r\n\t\t// Get rid of old data. Getting rid of trips, trip patterns, and blocks\r\n\t\t// is a bit complicated. Need to delete them in proper order because\r\n\t\t// of the foreign keys. Because appear to need to use plain SQL\r\n\t\t// to do so successfully (without reading in objects and then\r\n\t\t// deleting them, which takes too much time and memory). Therefore\r\n\t\t// deleting of this data is done here before writing the data.\r\n\t\tlogger.info(\"Deleting old blocks and associated trips from database...\");\r\n\t\tBlock.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trips from database...\");\r\n\t\tTrip.deleteFromSandboxRev(session);\r\n\r\n\t\tlogger.info(\"Deleting old trip patterns from database...\");\r\n\t\tTripPattern.deleteFromSandboxRev(session);\r\n\t\t\r\n\t\t// Now write the data to the database.\r\n\t\t// First write the Blocks. This will also write the Trips, TripPatterns,\r\n\t\t// Paths, and TravelTimes since those all have been configured to be\r\n\t\t// cascade=CascadeType.ALL .\r\n\t\tlogger.info(\"Saving {} blocks (plus associated trips) to database...\", \r\n\t\t\t\tgtfsData.getBlocks().size());\r\n\t\tint c = 0;\r\n\t\tfor (Block block : gtfsData.getBlocks()) {\r\n\t\t\tlogger.debug(\"Saving block #{} with blockId={} serviceId={} blockId={}\",\r\n\t\t\t\t\t++c, block.getId(), block.getServiceId(), block.getId());\r\n\t\t\twriteObject(block);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving routes to database...\");\r\n\t\tRoute.deleteFromSandboxRev(session);\r\n\t\tfor (Route route : gtfsData.getRoutes()) {\r\n\t\t\twriteObject(route);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving stops to database...\");\r\n\t\tStop.deleteFromSandboxRev(session);\r\n\t\tfor (Stop stop : gtfsData.getStops()) {\r\n\t\t\twriteObject(stop);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving agencies to database...\");\r\n\t\tAgency.deleteFromSandboxRev(session);\r\n\t\tfor (Agency agency : gtfsData.getAgencies()) {\r\n\t\t\twriteObject(agency);\r\n\t\t}\r\n\r\n\t\tlogger.info(\"Saving calendars to database...\");\r\n\t\tCalendar.deleteFromSandboxRev(session);\r\n\t\tfor (Calendar calendar : gtfsData.getCalendars()) {\r\n\t\t\twriteObject(calendar);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving calendar dates to database...\");\r\n\t\tCalendarDate.deleteFromSandboxRev(session);\r\n\t\tfor (CalendarDate calendarDate : gtfsData.getCalendarDates()) {\r\n\t\t\twriteObject(calendarDate);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare rules to database...\");\r\n\t\tFareRule.deleteFromSandboxRev(session);\r\n\t\tfor (FareRule fareRule : gtfsData.getFareRules()) {\r\n\t\t\twriteObject(fareRule);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving fare attributes to database...\");\r\n\t\tFareAttribute.deleteFromSandboxRev(session);\r\n\t\tfor (FareAttribute fareAttribute : gtfsData.getFareAttributes()) {\r\n\t\t\twriteObject(fareAttribute);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving frequencies to database...\");\r\n\t\tFrequency.deleteFromSandboxRev(session);\r\n\t\tfor (Frequency frequency : gtfsData.getFrequencies()) {\r\n\t\t\twriteObject(frequency);\r\n\t\t}\r\n\t\t\r\n\t\tlogger.info(\"Saving transfers to database...\");\r\n\t\tTransfer.deleteFromSandboxRev(session);\r\n\t\tfor (Transfer transfer : gtfsData.getTransfers()) {\r\n\t\t\twriteObject(transfer);\r\n\t\t}\r\n\t}",
"void setSaveStatus(boolean b) {\n int status = (b) ? 1 : 0;\n setStat(status, saveStatus);\n }",
"public void persist(Timesheet ts) {\n\t em.persist(ts);\n\t }",
"List<Status> getStatusAlteraveis() throws ServiceException;",
"@Override\n public void setFamilyServiceStatus(String status) {\n }",
"public interface DbServices {\n\n String getLocalStatus();\n\n void save(UserEntity userEntity);\n\n UserEntity read(long id);\n\n UserEntity readByName(String name);\n\n List<UserEntity> readAll();\n\n void shutdown();\n}",
"public void insert(Service servico){\n Database.servico.add(servico);\n }",
"public void actualizarEstadoSiendoAtendido(Paciente paciente) {\n paciente.setStatus(\"Siendo atendido\");\n Paciente elemento = pacienteRepository.save(paciente);\n }",
"private void save() {\n Saver.saveTeam(team);\n }",
"private void save() {\r\n\t\tif (Store.save()) {\r\n\t\t\tSystem.out.println(\" > The store has been successfully saved in the file StoreData.\\n\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\" > An error occurred during saving.\\n\");\r\n\t\t}\r\n\t}",
"public void setStatus(org.nhind.config.EntityStatus status) {\n this.status = status;\n }",
"@Override\r\n\tpublic void persist(Seat seatHoldState, SeatState value) {\n\t\t\r\n\t}",
"private void storeData() {\r\n final File tweetsFile = new File(tweetsStorePath);\r\n final File usersFile = new File(usersStorePath);\r\n final Set<TweetEntity> tweetEntities = new HashSet();\r\n final Set<UserEntity> userEntities = new HashSet();\r\n \r\n tweets.entrySet().stream().forEach(entry -> {\r\n entry.getValue().stream().forEach(\r\n status -> {\r\n try {\r\n tweetEntities.add(\r\n new TweetEntity(status,\r\n entry.getKey()));\r\n userEntities.add(\r\n new UserEntity(status.getUser()));\r\n } catch (UnsupportedEncodingException ex) {\r\n \r\n }\r\n });\r\n });\r\n\r\n try {\r\n try (PrintWriter tweetWriter = new PrintWriter(tweetsFile)) {\r\n tweetEntities.stream().forEach(entity -> {\r\n tweetWriter.println(entity.toString());\r\n });\r\n }\r\n try (PrintWriter userWriter = new PrintWriter(usersFile)) {\r\n userEntities.stream().forEach(entity -> {\r\n userWriter.println(entity.toString());\r\n });\r\n }\r\n } catch (IOException ex) {\r\n System.out.println(\"DBLIS - storeData() - error storing data\" + ex);\r\n }\r\n }",
"private void insertServiceSQLite(ArrayList<ServiceModel> servicesModel) {\n db.execSQL(\"DELETE FROM \" + DBSQLite.TABLE_PRICE_SERVICE\n + \" WHERE \" + DBSQLite.KEY_PRICE_SERVICE_IS_OFFER + \"=0\");\n db.execSQL(\"DELETE FROM \" + DBSQLite.TABLE_SERVICE);\n\n for (ServiceModel serviceModel : servicesModel) {\n ContentValues serviceContent = new ContentValues();\n\n serviceContent.put(DBSQLite.KEY_SERVICE_ID, serviceModel.getId());\n serviceContent.put(DBSQLite.KEY_SERVICE_NAME, serviceModel.getName());\n serviceContent.put(DBSQLite.KEY_SERVICE_DESCRIPTION, serviceModel.getDescription());\n serviceContent.put(DBSQLite.KEY_SERVICE_IMAGE, serviceModel.getImage());\n serviceContent.put(DBSQLite.KEY_SERVICE_RESERVED, serviceModel.getReserved());\n serviceContent.put(DBSQLite.KEY_SERVICE_ID_TYPE, serviceModel.getIdType());\n serviceContent.put(DBSQLite.KEY_SERVICE_NAME_TYPE, serviceModel.getNameType());\n serviceContent.put(DBSQLite.KEY_SERVICE_VALUE_TYPE, serviceModel.getValueType());\n\n if (db.insert(DBSQLite.TABLE_SERVICE, null, serviceContent) == -1)\n System.out.println(\"Ocurrio un error al inserar la consulta en ServiceModel\");\n\n serviceServicePrice.insertServicePriceSQLite(serviceModel.getServicePrice());\n }\n }",
"@Test\n public void testDeployedStateAndDeployedService() {\n cleanUp();\n\n State state = makeState(1L, \"State 1\");\n deployedServiceDataService.create(new DeployedService(state, Service.MOBILE_ACADEMY));\n\n assertTrue(propertyService.isServiceDeployedInState(Service.MOBILE_ACADEMY, state));\n }",
"public void save() {\n JobNotificationDao dao = new JobNotificationDao();\n projectBean.getWorkload().getJobConfiguration().getNotifications().clear();\n for (JobNotification notification : notifications) {\n notification.copyTransient();\n notification = dao.saveOrUpdate(notification);\n projectBean.getWorkload().getJobConfiguration().getNotifications().add(notification);\n }\n }",
"@Override\r\n\tpublic void persist() {\n\t}",
"private void save(MyContext myContext) {\n if (isMember.unknown || group.actorId == 0 || memberId == 0 || myContext == null ||\n myContext.getDatabase() == null) return;\n\n for (int pass=0; pass<5; pass++) {\n try {\n tryToUpdate(myContext, isMember.toBoolean(false));\n break;\n } catch (SQLiteDatabaseLockedException e) {\n MyLog.i(this, \"update, Database is locked, pass=\" + pass, e);\n if (DbUtils.waitBetweenRetries(\"update\")) {\n break;\n }\n }\n }\n }",
"@Override\n\tpublic void saveData()\n\t{\n ssaMain.d1.pin = ssaMain.tmp_pin1;\n ssaMain.d1.balance = ssaMain.tmp_balance1;\n System.out.println(\"Your account has been established successfully.\");\n\t}",
"public void saveService(String condition) {\n if (super.getSelected() != null) {\n if (getFileImage() != null) {\n upload(getFileImage());\n }\n if (condition != null && ConditionType.NEW.getNameCondition().equals(condition)) {\n saveNew(null);\n } else {\n save(null);\n }\n }\n setFileImage(null);\n }",
"public void setServicestatusid(Integer servicestatusid) {\r\n this.servicestatusid = servicestatusid;\r\n }",
"@PreDestroy\n public void saveStates() {\n if(getShopId() != 0) {\n log.info(\"Interrupt matching for shop {} during phase {} at {} \", getShopId(), getPhase(), new Date());\n getRemainingStates().add(new State(getShopId(), getPhase(), getPictureIds()));\n }\n getMatcherStateRepository().saveAllStates(getRemainingStates());\n }",
"public void saveAndUpdateJobStatus(AbstractPersistedAnalysisJob job) {\r\n job.setLastUpdateDate(new Date());\r\n getWorkspaceService().savePersistedAnalysisJob(job);\r\n updateJobStatus(job);\r\n }",
"public void save(){\r\n\t\tmanager.save(this);\r\n\t}",
"protected void trackLoginStatus(String ipAddress, String username, int status) {\n\t\tJdbcTemplate template = new JdbcTemplate( dataSource);\n\t\tString sql = \"INSERT INTO login_track_tbl (ip_address, login_status, username) VALUES (?,?,?)\";\n\t\t\n\t\ttemplate.update(sql, new Object[] { ipAddress, status, username });\n\t}",
"@Transactional\n public abstract OnmsServiceType createServiceTypeIfNecessary(String serviceName);",
"int insert(SurveystatusPkey record);",
"void addService(ServiceInfo serviceInfo);",
"org.hl7.fhir.ObservationStatus addNewStatus();",
"public abstract void saveChanges() throws SOAPException;",
"@Override\r\n\tpublic boolean add(ServicesDto servicesDto) {\r\n\t\ttry {\r\n\t\t\t// add the category to database table\r\n\t\t\tsessionFactory.getCurrentSession().persist(servicesDto);\r\n\t\t\treturn true;\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"@Override\n\tpublic int addStationstoServices(Service serviceDTO) {\n\t\tcom.svecw.obtr.domain.Service serviceDomain = new com.svecw.obtr.domain.Service();\n\t\tserviceDomain.setSourceStationId(serviceDTO.getSourceStationId());\n\t\tserviceDomain.setDestinationStationId(serviceDTO.getDestinationStationId());\n\t\tserviceDomain.setServiceId(serviceDTO.getServiceId());\n\t\tSystem.out.println(serviceDTO.getServiceId());\n\t\t//System.out.println(serviceDTO.getDestinationStationId());\n\t\treturn iStationToService.addServiceToStation(serviceDomain);\n\t}",
"private void saveAppState(Context context) {\n LogHelper.v(LOG_TAG, \"Saving state.\");\n }",
"Transfer updateStatus(Long id, Payment.Status status);",
"public void save() {\r\n\t\tCampLeaseDAO leaseDao = (CampLeaseDAO) getApplicationContext().getBean(\"leaseDaoBean\", CampLeaseDAO.class);\r\n\t\tleaseDao.save(this);\r\n\t}",
"public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }",
"public void salvar() throws Exception {\t\r\n\t\t\t\t\r\n\t\tDate date = new Date();\r\n\t\tString url = evento.getUrl();\r\n\t\tevento.setNmStatus(EventoService.getStatus(url));\r\n\t\tevento.setDataHora(date);\r\n\t\teventoRepository.save(evento); // COLOCAMOS NO BANCO\r\n\t\tFacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Cadastro inserido\"));\r\n\t\tif (!modoEdicao)\r\n\t\t\teventos.add(evento); // COLOCAMOS NA LISTA\r\n\t\tevento = new Evento();\r\n\t\tmodoEdicao = false;\r\n\t}",
"public void persists(Drive drive){\n\t\tem.persist(drive);\n\t}",
"public void persistByStatus(final Persistence persistentObject, final Session session) throws HibernateException {\n if (persistentObject.isNew()) {\n persistentObject.getDAO().save(persistentObject, session);\n } else if (persistentObject.isChanged()) {\n persistentObject.getDAO().update(persistentObject, session);\n } else if (persistentObject.isDeleted()) {\n persistentObject.getDAO().delete(persistentObject, session);\n }\n }",
"public interface StatusService {\r\n\r\n String getStatus();\r\n\r\n}",
"private void saveList() throws Exception {\n JournalEntries.saveList(JournalList,ReconcileCur.ReconcileNum);\n }",
"public boolean save(WriteConcern concern) {\n return save(Datastore.fetchDefaultService(), false, concern);\n }"
] | [
"0.6422054",
"0.6344173",
"0.6294208",
"0.5898249",
"0.5846967",
"0.57639706",
"0.5762447",
"0.5662358",
"0.558842",
"0.5580734",
"0.55673194",
"0.55656224",
"0.55160105",
"0.550836",
"0.54865843",
"0.542738",
"0.54262614",
"0.5388146",
"0.53836435",
"0.53832185",
"0.5379506",
"0.536954",
"0.5353286",
"0.5322326",
"0.52647334",
"0.5258448",
"0.5246829",
"0.5232916",
"0.52307886",
"0.52229756",
"0.52144116",
"0.52097654",
"0.51991",
"0.5187624",
"0.51774406",
"0.5163602",
"0.5161458",
"0.5156477",
"0.515286",
"0.51400375",
"0.51365834",
"0.5131234",
"0.51270473",
"0.5124363",
"0.5116146",
"0.511112",
"0.5068955",
"0.5063272",
"0.5062443",
"0.5062262",
"0.50551754",
"0.50442487",
"0.5030281",
"0.5029612",
"0.5026611",
"0.5018598",
"0.500258",
"0.4987102",
"0.49848583",
"0.497603",
"0.4974888",
"0.4973855",
"0.49702445",
"0.49690497",
"0.49652863",
"0.4963194",
"0.49602342",
"0.49589464",
"0.4958765",
"0.49564162",
"0.49500257",
"0.49479273",
"0.494641",
"0.4938429",
"0.49349332",
"0.4934154",
"0.49166507",
"0.49102077",
"0.49047676",
"0.48981082",
"0.48885947",
"0.4880934",
"0.4877152",
"0.48771316",
"0.48770282",
"0.48760623",
"0.48725224",
"0.4871967",
"0.4871581",
"0.4871198",
"0.48670453",
"0.4860583",
"0.48492417",
"0.48490483",
"0.48483014",
"0.4843575",
"0.48410013",
"0.48355913",
"0.4831287",
"0.48299822"
] | 0.7897217 | 0 |
This method gets called after every specified duration | @Override
public void run() {
try {
ServiceInfo serviceInfo = this.getServiceStatus(url);
this.saveServiceStatusInfo(serviceInfo);
if(serviceInfo.getResponseTimeInMillis() > 200)
log.warn("The service is taking too long to respond");
if(serviceInfo.getStatusCode()!=200)
log.warn("The service did not respond OK");
} catch (IOException e) {
log.error("Error while accessing the service" ,e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void runEachSecond() {\n \n }",
"@Override\n public void onDurationUs(long durationUs) {\n sleep();\n isDurationSet = true;\n }",
"@Override\r\n public void timePassed(double dt) {\r\n return;\r\n }",
"@Override\r\n public void timePassed(double dt) {\r\n\r\n }",
"@Override\r\n public void timePassed(double dt) {\r\n\r\n }",
"@Override\r\n\tpublic void perSecond() {\n\r\n\t}",
"@Override\r\n public void timePassed() {\r\n }",
"@Override\n public void timePassed() {\n }",
"protected void runEachMinute() {\n \n }",
"@Override\n public void onComplete(long dt) {\n }",
"void setDuration(int duration);",
"void onStart(int duration);",
"@Override\r\n public void setTimeouts()\r\n {\n\r\n }",
"private static void pause(int duration) {\n LOG.info(\"\\nlets go again!\\n\");\n sleep(duration);\n }",
"private void onComplete(int duration) {\n\t\t\n\t\tservice = Executors.newSingleThreadExecutor();\n\n\t\ttry {\n\t\t Runnable r = new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t // Database task\n\t\t \tcontrollerVars.setPlays(false);\n\t\t }\n\t\t };\n\t\t Future<?> f = service.submit(r);\n\n\t\t f.get(duration, TimeUnit.MILLISECONDS); // attempt the task for two minutes\n\t\t}\n\t\tcatch (final InterruptedException e) {\n\t\t // The thread was interrupted during sleep, wait or join\n\t\t}\n\t\tcatch (final TimeoutException e) {\n\t\t // Took too long!\n\t\t}\n\t\tcatch (final ExecutionException e) {\n\t\t // An exception from within the Runnable task\n\t\t}\n\t\tfinally {\n\t\t service.shutdown();\n\t\t}\t\t\n\t}",
"@Override\n protected void sleep(int milliseconds) {\n super.sleep(milliseconds);\n }",
"@AfterEach\n public void setTimeInterval() {\n try {\n TimeUnit.SECONDS.sleep(Long.valueOf(settings.getTimeInterval()));\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public void step(){\r\n\t\tcurrentTime++;\r\n\t\tfor (TimeObserver t : observers) {\r\n\t\t\tt.timeChanged(currentTime);\r\n\t\t}\r\n\t}",
"@Override\n public void periodic() {\n\n }",
"@Override\n public void periodic() {\n\n }",
"@Override\r\n public void update(long timePassed) {\n\r\n }",
"public void step() {\n \tinternaltime ++;\n \n }",
"@Override\n public void onTimeout(TimeValue timeout) {\n run();\n }",
"@Override\n public void run() {\n long startTime = System.currentTimeMillis();\n try {\n // Loop for the given duration\n while (System.currentTimeMillis() - startTime < duration) {\n // Every 100ms, sleep for the percentage of unladen time\n if (System.currentTimeMillis() % 100 == 0) {\n Thread.sleep((long) Math.floor((1 - load) * 100));\n }\n }\n } catch (Exception e) {\n logger.error(\"Error happened\", e);\n }\n }",
"@Override\r\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void timePassed() {\n moveOneStep();\n }",
"private Sleep(Duration duration) {\n this.duration = duration;\n }",
"public void step(long now) {\n\t}",
"@Override\n public void periodic() {\n\n }",
"@Override\n public void periodic() {\n\n }",
"@Override\n public void periodic() {\n\n }",
"@Override\n public void periodic() {\n\n }",
"private void setEndTimer() {\n vertx.setTimer(10, id -> testComplete());\n }",
"public void setDuration(int duration){\n this.duration = duration;\n }",
"protected abstract void timed() throws Throwable;",
"private void meditate() {\n\t\t\tUtils.pause(10_000);\n\t\t\t// System.out.println(this.name + \" is finished meditate\");\n\t\t}",
"@Override\n public void postFade() {\n startCapsules();\n heartBeat.startTimer();\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n public void periodic() {\n }",
"@Override\n\tpublic void sleeps() {\n\t\t\n\t}",
"public void run() {\n loadAlertAnimationDelay(aType);\n }",
"public void onRepeat() {\n\t\t// TODO Auto-generated method stub\n\t\tLastWholeDelta = 0;\n\t}",
"protected void runAfterIterations() {}",
"public void timePassed(double dt) {\r\n moveOneStep(dt);\r\n }",
"public void timePassed(double dt) {\n this.moveOneStep(dt);\n }",
"@Override\n\tpublic void periodic()\n\t{\n\t}",
"private void timerFired() {\n\t\t\n\t\tArrayList<CedView> tempList = _pendingRefresh;\n\t\t_pendingRefresh = new ArrayList<>();\n\t\t\n\t\tfor (CedView view : tempList) {\n\t\t\tview.refresh();\n\t\t}\n\t\ttempList = null;\n\t}",
"public void timePassed(double dt) {\r\n this.moveOneStep(dt);\r\n }",
"public abstract void animation(double seconds);",
"protected void runEachHour() {\n \n }",
"@Override\n\tpublic void periodic() {\n\t}",
"public void setDuration( Long duration );",
"public void setDuration(int duration) {\n this.duration = duration;\n }",
"public void setDuration(int duration) {\n this.duration = duration;\n }",
"protected void runAfterIteration() {}",
"private static void addDelay() {\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ignored) {\n }\n }",
"public abstract void interactionEnds(long ms);",
"@Override\r\n public void periodic() {\n\r\n }",
"@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tdimensionclip3.start();\r\n\t\t\t\t\t\t\tTimer fourtheffect = new Timer();\r\n\t\t\t\t\t\t\tTimerTask fourtheffecttask = new TimerTask() {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\tdimensionclip4.start();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tfourtheffect.schedule(fourtheffecttask, 1300);\r\n\t\t\t\t\t\t}",
"protected void runEachDay() {\n \n }",
"public void timePassed(double dt) {\r\n // Currently- nothing\r\n }",
"@Override\n\tpublic void sleep() {\n\t\t\n\t}",
"public void demoSchduleMethod() {\n log.info(\"Method executed at every 5 seconds. Current time is :: \" + new Date());\n }",
"public abstract void advance(double deltaTime);",
"public void tick() {\n Instant now = clock.instant();\n SortedMap<Instant, Set<Endpoint>> range = timeouts.headMap(now);\n\n Set<Endpoint> processed = new HashSet<>();\n for (Set<Endpoint> batch : range.values()) {\n for (Endpoint endpoint : batch) {\n if (processed.contains(endpoint)) {\n continue;\n }\n processed.add(endpoint);\n checkExpiration(now, endpoint);\n }\n }\n range.clear();\n }"
] | [
"0.70147496",
"0.67069626",
"0.66952854",
"0.6618919",
"0.6618919",
"0.6577559",
"0.6547597",
"0.64839184",
"0.6339646",
"0.63327736",
"0.6326539",
"0.63167536",
"0.6269083",
"0.62566835",
"0.62330127",
"0.614869",
"0.61409163",
"0.6100889",
"0.6091811",
"0.6091811",
"0.60672677",
"0.6060147",
"0.6053484",
"0.6031966",
"0.60207826",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6013158",
"0.6012548",
"0.60070854",
"0.6005459",
"0.59965044",
"0.59965044",
"0.59965044",
"0.59965044",
"0.59780353",
"0.5970315",
"0.5959761",
"0.59480876",
"0.59370536",
"0.5934679",
"0.5934679",
"0.5934679",
"0.5893191",
"0.58726287",
"0.58580434",
"0.58532137",
"0.5845976",
"0.58419234",
"0.5836305",
"0.5833414",
"0.5826435",
"0.58127034",
"0.5812702",
"0.5806025",
"0.5803503",
"0.5803482",
"0.5803482",
"0.5802646",
"0.57938385",
"0.5789531",
"0.57831717",
"0.5766768",
"0.5761435",
"0.5758159",
"0.57480705",
"0.5728912",
"0.572624",
"0.57219887"
] | 0.0 | -1 |
Returns an intent that triggers this dialog as an activity. | public static Intent getIntent(Context context) {
Intent intent = new Intent(context, WifiSchedulerDialog.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
return intent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected Intent getStravaActivityIntent()\n {\n return new Intent(this, MainActivity.class);\n }",
"public Intent getActivityIntent() {\n Intent intent = new Intent(this.context, InterstitialActivity.class);\n intent.setFlags(268435456);\n intent.addFlags(67108864);\n intent.putExtra(\"id\", getPlacementID());\n if (this.setAutoPlay) {\n intent.putExtra(\"auto_play\", this.autoPlay);\n }\n if (this.setCanClose) {\n intent.putExtra(\"can_close\", isBackButtonCanClose());\n }\n if (this.setMute) {\n intent.putExtra(\"mute\", getMute());\n }\n intent.putExtra(\"cat\", getCategories());\n intent.putExtra(\"pbk\", getPostback());\n intent.putExtra(\"b_color\", getButtonColor());\n intent.putExtra(\"skip_title\", getSkipText());\n intent.putExtra(\"creative\", getCreative());\n return intent;\n }",
"com.google.cloud.dialogflow.cx.v3.Intent getIntent();",
"public Intent getIntent() {\n return mIntent;\n }",
"public Intent getIntent() {\n return mIntent;\n }",
"protected abstract Intent getIntent();",
"public Intent getIntent() {\n return mInviteIntent;\n }",
"void startNewActivity(Intent intent);",
"public static Intent getLaunchIntent(Context context) {\n return getLaunchIntent(context, false, false, null);\n }",
"public Intent intentForPosition(int position) {\r\n if (null == mList) {\r\n return null;\r\n } // End of intentForPosition\r\n\r\n DisplayResolveInfo dri = mList.get(position);\r\n \r\n Intent intent = new Intent(dri.origIntent != null\r\n ? dri.origIntent : mIntent);\r\n intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT\r\n |Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);\r\n ActivityInfo ai = dri.ri.activityInfo;\r\n intent.setComponent(new ComponentName(\r\n ai.applicationInfo.packageName, ai.name));\r\n return intent;\r\n }",
"@Override\n public void onClick(View view) {\n\n startActivity(getIntent());\n }",
"public Intent getAssistIntent(boolean inclContext) {\n try {\n Intent intent = new Intent(Intent.ACTION_ASSIST);\n if (inclContext) {\n IActivityTaskManager am = ActivityTaskManager.getService();\n Bundle extras = am.getAssistContextExtras(ActivityManager.ASSIST_CONTEXT_BASIC);\n if (extras != null) {\n intent.replaceExtras(extras);\n }\n }\n return intent;\n } catch (RemoteException re) {\n throw re.rethrowFromSystemServer();\n }\n }",
"public Intent intent( String inAction ) {\r\n\t\treturn new Intent( kMessagePlayer ).putExtra( \"action\" , inAction );\r\n\t}",
"protected Intent getIntentForChangePresenter() {\n \t// Destino: Presentador H\n \tIntent intent = new Intent(PresentadorV_main.this,\n \t\t\tPresentadorH_main.class);\n\t\tintent.setAction(INTENT_ACTION);\t\n\t\t// Guarda en el intent el contenido de la searchview\n\t\t// ojo: es tipo CharSequence\t\t\n\t\tintent.putExtra(INTENT_CONTENT_WISEARCH, wi_search.getQuery());\n \treturn intent;\n }",
"public static Intent makeIntent(Context context) {\n return new Intent(context, AddEvent.class);\n }",
"public void onClick(View v) {\n\n\n\n startActivity(myIntent);\n }",
"private PendingIntent getNotificationIntent() {\n Intent resultIntent = new Intent(this, ScheduleNotificationActivity.class);\n // Because clicking the notification opens a new (\"special\") activity, there's\n // no need to create an artificial back stack.\n return PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_ONE_SHOT\n );\n }",
"public Intent newIntent(Context packageContext) {\n Intent intent = new Intent(packageContext, A16_MeetingListActivity.class);\n return intent;\n }",
"Intent getOpenInOtherWindowIntent();",
"public Intent returnShareIntent() {\n Intent intent = new Intent(Intent.ACTION_INSERT);\n // Sets the MIME type\n intent.setType(ContactsContract.Contacts.CONTENT_TYPE);\n // store data in intent\n intent.putExtra(ContactsContract.Intents.Insert.NAME, this.name);\n intent.putExtra(ContactsContract.Intents.Insert.PHONE, this.mobile);\n intent.putExtra(ContactsContract.Intents.Insert.EMAIL, this.email);\n intent.putExtra(ContactsContract.Intents.Insert.COMPANY, this.company);\n intent.putExtra(ContactsContract.Intents.Insert.POSTAL, this.postal);\n intent.putExtra(ContactsContract.Intents.Insert.JOB_TITLE, this.job);\n intent.putExtra(ContactsContract.Intents.Insert.NOTES, this.detail);\n return intent;\n }",
"@Override\n public void startActivity(Intent intent) {\n startActivity(intent, null);\n }",
"public static Intent createIntent(Context context) {\n\t\treturn new Intent(context, TabletResultsActivity.class);\n\t}",
"public PendingIntent getLaunchPendingIntent() {\n }",
"public Intent getTrackedIntent(){\n Intent trackedIntent = new Intent(context, PPOpenTrackerActivity.class);\n trackedIntent.putExtra(PushPrime.NOTIFICATION, this);\n return trackedIntent;\n }",
"public void onClick(DialogInterface dialog, int which) {\n\t \t\n\t\t\t\tstartActivity(intent);\n\t\t\t\t}",
"public static Intent getStartIntent(Context context, Theme theme) {\n Intent intent = new Intent(context, ThemeDetailActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.putExtra(EXTRA_THEME, theme);\n return intent;\n }",
"public void openExplicitIntent(View view) {\n // start the email activity\n Intent intent = new Intent(this, OpenExplicitIntent.class);\n startActivityForResult(intent, EMAIL_ACTIVITY_RESULT_CODE);\n }",
"public static Intent getFileIntent(File file){\n Uri uri = Uri.fromFile(file);\r\n String type = getMIMEType(file);\r\n Log.i(\"tag\", \"type=\"+type);\r\n Intent intent = new Intent(\"android.intent.action.VIEW\");\r\n intent.addCategory(\"android.intent.category.DEFAULT\");\r\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n intent.setDataAndType(uri, type);\r\n return intent;\r\n }",
"public static Intent createIntent(Context context, OnboardingType type, boolean fromDiagnostics) {\n return createIntent(context, type, fromDiagnostics, null);\n }",
"private void startNewAcitivity(Intent intent, ActivityOptionsCompat options) {\n ActivityCompat.startActivity(this, intent, options.toBundle());\n }",
"public void Volgende(Intent intent){\r\n\r\n startActivity(intent);\r\n\r\n }",
"private static Intent getIntent(Context context, Class<?> cls) {\n Intent intent = new Intent(context, cls);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n return intent;\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent intent = new Intent(context, MeetingDetailActivity.class);\n intent.putExtra(MeetingDetailActivity.ARG_MEETING_ID, message.meetingId);\n context.startActivity(intent);\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent intent = new Intent(context, MeetingDetailActivity.class);\n intent.putExtra(MeetingDetailActivity.ARG_MEETING_ID, message.meetingId);\n context.startActivity(intent);\n }",
"Intent createNewIntent(Class cls);",
"@Override\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\t\t\tintentToClass(getApplicationContext(), GlassRoomActivity.class);\n\t\t\t\t\t\t\t\t}",
"@Nullable\n public Intent getIntent() {\n return mPrimaryIntent;\n }",
"private Intent createIntent() {\n Intent intent = new Intent(this, GameOverActivity.class);\n intent.putExtra(POINTS, presenter.getPoints() + points);\n intent.putExtra(PASS_USER, user);\n intent.putExtra(CORRECT, correct);\n intent.putExtra(INCORRECT, incorrect);\n intent.putExtra(TIME, time);\n intent.putExtra(EVIL, evil);\n intent.putExtra(FRIENDLY, friendly);\n intent.putExtra(\"from\", \"bonus\");\n return intent;\n }",
"private void openActivity() {\n }",
"Class<? extends Activity> getOpenInOtherWindowActivity();",
"public static Intent getIntentInstance(Context context, Character character) {\n mCharacter = character;\n NoisyUtils.logD(NoisyUtils.getToJson(mCharacter));\n return new Intent(context, DetailAcitvity.class);\n }",
"Activity getRepairForwardActivity();",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent intent = new Intent(SuperScouting.this, SuperScouting.class);\n if (practice) {\n intent.putExtra(Constants.Intent_Extras.MATCH_NUMBER, -1);\n } else {\n intent.putExtra(Constants.Intent_Extras.MATCH_NUMBER, matchNumber - 1);\n }\n startActivity(intent);\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n if (drmIntent != null) {\n activity.startActivity(drmIntent);\n }else {\n Toast.makeText(activity, com.sprd.fileexplorer.R.string.msg_invalid_intent, Toast.LENGTH_SHORT)\n .show();\n }\n }",
"public static Intent getLaunchIntent(Context context, boolean force) {\n return getLaunchIntent(context, force, false, null);\n }",
"public static Intent newIntent(Context packageContext, UUID crimeId) {\n Intent intent = new Intent(packageContext, CrimeActivity.class);\n intent.putExtra(EXTRA_CRIME_ID, crimeId);\n return intent;\n }",
"@Override\n public void onClick(View view) {\n Intent intent = AlarmPagerActivity.newIntent(sApplicationContext, mAlarm.getId());\n startActivity(intent);\n }",
"@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)\n public static void goToIntent(Context ctx, Class<?> clazz) {\n Intent intent = new Intent(ctx, clazz);\n ctx.startActivity(intent);\n ((Activity) ctx).setResult(Activity.RESULT_CANCELED);\n ((Activity) ctx).finishAffinity();\n }",
"@SuppressWarnings(\"static-access\")\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent Intent = new Intent(android.content.Intent.ACTION_VIEW);\r\n\t\t\t\tString extension = android.webkit.MimeTypeMap\r\n\t\t\t\t\t\t.getFileExtensionFromUrl(Uri.fromFile((File) item.downFile).toString());\r\n\t\t\t\tString mimetype = android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);\r\n\t\t\t\tIntent.setDataAndType(Uri.fromFile((File) item.downFile), mimetype);\r\n\t\t\t\tIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t\t\tmContext.startActivity(Intent);\r\n\t\t\t\tLogger.d(TAG, \"Intent\" + Intent);\r\n\t\t\t}",
"public void startInterstitialActivity() {\n Intent activityIntent = getActivityIntent();\n if (activityIntent != null) {\n this.context.startActivity(activityIntent);\n return;\n }\n throw new IllegalArgumentException(\"null intent\");\n }",
"@Override\n\t\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\t\tIntent it = new Intent();\n\t\t\t\t\t\t\tit.setClass(TR_MaintainGuide_Activity.this,NewPragramActivity.class);\n\t\t\t\t\t\t\tit.setFlags(3);\n\t\t\t\t\t\t\tstartActivity(it);\n\t\t\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onClick(DialogInterface arg0,\n\t\t\t\t\t\tint arg1) {\n\t\t\t\t\tIntent i = new Intent(getActivity().getApplicationContext(),MainActivity.class);\n\t\t\t\t\tgetActivity().startActivity(i);\n\t\t\t\t}",
"public PendingIntent getActionIntent(NotificationEntry entry, NotificationEntry.Action act) {\n Intent intent = new Intent(ACTION_ACTION);\n intent.putExtra(KEY_ENTRY_ID, entry.ID);\n intent.putExtra(KEY_ACTION_ID, entry.mActions.indexOf(act));\n return PendingIntent.getBroadcast(mContext, genIdForPendingIntent(), intent, 0);\n }",
"protected abstract Intent createOne();",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent intent = new Intent(thisActivity, SpeedDialListActivity.class);\n startActivity(intent);\n }",
"public void getintent() {\n Intent intent = this.getIntent();\n acceptDetailsModel = (AcceptDetailsModel) intent.getSerializableExtra(\"menu_item\");\n }",
"public static Intent newIntent(Context context) {\n return new Intent(context, LoginActivity.class);\n }",
"@Override\n\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\tIntent intent = getIntent();\n\t \tfinish();\n\t \tstartActivity(intent);\t\n\t\t}",
"@Override\n public void onClick(View view) {\n Intent intent = MainActivity.newIntent(getActivity(), mMonitor.getId());\n startActivity(intent);\n\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent callOnwerIntent = new Intent(Intent.ACTION_DIAL,\n Uri.parse(\"tel:\"+gym.getOwnerMobile().toString()));\n startActivity(callOnwerIntent);\n }",
"private PendingIntent openActivityPendingIntent(Context context) {\n Intent intent = new Intent(context, MainActivity.class);\n return PendingIntent.getActivity(context, 0, intent, 0);\n }",
"public static Intent getStartIntent(Context context, boolean triggerDataSyncOnCreate) {\n Intent intent = new Intent(context, MainActivity.class);\n intent.putExtra(EXTRA_TRIGGER_SYNC_FLAG, triggerDataSyncOnCreate);\n return intent;\n }",
"public static Intent createIntent(final Context context) {\n return new Intent(context, LicenseActivity.class);\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, TriggerActivity.class);\n startActivity(intent);\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent intent = new Intent(SuperScouting.this, SuperScouting.class);\n if (practice) {\n intent.putExtra(Constants.Intent_Extras.MATCH_NUMBER, -1);\n } else {\n intent.putExtra(Constants.Intent_Extras.MATCH_NUMBER, matchNumber + 1);\n }\n startActivity(intent);\n }",
"private void superStartActivity(Intent intent, Bundle options) {\n super.startActivity(intent, options);\n }",
"public static Intent newIntent(Context context) {\n\t\treturn new Intent(context, ProductDetailsActivity.class);\n\t}",
"public void transferActivity() {\n Intent intent = new Intent(this, AddInfoActivity.class);\n this.startActivity(intent);\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdialog.dismiss();\n\n\t\t\t\tIntent intent = new Intent(getApplicationContext(),\n\t\t\t\t\t\tActivityInspection.class);\n\t\t\t\tintent.putExtra(\"taskType\", 2);\n\t\t\t\tintent.putExtra(\"fromService\", true);\n\t\t\t\tintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\tstartActivity(intent);\n\t\t\t}",
"public static Intent createIntent(Context context, OnboardingType type, boolean fromDiagnostics, OnboardingResponseData onboardingResponse) {\n Intent intent = new Intent(context, OnboardingActivity.class);\n intent.putExtra(OnboardingType.ARG_KEY, Parcels.wrap(type));\n intent.putExtra(Arg.FROM_DIAGNOSTICS, fromDiagnostics);\n if (onboardingResponse != null) {\n intent.putExtra(Arg.ONBOARDING_DATA, Parcels.wrap(onboardingResponse));\n }\n return intent;\n }",
"void mo21580A(Intent intent);",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n Intent intent = checkItem.getForwardIntent();\n CTSCLog.e(TAG, \"Forward intent is null! Check item = \" + checkItem.getTitle());\n startActivity(intent);\n }",
"private Intent newVoicemailIntent() {\n final Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,\n Uri.fromParts(\"voicemail\", EMPTY_NUMBER, null));\n intent.putExtra(\"phone_subscription\", mSubscription);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n return intent;\n }",
"public static Intent getLaunchIntent(Context context, boolean force, boolean notify, SmsMmsMessage msg) {\n Intent intent = new Intent(context, CadPageActivity.class);\n int flags =\n Intent.FLAG_ACTIVITY_NEW_TASK\n | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS\n | Intent.FLAG_ACTIVITY_NO_USER_ACTION;\n\n intent.setFlags(flags);\n if (force) intent.putExtra(EXTRA_POPUP, true);\n if (notify) intent.putExtra(EXTRA_NOTIFY, true);\n if (msg != null) {\n lockMsgId = msg.getMsgId();\n intent.putExtra(EXTRA_MSG_ID, lockMsgId);\n }\n return intent;\n }",
"private void buildIntent() {\n ReportLogic.report(this, \"POST\", mInfo.c_rpt, 0, null);\n Intent intent = new Intent();\n Bundle bundle = new Bundle();\n bundle.putString(PKG_NAME, mInfo.href);\n bundle.putString(APP_NAME, mInfo.name);\n intent.putExtra(DetailActivity.DETAIL, bundle);\n intent.setClass(this, DetailActivity.class);\n startActivity(intent);\n }",
"public static Intent build(Context c, Family family)\n {\n Intent intent = new Intent(c, SurveyActivity.class);\n intent.putExtra(FAMILY_ID_KEY, family.getId());\n\n return intent;\n }",
"public interface C0869a {\n Intent getSupportParentActivityIntent();\n }",
"public void onButtonMyReceiverIntent(View view) {\n\n Intent myCustomIntent = new Intent(this, CustomIntent.class);\n startActivity(myCustomIntent);\n\n\n }",
"@Override\n public void onClick(View view) {\n Intent intent = ClassActivity.newIntent(getActivity(), mClass.getId());\n getActivity().startActivity( intent );\n }",
"public interface IntentStarter {\n void startActivityForResult(ResultRequestor requestor, Intent intent);\n}",
"public boolean openCreateGoal(){\n Intent intent = new Intent(this, GoalNewActivity.class);\n startActivity(intent);\n return true;\n }",
"public static Intent makeIntent(Context context) {\n return new Intent(context,\n WeatherServiceSync.class);\n }",
"protected ScllActivity iGetActivity() {\n\t\treturn (ScllActivity) getActivity();\n\t}",
"public void openNewActivity(){\n Intent intent = new Intent(this, InventoryDisplay.class);\n startActivity(intent);\n }",
"private PendingIntent getPendingSelfIntent(Context context, String action) {\n Intent intent = new Intent(context, getClass());\n intent.setAction(action);\n return PendingIntent.getBroadcast(context, 0, intent, 0);\n }",
"@NonNull\n public static Intent getAppSettingsIntent() {\n Intent intent = new Intent();\n intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);\n Uri uri = Uri.fromParts(\"package\", BuildConfig.APPLICATION_ID, null);\n intent.setData(uri);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n return intent;\n }",
"@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tIntent intent = getIntent();\n\t\t \tfinish();\n\t\t \tstartActivity(intent);\t\n\t\t\t}",
"public Builder setIntent(@Nullable Intent intent) {\n mPrimaryIntent = intent;\n return this;\n }",
"private static Intent newFacebookIntent(PackageManager pm, String url) {\n Uri uri = Uri.parse(url);\n try {\n ApplicationInfo applicationInfo = pm.getApplicationInfo(\"com.facebook.katana\", 0);\n if (applicationInfo.enabled) {\n uri = Uri.parse(\"fb://facewebmodal/f?href=\" + url);\n }\n } catch (PackageManager.NameNotFoundException ignored) {\n }\n return new Intent(Intent.ACTION_VIEW, uri);\n }",
"@Override\n public void onClick(View v) {\n incidentalIntent = new Intent(getApplicationContext(),IncidentalTaskActivity.class);\n startActivity(incidentalIntent);\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent = new Intent(getActivity(), AgendaActivity.class);\r\n\t\t\t\tstartActivity(intent);\r\n\t\t\t}",
"private void startActivity(Class destination)\n {\n Intent intent = new Intent(MainActivity.this, destination);\n startActivity(intent);\n }",
"@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }",
"@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tcallintentforattachment();\n\t\t\t\t}",
"@Override\r\n public void onNewIntent(Intent intent){\r\n \t\r\n \tthis.activateExamBoard(intent);\r\n }",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n\n Intent marketIntent = new Intent(Intent.ACTION_VIEW);\n marketIntent.setData(Uri.parse(\"market://details?id=com.adobe.reader\"));\n// marketIntent.setData(Uri.parse(\"market://details?id=com.infraware.office.link\"));\n startActivity(marketIntent);\n\n }",
"@Override\n public void onClick(View v) {\n routineIntent = new Intent(getApplicationContext(), RoutineTaskActivity.class);\n startActivity(routineIntent);\n }",
"public void onNewIntent(Intent intent) {\n }"
] | [
"0.6488404",
"0.6482818",
"0.6479528",
"0.6442136",
"0.6428803",
"0.63523704",
"0.63265675",
"0.6321343",
"0.60948455",
"0.6074655",
"0.60652816",
"0.6021728",
"0.6014171",
"0.601032",
"0.60023993",
"0.5975352",
"0.597527",
"0.59397334",
"0.59215695",
"0.5904398",
"0.5903206",
"0.5891998",
"0.5876072",
"0.5829773",
"0.58165026",
"0.58082163",
"0.5807478",
"0.5797602",
"0.5783518",
"0.5769706",
"0.57574004",
"0.57527643",
"0.5752539",
"0.5752539",
"0.5735802",
"0.5722948",
"0.57079047",
"0.56840783",
"0.5675325",
"0.56689566",
"0.56590635",
"0.56300956",
"0.5597408",
"0.55821365",
"0.5573179",
"0.5562592",
"0.55578375",
"0.55461174",
"0.55418634",
"0.5533249",
"0.5518356",
"0.551455",
"0.5495675",
"0.54903466",
"0.5487499",
"0.54839885",
"0.5478423",
"0.54729694",
"0.547242",
"0.5469035",
"0.54658693",
"0.5457213",
"0.54555875",
"0.54537576",
"0.5451071",
"0.54494613",
"0.5446918",
"0.544589",
"0.5444888",
"0.54223764",
"0.5419569",
"0.5418763",
"0.5410978",
"0.54049474",
"0.53906226",
"0.53869295",
"0.5382883",
"0.5382617",
"0.537859",
"0.5375103",
"0.5371863",
"0.53700477",
"0.53645164",
"0.5356099",
"0.53525984",
"0.5342608",
"0.5334923",
"0.5329078",
"0.5317119",
"0.5314845",
"0.53147805",
"0.5310824",
"0.5308626",
"0.5298629",
"0.5298629",
"0.5298046",
"0.5298005",
"0.52866423",
"0.5282518",
"0.5280102"
] | 0.6665624 | 0 |
Constructor that does not take color | public Olive(String desc, Money cst, int calrs){
super(desc,cst,calrs);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Color() {\n\n\t\tthis(0, 0, 0);\n\t}",
"private HepRepColor() {\n }",
"protected Green() {\n\n super();\n }",
"private ColorWithConstructor() {\n\t\tSystem.out.println(\"Constructor called for : \" + this.toString());\n\t}",
"public ColorList () { \n\t\t\n\t}",
"public ColorClass (int ide) {\n this(ide, false);\n }",
"public ColorRenderer() {\r\n\t}",
"Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }",
"public Color() {\n\t\tr = 0;\n\t\tg = 0;\n\t\tb = 0;\n\t}",
"private ColorUtil() {\n // do nothing\n }",
"public ColorClass( String name) {\n this(name, false);\n }",
"private ColorUtil() {\n }",
"public Colour() {\n\t\tset(0, 0, 0);\n\t}",
"public ColorSet()\n {\n }",
"public ColorClass (int ide, Interval interval) {\n this(ide , interval , false);\n }",
"public Shape(Color c) {\n\t\tcolor = c;\n\t}",
"public Collection(char colour) { /* ... code ... */ }",
"public Shape(String color) { \n System.out.println(\"Shape constructor called\"); \n this.color = color; \n }",
"public Image() {\n\t\t\tthis(Color.white, 0);\n\t\t}",
"public Emrld() {\n super(\n new Color(211, 242, 163),\n new Color(151, 225, 150),\n new Color(108, 192, 139),\n new Color(76, 155, 130),\n new Color(33, 122, 121),\n new Color(16, 89, 101),\n new Color(7, 64, 80)\n\n );\n\n\n }",
"public ColorClass(String name, boolean ordered) {\n this (name, new Interval(2) , ordered);\n }",
"public Wall()\n {\n super();\n setColor( null );\n\n }",
"public TetrisColors() {\n\t\treset();\t\n\t}",
"public LightBulb(RGBColor color){\r\n _color = new RGBColor(color);\r\n }",
"public Light(){\n this(0.0, 0.0, 0.0);\n }",
"public RedGiant(){\r\n\t\tthis(\"\",0,0);\r\n\t}",
"public Miner(PlayerColor aColor) {\n super(3, aColor);\n }",
"public Vivid() {\n super(\n new Color(229, 134, 6),\n new Color(93, 105, 177),\n new Color(82, 188, 163),\n new Color(153, 201, 69),\n new Color(204, 97, 176),\n new Color(36, 121, 108),\n new Color(218, 165, 27),\n new Color(47, 138, 196),\n new Color(118, 78, 159),\n new Color(237, 100, 90),\n new Color(204, 58, 142),\n new Color(165, 170, 153)\n\n );\n\n }",
"public ColorClass (int ide, boolean ordered) {\n this(\"C_\"+ide, ordered);\n }",
"public Color(int r, int g, int b)\n {\n this( ((float)r)/255f,((float)g) /255f,((float)b)/255f );\n }",
"public ColourTest(String name)\n\t{\n\t\tsuper(name);\n\t}",
"public Figure(Color color){\n this.color=color;\n }",
"public Circle(){ // 1 constructor\n this.radius = DEFAULT_RADIUS;\n this.color = DEFAULT_COLOR;\n }",
"public ColorClass (int ide, Interval interval, boolean ordered) {\n this (\"C\"+ide, interval, ordered);\n }",
"public Shape (int x, int y, Color color)\r\n {\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.color = color;\r\n }",
"public SimpleStyle() {\n\t\t// set default values\n\t\tthis.foregroundColor = -1;\n\t\t// others are null: VM DONE\n\t}",
"public ColorFilter(Color color) {\r\n this.color = color;\r\n }",
"public BoxBackground()\n {\n this(null);\n }",
"public Circle(SelectedColor color) {\n super(Name.Circle, color);\n\n Log.i(\"Circle\",\"Created a \" + color + \" Circle\");\n //Need getcolor() to pick random\n //Maybe keep all colors random at create time, then when we add them to data struc\n //we change one of the colors depending on \"correct shape\"\n }",
"public NewCustomColorPalette() {\n\t\tsuper();\n\t\tbuildPalette();\n\t}",
"protected GeometricObject(String color, boolean filled) \n\t{\n\t\tdateCreated = new java.util.Date();\n\t\tthis.color = color;\n\t\tthis.filled = filled;\n\t}",
"public Color(int argb) {\n this.a = (byte)(argb >> 24);\n this.r = (byte)(argb >> 16);\n this.g = (byte)(argb >> 8);\n this.b = (byte)(argb );\n }",
"public ColorClass(int ide, Interval[] intervals , boolean ordered) {\n this (\"C_\"+ide, intervals, ordered );\n }",
"public Circle(double radius, String color){ // 3 constructor\n this.radius = radius;\n this.color = color;\n }",
"public Pixel() {\r\n\t\t}",
"protected GeometricObject(String color, boolean filled)\n {\n this.color = color;\n this.filled = filled;\n dateCreated = new Date();\n }",
"public Bishop(String color) {//True is white, false is black\n\t\tsuper(color);\n\n\t}",
"public ColorClass(int ide, Interval[] intervals ) {\n this (ide, intervals, false );\n }",
"public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}",
"public Water()\n {\n super(Color.cadetBlue, false, 1.0);\n }",
"Rectangle()\n {\n this(1.0,1.0);\n }",
"public ColorClass (String name, Interval interval) {\n this(name, interval, false);\n }",
"public Colour(double r, double g, double b) {\n\t\tset(r, g, b);\n\t}",
"protected CGEFrameRenderer(int dummy) {\n\n }",
"public Fruit()\n {\n setColor(Color.GREEN);\n }",
"public ShadesOfBlue(){\n super( Settings.ObjectivesProperties.SHADES_OF_BLUE.getTitle(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getDescription(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPath(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPoints(),\n Colour.BLUE);\n }",
"public CachedColorizer()\n {\n colorIndex = 3;\n }",
"public Doolhof()\n {\n this(255, 255, new RechtKaart(1, false));\n }",
"public Rook(int row, int col, boolean color)\n {\n super(row, col, color);\n }",
"public Circle() {\n this( 1.0 ); \n }",
"public Circle() {\n this(0, 0, 1);\n }",
"public Palette(int r, int g, int b) {\n myRed = r;\n myGreen = g;\n myBlue = b;\n }",
"public ColorVector(float red, float green, float blue) {\n this.red = red;\n this.green = green;\n this.blue = blue;\n }",
"public Pawn(String color){\r\n this.color=color; \r\n }",
"public Fill() { }",
"private ColorIcon(final Color theColor) {\r\n this.myColor = theColor;\r\n }",
"Composite() {\n\n\t}",
"public DefaultGraphDecorator() {\n\t\tthis(Color.LIGHT_GRAY, Color.LIGHT_GRAY, Color.DARK_GRAY, Color.DARK_GRAY, new Color(128, 128, 255));\n\t}",
"public Shape() { this(X_DEFAULT, Y_DEFAULT); }",
"public ColorWeight()\n {\n weight = 0;\n }",
"public BaseShape(int aStartX, int aStartY, Color aColor) {\r\n\t\t\r\n\t\tthis.startX = aStartX;\r\n\t\tthis.startY = aStartY;\r\n\t\tthis.color = aColor;\r\n\t}",
"DummyCanvas() {\n super(null);\n // super(null); ----------------ADDED TO COMPILE -----------------------------------------\n }",
"public Element(int someX, int someY, Color someColor) {\r\n\t\tx = someX;\r\n\t\ty = someY;\r\n\t\tcolor = someColor;\r\n\t\thilite = true;\r\n\t}",
"public Circle() {\n radius = 1.0;\n color = \"red\";\n }",
"public Rook(String color) {\n\t\tsuper(color, \"R\");\n\t}",
"private ColorWheel() {\n pCount = 0;\n sCount = 0;\n }",
"@Override\n\tpublic void init() {\n this.setColor(Color.PINK);\n \n\t}",
"private NumericCard (Color color, int number)\n {\n super(color);\n this.number = number;\n }",
"public Rectangle() {\n this(50, 40);\n }",
"public ToolImpl(Color fgColor) {\n\t\tthis(fgColor, null, null, null, null);\n\t}",
"public Circle() {\n radius = 1.0;\n color = \"red\";\n }",
"public Pixel(int red, int green, int blue)\r\n {\r\n this.red = Fixed(red);\r\n this.green = Fixed(green);\r\n this.blue = Fixed(blue);\r\n }",
"public ColourRect(float x, float y, float w, float h){\n super(x,y,w,h);\n }",
"private PaletteFactory() {\n }",
"public CustomRectangle() { }",
"public Rectangle () {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"public Line()\n\t{\n\t\tthis(1.0f, 1.0f, 0.0f);\n\t}",
"public Coche (String color, String modelo) {\r\n\t super(color, modelo);\r\n\t numeroDeRuedas = 4;\r\n\t }",
"public Circle(double radius){ // 2 constructor\n this.radius = radius;\n this.color = DEFAULT_COLOR;\n }",
"public RandomColorProvider() {\n\t\tcurrentColorValue = 0;\n\t}",
"public OutlineZigzagEffect(int width, Color color) {\n/* 89 */ super(width, color);\n/* */ }",
"defaultConstructor(){}",
"public Circle(){}",
"public Wuziqi(Context context, AttributeSet attrs) {\n super(context, attrs);\n setBackgroundColor(0x44ff0000);\n initPaint();\n }",
"public Piezas(String color) {\r\n this.color = color;\r\n }",
"public RedBlackNode(int element) \n { \n this( element, null, null ); \n }",
"public Color(double newR, double newG, double newB) {\n\n\t\tr = newR;\n\t\tg = newG;\n\t\tb = newB;\n\t}",
"public ColorClass(String name, Interval[] intervals) {\n this(name, intervals, false);\n }",
"public ColorField(int rStart, int gStart, int bStart, int alphaStart, int rEnd, int gEnd, int bEnd, int alphaEnd) {\n this.rStart = rStart;\n this.gStart = gStart;\n this.bStart = bStart;\n this.alphaStart = alphaStart;\n this.rEnd = rEnd;\n this.gEnd = gEnd;\n this.bEnd = bEnd;\n this.alphaEnd = alphaEnd;\n int r = Math.abs(rStart - rEnd) / (colors.length);\n int g = Math.abs(gStart - gEnd) / (colors.length);\n int b = Math.abs(bStart - bEnd) / (colors.length);\n int alpha = Math.abs(alphaStart - alphaEnd) / (colors.length);\n for (int i = 0; i < colors.length; i++) {\n colors[i] = new Color(rStart + r * i, gStart + g * i, bStart + b * i, alphaStart + alpha * i);\n // System.out.println(colors[i].alpha);\n }\n }",
"public Light() {\n\t\tthis(false);\n\t}"
] | [
"0.7919324",
"0.74798363",
"0.73642707",
"0.72852886",
"0.7276927",
"0.72428447",
"0.71750855",
"0.7170629",
"0.7152234",
"0.7084297",
"0.70769864",
"0.69972605",
"0.69966865",
"0.69656134",
"0.6901215",
"0.68525004",
"0.6784451",
"0.67029876",
"0.6675584",
"0.66528624",
"0.66217035",
"0.66173816",
"0.6615058",
"0.6595694",
"0.65711886",
"0.6567444",
"0.65402293",
"0.65305847",
"0.65091896",
"0.64633083",
"0.645717",
"0.6451142",
"0.64508235",
"0.6448442",
"0.64472556",
"0.64035404",
"0.6401357",
"0.6400158",
"0.63864255",
"0.63841575",
"0.63801944",
"0.63669467",
"0.63650006",
"0.63642704",
"0.6363823",
"0.636093",
"0.6352047",
"0.63502914",
"0.63416374",
"0.6325656",
"0.63219655",
"0.63110834",
"0.629977",
"0.6294662",
"0.6293746",
"0.6266263",
"0.6248084",
"0.624017",
"0.62333876",
"0.6232448",
"0.6229244",
"0.6223859",
"0.6223495",
"0.6220731",
"0.62147075",
"0.6213354",
"0.6197489",
"0.6192349",
"0.6177966",
"0.61710894",
"0.61696863",
"0.6156352",
"0.61429083",
"0.6120516",
"0.609681",
"0.60937446",
"0.6086171",
"0.6080087",
"0.60729945",
"0.60687757",
"0.60631025",
"0.6061775",
"0.60615623",
"0.6058415",
"0.6056478",
"0.60561585",
"0.6037964",
"0.6031135",
"0.60046625",
"0.60011095",
"0.5994877",
"0.59936166",
"0.59909135",
"0.59817773",
"0.5980928",
"0.59742385",
"0.59701955",
"0.5968029",
"0.59496796",
"0.59420866",
"0.5932434"
] | 0.0 | -1 |
Constructor that takes a default color | public Olive(String desc, Money cst, int calrs, Color clr){
super(desc,cst,calrs,clr);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Color() {\n\n\t\tthis(0, 0, 0);\n\t}",
"Color(int R, int G, int B) {\r\n\t\t this.rgb = new RGB(R,G,B);\r\n\t\t this.colorific = true;\r\n\t }",
"public Colour() {\n\t\tset(0, 0, 0);\n\t}",
"public Color() {\n\t\tr = 0;\n\t\tg = 0;\n\t\tb = 0;\n\t}",
"public ColorRenderer() {\r\n\t}",
"private HepRepColor() {\n }",
"public ColorClass (int ide) {\n this(ide, false);\n }",
"protected Green() {\n\n super();\n }",
"public ColorClass( String name) {\n this(name, false);\n }",
"public Shape(Color c) {\n\t\tcolor = c;\n\t}",
"public Figure(Color color){\n this.color=color;\n }",
"public DefaultGraphDecorator() {\n\t\tthis(Color.LIGHT_GRAY, Color.LIGHT_GRAY, Color.DARK_GRAY, Color.DARK_GRAY, new Color(128, 128, 255));\n\t}",
"public Pen(@Nullable Color color) {\n Color c = Color.BLACK;\n if (color != null) {\n c = color;\n }\n this.color = c;\n this.stroke = new BasicStroke();\n }",
"public LightBulb(RGBColor color){\r\n _color = new RGBColor(color);\r\n }",
"public ColorList () { \n\t\t\n\t}",
"private ColorIcon(final Color theColor) {\r\n this.myColor = theColor;\r\n }",
"public Emrld() {\n super(\n new Color(211, 242, 163),\n new Color(151, 225, 150),\n new Color(108, 192, 139),\n new Color(76, 155, 130),\n new Color(33, 122, 121),\n new Color(16, 89, 101),\n new Color(7, 64, 80)\n\n );\n\n\n }",
"private ColorUtil() {\n }",
"public ColorClass (int ide, Interval interval) {\n this(ide , interval , false);\n }",
"public NewCustomColorPalette() {\n\t\tsuper();\n\t\tbuildPalette();\n\t}",
"public Color(int r, int g, int b)\n {\n this( ((float)r)/255f,((float)g) /255f,((float)b)/255f );\n }",
"public ColorFilter(Color color) {\r\n this.color = color;\r\n }",
"public SimpleStyle() {\n\t\t// set default values\n\t\tthis.foregroundColor = -1;\n\t\t// others are null: VM DONE\n\t}",
"public RandomColorProvider() {\n\t\tcurrentColorValue = 0;\n\t}",
"public ColorClass (int ide, boolean ordered) {\n this(\"C_\"+ide, ordered);\n }",
"public ColourTest(String name)\n\t{\n\t\tsuper(name);\n\t}",
"private ColorWithConstructor() {\n\t\tSystem.out.println(\"Constructor called for : \" + this.toString());\n\t}",
"public ColorClass(String name, boolean ordered) {\n this (name, new Interval(2) , ordered);\n }",
"ClrConst(Color color)\n {\n this(Color.RGBtoHSB(\n color.getRed(), \n color.getGreen(),\n color.getBlue(), null)[0]);\n }",
"public Rook(String color) {\n\t\tsuper(color, \"R\");\n\t}",
"public Fruit()\n {\n setColor(Color.GREEN);\n }",
"public Color getDefaultColor() {\n return defaultColor;\n }",
"public ColorSet()\n {\n }",
"private static Color newColor(int red, int green, int blue) {\n return new Color(red / 255.0, green / 255.0, blue / 255.0);\n }",
"public DrawComponent(int color) {\n this.color = color;\n }",
"public Color(int red, int green, int blue) {\n\t\tStringBuilder stringBuilder = new StringBuilder(\"#000000\");\n\t\tString hexString = Integer.toHexString(getHexValue(red, green, blue));\n\t\tcolorCode = stringBuilder.replace(\n\t\t\t\tstringBuilder.length() - hexString.length(), \n\t\t\t\tstringBuilder.length(), \n\t\t\t\thexString).toString();\n\t\tthis.red = red;\n\t\tthis.green = green;\n\t\tthis.blue = blue;\n\t\tthis.alpha = DEFAULT_ALPHA;\n\t}",
"default Color getColor() {\r\n\t\treturn Color.RED;\r\n\t}",
"public Colour(double r, double g, double b) {\n\t\tset(r, g, b);\n\t}",
"public Knight(String color){\n super(\"Knight\",color);\n }",
"private ColorUtil() {\n // do nothing\n }",
"public Circle(SelectedColor color) {\n super(Name.Circle, color);\n\n Log.i(\"Circle\",\"Created a \" + color + \" Circle\");\n //Need getcolor() to pick random\n //Maybe keep all colors random at create time, then when we add them to data struc\n //we change one of the colors depending on \"correct shape\"\n }",
"public Miner(PlayerColor aColor) {\n super(3, aColor);\n }",
"public RGBColor () \r\n\t{\r\n\t\tr = 0; g = 0; b = 0;\r\n\t\tindex = (byte) Palm.WinRGBToIndex(this);\t\r\n\t}",
"public Palette(int r, int g, int b) {\n myRed = r;\n myGreen = g;\n myBlue = b;\n }",
"public static SbColor getDefaultDiffuse()\n\t\t {return new SbColor(0.8f, 0.8f, 0.8f);}",
"public void init()\n {\n setBackground(Color.YELLOW);\n setForeground(Color.RED);\n }",
"public Piezas(String color) {\r\n this.color = color;\r\n }",
"public TetrisColors() {\n\t\treset();\t\n\t}",
"public ColorVector(float red, float green, float blue) {\n this.red = red;\n this.green = green;\n this.blue = blue;\n }",
"public ColorClass (int ide, Interval interval, boolean ordered) {\n this (\"C\"+ide, interval, ordered);\n }",
"protected GeometricObject(String color, boolean filled)\n {\n this.color = color;\n this.filled = filled;\n dateCreated = new Date();\n }",
"public Pawn(String color){\r\n this.color=color; \r\n }",
"public ColorChange(Color color, double time) {\n this.color = color;\n this.time = time;\n }",
"@Override\n\tpublic void init() {\n this.setColor(Color.PINK);\n \n\t}",
"public float[] getDefaultColor() {\n \treturn defaultColor;\n }",
"Color userColorChoose();",
"public Bishop(String color) {//True is white, false is black\n\t\tsuper(color);\n\n\t}",
"public Box(String color) {\n\t\tthis.color = color;\n\t}",
"@Override\n\tpublic String getColor() {\n\t\treturn \"blue\";\n\t}",
"protected GeometricObject(String color, boolean filled) \n\t{\n\t\tdateCreated = new java.util.Date();\n\t\tthis.color = color;\n\t\tthis.filled = filled;\n\t}",
"public Shape(String color) { \n System.out.println(\"Shape constructor called\"); \n this.color = color; \n }",
"public ToolImpl(Color fgColor) {\n\t\tthis(fgColor, null, null, null, null);\n\t}",
"public Color(int argb) {\n this.a = (byte)(argb >> 24);\n this.r = (byte)(argb >> 16);\n this.g = (byte)(argb >> 8);\n this.b = (byte)(argb );\n }",
"public Collection(char colour) { /* ... code ... */ }",
"public void setColor(Color c);",
"public Color(double newR, double newG, double newB) {\n\n\t\tr = newR;\n\t\tg = newG;\n\t\tb = newB;\n\t}",
"public Color(final int red, final int green, final int blue) {\n\t\tif (red < 0 || red > 255) {\n\t\t\tthrow new IllegalArgumentException(\"The red part of a color can only be between 0 and 255.\");\n\t\t} else if (green < 0 || green > 255) {\n\t\t\tthrow new IllegalArgumentException(\"The green part of a color can only be between 0 and 255.\");\n\t\t} else if (blue < 0 || blue > 255) {\n\t\t\tthrow new IllegalArgumentException(\"The blue part of a color can only be between 0 and 255.\");\n\t\t}\n\t\tthis.r = red;\n\t\tthis.g = green;\n\t\tthis.b = blue;\n\t}",
"public DefaultTheme() {\r\n //sets up alpha values for a nicer look\r\n p1.a = 0.85f;\r\n p2.a = 0.85f;\r\n p3.a = 0.85f;\r\n\r\n s1.a = 0.85f;\r\n s2.a = 0.85f;\r\n s3.a = 0.85f;\r\n }",
"public Color(Color newColor) {\n\n\t\tthis(newColor.r, newColor.g, newColor.b);\n\t}",
"public void init_colors_red(){\t\n\t\tColor c1 = new Color(0,0,0);\t\t// BLACK\t\t\n\t\tColor c2 = new Color(255,0,0);\t// RED\n\t\tColor c3 = new Color(255,170,0);\t// ORANGE\n\t\tColor c4 = new Color(255,255,255);\t// WHITE\n\t\t\n\t\tinit_colors(c1,c2,c3,c4);\n\t}",
"public void color(Color the_color) {\n \n }",
"colorChoice(Vec3 color) {\n this.color = color;\n }",
"public EnemyBackground(Color color) {\r\n this.color = color;\r\n }",
"public void makeRandColor(){}",
"public ShadesOfBlue(){\n super( Settings.ObjectivesProperties.SHADES_OF_BLUE.getTitle(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getDescription(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPath(),\n Settings.ObjectivesProperties.SHADES_OF_BLUE.getPoints(),\n Colour.BLUE);\n }",
"public static void setBasicColor(Color color) {\n basicColor = new Color(color.getRGB());\n }",
"public static Color getBasicColor() {\n String colorEntities = PropertyLoader.getInstance().getProperties()\n .getProperty(PropertyLoader.COLOR_ENTITIES);\n Color color;\n\n if (colorEntities == null)\n color = basicColor;\n else\n color = new Color(Integer.parseInt(colorEntities));\n\n return color;\n }",
"abstract Color getColor();",
"@Override\r\n\tpublic String getColor() {\n\t\treturn \"white\";\r\n\t}",
"@Override\n public ShapeColor setColor(int r, int g, int b) {\n return new ShapeColor(r, g, b);\n }",
"public CachedColorizer()\n {\n colorIndex = 3;\n }",
"public Coche (String color, String modelo) {\r\n\t super(color, modelo);\r\n\t numeroDeRuedas = 4;\r\n\t }",
"private Color NewColor(int numb) {\r\n\r\n\t\tswitch(numb){\r\n\t\tcase 0: return Color.BLACK;\r\n\t\tcase 1: return Color.RED;\r\n\t\tcase 3: return Color.BLUE;\r\n\t\t}\r\n\t\treturn Color.MAGENTA;\r\n\t}",
"public Shape (int x, int y, Color color)\r\n {\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n\tthis.color = color;\r\n }",
"RGB getNewColor();",
"public void setColor(Color c){\n\t\t//do nothing\n\t}",
"public Colour(Colour c) {\n\t\tset(c.r, c.b, c.g);\n\t}",
"@Override\n Color getColor() {\n return new Color(32, 83, 226, 255);\n }",
"public Goat(String color){\r\n\t\t\r\n\t\tthis.color = color;\r\n\t\tthis.blackCoins = 100;\r\n\t\tthis.whiteCoins = 100;\r\n\t\tthis.greyCoins = 100;\r\n\t\tthis.waitTime = 1;\r\n\t\tthis.willPay = false;\r\n\r\n\t}",
"public void setColor(int color);",
"public void setColor(int color);",
"public Wall()\n {\n super();\n setColor( null );\n\n }",
"public ColorClass (String name, Interval interval) {\n this(name, interval, false);\n }",
"public void setColor(Color c) { color.set(c); }",
"void setColor(int r, int g, int b);",
"public Figure(String colour) {\n this.colour = colour;\n }",
"BasicShader( String name, Color baseColor ) {\n name_ = name;\n baseColor_ = baseColor;\n }",
"public void setColor(int r, int g, int b);",
"@Override\r\n\tpublic String setColor() {\n\t\treturn null;\r\n\t}",
"public SearchManager(Color givenColor) {\n\t\tsuper(givenColor);\n\t}",
"public abstract Color getColor();"
] | [
"0.7973721",
"0.726136",
"0.7147733",
"0.7080134",
"0.7065064",
"0.69429916",
"0.685657",
"0.67726535",
"0.6734588",
"0.6714522",
"0.66417444",
"0.6632625",
"0.66081417",
"0.66047317",
"0.6585129",
"0.6525008",
"0.6414012",
"0.64124817",
"0.6401885",
"0.6389168",
"0.6382989",
"0.6375378",
"0.6360183",
"0.63570297",
"0.63461804",
"0.63290465",
"0.6307203",
"0.6298052",
"0.6292155",
"0.6284424",
"0.628371",
"0.62806726",
"0.6276699",
"0.62663776",
"0.62501025",
"0.6247325",
"0.62389547",
"0.6229406",
"0.6226113",
"0.6214231",
"0.62059003",
"0.61956763",
"0.61878854",
"0.61877763",
"0.61855865",
"0.6177621",
"0.6174056",
"0.616926",
"0.61572915",
"0.6143545",
"0.61394423",
"0.613432",
"0.6119566",
"0.61181694",
"0.6113306",
"0.6092182",
"0.60902464",
"0.6078107",
"0.6067639",
"0.6057125",
"0.6055491",
"0.6053117",
"0.6048664",
"0.604261",
"0.60385996",
"0.603675",
"0.6034927",
"0.60334593",
"0.603046",
"0.6021074",
"0.6011952",
"0.6007532",
"0.60061693",
"0.6004643",
"0.6002307",
"0.59977525",
"0.5988166",
"0.59855425",
"0.597845",
"0.5977839",
"0.5977378",
"0.5962863",
"0.5961814",
"0.595477",
"0.59399956",
"0.593473",
"0.59332263",
"0.5933049",
"0.5927971",
"0.5923009",
"0.5923009",
"0.59216374",
"0.5912455",
"0.59070593",
"0.59050554",
"0.58974147",
"0.589318",
"0.58924603",
"0.58905864",
"0.5887993",
"0.58861923"
] | 0.0 | -1 |
Main for testing methods | public static void main(String args[]){
Olive empty = new Olive();
Olive notEmpty = new Olive("notEmpty",new Money(1,1),300);
Olive notEmpty2 = new Olive("notEmpty",new Money(1,1),300);
System.out.println(empty.toString()+"\n"+notEmpty.toString()+"\n" +notEmpty2.toString()+"\n" );
System.out.println(empty.equals(notEmpty)+"\n" +notEmpty.equals(notEmpty2));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\r\n // 2. Call your method in various ways to test it here.\r\n }",
"public static void main(String[] args){\n new Testing().runTests();\r\n \r\n }",
"@Test\n public void main() {\n MainApp.main(new String[] {});\n }",
"public static void main(String[] args) {\n // PUT YOUR TEST CODE HERE\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n GOL_Main.main(args);\n }",
"@Test\n\tpublic void testMain() {\n\t}",
"@Test\n\tpublic void testMain() {\n\t\t// TODO: test output streams for various IO methods, emulating a user's\n\t\t// input - kinda like Joel did for CSSE2310\n\t\tAssert.fail();\n\t}",
"@Test\r\n\tpublic void mainTest(){\r\n\t\tMain m = new Main();\r\n\t\tm.main(null);\r\n\t}",
"@Test\n public void testMain() throws Exception {\n //main function cannot be tested as it is dependant on user input\n System.out.println(\"main\");\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n Calculadora_teste.main(args);\n \n }",
"@Test\t\n\tpublic void testMain() {\n\n\t\tSystem.out.println(\"hello\");\n\t}",
"public static void main(String[] args) {\r\n// Use for unit testing\r\n }",
"@Test\n public void main() {\n // App.main(null);\n // assertEquals(\"Hello world\", outContent.toString());\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n Cic.main(args);\n \n }",
"public static void main(String[] args) {\r\n\t\tSystem.out.println(\"Testing Calculator\");\r\n\t\ttestConstructors();\r\n\t\ttestSetters();\r\n\t\ttestGetters();\r\n\t\ttestToString();\r\n\t}",
"public static void main(String args[]){\n\t\tTestingUtils.runTests();\n\t\t\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n CashRegister.main(args);\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n SServer.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public void TestMain(){\n SampleStatements();\n TestMyPow();\n }",
"@Test\n public void main() {\n System.out.println(\"main\");\n String[] args = null;\n SaalHelper.main(args);\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n LoginRegister.main(args);\n }",
"public static void main(String[] args) {\n //init\n Client.getLayerIntersectDao().getConfig().getIntersectionFile(null);\n\n //tests\n TestLayers();\n// TestFields();\n// TestObjects();\n// TestDistributions();\n// TestDistributionData();\n// TestDistributionShapes();\n// TestObjNames();\n }",
"public static void main(String... args) throws Exception {\n //testHelloWorld();\n //testExchange();\n //testParentChild();\n //testLinking();\n //testListener();\n //testParse(\"1\");\n //testOuterInner();\n //testResourceARM();\n //testExecuteAround();\n testExecuteAroundARM();\n }",
"@Test\r\n public void testMain() {\r\n System.out.println(\"main\");\r\n String[] args = null;\r\n Prog4.main(args);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n RefSystemGUI.main(args);\n }",
"public static void main(String[] args) {\n\t\t\n\t\tglobalTest();\n//\t\ttimeTest();\n//\t\ttestPrefixSearch();\n//\t\ttestSearch();\n//\t\ttestPrediction();\n//\t\ttestTrieSearch();\n//\t\ttestRebuid();\n//\t\ttest13();\n//\t\ttest14();\n\t}",
"public static void main() {\n \n }",
"public static void main(String[] args) {\n\ttest(tests);\n }",
"public static void main(String[] args) {\r\n\t\t// test method\r\n\t\tNewFeatures newFeatures = new NewFeatures();\r\n\t\tnewFeatures.testingArrayList();\r\n\t\tnewFeatures.testingTryCatch();\r\n\t\tnewFeatures.testingNumericValues();\r\n\t\tnewFeatures.testingSwitchWithStringStatemant();\r\n\r\n\t}",
"public void testMain() throws ClassNotFoundException, IOException \r\n {\r\n String[] args = new String[1];\r\n args[0] = \"SyntaxTest\";\r\n \r\n System.out.println(\"Filename: SyntaxTest:\\n\");\r\n Rectangle1.main(args);\r\n \r\n\r\n\r\n String[] args2 = new String[1];\r\n args2[0] = \"SimpleInsertionTest\";\r\n \r\n System.out.println(\"\\n\\nFilename: SimpleInsertionTest:\\n\");\r\n Rectangle1.main(args2);\r\n \r\n String[] args3 = new String[1];\r\n args3[0] = \"RegionSearchTest\";\r\n \r\n System.out.println(\"\\n\\nFilename: RegionSearchTest:\\n\");\r\n Rectangle1.main(args3);\r\n \r\n String[] args4 = new String[1];\r\n args4[0] = \"WebCatTests\";\r\n \r\n System.out.println(\"\\n\\nFilename: WebCatTests:\\n\");\r\n Rectangle1.main(args4);\r\n \r\n String[] args5 = new String[1];\r\n args5[0] = \"RemoveTest\";\r\n \r\n System.out.println(\"\\n\\nFilename: RemoveTest:\\n\");\r\n Rectangle1.main(args5);\r\n \r\n String[] args6 = new String[1];\r\n args6[0] = \"MoreCommands\";\r\n \r\n System.out.println(\"\\n\\nFilename: MoreCommands:\\n\");\r\n Rectangle1.main(args6);\r\n \r\n assertEquals(\"RegionSearchTest\", args3[0]);\r\n }",
"@Test\r\n public void testMain() {\r\n System.out.println(\"main\");\r\n String[] args = null;\r\n ChessMain.main(args);\r\n // TODO review the generated test code and remove the default call to fail.\r\n \r\n }",
"public static void main(){\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n WarPlane.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static void main()\n\t{\n\t}",
"@Test\n public void main() {\n run(\"TEST\");\n }",
"public static void main(String args[]) {\n\t\tSystem.out.println(\"\\r\\ngetGameSituationTest()\");\n\t\tgetGameSituationTest();\n\n\t\tSystem.out.println(\"\\r\\nstateCheckerboardConvertionTest()\");\n\t\tstateCheckerboardConvertionTest();\n\n\t\tSystem.out.println(\"\\r\\ngetValidActionsTest()\");\n\t\tgetValidActionsTest();\n\t}",
"public static void main(String[] args) {\n\t\ttest();\n\t}",
"@Test\n public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n MainWindow1.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static void main(String[] args) {\n System.out.println(testLibraryParseCardBarCode());\n System.out.println(testLibraryParseRunLibrarianCheckoutBookCommand());\n System.out.println(testLibraryParseRunSubscriberReturnBookCommand());\n System.out.println(testparseBookId());\n System.out.println(testparseRunSubscriberCheckoutBookCommand());\n }",
"public static void main(String[] args) {\n\t\trun();\n\t\t//runTest();\n\n\t}",
"public static void main(String[] args) {\n\t\ttestStreamMapReduce();\r\n\t\t//testMethodReference();\r\n\t}",
"public static void main(String [] args) {\r\n\t\ttestOne(); //adds items to WH; tests getNumItems method & toString method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestTwo(); //tests getItem(String) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestThree(); //test getItem(Item) method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFour(); //tests total cost method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestFive(); //this will test the getRefrigeratedItems method\r\n\t\tSystem.out.print(\"\\n\"); \r\n\t\ttestSix(); //tests getTotalCostRefrigerated method\r\n\t\tSystem.out.print(\"\\n\");\r\n\t\ttestSeven(); //tests remove method\r\n\t}",
"public static void main(String argv[]) {\n \r\n PolicyTest bmt = new PolicyTest();\r\n\r\n bmt.create_minibase();\r\n\r\n // run all the test cases\r\n System.out.println(\"\\n\" + \"Running \" + TEST_NAME + \"...\");\r\n boolean status = PASS;\r\n status &= bmt.test1();\r\n \r\n bmt = new PolicyTest();\r\n bmt.create_minibase();\r\n status &= bmt.test2();\r\n\r\n // display the final results\r\n System.out.println();\r\n if (status != PASS) {\r\n System.out.println(\"Error(s) encountered during \" + TEST_NAME + \".\");\r\n } else {\r\n System.out.println(\"All \" + TEST_NAME + \" completed successfully!\");\r\n }\r\n\r\n }",
"public static void main (String[] args){\n\t\tincPieceCountTest();\n\t\tdecPieceCountTest();\n\t\tsetPieceTest();\n\t\tmoveTest();\n\t\tanyMoveTest();\n\t\tgetPiecesTest();\n\t\tsetPieceTest2();\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"Just testing\");\r\n\t\t//lisää kommenttia\r\n\t\t\r\n\t}",
"public void testMain() throws Throwable {\n\r\n\t}",
"public static void main() {\n }",
"public static void main(String[] args) {\n inOrbitDestinationControllerTest();\n// inOrbitReplayControllerTest();\n\n }",
"@org.junit.Test\n public void main() throws Exception {\n DosEquis.main(null);\n }",
"public static void run() {\n testAlgorithmOptimality();\n// BenchmarkGraphSets.testMapLoading();\n //testAgainstReferenceAlgorithm();\n //countTautPaths();\n// other();\n// testLOSScan();\n //testRPSScan();\n }",
"public static void main(String[] args) {\n testFactorial();\n testFibonacci();\n testMissing();\n testPrime();\n\n\n }",
"public static void main(String[] args){\n\t\ttest1();\r\n\t}",
"public void Main(){\n }",
"public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"main method\");\n\t\ttest();\n\t\t//RunprogramwithoutObject.test();// no need to create any object of class\n\t\tcover();\n\n\t}",
"public static void main(String[] args) {\n DatabaseCommunicator test = new DatabaseCommunicator();\n// HashMap<String,LabTest> methods = test.getMethods();\n// System.out.println(methods.get(\"mingi labTest\").getMatrix());\n LabTest labTest = new LabTest();\n ArrayList testData = test.fileReader();\n DatabaseCommunicator.testSendingToDatabase(test, labTest, testData);\n }",
"public static void main (String[] args) {\n \n doTest (\"hello\");\n doTest (\"query\");\n doTest (\"Mississippi\");\n doTest (\"elephant\");\n doTest (\"Qatar\");\n System.out.println();\n \n }",
"public static void main(String[] args) throws Exception{\n test1();\n }",
"public static void main(String[] args){\n //The driver of the methods created above\n //first display homeowork header\n homeworkHeader();\n //calls driver method\n System.out.println(\"Calling driver method:\");\n driver(true);//runs choice driver\n //when prompted for a choice input 9 to see test driver\n System.out.println(\"End calling of driver method\");\n \n }",
"public static void main(String[] args) {\n\n experiment();\n }",
"public Main() {}",
"public void testMain() {\n System.out.println(\"main\");\n String[] args = null;\n SVV01.main(args);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public static void main(String[] args) {\n\t\tTestST st2 = TestST.getInstance();\r\n\t}",
"public Main() {\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\ttest01();\n\t}",
"public static void main(String[] args) throws IOException {\n\t\t testType1();\n\n\t\t// testMatrix();\n//\t\ttestKening();\n\t\t\n//\t\ttestOutline();\n\t}",
"@Test\n public void run_main(){\n\n String resource_folder = (new File(\"src/test/resources/\")).getAbsolutePath()+ File.separator ;\n\n String[] args = new String[7];\n args[0] = \"-run\";\n args[1] = resource_folder + \"test_configs/line_ctm.xml\";\n args[2] = \"mytest\";\n args[3] = resource_folder+\"sample_output_request.xml\";\n args[4] = \"temp\";\n args[5] = \"0\";\n args[6] = \"100\";\n\n OTM.main(args);\n\n }",
"public static void main(String[] args)\n {\n try\n {\n TestRunner.run(isuite());\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }",
"@Test\n public void testMain() {\n String simulatedUserInput = \"100AUD\" + System.getProperty(\"line.separator\")\n + \"1\" + System.getProperty(\"line.separator\");\n\n InputStream savedStandardInputStream = System.in;\n System.setIn(new ByteArrayInputStream(simulatedUserInput.getBytes()));\n\n mainFunction mainfunc = new mainFunction();\n\n try {\n mainfunc.start();\n } catch(Exception e) {\n System.out.println(\"Exception!\");\n }\n\n assertEquals(1,1);\n }",
"public void main(){\n }",
"public static void main(String[] args)\r\n\t{\r\n\t\t// create the suite of tests\r\n\t\t/*final TestSuite tSuite = new TestSuite();\r\n\t\ttSuite.addTest(new PersonDaoGenericTest(\"testSavePerson\"));\r\n\t\ttSuite.addTest(new PersonDaoGenericTest(\"testLoadPerson\"));\r\n\t\tTestRunner.run(tSuite);*/\r\n\t}",
"private Main() {\n }",
"public Main() {\n \n \n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"Testing basic functions...\");\n\t\tQuiz q = new QuizImpl(1, \"Test quiz\");\n\t\tSystem.out.println(\"Quiz ID: \" + q.getId());\n\t\tSystem.out.println(\"Quiz name: \" + q.getTitle());\n\t\tSystem.out.println(\"Adding questions...\");\n\t\tq.addQuestions();\n\t\tSystem.out.println(\"Printing questions...\");\n\t\tq.printQuestions();\n\t}",
"public static void main(String[] args) {\n new TSL2550Test();\n }",
"public static void main(String[] args){\n Api api = Factory.createApi(1);\n api.operation(\"using factory now\");\n\n System.out.println(\"--------------using configuration file to get api--------------\");\n Api api2 = Factory.configToCreateApi();\n api2.operation(\"just a test!\");\n }",
"public static void main(String[] args) {\n basePath = MatcherTest.class.getClassLoader().getResource(\"\").getPath() + \"/\";\n\n String russianPath = basePath + \"russianArticlesTokenizedShort-2.txt\";\n String ruOriginalPath = basePath + \"newRussianArticles.json\";\n String englishPath = basePath + \"englishArticlesTokenized.txt\";\n String enOriginalPath = basePath + \"englishArticles.txt\";\n\n String titleExpert = basePath + \"titleExpert.json\";\n String expertPath = basePath + \"matchExpert.json\";\n String articlePath = basePath + \"testMatchRussian3.json\";\n\n getRussianTokenized(russianPath);\n getRussianOriginal(ruOriginalPath);\n getEnglishTokenized(englishPath);\n getEnglishOriginal(enOriginalPath);\n// matchTitles(titleExpert);\n// matchArticles(articlePath);\n// matchTest(expertPath, articlePath);\n matchArticlesRussian(articlePath);\n ArticleClass.PlayMusic();\n }",
"public static void main(String[] args) {\n\t\tdeferTest();\n\t}",
"private Main() {}",
"@Override\n public void runTest() {\n }",
"private void test() {\n\n\t}",
"public static void main(String[] args) {\r\n System.out.println(runAllTests());\r\n }",
"public static void main(String arg[]) {\n System.out.println(\"testGuset(): \" + testGuset());\n System.out.println(\"testServingQueue(): \" + testServingQueue());\n System.out.println(\"testDessertSolvers(): \" + testDessertSolvers());\n testCapicity();\n }",
"public static void main(String argv[]) {\n org.junit.runner.JUnitCore.main(Test_Data.class.getName()); // full name with package\n }",
"public static void main(String[] args) {\n\n\n\n org.junit.runner.JUnitCore.main(\n \"dataAccessTest.databaseTest\",\n \"proxyTest.proxyTest\");\n }",
"public static void main(String[] args) {\n\t\t \n\t\tResult result1 = JUnitCore.runClasses(TestUnitForCreate.class);\n\t for (Failure failure : result1.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result1.wasSuccessful());\n\n\t Result result2 = JUnitCore.runClasses(TestUnitForReadByCalimNumber.class);\n\t for (Failure failure : result2.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result2.wasSuccessful());\n\t \n\t Result result3 = JUnitCore.runClasses(TestUnitForReadByLossDate.class);\n\t for (Failure failure : result3.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result3.wasSuccessful());\n\t \n\t\tResult result4 = JUnitCore.runClasses(TestUnitForUpdate.class);\n\t\tfor (Failure failure : result4.getFailures()) {\n\t\t\tSystem.out.println(failure.toString());\n\t\t}\n\t\tSystem.out.println(result4.wasSuccessful());\n\t \n\t Result result5 = JUnitCore.runClasses(TestUnitForReadVehicle.class);\n\t for (Failure failure : result5.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result5.wasSuccessful());\n \n\t Result result6 = JUnitCore.runClasses(TestUnitForDelete.class);\n\t for (Failure failure : result6.getFailures()) {\n\t System.out.println(failure.toString());\n\t }\n\t System.out.println(result6.wasSuccessful());\n\t \n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tTestClass T = new TestClass();\n\t\tT.TestRun();\n\t\tT.TestQ();\n\n\t}",
"public Main() {\r\n }",
"public Main() {\r\n }",
"public static void start() {\n\t\t\n\t\ttestEmptyConstructors();\n\t\ttestConstructors();\n\n\t}",
"public static void main(String... args) throws IOException {\n new Test().test();\n }",
"public static void main(String[] args) throws IOException, ClassNotFoundException {\n displayInventoryTest();\n updateInventoryTest();\n getItemTest();\n }",
"@Test\n public void run () {\n\t \n\t System.out.println(\"---------->\");\n\t //System.out.println(md5list.getResult());\n\t //System.out.println(hashsearch.getResult());\n\t \n\t \n\t \n\t // System.out.println(samples.Testing());\n\t //System.out.println(\"getserult: \"+samples.getResult());\n\t \n }",
"public static void main(String[] args) {\n test4();\n }",
"public static void main(String[] args) {\n\t\tdebutTest();\n\t\t\tinstancePerson();\n\t\t\tmodifier1Personne();\n\t\t\t//modifier2Personne();\n\t\t\n\t\tfinTest();\n\t}",
"public static void main(String[] args) throws Exception {\n\n\t\t testDistance();\n\n\t\t //functionFitting();\n\t\t //testFunction();\n\t}",
"public static void main(String[] args) {\n\t\ttestJacksonString();\r\n//\t\tgetFlightSearchData();\r\n\t}",
"public static void main(String[] args) {\n testFactoryMethod();\n }",
"public static void main(String[] args) {\r\n\r\n\t\ttry {\r\n\t\t\tDatabaseManager.setPatternNumber(1);\r\n\t\t\tDatabaseManager.getSingleton().openConnection();\r\n\r\n\t\t\tSingleTableCreator.dropAllTables();\r\n\t\t\tSingleTableCreator.createTables();\r\n\t\t\tSingleTableCreator.addTestRows();\r\n\r\n\t\t\tTestEVERYTHING.testRunAllTheTests();\r\n\r\n\t\t\tSystem.out.println(\"ya done diddly did it\");\r\n\r\n\t\t\tDatabaseManager.getSingleton().closeConnection();\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tDatabaseException.detectError(e, \"Runnable - Single\");\r\n\t\t}\r\n\t}",
"@Test\n @Category(SlowTest.class)\n public void AppSmokeTest(){\n App.main(new String[]{TEST_PATH + \"input.dot\",\"1\"});\n }",
"public static void main(String[] args)\n {\n TestRunner.run(suite());\n }",
"public Main() {\n }"
] | [
"0.80044794",
"0.79133797",
"0.7870498",
"0.78201944",
"0.76909834",
"0.7566141",
"0.7551845",
"0.75482416",
"0.7516583",
"0.751098",
"0.7483329",
"0.7445297",
"0.7371763",
"0.7335071",
"0.73166794",
"0.731274",
"0.7310231",
"0.73049766",
"0.7285266",
"0.7273571",
"0.7249842",
"0.724534",
"0.7219945",
"0.7212616",
"0.71935076",
"0.71504724",
"0.7148863",
"0.7146999",
"0.7133503",
"0.71066856",
"0.7097117",
"0.70955366",
"0.70869243",
"0.70812607",
"0.70641136",
"0.705981",
"0.70521235",
"0.7051928",
"0.70473456",
"0.704296",
"0.70344573",
"0.7024547",
"0.70143044",
"0.69710344",
"0.6965805",
"0.6962792",
"0.69606304",
"0.695125",
"0.6950623",
"0.6946343",
"0.6945808",
"0.69413996",
"0.693716",
"0.69232213",
"0.6919762",
"0.68913406",
"0.6881292",
"0.6872045",
"0.6865008",
"0.6862078",
"0.68612367",
"0.68593556",
"0.6854193",
"0.68440413",
"0.6843696",
"0.68422323",
"0.6835717",
"0.6832834",
"0.6826793",
"0.6823721",
"0.6820233",
"0.6818251",
"0.68144256",
"0.6813338",
"0.68129927",
"0.6809276",
"0.6793222",
"0.67928284",
"0.67902386",
"0.6776893",
"0.67767084",
"0.67699313",
"0.67598104",
"0.67589414",
"0.6756825",
"0.6755172",
"0.67421216",
"0.67421216",
"0.6740795",
"0.67348313",
"0.67300916",
"0.6728511",
"0.6719269",
"0.6715347",
"0.67115986",
"0.67113405",
"0.67090046",
"0.6708292",
"0.6707536",
"0.67017746",
"0.6698074"
] | 0.0 | -1 |
Initializes the controller class. | @Override
public void initialize(URL url, ResourceBundle rb) {
Root = holderpane;
try {
VBox box = FXMLLoader.load(getClass().getResource("DrawerFXML.fxml"));
drawer.setSidePane(box);
} catch (IOException ex) {
}
HamburgerBackArrowBasicTransition transition = new HamburgerBackArrowBasicTransition(hamburger);
transition.setRate(-1);
hamburger.addEventHandler(MouseEvent.MOUSE_PRESSED,(e)->{
transition.setRate(transition.getRate()*-1);
transition.play();
if(drawer.isShown())
{
drawer.close();
}else
drawer.open();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initialize() {\n\t\tcontroller = Controller.getInstance();\n\t}",
"public MainController() {\n\t\tcontroller = new Controller(this);\n\t}",
"public abstract void initController();",
"public Controller() {\n super();\n }",
"public Controller() {\n super();\n }",
"public Controller()\n\t{\n\n\t}",
"private static CompanyController initializeController() {\n\n controller = new CompanyController();\n return controller;\n }",
"public MainController() {\n initializeControllers();\n initializeGui();\n runGameLoop();\n }",
"public Controller() {\n this.model = new ModelFacade();\n this.view = new ViewFacade();\n }",
"public Controller()\r\n\t{\r\n\t\tview = new View();\r\n\t}",
"public Controller() {\n\t\tthis(null);\n\t}",
"public void init(){\n\t\t//Makes the view\n\t\tsetUpView();\n\n\t\t//Make the controller. Links the action listeners to the view\n\t\tnew Controller(this);\n\t\t\n\t\t//Initilize the array list\n\t\tgameInput = new ArrayList<Integer>();\n\t\tuserInput = new ArrayList<Integer>();\n\t\thighScore = new HighScoreArrayList();\n\t}",
"private void initialize() {\n\t\tinitializeModel();\n\t\tinitializeBoundary();\n\t\tinitializeController();\n\t}",
"public void init() {\n\t\tkontrolleri1 = new KolikkoController(this);\n\t}",
"protected void initialize() {\n super.initialize(); // Enables \"drive straight\" controller\n }",
"public Controller() {\n model = new Model();\n comboBox = new ChannelComboBox();\n initView();\n new ChannelWorker().execute();\n timer = new Timer();\n }",
"protected CityController() {\r\n\t}",
"public void initialize() {\n warpController = new WarpController(this);\n kitController = new KitController(this);\n crafting = new CraftingController(this);\n mobs = new MobController(this);\n items = new ItemController(this);\n enchanting = new EnchantingController(this);\n anvil = new AnvilController(this);\n blockController = new BlockController(this);\n hangingController = new HangingController(this);\n entityController = new EntityController(this);\n playerController = new PlayerController(this);\n inventoryController = new InventoryController(this);\n explosionController = new ExplosionController(this);\n requirementsController = new RequirementsController(this);\n worldController = new WorldController(this);\n arenaController = new ArenaController(this);\n arenaController.start();\n if (CompatibilityLib.hasStatistics() && !CompatibilityLib.hasJumpEvent()) {\n jumpController = new JumpController(this);\n }\n File examplesFolder = new File(getPlugin().getDataFolder(), \"examples\");\n examplesFolder.mkdirs();\n\n File urlMapFile = getDataFile(URL_MAPS_FILE);\n File imageCache = new File(dataFolder, \"imagemapcache\");\n imageCache.mkdirs();\n maps = new MapController(this, urlMapFile, imageCache);\n\n // Initialize EffectLib.\n if (com.elmakers.mine.bukkit.effect.EffectPlayer.initialize(plugin, getLogger())) {\n getLogger().info(\"EffectLib initialized\");\n } else {\n getLogger().warning(\"Failed to initialize EffectLib\");\n }\n\n // Pre-create schematic folder\n File magicSchematicFolder = new File(plugin.getDataFolder(), \"schematics\");\n magicSchematicFolder.mkdirs();\n\n // One-time migration of legacy configurations\n migrateConfig(\"enchanting\", \"paths\");\n migrateConfig(\"automata\", \"blocks\");\n migrateDataFile(\"automata\", \"blocks\");\n\n // Ready to load\n load();\n resourcePacks.startResourcePackChecks();\n }",
"public ClientController() {\n }",
"public Controller() {\n\t\tthis.nextID = 0;\n\t\tthis.data = new HashMap<Integer, T>();\n\t}",
"public ListaSEController() {\n }",
"boolean InitController();",
"public MenuController() {\r\n\t \r\n\t }",
"@Override\n\tprotected void initController() throws Exception {\n\t\tmgr = orderPickListManager;\n\t}",
"public CustomerController() {\n\t\tsuper();\n\n\t}",
"public End_User_0_Controller() {\r\n\t\t// primaryStage = Users_Page_Controller.primaryStage;\r\n\t\t// this.Storeinfo = primaryStage.getTitle();\r\n\t}",
"public Controller(){\r\n\t\tthis.fabricaJogos = new JogoFactory();\r\n\t\tthis.loja = new Loja();\r\n\t\tthis.preco = 0;\r\n\t\tthis.desconto = 0;\r\n\t}",
"private Controller() {\n\t\tthis.gui = GUI.getInstance();\n\t\tthis.gui.setController(this);\n\t}",
"public GameController() {\r\n\t\tsuper();\r\n\t\tthis.model = Main.getModel();\r\n\t\tthis.player = this.model.getPlayer();\r\n\t\tthis.timeline = this.model.getIndefiniteTimeline();\r\n\t}",
"public PlantillaController() {\n }",
"public Controller() {\n\t\tplaylist = new ArrayList<>();\n\t\tshowingMore = false;\n\t\tstage = Main.getStage();\n\t}",
"public IfController()\n\t{\n\n\t}",
"public TournamentController()\n\t{\n\t\tinitMap();\n\t}",
"public GeneralListVueController() {\n\n\t}",
"private ClientController() {\n }",
"public Controller()\n\t{\n\t\ttheParser = new Parser();\n\t\tstarList = theParser.getStars();\n\t\tmessierList = theParser.getMessierObjects();\n\t\tmoon = new Moon(\"moon\");\n\t\tsun = new Sun(\"sun\");\n\t\tconstellationList = theParser.getConstellations();\n\t\tplanetList = new ArrayList<Planet>();\n\t\ttheCalculator = new Calculator();\n\t\tepoch2000JD = 2451545.0;\n\t}",
"private void initialiseController() \r\n {\r\n defaultVectors();\r\n if(grantsByPIForm == null) \r\n {\r\n grantsByPIForm = new GrantsByPIForm(); //(Component) parent,modal);\r\n }\r\n grantsByPIForm.descriptionLabel.setText(UnitName);\r\n grantsByPIForm.descriptionLabel.setFont(new Font(\"SansSerif\",Font.BOLD,14));\r\n queryEngine = QueryEngine.getInstance();\r\n coeusMessageResources = CoeusMessageResources.getInstance();\r\n registerComponents();\r\n try {\r\n setFormData(null);\r\n }\r\n catch(Exception e) {\r\n e.printStackTrace(System.out);\r\n }\r\n }",
"public LogMessageController() {\n\t}",
"public LoginPageController() {\n\t}",
"public ControllerEnfermaria() {\n }",
"public ProvisioningEngineerController() {\n super();\n }",
"private StoreController(){}",
"public GenericController() {\n }",
"@Override\n\tpublic void initialize() {\n\t\tinitializeModel(getSeed());\n\t\tinitializeView();\n\t\tinitializeControllers();\n\t\t\n\t\tupdateScore(8);\n\t\tupdateNumberCardsLeft(86);\n\n\t}",
"public MapController() {\r\n\t}",
"public Controller() {\n\t\tenabled = false;\n\t\tloop = new Notifier(new ControllerTask(this));\n\t\tloop.startPeriodic(DEFAULT_PERIOD);\n\t}",
"@Override\r\n\tpublic void initControllerBean() throws Exception {\n\t}",
"private void setupController() {\n setupWriter();\n Controller controller1 = new Controller(writer);\n controller = controller1;\n }",
"public WfController()\n {\n }",
"public Controller() {\n\n lastSearches = new SearchHistory();\n\n }",
"private ClientController(){\n\n }",
"public LoginController() {\r\n }",
"public PersonasController() {\r\n }",
"private void initBefore() {\n // Crear Modelo\n model = new Model();\n\n // Crear Controlador\n control = new Controller(model, this);\n\n // Cargar Propiedades Vista\n prpView = UtilesApp.cargarPropiedades(FICHERO);\n\n // Restaurar Estado\n control.restaurarEstadoVista(this, prpView);\n\n // Otras inicializaciones\n }",
"public StoreController() {\n }",
"public ConsoleController() {\n\t\tcommandDispatch = new CommandDispatch();\n\t}",
"public LoginController() {\r\n\r\n }",
"public final void init(final MainController mainController) {\n this.mainController = mainController;\n }",
"public SMPFXController() {\n\n }",
"public Controller()\r\n {\r\n fillBombs();\r\n fillBoard();\r\n scoreBoard = new ScoreBoard();\r\n }",
"public GUIController() {\n\n }",
"public void init(){\n this.controller = new StudentController();\n SetSection.displayLevelList(grade_comp);\n new DesignSection().designForm(this, editStudentMainPanel, \"mini\");\n }",
"public void init(final Controller controller){\n Gdx.app.debug(\"View\", \"Initializing\");\n \n this.controller = controller;\n \n //clear old stuff\n cameras.clear();\n \n //set up renderer\n hudCamera = new OrthographicCamera();\n hudCamera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n \n batch = new SpriteBatch();\n igShRenderer = new ShapeRenderer();\n shapeRenderer = new ShapeRenderer();\n \n //set up stage\n stage = new Stage();\n \n //laod cursor\n cursor = new Pixmap(Gdx.files.internal(\"com/BombingGames/WurfelEngine/Core/images/cursor.png\"));\n\n controller.getLoadMenu().viewInit(this);\n \n initalized = true;\n }",
"@PostConstruct\n public void init() {\n WebsocketController.getInstance().setTemplate(this.template);\n try {\n\t\t\tthis.chatController = ChatController.getInstance();\n } catch (final Exception e){\n LOG.error(e.getMessage(), e);\n }\n }",
"public ControllerTest()\r\n {\r\n }",
"public SearchedRecipeController() {\n }",
"public FilmOverviewController() {\n }",
"public CreditPayuiController() {\n\t\tuserbl = new UserController();\n\t}",
"private void initComponents() {\r\n\t\temulator = new Chip8();\r\n\t\tpanel = new DisplayPanel(emulator);\r\n\t\tregisterPanel = new EmulatorInfoPanel(emulator);\r\n\t\t\r\n\t\tcontroller = new Controller(this, emulator, panel, registerPanel);\r\n\t}",
"public RootLayoutController() {\n }",
"public MehController() {\n updateView(null);\n }",
"public Controller(int host) {\r\n\t\tsuper(host);\r\n\t}",
"public TipoInformazioniController() {\n\n\t}",
"public WorkerController(){\r\n\t}",
"private void initializeMealsControllers() {\n trNewPetMeal = MealsControllersFactory.createTrNewPetMeal();\n trObtainAllPetMeals = MealsControllersFactory.createTrObtainAllPetMeals();\n trDeleteMeal = MealsControllersFactory.createTrDeleteMeal();\n trUpdateMeal = MealsControllersFactory.createTrUpdateMeal();\n }",
"public ProductOverviewController() {\n }",
"public ProduktController() {\r\n }",
"public Controller(ViewIF view) {\n\t\tthis.view = view;\n\t\tthis.dao = new DAO();\n\t\tthis.stats = new Statistics(this.dao);\n\t\tthis.gameStarted = false;\n\t}",
"private void initializeMedicationControllers() {\n trNewPetMedication = MedicationControllersFactory.createTrNewPetMedication();\n trObtainAllPetMedications = MedicationControllersFactory.createTrObtainAllPetMedications();\n trDeleteMedication = MedicationControllersFactory.createTrDeleteMedication();\n trUpdateMedication = MedicationControllersFactory.createTrUpdateMedication();\n }",
"public PersonLoginController() {\n }",
"public PremiseController() {\n\t\tSystem.out.println(\"Class PremiseController()\");\n\t}",
"public TaxiInformationController() {\n }",
"public LoginController() {\n\t\treadFromFile();\n\t\t// TODO Auto-generated constructor stub\n\t}",
"public Controller(){\n initControl();\n this.getStylesheets().addAll(\"/resource/style.css\");\n }",
"public CreateDocumentController() {\n }",
"public ControllerRol() {\n }",
"Main ()\n\t{\n\t\tview = new View ();\t\t\n\t\tmodel = new Model(view);\n\t\tcontroller = new Controller(model, view);\n\t}",
"public Controller () {\r\n puzzle = null;\r\n words = new ArrayList <String> ();\r\n fileManager = new FileIO ();\r\n }",
"public void init() {\n \n }",
"public Controller() {\n\t\tdoResidu = false;\n\t\tdoTime = false;\n\t\tdoReference = false;\n\t\tdoConstraint = false;\n\t\ttimeStarting = System.nanoTime();\n\t\t\n\t\tsetPath(Files.getWorkingDirectory());\n\t\tsetSystem(true);\n\t\tsetMultithreading(true);\n\t\tsetDisplayFinal(true);\n\t\tsetFFT(FFT.getFastestFFT().getDefaultFFT());\n\t\tsetNormalizationPSF(1);\n\t\tsetEpsilon(1e-6);\n\t\tsetPadding(new Padding());\n\t\tsetApodization(new Apodization());\n\n\t\tmonitors = new Monitors();\n\t\tmonitors.add(new ConsoleMonitor());\n\t\tmonitors.add(new TableMonitor(Constants.widthGUI, 240));\n\n\t\tsetVerbose(Verbose.Log);\n\t\tsetStats(new Stats(Stats.Mode.NO));\n\t\tsetConstraint(Constraint.Mode.NO);\n\t\tsetResiduMin(-1);\n\t\tsetTimeLimit(-1);\n\t\tsetReference(null);\n\t\tsetOuts(new ArrayList<Output>());\n\t}",
"public OrderInfoViewuiController() {\n\t\tuserbl = new UserController();\n\t}",
"public SessionController() {\n }",
"@Override\n\tprotected void setController() {\n\t\t\n\t}",
"public MainFrameController() {\n }",
"public LicenciaController() {\n }",
"public NearestParksController() {\n this.bn = new BicycleNetwork();\n this.pf = new LocationFacade();\n // this.bn.loadData();\n }",
"public MotorController() {\n\t\tresetTachometers();\n\t}",
"public Controller(IView view) {\n\t\tengine = new Engine(this);\n\t\tclock = new Clock();\n\t\tsoundEmettor = new SoundEmettor();\n\t\tthis.view = view;\n\t}",
"public AwTracingController() {\n mNativeAwTracingController = nativeInit();\n }",
"public HomeController() {\n }",
"public HomeController() {\n }"
] | [
"0.8126442",
"0.78539085",
"0.7832836",
"0.77623755",
"0.77623755",
"0.76012474",
"0.74504834",
"0.7437387",
"0.7431329",
"0.74233705",
"0.7406829",
"0.7342683",
"0.7329348",
"0.72642463",
"0.7223624",
"0.7101346",
"0.7058293",
"0.6987611",
"0.697182",
"0.6943626",
"0.69122165",
"0.6888371",
"0.68798083",
"0.68793654",
"0.68729013",
"0.68672144",
"0.68671244",
"0.6850885",
"0.6846919",
"0.68397343",
"0.6837595",
"0.68333036",
"0.67969817",
"0.6782468",
"0.67667216",
"0.67645586",
"0.6750096",
"0.6748695",
"0.6744897",
"0.6743362",
"0.67401564",
"0.6728062",
"0.67243963",
"0.6697463",
"0.668971",
"0.66884416",
"0.6681328",
"0.6678264",
"0.66650236",
"0.66640395",
"0.66612506",
"0.66533035",
"0.66489184",
"0.6646337",
"0.6639123",
"0.6632608",
"0.6631185",
"0.6627817",
"0.6624544",
"0.6610567",
"0.6605565",
"0.66027856",
"0.6598283",
"0.65813047",
"0.6579163",
"0.6576047",
"0.65744185",
"0.6551466",
"0.6551001",
"0.6547289",
"0.6546178",
"0.6541605",
"0.6528732",
"0.6528491",
"0.65277237",
"0.6523244",
"0.65194416",
"0.6513512",
"0.6509827",
"0.6498208",
"0.64948505",
"0.64934474",
"0.6492267",
"0.648407",
"0.64838904",
"0.64821756",
"0.64787185",
"0.6478498",
"0.6477243",
"0.6471596",
"0.64651674",
"0.64609027",
"0.64442694",
"0.6436732",
"0.64321035",
"0.6428795",
"0.6425759",
"0.64167184",
"0.6416357",
"0.6415472",
"0.6415472"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int getsongCount(String songGenre) {
String query ="select COUNT(songGenre) from genre where songGenre= ? groupby songGenre";
PreparedStatement ps;
int i = 0;
int count = 0;
try {
ps = DBConnection.getDBconnection().prepareStatement(query);
ResultSet rs = ps.executeQuery();
while(rs.next()) {
Genre Genre = new Genre();
count= Genre.setsongCount(rs.getInt("genreName"));
i++;
}
} catch (ClassNotFoundException | SQLException e) {
e.printStackTrace();
}
return count;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public String addGenre(Genre songName, Genre songArtist, Genre songBpm, Genre songGenre) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Creates the update channel. | public UpdateSession(Type type, Channel channel) {
this.type = type;
this.channel = channel;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(\"Stopwatch\", \"StopWatch\", NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(\"Stopwatch Notifications\");\n Objects.requireNonNull(this.getSystemService(NotificationManager.class)).createNotificationChannel(channel);\n }\n }",
"default ServerTextChannelUpdater createUpdater() {\n return new ServerTextChannelUpdater(this);\n }",
"EventChannel.Update update();",
"EventChannel create();",
"public static Channel createUpdatedEntity(EntityManager em) {\n Channel channel = new Channel()\n .type(UPDATED_TYPE)\n .template(UPDATED_TEMPLATE);\n return channel;\n }",
"@Test\n public void testNewChannelAppears() {\n TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.RELEASE);\n UpdateStrategyCustomization customization = new UpdateStrategyCustomization();\n UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString(\"IU-95.627\"), InfoReader.read(\"idea-newChannel-release.xml\"), settings, customization);\n\n CheckForUpdateResult result = strategy.checkForUpdates();\n assertEquals(UpdateStrategy.State.LOADED, result.getState());\n BuildInfo update = result.getNewBuildInSelectedChannel();\n assertNull(update);\n\n UpdateChannel newChannel = result.getChannelToPropose();\n assertNotNull(newChannel);\n assertEquals(\"IDEA10EAP\", newChannel.getId());\n assertEquals(\"IntelliJ IDEA X EAP\", newChannel.getName());\n }",
"@RequiresApi(Build.VERSION_CODES.O)\n private void createChannel() {\n NotificationManager\n mNotificationManager =\n (NotificationManager) this\n .getSystemService(NOTIFICATION_SERVICE);\n // The id of the channel.\n String id = CHANNEL_ID;\n // The user-visible name of the channel.\n CharSequence name = \"Media playback\";\n // The user-visible description of the channel.\n String description = \"Media playback controls\";\n int importance = NotificationManager.IMPORTANCE_LOW;\n NotificationChannel mChannel = new NotificationChannel(id, name, importance);\n // Configure the notification channel.\n mChannel.setDescription(description);\n mChannel.setShowBadge(false);\n mChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);\n mNotificationManager.createNotificationChannel(mChannel);\n }",
"public void createChannel() {\r\n\t\tworkChannels.add(new ArrayList<Point>());\r\n\t}",
"public abstract DefaultWOWebSocket create(Channel channel);",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n Log.d(TAG, \"createNotificationChannel: \" + Build.VERSION.SDK_INT);\n // Importance applicable to all the notifications in this Channel\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n\n NotificationChannel notificationChannel =\n new NotificationChannel(NOTIFICATION_CHANNEL_ID, CHANNEL_NAME, importance);\n\n String channelDescription = \"This is channel description\";\n notificationChannel.setDescription(channelDescription);\n notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);\n\n //finally create notification channel\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n if (notificationManager != null) {\n notificationManager.createNotificationChannel(notificationChannel);\n }\n }\n }",
"abstract ManagedChannel createChannel(List<ServerInfo> servers);",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Channel1\";\n String description = \"Channel discription\";\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(channelId, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@Test\n public void testNewChannelAndNewBuildAppear() {\n TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);\n UpdateStrategyCustomization customization = new UpdateStrategyCustomization();\n UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString(\"IU-95.429\"), InfoReader.read(\"idea-newChannel.xml\"), settings, customization);\n\n CheckForUpdateResult result = strategy.checkForUpdates();\n assertEquals(UpdateStrategy.State.LOADED, result.getState());\n BuildInfo update = result.getNewBuildInSelectedChannel();\n assertNotNull(update);\n assertEquals(\"95.627\", update.getNumber().toString());\n\n UpdateChannel newChannel = result.getChannelToPropose();\n assertNotNull(newChannel);\n assertEquals(\"IDEA10EAP\", newChannel.getId());\n assertEquals(\"IntelliJ IDEA X EAP\", newChannel.getName());\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = \"\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n mNotificationManager = getSystemService(NotificationManager.class);\n mNotificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n String name = NOTIFICATION_CHANNEL_NAME;\n String descriptionText = NOTIFICATION_CHANNEL_DESCRIPTION;\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(descriptionText);\n\n // Register the channel with the system\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"public void createNotificationChannel()\n {\n //Instantiate the NotificationManager\n mNotifyManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n //Notification Channel constructed\n NotificationChannel notificationChannel = new NotificationChannel(PRIMARY_CHANNEL_ID, \"Simple Notification\", NotificationManager.IMPORTANCE_HIGH);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Simple Notification\");\n\n //Create the channel with the NotificationManager\n mNotifyManager.createNotificationChannel(notificationChannel);\n }",
"public void createNotificationChannel() {\n mNotificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >=\n android.os.Build.VERSION_CODES.O) {\n\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel\n (PRIMARY_CHANNEL_ID,\n \"Stand up notification\",\n NotificationManager.IMPORTANCE_HIGH);\n\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Notifies every 15 minutes to \" +\n \"stand up and walk\");\n mNotificationManager.createNotificationChannel(notificationChannel);\n }\n }",
"private void createNotificationChannel() {\n // Create the NotificationChannel, but only on API 26+ because\n // the NotificationChannel class is new and not in the support library\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Inwentaryzacja\";\n String description = \"Powiadomienia\";\n int importance = NotificationManager.IMPORTANCE_LOW; // low importance - no sound\n NotificationChannel channel = new NotificationChannel(C.CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"1\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"public void createChannels() {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID,\n CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT);\n\n getManager().createNotificationChannel(channel);\n }\n\n }",
"public void createNotificationChannel() {\n weatherNotificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >=\n android.os.Build.VERSION_CODES.O) {\n\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel\n (PRIMARY_CHANNEL_ID,\n \"Weather change.\",\n NotificationManager.IMPORTANCE_HIGH);\n\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription\n (\"Conditions have are below threshold\");\n weatherNotificationManager.createNotificationChannel(notificationChannel);\n\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Channel 1\";\n String description = \"For testing\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n CharSequence name = \"DailyReminderChannel\";\n String desc = \"Channel for daily reminders\";\n NotificationChannel channel = new NotificationChannel(\"dailyReminders\", name, NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(desc);\n\n NotificationManager manager = getActivity().getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel);\n }\n }",
"public void testNewChannelAppears() {\n final TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);\n //first time load\n UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString(\"IU-95.627\"), UpdatesInfoXppParserTest.InfoReader.read(\"idea-newChannel.xml\"), settings);\n\n\n final CheckForUpdateResult result = strategy.checkForUpdates();\n Assert.assertEquals(UpdateStrategy.State.LOADED, result.getState());\n final BuildInfo update = result.getNewBuildInSelectedChannel();\n Assert.assertNull(update);\n\n final UpdateChannel newChannel = result.getChannelToPropose();\n Assert.assertNotNull(newChannel);\n Assert.assertEquals(\"IDEA10EAP\", newChannel.getId());\n Assert.assertEquals(\"IntelliJ IDEA X EAP\", newChannel.getName());\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"channel_name\";\n String description =\"channel_description\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"1\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Tracker\";\n String description = getString(R.string.app_name);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"ReminderChannel\";\n String description = \"Hello channel\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"notifyAnkit\", name, importance);\n channel.setDescription(description);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"EventChannel create(Context context);",
"private void createNotificationChannel() {\n mNotificationManager =\r\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n\r\n // Notification channels are only available in OREO and higher.\r\n // So, add a check on SDK version.\r\n if (android.os.Build.VERSION.SDK_INT >=\r\n android.os.Build.VERSION_CODES.O) {\r\n\r\n // Create the NotificationChannel with all the parameters.\r\n NotificationChannel notificationChannel = new NotificationChannel\r\n (PRIMARY_CHANNEL_ID,\r\n \"Stand up notification\",\r\n NotificationManager.IMPORTANCE_HIGH);\r\n\r\n notificationChannel.enableLights(true);\r\n notificationChannel.setLightColor(Color.RED);\r\n notificationChannel.enableVibration(true);\r\n notificationChannel.setDescription(\"Daje znać użytkownikowi \" +\r\n \"by wprowadził swoje wydatki\");\r\n mNotificationManager.createNotificationChannel(notificationChannel);\r\n }\r\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"channel1\";\n String description = \"First Notification Channel\";\n NotificationChannel channel = new NotificationChannel( \"ch1\", name, NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel(){\n // Create the NotificationChannel, but only on API 26+ because\n // the NotificationChannel class is new and not in the support library\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n Log.v(\"notification_channel \", \"true\");\n CharSequence name = \"channel_name2\";\n String description = \"channel_description2\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"channel_id2\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"hello\";\n String description = \"getString(R.string.channel_description)\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"CHANNEL_ID\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n\n // crate a channel with high priority\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID_1, name, importance);\n\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n\n// // Create an Intent for the activity you want to start\n// Intent resultIntent = new Intent(this, MainActivity.class);\n// // Create the TaskStackBuilder and add the intent, which inflates the back stack\n// TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n// stackBuilder.addNextIntentWithParentStack(resultIntent);\n// // Get the PendingIntent containing the entire back stack\n// PendingIntent resultPendingIntent =\n// stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n }\n\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n// CharSequence name = getString(R.string.channel_name);\n// String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"myChannelId\", \"channelName\", importance);\n channel.setDescription(\"this is channel myChannelId\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getActivity().getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"31\", \"test\", importance);\n channel.setDescription(\"hihi\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@JsonCreator\n ChannelImpl(@JsonProperty(\"id\") final String id, @JsonProperty(\"version\") final Long version,\n @JsonProperty(\"createdAt\") final java.time.ZonedDateTime createdAt,\n @JsonProperty(\"lastModifiedAt\") final java.time.ZonedDateTime lastModifiedAt,\n @JsonProperty(\"lastModifiedBy\") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy,\n @JsonProperty(\"createdBy\") final com.commercetools.api.models.common.CreatedBy createdBy,\n @JsonProperty(\"key\") final String key,\n @JsonProperty(\"roles\") final java.util.List<com.commercetools.api.models.channel.ChannelRoleEnum> roles,\n @JsonProperty(\"name\") final com.commercetools.api.models.common.LocalizedString name,\n @JsonProperty(\"description\") final com.commercetools.api.models.common.LocalizedString description,\n @JsonProperty(\"address\") final com.commercetools.api.models.common.Address address,\n @JsonProperty(\"reviewRatingStatistics\") final com.commercetools.api.models.review.ReviewRatingStatistics reviewRatingStatistics,\n @JsonProperty(\"custom\") final com.commercetools.api.models.type.CustomFields custom,\n @JsonProperty(\"geoLocation\") final com.commercetools.api.models.common.GeoJson geoLocation) {\n this.id = id;\n this.version = version;\n this.createdAt = createdAt;\n this.lastModifiedAt = lastModifiedAt;\n this.lastModifiedBy = lastModifiedBy;\n this.createdBy = createdBy;\n this.key = key;\n this.roles = roles;\n this.name = name;\n this.description = description;\n this.address = address;\n this.reviewRatingStatistics = reviewRatingStatistics;\n this.custom = custom;\n this.geoLocation = geoLocation;\n }",
"private void createStatusNotificationChannel(){\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n statusChannel = new NotificationChannel(\"2\",\"Status\",NotificationManager.IMPORTANCE_DEFAULT);\n statusChannel.setDescription(\"This is a status notification channel\");\n\n NotificationManager notificationManager = ctx.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(statusChannel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"push\";//getString(R.string.channel_name);\n String description = \"pushnotif\";//getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"CHANNEL_ID\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"Update withSource(EventChannelSource source);",
"public void testNewChannelAndNewBuildAppear() {\n final TestUpdateSettings settings = new TestUpdateSettings(ChannelStatus.EAP);\n //first time load\n UpdateStrategy strategy = new UpdateStrategy(9, BuildNumber.fromString(\"IU-95.429\"), UpdatesInfoXppParserTest.InfoReader.read(\"idea-newChannel.xml\"), settings);\n\n final CheckForUpdateResult result = strategy.checkForUpdates();\n Assert.assertEquals(UpdateStrategy.State.LOADED, result.getState());\n final BuildInfo update = result.getNewBuildInSelectedChannel();\n Assert.assertNotNull(update);\n Assert.assertEquals(\"95.627\", update.getNumber().toString());\n\n final UpdateChannel newChannel = result.getChannelToPropose();\n Assert.assertNotNull(newChannel);\n Assert.assertEquals(\"IDEA10EAP\", newChannel.getId());\n Assert.assertEquals(\"IntelliJ IDEA X EAP\", newChannel.getName());\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = MyShardPrefernces.myNotificationChannelName;\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(MyShardPrefernces.myNoficataionChannelID, name, importance);\n channel.setDescription(\"Notifications for alert Messenging\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"protected Channel createChannel() throws IOException, TimeoutException, NoSuchAlgorithmException {\n LOGGER.debug(\"Creating channel\");\n Channel channel = connectionProducer.getConnection(config).createChannel();\n LOGGER.debug(\"Created channel\");\n return channel;\n }",
"public interface Channels {\n \n public void createChannel();\n\n}",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n if(status.connection_status == enums.connection_status.connected)\n {\n CharSequence name = \"Sample VPN\";\n String description = \"VPN notification\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = home_model.getInstance().getHomeInstance().getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }\n }",
"static public void createNotificationChannel(Context ctx) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = ctx.getString(R.string.channel_name);\n String description = ctx.getString(R.string.channel_description);\n String CHANNEL_ID = ctx.getString(R.string.channel_id);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = ctx.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"static private void createNotificationChannel(Context context) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"lw_notification_channel\";\n String description = \"lw_notification_channel_desc\";\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(Constants.WEATHER_NOTIFICATION_CHANNEL, name, importance);\n channel.setDescription(description);\n\n // Register Notification channel\n NotificationManager notificationManager = (NotificationManager)\n context.getSystemService(Context.NOTIFICATION_SERVICE);\n if (notificationManager != null) {\n notificationManager.createNotificationChannel(channel);\n }\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Test\";\n String description = \"Test noti\";\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(\"Vuongpro1\", name, importance);\n channel.setVibrationPattern(new long[]{300, 300, 300});\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"public void putChannel(NotificationsChannel notiChannel) throws Exception;",
"public void createNotificationChannel() {\n mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel(PRIMARY_CHANNEL_ID,\"Log the game!\", NotificationManager.IMPORTANCE_HIGH);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Reminder to log your game on Friday's at 3:05 pm\");\n mNotificationManager.createNotificationChannel(notificationChannel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"NOTIFICATION\";\n String description = \"NOTIFICATION\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = (NotificationManager)getSystemService(NotificationManager.class);\n\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel(Context context) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = context.getString(R.string.channel_name);\n String description = context.getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = context.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"Update createUpdate();",
"private static void createNotificationChannel(Context context) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = context.getString(R.string.channel_name);\n String description = context.getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = context.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"public abstract AbstractDataChannel createDataChannel(int channelId);",
"private void createNotificationChannels() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel1 = new NotificationChannel(CHANNEL_REMINDER_ID, \"Reminder Channel\",NotificationManager.IMPORTANCE_HIGH);\n channel1.setDescription(\"Reminder to drink water\");\n\n NotificationManager manager = getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel1);\n\n\n }\n }",
"public interface ChannelManager {\n int createChannel(String channel, long ttlInSeconds);\n int publishToChannel(String channel, String msg);\n}",
"public void CrearNotificacionChannel(){\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n CharSequence name = \"Notificacion name\";\n NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_DEFAULT);\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(notificationChannel);\n }\n }",
"@RequiresApi(api = Build.VERSION_CODES.O)\n private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.notification);\n String description =getString(R.string.notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"lemubitA\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@TargetApi(Build.VERSION_CODES.O)\n private void createNotificationChannel() {\n CharSequence name = getString(R.string.appName);\n String description = getString(R.string.appName);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(name.toString(), name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }",
"public Update() {\n super(OcNotify.NAMESPACE, \"update\");\n }",
"Channel channel() {\n return channel;\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\r\n CharSequence name = \"Picture upload\";\r\n String description =\"PRIKACENA SLIKA\";\r\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\r\n NotificationChannel channel = new NotificationChannel(\"slika1\", name, importance);\r\n channel.setDescription(description);\r\n // Register the channel with the system; you can't change the importance\r\n // or other notification behaviors after this\r\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\r\n notificationManager.createNotificationChannel(channel);\r\n }\r\n }",
"private void sendUpdateMessage() {\n Hyperium.INSTANCE.getHandlers().getGeneralChatHandler().sendMessage(\n \"A new version of Particle Addon is out! Get it at https://api.chachy.co.uk/download/ParticleAddon/\" + ChachyMod.INSTANCE.getVersion(() -> \"ParticleAddon\"));\n }",
"public native boolean createChannel(String appId, String channelKey, String name, int uid, RecordingConfig config);",
"void setChannel(EzyChannel channel);",
"public void createNotificationChannels(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n NotificationChannel notificationChannel = new NotificationChannel(\n CHANNEL_1_ID, \"Channel 1\", NotificationManager.IMPORTANCE_HIGH\n );\n notificationChannel.enableLights(true);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Alarm Message\");\n\n NotificationManager manager = getSystemService(NotificationManager.class);\n manager.createNotificationChannel(notificationChannel);\n }\n\n }",
"Update withDestination(EventChannelDestination destination);",
"@PreAuthorize(\"hasRole('superman')\")\n\tpublic abstract boolean updateChannel(Channel channel);",
"Update withFilter(EventChannelFilter filter);",
"private void createChannelAccess(Nx100Type config) throws FactoryException {\n \t\ttry {\n \t\t\tjobChannel = channelManager.createChannel(config.getJOB().getPv(), false);\n \t\t\tstartChannel = channelManager.createChannel(config.getSTART().getPv(), false);\n \t\t\tholdChannel = channelManager.createChannel(config.getHOLD().getPv(), false);\n \t\t\tsvonChannel = channelManager.createChannel(config.getSVON().getPv(), false);\n \t\t\terrChannel = channelManager.createChannel(config.getERR().getPv(), errls, false);\n \n \t\t\t// acknowledge that creation phase is completed\n \t\t\tchannelManager.creationPhaseCompleted();\n \t\t} catch (Throwable th) {\n \t\t\tthrow new FactoryException(\"failed to create all channels\", th);\n \t\t}\n \t}",
"public void SetChannel(int channel);",
"public Builder setChannel(\n int index, io.grpc.channelz.v1.Channel value) {\n if (channelBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureChannelIsMutable();\n channel_.set(index, value);\n onChanged();\n } else {\n channelBuilder_.setMessage(index, value);\n }\n return this;\n }",
"public ChannelDesc(SocketChannel channel) {\n this.channel = channel;\n }",
"private void updateChannelObject() {\n int i = channelSelect.getSelectedIndex();\n Channel c = channelList.get(i);\n \n double a = Double.valueOf(ampBox.getText()) ;\n double d = Double.valueOf(durBox.getText());\n double f = Double.valueOf(freqBox.getText());\n double o = Double.valueOf(owBox.getText());\n \n c.updateSettings(a, d, f, o);\n }",
"KafkaChannel buildChannel(String id, SelectionKey key, int maxReceiveSize) throws KafkaException;",
"public Builder addChannel(\n int index, io.grpc.channelz.v1.Channel value) {\n if (channelBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureChannelIsMutable();\n channel_.add(index, value);\n onChanged();\n } else {\n channelBuilder_.addMessage(index, value);\n }\n return this;\n }",
"WithCreate withDestination(EventChannelDestination destination);",
"void addChannel(IChannel channel);",
"WithCreate withSource(EventChannelSource source);",
"public void setChannel(Channel channel)\n {\n this.channel = channel;\n }",
"EzyChannel getChannel();",
"public io.grpc.channelz.v1.Channel.Builder addChannelBuilder() {\n return getChannelFieldBuilder().addBuilder(\n io.grpc.channelz.v1.Channel.getDefaultInstance());\n }",
"public MessageChannel createMessageChannel\n (MessageChannel rawChannel) {\n synchronized(clientTransactions) {\n // New client transaction to return\n SIPTransaction\treturnChannel =\n createClientTransaction(rawChannel);\n clientTransactions.add(returnChannel);\n ((SIPClientTransaction)returnChannel).setViaPort\n (rawChannel.getViaPort());\n ((SIPClientTransaction)returnChannel).setViaHost\n (rawChannel.getHost());\n return returnChannel;\n }\n }",
"public interface ServerTextChannel extends TextableRegularServerChannel, ServerTextChannelAttachableListenerManager {\n\n /**\n * Gets the default auto archive duration for threads that will be created in this channel.\n *\n * @return The default auto archive duration for this channel.\n */\n int getDefaultAutoArchiveDuration();\n\n /**\n * Gets the topic of the channel.\n *\n * @return The topic of the channel.\n */\n String getTopic();\n\n /**\n * Creates an updater for this channel.\n *\n * @return An updater for this channel.\n */\n default ServerTextChannelUpdater createUpdater() {\n return new ServerTextChannelUpdater(this);\n }\n\n /**\n * Updates the topic of the channel.\n *\n * <p>If you want to update several settings at once, it's recommended to use the\n * {@link ServerTextChannelUpdater} from {@link #createUpdater()} which provides a better performance!\n *\n * @param topic The new topic of the channel.\n * @return A future to check if the update was successful.\n */\n default CompletableFuture<Void> updateTopic(String topic) {\n return createUpdater().setTopic(topic).update();\n }\n\n @Override\n default Optional<ServerTextChannel> getCurrentCachedInstance() {\n return getApi().getServerById(getServer().getId()).flatMap(server -> server.getTextChannelById(getId()));\n }\n\n @Override\n default CompletableFuture<ServerTextChannel> getLatestInstance() {\n Optional<ServerTextChannel> currentCachedInstance = getCurrentCachedInstance();\n if (currentCachedInstance.isPresent()) {\n return CompletableFuture.completedFuture(currentCachedInstance.get());\n } else {\n CompletableFuture<ServerTextChannel> result = new CompletableFuture<>();\n result.completeExceptionally(new NoSuchElementException());\n return result;\n }\n }\n\n /**\n * Creates a thread for a message in this ServerTextChannel.\n *\n * @param message The message to create the thread for.\n * @param name The Thread name.\n * @param autoArchiveDuration Duration in minutes to automatically archive the thread after recent activity.\n * @return The created ServerThreadChannel.\n */\n default CompletableFuture<ServerThreadChannel> createThreadForMessage(Message message, String name,\n AutoArchiveDuration autoArchiveDuration) {\n return createThreadForMessage(message, name, autoArchiveDuration.asInt());\n }\n\n /**\n * Creates a thread for a message in this ServerTextChannel.\n *\n * @param message The message to create the thread for.\n * @param name The Thread name.\n * @param autoArchiveDuration Duration in minutes to automatically archive the thread after recent activity.\n * @return The created ServerThreadChannel.\n */\n default CompletableFuture<ServerThreadChannel> createThreadForMessage(Message message, String name,\n Integer autoArchiveDuration) {\n return new ServerThreadChannelBuilder(message, name).setAutoArchiveDuration(autoArchiveDuration).create();\n }\n\n /**\n * Creates a thread which is not related to a message.\n *\n * <p>Creating a private thread requires the server to be boosted.\n * The 3 day and 7 day archive durations require the server to be boosted.\n * The server features will indicate if that is possible for the server.\n *\n * @param channelType A ChannelType for a thread.\n * @param name The thread name.\n * @param autoArchiveDuration Duration in minutes to automatically archive the thread after recent activity.\n * @return The created ServerThreadChannel.\n */\n default CompletableFuture<ServerThreadChannel> createThread(ChannelType channelType, String name,\n Integer autoArchiveDuration) {\n return createThread(channelType, name, autoArchiveDuration, null);\n }\n\n /**\n * Creates a thread which is not related to a message.\n *\n * <p>Creating a private thread requires the server to be boosted.\n * The 3 day and 7 day archive durations require the server to be boosted.\n * The server features will indicate if that is possible for the server.\n *\n * @param channelType A ChannelType for a thread.\n * @param name The thread name.\n * @param autoArchiveDuration Duration in minutes to automatically archive the thread after recent activity.\n * @return The created ServerThreadChannel.\n */\n default CompletableFuture<ServerThreadChannel> createThread(ChannelType channelType, String name,\n AutoArchiveDuration autoArchiveDuration) {\n return createThread(channelType, name, autoArchiveDuration.asInt(), null);\n }\n\n /**\n * Creates a thread which is not related to a message.\n *\n * <p>Creating a private thread requires the server to be boosted.\n * The 3 day and 7 day archive durations require the server to be boosted.\n * The server features will indicate if that is possible for the server.\n *\n * @param channelType A ChannelType for a thread.\n * @param name The thread name.\n * @param autoArchiveDuration Duration in minutes to automatically archive the thread after recent activity.\n * @param inviteable Whether non-moderators can add other non-moderators to a thread;\n * only available when creating a private thread.\n * @return The created ServerThreadChannel.\n */\n default CompletableFuture<ServerThreadChannel> createThread(ChannelType channelType, String name,\n Integer autoArchiveDuration,\n Boolean inviteable) {\n return new ServerThreadChannelBuilder(this, channelType, name)\n .setAutoArchiveDuration(autoArchiveDuration)\n .setInvitableFlag(inviteable).create();\n }\n\n /**\n * Creates a thread which is not related to a message.\n *\n * <p>Creating a private thread requires the server to be boosted.\n * The 3 day and 7 day archive durations require the server to be boosted.\n * The server features will indicate if that is possible for the server.\n *\n * @param channelType A ChannelType for a thread.\n * @param name The thread name.\n * @param autoArchiveDuration Duration in minutes to automatically archive the thread after recent activity.\n * @param inviteable Whether non-moderators can add other non-moderators to a thread;\n * only available when creating a private thread.\n * @return The created ServerThreadChannel.\n */\n default CompletableFuture<ServerThreadChannel> createThread(ChannelType channelType, String name,\n AutoArchiveDuration autoArchiveDuration,\n Boolean inviteable) {\n return createThread(channelType, name, autoArchiveDuration.asInt(), inviteable);\n }\n\n /**\n * Gets the public archived threads.\n *\n * <p>Returns archived threads in the channel that are public.\n * When called on a SERVER_TEXT_CHANNEL, returns threads of type SERVER_PUBLIC_THREAD.\n * When called on a SERVER_NEWS_CHANNEL returns threads of type SERVER_NEWS_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires the READ_MESSAGE_HISTORY permission.\n *\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getPublicArchivedThreads() {\n return getPublicArchivedThreads(null, null);\n }\n\n /**\n * Gets the public archived threads.\n *\n * <p>Returns archived threads in the channel that are public.\n * When called on a SERVER_TEXT_CHANNEL, returns threads of type SERVER_PUBLIC_THREAD.\n * When called on a SERVER_NEWS_CHANNEL returns threads of type SERVER_NEWS_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires the READ_MESSAGE_HISTORY permission.\n *\n * @param before Get public archived threads before the thread with this id.\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getPublicArchivedThreads(long before) {\n return getPublicArchivedThreads(before, null);\n }\n\n /**\n * Gets the public archived threads.\n *\n * <p>Returns archived threads in the channel that are public.\n * When called on a SERVER_TEXT_CHANNEL, returns threads of type SERVER_PUBLIC_THREAD.\n * When called on a SERVER_NEWS_CHANNEL returns threads of type SERVER_NEWS_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires the READ_MESSAGE_HISTORY permission.\n *\n * @param limit The maximum amount of public archived threads.\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getPublicArchivedThreads(int limit) {\n return getPublicArchivedThreads(null, limit);\n }\n\n /**\n * Gets the public archived threads.\n *\n * <p>Returns archived threads in the channel that are public.\n * When called on a SERVER_TEXT_CHANNEL, returns threads of type SERVER_PUBLIC_THREAD.\n * When called on a SERVER_NEWS_CHANNEL returns threads of type SERVER_NEWS_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires the READ_MESSAGE_HISTORY permission.\n *\n * @param before Get public archived threads before the thread with this id.\n * @param limit The maximum amount of public archived threads.\n * @return The ArchivedThreads.\n */\n CompletableFuture<ArchivedThreads> getPublicArchivedThreads(Long before, Integer limit);\n\n /**\n * Gets the private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.\n *\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getPrivateArchivedThreads() {\n return getPrivateArchivedThreads(null, null);\n }\n\n /**\n * Gets the private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.\n *\n * @param before Get private archived threads before the thread with this id.\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getPrivateArchivedThreads(long before) {\n return getPrivateArchivedThreads(before, null);\n }\n\n /**\n * Gets the private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.\n *\n * @param limit The maximum amount of private archived threads.\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getPrivateArchivedThreads(int limit) {\n return getPrivateArchivedThreads(null, limit);\n }\n\n /**\n * Gets the private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD.\n * Threads are ordered by archive_timestamp, in descending order.\n * Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.\n *\n * @param before Get private archived threads before the thread with this id.\n * @param limit The maximum amount of private archived threads.\n * @return The ArchivedThreads.\n */\n CompletableFuture<ArchivedThreads> getPrivateArchivedThreads(Long before, Integer limit);\n\n /**\n * Gets the joined private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD, and the user has joined.\n *\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getJoinedPrivateArchivedThreads() {\n return getJoinedPrivateArchivedThreads(null, null);\n }\n\n /**\n * Gets the joined private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD, and the user has joined.\n *\n * @param before Get the joined private archived threads before the thread with this id.\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getJoinedPrivateArchivedThreads(long before) {\n return getJoinedPrivateArchivedThreads(before, null);\n }\n\n /**\n * Gets the joined private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD, and the user has joined.\n *\n * @param limit The maximum amount of private archived threads.\n * @return The ArchivedThreads.\n */\n default CompletableFuture<ArchivedThreads> getJoinedPrivateArchivedThreads(int limit) {\n return getJoinedPrivateArchivedThreads(null, limit);\n }\n\n /**\n * Gets the joined private archived threads.\n *\n * <p>Returns archived threads in the channel that are of type SERVER_PRIVATE_THREAD, and the user has joined.\n *\n * @param before Get the joined private archived threads before the thread with this id.\n * @param limit The maximum amount of private archived threads.\n * @return The ArchivedThreads.\n */\n CompletableFuture<ArchivedThreads> getJoinedPrivateArchivedThreads(Long before, Integer limit);\n}",
"interface Update\n extends UpdateStages.WithSource,\n UpdateStages.WithDestination,\n UpdateStages.WithExpirationTimeIfNotActivatedUtc,\n UpdateStages.WithFilter,\n UpdateStages.WithPartnerTopicFriendlyDescription {\n /**\n * Executes the update request.\n *\n * @return the updated resource.\n */\n EventChannel apply();\n\n /**\n * Executes the update request.\n *\n * @param context The context to associate with this operation.\n * @return the updated resource.\n */\n EventChannel apply(Context context);\n }",
"public Channel getChannel() {\n return channel;\n }",
"@Override\n public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) {\n Channel channel = ctx.getChannel();\n //session.setAttachment(new Player(session));\n Client client = new Client(channel);\n channel.setAttachment(client);\n engine.addClient(client);\n }",
"public void updateContestChannel(ContestChannel arg0) throws ContestManagementException {\r\n }",
"Response createChannelWithPayload(@NonNull ChannelRegistrationPayload channelPayload) {\n String payload = channelPayload.toJsonValue().toString();\n Logger.verbose(\"ChannelApiClient - Creating channel with payload: \" + payload);\n return requestWithPayload(creationURL, \"POST\", payload);\n }",
"public void initChannel() {\n //or channelFactory\n bootstrap().channel(NioServerSocketChannel.class);\n }",
"public interface ChannelFactory<T extends Channel> {\n T newChannel();\n}",
"public void createNotificationChannel(Activity activity) {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\n CharSequence name = \"notifier\";\n String description = \"notifies the firebaseUser about app activities\";\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = activity.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@Override\n protected void initChannel (SocketChannel ch) throws Exception {\n // can utilize channel to push message to different client since one channel correspond to one client\n System.out.println(\"client socket channel hashcode = \" + ch.hashCode());\n ch.pipeline().addLast(new NettyServerHandler());\n }",
"private void openChannel() {\n database.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.exists()) {\n String channelUrl = (String) dataSnapshot.child(\"channelUrl\").getValue();\n joinChannel(channelUrl);\n } else {\n createChannel();\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n }",
"public Channel() {\n this(DSL.name(\"channel\"), null);\n }"
] | [
"0.6501752",
"0.63789517",
"0.6345177",
"0.623832",
"0.62058765",
"0.6053249",
"0.6052721",
"0.5978628",
"0.59387046",
"0.5891553",
"0.58827066",
"0.58572096",
"0.5842459",
"0.5842459",
"0.58342314",
"0.5832116",
"0.5832116",
"0.5831166",
"0.5828897",
"0.5822047",
"0.5804375",
"0.5804283",
"0.5798807",
"0.5797007",
"0.5796235",
"0.5786708",
"0.5782253",
"0.5774739",
"0.57616574",
"0.5754292",
"0.5728339",
"0.57220006",
"0.57165277",
"0.571637",
"0.57146895",
"0.56887996",
"0.568576",
"0.5684096",
"0.56689703",
"0.5664557",
"0.5662144",
"0.56349593",
"0.56318307",
"0.56253856",
"0.5598136",
"0.5597341",
"0.5593928",
"0.55818474",
"0.55721",
"0.55575895",
"0.55241406",
"0.5523997",
"0.5519371",
"0.54836786",
"0.5476415",
"0.54689664",
"0.5436825",
"0.5412779",
"0.539435",
"0.5386919",
"0.5373694",
"0.5365107",
"0.53566694",
"0.53546923",
"0.5338896",
"0.5316481",
"0.53158635",
"0.5301341",
"0.52716523",
"0.52673024",
"0.5262942",
"0.52399427",
"0.52264833",
"0.522388",
"0.521907",
"0.5212125",
"0.5204253",
"0.5171407",
"0.51404256",
"0.5138725",
"0.5132427",
"0.51293033",
"0.5122053",
"0.5115478",
"0.5089655",
"0.5068979",
"0.50587654",
"0.5053991",
"0.50437176",
"0.5033963",
"0.5025547",
"0.50253725",
"0.5018408",
"0.50098217",
"0.49979696",
"0.4996019",
"0.49936983",
"0.4978585",
"0.4970122",
"0.49617088",
"0.49611673"
] | 0.0 | -1 |
Reads a line of input data. | public void readLine(String line) {
if (request == null) {
switch (type) {
case JAGGRAB:
readJaggrabPath(line);
break;
case HTTP:
readHttpPath(line);
break;
}
} else {
if (type == Type.HTTP) {
if (line.length() == 0) {
serve();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean read(String line);",
"private void readLine() throws IOException {\n line = reader.readLine(); // null at the end of the source\n currentPos = -1;\n\n if (line != null) {\n lineNum++;\n }\n\n if (line != null) {\n sendMessage(new Message(MessageType.SOURCE_LINE, new Object[]{lineNum, line}));\n }\n }",
"public static String readLine()\n\t{\n\t\tif (bJunit == true)\n\t\t{\n\t\t\tsLastLine = sJunitInput;\n\t\t\twriteLine(\"JUnit INPUT: \" + sJunitInput);\n\t\t\treturn sLastLine;\n\t\t}\n\t\n\t\ttry {\n\t\t\tsLastLine = br.readLine();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error reading from STDIN\");\n\t\t}\n\t\t\n\t\treturn sLastLine;\n\t\t\n\t}",
"String readLine() throws IOException\n\t{\n\t\tString line = null;\n\t\tif (haveStreams())\n\t\t\tline = m_in.readLine();\n\t\telse\n\t\t\tline = keyboardReadLine();\n\n\t\tsetCurrentLine(line);\n\t\treturn line;\n\t}",
"public abstract String readLine() throws IOException, InterruptedException;",
"public String getLine()\n\t{\n\t\ttry\n\t\t{\n\t\t\tline = reader.readLine();\n\t\t} catch (IOException ioe)\n\t\t{\n\t\t\t//\n\t\t}\n\n\t\treturn line;\n\t}",
"public static String readInput() {\r\n return SCANNER.nextLine();\r\n }",
"private String readLine() {\r\n\t\ttry {\r\n\t\t\treturn input.readLine();\r\n\t\t} catch (IOException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"private static String readLine() {\r\n String input=\"\";\r\n try {\r\n input = in.readLine();\r\n } catch (IOException e) {\r\n System.out.println(e.getMessage());\r\n }\r\n return input;\r\n }",
"abstract public String readLine() throws TerminalException;",
"protected String readLine()\n { try { if (stdin!=null) return stdin.readLine(); } catch (IOException e) {}\n return null;\n }",
"public String readLine(){\n\t\tString line;\n\t\ttry{\n\t\t\tline=scanner.nextLine();\n\t\t}catch (NoSuchElementException e){\n\t\t\tline=null;\n\t\t}\n\t\treturn line;\n\t}",
"private String readLine(ByteBuf in) {\n\n int bytesToRead;\n byte[] data = null;\n int bytesToSkip;\n\n if ((bytesToRead = in.bytesBefore((byte) LINE_FEED_CHAR)) > -1) {\n // Found the line feed.\n bytesToSkip = 1;\n\n // Check (and ignore) optional carriage return.\n if (bytesToRead > 0 && in.getByte(bytesToRead - 1) == CARRIAGE_RETURN_CHAR) {\n bytesToSkip++;\n bytesToRead--;\n }\n\n // Check that the bytes we're about to read will not exceed the\n // max frame size.\n checkTooLongFrame(bytesToRead);\n\n data = new byte[bytesToRead];\n in.readBytes(data);\n in.skipBytes(bytesToSkip);\n\n // Count the bytes read.\n currentDecodedByteCount += bytesToRead;\n }\n else {\n // No line feed. Make sure we're not buffering more than the max\n // frame size.\n checkTooLongFrame(in.readableBytes());\n }\n\n if (data != null) {\n return new String(data, StompConstants.UTF_8);\n }\n else {\n return null;\n }\n }",
"public int readInt() {\n return Integer.parseInt(readNextLine());\n }",
"@Override\n\tpublic String readLine() throws IOException {\n\t\tint length = readInt();\n\t\twriteInt(length);\n\t\tbyte[] data = awaitNextPacket(new byte[length]);\n\t\treturn new String(data);\n\t}",
"public String readLine() throws IOException, ReadTimeoutException {\n\t\ttry {\n\t\t\twaitForAvailable();\n\t\t\tlineBuffer[0] = (byte) inputStream.read();\n\t\t\twaitForAvailable();\n\t\t\tlineBuffer[1] = (byte) inputStream.read();\n\t\t\tlineLength = 2;\n\t\t\twhile (lineBuffer[lineLength - 2] != (byte) 13\n\t\t\t\t|| lineBuffer[lineLength - 1] != (byte) 10) {\n\t\t\t\twaitForAvailable();\n\t\t\t\tlineBuffer[lineLength] = (byte) inputStream.read();\n\t\t\t\tlineLength++;\n\t\t\t}\n\t\t\treturn new String(lineBuffer, 0, lineLength - 2);\n\t\t} catch (ArrayIndexOutOfBoundsException aioobe) {\n\t\t\tthrow new IOException(\"Line too long.\");\n\t\t}\n\t}",
"private String readLine() {\n\t\ttry {\n\t\t\treturn reader.nextLine();\t\n\t\t} catch (NoSuchElementException e) {\n\t\t\treturn null;\n\t\t}\n\t}",
"public static String readNextLine() {\n return sc.nextLine();\n }",
"public abstract T parseLine(String inputLine);",
"public String readLine() throws ShellIOException;",
"public String readLine() {\n\n String temp = null;\n\n try\n {\n assert this.isValid();\t\t\t//Test that we can read the file\n temp = br.readLine();\t\t\t//Read the next line and store it as temp\n }\n\n\t\t//Catch possible exceptions\n catch(java.io.IOException e) {\n System.out.println(\"Error reading file: \" + e );\n }\n\n return temp;\n }",
"@Override\n\tpublic String read() \n\t{\n\t\tString res = \"\";\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tif (scan.hasNextLine())\n\t\t\tres = scan.nextLine();\n\t\t\n\t\treturn res;\n\t\t\n\n\t}",
"public void read() {\n try {\n pw = new PrintWriter(System.out, true);\n br = new BufferedReader(new InputStreamReader(System.in));\n input = br.readLine();\n while (input != null) {\n CM.processCommand(input, pw, true);\n input = br.readLine();\n }\n } catch (IOException ioe) {\n pw.println(\"ERROR: Problem with reading user input.\");\n } finally {\n try {\n br.close();\n } catch (IOException ioe) {\n pw.println(\"ERROR: Buffer DNE\");\n }\n }\n }",
"static String read ()\r\n \t{\r\n \t\tString sinput;\r\n \r\n \t\ttry\r\n \t\t{\r\n \t\t\tsinput = br.readLine();\r\n \t\t}\r\n \t\tcatch (IOException e)\r\n \t\t{\r\n \t\t\tErrorLog.addError(\"Input exception occured in command line interface!\");\r\n \t\t\treturn null; //Menu will exit when fed a null\r\n \t\t}\r\n \t\treturn sinput;\r\n \t}",
"public abstract void read(DataInput input) throws IOException;",
"public synchronized String readLineFromFile(){\n\t\tString line = null;\n\t\t\n\t\ttry{\n\n\t\t\tif((line = bufferedInput.readLine()) != null){\n\t\t\t\treturn line;\n\t\t\t}\n\t\t}\n\t\tcatch(NullPointerException ex) {\n \t\tSystem.err.println(\"File is Blank\");\t\t \n \t\tSystem.exit(1); \n\t\t}\n\t\tcatch(IOException ex) {\n System.err.println(\"Unable to read a line from file\");\t\t \n\t\t\tSystem.exit(1); \n }\n\n\t\treturn line;\n\t}",
"public String readLine() throws IOException {\n\t\t// Punt on this and use BufferedReader routines.\n\t\tBufferedReader d = new BufferedReader(new InputStreamReader(this));\n\t\treturn d.readLine();\n\t}",
"public int getLine();",
"public int getLine();",
"public int getLine();",
"String getLine();",
"@Override\n public String readLine() throws IOException {\n checkBuffer(-1);\n this.randomAccessFile.seek(this.fileOffset + this.bufferPointer.bufferOffset);\n String line = this.randomAccessFile.readLine();\n this.fileOffset = this.randomAccessFile.getFilePointer();\n this.bufferPointer.invalidate();\n return line;\n }",
"public static String readString() {\n return in.nextLine();\n }",
"public String getLine();",
"public static String readLine()\n {\n \tString ch=scanner.nextLine();\n \treturn ch;\n }",
"public abstract int getLine();",
"public abstract int getLine();",
"int getLine();",
"private void processInput() {\r\n\t\ttry {\r\n\t\t\thandleInput(readLine());\r\n\t\t} catch (WrongFormatException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public static String readUserInput() {\n return in.nextLine();\n }",
"axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }",
"private void readIntLine(String next) {\n Scanner read = new Scanner(next);\n if (read.hasNextInt()) {\n row = read.nextInt();\n column = read.nextInt();\n }\n }",
"public void read(DataInputStream in) throws IOException;",
"@Override\r\n\tpublic void read(DataInput in) throws IOException {\n\t\t\r\n\t}",
"@Override\n public int read() throws IOException {\n return input.read();\n }",
"@Override\n public String readLine() {\n try {\n return this.bufferedReader.readLine();\n } catch (IOException e) {\n return \"\";\n }\n }",
"public String nextLine()\n\t{\t\t\n\t\t\n\t\treturn this.getIn().nextLine();\n\t}",
"public abstract String inReadLine() throws JVMIOException;",
"String getLine (int line);",
"public void read(NetInput in)\r\n/* 35: */ throws IOException\r\n/* 36: */ {\r\n/* 37:35 */ this.entityId = in.readInt();\r\n/* 38:36 */ this.metadata = NetUtil.readEntityMetadata(in);\r\n/* 39: */ }",
"public String readLine() throws IOException\r\n\t{\r\n\t\treturn file.readLine();\r\n\t}",
"public int readInt(){\n\t\tif(sc.hasNextInt()){\n\t\t\treturn sc.nextInt();\n\t\t}\n\t\tsc.nextLine();\n\t\treturn -1;\n\t}",
"public static String readLine(String format, Object... args) throws IOException {\n\t\tif (System.console() != null) {\n\t\t\treturn System.console().readLine(format, args);\n\t\t}\n\t\tlogger.info(String.format(format, args));\n\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\t\treturn reader.readLine();\n\t}",
"public final int getLine()\n\t{\n\t\treturn address >>> 8 & 0x0F;\n\t}",
"public ClientInput readClientInput() throws IOException { //TODO blocking\n try {\n //Read a line from the input from client and check if the client is disconnected\n return new ClientInput(in.readLine());\n } catch (SocketException ex) {\n ex.printStackTrace();\n }\n return new ClientInput(in.readLine());\n }",
"public String readLine() {\n if(in.hasNextLine()) {\n return in.nextLine();\n } else {\n // remote host closed connection!\n cleanup();\n return null;\n }\n }",
"String getLine ();",
"public void parseInput(Scanner sc, String inputLine) {\n String[] input = inputLine.split(\",\");\n assert(input[0].equals(\"R\"));\n this.warehouseID = Integer.parseInt(input[1]);\n this.districtID = Integer.parseInt(input[2]);\n this.customerID = Integer.parseInt(input[3]);\n }",
"public String readLine() {\n BufferedReader input;\n String str = null;\n \n if (file == null || line < 0) {\n return null;\n }\n try {\n input = new BufferedReader(new FileReader(file));\n for (int i = 0; i < line; i++) {\n str = input.readLine();\n }\n input.close();\n } catch (IOException e) {\n return null;\n }\n return str;\n }",
"public abstract void readData(DataInput din) throws IOException;",
"public void inputFromStream(BufferedReader dis) throws IOException {\n String line = dis.readLine();\n setFile(line);\n int lines = Str.strToInt(dis.readLine());\n if (lines != 0) {\n lineNos = new int[lines];\n for (int i = 0; i < lineNos.length; ++i) {\n lineNos[i] = Str.strToInt(dis.readLine());\n }\n }\n }",
"static void readLine(String line) {\n if (line.equals(\"\")) {\n //boş satır varsa birşey yapma\n } else {\n String[] satır = line.split(\", \");\n long id = Long.parseLong(satır[0]);//id\n String a = satır[1]; //eventType\n String b = satır[2]; //EventName\n String c = satır[3]; // date\n String c2 = satır[4];\n boolean c22 = Boolean.parseBoolean(c2); //isAllDay?\n String d = satır[5];//time from\n String e = satır[6];//time to\n String f = satır[7];//color\n String g = satır[8];//location\n String h = satır[9];//description\n String j = satır[10];//reminder\n\n Agenda agenda = new Agenda(id, a, b, c, c22, d, e, f, g, h, j);\n data.add(agenda);\n addtoReminder(j, c);\n }\n }",
"abstract protected T getRecordFromLine(String line) throws DataImportException ;",
"public void readLine(String line) {\n\t\tif (line.length() < 32) {\n\t\t\twhile (line.length() < 32) {\n\t\t\t\tline += \"0\";\n\t\t\t}\n\t\t}\n\n\t\tint begin = 0;\n\t\tint end = 2;\n\n\t\t\n\t\tfor (int row = 0; row < 4; row++) {\n\t\t\tfor (int col = 0; col < 4; col++) {\n\t\t\t\t// int val = 0;\n\t\t\t\tString hexVal = line.substring(begin, end);\n\t\t\t\thexVal = \"0x\" + hexVal;\n\t\t\t\tchar val; \n\t\t\t\ttry {\n\t\t\t\t\tval = (char) Integer.decode(hexVal).intValue();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// System.out.println(\"Error: Key has non hex characters.\");\n\t\t\t\t\tthis.state = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.state[row][col] = val;\n\t\t\t\tbegin += 2;\n\t\t\t\tend += 2;\n\t\t\t}\n\t\t}\n\t}",
"public final int getLine() {\n/* 377 */ return this.bufline[this.bufpos];\n/* */ }",
"public int readInt() throws IOException {\n return in.readInt();\n }",
"private String readFromClient() throws IOException {\n final String request = inFromClient.readLine();\n return request;\n }",
"private String readNextLine() {\n StringBuilder sb = new StringBuilder();\n\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(stream));\n sb.append(br.readLine());\n } catch (IOException e) {\n e.fillInStackTrace();\n }\n\n return sb.toString();\n }",
"@Override\n public int read() throws IOException {\n int c;\n\n do {\n c = System.in.read();\n } while(c != -1 && (c == '\\n' || c == '\\r'));\n\n return c;\n }",
"public static void Input(){\n try{\n prepareReader();\n String linea=\"\";\n while((linea = br.readLine()) != null){\n System.out.println(linea);\n }\n br.close();\n System.out.println(\"-------------------------------------------------\");\n }catch (Exception e){\n System.err.println(\"Error al leer del buffer\");\n }\n }",
"public static int getLine() {\r\n\t\treturn rline;\r\n\t}",
"public synchronized void readInput() throws InterruptedException, IOException \n\t{\n\t\twhile (getDataSourceEOFlag())\n\t\t{\n\t\t\tcontent.set(incomingPipe.take());\n\t\t\t\n\t\t\t// Ensure thread-timing uniformity (a speed-limiter)\n\t\t\t//Thread.sleep(100);\n\t\t\t\n\t\t\tprocess();\n\t\t\t// Discard the text to free up memory.\n\t\t\tcontent.set(null);\n\t\t}\n\t}",
"public void readLine(String line){\n\t\tfields = line.split(\"\\\\s*,\\\\s*\");\n\t\tDate key = parseDate(fields[0]);\n\t\tif(key != null){\n\t\t\tDouble val = parseAverage(fields[6]);\t\t\n\t\t\tdja.put(key, val);\n\t\t}\n\t}",
"protected abstract DataTypes[] processLine(MutableCharArrayString line);",
"private String[] readLine( String line ) throws IOException {\n if ( StringUtils.isBlank( line ) ) {\n return null;\n }\n if ( line.startsWith( \"#\" ) ) {\n return null;\n }\n\n String[] fields = StringUtils.splitPreserveAllTokens( line, '\\t' );\n if ( fields.length < 2 ) {\n throw new IOException( \"Illegal format, expected at least 2 columns, got \" + fields.length );\n }\n return fields;\n\n }",
"public String getLine ()\n {\n return line;\n }",
"private static boolean readLine(BufferedInputStream is, MutableString read)\n throws IOException {\n read.length(0);\n int c = is.read();\n while((c!=-1)&&c!='\\n'&&c!='\\r') {\n read.append((char)c);\n c = is.read();\n }\n if(c==-1 && read.length()==0) {\n // EOF and none read; return false\n return false;\n }\n if(c=='\\n') {\n // consume LF following CR, if present\n is.mark(1);\n if(is.read()!='\\r') {\n is.reset();\n }\n }\n // a line (possibly blank) was read\n return true;\n }",
"@Override\n\tpublic String readLine() throws IOException {\n\t\tString line = super.readLine();\n\t\n\t\tif(line==null){\n\t\t\treturn null;\n\t\t}\t\n\t\tline = count+\" \"+line;\n\t\tcount++;\n\t\treturn line;\n\t}",
"public abstract T readDataFile(String fileLine);",
"String readInput() {\n Scanner scanner = new Scanner(System.in);\n return scanner.nextLine();\n }",
"public int getLine() {\r\n return line;\r\n }",
"public void readUserInput(){\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n try {\n String input = reader.readLine();\n while (!userValidation.validateUserInput(input)){\n input = reader.readLine();\n }\n elevatorController.configureNumberOfElevators(input);\n\n } catch (\n IOException e) {\n logger.error(e);\n }\n\n }",
"public void readQuestion()\n\t{\n\t\tnumLines = (int)numScan.nextDouble();\n\t\tquestion = stringScan.nextLine();\n\t}",
"private static int readLine(DataInputStream dis){\n\t\tint len = -1;\n\t\ttry{\n\t\t\tboolean end = false;\n\t\t\tString lineEnd = \"\\n\"; //assumes that the end of the line is marked with this\n\t\t\tbyte[] lineEndBytes = lineEnd.getBytes();\n\t\t\tbyte[] byteBuf = new byte[lineEndBytes.length];\n\t\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\t\twhile(!end){\n\t\t\t\tdis.read(byteBuf,0,lineEndBytes.length);\n\t\t\t\tbaos.write(byteBuf);\n\t\t\t\tString t = new String(byteBuf);\n\t\t\t\t//System.out.print(t); //uncomment if you want to see what the lines actually look like\n\t\t\t\tif(t.equals(lineEnd)) end=true;\n\t\t\t}\n\t\t\tString data = new String(baos.toByteArray());\n\t\t\tif(data.contains(\"Content-Length: \")){\n\t\t\t\tint index = data.indexOf(\"Content-Length: \") +\"Content-Length: \".length();\n\t\t\t\tif(index >= 0){\n\t\t\t\t\tlen = Integer.parseInt(data.substring(index, data.length() -2));\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\tSystem.err.println(\"Error Processing the data input Stream : \" +e.getMessage());\n\t\t\treturn -1;\n\t\t}\n\t\treturn len;\n\n\t}",
"void readInput() {\n\t\ttry {\n\t\t\tBufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\n\t\t\tString line = input.readLine();\n\t\t\tString [] numbers = line.split(\" \");\n\n\t\t\tlenA = Integer.parseInt(numbers[0]);\n\t\t\tlenB = Integer.parseInt(numbers[1]); \n\n\t\t\twordA = input.readLine().toLowerCase(); \n\t\t\twordB = input.readLine().toLowerCase();\n\n\t\t\tg = Integer.parseInt(input.readLine());\n\n\t\t\tString key; \n\t\t\tString [] chars;\n\t\t\tpenaltyMap = new HashMap<String, Integer>();\n\n\t\t\tfor(int i=0;i<676;i++) {\n\t\t\t\tline = input.readLine();\n\t\t\t\tchars = line.split(\" \");\n\t\t\t\tkey = chars[0] + \" \" + chars[1];\n\t\t\t\tpenaltyMap.put(key, Integer.parseInt(chars[2]));\n\n\t\t\t}\n\n\t\t\tinput.close();\n\n\t\t} catch (IOException io) {\n\t\t\tio.printStackTrace();\n\t\t}\n\t}",
"public String Get_Input()throws IOException{\r\n\t\tString input=\"\";\r\n\t\tInputStreamReader converter = new InputStreamReader(System.in);\r\n\t\tBufferedReader in = new BufferedReader(converter);\r\n\t\t\r\n\t\tinput = in.readLine();\r\n\t\t\r\n\t\treturn input;\r\n\t}",
"private String[] readLine(BufferedReader r) throws IOException\r\n\t{\r\n\t\tSystem.out.print(\"> \");\r\n\t\tfinal String line = r.readLine();\r\n\t\treturn line != null ? split(line) : null;\r\n\t}",
"public java.lang.String readLine() {\n /*\n r7 = this;\n r0 = r7.in;\n monitor-enter(r0);\n r1 = r7.buf;\t Catch:{ all -> 0x0097 }\n if (r1 != 0) goto L_0x000f;\n L_0x0007:\n r1 = new java.io.IOException;\t Catch:{ all -> 0x0097 }\n r2 = \"LineReader is closed\";\n r1.<init>(r2);\t Catch:{ all -> 0x0097 }\n throw r1;\t Catch:{ all -> 0x0097 }\n L_0x000f:\n r1 = r7.pos;\t Catch:{ all -> 0x0097 }\n r2 = r7.end;\t Catch:{ all -> 0x0097 }\n if (r1 < r2) goto L_0x0018;\n L_0x0015:\n r7.aOB();\t Catch:{ all -> 0x0097 }\n L_0x0018:\n r1 = r7.pos;\t Catch:{ all -> 0x0097 }\n L_0x001a:\n r2 = r7.end;\t Catch:{ all -> 0x0097 }\n r3 = 10;\n if (r1 == r2) goto L_0x0051;\n L_0x0020:\n r2 = r7.buf;\t Catch:{ all -> 0x0097 }\n r2 = r2[r1];\t Catch:{ all -> 0x0097 }\n if (r2 != r3) goto L_0x004e;\n L_0x0026:\n r2 = r7.pos;\t Catch:{ all -> 0x0097 }\n if (r1 == r2) goto L_0x0035;\n L_0x002a:\n r2 = r7.buf;\t Catch:{ all -> 0x0097 }\n r3 = r1 + -1;\n r2 = r2[r3];\t Catch:{ all -> 0x0097 }\n r4 = 13;\n if (r2 != r4) goto L_0x0035;\n L_0x0034:\n goto L_0x0036;\n L_0x0035:\n r3 = r1;\n L_0x0036:\n r2 = new java.lang.String;\t Catch:{ all -> 0x0097 }\n r4 = r7.buf;\t Catch:{ all -> 0x0097 }\n r5 = r7.pos;\t Catch:{ all -> 0x0097 }\n r6 = r7.pos;\t Catch:{ all -> 0x0097 }\n r3 = r3 - r6;\n r6 = r7.charset;\t Catch:{ all -> 0x0097 }\n r6 = r6.name();\t Catch:{ all -> 0x0097 }\n r2.<init>(r4, r5, r3, r6);\t Catch:{ all -> 0x0097 }\n r1 = r1 + 1;\n r7.pos = r1;\t Catch:{ all -> 0x0097 }\n monitor-exit(r0);\t Catch:{ all -> 0x0097 }\n return r2;\n L_0x004e:\n r1 = r1 + 1;\n goto L_0x001a;\n L_0x0051:\n r1 = new com.a.a.b$1;\t Catch:{ all -> 0x0097 }\n r2 = r7.end;\t Catch:{ all -> 0x0097 }\n r4 = r7.pos;\t Catch:{ all -> 0x0097 }\n r2 = r2 - r4;\n r2 = r2 + 80;\n r1.<init>(r2);\t Catch:{ all -> 0x0097 }\n L_0x005d:\n r2 = r7.buf;\t Catch:{ all -> 0x0097 }\n r4 = r7.pos;\t Catch:{ all -> 0x0097 }\n r5 = r7.end;\t Catch:{ all -> 0x0097 }\n r6 = r7.pos;\t Catch:{ all -> 0x0097 }\n r5 = r5 - r6;\n r1.write(r2, r4, r5);\t Catch:{ all -> 0x0097 }\n r2 = -1;\n r7.end = r2;\t Catch:{ all -> 0x0097 }\n r7.aOB();\t Catch:{ all -> 0x0097 }\n r2 = r7.pos;\t Catch:{ all -> 0x0097 }\n L_0x0071:\n r4 = r7.end;\t Catch:{ all -> 0x0097 }\n if (r2 == r4) goto L_0x005d;\n L_0x0075:\n r4 = r7.buf;\t Catch:{ all -> 0x0097 }\n r4 = r4[r2];\t Catch:{ all -> 0x0097 }\n if (r4 != r3) goto L_0x0094;\n L_0x007b:\n r3 = r7.pos;\t Catch:{ all -> 0x0097 }\n if (r2 == r3) goto L_0x008a;\n L_0x007f:\n r3 = r7.buf;\t Catch:{ all -> 0x0097 }\n r4 = r7.pos;\t Catch:{ all -> 0x0097 }\n r5 = r7.pos;\t Catch:{ all -> 0x0097 }\n r5 = r2 - r5;\n r1.write(r3, r4, r5);\t Catch:{ all -> 0x0097 }\n L_0x008a:\n r2 = r2 + 1;\n r7.pos = r2;\t Catch:{ all -> 0x0097 }\n r1 = r1.toString();\t Catch:{ all -> 0x0097 }\n monitor-exit(r0);\t Catch:{ all -> 0x0097 }\n return r1;\n L_0x0094:\n r2 = r2 + 1;\n goto L_0x0071;\n L_0x0097:\n r1 = move-exception;\n monitor-exit(r0);\t Catch:{ all -> 0x0097 }\n throw r1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.a.a.b.readLine():java.lang.String\");\n }",
"public Line getLine ()\r\n {\r\n if (line == null) {\r\n computeLine();\r\n }\r\n\r\n return line;\r\n }",
"private int load(int requested) throws IOException {\n final int remaining = bufferSize - lineMark;\n int toLoad = buffer.length - remaining;\n int maxLoad = Math.max(maxLoadSize, requested);\n if (toLoad < maxLoad) {\n if (toLoad == 0) {\n // Max line size reached. No more space to load.\n throw new LineParseException(lineNumber,\n \"Line length exceeds maximum line length of \" + buffer.length + \" characters\");\n }\n // Shift remaining to the left\n System.arraycopy(buffer, lineMark, buffer, 0, remaining);\n cursor -= lineMark;\n bufferSize -= lineMark;\n lineEnd -= lineMark;\n nextLineBegin -= lineMark;\n lineMark = 0;\n } else {\n if (lineMark == bufferSize) {\n cursor = 0;\n bufferSize = 0;\n lineMark = 0;\n }\n toLoad = maxLoad;\n }\n final int count = reader.read(buffer, bufferSize, toLoad);\n if (count >= 0) {\n bufferSize += count;\n }\n if (count < toLoad) {\n lineEnd = Math.min(bufferSize, lineEnd); // EOF\n }\n return count;\n }",
"public int getLine() {\n return line;\n }",
"public String getLine() {\n return this.line;\n }",
"@Override\n public String readLine() throws IOException {\n\n String line = null;\n\n while (true) {\n\n line = super.readLine();\n\n if (line == null) {\n\n return null;\n }\n\n // Get rid of comments\n\n // VT: FIXME: not handling the escaped comments\n\n int hash = line.indexOf(\"#\");\n\n if (hash != -1) {\n\n // Check if the '#' is escaped\n\n if (hash > 0 && line.indexOf(\"\\\\#\") == hash - 1) {\n\n // Yes, it is\n\n // System.err.println( \"Raw: '\"+line+\"'\" );\n line = line.substring(0, hash - 1) + line.substring(hash, line.length());\n // System.err.println( \"Unescaped: '\"+line+\"'\" );\n\n } else {\n\n line = line.substring(0, hash);\n }\n }\n\n // Trim it\n\n line = line.trim();\n\n if (line.length() != 0) {\n\n return line;\n }\n }\n }",
"public String readLine() throws IOException {\n/* 176 */ String line = this.currentFilePart.readLine();\n/* 177 */ while (line == null) {\n/* 178 */ this.currentFilePart = this.currentFilePart.rollOver();\n/* 179 */ if (this.currentFilePart != null) {\n/* 180 */ line = this.currentFilePart.readLine();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 188 */ if (\"\".equals(line) && !this.trailingNewlineOfFileSkipped) {\n/* 189 */ this.trailingNewlineOfFileSkipped = true;\n/* 190 */ line = readLine();\n/* */ } \n/* */ \n/* 193 */ return line;\n/* */ }",
"public int getLine() {\r\n\t\treturn line;\r\n\t}",
"private SensorReading extractReading(String line) {\n\t\tList<Integer> tempArray = new ArrayList<Integer>();\n\t\tString[] sr = line.split(\",\");\n\t\tfor(int i=0; i<sr.length; i++) {\n\t\t\tint num = Integer.MIN_VALUE;\n\t\t\ttry {\n\t\t\t\tnum = Integer.parseInt(sr[i]);\n\t\t\t} catch(NumberFormatException nfe) {\n\t\t\t\t// if num is not integer, skip the current line\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\ttempArray.add(num);\n\t\t}\t\t\t\n\t\tif(tempArray.size() == sr.length) {\n\t\t\treturn new SensorReading(tempArray, zeroValues);\n\t\t}\n\t\treturn null;\n\t}",
"public int getLine() {\n return line;\n }",
"public static byte[] readLine(InputStream inputStream, boolean includeCR)\n throws IOException {\n int len = 0;\n int buflen = 128; // average line length\n byte[] buf = new byte[buflen];\n byte[] ret = null;\n int b;\n while (true) {\n b = inputStream.read();\n switch (b) {\n case -1:\n if (len > 0) {\n ret = new byte[len];\n System.arraycopy(buf, 0, ret, 0, len);\n return ret;\n }\n return null;\n case 10:\n if ((len > 0) && (buf[len - 1] == 13)) {\n if (includeCR) {\n ret = new byte[len + 1];\n if (len > 0)\n System.arraycopy(buf, 0, ret, 0, len);\n ret[len] = 10;\n } else {\n len--;\n ret = new byte[len];\n if (len > 0)\n System.arraycopy(buf, 0, ret, 0, len);\n }\n return ret;\n }\n default:\n buf[len++] = (byte) b;\n if (len >= buflen) {\n buflen *= 2;\n byte[] tmp = new byte[buflen];\n System.arraycopy(buf, 0, tmp, 0, len);\n buf = tmp;\n }\n }\n }\n }",
"protected final String _readTTYLine() {\n\n StringBuffer buf = new StringBuffer(80);\n int c = 0;\n try {\n while ((c = System.in.read()) != -1) {\n char ch = (char) c;\n if (ch == '\\r') {\n ch = (char) System.in.read();\n if (ch == '\\n') {\n break;\n } else {\n continue;\n }\n } else if (ch == '\\n') {\n break; // Unix flavors.\n }\n buf.append(ch);\n }\n } catch (IOException e) {\n this._logger.error(ERROR_TAG + e.getMessage());\n }\n return buf.toString();\n }",
"@Override\n\tpublic void readData(DataInputStream input) throws IOException {\n\t\t\n\t}"
] | [
"0.685868",
"0.6765325",
"0.66573304",
"0.6573599",
"0.65466136",
"0.6384109",
"0.63707256",
"0.6344303",
"0.6294965",
"0.6264452",
"0.62541443",
"0.6203705",
"0.61670667",
"0.61462504",
"0.6132374",
"0.61066467",
"0.609157",
"0.6085269",
"0.6047729",
"0.60246056",
"0.60216916",
"0.6019362",
"0.6016136",
"0.5988452",
"0.598635",
"0.5954758",
"0.5931858",
"0.59281194",
"0.59281194",
"0.59281194",
"0.5919814",
"0.5909956",
"0.58961755",
"0.5884561",
"0.58781594",
"0.5877231",
"0.5877231",
"0.58557117",
"0.5845103",
"0.5837313",
"0.58285",
"0.5822598",
"0.58218634",
"0.57702583",
"0.5768391",
"0.5766045",
"0.57320505",
"0.57010454",
"0.56972486",
"0.5695413",
"0.56917",
"0.56838566",
"0.56752",
"0.5674557",
"0.567427",
"0.5667494",
"0.5665498",
"0.5661271",
"0.56416816",
"0.56386936",
"0.56335574",
"0.56312937",
"0.5624096",
"0.5620354",
"0.5618394",
"0.5595383",
"0.55922544",
"0.5591697",
"0.5588673",
"0.55792844",
"0.55772734",
"0.5576187",
"0.5570208",
"0.556382",
"0.5550248",
"0.5548892",
"0.55404407",
"0.55376905",
"0.5514024",
"0.54946136",
"0.5490916",
"0.54903924",
"0.54901314",
"0.5470872",
"0.5469153",
"0.54540837",
"0.54406005",
"0.54382175",
"0.5420194",
"0.54187495",
"0.5417251",
"0.54147124",
"0.54088944",
"0.54088175",
"0.5400702",
"0.53984267",
"0.53983045",
"0.5397973",
"0.5396741",
"0.53958917"
] | 0.601321 | 23 |
Servers the requested file. | private void serve() {
if (request == null) {
channel.close();
return;
}
logger.fine("Serving " + type + " request : " + request.getPath());
Response resp = RequestHandler.handle(request);
if (resp.getRespCode() == ResponseCode.NOT_FOUND) {
error404(resp);
return;
}
StringBuilder header = new StringBuilder();
if (type == Type.HTTP) {
header.append("HTTP/1.0 200 OK\r\n");
header.append("Content-Length: ")
.append(resp.getFileData().remaining()).append("\r\n");
header.append("Connection: close\r\n");
header.append("Server: Hyperion/1.0\r\n");
header.append("Content-Type: " + resp.getMimeType() + "\r\n");
header.append("\r\n");
}
byte[] headerBytes = header.toString().getBytes();
ByteBuffer bb = resp.getFileData();
ChannelBuffer ib = ChannelBuffers.buffer(bb.remaining()
+ headerBytes.length);
ib.writeBytes(headerBytes);
ib.writeBytes(bb);
channel.write(ib).addListener(ChannelFutureListener.CLOSE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void whenServeFile(String fileName, HttpServletRequest request);",
"public void sendRequest(){\n fileServer.sendMessage(this.packet,new FileNode(ip,port));\n }",
"public void run() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket sock = ss.accept(); // 接受连接请求\n\t\t\t\tDataInputStream din = new DataInputStream(sock.getInputStream());\n\t\t\t\tbyte buffer[] = new byte[1024]; // 缓冲区\n\t\t\t\tint len = din.read(buffer);\n\t\t\t\tString filename = new String(buffer, 0, len); // 提取出想要获取的文件名\n\t\t\t\tSystem.out.println(\"Client01: received a file request from\" + sock.getInetAddress()+\":\"+sock.getPort()+\",filename:\"+ filename);\n\t\t\t\tDataOutputStream dout = new DataOutputStream(sock.getOutputStream());\n\t\t\t\tFileInputStream fis = new FileInputStream(new File(\"D:/networkExperiment/experiment04/host01/\" + filename));\n\t\t\t\tbyte b[] = new byte[1024];\n\t\t\t\tfis.read(b); // 从文件中将数据写入缓冲区\n\t\t\t\tdout.write(b); // 将缓冲区中的数据返回\n\t\t\t\tSystem.out.println(\"Client01: return file successfully!\");\n\t\t\t\tdout.close();\n\t\t\t\tsock.close();\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t}\n\t}",
"void sendFile(String fileName, String hostName, int port) throws IOException;",
"public synchronized void run() {\n try {\n String data = in.readUTF();\n String response = FileRequestService.handleRequest(data, sharedWriteQueueService);\n out.writeUTF(response);\n System.out.println(\"server wrote:\" + response);\n } catch(EOFException e) {\n System.out.println(\"EOF:\" + e.getLocalizedMessage() + \" \" + e);\n } catch(IOException e) {\n System.out.println(\"IO:\" + e.getLocalizedMessage() + \" \" + e);\n } finally { \n try {\n clientSocket.close();\n } catch (IOException e){\n System.out.println(\"close:\" + e.getMessage());\n }\n }\n }",
"@GET\n @Path(\"{filename}\")\n @Produces(MediaType.APPLICATION_OCTET_STREAM)\n public Response show(@PathParam(\"filename\") String filename) {\n ArrayList<String> serversClone = new ArrayList<>();\n this.cm.getServers().forEach(server -> {\n serversClone.add(server);\n });\n while (!serversClone.isEmpty()) {\n String selectedServer = this.cm.getServer();\n serversClone.remove(selectedServer);\n try{\n String endpoint = \"http://\" + selectedServer\n + \"/WebService/webresources/files\";\n URL url = new URL(endpoint + \"/\" + filename);\n String methodType = \"GET\";\n HttpURLConnection urlConnection = (HttpURLConnection) \n url.openConnection();\n urlConnection.setRequestMethod(methodType);\n urlConnection.setDoOutput(true);\n urlConnection.setRequestProperty(\n \"Content-type\", MediaType.APPLICATION_OCTET_STREAM\n );\n urlConnection.setRequestProperty(\n \"Accept\", MediaType.APPLICATION_OCTET_STREAM\n );\n int httpResponseCode = urlConnection.getResponseCode();\n if (httpResponseCode == HttpURLConnection.HTTP_OK) {\n return Response.ok(urlConnection.getInputStream()).build();\n } else {\n if (serversClone.isEmpty()) {\n return Response\n .status(httpResponseCode).build();\n }\n }\n } catch (IOException e) {\n System.err.println(e);\n return Response.serverError().build();\n }\n }\n return Response.status(HttpURLConnection.HTTP_UNAVAILABLE).build();\n }",
"void receiveFile(String fileName, int port) throws IOException;",
"@Override\n\t\tpublic void run() {\n\t\t\tIndexServer is = new IndexServer(3002,\"/src/P2Pfile/Peer2/filefolder\" );\n\t\t\tSystem.out.println(\"Peer2Server Start\");\n\t\t\tis.ConnectionAccept();\n\t\t\t\n\t\t\n\t\t\t\n\t\t}",
"private void requestFile(NapFile file, Client fileOwner) {\r\n\t\ttry {\r\n\r\n\t\t\tFile localCopy = new File(\"./SharedFiles1/\" + file.FILE_NAME);\r\n\r\n\t\t\tif (localCopy.createNewFile()) {\r\n\t\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"Connecting to \" + fileOwner.IP.toString().substring(1)\r\n\t\t\t\t\t\t+ \":\" + fileOwner.PORT_NUM);\r\n\t\t\t\tSocket OwnerSocket = Net_Util.connectToServer(fileOwner.IP.toString().substring(1), fileOwner.PORT_NUM);\r\n\t\t\t\tNet_Util.send(OwnerSocket, file.FILE_NAME);\r\n\t\t\t\tString[] contents = Net_Util.recStrArr(OwnerSocket);\r\n\r\n\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(localCopy));\r\n\t\t\t\tfor (String lineContent : contents) {\r\n\t\t\t\t\twriter.write(lineContent + \"\\n\");\r\n\t\t\t\t}\r\n\t\t\t\twriter.close();\r\n\t\t\t\twriter = new BufferedWriter(new FileWriter(\"./SharedFiles1/FileList.txt\", true));\r\n\t\t\t\twriter.newLine();\r\n\t\t\t\twriter.write(file.FILE_NAME + \"::\" + file.DESCRIPTION);\r\n\t\t\t\twriter.close();\r\n\r\n\t\t\t\tNet_Util.send(serverSocket, \"register \" + file.FILE_NAME);\r\n\r\n\t\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"File \" + file.FILE_NAME + \" retrieved sucessfully\");\r\n\t\t\t} else {\r\n\t\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"You already have a file with this name\");\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\tcmdDisplay.setText(cmdDisplay.getText() + \"\\n\" + \"Couldn't send connect to file owner\");\r\n\t\t}\r\n\t}",
"public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}",
"@Override\n\tpublic void run( ) {\n\t\tConnect();\n\t\tSendFile( filePath );\n\t\tDisconnect();\n\t}",
"@Override\n public void run() {\n FILEPREFIX = \".//files\"+serverID + \"//\";\n ClientMessage = (Message) socketRead();\n ServerMessage = getReturnMessage(ClientMessage);\n //System.out.println(\"client\"+ClientMessage.getFrom()+\"message : \"+ClientMessage.getContent());\n File file = new File(FILEPREFIX + ClientMessage.getFileName());\n switch (ClientMessage.getType()){\n case \"enquiry\"://return the list of file\n ServerMessage.setContent(ListAllFile());\n break;\n case \"read\"://read the last line\n System.out.println(ClientMessage.getFrom() + \": Reading...\");\n ServerMessage.setContent(\"Reading: \"+ReadLastLine(file));\n System.out.println(\"Reading \"+ClientMessage.getContent());\n break;\n case \"write\"://write to the end of file\n System.out.println(ClientMessage.getFrom() + \": writing...\");\n try{\n WriteLastLine(file,ClientMessage.getContent());\n }catch (IOException e) {\n System.out.println(\"write error\");\n }\n\n ServerMessage.setContent(\"writing: \"+ReadLastLine(file));\n System.out.println(\"Writing \"+ClientMessage.getContent());\n break;\n default://unknown command\n System.out.println(ClientMessage.getType());\n ServerMessage.setContent(\"Error\");\n System.out.println(ClientMessage.getFrom() + \": Wrong type\");\n break;\n }\n socketWrite(ServerMessage);\n\n try {//close the socket connection\n client.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void main(String args[]) throws Exception\n {\n\n ServerSocket server = new ServerSocket(2000,10);\n\n System.out.println(\"Web Server Started. Listening on port number 2000\");\n String filespec;\n int ch;\n \n while (true)\n {\n // get connection from client \n Socket client = server.accept();\n\n BufferedReader br = new BufferedReader( new InputStreamReader(client.getInputStream()));\n\n OutputStream clientout = client.getOutputStream();\n\n // read filespec from client\n while ( (filespec = br.readLine()) == null);\n\n System.out.println(\"Processing request for file : \" + filespec);\n \n // open the file and send content back to client\n\n FileReader fr = new FileReader( filespec);\n\n while ( ( ch = fr.read()) != -1 )\n clientout.write(ch);\n\n clientout.write(-1); // write EOF\n clientout.close();\n \n fr.close();\n\n System.out.println(\"Process Completed Successfully\");\n\n } // end of while\n\n }",
"public synchronized Package handle(Package req){\n\n\t\tString filename = req.getP(\"filename\");\n\t String path = filePath.get(filename);\n\t int length = Integer.parseInt(req.getP(\"seg_length\"));\n\t int offset = Integer.parseInt(req.getP(\"seg_offset\"));\n\t File file = new File(path);\n\t System.out.println(\"Serve file with offset, length , total length:\"\n\t + offset + \",\" + length + \",\" + file.length() + \" \"+ path);\n\n\t RandomAccessFile raFile;\n\t byte data[] = new byte[length];\n\t\ttry {\n\t\t\traFile = new RandomAccessFile(path, \"r\");\n\t\t raFile.seek(offset);\n\t\t raFile.read(data);\n\t\t raFile.close();\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t \n\t\treq.setD(data);\n\t\treturn req; \n\t}",
"public static void main(String[] args) throws IOException {\n\t\tif(args.length != 2)\n\t\t{\n\t\t\tusage();\n\t\t\treturn;\n\t\t}\n\t\tHttpServer server = new HttpServer(Integer.parseInt(args[0]), new FileServer(args[1]));\n\t\tserver.setAllowedMethods(new String[] { \"GET\", \"HEAD\" });\n\t\tserver.setName(\"info.ziyan.net.httpserver.example.FileServer/1.0\");\n\t\tserver.start();\n\t}",
"public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, java.io.IOException {\r\n\t\tString resourceID = request.getResourceID();\r\n\t\tif (resourceID.equals(\"resourceID\")) {\r\n\t\t\t// Insert code for serving the resource \r\n\t\t}\r\n\t}",
"private void fileHandler(String line) {\n var splited = line.split(\" \");\n if (splited.length < 3) {\n System.err.println(\"usage: /file login filename\");\n return;\n }\n String receiver = splited[1];\n String filename = splited[2];\n Path filePath = Path.of(directoryPath.toAbsolutePath().toString(), filename);\n\n if (!Files.exists(filePath)) {\n System.err.println(splited[2] + \" file does not exist.\");\n return;\n }\n\n readFile(filePath).ifPresent(fileContent ->\n {\n if (fileContent.limit() > Helper.LIMIT_FILE_CONTENT_SIZE) {\n System.err.println(\"file is too big. It must be under \" + Helper.LIMIT_SIZE_MSG);\n return;\n }\n\n var fileMsg = new FileMessage(filename, login, fileContent);\n if (!existPrivateConnection(receiver)) {\n sendPrivateConnectionRequest(receiver);\n privateConnectionMap.get(receiver).pendingDirectMessages.add(fileMsg.toBuffer());\n return;\n }\n handlerPrivateFrameSending(fileMsg, receiver);\n });\n }",
"static void startServer(String tracker_file, int port, String file_location) throws IOException {\n\t\tTrackerInfo ctracker = new TrackerInfo(tracker_file);\n\t\tPeer peer = new Peer(InetAddress.getByName(\"127.0.0.1\"), port, ctracker, file_location);\n\t\tpeer.waitingForClient();\n\t\twhile(true) {\n\t\t\tif(peer.out_buf.size() > 0) {\n\t\t\t\tif(!peer.send()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!peer.recieve()) {\n\t\t\t\tif(peer.out_buf.size() == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tpeer.recieveHandle();\n\t\t\t}\n\t\t}\n\t\tpeer.closeTCP();\n\t}",
"public void doFiles(){\r\n serversDir = new File(rootDirPath+\"/servers/\");\r\n serverList = new File(rootDirPath+\"serverList.txt\");\r\n if(!serversDir.exists()){ //if server Directory doesn't exist\r\n serversDir.mkdirs(); //create it\r\n }\r\n updateServerList();\r\n }",
"public void initServer(File fname) {\n // Do something!\n System.err.println(\"Init server with fname \" + fname);\n }",
"public void get(String file) {\n\n }",
"@Override\n\t\t\t\t\tpublic void handle(File file)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void run() {\n try {\n //first send the file name to the receiver\n out.flush();\n out.writeUTF(fileName);\n out.flush();\n //sends the destination folder name\n out.writeUTF(destFolder);\n out.flush(); //flushes the buffer\n //array of bytes that holds the file bytes\n byte[] file = readFile(srcFilePath +\"/\"+fileName);\n System.out.println(\"Sending file: \"+fileName+\" to folder: \"+destFolder);\n //sends the file\n out.write(file,0,file.length);\n out.flush();\n if(notifDownloader) {\n NodeInterface nodeStub = (NodeInterface) Naming.lookup(\"/\"+clientSocket.getInetAddress().toString()+\"/Node\");\n nodeStub.fileDownloaded(fileName);\n }\n } catch (IOException e) {\n System.out.println(\"readline: \" + e.getMessage());\n } catch (NotBoundException e) {\n //e.printStackTrace();\n System.err.println(\"There was an error notifying the downloader \"+e.getMessage());\n } finally{\n try{\n //closes the socket\n clientSocket.close();\n }catch(IOException e){\n System.out.println(\"problem closing the socket: \"+e.getMessage());\n }\n }\n }",
"void sendFile() {\r\n\t\t// 특정 클라이언트에게 파일을 보냄\r\n\t}",
"@Override\n protected void service(HttpServletRequest request,\n HttpServletResponse response) throws IOException {\n String requestUri = request.getRequestURI();\n FileStorageUtil fileStorageUtil = new FileStorageUtil(this.fastDepFileProperties);\n String downloadUrl = this.fastDepFileProperties.getDownloadUrl();\n if (this.fastDepFileProperties.getUploadUrl().equals(requestUri)) {\n // HttpServletRequest to MultipartHttpServletRequest\n StandardServletMultipartResolver resolver = new StandardServletMultipartResolver();\n MultipartHttpServletRequest multipartRequest = resolver.resolveMultipart(request);\n MultipartFile files = multipartRequest.getFile(this.fastDepFileProperties.getFieldName());\n FileResponse fileResponse = fileStorageUtil.uploadFile(files);\n response.setContentType(\"text/json;charset=UTF-8\");\n response.setCharacterEncoding(\"UTF-8\");\n PrintWriter out = response.getWriter();\n ObjectMapper mapper = new ObjectMapper();\n String result = mapper.writeValueAsString(fileResponse);\n out.println(result);\n out.flush();\n out.close();\n } else if (requestUri.startsWith(downloadUrl)) {\n // download file\n fileStorageUtil.downloadFile(requestUri.substring(downloadUrl.length() + 1), request, response);\n }\n }",
"public FileServer(int port) throws IOException {\n serverThread = new Thread(new RunningService(port));\n }",
"@Override\r\n\tpublic void runSystem() throws IOException {\n\t\tclientWithHalf.setHalfFile(fileHalf);\r\n\t\tserverWithTotal.setTotalFile(fileTotal);\r\n\t\tclientWithHalf.connect(serverWithTotal);\r\n\t\tserverWithTotal.connect(clientWithHalf);\r\n\t\tclientWithHalf.sendCheckSumFile();\r\n\t\tserverWithTotal.receieveCheckSumFile();\r\n\t\tserverWithTotal.startMatch();\r\n\t\tserverWithTotal.sendBackData();\r\n\t\tclientWithHalf.rebuidFile();\r\n\t\tclientWithHalf.checkFileEqual();\r\n\t\tclientWithHalf.clearTempData();\r\n\t\tserverWithTotal.getConfirm();\r\n\t\tserverWithTotal.clearTempData();\r\n\t}",
"@Override\n\tpublic void run() {\n\t\tString request;\n\t\ttry {\n\t\t\tSocketBuilder socketBuilder = new SocketBuilder(this.IP);\n\n\t\t\tSocket clientSocketStrings = socketBuilder.createStringSocket();\n\t\t\tSocket clientSocketBytes = socketBuilder.createByteSocket();\n\n\t\t\tDataOutputStream outToServer = new DataOutputStream(clientSocketStrings.getOutputStream());\n\n\t\t\tDataInputStream bytesStream = new DataInputStream(clientSocketBytes.getInputStream());\n\n\t\t\tBufferedReader inFromServer = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(clientSocketStrings.getInputStream(), StandardCharsets.UTF_8));\n\t\t\t\n\t\t\tMessage requestMessage = new Message();\n\t\t\trequestMessage.createDownloadMessage(path);\n\n\t\t\trequest = JsonParser.messageToJson(requestMessage);\n\n\t\t\toutToServer.write(request.getBytes(\"UTF-8\"));\n\t\t\toutToServer.writeByte('\\n');\n\n\t\t\tMessage responseMessage = JsonParser.jsonToMessage(inFromServer.readLine());\n\n\t\t\t// check if operation is possible\n\t\t\tif (responseMessage.isERRORMessage()) {\n\t\t\t\t/*\n\t\t\t\t * Handle Error Here\n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tFileTransfer fileTransfer = new FileTransfer();\n\n\t\t\t\tlong size = Long.parseLong(inFromServer.readLine());\n\n\t\t\t\tEstimationViewManagementThread manage = new EstimationViewManagementThread(size, \n\t\t\t\t\t\tfileTransfer, clientSocketStrings, clientSocketBytes);\n\t\t\t\tmanage.start();\n\t\t\t\tfileTransfer.receiveFiles(bytesStream, inFromServer, locationToSave);\n\t\t\t}\n\t\t\t\n\t\t\toutToServer.close();\n\t\t\tbytesStream.close();\n\t\t\tinFromServer.close();\n\t\t\tclientSocketBytes.close();\n\t\t\tclientSocketStrings.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n public void run() {\n downloadFile(Const.MONITOR_SERVER_ADDRESS, downFilePath);\n }",
"public static void main(String[] args) throws IOException {\n ServerFile severFile = new ServerFile();\n severFile.createChannel(\"127.0.0.1\",9091);\n// SocketChannel socketChannel = severFile.createChannel(\"127.0.0.1\",9090);\n// severFile.sendFile(socketChannel);\n }",
"public void sendRequest(SimpleChannelHandler handler){\n fileServer.sendMessage(this.packet,new FileNode(ip,port),handler);\n }",
"public String getFileTransferServer();",
"public fileServer() {\n }",
"public void replyToClientHeader(int type, File file) {\r\n \t\r\n if (type == NOT_IMPLEMENTED) {\r\n pw.print(\"HTTP/1.1 501 Not Implemented\\r\\n\");\r\n out.print(\". Response to client: HTTP/1.1 501 Not Implemented\\r\\n\");\r\n out.flush();\r\n }\r\n else if (type == OK) {\r\n pw.print(\"HTTP/1.1 200 OK\\r\\n\");\r\n out.print(\". Response to client: HTTP/1.1 200 OK\\r\\n\");\r\n out.flush();\r\n }\r\n else {\r\n pw.print(\"HTTP/1.1 404 Not Found\\r\\n\");\r\n out.print(\". Response to client: HTTP/1.1 404 Not Found\\r\\n\");\r\n out.flush();\r\n }\r\n pw.print(\"Server: Simple Java Http Server\\r\\n\");\r\n try {\r\n /**\r\n * @see <a href=\"https://docs.oracle.com/javase/7/docs/api/java/nio/\r\n * file/Files.html#probeContentType%28java.nio.file.Path%29\">https:/\r\n * /docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#probe\r\n * ContentType%28java.nio.file.Path%29</a>\r\n */\r\n pw.print(\"Content-Type: \" + Files.probeContentType(file.toPath()) + \"\\r\\n\");\r\n } catch (IOException ex) {\r\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n pw.print(\"Content-Length: \" + countChars(file) + \"\\r\\n\\r\\n\");\r\n pw.flush();\r\n }",
"public void transferFile() {\n\t\t// create file event and set client and server path\n\t\tfileEvent = new FileEvent();\n\t\tfileEvent.setClientPath(clientPath);\n\t\tfileEvent.setServerPath(serverPath);\n\t\t\n\t\t// get client name and set filename\n\t\tFile file = new File(clientPath);\n\t\tString name = clientPath.substring(clientPath.lastIndexOf(\"/\") + 1, \n\t\t\t\t\t\tclientPath.length());\n\t\tfileEvent.setFilename(name);\n\t\t\n\t\t// checks if the file exists in the path mentioned or sets valid to No\n\t\tif (file.isFile()) {\n\t\t\t//creates input stream setup the data in byte arrays\n\t\t\tDataInputStream inStream = null;\n\t\t\ttry {\n\t\t\t\tinStream = new DataInputStream(new FileInputStream(file));\n\t\t\t\tlong length = (int) file.length();\n\t\t\t\tbyte[] byteArray = new byte[(int) length];\n\t\t\t\tint start = 0;\n\t\t\t\tint last = 0;\n\t\t\t\tint rest = inStream.read(byteArray, start, \n\t\t\t\t\t\t\t\t\t\t\tbyteArray.length - start);\n\t\t\t\twhile (start < byteArray.length && (last = rest) >= 0) {\n\t\t\t\t\tstart = start + last;\n\t\t\t\t}\n\t\t\t\tfileEvent.setFileSize(length);\n\t\t\t\tfileEvent.setFileData(byteArray);\n\t\t\t\tfileEvent.setValid(\"Yes\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tfileEvent.setValid(\"No\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Path does not exist.\");\n\t\t\tfileEvent.setValid(\"No\");\n\t\t}\n\t\t// Start sending the data byte array\n\t\ttry {\n\t\t\toutStream.writeObject(fileEvent);\n\t\t\tSystem.out.println(\"Done...\");\n\t\t\tThread.sleep(5000);\n\t\t\tSystem.exit(0);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tif(args.length != 4){\n\t\t\tSystem.out.println(\"Program takes 4 arguments. Usage: java HttpClient localhost <port number> <Request Type(GET/PUT)> <filepath>\");\n\t\t}else{\n\t\t\tif (!isNumeric(args[1]))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Please enter valid Port no\");\n\t\t\t\treturn;\n\t\t\t}\n String hostName = args[0];\n\t\t\tint portNo = Integer.parseInt(args[1]);\n\t\t\tString requestType = args[2];\n\t\t\tString filePath = args[3];\n\t\t\tObjectOutputStream outs;\n\t\t\tObjectInputStream ins;\n\t\t\t\n\t\ttry {\n \n\t\t\tSocket socket = new Socket(hostName, portNo);\n\t\t\tSystem.out.println(\"\\n\" + \"Connected to Server on port \" + portNo);\n\t\t\t\n\t\t\touts = new ObjectOutputStream(socket.getOutputStream()); \n\t\t\tins = new ObjectInputStream(socket.getInputStream());\n\t\t\t\n\t\t\tif(requestType.equals(GET)){\n\t\t\t\tSystem.out.println(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\tSystem.out.println(\"Host:\" + hostName);\n\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\touts.writeObject(\"Host:\" + hostName);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tString response = (String) ins.readObject();\n\n\t\t\t\t\tSystem.out.println(\"Status: \" + response + \"\\n\");\n\t\t\t\t\tif ( response.equals(RESPONSE_OK)) \n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"Requested file contains : \\n\");\n\t\t\t\t\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tString line = (String) ins.readObject();\n\t\t\t\t\t\t\twhile (line != null) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\t\t\tline = (String) ins.readObject();\n\t\t\t\t\t\t\t}\n \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcatch(EOFException e)\n\t\t\t\t\t\t{\n System.out.println(\"-------------------------------------------------\");\n\t\t\t\t\t\t\tSystem.out.println(\"\\nFile is received\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(response);\n\t\t\t\t\t\t}\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse if ( requestType.equals(PUT)) \n\t\t\t{\n\t\t\t\tFile file = new File(filePath); \n\t\t\t\tif (!(file.isDirectory()) && (file.exists()))\n\t\t\t\t{\n System.out.println(\"Sending the file: \" + file.getName() + \" to server....\\n\"); \n\t\t\t\t\touts.writeObject(requestType + \" \" + filePath + \" HTTP/1.1\");\n\t\t\t\t\t\n\t\t\t\t\tInputStream fis = new FileInputStream(file); \n\t\t\t\t\tbyte [] buffer = new byte[(int)file.length()];\n\n\t\t\t\t\tint noOfBytes = fis.read(buffer);\n\t\t\t\t\ttry{\n\t\t\t\t\t\tif(noOfBytes > 0)\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\touts.write(buffer, 0, noOfBytes);\n\t\t\t\t\t\t\touts.flush();\n\t\t\t\t\t\t\tSystem.out.println(\"File: \" + file.getName() + \" Sent\\n\\n\");\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\tcatch(Exception e)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfis.close();\n\t\t\t\t\tSystem.out.println(\"Status Code from server: \" + ins.readObject() + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"Status Message from server: \" + ins.readObject() + \"\\n\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"File doesn't exist\\n\");\n\t\t\t\t\touts.writeObject(\"Invalid File\");\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Invalid Request type. Use only GET/PUT \\n\");\n\t\t\t\touts.writeObject(\"Invalid Request type\");\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Closing the Socket\");\n\t\t\t\n\t\t\touts.close();\n\t\t\tins.close();\t\t\t\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch( Exception e )\n\t\t{\n\t\t\te.printStackTrace();\n\t\t} \n\t\t}\n\n\t}",
"Response serveFile(String uri, Map<String, String> header, File file, String mime) {\n\t\t\tResponse res;\n\t\t\ttry {\n\t\t\t\t// Calculate etag\n\t\t\t\tString etag = Integer.toHexString((file.getAbsolutePath() + file.lastModified()\n\t\t\t\t\t\t+ \"\" + file.length()).hashCode());\n\n\t\t\t\t// Support (simple) skipping:\n\t\t\t\tlong startFrom = 0;\n\t\t\t\tlong endAt = -1;\n\t\t\t\tString range = header.get(\"range\");\n\t\t\t\tif (range != null) {\n\t\t\t\t\tif (range.startsWith(\"bytes=\")) {\n\t\t\t\t\t\trange = range.substring(\"bytes=\".length());\n\t\t\t\t\t\tint minus = range.indexOf('-');\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (minus > 0) {\n\t\t\t\t\t\t\t\tstartFrom = Long.parseLong(range.substring(0, minus));\n\t\t\t\t\t\t\t\tendAt = Long.parseLong(range.substring(minus + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (NumberFormatException ignored) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// get if-range header. If present, it must match etag or else\n\t\t\t\t// we\n\t\t\t\t// should ignore the range request\n\t\t\t\tString ifRange = header.get(\"if-range\");\n\t\t\t\tboolean headerIfRangeMissingOrMatching = (ifRange == null || etag.equals(ifRange));\n\n\t\t\t\tString ifNoneMatch = header.get(\"if-none-match\");\n\t\t\t\tboolean headerIfNoneMatchPresentAndMatching = ifNoneMatch != null\n\t\t\t\t\t\t&& (\"*\".equals(ifNoneMatch) || ifNoneMatch.equals(etag));\n\n\t\t\t\t// Change return code and add Content-Range header when skipping\n\t\t\t\t// is\n\t\t\t\t// requested\n\t\t\t\tlong fileLen = file.length();\n\n\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= 0\n\t\t\t\t\t\t&& startFrom < fileLen) {\n\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\tif (headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that matches current etag\n\t\t\t\t\t\t// and the startFrom of the range is satisfiable\n\t\t\t\t\t\t// would return range from file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (endAt < 0) {\n\t\t\t\t\t\t\tendAt = fileLen - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlong newLen = endAt - startFrom + 1;\n\t\t\t\t\t\tif (newLen < 0) {\n\t\t\t\t\t\t\tnewLen = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\t\t\t\tfis.skip(startFrom);\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.PARTIAL_CONTENT, mime, fis,\n\t\t\t\t\t\t\t\tnewLen);\n\t\t\t\t\t\tres.addHeader(\"Accept-Ranges\", \"bytes\");\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + newLen);\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes \" + startFrom + \"-\" + endAt + \"/\"\n\t\t\t\t\t\t\t\t+ fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\n\t\t\t\t\tif (headerIfRangeMissingOrMatching && range != null && startFrom >= fileLen) {\n\t\t\t\t\t\t// return the size of the file\n\t\t\t\t\t\t// 4xx responses are not trumped by if-none-match\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.RANGE_NOT_SATISFIABLE,\n\t\t\t\t\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"\");\n\t\t\t\t\t\tres.addHeader(\"Content-Range\", \"bytes */\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (range == null && headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// full-file-fetch request\n\t\t\t\t\t\t// would return entire file\n\t\t\t\t\t\t// respond with not-modified\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else if (!headerIfRangeMissingOrMatching\n\t\t\t\t\t\t\t&& headerIfNoneMatchPresentAndMatching) {\n\t\t\t\t\t\t// range request that doesn't match current etag\n\t\t\t\t\t\t// would return entire (different) file\n\t\t\t\t\t\t// respond with not-modified\n\n\t\t\t\t\t\tres = newFixedLengthResponse(Response.Status.NOT_MODIFIED, mime, \"\");\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// supply the file\n\t\t\t\t\t\tres = newFixedFileResponse(file, mime);\n\t\t\t\t\t\tres.addHeader(\"Content-Length\", \"\" + fileLen);\n\t\t\t\t\t\tres.addHeader(\"ETag\", etag);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tres = getForbiddenResponse(\"Reading file failed.\");\n\t\t\t}\n\n\t\t\treturn res;\n\t\t}",
"static void startClient(String tracker_file, int port) throws UnknownHostException {\n\t\tTrackerInfo ctracker = new TrackerInfo(tracker_file);\n\t\tTransferManager.initial(getPiecesFromTrackerInfo(ctracker), ctracker);\n\t\tPeer peer = new Peer(InetAddress.getByName(\"127.0.0.1\"), port, ctracker);\n\t\tpeer.initialTCP();\n\t\tpeer.handShake();\n\t\twhile(!TransferManager.fileDonwloaded()) {\n\t\t\tif(peer.out_buf.size() > 0) {\n\t\t\t\tif(!peer.send()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!peer.recieve()) {\n\t\t\t\tif(peer.out_buf.size() == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tpeer.recieveHandle();\n\t\t\t}\n\t\t}\n\t\tif(TransferManager.fileDonwloaded()) {\n\t\t\tTransferManager.writeToFile();\n\t\t\tSystem.out.println(\"Success Recieve The File: \" + ctracker.file_name);\n\t\t}else {\n\t\t\tSystem.out.println(\"Unable To Recieve The File: \" + ctracker.file_name);\n\t\t}\n\t\tpeer.closeTCP();\n\t}",
"public void replyToClientBody(File file) {\r\n FileInputStream fis = null;\r\n try {\r\n /**\r\n * @see <a href=\"https://stackoverflow.com/questions/14169661/read-c\r\n * omplete-file-without-using-loop-in-java\">https://stackoverflow.co\r\n * m/questions/14169661/read-complete-file-without-using-loop-in-j\r\n * ava</a>\r\n */\r\n fis = new FileInputStream(file);\r\n byte[] data = new byte[(int) file.length()];\r\n fis.read(data);\r\n fis.close();\r\n outputBody.write(data);\r\n outputBody.flush();\r\n } catch (Exception ex) {\r\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"public void getFile(byte[] data, String name,String server) throws RemoteException;",
"public void sendResponse(int dest, String file) throws UnknownHostException, SocketException, IOException {\n InetAddress IPAddress = InetAddress.getByName(\"127.0.0.1\");\n\n // Canal de comunicação não orientado à conexão\n //DatagramSocket serverSocket = new DatagramSocket();\n\n // Passa o caminho do arquivo\n final byte[] sendData = (this.home + file).getBytes();\n\n // Criando pacote com base no endereco do cliente\n DatagramPacket sendPacket\n = new DatagramPacket(sendData, sendData.length,\n IPAddress, dest);\n\n this.getServerSocket().send(sendPacket);\n }",
"private void sendFile(String fileName) throws IOException {\n // Read file from disk\n //\n fileReader = new MyFileReader();\n byte[] data = fileReader.readFile(fileName);\n //\n // Send binary data over the TCP/IP socket connection\n //\n for (byte i : data) {\n this.socket.getOutputStream().write(i);\n }\n\n System.out.println(\"\\r\\nSent \" + data.length + \" bytes to server.\");\n }",
"public void run()\n {\n try\n {\n // Load the manifest file\n File manifest = new File(UploaderMain.getManifestName());\n if (!manifest.exists())\n {\n ErrorPrinter.printError(ErrorCode.fileNotFound, \"manifest does not exist\");\n System.exit(0);\n }\n\n // Read names of files from manifest\n Map<String, File> files = new HashMap<String, File>();\n BufferedReader manifestReader = new BufferedReader(new FileReader(manifest));\n String line;\n long totalLength = 0;\n while ((line = manifestReader.readLine()) != null)\n {\n if (line.startsWith(\"//\") || line.trim().isEmpty()) continue; // ignore comments\n StringTokenizer token = new StringTokenizer(line, \"@\");\n String destinationName = token.nextToken();\n String localName = token.nextToken();\n File f = new File(localName);\n if (!f.exists())\n {\n \tErrorPrinter.printError(ErrorCode.fileNotFound, \"file \" + localName + \" not found\");\n \tcontinue;\n }\n totalLength += f.length();\n files.put(destinationName, f);\n }\n manifestReader.close();\n\n dOut.writeInt(files.size());\n dOut.writeLong(totalLength);\n\n for (String s : files.keySet())\n {\n File f = files.get(s);\n \n try\n {\n // Send the name and length of the file\n dOut.writeUTF(s);\n dOut.writeLong(f.length());\n\n // Send the file over the network\n FileInputStream reader = new FileInputStream(f);\n byte[] buffer = new byte[BUFFER_SIZE];\n int numRead;\n long numSent = 0;\n while (numSent < f.length())\n {\n numRead = reader.read(buffer);\n dOut.write(buffer, 0, numRead);\n numSent += numRead;\n }\n\n reader.close();\n }\n catch (Exception e)\n {\n System.out.println(\"Error sending file \" + f.getName());\n }\n }\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }",
"protected void doDeliver(URLConnection conn, InputStream in, String filename, HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\taddDateHeader(response, HttpConstants.LAST_MODIFIED, getLastModified(conn));\n\t\tint statusCode = HttpHeaderToStatus(conn.getHeaderField(0));\n\n\t\tresponse.setStatus(statusCode != -1 ? HttpServletResponse.SC_OK : statusCode);\n\n\t\tint contentlength = getContentLength(conn);\n\t\tif (contentlength >= 0) {\n\t\t\tresponse.setContentLength(contentlength);\n\n\t\t\tString mimeType = computeMimeType(filename, conn);\n\t\t\tresponse.setContentType(mimeType);\n\n\t\t\t// We want to use a writer if we are sending text\n\t\t\tif (mimeType.startsWith(\"text/\")) //$NON-NLS-1$\n\t\t\t{\n\t\t\t\tPrintWriter writer = response.getWriter();\n\n\t\t\t\twriter.flush(); /* write the headers and unbuffer the output */\n\n\t\t\t\tdoDelay(filename, 150);\n\n\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n\t\t\t\tchar buffer[] = new char[4096];\n\t\t\t\tint read;\n\t\t\t\twhile ((read = reader.read(buffer, 0, buffer.length)) != -1) {\n\t\t\t\t\twriter.write(buffer, 0, read);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tServletOutputStream out = response.getOutputStream();\n\n\t\t\t\tout.flush(); /* write the headers and unbuffer the output */\n\n\t\t\t\tdoDelay(filename, 150);\n\n\t\t\t\tbyte buffer[] = new byte[4096];\n\t\t\t\tint read;\n\t\t\t\twhile ((read = in.read(buffer, 0, buffer.length)) != -1) {\n\t\t\t\t\tout.write(buffer, 0, read);\n\t\t\t\t\tout.flush();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void parseServerFile() throws IOException {\r\n /* Creates new Scanner object of the filePath */\r\n Scanner scan = new Scanner(filePath).useDelimiter(\"version=\");\r\n /* Creates new Scanner object for the server version */\r\n Scanner scanVersion = new Scanner(scan.next()).useDelimiter(\"name=\");\r\n /* Sets the server version number */\r\n this.setVersion(scanVersion.next());\r\n /* Creates new Scanner object for the server name */\r\n Scanner scanName = \r\n new Scanner(scanVersion.next()).useDelimiter(\"host=\");\r\n /* Sets the server name */\r\n this.setName(scanName.next());\r\n /* Creates new Scanner object for the server ip address */\r\n Scanner scanAddress = new Scanner(scanName.next());\r\n /* Sets the server ip address */\r\n this.setIPAddress(scanAddress.next()); \r\n }",
"public void runFile(String filename) {\n }",
"public void run() {\n String fileName;\n DataInputStream in;\n byte[] arr = new byte[5000];\n try {\n //getting the file name from client\n in = new DataInputStream(clientSocket.getInputStream());\n fileName = in.readUTF();\n // calling the function to send the file back to the client\n sendDataToClient(s3, fileName);\n //read file from disk\n FileInputStream fis = new FileInputStream(\"/home/ubuntu/\" + fileName);\n BufferedInputStream bis = new BufferedInputStream(fis);\n //output stream for socket\n BufferedOutputStream out = new BufferedOutputStream(clientSocket.getOutputStream());\n // if the file is for getting RTT\n if ( !fileName.equals(\"RTTFile.txt\") )\n System.out.println(\"\\n Serving file: \" + fileName + \"\\n\");\n // writing to streams\n int count;\n while ((count = bis.read(arr)) > 0) {\n out.write(arr, 0, count);\n }\n // flushing and closing all the open streams\n out.flush();\n out.close();\n fis.close();\n bis.close();\n clientSocket.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public Response serve(IHTTPSession session) {\n\t\tMap<String, String> files = new HashMap<String, String>();\n\t\tMethod method = session.getMethod();\n\t\tif (Method.PUT.equals(method) || Method.POST.equals(method)) {\n\t\t\ttry {\n\t\t\t\tsession.parseBody(files);\n\t\t\t} catch (IOException ioe) {\n\t\t\t\treturn newFixedLengthResponse(Response.Status.INTERNAL_ERROR,\n\t\t\t\t\t\tNanoHTTPDSingleFile.MIME_PLAINTEXT, \"SERVER INTERNAL ERROR: IOException: \"\n\t\t\t\t\t\t\t\t+ ioe.getMessage());\n\t\t\t} catch (ResponseException re) {\n\t\t\t\treturn newFixedLengthResponse(re.getStatus(), NanoHTTPDSingleFile.MIME_PLAINTEXT,\n\t\t\t\t\t\tre.getMessage());\n\t\t\t}\n\t\t}\n\n\t\tMap<String, String> parms = session.getParms();\n\t\tparms.put(NanoHTTPDSingleFile.QUERY_STRING_PARAMETER, session.getQueryParameterString());\n\t\treturn serve(session.getUri(), method, session.getHeaders(), parms, files);\n\t}",
"public static void main(String[] args) throws NumberFormatException,\n IOException\n {\n int port = 0;\n String address = \"127.0.0.1\";\n String path = \"\";\n\n if (args.length % 2 == 0) {\n for (int i = 0; i < args.length; i++) {\n if (args[i].equals(\"-a\")) {\n address = args[i + 1];\n }\n if (args[i].equals(\"-d\")) {\n path = args[i + 1];\n }\n if (args[i].equals(\"-p\")) {\n port = Integer.parseInt(args[i + 1]);\n }\n }\n }\n\n if (port != 0 && !path.equals(\"\")) {\n new FileServer().launch(port, path, address);\n } else {\n System.out\n .println(\"> arguments must be : -p [port] -d [path of the file system] -a (optionnal) [address]\");\n }\n }",
"public void broadcastfile(int size, String file_name, byte[] file){\r\n Server.getUsers().forEach((user) -> {\r\n if(!user.getName().equals(this.name)){\r\n user.sendfile(size, file_name, file);\r\n }\r\n \r\n });\r\n \r\n }",
"private void handleStor(String file) {\n if (file == null) {\n sendMsgToClient(\"501 No filename given\");\n } else {\n File f = new File(currDirectory + fileSeparator + file);\n\n if (f.exists()) {\n sendMsgToClient(\"550 File already exists\");\n }\n\n else {\n\n // Binary mode\n if (transferMode == transferType.BINARY) {\n BufferedOutputStream fout = null;\n BufferedInputStream fin = null;\n\n sendMsgToClient(\"150 Opening binary mode data connection for requested file \" + f.getName());\n\n try {\n // create streams\n fout = new BufferedOutputStream(new FileOutputStream(f));\n fin = new BufferedInputStream(dataConnection.getInputStream());\n } catch (Exception e) {\n debugOutput(\"Could not create file streams\");\n }\n\n debugOutput(\"Start receiving file \" + f.getName());\n\n // write file with buffer\n byte[] buf = new byte[1024];\n int l = 0;\n try {\n while ((l = fin.read(buf, 0, 1024)) != -1) {\n fout.write(buf, 0, l);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n // close streams\n try {\n fin.close();\n fout.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n\n debugOutput(\"Completed receiving file \" + f.getName());\n\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n\n }\n\n // ASCII mode\n else {\n sendMsgToClient(\"150 Opening ASCII mode data connection for requested file \" + f.getName());\n\n BufferedReader rin = null;\n PrintWriter rout = null;\n\n try {\n rin = new BufferedReader(new InputStreamReader(dataConnection.getInputStream()));\n rout = new PrintWriter(new FileOutputStream(f), true);\n\n } catch (IOException e) {\n debugOutput(\"Could not create file streams\");\n }\n\n String s;\n\n try {\n while ((s = rin.readLine()) != null) {\n rout.println(s);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n try {\n rout.close();\n rin.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n }\n\n }\n closeDataConnection();\n }\n\n }",
"private static void SendFileToServer(String user, Object filename,Socket soc) {\r\n \r\n\t\tFile From = new File(\"C:/Users/harsh/Desktop/\"+user+\"/\"+filename); //path of client directory\r\n\t\tFile To = new File(\"C:/Users/harsh/Desktop/Server/\"+filename); //path of server directory\r\n\t\t\r\n\t\ttry {\r\n\r\n\t\t\tFileUtils.copyFile(From, To); //Apache File Utils library function to copy file from one location to another location\r\n\t\t\tSystem.out.println(\"File:\" +filename+ \" uploaded on server sucessfully !!\"); //let user know file has been uploaded to server\r\n\t\t\tSystem.out.println(\"------------------------------------------------------------------\");\r\n\t\t\t\r\n\t\t\tDataOutputStream dos=new DataOutputStream(soc.getOutputStream());\r\n\t\t\tdos.writeUTF(\"File: \"+filename+\" uploaded by user: \"+user);\r\n\t\t\tdos.writeUTF(user);\r\n \t\r\n\t\t\tWatchDirectory(user, soc); // function call to continue watching User directory\r\n\t\t} \r\n\t\tcatch (IOException e) {\r\n\t\t\t//print error (if any)\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"private void handleRetr(String file) {\n File f = new File(currDirectory + fileSeparator + file);\n\n if (!f.exists()) {\n sendMsgToClient(\"550 File does not exist\");\n }\n\n else {\n\n // Binary mode\n if (transferMode == transferType.BINARY) {\n BufferedOutputStream fout = null;\n BufferedInputStream fin = null;\n\n sendMsgToClient(\"150 Opening binary mode data connection for requested file \" + f.getName());\n\n try {\n // create streams\n fout = new BufferedOutputStream(dataConnection.getOutputStream());\n fin = new BufferedInputStream(new FileInputStream(f));\n } catch (Exception e) {\n debugOutput(\"Could not create file streams\");\n }\n\n debugOutput(\"Starting file transmission of \" + f.getName());\n\n // write file with buffer\n byte[] buf = new byte[1024];\n int l = 0;\n try {\n while ((l = fin.read(buf, 0, 1024)) != -1) {\n fout.write(buf, 0, l);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n // close streams\n try {\n fin.close();\n fout.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n\n debugOutput(\"Completed file transmission of \" + f.getName());\n\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n\n }\n\n // ASCII mode\n else {\n sendMsgToClient(\"150 Opening ASCII mode data connection for requested file \" + f.getName());\n\n BufferedReader rin = null;\n PrintWriter rout = null;\n\n try {\n rin = new BufferedReader(new FileReader(f));\n rout = new PrintWriter(dataConnection.getOutputStream(), true);\n\n } catch (IOException e) {\n debugOutput(\"Could not create file streams\");\n }\n\n String s;\n\n try {\n while ((s = rin.readLine()) != null) {\n rout.println(s);\n }\n } catch (IOException e) {\n debugOutput(\"Could not read from or write to file streams\");\n e.printStackTrace();\n }\n\n try {\n rout.close();\n rin.close();\n } catch (IOException e) {\n debugOutput(\"Could not close file streams\");\n e.printStackTrace();\n }\n sendMsgToClient(\"226 File transfer successful. Closing data connection.\");\n }\n\n }\n closeDataConnection();\n\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n response.setContentType(\"text/plain\");\r\n PrintWriter pw = response.getWriter();\r\n pw.println(\"Welcome to the Airline Server\");\r\n pw.flush();\r\n\r\n String name = getParameter(\"name\", request);\r\n String src = getParameter(\"src\", request);\r\n String dest = getParameter(\"dest\", request);\r\n\r\n if (name == null && src == null && dest == null) {\r\n writeAllMappings(response);\r\n } else if (name != null && src != null && dest != null) {\r\n writeAllMatchedMappings(response, name, src, dest);\r\n } else if (name != null && src == null && dest == null) {\r\n writeAllMatchedAirlineMappings(response, name);\r\n } else {\r\n pw.println(\"Error, this isn't valid URL\");\r\n pw.flush();\r\n }\r\n\r\n }",
"public IndexServer(int port, File fname) throws IOException {\n super(port, fname);\n }",
"public FileServer(){\n\t\tfilePath = new ConcurrentHashMap<String, String>();\n\t}",
"public void forwardResponse(int dest, String file) throws UnknownHostException, SocketException, IOException {\n InetAddress IPAddress = InetAddress.getByName(\"127.0.0.1\");\n\n // Canal de comunicação não orientado à conexão\n //DatagramSocket serverSocket = new DatagramSocket();\n\n // Montando a mensagem a ser enviada\n String msg = file + \"#\" + this.getClient() + \"#\" + this.getTtl();\n\n // Preenche o buffer de envio\n final byte[] sendData = msg.getBytes();\n\n // Montando o pacote com o offset do tamanho do nome do arquivo.\n DatagramPacket sendPacket \n = new DatagramPacket(sendData, sendData.length,\n IPAddress, dest);\n\n this.getServerSocket().send(sendPacket);\n\n // Reseta o ttl para o Peer em questao\n //this.setTtl(Peer.TTLREFERENCE);\n }",
"private void downFile(HttpServletRequest req, HttpServletResponse res, String file_path ,String file_id, String file_name) throws Exception{\n\t\tSystem.out.println(file_path);\n\t\tSystem.out.println(file_id);\n\t\tSystem.out.println(file_name);\n\t\tFile file = null;\n\t\tBufferedInputStream fin = null;\n\t\tBufferedOutputStream outs = null;\n\ttry {\n\n\t\tfile = new File(file_path + \"\\\\\" + file_id);\n\t // ���� ����\n\t int filelength = (int) file.length();\n\t byte[] bytestream = new byte[2048];\n\t int read = 0;\n\t \n\t if(!file.exists()){\n\t \tthrow new Exception(\"mis.file.noexist\");\n\t }\n\t\t\n\t fin = new BufferedInputStream(new FileInputStream(file));\n\t outs = new BufferedOutputStream(res.getOutputStream());\n\t \n\t\n\t\tString clientHead = req.getHeader(\"User-Agent\");\n\t\t\n\t\tres.setContentLength(filelength);\n\t\tif (clientHead.indexOf(\"MSIE 5.5\") > -1)\n\t\t{\t\t\t\n\t\t\tres.setContentType(\"application/x-filler; charset=EUC-KR\");\n\t\t\tres.setHeader(\"Content-Type\", \"doesn/matter;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tres.setHeader(\"Content-Type\", \"application/octet-stream;\");\n\t\t\tres.setHeader(\"Content-Disposition\", \"attachment;filename=\\\"\" + file_name + \"\\\";\");\n\t\t}\n\t\tres.setHeader (\"Content-Length\", \"\" + filelength);\n\t\n\t //try {\n\t\tif(filelength>0) {\n\t\t\twhile ((read = fin.read(bytestream)) != -1) {\n\t\t\t\touts.write(bytestream, 0, read);\n\t\t\t}\n\t\t}\n\t \n\t //close\n\t outs.close();\n\t fin.close();\n\t} catch (Exception e) {\n\t\t\n\t} finally {\n\t\tif(outs != null) { try { outs.close(); } catch(Exception e) {} }\n\t\tif(fin != null) { try { fin.close(); } catch(Exception e) {} }\n\t}\n}",
"public void run(){\r\n DataInputStream dis = null;\r\n try{\r\n dis = new DataInputStream(socket.getInputStream());\r\n while(true){\r\n String command = dis.readUTF();\r\n if(command.startsWith(\"/\")){\r\n if(command.length() > 1) listener.receivedCommand(this, command.substring(1));\r\n }\r\n else{\r\n int size = dis.readInt();\r\n if(size > limit){\r\n cleanup(false);\r\n break;\r\n }\r\n byte[] buffer = new byte[size];\r\n dis.readFully(buffer, 0, size);\r\n listener.receivedFile(this, command, buffer);\r\n }\r\n }\r\n }\r\n catch(SocketException e){ e.printStackTrace(); }\r\n catch(EOFException e){ e.printStackTrace(); }\r\n catch(IOException ioe){ ioe.printStackTrace(); }\r\n finally{ cleanup(); }\r\n \r\n if(dis != null){\r\n try{ dis.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dis = null;\r\n }\r\n }",
"public void run(){\n try{\n String line = null;\n String [] line_seg; \n\t\t int num ;\n while((line = br.readLine())!=null) {\n\t\t\t line_seg = line.split(\",\");\n\t\t num = line_seg.length;\n\t\t\tif (num == 4) {\n\t\t\t\tif (line_seg[0].equals(\"FPUT\")) {\n\t\t\t\t\tfile_name = line_seg[1];\n\t\t\t\t\tport_num_ = Integer.parseInt(line_seg[3]);\n\t\t\t\t\tnew Thread(){\n\t\t\t\t\t\tpublic void run(){\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tReceiverThread.fileServer();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}.start();\n\t\t\t\t} else if (line_seg[0].equals(\"FGET\")) {\n\t\t\t\t\t\tSocket sk = null;\n\t\t\t\t\t\ttry { \n\t\t\t\t\t\t\tsk = new Socket(line_seg[2], Integer.parseInt(line_seg[3]));\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tSystem.out.println(e);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tFile output = new File(line_seg[1]);\n\t\t\t\t\t\tFileOutputStream fos = new FileOutputStream(output);\n\t\t\t\t\t\tBufferedInputStream bis =new BufferedInputStream(sk.getInputStream());\n\t\t\t\t\t\tBufferedOutputStream bos = new BufferedOutputStream(fos);\n\t\t\t\t\t\tbyte buffer[] = new byte[1024];\n\t\t\t\t\t\tint read;\n\t\t\t\t\t\twhile((read = bis.read(buffer))!=-1) {\n\t\t\t\t\t\t\tbos.write(buffer, 0, read);\n\t\t\t\t\t\t\tbos.flush();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfos.close();\n\t\t\t\t\t\t sk.close();\n\t\t\t\t\t\tSystem.out.println(\"File downloaded\");\n\t\t\t\t }\n\t\t } // end of if (num == 4) \n\t\t else { \n\t\t\t System.out.println(line);\n\t\t }\n } // end of while\t\n } catch(Exception e) {\n \t//e.printStackTrace();\n\t } finally {\n\t\t try{\n\t\t\t if(br!=null) {\n\t\t\t\t br.close();\n\t\t\t }\n\t\t }catch(Exception ex) {}\n\t\t try {\n\t\t\t if(sock!=null){\n\t\t\t\t sock.close();\n\t\t\t }\n\t\t }catch(Exception ex){}\n }\n }",
"public FileServ() {\n\t\tsuper();\n\t}",
"public File selectServerFile() {\n\t\tint selectedIndex = -1;\n\t\ttry {\n\t\t\tthis.requestListFiles();\n\n\t\t\twhile (!(selectedIndex >= 0 && selectedIndex < this.serverFiles.length)) {\n\t\t\t\tselectedIndex = textUI.getInt(\"Which index to select?\"); \n\t\t\t}\n\n\t\t} catch (IOException | PacketException | UtilDatagramException e) {\n\t\t\tthis.showNamedError(\"Something went wrong while refreshing\"\n\t\t\t\t\t+ \" the server file list: \" + e.getLocalizedMessage());\n\t\t}\n\n\t\treturn this.serverFiles[selectedIndex];\n\t}",
"private void renderFile(HttpServletResponse resp, File file)\n\t\t\tthrows IOException {\n\t\tString mimetype = file.getMimetype();\n\t\tif (mimetype.startsWith(\"text/*\")) {\n\t\t\tmimetype += \"; charset=\" + Dc2fConstants.CHARSET.displayName();\n\t\t}\n\t\tresp.setHeader(\"Content-Type\", mimetype);\n\t\tIOUtils.copy(file.getContent(false), resp.getOutputStream());\n\t}",
"public static void sendFileOnce(File file, String servIpAddr)\n\t\t\tthrows UnknownHostException, IOException, InterruptedException {\n\t\t// Initialize string transfer module and send the string\n\t\tSendString clientStringTrans = new SendString(file.getName(), servIpAddr);\n\t\tclientStringTrans.sendString();\n\n\t\t// Allow enough time for the invocation to happen on the server\n\t\tThread.sleep(3000);\n\n\t\t// Initialize file transfer module and transfer the file\n\t\tSendFile clientFileTrans = new SendFile(file.getPath(), servIpAddr);\n\t\tclientFileTrans.sendFile();\n\t}",
"private void processIndividualFile(File file, InputStream is,\n ConnectionUtilities connections) throws IOException, InterruptedException,\n ClientWriteException, NumberFormatException {\n\n SimpleDateFormat sdf = new SimpleDateFormat( \"yyyy-MM-dd HH:mm:ss.SSS\" );\n LOG.debug( \"The file: \" + file.getAbsolutePath() + \" was last modified at \"\n + sdf.format( file.lastModified() ) );\n\n int filelength = ( int ) file.length();\n int numberOfChunks =\n ( int ) Math.ceil( ( double ) filelength / Constants.CHUNK_SIZE );\n\n routes = new String[ numberOfChunks ][];\n\n WriteFileRequest request = new WriteFileRequest( file.getAbsolutePath(), 0,\n filelength, numberOfChunks );\n for ( int sequence = 0; sequence < numberOfChunks; ++sequence )\n {\n request.setSequence( sequence );\n this.node.getControllerConnection().getTCPSender()\n .sendData( request.getBytes() );\n }\n // wait for response from controller containing routing information.\n synchronized ( lock )\n {\n lock.wait();\n }\n if ( !ableToWrite )\n {\n throw new ClientWriteException( \"The controller has not\"\n + \" received file chunk locations for the original file yet.\" );\n }\n sendWriteChunkRequest( file, is, connections, numberOfChunks );\n }",
"MovilizerRequest getRequestFromFile(Path filePath);",
"private void setFile() {\n\t}",
"private void startServer(String ip, int port, String contentFolder) throws IOException{\n HttpServer server = HttpServer.create(new InetSocketAddress(ip, port), 0);\n \n //Making / the root directory of the webserver\n server.createContext(\"/\", new Handler(contentFolder));\n //Making /log a dynamic page that uses LogHandler\n server.createContext(\"/log\", new LogHandler());\n //Making /online a dynamic page that uses OnlineUsersHandler\n server.createContext(\"/online\", new OnlineUsersHandler());\n server.setExecutor(null);\n server.start();\n \n //Needing loggin info here!\n }",
"private static void sendRequestUserTextUpload(Socket s, PrintWriter pw, String method, Boolean requestFileFlag, Boolean bodyFlag) throws IOException {\n pw.print(method + \" /\");\n if (requestFileFlag) {\n pw.print(\"UserTextUpload/\");\n }\n pw.print(\" HTTP/1.1\\r\\n\");\n //request headers formation.\n pw.print(\"Host: localhost\\r\\n\");\n pw.print(\"Content-Type: text/html\\r\\n\");\n\n //This is to add a new header with the size of the sent file.\n pw.print(\"Content-Size: \" + Files.size(Path.of(FILE_PATH)) + \"\\r\\n\");\n pw.print(\"\\r\\n\");\n pw.flush();\n\n //request body formation.\n if (bodyFlag) {\n //Change to your own txt file\n Files.copy(Path.of(FILE_PATH), s.getOutputStream());\n }\n pw.flush();\n }",
"@Override\n protected void execute(File file, int offset) throws IOException {\n }",
"abstract String getFileRoute() throws IOException;",
"public boolean sendFile(String inKey, File inFile) throws NuxeoException;",
"public void execfile(String filename) {\n }",
"public FileTransfer(int myPort){ //Receiver\n socket = new MySocket(ProtocolStack.getLocalhost().getLogicalID(),myPort);\n socket.bindServer();\n socket.accept();\n step = STEP_WAITING_TO_RECEIVE;\n }",
"@Override\n public void receivedReply(final SelectFileReply reply) {\n }",
"protected void doFile(HttpServletRequest request, HttpServletResponse response, String path, String mimeType, boolean dynamic) throws IOException\n {\n if (!dynamic && isUpToDate(request, path))\n {\n response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);\n return;\n }\n \n String output;\n \n synchronized (scriptCache)\n {\n output = (String) scriptCache.get(path);\n if (output == null)\n {\n StringBuffer buffer = new StringBuffer();\n \n String resource = DwrConstants.PACKAGE + path;\n InputStream raw = getClass().getResourceAsStream(resource);\n if (raw == null)\n {\n throw new IOException(\"Failed to find resource: \" + resource); //$NON-NLS-1$\n }\n \n BufferedReader in = new BufferedReader(new InputStreamReader(raw));\n while (true)\n {\n String line = in.readLine();\n if (line == null)\n {\n break;\n }\n \n if (dynamic)\n {\n if (line.indexOf(PARAM_HTTP_SESSIONID) != -1)\n {\n line = LocalUtil.replace(line, PARAM_HTTP_SESSIONID, request.getSession(true).getId());\n }\n \n if (line.indexOf(PARAM_SCRIPT_SESSIONID) != -1)\n {\n line = LocalUtil.replace(line, PARAM_SCRIPT_SESSIONID, generator.generateId(pageIdLength));\n }\n }\n \n buffer.append(line);\n buffer.append('\\n');\n }\n \n output = buffer.toString();\n \n if (mimeType.equals(MimeConstants.MIME_JS) && scriptCompressed)\n {\n output = JavascriptUtil.compress(output, compressionLevel);\n }\n \n if (!dynamic)\n {\n scriptCache.put(path, output);\n }\n }\n }\n \n response.setContentType(mimeType);\n response.setDateHeader(HttpConstants.HEADER_LAST_MODIFIED, servletContainerStartTime);\n response.setHeader(HttpConstants.HEADER_ETAG, etag);\n \n PrintWriter out = response.getWriter();\n out.println(output);\n out.flush();\n }",
"public void run(){\n\t\tstartServer();\n\t}",
"public void start()\n {\n FileVector = FileHandler.getFileList( harvesterDirName , filterArray, false );\n iter = FileVector.iterator();\n }",
"public void onFTP(\r\n final String senderIP, \r\n final String senderName, \r\n final String fileName,\r\n final String fullpath,\r\n final int socketNo,\r\n final long fileLength) {\n // Process this ftp request with a thread so that\r\n // further messages can be processed without waiting for\r\n // finishing of this ftp.\r\n //\r\n Thread ftpThread = new Thread() {\r\n public void run() {\r\n\t\t\t\tFile \tselectedFile\t= null;\r\n\r\n\t\t\t\tsynchronized (FTPListenerImpl.this) {\r\n\t\t\t\t\tif (fFileChooser == null) {\r\n\t\t\t\t\t\tfFileChooser = new JFileChooser(\".\");\r\n\t\t\t\t\t\tfFileChooser.setDialogTitle(\"MessagingTool: \" + StringDefs.SAVE_FILE_AS);\r\n\t\t\t\t\t}\r\n\t\t\t\t \tselectedFile = new File(fFileChooser.getCurrentDirectory(), fileName);\r\n\t\t\t\t\tComponentUtil.overlapComponents(fFileChooser, fParentFrame, 32, false);\r\n\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\tfFileChooser.setSelectedFile(selectedFile);\r\n\t\t\t\t\t\tint status = fFileChooser.showSaveDialog(fParentFrame);\r\n\t\t\t\t\t\tif (status != JFileChooser.APPROVE_OPTION)\r\n \t\t\t\t \t\treturn;\r\n\r\n\t\t\t\t \t\tselectedFile = fFileChooser.getSelectedFile();\r\n\t\t\t\t\t\tif (!selectedFile.exists()) \r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tObject[] options = { StringDefs.YES, StringDefs.NO };\r\n\r\n\t\t\t\t\t\t\tfParentFrame.getToolkit().beep();\r\n\t\t\t\t\t\t\tint choice = JOptionPane.showOptionDialog(fParentFrame,\r\n\t\t\t\t\t\t\t\tselectedFile + StringDefs.FILE_EXISTS,\r\n\t\t\t\t\t\t\t\t\"\",\r\n\t\t\t\t\t\t\t\tJOptionPane.YES_NO_OPTION,\r\n\t\t\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE,\r\n\t\t\t\t\t\t\t\tnull, options, options[0]);\r\n\t\t\t\t\t \t\tif (choice == JOptionPane.YES_OPTION)\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t \t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n \r\n FileOutputStream outStream = null;\r\n\r\n try {\r\n outStream = new FileOutputStream(selectedFile);\r\n if (FTP.getInstance().retrieve(senderIP, fullpath, fileName, outStream, socketNo, fileLength))\r\n outStream.close();\r\n else {\r\n outStream.close();\r\n selectedFile.delete();\r\n }\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n selectedFile.delete();\r\n return;\r\n }\r\n }\r\n };\r\n\r\n ftpThread.setDaemon(true);\r\n ftpThread.start();\r\n }",
"public ZwischenServer() throws IOException{\n\t\tFile paramfile = new File(\"/home/tobi/uniworks/netzwerke/UE2/Parameter.txt\");\n\t\tif(paramfile.canRead()){\n\t\t\tInputStream paramIs = new FileInputStream(paramfile);\n\t\t\tInputStreamReader paramIsr = new InputStreamReader(paramIs);\n\t\t\tBufferedReader paramBr = new BufferedReader(paramIsr);\n\t\t\tth = paramBr.readLine();\n\t\t\tcontent = th.substring(th.indexOf(' ', 0), th.length());\n\t\t\tth = th.substring(0, th.indexOf(' ', 0));\n\t\t\texchangeContent = content.substring(content.indexOf(';'), content.indexOf(')')-1);\n\t\t\tcontent = content.substring(content.indexOf('('), content.indexOf(';'));\n\t\t\tsocket8082 = new Socket(\"127.0.0.1\",8082);\n\t\t\tsocket80 = new Socket(th,80);\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Error file not found\");\n\t}",
"public void runServer() throws IOException {\n runServer(0);\n }",
"@Override\n\tpublic void run(){\n\t\tSystem.out.println(\"run\");\n\t\ttry {\n\t\t\tString firstLine = inFromClient.readLine();\n\t\t\tSystem.out.println(\"Received: \" + firstLine);\n\n\t\t\tboolean badRequest = false;\n\t\t\tString[] array = firstLine.split(\" \");\n\t\t\tString HTTPcommand = array[0];\n\t\t\tString URI = array[1];\n\t\t\tString HTTPversion = array[2];\n\t\t\tString path = \"\";\n\t\t\t\n\t\t\tint indexSlash = URI.lastIndexOf(\"/\");\n\t\t\tSystem.out.println(indexSlash);\n\t\t\tpath = URI.substring(indexSlash+1, URI.length());\n\n\t\t\t\n\t\t\tString secondLine = inFromClient.readLine();\n\t\t\tif (!HTTPversion.equals(\"HTTP/1.1\")) {\n\t\t\t\tbadRequest = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (badRequest) {\n\t\t\t\tout.println(\"HTTP/1.1 400 Bad Request\");\n\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\tout.flush();\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tswitch(HTTPcommand){\n\t\t\t\tcase \"HEAD\": Head.head(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"GET\": Get.get(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"PUT\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPut.put(inFromClient, path);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"POST\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPost.post(inFromClient, path);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault: {\n\t\t\t\t\tout.println(\"HTTP/1.1 501 Not Implemented\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\t//run();\n\n\t\t//inFromClient.close();\n\t\t//serverSocket.close();\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException\n {\n resp.setContentType(\"text/html;charset=UTF-8\");\n\n final Part filePart = req.getPart(\"file\");\n final String fileName = getFileName(filePart);\n\n File file = new File(Config.fileDirectory + File.separator + fileName);\n\n // TODO: return error saying file exists\n if(file.exists())\n {\n resp.setStatus(resp.SC_BAD_REQUEST);\n req.getRequestDispatcher(\"/\").forward(req, resp);\n return;\n }\n\n OutputStream out = null;\n InputStream fileContent = null;\n final PrintWriter writer = resp.getWriter();\n\n try\n {\n out = new FileOutputStream(new File(Config.fileDirectory + File.separator\n + fileName));\n fileContent = filePart.getInputStream();\n\n int read = 0;\n final byte[] bytes = new byte[1024];\n\n while ((read = fileContent.read(bytes)) != -1)\n out.write(bytes, 0, read);\n\n log.info(\"File {} being uploaded to {}\", fileName, Config.fileDirectory);\n }\n catch (FileNotFoundException fne)\n {\n log.error(\"Problems during file upload. Error: {}\", fne.getMessage());\n }\n finally\n {\n req.getRequestDispatcher(\"/\").forward(req, resp);\n if (out != null)\n out.close();\n if (fileContent != null)\n fileContent.close();\n if (writer != null)\n writer.close();\n }\n }",
"public void run() {\n //we are now inside our own thread separated from the gui.\n ServerSocket serversocket = null;\n //Pay attention, this is where things starts to cook!\n try {\n //print/send message to the guiwindow\n s(\"Trying to bind to localhost on port \" + Integer.toString(port) + \"...\");\n //make a ServerSocket and bind it to given port,\n serversocket = new ServerSocket(port);\n } catch (Exception e) { //catch any errors and print errors to gui\n s(\"\\nFatal Error:\" + e.getMessage());\n return;\n }\n\n //go in a infinite loop, wait for connections, process request, send response\n while (true) {\n s(\"\\nReady, Waiting for requests...\\n\");\n try {\n //this call waits/blocks until someone connects to the port we\n //are listening to\n Socket connectionsocket = serversocket.accept();\n //figure out what ipaddress the client commes from, just for show!\n InetAddress client = connectionsocket.getInetAddress();\n //and print it to gui\n s(client.getHostName() + \" connected to server.\\n\");\n //Read the http request from the client from the socket interface\n //into a buffer.\n BufferedReader input =\n new BufferedReader(new InputStreamReader(connectionsocket.getInputStream()));\n //Prepare a outputstream from us to the client,\n //this will be used sending back our response\n //(header + requested file) to the client.\n DataOutputStream output =\n new DataOutputStream(connectionsocket.getOutputStream());\n\n //as the name suggest this method handles the http request, see further down.\n //abstraction rules\n http_handler(input, output);\n } catch (Exception e) { //catch any errors, and print them\n s(\"\\nError:\" + e.getMessage());\n }\n\n } //go back in loop, wait for next request\n }",
"protected void handleGet(final String filename) {\r\n\t\tSystem.out.printf(\"Preparing to send %s ... %n\", filename);\r\n\r\n\t\t// CHECK EXISTANCE OF FILE, AND SEND LENGTH\r\n\t\tFile file = new File(getFilePath(filename));\r\n\t\tif (!file.exists()) {\r\n\t\t\tSystem.err.printf(\"%s does not exist.%n\", file);\r\n\t\t\tsendMessage(String.valueOf(ERROR));\r\n\t\t} else {\r\n\t\t\t// send length\r\n\t\t\tSystem.out.printf(\"Sending length ... \");\r\n\t\t\tsendMessage(String.valueOf(file.length()));\r\n\t\t\tSystem.out.printf(\"done.%n\");\r\n\r\n\t\t\t// send data\r\n\t\t\tbyte[] data = readFile(file);\r\n\t\t\tsendData(data);\r\n\t\t}\r\n\t}",
"protected final void sendFile(final File file) {\n\t\t// almacenamos el fichero a enviar\n\t\tthis.file = file;\n\t\t// cambiamos al modo transferencia\n\t\tthis.setLocalStage(Stage.FILE);\n\t\t// soliticamos el envio del fichero\n\t\tthis.send(Commands.FILE);\n\t}",
"public static String sendFile(File file, String hostName) {\r\n\t\tbyte[] buffer = new byte[BUFFER_SIZE];\r\n\t\tSocket socket = null;\r\n\t\tSystem.out.println(\"start\");\r\n\r\n\t\tInputStream inputStream = null;\r\n\t\tOutputStream outputStream = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tsocket = new Socket(hostName, PORT_NUMBER);\r\n\t\t\tsocket.setSoTimeout(Timeout);\r\n\t\t\tinputStream = new FileInputStream(file);\r\n\t\t\toutputStream = socket.getOutputStream();\r\n\r\n\t\t\tint fileLength = 0;\r\n\t\t\twhile ((fileLength = inputStream.read(buffer)) > 0) {\r\n\t\t\t\toutputStream.write(buffer, 0, fileLength);\r\n\t\t\t}\r\n\t\t\toutputStream.flush();\r\n\t\t\toutputStream.close();\r\n\t\t\tinputStream.close();\r\n\t\t\tsocket.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\treturn ERROR_STATUS;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tThread.sleep(NetworkConstants.WaitTime);\r\n\t\t} catch (InterruptedException e) {\r\n\r\n\t\t}\r\n\t\treturn SUCCESS_STATUS;\r\n\t}",
"public void OnFileIncoming(int length);",
"void downloadingFile(String path);",
"public Server() throws IOException {\n FileInputStream fistream = null;\n BufferedInputStream bistream = null;\n OutputStream ostream = null;\n ServerSocket ss = null;\n Socket socket = null;\n\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Input file path\");\n filepath = sc.nextLine();\n\n try {\n ss = new ServerSocket(PORT);\n while (true) {\n System.out.println(\"Waiting...\");\n\n try {\n socket = ss.accept();\n System.out.println(\"Accepted connection : \" + socket);\n\n // send file\n File myFile = new File (filepath);\n byte [] mybytearray = new byte [(int)myFile.length()];\n\n fistream = new FileInputStream(myFile);\n bistream = new BufferedInputStream(fistream);\n bistream.read(mybytearray,0,mybytearray.length);\n ostream = socket.getOutputStream();\n\n System.out.println(\"Sending \" + filepath + \"(\" + mybytearray.length + \" bytes)\");\n\n ostream.write(mybytearray,0,mybytearray.length);\n ostream.flush();\n\n System.out.println(\"Done.\");\n }\n finally {\n if (bistream != null) bistream.close();\n if (ostream != null) ostream.close();\n if (socket!=null) socket.close();\n }\n }\n }\n finally {\n if (ss != null) ss.close();\n }\n }",
"private void processRequest() throws Exception {\n\t\tString server_url = \"http://localhost:\" + socket.getPort() + \"/\";\n\t\tSystem.out.println(\"server \" + server_url);\n\t\tURL url = new URL(server_url);\n\t\tSystem.out.println(\"URL \" + url);\n\t\tInputStream in = socket.getInputStream();\n\t\tDataOutputStream op = new DataOutputStream(socket.getOutputStream());\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(in));\n\t\tString requestLine = br.readLine();\n\t\tSystem.out.println();\n\t\t// information from the connection objects,\n\t\tSystem.out.println(\"------------------------------------------\");\n\t\tSystem.out.println(\"Information from the connection objects\");\n\t\tSystem.out.println(\"------------------------------------------\");\n\t\tSystem.out.println(\"RequestLine \" + requestLine);\n\t\tSystem.out.println(\"Connection received from \" + socket.getInetAddress().getHostName());\n\t\tSystem.out.println(\"Port : \" + socket.getPort());\n\t\tSystem.out.println(\"Protocol : \" + url.getProtocol());\n\t\tSystem.out.println(\"TCP No Delay : \" + socket.getTcpNoDelay());\n\t\tSystem.out.println(\"Timeout : \" + socket.getSoTimeout());\n\t\tSystem.out.println(\"------------------------------------------\");\n\t\tSystem.out.println();\n\t\tString headerLine = null;\n\t\twhile ((headerLine = br.readLine()).length() != 0) {\n\t\t\tSystem.out.println(headerLine);\n\t\t}\n // Creating the StringTokenizer and passing requestline in constructor .\n\t\t//tokens object split the requestline and create the token \n\t\tStringTokenizer tokens = new StringTokenizer(requestLine);\n\n\t\ttokens.nextToken(); // skip over the method, which should be “GET”\n\t\tString fileName = tokens.nextToken();\n\t\t// Prepend a “.” so that file request is within the current directory.\n\t\tfileName = \".\" + fileName;\n\t\tSystem.out.println(\"FileName GET\" + fileName);\n\t\t// Open the requested file.\n\t\tFileInputStream fis = null;\n\t\tboolean fileExists = true;\n\t\ttry {\n\t\t\tfis = new FileInputStream(fileName);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tfileExists = false;\n\t\t}\n\t\t// Construct the response message.\n\t\tString statusLine = null;\n\t\tString contentTypeLine = null;\n\t\tString entityBody = null;\n\t\t//Check file exist in directory or not\n\t\tif (fileExists) {\n\t\t\tstatusLine = \"200 OK \";\n\t\t\tcontentTypeLine = \"Content-Type:\" + contentType(fileName) + CRLF;\n\t\t} else {\n\t\t\tstatusLine = \"HTTP/1.1 404 Not Found:\";\n\t\t\tcontentTypeLine = \"Content-Type: text/html\" + CRLF;\n\t\t\tentityBody = \"<HTML>\" + \"<HEAD> <TITLE> Not Found</TITLE></HEAD>\" + \"<BODY> Not Found</BODY><HTML>\";\n\t\t}\n\t\t// Send the status line.\n\t\top.writeBytes(statusLine);\n\t\top.writeBytes(CRLF);\n\t\t// Send the content type line.\n\t\top.writeBytes(contentTypeLine);\n\n\t\t// Send a blank line to indicate the end of the header lines.\n\t\top.writeBytes(CRLF);\n\t\t// Send the entity body.\n\t\tif (fileExists) {\n\n\t\t\tsendBytes(fis, op);\n\n\t\t\tfis.close();\n\t\t} else {\n\t\t\top.writeBytes(entityBody);\n\t\t}\n//close the open objects\n\t\top.close();\n\t\tbr.close();\n\t\tsocket.close();\n\n\t}",
"public void doPut() throws IOException {\n\n String otherContent = \".\";\n\n int contentLength = 0;\n\n while (!otherContent.equals(\"\")) {\n otherContent = in.readLine();\n if (otherContent.startsWith(\"Content-Length\")) {\n contentLength = Integer.parseInt(otherContent.split(\" \")[1]);\n }\n }\n\n char[] buffer = new char[contentLength];\n this.in.read(buffer, 0, contentLength); // read parameter\n\n String parameters = decodeValue(new String(buffer));\n System.out.println(\"Param \" + parameters);\n byte[] contentByte = parameters.getBytes();\n // traiter le buffer\n\n String path = RESOURCE_DIRECTORY + this.url;\n\n File file = new File(path);\n\n if (file.exists() && !file.isDirectory()) {\n Files.write(Paths.get(path), contentByte);\n statusCode = NO_CONTENT;\n } else {\n if (file.createNewFile()) {\n Files.write(Paths.get(path), contentByte);\n statusCode = CREATED;\n } else {\n statusCode = FORBIDEN;\n }\n\n }\n\n //Response to client\n sendHeader(statusCode, \"text/html\", contentByte.length);\n\n }",
"public void getCache(int docid){\n try {\n FileReader fr;\n String file_name = ServerThread.collection_path+docid+\".html\";\n fr = new FileReader(file_name);\n BufferedReader file_input = new BufferedReader(fr);\n String line;\n String file_content=\"\";\n while ((line = file_input.readLine()) != null) {\n file_content += line;\n }\n fr.close(); \n send(file_content);\n //System.out.println(file_content); \n } \n catch (IOException ex) {\n Logger.getLogger(ServerThread.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Could not access file: \"+docid);\n } \n }",
"void fileDownloaded(String path);",
"@Override\r\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{\n File blueCheck = new File(request.getParameter(\"filename\"));\r\n String pathToWeb = getServletContext().getRealPath(\"/\" + blueCheck);\r\n\r\n ServletContext cntx= request.getServletContext();\r\n String mime = cntx.getMimeType(pathToWeb);\r\n\r\n response.setContentType(mime);\r\n try {\r\n File file = new File(pathToWeb);\r\n response.setContentLength((int) file.length());\r\n\r\n FileInputStream in = new FileInputStream(file);\r\n OutputStream out = response.getOutputStream();\r\n\r\n // Copy the contents of the file to the output stream\r\n byte[] buf = new byte[1024];\r\n int count;\r\n while ((count = in.read(buf)) >= 0) {\r\n out.write(buf, 0, count);\r\n }\r\n out.close();\r\n in.close();\r\n\r\n response.setHeader(\"Content-Transfer-Encoding\", \"binary\");\r\n response.setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" + blueCheck.getName() + \"\\\"\");//fileName;\r\n } catch(Exception e) {\r\n response.getWriter().write(e.getMessage());\r\n }\r\n\r\n\r\n }",
"public static Result servePackFile(String file)\n {\n\t\n\ttry {\n\t //note: the (virtual) 'file' is used as the cache key, see pack()\n\t Map<String, Object> cache = (Map<String, Object>) Cacher.fetchApplicationObject(CACHE_KEY);\n\t CachedPack pack = null;\n\t if (cache!=null && (pack = (CachedPack)cache.get(file))!=null) {\n\t\t/*\n\t\t * TODO: the packed files are stored gzipped to save memory and we return it as raw bytes,\n\t\t * but we should probably offer an alternative for browsers that don't support gzip?\n\t\t */\n\t\tresponse().setHeader(\"Content-Encoding\", \"gzip\");\n\t\tresponse().setHeader(\"Content-Length\", pack.content.length + \"\");\n\t\treturn ok(pack.content).as(pack.mimeType);\n\t }\n\t else {\n\t\t/*\n\t\t * Flush the cache; this shouldn't happen if some client doens't want to load random asset files.\n\t\t * Note: this can impact the performance, so I'm flagging this as 'error' so it pops up in the logs if it does. \n\t\t */\n\t\tLogger.error(\"Flushing the pack-cache, because we seem to miss an entry for \"+file+\" - this shouldn't happen!\");\n\t\tCacher.storeApplicationObject(CACHE_KEY, null);\n\t\treturn notFound();\n\t }\n\t}\n\tcatch (Exception e) {\n\t Logger.error(\"Error while serving pack file\", e);\n\t return internalServerError();\n\t}\n }",
"private static void writeFileToResponse(byte[] fileContent) throws IOException{\r\n\t\t// Write file to response.\r\n\t output = response.getOutputStream();\r\n\t output.write(fileContent);\r\n\t output.close();\r\n\t}",
"public void run() {\n try {\n while (true) {\n BufferedReader inFromKeyBoard = new BufferedReader(new InputStreamReader(System.in));\n OutputStream outToClient = socket.getOutputStream();\n BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n DataInputStream inFromServer = null;\n DataOutputStream outToServer = null;\n String cmd = inFromClient.readLine();\n System.out.println(\"The Client request for: \" + cmd);\n if (cmd == null)\n continue;\n\n /**\n * Process the command from client and identify the method and address.\n * If command error, write the error response and break.\n *\n */\n String[] strs = cmd.split(\" \");\n\n String method = strs[0];\n\n if (!method.equals(\"GET\")) {\n continue;\n }\n\n String url = strs[1];\n if (!url.contains(\"://\")) {\n url = url + \"http://\";\n }\n\n /**\n * Process the file name and make sure the server name, the file path and the number of port.\n *\n */\n int port = 0;\n String serverName = \"\";\n String filePath = \"\";\n\n URL new_url = new URL(url);\n serverName = new_url.getHost();\n port = new_url.getPort();\n if (port == -1) {\n port = 80;\n }\n url = url.substring(url.indexOf(\"//\") + 2);\n filePath = url.substring(url.indexOf(\"/\"));\n\n /**\n * Response the right format request. Identify the file type and write it to the client.\n *\n */\n System.out.println(\"HOST: \" + serverName);\n System.out.println(\"PORT: \" + port);\n System.out.println(filePath);\n System.out.println(\"Now respond the Client \\'s request: \");\n\n Socket clientSocket = new Socket(serverName, port);// the Proxy Server Functions as client\n\n inFromServer = new DataInputStream(clientSocket.getInputStream());\n outToServer = new DataOutputStream(clientSocket.getOutputStream());\n\n outToServer.writeBytes(\"GET \" + filePath + \" HTTP/1.0\\r\\n\\r\\n\");\n\n byte[] bytes = new byte[1024];\n\n int size = 0;\n\n /**\n * Read from Server and Write to Client.\n *\n */\n while ((size = inFromServer.read(bytes, 0, 1024)) != -1) {\n outToClient.write(bytes, 0, size);\n outToClient.flush();\n }\n break;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n // close the socket\n finally {\n try {\n if (socket != null) {\n socket.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"abstract public void acceptFile(File file);"
] | [
"0.7076866",
"0.64294785",
"0.6419111",
"0.6418465",
"0.63023865",
"0.62775004",
"0.6257639",
"0.62280035",
"0.62241787",
"0.618462",
"0.61592084",
"0.6101796",
"0.6048826",
"0.59900415",
"0.59877425",
"0.59790677",
"0.5969708",
"0.5963221",
"0.59606004",
"0.5957954",
"0.5952402",
"0.58950645",
"0.58660704",
"0.5863856",
"0.5855555",
"0.583613",
"0.5799615",
"0.57750416",
"0.5772993",
"0.5768614",
"0.5766951",
"0.5757568",
"0.5736505",
"0.57232547",
"0.57213336",
"0.57105565",
"0.5701285",
"0.56740296",
"0.5662528",
"0.5653326",
"0.56454074",
"0.5642188",
"0.5635471",
"0.5613192",
"0.5596334",
"0.5589728",
"0.55696005",
"0.5560412",
"0.553795",
"0.5534192",
"0.5528132",
"0.5522343",
"0.5502167",
"0.5497236",
"0.5494069",
"0.54923546",
"0.5484659",
"0.54762447",
"0.54757464",
"0.5471218",
"0.54616743",
"0.5461264",
"0.54596245",
"0.5456682",
"0.5455919",
"0.5442907",
"0.54371214",
"0.542773",
"0.54231983",
"0.5420736",
"0.5389985",
"0.53899837",
"0.5380024",
"0.53799254",
"0.53771603",
"0.5375509",
"0.5374097",
"0.53668994",
"0.53529316",
"0.53428346",
"0.5338706",
"0.53335214",
"0.5326335",
"0.53248626",
"0.5318853",
"0.531626",
"0.53108954",
"0.5310588",
"0.53089184",
"0.53067183",
"0.53009975",
"0.5289155",
"0.52823275",
"0.52783346",
"0.5270165",
"0.52686596",
"0.52656996",
"0.5262114",
"0.52620286",
"0.5245761"
] | 0.66993874 | 1 |
Reads the path from a HTTP request line. | private void readHttpPath(String line) {
String[] parts = line.split(" ");
if (parts.length != 3) {
channel.close();
} else {
request = new Request(parts[1].trim());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void readLine(String line) {\n\t\tif (request == null) {\n\t\t\tswitch (type) {\n\t\t\tcase JAGGRAB:\n\t\t\t\treadJaggrabPath(line);\n\t\t\t\tbreak;\n\t\t\tcase HTTP:\n\t\t\t\treadHttpPath(line);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (type == Type.HTTP) {\n\t\t\t\tif (line.length() == 0) {\n\t\t\t\t\tserve();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void readJaggrabPath(String line) {\n\t\tfinal String START = \"JAGGRAB \";\n\t\tif (line.startsWith(START)) {\n\t\t\trequest = new Request(line.substring(START.length()).trim());\n\t\t} else {\n\t\t\tchannel.close();\n\t\t}\n\t\tserve();\n\t}",
"static RequestLine readRequestLine(InputStream in) throws IOException {\n\t\tString line = readLine(in, true);\n\t\tString[] parts = line.split(\" \");\n\t\tif (parts.length != 3) {\n\t\t\tthrow new WebException(StatusCode.BAD_REQUEST, \"invalid request line: \" + line);\n\t\t}\n\t\tString method = parts[0];\n\t\tString target = parts[1];\n\t\tString path = target;\n\t\tString query = null;\n\t\tint index = target.indexOf('?');\n\t\tif (index != -1) {\n\t\t\tpath = target.substring(0, index);\n\t\t\tquery = target.substring(index + 1);\n\t\t}\n\t\treturn new RequestLine(method, target, path, query);\n\t}",
"private static StringPair getPath(BufferedReader in) throws IOException {\n StringPair sp = null;\n String line = in.readLine();\n WVM.out.println(\"\\n + + + request is: \" + line);\n String path = \"\";\n String wid = null;\n // extract class from GET line\n if (line.startsWith(\"GET /\")) {\n line = line.substring(5, line.length()-1).trim();\n int index = line.indexOf(\".class\");\n if (index != -1) {\n path = line.substring(0, index).replace('/', '.');\n } else {\n path = new StringTokenizer(line, \" \").nextToken();\n }\n if (WVM.DEBUG(3)) WVM.out.println(\"path is: \" + path);\n //see if the worklet id is supplied\n int i = line.indexOf(\"?\");\n if(i!= -1 ){\n\t //have worklet id\n\t wid = line.substring(i+1,line.length()-8);\t \n }\n } else {\n throw new IOException(\"Malformed Header in Class request\");\n }\n\n // eat the rest of header\n do {\n line = in.readLine();\n // WVM.out.println (\" + + + \" + line);\n } while ((line.length() != 0) && (line.charAt(0) != '\\r') && (line.charAt(0) != '\\n'));\n if (path.length() != 0) {\n\tsp = new StringPair(path,wid);\n // WVM.out.println(\"Edited: gskc, 19Feb01 --- returning path: \" + path);\n return sp;\n } else {\n throw new IOException(\"Malformed Header\");\n }\n }",
"private static String getRequestPath(final IWebRequest request) {\n\n String requestPath = request.getPathWithinApplication();\n\n final int fragmentIndex = requestPath.indexOf(';');\n if (fragmentIndex != -1) {\n requestPath = requestPath.substring(0, fragmentIndex);\n }\n\n return requestPath;\n\n }",
"public abstract String getRequestPathInfo();",
"protected String processPath(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException\n { //20030305AH - Store result of processPath() in request attribute so can use it later for\n //looking up stuff - such as in navigationRenderer...\n String path = super.processPath(request, response);\n request.setAttribute(PROCESSED_PATH, path);\n return path;\n }",
"private static String getPath (HttpServletRequest request) {\n String path = request.getServletPath();\n return path != null ? path : request.getPathInfo();\n }",
"public String getpathInput() {\r\n\t\treturn pathInput;\r\n\t}",
"private boolean parseRequestLine() {\n\n // the request line has the format:\n // METHOD URI HTTP/1.1 CRLF\n\n // search the buffer for CRLF to see if you can process the line, otherwise return false\n // to stop the parser from trying the next phase\n\n\n // parse the line and set the fields on this.request\n\n // don't forget to consume the line from the parser\n\n return true;\n }",
"private String getFilePath(String sHTTPRequest) {\n return sHTTPRequest.replaceFirst(\"/\", \"\");\n\n }",
"public static String parseRequest(String request) {\r\n String parsedSoFar = \"\";\r\n String file = \"\";\r\n int fileSize = 0;\r\n String s = null;\r\n \r\n if (request.length() < 14) {\r\n return s;\r\n }\r\n \t\r\n if (!request.substring(0, 4).equals(\"GET \")) {\r\n return s;\r\n }\r\n \r\n parsedSoFar = request.substring(4, request.length());\r\n \t\r\n int counter = 0;\r\n \r\n while (parsedSoFar.charAt(counter) != ' ') {\r\n counter++;\r\n }\r\n \r\n file = parsedSoFar.substring(0, counter);\r\n \r\n parsedSoFar = parsedSoFar.substring(file.length() + 1, parsedSoFar.length()).trim();\r\n \r\n if (!parsedSoFar.equals(\"HTTP/1.0\")) {\r\n return s;\r\n }\r\n \r\n return file;\r\n }",
"private String readFromClient() throws IOException {\n final String request = inFromClient.readLine();\n return request;\n }",
"public synchronized String getPath(long entry) throws IOException,\n EOFException {\n long startOfEntry = IDX_START_OF_CONTENT + (entry * bytesPerSlot);\n idx.seek(startOfEntry);\n if (idx.readChar() == '\\n')\n throw new IllegalStateException(\"No data at address \" + entry);\n idx.skipBytes(bytesPerId + bytesPerType - 2);\n \n byte[] bytes = new byte[bytesPerPath];\n idx.read(bytes);\n String line = new String(bytes, \"utf-8\");\n int delimiter = line.indexOf('\\n');\n if (delimiter < 1)\n throw new IllegalStateException(\"Found path without delimiter\");\n return new String(bytes, 0, delimiter - 1);\n }",
"public RequestLine parseRequestLine(CharArrayBuffer buffer, ParserCursor cursor) throws ParseException {\n/* 280 */ Args.notNull(buffer, \"Char array buffer\");\n/* 281 */ Args.notNull(cursor, \"Parser cursor\");\n/* 282 */ int indexFrom = cursor.getPos();\n/* 283 */ int indexTo = cursor.getUpperBound();\n/* */ \n/* */ try {\n/* 286 */ skipWhitespace(buffer, cursor);\n/* 287 */ int i = cursor.getPos();\n/* */ \n/* 289 */ int blank = buffer.indexOf(32, i, indexTo);\n/* 290 */ if (blank < 0) {\n/* 291 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ }\n/* */ \n/* 294 */ String method = buffer.substringTrimmed(i, blank);\n/* 295 */ cursor.updatePos(blank);\n/* */ \n/* 297 */ skipWhitespace(buffer, cursor);\n/* 298 */ i = cursor.getPos();\n/* */ \n/* 300 */ blank = buffer.indexOf(32, i, indexTo);\n/* 301 */ if (blank < 0) {\n/* 302 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ }\n/* */ \n/* 305 */ String uri = buffer.substringTrimmed(i, blank);\n/* 306 */ cursor.updatePos(blank);\n/* */ \n/* 308 */ ProtocolVersion ver = parseProtocolVersion(buffer, cursor);\n/* */ \n/* 310 */ skipWhitespace(buffer, cursor);\n/* 311 */ if (!cursor.atEnd()) {\n/* 312 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ }\n/* */ \n/* */ \n/* 316 */ return createRequestLine(method, uri, ver);\n/* 317 */ } catch (IndexOutOfBoundsException e) {\n/* 318 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ } \n/* */ }",
"public GetRequest(String pathInfo) throws ServletException {\r\n\r\n\t\tMatcher matcher;\r\n\r\n\t\tif (pathInfo != null) {\r\n\r\n\t\t\tmatcher = regExQueuePattern.matcher(pathInfo);\r\n\t\t\tif (matcher.find()) {\r\n\t\t\t\trequestID = Integer.parseInt(matcher.group(1));\r\n\t\t\t\tisQueuePolling = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tmatcher = regExResponsePattern.matcher(pathInfo);\r\n\t\t\tif (matcher.find()) {\r\n\t\t\t\trequestID = Integer.parseInt(matcher.group(1));\r\n\t\t\t\tisQueuePolling = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(PROXY + \"Invalid URI.\");\r\n\t\tthrow new ServletException(PROXY + \"Invalid URI.\");\r\n\t}",
"private String getResourcePath() {\n\t\tString reqResource = getRequest().getResourceRef().getPath();\n\t\treqResource = actualPath(reqResource, 1);\n\t\tLOGGERS.info(\"reqResourcePath---->\" + reqResource);\n\t\treturn reqResource;\n\t}",
"public RequestLine(String rawRequestLine) {\n\t\tparseRequestLine(rawRequestLine);\n\t}",
"public Line getLine(String targetLine);",
"private String getRequestLine(HttpConnection conn) {\n return HttpMethodBase.generateRequestLine(conn, getName(),\n getPath(), getQueryString(), getHttpVersion());\n }",
"@Nullable\n public static String getPathInfo (@Nonnull final HttpServletRequest aHttpRequest)\n {\n ValueEnforcer.notNull (aHttpRequest, \"HttpRequest\");\n final String sPathInfo = aHttpRequest.getPathInfo ();\n if (StringHelper.hasNoText (sPathInfo))\n return sPathInfo;\n\n return getWithoutSessionID (sPathInfo);\n }",
"public String getLine()\n\t{\n\t\ttry\n\t\t{\n\t\t\tline = reader.readLine();\n\t\t} catch (IOException ioe)\n\t\t{\n\t\t\t//\n\t\t}\n\n\t\treturn line;\n\t}",
"public String getLine ()\n {\n return line;\n }",
"private int getSelectedLine(HttpServletRequest request) {\n int selectedLine = -1;\n String parameterName = (String) request.getAttribute(KRADConstants.METHOD_TO_CALL_ATTRIBUTE);\n if (StringUtils.isNotBlank(parameterName)) {\n String lineNumber = StringUtils.substringBetween(parameterName, \".line\", \".\");\n selectedLine = Integer.parseInt(lineNumber);\n }\n\n return selectedLine;\n }",
"public static String parseLine(String line) {\n if (line.startsWith(\"//\") || \"\".equals(line.trim())\n || (line.startsWith(\"#\") && !line.startsWith(\"#(\"))) {\n return null;\n } else {\n String arr[] = line.split(\"[:]\");\n if (arr.length == 2) {\n return arr[1];\n } else if (arr.length == 1) {\n return arr[0];\n } else {\n assert false : \"Received line: \" + line;\n return null;\n }\n }\n }",
"public static RequestLine parseRequestLine(String value, LineParser parser) throws ParseException {\n/* 257 */ Args.notNull(value, \"Value\");\n/* */ \n/* 259 */ CharArrayBuffer buffer = new CharArrayBuffer(value.length());\n/* 260 */ buffer.append(value);\n/* 261 */ ParserCursor cursor = new ParserCursor(0, value.length());\n/* 262 */ return ((parser != null) ? parser : INSTANCE).parseRequestLine(buffer, cursor);\n/* */ }",
"private String toCompletePath(String fullRequest) {\n \n///Parse request for file path\nString requestLine[] = new String[] {\" \", \" \", \" \"};\n requestLine = fullRequest.split(\" \");\nString partialPath = requestLine[1];\n \n//If requested path is just \"/\" or \"\", don't return any path\n if(partialPath.length() <= 1) {\n noFileRequested = true;\n return null;\n }\n \nString completePath;\n//If using my Windows machine, the path is different than the school Linux machines\nif (Windows)\n completePath = \"C:/Users/Michelle/eclipse-workspace/P1\" + partialPath;\nelse\n completePath = \".\" + partialPath;\n \n return completePath;\n}",
"public String getLine() {\n\t\treturn line.toString();\n\t}",
"public String getLine() {\n return this.line;\n }",
"public static String extractPathFromPattern(final HttpServletRequest request){\r\n\r\n\t\tString path = (String) request.getAttribute(\r\n\t HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);\r\n\t String bestMatchPattern = (String ) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);\r\n\r\n\t AntPathMatcher apm = new AntPathMatcher();\r\n\t String finalPath = apm.extractPathWithinPattern(bestMatchPattern, path);\r\n\r\n\t return finalPath;\r\n\t}",
"public abstract String getRequestServletPath();",
"protected abstract Operation parseLine(File baseDir, String line, int lineNum) throws IOException;",
"public String getNextLine() throws IOException{\n String nextLine;\n\n if (this.bufferedReader == null) {\n log.error(\"{} : Input file not open when trying to read next line\", LOG_TAG);\n }\n try {\n nextLine = this.bufferedReader.readLine();\n while(nextLine != null && (StringUtils.isBlank(nextLine) || nextLine.startsWith(\"/\"))) {\n nextLine = this.bufferedReader.readLine();\n }\n } catch (IOException e) {\n log.error(\"{} : IOException, file read error {}\", LOG_TAG, e.getStackTrace());\n throw e;\n }\n\n log.debug(\"Next line read : {}\", nextLine);\n return nextLine;\n }",
"@Override\n public String getRequestURI() {\n if (httpRequest instanceof HttpRequestImpl) {\n return strip(context, ((HttpRequestImpl) httpRequest).requestRawPath());\n }\n return strip(context, super.getRequestURI());\n }",
"public static void parseFullPath(String path, IUriListener listener) {\n if (path == null) {\n path = \"\";\n }\n char[] array = path.toCharArray();\n parseFullPath(array, listener);\n }",
"public static LogDataParser praseLogRequestLine(String line)\n\t\t\tthrows NumberFormatException, PatternSyntaxException, PatternNotMatchedException {\n\t\tPATTERN = Pattern.compile(LOG_LINE_ENTRY_PATTERN);\n\t\tMatcher matcher = PATTERN.matcher(line);\n\t\tif (!matcher.find()) {\n\t\t\tthrow new PatternNotMatchedException(\"Cannot parse \" + line);\n\t\t}\n\t\treturn new LogDataParser(matcher.group(1), matcher.group(9));\n\t}",
"String readLine() throws IOException\n\t{\n\t\tString line = null;\n\t\tif (haveStreams())\n\t\t\tline = m_in.readLine();\n\t\telse\n\t\t\tline = keyboardReadLine();\n\n\t\tsetCurrentLine(line);\n\t\treturn line;\n\t}",
"PathSegments getPath();",
"protected final int getLineNumber(HttpServletRequest request) {\n int lineNumber = 0;\n String lineStr = request.getParameter(LINE_NUMBER);\n if (lineStr == null) {\n lineNumber = getSelectedLine(request);\n } else {\n try {\n lineNumber = Integer.parseInt(lineStr);\n } catch (Exception ex) {\n // do nothing; 0 will be returned\n }\n }\n return lineNumber;\n }",
"@Override\n public String readLine() throws IOException {\n checkBuffer(-1);\n this.randomAccessFile.seek(this.fileOffset + this.bufferPointer.bufferOffset);\n String line = this.randomAccessFile.readLine();\n this.fileOffset = this.randomAccessFile.getFilePointer();\n this.bufferPointer.invalidate();\n return line;\n }",
"protected void setupRequestPathExp(StringBuilder sb, RomanticTransaction tx) {\n final String requestPath = tx.getRequestPath();\n if (requestPath != null) {\n sb.append(\", \").append(requestPath);\n }\n }",
"axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }",
"public synchronized String readLineFromFile(){\n\t\tString line = null;\n\t\t\n\t\ttry{\n\n\t\t\tif((line = bufferedInput.readLine()) != null){\n\t\t\t\treturn line;\n\t\t\t}\n\t\t}\n\t\tcatch(NullPointerException ex) {\n \t\tSystem.err.println(\"File is Blank\");\t\t \n \t\tSystem.exit(1); \n\t\t}\n\t\tcatch(IOException ex) {\n System.err.println(\"Unable to read a line from file\");\t\t \n\t\t\tSystem.exit(1); \n }\n\n\t\treturn line;\n\t}",
"private static String getLine(String path, List<Parameter> parameters) {\n InputStream in = null;\n BufferedReader rd = null;\n\n try {\n in = getInputStream(path, parameters);\n rd = new BufferedReader(new InputStreamReader(in, OAuthUtils.ENC));\n final StringBuffer buf = new StringBuffer();\n String line;\n while ((line = rd.readLine()) != null) {\n buf.append(line);\n }\n return buf.toString();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n IOUtils.close(in);\n IOUtils.close(rd);\n }\n return null;\n }",
"public static String getPath(HttpServletRequest request) {\n return request.getRequestURI().substring(request.getContextPath().length());\n }",
"public String getPath() {\n if (fileType == HTTP) {\n return fileName.substring(0, fileName.lastIndexOf(\"/\"));\n } else {\n return fileName.substring(0, fileName.lastIndexOf(File.separator));\n }\n }",
"private String readLine() {\r\n\t\ttry {\r\n\t\t\treturn input.readLine();\r\n\t\t} catch (IOException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"protected void processLine(String line){}",
"public String determineTaskDetailsFromFileLine(String line) {\n int indexOfFirstSquareBracket = line.indexOf(\"[\");\n String details = line.substring(indexOfFirstSquareBracket + 8); // from unnecessary info at the front of line.\n return details;\n }",
"public String getCurrentInputString() { return line; }",
"protected Resource getResource(HttpServletRequest request) {\n String path = request.getPathInfo();\n /*\n * we want to extract everything after /spa/spaServlet from the path info.\n * This should cater for sub-directories\n */\n return getResourceLoaderBean().getResource(constructRemoteUrl(path));\n }",
"public String readLine(){\n\t\tString line;\n\t\ttry{\n\t\t\tline=scanner.nextLine();\n\t\t}catch (NoSuchElementException e){\n\t\t\tline=null;\n\t\t}\n\t\treturn line;\n\t}",
"static Path getInputPath(Configuration conf) {\n String in = conf.get(MRUtils.INPUT_PATH);\n if (in == null) {\n return null;\n }\n return new Path(in);\n }",
"public String getFileName(String request) {\n\t\tString fileName = request.substring(request.indexOf('/') + 1, request.indexOf(\" HTTP\", (request.indexOf('/'))));\n\t\tSystem.out.println(\"Filename is: \" + fileName);\n\n\t\treturn fileName;\n\t}",
"Path getRequestListFilePath();",
"public String getline() {\n\t\treturn _line;\n\t}",
"String getLine (int line);",
"public String getPath() throws Exception {\n\t\t/*\n\t\t * return \"/news-oppsRecord\" + doc.selectSingleNode\n\t\t * (\"/metadataFieldInfo/field/@path\").getText();\n\t\t */\n\t\treturn doc.selectSingleNode(\"/metadataFieldInfo/field/@path\").getText();\n\t}",
"public MountRequest(String p){\n\t\tpath = p;\n\t}",
"String getRealPath(String path);",
"public static void parseFullPath(char[] path, IUriListener listener) {\n UriParser parser = new UriParser(listener);\n parser.parseFullPath(path, 0);\n }",
"public String getPath() {\n\t\treturn getString(\"path\");\n\t}",
"public abstract String readLine() throws IOException, InterruptedException;",
"public static void addPaths(String pathLine) {\n if (pathLine == null || \"\".equals(pathLine)) {\n return;\n }\n try {\n String[] paths = pathLine.split(\"[:;]\");\n for (String path : paths) {\n if (!\"\".equals(path)) {\n addPath(path);\n }\n }\n } catch (MalformedURLException e) {\n System.out.println(\"File not found\");\n } catch (Exception e) {\n System.out.println(\"File not found\");\n }\n }",
"public String getPath()\r\n/* 26: */ {\r\n/* 27:57 */ return this.path;\r\n/* 28: */ }",
"public CommandLine getLine() {\n return line;\n }",
"private String getHttpPath(String httpPath) {\n if(httpPath == null || httpPath.equals(\"\")) {\n httpPath = \"/*\";\n }\n else {\n if(!httpPath.startsWith(\"/\")) {\n httpPath = \"/\" + httpPath;\n }\n if(httpPath.endsWith(\"/\")) {\n httpPath = httpPath + \"*\";\n }\n if(!httpPath.endsWith(\"/*\")) {\n httpPath = httpPath + \"/*\";\n }\n }\n return httpPath;\n }",
"public Path resolve(String part) {\n return Paths.get(part);\n }",
"public String getLine();",
"public String readLine() {\n BufferedReader input;\n String str = null;\n \n if (file == null || line < 0) {\n return null;\n }\n try {\n input = new BufferedReader(new FileReader(file));\n for (int i = 0; i < line; i++) {\n str = input.readLine();\n }\n input.close();\n } catch (IOException e) {\n return null;\n }\n return str;\n }",
"@Override\n public String readLine() throws IOException {\n\n String line = null;\n\n while (true) {\n\n line = super.readLine();\n\n if (line == null) {\n\n return null;\n }\n\n // Get rid of comments\n\n // VT: FIXME: not handling the escaped comments\n\n int hash = line.indexOf(\"#\");\n\n if (hash != -1) {\n\n // Check if the '#' is escaped\n\n if (hash > 0 && line.indexOf(\"\\\\#\") == hash - 1) {\n\n // Yes, it is\n\n // System.err.println( \"Raw: '\"+line+\"'\" );\n line = line.substring(0, hash - 1) + line.substring(hash, line.length());\n // System.err.println( \"Unescaped: '\"+line+\"'\" );\n\n } else {\n\n line = line.substring(0, hash);\n }\n }\n\n // Trim it\n\n line = line.trim();\n\n if (line.length() != 0) {\n\n return line;\n }\n }\n }",
"public int getLine() {\r\n return line;\r\n }",
"@Override\n public Line getLine() {\n return line;\n }",
"public String readLine() throws IOException {\n/* 176 */ String line = this.currentFilePart.readLine();\n/* 177 */ while (line == null) {\n/* 178 */ this.currentFilePart = this.currentFilePart.rollOver();\n/* 179 */ if (this.currentFilePart != null) {\n/* 180 */ line = this.currentFilePart.readLine();\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 188 */ if (\"\".equals(line) && !this.trailingNewlineOfFileSkipped) {\n/* 189 */ this.trailingNewlineOfFileSkipped = true;\n/* 190 */ line = readLine();\n/* */ } \n/* */ \n/* 193 */ return line;\n/* */ }",
"public Line getLine()\n {\n return line;\n }",
"public Line getLine(Line.Info paramInfo) throws LineUnavailableException {\n/* 128 */ Line.Info info = getLineInfo(paramInfo);\n/* */ \n/* 130 */ if (info != null && info instanceof Port.Info) {\n/* 131 */ for (byte b = 0; b < this.portInfos.length; b++) {\n/* 132 */ if (info.equals(this.portInfos[b])) {\n/* 133 */ return getPort(b);\n/* */ }\n/* */ } \n/* */ }\n/* 137 */ throw new IllegalArgumentException(\"Line unsupported: \" + paramInfo);\n/* */ }",
"public void setline(String line) {\n\t\t_line = line;\n\t}",
"private String readLine() {\n\t\ttry {\n\t\t\treturn reader.nextLine();\t\n\t\t} catch (NoSuchElementException e) {\n\t\t\treturn null;\n\t\t}\n\t}",
"public void testExtractDetailsUsingPath() {\n\t\t\n\t\tString href = when().\n\t\t\t\t\t\tget(\"http://jsonplaceholder.typicode.com/photos/1\").\n\t\t\t\t\t then().\n\t\t\t\t\t contentType(ContentType.JSON).\n\t\t\t\t\t body(\"albumId\", equalTo(1)).\n\t\t\t\t\t extract().\n\t\t\t\t\t path(\"url\");\n\t\tSystem.out.println(\"href : \" + href);\n\t\t\n\t\twhen().get(href).then().statusCode(200);\n\t}",
"public String readLine() {\n\n String temp = null;\n\n try\n {\n assert this.isValid();\t\t\t//Test that we can read the file\n temp = br.readLine();\t\t\t//Read the next line and store it as temp\n }\n\n\t\t//Catch possible exceptions\n catch(java.io.IOException e) {\n System.out.println(\"Error reading file: \" + e );\n }\n\n return temp;\n }",
"Path getPath();",
"@Override\n\t\tpublic String getRealPath(String path) {\n\t\t\treturn null;\n\t\t}",
"public abstract boolean read(String line);",
"protected String getRequestData(HttpServletRequest request) {\n\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\ttry {\n\t\t\tBufferedReader reader = request.getReader();\n\t\t\tString currentLine = \"\";\n\t\t\twhile ((currentLine = reader.readLine()) != null) {\n\n\t\t\t\tstringBuilder.append(currentLine);\n\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn stringBuilder.toString();\n\n\t}",
"public static Request parseRequest(BufferedReader input) throws IOException, IllegalStateException, SocketException\n {\n Request request = new Request();\n String line;\n Matcher matcher;\n\n // Parsing request method & uri\n if ((line = input.readLine()) == null) throw new SocketException(\"Client disconnected\");\n\n matcher = regexMethod.matcher(line);\n if (matcher.find()) {\n request.method = RtspMethod.valueOf(matcher.group(1));\n request.uri = matcher.group(2);\n LogHelper.e(TAG, \"Line: \" + line);\n LogHelper.e(TAG, \"Parsing request method & uri: \" + request.method + \" --> \" + request.uri);\n\n // Parsing headers of the request\n while ((line = input.readLine()) != null && line.length() > 3) {\n matcher = regexHeader.matcher(line);\n if (matcher.find()) {\n request.headers.put(matcher.group(1).toLowerCase(Locale.US), matcher.group(2));\n LogHelper.e(TAG, \"Parsing headers of the request: \" + line + \" | \" +\n matcher.group(1).toLowerCase(Locale.US) + \" --> \" + matcher.group(2));\n }\n }\n if (line == null) throw new SocketException(\"Client disconnected\");\n\n // It's not an error, it's just easier to follow what's happening in logcat with the request in red\n LogHelper.e(TAG, request.method + \" \" + request.uri);\n }\n\n return request;\n }",
"private void readHTTPRequest(InputStream is) {\n BufferedReader requestReader = null;\n \n while (true) {\n try {\n requestReader = new BufferedReader(new InputStreamReader(is));\n \n while (!requestReader.ready()) Thread.sleep(1);\n String line = requestReader.readLine();\n System.err.println(\"Request line: (\"+line+\")\");\n \n \n/* Get the complete path from the root directory to the file\n* If no file requested: display default content\n*/\n String rootPath = toCompletePath(line);\n if(noFileRequested) {\n HTMLcontent = \"<html><h1>Welcome to \" + serverName + \"</h1><body>\\n\" +\n \"<p>You may request a file in the URL path.</p>\\n\" +\n \"</body></html>\\n\";\n break;\n }//end\n \n /* Check if file exists\n * If not: change the status and exit\n * If so: read the contents of the file\n */\n File fileRequested = new File(rootPath);\n if(!fileRequested.exists()) {\nstreamStatus = \"HTTP/1.1 404 NOT FOUND\\n\";\nHTMLcontent = \"<html><h1>404 Error.</h1><body>\\n\" +\n \"<p>Page not found.</p>\\n\" +\n \"</body></html>\\n\";\n break;\n }\n else {\n HTMLcontent = readFile(rootPath);\n break;\n }//end\n \n \n } catch (Exception e) {\n System.err.println(\"Request error: \" + e);\n break;\n //close BufferedReader if initialized\n }//end catch\n \n }//end while loop\n}",
"public void setLine ( String value )\n {\n line = value;\n }",
"private String[] readLine( String line ) throws IOException {\n if ( StringUtils.isBlank( line ) ) {\n return null;\n }\n if ( line.startsWith( \"#\" ) ) {\n return null;\n }\n\n String[] fields = StringUtils.splitPreserveAllTokens( line, '\\t' );\n if ( fields.length < 2 ) {\n throw new IOException( \"Illegal format, expected at least 2 columns, got \" + fields.length );\n }\n return fields;\n\n }",
"String getPath() {\r\n\t\treturn path;\r\n\t}",
"public final int getLine() {\n/* 377 */ return this.bufline[this.bufpos];\n/* */ }",
"protected static String generateRequestLine(HttpConnection connection,\n String name, String requestPath, String query, String version) {\n LOG.trace(\"enter HttpMethodBase.generateRequestLine(HttpConnection, \"\n + \"String, String, String, String)\");\n\n StringBuffer buf = new StringBuffer();\n // Append method name\n buf.append(name);\n buf.append(\" \");\n // Absolute or relative URL?\n if (!connection.isTransparent()) {\n Protocol protocol = connection.getProtocol();\n buf.append(protocol.getScheme().toLowerCase());\n buf.append(\"://\");\n buf.append(connection.getHost());\n if ((connection.getPort() != -1) \n && (connection.getPort() != protocol.getDefaultPort())\n ) {\n buf.append(\":\");\n buf.append(connection.getPort());\n }\n }\n // Append path, if any\n if (requestPath == null) {\n buf.append(\"/\");\n } else {\n if (!connection.isTransparent() && !requestPath.startsWith(\"/\")) {\n buf.append(\"/\");\n }\n buf.append(requestPath);\n }\n // Append query, if any\n if (query != null) {\n if (query.indexOf(\"?\") != 0) {\n buf.append(\"?\");\n }\n buf.append(query);\n }\n // Append protocol\n buf.append(\" \");\n buf.append(version);\n buf.append(\"\\r\\n\");\n \n return buf.toString();\n }",
"@Nonnull\n public static String getPathWithinServlet (@Nonnull final HttpServletRequest aHttpRequest)\n {\n ValueEnforcer.notNull (aHttpRequest, \"HttpRequest\");\n\n final String sPathWithinApp = getPathWithinServletContext (aHttpRequest);\n final String sServletPath = aHttpRequest.getServletPath ();\n if (sPathWithinApp.startsWith (sServletPath))\n return sPathWithinApp.substring (sServletPath.length ());\n\n // Special case: URI is different from servlet path.\n // Can happen e.g. with index page: URI=\"/\", servletPath=\"/index.html\"\n // Use servlet path in this case, as it indicates the actual target path.\n return sServletPath;\n }",
"public int getLine() {\n return line;\n }",
"public int getLine() {\r\n\t\treturn line;\r\n\t}",
"public SoPath getPath() {\n\t\t return path; \n\t}",
"public int getLine() {\n return line;\n }",
"public static String getPathCache()\r\n/* 43: */ throws IOException\r\n/* 44: */ {\r\n/* 45: 44 */ log.finest(\"OSHandler.getPathCache\");\r\n/* 46: 45 */ return getProperty(\"path\");\r\n/* 47: */ }",
"public Line getLine ()\r\n {\r\n if (line == null) {\r\n computeLine();\r\n }\r\n\r\n return line;\r\n }",
"public static String getContextPath(HttpServletRequest request) {\n String contextPath = (String) request.getAttribute(INCLUDE_CONTEXT_PATH_ATTRIBUTE);\n if (null == contextPath) {\n contextPath = request.getContextPath();\n }\n if (\"/\".equals(contextPath)) {\n // Invalid case, but happens for includes on Jetty: silently adapt it.\n contextPath = \"\";\n }\n return decodeRequestString(request, contextPath);\n }",
"public int getLine() {\n\t\treturn line;\n\t}"
] | [
"0.76403",
"0.69480723",
"0.6600143",
"0.6484661",
"0.57456315",
"0.573962",
"0.5693663",
"0.56130785",
"0.56104046",
"0.5527838",
"0.5521516",
"0.5461332",
"0.544353",
"0.542534",
"0.5420223",
"0.53984797",
"0.5364067",
"0.530982",
"0.528337",
"0.5256381",
"0.52413225",
"0.5234973",
"0.518564",
"0.5180687",
"0.51580274",
"0.51204306",
"0.5062038",
"0.5055608",
"0.5011616",
"0.50092804",
"0.49896896",
"0.4986929",
"0.49675193",
"0.4946959",
"0.4936415",
"0.4934642",
"0.49339885",
"0.49278438",
"0.49271798",
"0.4912753",
"0.48976627",
"0.48891258",
"0.4883693",
"0.48780432",
"0.48704147",
"0.48530248",
"0.4852471",
"0.48512727",
"0.48367408",
"0.4836565",
"0.48303342",
"0.4830267",
"0.4822868",
"0.4819062",
"0.48171172",
"0.48122972",
"0.47975668",
"0.4796097",
"0.47674853",
"0.4767071",
"0.47667933",
"0.47607365",
"0.47574332",
"0.47360063",
"0.4733982",
"0.47185326",
"0.471488",
"0.4712115",
"0.4710521",
"0.47081602",
"0.46888936",
"0.46863812",
"0.46783596",
"0.46767768",
"0.467416",
"0.46670955",
"0.46658352",
"0.46588117",
"0.46581975",
"0.46531796",
"0.46515772",
"0.46458098",
"0.46453473",
"0.46434465",
"0.464167",
"0.46411872",
"0.46367297",
"0.46351218",
"0.46289867",
"0.46283668",
"0.46275705",
"0.4627221",
"0.4625665",
"0.46250224",
"0.4616519",
"0.46106702",
"0.46106175",
"0.4610516",
"0.46044043",
"0.45990556"
] | 0.8246169 | 0 |
Reads the path from a JAGGRAB request line. | private void readJaggrabPath(String line) {
final String START = "JAGGRAB ";
if (line.startsWith(START)) {
request = new Request(line.substring(START.length()).trim());
} else {
channel.close();
}
serve();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void readHttpPath(String line) {\n\t\tString[] parts = line.split(\" \");\n\t\tif (parts.length != 3) {\n\t\t\tchannel.close();\n\t\t} else {\n\t\t\trequest = new Request(parts[1].trim());\n\t\t}\n\t}",
"public void readLine(String line) {\n\t\tif (request == null) {\n\t\t\tswitch (type) {\n\t\t\tcase JAGGRAB:\n\t\t\t\treadJaggrabPath(line);\n\t\t\t\tbreak;\n\t\t\tcase HTTP:\n\t\t\t\treadHttpPath(line);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (type == Type.HTTP) {\n\t\t\t\tif (line.length() == 0) {\n\t\t\t\t\tserve();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private static StringPair getPath(BufferedReader in) throws IOException {\n StringPair sp = null;\n String line = in.readLine();\n WVM.out.println(\"\\n + + + request is: \" + line);\n String path = \"\";\n String wid = null;\n // extract class from GET line\n if (line.startsWith(\"GET /\")) {\n line = line.substring(5, line.length()-1).trim();\n int index = line.indexOf(\".class\");\n if (index != -1) {\n path = line.substring(0, index).replace('/', '.');\n } else {\n path = new StringTokenizer(line, \" \").nextToken();\n }\n if (WVM.DEBUG(3)) WVM.out.println(\"path is: \" + path);\n //see if the worklet id is supplied\n int i = line.indexOf(\"?\");\n if(i!= -1 ){\n\t //have worklet id\n\t wid = line.substring(i+1,line.length()-8);\t \n }\n } else {\n throw new IOException(\"Malformed Header in Class request\");\n }\n\n // eat the rest of header\n do {\n line = in.readLine();\n // WVM.out.println (\" + + + \" + line);\n } while ((line.length() != 0) && (line.charAt(0) != '\\r') && (line.charAt(0) != '\\n'));\n if (path.length() != 0) {\n\tsp = new StringPair(path,wid);\n // WVM.out.println(\"Edited: gskc, 19Feb01 --- returning path: \" + path);\n return sp;\n } else {\n throw new IOException(\"Malformed Header\");\n }\n }",
"public String getpathInput() {\r\n\t\treturn pathInput;\r\n\t}",
"static RequestLine readRequestLine(InputStream in) throws IOException {\n\t\tString line = readLine(in, true);\n\t\tString[] parts = line.split(\" \");\n\t\tif (parts.length != 3) {\n\t\t\tthrow new WebException(StatusCode.BAD_REQUEST, \"invalid request line: \" + line);\n\t\t}\n\t\tString method = parts[0];\n\t\tString target = parts[1];\n\t\tString path = target;\n\t\tString query = null;\n\t\tint index = target.indexOf('?');\n\t\tif (index != -1) {\n\t\t\tpath = target.substring(0, index);\n\t\t\tquery = target.substring(index + 1);\n\t\t}\n\t\treturn new RequestLine(method, target, path, query);\n\t}",
"private static String getRequestPath(final IWebRequest request) {\n\n String requestPath = request.getPathWithinApplication();\n\n final int fragmentIndex = requestPath.indexOf(';');\n if (fragmentIndex != -1) {\n requestPath = requestPath.substring(0, fragmentIndex);\n }\n\n return requestPath;\n\n }",
"public synchronized String getPath(long entry) throws IOException,\n EOFException {\n long startOfEntry = IDX_START_OF_CONTENT + (entry * bytesPerSlot);\n idx.seek(startOfEntry);\n if (idx.readChar() == '\\n')\n throw new IllegalStateException(\"No data at address \" + entry);\n idx.skipBytes(bytesPerId + bytesPerType - 2);\n \n byte[] bytes = new byte[bytesPerPath];\n idx.read(bytes);\n String line = new String(bytes, \"utf-8\");\n int delimiter = line.indexOf('\\n');\n if (delimiter < 1)\n throw new IllegalStateException(\"Found path without delimiter\");\n return new String(bytes, 0, delimiter - 1);\n }",
"public abstract String getRequestPathInfo();",
"private String getResourcePath() {\n\t\tString reqResource = getRequest().getResourceRef().getPath();\n\t\treqResource = actualPath(reqResource, 1);\n\t\tLOGGERS.info(\"reqResourcePath---->\" + reqResource);\n\t\treturn reqResource;\n\t}",
"static Path getInputPath(Configuration conf) {\n String in = conf.get(MRUtils.INPUT_PATH);\n if (in == null) {\n return null;\n }\n return new Path(in);\n }",
"private String getJsonPath(final String path) {\n final int dotPos = path.indexOf('.');\n final String jsonPath = path.substring(dotPos + 1);\n return jsonPath;\n }",
"public String getPath()\r\n/* 26: */ {\r\n/* 27:57 */ return this.path;\r\n/* 28: */ }",
"Path getPath();",
"protected String processPath(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException\n { //20030305AH - Store result of processPath() in request attribute so can use it later for\n //looking up stuff - such as in navigationRenderer...\n String path = super.processPath(request, response);\n request.setAttribute(PROCESSED_PATH, path);\n return path;\n }",
"private String toCompletePath(String fullRequest) {\n \n///Parse request for file path\nString requestLine[] = new String[] {\" \", \" \", \" \"};\n requestLine = fullRequest.split(\" \");\nString partialPath = requestLine[1];\n \n//If requested path is just \"/\" or \"\", don't return any path\n if(partialPath.length() <= 1) {\n noFileRequested = true;\n return null;\n }\n \nString completePath;\n//If using my Windows machine, the path is different than the school Linux machines\nif (Windows)\n completePath = \"C:/Users/Michelle/eclipse-workspace/P1\" + partialPath;\nelse\n completePath = \".\" + partialPath;\n \n return completePath;\n}",
"public String getPath() {\n\t\treturn getString(\"path\");\n\t}",
"private String readFromClient() throws IOException {\n final String request = inFromClient.readLine();\n return request;\n }",
"private int getSelectedLine(HttpServletRequest request) {\n int selectedLine = -1;\n String parameterName = (String) request.getAttribute(KRADConstants.METHOD_TO_CALL_ATTRIBUTE);\n if (StringUtils.isNotBlank(parameterName)) {\n String lineNumber = StringUtils.substringBetween(parameterName, \".line\", \".\");\n selectedLine = Integer.parseInt(lineNumber);\n }\n\n return selectedLine;\n }",
"public String getLine ()\n {\n return line;\n }",
"String getPath() {\r\n\t\treturn path;\r\n\t}",
"private static String getPath (HttpServletRequest request) {\n String path = request.getServletPath();\n return path != null ? path : request.getPathInfo();\n }",
"PathSegments getPath();",
"public static void parseFullPath(String path, IUriListener listener) {\n if (path == null) {\n path = \"\";\n }\n char[] array = path.toCharArray();\n parseFullPath(array, listener);\n }",
"axiom Object readLine(Object BufferedReader(FileReaderr f)) {\n\treturn f.get(0);\n }",
"public RequestLine parseRequestLine(CharArrayBuffer buffer, ParserCursor cursor) throws ParseException {\n/* 280 */ Args.notNull(buffer, \"Char array buffer\");\n/* 281 */ Args.notNull(cursor, \"Parser cursor\");\n/* 282 */ int indexFrom = cursor.getPos();\n/* 283 */ int indexTo = cursor.getUpperBound();\n/* */ \n/* */ try {\n/* 286 */ skipWhitespace(buffer, cursor);\n/* 287 */ int i = cursor.getPos();\n/* */ \n/* 289 */ int blank = buffer.indexOf(32, i, indexTo);\n/* 290 */ if (blank < 0) {\n/* 291 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ }\n/* */ \n/* 294 */ String method = buffer.substringTrimmed(i, blank);\n/* 295 */ cursor.updatePos(blank);\n/* */ \n/* 297 */ skipWhitespace(buffer, cursor);\n/* 298 */ i = cursor.getPos();\n/* */ \n/* 300 */ blank = buffer.indexOf(32, i, indexTo);\n/* 301 */ if (blank < 0) {\n/* 302 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ }\n/* */ \n/* 305 */ String uri = buffer.substringTrimmed(i, blank);\n/* 306 */ cursor.updatePos(blank);\n/* */ \n/* 308 */ ProtocolVersion ver = parseProtocolVersion(buffer, cursor);\n/* */ \n/* 310 */ skipWhitespace(buffer, cursor);\n/* 311 */ if (!cursor.atEnd()) {\n/* 312 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ }\n/* */ \n/* */ \n/* 316 */ return createRequestLine(method, uri, ver);\n/* 317 */ } catch (IndexOutOfBoundsException e) {\n/* 318 */ throw new ParseException(\"Invalid request line: \" + buffer.substring(indexFrom, indexTo));\n/* */ } \n/* */ }",
"public String getPath() throws Exception {\n\t\t/*\n\t\t * return \"/news-oppsRecord\" + doc.selectSingleNode\n\t\t * (\"/metadataFieldInfo/field/@path\").getText();\n\t\t */\n\t\treturn doc.selectSingleNode(\"/metadataFieldInfo/field/@path\").getText();\n\t}",
"protected void setupRequestPathExp(StringBuilder sb, RomanticTransaction tx) {\n final String requestPath = tx.getRequestPath();\n if (requestPath != null) {\n sb.append(\", \").append(requestPath);\n }\n }",
"public static void parseFullPath(char[] path, IUriListener listener) {\n UriParser parser = new UriParser(listener);\n parser.parseFullPath(path, 0);\n }",
"public GetRequest(String pathInfo) throws ServletException {\r\n\r\n\t\tMatcher matcher;\r\n\r\n\t\tif (pathInfo != null) {\r\n\r\n\t\t\tmatcher = regExQueuePattern.matcher(pathInfo);\r\n\t\t\tif (matcher.find()) {\r\n\t\t\t\trequestID = Integer.parseInt(matcher.group(1));\r\n\t\t\t\tisQueuePolling = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tmatcher = regExResponsePattern.matcher(pathInfo);\r\n\t\t\tif (matcher.find()) {\r\n\t\t\t\trequestID = Integer.parseInt(matcher.group(1));\r\n\t\t\t\tisQueuePolling = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(PROXY + \"Invalid URI.\");\r\n\t\tthrow new ServletException(PROXY + \"Invalid URI.\");\r\n\t}",
"private String getRequestLine(HttpConnection conn) {\n return HttpMethodBase.generateRequestLine(conn, getName(),\n getPath(), getQueryString(), getHttpVersion());\n }",
"public static String parseLine(String line) {\n if (line.startsWith(\"//\") || \"\".equals(line.trim())\n || (line.startsWith(\"#\") && !line.startsWith(\"#(\"))) {\n return null;\n } else {\n String arr[] = line.split(\"[:]\");\n if (arr.length == 2) {\n return arr[1];\n } else if (arr.length == 1) {\n return arr[0];\n } else {\n assert false : \"Received line: \" + line;\n return null;\n }\n }\n }",
"public int path(){\n\t\treturn this.path;\n\t}",
"private String getFilePath(String sHTTPRequest) {\n return sHTTPRequest.replaceFirst(\"/\", \"\");\n\n }",
"public String getInputPath() {\n\t\treturn inputPath;\n\t}",
"public String getInputPath2() {\n\t\treturn inputPath2;\n\t}",
"public String getCurrentInputString() { return line; }",
"String getPath() {\n return this.path;\n }",
"public SoPath getPath() {\n\t\t return path; \n\t}",
"public String getLine() {\n\t\treturn line.toString();\n\t}",
"private boolean parseRequestLine() {\n\n // the request line has the format:\n // METHOD URI HTTP/1.1 CRLF\n\n // search the buffer for CRLF to see if you can process the line, otherwise return false\n // to stop the parser from trying the next phase\n\n\n // parse the line and set the fields on this.request\n\n // don't forget to consume the line from the parser\n\n return true;\n }",
"@JsonProperty(\"path\")\r\n public String getPath() {\r\n return path;\r\n }",
"@JsonProperty(\"path\")\r\n public String getPath() {\r\n return path;\r\n }",
"private int pathIndex(String path){\n\t\t\tint returnIndex;\n\t\t\t\n\t\t\tif(path.contains(\"DR\")){\n\t\t\t\treturnIndex = 0;\n\t\t\t}else if(path.contains(\"DT\")){\n\t\t\t\treturnIndex = 1;\n\t\t\t}else if(path.contains(\"L\")){\n\t\t\t\treturnIndex = 2;\n\t\t\t}else{\n\t\t\t\treturnIndex = 3;\n\t\t\t}\n\t\t\treturn returnIndex;\n\t\t}",
"private char[] getPath() {\n\t\treturn null;\n\t}",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String getPath() {\r\n\t\treturn path;\r\n\t}",
"public String getPath() {\r\n\t\treturn path;\r\n\t}",
"public String getPath() {\r\n\t\treturn path;\r\n\t}",
"public String getPath() {\n\t\treturn path;\n\t}",
"String getPath() {\n return path;\n }",
"public String getline() {\n\t\treturn _line;\n\t}",
"public String getPath(){\r\n\t\treturn path;\r\n\t}",
"public String getPath()\n\t{\n\t\treturn letter + \":/\";\n\t}",
"public String getPath() {\r\n return path;\r\n }",
"public String getPath() {\r\n return path;\r\n }",
"public java.lang.String getPath1() {\n return path1;\n }",
"public String path() {\n return this.path;\n }",
"public String path() {\n return this.path;\n }",
"public String getPath() {\n return this.path;\n }",
"public String determineTaskDetailsFromFileLine(String line) {\n int indexOfFirstSquareBracket = line.indexOf(\"[\");\n String details = line.substring(indexOfFirstSquareBracket + 8); // from unnecessary info at the front of line.\n return details;\n }",
"public String getPath(){\n\t\t\treturn this.path;\n\t\t}",
"public String getPath() {\n\t\treturn this.path;\n\t}",
"public String getPath() {\r\n\t\t\treturn path;\r\n\t\t}",
"protected String getMyVarPath(String path){\n\t\treturn \"getVariableData('\"+VARNAME+\"', 'part1', '/nswomoxsd:receive/nswomoxsd:evt/\"+path+\"') \";\n\t}",
"public static String extractPathFromPattern(final HttpServletRequest request){\r\n\r\n\t\tString path = (String) request.getAttribute(\r\n\t HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);\r\n\t String bestMatchPattern = (String ) request.getAttribute(HandlerMapping.BEST_MATCHING_PATTERN_ATTRIBUTE);\r\n\r\n\t AntPathMatcher apm = new AntPathMatcher();\r\n\t String finalPath = apm.extractPathWithinPattern(bestMatchPattern, path);\r\n\r\n\t return finalPath;\r\n\t}",
"public String path() {\n\treturn path;\n }",
"public String getPath()\n {\n return path;\n }",
"public String getPath()\n {\n return path;\n }",
"Path getRequestListFilePath();",
"@JsonProperty(\"path\")\n public String getPath() {\n return path;\n }",
"public Line getLine(String targetLine);",
"public String getNextLine() throws IOException{\n String nextLine;\n\n if (this.bufferedReader == null) {\n log.error(\"{} : Input file not open when trying to read next line\", LOG_TAG);\n }\n try {\n nextLine = this.bufferedReader.readLine();\n while(nextLine != null && (StringUtils.isBlank(nextLine) || nextLine.startsWith(\"/\"))) {\n nextLine = this.bufferedReader.readLine();\n }\n } catch (IOException e) {\n log.error(\"{} : IOException, file read error {}\", LOG_TAG, e.getStackTrace());\n throw e;\n }\n\n log.debug(\"Next line read : {}\", nextLine);\n return nextLine;\n }",
"@JsonProperty(\"path\")\r\n public void setPath(String path) {\r\n this.path = path;\r\n }",
"@JsonProperty(\"path\")\r\n public void setPath(String path) {\r\n this.path = path;\r\n }",
"protected String getPath ()\n\t{\n\t\treturn path;\n\t}",
"public String getPath() { \n\t\treturn getPathElement().getValue();\n\t}",
"@Override\n\t\tpublic String getRealPath(String path) {\n\t\t\treturn null;\n\t\t}",
"public void setPath(String path)\n {\n try\n {\n // Tokenize the path\n pathArray = getPathResolved(path);\n \n // Set path property\n this.path = path;\n }\n catch (NumberFormatException nfe)\n {\n // Reset path property\n this.path = \"\";\n }\n }",
"public String getLine()\n\t{\n\t\ttry\n\t\t{\n\t\t\tline = reader.readLine();\n\t\t} catch (IOException ioe)\n\t\t{\n\t\t\t//\n\t\t}\n\n\t\treturn line;\n\t}",
"public java.lang.String getPath() {\n\t\t return path;\n\t }",
"public String getLine() {\n return this.line;\n }",
"String getPath();",
"String getPath();",
"String getPath();",
"String getPath();",
"String getPath();",
"IPath getPath();",
"String getRealPath(String path);"
] | [
"0.7185894",
"0.6613295",
"0.6348909",
"0.59935665",
"0.5511941",
"0.5481795",
"0.54426813",
"0.5340428",
"0.5185974",
"0.5159318",
"0.5017017",
"0.501695",
"0.49994504",
"0.49859893",
"0.49841982",
"0.4982469",
"0.4975871",
"0.49622658",
"0.4944882",
"0.49370295",
"0.4929605",
"0.4927618",
"0.49269524",
"0.49233222",
"0.49079174",
"0.4890984",
"0.4886377",
"0.48606133",
"0.48485386",
"0.48471528",
"0.4827236",
"0.4824745",
"0.48245746",
"0.48113117",
"0.48002353",
"0.47958127",
"0.47941086",
"0.47904837",
"0.4785212",
"0.47829905",
"0.47811666",
"0.47811666",
"0.47791672",
"0.47734424",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.47639298",
"0.4760923",
"0.4760923",
"0.4760923",
"0.47560465",
"0.47519374",
"0.47498465",
"0.4747826",
"0.47427818",
"0.4738587",
"0.4738587",
"0.47341383",
"0.47325528",
"0.47325528",
"0.47223997",
"0.47203904",
"0.47199374",
"0.47163266",
"0.47100592",
"0.47072294",
"0.47059223",
"0.47057202",
"0.47043923",
"0.47043923",
"0.47039336",
"0.47012165",
"0.4697172",
"0.46911156",
"0.46906504",
"0.46906504",
"0.4690201",
"0.46837783",
"0.46810713",
"0.4679491",
"0.46788225",
"0.46738884",
"0.4672871",
"0.46706733",
"0.46706733",
"0.46706733",
"0.46706733",
"0.46706733",
"0.46669176",
"0.4665014"
] | 0.7908953 | 0 |
Implement the actionPerformed method which is declared in the ActionListener interface. | public void actionPerformed(ActionEvent e){
//Note that because this class is defined inside
// the GUI class which is defined inside the
// SampProg127 class, this method has direct
// access to the members of both the SampProg127
// class and the GUI class. Therefore, this method
// can directly access the reference variable named
// myLabel without having to access it via an
// object of type GUI.
myLabel.setText("Ouch");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) \n\t\t{\n\t\t\t\n\t\t}",
"@Override\n\t public void actionPerformed(ActionEvent e){\n\t }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t\t\n\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) \n\t\t{\n\t\t\t\n\t\t}",
"@Override\n\tpublic abstract void actionPerformed(ActionEvent arg0);",
"@Override\n\tpublic void actionPerformed(\n\t\t\tActionEvent e)\n\t\t{\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0)\n\t{\n\t\t\n\t}",
"@Override\r\n \t\tpublic void actionPerformed(ActionEvent e) {\n \t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n }",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override //se repita\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t}",
"@Override\r\n public void actionPerformed(ActionEvent e) {\n }",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e)\n\t{\n\t\t\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"@Override\n public void actionPerformed(ActionEvent ev) {\n }",
"public void actionPerformed(ActionEvent arg0) {\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e)\n {\n }",
"@Override\r\n public void actionPerformed(ActionEvent e)\r\n {\n \r\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\r\n\t}",
"public void actionPerformed(ActionEvent e) {\r\n\t\t\t}",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t}",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t}"
] | [
"0.88957727",
"0.88957727",
"0.8892081",
"0.8892081",
"0.8873399",
"0.88522965",
"0.880614",
"0.87657714",
"0.87657714",
"0.87657714",
"0.87657714",
"0.87657714",
"0.87657714",
"0.87591356",
"0.8750983",
"0.87494487",
"0.87458956",
"0.8713064",
"0.871218",
"0.871218",
"0.871218",
"0.871218",
"0.871218",
"0.871218",
"0.871218",
"0.871218",
"0.871218",
"0.87100047",
"0.8705206",
"0.8704525",
"0.8704525",
"0.8704525",
"0.86959213",
"0.86959213",
"0.86959213",
"0.86959213",
"0.86532843",
"0.86532843",
"0.86532843",
"0.86008614",
"0.8599033",
"0.8599033",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85988444",
"0.85972905",
"0.8587936",
"0.8582957",
"0.8582957",
"0.85802084",
"0.8574896",
"0.85719603",
"0.856944",
"0.8565643",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8556422",
"0.8548203",
"0.8547566",
"0.8542305",
"0.85129184",
"0.85090894",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.8506897",
"0.85058993",
"0.85051686",
"0.8503747",
"0.8503747"
] | 0.0 | -1 |
Setup log4j for testing. | @BeforeClass
public static void setUpBeforeClass() throws Exception {
org.apache.log4j.BasicConfigurator.configure();
Properties properties = new Properties();
properties.setProperty("hive.metastore.uris", "thrift://localhost:9083");
server = new PigServer(ExecType.LOCAL, properties);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@BeforeClass\npublic static void setLogger() {\n System.setProperty(\"log4j.configurationFile\",\"./src/test/resources/log4j2-testing.xml\");\n log = LogManager.getLogger(LocalArtistIndexTest.class);\n}",
"@BeforeClass\n\tpublic void setup() {\n\t\tlogger = Logger.getLogger(\"AveroRestAPI\");\n\t\tPropertyConfigurator.configure(\"Log4j.properties\");\n\t\tlogger.setLevel(Level.DEBUG);\n\n\t}",
"@BeforeClass\n public static void setUpClass() {\n final Properties p = new Properties();\n p.put(\"log4j.appender.Remote\", \"org.apache.log4j.net.SocketAppender\");\n p.put(\"log4j.appender.Remote.remoteHost\", \"localhost\");\n p.put(\"log4j.appender.Remote.port\", \"4445\");\n p.put(\"log4j.appender.Remote.locationInfo\", \"true\");\n p.put(\"log4j.rootLogger\", \"ALL,Remote\");\n PropertyConfigurator.configure(p);\n }",
"@Before\r\n public void setUp() throws Exception {\r\n PropertyConfigurator.configure(\"test_files/log4j.properties\");\r\n\r\n LogManager.setLogFactory(new Log4jLogFactory());\r\n log = LogManager.getLog(this.getClass().getName());\r\n\r\n paramNames = new String[] {\"p1\", \"p2\"};\r\n paramValues = new Object[] {123, \"abc\"};\r\n\r\n value = new Object[] {\"result\"};\r\n exception = new Exception(\"Exception for testing.\");\r\n }",
"public static void setupLoggers() {\n SLF4JBridgeHandler.removeHandlersForRootLogger();\n\n // add SLF4JBridgeHandler to j.u.l's root logger\n SLF4JBridgeHandler.install();\n }",
"@BeforeClass\n\tpublic static void setup() {\n\t\tgetLogManager().init();\n\t}",
"public void setupLogging() {\n\t\ttry {\n\t\t\t_logger = Logger.getLogger(QoSModel.class);\n\t\t\tSimpleLayout layout = new SimpleLayout();\n\t\t\t_appender = new FileAppender(layout,_logFileName+\".txt\",false);\n\t\t\t_logger.addAppender(_appender);\n\t\t\t_logger.setLevel(Level.ALL);\n\t\t\tSystem.setOut(createLoggingProxy(System.out));\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@BeforeClass\n\tpublic static void setup() {\n\t\tLogger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);\n\t\troot.setLevel(Level.INFO);\n\t}",
"private static void setupLogger() {\n\t\tLogManager.getLogManager().reset();\n\t\t// set the level of logging.\n\t\tlogger.setLevel(Level.ALL);\n\t\t// Create a new Handler for console.\n\t\tConsoleHandler consHandler = new ConsoleHandler();\n\t\tconsHandler.setLevel(Level.SEVERE);\n\t\tlogger.addHandler(consHandler);\n\n\t\ttry {\n\t\t\t// Create a new Handler for file.\n\t\t\tFileHandler fHandler = new FileHandler(\"HQlogger.log\");\n\t\t\tfHandler.setFormatter(new SimpleFormatter());\n\t\t\t// set level of logging\n\t\t\tfHandler.setLevel(Level.FINEST);\n\t\t\tlogger.addHandler(fHandler);\n\t\t}catch(IOException e) {\n\t\t\tlogger.log(Level.SEVERE, \"File logger not working! \", e);\n\t\t}\n\t}",
"@BeforeAll\n public static void configureLogger() {\n new SuperStructure(null, null, null, null, null);\n\n Logger.configure(null);\n Logger.start();\n }",
"protected void setUp() throws Exception {\n\t\tTestUtils.configureLogging();\r\n\r\n\t\t// delete all tmp files ...\r\n\t\tthis.tmpDir = new TmpDirectory(\"howllogger\");\r\n\t\tthis.tmpDir.clear();\r\n\r\n\t\tthis.tmpDir = new TmpDirectory(\"howllogger\");\r\n\t\tSystem.getProperties().setProperty(\"howl.log.logFileDir\",\r\n\t\t\t\tthis.tmpDir.getDirectory().getCanonicalPath());\r\n\r\n\t}",
"public static void getLoggerConfiguration() {\n\t\tPropertyConfigurator.configure(System.getProperty(\"user.dir\")+ \"\\\\Config\\\\log4j.properties\");\n\t}",
"@BeforeClass\n public static void setupClass() {\n build = System.getenv(\"BUILD\");\n \n File logFile = new File(LOG_FILE);\n if(!logFile.exists()) {\n System.out.println(\"Creating log file\");\n try {\n logFile.createNewFile();\n System.out.println(\"Created log file: \" + logFile.getPath());\n } catch (IOException e) {\n System.out.println(e.getMessage());\n //e.printStackTrace();\n }\n }\n \n try {\n FileHandler fileHandler = new FileHandler(logFile.getPath());\n fileHandler.setFormatter(new LogFormatter());\n LOGGER.addHandler(fileHandler);\n \n } catch (SecurityException e) {\n System.out.println(e.getMessage());\n //e.printStackTrace();\n } catch (IOException e) {\n System.out.println(e.getMessage());\n //e.printStackTrace();\n }\n \n LOGGER.setUseParentHandlers(false);\n \n }",
"private void setupLogging() {\n\t\t// Ensure all JDK log messages are deferred until a target is registered\n\t\tLogger rootLogger = Logger.getLogger(\"\");\n\t\tHandlerUtils.wrapWithDeferredLogHandler(rootLogger, Level.SEVERE);\n\n\t\t// Set a suitable priority level on Spring Framework log messages\n\t\tLogger sfwLogger = Logger.getLogger(\"org.springframework\");\n\t\tsfwLogger.setLevel(Level.WARNING);\n\n\t\t// Set a suitable priority level on Roo log messages\n\t\t// (see ROO-539 and HandlerUtils.getLogger(Class))\n\t\tLogger rooLogger = Logger.getLogger(\"org.springframework.shell\");\n\t\trooLogger.setLevel(Level.FINE);\n\t}",
"@Before\n public void setUp() throws Exception {\n logger.setLevel(Level.DEBUG);\n }",
"@BeforeClass\n public static void beforeClass()\n throws Exception\n {\n LoggerConfiguration.logSetup();\n }",
"private void init() {\r\n this.log = this.getLog(LOGGER_MAIN);\r\n\r\n if (!(this.log instanceof org.apache.commons.logging.impl.Log4JLogger)) {\r\n throw new IllegalStateException(\r\n \"LogUtil : apache Log4J library or log4j.xml file are not present in classpath !\");\r\n }\r\n\r\n // TODO : check if logger has an appender (use parent hierarchy if needed)\r\n if (this.log.isWarnEnabled()) {\r\n this.log.warn(\"LogUtil : logging enabled now.\");\r\n }\r\n\r\n this.logBase = this.getLog(LOGGER_BASE);\r\n this.logDev = this.getLog(LOGGER_DEV);\r\n }",
"private void initLoggers() {\n _logger = LoggerFactory.getInstance().createLogger();\n _build_logger = LoggerFactory.getInstance().createAntLogger();\n }",
"public static void setUp() {\n Handler handler = new LoggerHandler();\n handler.setFormatter(new SimpleFormatter());\n getInstance().addHandler(handler);\n }",
"@Before public void setUp() {\n\t\tsetUp(new ParallelLogger());\n\t}",
"private static void initLogger() {\n if (initialized) {\n return;\n }\n\n initialized = true;\n\n System.out.println(\"\");\n System.out.println(\"=> Begin System Logging Configuration\");\n URL fileUrl = null;\n String filePath = null;\n\n try {\n final Region region = EnvironmentConfiguration.getRegion();\n filePath = \"log4j-\" + region.getCode() + \".xml\";\n System.out.println(\"=> searching for log configuration file : \" + filePath);\n fileUrl = LogFactory.class.getResource(\"/\" + filePath);\n DOMConfigurator.configure(fileUrl);\n System.out.println(\"=> found log configuration file : \" + fileUrl);\n System.out.println(\"=> System Logging has been initialized\");\n }\n catch (final NoClassDefFoundError ncdf) {\n System.out.println(\"=> Logging Configuration Failed\");\n System.err.println(LogFactory.class.getName()\n + \"::loadProps() - Unable to find needed classes. Logging disabled. \" + ncdf);\n }\n catch (final Exception e) {\n System.out.println(\"=> Logging Configuration Failed\");\n System.err.println(\n LogFactory.class.getName() + \"::loadProps() - Unable to initialize logger from file=\"\n + filePath + \". Logging disabled.\");\n }\n System.out.println(\"=> End System Logging Configuration\");\n System.out.println(\"\");\n }",
"protected void initLogger() {\n initLogger(\"DEBUG\");\n }",
"private void initLogConfig() {\n\t\t logConfigurator = new LogConfigurator();\n\t\t// Setting append log coudn't cover by a new log.\n\t\tlogConfigurator.setUseFileAppender(true);\n\t\t// Define a file path for output log.\n\t\tString filename = StorageUtils.getLogFile();\n\t\tLog.i(\"info\", filename);\n\t\t// Setting log output\n\t\tlogConfigurator.setFileName(filename);\n\t\t// Setting log's level\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setFilePattern(\"%d %-5p [%c{2}]-[%L] %m%n\");\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 5);\n\t\t// Set up to use the cache first and then output to a file for a period\n\t\t// of time\n\t\tlogConfigurator.setImmediateFlush(false);\n\t\tlogConfigurator.setUseLogCatAppender(true);\n\t\t// logConfigurator.setResetConfiguration(true);\n\t\tlogConfigurator.configure();\n\t}",
"private static void initializeLog(Properties config)\n {\n // log.file.level = [ ALL | DEBUG | INFO | WARN | ERROR | FATAL ]\n\n try\n {\n PatternLayout layout;\n\n String pattern = config.getProperty(\"log.file.layout\");\n if (null == pattern)\n {\n layout = new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN);\n }\n else\n {\n layout = new PatternLayout(pattern);\n }\n // System.out.println(\"Log4j pattern = \" + pattern);\n // System.out.println(\"Log4j layout = \" + layout);\n\n String fileName = basedir + File.separator + config.getProperty(\"log.dir\") +\n File.separator + config.getProperty(\"log.file\");\n // System.out.println(\"Log4j fileName = \" + fileName);\n\n RollingFileAppender appender = new RollingFileAppender(layout, fileName, true);\n appender.setMaxFileSize(config.getProperty(\"log.file.max.size\"));\n int maxBackup = 14; // default if property not available\n try\n {\n maxBackup = Integer.parseInt(config.getProperty(\"log.file.max.backup\"));\n }\n catch (NumberFormatException e) { }\n appender.setMaxBackupIndex(maxBackup);\n // System.out.println(\"Log4j maxBackup = \" + maxBackup);\n\n Logger log = Logger.getRootLogger();\n log.addAppender(appender);\n log.setLevel(Level.toLevel(config.getProperty(\"log.file.priority\")));\n }\n catch (IOException e)\n {\n System.err.println(\"FAILURE: Error opening log file\");\n System.err.println(e.getMessage());\n System.exit(BAD_RUN);\n }\n }",
"protected void setUp() throws Exception {\r\n printStream = new PrintStream(new FileOutputStream(FILE));\r\n\r\n logFactory = new BasicLogFactory(printStream);\r\n\r\n log = (BasicLog) logFactory.createLog(NAME);\r\n }",
"@BeforeSuite\n public void initiateData() throws FileNotFoundException, IOException {\n jsonTestData = new JsonClass();\n userDirectory = System.getProperty(\"user.dir\");\n String log4jConfigFile = userDirectory + File.separator + \"src\" + File.separator + \"test\" + File.separator + \"resources\" + File.separator\n + \"log4j.properties\";\n ConfigurationSource source = new ConfigurationSource(new FileInputStream(log4jConfigFile));\n Configurator.initialize(null, source);\n logger = Logger.getLogger(getClass());\n }",
"private void repetitiveWork(){\n\t PropertyConfigurator.configure(\"log4j.properties\");\n\t log = Logger.getLogger(BackupRestore.class.getName());\n }",
"public void disabled_og4j_testSetLogLevel() throws Exception {\n assertEquals(\"Default Level is ERROR\", LOGGER.getLevel(), Level.ERROR);\n Helper.setLog4JLogLevel(Level.DEBUG);\n assertEquals(\"Default Level is DEBUG\", LOGGER.getLevel(), Level.DEBUG);\n }",
"private static void prepareLoggingSystemEnviroment() {\n\t\t// property configuration relies on this parameter\n\t\tSystem.setProperty(\"log.directory\", getLogFolder());\n\t\t//create the log directory if not yet existing:\n\t\t//removed code as log4j is now capable of doing that automatically\n\t}",
"private void initLogger() {\n\t\ttry {\n\t\t\tjava.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger(\"\");\n\t\t\trootLogger.setUseParentHandlers(false);\n\t\t\tHandler csvFileHandler = new FileHandler(\"logger/log.csv\", 100000, 1, true);\n\t\t\tlogformater = new LogFormatter();\n\t\t\trootLogger.addHandler(csvFileHandler);\n\t\t\tcsvFileHandler.setFormatter(logformater);\n\t\t\tlogger.setLevel(Level.ALL);\n\t\t} catch (IOException ie) {\n\t\t\tSystem.out.println(\"Logger initialization failed\");\n\t\t\tie.printStackTrace();\n\t\t}\n\t}",
"public void setup (SProperties config) throws IOException {\n\tString sysLogging =\n\t System.getProperty (\"java.util.logging.config.file\");\n\tif (sysLogging != null) {\n\t System.out.println (\"Logging configure by system property\");\n\t} else {\n\t Logger eh = getLogger (config, \"error\", null, \"rabbit\",\n\t\t\t\t \"org.khelekore.rnio\");\n\t eh.info (\"Log level set to: \" + eh.getLevel ());\n\t}\n\taccessLog = getLogger (config, \"access\", new AccessFormatter (),\n\t\t\t \"rabbit_access\");\n }",
"@Test\n public void testSetFilePath() {\n YConnectLogger.setFilePath(getResourcePath(\"/log4j.xml\"));\n YConnectLogger.debug(\"Some Object\",\n \"should put a message with the class name.\");\n }",
"@BeforeClass\n\tpublic static void start() throws IOException\n\t{\n\t\tng.configure(\"log4j.properties\");\n\t\tFileInputStream st= new FileInputStream(\"config.properties\");\n\t\tmp.load(st);\n\t\tlg.info(\"============= visiting url ==============\");\n\t\tdr.get(mp.getProperty(\"url\"));\n\t\t\n\t\t\n\t}",
"private static void defineLogger() {\n HTMLLayout layout = new HTMLLayout();\n DailyRollingFileAppender appender = null;\n try {\n appender = new DailyRollingFileAppender(layout, \"/Server_Log/log\", \"yyyy-MM-dd\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n logger.addAppender(appender);\n logger.setLevel(Level.DEBUG);\n }",
"@BeforeClass\r\n\tpublic void setup() {\r\n\r\n\t\tdriver = new FirefoxDriver();\r\n\t\t\r\n\t\tlogger=Logger.getLogger(\"pnetpractice\");\r\n\t\tPropertyConfigurator.configure(\"log4j.properties\");\r\n\t\t\r\n\t\t\r\n\t\tdriver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);\r\n\t\t//driver.get(Baseurl);\r\n\t}",
"static public void setup() throws IOException {\n Logger logger = Logger.getLogger(\"\");\n\n logger.setLevel(Level.INFO);\n Calendar cal = Calendar.getInstance();\n //SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\");\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String dateStr = sdf.format(cal.getTime());\n fileTxt = new FileHandler(\"log_\" + dateStr + \".txt\");\n fileHTML = new FileHandler(\"log_\" + dateStr + \".html\");\n\n // Create txt Formatter\n formatterTxt = new SimpleFormatter();\n fileTxt.setFormatter(formatterTxt);\n logger.addHandler(fileTxt);\n\n // Create HTML Formatter\n formatterHTML = new LogHTMLFormatter();\n fileHTML.setFormatter(formatterHTML);\n logger.addHandler(fileHTML);\n }",
"public void configLog()\n\t{\n\t\tlogConfigurator.setFileName(Environment.getExternalStorageDirectory() + File.separator + dataFileName);\n\t\t// Set the root log level\n\t\t//writerConfigurator.setRootLevel(Level.DEBUG);\n\t\tlogConfigurator.setRootLevel(Level.DEBUG);\n\t\t///writerConfigurator.setMaxFileSize(1024 * 1024 * 500);\n\t\tlogConfigurator.setMaxFileSize(1024 * 1024 * 1024);\n\t\t// Set log level of a specific logger\n\t\t//writerConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setLevel(\"org.apache\", Level.ERROR);\n\t\tlogConfigurator.setImmediateFlush(true);\n\t\t//writerConfigurator.configure();\n\t\tlogConfigurator.configure();\n\n\t\t//gLogger = Logger.getLogger(this.getClass());\n\t\t//gWriter = \n\t\tgLogger = Logger.getLogger(\"vdian\");\n\t}",
"void initializeLogging();",
"public void init(String log4JPropertiesPath) throws IOException{\n\t\t\n\t\t//LoggerServices.build().disableApacheCommonsLogging();\n\t\t\n\t\t//By default, if no other configuration is given, log4j will search your classpath for a 'log4j.properties' file\n\t\t//here we locate the one that will be used if it exists on classpath....\n\t\tURL propertyFileURL = Thread.currentThread().getContextClassLoader().getResource(\"log4j.properties\"); \n\t\t\n\t\tFile log4JPropertiesFile = new File(log4JPropertiesPath);\n\t\t\n\t if (log4JPropertiesFile.exists()) {\n\t PropertyConfigurator.configure(log4JPropertiesPath); \n\t logger.info(\"loaded log4j.properties : \" + log4JPropertiesFile.getCanonicalPath().replaceAll(\"\\\\\\\\\", \"/\"));\n\t }else{ \n\t \tif(propertyFileURL != null){\n\t \t\tString warning = \t\"\\n\\n*******************************************************************************************************\\n\" + \n\t \t\t\t\t\t\t\t\"*******************************************************************************************************\\n\" +\t\t\n\t \t\t\t\t\t\t\t\"*******************************************************************************************************\\n\" +\t\n\t \t\t\t\t\t\t\t\"\\n\" + \n\t \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"\\tlog4j.properties file not found: \" + log4JPropertiesFile + \"\\n\\tloading log4j.properties found on classPath: \" + propertyFileURL + \"\\n\" +\n\t \t\t\n\t\t\t\t\t\t\t\t\t\"\\n\" + \n\t\t\t\t\t\t\t\t\t\"*******************************************************************************************************\\n\" + \n\t\t\t\t\t\t\t\t\t\"*******************************************************************************************************\\n\" +\t\t\n\t\t\t\t\t\t\t\t\t\"*******************************************************************************************************\\n\\n\" ;\n\t \t\t\n\t \t\tlogger.warn(warning);\n\t \t}else{\n\t \t\tBasicConfigurator.configure();\n\t \t\tlogger.error(\"log4j.properties file not found: \" + log4JPropertiesPath + \", and none found on classpath...loaded BasicConfigurator (System.err output)\");\n\t \t}\n\t }\n\t logger.info(\"current working dir: \" + new File(\".\").getCanonicalPath().replaceAll(\"\\\\\\\\\", \"/\"));\n\t}",
"void setupFileLogging();",
"@Test\n\t/**\n\t * This is in effect:\n\t * \n\t * log4j.rootLogger=DEBUG\n\t */\n\tpublic void testDebugAbove(){\n\t\tlogger.trace(\"Trace\");\n\t\t//Above Debug are all logged\n\t\tlogger.debug(\"Debug\");\n\t\tlogger.info(\"Info\");\n\t\tlogger.warn(\"Warning\");\n\t\tlogger.error(\"Error\");\n\t}",
"@Test\n public void testReset() {\n final VectorAppender appender = new VectorAppender();\n appender.setName(\"A1\");\n Logger.getRootLogger().addAppender(appender);\n final Properties properties = new Properties();\n properties.put(\"log4j.reset\", \"true\");\n PropertyConfigurator.configure(properties);\n assertNull(Logger.getRootLogger().getAppender(\"A1\"));\n LogManager.resetConfiguration();\n }",
"private void initLogger(BundleContext bc) {\n\t\tBasicConfigurator.configure();\r\n\t\tlogger = Logger.getLogger(Activator.class);\r\n\t\tLogger.getLogger(\"org.directwebremoting\").setLevel(Level.WARN);\r\n\t}",
"private void init() {\n LoggerContext ctx = (LoggerContext) LogManager.getContext(false);\n Configuration config = ctx.getConfiguration();\n LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);\n loggerConfig.setLevel(DEBUG ? Level.DEBUG : Level.INFO);\n ctx.updateLoggers();\n\n // Check if Maven repo exists\n File f = new File(globalConfig.getMavenRepoPath());\n if (!f.exists()) {\n // If not then create\n f.mkdir();\n }\n }",
"public void configLogger() {\n Logger.addLogAdapter(new AndroidLogAdapter());\n }",
"public static void log4jExample() {\n\t\tnewLogger.warn(\"This is the info level\");\n\t\t\n\t}",
"protected static Logger initLogger() {\n \n \n File logFile = new File(\"workshop2_slf4j.log\");\n logFile.delete();\n return LoggerFactory.getLogger(Slf4j.class.getName());\n }",
"public static void initializeLogger(Level level) {\r\n\t\tClassLoader loader = Thread.currentThread().getContextClassLoader();\r\n\t\tURL url = loader.getResource(\"resources/log4j.xml\");\r\n\t\tPropertyConfigurator.configure(url);\r\n\t\tLogger logger = Logger.getLogger(BaseActivator.class);\r\n\t\tlogger.setLevel(level);\r\n\t\tlogger.info(\"Starting Logger: Level = \" + logger.getLevel().getClass());\r\n\t\tBaseActivator.setLoggerIsInitialized(true);\r\n\t}",
"private void configureLogging() throws FileNotFoundException, IOException {\r\n\t\t// Set configuration file for log4j2\r\n\t\tConfigurationSource source = new ConfigurationSource(new FileInputStream(CONFIG_LOG_LOCATION));\r\n\t\tConfigurator.initialize(null, source);\r\n\t\tlog = LogManager.getLogger(SBIWebServer.class);\r\n\t}",
"private static void setupLogging(IATOptions iatOptions) {\n\t\tPrintStream logS = null;\n\t\t\n\t\ttry {\n\t\t\tFile path = new File(iatOptions.logFilePath_);\n\t\t\tpath.getParentFile().mkdirs();\n\t\t\tlogS = new PrintStream(new FileOutputStream(path));\n\t\t\tSystem.setErr(logS);\n\t\t} catch (Exception e) {\n\t\t\tLogging.Init_LOG.error(\"Cannot open log file\", e);\n\t\t}\n\t}",
"@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = \"RV_RETURN_VALUE_IGNORED_BAD_PRACTICE\",\n justification = \"Return value for file delete is not important here.\")\n private void initLogWriter() throws org.apache.geode.admin.AdminException {\n loggingSession.createSession(this);\n\n final LogConfig logConfig = agentConfig.createLogConfig();\n\n // LOG: create logWriterAppender here\n loggingSession.startSession();\n\n // LOG: look in AgentConfigImpl for existing LogWriter to use\n InternalLogWriter existingLogWriter = agentConfig.getInternalLogWriter();\n if (existingLogWriter != null) {\n logWriter = existingLogWriter;\n } else {\n // LOG: create LogWriterLogger\n logWriter = LogWriterFactory.createLogWriterLogger(logConfig, false);\n // Set this log writer in AgentConfigImpl\n agentConfig.setInternalLogWriter(logWriter);\n }\n\n // LOG: create logWriter here\n logWriter = LogWriterFactory.createLogWriterLogger(logConfig, false);\n\n // Set this log writer in AgentConfig\n agentConfig.setInternalLogWriter(logWriter);\n\n // LOG:CONFIG: changed next three statements from config to info\n logger.info(LogMarker.CONFIG_MARKER,\n String.format(\"Agent config property file name: %s\",\n AgentConfigImpl.retrievePropertyFile()));\n logger.info(LogMarker.CONFIG_MARKER, agentConfig.getPropertyFileDescription());\n logger.info(LogMarker.CONFIG_MARKER, agentConfig.toPropertiesAsString());\n }",
"public void setUp() {\n instance = new LogMessage(type, id, operator, message, error);\n }",
"private void log4jConfig(String actionName) {\n\t\tString LOG4J_ROLLING_FILE_NAME_TOKEN = \"Launcher\";\n\t Logger rootLogger = LogManager.getRootLogger();\n\t RollingFileAppender fileAppender = (RollingFileAppender)rootLogger.getAppender(\"fileAppender\");\n\n\t // <param name=\"FileNamePattern\" value=\"/var/log/Launcher.log.%d{yyyy-MM-dd}.gz\"/>\n\t String currentLogFile = fileAppender.getFile();\n\t String newLogPattern = currentLogFile.replace(LOG4J_ROLLING_FILE_NAME_TOKEN, actionName);\n\t fileAppender.setFile(newLogPattern);\n\t \n\t fileAppender.activateOptions();\n\t}",
"private Logger configureLogging() {\r\n\t Logger rootLogger = Logger.getLogger(\"\");\r\n\t rootLogger.setLevel(Level.FINEST);\r\n\r\n\t // By default there is one handler: the console\r\n\t Handler[] defaultHandlers = Logger.getLogger(\"\").getHandlers();\r\n\t defaultHandlers[0].setLevel(Level.CONFIG);\r\n\r\n\t // Add our logger\r\n\t Logger ourLogger = Logger.getLogger(serviceLocator.getAPP_NAME());\r\n\t ourLogger.setLevel(Level.FINEST);\r\n\t \r\n\t // Add a file handler, putting the rotating files in the tmp directory \r\n\t // \"%u\" a unique number to resolve conflicts, \"%g\" the generation number to distinguish rotated logs \r\n\t try {\r\n\t Handler logHandler = new FileHandler(\"/%h\"+serviceLocator.getAPP_NAME() + \"_%u\" + \"_%g\" + \".log\",\r\n\t 1000000, 3);\r\n\t logHandler.setLevel(Level.FINEST);\r\n\t ourLogger.addHandler(logHandler);\r\n\t logHandler.setFormatter(new Formatter() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic String format(LogRecord record) {\r\n\t\t\t\t\t\tString result=\"\";\r\n\t\t\t\t\t\tif(record.getLevel().intValue() >= Level.WARNING.intValue()){\r\n\t\t\t\t\t\t\tresult += \"ATTENTION!: \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSimpleDateFormat df = new SimpleDateFormat(\"dd-MMM-yyyy HH:mm:ss\");\r\n\t\t\t\t\t\tDate d = new Date(record.getMillis());\r\n\t\t\t\t\t\tresult += df.format(d)+\" \";\r\n\t\t\t\t\t\tresult += \"[\"+record.getLevel()+\"] \";\r\n\t\t\t\t\t\tresult += this.formatMessage(record);\r\n\t\t\t\t\t\tresult += \"\\r\\n\";\r\n\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t } catch (Exception e) { // If we are unable to create log files\r\n\t throw new RuntimeException(\"Unable to initialize log files: \"\r\n\t + e.toString());\r\n\t }\r\n\r\n\t return ourLogger;\r\n\t }",
"private static void setupLogger(String path, String filename, Level level) throws IOException {\n Path logDir = Paths.get(path, filename + \"_log\");\n\t\tif (!Files.exists(logDir)) {\n\t\t\tFiles.createDirectories(logDir);\n\t\t}\n\t\tString fileName = logDir.resolve(\"searsia.log\").toString();\n Handler fileHandler = new FileHandler(fileName, 1048576, 100, true);\n fileHandler.setFormatter(new SimpleFormatter());\n LogManager.getLogManager().reset();\n\t\tLOGGER.addHandler(fileHandler);\n\t\tLOGGER.setLevel(level);\n\t\tLOGGER.warning(\"Searsia restart\");\n\t}",
"private HeaderBrandingTest()\n\t{\n\t\tBaseTest.classLogger = LoggerFactory.getLogger( HeaderBrandingTest.class );\n\t}",
"@Before\n public void beforeEach() {\n mockMvc = MockMvcBuilders\n .webAppContextSetup(context)\n .build();\n\n serviceMock = mock(PacketAppService.class);\n ReflectionTestUtils.setField(controller, PACKET_APP_SERVICE, serviceMock);\n\n testAppender = new TestLogAppender();\n root.addAppender(testAppender);\n root.setLevel(Level.DEBUG);\n }",
"void initializeLogging(String loggingProperties);",
"@Override\n\tpublic void initLogger() {\n\t\t\n\t}",
"@BeforeMethod\n\tpublic void setup()\n\t{\n\t ExtentHtmlReporter reporter=new ExtentHtmlReporter(\"./Reports/amazon.html\");\n\t\t\n\t extent = new ExtentReports();\n\t \n\t extent.attachReporter(reporter);\n\t \n\t logger=extent.createTest(\"LoginTest\");\n\t}",
"public void beforeClass() throws Exception\n {\n new File(\"test-logs\").mkdirs(); \n System.setProperty(\"hadoop.log.dir\", \"test-logs\");\n \n _fileSystem = FileSystem.get(new JobConf());\n }",
"private void configureLogging() throws FileNotFoundException, IOException {\n\t\tConfigurationSource source = new ConfigurationSource(new FileInputStream(CONFIG_LOG_LOCATION));\r\n\t\tConfigurator.initialize(null, source);\r\n\t\tlog = LogManager.getLogger(SekaiClient.class);\r\n\t}",
"public static synchronized void initializeLogger() {\n\t\t\n\t try {\n\t\t String workingDir = System.getProperty(\"user.dir\");\n\t\t String fileName = workingDir + File.separator + \"config\" + File.separator + \"logging.properties\";\n\t\t \n\t\t FileInputStream fileInputStream = new FileInputStream(fileName);\n\t\t LogManager.getLogManager().readConfiguration(fileInputStream);\n\t\t \n\t } catch (IOException ex) {\n\t\t System.err.println(\"Failed to load logging.properlies, please check the file and the path:\" + ex.getMessage()); \n\t ex.printStackTrace();\n\t System.exit(0);\n\t }\n\t}",
"private TestContext() {\n\t\tinitLog4j();\n\t\tloadConfig();\n\t}",
"private static void setupLogger(Application application) {\n\n\t\tapplication.addComponentMenu(Logger.class, \"Logger\", 0);\n\t\tapplication.addComponentMenuElement(Logger.class, \"Clear log\",\n\t\t\t\t(ActionEvent e) -> application.flushLoggerOutput());\n\t\tapplication.addComponentMenuElement(Logger.class, \"Fine level\", (ActionEvent e) -> logger.setLevel(Level.FINE));\n\t\tapplication.addComponentMenuElement(Logger.class, \"Info level\", (ActionEvent e) -> logger.setLevel(Level.INFO));\n\t\tapplication.addComponentMenuElement(Logger.class, \"Warning level\",\n\t\t\t\t(ActionEvent e) -> logger.setLevel(Level.WARNING));\n\t\tapplication.addComponentMenuElement(Logger.class, \"Severe level\",\n\t\t\t\t(ActionEvent e) -> logger.setLevel(Level.SEVERE));\n\t\tapplication.addComponentMenuElement(Logger.class, \"OFF logging\", (ActionEvent e) -> logger.setLevel(Level.OFF));\n\t}",
"public static void configureLog(final String logfile) {\n\t\tLoggerContext context = (LoggerContext) LoggerFactory\n\t\t\t\t.getILoggerFactory();\n\n\t\ttry {\n\t\t\tJoranConfigurator configurator = new JoranConfigurator();\n\t\t\tconfigurator.setContext(context);\n\t\t\t// Call context.reset() to clear any previous configuration, e.g.\n\t\t\t// default\n\t\t\t// configuration. For multi-step configuration, omit calling\n\t\t\t// context.reset().\n\t\t\tcontext.reset();\n\t\t\tconfigurator.doConfigure(logfile);\n\t\t} catch (JoranException je) {\n\t\t\tStatusPrinter.printInCaseOfErrorsOrWarnings(context);\n\t\t}\n\t}",
"private void initJulLogger() {\n SLF4JBridgeHandler.removeHandlersForRootLogger();\n SLF4JBridgeHandler.install();\n }",
"@BeforeSuite(alwaysRun = true)\n public static void startSuite() {\n\n ThreadContext.put(THREAD_ID, Thread.currentThread().getName());\n EnvironmentConfig.initializeEnvironment();\n\n // Instantiates and stores the WebDriver into the ThreadLocal variable\n driverThread = ThreadLocal.withInitial(() -> {\n /*\n The following instruction is used to tell log4j which file the log will be written to\n depending on the thread name. The thread name is used as the value threadId that is used as\n the routing key in the routing appender. Check the log4j2.xml config file.\n For more info check here:\n https://stackoverflow.com/questions/8355847/how-to-log-multiple-threads-in-different-log-files\n http://logging.apache.org/log4j/2.x/faq.html#separate_log_files\n */\n ThreadContext.put(THREAD_ID, Thread.currentThread().getName());\n\n logger.trace(\"Instantiate WebDriver\");\n DriverFactory webDriverThread = new DriverFactory();\n webDriverThreadPool.add(webDriverThread);\n return webDriverThread;\n });\n }",
"@Before\n public void setUp() {\n Log.getFindings().clear();\n Log.enableFailQuick(false);\n }",
"@Test\n public void testExistingLog4j2Logger() {\n org.apache.logging.log4j.LogManager.getLogger(\"existingLogger\");\n // Logger will be the one created above\n final Logger logger = Logger.getLogger(\"existingLogger\");\n final Logger l2 = LogManager.getLogger(\"existingLogger\");\n assertEquals(logger, l2);\n logger.setLevel(Level.ERROR);\n final Priority debug = Level.DEBUG;\n // the next line will throw an exception if the LogManager loggers\n // aren't supported by 1.2 Logger/Category\n logger.l7dlog(debug, \"Hello, World\", new Object[0], null);\n assertTrue(appender.getEvents().size() == 0);\n }",
"public static void setupElementLogger(String elementId, long logSize) throws IOException {\n\t\tint maxFileSize = (int) (logSize * 1_000_000); \n\t\tint logFileCount = Math.round(logSize);\n\t\tfinal File logDirectory = new File(Configuration.getLogDiskDirectory());\n\n\t\tlogDirectory.mkdirs();\n\n\t\tUserPrincipalLookupService lookupservice = FileSystems.getDefault().getUserPrincipalLookupService();\n\t\tfinal GroupPrincipal group = lookupservice.lookupPrincipalByGroupName(\"iofog\");\n\t\tFiles.getFileAttributeView(logDirectory.toPath(), PosixFileAttributeView.class,\n\t\t\t\tLinkOption.NOFOLLOW_LINKS).setGroup(group);\n\t\tSet<PosixFilePermission> perms = PosixFilePermissions.fromString(\"rwxrwx---\");\n\t\tFiles.setPosixFilePermissions(logDirectory.toPath(), perms);\n\n\t\tfinal String logFilePattern = logDirectory.getPath() + \"/\" + elementId + \".%g.log\";\n\t\tLogger logger = elementLogger.get(elementId);\n\t\t\n\t\tif (logger != null) {\n\t\t\tfor (Handler f : logger.getHandlers())\n\t\t\t\tf.close();\n\t\t} \n\t\t\n\t\tHandler logFileHandler = new FileHandler(logFilePattern, maxFileSize / logFileCount, logFileCount);\n\t\n\t\tlogFileHandler.setFormatter(new LogFormatter());\n\t\n\t\tlogger = Logger.getLogger(elementId);\n\t\tlogger.addHandler(logFileHandler);\n\n\t\tlogger.setUseParentHandlers(false);\n\n\t\telementLogger.put(elementId, logger);\n\t}",
"void setLoggerConfigFileName(String fileName);",
"public void enableLogging(Logger logger) {\n m_logger = logger;\n }",
"private void initLoggers()\n {\n Logger.getSharedInstance();\n\n for (Logger logger : Logger.getAllLoggers())\n {\n String key = \"Loggers/\" + logger.getNamespace();\n Level desired;\n\n if (!SmartDashboard.containsKey(key))\n {\n // First time this logger has been sent to SmartDashboard\n SmartDashboard.putString(key, logger.getLogLevel().name());\n desired = Level.DEBUG;\n }\n else\n {\n String choice = SmartDashboard.getString(key, \"DEBUG\");\n Level parsed = Level.valueOf(choice);\n if (parsed == null)\n {\n m_logger.error(\"The choice '\" + choice + \"' for logger \" + logger.getNamespace() + \" isn't a valid value.\");\n desired = Level.DEBUG;\n }\n else\n {\n desired = parsed;\n }\n }\n logger.setLogLevel(desired);\n }\n }",
"public void testLogger() {\n assertNotNull(rootBlog.getLogger());\n }",
"@BeforeMethod\n\tpublic void setup()\n\t{\n\t ExtentHtmlReporter reporter=new ExtentHtmlReporter(\"./Reports/naveen-report.html\");\n\t\t\n\t extent = new ExtentReports();\n\t \n\t extent.attachReporter(reporter);\n\t \n\t logger=extent.createTest(\"LoginTest\");\n\t}",
"protected synchronized void initializeLogger(Logger logger) {\n\n if( config==null) {\n _unInitializedLoggers.add( logger );\n } else {\n internalInitializeLogger( logger ); \n }\n }",
"@org.junit.Before\n public void setUp() {\n LOGGER.log(Level.INFO, \"Starting test\");\n emptyTestDirectory();\n }",
"public void testGetLogger(){\r\n assertNotNull(this.lm.getLogger(LoggerManagerTest.class.getPackage().getName()));\r\n }",
"public static void loadLog4jContext() throws FileNotFoundException {\n LoggerContext context = (LoggerContext) LogManager.getContext(false);\n final File log4jConfig = searchForLog4jConfig();\n context.setConfigLocation(log4jConfig.toURI());\n }",
"protected void setUp() throws Exception {\r\n instance = new LoggingInterceptor();\r\n }",
"private static void configureLogging(String currentDirectory) {\n System.out.println(\"Looking for watchdog.properties within current working directory : \" + currentDirectory);\n try {\n LogManager manager = LogManager.getLogManager();\n manager.readConfiguration(new FileInputStream(WATCHDOG_LOGGING_PROPERTIES));\n try {\n fileHandler = new FileHandler(WatchDogConfiguration.watchdogLogfilePath, true); //file\n SimpleFormatter simple = new SimpleFormatter();\n fileHandler.setFormatter(simple);\n logger.addHandler(fileHandler);//adding Handler for file\n } catch (IOException e) {\n System.err.println(\"Exception during configuration of logging.\");\n }\n } catch (IOException e) {\n System.err.println(e.getMessage());\n }\n logger.info(String.format(\"Monitoring: %s\", WatchDogConfiguration.watchdogDirectoryMonitored));\n logger.info(String.format(\"Processed: %s\", WatchDogConfiguration.watchdogDirectoryProcessed));\n logger.info(String.format(\"Logfile: %s\", WatchDogConfiguration.watchdogLogfilePath));\n }",
"public void setLogger(Logger logger)\n {\n this.logger = logger;\n }",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tPropertyConfigurator.configure(\"log4j.properties\");\n\t\tTradeTest tradeTest = new TradeTest();\n\t\ttradeTest.run();\n\t}",
"private static void createLogFile() {\n try {\n String date = new Date().toString().replaceAll(\":\", \"-\");\n logFile = new FileWriter(\"bio-formats-test-\" + date + \".log\");\n TestLogger log = new TestLogger(logFile);\n LogTools.setLog(log);\n }\n catch (IOException e) { }\n }",
"public void enableLogging( final Logger logger )\n {\n m_logger = logger;\n }",
"public void setUp() {\n threadName = Thread.currentThread().getName();\n }",
"private void setupLogging(BuildListener listener) {\n this.listener = listener;\n }",
"@Bean\r\n\tpublic ServletContextInitializer initializer() {\r\n\t return new ServletContextInitializer() {\r\n\r\n\t\t\tpublic void onStartup(ServletContext servletContext) throws ServletException {\r\n\t\t\t\tservletContext.setInitParameter(\"log4jConfigLocation\", \"classes/log4j.properties\");\r\n\t\t\t\tservletContext.addListener(\"org.springframework.web.util.Log4jConfigListener\");\r\n\t\t\t\tservletContext.addListener(\"org.springframework.web.util.IntrospectorCleanupListener\");\r\n\t\t\t}\r\n\t \t\r\n\t };\r\n\t}",
"public void setLogger(Logger logger) {\n this.logger = logger;\n }",
"public static TournamentLogger createDummyLogger(){\n\t\tTournamentLogger logger = new TournamentLogger();\n\t\tlogger.setEventLogPath(null);\n\t\tlogger.setPrintStdOut(false);\n\t\tlogger.setPrintStdErr(false);\n\t\treturn logger;\n\t}",
"protected void setUp() {\r\n auditDetail = new AuditDetail();\r\n }",
"public boolean isLog4JAvailable() {\n return isLogLibraryAvailable(\"Log4J\", LOGGING_IMPL_LOG4J_LOGGER);\n }",
"public void enableLogging();",
"@Test\r\n\tpublic void logTest() {\r\n\t\tlogger.info(\"Testando info\");\r\n\t\tlogger.debug(\"nao sera logado\" + \"Nice\");\r\n\t\tlogger.error(\"This is Error message\", new Exception(\"Testing\"));\r\n\t}",
"@BeforeEach\n public void setUp() throws IOException {\n logFiles = new ArrayList<>();\n logFiles.add(Paths.get(\"src/test/resources/logviewer-search-context-tests.log.test\"));\n logFiles.add(Paths.get(\"src/test/resources/logviewer-search-context-tests.log.gz\"));\n\n topoPath = Files.createTempDirectory(\"topoA\").toAbsolutePath().normalize();\n new File(topoPath.toFile(), \"6400\").createNewFile();\n new File(topoPath.toFile(), \"6500\").createNewFile();\n new File(topoPath.toFile(), \"6600\").createNewFile();\n new File(topoPath.toFile(), \"6700\").createNewFile();\n }",
"@Inject\n private void setLogger(Logger log) {\n logger = log;\n }",
"@Test(expected = TermsOfUseDaoConfigurationException.class)\r\n public void testCtor_loggerNameMissing() throws Exception {\r\n configurationObject.removeProperty(\"loggerName\");\r\n\r\n new ProjectTermsOfUseDaoImpl(configurationObject);\r\n }",
"private static final Logger getLog4JLogger(final Log l) {\r\n return ((org.apache.commons.logging.impl.Log4JLogger) l).getLogger();\r\n }",
"public Slf4jLogService() {\n this(System.getProperties());\n }",
"public void enableSDKLog() {\r\n\t\tString path = null;\r\n\t\tpath = Environment.getExternalStorageDirectory().toString() + \"/IcatchWifiCamera_SDK_Log\";\r\n\t\tEnvironment.getExternalStorageDirectory();\r\n\t\tICatchWificamLog.getInstance().setFileLogPath(path);\r\n\t\tLog.d(\"AppStart\", \"path: \" + path);\r\n\t\tif (path != null) {\r\n\t\t\tFile file = new File(path);\r\n\t\t\tif (!file.exists()) {\r\n\t\t\t\tfile.mkdirs();\r\n\t\t\t}\r\n\t\t}\r\n\t\tICatchWificamLog.getInstance().setSystemLogOutput(true);\r\n\t\tICatchWificamLog.getInstance().setFileLogOutput(true);\r\n\t\tICatchWificamLog.getInstance().setRtpLog(true);\r\n\t\tICatchWificamLog.getInstance().setPtpLog(true);\r\n\t\tICatchWificamLog.getInstance().setRtpLogLevel(ICatchLogLevel.ICH_LOG_LEVEL_INFO);\r\n\t\tICatchWificamLog.getInstance().setPtpLogLevel(ICatchLogLevel.ICH_LOG_LEVEL_INFO);\r\n\t}"
] | [
"0.7626134",
"0.75424933",
"0.6960288",
"0.6866488",
"0.67636406",
"0.6748121",
"0.6728164",
"0.6720177",
"0.66626257",
"0.65896004",
"0.6587946",
"0.65743446",
"0.649525",
"0.6455015",
"0.64466006",
"0.64219326",
"0.639844",
"0.6349239",
"0.6349189",
"0.6330632",
"0.6284492",
"0.6282842",
"0.62261456",
"0.62102914",
"0.61508214",
"0.6150603",
"0.6069924",
"0.6050074",
"0.60297173",
"0.6008694",
"0.60069466",
"0.60003006",
"0.596566",
"0.5959908",
"0.5893049",
"0.587983",
"0.58647436",
"0.5847861",
"0.58294904",
"0.58213955",
"0.5813061",
"0.580214",
"0.5799436",
"0.57897323",
"0.57695204",
"0.5757519",
"0.57456326",
"0.5717975",
"0.57105136",
"0.5701332",
"0.56564283",
"0.5655738",
"0.56211305",
"0.56066304",
"0.55250674",
"0.5524282",
"0.5494162",
"0.5489587",
"0.5453493",
"0.5449562",
"0.54490876",
"0.5434357",
"0.5425289",
"0.5402843",
"0.539432",
"0.53854185",
"0.5371834",
"0.5364558",
"0.53571105",
"0.5339388",
"0.5327338",
"0.53252566",
"0.53141433",
"0.5310735",
"0.5310443",
"0.5292622",
"0.52812064",
"0.527713",
"0.5241007",
"0.52271223",
"0.5224793",
"0.52214086",
"0.5218923",
"0.52145135",
"0.521171",
"0.5202981",
"0.5201464",
"0.5195571",
"0.51916784",
"0.5191479",
"0.5186398",
"0.51845723",
"0.5171837",
"0.51575786",
"0.5154016",
"0.51524067",
"0.51437026",
"0.51385945",
"0.51376826",
"0.51195204",
"0.51179993"
] | 0.0 | -1 |
Added on 09.Apr.2015 Start | public static boolean isInternetOn(Context context) {
_context = context;
ConnectivityManager connec = null;
// get Connectivity Manager object to check connection
//ConnectivityManager connec =
//(ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);
// get Connectivity Manager object to check connection
try {
connec = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);
// 0 is Mobile dataconnection
// 1 for Wifi Connection
NetworkInfo activeNetwork = connec.getActiveNetworkInfo();
if (activeNetwork != null) {
if (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTING ||
connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) {
//Common.IsLocalConnection = 2;
return true;
} else if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED ||
connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTING) {
//Common.IsLocalConnection = 1;
return true;
} else if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.DISCONNECTED ||
connec.getNetworkInfo(1).getState() == NetworkInfo.State.DISCONNECTED) {
//Common.IsLocalConnection = 0;
return false;
} // Check for network connections
} else {
// not connected to the internet
}
} catch (Exception ex) {
CrashAnalytics.CrashReport(ex);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected boolean func_70814_o() { return true; }",
"public final void mo51373a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"public void mo38117a() {\n }",
"private void m50366E() {\n }",
"protected boolean func_70041_e_() { return false; }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"public void mo12628c() {\n }",
"public void mo4359a() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"public void method_4270() {}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"public final void mo91715d() {\n }",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\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 sacrifier() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"public void mo12930a() {\n }",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"public void m23075a() {\n }",
"private void poetries() {\n\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"private void strin() {\n\n\t}",
"public abstract void mo70713b();",
"public void mo21779D() {\n }",
"public void gored() {\n\t\t\n\t}",
"public void mo115190b() {\n }",
"@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"public void mo21877s() {\n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"public void mo9848a() {\n }",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"protected void mo6255a() {\n }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"public void mo1531a() {\n }",
"public void mo21878t() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void mo6081a() {\n }",
"public void mo21825b() {\n }",
"@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 int describeContents() { return 0; }",
"public void mo55254a() {\n }",
"static void feladat4() {\n\t}",
"public abstract void mo56925d();",
"static void feladat9() {\n\t}",
"@Override\r\n\tvoid func04() {\n\t\t\r\n\t}",
"public static void listing5_14() {\n }",
"public void mo21785J() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"public void mo21794S() {\n }",
"public void mo21787L() {\n }",
"public abstract void mo6549b();",
"public void mo23813b() {\n }",
"public void mo3749d() {\n }",
"private void m50367F() {\n }",
"public void mo97908d() {\n }",
"public void mo1403c() {\n }",
"public void mo21793R() {\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"public abstract String mo13682d();",
"protected MetadataUGWD() {/* intentionally empty block */}",
"public void mo21782G() {\n }",
"@Override\n protected void init() {\n }",
"void m1864a() {\r\n }",
"private void init() {\n\n\t}",
"private zza.zza()\n\t\t{\n\t\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"public void mo21795T() {\n }",
"public void skystonePos4() {\n }",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}"
] | [
"0.5963188",
"0.5869135",
"0.58605343",
"0.5692185",
"0.5644176",
"0.55952317",
"0.5527498",
"0.55206436",
"0.5509141",
"0.5504767",
"0.55",
"0.54950887",
"0.5488248",
"0.5470673",
"0.54594576",
"0.54561037",
"0.5452408",
"0.5445401",
"0.5435836",
"0.54304045",
"0.54304045",
"0.54298806",
"0.54186094",
"0.5418576",
"0.5412735",
"0.54020065",
"0.5393167",
"0.5388771",
"0.5386044",
"0.5383178",
"0.53688514",
"0.5362645",
"0.5362645",
"0.5362645",
"0.5362645",
"0.5362645",
"0.5362645",
"0.5362645",
"0.53611726",
"0.53567",
"0.53322136",
"0.533203",
"0.53315705",
"0.53034073",
"0.52999216",
"0.5297106",
"0.52890044",
"0.5287447",
"0.5284221",
"0.5281395",
"0.5276148",
"0.52723056",
"0.52719736",
"0.5271348",
"0.52691895",
"0.5262529",
"0.5260067",
"0.525935",
"0.525706",
"0.5242705",
"0.52403307",
"0.52397966",
"0.5236886",
"0.5236886",
"0.5236886",
"0.5236886",
"0.5236886",
"0.5235976",
"0.5231121",
"0.52239853",
"0.52210486",
"0.521277",
"0.5211921",
"0.52115446",
"0.5204255",
"0.5202157",
"0.5190275",
"0.518997",
"0.518969",
"0.5187436",
"0.51764095",
"0.5173665",
"0.5169187",
"0.5169149",
"0.5165669",
"0.5162585",
"0.5162585",
"0.5153643",
"0.5153361",
"0.51513946",
"0.5150902",
"0.51458824",
"0.5136051",
"0.51337963",
"0.5132784",
"0.51245725",
"0.51178485",
"0.5117354",
"0.5112342",
"0.5112342",
"0.5112342"
] | 0.0 | -1 |
Create a URL from a location. This method supports the context:// pseudoprotocol for loading resources accessible from the context root path | public URL getURL(String location) throws MalformedURLException {
Context envContext = null;
try {
envContext = (Context)this.context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
} catch (ContextException e){
getLogger().error("ContextException in getURL",e);
}
if (envContext == null) {
getLogger().warn("no environment-context in application context (making an absolute URL)");
return new URL(location);
}
URL u = envContext.getResource("/" + location);
if (u != null)
return u;
else {
getLogger().info(location + " could not be found. (possible context problem)");
throw new MalformedURLException(location + " could not be found. (possible context problem)");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public URL getResourceLocation( String name );",
"private URL getResourceAsUrl(final String path) throws IOException {\n\t\treturn appContext.getResource(path).getURL();\n\t}",
"URL toURL() throws IOException;",
"public static <T> T load(URL location, ResourceBundle resources) throws IOException {\n return builder().location(location).resources(resources).build().load();\n }",
"java.lang.String getResourceUri();",
"public static <T> T load(URL location) throws IOException {\n return builder().location(location).build().load();\n }",
"public URL makeUrl(String path) throws IOException {\n path = Val.chkStr(path);\n URL url = null;\n \n if ((_localFolder.length() > 0) && (_externalFolder.length() > 0) &&\n path.startsWith(_localFolder)) {\n path = _externalFolder+path.substring(_localFolder.length());\n //LogUtil.getLogger().finer(\"Making URL for resource: \"+path);\n url = new URL(path); \n \n } else {\n //url = this.getClass().getClassLoader().getResource(path);\n //LogUtil.getLogger().finer(\"Making URL for resource: \"+path);\n url = Thread.currentThread().getContextClassLoader().getResource(path);\n }\n if (url == null) {\n throw new IOException(\"Unable to create resource URL for path: \"+path);\n }\n return url;\n}",
"public URL getURL()\n/* */ {\n/* 135 */ return ResourceUtils.getResourceAsURL(this, this);\n/* */ }",
"URI getLocation();",
"protected abstract URL resolve(String resource) throws IOException;",
"public static <T> T load(URL location, ResourceBundle resources, BuilderFactory builderFactory)\n throws IOException {\n return builder().location(location).resources(resources).builderFactory(builderFactory).build()\n .load();\n }",
"@Override\n public URI createUri(String url) {\n try {\n this.uri = new URI(url);\n } catch (URISyntaxException e) {\n e.printStackTrace();\n }\n return uri;\n }",
"public URL getURL() throws IOException {\r\n\t\tthrow new FileNotFoundException(getDescription() + \" cannot be resolved to URL\");\r\n\t}",
"@Nonnull public URL buildURL() throws MalformedURLException {\n installTrustStore();\n \n if (disableNameChecking) {\n final HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(final String hostname, final SSLSession session) {\n return true;\n }\n }; \n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); \n }\n \n final StringBuilder builder = new StringBuilder(getURL());\n if (getPath() != null) {\n builder.append(getPath());\n }\n\n return new URL(doBuildURL(builder).toString());\n }",
"URI createURI();",
"private static URI toResourceURI( Class<?> baseClass, String baseDir) {\n try {\n return\n baseClass != null\n ? baseClass.getResource( baseDir==null? \".\" : baseDir).toURI()\n : new URI( \"file://\" + (baseDir==null? \"\" : baseDir));\n }\n catch( Exception e) {\n throw new IllegalArgumentException( \"Can't create URI\", e);\n }\n }",
"protected abstract URL resolve(NamespaceId namesapace, String resource) throws IOException;",
"public static URL buildUrl() {\n Uri builtUri = Uri.parse(CONTENT_JSON_URL).buildUpon()\n .build();\n\n URL url = null;\n try {\n url = new URL(builtUri.toString());\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n return url;\n }",
"URI getUri();",
"String getUri( );",
"public static <T> T load(URL location, ResourceBundle resources, BuilderFactory builderFactory,\n Charset charset) throws IOException {\n return builder().location(location).resources(resources).builderFactory(builderFactory)\n .charset(charset).build().load();\n }",
"public ResourcePath() {\n //_externalFolder = \"file:///C:/Program%20Files/ESRI/GPT9/gpt/\";\n //_localFolder = \"gpt/\";\n}",
"String getUri();",
"Uri getUrl();",
"java.lang.String getUri();",
"java.lang.String getUri();",
"public static URL retrieveURL(ExecutionContext ctx, String resourceName, String urlSpec) throws Exception {\n if (resourceName != null)\r\n return DiagnoseUtil.findResource(ctx.resolveString(resourceName), false);\r\n // url != null, variable or direct value\r\n Object storedURL = ctx.resolveValue(urlSpec);\r\n if (storedURL instanceof String)\r\n return new URL((String) storedURL);\r\n else\r\n return (URL) storedURL;\r\n }",
"public Location(Context context){\n//\t\tthis.context = context;\n\t\tinit(context);\n\t}",
"String getURI();",
"String getURI();",
"String getURI();",
"public URI toURI( String location ) throws URISyntaxException {\n\t\treturn new URI( Strings.nvl(location).replace(\" \", \"%20\"));\n\t}",
"private static URL m23464a(Context context, String str) {\n try {\n return new URL(str);\n } catch (MalformedURLException e) {\n C5376d dVar = C5376d.EXCEPTION;\n StringBuilder sb = new StringBuilder();\n sb.append(\"OMSDK: can't create URL - \");\n sb.append(str);\n C5378f.m23016a(context, dVar, sb.toString(), e.getMessage(), \"\");\n return null;\n }\n }",
"public MarinerURL mapToExternalURL (MarinerRequestContext requestContext,\n MarinerURL url) {\n return url;\n }",
"public String getEasyCoopURI() {\r\n String uri = \"\";\r\n\r\n try {\r\n javax.naming.Context ctx = new javax.naming.InitialContext();\r\n uri = (String) ctx.lookup(\"java:comp/env/easycoopbaseurl\");\r\n //BASE_URI = uri; \r\n } catch (NamingException nx) {\r\n System.out.println(\"Error number exception\" + nx.getMessage().toString());\r\n }\r\n\r\n return uri;\r\n }",
"public URL makeBase(URL startingURL);",
"private static URI createUri(String eventSource, String protocol, String resource) {\n if (eventSource.contains(\"://\")) {\n // Defines the event source the full path? Indicated by containing more than the protocol (://) and top-level slashes\n return eventSource.chars().filter(ch -> ch == '/').count() > 3\n ? URI.create(eventSource)\n : URI.create(eventSource + resource);\n } else {\n // Defines the event source the sub path?\n return eventSource.chars().filter(ch -> ch == '/').count() > 1\n ? URI.create(protocol + \"://\" + eventSource)\n : URI.create(protocol + \"://\" + eventSource + resource);\n }\n }",
"FullUriTemplateString baseUri();",
"public interface ResourceLocation\n{\n\t/**\n\t * Create a new location that represents this resource but with a\n\t * different extension.\n\t *\n\t * @param newExtension\n\t * @return\n\t */\n\tResourceLocation withExtension(String newExtension);\n\n\t/**\n\t * Resolve a path relative to this location.\n\t *\n\t * @param path\n\t * @return\n\t */\n\tResourceLocation resolve(String path);\n\n\t/**\n\t * Get the name of this resource.\n\t *\n\t * @return\n\t */\n\tString getName();\n}",
"private InputSource urlLookup(ResourceLocation matchingEntry) {\n\n String uri = matchingEntry.getLocation();\n URL baseURL;\n\n //\n // The ResourceLocation may specify a relative url for its\n // location attribute. This is resolved using the appropriate\n // base.\n //\n if (matchingEntry.getBase() != null) {\n baseURL = matchingEntry.getBase();\n } else {\n try {\n baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());\n } catch (MalformedURLException ex) {\n throw new BuildException(\"Project basedir cannot be converted to a URL\");\n }\n }\n\n URL url;\n\n try {\n url = new URL(baseURL, uri);\n } catch (MalformedURLException ex) {\n url = null;\n }\n\n InputSource source = null;\n if (url != null) {\n try {\n InputStream is = null;\n URLConnection conn = url.openConnection();\n if (conn != null) {\n conn.setUseCaches(false);\n is = conn.getInputStream();\n }\n if (is != null) {\n source = new InputSource(is);\n String sysid = url.toExternalForm();\n source.setSystemId(sysid);\n log(\"catalog entry matched as a URL: '\"\n + sysid + \"'\", Project.MSG_DEBUG);\n }\n } catch (IOException ex) {\n // ignore\n }\n }\n\n return source;\n\n }",
"URI uri();",
"private DataLocation createLocation(String fileName) throws IOException {\n SimpleURI uri = new SimpleURI(fileName);\n if (uri.getSchema().isEmpty()) {\n // Add default File scheme and wrap local paths\n String canonicalPath = new File(fileName).getCanonicalPath();\n uri = new SimpleURI(Protocol.FILE_URI.getSchema() + canonicalPath);\n }\n\n // Check host\n Resource host = Comm.getAppHost();\n String hostName = uri.getHost();\n if (hostName != null && !hostName.isEmpty()) {\n host = Resource.getResource(hostName);\n if (host == null) {\n ErrorManager.error(\"Host \" + hostName + \" not found when creating data location.\");\n }\n }\n\n // Create location\n return DataLocation.createLocation(host, uri);\n }",
"abstract String getUri();",
"public URL getURL()\n {\n if( url == null )\n {\n // Check if the file is online or inside the JAR:\n if( filename.matches( SoundSystemConfig.PREFIX_URL ) )\n {\n // Online\n try\n {\n url = new URL( filename );\n }\n catch( Exception e )\n {\n errorMessage( \"Unable to access online URL in \" +\n \"method 'getURL'\" );\n printStackTrace( e );\n return null;\n }\n }\n else\n {\n // Inside the JAR\n url = getClass().getClassLoader().getResource(\n SoundSystemConfig.getSoundFilesPackage() + filename );\n }\n }\n return url;\n }",
"public static URL adjustURL(URL resource) throws MalformedURLException {\n \t\tString urlStr = resource.getFile();\n \t\tif (urlStr.startsWith(\"file://\"))\n \t\t\turlStr.replaceFirst(\"file://localhost\", \"file://\");\n \t\telse\n \t\t\turlStr = \"file:///\" + urlStr;\n \t\treturn new URL(urlStr);\n \t}",
"java.net.URL getUrl();",
"public Resource atLocation(Resource entity, Resource location) {\n return createStatement(entity.getURI(), ProvOntology.getAtLocationExpandedPropertyFullURI(),\n location.getURI());\n }",
"@DSSource({DSSourceKind.FILE_INFORMATION})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:00:49.376 -0500\", hash_original_method = \"AC6673E983BE229DBE393CCBB4A72E75\", hash_generated_method = \"03FD0CE5F473571E708DB9317FA1B856\")\n \npublic String getURI (String prefix)\n {\n return currentContext.getURI(prefix);\n }",
"private static final URL getURL(String url) throws ResourceManagerServiceClientCreationException {\r\n ArgumentChecker.checkNullOrEmpty(url, \"WSDL URL\");\r\n\r\n try {\r\n return new URL(url);\r\n } catch (MalformedURLException e) {\r\n throw new ResourceManagerServiceClientCreationException(\"Error while creating URL.\", e);\r\n }\r\n }",
"public abstract RestURL getURL();",
"@Override\n protected PipeResourceAddress newResourceAddress0(String original, String location) {\n\n String pipeName = URIUtils.getAuthority(location);\n String pathName = URIUtils.getPath(location);\n if (pipeName == null) {\n throw new IllegalArgumentException(String.format(\"URI %s missing pipe name\", location));\n }\n if (pathName != null && !pathName.isEmpty()) {\n throw new IllegalArgumentException(String.format(PIPE_PATH_ERROR_MESSAGE, pipeName, pipeName, pathName));\n }\n\n URI uriLocation = URI.create(location);\n return new PipeResourceAddress(this, original, uriLocation);\n\n }",
"public String getUri();",
"ResourceLocation resolve(String path);",
"public static ResourceLocation constructResourceLocation(String name) {\n\t\treturn new ResourceLocation(name);\n\t}",
"public boolean isUrl( String resourceLocation ) {\n\t\tif ( resourceLocation == null ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( resourceLocation.startsWith(URL_PREFIX_CLASSPATH) ) {\n\t\t\treturn true;\n\t\t}\n\t\ttry {\n\t\t\tnew URL(resourceLocation);\n\t\t\treturn true;\n\t\t} catch ( MalformedURLException ex ) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public static String getResourceEndpointURL(String resource) throws NotFoundException {\n\n return resourceURLBuilder.build(resource);\n }",
"private String get_url() {\n File file = new File(url);\n return file.getAbsolutePath();\n }",
"public static Node buildResource(final String uriOrLocalName) {\n\t\treturn NodeFactory.createURI(\n\t\t\t\turiOrLocalName.startsWith(\"http\") \n\t\t\t\t\t? uriOrLocalName \n\t\t\t\t\t: \"http://gazzax.rdf.org/\" + uriOrLocalName);\n\t}",
"public DIDURL(DID context, String url) throws MalformedDIDURLException {\n\t\tParser parser = new Parser();\n\t\tparser.parse(context, url);\n\t}",
"private static URL buildURL(String repositoryFileName) throws MalformedURLException {\n URL url = ClassHelper.getResource(repositoryFileName);\n\n // don't be too strict: if resource is not on the classpath, try ordinary file lookup\n if (url == null) {\n try {\n url = new File(repositoryFileName).toURL();\n }\n catch (MalformedURLException ignore) {\n }\n }\n\n if (url != null) {\n LOG.info(\"OJB Descriptor Repository: \" + url);\n } else {\n throw new MalformedURLException(\"did not find resource \" + repositoryFileName);\n }\n return url;\n }",
"void setLocationURI(URI locationURI);",
"Uri getJurisdiction();",
"public Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable environment) throws Exception {\r\n//\t\tContext ctx = getInitialContext(environment);\r\n\t\tReference ref = (Reference)obj;\r\n\t\tString url_string = (String)ref.get(\"URL\").getContent();\r\n\t\tURL url = new URL(url_string);\r\n\t\treturn url.getContent();\r\n }",
"private static URL toFileURL(URL resource) throws IOException {\n\t\t// Don't bother copying file urls\n\t\t//\n\t\tif (resource.getProtocol()\n\t\t\t.equalsIgnoreCase(\"file\"))\n\t\t\treturn resource;\n\n\t\t//\n\t\t// Need to make a copy to a temp file\n\t\t//\n\n\t\tFile f = File.createTempFile(\"resource\", \".jar\");\n\t\tFiles.createDirectories(f.getParentFile()\n\t\t\t.toPath());\n\t\ttry (InputStream in = resource.openStream(); OutputStream out = Files.newOutputStream(f.toPath())) {\n\t\t\tbyte[] buffer = new byte[BUFFER_SIZE];\n\t\t\tfor (int size; (size = in.read(buffer, 0, buffer.length)) > 0;) {\n\t\t\t\tout.write(buffer, 0, size);\n\t\t\t}\n\t\t}\n\t\tf.deleteOnExit();\n\t\treturn f.toURI()\n\t\t\t.toURL();\n\t}",
"String createUrl() throws JspException {\n\t\tAssert.state(this.value != null, \"No value set\");\n\t\tHttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();\n\t\tHttpServletResponse response = (HttpServletResponse) this.pageContext.getResponse();\n\n\t\tStringBuilder url = new StringBuilder();\n\t\tif (this.type == UrlType.CONTEXT_RELATIVE) {\n\t\t\t// add application context to url\n\t\t\tif (this.context == null) {\n\t\t\t\turl.append(request.getContextPath());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (this.context.endsWith(\"/\")) {\n\t\t\t\t\turl.append(this.context, 0, this.context.length() - 1);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\turl.append(this.context);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.type != UrlType.RELATIVE && this.type != UrlType.ABSOLUTE && !this.value.startsWith(\"/\")) {\n\t\t\turl.append('/');\n\t\t}\n\t\turl.append(replaceUriTemplateParams(this.value, this.params, this.templateParams));\n\t\turl.append(createQueryString(this.params, this.templateParams, (url.indexOf(\"?\") == -1)));\n\n\t\tString urlStr = url.toString();\n\t\tif (this.type != UrlType.ABSOLUTE) {\n\t\t\t// Add the session identifier if needed\n\t\t\t// (Do not embed the session identifier in a remote link!)\n\t\t\turlStr = response.encodeURL(urlStr);\n\t\t}\n\n\t\t// HTML and/or JavaScript escape, if demanded.\n\t\turlStr = htmlEscape(urlStr);\n\t\turlStr = (this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(urlStr) : urlStr);\n\n\t\treturn urlStr;\n\t}",
"public abstract String getURL();",
"private static URL buildURL(Calendar calendar) throws MalformedURLException {\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tbuilder.append(\"http://gapi.ereality.ru/events/\");\r\n\t\tbuilder.append(trueFormat.format(calendar.getTime()));\r\n\t\tbuilder.append(\".txt\");\r\n\t\treturn new URL(builder.toString());\r\n\t}",
"@Override\n public boolean isContextPathInUrl() {\n return false;\n }",
"@Override\n public boolean isContextPathInUrl() {\n return false;\n }",
"public String getURL();",
"public URL getLocation() {\n return location;\n }",
"public URI getLocation()\r\n/* 293: */ {\r\n/* 294:441 */ String value = getFirst(\"Location\");\r\n/* 295:442 */ return value != null ? URI.create(value) : null;\r\n/* 296: */ }",
"private static URL createURL(String requestedUrl) {\n URL url = null;\n try {\n url = new URL(requestedUrl);\n } catch (MalformedURLException e) {\n Log.e(TAG, \"createdUrl: Problem building URL\", e);\n }\n return url;\n }",
"String getBaseUri();",
"URL toURL(FileReference fileReferece);",
"String getURL(FsItem f);",
"private static String urlToLocalResource(String url) {\n if (!url.startsWith(\"@\")) { //$NON-NLS-1$\n return null;\n }\n int typeEnd = url.indexOf('/', 1);\n if (typeEnd == -1) {\n return null;\n }\n int nameBegin = typeEnd + 1;\n int typeBegin = 1;\n int colon = url.lastIndexOf(':', typeEnd);\n if (colon != -1) {\n String packageName = url.substring(typeBegin, colon);\n if (\"android\".equals(packageName)) { //$NON-NLS-1$\n // Don't want to point to non-local resources\n return null;\n }\n\n typeBegin = colon + 1;\n assert \"layout\".equals(url.substring(typeBegin, typeEnd)); //$NON-NLS-1$\n }\n\n return url.substring(nameBegin);\n }",
"URL getUrl();",
"public abstract URI target();",
"public static URL loadFile(String path) throws FileNotFoundException\n\t{\n\t\tFile f;\n\t\tURL u;\n\t\ttry {\n\t\t\tString jarPath = \"\";\n\t\t\tjarPath = Util.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();\n\t\t\tpath = new File(jarPath).getParent() + \"/resource\" +path;\n\t\t\tf = new File(path);\n\t\t\tu = f.toURI().toURL();\n\t\t} catch (MalformedURLException | URISyntaxException e) { throw new FileNotFoundException(\"failed to find resource at \\\"\" +path +\"\\\"\"); }\n\n\t\tif(u == null || !f.exists())\n\t\t\tthrow new FileNotFoundException(\"failed to find resource at \\\"\" +path +\"\\\"\");\n\n\t\treturn u; // in a jar, the URL code sometimes gets confused when things aren't found. Only return a valid URL if we are sure nothing is amiss\n\n\t}",
"@Override\n\tpublic URL getURL(String uri) throws MalformedURLException {\n\t\tif (uri.length() == 0) {\n\t\t\tthrow new MalformedURLException(\"Empty URI\");\n\t\t}\n\t\tURL url;\n\t\tif (uri.indexOf(\"://\") < 0) {\n\t\t\turl = new URL(getBaseURL(), uri);\n\t\t} else {\n\t\t\turl = new URL(uri);\n\t\t}\n\t\treturn url;\n\t}",
"public static String makeResourceFromURI(String uri) {\n String path = uri.substring(MagicNames.ANTLIB_PREFIX.length());\n String resource;\n if (path.startsWith(\"//\")) {\n //handle new style full paths to an antlib, in which\n //all but the forward slashes are allowed.\n resource = path.substring(\"//\".length());\n if (!resource.endsWith(\".xml\")) {\n //if we haven't already named an XML file, it gets antlib.xml\n resource += ANTLIB_XML;\n }\n } else {\n //convert from a package to a path\n resource = path.replace('.', '/') + ANTLIB_XML;\n }\n return resource;\n }",
"protected static File getFile(URL resourceUrl, String description) throws FileNotFoundException {\r\n\t\t//assert (resourceUrl == null);\r\n\t\tif (!URL_PROTOCOL_FILE.equals(resourceUrl.getProtocol())) {\r\n\t\t\tthrow new FileNotFoundException(\r\n\t\t\t\t\tdescription + \" cannot be resolved to absolute file path \" +\r\n\t\t\t\t\t\"because it does not reside in the file system: \" + resourceUrl);\r\n\t\t}\r\n\t\tFile file = null;\r\n\t\ttry {\r\n\t\t\tfile = new File(URLDecoder.decode(resourceUrl.getFile(), \"UTF-8\"));\r\n\t\t} catch (UnsupportedEncodingException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn file;\r\n\t}",
"private static URL getDeployableXmlUrl(Class<?> clazz)\n {\n // Initialize\n StringBuffer urlString = new StringBuffer();\n\n // Assemble filename in form \"fullyQualifiedClassName\"\n urlString.append(clazz.getName());\n\n // Make a String\n String flatten = urlString.toString();\n\n // Adjust for filename structure instead of package structure\n flatten = flatten.replace('.', '/');\n\n // Append Suffix\n flatten = flatten + DEFAULT_SUFFIX_DEPLOYABLE_XML;\n\n // Get URL\n URL url = Thread.currentThread().getContextClassLoader().getResource(flatten);\n assert url != null : \"URL was not found for \" + flatten;\n \n // Return\n return url;\n }",
"private URL createURL() {\n try {\n Log.d(\"URL\", \"create\");\n String urlString = \"http://cs262.cs.calvin.edu:8084/cs262dCleaningCrew/task/cjp27\";\n return new URL(urlString);\n } catch (Exception e) {\n Toast.makeText(this, getString(R.string.connection_error), Toast.LENGTH_SHORT).show();\n }\n\n return null;\n }",
"public static URL buildUrl(Double lat, Double lon) {\n return null;\n }",
"private URI getUri(final MMIContext context, final PrepareRequest request)\n throws URISyntaxException, MMIMessageException {\n final ContentURLType contentUrlType = request.getContentURL();\n if (contentUrlType != null) {\n final String href = contentUrlType.getHref();\n if (href != null) {\n return new URI(href);\n }\n }\n final AnyComplexType content = request.getContent();\n if (content != null) {\n return createTemporaryVoiceXmlDocumentUri(context, content);\n }\n return context.getContentURL();\n }",
"private static URL generateUrl(String requestedUrlString) {\n URL url = null;\n\n try {\n url = new URL(requestedUrlString);\n } catch (MalformedURLException e) {\n Log.e(LOG_TAG, \"Error creating a URL object : generateURL() block\", e);\n }\n return url;\n }",
"String url();",
"private Uri computeUri(Context param1) {\n }",
"public URL getUrl() throws MalformedURLException {\n StringBuilder pathAndQuery = new StringBuilder(100);\n String path = this.getPath();\n // Hack to allow entire URL to be provided in host field\n if (path.startsWith(HTTP_PREFIX)\n || path.startsWith(HTTPS_PREFIX)){\n return new URL(path);\n }\n String domain = getDomain();\n String protocol = getProtocol();\n if (PROTOCOL_FILE.equalsIgnoreCase(protocol)) {\n domain=null; // allow use of relative file URLs\n } else {\n // HTTP URLs must be absolute, allow file to be relative\n if (!path.startsWith(\"/\")){ // $NON-NLS-1$\n pathAndQuery.append(\"/\"); // $NON-NLS-1$\n }\n }\n pathAndQuery.append(path);\n \n // Add the query string if it is a HTTP GET or DELETE request\n if(HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod())) {\n // Get the query string encoded in specified encoding\n // If no encoding is specified by user, we will get it\n // encoded in UTF-8, which is what the HTTP spec says\n String queryString = getQueryString(getContentEncoding());\n if(queryString.length() > 0) {\n if (path.indexOf(QRY_PFX) > -1) {// Already contains a prefix\n pathAndQuery.append(QRY_SEP);\n } else {\n pathAndQuery.append(QRY_PFX);\n }\n pathAndQuery.append(queryString);\n }\n }\n // If default port for protocol is used, we do not include port in URL\n if(isProtocolDefaultPort()) {\n return new URL(protocol, domain, pathAndQuery.toString());\n }\n return new URL(protocol, domain, getPort(), pathAndQuery.toString());\n }",
"private DIDURL(DID context) {\n\t\tthis(context, (DIDURL)null);\n\t}",
"public URL getUrl() throws MalformedURLException {\n StringBuilder pathAndQuery = new StringBuilder(100);\n String path = this.getPath();\n // Hack to allow entire URL to be provided in host field\n if (path.startsWith(HTTP_PREFIX)\n || path.startsWith(HTTPS_PREFIX)) {\n return new URL(path);\n }\n String domain = getDomain();\n String protocol = getProtocol();\n if (PROTOCOL_FILE.equalsIgnoreCase(protocol)) {\n domain = null; // allow use of relative file URLs\n } else {\n // HTTP URLs must be absolute, allow file to be relative\n if (!path.startsWith(\"/\")) { // $NON-NLS-1$\n pathAndQuery.append(\"/\"); // $NON-NLS-1$\n }\n }\n pathAndQuery.append(path);\n \n // Add the query string if it is a HTTP GET or DELETE request\n if (HTTPConstants.GET.equals(getMethod()) || HTTPConstants.DELETE.equals(getMethod())) {\n // Get the query string encoded in specified encoding\n // If no encoding is specified by user, we will get it\n // encoded in UTF-8, which is what the HTTP spec says\n String queryString = getQueryString(getContentEncoding());\n if (queryString.length() > 0) {\n if (path.contains(QRY_PFX)) {// Already contains a prefix\n pathAndQuery.append(QRY_SEP);\n } else {\n pathAndQuery.append(QRY_PFX);\n }\n pathAndQuery.append(queryString);\n }\n }\n // If default port for protocol is used, we do not include port in URL\n if (isProtocolDefaultPort()) {\n return new URL(protocol, domain, pathAndQuery.toString());\n }\n return new URL(protocol, domain, getPort(), pathAndQuery.toString());\n }",
"private void createFakeAssetURLMapEntry(MarinerRequestContext context,\n String url) {\n // copied from ObjectElement implementation \n ApplicationContext ac = ContextInternals.getApplicationContext(context);\n PackageResources pr = ac.getPackageResources();\n if (pr != null) {\n PackagedURLEncoder packagedURLEncoder = ac.getPackagedURLEncoder();\n if (packagedURLEncoder != null) {\n String encoded = packagedURLEncoder.getEncodedURI(url);\n PackageResources.Asset prAsset = new PackageResources.Asset(\n url, false);\n pr.addAssetURLMapping(encoded, prAsset);\n }\n }\n }",
"private URL getURL(String filename) {\n\t\tURL url = null;\r\n\t\ttry { \r\n\t\t\turl = this.getClass().getResource(filename);\r\n\t\t} catch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn url;\r\n\t}",
"public Url getUrl(Oid oid) {\n\t\treturn retrieveByOid(oid);\n\t}",
"private URLHelper() {\n\n }",
"private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}",
"String getSpecUrl();",
"public URL resolveResource(final String resourcePath) throws MalformedURLException {\n\t\tFile resourceFile = new File(getFullPath(resourcePath));\n\t\tif (resourceFile.exists()) {\n\t\t\treturn resourceFile.toURL();\n\t\t}\n\t\tif (LOG.isTraceEnabled()) {\n\t\t\tLOG.trace(\"Resource at \\n\\t\" + resourceFile.getPath() + \" not found.\");\n\t\t}\n\t\treturn null;\n\t}"
] | [
"0.62191397",
"0.5768189",
"0.56726843",
"0.5607959",
"0.56031114",
"0.560019",
"0.5581898",
"0.55811113",
"0.5496695",
"0.5492273",
"0.5469871",
"0.54344517",
"0.54265964",
"0.5364118",
"0.5341628",
"0.52905136",
"0.5256868",
"0.52557564",
"0.5253657",
"0.5249827",
"0.5239101",
"0.52087206",
"0.52016854",
"0.51942056",
"0.517362",
"0.517362",
"0.5172176",
"0.51390904",
"0.51308626",
"0.51308626",
"0.51308626",
"0.5104032",
"0.5097354",
"0.5094578",
"0.5080405",
"0.50802225",
"0.5077673",
"0.5073775",
"0.5070561",
"0.503288",
"0.50319386",
"0.5027492",
"0.50240225",
"0.5018216",
"0.50179005",
"0.5008655",
"0.4996262",
"0.49877012",
"0.49870047",
"0.49767727",
"0.49631757",
"0.4962102",
"0.49350545",
"0.49250904",
"0.4914854",
"0.49069396",
"0.48960018",
"0.48935726",
"0.4890544",
"0.4877759",
"0.4864771",
"0.48556107",
"0.48498455",
"0.4849352",
"0.48491442",
"0.48478982",
"0.48449606",
"0.48420504",
"0.48420504",
"0.48344585",
"0.48251688",
"0.48229155",
"0.48223338",
"0.48213544",
"0.48161444",
"0.48148608",
"0.48000962",
"0.47760525",
"0.47748217",
"0.47717762",
"0.47701743",
"0.47663668",
"0.47559476",
"0.47500417",
"0.47410965",
"0.4735323",
"0.47303623",
"0.47300288",
"0.47285262",
"0.4726993",
"0.47219437",
"0.471653",
"0.47143912",
"0.47069162",
"0.46998096",
"0.46900156",
"0.4687252",
"0.46844915",
"0.46739933",
"0.46570307"
] | 0.71535075 | 0 |
end initialize(). Implemented ActionListener abstract methods.Handles the events when a button is pressed. | public void actionPerformed(ActionEvent e){
String command = e.getActionCommand();
if(command == "login"){
if(isUserValid(loginView.getUserNameTextField().getText(),
loginView.getUserPasswordField().getPassword())){
PosPiMenu posMenu = new PosPiMenu(this.dataConnection, this.dataUser, this.dataPassword);
posMenu.showGUI();
this.loginView.getMainFrame().dispose();
}
}//end if
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJButton btn = (JButton)e.getSource();\r\n\t\tif(btn==btnVclListen)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnlisten_Click\");\r\n\t\t}\r\n\t\telse if(btn == btnFinal){\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnfinal_Click\");\r\n\t\t\t//Vocabulary vocabulary = new Vocabulary();\r\n\t\t}\r\n\t\telse if(btn == btnOpenfile){\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnOpen_Click\");\r\n\t\t\t//Vocabulary vocabulary = new Vocabulary();\r\n\t\t}\r\n\t\telse if(btn == btnHome){\r\n\t\t\tSystem.out.println(\"ExerciseVocabulary_listen --> btnHome_Click\");\r\n\t\t\tExVclListen.frame.setVisible(false);\r\n\t\t\tmenuVocabulary vcl = new menuVocabulary();\r\n\t\t\t\r\n\t\t\t//Vocabulary vocabulary = new Vocabulary();\r\n\t\t}\r\n\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) \n\t\t{\n\t\t\t\n\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t}",
"@Override\r\n \t\tpublic void actionPerformed(ActionEvent e) {\n \t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) \n\t\t{\n\t\t\t\n\t\t}",
"@Override //se repita\r\n public void actionPerformed(ActionEvent ae) {\r\n \r\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\n\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n \n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n \n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n \n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t\t\n\t}",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\r\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0)\n\t{\n\t\t\n\t}",
"@Override\n\t public void actionPerformed(ActionEvent e){\n\t }",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\r\n\t}",
"public void actionPerformed(ActionEvent e) {\n }",
"public void actionPerformed(ActionEvent e)\n {\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e)\n\t{\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(\n\t\t\tActionEvent e)\n\t\t{\n\t\t\t\n\t\t}",
"@Override\r\n public void actionPerformed(ActionEvent e)\r\n {\n \r\n }",
"@Override\n public void actionPerformed(ActionEvent ev) {\n }",
"public void actionPerformed(ActionEvent e) {\r\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\n\t}",
"@Override\r\n public void actionPerformed(ActionEvent e) {\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\n\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}",
"@Override\n public void actionPerformed(ActionEvent arg0)\n {\n\n }",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\r\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\t\n\t}"
] | [
"0.7587681",
"0.7552371",
"0.75152695",
"0.75152695",
"0.7496436",
"0.74727607",
"0.74727607",
"0.74727607",
"0.74727607",
"0.74723655",
"0.7467169",
"0.7452305",
"0.74412495",
"0.74388856",
"0.74388856",
"0.74388856",
"0.7420936",
"0.7420936",
"0.74146444",
"0.736842",
"0.7359303",
"0.7359303",
"0.7359303",
"0.7351926",
"0.7351926",
"0.7335722",
"0.73296833",
"0.7325108",
"0.73245317",
"0.73245317",
"0.73245317",
"0.73245317",
"0.73245317",
"0.73245317",
"0.7317132",
"0.731672",
"0.731448",
"0.7298739",
"0.7298739",
"0.7298739",
"0.7298739",
"0.7298739",
"0.7298739",
"0.7298739",
"0.7298739",
"0.7298739",
"0.7298739",
"0.72943956",
"0.72932446",
"0.7289817",
"0.7282802",
"0.72783625",
"0.7266806",
"0.7263343",
"0.7261515",
"0.7261515",
"0.7261515",
"0.7261515",
"0.7261515",
"0.7261515",
"0.7261515",
"0.7261515",
"0.7261515",
"0.7257977",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.7250496",
"0.724936",
"0.7247487",
"0.7247487",
"0.7247487",
"0.72461176",
"0.72442406",
"0.72378224",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988",
"0.7234988"
] | 0.0 | -1 |
end actionPerformed(). Checks the database if username and password is valid. | public boolean isUserValid(String userName, char[] password){
Connection dbConnection = null;
PreparedStatement selectStatement = null;
ResultSet rs = null;
try{
dbConnection = DriverManager.getConnection(dataConnection, dataUser, dataPassword);
selectStatement = dbConnection.prepareStatement("SELECT password FROM users WHERE user_name = ?");
selectStatement.setString(1, userName);
rs = selectStatement.executeQuery();
if(rs.next()){
if(Arrays.equals(password, rs.getString("password").toCharArray())){
return true;
}
else{
JOptionPane.showMessageDialog(null, "Sorry, incorrect password.",
"Invalid password.",
JOptionPane.WARNING_MESSAGE);
return false;
}//end if
}
else{
JOptionPane.showMessageDialog(null, "Sorry, the username is not recognised.",
"Invalid username.",
JOptionPane.WARNING_MESSAGE);
return false;
}//end if
}//end try
catch(SQLException sqlEx){
JOptionPane.showMessageDialog(null, sqlEx.toString(),
"Error in connecting to database.",
JOptionPane.WARNING_MESSAGE);
return false;
}//end catch
catch(Exception eEx){
JOptionPane.showMessageDialog(null, eEx.toString(),
"Error in connecting to database",
JOptionPane.WARNING_MESSAGE);
return false;
}//end catch
finally{
dbConnection = null;
selectStatement = null;
rs = null;
}//end finally
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void actionPerformed(ActionEvent e) {\n if (e.getSource() == submitButton) {\n username = usernameInput.getText();\n password = passwordInput.getText();\n\n //Check lengths\n for(int i = 0; i < JavaMySQL.username_vector.length;i++)\n {\n if(username.equals(JavaMySQL.username_vector[i]))\n {\n //System.out.println(\"username good\");\n if(password.equals(JavaMySQL.passwords_vector[i]))\n {\n // System.out.println(\"pw good\");\n\n if(JavaMySQL.mechanic_status[i] == 0)\n {\n ClientGUI clientGUI = new ClientGUI(username);\n\n }\n else\n {\n MechanicGUI mechanicGUI = new MechanicGUI(username);\n }\n }\n }\n\n }\n\n //If lengths are ok, code inside \"else\"\n// else{\n// //Add query to check if user exists in DB\n// frame.setVisible(false);\n// }\n }\n\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tif(fn.getText().equals(\"\")||use.getText().equals(\"\")||use.getText().equals(\"\")||pas.getText().equals(\"\")||cpas.getText().equals(\"\"))\r\n\t\t\t\t{\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"all fields are required\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(!pas.getText().equals(cpas.getText()))\r\n\t\t\t\t{\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"password and confirm password field should be same\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tString fna= fn.getText();\r\n\t\t\t\t\tString sna=sn.getText();\r\n\t\t\t\t\tString user=use.getText();\r\n\t\t\t\t\t\tString pass=cpas.getText();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\tClass.forName(Constant.DRIVER);\r\n\t\t\t\t\tcon= DriverManager.getConnection(Constant.CONNECTION_STRING, Constant.USRENAME, Constant.PASSWORD);\r\n\t\t\t\t\tString querry=\"insert into login values('\"+fn.getText()+\"','\"+sn.getText()+\"','\"+use.getText()+\"','\"+pass+\"')\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tst=con.createStatement();\r\n\t\t\t\t\tst.executeUpdate(querry);\r\n\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"upated\");\r\n\t\t\t\t\tf.dispose();\r\n\t\t\t\t\tnew Dashboard();\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\tcatch(Exception ea) {\r\n\t\t\t\t\t\tea.printStackTrace();\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Error please Check your information and try again\");\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t}",
"private void login()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Get the connection to the database\r\n\t\t\tDatabase db = new Database();\r\n\r\n\t\t\t//Get the data and format it correctly\r\n\t\t\tString username = txtUsername.getText().trim().toLowerCase();\r\n\t\t\tString password = new String(txtPassword.getPassword()).trim();\r\n\r\n\t\t\t//Verify that user information has been inserted into the username/password fields\r\n\t\t\tif (username.length() == 0)\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\tthis,\r\n\t\t\t\t\t\"Please enter your username.\",\r\n\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t);\r\n\r\n\t\t\t\ttxtUsername.requestFocus();\r\n\t\t\t}//End of if\r\n\t\t\telse if (password.length() == 0)\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\tthis,\r\n\t\t\t\t\t\"Please enter your password.\",\r\n\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t);\r\n\r\n\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t}//End of else if\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif (!db.usernameExists(username))\r\n\t\t\t\t{\r\n\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\"The username/password combination you provided does not exist.\",\r\n\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t}//End of if\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tUser user = db.loadUser(username);\r\n\t\t\t\t\tbyte [] bPassword = PasswordEncryption.hashPassword(username, password);\r\n\r\n\t\t\t\t\tif (bPassword.length != user.getPassword().length)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\t\t\"The username/password combination you provided does not exist.\",\r\n\t\t\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t\t}//End of if\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tboolean same = true;\r\n\r\n\t\t\t\t\t\t//Check the passwords for equality\r\n\t\t\t\t\t\tfor (int x = 0; x < bPassword.length; x++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (bPassword[x] != user.getPassword()[x])\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tsame = false;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}//End of if\r\n\t\t\t\t\t\t}//End of for\r\n\r\n\t\t\t\t\t\tif (same)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (user.getAccountLevel() < 10)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\t\t\t\"You do not have sufficient rights to access this application.\",\r\n\t\t\t\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t\t\t\t}//End of if\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t//Login the user\r\n\t\t\t\t\t\t\t\tSession.login(user);\r\n\r\n\t\t\t\t\t\t\t\t//Open the dashbard\r\n\t\t\t\t\t\t\t\tSession.openWindow(new Dashboard());\r\n\r\n\t\t\t\t\t\t\t\t//Close this window\r\n\t\t\t\t\t\t\t\tthis.dispose();\r\n\t\t\t\t\t\t\t}//End of else\r\n\t\t\t\t\t\t}//End of if\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\t\t\t\t\tthis,\r\n\t\t\t\t\t\t\t\t\"The username/password combination your provided does not exist.\",\r\n\t\t\t\t\t\t\t\tApplication.NAME,\r\n\t\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\ttxtPassword.setText(\"\");\r\n\t\t\t\t\t\t\ttxtPassword.requestFocus();\r\n\t\t\t\t\t\t}//End of else\r\n\t\t\t\t\t}//End of else\r\n\t\t\t\t}//End of else\r\n\t\t\t}//End of else\r\n\t\t}//End of try\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\t//Inform the user that the application was unable to connect to the database.\r\n\t\t\tJOptionPane.showMessageDialog(\r\n\t\t\t\tthis,\r\n\t\t\t\t\"An error occured connecting to the database.\\n\\nIf this problem continues, please contact your system administrator.\",\r\n\t\t\t\tApplication.NAME,\r\n\t\t\t\tJOptionPane.ERROR_MESSAGE\r\n\t\t\t);\r\n\t\t}//End of catch\r\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tif (arg0.getActionCommand().equals(\"LOGIN\")) {\n\t\t\t\n\t\t\t// Verify username is valid and acquire associated password for account\n\t\t\tString username = usernameTF.getText();\n\t\t\t\n\t\t\t// Database: Check for username\n\t\t\tif (username == \"jmn7080\") {\n\t\t\t\t// Get password from database\n\t\t\t//\tcorrectPassword = getAssociatedPassword(username);\n\t\t\t\t\n\t\t\t\t// Retrieve password input by user\n\t\t\t\tchar[] input = passwordPF.getPassword();\n\t\t\t\tchar[] correctPassword = { 's', 'a', 'v', 'e', 'm', 'e'};\n\t\t\t\t\n\t\t\t\tif (isPasswordCorrect(input, correctPassword)) {\n\t\t\t\t\tJOptionPane.showMessageDialog(newUserWindow,\"Success! You typed the right password.\");\n\t\t\t\t\tloginWindow.dispose();\n\t\t\t\t\tcreateTempData();\n\t\t\t\t\tteacherPortalScreen();\n\t\t\t\t\t\n\t\t } else {\n\t\t \t\t\tJOptionPane.showMessageDialog(newUserWindow,\"Invalid password. Try again.\",\n\t\t \"Error Message\", JOptionPane.ERROR_MESSAGE);\n\t\t usernameTF.setText(\"\");\n\t\t passwordPF.setText(\"\");\n\t\t \n\t\t // Zero out the possible password, for security.\n\t\t Arrays.fill(input, '0');\n\t\t }\n\t\t\t\t\n\t\t\t\t// Zero out the possible password, for security.\n\t Arrays.fill(input, '0');\n\t \n\t passwordPF.selectAll();\n\t resetFocus();\n\t\t\t} \n\t\t}\n\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\n\t\t\t\tif (uName.getText().equals(AdminPage.NAME) && password.getText().equals(AdminPage.PASSWORD)) {\n\n\t\t\t\t\tnew AdminPage();\n\t\t\t\t\tMainGUI.sf.close();\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tMainGUI.rs = MainGUI.statement.executeQuery(\n\t\t\t\t\t\t\t\t\"SELECT password\\r\\n\" + \"FROM USERS\\r\\n\" + \"WHERE name='\" + uName.getText() + \"'\");\n\t\t\t\t\t} catch (SQLException e2) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te2.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tint b = 0;\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tif (!MainGUI.rs.next() || !MainGUI.rs.getString(\"PASSWORD\").equals(password.getText())) {\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Invalid Username or Password\", \"Error\",\n\t\t\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t\tb++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tif (b != 0)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tif (password.getText().equals(MainGUI.rs.getString(\"PASSWORD\"))) {\n\t\t\t\t\t\t\t\tString name, mail = null, password = null, gender = null, dob = null;\n\t\t\t\t\t\t\t\tint wallet = 0, id = -1;\n\t\t\t\t\t\t\t\tname = uName.getText();\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tMainGUI.rs = MainGUI.statement.executeQuery(\n\t\t\t\t\t\t\t\t\t\t\t\"SELECT *\\r\\n\" + \"FROM USERS\\r\\n\" + \"WHERE name='\" + uName.getText() + \"'\");\n\t\t\t\t\t\t\t\t\twhile (MainGUI.rs.next()) {\n\t\t\t\t\t\t\t\t\t\tmail = MainGUI.rs.getString(\"EMAIL\");\n\t\t\t\t\t\t\t\t\t\tpassword = MainGUI.rs.getString(\"PASSWORD\");\n\t\t\t\t\t\t\t\t\t\tgender = MainGUI.rs.getString(\"GENDER\");\n\t\t\t\t\t\t\t\t\t\tdob = MainGUI.rs.getString(\"DOB\");\n\t\t\t\t\t\t\t\t\t\tdob = dob.substring(0, 10);\n\t\t\t\t\t\t\t\t\t\twallet = MainGUI.rs.getInt(\"WALLET\");\n\t\t\t\t\t\t\t\t\t\tid = MainGUI.rs.getInt(\"ID\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tUser user = new User(name, mail, password, gender, wallet, dob, id);\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tnew LibraryGUI(user);\n\t\t\t\t\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tMainGUI.sf.close();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} while (MainGUI.rs.next());\n\t\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// ----------------------------------------------------------\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tif (campoUsername.getText().replace(\" \", \"\").equals(\"\")\n\t\t\t\t\t\t|| new String(campoPassword.getPassword()).replace(\" \", \"\").equals(\"\")) {\n\t\t\t\t\tmostraMissatge(\"No ha possat username o password\");\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\tcv.PrLogin(campoUsername.getText(), new String(campoPassword.getPassword()));\n\t\t\t\t}\n\t\t\t}",
"public void actionPerformed(ActionEvent e) \n {\n\t\t\t\tWrapper conn = null;\n\t\t\t\ttry //try block\n {\n //declare variables\n\t\t\t\tString username = \"\";\n\t\t\t\tString password = \"\";\n\t\t\t\t\n\t\t\t\t//get values using getText() method\n\t\t\t\tusername = txtUser.getText().trim();\n\t\t\t\tpassword = txtPassword.getText().trim();\n\t\t\t\t\n // check condition it field equals to blank throw error message\n\t\t\t\tif (username.equals(\"\")|| password.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\" name or password or Role is wrong\",\"Error\",JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t\telse //else insert query is run properly\n {\n\t\t\t\t\tString IQuery = \"INSERT INTO `demo`.`loginaccount`(`username`,`password`,`ts`) VALUES('\"+username+\"', '\"+password+\"',current_timestamp)\";\n\t\t\t\t\tSystem.out.println(IQuery);//print on console\n\t\t\t\t\tSystem.out.println(\"Connecting to a selected database...\");\n\t\t\t\t\n\t\t\t\t//STEP 3: Open a connection\n\t\t\t\tconn = DriverManager.getConnection(DB_URL, USER, PASS);\n\t\t\t\t\tSystem.out.println(\"Connected database successfully...\");\n\t\t\t\t\t \n\t\t\t\t((Connection)conn).createStatement().execute(IQuery);//select the rows\n\t\t\t\t\t// define SMessage variable\n\t\t\t\t\tString SMessage = \"Record added for \"+username;\n\t\t\t\t\t\n // create dialog ox which is print message\n\t JOptionPane.showMessageDialog(null,SMessage,\"Message\",JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t//close connection\n\t\t\t\t\t((java.sql.Connection)conn).close();\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tcatch (SQLException se) \n\t\t\t{\n\t\t\t\t//handle errors for JDBC\n\t\t\t\tse.printStackTrace();\n\t\t\t}\n\t\t\tcatch (Exception a) //catch block\n\t\t\t{\n\t\t\t\ta.printStackTrace();\n\t\t\t}\n\t\t }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tSystem.out.println(\"am in Validate click\");\n\t\t\t\t\n\t\t\t\tString u=user.getText();\n\t\t\t\n\t\t\t\tString p=pwd.getText();\n\t\t\t\tif(u.equals(\"seed\")&&p.equals(\"infotech\"))\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"You are a Valid user\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"You are a InValid user\");\n\t\t\t\n\t\t\t\t\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\r\n//\t\t\t\tSqlCheck();\r\n\t\t\t\tchangepassword();\r\n\t\t\t\tbutton2.addActionListener(new ActionListener() {\r\n\t\t\t\t\tpublic void actionPerformed(ActionEvent ex) {\r\n\t\t\t\t\t\tBoolean successrate=false;\r\n\t\t\t\t\t\tString newpass=newpas.getText();\r\n\t\t\t\t\t\tString verifynewpass=verify.getText();\r\n\t\t\t\t\t\tString currentpassword=currentp.getText();\r\n\t\t\t\t\t\tif(newpass.equals(verifynewpass)) {\r\n\t\t\t\t\t\t\tSql changepass=new Sql(newpass,usernameformainpage,currentpassword);\r\n\t\t\t\t\t\t\tsuccessrate= changepass.changepasswordofdoctor();\r\n\t\t\t\t\t\t\tif(successrate==true) {\r\n\t\t\t\t\t\t\t\twinPassword.dispose();\r\n\t\t\t\t\t\t\t\tmainWin.dispose();\r\n\t\t\t\t\t\t\t\tMainLoginPage mm=new MainLoginPage();\r\n\t\t\t\t\t\t\t\tmm.display();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(winPassword, \"Invalid current password\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(winPassword, \"New password and verify password doesn't match\");\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}",
"@Override\r\npublic void actionPerformed(ActionEvent e) {\n\tString str=e.getActionCommand();\r\n\tif(str.equalsIgnoreCase(\"login\")){\r\n\t\t//System.out.println(\"login\");\r\n\t\tString e1=name.getText();\r\n\t\tString e2=password.getText();\r\n\t\tConnection conn=DBUtility.getConnections();\r\n\t\tString sql=\"SELECT * FROM login where name=? and password=?\";\r\n\t\tSystem.out.println(\"ju\");\r\n\t\ttry{\r\n\t\t\tPreparedStatement ps=conn.prepareStatement(sql);\r\n\t\t\t\r\n\t\t\tps.setString(1,e1);\r\n\t\t\tps.setString(2, e2);\r\n\t\t\tSystem.out.println(\"n\");\r\n\t\t\tResultSet rs=ps.executeQuery();\r\n\t\t\tSystem.out.println(\"jhj\");\r\n\t\t\t//int i=rs.getRow();\r\n\t\t\twhile(rs.next()){\r\n\t\t\tJOptionPane.showMessageDialog(null,\"LOGIN SUCCESSFUL!\");\r\n\t\t\tc=1;\t\r\n\t\t\t\tnew Main();\r\n\t\t\t f.dispose();\r\n\t\t\t}\r\n\t\t\tif(c==0){\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"WRONG USERNAME OR PASSWORD\");}//try\r\n\t\t\t}\r\n\t\tcatch(Exception e11){\r\n\t\t\t\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\ttry{\r\n\t\t\t\tconn.close();\r\n\t\t\t}\r\n\t\t\r\n\t\t\tcatch(Exception e21){\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}}\r\n\t\r\n\t\telse if(str.equalsIgnoreCase(\"sign up\")){\r\n\t\tnew Signup();\r\n\t\tf.dispose();\r\n\t}}",
"private void btn_LoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_LoginActionPerformed\n // Connect to database and verify login credentials\n try{\n String valid = \"\";\n // Connect to the database\n DBConnect con = new DBConnect();\n // SQL query statement\n ResultSet rs = con.getStatement().executeQuery(\"SELECT [PlayerId]\" +\n \", [Username], [Password] FROM LoginInfo\");\n\n // Validate the username and password\n while(rs.next()){\n /* If the username and password are incorrect then skip through\n the loop */\n if(!rs.getString(2).equals(txt_userName.getText()) ||\n !Arrays.equals(rs.getString(3).toCharArray(),\n password_password.getPassword())){\n continue;\n }\n // If username and password are correct then log in\n playerId = Integer.parseInt(rs.getString(1));\n valid = \"Login Successful\";\n\n // Create and display Main Form\n new frm_Main(playerId).setVisible(true);\n\n // Close database connection and dispose of this form\n con.getConnection().close();\n this.dispose();\n }\n // If username and password are not valid then print invalid\n if(valid.equals(\"\")){\n JOptionPane.showMessageDialog(null, \"Incorrect Username or Password!!\");\n txt_userName.setText(\"\");\n password_password.setText(\"\");\n txt_userName.requestFocus();\n }\n }catch(Exception ex){ // Print error is there is a problem with database\n System.out.println(\"Error: \" + ex);\n }\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString password = passwordField_Doctor.getText();\n\t\t\t\tString user_name = username_Doctor.getText();\n\t\t\t\tString userId =\"\";\n\t\t\t\tString pass = \"\";\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\tSystem.out.println(user_name + password);\n\t\t\t\tif(user_name.equals(\"\")|| password.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Please enter missing details.\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\t\t\n\t\t\t\t\tConnection c=DriverManager.getConnection(\"jdbc:mysql://localhost/oopd\",\"root\",\"root\");\n\t\t\t\t\tStatement st=c.createStatement();\n\t\t\t\t\tString user = \"\";\n\t\t\t\t\tResultSet rs=st.executeQuery(\"Select * from logindoctor where username = '\"+user_name+\"'\");\n\t\t\t\t\t\n\t\t\t\t\twhile(rs.next())\n\t\t\t\t\t{\n\t\t\t\t\t\tuserId = rs.getString(\"username\");\n\t\t\t\t\t\tpass = rs.getString(\"password\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tResultSet rs1=st.executeQuery(\"Select * from department where dept_hod_username = '\"+user_name+\"'\");\n\t\t\t\t\twhile(rs1.next())\n\t\t\t\t\t{\n\t\t\t\t\t\tuser = rs1.getString(\"dept_hod_username\");\n\t\t\t\t\t}\n\n\t\t\t\t\tSystem.out.println(userId + pass);\n\t\t\t\t\tif(user_name.equals(userId) && pass.equals(password))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!user.equals(\"\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t\tHoDPage hodp = new HoDPage(user_name);\n\t\t\t\t\t\t\thodp.setVisible(true);\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\tclose();\n//\t\t\t\t\t\t\tDoctor_Home dh = new Doctor_Home(user_name);\n//\t\t\t\t\t\t\tdh.setVisible(true);\n\t\t\t\t\t\t\tList_Of_Patients lop = new List_Of_Patients(user_name);\n\t\t\t\t\t\t\tlop.setVisible(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tusername_Doctor.setText(\"\");\n\t\t\t\t\t\tpasswordField_Doctor.setText(\"\");\n\t\t\t\t\t\tJOptionPane.showMessageDialog(contentPane, \"Invalid Credentials!!\",\"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcatch(Exception ex)\n\t\t\t\t{\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t\tSystem.out.println(\"Exception is here!!\");\n\t\t\t\t\tlgf.logfile(\" Exception Caught\");\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t}",
"private void password_passwordKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_password_passwordKeyPressed\n // Connect to the database and verify login credentials when Enter is pressed\n if (evt.getKeyCode()==KeyEvent.VK_ENTER){\n try{\n String valid = \"\";\n // Connect to the database\n DBConnect con = new DBConnect();\n // SQL query statement\n ResultSet rs = con.getStatement().executeQuery(\"SELECT [PlayerId]\" +\n \", [Username], [Password] FROM LoginInfo\");\n\n // Validate the username and password\n while(rs.next()){\n /* If the username and password are incorrect then skip through\n the loop */\n if(!rs.getString(2).equals(txt_userName.getText()) ||\n !Arrays.equals(rs.getString(3).toCharArray(),\n password_password.getPassword())){\n continue;\n }\n // If username and password are correct then log in\n playerId = Integer.parseInt(rs.getString(1));\n valid = \"Login Successful\";\n\n // Create and display Main Form\n new frm_Main(playerId).setVisible(true);\n\n // Close database connection and dispose of this form\n con.getConnection().close();\n this.dispose();\n }\n // If username and password are not valid then print invalid\n if(valid.equals(\"\")){\n JOptionPane.showMessageDialog(null, \"Incorrect Username or Password!!\");\n txt_userName.setText(\"\");\n password_password.setText(\"\");\n txt_userName.requestFocus();\n }\n }catch(Exception ex){ // Print error is there is a problem with database\n System.out.println(\"Error: \" + ex);\n }\n \n }\n }",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tuser = txt_usr.getText();\n\t\t\t\tpass = txt_pass.getText();\n\t\t\t\t//check password or id is correct or not\n\t\t\t\tif(user.equals(\"test\") && pass.equals(\"12345\")) {\n\t\t\t\t\t//if both are correct user will be loged in\n\t\t\t\t\tAccountHome reg = new AccountHome();\n\t\t\t\t\treg.setVisible(true);\n\t\t\t\t\tdispose();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t//if user input incorrect details he will get alert message to input correct details\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Wrong Password / Username\");\n\t\t\t\t\ttxt_usr.setText(\"\");\n\t\t\t\t\ttxt_pass.setText(\"\");\n\t\t\t\t\ttxt_usr.requestFocus();\n\t\t\t\t}\n\t\t\t}",
"public void verify() {\n lblTheDatabaseNameIsEmpty();\n lblDatabaseName();\n lblUserName();\n lblPassword();\n lblDatabaseLocation();\n txtPassword();\n txtUserName();\n txtDatabaseLocation();\n btSettings();\n txtDatabaseName();\n btCancel();\n btOK();\n }",
"private boolean createCredentials() {\r\n dbLogin = new SetUpUI();\r\n dbLogin.setVisible(true);\r\n actionListener = new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent e) {\r\n if (e.getSource() == dbLogin.getDoneBtn()) {\r\n FileOutputStream FOS = null;\r\n try {\r\n /**\r\n * I take the values fromthe text file and I insert it\r\n * into a text file create a file with specified details\r\n */\r\n File fout = new File(\"credentials.txt\");\r\n FOS = new FileOutputStream(fout);\r\n BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(FOS)); \r\n String userDetails = dbLogin.username().getText() + \":\" + dbLogin.password().getText();\r\n String dbPass = dbLogin.mysqlPassword().getText();\r\n if(dbLogin.mysqlPassword().getText().isEmpty()){ \r\n dbPass = \"e\";\r\n }\r\n String mysqlDetails = dbLogin.mysqlUsername().getText() + \":\" + dbPass; \r\n bw.write(userDetails);\r\n bw.newLine();\r\n bw.write(mysqlDetails);\r\n bw.close();\r\n JOptionPane.showMessageDialog(dbLogin, \"Succesfully Created Details Please Restart The Program\"); \r\n dbLogin.dispose();\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(SetUp.class.getName()).log(Level.SEVERE, null, ex);\r\n JOptionPane.showMessageDialog(dbLogin, \"Failed to create SetUp Details\");\r\n } catch (IOException ex) {\r\n Logger.getLogger(SetUp.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Registering the components\r\n */\r\n dbLogin.getDoneBtn().addActionListener(actionListener);\r\n return state;\r\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\ttry{\n\t\t\t\t\t\n\t\t\t\t\tString create_query=\"CREATE TABLE '\" + username.getText() + \"' ('ID' TEXT PRIMARY KEY NOT NULL , 'DATE' TEXT, 'CODE' TEXT, 'NumOfPieces' INTEGER DEFAULT 0,'WEIGHT' DOUBLE DEFAULT 0.000,'PARTICULAR' TEXT, 'DEBIT' DOUBLE DEFAULT 0.00, 'CREDIT' DOUBLE DEFAULT 0.00)\";\n\t\t\t\t\tPreparedStatement pst2 = connection.prepareStatement(create_query);\n\t\t\t\t\tpst2.executeUpdate();\n\t\t\t\t\tString insert_query=\"INSERT INTO JAM_USER(user_name,user_pwd,user_cr,user_db,user_bal) VALUES(?,?,?,?,?)\";\n\t\t\t\t\tPreparedStatement pst3 = connection.prepareStatement(insert_query);\n\t\t\t\t\tpst3.setString(1,username.getText());\n\t\t\t\t\tpst3.setString(2,password.getText());\n\t\t\t\t\t//pst2.setString(3,);\n\t\t\t\t\t//pst2.setString(4,password.getText());\n\t\t\t\t\t//pst2.setString(5,username.getText());\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpst3.executeUpdate();\n\t\t\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"User Created Successfully, Please Login!\",\"Jarvis Account Manager\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t//\tframe.dispose();\n\t\t\t\t//\tSecond_frame sf1= new Second_frame();\n\t\t\t\t//\tsf1.setVisible(true);\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpst2.close();\n\t\t\t\t\tpst3.close();\n\t\t\t\t}catch(Exception se){\n\t\t\t\t\t//JOptionPane.showMessageDialog(null,se);\n\t\t\t\t\tJOptionPane.showMessageDialog(null,se.getMessage(),\"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t}\n\t\t\t\n\t\t\t}",
"public void actionPerformed(ActionEvent event) {\n\t\t//We have only one button\n\t\tif(event.getSource() == loginButton) {\n\t\t\t//Getting the username and password inserted\n\t\t\tauxUsername = usernameTextField.getText();\n\t\t\tauxPassword = new String(passwordField.getPassword());\n\t\t\t\n\t\t\t//Check if user introduces username and password\n\t\t\tif(!auxUsername.equals(\"\") && !auxPassword.equals(\"\")) {\n\t\t\t\t//First case: the administrator is logging\n\t\t\t\tif(auxUsername.equals(\"admin\") \n\t\t\t\t\t\t&& auxPassword.equals(\"admin\")) {\n\t\t\t\t\tsetVisible(false);\n\t\t\t\t\t\n\t\t\t\t\tUser auxUser = null;\n\t\t\t\t\tfor(int i=0 ; i<usersList.size(); i++) {\n\t\t\t\t\t\tif(usersList.get(i).getUsername().equals(\"admin\") && \n\t\t\t\t\t\t\t\t\tusersList.get(i).getPassword().equals(\"admin\")) {\n\t\t\t\t\t\t\tauxUser = usersList.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tAdminGUI adminGUI = new AdminGUI(this, auxUser);\n\t\t\t\t\tadminGUI.run();\n\t\t\t\t} else {\n\t\t\t\t\t//Second case: somebody else is logging\n\t\t\t\t\tUser auxUser = null;\n\t\t\t\t\tfor(int i=0; i<usersList.size(); i++) {\n\t\t\t\t\t\tif(usersList.get(i).getUsername().equals(auxUsername) &&\n\t\t\t\t\t\t\t\t\tusersList.get(i).getPassword().equals(auxPassword)) {\n\t\t\t\t\t\t\tauxUser = usersList.get(i);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(auxUser != null) {\n\t\t\t\t\t\tsetVisible(false);\n\t\t\t\t\t\tUserGUI userGUI = new UserGUI(this, auxUser);\n\t\t\t\t\t\tuserGUI.run();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Username or password incorect! Try again!\",\n\t\t\t\t \t\t\"ERROR!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t//Delete text from textfields\n\t\t\t\t\t\tusernameTextField.setText(\"\");\n\t\t\t\t\t\tpasswordField.setText(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Delete text from textfields\n\t\t\t\tusernameTextField.setText(\"\");\n\t\t\t\tpasswordField.setText(\"\");\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t String username = t4.getText().toString();\n\t\t\t String Fullname = t.getText().toString();\n\t\t\t String Address = t1.getText().toString();\n\t\t\t String ContactNo = t3.getText().toString();\n\t\t\t String EmailId = t2.getText().toString();\n \t char pass[]= p.getPassword();\n \t String password = new String(pass);\n \t \n \t try\n \t {\n \t \t Class.forName(\"com.mysql.jdbc.Driver\");\n \t \t con = DriverManager.getConnection( \"jdbc:mysql://localhost:3306/RIT\", \"root\", \"\");\n \t stmt = con.createStatement();\n \t stmt.executeUpdate(\"insert into user values('\"+Fullname+\"','\"+Address+\"','\"+EmailId+\"','\"+ContactNo+\"','\"+username+\"','\"+password+\"')\");\n \t JOptionPane.showMessageDialog(f, \"Registered Successfully\");\n \t \n \t }\n \t catch(ClassNotFoundException e1)\n \t {\n \t \t e1.printStackTrace();\n \t } \n \t catch (SQLException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n \t finally\n \t {\n \t \t try {\n\t\t\t\t\t\t\tcon.close();\n\t\t\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t\t}\n \t }\n\t\t\t\t\n \t\t \n\t\t\t\t}",
"@Override\r\n public void handle(ActionEvent e) {\n if (inputDatabase(txtPassword.getText())) {\r\n\r\n confirmUserStage.close();\r\n\r\n }\r\n \r\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tString user = userInput.getText();\r\n\t\t\t\tString password = passwordInput.getText();\r\n\t\t\t\tnew controlador.Login().checkUser(user, password);\t\r\n\t\t\t\tdispose();\r\n\t\t\t\t//if (usr.checkUserAndPass(user, password)) { \r\n\t\t\t\t//Login atras1 = new Login(); \r\n\t\t\t\t//atras1.setVisible(true); \r\n\t\t\t\t//setVisible(false); \r\n//} else { \r\n\t//JOptionPane.showMessageDialog(null, \"Usuario no reconocido\"); }\r\n\t\t\t\t//new vista.ElegirEquipo().setVisible(true);\r\n\t\t\t\t\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\r\n\t\t\t\tif (!txtUserName.getText().isEmpty() && txtPassword.getPassword().length != 0) {\r\n\t\t\t\t\tString givenPassword = new String(txtPassword.getPassword());\r\n\t\t\t\t\tif (txtUserName.getText().indexOf(\"_\") == -1 && givenPassword.indexOf(\"_\") == -1\r\n\t\t\t\t\t\t\t&& txtUserName.getText().indexOf(\"/\") == -1 && givenPassword.indexOf(\"/\") == -1) {\r\n\t\t\t\t\t\tSignUp.printRecord(txtUserName.getText().toString(), givenPassword.toString());\r\n\t\t\t\t\t\tif (signedUpSuccessfully) {\r\n\t\t\t\t\t\t\tProfileLast.userName = txtUserName.getText();\r\n\t\t\t\t\t\t\tif (profileAddress.equals(\"Contact2.png\")) {\r\n\t\t\t\t\t\t\t\tProfileLast.main(txtUserName.getText() , \"Contact2.png\");\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tProfileLast.main(txtUserName.getText() , txtUserName.getText() + \".jpg\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tdispose();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Wrong Inputs given !\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Enter The Fields Correctly !\");\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent paramActionEvent) {\n\t\t\t\tString username = new String(textFieldtUserName.getText());\n\t\t\t\tString passwd = new String(textFieldPasswd.getPassword());\n\t\t\t\tString vcode = new String(CodeFieldPasswd.getText());\n\t\t\t\tUserAction userAction = new UserAction();\n\n\t\t\t\tif (users == 0) {\n\t\t\t\t\tUser.table = \"teacher\";\n\t\t\t\t} else {\n\t\t\t\t\tUser.table = \"student\";\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tif (username.equals(\"\") || passwd.equals(\"\")/* || vcode.equals(\"\") */) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"用户名、密码、验证码不能为空\", \"错误\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// 验证用户名\n\t\t\t\t\t\tif (!userAction.isExist(User.table, username)) {\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"用户名错误\", \"错误\", JOptionPane.PLAIN_MESSAGE);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tUser.Username = username;\n\t\t\t\t\t\t\tList<User> userList = userAction.query(User.table, username);\n\t\t\t\t\t\t\t// 验证密码和验证码\n\t\t\t\t\t\t\tfor (User user : userList) {\n\t\t\t\t\t\t\t\tif (user.getPasswd().equals(passwd)/* &&isValidCodeRight() */) {\n\t\t\t\t\t\t\t\t\tframe.setVisible(false);\n\t\t\t\t\t\t\t\t\tif(users==0) {\n\t\t\t\t\t\t\t\t\t\tnew AdminMenuBar(frame);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse if(users==1) {\n\t\t\t\t\t\t\t\t\t\tnew StudentMenuBar(frame);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tnew AdminInformation();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"密码或验证码错误\", \"错误\", JOptionPane.PLAIN_MESSAGE);\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} catch (Exception ex) {\n\t\t\t\t\tex.printStackTrace();\n\t\t\t\t}\n\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tString id = UserID.getText();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tint check = db.idcheck(id);\r\n\r\n\t\t\t\t\tif (check == 1) {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(j, \"삭제되었습니다.\");\r\n\t\t\t\t\t\tdb.delete(id);\r\n\t\t\t\t\t\t로그인창 login = new 로그인창();\r\n\t\t\t\t\t\tlogin.loginpage();\r\n\t\t\t\t\t\tj.dispose();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(j, \"해당 아이디가 존재하지않습니다.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e1) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tStringBuilder mensagemErro = new StringBuilder();\n\t\t\t\tString usuario = txtUsuario.getText(); // Obtém a String que representa o usuário\n\t\t\t\tString senha = String.valueOf(passwordField.getPassword()); // Obtém a String que representa a senha\n\t\t\t\tString codigoAgencia = txtCodigoAgencia.getText();\n\t\t\t\t\n\t\t\t\t// Verifica se usuário foi preenchido\n\t\t\t\tif (SystemUtils.isNuloOuVazio(usuario) || usuario.length() == 0 ) {\n\t\t\t\t\tmensagemErro.append(LocaleUtils.getLocaleMessages().getString(\"falha_login_usuariobranco\"));\n\t\t\t\t\n\t\t\t\t// Verifica se a senha foi preenchida\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tif (SystemUtils.isNuloOuVazio(senha) || senha.length() == 0) {\n\t\t\t\t\tmensagemErro.append(LocaleUtils.getLocaleMessages().getString(\"falha_login_senhabranco\"));\n\t\t\t\t\n\t\t\t\t// Verifica se foi gerada uma mesagem de erro\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tif (SystemUtils.isNuloOuVazio(codigoAgencia) || codigoAgencia.length() == 0){\n\t\t\t\t\tmensagemErro.append(LocaleUtils.getLocaleMessages().getString(\"falha_login_agenciabranco\"));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (mensagemErro.length() > 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(panelCabecalho, mensagemErro);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Valida o usuário, senha e código da agência\n\t\t\t\tif (Autenticacao.autenticar(usuario, senha, codigoAgencia)) {\n\t\t\t\t\tdispose();\n\t\t\t\t\tnew TelaPrincipalGUI();\n\t\t\t\t} else {\n\t\t\t\t\t// Limpa o campo senha\n\t\t\t\t\tpasswordField.setText(\"\");\n\t\t\t\t\tJOptionPane.showMessageDialog(panelCabecalho, LocaleUtils.getLocaleMessages().getString(\"falha_login\"));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\tDatabaseMethods DB = new DatabaseMethods();\n\t\t\t\t\t\t\tArrayList<User> usrarray = DB.ReadUser();\n\t\t\t\t\t\t\tArrayList<Admin> adminarray = DB.ReadAdmin();\n\t\t\t\t\t\t\tfor(User u:usrarray) {\n\t\t\t\t\t\t\t\t//System.out.println(u.getUserName().equals(login.psw.getPassword()) + \" \" + u.getPassword() + \" \" + new String(login.psw.getPassword()));\n\t\t\t\t\t\t\t\tif(u.getUserName().equals(userloginpanel.usr_name.getText()) && u.getPassword().equals(new String(userloginpanel.psw.getPassword()))) {\n\t\t\t\t\t\t\t\t\tuserloginpanel.frame.setVisible(false);\n\t\t\t\t\t\t\t\t\tex.setuser(u);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor(Admin a:adminarray){\n\t\t\t\t\t\t\t\tif(a.getAdminName().equals(userloginpanel.usr_name.getText()) && a.getPassword().equals(new String(userloginpanel.psw.getPassword()))) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"admin\");\n\t\t\t\t\t\t\t\t\tuserloginpanel.frame.setVisible(false);\n\t\t\t\t\t\t\t\t\tex.sidebar.admin_button.setVisible(true);\n\t\t\t\t\t\t\t\t\t//ex.repaint();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"@Override\r\n\tpublic void actionPerformed(Object e) {\n\t\tif(e == loginButton) {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\tPreparedStatement ps = con.prepareStatement(\"SELECT * FROM users WHERE username LIKE ? AND password LIKE ?\");\r\n\t\t\t\tps.setString(1, usernameField.getText());\r\n\t\t\t\tps.setString(2, passField.getText());\r\n\t\t\t\tResultSet rs = ps.executeQuery();\r\n\t\t\t\t\r\n\t\t\t\tif(!rs.next()) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"invalid username/password\",\"error\",JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tint i = rs.getInt(\"UserId\");\r\n\t\t\t\t\tString name = rs.getString(\"Name\");\r\n\t\t\t\t\tBlob blob = rs.getBlob(\"ProfilePic\");\r\n\t\t\t\t\tUser user = User.getUser(i, name,usernameField.getText(), passField.getText(),blob);\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Login Successfull !\");\r\n\t\t\t\t\tsm.setNewPage(StateManager.HOME);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tSystem.out.println(\"ERROR\");\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void login() {\n if (!areFull()) {\n return;\n }\n\n // Get the user login info\n loginInfo = getDBQuery(nameField.getText());\n if (loginInfo.equals(\"\")) {\n return;\n }\n\n // Get password and check if the entered password is true\n infoArray = loginInfo.split(\" \");\n String password = infoArray[1];\n if (!passField.getText().equals(password)) {\n errorLabel.setText(\"Wrong Password!\");\n return;\n }\n\n continueToNextPage();\n }",
"private void login() {\n if (usrField.getText().equals(\"\") || passwordField.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(rootPane,\n \"YOU MUST ENTER USER AND PASSWORD\",\n \"ERROR\",\n JOptionPane.WARNING_MESSAGE);\n return;\n }\n\n //User.ID = userField.getText();\n User.ID = \"BPDB\";\n\n //User.password = passwordField.getText();\n\n User.password = \"BPDB\";\n\n\n //String sql = \"SELECT desig FROM BPDB.usr WHERE name = '\" + userField.getText() + \"',\"and\" +passwordField.getText() +\"'\";\n\n String sql = \"select desig from BPDB.usr where name='\" + usrField.getText()\n + \"' and password='\" + passwordField.getText() + \"'\";\n\n User.desig = Utility2.singleStOPQuery(login, sql);\n System.out.println(\"Designation : \" + User.desig);\n if (User.desig.isEmpty()) {\n\n\n JOptionPane.showMessageDialog(rootPane,\n \"YOU MUST ENTER USER AND PASSWORD\",\n \"ERROR\",\n JOptionPane.WARNING_MESSAGE);\n return;\n } else {\n\n sql = \"SELECT name FROM BPDB.usr WHERE name = '\" + usrField.getText() + \"'\";\n User.name = Utility2.singleStOPQuery(login, sql);\n\n if (User.desig.equalsIgnoreCase(\"BPDB\")) {\n setVisible(false);\n dispose();\n new HomeFrame().setVisible(true);\n\n } else if (User.desig.equalsIgnoreCase(\"DRAFT\")) {\n setVisible(false);\n dispose();\n new DRAFTFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"APPLY\")) {\n setVisible(false);\n dispose();\n new APPLYFrame().setVisible(true);\n\n } else if (User.desig.equalsIgnoreCase(\"HR\")) {\n setVisible(false);\n dispose();\n new HRFrame().setVisible(true);\n\n } else if (User.desig.equalsIgnoreCase(\"ADMIN\")) {\n setVisible(false);\n dispose();\n new ADMINFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"ACCOUNT\")) {\n setVisible(false);\n dispose();\n new ACCOUNTFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"SALARY\")) {\n setVisible(false);\n dispose();\n new SALARYFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"BILLING\")) {\n setVisible(false);\n dispose();\n new BILLINGFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"DISTRIBUTION\")) {\n setVisible(false);\n dispose();\n new DISTRIBUTIONFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"GENERATION\")) {\n setVisible(false);\n dispose();\n new GENERATIONFrame().setVisible(true);\n\n } else if (User.desig.equalsIgnoreCase(\"DHAKA\")) {\n setVisible(false);\n dispose();\n new DHAKAFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"KHULNA\")) {\n setVisible(false);\n dispose();\n new KHULNAFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"RAUJAN\")) {\n setVisible(false);\n dispose();\n new RAUJANFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"SHIDDERGANJ\")) {\n setVisible(false);\n dispose();\n new SHIDDERGANJFrame().setVisible(true);\n } else if (User.desig.equalsIgnoreCase(\"GRASHAL\")) {\n setVisible(false);\n dispose();\n new GRASHALFrame().setVisible(true);\n }\n }\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tint a;\r\n\t\t\t\t s1= idJt.getText();\r\n\t\t\t\t s2= new String(idPasswordJp.getPassword());\r\n\t\t\t\t s3= userNameJt.getText();\r\n\t\t\t\t s4= nickNameJt.getText();\r\n\t\t\t\t a=checkRegister.checkString(s1,s2,s3,s4,s5);\r\n\t\t\t\tif(a==0) {\r\n\t\t\t\t\tcheckNews_dao cn = new checkNews_dao();\r\n\t\t\t\t\tif(cn.checkId(s1)) {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(registerJf, \"账号已存在\");\r\n\t\t\t\t\t\tidJt.setText(\"\");\r\n\t\t\t\t\t\tcn.closeAll();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(cn.checkNickName(s4)) {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(registerJf, \"昵称已存在\");\r\n\t\t\t\t\t\tnickNameJt.setText(\"\");\r\n\t\t\t\t\t\tcn.closeAll();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tuserNews_dao un=new userNews_dao();\r\n\t\t\t\t\t\tun.insertNews(s1, s2, s3, s4, s5);\r\n\t\t\t\t\t\tun.closeAll();\r\n\t\t\t\t\t\tempty();\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(registerJf, \"注册成功\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(registerJf, \"请把信息输入完整!\");\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource() == buttonRegister) {\n\t\t\tthis.dispose();\n\t\t\tnew Register(userVec, db);\n\t\t\t\n\t\t}else if(e.getSource() == buttonLogin) {\n\t\t\tString name = texNama.getText();\n\t\t\tString password = String.valueOf(texPass.getPassword());\n\t\t\t\n\t\t\tif(passwordValidator(name, password) != -1) {\n\t\t\t\tJOptionPane.showMessageDialog(this, name+\" berhasil login!\");\n\t\t\t\tthis.dispose();\n\t\t\t\tnew Home(userVec, userVec.get(passwordValidator(name, password)), db);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\r\n\tprotected void btnUpdateactionPerformed() {\n\t\tjava.sql.Connection conObj = JdbcConnect.createConnection();\r\n\t\tjava.util.Vector update_pass = new java.util.Vector();\r\n\t\t\r\n\t\tupdate_pass.add(newpassUpdatejTextField.getText());\r\n\t\tupdate_pass.add(unameUpdatejTextField.getText());\r\n\t\t\r\n\t\tif(\"Administrer\".equals(unameUpdatejTextField.getText()))\r\n\t\t{\r\n\t\t\tif(\"Administrer\".equals(usrname))\r\n\t\t\t{\r\n\t\t\t\tint i = 0;\r\n\t\t\t\ttry {\r\n\t\t\t\t\ti = JdbcUpdateUSERACCOUNTS.updateRecordFromTable(conObj,update_pass);\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,e.getMessage(), \"\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t}\t\r\n\t\t\t\tif (i==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Database Internal Error\", \"User@\"+unameUpdatejTextField.getText()+\" access error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse {\t\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"You have successful generated new password for User@\"+unameUpdatejTextField.getText(), \"User@\"+unameUpdatejTextField.getText()+\" success message\", JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"User@\"+usrname+\" Not permitted to interfere with the parent Administrator\", \"Security message\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\t\r\n\t\telse {\r\n\t\t\tint i = 0;\r\n\t\t\ttry {\r\n\t\t\t\ti = JdbcUpdateUSERACCOUNTS.updateRecordFromTable(conObj,update_pass);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tJOptionPane.showMessageDialog(null,e.getMessage(), \"\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\t\r\n\t\t\tif (i==0)\r\n\t\t\t{\r\n\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"Internal Error\", \"User@\"+unameUpdatejTextField.getText()+\" access error\", javax.swing.JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse {\t\r\n\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"You have successful generated new password for User@\"+unameUpdatejTextField.getText(), \"User@\"+unameUpdatejTextField.getText()+\" success message\", javax.swing.JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void LoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LoginActionPerformed\n\n Connection connection = null;\n try {\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n\n String ConnectionURL = \"jdbc:mysql://localhost:3306/weddinghallreservation\";\n \n PreparedStatement q;\n\n \n connection = DriverManager.getConnection(ConnectionURL, \"root\", \"1212\");\n \n\n Id = id.getText();\n \n if (Id.startsWith(\"12\")) {\n // Query to bring the login information of the owner from Owner table\n q = connection.prepareStatement(\"Select `idOwner` , `Password` from `owner` where `idOwner`=? AND `Password`=? \");\n q.setString(1, Id);\n q.setString(2, String.valueOf(Password.getPassword()));\n ResultSet r = q.executeQuery();\n \n if (r.next()) { // Moving to the Owner home page\n OwnerPage_Home ob = new OwnerPage_Home();\n ob.setVisible(true);\n this.setVisible(false);\n\n } else { // In case the password is incorrect\n incorrectPass.setText(\"Incorrect email or password\");\n }\n\n } else {\n // Query to bring the login information of the tenant from Tenant table\n q = connection.prepareStatement(\"Select `idTenant` , `Password` from `tenant` where `idTenant`=? AND `Password`=? \");\n q.setString(1, Id);\n q.setString(2, String.valueOf(Password.getPassword()));\n ResultSet r = q.executeQuery();\n\n if (r.next()) { // Moving to the Tenant home page\n TenantPage_Home ob = new TenantPage_Home();\n ob.setVisible(true);\n this.setVisible(false);\n } else {\n\n incorrectPass.setText(\"Incorrect email or password\");\n }\n\n }\n\n connection.close();\n\n } catch (SQLException ex) {\n JOptionPane.showMessageDialog(null, ex.toString());\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@SuppressWarnings({ \"rawtypes\", \"unchecked\", \"deprecation\" })\r\n\tprotected void btnCreateactionPerformed() {\n\t\tif ((confirmpasswordcreatejTextField.getText()).equals(passwordcreatejPasswordField.getText()))\r\n\t\t{\r\n\t\t\tjava.sql.Connection conObj = JdbcConnect.createConnection();\r\n\t\t\tjava.sql.ResultSet rs = null;\r\n\t\t\ttry {\r\n\t\t\t\trs = JdbcSelectUname.selectRecordFromTable(conObj,usrname);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Internal Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tif (rs.next())\r\n\t\t\t\t{\r\n\t\t\t\t\t\tString role = (String) rolecreatejComboBox.getSelectedItem();\r\n\t\r\n\t\t\t\t\t\tjava.util.Vector add_rows = new java.util.Vector();\r\n\t\t\t\t\t\t//adding new user details to the Vector_add_rows\r\n\t\t\t\t\t\tadd_rows.add(unamecreatejTextField.getText());\r\n\t\t\t\t\t\tadd_rows.add(passwordcreatejPasswordField.getText());\r\n\t\t\t\t\t\tadd_rows.add(passHintTextField.getText());\r\n\t\t\t\t\t\tadd_rows.add(role);\r\n\t\r\n\t\t\t\t\t\tint i = JdbcCreateUser.insertRecords(conObj,add_rows);\r\n\t\r\n\t\t\t\t\t\tif (i!=1)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"User@\"+unamecreatejTextField.getText()+\" not created\\nPlease try again...\", \"User@\"+unamecreatejTextField.getText()+\" error\", javax.swing.JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"User@\"+unamecreatejTextField.getText()+\" added to the system\", \"User@\"+unamecreatejTextField.getText()+\" success message\", javax.swing.JOptionPane.PLAIN_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}//rs.next() if statement;\r\n\t\r\n\t\t\t\telse {\r\n\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"Access denied! User@\"+usrname+\" not granted to create new users\", \"User@\"+usrname+\" authentication error\", javax.swing.JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t}\r\n\t\t\t} catch (HeadlessException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\telse {\r\n\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null, \"Access Denied! The given password do not match\", \"Mismatch error\", javax.swing.JOptionPane.ERROR_MESSAGE);\t\t\t\t\t\t\r\n\t\t}\t\t\t\t\r\n\t}",
"public void actionPerformed(ActionEvent arg0){\n char[] tamanho = tsenha.getPassword();\n \n if (tamanho.length == 0){\n JOptionPane.showMessageDialog(menssagem, \"Digite uma senha!\");\n }else{\n // recupera senha do Java Password Field\n String psenha = new String(tsenha.getPassword());\n \n //Cria conexão\n ConnectionMSSql conecta= new ConnectionMSSql();\n conecta.conectar(tip.getText(), tinstancia.getText(), tporta.getText(), tbanco.getText(), tusuario.getText() , psenha);\n \n }\n \n }",
"void SubmitButton() {\r\n\t\tint checker = Accounts.checkUser(username.getText(), password.getText());\r\n\t\tif(checker == -1) {\r\n\t\t\tsetVisible(false);\r\n\t\t\tdispose();\r\n\t\t\tAdminScreen adminScreen = new AdminScreen();\r\n\t\t}\r\n\t\telse if(checker >= 0) {\r\n\t\t\tsetVisible(false);\r\n\t\t\tdispose();\r\n\t\t\tStudentScreen studentScreen = new StudentScreen(checker);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Error: username \"\r\n\t\t\t\t\t+ \"and/or password is incorrect.\");\r\n\t\t\tpassword.setText(\"\");\r\n\t\t\tusername.setText(\"\");\r\n\t\t}\r\n\t\t\r\n\t}",
"public void actionPerformed(ActionEvent e) {\n\t\tif (Data.linkTest()) {\r\n\t\t String btnstring = e.getActionCommand();\r\n\t if (btnstring.equals(\"注册\")) {\r\n\r\n\t String nameString=textField.getText().trim();\r\n\t String pass=String.valueOf(passwordField.getPassword());\r\n\t String repass=String.valueOf(passwordField_1.getPassword());\r\n\t String mailString=textField_5.getText().trim(); \r\n\t \t \r\n\t String query;\t \r\n\t \r\n\t if (!nameString.equals(\"\") && !pass.equals(\"\") && pass.equals(repass) && !mailString.equals(\"\")&&isEmail(mailString)) {\r\n\t System.out.println(\"注册\");\r\n\t if(UserCheck.CheckUsername(nameString)){\r\n\t query=\r\n\t \"insert into user values(\"+\r\n\t \t\t \"null,\"+\r\n\t \"'\"+nameString+\"',\"+\r\n\t \"'\"+pass+\"',\"+\r\n\t \"'\"+mailString+\"',\"+\r\n\t \"''\"+\r\n\t \")\";\r\n\t \r\n\t System.out.println(query);\r\n\t if(Data.modify(query))\t \r\n\t \t JOptionPane.showMessageDialog(null,\"注册成功\",\"提示\",JOptionPane.INFORMATION_MESSAGE);\r\n\t else\r\n\t \t JOptionPane.showMessageDialog(null,\"注册失败请检查网络连接\",\"提示\",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\r\n\t frame.setVisible(false);\r\n\r\n\t } \r\n\t }else \r\n\t {\r\n\t \t JOptionPane.showMessageDialog(null,\"用户名重复\",\"注册失败\",JOptionPane.INFORMATION_MESSAGE);\r\n\t }\r\n\t }\r\n\t\t}else{\r\n\t\t\tJOptionPane.showMessageDialog(null,\"连接服务器失败,请检查网络连接\",\"提示\",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tdatabseExecuteQuery(\"DELETE FROM userdetails where username='\"+Username+\"'\");\n\t\t\t\t//after that make verification GUI again.\n\t\t\t\tnew Verification();\n\t\t\t}",
"public void actionPerformed(ActionEvent e)\r\n\t\t\t{\n\t\t\t\temailTextBox.setText(emailTextBox.getText().trim());\r\n\t\t\t\tpasswordTextBox.setText(new String(passwordTextBox.getPassword()).trim());\r\n\t\t\t\t\r\n\t\t\t\tloginButton.setEnabled(false);\r\n\t\t\t\temailTextBox.setEnabled(false);\r\n\t\t\t\tpasswordTextBox.setEnabled(false);\r\n\t\t\t\t\r\n\t\t\t\t// check the login credentials\r\n\t\t\t\tif(loginModule.login(emailTextBox.getText(), new String(passwordTextBox.getPassword())))\r\n\t\t\t\t{\r\n\t\t\t\t\t// correct credentials and authentication\r\n\t\t\t\t\terrorLabel.setVisible(false);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// load up the Room Viewer window\r\n\t\t\t\t\tif(!loginModule.getUsername().trim().equals(\"\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// set basic properties based upon the login result\r\n\t\t\t\t\t\troomViewerUI.setAvatarBasicData(new AStarCharacterBasicData(loginModule.getUsername(), emailTextBox.getText(), loginModule.getGender(), loginModule.getContentRating(), loginModule.getCredits()));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// close the login window\r\n\t\t\t\t\tloginLoadRoomViewerUI();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// incorrect credentials\r\n\t\t\t\t\terrorLabel.setText(loginModule.getErrorMessage());\r\n\t\t\t\t\terrorLabel.setVisible(true);\r\n\t\t\t\t\t\r\n\t\t\t\t\tloginButton.setEnabled(true);\r\n\t\t\t\t\temailTextBox.setEnabled(true);\r\n\t\t\t\t\tpasswordTextBox.setEnabled(true);\r\n\t\t\t\t}\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e){\n if (e.getSource() == login_var){\r\n String username_input = userInp.getText();\r\n login_username = username_input;\r\n \r\n String password_input = passInp.getText();\r\n status = systemssoftwareproject.Authentication.login.login(username_input, password_input);\r\n \r\n // If credentials are a match - login successfully\r\n if(status) {\r\n setVisible(false);\r\n }\r\n \r\n // Else - display error\r\n else{\r\n JOptionPane.showMessageDialog(c, \"Incorrect Credentials! Try again.\", \"ERROR\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }\r\n \r\n // Send user to SignupForm\r\n if (e.getSource() == signup){\r\n setVisible(false);\r\n SignupForm signupForm = new SignupForm();\r\n signupForm.getLoginInstance(this);\r\n }\r\n }",
"public static boolean login() {\n\t\t// DB\n\t\tString[] usr = { \"NICOLAS\", \"CELESTE\" };\n\t\tString[] pass = { \"cerveza\", \"fernet\" };\n\t\tString usrAuth = \"\";\n\t\tboolean auth = false;\n\t\tint intentos = 1;\n\n\t\tdo {\n\t\t\tJTextField usuario = new JTextField();\n\t\t\tJTextField password = new JPasswordField();\n\t\t\tObject[] ingresarUsuarioPassword = { \"Usuario: \", usuario, \"Password\", password };\n\t\t\tint ingresarLogin = JOptionPane.showConfirmDialog(null, ingresarUsuarioPassword,\n\t\t\t\t\t\"Ingrese credenciales de usuario\", JOptionPane.OK_CANCEL_OPTION);\n\t\t\tif (ingresarLogin == JOptionPane.OK_OPTION) {\n\t\t\t\t// Busca el usuario en un bucle For\n\t\t\t\tfor (int i = 0; i < usr.length; i++) {\n\t\t\t\t\t// Si encuentra el usuario, verifica si el usuario y la contraseña coinciden\n\t\t\t\t\tif (usr[i].equals(usuario.getText().toUpperCase()) && pass[i].equals(password.getText())) {\n\t\t\t\t\t\tusrAuth = usr[i];\n\t\t\t\t\t\tauth = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Si no coincide, muestra los intentos restantes y vuelve a pedir credenciales\n\t\t\t\tif (!auth) {\n\t\t\t\t\tif (intentos < 3) {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\\n\" + (3 - intentos) + \" Intentos restantes\",\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tintentos++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\\n\" + \"Se supero en numero de intentos\",\n\t\t\t\t\t\t\t\t\"Usuario y/o Password incorrecto\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t\t\tintentos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Cierra si no se selecciona OK\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (!auth & (intentos <= 3));\n\t\t// Si autentica, muestra mensaje de bienvenida\n\t\tif (auth)\n\t\t\tJOptionPane.showMessageDialog(null, \"Bienvenido \" + usrAuth, \"Bienvenido\", JOptionPane.INFORMATION_MESSAGE);\n\t\treturn auth;\n\t}",
"public void Login()throws Exception{\r\n if(eMailField.getText().equals(\"user\") && PasswordField.getText().equals(\"pass\")){\r\n displayMainMenu();\r\n }\r\n else{\r\n System.out.println(\"Username or Password Does not match\");\r\n }\r\n }",
"private void jButtonLoginActionPerformed(java.awt.event.ActionEvent evt) {\n Username= jTextUsername.getText();\n Password= String.valueOf(jPassword.getPassword()); \n if ((Username != null)&& (Password!= null)) {\n if(Common.CheckSpace(Username)!= false){\n jLabelCheckSpace.setText(\"Username must not have space. Try again!\");\n System.out.println(\"Try again!\");\n }\n else{\n if (userController.Login(Username, Password)==true) {\n System.out.println(\"Login success!\");\n try {\n DashBoard.role_user = userController.GetRole(Username);\n System.out.println(\"\"+DashBoard.role_user);\n } catch (SQLException ex) {\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\n }\n DashBoard dashBoard= new DashBoard();\n dashBoard.show();\n dashBoard.getjLabelUsername().setText(Username);\n this.dispose();\n }\n else{\n jLabelCheckPassword.setText(\"Password is not right! Please try again!\");\n System.out.println(\"Fail!\"); \n }\n } \n } \n }",
"private void btncreateActionPerformed(java.awt.event.ActionEvent evt) {\n \n \n String newfirstname = txtnewfirstname.getText();\n String newlastname =txtnewlastname.getText();\n String newusername = txtnewusername.getText();\n String newpassword = txtnewpassword.getText();\n int newusertype = txtnewusertype.getSelectedIndex();\n String newuserid = txtnewuserid.getText();\n if(newfirstname.equals(\"\") || newlastname.equals(\"\") || newusername.equals(\"\")||newpassword.equals(\"\")||newusertype == 0||newuserid.equals(\"\"))\n {\n JOptionPane.showMessageDialog(null,\"Some Fields are Empty\", \"Error\",1);\n }\n \n \n else\n {\n try\n {\n if(newusertype == 1){\n String input = JOptionPane.showInputDialog(null,\"Enter the Admin Password:\");\n query = null;\n try\n {\n query = \"select Password from tablelogin where userID = 101\" + \" and Password = '\" + input + \"'\";\n rs = DatabaseQuery.ExecuteQuery(query);\n if (rs.next())\n {\n if(rs.getString(\"Password\").equals(input))\n {\n query = \"insert into tablelogin values(\"+newuserid+\",'\"+newfirstname+\"','\"+newlastname+\"','\"+newusername+\"','\"+newpassword+\"','\"+newusertype+\"')\";\n rowcount = DatabaseQuery.ExecuteUpdate(query);\n JOptionPane.showMessageDialog(null, \"Saved Successfully\",\"Save\", 1);\n clearForm();\n }\n }\n else\n {\n JOptionPane.showMessageDialog(null, \"Incorrect Admin Password\");\n }\n \n }\n catch(SQLException e)\n {\n e.printStackTrace();\n } \n }\n else{\n \n //\n query = \"insert into tablelogin values(\"+newuserid+\",'\"+newfirstname+\"','\"+newlastname+\"','\"+newusername+\"','\"+newpassword+\"','\"+newusertype+\"')\";\n rowcount = DatabaseQuery.ExecuteUpdate(query);\n JOptionPane.showMessageDialog(null, \"Saved Successfully\",\"Save\", 1);\n clearForm();\n }\n }\n catch(SQLException e)\n {\n e.printStackTrace();\n }\n \n }\n }",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tdatabseExecuteQuery(\"UPDATE userdetails SET verify=1 where username='\"+Username+\"'\");\n\t\t\t\t\n\t\t\t\t//after that make verifiacation GUI again \n\t\t\t\tnew Verification();\n\t\t\t}",
"public boolean logincheck(String user, String pass) \r\n {\n \r\n try{\r\n Connection conn = DriverManager.getConnection(url, userName, password);\r\n String Sql = \"Select * from APP.MEMBER where email=? and password=?\";\r\n PreparedStatement pst = conn.prepareStatement(Sql);\r\n pst.setString(1,user);\r\n pst.setString(2,pass);\r\n ResultSet rs = pst.executeQuery();\r\n if (rs.next())\r\n {\r\n JOptionPane.showMessageDialog(null,\"Welcome user\");\r\n createEventsUI w = new createEventsUI();\r\n w.setVisible(true);\r\n }\r\n else\r\n {\r\n JOptionPane.showMessageDialog(null,\"Invalid username or password\", \"Access Denied\",JOptionPane.ERROR_MESSAGE);\r\n }\r\n }catch(Exception e) \r\n {\r\n JOptionPane.showMessageDialog(null, e);\r\n }\r\n return false;\r\n \r\n }",
"public void actionPerformed(ActionEvent e) {\r\n\t\t\t\tConnection conn = null;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tClass.forName(\"com.microsoft.sqlserver.jdbc.SQLServerDriver\").newInstance();\r\n\t\t\t\t\tconn = DriverManager.getConnection(\"jdbc:sqlserver://teamthree.cejfxkzyperf.us-west-2.rds.amazonaws.com:1433;\" + \r\n\t\t\t\t\t\t\t\"databaseName=Project1\", \"admin\", \"Project1\");\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e1) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Could not connect to the Database.\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * Try and write user information to database\r\n\t\t\t\t */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif(rdbtn_Faculty.isSelected()) {\r\n//\t\t\t\t\t\tFaculty faculty = new Faculty(txt_UN.getText(), txt_MI.getText(), txt_LN.getText(), txt_Email.getText(),\r\n//\t\t\t\t\t\t\t\ttxt_UN.getText(), txt_UP.getText(), txt_PayPal.getText());\r\n//\r\n//\t\t\t\t\t\tfirstname = faculty.getFirstName();\r\n//\t\t\t\t\t\tmiddleinitial = faculty.getMiddleInitial();\r\n//\t\t\t\t\t\tlastname = faculty.getLastName();\r\n//\t\t\t\t\t\temail = faculty.getEmailAddress();\r\n//\t\t\t\t\t\tpaypal = faculty.getPayPal();\r\n//\t\t\t\t\t\tusername = faculty.getUserName();\r\n//\t\t\t\t\t\tpassword = faculty.getPassword();\r\n//\t\t\t\t\t\tfaculty.setStatus(\"Faculty\");\r\n//\t\t\t\t\t\tstatus = faculty.getStatus();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(rdbtn_Student.isSelected()) {\r\n////\t\t\t\t\t\tStudent student = new Student(txt_UN.getText(), txt_MI.getText(), txt_LN.getText(), txt_Email.getText(),\r\n////\t\t\t\t\t\t\t\ttxt_UN.getText(), txt_UP.getText(), txt_PayPal.getText());\r\n//\r\n//\t\t\t\t\t\tfirstname = student.getFirstName();\r\n//\t\t\t\t\t\tmiddleinitial = student.getMiddleInitial();\r\n//\t\t\t\t\t\tlastname = student.getLastName();\r\n//\t\t\t\t\t\temail = student.getEmailAddress();\r\n//\t\t\t\t\t\tpaypal = student.getPayPal();\r\n//\t\t\t\t\t\tusername = student.getUserName();\r\n//\t\t\t\t\t\tpassword = student.getPassword();\r\n//\t\t\t\t\t\tstudent.setStatus(\"Student\");\r\n//\t\t\t\t\t\tstatus = student.getStatus();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tStatement stmt = conn.createStatement(); \r\n\t\t\t\t\tstmt.execute(\"INSERT INTO Users ([Users UN], [Users Pass], [Users FN], [Users MI], [Users LN], [Users Email], [Users Paypal], [Users Status]) VALUES ('\"\r\n\t\t\t\t\t\t\t+username+\"','\"+password+\"','\"+firstname+\"','\"+middleinitial+\"','\"+lastname+\"','\"+email+\"','\"+paypal+\"','\"+status+\"')\");\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(username == null || password == null || firstname == null || middleinitial == null || lastname == null) {\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please provide listed infromation.\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tRegistration_Panel registration = new Registration_Panel();\r\n\t\t\t\t\t\tregistration.repaint();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tclose();\r\n\t\t\t\t\t\tLogin_Panel login = new Login_Panel();\r\n\t\t\t\t\t\tlogin.setVisible(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e2) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Could not write to Database.\");\r\n\t\t\t\t}\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\ttry {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tinputListenerForLoginButton();\n\t\t\t\t\t} catch (ParseException e1) {\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}",
"public void actionPerformed(ActionEvent ae) {\n \t\n \t// JPasswordFields gives char arrays instead of Strings. Need to convert.\n \tchar[] enteredPassword = passwordField.getPassword();\n \tString enteredPasswordStr = new String(enteredPassword);\n \t\n \t// check login info. If it's good we can dispose of this frame and open the RMOS's frame.\n \tif (usernameField.getText().equals(\"admin\") && enteredPasswordStr.equals(\"admin\")) {\n\n \t\t// log in was correct\n \t\tProjectLauncher.adminFrame.dispose();\n \t\tsetRecyclingStationFrame(new RecyclingStation());\n \t\t\n \t\tgetRecyclingStationFrame().setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n \t\tgetRecyclingStationFrame().setTitle(\"Recycling Monitoring Station (RMOS)\");\n \t\t\n \tgetRecyclingStationFrame().validate();\n \tgetRecyclingStationFrame().pack();\n \tgetRecyclingStationFrame().setVisible(true);\n\n \t} else {\n \t\t\n \t\terrMsgLabel.setText(\"Incorrect username/password\");\n \t\tProjectLauncher.adminFrame.pack();\n \t}\n }",
"public void logins(){\n \n \n \n String username=txtUser.getText();\n String password=txtPass.getText();\n String sql;\n\n \n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n conn = (Connection) DriverManager.getConnection(\"jdbc:mysql://\"+host+\"/\"+db+\"?user=\"+user+\"&password=\"+pass);\n sql =\"Select * from user WHERE username ='\" +txtUser.getText() + \"'\";\n PreparedStatement st = (PreparedStatement) conn.prepareStatement(sql);\n ResultSet rs =st.executeQuery(); \n if(rs.next()) {\n String pasas = rs.getString(\"password\");\n if(password.equals(pasas)){\n JOptionPane.showMessageDialog(this, \"Login Berhasil\");\n \n Home tampil=new Home();\n tampil.setVisible(true);\n dispose();\n \n }else{\n JOptionPane.showMessageDialog(this, \"Username tidak terdaftar\");\n txtUser.requestFocus();\n }\n }else{\n JOptionPane.showMessageDialog(this, \"Username tidak terdaftar\");\n txtUser.requestFocus();\n }\n }catch (Exception e) {\n JOptionPane.showMessageDialog(this,e.getMessage());\n }\n \n }",
"public void actionPerformed(ActionEvent e){\n\t\t\t\t\t\t\tUser add = new User(user.getText(), String.valueOf(pass.getPassword()), addr.getText(), phone.getText());\n\n\t\t\t\t\t\t\tConnection connection = Conn.getConnection();\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tStatement stmt = connection.createStatement();\n\t\t\t\t\t\t\t\t//Update the user details by the value that the user has entered\n\t\t\t\t\t\t\t\tstmt.executeUpdate(\"UPDATE USERS SET USERNAME ='\"+add.getUsername()+\"',PASSWORD = '\"+add.getPassword()+\"',ADDRESS='\"+add.getAddress()+\"',PHONE = '\"+add.getPhoneNo()+\"' WHERE UID = \"+update.getUID());\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\"User updated!\"); //Update success message\n\t\t\t\t\t\t\t\tf.dispose();\n\t\t\t\t\t\t\t\tf2.dispose();\n\t\t\t\t\t\t\t\tview.initComponents();//Open the viewUserTab back\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcatch (SQLException e1) {\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, e1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\tUsuarioPojo user = null;\r\n\t\t\t\tUsuarioPersistencia up = new UsuarioPersistencia();\r\n\r\n\t\t\t\t//int id = up.obtenerIdEmple();\r\n\t\t\t\tString usuarioMail = txtUsuario.getText();\r\n\t\t\t\tString password = new String(pwdPass.getPassword()); // DNI de momento\r\n\t\t\t\tString passwordC = new String(pwdConfPass.getPassword());\r\n\t\t\t\tString apenom = txtApenom.getText();\r\n\t\t\t\tString dni = txtDni.getText();\r\n\t\t\t\tint numSS = Integer.parseInt(txtSegSoc.getText());\r\n\t\t\t\tString cuenta = txtCuenta.getText();\r\n\r\n\t\t\t\tif (password.equals(passwordC)) {\r\n\t\t\t\t\t// creamos un objeto usuario si coinciden las contraseñas\r\n\t\t\t\t\tuser = new UsuarioPojo(apenom, numSS, cuenta, dni, usuarioMail, password);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (user != null) {\r\n\t\t\t\t\t// insertaremos el usuario si coinciden las contraseñas\r\n\t\t\t\t\tup = new UsuarioPersistencia();\r\n\t\t\t\t\tint res = up.insertarUser(user);\r\n\r\n\t\t\t\t\tif (res == 1) { // se habrá registrado al usuario\r\n\t\t\t\t\t\tSystem.out.println(\"Insertado correctamente\");\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Registro insertado correctamente\",\r\n\t\t\t\t\t\t\t\t\"Resultado del Registro\", JOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\tdispose(); // dispose cierra ventana actual, System.exit(0) sale del programa\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mostramos msg si no coinciden las contraseñas, manteniendo el control en dreg\r\n\t\t\t\t\tSystem.out.println(\"No insertado\");\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Contraseñas introducidas no coinciden\", \"Error de contraseña\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\t// limpiamos campos de contraseña\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\r\n\t\t\tuserName = SerGui.getTextUserName();\r\n\t\t\tPasswordServer = SerGui.getTextPassword();\r\n\t\t\tDefport = SerGui.getTextPort();\r\n\t\t\tport = Integer.parseInt(Defport);\r\n\t\t\tScheam = SerGui.getTextScheam();\r\n\r\n\t\t\tif (openConnectionDB()) {\r\n\t\t\t\tsv = new myBoxServer(port);\r\n\t\t\t\tsv.setConn(conn);\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsv.listen(); // Start listening for connections\r\n\t\t\t\t\tSerGui.dispose();\r\n\t\t\t\t\tserverLogGui servlog = new serverLogGui();\r\n\t\t\t\t\tServerLogController serverlogc =new ServerLogController(servlog);\r\n\t\t\t\t\tsv.SetServerLogController(serverlogc);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//--------when initializing the server set status0----------\r\n\t\t\t\t\t\tPreparedStatement ps;\r\n\t\t\t\t\t\tString query = \"UPDATE user SET user.status = ? \";\r\n\t\t\t\t\t\tps = (PreparedStatement) conn.prepareStatement(query);\r\n\t\t\t\t\t\tps.setInt(1, 0);\r\n\t\t\t\t\t\tps.executeUpdate();\r\n\t\t\t\t\t\t//--------when initializing the server set status0----------\r\n\r\n\t\t\t\t} catch (Exception ex) {\r\n\t\t\t\t\tSerGui.setWarningMessageVisibleTrue(\"ERROR - Could not listen for clients!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif ((JButton) e.getSource() == sbt_jbt) {\n\t\t\t\t\tString uname = u_jtf.getText().toString();\n\t\t\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\t\t\tString pwd = pwd_jtf.getText().toString();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tConnection conn = BaseDao.getConn();\n\t\t\t\t\t\tif (guanli.isSelected()) {\n\t\t\t\t\t\t\tString sql = \"select * from admin where adminName=?\";\n\t\t\t\t\t\t\tPreparedStatement stm = conn.prepareStatement(sql);\n\t\t\t\t\t\t\tstm.setString(1, uname);\n\t\t\t\t\t\t\tResultSet res = stm.executeQuery();\n\t\t\t\t\t\t\tif (res.next()) {\n\t\t\t\t\t\t\t\tif (uname.equals(res.getString(\"adminName\"))) {\n\t\t\t\t\t\t\t\t\tif (pwd.equals(res.getString(\"password\"))) {\n\t\t\t\t\t\t\t\t\t\tsetVisible(false);\n\t\t\t\t\t\t\t\t\t\tnew Admin_Main();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"您输入的密码有误,请重新输入\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"您输入的账号有误,请重新输入\");\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"您输入的账号有误,请重新输入\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (duzhe.isSelected()) {\n\t\t\t\t\t\t\tString sql1 = \"select * from user_info where userid=?\";\n\t\t\t\t\t\t\tPreparedStatement stmt = conn.prepareStatement(sql1);\n\t\t\t\t\t\t\tstmt.setString(1, uname);\n\t\t\t\t\t\t\tResultSet rs = stmt.executeQuery();\n\t\t\t\t\t\t\tif (rs.next()) {\n\t\t\t\t\t\t\t\tif (uname.equals(rs.getString(\"userid\"))) {\n\t\t\t\t\t\t\t\t\tif (pwd.equals(rs.getString(\"password\"))) {\n\t\t\t\t\t\t\t\t\t\tsetVisible(false);\n\t\t\t\t\t\t\t\t\t\tuserid = u_jtf.getText();\n\t\t\t\t\t\t\t\t\t\tnew Reader_Main(userid);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"您输入的密码有误,请重新输入\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"您输入的账号有误,请重新输入\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"您输入的账号有误,请重新输入\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (SQLException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif (e.getSource() == updateB) //sign-up button\n\t\t{\n\t\t\t//get all answers\n\t\t\tString lastnameS = lastnameTF.getText();\n\t\t\tString firstnameS = firstnameTF.getText();\n\t\t\tString usernameS = usernameTF.getText();\n\t\t\tString password1S = new String(password1PF.getPassword());\n\t\t\tString password2S = new String(password2PF.getPassword());\n\t\t\tint admin = 0;\n\t\t\tif (adminCB.isSelected() == true)\n\t\t\t{\n\t\t\t\tadmin = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif (lastnameS != null && !(lastnameS.isEmpty())) //lastname cannot be null\n\t\t\t{\n\t\t\t\tif (firstnameS != null && !(firstnameS.isEmpty())) //first name cannot be null\n\t\t\t\t{\n\t\t\t\t\tif (usernameS != null && !(usernameS.isEmpty())) //email cannot be null\n\t\t\t\t\t{\n\t\t\t\t\t\tif (password1S != null && !(password1S.isEmpty())) //password1 cannot be null\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (password2S != null && !(password2S.isEmpty())) //password 2 cannot be null\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (ValidEmail(usernameS) == true) //check if email is valid\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (password1S.compareTo(password2S) == 0) //check if the 2 passwords are the same\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif (ValidString(password1S) == true) //check if password is valid\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tUser newuser = new User(usernameS, password1S, admin, firstnameS, lastnameS);\n\t\t\t\t\t\t\t\t\t\t\t//continue insert into udb\n\t\t\t\t\t\t\t\t\t\t\tif (udb.modifyUser(uid,newuser) == true) //check if addUser is successful\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t//messageBox: successful!\n\t\t\t\t\t\t\t\t\t\t\t\t//close this dialog afterwards\n\t\t\t\t\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Account update successful!\");\n\t\t\t\t\t\t\t\t\t\t\t\tdispose();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"Something went wrong. Please try again\", \"OK\", JOptionPane.YES_NO_OPTION);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"Password is not valid\", \"OK\", JOptionPane.YES_NO_OPTION);\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\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"The 2 passwords does not match!\", \"OK\", JOptionPane.YES_NO_OPTION);\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\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tJOptionPane.showConfirmDialog(null, \"Email is invalid\", \"OK\", JOptionPane.YES_NO_OPTION);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Password 2 name cannot be null.\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Password 1 name cannot be null.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Email name cannot be null.\");\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\tJOptionPane.showMessageDialog(null, \"First name cannot be null.\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Last name cannot be null.\");\n\t\t\t}\n\t\t}\n\t\telse if (e.getSource() == cancelB) //cancel button\n\t\t{\n\t\t\t//close this and go back\n\t\t\tint n = JOptionPane.showConfirmDialog(null, \"Discard all changes?\",\n\t\t\t\t\t\"Confirm\", JOptionPane.YES_NO_OPTION);\n\t\t\tif (n == JOptionPane.YES_OPTION)\n\t\t\t\tdispose();\n\t\t}\n\n\t}",
"private boolean inputDatabase(String password) {\r\n\r\n boolean checks = false;\r\n int wasUpdated = 0;\r\n\r\n String hashSalt = \"\";\r\n\r\n try {\r\n //Get the hash and salt for the given password\r\n hashSalt = encrypt.getHashString(password);\r\n } catch (NoSuchAlgorithmException | UnsupportedEncodingException ex) {\r\n System.out.println(\"A problem occurred while inserting the user. \"\r\n + \"Error Message: \" + ex.getMessage());\r\n }\r\n\r\n if (!hashSalt.isEmpty()) // Encryption was successful\r\n {\r\n String hash = hashSalt.substring(0, 44); //Substring for password hash\r\n String salt = hashSalt.substring(44, hashSalt.length()); //Substring for salt\r\n\r\n //Variables fo other fields to include in query\r\n String username = txtUserName.getText();\r\n String email = txtEmail.getText();\r\n String first_name = txtFirstName.getText();\r\n String last_name = txtLastName.getText();\r\n\r\n //Create the query string\r\n String query = \"INSERT INTO user (username,email,first_name,\"\r\n + \"last_name,created,last_update,password,salt) values ('\"\r\n + username + \"','\" + email + \"','\" + first_name + \"','\"\r\n + last_name + \"',?,?,'\" + hash + \"','\" + salt + \"')\";\r\n System.out.println(query);\r\n\r\n try {\r\n //Call insertUser in DBConnector to \r\n wasUpdated = Login.db.insertUser(query);\r\n\r\n } catch (SQLException ex) {\r\n System.out.println(\"A problem occurred while inserting the user. \"\r\n + \"Error Message: \" + ex.getMessage());\r\n }\r\n }\r\n \r\n //Update successful\r\n if (wasUpdated > 0) {\r\n checks = true;\r\n }\r\n \r\n return checks;\r\n }",
"@Override\r\n\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\tUser u = user;\r\n\t\t\t\t\t\tuser.setUser_password(NewPassword.getText());\r\n\t\t\t\t\t\tif (NewPassword.getText().equals(surePassword.getText())) {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tDAOFactory.getIUserDAOInstance().update(u);\r\n\t\t\t\t\t\t\t} catch (Exception e1) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(UserFrame.this, \"更改成功\", \"提示\", \r\n\t\t\t\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(UserFrame.this, \"两次输入不同\", \"提示\", \r\n\t\t\t\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}",
"public void actionPerformed(ActionEvent e) {\r\n\t\t\t\trealLogin(host.getText(), tf_name.getText());\r\n\t\t\t\td.dispose();\r\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent ae) {\n\t\t\n\t\tif(ae.getSource().equals(j_b_login)) {\n\t\t\tString username;\n\t\t\tString password;\n\t\t\t\n\t\t\tusername = j_text_Username.getText();\n\t\t\tpassword = j_text_password.getText();\n\t\t\tif(username.contentEquals(\"admin\") && password.equals(\"admin\")) {\n//\t\t\t\tnew Admin_Dashboard();\n\t\t\t\tAdmin_Dashboard AD =new Admin_Dashboard();\n\t\t\t\tAD.setVisible(true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tJOptionPane.showMessageDialog(this, \"Invalid Username or Password\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void inputListenerForLoginButton() throws SQLException, ParseException {\n\t\t// when Login is pressed\n\t\tString email = textField_Email.getText().toLowerCase();\n\t\ttextField_Email.setText(\"\");\n\n\t\t@SuppressWarnings(\"deprecation\")\n\t\tString password = passwordField.getText();\n\t\tpasswordField.setText(\"\");\n\n\t\tMember m = memberRepository.passwordMatchesForLogin(email, password);\n\n\t\tif (!isEmailFormatCorrect(email) || password.equals(\"\")) {\n\t\t\tlblLabel_Invalid.setVisible(true);\n\t\t\tpanel.revalidate();\n\t\t\tpanel.repaint();\n\t\t\treturn;\n\t\t}\n\n\t\tif (m != null) {\n\t\t\tif (m.isAdmin()) {\n\t\t\t\t// view el admin Panel\n\t\t\t\tAdminGUI admin = new AdminGUI();\n\t\t\t\tfrmLibraryManagementSystem.remove(panel11);\n\t\t\t\tfrmLibraryManagementSystem.getContentPane().add(admin);\n\t\t\t\tfrmLibraryManagementSystem.revalidate();\n\t\t\t\tfrmLibraryManagementSystem.repaint();\n\t\t\t} else {\n\t\t\t\t// go to BookGUI panel\n\t\t\t\tBooksGUI p = new BooksGUI(m);\n\t\t\t\tfrmLibraryManagementSystem.remove(panel11);\n\t\t\t\tfrmLibraryManagementSystem.getContentPane().add(p);\n\t\t\t\tfrmLibraryManagementSystem.revalidate();\n\t\t\t\tfrmLibraryManagementSystem.repaint();\n\t\t\t}\n\t\t} else {\n\t\t\tlblLabel_Invalid.setVisible(true);\n\t\t\tpanel.revalidate();\n\t\t\tpanel.repaint();\n\t\t}\n\n\t}",
"@Override\n public void actionPerformed(ActionEvent actionEvent) {\n\n if (loginPanel.usernameField.getText().equals(\"\")) {\n //they have not so we show an error dialog and make them try again\n JOptionPane.showMessageDialog(null,\n \"Enter a username to continue!\",\n \"Error\",\n JOptionPane.ERROR_MESSAGE);\n }\n else {\n //they entered something so we check to see if they have a record in the database already\n Learner newGuy = AppModel.checkUsername(loginPanel.usernameField.getText());\n\n if (newGuy == null) {\n //we didn't find anyone so let's make them a new record\n newGuy = new Learner(loginPanel.usernameField.getText(), 0.0, 0.0);\n ap.insertLearner(newGuy);\n loginPanel.statusLabel.setText(\"<html> <center> Welcome \" + loginPanel.usernameField.getText() +\n \"! </center> <br/> We set up a new account for you! \" +\n \" <br/>Your high score is 0.00 and your last score is 0.00</html>\");\n } else {\n //we found someone so let's grab their stats\n loginPanel.statusLabel.setText(\"<html>Welcome \" + newGuy.getUserName() +\n \"! <br/> Your high score is \" + newGuy.getHighScore() +\n \" and your last score was \" + newGuy.getLastScore() + \"</html>\");\n }\n loginPanel.loginButton.setEnabled(false);\n CurrentUser.setCu(newGuy);\n TabbedPanel.openTabs();\n }\n }",
"@FXML\r\n\tprivate void connectDatabase(ActionEvent event) {\r\n\t\tString username = \"\";\r\n\t\tString password = \"\";\r\n\t\t\r\n\t\twhile (true) {\r\n\t\t\tTextInputDialog userInput = new TextInputDialog();\r\n\t\t\tuserInput.setTitle(\"Input username\");\r\n\t\t\tuserInput.getDialogPane().setContentText(\"Username: \");\r\n\t\t\tTextField tf = userInput.getEditor();\r\n\t\t\tOptional<String> result = userInput.showAndWait();\r\n\r\n\t\t\tif (result.isPresent()) {\r\n\t\t\t\t// validate input\r\n\t\t\t\tusername = tf.getText();\r\n\t\t\t\tif (!username.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tshowAlert(AlertType.ERROR, \"Input Error\", \"Input username\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// canceled\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t\twhile (true) {\r\n\t\t\t\r\n\t\t\tTextInputDialog userInput = new TextInputDialog();\r\n\t\t\tuserInput.setTitle(\"Input password\");\r\n\t\t\tuserInput.getDialogPane().setContentText(\"Password: \");\r\n\t\t\tTextField tf = userInput.getEditor();\r\n\t\t\tOptional<String> result = userInput.showAndWait();\r\n\r\n\t\t\tif (result.isPresent()) {\r\n\t\t\t\t// validate input\r\n\t\t\t\tpassword = tf.getText();\r\n\t\t\t\tif (!password.isEmpty()) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tshowAlert(AlertType.ERROR, \"Input Error\", \"Input password\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// canceled\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t\tmyConn.getConnection(username, password);\r\n\t\tbuildTable();\r\n/*\r\n\t\tSystem.out.println(\"username: \" + username);\r\n\t\tSystem.out.println(\"password: \" + password);\r\n*/\r\n\t}",
"@FXML\r\n\tpublic void createUser(ActionEvent event) throws Exception{\r\n\t\ttry {\r\n\t\t\tconn = WilderTestDBConfig.getConnection();\r\n\t\t\t/*\r\n\t\t\tSELECT COUNT(userID), COUNT(username), COUNT(`password`), COUNT(privilege)\r\n\t\t\tFROM users\r\n\t\t\tWHERE username like 'user2' AND `password` like '1991225552';\r\n\t\t\t*/\r\n\t\t\tPreparedStatement updateUsers = conn.prepareStatement(\"SELECT COUNT(username) FROM users \" +\r\n\t\t\t\t\t\"WHERE username like '\" + userNameTextField.getText() + \"';\");\r\n\t\t\tResultSet resultSet = updateUsers.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\t\t\t\tusernameInt = resultSet.getInt(\"COUNT(username)\");\r\n\t\t\t}\r\n\t\t\tupdateUsers = conn.prepareStatement(\"SELECT COUNT(`password`) FROM users WHERE \" +\r\n\t\t\t\t\t\"`password` like '\"+ /*loginController*/LoginController.hashPass(passwordTextField.getText())+\"'\");\r\n\t\t\tresultSet = updateUsers.executeQuery();\r\n\t\t\twhile(resultSet.next()){\r\n\t\t\t\tpasswordInt = resultSet.getInt(\"COUNT(`password`)\");\r\n\t\t\t}\r\n\t\t\tif(passwordInt > 0){\r\n\t\t\t\tSystem.out.println(\"password already exists\");\r\n\t\t\t\tpasswordLabel.setText(\"Password\");\r\n\t\t\t} else\r\n\t\t\t\tpasswordLabel.setText(\"\");\r\n\t\t\tif(usernameInt > 0){\r\n\t\t\t\tSystem.out.println(\"username already exists\");\r\n\t\t\t\tusernameLabel.setText(\"Username\");\r\n\t\t\t} else\r\n\t\t\t\tusernameLabel.setText(\"\");\r\n\t\t\tif(passwordInt > 0 || usernameInt > 0){\r\n\t\t\t\tinsertStatusLabel.setText(\"Insertion Failed\");\r\n\t\t\t\tinsertStatusLabel.setTextFill(Color.RED);\r\n\t\t\t\treturn;\r\n\t\t\t} else if (usernameInt + passwordInt == 0) {\r\n\t\t\t\t\t/*\r\n\t\t\t\t\tThis is an example of the propper form and syntax for insertion... gigity\r\n\t\t\t\t\tINSERT INTO users (username, `password`, privilege)\r\n\t\t\t\t\tVALUES('user2', '1991225552', 0);\r\n\t\t\t\t\t*/\r\n\t\t\t\tString createUser = \"INSERT INTO users (username, `password`, privilege) VALUES ( '\" + userNameTextField.getText() + \"', '\" + LoginController.hashPass(passwordTextField.getText()) + \"', 0)\";\r\n\t\t\t\tupdateUsers = conn.prepareStatement(createUser);\r\n\t\t\t\tupdateUsers.execute(createUser);\r\n\t\t\t\tinsertStatusLabel.setText(\"Insertion Sucessfull\");\r\n\t\t\t\tinsertStatusLabel.setTextFill(Color.GREEN);\r\n\t\t\t}\r\n\t\t\tconn.close();//probably should properly close the connection, resultSet, and statement \r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void account() throws SQLException {\r\n String name = tf_firstAndLastName.getText();\r\n String password = tf_employeePass.getText();\r\n if ((!name.equals(\"\")) && (!password.equals(\"\"))) {\r\n myEmployee = new Employee(name, password);\r\n if ((!myEmployee.getUsername().equals(\"\")) && (!myEmployee.getPassword().equals(\"\"))) {\r\n String employeeCode = JOptionPane.showInputDialog(\"Input Employee Code\");\r\n if (employeeCode.equals(\"AS123\")) {\r\n String productQuery = \"INSERT INTO EMPLOYEE(NAME, USERNAME, PASSWORD, EMAIL) VALUES (?,?,?,?)\";\r\n PreparedStatement addEmployee = Login_Controller.conn.prepareStatement(productQuery);\r\n\r\n addEmployee.setString(1, name);\r\n addEmployee.setString(2, myEmployee.getUsername());\r\n addEmployee.setString(3, password);\r\n addEmployee.setString(4, myEmployee.getEmail());\r\n addEmployee.executeUpdate();\r\n addEmployee.close();\r\n\r\n tf_firstAndLastName.clear();\r\n tf_employeePass.clear();\r\n ta_employeeAccount.appendText(myEmployee.toString() + \"\\n\\n\");\r\n\r\n } else {\r\n JOptionPane.showMessageDialog(null, \"Invalid employee code. \" +\r\n \"\\nNote: Only employees need to create accounts and log in\");\r\n }\r\n } else {\r\n JFrame frame = new JFrame(\"\");\r\n JOptionPane.showMessageDialog(\r\n frame.getContentPane(),\r\n \"Username or password has invalid format.\\n\",\r\n \"Invalid Format\",\r\n JOptionPane.ERROR_MESSAGE);\r\n }\r\n } else {\r\n JOptionPane.showMessageDialog(null, \"Name or password is empty.\");\r\n }\r\n\r\n }",
"private void login() {\r\n\r\n if (String.valueOf(login_usernameTextField.getText()).equals(\"\"))\r\n JOptionPane.showMessageDialog\r\n (null, \"Must Enter A Username\");\r\n\r\n else if (String.valueOf(login_passwordField.getPassword()).equals(\"\"))\r\n JOptionPane.showMessageDialog\r\n (null, \"Must Enter A Password\");\r\n\r\n else if (MainGUI.pimsSystem.staff_exists(login_usernameTextField.getText(), String.valueOf(login_passwordField.getPassword()))) {\r\n remove(loginPanel);\r\n add(tabbedPane);\r\n JOptionPane.showMessageDialog\r\n (null, \"Login Successful\");\r\n repaint();\r\n revalidate();\r\n\r\n // reset username and password fields\r\n login_usernameTextField.setText(\"\");\r\n login_passwordField.setText(\"\");\r\n\r\n } else\r\n JOptionPane.showMessageDialog\r\n (null, \"Invalid Password or Username\");\r\n }",
"private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed\n // TODO add your handling code here:\n\n //SAVE CODE\n if (tools.checkNumberFormat(new String(txtCurrentPass.getPassword()))) {\n checkRole();\n } else if (BCrypt.checkpw(new String(txtCurrentPass.getPassword()), employee.getPassword())) {\n checkRole();\n } else {\n tampilPesan(\"Current Password is Wrong!!!\");\n }\n\n }",
"private void initialize() {\r\n\t\tframe = new JFrame();\r\n\t\tframe.getContentPane().setBackground(new Color(204, 204, 255));\r\n\t\tframe.getContentPane().setForeground(new Color(0, 0, 0));\r\n\t\tframe.setBounds(100, 100, 800, 600);\r\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n\t\tframe.getContentPane().setLayout(null);\r\n\t\t\r\n\t\tuserid = new JTextField();\r\n\t\tuserid.setBounds(292, 273, 221, 32);\r\n\t\tframe.getContentPane().add(userid);\r\n\t\tuserid.setColumns(10);\r\n\t\t\r\n\t\tpassword = new JPasswordField();\r\n\t\tpassword.setBounds(292, 317, 221, 32);\r\n\t\tframe.getContentPane().add(password);\r\n\t\t\r\n\t\tJButton btnLogin = new JButton(\"LOGIN\");\r\n\t\tbtnLogin.setFont(new Font(\"Calibri\", Font.PLAIN, 15));\r\n\t\tbtnLogin.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tString uId=userid.getText();\r\n\t\t\t\tString pw =password.getText();\r\n\t\t\t\t\r\n\t\t\t\tif(uId.equals(\"id\") && pw.equals(\"pass\")) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Login success!\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(frame, \"Login fail!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnLogin.setForeground(new Color(255, 255, 255));\r\n\t\tbtnLogin.setBackground(new Color(204, 204, 255));\r\n\t\tbtnLogin.setBounds(292, 361, 105, 27);\r\n\t\tframe.getContentPane().add(btnLogin);\r\n\t\t\r\n\t\tbtnJoin = new JButton(\"JOIN\");\r\n\t\tbtnJoin.setFont(new Font(\"Calibri\", Font.PLAIN, 15));\r\n\t\tbtnJoin.setForeground(new Color(255, 255, 255));\r\n\t\tbtnJoin.setBackground(new Color(204, 204, 255));\r\n\t\tbtnJoin.setBounds(408, 361, 105, 27);\r\n\t\tframe.getContentPane().add(btnJoin);\r\n\t\t\r\n\t\tbtnFindIdOr = new JButton(\"FIND ID OR PASSWORD\");\r\n\t\tbtnFindIdOr.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t}\r\n\t\t});\r\n\t\tbtnFindIdOr.setForeground(new Color(255, 255, 255));\r\n\t\tbtnFindIdOr.setFont(new Font(\"Calibri\", Font.PLAIN, 15));\r\n\t\tbtnFindIdOr.setBackground(new Color(204, 204, 255));\r\n\t\tbtnFindIdOr.setBounds(292, 400, 221, 27);\r\n\t\tframe.getContentPane().add(btnFindIdOr);\r\n\t\t\r\n\t\tlblLogo = new JLabel(\"LOGO\");\r\n\t\tlblLogo.setBackground(new Color(204, 204, 255));\r\n\t\tlblLogo.setFont(new Font(\"Calibri\", Font.PLAIN, 15));\r\n\t\tlblLogo.setHorizontalAlignment(SwingConstants.CENTER);\r\n\t\tlblLogo.setBounds(292, 114, 221, 125);\r\n\t\tframe.getContentPane().add(lblLogo);\r\n\t}",
"protected void confirmLogin() {\n String nameString1 = this.adminName.getText();\n String passwordString1 = this.adminPassword.getText();\n UserType userType = (UserType) this.user_type_combobox.getSelectedItem();\n if (\"系统管理员\".equals(userType.getName())) {\n AdminDao adminDao = new AdminDao();\n SystemAdmin admin = adminDao.selectAdmin(nameString1, passwordString1);\n if (admin == null) {\n JOptionPane.showMessageDialog(this, \"用户名或者密码错误!!\");\n return;\n }\n IndexFrame indexFrame = new IndexFrame(userType, admin, passwordString1);\n indexFrame.setVisible(true);\n this.dispose();\n }\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t// TODO Auto-generated method stub\n\t\tif (e.getSource() == btnExit){\n\t\t\t//if exit button is pressed the program quits\n\t\t\tSystem.exit(0);\n\t\t}\n\t\telse if (e.getSource()==btnLogin){\n\t\t\t//if login button is pressed, program checks\n\t\t\t//if the username and password are valid, if \n\t\t\t//valid the creates the listMenu!\n\t\t\tif (username.getText().equals(\"campos\")&& \"dev\".equals(new String (password.getPassword()))) {\n\t\t\t\ttry {\n\t\t\t\t\tListMenu menu = new ListMenu();\n\t\t\t\t\t//catches for file and format!\n\t\t\t\t} catch (NumberFormatException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"ERROR: Number Format Error\");\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \n\t\t\t\t\t\t\t\"ERROR: File(s) Not Found\\n Please Check Your File Format\\n\"\n\t\t\t\t\t\t\t\t\t+ \"and The File Name!\");\n\t\t\t\t}\n\t\t\t\t//welcome user and dispose the login menu\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Welcome \" + username.getText());\n\t\t\t\tdispose();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//if username and/or password is incorrect \n\t\t\t\t//displays a message telling them its incorrect and\n\t\t\t\t//sets the text fields as empty\n\t\t\t\tJOptionPane.showMessageDialog(null, \n\t\t\t\t\t\t\"Incorrect Username or Password\\nPlease Read Readme File\\n to find the admin account\");\n\t\t\t\tusername.setText(\"\");\n\t\t\t\tpassword.setText(\"\");\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\tString fn = tffname.getText();\r\n\t\t\tString ln = tflname.getText();\r\n\t\t\tString eml= tfemail.getText();\r\n\t\t\tString phn = tfphone.getText();\r\n\t\t\tString user = tfusername.getText();\r\n\t\t\tString pass = tfpasswrd.getText();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tstatement.executeUpdate(\"INSERT INTO register VALUES('\"+fn+\"','\"+ln+\"','\"+eml+\"','\"+phn+\"','\"+user+\"','\"+pass+\"')\");\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tif (server == null)\r\n\t\t\t\t\tlogin();\r\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif(e.getSource()==signup)\n\t\t{\n\t\t\tnewaccount l = new newaccount();\t\t\t\n\t\t}\n\t\tif(e.getSource()==go)\n\t\t{\n\t\t\ttry{\n\t\t\t\tClass.forName(JDBC_DRIVER);//JDBC드라이버 로드\n\t\t\t\tconn = DriverManager.getConnection(DB_URL,USERNAME,PASSWORD);//DB연결\n\t\t\t\tSystem.out.println(\"\\n- DB연결 성공\");\n\t\t\t\tstmt = conn.createStatement();//\n\t\t\t\t\n\t\t\t\tString king;\n\t\t\t\tking = \"SELECT * FROM rank ORDER BY jumsu DESC LIMIT 1\";\n\t\t\t\tResultSet rsking = stmt.executeQuery(king);\n\t\t\t\twhile(rsking.next())\n\t\t\t\t{\n\t\t\t\t\tkingjumsu=rsking.getString(2);\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\tString sql;\n\t\t\t\t//현재 입력된 아이디와 동일한 아이디가 있는지 검사\n\t\t\t\tsql = \"SELECT * FROM user WHERE user_ID ='\" + id.getText() +\n\t\t\t\t\t\t\t\t\t\t\"' AND user_PW ='\" + pw.getText() +\"'\";\n\t\t\t\tResultSet rs1 = stmt.executeQuery(sql);\n\t\t\t\t\n\t\t\t\tint i=0;\n\t\t\t\twhile(rs1.next())\n\t\t\t\t{\n\t\t\t\t\ti++;\n\t\t\t\t}\t\t\n\t\t\t\trs1.close();\n\t\t\t\t//i가 1이상이면(1이면)중복된 값이 있는것이기 때문에 실행 o\n\t\t\t\tif(i!=0)\n\t\t\t\t{\n\t\t\t\t\tnowid = id.getText();//넘겨주기 위해 선언\n\t\t\t\t\t\n\t\t\t\t\t//현재 입력된 아이디의 저장 데이터가 있는지 검사\n\t\t\t\t\tString sql2;\n\t\t\t\t\tsql2 = \"SELECT * FROM save WHERE user_ID ='\" + nowid + \"'\";\n\t\t\t\t\tResultSet rs2 = stmt.executeQuery(sql2);\t \n\t\t\t\t\t\n\t\t\t\t\tint j=0;\n\t\t\t\t\twhile(rs2.next())\n\t\t\t\t\t{\n\t\t\t\t\t\tj++;\n\t\t\t\t\t}\t\t\n\t\t\t\t\trs2.close();\n\t\t\t\t\t\n\t\t\t\t\t//j가 1 이상이면 중복된 값이 있는것이기 때문에 물어보고 실행 o\n\t\t\t\t\tif(j!=0)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tint result = 0;\n\t\t\t\t\t\tresult = JOptionPane.showConfirmDialog(null, \"저장된 데이터가 있습니다. 불러오시겠습니까?\\n(※경고 : 불러오지 않으면 저장되있던 데이터는 삭제됩니다.)\"\n\t\t\t\t\t\t\t\t+ \"\t\t\t\t\t\t\t\t\t \",\"불러오기\",JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t\t\t// (result 리턴값)\n\t\t\t\t\t\t// JOptionPane.YES_OPTION, JOptionPane.NO_OPTION,\n\t\t\t\t\t\t// JOptionPane.CANCEL_OPTION 등\n\t\t\t\t\t\t\n\t\t\t\t\t\t//저장된 값부터 시작\n\t\t\t\t\t\tif(result==JOptionPane.YES_OPTION){\n\t\t\t\t\t\t\tload=false;\n\t\t\t\t\t\t\tString sql3;\n\t\t\t\t\t\t\tsql3 = \"SELECT * FROM save WHERE user_ID ='\" + id.getText() + \"'\";\n\t\t\t\t\t\t\t//현재아이디로 저장된 save데이터를 받아서 버튼배열에 저장\t\t\n\t\t\t\t\t\t\tResultSet rs3 = stmt.executeQuery(sql3);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint x=0;\n\t\t\t\t\t\t\twhile(rs3.next())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfor(int y=0;y<=15;y++)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tbtnnum[x]=rs3.getString(x+3);\n\t\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tjumsu = rs3.getString(2);\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\tsavenum=1;\n\t\t\t\t\t\t\trs3.close();\n\t\t\t\t\t\t\tCore c = new Core();\n\t\t\t\t\t\t}//처음부터 시작(세이브 데이터 초기화됨)\n\t\t\t\t\t\tif(result==JOptionPane.NO_OPTION){\n\t\t\t\t\t\t\tString set;\n\t\t\t\t\t\t\tset = \"DELETE FROM save WHERE user_ID='\"+ nowid + \"'\";\n\t\t\t\t\t\t\tst = conn.prepareStatement(set);\n\t\t\t\t\t\t\tst.executeUpdate();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tCore c = new Core();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//아니라면 그냥 처음부터 실행\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\"로그인 성공\");\n\t\t\t\t\t\tmain main = new main();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//i가 0이면 정보가 없기때문에 실행 x\n\t\t\t\tif(i==0)\n\t\t\t\t{\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"아이디, 비밀번호를 확인해주세요\");\n\t\t\t\t}\n\t\t\t\tstmt.close();\n\t\t\t\tconn.close();\n\t\t\t}catch(SQLException se1){\n\t\t\t\tse1.printStackTrace();\n\t\t\t}catch(Exception ex){\n\t\t\t\tex.printStackTrace();\n\t\t\t}finally{\n\t\t\t\ttry{\n\t\t\t\t\tif(stmt!=null)\n\t\t\t\t\t\tstmt.close();\n\t\t\t\t}catch(SQLException se2){\n\t\t\t\t}\n\t\t\t\ttry{\n\t\t\t\t\tif(conn!=null)\n\t\t\t\t\t\tconn.close();\n\t\t\t\t}catch(SQLException se){\n\t\t\t\t\tse.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t}",
"@Override\r\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tfor(int i = 0; i < myUsers.size(); i++) {\r\n\t\t\t\t\tif(myUsers.get(i).getName() == username.getText() && myUsers.get(i).getPassword() == password.getText()) {\r\n\t\t\t\t\t\t\tSystem.out.println(\"Success!\");\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\t\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\tSystem.out.println(\"Failure\");\r\n\t\t\t\t}",
"@FXML\r\n private void handleLoginButtonAction(ActionEvent event) throws SQLException {\n\r\n String query = \"SELECT username, password FROM LoginTable WHERE \"\r\n + \"username = '\" + usernameBox.getText() + \"'\"\r\n + \"AND password = '\" + passwordBox.getText() + \"'\";\r\n\r\n try {\r\n ResultSet rs = d.getResultSet(query); //TODO: Fill in this query\r\n if (!rs.next()) {\r\n //TODO: What should happen if there is no result?\r\n prompt.setText(\"Incorrect Username or Password\");\r\n } else {\r\n //TODO: What should happen if there is a result?\r\n prompt.setText(\"Login Success\");\r\n music.setVisible(true);\r\n }\r\n rs.close();\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }",
"public void actionPerformed(ActionEvent e) {\n \t\t\t\tlogin();\n \t\t\t}",
"@Override\n\t\tpublic void actionPerformed(ActionEvent arg0){\n\t\t String username = userLogInput.getText();\n\t\t String password = passLogInput.getText();\n\t\t if (username.contains(\"\\n\")){\n\t\t\tlogMessage.setText(\"Messages: username cannot contain the new line character.\");\n\t\t\tpanelLog.add(logMessage);\n\t\t\treturn;\n\t\t }\n\t\t for (int i = 0; i < username.length(); i++){\n\t\t\tif (username.charAt(i) == 44){\n\t\t\t logMessage.setText(\"Messages: username cannot contain the comma character.\");\n\t\t\t panelLog.add(logMessage);\n\t\t\t return;\n\t\t\t}\n\t\t }\n\t\t if (password.contains(\"\\n\")){\n\t\t\tlogMessage.setText(\"Messages: password cannot contain the new line character.\");\n\t\t\tpanelLog.add(logMessage);\n\t\t\treturn;\n\t\t }\n\t\t for (int i = 0; i < password.length(); i++){\n\t\t\tif (password.charAt(i) == 44){\n\t\t\t logMessage.setText(\"Messages: password cannot contain the comma character.\");\n\t\t\t panelLog.add(logMessage);\n\t\t\t return;\n\t\t\t}\n\t\t }\n\t\t /**int i = 0;\n\t\t String password = \"\";\n\t\t while(i < passLogInput.length){\n\t\t\tpassword += passLogInput[i];\n\t\t\t}*/\n\t\t /**if (username.length() == 0){\n\t\t\tlogMessage.setText(\"Input username\");\n\t\t }\n\t\t if (password.length() == 0){\n\t\t\tlogMessage.setText(\"Input password\");\n\t\t\t}*/\n\t\t \n\t\t Login backend = new Login(username, password);\n\t\t String results = backend.readFile(\"Example.csv\");\n\n\t\t //Username and password match those in Example.csv\n\t\t if (results.equals(\"Success\")){\n\t\t\tlogMessage.setText(\"Messages: Success!\");\n\t\t\tpanelLog.add(logMessage);\n\t\t\tdispose();\n\t\t\t//new LoginGUI();\n\t\t\t//new LoginGUI();\n\t\t\t//new LoginGUI();\n\n\t\t\tnew GUI(\"Example.csv\", username);\n\t\t }\n\n\t\t //Username or password do not match those in Example.csv\n\t\t else if (results.equals(\"Bad Pass\")){\n\t\t\tlogMessage.setText(\"Messages: The password inputted does not match this username.\");\n\t\t\tpanelLog.add(logMessage);\n\t\t }\n\t\t else if (results.equals(\"Bad User\")){\n\t\t\tlogMessage.setText(\"Messages: There is no such user.\");\n\t\t\tpanelLog.add(logMessage);\n\n\t\t }\n\n\t\t //No username or password inputted\n\t\t else if (results.equals(\"Empty User\")){\n\t\t\tlogMessage.setText(\"Messages: Input your username.\");\n\t\t\tpanelLog.add(logMessage);\n\t\t }\n\t\t else if (results.equals(\"Empty Pass\")){\n\t\t\tlogMessage.setText(\"Messages: Input your password.\");\n\t\t\tpanelLog.add(logMessage);\n\t\t }\n\t\t else{\n\t\t\tlogMessage.setText(\"Messages: Error. Please input your username and password.\");\n\t\t\tpanelLog.add(logMessage);\n\t\t }\n\t\t /**String apple = userLogInput.getText();\n\t\t userSignInput.setText(apple);\n\t\t dispose();//this should close the window, but that's a minor technicality\n\t\t new LoginGUI();//this shoudl actually be nwhatever Janice chooses to be her main GUI.*/\n\n\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tif(oldText.getPassword().length == 0 || newPassText1.getPassword().length == 0 || newPassText2.getPassword().length ==0) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"请输入密码!\", \"警告\", JOptionPane.WARNING_MESSAGE, new ImageIcon(new Images().getWarring2()));\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tString oldPass = new String( oldText.getPassword() );\r\n\t\t\t\tString newPass = new String( newPassText1.getPassword() );\r\n\t\t\t\tif(!newPass.equals(new String(newPassText2.getPassword()))) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"两次输入的密码不同,请重新输入\", \"警告\", JOptionPane.WARNING_MESSAGE, new ImageIcon(new Images().getWarring2()));\r\n\t\t\t\t\treturn ;\r\n\t\t\t\t}\r\n\t\t\t\tLoginDao loginDao = new LoginDao();\r\n\t\t\t\tif(loginDao.changePass(Login.getUser().getId(), oldPass, newPass)) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"密码修改成功,请重新登陆!\", \"提示消息\",JOptionPane.INFORMATION_MESSAGE , new ImageIcon(new Images().getYes2()));\r\n\t\t\t\t\tdispose();\r\n\t\t\t\t\tLogin.reLogin();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"密码修改失败!\", \"提示消息\",JOptionPane.ERROR_MESSAGE , new ImageIcon(new Images().getError2()));\r\n\t\t\t\t}\r\n\t\t\t}",
"public boolean checkCredentials(String inputLogin, String inputPassword) {\n //creates boolean variable flag and defines it as True\n boolean flag = false;\n //defines Connection con as null\n Connection con = MainWindow.dbConnection();\n try {\n //tries to create a SQL statement to retrieve values of a User object from the database\n String query = \"SELECT * FROM User WHERE userID = '\" + inputLogin + \"' AND password = '\" + inputPassword + \"';\";\n Statement statement = con.createStatement();\n ResultSet result = statement.executeQuery(query);\n /*\n if statement compares data entered by user with data in the database. If there is such data in the database\n users credentials are put into MainWindow variables and defines flag variable as True\n */\n if(result.getString(\"userID\").equals(inputLogin) && result.getString(\"password\").equals(inputPassword)) {\n flag = true;\n MainWindow.userLastName = result.getString(\"lastName\");\n MainWindow.userFirstName = result.getString(\"firstName\");\n MainWindow.userID = inputLogin;\n MainWindow.userPassword = inputPassword;\n }//end if statement\n } catch (Exception e) {\n //catches exceptions and show message about them\n System.out.println(e.getMessage());\n }//end try/catch\n //checks if Connection con is equaled null or not and closes it.\n MainWindow.closeConnection(con);\n return flag;\n }",
"private void checkRole() {\n if (tools.checkNewPassword(new String(txtNewPass.getPassword()))) {\n if (new String(txtNewPass.getPassword()).equals(new String(txtConfirmPass.getPassword()))) {\n try {\n controller.changePassword(employee.getUsername(), new String(txtNewPass.getPassword()));\n Tools tools = new Tools();\n tools.sendMessage(employee, 3);\n tampilPesan(\"Password successfully updated.\");\n Login login = new Login(sessionFactory);\n this.getParent().add(login);\n login.setLocation(480, 200);\n login.setVisible(true);\n \n dispose();\n } catch (SQLException ex) {\n Logger.getLogger(ChangePasswordView.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n tampilPesan(\"New password doesn't match with confirm password\");\n }\n } else {\n tampilPesan(\"Password must have 8 characters minimum containing Uppercase, Lowercase, and number!!!\");\n }\n }",
"public boolean onOkClicked() {\n try {\n if (form.isValid()) {\n String userName = form.getFieldValue(SysUser.USER_NAME_PROPERTY);\n String userAccount = form.getFieldValue(SysUser.USER_ACCOUNT_PROPERTY);\n String passWord = form.getFieldValue(SysUser.USER_PASSWORD_PROPERTY);\n String cPassWord = form.getFieldValue(\"cPassWord\");\n if (!passWord.equals(cPassWord)) {\n form.getField(SysUser.USER_PASSWORD_PROPERTY).setValue(\"\");\n form.getField(\"cPassWord\").setValue(\"\");\n form.getField(SysUser.USER_PASSWORD_PROPERTY).setFocus(true);\n addModel(\"msg\", \"密码不一致\");\n } else if (SysUserDao.getInstance().canCreate(getSysUser().getObjectContext(), userAccount)) {\n if (SysUserDao.getInstance().createSysUser(getSysUser().getObjectContext(), userName, userAccount, passWord)) {\n setRedirect(UserListPage.class);\n } else {\n addModel(\"msg\", \"失败\");\n }\n } else {\n form.getField(SysUser.USER_ACCOUNT_PROPERTY).setFocus(true);\n addModel(\"msg\", \"账号已存在\");\n }\n }\n } catch (Exception e) {\n logger.error(e.getLocalizedMessage(), e);\n }\n return true;\n }",
"public void actionPerformed(ActionEvent e) {\t\t\t\tif(connected == true) {\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"You are already connected !\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*Only if client is not already logged in, will it be able to \r\n\t\t\t\tsend connection request to server*/\r\n\t\t\t\telse if(connected == false) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tclientname = textRegName.getText();\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*Checking for bad client usernames and accepting only alphanumeric names*/\r\n\t\t\t\t\tif(clientname.equals(null)||clientname.trim().isEmpty()||(!Pattern.matches(regex, clientname)))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Please enter an alphanumeric username to connect to server! \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/*calling the method to start client connection.*/\r\n\t\t\t\t\t\tstartClientConnection();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tif(arg0.getSource()==jb)\n\t\t{\n\t\t\tString id_=id.getText();\n\t\t\ttry\n\t\t\t{\n\t\t\t\n\t\t\tif(id_.equals(null)||(!id_.equals(\"Admin\")))\n\t\t\t\tthrow new AdminId();\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(AdminId e)\n\t\t\t{\n\t\t\t\tid.setBackground(new Color(249,139,29));\n\t\t\t}\n\t\t\tString password_=password.getText();\n\t\t\ttry {\n\t\t\t\tverify_password(password_,id_);\n\t\t\t} \n\t\t\t\n\t\t\tcatch (PasswordMatch e) {\n\t\t\t\n\t\t\t\tif(e.a==1)\n\t\t\t\t{\n\t\t\t\tpassword.setText(null);\n\t\t\t\tpassword.setBackground(new Color(249,139,29));\n\t\t\t\t}\n\t\t\t\telse if(e.a==2)\n\t\t\t\t{\n\t\t\t\t\tpassword.setText(null);\n\t\t\t\t\tpassword.setBackground(new Color(9,115,76));\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\telse if(arg0.getSource()==jb1)\n\t\t{\n\t\t\tjf.dispose();\n\t\t}\n\t}",
"public void login(ActionEvent e) throws IOException{\n\t\tString username = Username.getText().toLowerCase();\n\t\tString password = Password.getText();\n\t\tif(username.equalsIgnoreCase(\"admin\")){\n\t\t\tif (password.equals(PhotoAlbum.admin.getPassword())) {\n\t\t\t\tsegue(\"/view/Admin.fxml\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpasswrong.setStyle(\"-fx-opacity: 1;\");\n\t\t\t\tPassword.setStyle(\"-fx-text-box-border: red; -fx-focus-color: red;\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t} \n\t\t//search through list\n\t\tfor(int i = 0; i < PhotoAlbum.admin.getUserList().size(); i++){\n\t\t\tPhotoAlbum.regular_user = (NonAdminUser) PhotoAlbum.admin.getUserList().get(i);\n\t\t\tif(PhotoAlbum.regular_user.getUsername().equals(username)){\n\t\t\t\tif(PhotoAlbum.regular_user.getPassword().equals(password)){\n\t\t\t\t\tUsername.setStyle(\"-fx-text-box-border: white; -fx-focus-color: #008ED6;\");\n\t\t\t\t\tuserwrong.setStyle(\"-fx-opacity: 0;\");\n\t\t\t\t\tPassword.setStyle(\"-fx-text-box-border: white; -fx-focus-color: #008ED6;\");\n\t\t\t\t\tpasswrong.setStyle(\"-fx-opacity: 0;\");\n\t\t\t\t\tPhotoAlbum.logged_in = (NonAdminUser) PhotoAlbum.admin.getUserList().get(i);\n\t\t\t\t\tsegue(\"/view/Albums.fxml\");\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tpasswrong.setStyle(\"-fx-opacity: 1;\");\n\t\t\t\t\tPassword.setStyle(\"-fx-text-box-border: red; -fx-focus-color: red;\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//if not found\n\t\tuserwrong.setStyle(\"-fx-opacity: 1;\");\n\t\tUsername.setStyle(\"-fx-text-box-border: #e67e22; -fx-focus-color: #e67e22;\");\n\t\tPassword.setStyle(\"-fx-text-box-border: #e67e22; -fx-focus-color: #e67e22;\");\n\t}",
"private void proseslogin() {\n String user = username.getText();\n char[] pass = password.getPassword();\n \n if (user.isEmpty()) {\n JOptionPane.showMessageDialog(this, \"Username Harus Diisi\");\n username.requestFocus();\n } else if (pass.length == 0){\n JOptionPane.showMessageDialog(this, \"Password Harus Diisi\");\n password.requestFocus();\n }else{\n String password = new String(pass);\n login.setEnabled(false);\n try {\n Connection conn = koneksi.sambungDB();\n Statement st = conn.createStatement();\n String n = \"SELECT * FROM tb_admin \"\n +\"WHERE admin_username='\"+user+\"' \"\n +\"AND admin_password=MD5('\"+password+\"')\" ;\n// System.out.println(q);\n ResultSet rs = st.executeQuery(n);\n if (rs.next()) {\n Data_perumahan h = new Data_perumahan();\n h.setExtendedState(Frame.MAXIMIZED_BOTH);\n this.setVisible(false);\n h.setVisible(true);\n }else{\n JOptionPane.showMessageDialog(this, \"Username dan Password Salah\");\n username.requestFocus();\n }\n login.setEnabled(true);\n } catch (HeadlessException | SQLException e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n }\n }",
"private void loginBD() {\n\t\t\r\n\t\tif(ConexionStatic.isDbConnected()){\r\n\t\t\ttry\r\n\t\t\t{ \r\n\t\t\t\t\r\n\t //chekar si el usuario escrbio el nombre de usuario y pw\r\n\t if (view.getTxtUser().getText().length() > 0 && view.getTxtPass().getText().length() > 0 )\r\n\t {\r\n\t \tmyUsuario.setPwd(view.getTxtPass().getText());\r\n\t \tmyUsuario.setUser(view.getTxtUser().getText());\r\n\t \tresultado=myUsuarioDao.setLogin(myUsuario);\r\n\t \t\r\n\t \tif(!resultado){//si el resultado el usuario en la bd no existe o el pwd\r\n\t \t\tJOptionPane.showMessageDialog(null, \"El nombre de usuario y/o contrasenia no son validos.\");\r\n\t //JOptionPane.showMessageDialog(null, view.getTxtUser().getText()+\" \" +view.getTxtPass().getText() );\r\n\t //view.getTxtUser().setText(\"\"); //limpiar campos\r\n\t view.getTxtPass().setText(\"\"); \r\n\t \r\n\t view.getTxtUser().requestFocusInWindow();\r\n\t \t}else{\r\n\t \t\tthis.view.setVisible(false);\r\n\t \t\tthis.view.dispose();\r\n\t \t\t\r\n\t \t}\r\n\t \t\r\n\t /*/ Si el usuario si fue validado correctamente\r\n\t if( validarUsuario( txtUser.getText(), txtPass.getText() ) ) //enviar datos a validar\r\n\t {\r\n\t // Codigo para mostrar la ventana principal\r\n\t setVisible(false);\r\n\t VentanaPrincipal ventana1 = new VentanaPrincipal();\r\n\t ventana1.mostrar();\r\n\t\r\n\t\r\n\t }\r\n\t else\r\n\t {\r\n\t JOptionPane.showMessageDialog(null, \"El nombre de usuario y/o contrasenia no son validos.\");\r\n\t JOptionPane.showMessageDialog(null, view.getTxtUser().getText()+\" \" +view.getTxtPass().getText() );\r\n\t view.getTxtUser().setText(\"\"); //limpiar campos\r\n\t view.getTxtPass().setText(\"\"); \r\n\t \r\n\t view.getTxtUser().requestFocusInWindow();\r\n\t }*/\r\n\t\r\n\t }\r\n\t else\r\n\t {\r\n\t JOptionPane.showMessageDialog(null, \"Debe escribir nombre de usuario y contrasenia.\\n\" +\r\n\t \"NO puede dejar ningun campo vacio\");\r\n\t }\r\n\t\r\n\t } catch (Exception e)\r\n\t {\r\n\t e.printStackTrace();\r\n\t }\r\n\t\t}//fin de la comprobacion de la conexion\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void actionPerformed(ActionEvent arg0) {\n\t\tif (arg0.getSource() == jb1) {\r\n\t\t\t\r\n\t\t\tif(judgePassword(jf5.getText()) && judgeTelephone(jf6.getText()))\r\n\t\t\t{\r\n\t\t\tConnection ct = null;\r\n\t\t\tPreparedStatement pstmt = null;\r\n\t\t\tResultSet rs = null;\r\n\t\t\tStatement stmt = null;\r\n\r\n\t\t\ttry {\r\n\t\t\t\t// 1.加载驱动\r\n\t\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\r\n\t\t\t\t// 2.连接数据库\r\n\t\t\t\tct = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/bank\", \"root\", \"root\");\r\n\t\t\t\tstmt = ct.createStatement();\r\n\r\n\t\t\t\tString sql = \"update customer1 set password= '\" + jf5.getText() + \"' where cardNumber= '\" + cardNumber\r\n\t\t\t\t\t\t+ \"'\";\r\n\t\t\t\tString sql1 = \"update customer1 set telephone= '\" + jf6.getText() + \"' where cardNumber= '\" + cardNumber\r\n\t\t\t\t\t\t+ \"'\";\r\n\t\t\t\tstmt.executeUpdate(sql);\r\n\t\t\t\tstmt.executeUpdate(sql1);\r\n\r\n\t\t\t\tthis.dispose();\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"修改成功\", \"提示信息\", JOptionPane.INFORMATION_MESSAGE);\r\n\r\n\t\t\t} catch (Exception arg1) {\r\n\t\t\t\targ1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\r\n\t\telse if (arg0.getSource() == jb2) {\r\n\t\t\tthis.dispose();// 关闭添加对话框\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tif (e.getSource()==btnIngresar) {\n\t\t\tchar[] clave = txtPassword.getPassword();\n\t\t\tString password = new String(clave);\n\t\t\t\n\t\t\tif(txtUsuario.getText().equals(\"RaulCobo\") && password.equals(\"12345\")) {\n\t\t\t\tdispose();\n\t\t\t\tJOptionPane.showMessageDialog(null,\"Bienvenido al Sistema\", \"Ingresaste\",JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\tGUI_Empleado empleado = new GUI_Empleado();\n\t\t\t\templeado.setVisible(true);\n\t\t\t\n\t\t\t}else {\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Usuario o Contrase\",\"Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\ttxtUsuario.setText(\"\");\n\t\t\t\ttxtPassword.setText(\"\");\n\t\t\t\ttxtUsuario.requestFocus();\n\t\t\t}\n\t\t}\n\t}",
"private void confirmAction() {\r\n try {\r\n PreparedStatement prep = conn.prepareStatement(\"SELECT * FROM admin WHERE login = ? and (paswd = ? or paswd = ?)\");\r\n prep.setString(1, tf_login.getText());\r\n prep.setString(2, pf_pass.getText());\r\n prep.setString(3, tf_pass.getText());\r\n ResultSet wynikLogowania = prep.executeQuery();\r\n if (wynikLogowania.next()) {\r\n// if (!wynikLogowania.getString(\"login\").equals(\"\")) {\r\n System.out.println(\"\\n=========================================================\");\r\n System.out.println(\"===|||Zalogowano poprawnie do aplikacji JAKO ADMIN!|||===\");\r\n System.out.println(\"=========================================================\\n\");\r\n try {\r\n Stage administratorStage = new Stage();\r\n Parent root = FXMLLoader.load(getClass().getResource(\"../view/adminMainView.fxml\")); //w tym miejscu wywołamy okno ADMINA po zalogowaniu!!!\r\n administratorStage.setTitle(\"Witamy w panelu administratora!!!\");\r\n administratorStage.setScene(new Scene(root));\r\n administratorStage.show();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n// }\r\n } else {\r\n System.out.println(\"\\n=======================================================\");\r\n System.out.println(\"\\tUWAGA: Wprowadzono niepoprawny login lub hasło!\");\r\n System.out.println(\"=======================================================\\n\");\r\n// licznikLogowan = licznikLogowan - 1;\r\n Alert alert = new Alert(Alert.AlertType.INFORMATION);\r\n alert.setTitle(\"ALERT: Nieprawidłowe dane logowania!\");\r\n alert.setHeaderText(\"Niepoprawny login lub hasło!\");\r\n// alert.setContentText(\"Pozostało: \" + licznikLogowan + \" prób logowania!\");\r\n alert.showAndWait();\r\n// if (licznikLogowan == 0) {\r\n// System.out.println(\"To była Twoja OSTATNIA próba zalogowania! Nie udało się! Zapraszamy jak się zastanowisz nad sobą!\");\r\n// System.exit(0);\r\n// }\r\n }\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n System.out.println(\"\\n#############################\");\r\n System.out.println(\"###Błędne zapytanie do DB!###\");\r\n System.out.println(\"##############################\\n\");\r\n }\r\n tf_login.clear();\r\n pf_pass.clear();\r\n tf_pass.clear();\r\n }",
"@FXML\n private void doneBtn(ActionEvent event) throws IOException, SQLException, ClassNotFoundException {\n \n passCheck(); //password chk\n \n if(!pass.equals(\"\")){\n UGStudent.insertStudentLogin(username.getText(), email.getText(), pass);\n \n //return to the login page;\n Parent root = FXMLLoader.load(getClass().getResource(\"/studentenrollment/FXMLDocument.fxml\"));\n Scene scene = new Scene(root);\n Stage appStage = (Stage) ((Node) event.getSource()).getScene().getWindow();\n appStage.setScene(scene);\n appStage.show();\n } \n else{\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Error\");\n alert.setHeaderText(\"\");\n alert.setContentText(\"Passwords not correct\");\n alert.showAndWait();\n }\n }",
"@Override\n public void actionPerformed(ActionEvent e)\n {\n String command = e.getActionCommand();\n if(command.equals(\"login\"))\n {\n String login = myLoginPanel.getLogin();\n char[] correctPassword = this.getPassword(login);\n if(correctPassword != null) {\n char[] typedPassword = myLoginPanel.getPassword();\n if (Arrays.equals(typedPassword, correctPassword)) {\n this.setVisible(false);\n Agent user = loadFromFile(myLoginPanel.getLogin());\n MainWindow myMainWindow = new MainWindow(null, user);\n saveToFile(user, myLoginPanel.getLogin());\n System.exit(0);\n } else {\n JOptionPane.showMessageDialog(null,\n \"Login or password incorrect. Please try again.\");\n myLoginPanel.clearGUIValues();\n }\n }\n }\n else if(command.equals(\"register\"))\n {\n // TODO : check if already existing\n RegisterAgentDialog myDialog = new RegisterAgentDialog(this);\n Agent agentReturned = myDialog.getAgentReturned();\n\n if(agentReturned != null)\n {\n agentReturned.generateID();\n saveToFile(agentReturned, myLoginPanel.getLogin());\n registerNewUser(myLoginPanel.getLogin(), myLoginPanel.getPassword());\n JOptionPane.showMessageDialog(null, \"Registration successful\");\n }\n else\n {\n JOptionPane.showMessageDialog(null, \"Registration cancelled\");\n }\n myLoginPanel.clearGUIValues();\n }\n }",
"public void login(){\r\n try{\r\n stmt = conn.createStatement();\r\n String userEmail = textEmail.getText();\r\n String userPass = textPassword.getText();\r\n String sql = \"SELECT * FROM admin WHERE mail= '\"+userEmail+\"' && password = '\"+ userPass+\"'\";\r\n rs = stmt.executeQuery(sql);\r\n if(rs.next()){\r\n String foundType = rs.getString(\"password\");\r\n System.out.println(foundType);\r\n }\r\n\r\n if(userEmail.equals(rs.getString(\"mail\")) && userPass.equals(rs.getString(\"password\"))){\r\n System.out.println(\"test1\");\r\n JOptionPane.showMessageDialog(null, \"Login Successful\");\r\n try {\r\n FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(\"home.fxml\"));\r\n Parent root1 = (Parent) fxmlLoader.load();\r\n Stage stage = new Stage();\r\n stage.setTitle(\"Home\");\r\n stage.setScene(new Scene(root1));\r\n stage.show();\r\n }catch (Exception e){\r\n JOptionPane.showMessageDialog(null,e);\r\n }\r\n }else{\r\n JOptionPane.showMessageDialog(null, \"Login failed\");\r\n dispose();\r\n }\r\n\r\n }catch(Exception e){\r\n JOptionPane.showMessageDialog(null,e);\r\n }\r\n\r\n ConnectionClass connectionClass=new ConnectionClass();\r\n\r\n }",
"public void actionPerformed(ActionEvent ae)\n {\n if(ae.getSource() == btnOK){\n login = textLogin.getText();\n passwd = texPasswd.getText();\n }\n dispose();\n\n }",
"@Override\r\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\r\n\t\t\tMySQLConnect dal = new MySQLConnect();\r\n\t\t\ttry {\r\n\t\t\t\tString name;\r\n\t\t\t\tString date;\r\n\t\t\t\tString desc;\r\n\t\t\t\tString course;\r\n\t\t\t\tString type;\r\n\t\t\t\tString prior;\r\n\t\t\t\tScanner scan = new Scanner(System.in);\r\n\t\t\t\tSystem.out.println(\"Name: \");\r\n\t\t\t\tname = scan.nextLine();\r\n\t\t\t\tSystem.out.println(\"Due Date(YYYY-MM-DD): \");\r\n\t\t\t\tdate = scan.nextLine();\r\n\t\t\t\tSystem.out.println(\"Description: \");\r\n\t\t\t\tdesc = scan.nextLine();\r\n\t\t\t\tSystem.out.println(\"Course: \");\r\n\t\t\t\tcourse = scan.nextLine();\r\n\t\t\t\tSystem.out.println(\"Type: \");\r\n\t\t\t\ttype = scan.nextLine();\r\n\t\t\t\tSystem.out.println(\"Priority: \");\r\n\t\t\t\tprior = scan.nextLine();\r\n\t\t\t\tSystem.out.println(\"The following form was added to the database:\");\r\n\t\t\t\tString[] check = dal.addForm(name.toString(),\"admin\",date.toString(),desc.toString(),course.toString(),type.toString(),prior.toString());\r\n\t\t\t\tfor(int i=0; i<check.length; i++){\r\n\t\t\t\t\tSystem.out.print(check[i] + \" \");\r\n\t\t\t\t}\r\n\t\t\t\t//test confirmation that button works\r\n\t\t\t\ttextArea.append(\"Form Submitted!\\n\");\r\n\t\t\t} catch (SQLException ex) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tlogin();\n\t\t\t}",
"private void btnLogInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLogInActionPerformed\n if(mngr!=null){\n if(mngr.LogIn(txtUsername.getText(), new String(txtPassword.getPassword()))){\n this.dispose();\n } else {\n JOptionPane.showConfirmDialog(this, \"Could not log you in. Check login, password or connection.\");\n }\n }\n }",
"public NewUserPanel() throws Exception {\n\t\tdatabase = new Database();\n\t\t\n\t\ttxtEmailAddress = new JTextField();\n\t\ttxtEmailAddress.setText(\"Email Address\");\n\t\ttxtEmailAddress.setColumns(10);\n\t\ttxtEmailAddress.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n txtEmailAddress.setText(\"\");\n }\n });\n\t\t\n\t\ttxtPassword = new JTextField();\n\t\ttxtPassword.setText(\"Password\");\n\t\ttxtPassword.setColumns(10);\n\t\ttxtPassword.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtPassword.setText(\"\");\n }\n });\n\t\t\n\t\ttxtConfirmPassword = new JTextField();\n\t\ttxtConfirmPassword.setText(\"Confirm Password\");\n\t\ttxtConfirmPassword.setColumns(10);\n\t\ttxtConfirmPassword.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtConfirmPassword.setText(\"\");\n }\n });\n\t\t\n\t\ttxtBirthdayxxxxxxxx = new JTextField();\n\t\ttxtBirthdayxxxxxxxx.setText(\"Birthday (YYYY-MM-DD)\");\n\t\ttxtBirthdayxxxxxxxx.setColumns(12);\n\t\ttxtBirthdayxxxxxxxx.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtBirthdayxxxxxxxx.setText(\"\");\n }\n });\n\t\t\n\t\ttxtDisplayName = new JTextField();\n\t\ttxtDisplayName.setText(\"Display Name\");\n\t\ttxtDisplayName.setColumns(10);\n\t\ttxtDisplayName.addMouseListener(new MouseAdapter(){\n @Override\n public void mouseClicked(MouseEvent e){\n \ttxtDisplayName.setText(\"\");\n }\n });\n\t\t\n\t\tJCheckBox chckbxMusicArtist = new JCheckBox(\"Music Artist\");\n\t\t\n\t\tJCheckBox chckbxProducer = new JCheckBox(\"Producer\");\n\t\t\n\t\tJButton btnNext = new JButton(\"Next ->\");\n\t\tbtnNext.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) { \n\t\t\t //Check booleans\n\t\t\t\tif (chckbxMusicArtist.isSelected() && !chckbxProducer.isSelected()) {\n\t\t\t\t\t//Music artist only\n\t\t\t\t\tString recordCompany = JOptionPane.showInputDialog(getParent(),\n\t\t\t\t\t\t \"Who is your record company? (Leave blank if not signed).\");\n\t\t\t\t\t\n\t\t\t\t\tString password = txtPassword.getText();\n\t\t\t\t\tString copyPassword = txtConfirmPassword.getText();\n\t\t\t\t\tif (password.equals(copyPassword)) {\n\t\t\t\t\t\t// Creating normal user\n\t\t\t\t\t\tString email = txtEmailAddress.getText();\n\t\t\t\t\t\tString displayName = txtDisplayName.getText();\n\t\t\t\t\t\tString dob = txtBirthdayxxxxxxxx.getText();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\tPreparedStatement insert = con.prepareStatement(\"INSERT INTO User VALUES ('\"+email+\"', '\"+password+\"', '\"+displayName+\"', '\"+ dob +\"');\");\t\t\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\n\t\t\t\t\t\t} catch (Exception error) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPreparedStatement insertArt = con.prepareStatement(\"INSERT INTO Artist VALUES ('\" + email + \"', '\" + recordCompany + \"');\");\n\t\t\t\t\t\t\tinsertArt.executeUpdate();\n\t\t\t\t\t\t\t// Display Finished Screen\n\t\t\t\t\t\t\tFinishedNewUserPanel finish = new FinishedNewUserPanel();\n\t\t\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\t\t\tframe.setContentPane(finish);\n\t\t\t\t\t\t\tframe.repaint();\n\t\t\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t\t\t} catch (Exception error) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(getParent(),\n\t\t\t\t\t\t\t \"Passwords do not match.\");\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} else if (!chckbxMusicArtist.isSelected() && chckbxProducer.isSelected()) {\n\t\t\t\t\t//Producer only\n\t\t\t\t\tString companyName = JOptionPane.showInputDialog(getParent(),\n\t\t\t\t\t\t \"What is your company name?\");\n\t\t\t\t\tString contactInfo = JOptionPane.showInputDialog(getParent(), \n\t\t\t\t\t\t\t\"Contact Information?\");\n\t\t\t\t\t\n\t\t\t\t\tString password = txtPassword.getText();\n\t\t\t\t\tString copyPassword = txtConfirmPassword.getText();\n\t\t\t\t\tif (password.equals(copyPassword)) {\n\t\t\t\t\t\t// Creating normal user\n\t\t\t\t\t\tString email = txtEmailAddress.getText();\n\t\t\t\t\t\tString displayName = txtDisplayName.getText();\n\t\t\t\t\t\tString dob = txtBirthdayxxxxxxxx.getText();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\tPreparedStatement insert = con.prepareStatement(\"INSERT INTO User VALUES ('\"+email+\"', '\"+password+\"', '\"+displayName+\"', '\"+ dob +\"');\");\t\t\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} catch (Exception error) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tPreparedStatement insertPro = con.prepareStatement(\"INSERT INTO Producer VALUES ('\" + email + \"', '\" + companyName + \"', '\" + contactInfo + \"');\");\n\t\t\t\t\t\t\tinsertPro.executeUpdate();\n\t\t\t\t\t\t\t// Display Finished Screen\n\t\t\t\t\t\t\tFinishedNewUserPanel finish = new FinishedNewUserPanel();\n\t\t\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\t\t\tframe.setContentPane(finish);\n\t\t\t\t\t\t\tframe.repaint();\n\t\t\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t\t\t} catch (Exception error) {\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(getParent(),\n\t\t\t\t\t\t\t \"Passwords do not match.\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else if (chckbxMusicArtist.isSelected() && chckbxProducer.isSelected()) {\n\t\t\t\t\t//Both\n\t\t\t\t\tJOptionPane.showMessageDialog(getParent(), \"Cannot be both a artist and a producer\");\n\t\t\t\t} else {\n\t\t\t\t\t//None\n\t\t\t\t\tString password = txtPassword.getText();\n\t\t\t\t\tString copyPassword = txtConfirmPassword.getText();\n\t\t\t\t\tif (password.equals(copyPassword)) {\n\t\t\t\t\t\t// Creating normal user\n\t\t\t\t\t\tString email = txtEmailAddress.getText();\n\t\t\t\t\t\tString displayName = txtDisplayName.getText();\n\t\t\t\t\t\tString dob = txtBirthdayxxxxxxxx.getText();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tConnection con = database.getConnection();\n\t\t\t\t\t\t\tPreparedStatement insert = con.prepareStatement(\"INSERT INTO User VALUES ('\"+email+\"', '\"+password+\"', '\"+displayName+\"', '\"+ dob +\"');\");\t\t\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\tinsert.executeUpdate();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Display Finished Screen\n\t\t\t\t\t\t\tFinishedNewUserPanel finish = new FinishedNewUserPanel();\n\t\t\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\t\t\tframe.setContentPane(finish);\n\t\t\t\t\t\t\tframe.repaint();\n\t\t\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t\t\t} catch (Exception error) {\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(getParent(),\n\t\t\t\t\t\t\t\t \"This email address has already been registered!\");\n\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(getParent(),\n\t\t\t\t\t\t\t \"Passwords do not match.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tJLabel lblNewUser = new JLabel(\"New User\");\n\t\t\n\t\tJButton button = new JButton(\"<- Back\");\n\t\tbutton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) { \n\t\t\t //Return back to Login Screen\n\t\t\t\tLoginPanel back;\n\t\t\t\ttry {\n\t\t\t\t\tback = new LoginPanel();\n\t\t\t\t\tJFrame frame = (JFrame) getTopLevelAncestor();\n\t\t\t\t\tframe.setContentPane(back);\n\t\t\t\t\tframe.repaint();\n\t\t\t\t\tframe.printAll(frame.getGraphics());\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t\t\n\t\tGroupLayout groupLayout = new GroupLayout(this);\n\t\tgroupLayout.setHorizontalGroup(\n\t\t\tgroupLayout.createParallelGroup(Alignment.TRAILING)\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t.addContainerGap(230, Short.MAX_VALUE)\n\t\t\t\t\t.addComponent(button)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addComponent(btnNext)\n\t\t\t\t\t.addContainerGap())\n\t\t\t\t.addGroup(Alignment.LEADING, groupLayout.createSequentialGroup()\n\t\t\t\t\t.addGap(35)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addComponent(lblNewUser)\n\t\t\t\t\t\t.addComponent(chckbxProducer)\n\t\t\t\t\t\t.addComponent(chckbxMusicArtist)\n\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)\n\t\t\t\t\t\t\t.addComponent(txtDisplayName, Alignment.LEADING)\n\t\t\t\t\t\t\t.addComponent(txtBirthdayxxxxxxxx, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 252, Short.MAX_VALUE)\n\t\t\t\t\t\t\t.addComponent(txtConfirmPassword, Alignment.LEADING)\n\t\t\t\t\t\t\t.addComponent(txtPassword, Alignment.LEADING)\n\t\t\t\t\t\t\t.addComponent(txtEmailAddress, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 371, GroupLayout.PREFERRED_SIZE)))\n\t\t\t\t\t.addContainerGap(44, Short.MAX_VALUE))\n\t\t);\n\t\tgroupLayout.setVerticalGroup(\n\t\t\tgroupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t.addGap(20)\n\t\t\t\t\t.addComponent(lblNewUser)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addComponent(txtEmailAddress, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)\n\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t\t\t.addComponent(txtPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(txtConfirmPassword, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(txtBirthdayxxxxxxxx, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(txtDisplayName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(chckbxMusicArtist)\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED)\n\t\t\t\t\t\t\t.addComponent(chckbxProducer)\n\t\t\t\t\t\t\t.addContainerGap(36, Short.MAX_VALUE))\n\t\t\t\t\t\t.addGroup(groupLayout.createSequentialGroup()\n\t\t\t\t\t\t\t.addPreferredGap(ComponentPlacement.RELATED, 189, Short.MAX_VALUE)\n\t\t\t\t\t\t\t.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t\t\t.addComponent(btnNext)\n\t\t\t\t\t\t\t\t.addComponent(button))\n\t\t\t\t\t\t\t.addContainerGap())))\n\t\t);\n\t\tsetLayout(groupLayout);\n\n\t}",
"private void LoginAction() {\n\t\tsubmit.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent e) \n\t\t\t{\n\t\t\t\tif (username.getText().isEmpty() || password.getPassword().length == 0) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"All fields have not been entered.\", \"Oops! Please Try Again\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(myController.login(username.getText(), String.valueOf(password.getPassword())))\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"We login\");\n\t\t\t\t\t\tmyController.showHomePage();\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, \"The username and password do not match an account.\", \"Login Error\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\telse if (username.getText().equalsIgnoreCase(\"User\") && Arrays.equals(password.getPassword(), new char[]{'u','s','e','r','p','w','d'})) {\n//\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Logged in as a USER!\", \"Success!\", JOptionPane.PLAIN_MESSAGE);\n//\t\t\t\t\t\n//\t\t\t\t} else if (username.getText().equalsIgnoreCase(\"Judge\") && Arrays.equals(password.getPassword(), new char[]{'j','u','d','g','e','p','w','d'})) {\n//\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Logged in as a Judge!\", \"Success!\", JOptionPane.PLAIN_MESSAGE);\n//\t\t\t\t\n//\t\t\t\t} else if (username.getText().equalsIgnoreCase(\"Admin\") && Arrays.equals(password.getPassword(), new char[]{'a','d','m','i','n','p','w','d'})) {\n//\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Logged in as an Admin!\", \"Success!\", JOptionPane.PLAIN_MESSAGE);\n//\t\t\t\t\n//\t\t\t\t} else {\n//\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Incorrect Login.\", \"Oops! Please Try Again\", JOptionPane.ERROR_MESSAGE);\n//\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}",
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tUserLoginPage userloginpanel = new UserLoginPage();\n\t\t\t\t\tuserloginpanel.login.addActionListener(new ActionListener() {\n\t\t\t\t\t\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tDatabaseMethods DB = new DatabaseMethods();\n\t\t\t\t\t\t\tArrayList<User> usrarray = DB.ReadUser();\n\t\t\t\t\t\t\tArrayList<Admin> adminarray = DB.ReadAdmin();\n\t\t\t\t\t\t\tfor(User u:usrarray) {\n\t\t\t\t\t\t\t\t//System.out.println(u.getUserName().equals(login.psw.getPassword()) + \" \" + u.getPassword() + \" \" + new String(login.psw.getPassword()));\n\t\t\t\t\t\t\t\tif(u.getUserName().equals(userloginpanel.usr_name.getText()) && u.getPassword().equals(new String(userloginpanel.psw.getPassword()))) {\n\t\t\t\t\t\t\t\t\tuserloginpanel.frame.setVisible(false);\n\t\t\t\t\t\t\t\t\tex.setuser(u);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor(Admin a:adminarray){\n\t\t\t\t\t\t\t\tif(a.getAdminName().equals(userloginpanel.usr_name.getText()) && a.getPassword().equals(new String(userloginpanel.psw.getPassword()))) {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"admin\");\n\t\t\t\t\t\t\t\t\tuserloginpanel.frame.setVisible(false);\n\t\t\t\t\t\t\t\t\tex.sidebar.admin_button.setVisible(true);\n\t\t\t\t\t\t\t\t\t//ex.repaint();\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}",
"public void tryLoginAgain(){\n\t\tnameField.setText(\"\");\n\t\trollField.setText(\"\");\n\t\tseatField.setText(\"\");\n\t\tnameField.repaint();\n\t\tseatField.repaint();\n\t\trollField.repaint();\n\t\tclearErrors();\n\t\tmainDialog.dispose();\t\t\n\t}",
"private void button1ActionPerformed(ActionEvent e) throws InterruptedException, SQLException, ClassNotFoundException {\n // TODO add your code here\n try {\n controllerConnection.isConnected(textField1.getText(), passwordField1.getText());\n\n } catch (SQLException | ClassNotFoundException throwables) {\n throwables.printStackTrace();\n }\n if (controllerConnection.getIsConnect()) {\n try {\n controllerConnection.updateUser(getEmailActualUser());\n } catch (SQLException | ClassNotFoundException throwables) {\n throwables.printStackTrace();\n }\n int permission = controllerConnection.testPermission();\n switch (permission) {\n case 0 -> System.out.println(\"Erreur - Permission non reconnu\");\n case 1 -> {\n root.setVisible(false);\n AdminView adminView = new AdminView(controllerConnection, true);\n }\n case 2 -> {\n root.setVisible(false);\n\n AdminView adminView = new AdminView(controllerConnection, false);\n }\n case 3 -> {\n root.setVisible(false);\n\n TeacherView teacherView = new TeacherView(controllerConnection);}\n case 4 ->{\n root.setVisible(false);\n StudentView studentView = new StudentView(controllerConnection);}\n }\n }\n\n if(controllerConnection.getIsIdFaild()){\n IdFail.setVisible(true);\n controllerConnection.idFailed =false;\n }\n }",
"@Override\n public void actionPerformed(ActionEvent e) { // Acionado qnd aperta ENTER\n String string = \"\";\n // Fechar janela de login\n setVisible(false);\n\n String usuario = textField.getText();\n String senha = passwordField.getText();\n\n // Usuário pressionou ENTER no JTextField textField[0]\n if (e.getSource() == textField || e.getSource() == passwordField) {\n if (usuario.equals(\"Daniel\")) {\n if (senha.equals(\"Daniel21\")) {\n JOptionPane.showMessageDialog(null, \"Entrou no sistema!\", \"Usuário: \" + usuario,\n JOptionPane.INFORMATION_MESSAGE);\n } else {\n JOptionPane.showMessageDialog(null, \"Senha Incorreta!\", \"ERRO\", JOptionPane.ERROR_MESSAGE);\n }\n } else {\n JOptionPane.showMessageDialog(null, \"Usuário Inválido!\", \"ERRO\", JOptionPane.ERROR_MESSAGE);\n }\n }\n\n // mostrar janela de login\n setVisible(true);\n }"
] | [
"0.7803722",
"0.74513924",
"0.7358654",
"0.73543227",
"0.7280049",
"0.7230355",
"0.7224267",
"0.70963067",
"0.7080422",
"0.70742446",
"0.7014132",
"0.698908",
"0.6908467",
"0.6903532",
"0.6883872",
"0.6825722",
"0.6814023",
"0.6780829",
"0.67782503",
"0.6758465",
"0.6743642",
"0.6740409",
"0.6738304",
"0.6692865",
"0.6690482",
"0.6688374",
"0.66828966",
"0.6678207",
"0.6668745",
"0.66682994",
"0.6666511",
"0.6665525",
"0.66561234",
"0.6641181",
"0.6641059",
"0.66313094",
"0.6622822",
"0.6617936",
"0.6611675",
"0.65978193",
"0.6596386",
"0.6584696",
"0.65593493",
"0.65458935",
"0.6544726",
"0.6526352",
"0.6508253",
"0.6506891",
"0.6505323",
"0.6502348",
"0.64970666",
"0.6494491",
"0.6478901",
"0.6468913",
"0.64570326",
"0.6419727",
"0.6417909",
"0.6416743",
"0.64131606",
"0.6390744",
"0.6389369",
"0.63893455",
"0.6381557",
"0.63814914",
"0.6380105",
"0.63655704",
"0.6353683",
"0.63443094",
"0.6337197",
"0.63361967",
"0.6320904",
"0.6308646",
"0.62911177",
"0.62837815",
"0.6270024",
"0.62610805",
"0.6258177",
"0.6255639",
"0.62498444",
"0.623229",
"0.6230848",
"0.6230468",
"0.6222662",
"0.62215674",
"0.62187624",
"0.6214332",
"0.6200057",
"0.6196477",
"0.6186421",
"0.6183124",
"0.6178603",
"0.61696464",
"0.6168973",
"0.616646",
"0.61611164",
"0.615736",
"0.6138555",
"0.6135483",
"0.6128982",
"0.61200726",
"0.6117217"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void run(String... args) throws Exception {
this.userBalanceRepository.save(UserBalance.builder().balance(5000).build())
.subscribe(System.out::println);
} | {
"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 |
Created by fengyue on 2017/3/28. | public interface SalesLeadsService {
String insertSalesLeads(SalesLeadsEntity salesLeads);
SalesLeadsQuery getSalesLeadsPage(SalesLeadsQuery salesLeadsQuery);
SalesLeadsEntity getSalesLeadsById(String id);
void deleteSalesLeadsById(String id);
void batchDeleteSalesLeads(List<String> ids);
void updateSalesLeads(SalesLeadsEntity salesLeads);
void batchDelete(String idArr);
void batchTransfer(String idArr);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"private stendhal() {\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 comer() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@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 public void init() {\n\n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"private void poetries() {\n\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public final void mo51373a() {\n }",
"@Override\n void init() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n public void init() {\n }",
"public void mo38117a() {\n }",
"@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}",
"private void init() {\n\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void nghe() {\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}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"private void strin() {\n\n\t}",
"@Override\n protected void getExras() {\n }",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n public void init() {}",
"@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 jugar() {\n\t\t\n\t}",
"private void kk12() {\n\n\t}",
"private void m50366E() {\n }",
"@Override\n protected void init() {\n }",
"public void mo6081a() {\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void einkaufen() {\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 }",
"private void init() {\n\n\n\n }",
"@Override\r\n\tpublic void init() {}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"@Override\n public void initialize() { \n }",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tpublic void init() {\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"Petunia() {\r\n\t\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n public void initialize() {\n \n }",
"Constructor() {\r\n\t\t \r\n\t }",
"public void mo55254a() {\n }",
"protected boolean func_70814_o() { return true; }",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}",
"public Pitonyak_09_02() {\r\n }",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}"
] | [
"0.61761415",
"0.6061146",
"0.5854614",
"0.5854614",
"0.5853775",
"0.58519995",
"0.58090067",
"0.5766937",
"0.5728059",
"0.572198",
"0.57150227",
"0.5674275",
"0.5668796",
"0.5661588",
"0.5659858",
"0.56407595",
"0.5635373",
"0.562043",
"0.5619691",
"0.5617448",
"0.561743",
"0.56109667",
"0.55992365",
"0.5597113",
"0.5590938",
"0.5574777",
"0.5574777",
"0.5574777",
"0.5574777",
"0.5574777",
"0.55737555",
"0.5562263",
"0.55584204",
"0.5552831",
"0.55417234",
"0.5536116",
"0.55340374",
"0.5527353",
"0.5527353",
"0.55225503",
"0.5519968",
"0.5519968",
"0.55199265",
"0.5510157",
"0.5510157",
"0.5510157",
"0.5510157",
"0.5510157",
"0.5510157",
"0.5493985",
"0.5493985",
"0.5493985",
"0.5479912",
"0.5478634",
"0.5477409",
"0.5472983",
"0.54708457",
"0.54708457",
"0.54708457",
"0.546076",
"0.5449109",
"0.5449109",
"0.5449109",
"0.54459524",
"0.5441067",
"0.54387814",
"0.5430332",
"0.5428318",
"0.5428116",
"0.5428116",
"0.5419264",
"0.5413615",
"0.5413615",
"0.5413615",
"0.5413615",
"0.5413615",
"0.5413615",
"0.5413615",
"0.541229",
"0.540602",
"0.54038274",
"0.5401125",
"0.53846234",
"0.5377308",
"0.5373454",
"0.5373185",
"0.5371717",
"0.5366273",
"0.5361063",
"0.5355431",
"0.53420764",
"0.53239745",
"0.5310043",
"0.530191",
"0.5293456",
"0.52924514",
"0.52921987",
"0.5287285",
"0.5285714",
"0.5284717",
"0.5282988"
] | 0.0 | -1 |
Returns the command descriptor. | public abstract CommandDescriptor<T> getDescriptor(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getCommand(){\n return getCommand(null);\n }",
"public String getCommand()\r\n\t{\r\n\t\treturn command;\r\n\t}",
"public String getCommand() {\r\n return command;\r\n }",
"public String getCommand() {\n return command;\n }",
"public String getCommand() {\n return command;\n }",
"public int getCommand() {\n return command_;\n }",
"public String getCommand() {\n\n return command;\n }",
"public int getCommand() {\n return command_;\n }",
"public String getCommand() {\n return this.command;\n }",
"public java.lang.String getCommand() {\n java.lang.Object ref = command_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n command_ = s;\n }\n return s;\n }\n }",
"public int getCommand()\n\t{\n\t\treturn this.command;\n\t}",
"public String getCommand() { return command; }",
"public String getCmd() {\r\n return cmd;\r\n }",
"java.lang.String getCommand();",
"@Override\r\n\tpublic String getCOMMAND() {\n\t\treturn COMMAND;\r\n\t}",
"public String Command() {\n\treturn command;\n }",
"String getCommand();",
"public java.lang.String getCommand() {\n java.lang.Object ref = command_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n command_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public int getCmd() {\n return cmd_;\n }",
"@Override\n public final Command getCommand() {\n return commandIdentifier;\n }",
"public int getCmd() {\n return cmd_;\n }",
"MBeanInfo getCommandDescription(String commandType);",
"public String getCommand(){\n return command;\n }",
"@JsonIgnore\n\tdefault short getCmd() {\n\t\tMessageMeta annotation = getClass().getAnnotation(MessageMeta.class);\n\t\tif (annotation != null) {\n\t\t\treturn annotation.cmd();\n\t\t}\n\t\treturn 0;\n\t}",
"public int getCommand() {\r\n\t\tif(this.command == null){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn this.command.ordinal();\r\n\t}",
"@Override\n\tpublic String getCommand() {\n\t\treturn model.getCommand();\n\t}",
"public String \n getCommand() \n {\n return pCommand;\n }",
"String getDescriptor();",
"com.google.protobuf.ByteString\n getCommandBytes();",
"int getCmd();",
"final public String getActionCommand() {\n return command;\n }",
"int getCommand();",
"public CommandManager getCommand() {\n\treturn command;\n }",
"public String getDescriptor() {\n/* 218 */ return this.desc;\n/* */ }",
"public com.google.protobuf.ByteString\n getCommandBytes() {\n java.lang.Object ref = command_;\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 command_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public Command getCommand() {\n\t\treturn redCom;\n\t}",
"public byte getCmd() {\n return this.btCmd;\n }",
"public com.google.protobuf.ByteString\n getCommandBytes() {\n java.lang.Object ref = command_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n command_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public Descriptor getDescriptor()\n\t{\n\t\treturn Descriptor.fromNumber( mMessage.getInt( B1_DESCRIPTOR ) );\n\t}",
"public String getCommand() {\n\t\tString[] lines = commandLine.getText().split(\"\\n\");\n\t\treturn lines[commandLine.getLineCount() - 2];\n\t}",
"public abstract String getCommand();",
"public String getOriginalCommand() {\n return command;\n }",
"public String getToolCommand();",
"public EventType getCommand(){\n return this.command;\n }",
"public ModuleDescriptor getDescriptor() {\n return descriptor;\n }",
"public network.message.PlayerResponses.Command getCommand() {\n if (commandBuilder_ == null) {\n if (responseCase_ == 2) {\n return (network.message.PlayerResponses.Command) response_;\n }\n return network.message.PlayerResponses.Command.getDefaultInstance();\n } else {\n if (responseCase_ == 2) {\n return commandBuilder_.getMessage();\n }\n return network.message.PlayerResponses.Command.getDefaultInstance();\n }\n }",
"List<String> getCommandDescription();",
"public final Descriptor getDescriptor() throws MdsException {\n return Descriptor.deserialize(this.getBuffer());\n }",
"public CommandValue getCommand() {\n\t\treturn value;\n\t}",
"public ProtocolCommandSupport getCommandSupport() {\n return this._commandSupport_;\n }",
"public EntityDescriptor getDescriptor() {\n return descriptor;\n }",
"public String getCommandKey()\n\t{\n\t\treturn commandKey;\n\t}",
"public Command getCurrentCommand();",
"public CommandInfo getInfo() {\n\t\treturn info;\n\t}",
"@Override\n\tpublic String toString() {\n\t\treturn CMD_NAME;\n\t}",
"@Override\n\tpublic DescriptorImpl getDescriptor() {\n\t\treturn (DescriptorImpl) super.getDescriptor();\n\t}",
"public Command getCreateCommand() {\n\t\treturn null;\n\t}",
"public Command commandType() {\r\n if (command.startsWith(\"push\")) {\r\n return Command.C_PUSH;\r\n } else if (command.startsWith(\"pop\")) {\r\n return Command.C_POP;\r\n } else if (isArithmeticCmd()) {\r\n return Command.C_ARITHMETIC;\r\n } else if (command.startsWith(\"label\")) {\r\n return Command.C_LABEL;\r\n } else if (command.startsWith(\"goto\")) {\r\n return Command.C_GOTO;\r\n } else if (command.startsWith(\"if-goto\")) {\r\n return Command.C_IF;\r\n } else if (command.startsWith(\"function\")) {\r\n return Command.C_FUNCTION;\r\n } else if (command.startsWith(\"call\")) {\r\n return Command.C_CALL;\r\n } else if (command.startsWith(\"return\")) {\r\n return Command.C_RETURN;\r\n } else {\r\n return null;\r\n }\r\n }",
"public Descriptor<Builder> getDescriptor() {\n return DESCRIPTOR;\n }",
"@Override\n public String toString() {\n return (\"Command \" + this.getCommandName().toUpperCase() + \":\\n\" + this\n .commandDocumentation());\n }",
"public network.message.PlayerResponses.Command getCommand() {\n if (responseCase_ == 2) {\n return (network.message.PlayerResponses.Command) response_;\n }\n return network.message.PlayerResponses.Command.getDefaultInstance();\n }",
"public Pit getCommandPit();",
"public ClassDescriptor getDescriptor() {\n return descriptor;\n }",
"@Override\n public DescriptorImpl getDescriptor() {\n return (DescriptorImpl) super.getDescriptor();\n }",
"@Override\n public DescriptorImpl getDescriptor() {\n return (DescriptorImpl) super.getDescriptor();\n }",
"@Override\n public DescriptorImpl getDescriptor() {\n return (DescriptorImpl)super.getDescriptor();\n }",
"@Override\n public DescriptorImpl getDescriptor() {\n return (DescriptorImpl)super.getDescriptor();\n }",
"public String getCommandReturned() {\n return commandReturned;\n }",
"public final String\r\n getDescriptor() {\r\n if (this.descriptorCache != null) return this.descriptorCache;\r\n return (this.descriptorCache = this.getDescriptor2());\r\n }",
"public int getActionCommand() {\n return actionCommand_;\n }",
"public String readCommand() {\n return scanner.nextLine();\n }",
"String getCommandId();",
"public String getUserCommand();",
"public ServerInfo commandInterface()\n {\n return command_stub;\n }",
"public CommandPackage getCommandPackage() {\n return commandPackage;\n }",
"public int getActionCommand() {\n return actionCommand_;\n }",
"public UtfConstant getDescriptor()\n {\n return m_descriptor;\n }",
"com.google.protobuf.ByteString\n getCommandNameBytes();",
"public network.message.PlayerResponses.CommandOrBuilder getCommandOrBuilder() {\n if ((responseCase_ == 2) && (commandBuilder_ != null)) {\n return commandBuilder_.getMessageOrBuilder();\n } else {\n if (responseCase_ == 2) {\n return (network.message.PlayerResponses.Command) response_;\n }\n return network.message.PlayerResponses.Command.getDefaultInstance();\n }\n }",
"protected EntityDescriptor getDescriptor() {\n if (descriptor == null) {\n descriptor = mixing.getDescriptor(type);\n }\n return descriptor;\n }",
"public byte[] getDescriptor()\n {\n return (byte[]) this.m_descriptor.clone();\n }",
"public network.message.PlayerResponses.CommandOrBuilder getCommandOrBuilder() {\n if (responseCase_ == 2) {\n return (network.message.PlayerResponses.Command) response_;\n }\n return network.message.PlayerResponses.Command.getDefaultInstance();\n }",
"public Command getCommand() {\n String userInput = in.nextLine();\n String[] words = userInput.split(\" \", 2);\n try {\n return new Command(words[0].toLowerCase(), words[1]);\n } catch (ArrayIndexOutOfBoundsException e) {\n return new Command(words[0].toLowerCase(), Command.BLANK_DESCRIPTION);\n }\n }",
"Optional<String> command();",
"public String getCommand(CreateProcedure cmd)\n throws DDLException\n {\n Map cprops;\n if (format == null) throw new DDLException(NbBundle.getBundle(\"org.netbeans.lib.ddl.resources.Bundle\").getString(\"EXC_NoFormatSpec\")); // NOI18N\n try {\n cprops = getColumnProperties(cmd);\n return CommandFormatter.format(format, cprops);\n } catch (Exception e) {\n throw new DDLException(e.getMessage());\n }\n }",
"java.lang.String getCommandName();",
"CommandsFactory getCommandsFactory();",
"Command createCommand();",
"public final Class getDescriptorClass() {\n\treturn descriptorClass;\n }",
"public java.lang.String getCommand(int index) {\n return command_.get(index);\n }",
"public String getCommandClass() {\n\treturn className;\n }",
"public java.lang.String getCommand(int index) {\n return command_.get(index);\n }",
"public String getDescriptor() {\n // FIXME: this is not completely accurate at this point (for\n // example, it knows nothing about the packages for compound\n // types)\n if (clazz != null) {\n return descriptor(clazz);\n }\n if (elementType != null) {\n if(elementType.getName()==null) {\n throw new RuntimeException(\"elementType.name is null: \"+getDumpString());\n }\n return \"[\" + descriptor(elementType.getName());\n }\n return descriptor(name);\n }",
"public AbstractCommand getCommand(HttpServletRequest request) {\n LOGGER.info(\"request key is \" + request.getMethod() + request.getPathInfo());\n String method = request.getMethod();\n String pathInfo = request.getPathInfo();\n return command.get(method + pathInfo);\n }",
"public final MethodDescriptor\r\n getDescriptor() throws CompileException {\r\n if (this.descriptorCache != null) return this.descriptorCache;\r\n return (this.descriptorCache = this.getDescriptor2());\r\n }",
"public abstract String commandDocumentation();",
"Commands getCommandes();",
"public Map<String, String> getCommands() {\n return commands;\n }",
"@Override\n public java.lang.String getServiceCmd() {\n java.lang.Object ref = serviceCmd_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n serviceCmd_ = s;\n }\n return s;\n }\n }",
"protected abstract Command getCreateCommand(CreateRequest request);"
] | [
"0.7277997",
"0.7229507",
"0.71709156",
"0.7141714",
"0.7141714",
"0.7136182",
"0.7116684",
"0.7071541",
"0.70562446",
"0.70560586",
"0.70532644",
"0.70240986",
"0.70169455",
"0.701622",
"0.70063674",
"0.6947252",
"0.694647",
"0.6930878",
"0.6929475",
"0.6884333",
"0.6883383",
"0.68476206",
"0.6834819",
"0.67860377",
"0.6781649",
"0.67809844",
"0.67571884",
"0.67513883",
"0.6742966",
"0.6732646",
"0.6695074",
"0.66943115",
"0.6659482",
"0.6634263",
"0.66222113",
"0.6619697",
"0.66060466",
"0.66019773",
"0.655421",
"0.65343904",
"0.651694",
"0.6488857",
"0.6457459",
"0.63827693",
"0.6375728",
"0.63480806",
"0.6322859",
"0.63212866",
"0.63212836",
"0.6320997",
"0.6319098",
"0.6314077",
"0.6307853",
"0.62963414",
"0.6293173",
"0.62791914",
"0.62624836",
"0.6254668",
"0.62524813",
"0.6223712",
"0.6209317",
"0.61981475",
"0.6197229",
"0.61549824",
"0.61549824",
"0.6144647",
"0.6144647",
"0.6132812",
"0.6130648",
"0.6124882",
"0.6078944",
"0.6049237",
"0.6046328",
"0.60413736",
"0.6023704",
"0.60232365",
"0.6014417",
"0.5993024",
"0.59844595",
"0.5958517",
"0.59403515",
"0.59395725",
"0.593762",
"0.5926632",
"0.5911346",
"0.59000975",
"0.58969474",
"0.589115",
"0.58799654",
"0.5878885",
"0.58758503",
"0.587321",
"0.58650154",
"0.5861025",
"0.5826433",
"0.5802065",
"0.5796121",
"0.5795302",
"0.57866544",
"0.57681113"
] | 0.81790674 | 0 |
Returns a completer for this command. | protected abstract Completer getCompleter(RuntimeContext context) throws CommandException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final CountedCompleter<?> getCompleter()\n/* */ {\n/* 499 */ return this.completer;\n/* */ }",
"Completable getCompletable();",
"public abstract CommandDescriptor<T> getDescriptor();",
"private String completeBuffer(String buf, ConsoleEditor editor) {\n buf = StringUtils.trimFront(buf);\n if (buf.isEmpty()) {\n return \"\";\n }\n\n editor.completionList.clear();\n\n if (buf.contains(\" \")) {\n StringUtils.tokenize(buf, arguments);\n\n assert (arguments.size() > 1);\n\n // Find the command and call its completion func\n String arg0 = arguments.get(0);\n ConsoleCmd cmd = cmdList.get(arg0);\n IConsoleCompleter complete = null;\n if (cmd != null) {\n if (cmd.isCallable(false)) {\n complete = cmd;\n }\n } else {\n CVar cvar = cvarList.get(arguments.get(0));\n if (cvar != null && cvar.isVisible(false)) {\n complete = cvar.getCompleter();\n }\n }\n if (complete != null) {\n String arg = arguments.size() > 1 ? arguments.get(1) : \"\";\n complete.complete(arg, editor.completionList);\n if (!editor.completionList.isEmpty()) {\n String base = arg0 + \" \";\n for (int i = 0; i < editor.completionList.size(); i++) {\n editor.completionList.set(i, base + editor.completionList.get(i));\n }\n }\n }\n } else {\n cmdCompleter.complete(buf, editor.completionList);\n cvarCompleter.complete(buf, editor.completionList);\n }\n if (editor.completionList.isEmpty()) {\n return buf;\n }\n\n int numEntries = editor.completionList.size();\n\n // Only one option, so return it straight\n if (numEntries == 1) {\n return editor.completionList.get(0);\n }\n\n // Convert to lowercase for faster comparison, then strip the input and calculate the shortest length\n int shortest = 1023;\n String lowerBuf = buf.toLowerCase();\n editor.completionListLower.clear();\n int i;\n for (i = 0; i < numEntries; i++) {\n String s = StringUtils.stripFrontOnce(editor.completionList.get(i).toLowerCase(), lowerBuf);\n editor.completionListLower.add(s);\n if (s.length() < shortest) {\n shortest = s.length();\n }\n }\n\n String returnValue = editor.completionList.get(0);\n if (shortest == 0) {\n returnValue = returnValue.substring(0, buf.length());\n } else {\n // Find the first not matching char\n int pos;\n String firstStr = editor.completionListLower.get(0);\n for (pos = 0; pos < shortest; pos++) {\n // Check if all chars at this position match\n for (i = 1; i < numEntries; i++) {\n if (StringUtils.cmpn(firstStr, editor.completionListLower.get(i), pos) != 0) {\n break;\n }\n }\n // One did not match\n if (i < numEntries) {\n break;\n }\n }\n returnValue = returnValue.substring(0, buf.length() + pos - 1);\n }\n\n return returnValue;\n }",
"public Command getAutonomousCommand() \n {\n switch (m_autoChooser.getSelected())\n {\n case \"default\":\n return null;\n case \"test\":\n return new CommandGroupTemplate();\n case \"three_ball_forward\":\n return new AutonomousThreeBall(1, 2.0);\n case \"three_ball_backward\":\n return new AutonomousThreeBall(-1, 3.0);\n case \"six_ball\":\n return new AutonomousSixBall();\n default:\n System.out.println(\"\\nError selecting autonomous command:\\nCommand selected: \" + m_autoChooser.getSelected() + \"\\n\");\n return null;\n }\n }",
"@Override\n public final Command getCommand() {\n return commandIdentifier;\n }",
"public Command getCommand() {\n\t\treturn redCom;\n\t}",
"public CommandManager getCommand() {\n\treturn command;\n }",
"public interface AutoCompleter {\n \n /** Sets the callback that will be notified when items are selected. */\n void setAutoCompleterCallback(AutoCompleterCallback callback);\n\n /** \n * Sets the new input to the autocompleter. This can change what is\n * currently visible as suggestions.\n * \n * The returned Future returns true if the lookup for autocompletions\n * completed succesfully. True does not indicate autocompletions are\n * available. It merely indicates that the lookup completed.\n * \n * Because AutoCompleters are allowed to be asynchronous, one should\n * use Future.get or listen to the future in order to see when\n * the future has completed.\n */\n ListeningFuture<Boolean> setInput(String input);\n\n /**\n * Returns true if any autocomplete suggestions are currently available, based the data\n * that was given to {@link #setInput(String)}.\n */\n boolean isAutoCompleteAvailable();\n\n /** Returns a component that renders the autocomplete items. */\n JComponent getRenderComponent();\n\n /** Returns the currently selected string. */\n String getSelectedAutoCompleteString();\n\n /** Increments the selection. */\n void incrementSelection();\n \n /** Decrements the selection. */\n void decrementSelection();\n \n /** A callback for users of autocompleter, so they know when items have been suggested. */\n public interface AutoCompleterCallback {\n /** Notification that an item is suggested. */\n void itemSuggested(String autoCompleteString, boolean keepPopupVisible, boolean triggerAction);\n }\n\n}",
"public Command getCurrentCommand();",
"public @NonNull CommandManager<C> getCommandManager() {\n return this.commandManager;\n }",
"public String getCommand(){\n return getCommand(null);\n }",
"public ProtocolCommandSupport getCommandSupport() {\n return this._commandSupport_;\n }",
"public CompletionProvider createCommentCompletionProvider() {\n\t\tDefaultCompletionProvider cp = new DefaultCompletionProvider();\n\t\tcp.addCompletion(new BasicCompletion(cp, \"TODO:\", \"A to-do reminder\"));\n\t\tcp.addCompletion(new BasicCompletion(cp, \"FIXME:\", \"A bug that needs to be fixed\"));\n\t\treturn cp;\n\t}",
"public CompletionProvider createCompletionProvider() {\n\n\t\t// Create the provider used when typing code.\n\t\tCompletionProvider codeCP = createCodeCompletionProvider();\n\n\t\t// The provider used when typing a string.\n\t\tCompletionProvider stringCP = createStringCompletionProvider();\n\n\t\t// The provider used when typing a comment.\n\t\tCompletionProvider commentCP = createCommentCompletionProvider();\n\n\t\t// Create the \"parent\" completion provider.\n\t\tLanguageAwareCompletionProvider provider = new\n\t\t\t\t\t\t\t\tLanguageAwareCompletionProvider(codeCP);\n\t\tprovider.setStringCompletionProvider(stringCP);\n\t\tprovider.setCommentCompletionProvider(commentCP);\n\n\t\treturn provider;\n\n\t}",
"public static RollCommand getCommand() {\n\t\treturn INSTANCE;\n\t}",
"public Command getCreateCommand() {\n\t\treturn null;\n\t}",
"public CommandInvokedCallback getCommandInvokedCallback() {\n return commandInvokedCallback;\n }",
"@Override\n\tprotected Command createCommand() {\n\t\tList<Object> editparts = editor.getSelectionCache().getSelectionModelForType(MGraphicElement.class);\n\t\tif (editparts.isEmpty())\n\t\t\treturn null;\n\t\tJSSCompoundCommand command = new JSSCompoundCommand(null);\n\t\tfor(Object part : editparts){\n\t\t\tif (part instanceof MTextElement) {\n\t\t\t\tMTextElement textElement = (MTextElement)part;\n\t\t\t\tcommand.setReferenceNodeIfNull(textElement);\n\t\t\t\tLazyCreateTextFieldCommand createCommand = new LazyCreateTextFieldCommand(textElement);\n\t\t\t\tcommand.add(createCommand);\n\t\t\t}\n\t\t}\n\t\tif (command.isEmpty()) {\n\t\t\treturn null;\n\t\t}\n\t\treturn command;\n\t}",
"public CommandExecutorInterface getCommandExecutor() {\n\t\treturn commandExecutor;\n\t}",
"@Override\n public MyBusinessObjectDeleteCommand getDeleteCommand() {\n return new MyBusinessObjectDeleteCommand(this);\n }",
"private CompletionProvider createStringCompletionProvider() {\n\t\tDefaultCompletionProvider cp = new DefaultCompletionProvider();\n\t\tcp.addCompletion(new BasicCompletion(cp, \"%c\", \"char\", \"Prints a character\"));\n\t\tcp.addCompletion(new BasicCompletion(cp, \"%i\", \"signed int\", \"Prints a signed integer\"));\n\t\tcp.addCompletion(new BasicCompletion(cp, \"%f\", \"float\", \"Prints a float\"));\n\t\tcp.addCompletion(new BasicCompletion(cp, \"%s\", \"string\", \"Prints a string\"));\n\t\tcp.addCompletion(new BasicCompletion(cp, \"%u\", \"unsigned int\", \"Prints an unsigned integer\"));\n\t\tcp.addCompletion(new BasicCompletion(cp, \"\\\\n\", \"Newline\", \"Prints a newline\"));\n\t\treturn cp;\n\t}",
"Commands getCommandes();",
"public WorldUps.UFinished.Builder getCompletionsBuilder(\n int index) {\n return getCompletionsFieldBuilder().getBuilder(index);\n }",
"@NotNull\n String getCommandTemplate();",
"public String getCommand() {\n return command;\n }",
"public String getCommand() {\n return command;\n }",
"java.lang.String getCommand();",
"public java.util.List<WorldUps.UFinished> getCompletionsList() {\n return completions_;\n }",
"public interface SuperCommand {\n\n /**\n * Setups anything that is needed for this command.\n * <br/><br/>\n * It is recommended you do the following in this method:\n * <ul>\n * <li>Register any of the sub-commands of this command;</li>\n * <li>Define the permission required to use this command using {@link CompositeCommand#setPermission(String)};</li>\n * <li>Define whether this command can only be run by players or not using {@link CompositeCommand#setOnlyPlayer(boolean)};</li>\n * </ul>\n */\n void setup();\n\n /**\n * Returns whether the command can be executed by this user or not.\n * It is recommended to send messages to let this user know why they could not execute the command.\n * Note that this is run previous to {@link #execute(User, String, List)}.\n * @param user the {@link User} who is executing this command.\n * @param label the label which has been used to execute this command.\n * It can be {@link CompositeCommand#getLabel()} or an alias.\n * @param args the command arguments.\n * @return {@code true} if this command can be executed, {@code false} otherwise.\n * @since 1.3.0\n */\n default boolean canExecute(User user, String label, List<String> args) {\n return true;\n }\n\n /**\n * Defines what will be executed when this command is run.\n * @param user the {@link User} who is executing this command.\n * @param label the label which has been used to execute this command.\n * It can be {@link CompositeCommand#getLabel()} or an alias.\n * @param args the command arguments.\n * @return {@code true} if the command executed successfully, {@code false} otherwise.\n */\n boolean execute(User user, String label, List<String> args);\n\n /**\n * Tab Completer for CompositeCommands.\n * Note that any registered sub-commands will be automatically added to the list.\n * Use this to add tab-complete for things like names.\n * @param user the {@link User} who is executing this command.\n * @param alias alias for command\n * @param args command arguments\n * @return List of strings that could be used to complete this command.\n */\n default Optional<List<String>> tabComplete(User user, String alias, List<String> args) {\n return Optional.empty();\n }\n\n}",
"public String getCommand() {\n\n return command;\n }",
"public cl_command_queue getCommandQueue() {\r\n return commandQueue;\r\n }",
"public java.util.List<WorldUps.UFinished> getCompletionsList() {\n if (completionsBuilder_ == null) {\n return java.util.Collections.unmodifiableList(completions_);\n } else {\n return completionsBuilder_.getMessageList();\n }\n }",
"java.util.List<WorldUps.UFinished> \n getCompletionsList();",
"public String getCommand() {\r\n return command;\r\n }",
"public Command getMaximizeCommand() {\n return maximizeCommand;\n }",
"public String getCommand() { return command; }",
"public Command getCommand() {\n String userInput = in.nextLine();\n String[] words = userInput.split(\" \", 2);\n try {\n return new Command(words[0].toLowerCase(), words[1]);\n } catch (ArrayIndexOutOfBoundsException e) {\n return new Command(words[0].toLowerCase(), Command.BLANK_DESCRIPTION);\n }\n }",
"public String getCommand()\r\n\t{\r\n\t\treturn command;\r\n\t}",
"public String getCommand() {\n return this.command;\n }",
"@Override public T clone() {\n T x = (T)super.clone();\n x.setCompleter(this); // Set completer, what used to be a final field\n x._topLocal = false; // Not a top job\n x._nleft = x._nrite = null;\n x. _left = x. _rite = null;\n x._fs = _fs;\n x._profile = null; // Clone needs its own profile\n x.setPendingCount(0); // Volatile write for completer field; reset pending count also\n return x;\n }",
"public CommandValue getCommand() {\n\t\treturn value;\n\t}",
"WorldUps.UFinished getCompletions(int index);",
"public Command commandType() {\r\n if (command.startsWith(\"push\")) {\r\n return Command.C_PUSH;\r\n } else if (command.startsWith(\"pop\")) {\r\n return Command.C_POP;\r\n } else if (isArithmeticCmd()) {\r\n return Command.C_ARITHMETIC;\r\n } else if (command.startsWith(\"label\")) {\r\n return Command.C_LABEL;\r\n } else if (command.startsWith(\"goto\")) {\r\n return Command.C_GOTO;\r\n } else if (command.startsWith(\"if-goto\")) {\r\n return Command.C_IF;\r\n } else if (command.startsWith(\"function\")) {\r\n return Command.C_FUNCTION;\r\n } else if (command.startsWith(\"call\")) {\r\n return Command.C_CALL;\r\n } else if (command.startsWith(\"return\")) {\r\n return Command.C_RETURN;\r\n } else {\r\n return null;\r\n }\r\n }",
"String getCommand();",
"final public String getActionCommand() {\n return command;\n }",
"JComboBox gtkGetComboBox() {\n return comboBox;\n }",
"@Override\r\n\tpublic String getCOMMAND() {\n\t\treturn COMMAND;\r\n\t}",
"protected JComponent createEditor() {\n return spinner.getEditor(); }",
"void setAutoCompleterCallback(AutoCompleterCallback callback);",
"public com.google.protobuf.ProtocolStringList\n getCommandList() {\n return command_.getUnmodifiableView();\n }",
"@Override protected T clone() {\n try {\n T x = (T)super.clone();\n x.setCompleter(this); // Set completer, what used to be a final field\n x._topLocal = false; // Not a top job\n x._nleft = x._nrite = null;\n x. _left = x. _rite = null;\n x._fs = null; // Clone does not depend on extent futures\n x.setPendingCount(0); // Volatile write for completer field; reset pending count also\n return x;\n } catch( CloneNotSupportedException e ) {\n throw Log.errRTExcept(e);\n }\n }",
"public java.lang.String getCommand() {\n java.lang.Object ref = command_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n command_ = s;\n }\n return s;\n }\n }",
"public String getCommand(){\n return command;\n }",
"public String getOriginalCommand() {\n return command;\n }",
"@Override\n\tpublic List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {\n\t\treturn Arrays.asList(assistant.computeCompletionProposals(context.getViewer(), context.getInvocationOffset()));\n\t}",
"public int getCommand() {\n return command_;\n }",
"public SortedSet calculateCompletions(String commandSoFar) {\n\t\treturn null;\n\t}",
"public com.google.protobuf.ProtocolStringList\n getCommandList() {\n return command_;\n }",
"public static JaccsCommandHandler getCommandHandler(Long id) {\r\n\t\treturn new JaccsCommandHandler(userCommands.get(id));\r\n\r\n\t}",
"public String getCommand() {\n\t\tString[] lines = commandLine.getText().split(\"\\n\");\n\t\treturn lines[commandLine.getLineCount() - 2];\n\t}",
"public WorldUps.UFinished getCompletions(int index) {\n if (completionsBuilder_ == null) {\n return completions_.get(index);\n } else {\n return completionsBuilder_.getMessage(index);\n }\n }",
"public WorldUps.UFinished getCompletions(int index) {\n return completions_.get(index);\n }",
"public DrawingCommand getLastCommand() {\r\n\t\tint i = this.commands.size() - 1;\r\n\t\tif (i >= 0) {\r\n\t\t\treturn this.commands.get(this.commands.size() - 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public String getCommandClass() {\n\treturn className;\n }",
"public String \n getCommand() \n {\n return pCommand;\n }",
"protected CountedCompleter()\n/* */ {\n/* 447 */ this.completer = null;\n/* */ }",
"public CommandPackage getCommandPackage() {\n return commandPackage;\n }",
"Command createCommandWith(CommandCreator creator);",
"public java.util.List<? extends WorldUps.UFinishedOrBuilder> \n getCompletionsOrBuilderList() {\n return completions_;\n }",
"public static EditCommandFactory getEditCommandFactory() {\n\t\treturn EditCommandFactory.getInstance();\n\t}",
"public int getCommand() {\n return command_;\n }",
"public Consumer<T> getExec() {\r\n\t\treturn exec;\r\n\t}",
"@Override\n\tpublic String getCommand() {\n\t\treturn model.getCommand();\n\t}",
"public CommandManager getCommandManager() {\n return commandManager;\n }",
"protected CountedCompleter(CountedCompleter<?> paramCountedCompleter)\n/* */ {\n/* 439 */ this.completer = paramCountedCompleter;\n/* */ }",
"public int getCompletionsCount() {\n return completions_.size();\n }",
"int getCommand();",
"public JComboBox<?> getPathCombo() {\n return getCombo(0);\n }",
"public java.util.List<? extends WorldUps.UFinishedOrBuilder> \n getCompletionsOrBuilderList() {\n if (completionsBuilder_ != null) {\n return completionsBuilder_.getMessageOrBuilderList();\n } else {\n return java.util.Collections.unmodifiableList(completions_);\n }\n }",
"public interface CommandCallback {\n /**\n * Sends a response on the previously handled command.\n *\n * @param response a raw byte array of the response to studio command.\n */\n // Users don't implement this callback, but call methods on it themselves\n @SuppressLint(\"CallbackMethodName\")\n void reply(@NonNull byte[] response);\n\n /**\n * Handles a signal sent from Studio that this command should be cancelled, if possible.\n *\n * @param executor There is no guarantee on which thread the listener will be triggered on,\n * and as an inspector developer, you should be aware of this explicitly.\n * As a result, we require you to pass in a custom executor to provide the\n * flexibility to allow running the cancellation behavior on a different\n * thread. If you don't care about this, use a direct executor instead.\n * @param runnable the listener to run when command is cancelled.\n */\n // Users don't implement this callback, but call methods on it themselves\n @SuppressLint({\"PairedRegistration\", \"CallbackMethodName\"})\n void addCancellationListener(@NonNull Executor executor, @NonNull Runnable runnable);\n }",
"public CommandLineTool getCommandLineToolInstance() {\n \treturn COMMAND_LINE_TOOL;\n }",
"final Commands getLastCommand() {\n\t\t// retornamos el ultimo comando enviado\n\t\treturn this.lastCommand;\n\t}",
"public java.lang.String getCommand() {\n java.lang.Object ref = command_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n command_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"CommandsFactory getCommandsFactory();",
"Object getCompletionResult();",
"public java.util.List<WorldUps.UFinished.Builder> \n getCompletionsBuilderList() {\n return getCompletionsFieldBuilder().getBuilderList();\n }",
"public final CountedCompleter<?> nextComplete()\n/* */ {\n/* */ CountedCompleter localCountedCompleter;\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 675 */ if ((localCountedCompleter = this.completer) != null) {\n/* 676 */ return localCountedCompleter.firstComplete();\n/* */ }\n/* 678 */ quietlyComplete();\n/* 679 */ return null;\n/* */ }",
"IDvCmdSafetyBean getCommandSafety();",
"public interface AutoCompleterCallback {\n /** Notification that an item is suggested. */\n void itemSuggested(String autoCompleteString, boolean keepPopupVisible, boolean triggerAction);\n }",
"public Label getComponentLabel() {\n return commandPromptLabel;\n }",
"public Builder addCompletions(WorldUps.UFinished value) {\n if (completionsBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureCompletionsIsMutable();\n completions_.add(value);\n onChanged();\n } else {\n completionsBuilder_.addMessage(value);\n }\n return this;\n }",
"public int getCommand()\n\t{\n\t\treturn this.command;\n\t}",
"public List<Command> getCommands() {\n return commands;\n }",
"public TextField getComponentNode() {\n return commandPromptTextArea;\n }",
"public String Command() {\n\treturn command;\n }",
"public String getToolCommand();",
"List<String> getCommands();",
"public interface ICommand {\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return long description of the command\r\n\t */\r\n\tString description();\r\n\r\n\t/**\r\n\t * \r\n\t * @return name of the command\r\n\t */\r\n\tString name();\r\n\r\n\t/**\r\n\t * Get called when the comma\r\n\t * @param console callback for output\r\n\t * @param options of the command invocation\r\n\t */\r\n\tvoid exec(ICommandConsole console, List<String> options);\r\n\r\n\t/**\r\n\t * \r\n\t * @return usage of the command\r\n\t */\r\n\tString usage();\r\n}",
"Command createCommand();"
] | [
"0.6460666",
"0.6005454",
"0.5726661",
"0.5359262",
"0.5358216",
"0.5324754",
"0.5297612",
"0.5286675",
"0.52592814",
"0.522273",
"0.5183838",
"0.51006573",
"0.5074187",
"0.505654",
"0.50385976",
"0.50331056",
"0.5023773",
"0.50202495",
"0.50150776",
"0.50115037",
"0.5008006",
"0.5007252",
"0.4981889",
"0.49591783",
"0.4938551",
"0.49377584",
"0.49377584",
"0.49370506",
"0.49309838",
"0.4930409",
"0.49303925",
"0.49233726",
"0.49217302",
"0.49065915",
"0.4887454",
"0.48798844",
"0.4879546",
"0.48635682",
"0.4860618",
"0.4857749",
"0.4857352",
"0.48378888",
"0.48375425",
"0.48283672",
"0.48226976",
"0.4813994",
"0.48063532",
"0.4804984",
"0.47971615",
"0.47934896",
"0.47866887",
"0.47833192",
"0.4775002",
"0.47726217",
"0.4769599",
"0.4764393",
"0.4757968",
"0.47557485",
"0.47535396",
"0.47491845",
"0.4747818",
"0.47448498",
"0.4743678",
"0.4737878",
"0.47308564",
"0.47296104",
"0.47105753",
"0.47102955",
"0.47100845",
"0.47012603",
"0.46943834",
"0.46908188",
"0.46901986",
"0.46794912",
"0.46793154",
"0.46720237",
"0.46557584",
"0.465549",
"0.46551096",
"0.46542826",
"0.46417367",
"0.46411625",
"0.46365505",
"0.4629741",
"0.4623688",
"0.4615209",
"0.46143043",
"0.46103874",
"0.46094242",
"0.46024686",
"0.45951885",
"0.45948032",
"0.45826435",
"0.45802104",
"0.4578687",
"0.45781896",
"0.45679986",
"0.45673075",
"0.45572147",
"0.45561317"
] | 0.768147 | 0 |
Resolve the real match for a specified invocation match. | protected abstract CommandMatch<?, ?> resolve(InvocationMatch<T> match); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Match getResultMatch();",
"public abstract Match match();",
"private int matchLevel(QualifiedNameReference qNameRef, boolean resolve) {\n if (!resolve) {\n if (this.pkgName == null) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n switch (this.matchMode) {\n case EXACT_MATCH:\n case PREFIX_MATCH:\n if (CharOperation.prefixEquals(this.pkgName, CharOperation.concatWith(qNameRef.tokens, '.'), this.isCaseSensitive)) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n case PATTERN_MATCH:\n char[] pattern = this.pkgName[this.pkgName.length-1] == '*' ? this.pkgName : CharOperation.concat(this.pkgName, \".*\".toCharArray()); //$NON-NLS-1$\n if (CharOperation.match(pattern, CharOperation.concatWith(qNameRef.tokens, '.'), this.isCaseSensitive)) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n default:\n return IMPOSSIBLE_MATCH; } }\n } else {\n Binding binding = qNameRef.binding;\n if (binding == null) {\n return INACCURATE_MATCH;\n } else {\n TypeBinding typeBinding = null;\n char[][] tokens = qNameRef.tokens;\n int lastIndex = tokens.length-1;\n switch (qNameRef.bits & AstNode.RestrictiveFlagMASK) {\n case BindingIds.FIELD : // reading a field\n typeBinding = ((FieldBinding)binding).declaringClass;\n // no valid match amongst fields\n int otherBindingsCount = qNameRef.otherBindings == null ? 0 : qNameRef.otherBindings.length; \n lastIndex -= otherBindingsCount + 1;\n if (lastIndex < 0) return IMPOSSIBLE_MATCH;\n break;\n case BindingIds.LOCAL : // reading a local variable\n return IMPOSSIBLE_MATCH; // no package match in it\n case BindingIds.TYPE : //=============only type ==============\n typeBinding = (TypeBinding)binding; }\n if (typeBinding instanceof ArrayBinding) {\n typeBinding = ((ArrayBinding)typeBinding).leafComponentType; }\n if (typeBinding == null) {\n return INACCURATE_MATCH;\n } else {\n if (typeBinding instanceof ReferenceBinding) {\n PackageBinding pkgBinding = ((ReferenceBinding)typeBinding).fPackage;\n if (pkgBinding == null) {\n return INACCURATE_MATCH;\n } else if (this.matches(pkgBinding.compoundName)) {\n return ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n } else {\n return IMPOSSIBLE_MATCH; } } } } }",
"public T getExactMatch(String arg)\n\t{\n\t\treturn null;\n\t}",
"private Argument resolveArgument(final String argString) {\n\t\treturn registeredArguments.stream()\n\t\t\t\t.filter(arg -> StringUtils.equalsAny(argString, arg.getShortCall(), arg.getLongCall()))\n\t\t\t\t.findFirst()\n\t\t\t\t.get();\n\t}",
"public abstract String resolve();",
"FunDef resolve(\n Exp[] args,\n Validator validator,\n List<Conversion> conversions);",
"public final CommandMatch<?, ?> resolveCommand(Map<String, ?> options, String subordinate, Map<String, ?> subordinateOptions, List<?> arguments) throws CommandException {\n InvocationMatcher<T> matcher = getDescriptor().matcher();\n\n //\n InvocationMatch<T> match;\n try {\n if (options != null && options.size() > 0) {\n for (Map.Entry<String, ?> option : options.entrySet()) {\n matcher = matcher.option(option.getKey(), Collections.singletonList(option.getValue()));\n }\n }\n\n //\n if (subordinate != null && subordinate.length() > 0) {\n matcher = matcher.subordinate(subordinate);\n\n // Minor : remove that and use same signature\n if (subordinateOptions != null && subordinateOptions.size() > 0) {\n for (Map.Entry<String, ?> option : subordinateOptions.entrySet()) {\n matcher = matcher.option(option.getKey(), Collections.singletonList(option.getValue()));\n }\n }\n }\n\n //\n match = matcher.arguments(arguments != null ? arguments : Collections.emptyList());\n }\n catch (org.crsh.cli.impl.SyntaxException e) {\n throw new CommandException(ErrorKind.EVALUATION, \"Could not resolve command \" + getDescriptor().getName(), e);\n }\n\n //\n return resolve(match);\n }",
"private int matchLevel(QualifiedTypeReference typeRef, boolean resolve) {\n if (!resolve) {\n if (this.pkgName == null) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n switch (this.matchMode) {\n case EXACT_MATCH:\n case PREFIX_MATCH:\n if (CharOperation.prefixEquals(this.pkgName, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive)) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n case PATTERN_MATCH:\n char[] pattern = this.pkgName[this.pkgName.length-1] == '*' ? this.pkgName : CharOperation.concat(this.pkgName, \".*\".toCharArray()); //$NON-NLS-1$\n if (CharOperation.match(pattern, CharOperation.concatWith(typeRef.tokens, '.'), this.isCaseSensitive)) {\n return this.needsResolve ? POSSIBLE_MATCH : ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n default:\n return IMPOSSIBLE_MATCH; } }\n } else {\n TypeBinding typeBinding = typeRef.binding;\n if (typeBinding == null) {\n return INACCURATE_MATCH;\n } else {\n if (typeBinding instanceof ArrayBinding) {\n typeBinding = ((ArrayBinding)typeBinding).leafComponentType; }\n if (typeBinding == null) {\n return INACCURATE_MATCH;\n } else if (typeBinding instanceof ReferenceBinding) {\n PackageBinding pkgBinding = ((ReferenceBinding)typeBinding).fPackage;\n if (this.matches(pkgBinding.compoundName)) {\n return ACCURATE_MATCH;\n } else {\n return IMPOSSIBLE_MATCH; }\n } else {\n return IMPOSSIBLE_MATCH; } } } }",
"T resolve();",
"public void doLazyMatch() {}",
"public abstract void resolve();",
"@Override\n public void match(Match match) {\n latestStepResult = new StepResult();\n latestStepResult.setArguments(convertArguments(match.getArguments()));\n\n resolveStepResultList().add(latestStepResult);\n }",
"private void findMatch()\n {\n if (this.matchLen > 0) \n {\n this.matchLen += ((this.matchLen - MAX_LENGTH) >>> 31);\n this.matchPos++;\n } \n else \n {\n // Retrieve match position\n this.matchPos = this.hashes[this.hash];\n\n // Detect match\n if ((this.matchPos != 0) && (this.pos - this.matchPos <= MASK2))\n {\n int r = this.matchLen + 1;\n\n while ((r <= MAX_LENGTH) && (this.buffer[(this.pos-r) & MASK2] == this.buffer[(this.matchPos-r) & MASK2])) \n r++;\n\n this.matchLen = r - 1;\n }\n } \n }",
"Symbol resolve(String name);",
"@Override\r\n public Match find(Match M) {\n return null;\r\n }",
"@Override\n public void resolve(MapChoice mapChoice, Query query, Result result, Resolution resolution) {\n assertEquals(\"myMethod\",mapChoice.getMethod());\n super.resolve(mapChoice,query,result,resolution);\n }",
"Match getPartialMatch();",
"Definition lookup(String name, // the name to locate\n int numParams) { // number of params\n // note that the name isn't used... all definitions contained\n // by the MultiDef have the same name\n \n // walk through the list of symbols\n Enumeration e = defs.elements();\n while(e.hasMoreElements()) {\n Definition d = (Definition)e.nextElement();\n \n // If the symbol is a method and it has the same number of\n // parameters as what we are calling, assume it's the match\n if (d instanceof MethodDef) {\n if (((MethodDef)d).getParamCount() == numParams)\n return d;\n }\n \n // otherwise, if it's not a method, AND we're not looking for\n // a method, return the definition found.\n else if (numParams == -1)\n return d;\n } \n\n // If we didn't find a match return null\n return null;\n }",
"Object isMatch(Object arg, String wantedType);",
"Match getCompleteMatch();",
"Match createMatch();",
"public void match(ReaderBuffer buffer, TokenMatch match)\n throws IOException {\n TokenPattern res = automaton.match(buffer, ignoreCase);\n\n if (res != null) {\n match.update(res.getPattern().length(), res);\n }\n }",
"public static void matchMaker()\n {\n \n }",
"public final CommandInvoker<?, ?> resolveInvoker(String line) throws CommandException {\n return resolveCommand(line).getInvoker();\n }",
"public void setMatched(String matched) {\r\n\t\tthis.matched = matched;\r\n\t}",
"<T> T resolve(String name, Class<T> type);",
"private String resolveCall(String module, Call call)\n {\n if(call==null) return module;\n\n String callMod = modules.get(call.module);\n\n if(call.union!=null)\n {\n callMod = callMod + \"in(\"+ call.union +\").\\n\";\n }\n Module m = null; \n try\n {\n m = compileModule(callMod);\n\n if(call.containsVar)\n {\n module = resolveVars(module, m, call);\n }\n else\n {\n if(callSucceeds(m, call))\n {\n System.out.println(\"CALL SUCCESS - \"+call.callString);\n module = affirmCall(module, call);\n System.out.println(module);\n }\n else\n {\n System.out.println(\"CALL FAILED - \"+call.callString);\n module = removeCall(module, call);\n }\n }\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n return module;\n }",
"private FamixMethod findInvokedMethodOnName(String fromClass, String fromMethod, String invokedClassName, String invokedMethodName) {\n \tFamixMethod result = null;\n\t\t/* Test Helper\n\t\tif (fromClass.equals(\"domain.direct.violating.AccessLocalVariable_SetArgumentValue\")){\n\t\t\tboolean breakpoint = true;\n\t\t} */\n\n \t// 1) If methodNameAsInInvocation matches with a method unique name, return that method. \n \tString searchKey = invokedClassName + \".\" + invokedMethodName;\n \tif (theModel.behaviouralEntities.containsKey(searchKey)) {\n \t\treturn (FamixMethod) theModel.behaviouralEntities.get(searchKey);\n \t}\n \t// 2) Find out if there are more methods with the same name of the invoked class. If only one method is found, then return this method. \n \tString methodName = invokedMethodName.substring(0, invokedMethodName.indexOf(\"(\")); // Methodname without signature\n \t searchKey = invokedClassName + \".\" + methodName;\n \tif (sequencesPerMethod.containsKey(searchKey)){\n \t\tArrayList<FamixMethod> methodsList = sequencesPerMethod.get(searchKey);\n \t\tif (methodsList.size() == 0) {\n \t\t\treturn result;\n \t\t} else if (methodsList.size() == 1) {\n \t\t\t// FamixMethod result1 = methodsList.get(0);\n \t\t\treturn methodsList.get(0);\n \t\t} else { // 3) if there are more methods with the same name, then compare the invocation arguments with the method parameters.\n \t\t\tString invocationSignature = invokedMethodName.substring(invokedMethodName.indexOf(\"(\"));;\n \t\t\tString contentsInvocationSignature = invocationSignature.substring(invocationSignature.indexOf(\"(\") + 1, invocationSignature.indexOf(\")\")); \n \t\t\tString[] invocationArguments = contentsInvocationSignature.split(\",\");\n \t\t\tint numberOfArguments = invocationArguments.length;\n \t\t\t// 3a) If there is only one method with the same number of parameters as invocationArguments, then return this method\n \t\t\tList<FamixMethod> matchingMethods1 = new ArrayList<FamixMethod>();\n\t \t\tfor (FamixMethod method : methodsList){\n\t \t\t\tif ((method.signature != null) && (!method.signature.equals(\"\"))) {\n\t\t \t\t\tString contentsmethodParameter = method.signature.substring(method.signature.indexOf(\"(\") + 1, method.signature.indexOf(\")\")); \n\t\t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n\t\t \t\t\tif (methodParameters.length == numberOfArguments) {\n\t\t \t\t\t\tmatchingMethods1.add(method);\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t} \n\t \t\tif (matchingMethods1.size() == 0)\n\t \t\t\treturn result;\n\t \t\tif (matchingMethods1.size() == 1)\n\t \t\t\treturn matchingMethods1.get(0);\n \t\t\t\n \t\t\t// 3b) If there is only one method where the first parameter type == the first argument type, then return this method \n \t\t\tList<FamixMethod> matchingMethods2 = new ArrayList<FamixMethod>();\n \t\t\tif (numberOfArguments >= 1) {\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[0] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[0]);\n \t \t\tfor (FamixMethod matchingMethod1 : matchingMethods1){\n \t \t\t\tString contentsmethodParameter = matchingMethod1.signature.substring(matchingMethod1.signature.indexOf(\"(\") + 1, matchingMethod1.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 1) {\n \t \t\t\tmethodParameters[0] = getfullPathOfDeclaredType(fromClass, methodParameters[0]);\n \t \t\t\t\tif (methodParameters[0].equals(invocationArguments[0])) {\n \t \t\t\t\t\tmatchingMethods2.add(matchingMethod1);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods2.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods2.size() == 1)\n \t \t\t\treturn matchingMethods2.get(0);\n \t\t\t}\n \t\t\t// If there is only one method where the second parameter type == the first argument type, then return this method \n \t\t\tif (numberOfArguments >= 2) {\n \t\t\t\tmatchingMethods1.clear();\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[1] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[1]);\n \t \t\tfor (FamixMethod matchingMethod2 : matchingMethods2){\n \t \t\t\tString contentsmethodParameter = matchingMethod2.signature.substring(matchingMethod2.signature.indexOf(\"(\") + 1, matchingMethod2.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 2) {\n \t \t\t\tmethodParameters[1] = getfullPathOfDeclaredType(fromClass, methodParameters[1]);\n \t \t\t\t\tif (methodParameters[1].equals(invocationArguments[1])) {\n \t \t\t\t\t\tmatchingMethods1.add(matchingMethod2);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods1.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods1.size() == 1)\n \t \t\t\treturn matchingMethods1.get(0);\n \t\t\t}\n \t\t}\n\t\t}\n \treturn result; \n }",
"public abstract Coordinate resolve(Coordinate c, int frame, double time);",
"private static void resolveParameter(StringBuilder query, String parameter, String resolvedValue) {\n final Pattern pattern = Pattern.compile(ParameterParser.getPatternStringFor(parameter));\n Matcher matcher = pattern.matcher(query);\n while (matcher.find()) {\n if (matcher.group(1) != null) {\n final MatchResult result = matcher.toMatchResult();\n query\n .replace(result.start(1) - ParameterParser.getParameterPrefixLength(), result.end(1), resolvedValue);\n matcher = pattern.matcher(query);\n }\n }\n }",
"public static Entry[] resolveOverload(final Entry[] candidates,\n final FuncInfo callSig, final Object[] args) {\n if (callSig == null) {\n return candidates;\n }\n\n final Entry[] applicable = applicableFuncs(candidates, callSig, args);\n if (applicable.length <= 1) {\n return applicable; // if nothing or just one applicable, return now\n }\n\n return bestFuncMatch(applicable, callSig, args);\n }",
"protected abstract Matcher<? super ExpressionTree> specializedMatcher();",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"void setCompleteMatch(Match completeMatch);",
"public int match(TypeDeclaration node, MatchingNodeSet nodeSet) {\n if (!this.pattern.findReferences)\n return IMPOSSIBLE_MATCH;\n if (this.pattern.fineGrain != 0 && (this.pattern.fineGrain & ~IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION) == 0)\n return IMPOSSIBLE_MATCH;\n // need to look for a generated default constructor\n return nodeSet.addMatch(node, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);\n }",
"void resolve();",
"public org.omg.CORBA.Object resolve(String name)\n {\n NameComponent nc = new NameComponent(name, \"Object\");\n NameComponent path[] = {nc};\n org.omg.CORBA.Object objRef = null;\n try\n {\n objRef = namingContext.resolve(path);\n }\n catch (Exception e)\n {\n fatalError(\"Cound not get object with name \\\"\" + name +\n \"\\\" from NameService\", e);\n }\n return objRef;\n }",
"String resolve(String placeholder, AddressTemplate template);",
"protected Lookup lookupOrCache(String pluginName, String functionName, int argsNumber, Object targetOrClass) {\n Function function = getFunction(pluginName, functionName);\n if (function != null && function.hasImplementation(argsNumber)) {\n return new Lookup(function);\n }\n\n // NOTE: even if the plugin has already been cached, if we can't find the requested function (either at\n // all or having a corresponding implementation for the provided arity, we re-cache the whole plugin in\n // case the plugin list or object reference has dynamically changed over the course of the program.\n return lookupAndCache(pluginName, functionName, argsNumber, targetOrClass);\n }",
"default Object resolve(String name) {\n return resolve(name, Object.class);\n }",
"public abstract boolean resolveAction(String str, Bundle bundle);",
"public void setMatch(OFMatch mt) {\n\t\tthis.match = mt;\r\n\t}",
"float getMatch();",
"@Override\n public Match getMatch() {\n return match;\n }",
"private Object executeMethod(Object target, CallStatement callStatement)\n throws EngineException {\n try {\n CallStatement.CallStatementEntry entry = \n callStatement.getEntries().get(callStatement.getEntries().size() -1);\n Method[] methods = target.getClass().getMethods();\n for (Method method: methods) {\n if (methodsMatch(method,entry)) {\n return method.invoke(target, parameters.toArray(new Object[0]));\n }\n }\n } catch (EngineException ex) {\n throw ex;\n } catch (Exception ex) {\n throw new EngineException(\"Failed to execute the method because : \" \n + ex.getMessage(),ex);\n }\n throw new java.lang.NoSuchMethodError(\n \"No method matching the requirments was found\");\n }",
"public abstract Object findPropertyMatchedChild(Object obj, String property, String bench, boolean exactMatch)\n\t throws SAFSObjectNotFoundException;",
"private RouteMatch _find(RenderContext context)\n {\n for (RouteParam param : routeParamArray)\n {\n RenderContext.Parameter entry = context.getParameter(param.name);\n if (entry != null && !entry.isMatched() && param.value.equals(entry.getValue()))\n {\n entry.remove(entry.getValue());\n }\n else\n {\n return null;\n }\n }\n\n // Match any request parameter\n for (RequestParam requestParamDef : requestParamArray)\n {\n RenderContext.Parameter entry = context.getParameter(requestParamDef.name);\n boolean matched = false;\n if (entry != null && !entry.isMatched())\n {\n if (requestParamDef.matchPattern == null || context.matcher(requestParamDef.matchPattern).matches(entry.getValue()))\n {\n matched = true;\n }\n }\n if (matched)\n {\n entry.remove(entry.getValue());\n }\n else\n {\n switch (requestParamDef.controlMode)\n {\n case OPTIONAL:\n // Do nothing\n break;\n case REQUIRED:\n return null;\n default:\n throw new AssertionError();\n }\n }\n }\n\n // Match any pattern parameter\n if (this instanceof PatternRoute)\n {\n PatternRoute prt = (PatternRoute)this;\n for (int i = 0;i < prt.params.length;i++)\n {\n PathParam param = prt.params[i];\n RenderContext.Parameter s = context.getParameter(param.name);\n String matched = null;\n if (s != null && !s.isMatched())\n {\n switch (param.encodingMode)\n {\n case FORM:\n case PRESERVE_PATH:\n for (int j = 0;j < param.matchingRegex.length;j++)\n {\n Regex renderingRegex = param.matchingRegex[j];\n if (context.matcher(renderingRegex).matches(s.getValue()))\n {\n matched = param.templatePrefixes[j] + s.getValue() + param.templateSuffixes[j];\n break;\n }\n }\n break;\n default:\n throw new AssertionError();\n }\n }\n if (matched != null)\n {\n s.remove(matched);\n }\n else\n {\n return null;\n }\n }\n }\n\n //\n if (context.isEmpty() && terminal)\n {\n Map<QualifiedName, String> matches = Collections.emptyMap();\n for (QualifiedName name : context.getNames())\n {\n RenderContext.Parameter parameter = context.getParameter(name);\n if (matches.isEmpty())\n {\n matches = new HashMap<QualifiedName, String>();\n }\n String match = parameter.getMatch();\n matches.put(name, match);\n }\n return new RouteMatch(context, this, matches);\n }\n\n //\n for (Route route : children)\n {\n RouteMatch a = route.find(context);\n if (a != null)\n {\n return a;\n }\n }\n\n //\n return null;\n }",
"private <T> T findActual(T matchingObject, List<? extends T> list) {\n T actual = null;\n for (T check : list) {\n if (check.equals(matchingObject)) {\n actual = check;\n }\n }\n return actual;\n }",
"<T extends java.lang.reflect.Member> T reflectAs(Class<T> expected, MethodHandles.Lookup lookup);",
"Concept resolveInstance(Instance instance);",
"@Override\n public String matchAndApply(String target, HttpServletRequest request, HttpServletResponse response) throws IOException {\n if (_virtualHosts != null && _virtualHosts.length > 0) {\n String requestHost = normalizeHostname(request.getServerName());\n for (String ruleHost : _virtualHosts) {\n if (ruleHost == null || ruleHost.equalsIgnoreCase(requestHost)\n || (ruleHost.startsWith(\"*.\") && ruleHost.regionMatches(true, 2, requestHost, requestHost.indexOf(\".\") + 1, ruleHost.length() - 2)))\n return apply(target, request, response);\n }\n } else {\n return apply(target, request, response);\n }\n return null;\n }",
"public Item resolveByName(String name, ItemSelector selector)\n {\n List<Item> items=_names.get(name);\n return resolveAmbiguity(name,items,selector);\n }",
"@Override\r\n\tpublic String getMatch() {\n\t\treturn match;\r\n\t}",
"public void doWorkAfterMatch(int matchedLength) {\n rhsUsed += 1; inputUsed += matchedLength;\n doAsTopOfStack();\n // retract the dotted goal\n rhsUsed -= 1; inputUsed -= matchedLength;\n }",
"@Override\n\tpublic DmcNamedObjectIF resolveClash(DmcObject obj, DmcAttributeInfo ai, DmcNameClashObjectSet<?> ncos) throws DmcValueException {\n\t\tDmcNamedObjectIF rc = null;\n\t\tIterator<DmcNamedObjectIF> matches = ncos.getMatches();\n\t\t\n\t\tDebugInfo.debug(\"\\nResolving \" + ai.name + \" in:\\n\\n\" + obj.toOIF() + \"\\n\");\n\t\t\n\t\tobj.getConstructionClassInfo().getAttributeInfo(ai.name);\n\t\t\n\t\tif (obj instanceof DmsDefinitionDMO){\n\t\t\t// We're resolving references within a set of definitions, if we aren't, there's not much we can do\n\t\t\tDmsDefinitionDMO defObj = (DmsDefinitionDMO) obj;\n\t\t\t\n\t\t\twhile(matches.hasNext()){\n\t\t\t\tDmcNamedObjectIF objif = matches.next();\n\t\t\t\t\n\t\t\t\tDebugInfo.debug(objif.toString());\n\t\t\t\tif (objif instanceof DmsDefinitionDMO){\n\t\t\t\t\tDmsDefinitionDMO matchDef = (DmsDefinitionDMO) objif;\n\t\t\t\t\tif (defObj.getDefinedIn().getObjectName().getNameString().equals(matchDef.getDefinedIn().getObjectName().getNameString())){\n\t\t\t\t\t\trc = matchDef;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse if (objif instanceof DmsDefinition){\n\t\t\t\t\tDmsDefinition matchDef = (DmsDefinition) objif;\n\t\t\t\t\t\n\t\t\t\t\tif (defObj.getDefinedIn().getObjectName().getNameString().equals(matchDef.getDefinedIn().getName().getNameString())){\n\t\t\t\t\t\trc = matchDef;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn(rc);\n\t}",
"public abstract ActionInMatch act();",
"private RegularMethodInvocation getInvocation(Element statement) {\n return getNearestElement(statement, RegularMethodInvocation.class);\n }",
"private Route lookupRoute(Prefix pfx) {\n\t\tRoute match = null;\n\t\tif (pfxList.contains(pfx)){\n\t\t\tint index = pfxList.indexOf(pfx);\n\t\t\tmatch = rteTbl.get(index);\n\t\t}\n\t\treturn match;\n\t}",
"public Object resolveObject(Object obj) throws IOException;",
"public T find (T target);",
"public String apply(TregexMatcher tregexMatcher)\n/* */ {\n/* 275 */ return this.result;\n/* */ }",
"VarRef lookupField(String fieldUse);",
"@Override\n public Object proceed() throws Throwable {\n if (this.currentInterceptorIndex == this.interceptorsAndDynamicMethodMatchers.size() - 1) {\n return invokeJoinpoint();\n }\n\n Object interceptorOrInterceptionAdvice =\n this.interceptorsAndDynamicMethodMatchers.get(++this.currentInterceptorIndex);\n\n if (interceptorOrInterceptionAdvice instanceof MyMethodIntercept) {\n // Evaluate dynamic method matcher here: static part will already have\n // been evaluated and found to match.\n MyMethodIntercept mi =\n (MyMethodIntercept) interceptorOrInterceptionAdvice;\n Class<?> targetClass = (this.targetClass != null ? this.targetClass : this.method.getDeclaringClass());\n return mi.invoke(this);\n // Dynamic matching failed.\n // Skip this interceptor and invoke the next in the chain.\n } else {\n return proceed();\n }\n }",
"public static MethodHandle findVirtual(MethodHandles.Lookup lookup, String name, Class type,\n Class clazz, MethodType mt)\n throws NoSuchMethodException, IllegalAccessException\n {\n return lookup.findVirtual(clazz, name, mt);\n }",
"public String resolve(final String name) {\n return name.length() > pathLength ? pathLength > 0 ? name.substring(pathLength) : name : null;\n }",
"void setPartialMatch(Match partialMatch);",
"public abstract String resolveText(String key, Serializable[] arguments);",
"public void delayedFindMatching(PropFinder finder, RecorderFossil fossil, ResultRecorder recorder) {\n\tthrow new SubclassResponsibilityException();\n/*\nudanax-top.st:9714:OrglRoot methodsFor: 'operations'!\n{void} delayedFindMatching: finder {PropFinder}\n\twith: fossil {RecorderFossil}\n\twith: recorder {ResultRecorder}\n\t\n\t\"This does the 'now' part of setting up a recorder, once the 'later' part has been set up.\n\t It does a walk south on the O-tree, then walks back north on all the H-trees, filtered by the Bert canopy.\"\n\t\n\tself subclassResponsibility!\n*/\n}",
"public void match(ReaderBuffer buffer, TokenMatch match)\n throws IOException {\n automaton.match(buffer, match);\n }",
"protected abstract void onMatch(String value, Label end);",
"final boolean subtreeMatch0(ASTMatcher matcher, Object other) {\r\n\t\t// dispatch to correct overloaded match method\r\n\t\treturn matcher.match(this, other);\r\n\t}",
"protected int resolveLevel(AllocationExpression allocation) {\n char[][] typeName = allocation.type.getTypeName();\n if (this.pattern.declaringSimpleName != null && !matchesName(this.pattern.declaringSimpleName, typeName[typeName.length - 1]))\n return IMPOSSIBLE_MATCH;\n return resolveLevel(allocation.binding);\n }",
"public int match(MessageSend msgSend, MatchingNodeSet nodeSet) {\n if ((msgSend.bits & ASTNode.InsideJavadoc) == 0)\n return IMPOSSIBLE_MATCH;\n if (!this.pattern.findReferences)\n return IMPOSSIBLE_MATCH;\n if (this.pattern.declaringSimpleName == null || CharOperation.equals(msgSend.selector, this.pattern.declaringSimpleName)) {\n return nodeSet.addMatch(msgSend, this.pattern.mustResolve ? POSSIBLE_MATCH : ACCURATE_MATCH);\n }\n return IMPOSSIBLE_MATCH;\n }",
"@Override\n\tpublic Symbol resolveMember(String name) {\n\t\tSymbol s = symbols.get(name);\n\t\tif (s != null)\n\t\t\treturn s;\n\t\t\n\t\t// don't look in the enclosing scope for this one\n\t\t\n\t\t// otherwise it doesn't exist\n\t\treturn null;\n\t}",
"protected Object resolveCommonArgument(MethodParameter methodParameter, NativeWebRequest webRequest)\n\t\t\tthrows Exception {\n\t\tif (this.customArgumentResolvers != null) {\n\t\t\tfor (WebArgumentResolver argumentResolver : this.customArgumentResolvers) {\n\t\t\t\tObject value = argumentResolver.resolveArgument(methodParameter, webRequest);\n\t\t\t\tif (value != WebArgumentResolver.UNRESOLVED) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Resolution of standard parameter types...\n\t\tClass paramType = methodParameter.getParameterType();\n\t\tObject value = resolveStandardArgument(paramType, webRequest);\n\t\tif (value != WebArgumentResolver.UNRESOLVED && !ClassUtils.isAssignableValue(paramType, value)) {\n\t\t\tthrow new IllegalStateException(\"Standard argument type [\" + paramType.getName() +\n\t\t\t\t\t\"] resolved to incompatible value of type [\" + (value != null ? value.getClass() : null) +\n\t\t\t\t\t\"]. Consider declaring the argument type in a less specific fashion.\");\n\t\t}\n\t\treturn value;\n\t}",
"public boolean accept(Match arg0) {\n\t\treturn false;\n\t}",
"public V lookup(K key);",
"private void setCurrentMatch(SingleMatch newMatch) {\n\t\tcurrentMatch = newMatch;\n\t}",
"private Operator findOperatorToResolve(Predicate predToResolve) throws Exception {\n\t\tfor (Operator op : this.operators) {\n\t\t\tOperator opCopy = op.getClass().newInstance();\n\t\t\tfor (Predicate predCandidate : opCopy.getAdd().toList()) {\n\t\t\t\tif (predCandidate.isCompatibleTo(predToResolve)) {\n\t\t\t\t\t// instantiate opCopy with predToResolve\n\t\t\t\t\tfor (int i = 0; i < predToResolve.getValence(); i++) {\n\t\t\t\t\t\tif (!predCandidate.getArgument(i).isInstantiated()) {\n\t\t\t\t\t\t\tpredCandidate.getArgument(i).instantiate(predToResolve.getArgument(i).getValue());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn opCopy;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tthrow new RuntimeException(\"There was no operator found to resolve a predicate. There is no possible plan.\");\n\t}",
"public Object execute(DynamicObject regExp, String input) {\n TruffleObject flags = compiledRegexAccessor.flags(JSRegExp.getCompiledRegex(regExp));\n boolean global = flagsAccessor.global(flags);\n boolean sticky = ecmaScriptVersion >= 6 && flagsAccessor.sticky(flags);\n long lastIndex = getLastIndex(regExp);\n if (global || sticky) {\n if (invalidLastIndex.profile(lastIndex < 0 || lastIndex > input.length())) {\n setLastIndex(regExp, 0);\n return getEmptyResult();\n }\n } else {\n lastIndex = 0;\n }\n\n TruffleObject result = executeIgnoreLastIndex(regExp, input, lastIndex);\n if (match.profile(regexResultAccessor.isMatch(result))) {\n context.setRegexResult(result);\n if (stickyProfile.profile(sticky && regexResultAccessor.captureGroupStart(result, 0) != lastIndex)) {\n // matcher should never have advanced that far!\n setLastIndex(regExp, 0);\n return getEmptyResult();\n }\n if (global || sticky) {\n setLastIndex(regExp, regexResultAccessor.captureGroupEnd(result, 0));\n }\n if (ecmaScriptVersion < 6) {\n return result;\n }\n return getMatchResult(result, input);\n } else {\n if (ecmaScriptVersion < 8 || global || sticky) {\n setLastIndex(regExp, 0);\n }\n return getEmptyResult();\n }\n }",
"public MatchResult exec(String input) {\n this.input = input;\n return exec();\n }",
"private ProjectResolutionResult resolveProject(TaskSelector.SelectionContext context, Path path, BuildState targetBuild) {\n if (!path.isAbsolute() && path.segmentCount() == 1) {\n return new ProjectResolutionResult(targetBuild, targetBuild.getMutableModel().getDefaultProject().getOwner(), true, path.getName());\n }\n\n // <path>:name -> resolve <path> to a project + select task with matching name in that project\n // when <path> is absolute -> resolve <path> relative to root project\n // when <path> is relative -> resolve <path> relative to default project\n\n Path projectPath = path.getParent();\n ProjectState matchingProject;\n if (projectPath.isAbsolute()) {\n matchingProject = buildRegistry.getRootBuild().getProjects().getRootProject();\n } else {\n matchingProject = targetBuild.getMutableModel().getDefaultProject().getOwner();\n }\n while (projectPath.segmentCount() > 0) {\n String next = projectPath.segment(0);\n matchingProject = selectProject(context, matchingProject, next);\n if (projectPath.segmentCount() == 1) {\n projectPath = Path.ROOT;\n } else {\n projectPath = projectPath.removeFirstSegments(1);\n }\n }\n LOGGER.info(\"Task path '{}' matched project '{}'\", context.getOriginalPath(), matchingProject.getIdentityPath());\n return new ProjectResolutionResult(matchingProject.getOwner(), matchingProject, false, path.getName());\n }",
"public void setMatched(boolean matched) {\r\n this.matched = matched;\r\n }",
"R matchByUri(AsyncRequest request) {\n final R[] routes = urlLookup.get(request.path());\n if (routes == null || routes.length == 0) {\n return null;\n }\n return findFor(routes, request);\n }",
"public String resolvePlayAlias( IApplicationInstance appInstance,\n\t\tString name, ILiveStreamPacketizer liveStreamPacketizer )\n\t{\n\t\tgetLogger().info(\"Resolve Play LiveStreamPacketizer: \" + name);\n\t\ttry\n\t\t{\n\t\t\treturn decryptStreamName( name, unknownIP );\n\t\t}\n\t\tcatch ( Exception ex )\n\t\t{\n\t\t\tgetLogger().warn( \"Error decrypting stream\", ex );\n\t\t\treturn null;\n\t\t}\n\t}",
"public final Field invoke() {\n f d = ac.ewF.d(this.this$0.aYM());\n Field field = null;\n if (d instanceof c) {\n c cVar = (c) d;\n ad aYF = cVar.aYF();\n f.a a = j.eMR.a(cVar.aYG(), cVar.aYI(), cVar.aYJ());\n if (a != null) {\n Class enclosingClass;\n if (l.e(aYF) || j.g(cVar.aYG())) {\n enclosingClass = this.this$0.aYP().aXV().getEnclosingClass();\n } else {\n k bbv = aYF.bbv();\n if (bbv instanceof d) {\n enclosingClass = ae.a((d) bbv);\n } else {\n enclosingClass = this.this$0.aYP().aXV();\n }\n }\n if (enclosingClass != null) {\n try {\n field = enclosingClass.getDeclaredField(a.getName());\n } catch (NoSuchFieldException unused) {\n return field;\n }\n }\n }\n } else if (d instanceof f.a) {\n field = ((f.a) d).getField();\n } else if (!((d instanceof b) || (d instanceof f.d))) {\n throw new NoWhenBranchMatchedException();\n }\n }",
"public QueryMatches interpret(ITMQLRuntime runtime, IContext context, IExpressionInterpreter<?> caller);",
"void matchStart();",
"public MatchOther processResult(ResultItems resultItems, Task task);",
"public T findOne(String arg0) {\n\t\treturn null;\n\t}",
"private boolean invoke(sim.stm.Instruction.Invoke invoke) {\n\t\tString className = invoke.method.classType;\n\t\tsim.classs.Class clazz = executor.getClass(className.substring(1,\n\t\t\t\tclassName.length() - 1));\n\t\tif (clazz == null)\n\t\t\treturn false;\n\t\tsim.method.Method m = executor.getMethod(clazz, invoke.method);\n\t\tif (m == null)\n\t\t\treturn false;\n\n\t\t// target method found\n\n\t\tIPersistentMap pReg = PersistentHashMap.EMPTY;\n\t\t// arguments is stored at p{0..} register\n\t\tfor (int index = 0; index < invoke.args.size(); index++) {\n\t\t\tString src = invoke.args.get(index);\n\t\t\tString reg = \"p\" + index;\n\n\t\t\tpReg = pReg.assoc(reg, mapToSym.valAt(src));\n\t\t}\n\n\t\tstack = stack.cons(new StackItem(clazz, currentMethod, pc, mapToSym,\n\t\t\t\tlabelCount));\n\n\t\tthis.clazz = clazz;\n\t\tthis.currentMethod = m;\n\t\tthis.pc = -1;\n\t\tthis.mapToSym = pReg;\n\t\tthis.labelCount = new HashMap<String, AtomicInteger>();\n\t\tfor (sim.method.Method.Label label : m.labelList) {\n\t\t\tlabelCount.put(label.lab, new AtomicInteger(0));\n\t\t}\n\n\t\treturn true;\n\t}",
"private InputSource urlLookup(ResourceLocation matchingEntry) {\n\n String uri = matchingEntry.getLocation();\n URL baseURL;\n\n //\n // The ResourceLocation may specify a relative url for its\n // location attribute. This is resolved using the appropriate\n // base.\n //\n if (matchingEntry.getBase() != null) {\n baseURL = matchingEntry.getBase();\n } else {\n try {\n baseURL = FILE_UTILS.getFileURL(getProject().getBaseDir());\n } catch (MalformedURLException ex) {\n throw new BuildException(\"Project basedir cannot be converted to a URL\");\n }\n }\n\n URL url;\n\n try {\n url = new URL(baseURL, uri);\n } catch (MalformedURLException ex) {\n url = null;\n }\n\n InputSource source = null;\n if (url != null) {\n try {\n InputStream is = null;\n URLConnection conn = url.openConnection();\n if (conn != null) {\n conn.setUseCaches(false);\n is = conn.getInputStream();\n }\n if (is != null) {\n source = new InputSource(is);\n String sysid = url.toExternalForm();\n source.setSystemId(sysid);\n log(\"catalog entry matched as a URL: '\"\n + sysid + \"'\", Project.MSG_DEBUG);\n }\n } catch (IOException ex) {\n // ignore\n }\n }\n\n return source;\n\n }",
"@SuppressWarnings(\"unchecked\")\n private Optional<Match> classMatchSearch(Class declaringClass) {\n// return memoizer.classMatches(result, declaringClass, () -> {\n List<Match> matches = new ArrayList<>();\n Stack<Class> classes = new Stack<>();\n classes.push(declaringClass);\n while(!classes.isEmpty()) {\n Class cls = classes.pop();\n Match match = result.getMatch(cls);\n\n if(match != null) {\n matches.add(match);\n }\n if(cls.getInterfaces() != null) {\n Stream.of(cls.getInterfaces()).forEach(c -> classes.push(c));\n }\n if(cls.getSuperclass() != null && !cls.getSuperclass().equals(Object.class)) {\n classes.push(cls.getSuperclass());\n }\n }\n\n if(matches.size() == 1) {\n return Optional.of(matches.get(0));\n } else if(matches.size() > 1) {\n // Join all the includes and excludes\n Match unionMatch = new Match();\n matches.forEach(m -> {\n unionMatch.getExcludes().addAll(m.getExcludes());\n unionMatch.getIncludes().addAll(m.getIncludes());\n unionMatch.getTransforms().putAll(m.getTransforms());\n });\n return Optional.of(unionMatch);\n } else {\n return Optional.empty();\n }\n// });\n }",
"Eid matchLocal(Eid eid);",
"public final Object dynamicMethod(MethodToInvoke methodToInvoke, Object obj, Object obj2) {\n switch (C7383l1.f18408a[methodToInvoke.ordinal()]) {\n case 1:\n return new C7447q1();\n case 2:\n return f18630j;\n case 3:\n this.f18636i.makeImmutable();\n return null;\n case 4:\n return new C7448a(null);\n case 5:\n Visitor visitor = (Visitor) obj;\n C7447q1 q1Var = (C7447q1) obj2;\n this.f18633f = visitor.visitString(!this.f18633f.isEmpty(), this.f18633f, !q1Var.f18633f.isEmpty(), q1Var.f18633f);\n this.f18634g = visitor.visitString(!this.f18634g.isEmpty(), this.f18634g, !q1Var.f18634g.isEmpty(), q1Var.f18634g);\n this.f18635h = visitor.visitString(!this.f18635h.isEmpty(), this.f18635h, true ^ q1Var.f18635h.isEmpty(), q1Var.f18635h);\n this.f18636i = visitor.visitList(this.f18636i, q1Var.f18636i);\n if (visitor == MergeFromVisitor.INSTANCE) {\n this.f18632e |= q1Var.f18632e;\n }\n return this;\n case 6:\n CodedInputStream codedInputStream = (CodedInputStream) obj;\n ExtensionRegistryLite extensionRegistryLite = (ExtensionRegistryLite) obj2;\n boolean z = false;\n while (!z) {\n try {\n int readTag = codedInputStream.readTag();\n if (readTag != 0) {\n if (readTag == 10) {\n this.f18633f = codedInputStream.readStringRequireUtf8();\n } else if (readTag == 18) {\n this.f18634g = codedInputStream.readStringRequireUtf8();\n } else if (readTag == 26) {\n this.f18635h = codedInputStream.readStringRequireUtf8();\n } else if (readTag == 34) {\n if (!this.f18636i.isModifiable()) {\n this.f18636i = GeneratedMessageLite.mutableCopy(this.f18636i);\n }\n this.f18636i.add(codedInputStream.readMessage(UserProto$User.parser(), extensionRegistryLite));\n } else if (!codedInputStream.skipField(readTag)) {\n }\n }\n z = true;\n } catch (InvalidProtocolBufferException e) {\n throw new RuntimeException(e.setUnfinishedMessage(this));\n } catch (IOException e2) {\n throw new RuntimeException(new InvalidProtocolBufferException(e2.getMessage()).setUnfinishedMessage(this));\n }\n }\n break;\n case 7:\n break;\n case 8:\n if (f18631k == null) {\n synchronized (C7447q1.class) {\n if (f18631k == null) {\n f18631k = new DefaultInstanceBasedParser(f18630j);\n }\n }\n }\n return f18631k;\n default:\n throw new UnsupportedOperationException();\n }\n return f18630j;\n }",
"@Override\n\tpublic void visit(Matches arg0) {\n\t\t\n\t}",
"@Override\n\tpublic Symbol resolve(String name) {\n\t\tSymbol s = symbols.get(name);\n\t\tif (s != null)\n\t\t\treturn s;\n\t\t\n\t\t// otherwise look in the enclosing scope, if there is one\n\t\tScope sc = enclosingScope;\n\t\twhile (sc != null) {\n\t\t\tSymbol sym = enclosingScope.resolve(name);\n\t\t\tif (sym != null) {\n\t\t\t\treturn sym;\n\t\t\t}\n\t\t\tsc = sc.getEnclosingScope();\n\t\t}\n\t\t// otherwise it doesn't exist\n\t\treturn null;\n\t}",
"final boolean subtreeMatch0(ASTMatcher matcher, Object other) {\n // dispatch to correct overloaded match method\n return matcher.match(this, other);\n }",
"@Test\r\n public void testMatchOptionsFallbackRegex() {\r\n File file = new File(MockFileSystem.getMockRoot().toFile(), \"The Office (US) - 1x02.mkv\");\r\n EpisodeMatch expResult = new EpisodeMatch(\"The Office (US)\", 1, 2);\r\n expResult.setEpisodeFile(file);\r\n TVMatcherOptions o = new TVMatcherOptions(new StandardTVElementMatcher()).fallbackTVMatcher();\r\n EpisodeMatch result = new TVMatcher(o).match(file.toPath());\r\n assertEpisodeMatchEquals(expResult, result);\r\n }"
] | [
"0.5866811",
"0.5646805",
"0.56364274",
"0.56295794",
"0.5599911",
"0.5421024",
"0.5358866",
"0.5328719",
"0.5261183",
"0.52512884",
"0.52508575",
"0.51659864",
"0.5153049",
"0.51412904",
"0.514062",
"0.5095323",
"0.50920343",
"0.50629985",
"0.50470847",
"0.5036154",
"0.50255775",
"0.49645597",
"0.49628842",
"0.492544",
"0.49132797",
"0.4890035",
"0.48772457",
"0.48762357",
"0.48624125",
"0.48449722",
"0.48445877",
"0.4834256",
"0.48189816",
"0.4800403",
"0.47875804",
"0.47867522",
"0.47121117",
"0.46755138",
"0.46711737",
"0.46414793",
"0.46336177",
"0.46179703",
"0.46142837",
"0.45944273",
"0.45936653",
"0.45858014",
"0.45841545",
"0.45784524",
"0.45770615",
"0.45741546",
"0.45597434",
"0.45370737",
"0.45334235",
"0.45265058",
"0.4522189",
"0.45120585",
"0.4509777",
"0.4507405",
"0.45051008",
"0.45003447",
"0.44913256",
"0.44907773",
"0.44868273",
"0.44851345",
"0.44816536",
"0.44510654",
"0.44489992",
"0.4443421",
"0.44429234",
"0.44398746",
"0.44393194",
"0.44384307",
"0.44318545",
"0.4427691",
"0.4424854",
"0.4424159",
"0.44208962",
"0.44162247",
"0.4416076",
"0.44155648",
"0.4414384",
"0.4413334",
"0.4410416",
"0.44049114",
"0.44017002",
"0.44015095",
"0.43983752",
"0.439495",
"0.43931115",
"0.4389998",
"0.4385077",
"0.4384109",
"0.43813014",
"0.43798593",
"0.43792394",
"0.43780148",
"0.43716162",
"0.4370845",
"0.43658626",
"0.43598205"
] | 0.75061595 | 0 |
Provide completions for the specified arguments. | public final CompletionMatch complete(RuntimeContext context, String line) throws CommandException {
CompletionMatcher matcher = getDescriptor().completer();
Completer completer = getCompleter(context);
try {
return matcher.match(completer, line);
}
catch (CompletionException e) {
// command.log.log(Level.SEVERE, "Error during completion of line " + line, e);
return new CompletionMatch(Delimiter.EMPTY, Completion.create());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public List<String> getSuggestions(CommandSource arg0, String arg1, Location<World> arg2) throws CommandException {\n return Collections.emptyList();\n }",
"@Override\n public List<CommandCompletion> complete(@NonNull final CommandCause cause, final ArgumentReader.@NonNull Mutable arguments) throws CommandException {\n return Collections.emptyList();\n }",
"@Override\r\n\tpublic List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] args) {\r\n\t\t\r\n\t\tfinal int leng = args.length;\r\n\t\t\r\n\t\tList<String> completions = new ArrayList<String>();\r\n\t\t\r\n\t\tswitch(leng) {\r\n\t\t\t\r\n\t\tcase 1:\r\n\t\t\tfor(OpsCommandType t : OpsCommandType.values()) {\r\n\t\t\t\tif(t == OpsCommandType.OPS) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcompletions.add(t.getLabel());\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tif(!cmdConfig.getSubArgs(args[0]).isEmpty()) {\r\n\t\t\t\tcompletions.addAll(cmdConfig.getSubArgs(args[0]));\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tcompletions.add(\"true\");\r\n\t\t\tcompletions.add(\"false\");\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn completions;\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tString[] input = {\"i love you\", \"island\",\"ironman\", \"i love leetcode\"};\n\t\tint[] times = {5,3,2,2};\n\t\tAutocompleteSystem sol = new AutocompleteSystem(input, times);\n\t}",
"public void onCompletion(CountedCompleter<?> paramCountedCompleter) {}",
"protected abstract Completer getCompleter(RuntimeContext context) throws CommandException;",
"public void completionActivated(AutocompletionEvent<T> e);",
"public interface AutoCompleter {\n \n /** Sets the callback that will be notified when items are selected. */\n void setAutoCompleterCallback(AutoCompleterCallback callback);\n\n /** \n * Sets the new input to the autocompleter. This can change what is\n * currently visible as suggestions.\n * \n * The returned Future returns true if the lookup for autocompletions\n * completed succesfully. True does not indicate autocompletions are\n * available. It merely indicates that the lookup completed.\n * \n * Because AutoCompleters are allowed to be asynchronous, one should\n * use Future.get or listen to the future in order to see when\n * the future has completed.\n */\n ListeningFuture<Boolean> setInput(String input);\n\n /**\n * Returns true if any autocomplete suggestions are currently available, based the data\n * that was given to {@link #setInput(String)}.\n */\n boolean isAutoCompleteAvailable();\n\n /** Returns a component that renders the autocomplete items. */\n JComponent getRenderComponent();\n\n /** Returns the currently selected string. */\n String getSelectedAutoCompleteString();\n\n /** Increments the selection. */\n void incrementSelection();\n \n /** Decrements the selection. */\n void decrementSelection();\n \n /** A callback for users of autocompleter, so they know when items have been suggested. */\n public interface AutoCompleterCallback {\n /** Notification that an item is suggested. */\n void itemSuggested(String autoCompleteString, boolean keepPopupVisible, boolean triggerAction);\n }\n\n}",
"@Override\n public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {\n List<String> players = new ArrayList<>();\n List<String> completions = new ArrayList<>();\n for (Player player : Bukkit.getOnlinePlayers())\n players.add(player.getName());\n if (args.length == 1) {\n StringUtil.copyPartialMatches(args[0], players, completions);\n }\n return completions;\n }",
"@Override\n protected void addBashCompletions(String currentText, CompletionParameters parameters, ProcessingContext context, CompletionResultSet result) {\n if (currentText.startsWith(\"$\")) {\n return;\n }\n\n PsiElement element = parameters.getPosition();\n PsiElement originalElement = parameters.getOriginalPosition();\n\n if (element.getParent() != null && element.getParent().getParent() instanceof BashParameterExpansion) {\n return;\n }\n\n PsiElement lookupElement = originalElement != null ? originalElement : element;\n BashFunctionVariantsProcessor processor = new BashFunctionVariantsProcessor(lookupElement);\n PsiTreeUtil.treeWalkUp(processor, lookupElement, BashPsiUtils.findFileContext(lookupElement), ResolveState.initial());\n\n Collection<LookupElement> functionItems = CompletionProviderUtils.createPsiItems(processor.getFunctionDefs());\n result.addAllElements(CompletionProviderUtils.wrapInGroup(CompletionGrouping.Function.ordinal(), functionItems));\n\n //offer predefined and built-ins on the second invocation count\n //if no local elements were found, offer the global at the first invocation, if enabled\n int invocationCount = parameters.getInvocationCount();\n if (invocationCount >= 2 || functionItems.isEmpty()) {\n Project project = lookupElement.getProject();\n\n //make sure to use the prefix text of the current lookup element, it might be a composed word\n //element and we need to match the commands with that prefix to avoid illegal suggestions\n String lookupPrefix = findCurrentText(parameters, lookupElement);\n CompletionResultSet commandResult = result.withPrefixMatcher(lookupPrefix);\n\n if (BashProjectSettings.storedSettings(project).isAutocompleteBuiltinCommands()) {\n Collection<LookupElement> globals = CompletionProviderUtils.createItems(LanguageBuiltins.commands, BashIcons.GLOBAL_VAR_ICON);\n commandResult.addAllElements(CompletionProviderUtils.wrapInGroup(CompletionGrouping.GlobalCommand.ordinal(), globals));\n }\n\n if (BashProjectSettings.storedSettings(project).isSupportBash4()) {\n Collection<LookupElement> globals = CompletionProviderUtils.createItems(LanguageBuiltins.commands_v4, BashIcons.GLOBAL_VAR_ICON);\n commandResult.addAllElements(CompletionProviderUtils.wrapInGroup(CompletionGrouping.GlobalCommand.ordinal(), globals));\n }\n\n if (invocationCount >= 2 && BashProjectSettings.storedSettings(project).isAutocompletePathCommands()) {\n //complete the current input with the executables found in $PATH\n Iterable<String> commandNames = BashPathCommandCompletion.getInstance().findCommands(currentText);\n\n commandResult.addAllElements(CompletionProviderUtils.createItems(commandNames, AllIcons.FileTypes.Text));\n\n }\n } else {\n result.addLookupAdvertisement(\"Press twice for built-in and system-wide commands\");\n }\n }",
"@Override\n public void doComplete(CompletionInfo completions, String partial, int flags) {\n if (caseInsensitive) {\n partial = partial.toLowerCase();\n }\n for (String str : valueMap.keySet()) {\n if (str.startsWith(partial)) {\n completions.addCompletion(str);\n }\n }\n }",
"void setAutoCompleterCallback(AutoCompleterCallback callback);",
"void setArguments(List<String> arguments);",
"private String completeBuffer(String buf, ConsoleEditor editor) {\n buf = StringUtils.trimFront(buf);\n if (buf.isEmpty()) {\n return \"\";\n }\n\n editor.completionList.clear();\n\n if (buf.contains(\" \")) {\n StringUtils.tokenize(buf, arguments);\n\n assert (arguments.size() > 1);\n\n // Find the command and call its completion func\n String arg0 = arguments.get(0);\n ConsoleCmd cmd = cmdList.get(arg0);\n IConsoleCompleter complete = null;\n if (cmd != null) {\n if (cmd.isCallable(false)) {\n complete = cmd;\n }\n } else {\n CVar cvar = cvarList.get(arguments.get(0));\n if (cvar != null && cvar.isVisible(false)) {\n complete = cvar.getCompleter();\n }\n }\n if (complete != null) {\n String arg = arguments.size() > 1 ? arguments.get(1) : \"\";\n complete.complete(arg, editor.completionList);\n if (!editor.completionList.isEmpty()) {\n String base = arg0 + \" \";\n for (int i = 0; i < editor.completionList.size(); i++) {\n editor.completionList.set(i, base + editor.completionList.get(i));\n }\n }\n }\n } else {\n cmdCompleter.complete(buf, editor.completionList);\n cvarCompleter.complete(buf, editor.completionList);\n }\n if (editor.completionList.isEmpty()) {\n return buf;\n }\n\n int numEntries = editor.completionList.size();\n\n // Only one option, so return it straight\n if (numEntries == 1) {\n return editor.completionList.get(0);\n }\n\n // Convert to lowercase for faster comparison, then strip the input and calculate the shortest length\n int shortest = 1023;\n String lowerBuf = buf.toLowerCase();\n editor.completionListLower.clear();\n int i;\n for (i = 0; i < numEntries; i++) {\n String s = StringUtils.stripFrontOnce(editor.completionList.get(i).toLowerCase(), lowerBuf);\n editor.completionListLower.add(s);\n if (s.length() < shortest) {\n shortest = s.length();\n }\n }\n\n String returnValue = editor.completionList.get(0);\n if (shortest == 0) {\n returnValue = returnValue.substring(0, buf.length());\n } else {\n // Find the first not matching char\n int pos;\n String firstStr = editor.completionListLower.get(0);\n for (pos = 0; pos < shortest; pos++) {\n // Check if all chars at this position match\n for (i = 1; i < numEntries; i++) {\n if (StringUtils.cmpn(firstStr, editor.completionListLower.get(i), pos) != 0) {\n break;\n }\n }\n // One did not match\n if (i < numEntries) {\n break;\n }\n }\n returnValue = returnValue.substring(0, buf.length() + pos - 1);\n }\n\n return returnValue;\n }",
"private Main(String... arguments) {\n this.operations = new ArrayDeque<>(List.of(arguments));\n }",
"@Override\n public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,\n @NonNull int[] grantResults) {\n if (requestCode == ASK_MULTIPLE_PERMISSION_REQUEST_CODE) {\n if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {\n populateAutoComplete();\n }\n }\n }",
"@Override\n\tpublic List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {\n\t\treturn Arrays.asList(assistant.computeCompletionProposals(context.getViewer(), context.getInvocationOffset()));\n\t}",
"protected List<String> getTabCompletion(final CommandSender sender, final List<String> args) {\n\t\treturn new ArrayList<String>();\n\t}",
"public void complete(T paramT)\n/* */ {\n/* 632 */ setRawResult(paramT);\n/* 633 */ onCompletion(this);\n/* 634 */ quietlyComplete();\n/* 635 */ CountedCompleter localCountedCompleter; if ((localCountedCompleter = this.completer) != null) {\n/* 636 */ localCountedCompleter.tryComplete();\n/* */ }\n/* */ }",
"protected CountedCompleter(CountedCompleter<?> paramCountedCompleter)\n/* */ {\n/* 439 */ this.completer = paramCountedCompleter;\n/* */ }",
"void setArguments(String arguments);",
"public void setArguments(List<String> arguments) {\n this.arguments = arguments;\n }",
"@Ignore @Test\n public void doCompletion() {\n controller.getCompletionList(INPUT,ONTOLOGY,FIELD,bean);\n List<CompletionTerm> compList = bean.getCompletionTermList();\n Assert.assertNotNull(compList);\n Assert.assertTrue(\"Should have >0 comp terms\",compList.size()>0);\n boolean containsInput = false;\n for (CompletionTerm t : compList)\n containsInput |= t.toString().contains(INPUT);\n Assert.assertTrue(\"Should contain \"+INPUT,containsInput);\n }",
"public static void main(String[] args) {\r\n\t\tSystem.out.println(\"Asymmetrik Autocomplete Program\\n\");\r\n\t\tmainMenu();\r\n\t}",
"@Override\n public void execute(String[] args) {\n\n }",
"public static void main(String arg[])\r\n {\r\n try\r\n {\r\n FuzzySearch fuzzy= new FuzzySearch();\r\n ArrayList words= null;\r\n String line;\r\n HashSet catalog= new HashSet();\r\n BufferedReader bufferedReader = new BufferedReader(new FileReader(arg[0]));\r\n // build a catalog of possible words\r\n //\r\n while ((line = bufferedReader.readLine()) !=null)\r\n {\r\n catalog.add(\" \"+line.trim()+\" \");\r\n }\r\n fuzzy.setCatalog(catalog);\r\n\r\n String search = arg[1];\r\n\r\n words = fuzzy.find(search, 40 /* 0-100% */);\r\n Iterator iter = words.iterator();\r\n while(iter.hasNext())\r\n {\r\n Keyword key= (Keyword)iter.next();\r\n System.out.println(\"Matching word: [\"+key.m_keyword+ \"] \"+key.m_percentage+\"%\");\r\n }\r\n }\r\n catch( Exception exc)\r\n {\r\n System.err.println(exc);\r\n }\r\n }",
"public List<FunctionArgument> resolveArguments(String argumentsPattern) throws InvalidArgumentsPatternException;",
"@Override\n public void computedCompletion(String completionId, int replacementOffset, int replacementLength,\n CompletionSuggestion[] completions, boolean last) {\n }",
"protected void parseArgs(String[] args) {\n // Arguments are pretty simple, so we go with a basic switch instead of having\n // yet another dependency (e.g. commons-cli).\n for (int i = 0; i < args.length; i++) {\n int nextIdx = (i + 1);\n String arg = args[i];\n switch (arg) {\n case \"--prop-file\":\n if (++i < args.length) {\n loadPropertyFile(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--schema-name\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n\n // Force upper-case to avoid tricky-to-catch errors related to quoting names\n this.schemaName = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--grant-to\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n\n // Force upper-case because user names are case-insensitive\n this.grantTo = args[i].toUpperCase();\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--target\":\n if (++i < args.length) {\n DataDefinitionUtil.assertValidName(args[i]);\n List<String> targets = Arrays.asList(args[i].split(\",\"));\n for (String target : targets) {\n String tmp = target.toUpperCase();\n nextIdx++;\n if (tmp.startsWith(\"BATCH\")) {\n this.grantJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else if (tmp.startsWith(\"OAUTH\")){\n this.grantOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else if (tmp.startsWith(\"DATA\")){\n this.grantFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n }\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--add-tenant-key\":\n if (++i < args.length) {\n this.addKeyForTenant = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--update-proc\":\n this.updateProc = true;\n break;\n case \"--check-compatibility\":\n this.checkCompatibility = true;\n break;\n case \"--drop-admin\":\n this.dropAdmin = true;\n break;\n case \"--test-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.testTenant = true;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--tenant-key\":\n if (++i < args.length) {\n this.tenantKey = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--tenant-key-file\":\n if (++i < args.length) {\n tenantKeyFileName = args[i];\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--list-tenants\":\n this.listTenants = true;\n break;\n case \"--update-schema\":\n this.updateFhirSchema = true;\n this.updateOauthSchema = true;\n this.updateJavaBatchSchema = true;\n this.dropSchema = false;\n break;\n case \"--update-schema-fhir\":\n this.updateFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n } else {\n this.schemaName = DATA_SCHEMANAME;\n }\n break;\n case \"--update-schema-batch\":\n this.updateJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--update-schema-oauth\":\n this.updateOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schemas\":\n this.createFhirSchema = true;\n this.createOauthSchema = true;\n this.createJavaBatchSchema = true;\n break;\n case \"--create-schema-fhir\":\n this.createFhirSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.schemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schema-batch\":\n this.createJavaBatchSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.javaBatchSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--create-schema-oauth\":\n this.createOauthSchema = true;\n if (nextIdx < args.length && !args[nextIdx].startsWith(\"--\")) {\n this.oauthSchemaName = args[nextIdx];\n i++;\n }\n break;\n case \"--drop-schema\":\n this.updateFhirSchema = false;\n this.dropSchema = true;\n break;\n case \"--drop-schema-fhir\":\n this.dropFhirSchema = Boolean.TRUE;\n break;\n case \"--drop-schema-batch\":\n this.dropJavaBatchSchema = Boolean.TRUE;\n break;\n case \"--drop-schema-oauth\":\n this.dropOauthSchema = Boolean.TRUE;\n break;\n case \"--pool-size\":\n if (++i < args.length) {\n this.maxConnectionPoolSize = Integer.parseInt(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--prop\":\n if (++i < args.length) {\n // properties are given as name=value\n addProperty(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--confirm-drop\":\n this.confirmDrop = true;\n break;\n case \"--allocate-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.allocateTenant = true;\n this.dropTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--drop-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.dropTenant = true;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--freeze-tenant\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.freezeTenant = true;\n this.dropTenant = false;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--drop-detached\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.dropDetached = true;\n this.dropTenant = false;\n this.allocateTenant = false;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--delete-tenant-meta\":\n if (++i < args.length) {\n this.tenantName = args[i];\n this.deleteTenantMeta = true;\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n break;\n case \"--dry-run\":\n this.dryRun = Boolean.TRUE;\n break;\n case \"--db-type\":\n if (++i < args.length) {\n this.dbType = DbType.from(args[i]);\n } else {\n throw new IllegalArgumentException(\"Missing value for argument at posn: \" + i);\n }\n switch (dbType) {\n case DERBY:\n translator = new DerbyTranslator();\n // For some reason, embedded derby deadlocks if we use multiple threads\n maxConnectionPoolSize = 1;\n break;\n case POSTGRESQL:\n translator = new PostgreSqlTranslator();\n break;\n case DB2:\n default:\n break;\n }\n break;\n default:\n throw new IllegalArgumentException(\"Invalid argument: \" + arg);\n }\n }\n }",
"public void registerCommands(Object obj) {\n for (Method method : obj.getClass().getMethods()) {\n if (method.getAnnotation(Command.class) != null) {\n Command command = method.getAnnotation(Command.class);\n\n if (method.getParameterTypes().length > 1 || method.getParameterTypes()[0] != CommandArgs.class) {\n MessageUtil.log(\"&c[KitPvP] Unable to register command \" + method.getName() + \". Unexpected method arguments\");\n continue;\n }\n\n registerCommand(command, command.name(), method, obj);\n for (String alias : command.aliases()) {\n registerCommand(command, alias, method, obj);\n }\n\n } else if (method.getAnnotation(Completer.class) != null) {\n Completer comp = method.getAnnotation(Completer.class);\n\n if (method.getParameterTypes().length != 1 || method.getParameterTypes()[0] != CommandArgs.class) {\n MessageUtil.log(\"&c[KitPvP] Unable to register tab completer \" + method.getName() + \". Unexpected method arguments\");\n continue;\n }\n\n if (method.getReturnType() != List.class) {\n MessageUtil.log(\"&c[KitPvP] Unable to register tab completer \" + method.getName() + \". Unexpected return type\");\n continue;\n }\n\n registerCompleter(comp.name(), method, obj);\n\n for (String alias : comp.aliases()) {\n registerCompleter(alias, method, obj);\n }\n }\n }\n }",
"public void setArgumentStrings(String[] arguments) {\r\n ArrayList<Object> l = new ArrayList<Object>();\r\n l.addAll(Arrays.asList(arguments));\r\n setArguments(l);\r\n }",
"public void processArgs(String[] args){\r\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\r\n\t\tfor (int i = 0; i<args.length; i++){\r\n\t\t\tString lcArg = args[i].toLowerCase();\r\n\t\t\tMatcher mat = pat.matcher(lcArg);\r\n\t\t\tif (mat.matches()){\r\n\t\t\t\tchar test = args[i].charAt(1);\r\n\t\t\t\ttry{\r\n\t\t\t\t\tswitch (test){\r\n\t\t\t\t\tcase 'f': directory = new File(args[i+1]); i++; break;\r\n\t\t\t\t\tcase 'o': orderedFileNames = args[++i].split(\",\"); break;\r\n\t\t\t\t\tcase 'c': output = new File(args[++i]); break;\r\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\r\n\t\t\t\t\tdefault: Misc.printErrAndExit(\"\\nProblem, unknown option! \" + mat.group());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e){\r\n\t\t\t\t\tSystem.out.print(\"\\nSorry, something doesn't look right with this parameter request: -\"+test);\r\n\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\tSystem.exit(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//check to see if they entered required params\r\n\t\tif (directory==null || directory.isDirectory() == false){\r\n\t\t\tSystem.out.println(\"\\nCannot find your directory!\\n\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}",
"java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Argument> \n getArgumentList();",
"java.util.List<com.mwr.jdiesel.api.Protobuf.Message.Argument> \n getArgumentList();",
"Optional<String[]> arguments();",
"ImmutableList<String> mainArgs();",
"public final void propagateCompletion()\n/* */ {\n/* 598 */ CountedCompleter localCountedCompleter1 = this;CountedCompleter localCountedCompleter2 = localCountedCompleter1;\n/* */ int i;\n/* 600 */ do { while ((i = localCountedCompleter1.pending) == 0) {\n/* 601 */ if ((localCountedCompleter1 = (localCountedCompleter2 = localCountedCompleter1).completer) == null) {\n/* 602 */ localCountedCompleter2.quietlyComplete();\n/* 603 */ return;\n/* */ }\n/* */ }\n/* 606 */ } while (!U.compareAndSwapInt(localCountedCompleter1, PENDING, i, i - 1));\n/* */ }",
"public interface AutoCompleterCallback {\n /** Notification that an item is suggested. */\n void itemSuggested(String autoCompleteString, boolean keepPopupVisible, boolean triggerAction);\n }",
"private static void validateCommandLineArguments(AutomationContext context, String extendedCommandLineArgs[])\r\n\t{\r\n\t\t//fetch the argument configuration types required\r\n\t\tCollection<IPlugin<?, ?>> plugins = PluginManager.getInstance().getPlugins();\r\n \t\tList<Class<?>> argBeanTypes = plugins.stream()\r\n\t\t\t\t.map(config -> config.getArgumentBeanType())\r\n\t\t\t\t.filter(type -> (type != null))\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\r\n\t\targBeanTypes = new ArrayList<>(argBeanTypes);\r\n\t\t\r\n\t\t//Add basic arguments type, so that on error its properties are not skipped in error message\r\n\t\targBeanTypes.add(AutoxCliArguments.class);\r\n\r\n\t\t//if any type is required creation command line options and parse command line arguments\r\n\t\tCommandLineOptions commandLineOptions = OptionsFactory.buildCommandLineOptions(argBeanTypes.toArray(new Class<?>[0]));\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tcommandLineOptions.parseBeans(extendedCommandLineArgs);\r\n\t\t} catch(MissingArgumentException e)\r\n\t\t{\r\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t} catch(Exception ex)\r\n\t\t{\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.err.println(commandLineOptions.fetchHelpInfo(COMMAND_SYNTAX));\r\n\t\t\tSystem.exit(-1);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void handleArgument(ArrayList<String> argument) {\n\t\t\n\t}",
"<E> Argument choices(E... values);",
"@Override\n\tprotected GATKArgumentCollection getArgumentCollection() {\n\t\treturn argCollection;\n\t}",
"public abstract void doExecute(A a, TaskCompletionSource<ResultT> taskCompletionSource) throws RemoteException;",
"public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tString useqVersion = IO.fetchUSeqVersion();\n\t\tSystem.out.println(\"\\n\"+useqVersion+\" Arguments: \"+ Misc.stringArrayToString(args, \" \") +\"\\n\");\n\t\tfor (int i = 0; i<args.length; i++){\n\t\t\tString lcArg = args[i].toLowerCase();\n\t\t\tMatcher mat = pat.matcher(lcArg);\n\t\t\tif (mat.matches()){\n\t\t\t\tchar test = args[i].charAt(1);\n\t\t\t\ttry{\n\t\t\t\t\tswitch (test){\n\t\t\t\t\tcase 'r': bedFile = new File(args[++i]); break;\n\t\t\t\t\tcase 's': saveDirectory = new File(args[++i]); break;\n\t\t\t\t\tcase 'c': haploArgs = args[++i]; break;\n\t\t\t\t\tcase 't': numberConcurrentThreads = Integer.parseInt(args[++i]); break;\n\t\t\t\t\tdefault: Misc.printErrAndExit(\"\\nProblem, unknown option! \" + mat.group());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e){\n\t\t\t\t\tMisc.printErrAndExit(\"\\nSorry, something doesn't look right with this parameter: -\"+test+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//check save dir\n\t\tif (saveDirectory == null) Misc.printErrAndExit(\"\\nError: cannot find your save directory!\\n\"+saveDirectory);\n\t\tsaveDirectory.mkdirs();\n\t\tif (saveDirectory.isDirectory() == false) Misc.printErrAndExit(\"\\nError: your save directory does not appear to be a directory?\\n\");\n\n\t\t//check bed\n\t\tif (bedFile == null || bedFile.canRead() == false) Misc.printErrAndExit(\"\\nError: cannot find your bed file of regions to interrogate?\\n\"+bedFile);\n\t\t\n\t\t//check args\n\t\tif (haploArgs == null) Misc.printErrAndExit(\"\\nError: please provide a gatk haplotype caller launch cmd similar to the following where you \"\n\t\t\t\t+ \"replace the $xxx with the correct path to these resources on your system:\\n'java -Xmx4G -jar $GenomeAnalysisTK.jar -T \"\n\t\t\t\t+ \"HaplotypeCaller -stand_call_conf 5 -stand_emit_conf 5 --min_mapping_quality_score 13 -R $fasta --dbsnp $dbsnp -I $bam'\\n\");\n\t\tif (haploArgs.contains(\"~\") || haploArgs.contains(\"./\")) Misc.printErrAndExit(\"\\nError: full paths in the GATK command.\\n\"+haploArgs);\n\t\tif (haploArgs.contains(\"-o\") || haploArgs.contains(\"-L\")) Misc.printErrAndExit(\"\\nError: please don't provide a -o or -L argument to the cmd.\\n\"+haploArgs);\t\n\t\n\t\t//determine number of threads\n\t\tdouble gigaBytesAvailable = ((double)Runtime.getRuntime().maxMemory())/ 1073741824.0;\n\t\t\n\t\n\t}",
"<E> Argument choices(Collection<E> values);",
"public Autocomplete(Term[] terms) {\r\n if (terms == null) {\r\n throw new java.lang.NullPointerException();\r\n }\r\n this.queries = terms;\r\n Arrays.sort(queries);\r\n }",
"public void request(String[] args) {\n String queryByDate = CLIHelper.extractOptionRawValue(QUERY_BY_DATE, args);\n String queryByYearMonth = CLIHelper.extractOptionRawValue(QUERY_BY_YEAR_MONTH, args);\n\n if (!queryByDate.isEmpty()) {\n queryBySpecificDates(queryByDate);\n }\n if (!queryByYearMonth.isEmpty()) {\n queryBySpecificYearMonths(queryByYearMonth);\n }\n if (CLIHelper.optionIsPresent(HELP, args)) {\n printUsage();\n }\n }",
"private void processArgs(String[] args)\n\t{\n\t\tboolean verbose = _verbose.getMatched();\n\n\t\t// disable console echo\n\t\t_writer.println(\"@echo off\");\n\n\t\tfor(int i = 0; i < args.length; ++i)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// try and expand any wildcards not handled by DOS/Windows\n\t\t\t\tString[] xargs = expandArg(args[i]);\n\n\t\t\t\tfor(int j = 0; j < xargs.length; ++j)\n\t\t\t\t{\n\t\t\t\t\tif(verbose)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.err.println(Strings.format(\"fProcessArg\", new Object[] { xargs[j] }));\n\t\t\t\t\t}\n\n\t\t\t\t\tFile pc = new File(xargs[j]);\n\t\t\t\t\t_writer.print(\"set CLASSPATH=%CLASSPATH%;\");\n\t\t\t\t\t_writer.println(pc.getCanonicalPath());\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(IOException e)\n\t\t\t{\n\t\t\t\tSystem.err.println(Strings.format(\"fGeneralError\", new Object[] { e.getMessage() }));\n\t\t\t\t\n\t\t\t\tif(verbose)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tSystem.exit(-1);\n\t\t\t}\n\t\t}\n\t}",
"public CompletionProvider createCodeCompletionProvider() {\n\n\t\t// Add completions for the C standard library.\n\t\tDefaultCompletionProvider cp = new DefaultCompletionProvider();\n\n\t\t// First try loading resource (running from demo jar), then try\n\t\t// accessing file (debugging in Eclipse).\n\t\tClassLoader cl = getClass().getClassLoader();\n\t\tInputStream in = cl.getResourceAsStream(rootFolder + \"\\\\c.xml\");\n\t\ttry {\n\t\t\tif (in!=null) {\n\t\t\t\tcp.loadFromXML(in);\n\t\t\t\tin.close();\n\t\t\t\t//System.out.println(\"*******************File exists1***************\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tFile file = new File(rootFolder, \"c.xml\");\n\t\t\t\t//System.out.println(\"@AutoCompleteProvider completeFile:\" + file.getAbsolutePath());\n\t\t\t\tif (file.exists())\n\t\t\t\t{\n\t\t\t\t\t//System.out.println(\"*******************File exists2***************\");\n\t\t\t\t\tcp.loadFromXML(file);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t}\n\n\t\t// Add some handy shorthand completions.\n\t\tcp.addCompletion(new ShorthandCompletion(cp, \"main\",\n\t\t\t\t\t\t\t\"int main(int argc, char **argv)\"));\n\n\t\t// Add a parameterized completion with a ton of parameters (see #67)\n\t\tFunctionCompletion functionCompletionWithLotsOfParameters = new FunctionCompletion(cp, \"long\", \"int\");\n\t\tParameterizedCompletion.Parameter param = new ParameterizedCompletion.Parameter(\"int\", \"intVal \");\n\t\tparam.setDescription(\"hello world\");\n\t\tfunctionCompletionWithLotsOfParameters.setParams(Arrays.asList(\n\t\t\tparam,\n\t\t\tnew ParameterizedCompletion.Parameter(\"float\", \"floatVal \"),\n\t\t\tnew ParameterizedCompletion.Parameter(\"string\", \"stringVal \"),\n\t\t\tnew ParameterizedCompletion.Parameter(\"int\", \"intVal2 \"),\n\t\t\tnew ParameterizedCompletion.Parameter(\"float\", \"floatVal2 \"),\n\t\t\tnew ParameterizedCompletion.Parameter(\"string\", \"stringVal2 \")\n\t\t\t\n\t\t));\n\t\t\n\t\tcp.addCompletion(functionCompletionWithLotsOfParameters);\n\t\treturn cp;\n\n\t}",
"@Override\n public void initialise(String[] arguments) {\n\n }",
"private static void handleArguments(String[] args) {\n\t\t\n\t\tif ( args.length > 0 && args[0].contains(\"--help\")) {\n\t\t\tSystem.err.println (menuString);\n\t\t\tSystem.err.println(\"Example queue name are: *\");\n\t\t\tSystem.exit(0);\n\t\t} else {\n\n\t\t\tint i = 0;\n\t\t\tString arg;\n\n\t\t\twhile (i < args.length && args[i].startsWith(\"--\")) {\n\t\t\t\targ = args[i++];\n\n\t\t\t\tif (arg.contains(ECS_HOSTS_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsHosts = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_HOSTS_CONFIG_ARGUMENT + \" requires hosts value(s)\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.contains(ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsMgmtAccessKey = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT + \" requires an access-key value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsMgmtSecretKey = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT + \" requires a secret-key value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_MGMT_PORT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsMgmtPort = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_MGMT_PORT_CONFIG_ARGUMENT + \" requires a mgmt port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_ALT_MGMT_PORT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tecsAlternativeMgmtPort = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_ALT_MGMT_PORT_CONFIG_ARGUMENT + \" requires an alternative mgmt port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_MODIFIED_OBJECT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\trelativeObjectModifiedSinceOption = true;\n\t\t\t\t\t\tobjectModifiedSinceNoOfDays = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_MODIFIED_OBJECT_CONFIG_ARGUMENT + \" requires a specified number of days value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_DATA_CONFIG_ARGUMENT)) {\n\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tcollectData = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_DATA_CONFIG_ARGUMENT + \" requires a collect data value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.contains(ELASTIC_HOSTS_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\telasticHosts = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ELASTIC_HOSTS_CONFIG_ARGUMENT + \" requires hosts value(s)\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ELASTIC_PORT_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\telasticPort = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ELASTIC_PORT_CONFIG_ARGUMENT + \" requires a port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ELASTIC_CLUSTER_CONFIG_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\telasticCluster = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( ELASTIC_CLUSTER_CONFIG_ARGUMENT + \" requires a cluster value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECTION_DAY_SHIFT_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\trelativeDayShift = Integer.valueOf(args[i++]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECTION_DAY_SHIFT_ARGUMENT + \" requires a day shift value port value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( ECS_INIT_INDEXES_ONLY_CONFIG_ARGUMENT)) { \n\t\t\t\t\tinitIndexesOnlyOption = true;\n\t\t\t\t} else if (arg.equals( XPACK_SECURITY_USER_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackUser = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SECURITY_USER_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SECURITY_USER_PASSWORD_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackPassword = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SECURITY_USER_PASSWORD_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SSL_KEY_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackSslKey = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SSL_KEY_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SSL_CERTIFICATE_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackSslCertificate = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SSL_CERTIFICATE_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals( XPACK_SSL_CERTIFICATE_AUTH_ARG)) { \n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\txpackSsslCertificateAuth = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println( XPACK_SSL_CERTIFICATE_AUTH_ARG + \" requires a value\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tobjectNamespace = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT + \" requires namespace\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else if (arg.equals(ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT)) {\n\t\t\t\t\tif (i < args.length) {\n\t\t\t\t\t\tbucketName = args[i++];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.err.println(ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT + \" requires bucket\");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.err.println(\"Unrecognized option: \" + arg); \n\t\t\t\t\tSystem.err.println(menuString);\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t} \n\t\t\t}\n\t\t\tif (bucketName!=null) {\n\t\t\t\tif (objectNamespace==null || \"\".equals(objectNamespace)) {\n\t\t\t\t\tSystem.err.println(ECS_COLLECT_OBJECT_DATA_NAMESPACE_ARGUMENT + \" requires namespace, \" + ECS_COLLECT_OBJECT_DATA_NAME_ARGUMENT + \" requires bucket\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(initIndexesOnlyOption) {\n\t\t\t// Check hosts\n\t\t\tif(elasticHosts.isEmpty()) {\t\n\t\t\t\tSystem.err.println(\"Missing Elastic hostname use \" + ELASTIC_HOSTS_CONFIG_ARGUMENT + \n\t\t\t\t\t\t\t\t\"<host1, host2> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t} else {\n\n\t\t\t// Check hosts\n\t\t\tif(ecsHosts.isEmpty()) {\t\n\t\t\t\tSystem.err.println(\"Missing ECS hostname use \" + ECS_HOSTS_CONFIG_ARGUMENT + \n\t\t\t\t\t\t\"<host1, host2> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// management access/user key\n\t\t\tif(ecsMgmtAccessKey.isEmpty()) {\n\t\t\t\tSystem.err.println(\"Missing managment access key use\" + ECS_MGMT_ACCESS_KEY_CONFIG_ARGUMENT +\n\t\t\t\t\t\t\"<admin-username> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// management access/user key\n\t\t\tif(ecsMgmtSecretKey.isEmpty()) {\n\t\t\t\tSystem.err.println(\"Missing management secret key use \" + ECS_MGMT_SECRET_KEY_CONFIG_ARGUMENT +\n\t\t\t\t\t\t\"<admin-password> to specify a value\" );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"List<String> completeEndpointPath(String completionText);",
"public Suggestion (CCombo combo, String[] suggestions) {\n\t\tthis.combo = combo;\n\t\tthis.suggestions = suggestions;\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"What task: \");\r\n\t\tint option = scan.nextInt();\r\n\t\tswitch (option) {\r\n\t\tcase 1:\r\n\t\t\tpositionalNumbers();\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tpassword();\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tmean();\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tbase();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"void setJvmArguments(List<String> arguments);",
"private void init(String... argNames) {\n\t\tfor (int i = 0; i < argNames.length; i++) {\n\t\t\tString name = argNames[i];\n\t\t\t\n\t\t\tString value = System.getProperty(name);\n\t\t\tif (value == null) {\n\t\t\t\tvalue = System.getenv(name);\n\t\t\t}\n\t\t\tif (value == null) {\n\t\t\t\targs.put(name, new Argument(name));\n\t\t\t\t\n\t\t\t} else { \n\t\t\t\targs.put(name, new Argument(name, value));\n\t\t\t}\n\t\t}\n\t\t\n\t\ttry {\n\t\t\trequireMoreArgument(args);\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onGetSuggestionResult(MKSuggestionResult arg0, int arg1) {\n\t\t\t\t\n\t\t\t}",
"String getArguments();",
"public static void main(String[] args) {\n System.out.println(\"Original results:\");\n printResults(candidates);\n \n // replace name\n replaceName(candidates, \"Michael Duffy\", \"John Elmos\");\n printResults(candidates);\n \n //replace votes\n replaceVotes(candidates, \"Mickey Jones\", 2500);\n printResults(candidates);\n \n //replace candidate\n replaceCandidate(candidates, \"Kathleen Turner\", \"John Kennedy\", 8500);\n printResults(candidates);\n \n // insert position\n insertPosition(candidates, 5, \"Mickey Duck\", 14000);\n printResults(candidates);\n \n // add candidate\n insertCandidate(candidates, \"Kathleen Turner\", \"Donald Mouse\", 100);\n printResults(candidates);\n }",
"@Override\n\t\tpublic void onGetSuggestionResult(MKSuggestionResult arg0, int arg1) {\n\t\t\t\n\t\t}",
"public R visit(com.biosimilarity.lift.lib.scalar.Absyn.Completion p, A arg)\n {\n\n\n return null;\n }",
"public abstract ValidationResults validArguments(String[] arguments);",
"public Collection<T> getArgumentsToAttack(T goalArgument);",
"public static void main(String[] args) {\n Cluedo cluedo = new Cluedo();\n cluedo.setUpPlayers();\n CardChoice cc = new CardChoice(cluedo.getPlayerPieces().get(0), cluedo.findRoomCard(\"Billiard\"), cluedo.findWeaponCard(\"Candlestick\"), cluedo.findSuspectCard(\"Prof Plum\"));\n cluedo.verifySuggestion(cc);\n\n }",
"@Test(expectedExceptions=ArgumentsAreMutuallyExclusiveException.class)\n public void mutuallyExclusiveArgumentsTest() {\n String[] commandLine = new String[] {\"--foo\",\"5\"};\n\n parsingEngine.addArgumentSource( MutuallyExclusiveArgProvider.class );\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n\n MutuallyExclusiveArgProvider argProvider = new MutuallyExclusiveArgProvider();\n parsingEngine.loadArgumentsIntoObject( argProvider );\n\n Assert.assertEquals(argProvider.foo.intValue(), 5, \"Argument is not correctly initialized\");\n\n // But when foo and bar come together, danger!\n commandLine = new String[] {\"--foo\",\"5\",\"--bar\",\"6\"};\n\n parsingEngine.parse( commandLine );\n parsingEngine.validate();\n }",
"@Override\n public ValidationResults validArguments(String[] arguments) {\n final int MANDATORY_NUM_OF_ARGUMENTS = 1;\n if (arguments.length == MANDATORY_NUM_OF_ARGUMENTS) {\n // Check if CommandMAN was called on itself (Checker doesn't need to\n // validate CommandMAN twice).\n if (arguments[0].equals(this.getCommandName())) {\n this.toDocument = this; // man will document itself.\n } else {\n // Man will document this command object.\n try {\n this.toDocument = Checker.getCommand(arguments[0], true);\n } catch (Exception ex) {\n return new ValidationResults(false, \"No manual entry for \"\n + arguments[0]); // CMD does not exist.\n }\n }\n return new ValidationResults(true, null);\n }\n return new ValidationResults(false, \"Requires \"\n + MANDATORY_NUM_OF_ARGUMENTS + \" argument.\");\n }",
"public interface FriendAutoCompleterFactory {\n\n /**\n * Returns a FriendLibraryAutocompleter that will supply suggestions based\n * on category.\n */\n public abstract AutoCompleteDictionary getDictionary(SearchCategory categoryToSearch);\n\n /**\n * Returns a FriendLibraryPropertyAutocompleter that will supply suggestions\n * based on category and FilePropertyKey combination.\n */\n public abstract AutoCompleteDictionary getDictionary(SearchCategory categoryToSearch,\n FilePropertyKey filePropertyKey);\n\n}",
"default List<String> tabComplete(CommandSender sender, String[] args) {\n return Collections.emptyList();\n }",
"@Override\n\t\tpublic void onGetSuggestionResult(MKSuggestionResult arg0, int arg1) {\n\n\t\t}",
"public interface AutofillAssistantActionHandler {\n /**\n * Returns the names of available AA actions.\n *\n * <p>This method starts AA on the current tab, if necessary, and waits for the first results.\n * Once AA is started, the results are reported immediately.\n *\n * @param userName name of the user to use when sending RPCs. Might be empty.\n * @param experimentIds comma-separated set of experiment ids. Might be empty\n * @param arguments extra arguments to include into the RPC. Might be empty.\n * @param callback callback to report the result to\n */\n void listActions(String userName, String experimentIds, Bundle arguments,\n Callback<Set<String>> callback);\n\n /**\n * Returns the available AA actions to be reported to the direct actions framework.\n *\n * <p>This method simply returns the list of actions known to AA. An empty string array means\n * either that the controller has not yet been started or there are no actions available for the\n * current website.\n *\n * @return Array of strings with the names of known actions.\n */\n String[] getActions();\n\n /** Performs onboarding and returns the result to the callback. */\n void performOnboarding(String experimentIds, Callback<Boolean> callback);\n\n /**\n * Performs an AA action.\n *\n * <p>If this method returns {@code true}, a definition for the action was successfully started.\n * It can still fail later, and the failure will be reported to the UI.\n *\n * @param name action name, might be empty to autostart\n * @param experimentIds comma-separated set of experiment ids. Might be empty.\n * @param arguments extra arguments to pass to the action. Might be empty.\n * @param callback to report the result to\n */\n void performAction(\n String name, String experimentIds, Bundle arguments, Callback<Boolean> callback);\n}",
"public static void main(String[] args) {\n\t\t\r\n\t\tSystem.setProperty(\"webdriver.chrome.driver\", \"./drivers/chromedriver.exe\");\r\n\t\tChromeDriver driver = new ChromeDriver();\r\n\r\n\t\tdriver.get(\"http://leafground.com/pages/autoComplete.html\");\r\n\t\t \r\n\t\tdriver.manage().window().maximize();\r\n\t\t\r\n\t\tWebElement input=driver.findElementById(\"tags\");\r\n\t\tinput.sendKeys(\"s\");\r\n\t\t\r\n\t\tList<WebElement> listoptions=driver.findElementsByXPath(\"//*[@id=\\'ui-id-1\\']/li\");\r\n\t\t\r\n\t\tfor (WebElement webElement : listoptions) {\r\n\t\t\twebElement.getText().equals(\"Web Services\");\r\n\t\t\twebElement.click();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tdriver.close();\r\n\t\t\r\n\t\t\r\n\r\n\t}",
"@Override\n public IntentDTO run(String... args) {\n this.setup(args);\n\n if (foundStudent != null) {\n ProgressDAO progressDAO = new ProgressDAO();\n Progress progress = progressDAO.findProgress(foundStudent);\n\n if (progress != null) {\n if (progress.name.equals(Progress.reset)) {\n /**\n * The student reseted it's account, reply accordingly\n */\n return (new RegistrationResetIntention()).run(args);\n } else if (progress.name.equals(Progress.initialRegistration)) {\n /**\n * After the student replied to the \"can you help me?\"\n * question, check if they are willing to continue\n */\n return (new InititalRegistrationIntent()).run(args);\n } else if (progress.name.equals(Progress.registrationCanceled)) {\n /**\n * The student replied negatively to the \"can you help me?\"\n * question\n */\n return (new RegistrationCanceledIntent()).run(args);\n } else if (shouldRegisterUniversity(progress)) {\n /**\n * The user replied positively to the \"can you help me?\"\n * question, or we did not find their university or they\n * said we didn't find their university\n */\n return (new RegisterUniversityIntent()).run(args);\n } else if (progress.name.equals(Progress.universityRegistrationResponse)) {\n /**\n * The user replied to the \"what is your university?\"\n * question\n */\n return (new UniversityRegistrationResponseIntent()).run(args);\n } else if (shouldRegisterCourse(progress)) {\n /**\n * The user replied positively to the \"is this your\n * university?\" question, or we did not find their course or\n * they said we didn't find their course\n */\n return (new RegisterCourseIntent()).run(args);\n } else if (progress.name.equals(Progress.courseRegistrationResponse)) {\n /**\n * The user replied to the \"what is your course?\" question\n */\n return (new CourseRegistrationResponseIntent()).run(args);\n } else if (shouldForwardToTermsAcceptanceIntent(progress)) {\n /**\n * The user replied positively to the \"Is this your course?\"\n * question\n */\n return (new TermsAcceptanceIntent()).run(args);\n }\n }\n }\n\n /**\n * The user is not in any valid progress, therefore, we assume it's\n * their first access\n */\n return firstAccess();\n }",
"public interface ISimpleSuggestionPluginProvider extends ISuggestionPluginProvider {\n\n Collection<String> getSuggestions(String input, SuggestionRequestContext context);\n\n}",
"private void initAutoCompleteAdapter(){\n adapterAcGeneric = new GenericAcAdapter(getActivity(),\n android.R.layout.simple_dropdown_item_1line);\n ac_generics.setThreshold(0);\n ac_generics.setAdapter(adapterAcGeneric);\n ac_generics.setOnItemClickListener(\n new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n //selectedText.setText(autoSuggestAdapter.getObject(position));\n genericName = adapterAcGeneric.getObject(position);\n makeApiCallForSearch();\n CommonMethods.hideKeybaord(getActivity());\n }\n });\n ac_generics.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int\n count, int after) {\n }\n @Override\n public void onTextChanged(CharSequence s, int start, int before,\n int count) {\n genericName = \"\";\n handlerGeneric.removeMessages(TRIGGER_AUTO_COMPLETE);\n handlerGeneric.sendEmptyMessageDelayed(TRIGGER_AUTO_COMPLETE,\n AUTO_COMPLETE_DELAY);\n }\n @Override\n public void afterTextChanged(Editable s) {\n }\n });\n handlerGeneric = new Handler(new Handler.Callback() {\n @Override\n public boolean handleMessage(Message msg) {\n if (msg.what == TRIGGER_AUTO_COMPLETE) {\n if (!TextUtils.isEmpty(ac_generics.getText())) {\n // Log.d(\"DEBUG\", \"in generic\");\n makeApiCall(ac_generics.getText().toString(), 1);\n }\n }\n return false;\n }\n });\n\n\n adapterAcCompany = new CompanyAcAdapter(getActivity(),\n android.R.layout.simple_dropdown_item_1line);\n ac_companies.setThreshold(0);\n ac_companies.setAdapter(adapterAcCompany);\n ac_companies.setOnItemClickListener(\n new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n //selectedText.setText(autoSuggestAdapter.getObject(position));\n companyName = adapterAcCompany.getObject(position);\n makeApiCallForSearch();\n CommonMethods.hideKeybaord(getActivity());\n }\n });\n ac_companies.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int\n count, int after) {\n }\n @Override\n public void onTextChanged(CharSequence s, int start, int before,\n int count) {\n companyName = \"\";\n handlerCompany.removeMessages(TRIGGER_AUTO_COMPLETE);\n handlerCompany.sendEmptyMessageDelayed(TRIGGER_AUTO_COMPLETE,\n AUTO_COMPLETE_DELAY);\n }\n @Override\n public void afterTextChanged(Editable s) {\n }\n });\n handlerCompany = new Handler(new Handler.Callback() {\n @Override\n public boolean handleMessage(Message msg) {\n if (msg.what == TRIGGER_AUTO_COMPLETE) {\n if (!TextUtils.isEmpty(ac_companies.getText())) {\n //Log.d(\"DEBUG\", \"in company\");\n makeApiCall(ac_companies.getText().toString(), 2);\n }\n }\n return false;\n }\n });\n\n\n ac_companies.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View view, boolean hasFocus) {\n if (hasFocus) {\n Log.d(\"DEBUG\", \"1\");\n makeApiCall(\"\", 2);\n\n // Toast.makeText(getActivity(), \"Got the focus\", Toast.LENGTH_SHORT).show();\n } else {\n // Toast.makeText(getActivity(), \"Lost the focus\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n ac_generics.setOnFocusChangeListener(new View.OnFocusChangeListener() {\n @Override\n public void onFocusChange(View view, boolean hasFocus) {\n if (hasFocus) {\n Log.d(\"DEBUG\", \"2\");\n makeApiCall(\"\", 1);\n // Toast.makeText(getActivity(), \"Got the focus\", Toast.LENGTH_SHORT).show();\n } else {\n // Toast.makeText(getActivity(), \"Lost the focus\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n\n }",
"public static void main(String[] args) {\n\n List<String> functionArgumentOfA = new ArrayList<>();\n functionArgumentOfA.add(\"Boolean\");\n functionArgumentOfA.add(\"Integer\");\n functionArgumentOfA.add(\"Integer\");\n\n Function functionA = new Function(\"A\", false, functionArgumentOfA);\n\n\n List<String> functionArgumentOfB = new ArrayList<>();\n functionArgumentOfB.add(\"Integer\");\n functionArgumentOfB.add(\"Integer\");\n functionArgumentOfB.add(\"Integer\");\n\n Function functionB = new Function(\"B\", false, functionArgumentOfB);\n\n List<String> functionArgumentOfC = new ArrayList<>();\n functionArgumentOfC.add(\"Integer\");\n\n Function functionC = new Function(\"C\", true, functionArgumentOfC);\n\n FunctionSearchPlugin searchPlugin = new FunctionSearchPlugin();\n\n List<Function> functions = new ArrayList<>();\n\n functions.add(functionA);\n functions.add(functionB);\n functions.add(functionC);\n\n searchPlugin.register(functions);\n //Search for functions now\n //Integer, Integer, Integer should return B and C\n\n List<String> firstSearch = new ArrayList<>();\n firstSearch.add(\"Integer\");\n firstSearch.add(\"Integer\");\n firstSearch.add(\"Integer\");\n\n List<Function> searchResponse = searchPlugin.searchFunctions(firstSearch);\n System.out.format(\"Query: %s\", String.join(\", \", firstSearch) + \"\\n\");\n System.out.println(\"Response: \");\n printFunctionSignature(searchResponse);\n\n\n List<String> secondSearch = new ArrayList<>();\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n secondSearch.add(\"Integer\");\n\n searchResponse = searchPlugin.searchFunctions(secondSearch);\n System.out.format(\"Query: %s\", String.join(\", \", secondSearch) + \"\\n\");\n System.out.println(\"Response: \");\n printFunctionSignature(searchResponse);\n\n }",
"@Override public void onDisplayCompletions(CompletionInfo[] completions) {\n // @note フルスクリーンモードでのエディタからの補完候補を受け取る.フルスクリーンフラグは自分でevaluateさせる\n }",
"private Arguments validateAndReturnType(String[] arguments) {\n\t\tif(arguments == null || arguments.length == 0 || arguments.length > 3)\n \t\treturn Arguments.INVALID;\n\t\tString arg1 = arguments[0].toLowerCase();\n\t\tif(arg1.equals(\"increase\") || arg1.equals(\"reduce\") || arg1.equals(\"inrange\")){\n\t\t\tif(arguments.length != 3)\n\t\t\t\treturn Arguments.INVALID;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(arg1.equals(\"increase\"))\n\t\t\t\t\treturn Arguments.INCREASE;\n\t\t\t\telse if(arg1.equals(\"reduce\"))\n\t\t\t\t\treturn Arguments.REDUCE;\n\t\t\t\telse if(arg1.equals(\"inrange\"))\n\t\t\t\t\treturn Arguments.INRANGE;\n\t\t\t}\n\t\t} else if(arg1.equals(\"next\") || arg1.equals(\"previous\") || arg1.equals(\"count\")) {\n\t\t\tif(arguments.length != 2)\n\t\t\t\treturn Arguments.INVALID;\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(arg1.equals(\"next\"))\n\t\t\t\t\treturn Arguments.NEXT;\n\t\t\t\telse if(arg1.equals(\"previous\"))\n\t\t\t\t\treturn Arguments.PREVIOUS;\n\t\t\t\telse if(arg1.equals(\"count\"))\n\t\t\t\t\treturn Arguments.COUNT;\n\t\t\t}\n\t\t} else if(arg1.equals(\"quit\")) {\n\t\t\treturn Arguments.QUIT;\n\t\t} else\n\t\t\treturn Arguments.INVALID;\n\t\t\t\n\t\treturn null;\n\t}",
"public void processArgs(String[] args){\n\t\tPattern pat = Pattern.compile(\"-[a-z]\");\n\t\tSystem.out.println(\"\\n\"+IO.fetchUSeqVersion()+\" Arguments: \"+Misc.stringArrayToString(args, \" \")+\"\\n\");\n\t\tfor (int i = 0; i<args.length; i++){\n\t\t\tString lcArg = args[i].toLowerCase();\n\t\t\tMatcher mat = pat.matcher(lcArg);\n\t\t\tif (mat.matches()){\n\t\t\t\tchar test = args[i].charAt(1);\n\t\t\t\ttry{\n\t\t\t\t\tswitch (test){\n\t\t\t\t\tcase 'b': bedFile = new File (args[i+1]); i++; break;\n\t\t\t\t\tcase 'm': minNumExons = Integer.parseInt(args[i+1]); i++; break;\n\t\t\t\t\tcase 'a': requiredAnnoType = args[i+1]; i++; break;\n\t\t\t\t\tcase 'h': printDocs(); System.exit(0);\n\t\t\t\t\tdefault: System.out.println(\"\\nProblem, unknown option! \" + mat.group());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Exception e){\n\t\t\t\t\tMisc.printExit(\"\\nSorry, something doesn't look right with this parameter: -\"+test+\"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (bedFile == null || bedFile.canRead() == false) Misc.printExit(\"\\nError: cannot find your bed file!\\n\");\t\n\t}",
"public listArestas_args(listArestas_args other) {\n }",
"public static void main( String[] args )\n {\n CommandLineParser parser = new DefaultParser();\n\n // create the Options\n OptionGroup optgrp = new OptionGroup();\n optgrp.addOption(Option.builder(\"l\")\n .longOpt(\"list\")\n .hasArg().argName(\"keyword\").optionalArg(true)\n .type(String.class)\n .desc(\"List documents scraped for keyword\")\n .build());\n optgrp.addOption( Option.builder(\"r\")\n .longOpt(\"read\")\n .hasArg().argName(\"doc_id\")\n .type(String.class)\n .desc(\"Display a specific scraped document.\")\n .build());\n optgrp.addOption( Option.builder(\"a\")\n .longOpt(\"add\")\n .type(String.class)\n .desc(\"Add keywords to scrape\")\n .build());\n optgrp.addOption( Option.builder(\"s\")\n .longOpt(\"scraper\")\n .type(String.class)\n .desc(\"Start the scraper watcher\")\n .build());\n\n\n\n Options options = new Options();\n options.addOptionGroup(optgrp);\n\n options.addOption( Option.builder(\"n\")\n .longOpt(\"search-name\").hasArg()\n .type(String.class)\n .desc(\"Name of the search task for a set of keywords\")\n .build());\n\n options.addOption( Option.builder(\"k\")\n .longOpt(\"keywords\")\n .type(String.class).hasArgs()\n .desc(\"keywords to scrape. \")\n .build());\n\n options.addOption( Option.builder(\"t\")\n .longOpt(\"scraper-threads\")\n .type(Integer.class).valueSeparator().hasArg()\n .desc(\"Number of scraper threads to use.\")\n .build());\n\n //String[] args2 = new String[]{ \"--add --search-name=\\\"some thing\\\" --keywords=kw1, kw2\" };\n // String[] args2 = new String[]{ \"--add\", \"--search-name\", \"some thing new\", \"--keywords\", \"kw3\", \"kw4\"};\n // String[] args2 = new String[]{ \"--scraper\"};\n// String[] args2 = new String[]{ \"--list\"};\n\n int exitCode = 0;\n CommandLine line;\n try {\n // parse the command line arguments\n line = parser.parse( options, args );\n }\n catch( ParseException exp ) {\n System.out.println( \"Unexpected exception:\" + exp.getMessage() );\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"searchscraper \\n\" +\n \" [--add --search-name=<SearchTask> --keywords=<keyword1> <keyword2> ...]\\n\" +\n \" [--list [<keyword>] ]\\n\" +\n \" [--read <doc_id>]\\n\", options , true);\n System.exit(2);\n return;\n }\n\n if( line.hasOption( \"add\" ) ) {\n // Add Search Task mode\n if(!line.hasOption( \"search-name\" ) || !line.hasOption(\"keywords\")) {\n System.out.println(\"must have search name and keywords when adding\");\n System.exit(2);\n }\n String name = line.getOptionValue( \"search-name\" );\n String[] keywords = line.getOptionValues(\"keywords\");\n System.out.println(\"Got keywords: \" + Arrays.toString(keywords) );\n\n exitCode = add(name, Arrays.asList(keywords));\n\n } else if( line.hasOption( \"list\" ) ) {\n // List Keyword mode\n DataStore ds = new DataStore();\n String keyword = line.getOptionValue( \"list\" );\n System.out.println(\"Listing with keyword = `\" + keyword + \"`\");\n if(keyword == null) {\n List<String > keywords = ds.listKeywords();\n for(String kw : keywords) {\n System.out.println(kw);\n }\n exitCode=0;\n } else {\n List<SearchResult > results = ds.listDocsForKeyword(keyword);\n for(SearchResult kw : results) {\n System.out.println(kw);\n }\n }\n ds.close();\n\n } else if( line.hasOption( \"read\" ) ) {\n // Show a specific document\n String docId = line.getOptionValue( \"read\" );\n if(docId == null) {\n System.err.println(\"read option missing doc_id parameter\");\n exitCode = 2;\n } else {\n\n DataStore ds = new DataStore();\n String result = ds.read(docId);\n\n if (result == null) {\n System.err.println(\"NOT FOUND\");\n exitCode = 1;\n } else {\n System.out.println(result);\n }\n ds.close();\n }\n }\n else if( line.hasOption( \"scraper\" ) ) {\n int numThreads = 1;\n if(line.hasOption( \"scraper-threads\")) {\n String threadString = line.getOptionValue(\"scraper-threads\");\n try {\n numThreads = Integer.parseInt(threadString);\n } catch (NumberFormatException e) {\n System.out.println(\n \"unable to parse number of threads from `\" +\n threadString + \"`\");\n }\n\n }\n // Start scraper mode\n Daemon daemon = new Daemon(numThreads);\n daemon.start();\n } else {\n // generate the help statement\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"searchscraper \\n\" +\n \" [--add --search-name <SearchTask> --keywords <keyword1> <keyword2> ...]\\n\" +\n \" [--list [<keyword>] ]\\n\" +\n \" [--read <doc_id>]\\n\", options , true);\n exitCode = 2;\n }\n\n\n System.exit(exitCode);\n }",
"private void initFixedArgs() {\n\t\t\n\t\t// Fetch arguments and convert to integer\n\t\tObject[] args = this.getArguments();\n\t\t\n\t\t// Assign values\n\t\tcoords = new Point((int) args[coordsXI], (int) args[coordsYI]);\n\t\tspots = (int) args[regularSpotsI] + (int) args[luxurySpotsI] + (int) args[handicapSpotsI];\n\t\tregularSpots = (int) args[regularSpotsI];\n\t\tluxurySpots = (int) args[luxurySpotsI];\n\t\thandicapSpots = (int) args[handicapSpotsI];\n\t\thourlyCost = (int) args[fixedHourlyCostI];\n\t\tluxuryCostPercent = (int) args[fixedLuxuryCostPercentI];\n\t}",
"public static void main(String[] args)\r\n\t{\n\t\tacceptConfig();\r\n\t\treadDictionary();\r\n\t\t//Then, it reads the input file and it prints the word (if contained on the file) or the suggestions\r\n\t\t//(if not contained) in the output file. These files are given by command line arguments\r\n\t\tprocessFile(args[0], args[1]);\r\n\t\t\r\n\t}",
"Result command(@NotNull CommandSender sender, List<String> args);",
"void listActions(String userName, String experimentIds, Bundle arguments,\n Callback<Set<String>> callback);",
"public Autocomplete(Term[] terms)\n {\n this.terms = terms;\n Arrays.sort(terms); //uses Term.compareTo(that) -- Comparable\n // for all other classes, the terms is already sorted lexicographically\n\n }",
"protected void performApply() {\n\n for (int i = 0; i < providers.getItemCount(); i++) {\n\n //TODO: The checkboxes are buggy. Sometimes the provider in the table - representation\n // seems not to be the correct VilArgumentProvier.\n if (providers.getItem(i).getChecked()) {\n VilArgumentProvider.getProvider(i).setActive(true);\n } else {\n VilArgumentProvider.getProvider(i).setActive(false);\n }\n \n //the arguments are in column 4..\n try {\n //Set the free arguments\n VilArgumentProvider.getProvider(i).setFreeArguments(providers.getItem(i).getText(4).trim().toString());\n } catch (NullPointerException e) {\n VilArgumentProvider.getProvider(i).setFreeArguments(\"\");\n }\n \n EASyPreferenceStore.persistVilArgumentProviderStates();\n }\n }",
"void itemSuggested(String autoCompleteString, boolean keepPopupVisible, boolean triggerAction);",
"public static void main(String[] args) {\n\n\t\tint argolas = 8;\n\t\tencheTorre(argolas, torre01);\n\n\t\tSystem.out.println(resolve(argolas, torre01, torre02, torre03) + \" passos.\");\n\t}",
"public interface AutocompletionListener<T> {\n\t/**\n\t * The user has activated a suggested item.\n\t * \n\t * This means the user has explicitly activate the item, i.e., pressed enter on or clicked the\n\t * item.\n\t * @param e the event describing the activation\n\t */\n\tpublic void completionActivated(AutocompletionEvent<T> e);\n}",
"@Test public void completeUsage() {\n\t\tfinal String[] args = new String[]{\"-verbose\", \"-speed\", \"4\", \"-filter\", \"a\", \"-filter\", \"b\", \"x\", \"y\", \"z\"};\n\t\tfinal CliActuators actuators = parser.parse(args, OPTIONS);\n\t\t// -verbose\n\t\tAssert.assertNotNull(actuators.getActuatorById(\"verbose\"));\n\t\t// -speed\n\t\tAssert.assertEquals(\"4\", actuators.getActuatorById(\"speed\").getValue());\n\t\t// -filter\n\t\tfinal CliActuator filter = actuators.getActuatorById(\"filter\");\n\t\tfinal List<String> filters = filter.getValues();\n\t\tAssert.assertEquals(2, filters.size());\n\t\tAssert.assertEquals(\"a\", filters.get(0));\n\t\tAssert.assertEquals(\"b\", filters.get(1));\n\t\t// rests\n\t\tfinal List<String> rests = actuators.getRests();\n\t\tAssert.assertEquals(3, rests.size());\n\t\tAssert.assertEquals(\"x\", rests.get(0));\n\t\tAssert.assertEquals(\"y\", rests.get(1));\n\t\tAssert.assertEquals(\"z\", rests.get(2));\n\t}",
"public getKeys_args(getKeys_args other) {\n }",
"@Override\n public void run(String... strings) throws Exception {\n }",
"public void cmdProc(Interp interp, /* Current interpreter. */\n\tTclObject argv[]) /* Argument list. */\n\tthrows TclException /* A standard Tcl exception. */\n\t{\n\t\tif (argv.length < 2) {\n\t\t\tthrow new TclNumArgsException(interp, 1, argv, \"?options? list\");\n\t\t}\n\n\t\tString command = null;\n\t\tint sortMode = QSort.ASCII;\n\t\tint sortIndex = -1;\n\t\tboolean sortIncreasing = true;\n\t\tboolean unique = false;\n\n\t\tfor (int i = 1; i < argv.length - 1; i++) {\n\t\t\tint index = TclIndex.get(interp, argv[i], validOpts, \"option\", 0);\n\n\t\t\tswitch (index) {\n\t\t\tcase OPT_ASCII: /* -ascii */\n\t\t\t\tsortMode = QSort.ASCII;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_COMMAND: /* -command */\n\t\t\t\tif (i == argv.length - 2) {\n\t\t\t\t\tthrow new TclException(interp,\n\t\t\t\t\t\t\t\"\\\"-command\\\" option must be\"\n\t\t\t\t\t\t\t\t\t+ \" followed by comparison command\");\n\t\t\t\t}\n\t\t\t\tsortMode = QSort.COMMAND;\n\t\t\t\tcommand = argv[i + 1].toString();\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_DECREASING: /* -decreasing */\n\t\t\t\tsortIncreasing = false;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_DICTIONARY: /* -dictionary */\n\t\t\t\tsortMode = QSort.DICTIONARY;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_INCREASING: /* -increasing */\n\t\t\t\tsortIncreasing = true;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_INDEX: /* -index */\n\t\t\t\tif (i == argv.length - 2) {\n\t\t\t\t\tthrow new TclException(interp,\n\t\t\t\t\t\t\t\"\\\"-index\\\" option must be followed by list index\");\n\t\t\t\t}\n\t\t\t\t// this caused 'end-1' to be reported as '-2 - 1' = -3.\n\t\t\t\tsortIndex = Util.getIntForIndex(interp, argv[i + 1], -2);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_INTEGER: /* -integer */\n\t\t\t\tsortMode = QSort.INTEGER;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_REAL: /* -real */\n\t\t\t\tsortMode = QSort.REAL;\n\t\t\t\tbreak;\n\n\t\t\tcase OPT_UNIQUE:\n\t\t\t\tunique = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tTclObject list = argv[argv.length - 1];\n\t\tboolean isDuplicate = false;\n\n\t\t// If the list object is unshared we can modify it directly. Otherwise\n\t\t// we create a copy to modify: this is \"copy on write\".\n\n\t\tif (list.isShared()) {\n\t\t\tlist = list.duplicate();\n\t\t\tisDuplicate = true;\n\t\t}\n\n\t\ttry {\n\t\t\tTclList.sort(interp, list, sortMode, sortIndex, sortIncreasing,\n\t\t\t\t\tunique, command);\n\t\t\tinterp.setResult(list);\n\t\t} catch (TclException e) {\n\t\t\tif (isDuplicate) {\n\t\t\t\tlist.release();\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}",
"String getAskQuery(String... args);",
"public void commandEntered(String cmd)\n {\n String cleaned = StringUtils.cleanWhiteSpace(cmd.trim());\n String args[] = cleaned.split(\" \");\n \tString c = args[0];\n \n Runnable cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n \tif (c.equals(\"name\"))\n cb = new Runnable() { public void run() { cbName(); } };\n else if (c.equals(\"version\")) \n cb = new Runnable() { public void run() { cbVersion(); } };\n else if (c.equals(\"genmove\")) \n cb = new Runnable() { public void run() { cbGenMove(); } };\n else if (c.equals(\"all_legal_moves\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"get_absorb_group\"))\n cb = new Runnable() { public void run() { cbGetAbsorbGroup(); } };\n \n \telse if (c.equals(\"shortest_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \telse if (c.equals(\"shortest_vc_paths\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"compute_dead_cells\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n else if (c.equals(\"vc-build-incremental\"))\n cb = new Runnable() { public void run() { cbComputeDeadCells(); } };\n \n \n else if (c.equals(\"solver-find-winning\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } }; \n \n else if (c.equals(\"find_sealed\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"strengthen_vcs\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n \n else if (c.equals(\"book-depths\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-sizes\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"book-scores\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \telse if (c.equals(\"book-priorities\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"db-get\")) \n cb = new Runnable() { public void run() { cbDBGet(); } };\n \n else if (c.equals(\"vc-connected-to\")) \n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-between-cells\"))\n cb = new Runnable() { public void run() { cbBetweenCells(); } };\n else if (c.equals(\"vc-get-mustplay\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-intersection\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n else if (c.equals(\"vc-union\"))\n cb = new Runnable() { public void run() { cbDisplayPointList(); } };\n \n else if (c.equals(\"eval_twod\")) \n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n else if (c.equals(\"eval_resist\")) \n cb = new Runnable() { public void run() { cbEvalResist(); } };\n else if (c.equals(\"eval_resist_delta\")) \n cb = new Runnable() { public void run() { cbEvalResistDelta(); } };\n \telse if (c.equals(\"eval_influence\"))\n cb = new Runnable() { public void run() { cbDisplayPointText(); } };\n \n else if (c.equals(\"mohex-show-rollout\")) \n cb = new Runnable() { public void run() { cbMohexShowRollout(); } };\n else if (c.equals(\"quit\")) \n cb = new Runnable() { public void run() { cbEmptyResponse(); } };\n \n sendCommand(cmd, cb);\n }",
"public static void main( String[] args )\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tmergeSpellingData( args );\r\n\t\t}\r\n\t\tcatch ( Exception e )\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void processArgs(final String args[]) throws OptionsException {\n\t\tOptionContainer option = null;\n\t\tint quant = -1;\n\t\tint qcount = 0;\n\t\tboolean moreData = false;\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (option == null) {\n\t\t\t\tif (args[i].charAt(0) != '-')\n\t\t\t\t\tthrow new OptionsException(\"Unexpected value: \" + args[i]);\n\n\t\t\t\t// see what kind of argument we have\n\t\t\t\tif (args[i].length() == 1)\n\t\t\t\t\tthrow new OptionsException(\"Illegal argument: '-'\");\n\n\t\t\t\tif (args[i].charAt(1) == '-') {\n\t\t\t\t\t// we have a long argument\n\t\t\t\t\t// since we don't accept inline values we can take\n\t\t\t\t\t// everything left in the string as argument, unless\n\t\t\t\t\t// there is a = in there...\n\t\t\t\t\tfinal String tmp = args[i].substring(2);\n\t\t\t\t\tfinal int pos = tmp.indexOf('=');\n\t\t\t\t\tif (pos == -1) {\n\t\t\t\t\t\toption = opts.get(tmp);\n\t\t\t\t\t\tmoreData = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toption = opts.get(tmp.substring(0, pos));\n\t\t\t\t\t\t// modify the option a bit so the code below\n\t\t\t\t\t\t// handles the moreData correctly\n\t\t\t\t\t\targs[i] = \"-?\" + tmp.substring(pos + 1);\n\t\t\t\t\t\tmoreData = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (args[i].charAt(1) == 'X') {\n\t\t\t\t\t// extra argument, same as long argument\n\t\t\t\t\tfinal String tmp = args[i].substring(1);\n\t\t\t\t\tfinal int pos = tmp.indexOf('=');\n\t\t\t\t\tif (pos == -1) {\n\t\t\t\t\t\toption = opts.get(tmp);\n\t\t\t\t\t\tmoreData = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toption = opts.get(tmp.substring(0, pos));\n\t\t\t\t\t\t// modify the option a bit so the code below\n\t\t\t\t\t\t// handles the moreData correctly\n\t\t\t\t\t\targs[i] = \"-?\" + tmp.substring(pos + 1);\n\t\t\t\t\t\tmoreData = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// single char argument\n\t\t\t\t\toption = opts.get(\"\" + args[i].charAt(1));\n\t\t\t\t\t// is there more data left in the argument?\n\t\t\t\t\tmoreData = args[i].length() > 2 ? true : false;\n\t\t\t\t}\n\n\t\t\t\tif (option != null) {\n\t\t\t\t\t// make sure we overwrite previously set arguments\n\t\t\t\t\toption.resetArguments();\n\t\t\t\t\tfinal int card = option.getCardinality();\n\t\t\t\t\tif (card == CAR_ONE) {\n\t\t\t\t\t\tif (moreData) {\n\t\t\t\t\t\t\toption.addArgument(args[i].substring(2));\n\t\t\t\t\t\t\toption = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tquant = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (card == CAR_ZERO_ONE) {\n\t\t\t\t\t\toption.setPresent();\n\t\t\t\t\t\tqcount = 1;\n\t\t\t\t\t\tquant = 2;\n\t\t\t\t\t\tif (moreData) {\n\t\t\t\t\t\t\toption.addArgument(args[i].substring(2));\n\t\t\t\t\t\t\toption = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (card == CAR_ZERO_MANY) {\n\t\t\t\t\t\toption.setPresent();\n\t\t\t\t\t\tqcount = 1;\n\t\t\t\t\t\tquant = -1;\n\t\t\t\t\t\tif (moreData) {\n\t\t\t\t\t\t\toption.addArgument(args[i].substring(2));\n\t\t\t\t\t\t\tqcount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (card == CAR_ZERO) {\n\t\t\t\t\t\toption.setPresent();\n\t\t\t\t\t\toption = null;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new OptionsException(\"Unknown argument: \" + args[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// store the `value'\n\t\t\t\toption.addArgument(args[i]);\n\t\t\t\tif (++qcount == quant) {\n\t\t\t\t\tquant = 0;\n\t\t\t\t\tqcount = 0;\n\t\t\t\t\toption = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void processArgs(String[] args) throws MalformedURLException, JAXBException, IOException, URISyntaxException, Exception {\n Options options = cli.getOptions(); \n options.addOption(\"collection\", true, \"Data Collection that this Fulfillment request applies to. Defaults to 'default'.\");\n Option idOpt = new Option(\"result_id\", true, \"The result_id being requested.\");\n idOpt.setRequired(true);\n options.addOption(idOpt);\n options.addOption(\"result_part_number\", true, \"The part number being requested. Defaults to '1'.\");\n \n cli.parse(args);\n CommandLine cmd = cli.getCmd();\n\n // Handle default values.\n String collection = cmd.hasOption(\"collection\") ? cmd.getOptionValue(\"collection\") : \"default\";\n int part = cmd.hasOption(\"result_part_number\") ? Integer.parseInt(cmd.getOptionValue(\"result_part_number\")) : 1;\n \n taxiiClient = generateClient(cmd);\n \n // Prepare the message to send.\n PollFulfillment request = factory.createPollFulfillment()\n .withMessageId(MessageHelper.generateMessageId())\n .withCollectionName(collection)\n .withResultId(cmd.getOptionValue(\"result_id\"))\n .withResultPartNumber(BigInteger.valueOf(part)); \n\n doCall(cmd, request);\n \n }",
"void setPossibleValues(List<? extends Suggest<?>> possibleValues);",
"protected void validateArguments( Object[] args ) throws ActionExecutionException {\n\n Annotation[][] annotations = method.getParameterAnnotations();\n for (int i = 0; i < annotations.length; i++) {\n\n Annotation[] paramAnnotations = annotations[i];\n\n for (Annotation paramAnnotation : paramAnnotations) {\n if (paramAnnotation instanceof Parameter) {\n Parameter paramDescriptionAnnotation = (Parameter) paramAnnotation;\n ValidationType validationType = paramDescriptionAnnotation.validation();\n\n String[] validationArgs;\n\n // if we are checking for valid constants, then the\n // args array should contain\n // the name of the array holding the valid constants\n if (validationType == ValidationType.STRING_CONSTANT\n || validationType == ValidationType.NUMBER_CONSTANT) {\n try {\n String arrayName = paramDescriptionAnnotation.args()[0];\n\n // get the field and set access level if\n // necessary\n Field arrayField = method.getDeclaringClass().getDeclaredField(arrayName);\n if (!arrayField.isAccessible()) {\n arrayField.setAccessible(true);\n }\n Object arrayValidConstants = arrayField.get(null);\n\n // convert the object array to string array\n String[] arrayValidConstatnsStr = new String[Array.getLength(arrayValidConstants)];\n for (int j = 0; j < Array.getLength(arrayValidConstants); j++) {\n arrayValidConstatnsStr[j] = Array.get(arrayValidConstants, j).toString();\n }\n\n validationArgs = arrayValidConstatnsStr;\n\n } catch (IndexOutOfBoundsException iobe) {\n // this is a fatal error\n throw new ActionExecutionException(\"You need to specify the name of the array with valid constants in the 'args' field of the Parameter annotation\");\n } catch (Exception e) {\n // this is a fatal error\n throw new ActionExecutionException(\"Could not get array with valid constants - action annotations are incorrect\");\n }\n } else {\n validationArgs = paramDescriptionAnnotation.args();\n }\n\n List<BaseType> typeValidators = createBaseTypes(paramDescriptionAnnotation.validation(),\n paramDescriptionAnnotation.name(),\n args[i], validationArgs);\n //perform validation\n for (BaseType baseType : typeValidators) {\n if (baseType != null) {\n try {\n baseType.validate();\n } catch (TypeException e) {\n throw new InvalidInputArgumentsException(\"Validation failed while validating argument \"\n + paramDescriptionAnnotation.name()\n + e.getMessage());\n }\n } else {\n log.warn(\"Could not perform validation on argument \"\n + paramDescriptionAnnotation.name());\n }\n }\n }\n }\n }\n }",
"@Test\n\tpublic void testComplete1() {\n\t\tString input = \"\";\n\t\twhile (true) {\n\t\t\tGfServiceResultComplete result = null;\n\t\t\ttry {\n\t\t\t\tresult = GF_SERVICE.complete(null, input, FROM, 1);\n\t\t\t} catch (GfServiceException e) {\n\t\t\t\tfail(Constants.MSG_GF_SERVICE_EXCEPTION);\n\t\t\t}\n\t\t\tSet<String> completions = result.getCompletions(FROM);\n\t\t\tif (completions.isEmpty()) {\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tinput += completions.iterator().next() + \" \";\n\t\t\t}\n\t\t}\n\t\tassertEquals(T_COMPLETE_1_OUT + \" \", input);\n\t}"
] | [
"0.59692967",
"0.58587545",
"0.58250284",
"0.57872146",
"0.5700078",
"0.5692881",
"0.5675983",
"0.5667809",
"0.55680233",
"0.55357254",
"0.5517264",
"0.54921466",
"0.5482511",
"0.5441815",
"0.53339916",
"0.52307934",
"0.52197224",
"0.5219719",
"0.52163637",
"0.5215435",
"0.52041405",
"0.5203752",
"0.51566845",
"0.51395357",
"0.50265676",
"0.50195324",
"0.5016035",
"0.50094634",
"0.49889153",
"0.49869162",
"0.49837682",
"0.49644887",
"0.4948543",
"0.4948543",
"0.49371967",
"0.49122384",
"0.49107113",
"0.49093956",
"0.48966277",
"0.48932433",
"0.48822853",
"0.48815238",
"0.48781824",
"0.48633483",
"0.48631316",
"0.48604894",
"0.48568434",
"0.4851911",
"0.4844778",
"0.4834395",
"0.48286557",
"0.48239744",
"0.48128656",
"0.47993445",
"0.47923136",
"0.47826102",
"0.47745502",
"0.47734624",
"0.47696185",
"0.47661835",
"0.476559",
"0.47577724",
"0.4757478",
"0.47492096",
"0.47458383",
"0.47232023",
"0.47196496",
"0.47178033",
"0.47103682",
"0.4709389",
"0.47014925",
"0.46902296",
"0.4675461",
"0.467253",
"0.46694115",
"0.46681443",
"0.46634692",
"0.46579567",
"0.46533915",
"0.463177",
"0.46314028",
"0.4630081",
"0.46290278",
"0.46240398",
"0.46197906",
"0.46149167",
"0.46141338",
"0.46090478",
"0.46068615",
"0.4605443",
"0.46052098",
"0.45999378",
"0.45992175",
"0.45986205",
"0.45878518",
"0.458512",
"0.45850548",
"0.45816472",
"0.45755276",
"0.45711446",
"0.45694044"
] | 0.0 | -1 |
Returns a description of the command or null if none can be found. | public final String describe(String line, Format format) throws CommandException {
CommandDescriptor<T> descriptor = getDescriptor();
InvocationMatcher<T> analyzer = descriptor.matcher();
InvocationMatch<T> match;
try {
match = analyzer.parse(line);
}
catch (org.crsh.cli.impl.SyntaxException e) {
throw new CommandException(ErrorKind.SYNTAX, "Syntax exception when evaluating " + descriptor.getName(), e);
}
return describe(match, format);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Optional<String> command();",
"List<String> getCommandDescription();",
"@Override\n public Optional<Text> getShortDescription(CommandSource source) {\n return desc;\n }",
"public String getCommand(){\n return getCommand(null);\n }",
"MBeanInfo getCommandDescription(String commandType);",
"java.lang.String getCommand();",
"public abstract String commandDocumentation();",
"public Optional<String> getDescription() {\n return Optional.ofNullable(description);\n }",
"public Optional<String> getDescription() {\n\t\treturn Optional.ofNullable(_description);\n\t}",
"public Optional<String> getDescription() {\n\t\treturn Optional.ofNullable(_description);\n\t}",
"String getCommand();",
"public Optional<String> desc() {\n\t\t\treturn Optional.ofNullable(_description);\n\t\t}",
"@Override\n public String toString() {\n return (\"Command \" + this.getCommandName().toUpperCase() + \":\\n\" + this\n .commandDocumentation());\n }",
"@org.jetbrains.annotations.Nullable()\n public abstract java.lang.String getDescription();",
"@Override\n public Optional<Text> getHelp(CommandSource source) {\n return help;\n }",
"public String getDescription() {\n String description = null;\n if ( !descriptions.isEmpty() ) {\n description = (String)descriptions.get(0);\n }\n return description;\n }",
"@Nullable\n public abstract String getDescription();",
"public String getHelp();",
"public String readCommand() {\n return scanner.nextLine();\n }",
"public java.lang.String getCommand() {\n java.lang.Object ref = command_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n command_ = s;\n }\n return s;\n }\n }",
"public String getDescription() {\n/* 179 */ return getDescription((String)null);\n/* */ }",
"@Override\n public String commandDocumentation() {\n return (\"Displays the documentation of various commands.\");\n }",
"@Nullable\n public abstract String description();",
"public String getToolCommand();",
"public Object getDescription() {\n\t\treturn null;\n\t}",
"@JsonIgnore\n\tdefault short getCmd() {\n\t\tMessageMeta annotation = getClass().getAnnotation(MessageMeta.class);\n\t\tif (annotation != null) {\n\t\t\treturn annotation.cmd();\n\t\t}\n\t\treturn 0;\n\t}",
"public abstract String getCommand();",
"@Override\n public String getDescription() {\n return String.format(COMMAND_DESCRIPTION, pastDate);\n }",
"String getDescription() {\n if (description == null) {\n return null;\n }\n if (basicControl) {\n return String.format(\"%s %s\", context.getString(description), context.getString(R.string.basicControl));\n }\n return context.getString(description);\n }",
"@Override\n\tpublic String matchCommand() {\n\t\treturn null;\n\t}",
"public String getCommand() { return command; }",
"public String getCommand() {\r\n return command;\r\n }",
"public String getDescription() {\n\t\treturn desc != null ? desc : getDirectory().getAbsolutePath();\n\t}",
"@Override\n public String getShortDescription() {\n final Part lp = (Part) getAttachedAnnotatable();\n\n if (lp == null) {\n return null;\n }\n \n RP.post(new Runnable() {\n @Override\n public void run() {\n evalExpression(lp);\n }\n });\n\n return null;\n }",
"public java.lang.String getCommand() {\n java.lang.Object ref = command_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n command_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public String findDescription(String input) {\n assert input.length() > 0;\n\n String cmd = input.split(\"\\\\s+\", 2)[1];\n\n if (cmd.contains(\"/by\")) {\n return cmd.split(\"/by\")[0];\n } else if (cmd.contains(\"/at\")) {\n return cmd.split(\"/at\")[0];\n } else {\n return null;\n }\n }",
"public String getCommand()\r\n\t{\r\n\t\treturn command;\r\n\t}",
"public String getCommand() {\n return this.command;\n }",
"public String showHelp() {\r\n return ctrlDomain.getHidatoDescription();\r\n }",
"public String getCommand() {\n return command;\n }",
"public String getCommand() {\n return command;\n }",
"public String getDescription(String _opt){\r\n\t\treturn getOption(_opt).getDescription();\r\n\t}",
"public CommandInfo getInfo() {\n\t\treturn info;\n\t}",
"java.lang.String getDesc();",
"public network.message.PlayerResponses.Command getCommand() {\n if (commandBuilder_ == null) {\n if (responseCase_ == 2) {\n return (network.message.PlayerResponses.Command) response_;\n }\n return network.message.PlayerResponses.Command.getDefaultInstance();\n } else {\n if (responseCase_ == 2) {\n return commandBuilder_.getMessage();\n }\n return network.message.PlayerResponses.Command.getDefaultInstance();\n }\n }",
"@Override\r\n\tpublic String getShortDescr() {\n\t\treturn null;\r\n\t}",
"public String getCommand() {\n\n return command;\n }",
"public String getHelp() {\r\n String res = \"You can use the following commands:\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"north\\\" to go towards the north\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"south\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"east\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"west\\\" to go towards the south\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"attack\\\" to attack a monster\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"look\\\" to look around in the room\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"search\\\" to search the room for treasure\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"use\\\" to use somthing in your inventory\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"gear\\\" to see what gear you got equipped\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"inventory\\\" to see what gear you have in your inventory\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"savegame\\\" to save your progress\" + System.getProperty(\"line.separator\");\r\n res += \"Type \\\"stop\\\" to quit the game.\" + System.lineSeparator();\r\n return res;\r\n }",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"java.lang.String getDescription();",
"@Nullable\n public String getDescription() {\n return description;\n }",
"@Nullable\n public String getDescription() {\n return description;\n }",
"public interface Command {\n\n String getName();\n\n String getUsage();\n\n String getShortDescription();\n\n void execute(String command, PrintStream out);\n}",
"@Override\r\n\tpublic String getCOMMAND() {\n\t\treturn COMMAND;\r\n\t}",
"public String Command() {\n\treturn command;\n }",
"String getHelpString();",
"public String getDescription() {\n\t\tif (description == null)\n\t\t\treturn \"No description\";\n\t\treturn description;\n\t}",
"public String getDescription()\n\t{ //begin vpj-cd e-evolution 30.09.2005\n\t\t//return s_driver.toString();\n try\n\t\t{\n\t\t\tif (s_driver == null)\n\t\t\t\tgetDriver();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t}\n\t\tif (s_driver != null)\n\t\t\treturn s_driver.toString();\n\t\treturn \"No Driver\";\n //end vpj-cd e-evolution 30.09.2005\n\t}",
"public Pit getCommandPit();",
"@Nullable\n public String getDescription() {\n return this.description;\n }",
"String getHelpText();",
"public String \n getCommand() \n {\n return pCommand;\n }",
"public String getCommand(){\n return command;\n }",
"@Override\n\tpublic String toString() {\n\t\treturn CMD_NAME;\n\t}",
"String getDescriptionIfNotMet();",
"public String getDescription(){\r\n \tString retVal = this.description;\r\n return retVal;\r\n }",
"@NotNull\n String getDescription();",
"public String getDescription() {\n if ((desc == null) && (forVar != null)) {\n Attribute att = forVar.findAttributeIgnoreCase(CDM.LONG_NAME);\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n\n if (desc == null) {\n att = forVar.findAttributeIgnoreCase(\"description\");\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n }\n\n if (desc == null) {\n att = forVar.findAttributeIgnoreCase(CDM.TITLE);\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n }\n\n if (desc == null) {\n att = forVar.findAttributeIgnoreCase(CF.STANDARD_NAME);\n if ((att != null) && att.isString())\n desc = att.getStringValue();\n }\n }\n return (desc == null) ? null : desc.trim();\n }",
"public String getLongDescription()\n {\n return description + \".\\n\" + getExitString();\n }",
"public Command commandType() {\r\n if (command.startsWith(\"push\")) {\r\n return Command.C_PUSH;\r\n } else if (command.startsWith(\"pop\")) {\r\n return Command.C_POP;\r\n } else if (isArithmeticCmd()) {\r\n return Command.C_ARITHMETIC;\r\n } else if (command.startsWith(\"label\")) {\r\n return Command.C_LABEL;\r\n } else if (command.startsWith(\"goto\")) {\r\n return Command.C_GOTO;\r\n } else if (command.startsWith(\"if-goto\")) {\r\n return Command.C_IF;\r\n } else if (command.startsWith(\"function\")) {\r\n return Command.C_FUNCTION;\r\n } else if (command.startsWith(\"call\")) {\r\n return Command.C_CALL;\r\n } else if (command.startsWith(\"return\")) {\r\n return Command.C_RETURN;\r\n } else {\r\n return null;\r\n }\r\n }",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();",
"public String getDescription();"
] | [
"0.7189373",
"0.6939134",
"0.6732174",
"0.6724085",
"0.67104584",
"0.66026855",
"0.6582228",
"0.6523726",
"0.64664876",
"0.64664876",
"0.643632",
"0.64305955",
"0.6314527",
"0.6284216",
"0.62654865",
"0.62043124",
"0.615544",
"0.61113936",
"0.61031",
"0.60799044",
"0.6079352",
"0.60652214",
"0.6058605",
"0.6058056",
"0.6046965",
"0.6046464",
"0.6025951",
"0.6024883",
"0.6022724",
"0.6018528",
"0.601242",
"0.59918594",
"0.59377",
"0.5930061",
"0.5924957",
"0.592201",
"0.59200263",
"0.59199405",
"0.5917812",
"0.5895701",
"0.5895701",
"0.5893372",
"0.5861015",
"0.58561414",
"0.58543193",
"0.5852498",
"0.5852318",
"0.5844357",
"0.5842566",
"0.5842566",
"0.5842566",
"0.5842566",
"0.5842566",
"0.5842566",
"0.5842566",
"0.5842566",
"0.5842566",
"0.5837073",
"0.5837073",
"0.5829883",
"0.5828534",
"0.5828418",
"0.58265674",
"0.5826145",
"0.57930404",
"0.57913536",
"0.57874066",
"0.57819694",
"0.57762045",
"0.5775735",
"0.5770505",
"0.5767739",
"0.5761813",
"0.5755021",
"0.57503766",
"0.57468796",
"0.57467294",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357",
"0.5741357"
] | 0.0 | -1 |
Provides an invoker for the command line specified as a command line to parse. | public final CommandInvoker<?, ?> resolveInvoker(String line) throws CommandException {
return resolveCommand(line).getInvoker();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract ArgumentParser makeParser();",
"protected abstract void go(CommandLine line) throws Exception;",
"public interface CommandLineParser {\n\n CommandLine parse(Options options, String[] arguments) throws ParseException;\n CommandLine parse(Options options, String[] arguments, boolean stopAtNonOption) throws ParseException;\n\n}",
"public E parse(String argument);",
"void main(CommandLine cmd);",
"public void execute() {\n\t\ttry {\n\t\t\tMethod method = this.getClass().getMethod(parseMethod(), new Class[0]);\n\t\t\tmethod.invoke(this, new Object[0]);\n\t\t} catch (NoSuchMethodException | SecurityException e) {\n\t\t\tSystem.out.println(\"Unknown option: \" + command);\n\t\t} catch (IllegalAccessException | IllegalArgumentException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Invalid usage of: \" + command + \", the following error \" + \"was given: \" + e.getMessage());\n\t\t} catch (InvocationTargetException e) {\n\t\t\tSystem.out.println(\"An error occurred while executing '\" + command + \"'. The \"\n\t\t\t\t\t+ \"following error was given: \" + e.getCause());\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public abstract String run(String args);",
"Result invoke(Invoker<?> invoker, Invocation invocation);",
"HospitalCommand provideCommand(String uri);",
"public static void main(String[] args) {\r\n\t\tCommandLine top = new CommandLine(new Main());\r\n\t\tif (args.length == 0) {\r\n\t\t\ttop.usage(System.out);\r\n\t\t}\r\n\t\t\r\n\t\tList<CommandLine> parsedCommands;\r\n\t\ttry {\r\n\t\t parsedCommands = top.parse(args);\r\n\t\t} catch (ParameterException ex) { // incorrect user input for one of the subcommands\r\n\t\t LOG.severe(\"Error parsing command line: \" + ex.getMessage());\r\n\t\t ex.getCommandLine().usage(System.out); // get the offended subcommand from the exception\r\n\t\t return;\r\n\t\t}\r\n\t\t\r\n\t\tfor (CommandLine parsed : parsedCommands) {\r\n\t\t if (parsed.isUsageHelpRequested()) {\r\n\t\t parsed.usage(System.out);\r\n\t\t return;\r\n\t\t } else if (parsed.isVersionHelpRequested()) {\r\n\t\t parsed.printVersionHelp(System.out);\r\n\t\t return;\r\n\t\t }\r\n\t\t}\r\n\t\tObject last = parsedCommands.get(parsedCommands.size() - 1).getCommand();\r\n\t\tif (last instanceof Runnable) {\r\n\t\t ((Runnable) last).run();\r\n\t\t return;\r\n\t\t}\r\n\t}",
"public static void main(String[] args)\r\n {\r\n CommandParser parser = new CommandParser(args[0]);\r\n parser.parseFile();\r\n }",
"public interface CommandProvider {\n /**\n * Provide command hospital command.\n *\n * @param uri the uri\n * @return the hospital command\n */\n HospitalCommand provideCommand(String uri);\n}",
"public Object invoke(String name, Object... args) throws Exception;",
"void parse(String[] args);",
"private void parseCommand(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tString commandString;\n\t\tif(tokens.length == 4) {\n\t\t\tcommandString = tokens[2] + \" \" + tokens[3];\n\t\t}\n\t\telse if(tokens.length == 3) {\n\t\t\tcommandString = tokens[2];\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Invalid command argument\");\n\t\t}\n\t\tthis.registerCommand(tokens[1].charAt(0), commandString);\n\t}",
"public CommandLine parse(String[] args ) throws ParseException\n {\n String[] cleanArgs = CleanArgument.cleanArgs( args );\n CommandLineParser parser = new DefaultParser();\n return parser.parse( options, cleanArgs );\n }",
"@Override\n\t\tpublic String execute(String line) {\n\t\t\tString[] command = line.split(\" \"); \n\t\t\tJCommander.newBuilder()\n\t\t\t .addObject(settings)\n\t\t\t .build()\n\t\t\t .parse(command);\n\t\t\t\n\t\t\treturn settings.execute();\n\t\t}",
"public Command parse(String[] s) {\n\t\t\n\t\tif(s.length == 1 && s[0].equalsIgnoreCase(\"RUN\"))\n\t\t\treturn new Run();\n\t\telse return null;\n\t}",
"public interface CommandParser {\n String[] splitStringIntoCommands(String string);\n String[] splitCommandIntoParams(String string);\n String convertArrayToString(String... stringArray);\n}",
"void parse(String[] args) throws Exception;",
"public Invoker() {\n\n\t\twhile (true) {\n\t\t\tSystem.out.println(execute(scanner.next()));\n\t\t}\n\t}",
"public CuratorClientArgParser( String[] commandLineArgs ) {\n confirmArgsAreGood( commandLineArgs );\n\n testing = false;\n for( int crntArg = 0; crntArg < commandLineArgs.length; crntArg++ ) {\n if( commandLineArgs[crntArg].equals(\"-host\") ) {\n host = commandLineArgs[++crntArg];\n }\n else if( commandLineArgs[crntArg].equals(\"-port\") ) {\n port = Integer.parseInt( commandLineArgs[++crntArg] );\n }\n else if( commandLineArgs[crntArg].equals(\"-in\") ) {\n inputDir = new File( commandLineArgs[++crntArg] );\n }\n else if( commandLineArgs[crntArg].equals(\"-out\") ) {\n outputDir = new File( commandLineArgs[++crntArg] );\n }\n else if( commandLineArgs[crntArg].equals(\"-mode\") ) {\n try {\n mode = CuratorClient.CuratorClientMode.fromString( commandLineArgs[++crntArg] );\n } catch ( IllegalArgumentException e ) {\n System.out.println( \"Please specify either 'PRE' or 'POST' \"\n + \"(pre-Hadoop and post-Hadoop, \"\n + \"respectively) as the mode.\");\n }\n }\n else if( commandLineArgs[crntArg].equals(\"-test\") ) {\n testing = true;\n }\n }\n\n if( outputDir == null ) {\n outputDir = new File( inputDir, \"output\" );\n }\n }",
"public static Command parse(String input) throws DukeException {\r\n String[] inputArr = input.split(\" \", 2);\r\n String command = inputArr[0];\r\n\r\n switch (command) {\r\n case \"bye\":\r\n return new ExitCommand();\r\n case \"list\":\r\n return new ListCommand();\r\n case \"done\":\r\n try {\r\n return new DoneCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n mark as done!\");\r\n }\r\n case \"delete\":\r\n try {\r\n return new DeleteCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n delete!\");\r\n }\r\n case \"todo\":\r\n try {\r\n return new AddCommand(new Todo(inputArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"The description of a todo cannot be empty.\");\r\n }\r\n case \"deadline\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /by \");\r\n return new AddCommand(new Deadline(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n deadline <description> /by <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"event\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /at \");\r\n return new AddCommand(new Event(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n event <description> /at <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"find\":\r\n try {\r\n return new FindCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify what you are searching for!\");\r\n }\r\n default:\r\n throw new DukeException(\"I'm sorry, but I don't know what that means!\");\r\n }\r\n }",
"public static String interpreter(String[] commandLineArguments) throws ClassNotFoundException, SQLException{\n \t if (commandLineArguments.length < 1) \n \t { \n \t System.out.println(\"Please input help\"); \n \t } \n \t //displayInput(commandLineArguments);\n \t //System.out.println(\"\");\n \t return parseCommand(commandLineArguments); \n }",
"public static void main(String[] args) {\n\t\tReceiver re = new Receiver();\r\n\t\tCommand cmd = new MyCommend(re);\r\n\t\tInvoker inv = new Invoker(cmd);\r\n\t\tinv.action();\r\n\t}",
"private CommandLine() {\n\t}",
"InvokeInfo getInvokeInfo(final String cmdString)\n throws IllegalUsageException, WrongNumberOfOperandsException, CmdNotFoundException\n {\n InvokeInfo invokeInfo = new InvokeInfo();\n\n int colonIndex = cmdString.indexOf(\":\");\n int leftParenIndex = cmdString.indexOf('(');\n\n String operationPortion = null;\n\n /*\n first determine if it's the \":\" form or the \"(...)\" form\n - if a colon preceeds a left paren, then its the xxx: form\n - if the last char is a right paren, and the left paren preceeds it, then its the paren form\n */\n if (colonIndex >= 1 && (colonIndex < leftParenIndex || leftParenIndex < 0))\n {\n invokeInfo.argList = cmdString.substring(colonIndex + 1, cmdString.length());\n operationPortion = cmdString.substring(0, colonIndex);\n }\n else if (leftParenIndex >= 1 && cmdString.charAt(cmdString.length() - 1) == ')')\n {\n invokeInfo.argList = cmdString.substring(leftParenIndex + 1, cmdString.length() - 1);\n operationPortion = cmdString.substring(0, leftParenIndex);\n\n }\n else\n {\n throw new CmdNotFoundException(cmdString, \"command not found\");\n }\n\n if (invokeInfo.argList.length() == 0)\n {\n invokeInfo.argList = null;\n }\n\n // now determine the targets\n int dotIndex = operationPortion.indexOf('.');\n if (dotIndex < 0)\n {\n invokeInfo.operationName = operationPortion;\n invokeInfo.targets = getTargets();\n }\n else if (dotIndex >= 1)\n {\n if (getOperands().length >= 1)\n {\n throw new IllegalUsageException(\"Can't supply operands when using alias invocation form\");\n }\n\n invokeInfo.operationName = operationPortion.substring(dotIndex + 1, operationPortion.length());\n invokeInfo.targets = new String[]\n {\n operationPortion.substring(0, dotIndex)\n };\n }\n else\n {\n throw new IllegalUsageException(cmdString);\n }\n\n return (invokeInfo);\n }",
"public ViewScheCommand(String line) throws DukeException {\n String[] arrOfStr = line.split(\"\\\\s+\");\n\n this.option = arrOfStr[0].trim();\n if (option.equals(\"/all\")) {\n if (arrOfStr.length > 1) {\n this.date = Parser.parseDate(arrOfStr[1].trim());\n sortByDate = true;\n }\n } else if (option.equals(\"/member\")) {\n this.memberName = arrOfStr[1].trim();\n if (arrOfStr.length > 2) {\n this.date = Parser.parseDate(arrOfStr[2].trim());\n sortByDate = true;\n }\n }\n }",
"@Override\n\tpublic Command parse(String[] s) {\n\t\tif (s.length==1 && s[0].equalsIgnoreCase(\"HELP\"))\n\t\t\treturn new Help(); \n\t\telse return null;\n\t}",
"interface OneArgCommand {\n void doCommand(String a);\n }",
"public static Command parse(String str) throws DukeException {\n\n String[] arr = str.split(\" \", 2);\n if (arr.length < 1) {\n throw new DukeException(\"No command was given.\");\n }\n String firstWord = arr[0];\n if (str.equalsIgnoreCase(\"bye\")) {\n return new ExitCommand();\n } else if (str.equalsIgnoreCase(\"list\")) {\n return new ListCommand();\n } else {\n Action action = parseFirstWord(firstWord.toLowerCase());\n\n if (arr.length < 2 && (action == Action.Done || action == Action.Delete)) {\n throw new DukeException(\"duke.task.Task number for \" + firstWord + \" is not given.\");\n } else if (arr.length < 2 || arr[1].isBlank()) {\n throw new DukeException(\"The description of \" + firstWord + \" cannot be empty\");\n } else {\n return actionToCommand(action, arr[1]);\n }\n }\n }",
"Argument<T> parse(Function<String, ParseResult<T>> parser);",
"private static void parseCommandLine(String[] args) {\r\n\t\tif (args.length != 3)\r\n\t\t\terror(\"usage: Tester server port url-file\");\r\n\t\t\t\r\n\t\tserverName = args[0];\r\n\t\tserverPort = Integer.parseInt(args[1]);\r\n\t\turlFileName = args[2];\r\n\t}",
"private void handleInvocationCommand() throws IOException, ClassNotFoundException {\r\n final Object context = m_in.readObject();\r\n final String handle = (String) m_in.readObject();\r\n final String methodName = (String) m_in.readObject();\r\n final Class[] paramTypes = (Class[]) m_in.readObject();\r\n final Object[] args = (Object[]) m_in.readObject();\r\n Object result = null;\r\n try {\r\n result = m_invoker.invoke(handle, methodName, paramTypes, args, context);\r\n } catch (Exception e) {\r\n result = e;\r\n }\r\n m_out.writeObject(result);\r\n m_out.flush();\r\n }",
"protected String interpretCommand(final String line)\n throws IOException\n {\n return executeCommand(line);\n }",
"private static void callIstallerCommand(String commandLine) {\n\t\tString[] commandParts = commandLine.split(\" \");\n\t\tInstaller installer = new Installer();\n\t\t\n\t\t//getting component name from command argument\n\t\tString command = commandParts[0];\n\t\tComponent component = null;\n\t\tString componentName = null;\n\t\t\n\t\tswitch (command) {\n\t\tcase \"DEPEND\":\n\t\t\tcomponentName = commandParts[1];\n\t\t\tcomponent = installer.addDependency(componentName);\n\t\t\tfor(int i = 2; i < commandParts.length; i++){\n\t\t\t\t//Parsing dependencies to component instance\n\t\t\t\tString dependencyComponent = commandParts[i];\n\t\t\t\tComponent dependency = installer.addDependency(dependencyComponent);\n\t\t\t\tinstaller.addToAvailableDependencies(component, dependencyComponent);\n\t\t\t\tinstaller.addToAvailableDependents(dependency, componentName);\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\n\t\tcase \"INSTALL\":\n\t\t\tcomponentName = commandParts[1];\n\t\t\tinstaller.installComponent(componentName);\n\t\t\tbreak;\n\n\t\tcase \"REMOVE\":\n\t\t\tcomponentName = commandParts[1];\n\t\t\tinstaller.removeComponent(componentName);\n\t\t\tbreak;\n\n\t\tcase \"LIST\":\n\t\t\tinstaller.listInstalledComponents();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid command \" + componentName);\n\t\t}\n\t}",
"public Command parseCommand(String userInput, Model model,\n seedu.address.person.model.CheckAndGetPersonByNameModel personModel) throws Exception {\n final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());\n if (!matcher.matches()) {\n throw new ParseException(CashierMessages.MESSAGE_NO_COMMAND);\n }\n\n final String commandWord = matcher.group(\"commandWord\");\n final String arguments = matcher.group(\"arguments\");\n\n switch (commandWord) {\n\n case AddCommand.COMMAND_WORD:\n return new AddCommandParser().parse(arguments, model, personModel);\n\n case DeleteCommand.COMMAND_WORD:\n return new DeleteCommandParser().parse(arguments, model, personModel);\n\n case EditCommand.COMMAND_WORD:\n return new EditCommandParser().parse(arguments, model, personModel);\n\n case SetCashierCommand.COMMAND_WORD:\n return new SetCashierCommandParser().parse(arguments, model, personModel);\n\n case CheckoutCommand.COMMAND_WORD:\n return new CheckoutCommandParser().parse(arguments, model, personModel);\n\n case ClearCommand.COMMAND_WORD:\n return new ClearCommandParser().parse(arguments, model, personModel);\n\n default:\n logger.info(\"There is no such command.\");\n throw new ParseException(CashierMessages.MESSAGE_NO_COMMAND);\n\n }\n }",
"public void parseCommandLine(String[] args) {\r\n\t\t// define command line options\r\n\t\tOptions options = new Options();\r\n\t\t// refresh:\r\n\t\toptions.addOption(new Option(\r\n\t\t \"refresh\", \r\n\t\t \"Tell Argus to start refreshing all files after Minstrel startup.\"));\r\n\t\t// port:\r\n\t\tOptionBuilder.withArgName(\"port\");\r\n\t\tOptionBuilder.hasArg();\r\n\t\tOptionBuilder.withDescription( \"Run NanoHTTPD on this port instead of default 8000.\" );\r\n\t\toptions.addOption(OptionBuilder.create(\"port\"));\r\n\t\t// argus:\r\n\t\tOptionBuilder.withArgName(\"url\");\r\n\t\tOptionBuilder.hasArg();\r\n\t\tOptionBuilder.withDescription( \"Use Argus at <url> instead of default localhost:8008.\" );\r\n\t\toptions.addOption(OptionBuilder.create(\"argus\"));\r\n\t\t// vlc:\r\n\t\tOptionBuilder.withArgName(\"url\");\r\n\t\tOptionBuilder.hasArg();\r\n\t\tOptionBuilder.withDescription(\"Use VLC at <url> instead of default localhost:8080.\");\r\n\t\toptions.addOption(OptionBuilder.create(\"vlc\"));\r\n\t\t// wwwroot:\r\n\t\tOptionBuilder.withArgName(\"path\");\r\n\t\tOptionBuilder.hasArg();\r\n\t\tOptionBuilder.withDescription(\"Have NanoHTTPD serve files from <path> instead of default ./wwwroot.\");\r\n\t\toptions.addOption(OptionBuilder.create(\"wwwroot\"));\r\n\t\t\r\n\t\t// parse command line options and adjust accordingly\r\n\t\tCommandLineParser parser = new GnuParser();\r\n\t\ttry {\r\n\t\t\tCommandLine line = parser.parse(options, args);\r\n\r\n\t\t\tif (line.hasOption(\"refresh\")) {\r\n\t\t\t\trefresh = new Date();\r\n\t\t\t}\r\n\t\t\tif (line.hasOption(\"port\")) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tport = Integer.parseInt( line.getOptionValue(\"port\"));\r\n\t\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t\tSystem.err.println(\"Badly formatted port number, defaulting to 8000. Reason: \" + e.getMessage());\r\n\t\t\t\t\tport = 8000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (line.hasOption(\"argus\")) {\r\n\t\t\t\targusURL = line.getOptionValue(\"argus\");\r\n\t\t\t}\r\n\t\t\tif (line.hasOption(\"vlc\")) {\r\n\t\t\t\tvlcURL = line.getOptionValue(\"vlc\");\r\n\t\t\t}\r\n\t\t\tif (line.hasOption(\"wwwroot\")) {\r\n\t\t\t\twwwroot = line.getOptionValue(\"wwwroot\");\r\n\t\t\t}\r\n\t\t} catch (ParseException e) {\r\n\t\t\tSystem.err.println(\"Command line parsing failed. Reason: \" + e.getMessage());\r\n\t\t}\r\n\t}",
"public DummyCommand parse(String userInput) throws ParseException {\n HashMap<String, String> aliasList = getAliasManager().getAliasList();\n\n if (aliasList.isEmpty()) {\n return new DummyCommand(MESSAGE_EMPTY);\n }\n\n StringBuilder sb = new StringBuilder();\n aliasList.forEach((alias, command) -> sb.append(String.format(\"%s: %s\\n\", alias, command)));\n\n return new DummyCommand(sb.toString());\n }",
"public interface IArgsParser {\r\n\tvoid parse(String [] aParams, Iterable<IArgument> args);\r\n}",
"@Override\r\n\tpublic void parseAndEvaluate(String cmdline, OutputStream stdout)\r\n\t\t\tthrows AbstractApplicationException, ShellException {\r\n\t\tCommand parentCommand = parse(cmdline);\r\n\t\tparentCommand.evaluate(null, stdout);\r\n\t}",
"static String parse(String input, User user)\n {\n if(input.length()==0 || input==null || input.matches(\"^[ \\t]*$\"))\n return LinSim.EMPTY_STRING;\n\n // set the base command\n StringTokenizer token=new StringTokenizer(input, \" \\t\");\n String baseCommand=token.nextToken();\n\n // Let's use some introspection magic...\n try\n {\n Class<?> cmdClass=Class.forName(\"org.linsim.Command\");\n // Note that ALL commands in the Command class must be public in order to be seen by getMethod() below\n Method method=cmdClass.getMethod(baseCommand, String.class);\n Object output=method.invoke(null, input, user);\n if(!LinSim.graphicalMode)\n java.lang.System.out.print(output.toString());\n // ToDo: use setText() for GUI later\n }\n catch(Throwable e)\n {\n return baseCommand + \": command not found.\\n\";\n }\n // after the command finishes execution, return to the input loop\n return LinSim.EMPTY_STRING;\n }",
"public Command parseCommand(String userInput) throws ParseException {\n final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());\n if (!matcher.matches()) {\n throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE));\n }\n\n final String commandWord = matcher.group(\"commandWord\");\n final String arguments = matcher.group(\"arguments\");\n switch (commandWord) {\n\n // ========================== Easy Travel Commands =========================\n case HelpCommand.COMMAND_WORD:\n return new HelpCommand();\n\n case ExitCommand.COMMAND_WORD:\n return new ExitCommand();\n\n // ========================== Trip Commands =========================\n case SetTripCommand.COMMAND_WORD:\n return new SetTripCommandParser().parse(arguments);\n\n case DeleteTripCommand.COMMAND_WORD:\n return new DeleteTripCommand();\n\n case CheckStatusCommand.COMMAND_WORD:\n return new CheckStatusCommand();\n\n case EditBudgetCommand.COMMAND_WORD:\n return new EditBudgetCommandParser().parse(arguments);\n\n case RenameCommand.COMMAND_WORD:\n return new RenameCommandParser().parse(arguments);\n // ========================== Schedule Commands =========================\n case ScheduleCommand.COMMAND_WORD:\n return new ScheduleCommandParser().parse(arguments);\n\n case UnscheduleCommand.COMMAND_WORD:\n return new UnscheduleCommandParser().parse(arguments);\n\n case ListScheduleCommand.COMMAND_WORD:\n return new ListScheduleCommand();\n\n // ========================== Fixed Expense Commands =========================\n case AddFixedExpenseCommand.COMMAND_WORD:\n return new AddFixedExpenseCommandParser().parse(arguments);\n\n case ClearFixedExpenseCommand.COMMAND_WORD:\n return new ClearFixedExpenseCommand();\n\n case DeleteFixedExpenseCommand.COMMAND_WORD:\n return new DeleteFixedExpenseCommandParser().parse(arguments);\n\n case EditFixedExpenseCommand.COMMAND_WORD:\n return new EditFixedExpenseCommandParser().parse(arguments);\n\n case CheckBudgetStatus.COMMAND_WORD:\n return new CheckBudgetStatus();\n\n case SortFixedExpenseCommand.COMMAND_WORD:\n return new SortFixedExpenseCommandParser().parse(arguments);\n\n case ListFixedExpenseCommand.COMMAND_WORD:\n return new ListFixedExpenseCommand();\n\n // ========================== Transport Booking Commands =========================\n case AddTransportBookingCommand.COMMAND_WORD:\n return new AddTransportBookingCommandParser().parse(arguments);\n\n case EditTransportBookingCommand.COMMAND_WORD:\n return new EditTransportBookingCommandParser().parse(arguments);\n\n case DeleteTransportBookingCommand.COMMAND_WORD:\n return new DeleteTransportBookingCommandParser().parse(arguments);\n\n case ClearTransportBookingCommand.COMMAND_WORD:\n return new ClearTransportBookingCommand();\n\n case SortTransportBookingCommand.COMMAND_WORD:\n return new SortTransportBookingCommandParser().parse(arguments);\n\n case ListTransportBookingCommand.COMMAND_WORD:\n return new ListTransportBookingCommand();\n\n // ========================== Packing List Commands =========================\n case AddItemCommand.COMMAND_WORD:\n return new AddItemCommandParser().parse(arguments);\n\n case AddPresetCommand.COMMAND_WORD:\n return new AddPresetCommandParser().parse(arguments);\n\n case CheckItemCommand.COMMAND_WORD:\n return new CheckItemCommandParser().parse(arguments);\n\n case ClearItemCommand.COMMAND_WORD:\n return new ClearItemCommand();\n\n case DeleteItemCommand.COMMAND_WORD:\n return new DeleteItemCommandParser().parse(arguments);\n\n case EditItemCommand.COMMAND_WORD:\n return new EditItemCommandParser().parse(arguments);\n\n case FindItemCommand.COMMAND_WORD:\n return new FindItemCommandParser().parse(arguments);\n\n case FindItemCategoryCommand.COMMAND_WORD:\n return new FindItemCategoryCommandParser().parse(arguments);\n\n case UncheckItemCommand.COMMAND_WORD:\n return new UncheckItemCommandParser().parse(arguments);\n\n case ListItemCommand.COMMAND_WORD:\n return new ListItemCommand();\n\n case ListPresetCommand.COMMAND_WORD:\n return new ListPresetCommand();\n\n case SortItemCommand.COMMAND_WORD:\n return new SortItemCommandParser().parse(arguments);\n\n\n // ========================== Activity Commands =========================\n case AddActivityCommand.COMMAND_WORD:\n return new AddActivityCommandParser().parse(arguments);\n\n case DeleteActivityCommand.COMMAND_WORD:\n return new DeleteActivityCommandParser().parse(arguments);\n\n case ClearActivityCommand.COMMAND_WORD:\n return new ClearActivityCommand();\n\n case EditActivityCommand.COMMAND_WORD:\n return new EditActivityCommandParser().parse(arguments);\n\n case FindActivityCommand.COMMAND_WORD:\n return new FindActivityCommandParser().parse(arguments);\n\n case FindActivityTagCommand.COMMAND_WORD:\n return new FindActivityTagCommandParser().parse(arguments);\n\n case ListActivityCommand.COMMAND_WORD:\n return new ListActivityCommand();\n\n case SortActivityCommand.COMMAND_WORD:\n return new SortActivityCommandParser().parse(arguments);\n\n // ========================== Accommodation Commands =========================\n case AddAccommodationBookingCommand.COMMAND_WORD:\n return new AddAccommodationBookingCommandParser().parse(arguments);\n\n case ClearAccommodationBookingCommand.COMMAND_WORD:\n return new ClearAccommodationBookingCommand();\n\n case DeleteAccommodationBookingCommand.COMMAND_WORD:\n return new DeleteAccommodationBookingCommandParser().parse(arguments);\n\n case EditAccommodationBookingCommand.COMMAND_WORD:\n return new EditAccommodationBookingCommandParser().parse(arguments);\n\n case SortAccommodationBookingCommand.COMMAND_WORD:\n return new SortAccommodationBookingParser().parse(arguments);\n\n case ListAccommodationBookingCommand.COMMAND_WORD:\n return new ListAccommodationBookingCommand();\n\n // ========================== Invalid Commands =========================\n default:\n throw new ParseException(MESSAGE_UNKNOWN_COMMAND);\n }\n }",
"public Command getCommand(String userInput) {\n return this.parser.parse(userInput);\n }",
"public static void main(String[] args) {\n switch (args[0]) {\r\n case \"-createUser\" -> createUser(args);\r\n case \"-showAllUsers\" -> showAllUsers();\r\n case \"-addTask\" -> addTask(args);\r\n case \"-showTasks\" -> showTasks();\r\n default -> {\r\n try {\r\n throw new IncorrectCommandFormatException();\r\n } catch (IncorrectCommandFormatException exception) {\r\n exception.printStackTrace();\r\n }\r\n }\r\n }\r\n }",
"public interface Command {\n int run(String[] args) throws IllegalArgumentException;\n}",
"public static void main(String[] args) throws Exception {\r\n\t\t\r\n\t\t\r\n\t\t//create an instance\r\n\t\tparser dpe = new parser(null);\r\n\t\t\r\n\t\tdpe.runParser();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"static Command parse(String text) throws ParseException {\n Parser parser = new Parser(text);\n return parser.parse();\n }",
"static ParsedCommand parseCommand(String cmdline) {\n ParsedCommand res = new ParsedCommand();\n cmdline = cmdline.trim();\n String[] split = cmdline.split(\"\\\\/([-]?[a-zA-Z]*)\");\n List<String> args = new ArrayList<>();\n for (int i = 0; i < split.length; i++) {\n String[] tmp = split[i].split(\" \");\n for (int j = 0; j < tmp.length; j++) {\n if (tmp[j].length() > 0) {\n args.add(tmp[j]);\n }\n }\n }\n if (args.size() == 0) return null;\n res.argv.addAll(args);\n Pattern p = Pattern.compile(\"\\\\/([-]?[a-zA-Z]*)\");\n Matcher m = p.matcher(cmdline);\n while (m.find()) {\n String cur = m.group(1);\n if (cur.startsWith(\"-\")) {\n for (int i = 1; i < cur.length(); i++) {\n res.switches.remove(String.valueOf(cur.charAt(i)).toUpperCase());\n }\n } else {\n for (int i = 0; i < cur.length(); i++) {\n res.switches.add(String.valueOf(cur.charAt(i)).toUpperCase());\n }\n }\n }\n\n return res;\n }",
"public static void main(final String[] args) {\n IHandler handler = new ExecutionStrategy(args).getHandler();\n // Print the handler name for reference.\n System.out.println(\"Strategy: \" + handler.getClass().getSimpleName());\n // Invoke the execution strategy.\n handler.handle();\n }",
"public Command parse(String fullCommand) throws InvalidInputException, UnknownException {\n checkDelimiters(fullCommand);\n String[] tokens = fullCommand.split(\"\\\\s+\");\n\n // If tokenized command returns an empty array (entered a string with only white spaces),\n // raise an exception\n if (tokens.length == 0) {\n throw new InvalidInputException(InvalidInputException.Type.EMPTY_STRING);\n }\n // If first token (command) is empty, there are empty spaces typed in at the front - so we remove it\n if (tokens[0].isEmpty()) {\n tokens = Arrays.copyOfRange(tokens, 1, tokens.length);\n // Check again to make sure it is not empty after removing first element\n if (tokens.length == 0) {\n throw new InvalidInputException(InvalidInputException.Type.EMPTY_STRING);\n }\n }\n\n HashMap<String, String> arguments = new HashMap<>();\n // Conver input command to lowercase to make it case insensitive\n String command = tokens[0].toLowerCase();\n arguments.put(\"command\", command);\n\n // Default key is \"payload\"\n String key = \"payload\";\n ArrayList<String> values = new ArrayList<>();\n for (int i = 1; i < tokens.length; ++i) {\n String token = tokens[i];\n // Check whether this token is a new key\n if (!token.isEmpty() && token.charAt(0) == '/') {\n // If it is, save current value into the map and start a new k-v pair\n arguments.put(key, String.join(DELIMITER, values));\n key = token.substring(1);\n values.clear();\n } else {\n // If not, append this token to the end of the value\n values.add(token);\n }\n }\n\n // Store the last k-v pair\n // Store even when `values` is empty, as that indicates an empty string\n arguments.put(key, String.join(DELIMITER, values));\n\n // Initialize a respective class from the command (by capitalize first character)\n String className = command + \"Command\";\n className = className.substring(0, 1).toUpperCase() + className.substring(1);\n className = Constants.COMMAND_CLASS_PREFIX + className;\n try {\n Class<?> cls = Class.forName(className);\n Constructor<?> constructor = cls.getDeclaredConstructor(Ui.class, Data.class, HashMap.class);\n Object obj = constructor.newInstance(ui, data, arguments);\n return (Command) obj;\n } catch (ClassNotFoundException classNotFoundException) {\n // *Command class cannot be found!\n throw new InvalidInputException(InvalidInputException.Type.UNKNOWN_COMMAND, classNotFoundException);\n } catch (Exception exception) {\n // Some other weird error occurred here (e.g. dev bugs)\n // We should NEVER reach this block, if we do, log under the highest level\n throw new UnknownException(exception);\n }\n }",
"private static Object command(String userCommandLine[]) {\n\t\tint size = userCommandLine.length;\n\n\t\tswitch(userCommandLine[0].trim().toUpperCase()) {\n\n\t\t/*\n\t\t * INFORMATION\n\t\t *\n\t\t * Add executecommand on each case\n\t\t * but if it dosn't yet implemented\n\t\t * comment the command allow to user\n\t\t * on the variable string[] commands\n\t\t *\n\t\t */\n\t\t\n\t\t/* ************************************\n\t\t * standard commands\n\t\t *************************************/\n\t\tcase \"QUIT\": return ExecuteCommand.exit();\n\t\tcase \"EXIT\": return ExecuteCommand.exit();\n\t\tcase \"HELP\": help( (size > 1) ? userCommandLine[1].trim() : \"\"); break;\n\t\tcase \"VAR\": ExecuteCommand.showVar(); break;\n\t\tcase \"DEL\" : ExecuteCommand.delVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"RENAME\": ExecuteCommand.renameVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"STARTSPARK\": ExecuteCommand.startSpark(); break;\n\t\tcase \"STOPSPARK\": ExecuteCommand.stopSpark(); break;\n\t\t\n\t\t/* ************************************\n\t\t * database\n\t\t *************************************/ \n\t\t\n\t\t/* open database(name: String, filesystem: FileSystem, conf: Config) */\n\t\tcase \"OPEN\" : ExecuteCommand.openDB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* close database */\n\t\tcase \"CLOSE\" : ExecuteCommand.closeDB(); break;\n\t\t/* restart database */\n\t\tcase \"RESTART\" : ExecuteCommand.restartDB(); break;\n\t\t/* show list of TimeSeries */\n\t\tcase \"SHOW\" : ExecuteCommand.showTS(); break;\n\t\t/* drop a timeSeries */\n\t\tcase \"DROP\" : ExecuteCommand.dropTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* exist a timeSeries with name ... */\n\t\tcase \"EXIST\" : ExecuteCommand.existTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get a timeSeries */\n\t\tcase \"GET\" : ExecuteCommand.getTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* create a timeSeries */\n\t\tcase \"CREATE\" : ExecuteCommand.createTS2DB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Time Series\n\t\t *************************************/\n\t\t\n\t\t/* create the timeSerie schema */\n\t\tcase \"CREATE_SCHEMA\" : ExecuteCommand.createSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* show the schema of the timeSerie */\n\t\tcase \"SHOW_SCHEMA\" : ExecuteCommand.showSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get the schema of the timeSerie*/\n\t\tcase \"GET_SCHEMA\" : ExecuteCommand.getSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* insert data at a certain file */\n\t\tcase \"INSERT\" : ExecuteCommand.insertDataFromFile(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* select timeSerie Range from timeStart to timeEnd */\n\t\tcase \"SELECT_RANGE\": break;\n\t\t/* select a column of a timeserie */\n\t\tcase \"SELECT\": ExecuteCommand.selectColumn(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find max value of timeSerie */\n\t\tcase \"MAX_VALUE\" : ExecuteCommand.maxValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find min value of timeSerie */\n\t\tcase \"MIN_VALUE\" : ExecuteCommand.minValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* print first five values */\n\t\tcase \"PRINT\" : ExecuteCommand.printHead(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Transformations\n\t\t *************************************/\n\t\t\n\t\t/* power transformation of timeSerie: square root */\n\t\tcase \"SQRT_TRANSFORM\" : break;\n\t\t/* power transformation of timeSerie: logarithm */\n\t\tcase \"LOG_TRANSFORM\" : break;\n\t\t/* average of timeSerie */\n\t\tcase \"MEAN\" : break;\n\t\t/* shifting timeSerie with coefficient */\n\t\tcase \"SHIFT\" : break;\n\t\t/* scaling timeSerie with coefficient */\n\t\tcase \"SCALE\" : break;\n\t\t/* standard deviation of timeSeries */\n\t\tcase \"STD_DEVIATION\" : break;\n\t\t/* normalize the TimeSerie */\n\t\tcase \"NORMALIZE\" : break;\n\t\t/* search the first time occurs */\n\t\tcase \"SEARCH\" : break;\n\t\t/* moving average */\n\t\tcase \"MOVING_AVERAGE\" : break;\n\t\t/* DFT of timeSerie */\n\t\tcase \"DFT\" : break;\n\t\t/* DTW of 2 timeSerie (similarity between two timeseries) */\n\t\tcase \"DTW\" : break;\n\t\t\n\t\t/* ************************************\n\t\t * Compression \n\t\t *************************************/\n\n\t\t/* compress a timeserie */\n\t\tcase \"COMPRESSION\" : ExecuteCommand.compression(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* decompress a timeserie */\n\t\tcase \"DECOMPRESSION\" : break;\n\n\t\t/* ************************************\n\t\t * indexing \n\t\t *************************************/\n\t\t\n\t\t/* create index for many ts */\n\t\tcase \"CREATE_INDEX\" : ExecuteCommand.createIndex(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* return neighbors of a ts from the create index */\n\t\tcase \"NEIGHBORS\" : break;\n\t\t/* ************************************\n\t\t * clustering \n\t\t *************************************/\n\t\t\n\t\t/* ************************************\n\t\t * Application \n\t\t *************************************/\n\t\tcase \"CREATE_DNA\" : break;\n\t\tcase \"DNA_SIMILARITY\" : ExecuteCommand.dnApplication(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\t\t\n\t\tdefault: System.out.println(\"oups it may have a code error\");\n\t\t}\n\n\t\treturn true;\n\t}",
"protected T getConfigurationByCommandline() {\n\t\t\n\t\tT result = null;\n\t\t\n\t\tString[] args = this.commandLineArguments; \n\t\t\n\t\tif (args == null) {\n\t\t\tthrow new NullPointerException(\"Command line arguments have not been set in factory!\");\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tresult = (T) CliFactory.parseArguments(\n\t\t\t\tthis.configurationInterface, args\n\t\t\t);\n\t\t} catch (ArgumentValidationException e) {\n\t\t\tthrow new ConfigurationException(e.getMessage());\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"protected abstract void parseArgs() throws IOException;",
"public abstract void exec(CommandSender sender, String[] args);",
"public OCamlCommandLine(OCamlCLArgParser p) throws CommandLineException\n\t{\n\t\tsuper(p);\n\t\tthis.ocamlArgs = p.getOCamlArgs();\n\t\t// Duplicated from super\n\t\tif (!this.args.containsKey(CLArgFlag.MAIN_MOD) && !this.args.containsKey(CLArgFlag.INLINE_MAIN_MOD))\n\t\t{\n\t\t\tthrow new CommandLineException(\"No main module has been specified\\r\\n\");\n\t\t}\n\t}",
"public CLI(String inputCommand)\r\n\t{\r\n\t\t//lvl = new Level();\r\n\t\tthis.inputCommand = inputCommand;\r\n\t\tin = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t}",
"public static void main( String[] args ) {\n \tclArgs = new CommandLineArgs();\n \tJCommander jc = new JCommander(clArgs);\n \tfinal IDefaultProvider DEFAULT_PROVIDER = new DefaultCommandLineArgsProvider();\n \t\n \t// Set provider for default values of command line arguments \n \tjc.setDefaultProvider(DEFAULT_PROVIDER);\n \tjc.setColumnSize(100);\n \t\n \ttry {\n \t\t// Try to parse the arguments\n \t\tjc.parse(args);\n \t} catch (ParameterException e) {\n \t\t// Print error message, jc.usage() is called automatically\n \t\tLOG.error(\"{}. Refer to the available options and their explanation below.\", e.getMessage());\n \t}\n \t\n \tif (clArgs.preprocess) {\n \t\t// Go into the preprocessing phase\n \t\tpreprocess();\n \t}\n \telse if (clArgs.spDetection) {\n \t\t// Go into the detection of stay points\n \t\tdetectStayPoints();\n \t}\n \telse if (clArgs.clustering) {\n \t\t// Go into the clustering task\n \t\tclustering();\n \t}\n \telse if (clArgs.buildFramework) {\n \t\t// Create shared framework based on clustering results\n \t\tbuildFramework();\n \t}\n \telse if (clArgs.buildUserGraphs) {\n \t\t// Create hierarchical graph for each user\n \t\tbuildHierarchicalGraphs();\n \t}\n \telse if (clArgs.calcSimilarity) {\n \t\t// Calculate spatial similarity between users\n \t\tcalculateSimilarity();\n \t}\n \telse if (clArgs.evaluation && !clArgs.automation) {\n \t\t// Evaluation only works with a run of similarity measurement beforehand\n \t\tLOG.info(\"The evaluation can only be performed in connection with the similarity measurement. Run this program with the command line switch {} or {} to get more information on how to run the similarity measurement.\",\n \t\t\t\tCommandLineArgs.HELP, CommandLineArgs.HELP_LONG);\n \t\treturn;\n \t}\n \telse if (clArgs.automation) {\n \t\tif (clArgs.evaluation) {\n \t\t\t// Start the automation\n \t\t\tautomate();\n \t\t} else {\n \t\t\t// The automation task needs the evaluation switch\n \t\tLOG.info(\"The automation requires the evaluation. The evaluation can be enabled with the {} or {} command line switch. Run this program with the command line switch {} or {} to get more information on how to run the automation.\",\n \t\t\t\tnew Object[] { CommandLineArgs.EVALUATION, CommandLineArgs.EVALUATION_LONG, CommandLineArgs.HELP, CommandLineArgs.HELP_LONG });\n \t\t\n \t\t// Ask the user if the evaluation should be enabled and the automation should run\n \t System.out.print(\"Do you want the system to enable the evaluation (y/n)? \");\n\n \t // Open standard input stream\n \t BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n \t\t\n \t\tString runAutomationWithEvaluation = null;\n \t\ttry {\n \t\t\trunAutomationWithEvaluation = br.readLine();\n \t\t} catch (IOException ioe) {\n \t\t\tLOG.error(\"An error occurred while reading your input: {}\", ioe);\n \t\t}\n \t\t\n \t\t// User decided to start automation with evaluation\n \t\tif (runAutomationWithEvaluation.equals(\"y\") || runAutomationWithEvaluation.equals(\"Y\")) {\n \t\t\tLOG.debug(\"The evaluation is enabled by the system. Starting automation task.\");\n \t\t\tautomate();\n \t\t}\n \t\t// User decided to end the program\n \t\telse {\n \t\t\tLOG.debug(\"Automation aborted by the user.\");\n \t\t\treturn;\n \t\t}\n \t\t}\n \t}\n \telse {\n \t\t// Print a help text\n \t\tjc.usage();\n \t}\n }",
"@Override\n public void run(String... args) throws Exception {\n ParseServices bean = context.getBean(ParseServices.class);\n try {\n bean.parse();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public ServerInterpreterImpl(String[] args){\n\n /* Expected inputs */\n Map<String, String> arg_values = new HashMap<>();\n arg_values.put(\"-v\", null);\n arg_values.put(\"-i\", null);\n arg_values.put(\"ip\", null);\n arg_values.put(\"-p\", null);\n arg_values.put(\"port\", null);\n arg_values.put(\"-h\", null);\n\n /* (Bonus check) Max length 6, to avoid server latencies for nothing if\n someone try to enter a large number of arguments. */\n if (args.length > 6){\n error_message = usage;\n return;\n }\n\n /*\n Checks:\n (1) Each inputs is one of -v, -i, -p, -h, int (port range), [0.255].[0-255].[0-255].[0-255]\n (2) Only one input for each kind (see (1) for the list)\n (3) Option -i must be followed by the ip address. Same for -p and the port\n (4) Check if the -i option is present if and only if an ip address is present. Same for -p and the port\n */\n for (int i=0; i<args.length; i++){\n\n /* (1) */\n if ( !valid(args[i]) ){\n error_message = usage;\n return;\n }\n\n /* (2) */\n String type_arg = type(args[i]);\n if ( arg_values.get(type_arg) != null ){\n error_message = usage;\n return;\n }\n arg_values.put(type_arg, args[i]);\n\n /* (3) */\n if ( type_arg.equals(\"-i\") && ( (i==(args.length-1)) || !(type(args[i+1]).equals(\"ip\")) ) ){\n error_message = usage;\n return;\n }\n else if ( type_arg.equals(\"-p\") && ( (i==(args.length-1)) || !(type(args[i+1]).equals(\"port\")) ) ){\n error_message = usage;\n return;\n }\n }\n\n /* (4) */\n if ( ((arg_values.get(\"ip\") != null) && (arg_values.get(\"-i\") == null))\n || ((arg_values.get(\"ip\") == null) && (arg_values.get(\"-i\") != null))\n || ((arg_values.get(\"port\") != null) && (arg_values.get(\"-p\") == null))\n || ((arg_values.get(\"port\") == null) && (arg_values.get(\"-p\") != null))){\n error_message = usage;\n return;\n }\n\n set_inputs(arg_values);\n }",
"public Runner runner(String[] args, String[] remoteArgs, ClassLoader testClassLoader);",
"public Command parse(String[] s) {\r\n\t\t\t\r\n\t\tif (s.length == 1 && s[0].equalsIgnoreCase(\"QUIT\"))\r\n\t\t\treturn new Quit();\r\n\t\telse \r\n\t\t\treturn null;\r\n\t}",
"private static void process(String... args) throws Exception {\n Deque<String> params = new LinkedList<>(Arrays.asList(args));\n String command = params.pop().toUpperCase(Locale.ROOT);\n valueOf(command).run(params);\n }",
"public ProgramParser(String[] args) throws InterpreterException {\n java.util.Scanner scanner;\n String text = \"\";\n try {\n scanner = new java.util.Scanner(new java.io.File(args[0]));\n text = scanner.useDelimiter(\"\\u005c\\u005cA\").next();\n scanner.close();\n ProgramParser.programCode = new java.io.StringReader(text);\n } catch (FileNotFoundException ex) {\n throw new InterpreterException(\"FileNotFoundException\", \"Check file path.\", ex.getMessage());\n }\n ProgramParser.stringInput = args[1];\n System.out.println(\"Program: \" + args[0] + \" - input: \" + stringInput);\n //System.out.println(\"code\\n\" + text + \"\\n---Done\");\n }",
"void excuteCommand(Command commandToExecute, String [] params);",
"public interface ClientType {\n /**\n * Run the client, processing the specified options.\n *\n * @param options The options extracted from the command line.\n */\n public void run(ClientOptions options);\n}",
"public ArgumentsParser() {\n this(new String[0]);\n }",
"@Override\n\tpublic void run(String... args) {\n\t}",
"public FrameworkCommand(String input, ObjectType init) \n {\n commandString = input.toUpperCase();\n initiator = init;\n\n // todo: verb as first word?\n \n /* This is a crummy timestamp.. We'll hope to do better in subclasses \n using scheduler instances. */\n lTimestamp = System.currentTimeMillis() * 1000;\n }",
"public static void main( String[] args )\n {\n CommandLineParser parser = new DefaultParser();\n\n // create the Options\n OptionGroup optgrp = new OptionGroup();\n optgrp.addOption(Option.builder(\"l\")\n .longOpt(\"list\")\n .hasArg().argName(\"keyword\").optionalArg(true)\n .type(String.class)\n .desc(\"List documents scraped for keyword\")\n .build());\n optgrp.addOption( Option.builder(\"r\")\n .longOpt(\"read\")\n .hasArg().argName(\"doc_id\")\n .type(String.class)\n .desc(\"Display a specific scraped document.\")\n .build());\n optgrp.addOption( Option.builder(\"a\")\n .longOpt(\"add\")\n .type(String.class)\n .desc(\"Add keywords to scrape\")\n .build());\n optgrp.addOption( Option.builder(\"s\")\n .longOpt(\"scraper\")\n .type(String.class)\n .desc(\"Start the scraper watcher\")\n .build());\n\n\n\n Options options = new Options();\n options.addOptionGroup(optgrp);\n\n options.addOption( Option.builder(\"n\")\n .longOpt(\"search-name\").hasArg()\n .type(String.class)\n .desc(\"Name of the search task for a set of keywords\")\n .build());\n\n options.addOption( Option.builder(\"k\")\n .longOpt(\"keywords\")\n .type(String.class).hasArgs()\n .desc(\"keywords to scrape. \")\n .build());\n\n options.addOption( Option.builder(\"t\")\n .longOpt(\"scraper-threads\")\n .type(Integer.class).valueSeparator().hasArg()\n .desc(\"Number of scraper threads to use.\")\n .build());\n\n //String[] args2 = new String[]{ \"--add --search-name=\\\"some thing\\\" --keywords=kw1, kw2\" };\n // String[] args2 = new String[]{ \"--add\", \"--search-name\", \"some thing new\", \"--keywords\", \"kw3\", \"kw4\"};\n // String[] args2 = new String[]{ \"--scraper\"};\n// String[] args2 = new String[]{ \"--list\"};\n\n int exitCode = 0;\n CommandLine line;\n try {\n // parse the command line arguments\n line = parser.parse( options, args );\n }\n catch( ParseException exp ) {\n System.out.println( \"Unexpected exception:\" + exp.getMessage() );\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"searchscraper \\n\" +\n \" [--add --search-name=<SearchTask> --keywords=<keyword1> <keyword2> ...]\\n\" +\n \" [--list [<keyword>] ]\\n\" +\n \" [--read <doc_id>]\\n\", options , true);\n System.exit(2);\n return;\n }\n\n if( line.hasOption( \"add\" ) ) {\n // Add Search Task mode\n if(!line.hasOption( \"search-name\" ) || !line.hasOption(\"keywords\")) {\n System.out.println(\"must have search name and keywords when adding\");\n System.exit(2);\n }\n String name = line.getOptionValue( \"search-name\" );\n String[] keywords = line.getOptionValues(\"keywords\");\n System.out.println(\"Got keywords: \" + Arrays.toString(keywords) );\n\n exitCode = add(name, Arrays.asList(keywords));\n\n } else if( line.hasOption( \"list\" ) ) {\n // List Keyword mode\n DataStore ds = new DataStore();\n String keyword = line.getOptionValue( \"list\" );\n System.out.println(\"Listing with keyword = `\" + keyword + \"`\");\n if(keyword == null) {\n List<String > keywords = ds.listKeywords();\n for(String kw : keywords) {\n System.out.println(kw);\n }\n exitCode=0;\n } else {\n List<SearchResult > results = ds.listDocsForKeyword(keyword);\n for(SearchResult kw : results) {\n System.out.println(kw);\n }\n }\n ds.close();\n\n } else if( line.hasOption( \"read\" ) ) {\n // Show a specific document\n String docId = line.getOptionValue( \"read\" );\n if(docId == null) {\n System.err.println(\"read option missing doc_id parameter\");\n exitCode = 2;\n } else {\n\n DataStore ds = new DataStore();\n String result = ds.read(docId);\n\n if (result == null) {\n System.err.println(\"NOT FOUND\");\n exitCode = 1;\n } else {\n System.out.println(result);\n }\n ds.close();\n }\n }\n else if( line.hasOption( \"scraper\" ) ) {\n int numThreads = 1;\n if(line.hasOption( \"scraper-threads\")) {\n String threadString = line.getOptionValue(\"scraper-threads\");\n try {\n numThreads = Integer.parseInt(threadString);\n } catch (NumberFormatException e) {\n System.out.println(\n \"unable to parse number of threads from `\" +\n threadString + \"`\");\n }\n\n }\n // Start scraper mode\n Daemon daemon = new Daemon(numThreads);\n daemon.start();\n } else {\n // generate the help statement\n HelpFormatter formatter = new HelpFormatter();\n formatter.printHelp( \"searchscraper \\n\" +\n \" [--add --search-name <SearchTask> --keywords <keyword1> <keyword2> ...]\\n\" +\n \" [--list [<keyword>] ]\\n\" +\n \" [--read <doc_id>]\\n\", options , true);\n exitCode = 2;\n }\n\n\n System.exit(exitCode);\n }",
"public MonitorCommand mapCliCommand(String command, String dottedName)\n throws MalformedNameException {\n MonitorCommand monitorCommand = null;\n if (CLI_COMMAND_GET.equalsIgnoreCase(command)) {\n monitorCommand = mapGetCommand(dottedName);\n } else if (CLI_COMMAND_LIST.equalsIgnoreCase(command)) {\n monitorCommand = mapListCommand(dottedName);\n } else {\n\t\t\tString msg = localStrings.getString( \"admin.monitor.unknown_cli_command\", command );\n throw new IllegalArgumentException( msg );\n }\n return monitorCommand;\n }",
"public static void main(String[] args) {\n CommandCliParser cliParser = new CommandCliParser();\n cliParser.parseCommand(\"--verbose\");\n }",
"@Override\n public void execute(String commandText) throws Exception {\n parse(commandText);\n }",
"public interface CmdLineOption {\n \n /**\n * Checks if this option parser recognizes the specified\n * option name.\n */\n boolean accepts(String optionName);\n\n /**\n * Called if the option that this parser recognizes is found.\n * \n * @param parser\n * The parser that's using this option object.\n * \n * For example, if the option \"-quiet\" is simply an alias to\n * \"-verbose 5\", then the implementation can just call the\n * {@link CmdLineParser#parse(String[])} method recursively. \n * \n * @param params\n * The rest of the arguments. This method can use this\n * object to access the arguments of the option if necessary.\n * \n * @return\n * The number of arguments consumed. For example, return 0\n * if this option doesn't take any parameter.\n */\n int parseArguments( CmdLineParser parser, Parameters params ) throws CmdLineException;\n \n// /**\n// * Adds the usage message for this option. \n// * <p>\n// * This method is used to build usage message for the parser.\n// * \n// * @param buf\n// * Messages should be appended to this buffer.\n// * If you add something, make sure you add '\\n' at the end. \n// */\n// void appendUsage( StringBuffer buf );\n \n \n /**\n * SPI for {@link CmdLineOption}.\n * \n * Object of this interface is passed to\n * {@link CmdLineOption}s to make it easy/safe to parse\n * additional parameters for options.\n */\n public interface Parameters {\n /**\n * Gets the recognized option name.\n * \n * @return\n * This option name has been passed to the\n * {@link CmdLineOption#accepts(String)} method and\n * the method has returned <code>true</code>.\n */\n String getOptionName();\n \n /**\n * Gets the additional parameter to this option.\n * \n * @param idx\n * specifying 0 will retrieve the token next to the option.\n * For example, if the command line looks like \"-o abc -d x\",\n * then <code>getParameter(0)</code> for \"-o\" returns \"abc\"\n * and <code>getParameter(1)</code> will return \"-d\".\n * \n * @return\n * Always return non-null valid String. If an attempt is\n * made to access a non-existent index, this method throws\n * appropriate {@link CmdLineException}.\n */\n String getParameter( int idx ) throws CmdLineException;\n \n /**\n * The convenience method of\n * <code>Integer.parseInt(getParameter(idx))</code>\n * with proper error handling.\n * \n * @exception CmdLineException\n * If the parameter is not an integer, it throws an\n * approrpiate {@link CmdLineException}.\n */\n int getIntParameter( int idx ) throws CmdLineException;\n }\n \n}",
"@AutoGUIAnnotation(\r\n DescriptionForUser = \"<html>A reference implementation of<br>a Instrument Command.</html>\",\r\n ParameterNames = {\"Value 1\", \"Value 2\", \"Value 3\"},\r\n DefaultValues = {\"1.1\", \"true\", \"\\\"Command-Line in double quotes\\\"\"},\r\n ToolTips = {\"TT1\", \"TT2\", \"The command to execute\"})\r\n @iC_Annotation( MethodChecksSyntax = true )\r\n public void ReferenceImplementation(float Param1,\r\n boolean Param2,\r\n String CommandLine)\r\n throws ScriptException, IOException, DataFormatException {\r\n\r\n // local variables\r\n float dummy = 0;\r\n\r\n\r\n // remove double-quotes from the beginning and end of the CommandLine\r\n CommandLine = CommandLine.replaceFirst(\"^\\\"\", \"\").replaceFirst(\"\\\"$\", \"\");\r\n\r\n\r\n //////////////////////////////////////\r\n // Syntax-Check + Execute Command Line\r\n\r\n // Execute the Command Line:\r\n // in Syntax-Check mode the returned object is null\r\n // when not in Syntax-Check mode, the object should be valid\r\n if ( !CommandLine.isEmpty() ) {\r\n\r\n // make a new Device object to call it's DispatchCommand method\r\n // see Remark in javadoc (How to write new Instrument-Classes)\r\n Device dev = new Device();\r\n\r\n // perform the Syntax check\r\n Object obj = dev.DispatchCommand(CommandLine);\r\n\r\n // convert to float if returned object is valid\r\n if (obj != null) {\r\n\r\n try {\r\n // convert the Instrument's answer to a float\r\n dummy = getFloat(obj.toString());\r\n \r\n } catch (ScriptException ex) {\r\n // returned object is no convertible into a float, so throw an Exception\r\n String str = \"Executing the Command Line\\n\" + CommandLine + \"\\n\"\r\n + \"did not return an object that can be converted into a float value.\\n\"\r\n + \"Please check the Command Line.\\n\";\r\n throw new ScriptException(str);\r\n }\r\n }\r\n // the returned object is not valid, so throw an Exception when\r\n // not in Syntax-Check mode\r\n else if ( !inSyntaxCheckMode() ) {\r\n\r\n // returned object is null, so throw an Exception\r\n String str = \"Executing the Command Line\\n\" + CommandLine + \"\\n\";\r\n str += \"did not return a valid object. Please check the Command Line.\\n\";\r\n\r\n throw new ScriptException(str);\r\n }\r\n }\r\n\r\n\r\n // perform Syntax-Checks here\r\n if (inSyntaxCheckMode()) {\r\n \r\n // these commands are only executed during Syntax-Check mode\r\n \r\n /* if (...) {\r\n String str = \"Descriptive Text.\\n\";\r\n\r\n throw new DataFormatException(str);\r\n }*/\r\n \r\n // Syntax check for a String value defined in a List\r\n // consider if it makes sense to define the list in iC.properties\r\n // see LakeshoreTC.checkInputChannel for an example\r\n /*final List<String> NEW_LIST =\r\n Arrays.asList(\"A\", \"B\", \"C\"); // the entries need to be in uppercase letters!\r\n if ( !NEW_LIST.contains(YourVariableToCheck.toUpperCase()) ) {\r\n String str = \"YourVariableToCheck '\" + YourVariableToCheck + \"' is not valid.\";\r\n str += \"Please select a value from:\\n \" + NEW_LIST.toString() + \".\\n\";\r\n throw new DataFormatException(str);\r\n }*/\r\n\r\n // Range check for a Float value defined in a List\r\n // consider if it makes sense to define the list in iC.properties\r\n /* final List<Float> YOUR_RANGE = Arrays.asList(-100f, 100f);\r\n\r\n if (YourVariableToCheck < YOUR_RANGE.get(0) || YourVariableToCheck > YOUR_RANGE.get(1)) {\r\n String str = \"The zyx value is out of range.\\n\"\r\n + \"Please select a value between \" + YOUR_RANGE.toString() + \".\\n\";\r\n throw new DataFormatException(str);\r\n }*/\r\n \r\n // return if in Syntax-Check mode\r\n return;\r\n }\r\n \r\n\r\n \r\n // exit if in No-Communication-Mode\r\n if (inNoCommunicationMode())\r\n return;\r\n\r\n\r\n\r\n // insert code to perform the desired task\r\n // for instance open files, calculate intermediate values, etc.\r\n\r\n\r\n\r\n //////////////////\r\n // query a command\r\n\r\n // build the GPIB command\r\n String cmd = String.format(Locale.US, \"COMMAND 1, %.3f\", Param1);\r\n\r\n // add the boolean value\r\n cmd += (Param2 ? \"ON\" : \"OFF\");\r\n\r\n\r\n\r\n // if new code requires to wait until a certain criteria is met, the\r\n // following while-loop can be used\r\n boolean Done = false;\r\n while ( !Done && !m_StopScripting) {\r\n\r\n // check for pause button\r\n isPaused(true);\r\n\r\n\r\n // query the command\r\n String ans = QueryInstrument(cmd);\r\n\r\n\r\n /* Convert to float\r\n * Using the predefined conversion routine is useful, because\r\n * it throws a ScriptException when the conversion fails.\r\n */\r\n dummy = getFloat(ans);\r\n\r\n\r\n // do something useful with dummy\r\n\r\n\r\n // check if the Instrument's answer is what we want it to be\r\n // to exit the method\r\n if (dummy == Param1) {\r\n Done = true;\r\n }\r\n }\r\n\r\n\r\n // if new code requires to start a new task, the following anonymous\r\n // inner class can be used. Ensure that the task terminates itself\r\n // upon the Stop signal.\r\n // See iC_Instrument.MonitorChart() for a working example displaying\r\n // data in a chart.\r\n\r\n /**\r\n * Implement a new class from an anonymous inner class that extends\r\n * Thread and implements run(), in which the actual job is done.<p>\r\n *\r\n * The thread pauses, respectively, stops when <code>m_Paused</code>, respectively,\r\n * <code>m_StopScripting</code> is true.\r\n */\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"myThread as anonymous inner class\">\r\n class myThread extends Thread {\r\n\r\n // member variables\r\n public String m_dummy;\r\n\r\n /** Constructor */\r\n public myThread(String dummy) {\r\n // assign the passed values\r\n m_dummy = dummy;\r\n }\r\n\r\n\r\n @Override\r\n public void run() {\r\n // local variables\r\n float dummy = 0.0f;\r\n\r\n // Display a status message\r\n m_GUI.DisplayStatusMessage(\"Starting the thread.\\n\");\r\n\r\n // do until the thread should be stopped\r\n while ( m_StopScripting == false) {\r\n\r\n // check for pause button\r\n isPaused(true);\r\n\r\n // do something useful here\r\n\r\n\r\n // wait the desired time\r\n try { Thread.sleep( 500 ); } catch (InterruptedException ignore) {}\r\n }\r\n\r\n // clean up the thread\r\n\r\n\r\n // Display a status message\r\n m_GUI.DisplayStatusMessage(\"Thread stopped.\\n\");\r\n }\r\n }//</editor-fold>\r\n\r\n\r\n // make a new thread object\r\n myThread myT = new myThread(\"Love All, Serve All\");\r\n\r\n // start the thread and return\r\n myT.start();\r\n }",
"public interface ICommand {\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return long description of the command\r\n\t */\r\n\tString description();\r\n\r\n\t/**\r\n\t * \r\n\t * @return name of the command\r\n\t */\r\n\tString name();\r\n\r\n\t/**\r\n\t * Get called when the comma\r\n\t * @param console callback for output\r\n\t * @param options of the command invocation\r\n\t */\r\n\tvoid exec(ICommandConsole console, List<String> options);\r\n\r\n\t/**\r\n\t * \r\n\t * @return usage of the command\r\n\t */\r\n\tString usage();\r\n}",
"public interface CommandExecutor {\n /**\n * This method parse a commands from string and call it\n *\n * @param sender ource of the commands\n * @param connectionCommand commands\n * @return true if a valid commands, otherwise false\n */\n default boolean onCommand(CommandSender sender, ConnectionCommand connectionCommand) {\n String[] split = connectionCommand.getCommand().split(\" \");\n\n return onCommand(sender, split[0], Arrays.copyOfRange(split, 1, split.length), connectionCommand.getArgs());\n }\n\n /**\n * Executes the given commands, returning its success\n *\n * @param sender ource of the commands\n * @param command Command which was executed\n * @param args Passed commands arguments\n * @param objects Objects\n * @return true if a valid commands, otherwise false\n */\n boolean onCommand(CommandSender sender, String command, String[] args, Object... objects);\n\n}",
"private Main(String... arguments) {\n this.operations = new ArrayDeque<>(List.of(arguments));\n }",
"private Command parse() throws ParseException {\n next();\n expect(Token.COMMAND);\n cmd = new Command(text);\n next();\n while (!((token == Token.WHERE) || (token == Token.RETURN) || (token == Token.EOL))) {\n param();\n }\n if (token == Token.WHERE) {\n where();\n }\n if (token == Token.RETURN) {\n returns();\n }\n expect(Token.EOL);\n return cmd;\n }",
"public abstract T parseLine(String inputLine);",
"public CommandArguments parse(String[] args) {\n ErrorSupport command = new ErrorSupport();\n command.checkLength(args);\n\n //parsing arguments\n CommandArguments arguments = new CommandArguments();\n for (int i = 0; i < args.length; i++) {\n if ((i == args.length - 1) && !args[i].equals(\"--help\")) {\n throw new IllegalArgumentException(\"Incorrect argument, --help for more information about app syntax\");\n }\n switch (args[i]) {\n case (\"--help\"):\n System.out.println(\"\\nHELP MENU \\nAvailable options and arguments: \\n \\t--latitude x \\t-enter latitude coordinate \\n \\t--longitude x\\t-enter longitude coordinate \\n \\t--sensorid x \\t-enter sensor's Id \\n \\t--apikey x \\t\\t-enter API key \\n \\t--history x \\t-enter number of hours to display from history data\\n\");\n System.exit(0);\n case (\"--latitude\"):\n i++;\n arguments.setLatitude(command.checkIsDouble(args[i]));\n break;\n case (\"--longitude\"):\n i++;\n arguments.setLongitude(command.checkIsDouble(args[i]));\n break;\n case (\"--sensorid\"):\n i++;\n arguments.setSensorId(command.checkIsInt(args[i]));\n break;\n case (\"--apikey\"):\n i++;\n arguments.setApiKey(command.checkApiKey(args[i]));\n break;\n case (\"--history\"):\n i++;\n arguments.setHistory(command.checkIsInt(args[i]));\n break;\n default:\n throw new IllegalArgumentException(\"Incorrect option, --help for more information about app syntax\");\n }\n }\n\n //checking environment API_KEY if there was no apikey in command line entered\n if (!arguments.hasApiKey() && System.getenv(\"API_KEY\") == null) {\n throw new IllegalArgumentException(\"No API Key found, check if you have entered the correct key or if there is a suitable environment variable ( API_KEY ), --help for more information about app syntax\");\n } else if (!arguments.hasApiKey()) {\n arguments.setApiKey(command.checkApiKey(System.getenv(\"API_KEY\")));\n }\n return arguments;\n }",
"public CommandPack executeCommandClient(String s) throws NullPointerException, NoSuchElementException {\n\n int index = s.indexOf(' ');\n\n String commandName;\n String keyWords;\n\n if (index > -1) {\n commandName = s.substring(0, index);\n keyWords = s.substring(index + 1);\n } else {\n commandName = s;\n keyWords = \"\";\n }\n try {\n\n if (history.size() > 5) {\n history.poll();\n }\n history.add(commandName);\n commands.get(commandName).onCall(keyWords);\n\n } catch (NullPointerException e) {\n System.out.println(\"There is no such command\");\n return null;\n } catch (IOException e) {\n System.out.println(\"we don't have a permission to interact with a file (or an unknown error occurred)\");\n return null;\n }\n return (new CommandPack(commandName, additionalOutputToServer, currentUserInfo));\n }",
"private Command parseCommand(String input) {\r\n\r\n String[] splittedInput = input.toUpperCase().split(\" \");\r\n String command = splittedInput[0];\r\n\r\n switch (command) {\r\n case \"PLACE\":\r\n return new PlaceCommand(input);\r\n case \"MOVE\":\r\n return new MoveCommand();\r\n case \"LEFT\":\r\n return new RotateLeftCommand();\r\n case \"RIGHT\":\r\n return new RotateRightCommand();\r\n case \"REPORT\":\r\n return new ReportCommand();\r\n default:\r\n return new IgnoreCommand();\r\n }\r\n }",
"private static void parseArguments(String[] args, MiParaPipeLine p) throws IOException{\n options.addOption(\"i\", \"input-file\", true, \"FASTA input file for query sequences\");\n options.addOption(\"o\", \"output-folder\", true, \"output folder for prediction results\");\n options.addOption(\"t\", \"test\", true, \"run test example \");\n options.addOption(\"c\", \"config\", true, \"configuration file for miRPara\");\n options.addOption(\"a\", \"action\", true, \"action to perform\");\n options.addOption(\"h\", \"help \", false, \"print help\");\n\n logger.trace(\"parsing args\");\n CommandLineParser parser = new BasicParser();\n CommandLine cmd = null;\n\n \n try {\n cmd = parser.parse(options, args);\n if (cmd.hasOption(\"h\")){\n print_help();\n System.out.print(p.reportAvailableActions());\n }\n\n if (cmd.hasOption(\"t\")){ \n logger.info(\"test set to \" + cmd.getOptionValue(\"l\"));\n test = cmd.getOptionValue(\"t\").toLowerCase();\n }\n \n if (cmd.hasOption(\"i\")) {\n logger.info(\"input file set to \" + cmd.getOptionValue(\"i\"));\n p.setInputFilename(cmd.getOptionValue(\"i\"));\t\n } \n\n if (cmd.hasOption(\"o\")){\n logger.info(\"output folder is\" + cmd.getOptionValue(\"o\"));\n p.setOutputFolder(cmd.getOptionValue(\"o\"));\n }\n \n if (cmd.hasOption(\"a\")){\n logger.info(\"requested action is \" + cmd.getOptionValue(\"a\"));\n p.setAction(cmd.getOptionValue(\"a\"));\n }\n \n if (cmd.hasOption(\"c\")){\n configFile = cmd.getOptionValue(\"c\");\n logger.info(\"Configuration file is \" + configFile);\n p.setConfigFilename(configFile);\n }\n\n\n \n if(p.getConfigFilename()==null){\n throw new ParseException(\"no configuration file was specified\") ; \n }\n \n if(new File(p.getConfigFilename()).exists() == false){\n throw new IOException(\"configuration file <\" + p.getConfigFilename() + \"> does not exist\");\n } \n \n if(new File(p.getInputFilename()).exists()== false)\n {\n throw new IOException(\"input file <\" + p.getInputFilename() + \"> does not exist\");\n }\n \n if(new File(p.getOutputFolder()).exists() == false)\n {\n if (new File(p.getOutputFolder()).getParentFile().exists() == false)\n throw new IOException(\"parent file <\" + new File(p.getOutputFolder()).getParentFile() + \"> does not exist\");\n \n new File(p.getOutputFolder()).mkdir();\n logger.info(\"create results folder <\" + p.getOutputFolder() + \">\");\n }\n\n } catch (ParseException e) {\n\n logger.fatal(\"Failed to parse command line properties\", e);\n print_help();\n\n }\n\n \n }",
"protected abstract CommandMatch<?, ?> resolve(InvocationMatch<T> match);",
"public Parser(String[] userInput) {\n this.command = userInput[0];\n if (userInput.length > 1) {\n this.description = userInput[1];\n }\n }",
"private static CommandLine parseCommandLine(String[] args) {\n Option config = new Option(CONFIG, true, \"operator config\");\n Option brokerStatsZookeeper =\n new Option(BROKERSTATS_ZOOKEEPER, true, \"zookeeper for brokerstats topic\");\n Option brokerStatsTopic = new Option(BROKERSTATS_TOPIC, true, \"topic for brokerstats\");\n Option clusterZookeeper = new Option(CLUSTER_ZOOKEEPER, true, \"cluster zookeeper\");\n Option seconds = new Option(SECONDS, true, \"examined time window in seconds\");\n options.addOption(config).addOption(brokerStatsZookeeper).addOption(brokerStatsTopic)\n .addOption(clusterZookeeper).addOption(seconds);\n\n if (args.length < 6) {\n printUsageAndExit();\n }\n\n CommandLineParser parser = new DefaultParser();\n CommandLine cmd = null;\n try {\n cmd = parser.parse(options, args);\n } catch (ParseException | NumberFormatException e) {\n printUsageAndExit();\n }\n return cmd;\n }",
"public static void main( String args[] ) {\n\n parseInput(args);\n }",
"public Invocation parseInvocation(byte[] data) {\n\t\t\tif (data.length < 4)\n\t\t\t\tthrow new RuntimeException(\"Invalid data length: \" + data.length);\n\t\t\tFunction function = getBySignatureHash(Arrays.copyOfRange(data, 0, 4));\n\t\t\tif (function == null)\n\t\t\t\tthrow new RuntimeException(\"Can't find function/event by it signature\");\n\t\t\tObject[] args = function.decode(data);\n\t\t\treturn new Invocation(this, function, args);\n\t\t}",
"public void parseUserInput(String[] args)\n {\n this.args = args;\n// Class cls = this.getClass();\n Method method;\n String parameter;\n int parameterPrefix = USER_OPTION.length();\n\n for (int parameterIndex=0; parameterIndex<args.length; parameterIndex++)\n {\n // Parse the input to find the corresponding function\n try\n {\n parameter = args[parameterIndex].substring(parameterPrefix);\n method = UserInput.class.getDeclaredMethod(parameter, Integer.class);\n parameterIndex = (int) method.invoke(this, parameterIndex);\n }\n catch (NoSuchMethodException | IllegalAccessException e )\n {\n throw new RuntimeException(\"Unhandled parameter: \" + args[parameterIndex] + \"\\n\" + e);\n }\n catch (InvocationTargetException e)\n {\n// e.printStackTrace();\n throw new RuntimeException(\"Missing or wrong parameters for the option: \" + args[parameterIndex] + \"\\n\" + e);\n }\n }\n }",
"void executeLine(String line){\n\t\tString[] input = digest(line);\n\t\tif(input.length == 0) return;\n\n\t\tswitch (input[0]) {\n\t\t\tcase LOCATION:\n\t\t\t\tcatalog.addVan(input[1], input[2], input[3].equals(AUTOMATIC));\t\t\t\t\t\t\n\t\t\t\tbreak;\n\n\t\t\tcase REQUEST:\n\t\t\tcase CHANGE:\n\n\t\t\t\tCalendar start, end;\n\t\t\t\ttry{\n\t\t\t\t\tstart = stringsToCalendar(input[2], input[3], input[4]);\n\t\t\t\t\tend = stringsToCalendar(input[5], input[6], input[7]);\n\t\t\t\t}\n\t\t\t\tcatch(ParseException e){\n\t\t\t\t\tSystem.err.println(String.format(\"Cannot parse date string, skipping...\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tInterval interval = new Interval(start, end);\n\t\t\t\t\n\t\t\t\tint auto, manual;\n\t\t\t\tint tmpa = Integer.parseInt(input[8]);\n\t\t\t\tint tmpb = input.length == 12 ? Integer.parseInt(input[10]) : 0;\n\t\t\t\tif(input[9].equals(AUTOMATIC)){\n\t\t\t\t\tauto = tmpa;\n\t\t\t\t\tmanual = tmpb;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tauto = tmpb;\n\t\t\t\t\tmanual = tmpa;\n\t\t\t\t}\n\n\t\t\t\tif(input[0].equals(REQUEST)){\n\t\t\t\t\tSystem.out.print(\"Booking \" + catalog.makeOrder(input[1], interval, auto, manual) + \"\\n\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(\"Change \" + catalog.changeOrder(input[1], interval, auto, manual) + \"\\n\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CANCEL:\n\t\t\t\tSystem.out.print(\"Cancel \" + catalog.cancelOrder(input[1]) + \"\\n\");\n\t\t\t\tbreak;\n\n\t\t\tcase PRINT:\n\t\t\t\tSystem.out.print(catalog.print(input[1]));\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tnew RemoteInvocationClient().go(); \n\t}",
"public Command parse(String command) throws DukeException {\n String[] commandSplit = command.split(\"\\\\s+\", 2);\n String commandWord = commandSplit[0].toLowerCase();\n String desc = \"\";\n if (commandSplit.length == 2) {\n desc = commandSplit[1];\n }\n\n switch (commandWord) {\n case DoneCommand.COMMAND_WORD:\n return doneParse(desc);\n\n case ListCommand.COMMAND_WORD:\n return new ListCommand();\n\n case ToDoCommand.COMMAND_WORD:\n return toDoParse(desc);\n\n case DeadlineCommand.COMMAND_WORD:\n return deadlineParse(desc);\n\n case EventCommand.COMMAND_WORD:\n return eventParse(desc);\n\n case DeleteCommand.COMMAND_WORD:\n return deleteParse(desc);\n\n case FindCommand.COMMAND_WORD:\n return new FindCommand(desc);\n case UpdateCommand.COMMAND_WORD:\n return new UpdateParser(desc).parse();\n case ByeCommand.COMMAND_WORD:\n return new ByeCommand();\n default:\n throw new DukeException(INVALID_COMMAND_MESSAGE);\n }\n }",
"public static void main(String[] args) {\n\t\tThread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {\r\n\t\t public void uncaughtException(Thread t, Throwable e) {\r\n\t\t logger.log(Level.SEVERE, t + \" RemoteFileParse threw an exception: \", e);\r\n\t\t };\r\n\t\t });\r\n\t\t\r\n\t\tif (args != null && args.length >= 3) {\r\n\t\t\t//Set the Buyer object Model with the incoming args provided in the command line args IE. IPRemoteParse.exe \r\n\t\t\tModels.Buyer buyerInfo = new Models.Buyer(Integer.parseInt(args[0]), args[1], args[2], args[3]);\r\n\t\t\t\r\n\t\t\t//check for a file. Haven't decided how to engage the scheduling as of yet.\r\n\t\t\tparseFiles(buyerInfo);\r\n\t\t}\r\n\t\telse { //just for testing stubbing out the buyer object. args would normally be sent in on a command line call or .bat file which will be created on install with all user options (or xml config file)\r\n\t\t\tModels.Buyer buyerInfo = new Models.Buyer(1926420, \"intelligentpay-api.inworks.com\", \"C:\\\\Users\\\\grichter.EVIL_EMPIRE\\\\Desktop\\\\ParseTesting\", \"Payments_\");\r\n\t\t\tparseFiles(buyerInfo);\r\n\t\t}\r\n\t}",
"@Override\n public ImportCommand parse(String args) throws ParseException {\n if (args.isEmpty()) {\n return parseFile(getFileFromFileBrowser());\n } else {\n return parseFile(getFileFromArgs(args));\n }\n }",
"public Object parse(String arg) {\n return (arg);\n }",
"public IManagedCommandLineGenerator getCommandLineGenerator();",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n\n List<String> inputs = new InputsReader().read(scanner);\n\n List<Command> commands = new CommandsFactory().build(inputs);\n\n new CommandsProcessor().execute(commands);\n }",
"public static InvocationExpression invoke(Expression expression, Expression arguments[]) { throw Extensions.todo(); }",
"public static void main(final String... args) {\n\t\t/* The class of our parser */\n\t\tfinal Class<SentenceParser> parserClass = SentenceParser.class;\n\n\t\t/* The constructor repository for our parser */\n\t\tfinal ParseNodeConstructorProvider repository\n\t\t\t\t= new ParseNodeConstructorProvider(parserClass);\n\n\t\t/* The grappa parser! */\n\t\tfinal SentenceParser parser = Grappa.createParser(parserClass);\n\n\t\t/* The runner that listens for events from the parser */\n\t\tfinal ParseRunner<Object> runner\n\t\t\t\t= new ParseRunner<>(parser.sentence());\n\n\t\t/* The class that will build the parse tree */\n\t\tfinal ParseTreeBuilder<Object> listener\n\t\t\t\t= new ParseTreeBuilder<>(repository);\n\n\t\t/* Register the parse tree builder to the runner. This must be done before you run. */\n\t\trunner.registerListener(listener);\n\t\t/* Run on the given input. */\n\t\trunner.run(\"John hit the ball\");\n\n\t\t/* Get the root node of the parse tree built. */\n\t\tfinal ParseNode rootNode = listener.getTree();\n\n\t\t/* Create a visitor runner, and provide the root node to start visiting from. */\n\t\tVisitorRunner visitorRunner = new VisitorRunner(rootNode);\n\n\t\t/* Create a visitor */\n\t\tExampleVisitor v = new ExampleVisitor();\n\n\t\t/* Register your visitor. */\n\t\tvisitorRunner.registerVisitor(v);\n\n\t\t/* Run the visitors on the parse tree using a defined traversal order. The default is a\n\t\tpost order traversal, here we specify a pre order traversal. A third option is breadth\n\t\tfirst traversal. */\n\t\tvisitorRunner.run(VisitOrder.PREORDER);\n\n\t\t/* Done! */\n\t\tSystem.out.println(v.getSillySentence());\n\t}"
] | [
"0.60837734",
"0.6073088",
"0.60581225",
"0.59278417",
"0.5882304",
"0.5756363",
"0.571614",
"0.569426",
"0.5692336",
"0.5591322",
"0.55829483",
"0.55248743",
"0.5519914",
"0.54915684",
"0.5437614",
"0.5421821",
"0.5385334",
"0.5382528",
"0.5348362",
"0.5346089",
"0.5343724",
"0.53399414",
"0.5312401",
"0.5302901",
"0.52730745",
"0.5270841",
"0.52675265",
"0.5242449",
"0.5237433",
"0.52313036",
"0.5212321",
"0.5207805",
"0.51998794",
"0.51932776",
"0.51854014",
"0.51845205",
"0.51628965",
"0.51615524",
"0.5140649",
"0.5138219",
"0.51371163",
"0.5135141",
"0.5111708",
"0.50906485",
"0.5078025",
"0.5074981",
"0.5071483",
"0.5067477",
"0.5059347",
"0.505784",
"0.50489867",
"0.5043665",
"0.503751",
"0.5034379",
"0.50275517",
"0.5011914",
"0.50057566",
"0.5005339",
"0.5001218",
"0.49988696",
"0.49842256",
"0.49762166",
"0.4970261",
"0.49635693",
"0.49611783",
"0.49566096",
"0.49543327",
"0.49388018",
"0.49348286",
"0.49326554",
"0.49316692",
"0.49285135",
"0.49261376",
"0.49226177",
"0.4916734",
"0.49105024",
"0.49040067",
"0.4903305",
"0.49025315",
"0.4901712",
"0.489737",
"0.48934746",
"0.48920915",
"0.4891734",
"0.48910627",
"0.4889092",
"0.48869672",
"0.48701534",
"0.4864931",
"0.4859998",
"0.48599228",
"0.4859529",
"0.48594955",
"0.48587465",
"0.48562",
"0.48548695",
"0.4850383",
"0.48484766",
"0.48480162",
"0.48478237"
] | 0.63958186 | 0 |
Provides an invoker for the command line specified in a detyped manner. | public final CommandMatch<?, ?> resolveCommand(Map<String, ?> options, String subordinate, Map<String, ?> subordinateOptions, List<?> arguments) throws CommandException {
InvocationMatcher<T> matcher = getDescriptor().matcher();
//
InvocationMatch<T> match;
try {
if (options != null && options.size() > 0) {
for (Map.Entry<String, ?> option : options.entrySet()) {
matcher = matcher.option(option.getKey(), Collections.singletonList(option.getValue()));
}
}
//
if (subordinate != null && subordinate.length() > 0) {
matcher = matcher.subordinate(subordinate);
// Minor : remove that and use same signature
if (subordinateOptions != null && subordinateOptions.size() > 0) {
for (Map.Entry<String, ?> option : subordinateOptions.entrySet()) {
matcher = matcher.option(option.getKey(), Collections.singletonList(option.getValue()));
}
}
}
//
match = matcher.arguments(arguments != null ? arguments : Collections.emptyList());
}
catch (org.crsh.cli.impl.SyntaxException e) {
throw new CommandException(ErrorKind.EVALUATION, "Could not resolve command " + getDescriptor().getName(), e);
}
//
return resolve(match);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public final CommandInvoker<?, ?> resolveInvoker(String line) throws CommandException {\n return resolveCommand(line).getInvoker();\n }",
"public Object invoke(String name, Object... args) throws Exception;",
"Result invoke(Invoker<?> invoker, Invocation invocation);",
"public interface CommandProvider {\n /**\n * Provide command hospital command.\n *\n * @param uri the uri\n * @return the hospital command\n */\n HospitalCommand provideCommand(String uri);\n}",
"protected abstract void go(CommandLine line) throws Exception;",
"void main(CommandLine cmd);",
"public abstract String run(String args);",
"HospitalCommand provideCommand(String uri);",
"interface OneArgCommand {\n void doCommand(String a);\n }",
"public interface ClientType {\n /**\n * Run the client, processing the specified options.\n *\n * @param options The options extracted from the command line.\n */\n public void run(ClientOptions options);\n}",
"public static void main(String[] args) {\n\t\tReceiver re = new Receiver();\r\n\t\tCommand cmd = new MyCommend(re);\r\n\t\tInvoker inv = new Invoker(cmd);\r\n\t\tinv.action();\r\n\t}",
"public interface CommandLineParser {\n\n CommandLine parse(Options options, String[] arguments) throws ParseException;\n CommandLine parse(Options options, String[] arguments, boolean stopAtNonOption) throws ParseException;\n\n}",
"public static String interpreter(String[] commandLineArguments) throws ClassNotFoundException, SQLException{\n \t if (commandLineArguments.length < 1) \n \t { \n \t System.out.println(\"Please input help\"); \n \t } \n \t //displayInput(commandLineArguments);\n \t //System.out.println(\"\");\n \t return parseCommand(commandLineArguments); \n }",
"public interface CommandFactory {\n Command fromString(String s) throws UnknownCommandException;\n}",
"public E parse(String argument);",
"private static void callIstallerCommand(String commandLine) {\n\t\tString[] commandParts = commandLine.split(\" \");\n\t\tInstaller installer = new Installer();\n\t\t\n\t\t//getting component name from command argument\n\t\tString command = commandParts[0];\n\t\tComponent component = null;\n\t\tString componentName = null;\n\t\t\n\t\tswitch (command) {\n\t\tcase \"DEPEND\":\n\t\t\tcomponentName = commandParts[1];\n\t\t\tcomponent = installer.addDependency(componentName);\n\t\t\tfor(int i = 2; i < commandParts.length; i++){\n\t\t\t\t//Parsing dependencies to component instance\n\t\t\t\tString dependencyComponent = commandParts[i];\n\t\t\t\tComponent dependency = installer.addDependency(dependencyComponent);\n\t\t\t\tinstaller.addToAvailableDependencies(component, dependencyComponent);\n\t\t\t\tinstaller.addToAvailableDependents(dependency, componentName);\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\n\t\tcase \"INSTALL\":\n\t\t\tcomponentName = commandParts[1];\n\t\t\tinstaller.installComponent(componentName);\n\t\t\tbreak;\n\n\t\tcase \"REMOVE\":\n\t\t\tcomponentName = commandParts[1];\n\t\t\tinstaller.removeComponent(componentName);\n\t\t\tbreak;\n\n\t\tcase \"LIST\":\n\t\t\tinstaller.listInstalledComponents();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tSystem.out.println(\"Invalid command \" + componentName);\n\t\t}\n\t}",
"public interface Command {\n int run(String[] args) throws IllegalArgumentException;\n}",
"public interface ICommand {\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return long description of the command\r\n\t */\r\n\tString description();\r\n\r\n\t/**\r\n\t * \r\n\t * @return name of the command\r\n\t */\r\n\tString name();\r\n\r\n\t/**\r\n\t * Get called when the comma\r\n\t * @param console callback for output\r\n\t * @param options of the command invocation\r\n\t */\r\n\tvoid exec(ICommandConsole console, List<String> options);\r\n\r\n\t/**\r\n\t * \r\n\t * @return usage of the command\r\n\t */\r\n\tString usage();\r\n}",
"void excuteCommand(Command commandToExecute, String [] params);",
"private static Object command(String userCommandLine[]) {\n\t\tint size = userCommandLine.length;\n\n\t\tswitch(userCommandLine[0].trim().toUpperCase()) {\n\n\t\t/*\n\t\t * INFORMATION\n\t\t *\n\t\t * Add executecommand on each case\n\t\t * but if it dosn't yet implemented\n\t\t * comment the command allow to user\n\t\t * on the variable string[] commands\n\t\t *\n\t\t */\n\t\t\n\t\t/* ************************************\n\t\t * standard commands\n\t\t *************************************/\n\t\tcase \"QUIT\": return ExecuteCommand.exit();\n\t\tcase \"EXIT\": return ExecuteCommand.exit();\n\t\tcase \"HELP\": help( (size > 1) ? userCommandLine[1].trim() : \"\"); break;\n\t\tcase \"VAR\": ExecuteCommand.showVar(); break;\n\t\tcase \"DEL\" : ExecuteCommand.delVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"RENAME\": ExecuteCommand.renameVar(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\tcase \"STARTSPARK\": ExecuteCommand.startSpark(); break;\n\t\tcase \"STOPSPARK\": ExecuteCommand.stopSpark(); break;\n\t\t\n\t\t/* ************************************\n\t\t * database\n\t\t *************************************/ \n\t\t\n\t\t/* open database(name: String, filesystem: FileSystem, conf: Config) */\n\t\tcase \"OPEN\" : ExecuteCommand.openDB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* close database */\n\t\tcase \"CLOSE\" : ExecuteCommand.closeDB(); break;\n\t\t/* restart database */\n\t\tcase \"RESTART\" : ExecuteCommand.restartDB(); break;\n\t\t/* show list of TimeSeries */\n\t\tcase \"SHOW\" : ExecuteCommand.showTS(); break;\n\t\t/* drop a timeSeries */\n\t\tcase \"DROP\" : ExecuteCommand.dropTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* exist a timeSeries with name ... */\n\t\tcase \"EXIST\" : ExecuteCommand.existTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get a timeSeries */\n\t\tcase \"GET\" : ExecuteCommand.getTS(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* create a timeSeries */\n\t\tcase \"CREATE\" : ExecuteCommand.createTS2DB(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Time Series\n\t\t *************************************/\n\t\t\n\t\t/* create the timeSerie schema */\n\t\tcase \"CREATE_SCHEMA\" : ExecuteCommand.createSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* show the schema of the timeSerie */\n\t\tcase \"SHOW_SCHEMA\" : ExecuteCommand.showSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* get the schema of the timeSerie*/\n\t\tcase \"GET_SCHEMA\" : ExecuteCommand.getSchema(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* insert data at a certain file */\n\t\tcase \"INSERT\" : ExecuteCommand.insertDataFromFile(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* select timeSerie Range from timeStart to timeEnd */\n\t\tcase \"SELECT_RANGE\": break;\n\t\t/* select a column of a timeserie */\n\t\tcase \"SELECT\": ExecuteCommand.selectColumn(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find max value of timeSerie */\n\t\tcase \"MAX_VALUE\" : ExecuteCommand.maxValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* find min value of timeSerie */\n\t\tcase \"MIN_VALUE\" : ExecuteCommand.minValue(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* print first five values */\n\t\tcase \"PRINT\" : ExecuteCommand.printHead(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\t\t\n\t\t\n\t\t/* ************************************\n\t\t * Transformations\n\t\t *************************************/\n\t\t\n\t\t/* power transformation of timeSerie: square root */\n\t\tcase \"SQRT_TRANSFORM\" : break;\n\t\t/* power transformation of timeSerie: logarithm */\n\t\tcase \"LOG_TRANSFORM\" : break;\n\t\t/* average of timeSerie */\n\t\tcase \"MEAN\" : break;\n\t\t/* shifting timeSerie with coefficient */\n\t\tcase \"SHIFT\" : break;\n\t\t/* scaling timeSerie with coefficient */\n\t\tcase \"SCALE\" : break;\n\t\t/* standard deviation of timeSeries */\n\t\tcase \"STD_DEVIATION\" : break;\n\t\t/* normalize the TimeSerie */\n\t\tcase \"NORMALIZE\" : break;\n\t\t/* search the first time occurs */\n\t\tcase \"SEARCH\" : break;\n\t\t/* moving average */\n\t\tcase \"MOVING_AVERAGE\" : break;\n\t\t/* DFT of timeSerie */\n\t\tcase \"DFT\" : break;\n\t\t/* DTW of 2 timeSerie (similarity between two timeseries) */\n\t\tcase \"DTW\" : break;\n\t\t\n\t\t/* ************************************\n\t\t * Compression \n\t\t *************************************/\n\n\t\t/* compress a timeserie */\n\t\tcase \"COMPRESSION\" : ExecuteCommand.compression(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* decompress a timeserie */\n\t\tcase \"DECOMPRESSION\" : break;\n\n\t\t/* ************************************\n\t\t * indexing \n\t\t *************************************/\n\t\t\n\t\t/* create index for many ts */\n\t\tcase \"CREATE_INDEX\" : ExecuteCommand.createIndex(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t/* return neighbors of a ts from the create index */\n\t\tcase \"NEIGHBORS\" : break;\n\t\t/* ************************************\n\t\t * clustering \n\t\t *************************************/\n\t\t\n\t\t/* ************************************\n\t\t * Application \n\t\t *************************************/\n\t\tcase \"CREATE_DNA\" : break;\n\t\tcase \"DNA_SIMILARITY\" : ExecuteCommand.dnApplication(Arrays.copyOfRange(userCommandLine, 1, size)); break;\n\t\t\n\t\t\t\t\n\t\tdefault: System.out.println(\"oups it may have a code error\");\n\t\t}\n\n\t\treturn true;\n\t}",
"public abstract ArgumentParser makeParser();",
"InvokeInfo getInvokeInfo(final String cmdString)\n throws IllegalUsageException, WrongNumberOfOperandsException, CmdNotFoundException\n {\n InvokeInfo invokeInfo = new InvokeInfo();\n\n int colonIndex = cmdString.indexOf(\":\");\n int leftParenIndex = cmdString.indexOf('(');\n\n String operationPortion = null;\n\n /*\n first determine if it's the \":\" form or the \"(...)\" form\n - if a colon preceeds a left paren, then its the xxx: form\n - if the last char is a right paren, and the left paren preceeds it, then its the paren form\n */\n if (colonIndex >= 1 && (colonIndex < leftParenIndex || leftParenIndex < 0))\n {\n invokeInfo.argList = cmdString.substring(colonIndex + 1, cmdString.length());\n operationPortion = cmdString.substring(0, colonIndex);\n }\n else if (leftParenIndex >= 1 && cmdString.charAt(cmdString.length() - 1) == ')')\n {\n invokeInfo.argList = cmdString.substring(leftParenIndex + 1, cmdString.length() - 1);\n operationPortion = cmdString.substring(0, leftParenIndex);\n\n }\n else\n {\n throw new CmdNotFoundException(cmdString, \"command not found\");\n }\n\n if (invokeInfo.argList.length() == 0)\n {\n invokeInfo.argList = null;\n }\n\n // now determine the targets\n int dotIndex = operationPortion.indexOf('.');\n if (dotIndex < 0)\n {\n invokeInfo.operationName = operationPortion;\n invokeInfo.targets = getTargets();\n }\n else if (dotIndex >= 1)\n {\n if (getOperands().length >= 1)\n {\n throw new IllegalUsageException(\"Can't supply operands when using alias invocation form\");\n }\n\n invokeInfo.operationName = operationPortion.substring(dotIndex + 1, operationPortion.length());\n invokeInfo.targets = new String[]\n {\n operationPortion.substring(0, dotIndex)\n };\n }\n else\n {\n throw new IllegalUsageException(cmdString);\n }\n\n return (invokeInfo);\n }",
"public Object invoke(Object owner, String methodName, Class<?> argumentType, Object argument) {\n try {\n\n Method method;\n if (argument != null) {\n method = owner.getClass().getMethod(methodName, argumentType);\n return method.invoke(owner, argument);\n } else {\n method = owner.getClass().getMethod(methodName, (Class<?>[]) null);\n return method.invoke(owner, (Object[]) null);\n }\n\n } catch (SecurityException e) {\n String message = makeSecurityExceptionMessage(owner, methodName, argument);\n LOGGER.error(message, e);\n throw new EngineRuntimeException(message, e);\n } catch (NoSuchMethodException e) {\n String message = makeNoSuchMethodExceptionMessage(owner, methodName, argument);\n LOGGER.error(message, e);\n throw new EngineRuntimeException(message, e);\n } catch (IllegalArgumentException e) {\n String message = makeIllegalArgumentExceptionMessage(owner, methodName, argument);\n LOGGER.error(message, e);\n throw new EngineRuntimeException(message, e);\n } catch (IllegalAccessException e) {\n String message = makeIllegalAccessExceptionMessage(owner, methodName, argument);\n LOGGER.error(message, e);\n throw new EngineRuntimeException(message, e);\n } catch (InvocationTargetException e) {//NOSONAR - see below\n String message = makeInvocationTargetExceptionMessage(owner, methodName, argument);\n LOGGER.error(message, e.getCause());//true, here we throw out the InvocationTargetException because only its cause is meaningful\n throw new EngineRuntimeException(message, e.getCause());//NOSONAR - see above\n }\n }",
"private void handleInvocationCommand() throws IOException, ClassNotFoundException {\r\n final Object context = m_in.readObject();\r\n final String handle = (String) m_in.readObject();\r\n final String methodName = (String) m_in.readObject();\r\n final Class[] paramTypes = (Class[]) m_in.readObject();\r\n final Object[] args = (Object[]) m_in.readObject();\r\n Object result = null;\r\n try {\r\n result = m_invoker.invoke(handle, methodName, paramTypes, args, context);\r\n } catch (Exception e) {\r\n result = e;\r\n }\r\n m_out.writeObject(result);\r\n m_out.flush();\r\n }",
"public IManagedCommandLineGenerator getCommandLineGenerator();",
"Object invoke(Object reqest) throws IOException, ClassNotFoundException,\n InvocationTargetException, IllegalAccessException, IllegalArgumentException;",
"public interface Command\n{\n void doCommand(List<String> args) throws Exception;\n}",
"public static void main(String[] args) {\r\n\t\tCommandLine top = new CommandLine(new Main());\r\n\t\tif (args.length == 0) {\r\n\t\t\ttop.usage(System.out);\r\n\t\t}\r\n\t\t\r\n\t\tList<CommandLine> parsedCommands;\r\n\t\ttry {\r\n\t\t parsedCommands = top.parse(args);\r\n\t\t} catch (ParameterException ex) { // incorrect user input for one of the subcommands\r\n\t\t LOG.severe(\"Error parsing command line: \" + ex.getMessage());\r\n\t\t ex.getCommandLine().usage(System.out); // get the offended subcommand from the exception\r\n\t\t return;\r\n\t\t}\r\n\t\t\r\n\t\tfor (CommandLine parsed : parsedCommands) {\r\n\t\t if (parsed.isUsageHelpRequested()) {\r\n\t\t parsed.usage(System.out);\r\n\t\t return;\r\n\t\t } else if (parsed.isVersionHelpRequested()) {\r\n\t\t parsed.printVersionHelp(System.out);\r\n\t\t return;\r\n\t\t }\r\n\t\t}\r\n\t\tObject last = parsedCommands.get(parsedCommands.size() - 1).getCommand();\r\n\t\tif (last instanceof Runnable) {\r\n\t\t ((Runnable) last).run();\r\n\t\t return;\r\n\t\t}\r\n\t}",
"private Object parseArgument(CommandSender sender, Class<?> type, String argument) throws CommandException {\n logger.fine(\"Attempting to parse string \\\"%s\\\" as type %s\", argument, type.getName());\n try {\n if(type == String.class) {\n return argument;\n } else if(type == World.class) {\n return parseWorld(sender, argument);\n } else if(type == int.class) {\n return Integer.parseInt(argument);\n } else if(type == short.class) {\n return Short.parseShort(argument);\n } else if(type == long.class) {\n return Long.parseLong(argument);\n } else if(type == byte.class) {\n return Byte.parseByte(argument);\n } else if(type == boolean.class) {\n if(argument.equalsIgnoreCase(\"true\") || argument.equalsIgnoreCase(\"yes\")) {\n return true;\n }\n if(argument.equalsIgnoreCase(\"false\") || argument.equalsIgnoreCase(\"no\")) {\n return false;\n }\n throw new CommandException(messageConfig.getErrorMessage(\"invalidBoolean\").replace(\"{arg}\", argument));\n } else if(type.isPrimitive()) {\n throw new InvalidCommandException(\"Unknown primitive type on command argument\");\n } else {\n return runValueOfMethod(type, argument);\n }\n\n } catch(IllegalArgumentException ex) {\n throw new CommandException(messageConfig.getErrorMessage(\"invalidArgs\"), ex);\n }\n }",
"protected abstract CommandMatch<?, ?> resolve(InvocationMatch<T> match);",
"public FrameworkCommand(String input, ObjectType init) \n {\n commandString = input.toUpperCase();\n initiator = init;\n\n // todo: verb as first word?\n \n /* This is a crummy timestamp.. We'll hope to do better in subclasses \n using scheduler instances. */\n lTimestamp = System.currentTimeMillis() * 1000;\n }",
"java.lang.String getArg();",
"public static Command parse(String input) throws DukeException {\r\n String[] inputArr = input.split(\" \", 2);\r\n String command = inputArr[0];\r\n\r\n switch (command) {\r\n case \"bye\":\r\n return new ExitCommand();\r\n case \"list\":\r\n return new ListCommand();\r\n case \"done\":\r\n try {\r\n return new DoneCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n mark as done!\");\r\n }\r\n case \"delete\":\r\n try {\r\n return new DeleteCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify the task number you wish to\\n delete!\");\r\n }\r\n case \"todo\":\r\n try {\r\n return new AddCommand(new Todo(inputArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"The description of a todo cannot be empty.\");\r\n }\r\n case \"deadline\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /by \");\r\n return new AddCommand(new Deadline(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n deadline <description> /by <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"event\":\r\n try {\r\n String[] detailsArr = inputArr[1].split(\" /at \");\r\n return new AddCommand(new Event(detailsArr[0], detailsArr[1]));\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\r\n \"Please follow the format:\\n event <description> /at <DD/MM/YYYY HHMM>\");\r\n }\r\n case \"find\":\r\n try {\r\n return new FindCommand(inputArr[1]);\r\n } catch (ArrayIndexOutOfBoundsException e) {\r\n throw new DukeException(\"Please specify what you are searching for!\");\r\n }\r\n default:\r\n throw new DukeException(\"I'm sorry, but I don't know what that means!\");\r\n }\r\n }",
"public abstract void exec(CommandSender sender, String[] args);",
"void exec(ICommandConsole console, List<String> options);",
"public interface CommandParser {\n String[] splitStringIntoCommands(String string);\n String[] splitCommandIntoParams(String string);\n String convertArrayToString(String... stringArray);\n}",
"public interface ICmd {\n void execute(Object... params);\n}",
"public interface CommandExecutor {\n /**\n * This method parse a commands from string and call it\n *\n * @param sender ource of the commands\n * @param connectionCommand commands\n * @return true if a valid commands, otherwise false\n */\n default boolean onCommand(CommandSender sender, ConnectionCommand connectionCommand) {\n String[] split = connectionCommand.getCommand().split(\" \");\n\n return onCommand(sender, split[0], Arrays.copyOfRange(split, 1, split.length), connectionCommand.getArgs());\n }\n\n /**\n * Executes the given commands, returning its success\n *\n * @param sender ource of the commands\n * @param command Command which was executed\n * @param args Passed commands arguments\n * @param objects Objects\n * @return true if a valid commands, otherwise false\n */\n boolean onCommand(CommandSender sender, String command, String[] args, Object... objects);\n\n}",
"protected String interpretCommand(final String line)\n throws IOException\n {\n return executeCommand(line);\n }",
"public interface IFuzzyCommand {\n\t\n\t/**\n\t * Run the command on the given fuzzy engine\n\t * @param engine a fuzzy engine\n\t * @throws FuzzyEngineException in case of errors\n\t */\n\tpublic void run(FuzzyEngine engine) throws FuzzyEngineException;\n\n}",
"public interface Command {\n\t public String execute(String[] request);\n}",
"public void execute() {\n\t\ttry {\n\t\t\tMethod method = this.getClass().getMethod(parseMethod(), new Class[0]);\n\t\t\tmethod.invoke(this, new Object[0]);\n\t\t} catch (NoSuchMethodException | SecurityException e) {\n\t\t\tSystem.out.println(\"Unknown option: \" + command);\n\t\t} catch (IllegalAccessException | IllegalArgumentException e) {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"Invalid usage of: \" + command + \", the following error \" + \"was given: \" + e.getMessage());\n\t\t} catch (InvocationTargetException e) {\n\t\t\tSystem.out.println(\"An error occurred while executing '\" + command + \"'. The \"\n\t\t\t\t\t+ \"following error was given: \" + e.getCause());\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public interface\n\t\tCommandHandler\n\t{\n\t\t/**\n\t\t Interprets a command string\n\n\t\t @param command the command string\n\t\t*/\n\t\tpublic void\n\t\t\thandleCommand(/*@ non_null */ String command);\n\t}",
"protected T getConfigurationByCommandline() {\n\t\t\n\t\tT result = null;\n\t\t\n\t\tString[] args = this.commandLineArguments; \n\t\t\n\t\tif (args == null) {\n\t\t\tthrow new NullPointerException(\"Command line arguments have not been set in factory!\");\n\t\t}\n\t\t\n\t\ttry {\n\t\t\tresult = (T) CliFactory.parseArguments(\n\t\t\t\tthis.configurationInterface, args\n\t\t\t);\n\t\t} catch (ArgumentValidationException e) {\n\t\t\tthrow new ConfigurationException(e.getMessage());\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public static void main(String[] args) {\n Executor executor = new Executor();\n InvocationHandler handler = new DynamicProxy(executor);\n IProxy proxy = (IProxy) Proxy.newProxyInstance(handler.getClass().getClassLoader(), executor.getClass().getInterfaces(), handler);\n proxy.action();\n }",
"public static Command parse(String str) throws DukeException {\n\n String[] arr = str.split(\" \", 2);\n if (arr.length < 1) {\n throw new DukeException(\"No command was given.\");\n }\n String firstWord = arr[0];\n if (str.equalsIgnoreCase(\"bye\")) {\n return new ExitCommand();\n } else if (str.equalsIgnoreCase(\"list\")) {\n return new ListCommand();\n } else {\n Action action = parseFirstWord(firstWord.toLowerCase());\n\n if (arr.length < 2 && (action == Action.Done || action == Action.Delete)) {\n throw new DukeException(\"duke.task.Task number for \" + firstWord + \" is not given.\");\n } else if (arr.length < 2 || arr[1].isBlank()) {\n throw new DukeException(\"The description of \" + firstWord + \" cannot be empty\");\n } else {\n return actionToCommand(action, arr[1]);\n }\n }\n }",
"public Command getCommand(String userInput) {\n return this.parser.parse(userInput);\n }",
"private static Command<?> getCommand(@NonNull String inputStr) {\n int seperatorIndex = inputStr.indexOf(' ');\n String commandStr = seperatorIndex == -1 ? inputStr : inputStr.substring(0, seperatorIndex);\n String paramStr = seperatorIndex == -1 ? \"\" : inputStr.substring(seperatorIndex + 1).trim();\n\n if (\"Tag\".equalsIgnoreCase(commandStr)) {\n List<String> tagList = Splitter.on(\",\")\n .trimResults()\n .omitEmptyStrings()//可以 选择是否对 空字符串 做处理\n .splitToList(paramStr.replace(',', ','));\n return new TagCommand(tagList.toArray(new String[]{}));\n } else if (\"Name\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify file path\");\n }\n return new NameCommand(paramStr);\n } else if (\"Where\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify search criteria\");\n }\n return new WhereCommand(paramStr);\n } else if (\"Analyze\".equalsIgnoreCase(commandStr)) {\n return new AnalyzeCommand();\n } else if (\"Export\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify export file path\");\n }\n return new ExportCommand(paramStr);\n } else {\n throw new IllegalArgumentException(\"Use either Tag, Where, Name, Export, or Analyze\");\n }\n }",
"public static void main(final String[] args) {\n IHandler handler = new ExecutionStrategy(args).getHandler();\n // Print the handler name for reference.\n System.out.println(\"Strategy: \" + handler.getClass().getSimpleName());\n // Invoke the execution strategy.\n handler.handle();\n }",
"public static void main(String[] args) {\n switch (args[0]) {\r\n case \"-createUser\" -> createUser(args);\r\n case \"-showAllUsers\" -> showAllUsers();\r\n case \"-addTask\" -> addTask(args);\r\n case \"-showTasks\" -> showTasks();\r\n default -> {\r\n try {\r\n throw new IncorrectCommandFormatException();\r\n } catch (IncorrectCommandFormatException exception) {\r\n exception.printStackTrace();\r\n }\r\n }\r\n }\r\n }",
"public interface Command {\n\n void executer(Tondeuse tondeuse);\n\n}",
"public interface Command {\n\n String getName();\n\n String getUsage();\n\n String getShortDescription();\n\n void execute(String command, PrintStream out);\n}",
"public Object invoke(String name, Object[] arguments, String[] types) throws Exception {\n return null;\n }",
"@AutoGUIAnnotation(\r\n DescriptionForUser = \"<html>A reference implementation of<br>a Instrument Command.</html>\",\r\n ParameterNames = {\"Value 1\", \"Value 2\", \"Value 3\"},\r\n DefaultValues = {\"1.1\", \"true\", \"\\\"Command-Line in double quotes\\\"\"},\r\n ToolTips = {\"TT1\", \"TT2\", \"The command to execute\"})\r\n @iC_Annotation( MethodChecksSyntax = true )\r\n public void ReferenceImplementation(float Param1,\r\n boolean Param2,\r\n String CommandLine)\r\n throws ScriptException, IOException, DataFormatException {\r\n\r\n // local variables\r\n float dummy = 0;\r\n\r\n\r\n // remove double-quotes from the beginning and end of the CommandLine\r\n CommandLine = CommandLine.replaceFirst(\"^\\\"\", \"\").replaceFirst(\"\\\"$\", \"\");\r\n\r\n\r\n //////////////////////////////////////\r\n // Syntax-Check + Execute Command Line\r\n\r\n // Execute the Command Line:\r\n // in Syntax-Check mode the returned object is null\r\n // when not in Syntax-Check mode, the object should be valid\r\n if ( !CommandLine.isEmpty() ) {\r\n\r\n // make a new Device object to call it's DispatchCommand method\r\n // see Remark in javadoc (How to write new Instrument-Classes)\r\n Device dev = new Device();\r\n\r\n // perform the Syntax check\r\n Object obj = dev.DispatchCommand(CommandLine);\r\n\r\n // convert to float if returned object is valid\r\n if (obj != null) {\r\n\r\n try {\r\n // convert the Instrument's answer to a float\r\n dummy = getFloat(obj.toString());\r\n \r\n } catch (ScriptException ex) {\r\n // returned object is no convertible into a float, so throw an Exception\r\n String str = \"Executing the Command Line\\n\" + CommandLine + \"\\n\"\r\n + \"did not return an object that can be converted into a float value.\\n\"\r\n + \"Please check the Command Line.\\n\";\r\n throw new ScriptException(str);\r\n }\r\n }\r\n // the returned object is not valid, so throw an Exception when\r\n // not in Syntax-Check mode\r\n else if ( !inSyntaxCheckMode() ) {\r\n\r\n // returned object is null, so throw an Exception\r\n String str = \"Executing the Command Line\\n\" + CommandLine + \"\\n\";\r\n str += \"did not return a valid object. Please check the Command Line.\\n\";\r\n\r\n throw new ScriptException(str);\r\n }\r\n }\r\n\r\n\r\n // perform Syntax-Checks here\r\n if (inSyntaxCheckMode()) {\r\n \r\n // these commands are only executed during Syntax-Check mode\r\n \r\n /* if (...) {\r\n String str = \"Descriptive Text.\\n\";\r\n\r\n throw new DataFormatException(str);\r\n }*/\r\n \r\n // Syntax check for a String value defined in a List\r\n // consider if it makes sense to define the list in iC.properties\r\n // see LakeshoreTC.checkInputChannel for an example\r\n /*final List<String> NEW_LIST =\r\n Arrays.asList(\"A\", \"B\", \"C\"); // the entries need to be in uppercase letters!\r\n if ( !NEW_LIST.contains(YourVariableToCheck.toUpperCase()) ) {\r\n String str = \"YourVariableToCheck '\" + YourVariableToCheck + \"' is not valid.\";\r\n str += \"Please select a value from:\\n \" + NEW_LIST.toString() + \".\\n\";\r\n throw new DataFormatException(str);\r\n }*/\r\n\r\n // Range check for a Float value defined in a List\r\n // consider if it makes sense to define the list in iC.properties\r\n /* final List<Float> YOUR_RANGE = Arrays.asList(-100f, 100f);\r\n\r\n if (YourVariableToCheck < YOUR_RANGE.get(0) || YourVariableToCheck > YOUR_RANGE.get(1)) {\r\n String str = \"The zyx value is out of range.\\n\"\r\n + \"Please select a value between \" + YOUR_RANGE.toString() + \".\\n\";\r\n throw new DataFormatException(str);\r\n }*/\r\n \r\n // return if in Syntax-Check mode\r\n return;\r\n }\r\n \r\n\r\n \r\n // exit if in No-Communication-Mode\r\n if (inNoCommunicationMode())\r\n return;\r\n\r\n\r\n\r\n // insert code to perform the desired task\r\n // for instance open files, calculate intermediate values, etc.\r\n\r\n\r\n\r\n //////////////////\r\n // query a command\r\n\r\n // build the GPIB command\r\n String cmd = String.format(Locale.US, \"COMMAND 1, %.3f\", Param1);\r\n\r\n // add the boolean value\r\n cmd += (Param2 ? \"ON\" : \"OFF\");\r\n\r\n\r\n\r\n // if new code requires to wait until a certain criteria is met, the\r\n // following while-loop can be used\r\n boolean Done = false;\r\n while ( !Done && !m_StopScripting) {\r\n\r\n // check for pause button\r\n isPaused(true);\r\n\r\n\r\n // query the command\r\n String ans = QueryInstrument(cmd);\r\n\r\n\r\n /* Convert to float\r\n * Using the predefined conversion routine is useful, because\r\n * it throws a ScriptException when the conversion fails.\r\n */\r\n dummy = getFloat(ans);\r\n\r\n\r\n // do something useful with dummy\r\n\r\n\r\n // check if the Instrument's answer is what we want it to be\r\n // to exit the method\r\n if (dummy == Param1) {\r\n Done = true;\r\n }\r\n }\r\n\r\n\r\n // if new code requires to start a new task, the following anonymous\r\n // inner class can be used. Ensure that the task terminates itself\r\n // upon the Stop signal.\r\n // See iC_Instrument.MonitorChart() for a working example displaying\r\n // data in a chart.\r\n\r\n /**\r\n * Implement a new class from an anonymous inner class that extends\r\n * Thread and implements run(), in which the actual job is done.<p>\r\n *\r\n * The thread pauses, respectively, stops when <code>m_Paused</code>, respectively,\r\n * <code>m_StopScripting</code> is true.\r\n */\r\n // <editor-fold defaultstate=\"collapsed\" desc=\"myThread as anonymous inner class\">\r\n class myThread extends Thread {\r\n\r\n // member variables\r\n public String m_dummy;\r\n\r\n /** Constructor */\r\n public myThread(String dummy) {\r\n // assign the passed values\r\n m_dummy = dummy;\r\n }\r\n\r\n\r\n @Override\r\n public void run() {\r\n // local variables\r\n float dummy = 0.0f;\r\n\r\n // Display a status message\r\n m_GUI.DisplayStatusMessage(\"Starting the thread.\\n\");\r\n\r\n // do until the thread should be stopped\r\n while ( m_StopScripting == false) {\r\n\r\n // check for pause button\r\n isPaused(true);\r\n\r\n // do something useful here\r\n\r\n\r\n // wait the desired time\r\n try { Thread.sleep( 500 ); } catch (InterruptedException ignore) {}\r\n }\r\n\r\n // clean up the thread\r\n\r\n\r\n // Display a status message\r\n m_GUI.DisplayStatusMessage(\"Thread stopped.\\n\");\r\n }\r\n }//</editor-fold>\r\n\r\n\r\n // make a new thread object\r\n myThread myT = new myThread(\"Love All, Serve All\");\r\n\r\n // start the thread and return\r\n myT.start();\r\n }",
"public ViewScheCommand(String line) throws DukeException {\n String[] arrOfStr = line.split(\"\\\\s+\");\n\n this.option = arrOfStr[0].trim();\n if (option.equals(\"/all\")) {\n if (arrOfStr.length > 1) {\n this.date = Parser.parseDate(arrOfStr[1].trim());\n sortByDate = true;\n }\n } else if (option.equals(\"/member\")) {\n this.memberName = arrOfStr[1].trim();\n if (arrOfStr.length > 2) {\n this.date = Parser.parseDate(arrOfStr[2].trim());\n sortByDate = true;\n }\n }\n }",
"private void parseCommand(String line) throws IllegalArgumentException {\n\t\tString[] tokens = line.split(\"\\\\s+\");\n\t\tString commandString;\n\t\tif(tokens.length == 4) {\n\t\t\tcommandString = tokens[2] + \" \" + tokens[3];\n\t\t}\n\t\telse if(tokens.length == 3) {\n\t\t\tcommandString = tokens[2];\n\t\t}\n\t\telse {\n\t\t\tthrow new IllegalArgumentException(\"Invalid command argument\");\n\t\t}\n\t\tthis.registerCommand(tokens[1].charAt(0), commandString);\n\t}",
"public interface Icmd {\n void excute(Object... params);\n}",
"private CommandLine() {\n\t}",
"public abstract Object execute(Class clazz, Object[] args) throws IOException;",
"public interface Command {\n\n /**\n * Executes given command, returns the results.\n *\n * <p><b>Note:</b> Command only executes by a player.</p>\n *\n * @param player Player executed command\n * @param params Passed command parameters\n * @return Command's result was executed\n */\n @NotNull\n CommandResult onCommand(@NotNull Player player, @NotNull String[] params);\n\n /**\n * Executes given command, returns the results.\n *\n * <p><b>Note:</b> Command only executes in the console.</p>\n *\n * @param console Console sender executed command\n * @param params Passed command parameters\n * @return Command's result was executed\n */\n @NotNull\n CommandResult onConsoleCommand(@NotNull ConsoleCommandSender console,\n @NotNull String[] params);\n\n /**\n * Requests a list of possible completions for a command parameters.\n *\n * <p><b>Note:</b> Request will be executed if command were executed by a player.</p>\n *\n * @param player Player executed command\n * @param params The parameters pass to the to the command, including final partial parameter to\n * be completed and command label\n * @return A result contains a list of possible completions for the final argument, or an empty\n * list to default to the command executor and string to search for.\n */\n @NotNull\n TabResult onTab(@NotNull Player player, @NotNull String[] params);\n\n /**\n * Requests a list of possible completions for a command parameters.\n *\n * <p><b>Note:</b> Request will be executed if command was executed in the console.</p>\n *\n * @param console Console sender executed command\n * @param params The parameters pass to the to the command, including final partial parameter to\n * be completed and command label\n * @return A result contains a list of possible completions for the final argument, or an empty\n * list to default to the command executor and string to search for.\n */\n @NotNull\n TabResult onConsoleTab(@NotNull ConsoleCommandSender console,\n @NotNull String[] params);\n\n /**\n * Returns parent {@link Command} of this command.\n *\n * @return Parent of this command\n * @deprecated Rename to {@link #getRoot()}\n */\n @Deprecated\n @Nullable\n Command getParent();\n\n /**\n * Returns root {@link Command} of this command.\n *\n * @return Root of this command\n */\n @Nullable\n Command getRoot();\n\n /**\n * Returns the name of this command.\n *\n * @return Name of this command\n */\n @NotNull\n String getName();\n\n /**\n * Returns the {@link PermissionWrapper} of this command\n *\n * @return The permission wrapper of this command\n */\n @NotNull\n PermissionWrapper getPermission();\n\n /**\n * Get the syntax or example usage of this command.\n *\n * @return Syntax of this command\n */\n @NotNull\n String getSyntax();\n\n /**\n * Gets a brief description of this command\n *\n * @return Description of this command\n */\n @NotNull\n String getDescription();\n\n /**\n * Returns a list of active aliases of this command, include value of {@link #getName()} method.\n *\n * @return List of aliases\n */\n @NotNull\n List<String> getAliases();\n\n String toString();\n}",
"Optional<String> commandLine();",
"public Object execute(String cmd) {\n\t\tObject retval = null;\n\t\tClass[] parameterTypes = new Class[] { CommandInterpreter.class };\n\t\tObject[] parameters = new Object[] { this };\n\t\tboolean executed = false;\n\t\tint size = commandProviders.length;\n\t\tfor (int i = 0; !executed && (i < size); i++) {\n\t\t\ttry {\n\t\t\t\tObject target = commandProviders[i];\n\t\t\t\tMethod method = target.getClass().getMethod(\"_\" + cmd, parameterTypes); //$NON-NLS-1$\n\t\t\t\tretval = method.invoke(target, parameters);\n\t\t\t\texecuted = true; // stop after the command has been found\n\t\t\t}\n\t\t\tcatch (NoSuchMethodException ite) {\n\t\t\t\t// keep going - maybe another command provider will be able to\n\t\t\t\t// execute this command\n\t\t\t}\n\t\t\tcatch (InvocationTargetException ite) {\n\t\t\t\texecuted = true; // don't want to keep trying - we found the\n\t\t\t\t// method but got an error\n\t\t\t\tprintStackTrace(ite.getTargetException());\n\t\t\t}\n\t\t\tcatch (Exception ee) {\n\t\t\t\texecuted = true; // don't want to keep trying - we got an error\n\t\t\t\t// we don't understand\n\t\t\t\tprintStackTrace(ee);\n\t\t\t}\n\t\t}\n\t\t// if no command was found to execute, display help for all registered\n\t\t// command providers\n\t\tif (!executed) {\n\t\t\tfor (int i = 0; i < size; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tCommandProvider commandProvider = (CommandProvider) commandProviders[i];\n\t\t\t\t\tout.print(commandProvider.getHelp());\n\t\t\t\t\tout.flush();\n\t\t\t\t}\n\t\t\t\tcatch (Exception ee) {\n\t\t\t\t\tprintStackTrace(ee);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// call help for the more command provided by this class\n\t\t\tout.print(getHelp());\n\t\t\tout.flush();\n\t\t}\n\t\treturn retval;\n\t}",
"Value main(String main);",
"abstract protected Object invoke0 (Object obj, Object[] args);",
"abstract /*package*/ IValue executeRVMProgram(String moduleName, String uid_main, IValue[] posArgs, Map<String,IValue> kwArgs);",
"public abstract String getLaunchCommand();",
"public interface CmdLineOption {\n \n /**\n * Checks if this option parser recognizes the specified\n * option name.\n */\n boolean accepts(String optionName);\n\n /**\n * Called if the option that this parser recognizes is found.\n * \n * @param parser\n * The parser that's using this option object.\n * \n * For example, if the option \"-quiet\" is simply an alias to\n * \"-verbose 5\", then the implementation can just call the\n * {@link CmdLineParser#parse(String[])} method recursively. \n * \n * @param params\n * The rest of the arguments. This method can use this\n * object to access the arguments of the option if necessary.\n * \n * @return\n * The number of arguments consumed. For example, return 0\n * if this option doesn't take any parameter.\n */\n int parseArguments( CmdLineParser parser, Parameters params ) throws CmdLineException;\n \n// /**\n// * Adds the usage message for this option. \n// * <p>\n// * This method is used to build usage message for the parser.\n// * \n// * @param buf\n// * Messages should be appended to this buffer.\n// * If you add something, make sure you add '\\n' at the end. \n// */\n// void appendUsage( StringBuffer buf );\n \n \n /**\n * SPI for {@link CmdLineOption}.\n * \n * Object of this interface is passed to\n * {@link CmdLineOption}s to make it easy/safe to parse\n * additional parameters for options.\n */\n public interface Parameters {\n /**\n * Gets the recognized option name.\n * \n * @return\n * This option name has been passed to the\n * {@link CmdLineOption#accepts(String)} method and\n * the method has returned <code>true</code>.\n */\n String getOptionName();\n \n /**\n * Gets the additional parameter to this option.\n * \n * @param idx\n * specifying 0 will retrieve the token next to the option.\n * For example, if the command line looks like \"-o abc -d x\",\n * then <code>getParameter(0)</code> for \"-o\" returns \"abc\"\n * and <code>getParameter(1)</code> will return \"-d\".\n * \n * @return\n * Always return non-null valid String. If an attempt is\n * made to access a non-existent index, this method throws\n * appropriate {@link CmdLineException}.\n */\n String getParameter( int idx ) throws CmdLineException;\n \n /**\n * The convenience method of\n * <code>Integer.parseInt(getParameter(idx))</code>\n * with proper error handling.\n * \n * @exception CmdLineException\n * If the parameter is not an integer, it throws an\n * approrpiate {@link CmdLineException}.\n */\n int getIntParameter( int idx ) throws CmdLineException;\n }\n \n}",
"public Runner runner(String[] args, String[] remoteArgs, ClassLoader testClassLoader);",
"@Override\n\tpublic void run(String... args) {\n\t}",
"public interface UserCommand {\n\n\t/**\n\t * Processes the command.\n\t * @throws IOException \n\t * @throws ClassNotFoundException \n\t * @throws InterruptedException \n\t * @throws DescriptorException \n\t */\n\tpublic void process(final JCommander jCommander) throws IOException, InterruptedException, ClassNotFoundException, DescriptorException;\n}",
"public CommandPack executeCommandClient(String s) throws NullPointerException, NoSuchElementException {\n\n int index = s.indexOf(' ');\n\n String commandName;\n String keyWords;\n\n if (index > -1) {\n commandName = s.substring(0, index);\n keyWords = s.substring(index + 1);\n } else {\n commandName = s;\n keyWords = \"\";\n }\n try {\n\n if (history.size() > 5) {\n history.poll();\n }\n history.add(commandName);\n commands.get(commandName).onCall(keyWords);\n\n } catch (NullPointerException e) {\n System.out.println(\"There is no such command\");\n return null;\n } catch (IOException e) {\n System.out.println(\"we don't have a permission to interact with a file (or an unknown error occurred)\");\n return null;\n }\n return (new CommandPack(commandName, additionalOutputToServer, currentUserInfo));\n }",
"public static void main( String[] cmdLine ) throws MalformedURLException,\n NotBoundException, RemoteException\n {\n TuiConsole tuiConsole = new TuiConsole();\n System.exit( tuiConsole.start( cmdLine ) );\n }",
"void run(AnswerType parameter);",
"Result command(@NotNull CommandSender sender, List<String> args);",
"String getCommand();",
"private Main(String... arguments) {\n this.operations = new ArrayDeque<>(List.of(arguments));\n }",
"public abstract void execute(CommandSender sender, String[] args);",
"public FrameworkCommand(String input, String _verb, ObjectType init) \n {\n this(input, init);\n setVerb(_verb);\n }",
"public abstract String getCommand();",
"public Command getCommand() {\n String userInput = in.nextLine();\n String[] words = userInput.split(\" \", 2);\n try {\n return new Command(words[0].toLowerCase(), words[1]);\n } catch (ArrayIndexOutOfBoundsException e) {\n return new Command(words[0].toLowerCase(), Command.BLANK_DESCRIPTION);\n }\n }",
"@Override\n\t\tpublic String execute(String line) {\n\t\t\tString[] command = line.split(\" \"); \n\t\t\tJCommander.newBuilder()\n\t\t\t .addObject(settings)\n\t\t\t .build()\n\t\t\t .parse(command);\n\t\t\t\n\t\t\treturn settings.execute();\n\t\t}",
"public interface CommandLoader {\n\n\t/**\n\t * Gets list of commands in bundle\n\t * @return\n\t */\n\tList<CommandInfo> list();\n\t\n\t/**\n\t * Executes command\n\t * @param cmdName command name\n\t * @return\n\t */\n\tObject execute(String cmdName, String param);\n}",
"private void handleCommand(String input) throws ClientOfflineException, ServerException {\n String[] params = input.split(\" \");\n Command command = this.availableCommandMap.get(params[0]);\n String argument = (params.length <= 1) ? null : params[1];\n command.execute(this, argument);\n }",
"ICommand getCommand(String requestType, String title, String points, String source, String activity_id) throws Exception;",
"public Command parseCommand(String userInput) throws ParseException {\n final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());\n if (!matcher.matches()) {\n throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE));\n }\n\n final String commandWord = matcher.group(\"commandWord\");\n final String arguments = matcher.group(\"arguments\");\n switch (commandWord) {\n\n // ========================== Easy Travel Commands =========================\n case HelpCommand.COMMAND_WORD:\n return new HelpCommand();\n\n case ExitCommand.COMMAND_WORD:\n return new ExitCommand();\n\n // ========================== Trip Commands =========================\n case SetTripCommand.COMMAND_WORD:\n return new SetTripCommandParser().parse(arguments);\n\n case DeleteTripCommand.COMMAND_WORD:\n return new DeleteTripCommand();\n\n case CheckStatusCommand.COMMAND_WORD:\n return new CheckStatusCommand();\n\n case EditBudgetCommand.COMMAND_WORD:\n return new EditBudgetCommandParser().parse(arguments);\n\n case RenameCommand.COMMAND_WORD:\n return new RenameCommandParser().parse(arguments);\n // ========================== Schedule Commands =========================\n case ScheduleCommand.COMMAND_WORD:\n return new ScheduleCommandParser().parse(arguments);\n\n case UnscheduleCommand.COMMAND_WORD:\n return new UnscheduleCommandParser().parse(arguments);\n\n case ListScheduleCommand.COMMAND_WORD:\n return new ListScheduleCommand();\n\n // ========================== Fixed Expense Commands =========================\n case AddFixedExpenseCommand.COMMAND_WORD:\n return new AddFixedExpenseCommandParser().parse(arguments);\n\n case ClearFixedExpenseCommand.COMMAND_WORD:\n return new ClearFixedExpenseCommand();\n\n case DeleteFixedExpenseCommand.COMMAND_WORD:\n return new DeleteFixedExpenseCommandParser().parse(arguments);\n\n case EditFixedExpenseCommand.COMMAND_WORD:\n return new EditFixedExpenseCommandParser().parse(arguments);\n\n case CheckBudgetStatus.COMMAND_WORD:\n return new CheckBudgetStatus();\n\n case SortFixedExpenseCommand.COMMAND_WORD:\n return new SortFixedExpenseCommandParser().parse(arguments);\n\n case ListFixedExpenseCommand.COMMAND_WORD:\n return new ListFixedExpenseCommand();\n\n // ========================== Transport Booking Commands =========================\n case AddTransportBookingCommand.COMMAND_WORD:\n return new AddTransportBookingCommandParser().parse(arguments);\n\n case EditTransportBookingCommand.COMMAND_WORD:\n return new EditTransportBookingCommandParser().parse(arguments);\n\n case DeleteTransportBookingCommand.COMMAND_WORD:\n return new DeleteTransportBookingCommandParser().parse(arguments);\n\n case ClearTransportBookingCommand.COMMAND_WORD:\n return new ClearTransportBookingCommand();\n\n case SortTransportBookingCommand.COMMAND_WORD:\n return new SortTransportBookingCommandParser().parse(arguments);\n\n case ListTransportBookingCommand.COMMAND_WORD:\n return new ListTransportBookingCommand();\n\n // ========================== Packing List Commands =========================\n case AddItemCommand.COMMAND_WORD:\n return new AddItemCommandParser().parse(arguments);\n\n case AddPresetCommand.COMMAND_WORD:\n return new AddPresetCommandParser().parse(arguments);\n\n case CheckItemCommand.COMMAND_WORD:\n return new CheckItemCommandParser().parse(arguments);\n\n case ClearItemCommand.COMMAND_WORD:\n return new ClearItemCommand();\n\n case DeleteItemCommand.COMMAND_WORD:\n return new DeleteItemCommandParser().parse(arguments);\n\n case EditItemCommand.COMMAND_WORD:\n return new EditItemCommandParser().parse(arguments);\n\n case FindItemCommand.COMMAND_WORD:\n return new FindItemCommandParser().parse(arguments);\n\n case FindItemCategoryCommand.COMMAND_WORD:\n return new FindItemCategoryCommandParser().parse(arguments);\n\n case UncheckItemCommand.COMMAND_WORD:\n return new UncheckItemCommandParser().parse(arguments);\n\n case ListItemCommand.COMMAND_WORD:\n return new ListItemCommand();\n\n case ListPresetCommand.COMMAND_WORD:\n return new ListPresetCommand();\n\n case SortItemCommand.COMMAND_WORD:\n return new SortItemCommandParser().parse(arguments);\n\n\n // ========================== Activity Commands =========================\n case AddActivityCommand.COMMAND_WORD:\n return new AddActivityCommandParser().parse(arguments);\n\n case DeleteActivityCommand.COMMAND_WORD:\n return new DeleteActivityCommandParser().parse(arguments);\n\n case ClearActivityCommand.COMMAND_WORD:\n return new ClearActivityCommand();\n\n case EditActivityCommand.COMMAND_WORD:\n return new EditActivityCommandParser().parse(arguments);\n\n case FindActivityCommand.COMMAND_WORD:\n return new FindActivityCommandParser().parse(arguments);\n\n case FindActivityTagCommand.COMMAND_WORD:\n return new FindActivityTagCommandParser().parse(arguments);\n\n case ListActivityCommand.COMMAND_WORD:\n return new ListActivityCommand();\n\n case SortActivityCommand.COMMAND_WORD:\n return new SortActivityCommandParser().parse(arguments);\n\n // ========================== Accommodation Commands =========================\n case AddAccommodationBookingCommand.COMMAND_WORD:\n return new AddAccommodationBookingCommandParser().parse(arguments);\n\n case ClearAccommodationBookingCommand.COMMAND_WORD:\n return new ClearAccommodationBookingCommand();\n\n case DeleteAccommodationBookingCommand.COMMAND_WORD:\n return new DeleteAccommodationBookingCommandParser().parse(arguments);\n\n case EditAccommodationBookingCommand.COMMAND_WORD:\n return new EditAccommodationBookingCommandParser().parse(arguments);\n\n case SortAccommodationBookingCommand.COMMAND_WORD:\n return new SortAccommodationBookingParser().parse(arguments);\n\n case ListAccommodationBookingCommand.COMMAND_WORD:\n return new ListAccommodationBookingCommand();\n\n // ========================== Invalid Commands =========================\n default:\n throw new ParseException(MESSAGE_UNKNOWN_COMMAND);\n }\n }",
"private void executeCommand(String c) {\n // split command and arguments\n int index = c.indexOf(' ');\n String command = ((index == -1) ? c.toUpperCase() : (c.substring(0, index)).toUpperCase());\n String args = ((index == -1) ? null : c.substring(index + 1));\n\n debugOutput(\"Command: \" + command + \" Args: \" + args);\n\n // dispatcher mechanism for different commands\n switch (command) {\n case \"USER\":\n handleUser(args);\n break;\n\n case \"PASS\":\n handlePass(args);\n break;\n\n case \"CWD\":\n handleCwd(args);\n break;\n\n case \"LIST\":\n handleNlst(args);\n break;\n\n case \"NLST\":\n handleNlst(args);\n break;\n\n case \"PWD\":\n case \"XPWD\":\n handlePwd();\n break;\n\n case \"QUIT\":\n handleQuit();\n break;\n\n case \"PASV\":\n handlePasv();\n break;\n\n case \"EPSV\":\n handleEpsv();\n break;\n\n case \"SYST\":\n handleSyst();\n break;\n\n case \"FEAT\":\n handleFeat();\n break;\n\n case \"PORT\":\n handlePort(args);\n break;\n\n case \"EPRT\":\n handleEPort(args);\n break;\n\n case \"RETR\":\n handleRetr(args);\n break;\n\n case \"MKD\":\n case \"XMKD\":\n handleMkd(args);\n break;\n\n case \"RMD\":\n case \"XRMD\":\n handleRmd(args);\n break;\n\n case \"TYPE\":\n handleType(args);\n break;\n\n case \"STOR\":\n handleStor(args);\n break;\n\n default:\n sendMsgToClient(\"501 Unknown command\");\n break;\n\n }\n\n }",
"public static void main(String[] args) throws InstantiationException, IllegalAccessException {\n }",
"public Invoker() {\n\n\t\twhile (true) {\n\t\t\tSystem.out.println(execute(scanner.next()));\n\t\t}\n\t}",
"public abstract Menu execute(String commandKey);",
"void run(String name, int v);",
"public void parseUserInput(String[] args)\n {\n this.args = args;\n// Class cls = this.getClass();\n Method method;\n String parameter;\n int parameterPrefix = USER_OPTION.length();\n\n for (int parameterIndex=0; parameterIndex<args.length; parameterIndex++)\n {\n // Parse the input to find the corresponding function\n try\n {\n parameter = args[parameterIndex].substring(parameterPrefix);\n method = UserInput.class.getDeclaredMethod(parameter, Integer.class);\n parameterIndex = (int) method.invoke(this, parameterIndex);\n }\n catch (NoSuchMethodException | IllegalAccessException e )\n {\n throw new RuntimeException(\"Unhandled parameter: \" + args[parameterIndex] + \"\\n\" + e);\n }\n catch (InvocationTargetException e)\n {\n// e.printStackTrace();\n throw new RuntimeException(\"Missing or wrong parameters for the option: \" + args[parameterIndex] + \"\\n\" + e);\n }\n }\n }",
"public abstract void onInvoked(CommandSender sender, String[] args);",
"public static void main(String[] args) {\n\t\tnew RemoteInvocationClient().go(); \n\t}",
"public static void main(String[] args, String value) {\n }",
"public void handleCommand(String command);",
"public static AbstractCommand getFromLine(FtpSession session, String line) {\r\n \t\tFtpCommandCode ftpCommandCode = null;\r\n \t\tif (line == null) {\r\n \t\t\tftpCommandCode = FtpCommandCode.Unknown;\r\n \t\t\tline = \"\";\r\n \t\t}\r\n \t\tString command = null;\r\n \t\tString arg = null;\r\n \t\tif (line.indexOf(' ') == -1) {\r\n \t\t\tcommand = line;\r\n \t\t\targ = null;\r\n \t\t} else {\r\n \t\t\tcommand = line.substring(0, line.indexOf(' '));\r\n \t\t\targ = line.substring(line.indexOf(' ')+1);\r\n \t\t\tif (arg.length() == 0) {\r\n \t\t\t\targ = null;\r\n \t\t\t}\r\n \t\t}\r\n \t\tString COMMAND = command.toUpperCase();\r\n \t\ttry {\r\n \t\t\tftpCommandCode = FtpCommandCode.valueOf(COMMAND);\r\n \t\t} catch (IllegalArgumentException e) {\r\n \t\t\tftpCommandCode = FtpCommandCode.Unknown;\r\n \t\t}\r\n \t\tAbstractCommand abstractCommand;\r\n \t\ttry {\r\n \t\t\tabstractCommand = (AbstractCommand) ftpCommandCode.command.newInstance();\r\n \t\t} catch (InstantiationException e) {\r\n \t\t\tabstractCommand = new UnknownCommand();\r\n \t\t\tabstractCommand.setArgs(session, COMMAND, arg, Unknown);\r\n \t\t\treturn abstractCommand;\r\n \t\t} catch (IllegalAccessException e) {\r\n \t\t\tabstractCommand = new UnknownCommand();\r\n \t\t\tabstractCommand.setArgs(session, COMMAND, arg, Unknown);\r\n \t\t\treturn abstractCommand;\r\n \t\t}\r\n \t\tabstractCommand.setArgs(session, COMMAND, arg, ftpCommandCode);\r\n \t\treturn abstractCommand;\r\n \t}",
"ProcessTaskFactory<T> runAsCommand();",
"public interface RouterDemoCommand {\n // Ui command begin\n String goDemoHomeActivity = \"goDemoHomeActivity\";\n // Ui command end\n\n // Data command begin\n // Data command end\n\n // Op command begin\n // Op command end\n}",
"String runAlgo(THost host, String classname, String param);",
"public ServerInterpreterImpl(String[] args){\n\n /* Expected inputs */\n Map<String, String> arg_values = new HashMap<>();\n arg_values.put(\"-v\", null);\n arg_values.put(\"-i\", null);\n arg_values.put(\"ip\", null);\n arg_values.put(\"-p\", null);\n arg_values.put(\"port\", null);\n arg_values.put(\"-h\", null);\n\n /* (Bonus check) Max length 6, to avoid server latencies for nothing if\n someone try to enter a large number of arguments. */\n if (args.length > 6){\n error_message = usage;\n return;\n }\n\n /*\n Checks:\n (1) Each inputs is one of -v, -i, -p, -h, int (port range), [0.255].[0-255].[0-255].[0-255]\n (2) Only one input for each kind (see (1) for the list)\n (3) Option -i must be followed by the ip address. Same for -p and the port\n (4) Check if the -i option is present if and only if an ip address is present. Same for -p and the port\n */\n for (int i=0; i<args.length; i++){\n\n /* (1) */\n if ( !valid(args[i]) ){\n error_message = usage;\n return;\n }\n\n /* (2) */\n String type_arg = type(args[i]);\n if ( arg_values.get(type_arg) != null ){\n error_message = usage;\n return;\n }\n arg_values.put(type_arg, args[i]);\n\n /* (3) */\n if ( type_arg.equals(\"-i\") && ( (i==(args.length-1)) || !(type(args[i+1]).equals(\"ip\")) ) ){\n error_message = usage;\n return;\n }\n else if ( type_arg.equals(\"-p\") && ( (i==(args.length-1)) || !(type(args[i+1]).equals(\"port\")) ) ){\n error_message = usage;\n return;\n }\n }\n\n /* (4) */\n if ( ((arg_values.get(\"ip\") != null) && (arg_values.get(\"-i\") == null))\n || ((arg_values.get(\"ip\") == null) && (arg_values.get(\"-i\") != null))\n || ((arg_values.get(\"port\") != null) && (arg_values.get(\"-p\") == null))\n || ((arg_values.get(\"port\") == null) && (arg_values.get(\"-p\") != null))){\n error_message = usage;\n return;\n }\n\n set_inputs(arg_values);\n }",
"public interface IActivityCommandFactory {\n /**\n * creates command to be executed.\n * @param requestType\n * @param title\n * @param points\n * @param source\n * @param activity_id\n * @return\n * @throws Exception\n */\n ICommand getCommand(String requestType, String title, String points, String source, String activity_id) throws Exception;\n}"
] | [
"0.6551683",
"0.58815324",
"0.57364833",
"0.5694924",
"0.56612504",
"0.55903393",
"0.5584083",
"0.55711627",
"0.55657506",
"0.554699",
"0.5414371",
"0.53359056",
"0.5323962",
"0.53168845",
"0.5312285",
"0.5305977",
"0.52994317",
"0.5295115",
"0.5294826",
"0.5255744",
"0.52280104",
"0.5202422",
"0.5165263",
"0.51456016",
"0.51350474",
"0.51142704",
"0.51031774",
"0.51008725",
"0.50906616",
"0.5076318",
"0.50543725",
"0.50418633",
"0.5041752",
"0.5037318",
"0.5034409",
"0.50227815",
"0.500558",
"0.50049543",
"0.50023663",
"0.49942803",
"0.49920094",
"0.49794888",
"0.49735162",
"0.4968887",
"0.49492854",
"0.49262807",
"0.49181062",
"0.49048284",
"0.49008477",
"0.48983622",
"0.48906782",
"0.48825467",
"0.48791403",
"0.48659524",
"0.48637658",
"0.48517406",
"0.48517042",
"0.48509875",
"0.484977",
"0.48464686",
"0.48377654",
"0.48305926",
"0.48230508",
"0.48187274",
"0.48178193",
"0.48109815",
"0.4810235",
"0.4806901",
"0.48028678",
"0.47807372",
"0.47788212",
"0.47761327",
"0.4775775",
"0.47756872",
"0.47756752",
"0.47723496",
"0.47700515",
"0.47650337",
"0.47644076",
"0.47626022",
"0.47615144",
"0.47581494",
"0.4756547",
"0.47415408",
"0.47389132",
"0.47385988",
"0.47358692",
"0.47315466",
"0.47227618",
"0.4722347",
"0.4715633",
"0.47125944",
"0.47115222",
"0.4711459",
"0.4707237",
"0.47039554",
"0.47035497",
"0.47035202",
"0.47017863",
"0.46952292",
"0.46949312"
] | 0.0 | -1 |
populate the table with data | private void loadData() {
// connect the table column with the attributes of the patient from the Queries class
id_In_editTable.setCellValueFactory(new PropertyValueFactory<>("pstiantID"));
name_In_editTable.setCellValueFactory(new PropertyValueFactory<>("name"));
date_In_editTable.setCellValueFactory(new PropertyValueFactory<>("reserveDate"));
time_In_editTable.setCellValueFactory(new PropertyValueFactory<>("reserveTime"));
try {
// database related code "MySql"
ps = con.prepareStatement("select * from visitInfo ");
ResultSet rs = ps.executeQuery();
while (rs.next()) {
// load data to the observable list
editOL.add(new Queries(new SimpleStringProperty(rs.getString("id")),
new SimpleStringProperty(rs.getString("patiantID")),
new SimpleStringProperty(rs.getString("patiant_name")),
new SimpleStringProperty(rs.getString("visit_type")),
new SimpleStringProperty(rs.getString("payment_value")),
new SimpleStringProperty(rs.getString("reserve_date")),
new SimpleStringProperty(rs.getString("reserve_time")),
new SimpleStringProperty(rs.getString("attend_date")),
new SimpleStringProperty(rs.getString("attend_time")),
new SimpleStringProperty(rs.getString("payment_date")),
new SimpleStringProperty(rs.getString("attend")),
new SimpleStringProperty(rs.getString("attend_type"))
));
}
// assigning the observable list to the table
table_view_in_edit.setItems(editOL);
ps.close();
rs.close();
} catch (SQLException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void populateTableData() {\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n model.setRowCount(0);\n for (Organization o : organizationDirectory.getOrganizationList()) {\n Object[] row = new Object[1];\n row[0] = o;\n //row[1] = o.getOrgName();\n model.addRow(row);\n }\n }",
"private void fillData() {\n table.setRowList(data);\n }",
"public void populate(){\n DefaultTableModel dtms = (DefaultTableModel)ticketTable.getModel();\n dtms.setRowCount(0);\n for(Ticket a:ticket)\n {\n Object[] row = new Object[dtms.getColumnCount()];\n row[0]=a;\n row[1]=a.getAirlineNO();\n row[2]=a.getCustomer();\n row[3]=a.getSeat();\n row[4]=a.getAirlineAgency();\n out.println(a+\" \"+a.getAirlineNO()+\" \"+a.getCustomer()+\" \"+a.getSeat()+\" \"+a.getAirlineAgency());\n dtms.addRow(row);\n }\n }",
"private void populateTable() {\n \n DefaultTableModel dtm = (DefaultTableModel) tblAllCars.getModel();\n dtm.setRowCount(0);\n \n for(Car car : carFleet.getCarFleet()){\n \n Object[] row = new Object[8];\n row[0]=car.getBrandName();\n row[1]=car.getModelNumber();\n row[2]=car.getSerialNumber();\n row[3]=car.getMax_seats();\n row[4]=car.isAvailable();\n row[5]=car.getYearOfManufacturing();\n row[6]=car.isMaintenenceCerticateExpiry();\n row[7]=car.getCity();\n \n dtm.addRow(row);\n \n }\n }",
"public void populateDataToTable() throws SQLException {\n model = (DefaultTableModel) tblOutcome.getModel();\n List<Outcome> ouc = conn.loadOutcome();\n int i = 1;\n for (Outcome oc : ouc) {\n Object[] row = new Object[5];\n row[0] = i++;\n row[1] = oc.getCode_outcome();\n row[2] = oc.getTgl_outcome();\n row[3] = oc.getJml_outcome();\n row[4] = oc.getKet_outcome();\n model.addRow(row);\n }\n }",
"public void populateTable()\n {\n DefaultTableModel model = (DefaultTableModel)workRequestJTable.getModel();\n \n model.setRowCount(0);\n for(WorkRequest request : weatherOrganisation.getWorkQueue().getWorkRequestList())\n {\n Object[] row = new Object[5];\n row[0] = request;\n \n row[1] = request.getStatus();\n row[2] = request.getRequestDate();\n row[3] = request.getResolveDate();\n row[4] = request.getDriverAcknowledgement();\n \n model.addRow(row);\n \n }\n \n }",
"private void populateTable(Vector data) {\n Vector columnNames = ViewStrings.getShareColumnNames();\n ((ShareTraderTable) table).updateTable(data, columnNames);\n }",
"private void repopulateTableForAdd()\n {\n clearTable();\n populateTable(null);\n }",
"private void populateTable() {\n Collections.sort(this.player.arr, new SortByLevel());\n achievementLabel.setText(player.toString() + \" at \" + new SimpleDateFormat(\"dd/MM/yy HH:mm:ss\").format(new Date()));\n for(int i = 0; i < this.player.arr.size(); i++) {\n Achievement temp = this.player.arr.get(i);\n resultsTable.addRow(new Object[] {temp.getDescription(), temp.getLevel(), temp.getOutOfPossible()});\n }\n }",
"private void fillTable(){\n tblModel.setRowCount(0);// xoa cac hang trong bang\n \n for(Student st: list){\n tblModel.addRow(new String[]{st.getStudentId(), st.getName(), st.getMajor(),\"\"\n + st.getMark(), st.getCapacity(), \"\" + st.isBonnus()});\n // them (\"\" + )de chuyen doi kieu float va boolean sang string\n \n }\n tblModel.fireTableDataChanged();\n }",
"private void initTable() {\n\t\tDefaultTableModel dtm = (DefaultTableModel)table.getModel();\n\t\tdtm.setRowCount(0);\t\t\n\t\tfor(int i=0;i<MainUi.controller.sale.items.size();i++){\n\t\t\tVector v1 = new Vector();\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getProdSpec().getTitle());\n\t\t\tv1.add(MainUi.controller.sale.items.get(i).getCopies());\n\t\t\tdtm.addRow(v1);\n\t\t}\n\t\tlblNewLabel.setText(\"\"+MainUi.controller.sale.getTotal());\n\t}",
"private void populateTable() {\n this.allLogs = this.auditLogService.getAllLogs();\n // Creat columns for users\n\n\n TableColumn<Map, String> actionColumn = new TableColumn<>(\"Action\");\n actionColumn.setCellValueFactory(new MapValueFactory<>(\"action\"));\n\n TableColumn<Map, String> actionByColumn = new TableColumn<>(\"By\");\n actionByColumn.setCellValueFactory(new MapValueFactory<>(\"actionByUserId\"));\n\n TableColumn<Map, String> actionAt = new TableColumn<>(\"At\");\n actionAt.setCellValueFactory(new MapValueFactory<>(\"createdAt\"));\n this.listOfLogs.getColumns().add(actionColumn);\n this.listOfLogs.getColumns().add(actionByColumn);\n this.listOfLogs.getColumns().add(actionAt);\n // Create an observable list to add customers to\n ObservableList<Map<String, Object>> items = FXCollections.<Map<String, Object>>observableArrayList();\n\n this.allLogs.forEach(log -> {\n Map<String, Object> obj = new HashMap<>();\n // Forces int to be string to be converted back to int\n obj.put(\"action\", log.getAction());\n obj.put(\"actionByUserId\", log.getActionByUserId().getName());\n obj.put(\"createdAt\", log.getCreatedAt());\n items.add(obj);\n });\n\n // Add all the users to the table\n this.listOfLogs.getItems().addAll(items);\n }",
"public void populateDataOnTable() {\n /*Defining default table model*/\n DefaultTableModel dtm = new DefaultTableModel(){\n\n @Override\n public boolean isCellEditable(int row, int column) {\n //all cells false\n return false;\n }\n };\n \n try{\n dtm.addColumn(\"Client Id\");\n dtm.addColumn(\"Request Date\");\n dtm.addColumn(\"Request Id\");\n dtm.addColumn(\"Request Subject\");\n dtm.addColumn(\"Description\");\n dtm.addColumn(\"Response Date\");\n dtm.addColumn(\"Response Id\");\n dtm.addColumn(\"Response Subject\");\n dtm.addColumn(\"Description\");\n \n /*Getting the value of clientId and setting it to the request and response*/\n BLRequestResponse blRequestResponse = new BLRequestResponse();\n ResultSet rs = blRequestResponse.selectParticularClientRequestResponse(txt_username.getText()); \n \n while(rs.next()) {\n Object objData[] = new Object[9];\n //objData[0] = this.setInt(num);\n objData[0] = rs.getInt(\"clientId\");\n objData[1] = rs.getString(\"reqDate\");\n objData[2] = rs.getInt(\"requestId\");\n objData[3] = rs.getString(\"requestSubject\");\n objData[4] = rs.getString(\"requestDescrip\");\n objData[5] = rs.getString(\"resDate\");\n objData[6] = rs.getInt(\"responseId\");\n objData[7] = rs.getString(\"responseSubject\");\n objData[8] = rs.getString(\"responseDescrip\");\n \n dtm.addRow(objData);\n }\n this.jTable1.setModel(dtm);\n }catch(Exception ex){\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"Exception\", JOptionPane.INFORMATION_MESSAGE);\n }\n }",
"protected void fillTable() {\r\n\t\ttabDate.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"transactionDate\"));\r\n\t\ttabSenderNumber.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"senderNumber\"));\r\n\t\ttabReceiverNumber\r\n\t\t\t\t.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"receiverNumber\"));\r\n\t\ttabAmount.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, BigDecimal>(\"amount\"));\r\n\t\ttabReference.setCellValueFactory(new PropertyValueFactory<TableRowAllTransactions, String>(\"reference\"));\r\n\r\n\t\tList<TableRowAllTransactions> tableRows = new ArrayList<TableRowAllTransactions>();\r\n\r\n\t\tfor (Transaction transaction : transactionList) {\r\n\t\t\tTableRowAllTransactions tableRow = new TableRowAllTransactions();\r\n\t\t\ttableRow.setTransactionDate(\r\n\t\t\t\t\tnew SimpleDateFormat(\"dd.MM.yyyy HH:mm:ss\").format(transaction.getTransactionDate()));\r\n\t\t\ttableRow.setSenderNumber(transaction.getSender().getNumber());\r\n\t\t\ttableRow.setReceiverNumber(transaction.getReceiver().getNumber());\r\n\t\t\ttableRow.setAmount(transaction.getAmount());\r\n\t\t\ttableRow.setReferenceString(transaction.getReference());\r\n\t\t\ttableRows.add(tableRow);\r\n\r\n\t\t}\r\n\r\n\t\tObservableList<TableRowAllTransactions> data = FXCollections.observableList(tableRows);\r\n\t\ttabTransaction.setItems(data);\r\n\t}",
"public void populateDiseaseTable() {\r\n DefaultTableModel dtm = (DefaultTableModel) tblDisease.getModel();\r\n dtm.setRowCount(0);\r\n for (Conditions disease : system.getConditionsList().getConditionList()) {\r\n Object[] row = new Object[2];\r\n row[0] = disease;\r\n row[1] = disease.getDiseaseId();\r\n dtm.addRow(row);\r\n }\r\n }",
"private void buildTable() {\n\t\tObservableList<Record> data;\r\n\t\tdata = FXCollections.observableArrayList();\r\n\r\n\t\t// get records from the database\r\n\t\tArrayList<Record> list = new ArrayList<Record>();\r\n\t\tlist = getItemsToAdd();\r\n\r\n\t\t// add records to the table\r\n\t\tfor (Record i : list) {\r\n\t\t\tSystem.out.println(\"Add row: \" + i);\r\n\t\t\tdata.add(i);\r\n\t\t}\r\n\t\ttableView.setItems(data);\r\n\t}",
"void initTable();",
"public void fillMyGoodsTable() {\n\t\tHashMap<Goods, Integer> myGoods = ship.getMyGoods();\n\t\tDefaultTableModel model = (DefaultTableModel)this.myGoodsTable.getModel();\n\t\tint number = 1;\n\t\tfor (HashMap.Entry<Goods, Integer> set: myGoods.entrySet()) {\n\t\t\tString name = set.getKey().getName();\n\t\t\tint quantity = set.getKey().getQuantityOwned();\n\t\t\tint price = set.getValue();\n\t\t\tmodel.addRow(new Object [] {number, name, quantity, price});\n\t\t\tnumber++;\n\t\t}\n\t}",
"void populateData();",
"public void initTable();",
"public void prepareTable(){\n\n TableColumn<Student, String> firstNameCol = new TableColumn<>(\"FirstName\");\n firstNameCol.setMinWidth(100);\n firstNameCol.setCellValueFactory(new PropertyValueFactory<>(\"firstname\"));\n\n TableColumn<Student, String> lastNameCol = new TableColumn<>(\"LastName\");\n lastNameCol.setMinWidth(100);\n lastNameCol.setCellValueFactory(new PropertyValueFactory<>(\"lastname\"));\n\n TableColumn<Student, String> formCol = new TableColumn<>(\"Form\");\n formCol.setMinWidth(100);\n formCol.setCellValueFactory(new PropertyValueFactory<>(\"form\"));\n\n TableColumn<Student, String> streamCol = new TableColumn<>(\"Stream\");\n streamCol.setMinWidth(100);\n streamCol.setCellValueFactory(new PropertyValueFactory<>(\"stream\"));\n\n TableColumn<Student, String> dateOfBirthCol = new TableColumn<>(\"Favorite Game\");\n dateOfBirthCol.setMinWidth(100);\n dateOfBirthCol.setCellValueFactory(new PropertyValueFactory<>(\"dateOfBirth\"));\n\n TableColumn<Student, String> genderCol = new TableColumn<>(\"Gender\");\n genderCol.setMinWidth(100);\n genderCol.setCellValueFactory(new PropertyValueFactory<>(\"gender\"));\n\n TableColumn<Student, Integer> ageCol = new TableColumn<>(\"age\");\n ageCol.setMinWidth(100);\n ageCol.setCellValueFactory(new PropertyValueFactory<>(\"age\"));\n\n TableColumn<Student, Integer> admissionCol = new TableColumn<>(\"Admission\");\n admissionCol.setMinWidth(100);\n admissionCol.setCellValueFactory(new PropertyValueFactory<>(\"admission\"));\n\n\n table.getColumns().addAll(admissionCol,firstNameCol,lastNameCol,formCol,streamCol,dateOfBirthCol,genderCol,ageCol);\n table.setItems(dao.selectAll());\n\n }",
"private void setUpTable()\n {\n //Setting the outlook of the table\n bookTable.setColumnReorderingAllowed(true);\n bookTable.setColumnCollapsingAllowed(true);\n \n \n bookTable.setContainerDataSource(allBooksBean);\n \n \n //Setting up the table data row and column\n /*bookTable.addContainerProperty(\"id\", Integer.class, null);\n bookTable.addContainerProperty(\"book name\",String.class, null);\n bookTable.addContainerProperty(\"author name\", String.class, null);\n bookTable.addContainerProperty(\"description\", String.class, null);\n bookTable.addContainerProperty(\"book genres\", String.class, null);\n */\n //The initial values in the table \n db.connectDB();\n try{\n allBooks = db.getAllBooks();\n }catch(SQLException ex)\n {\n ex.printStackTrace();\n }\n db.closeDB();\n allBooksBean.addAll(allBooks);\n \n //Set Visible columns (show certain columnes)\n bookTable.setVisibleColumns(new Object[]{\"id\",\"bookName\", \"authorName\", \"description\" ,\"bookGenreString\"});\n \n //Set height and width\n bookTable.setHeight(\"370px\");\n bookTable.setWidth(\"1000px\");\n \n //Allow the data in the table to be selected\n bookTable.setSelectable(true);\n \n //Save the selected row by saving the change Immediately\n bookTable.setImmediate(true);\n //Set the table on listener for value change\n bookTable.addValueChangeListener(new Property.ValueChangeListener()\n {\n public void valueChange(ValueChangeEvent event) {\n \n }\n\n });\n }",
"public void initTable(){\n if(counter == 0){\n getDataSemua();\n }else if(counter == 1){\n getDataMakan();\n }else if(counter == 2){\n getDataMinum();\n }else if(counter == 3){\n getDataPaket();\n }\n id.setCellValueFactory(new PropertyValueFactory<casher, String>(\"Id\"));\n nama.setCellValueFactory(new PropertyValueFactory<casher, String>(\"Nama\"));\n kategori.setCellValueFactory(new PropertyValueFactory<casher, String>(\"Kategori\"));\n harga.setCellValueFactory(new PropertyValueFactory<casher, Integer>(\"Harga\"));\n status.setCellValueFactory(new PropertyValueFactory<casher, String>(\"Status\"));\n tambah.setCellValueFactory(new PropertyValueFactory<casher,Button>(\"Tambah\"));\n\n table.setItems(list);\n\n }",
"@Override\n public void initData() {\n customerResponses = distributorController.getAllDistributorResponseObject();\n Object[] obj = new Object[]{\"STT\", \"Mã Nhà phân phối\", \"Tên nhà phân phối\", \"Địa chỉ\", \"Số điện thoại\", \"Email\", \"Ghi chú\"};\n tableModel = new DefaultTableModel(obj, 0);\n tableRowSorter = new TableRowSorter<>(tableModel);\n tblDistribute.setModel(tableModel);\n tblDistribute.setRowSorter(tableRowSorter);\n count = 0;\n tableModel.setRowCount(0);\n try {\n customerResponses.forEach((Object[] item) -> {\n item[0] = ++count;\n tableModel.addRow(item);\n\n });\n } catch (Exception exception) {\n log.error(\"Can't add row to table model \");\n exception.printStackTrace();\n\n }\n setButtonsEnable(btnUpdate, false, btnAdd, true, btnEdit, false, btnDelete, false, btnCancel, true);\n }",
"public void getTableData() {\n MSApptIDCol.setCellValueFactory(new PropertyValueFactory<Appointment, Integer>(\"appointmentID\"));\n MSCustIDCol.setCellValueFactory(new PropertyValueFactory<Appointment, Integer>(\"customerID\"));\n MSTitleCol.setCellValueFactory(new PropertyValueFactory<Appointment, String>(\"appointmentTitle\"));\n MSDescriptionCol.setCellValueFactory(new PropertyValueFactory<Appointment, String>(\"description\"));\n MSContactCol.setCellValueFactory(new PropertyValueFactory<Appointment, String>(\"contactName\"));\n MSLocationCol.setCellValueFactory(new PropertyValueFactory<Appointment, String>(\"location\"));\n MSTypeCol.setCellValueFactory(new PropertyValueFactory<Appointment, String>(\"appointmentType\"));\n MSStartTimeCol.setCellValueFactory(new PropertyValueFactory<Appointment, LocalDateTime>(\"appointmentStart\"));\n MSEndTimeCol.setCellValueFactory(new PropertyValueFactory<Appointment, LocalDateTime>(\"appointmentEnd\"));\n }",
"private void createTable() {\n\t\t// Tao dataModel & table \n\t\tdataModel = new DefaultTableModel(headers, 0);\n\t\ttable.setModel(dataModel);\n\t\t\n\t\tnapDuLieuChoBang();\n\t}",
"private void loadTable() {\n model.getDataVector().removeAllElements();\n model.fireTableDataChanged();\n try {\n String sql = \"select * from tb_mahasiswa\";\n Statement n = a.createStatement();\n ResultSet rs = n.executeQuery(sql);\n while (rs.next()) {\n Object[] o = new Object[6];\n o[0] = rs.getString(\"id_mahasiswa\");\n o[1] = rs.getString(\"nama\");\n o[2] = rs.getString(\"tempat\");\n o[3] = rs.getString(\"waktu\");\n o[4] = rs.getString(\"status\");\n model.addRow(o);\n }\n } catch (Exception e) {\n }\n }",
"private void initTableView() {\n try {\n NonEditableDefaultTableModel dtm = new NonEditableDefaultTableModel();\n dtm.setColumnIdentifiers(new String[]{\"Id\", \"Code\", \"From\", \"To\", \"Prepared\", \"Status\"});\n\n for (PayrollPeriod p : ppDao.getPayrollPeriods()) {\n\n try {\n Object[] o = new Object[]{p.getId(), p,\n sdf.format(p.getDateFrom()), sdf.format(p.getDateTo()),\n sdf.format(p.getDatePrepared()), p.getStatus()};\n dtm.addRow(o);\n } catch (Exception ex) {\n }\n\n }\n tablePayrollPeriod.setModel(dtm);\n } catch (Exception ex) {\n Logger.getLogger(PayrollPeriodInformation.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }",
"private void initFlightsTable() {\n try ( Connection con = DbCon.getConnection()) {\n PreparedStatement pst = con.prepareStatement(\"select * from Flights\");\n ResultSet rs = pst.executeQuery();\n ResultSetMetaData rsmd = rs.getMetaData();\n\n int columnCount = rsmd.getColumnCount();\n //create a model to of the flights table to be populated later\n flightsDftTblMdl = (DefaultTableModel) flightsTable.getModel();\n flightsDftTblMdl.setRowCount(0);\n\n while (rs.next()) {\n //holds all valauese from table Flight\n Object[] a = new Object[6];\n //assigning of the values from Flight\n for (int i = 0; i < columnCount; i++) {\n a[0] = rs.getString(\"departure\");\n a[1] = rs.getString(\"destination\");\n a[2] = rs.getString(\"depTime\");\n a[3] = rs.getString(\"arrTime\");\n a[4] = rs.getInt(\"number\");\n a[5] = rs.getDouble(\"price\");\n }// add new row to the model\n flightsDftTblMdl.addRow(a);\n }\n\n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(BookTicket.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private void populateUserTable() {\n DefaultTableModel model = (DefaultTableModel)userJTable.getModel();\n model.setRowCount(0);\n \n for(Network nw : system.getNetworkList()){\n for(Enterprise ep : nw.getEnterpriseDirectory().getEnterpriseList()){\n if(ep instanceof SupplierEnterpise){\n for (Organization org : ep.getOrganazDirectory().getOrganizationList()) {\n for (UserAccount ua : org.getUserAccountDirectory().getUserAccountList()) {\n Object[] row = new Object[3];\n row[0] = ep.getName();\n row[1] = nw.getName();\n row[2] = ua.getUsername();\n\n model.addRow(row);\n }\n } \n }else{\n for (UserAccount ua : ep.getUserAccountDirectory().getUserAccountList()) {\n Object[] row = new Object[3];\n row[0] = ep.getName();\n row[1] = nw.getName();\n row[2] = ua.getUsername();\n\n model.addRow(row);\n }\n }\n }\n }\n }",
"public void loadData() {\n String[] header = {\"Tên Cty\", \"Mã Cty\", \"Cty mẹ\", \"Giám đốc\", \"Logo\", \"Slogan\"};\n model = new DefaultTableModel(header, 0);\n List<Enterprise> list = new ArrayList<Enterprise>();\n list = enterpriseBN.getAllEnterprise();\n for (Enterprise bean : list) {\n Enterprise enterprise = enterpriseBN.getEnterpriseByID(bean.getEnterpriseParent()); // Lấy ra 1 Enterprise theo mã\n Person person1 = personBN.getPersonByID(bean.getDirector());\n Object[] rows = {bean.getEnterpriseName(), bean.getEnterpriseID(), enterprise, person1, bean.getPicture(), bean.getSlogan()};\n model.addRow(rows);\n }\n listEnterprisePanel.getTableListE().setModel(model);\n setupTable();\n }",
"private void loadAllToTable() {\n try {\n ArrayList<ItemDTO> allItems=ip.getAllItems();\n DefaultTableModel dtm=(DefaultTableModel) tblItems.getModel();\n dtm.setRowCount(0);\n \n if(allItems!=null){\n for(ItemDTO item:allItems){\n \n Object[] rowdata={\n item.getiId(),\n item.getDescription(),\n item.getQtyOnHand(),\n item.getUnitPrice()\n \n };\n dtm.addRow(rowdata);\n \n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AddItem.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n \n }",
"private void tableLoad() {\n try{\n String sql=\"SELECT * FROM salary\";\n pst = conn.prepareStatement(sql);\n rs = pst.executeQuery();\n \n table1.setModel(DbUtils.resultSetToTableModel(rs));\n \n \n }\n catch(SQLException e){\n \n }\n }",
"private void fillTable() {\n\n table.row();\n table.add();//.pad()\n table.row();\n for (int i = 1; i <= game.getNum_scores(); i++) {\n scoreRank = new Label(String.format(\"%01d: \", i), new Label.LabelStyle(fonts.getInstance().getClouds(), Color.WHITE));\n scoreValue = new Label(String.format(\"%06d\", game.getScores().get(i-1)), new Label.LabelStyle(fonts.getInstance().getRancho(), Color.WHITE));\n table.add(scoreRank).expandX().right();\n table.add(scoreValue).expandX().left();\n table.row();\n }\n\n }",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n people.addAll(sp.getAll());\n idP.setCellValueFactory(new PropertyValueFactory<>(\"path_photo\"));\n price1.setCellValueFactory(new PropertyValueFactory<>(\"price\"));\n\n tabble1.setItems(people);\n try {\n ResultSet rs = c.createStatement().executeQuery(\"select path_photo, price from shoppingcart\");\n while(rs.next()){\n data1.add(new ShoppingCart(rs.getString(\"path_photo\"), rs.getDouble(\"price\")));\n \n }\n \n\n// TODO\n } catch (SQLException ex) {\n Logger.getLogger(ShoppingCartController.class.getName()).log(Level.SEVERE, null, ex);\n }\n Item2.setCellValueFactory(new PropertyValueFactory<>(\"path_photo\"));\n Price2.setCellValueFactory(new PropertyValueFactory<>(\"price\"));\n table.setItems(data1);\n }",
"private void setTableModelData() {\r\n\t\t//Spin through the list and add the individual country fields.\r\n\t\tVector<String> fields;\r\n\t\tfor (Country c : countryList) {\r\n\t\t\tfields = new Vector<String>();\r\n\t\t\tfields.add(c.getName());\r\n\t\t\tfields.add(c.getCapital());\r\n\t\t\tfields.add(c.getFoundation().toString());\r\n\t\t\tfields.add(c.getContinent());\r\n\t\t\tfields.add(String.valueOf(c.getPopulation()));\r\n\t\t\tcountryData.add(fields);\r\n\t\t}\r\n\t}",
"private void initTable() {\n \t\t// init table\n \t\ttable.setCaption(TABLE_CAPTION);\n \t\ttable.setPageLength(10);\n \t\ttable.setSelectable(true);\n \t\ttable.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);\n \t\ttable.setColumnCollapsingAllowed(true);\n \t\ttable.setColumnReorderingAllowed(true);\n \t\ttable.setSelectable(true);\n \t\t// this class handles table actions (see handleActions method below)\n \t\ttable.addActionHandler(this);\n \t\ttable.setDescription(ACTION_DESCRIPTION);\n \n \t\t// populate Toolkit table component with test SQL table rows\n \t\ttry {\n \t\t\tQueryContainer qc = new QueryContainer(\"SELECT * FROM employee\",\n \t\t\t\t\tsampleDatabase.getConnection());\n \t\t\ttable.setContainerDataSource(qc);\n \t\t} catch (SQLException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\t// define which columns should be visible on Table component\n \t\ttable.setVisibleColumns(new Object[] { \"FIRSTNAME\", \"LASTNAME\",\n \t\t\t\t\"TITLE\", \"UNIT\" });\n \t\ttable.setItemCaptionPropertyId(\"ID\");\n \t}",
"protected abstract void initialiseTable();",
"private void loadData()\n\t{\n\t\tVector<String> columnNames = new Vector<String>();\n\t\tcolumnNames.add(\"Item Name\");\n\t\tcolumnNames.add(\"Item ID\");\n\t\tcolumnNames.add(\"Current Stock\");\n\t\tcolumnNames.add(\"Unit Price\");\n\t\tcolumnNames.add(\"Section\");\n\t\t\n\t\tVector<Vector<Object>> data= new Vector<Vector<Object>>();\n\t\t\n\t\tResultSet rs = null;\n\t\ttry \n\t\t{\n\t\t\tConnection con = Connector.DBcon();\n\t\t\tString query=\"select * from items natural join sections order by sections.s_name\";\n\t\t\tPreparedStatement pst = con.prepareStatement(query);\n\t\t\trs = pst.executeQuery();\n\t\t\t\n\t\t\twhile(rs.next())\n\t\t\t{\n\t\t\t\tVector<Object> vector = new Vector<Object>();\n\t\t for (int columnIndex = 1; columnIndex <= 9; columnIndex++)\n\t\t {\n\t\t \t\n\t\t \tvector.add(rs.getObject(1));\n\t\t \tvector.add(rs.getObject(2));\n\t\t vector.add(rs.getObject(3));\n\t\t vector.add(rs.getObject(4));\n\t\t vector.add(rs.getObject(6));\n\t\t \n\t\t }\n\t\t data.add(vector);\n\t\t\t}\n\t\t\t\n\t\t\t tableModel.setDataVector(data, columnNames);\n\t\t\t \n\t\t\t rs.close();\n\t\t\t pst.close();\n\t\t\t con.close();\n\t\t} \n\t\tcatch (Exception e) \n\t\t{\n\t\t\tJOptionPane.showMessageDialog(null, e);\n\t\t}\n\t\t\n\t\t\n\t}",
"private void repopulateTableForDelete()\n {\n clearTable();\n populateTable(null);\n }",
"private void refreshTable() {\n dataPanel.getModel().setRowCount(0);\n try {\n ResultSet resultSet = reg.get();\n while (resultSet.next()) {\n dataPanel.getModel().addRow(new Object[]{\n resultSet.getInt(\"id\"),\n resultSet.getString(\"first_name\"),\n resultSet.getString(\"last_name\"),\n resultSet.getString(\"username\"),\n resultSet.getString(\"password\"),\n resultSet.getInt(\"age\"),\n resultSet.getString(\"gender\"),\n });\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }",
"private void initilizeTable(DefaultTableModel model) throws SQLException {\r\n ArrayList<Products> allProducts;\r\n Connection c = null;\r\n PreparedStatement s = null;\r\n ResultSet rs;\r\n String query = \"SELECT * FROM products\";\r\n try {\r\n c = ConnectionFactory.getConnection();\r\n s = c.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);\r\n rs = s.executeQuery();\r\n allProducts = listForJTable(rs);\r\n rs.beforeFirst();\r\n model = getFieldsName(model, rs);\r\n for (Products p : allProducts)\r\n model.addRow(new String[]{String.valueOf(p.getIdproducts()), p.getProducts_name(), String.valueOf(p.getProducts_price()), String.valueOf(p.getProducts_inStock())});\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n } finally {\r\n ConnectionFactory.close(s);\r\n ConnectionFactory.close(c);\r\n }\r\n }",
"public void setBorrowBookDetailsToTable() {\n\n try {\n Connection con = databaseconnection.getConnection();\n Statement st = con.createStatement();\n ResultSet rs = st.executeQuery(\"select * from lending_book where status= '\" + \"pending\" + \"'\");\n\n while (rs.next()) {\n String id = rs.getString(\"id\");\n String bookName = rs.getString(\"book_name\");\n String studentName = rs.getString(\"student_name\");\n String lendingDate = rs.getString(\"borrow_date\");\n String returnDate = rs.getString(\"return_book_datte\");\n String status = rs.getString(\"status\");\n\n Object[] obj = {id, bookName, studentName, lendingDate, returnDate, status};\n\n model = (DefaultTableModel) tbl_borrowBookDetails.getModel();\n model.addRow(obj);\n\n }\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, \"Error\");\n }\n }",
"public void fill_table()\n {\n Secante secante = new Secante(GraficaSecanteController.a, GraficaSecanteController.b, GraficaSecanteController.ep, FuncionController.e);\n list = secante.algoritmo();\n }",
"public void populateTable() {\n DefaultTableModel dtm = (DefaultTableModel)tblSalesPersonCommision.getModel();\n dtm.setRowCount(0);\n // for(OrderList orderlist:salesperson.getOrderlistcatalog().getSalesPersonOrder()){\n // for(Order order:salesperson.getOrderListSalesPerson().getOrderList()){ \n // for(OrderList orderlist:salesperson.getOrderlistcatalog().getOrCatalog()){\n // for(SalesPerson salesperson :business.getEmployeedirectory().getSalesPersonList()){\n \n for(OrderList orderlist:salesperson.getOrderlistcatalog().getOrCatalog()){\n Object [] row = new Object[4];\n // row[0]=.getCustomer().getCustomerId();\n // row[1]= market.getCustomer().getCustomerName();\n row[0]=orderlist;\n row[1]=orderlist.getOrdertotalprice();\n row[2]=orderlist.getSalespersoncomission();\n row[3]=orderlist.getTotalorderlistquantity();\n //3 tcomission = tcomission + orderlist.getSalespersoncomission();\n //3 totalquantity = totalquantity + orderlist.getTotalorderlistquantity();\n //3 totalorderprice = totalorderprice + orderlist.getOrdertotalprice();\n \n // row[0]=order;\n // row[1]=order.getAmountprice();\n \n dtm.addRow(row);\n // }\n // }\n } \n //2 salesperson.getOrderlistcatalog().setTotalquantitypersalesperson(totalquantity);\n //2 salesperson.getOrderlistcatalog().setTotalcommision(tcomission);\n //2 salesperson.getOrderlistcatalog().setTotalorderlistcsatalogprice(totalorderprice);\n}",
"public void preencherTabela(){\n imagemEnunciado.setImage(imageDefault);\n pergunta.setImagemEnunciado(caminho);\n imagemResposta.setImage(imageDefault);\n pergunta.setImagemResposta(caminho);\n ///////////////////////////////\n perguntas = dao.read();\n if(perguntas != null){\n perguntasFormatadas = FXCollections.observableList(perguntas);\n\n tablePerguntas.setItems(perguntasFormatadas);\n }\n \n }",
"public void fillAnimalDetailTable() {\n\t\tfinal AnimalDetailTable table = new AnimalDetailTable();\n\t\ttable.setColumnsWidth();\n\n\t\tnew AsyncTask() {\n\t\t\tList<AnimalModel> models = new ArrayList<>();\n\n\t\t\t@Override\n\t\t\tprotected Boolean doInBackground() throws Exception {\n\t\t\t\ttry {\n\t\t\t\t\tmodels = dataManager.getAnimalHistory(selectedAnimalModel.getId());\n\t\t\t\t\treturn true;\n\t\t\t\t} catch (DataManagerException e) {\n\t\t\t\t\tLogger.createLog(Logger.ERROR_LOG, e.getMessage());\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tprotected void onDone(boolean success) {\n\t\t\t\tif (models != null && models.size() > 0) {\n\t\t\t\t\tfor (AnimalModel model : models) {\n\t\t\t\t\t\ttable.addAnimalModel(model);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tanimalDetailPanel.setAnimalDetailTable(table);\n\t\t\t}\n\t\t}.start();\n\t}",
"private void preencherTabela() {\n\t\tList<Cidade> listCidade;\n\t\tCidadeDAO cidadeDAO;\n\t\tObservableList<Cidade> oListCidade;\n\n\t\t// Determina os atributos que irão preencher as colunas\n\t\tcolCidade.setCellValueFactory(new PropertyValueFactory<>(\"nomeCidades\"));\n\t\tcolEstado.setCellValueFactory(new PropertyValueFactory<>(\"nomeEstado\"));\n\t\tcolSigla.setCellValueFactory(new PropertyValueFactory<>(\"siglaEstado\"));\n\t\tcolCodigoCidade.setCellValueFactory(new PropertyValueFactory<>(\"idCidade\"));\n\t\tcolIdEstado.setCellValueFactory(new PropertyValueFactory<>(\"idEstado\"));\n\n\t\t// Instancia a lista de cidades e a DAO\n\t\tlistCidade = new ArrayList<Cidade>();\n\t\tcidadeDAO = new CidadeDAO();\n\n\t\t// Chama o metodo para selecionar todas as cidades e atribuir a lista\n\t\tlistCidade = cidadeDAO.selecionar();\n\n\t\t// Converte a lista de cidades em observablearray\n\t\toListCidade = FXCollections.observableArrayList(listCidade);\n\n\t\t// Adiciona a lista na tabela\n\t\ttblCidades.setItems(oListCidade);\n\t}",
"private void TampilData() {\n DefaultTableModel model = new DefaultTableModel();\n model.addColumn(\"NO\");\n model.addColumn(\"ID\");\n model.addColumn(\"NAME\");\n model.addColumn(\"USERNAME\");\n tabelakses.setModel(model);\n\n //menampilkan data database kedalam tabel\n try {\n int i=1;\n java.sql.Connection conn = new DBConnection().connect();\n java.sql.Statement stat = conn.createStatement();\n ResultSet data = stat.executeQuery(\"SELECT * FROM p_login order by Id asc\");\n while (data.next()) {\n model.addRow(new Object[]{\n (\"\" + i++),\n data.getString(\"Id\"),\n data.getString(\"Name\"),\n data.getString(\"Username\")\n });\n tabelakses.setModel(model);\n }\n } catch (Exception e) {\n System.err.println(\"ERROR:\" + e);\n }\n }",
"private void insertProjectTable() {\n name.setCellValueFactory(new PropertyValueFactory<>(\"nameId\"));\n dateStart.setCellValueFactory(new PropertyValueFactory<>(\"dateStart\"));\n dateFinish.setCellValueFactory(new PropertyValueFactory<>(\"dateFinish\"));\n place.setCellValueFactory(new PropertyValueFactory<>(\"place\"));\n car.setCellValueFactory(new PropertyValueFactory<>(\"cars\"));\n instructors.setCellValueFactory(new PropertyValueFactory<>(\"instructors\"));\n description.setCellValueFactory(new PropertyValueFactory<>(\"description\"));\n author.setCellValueFactory(new PropertyValueFactory<>(\"author\"));\n }",
"private void loadAllToTable() {\n \n try {\n ArrayList<CustomerDTO> allCustomers=cusCon.getAllCustomers();\n DefaultTableModel dtm=(DefaultTableModel) tblCustomers.getModel();\n dtm.setRowCount(0);\n \n if(allCustomers!=null){\n for(CustomerDTO customer:allCustomers){\n \n Object[] rowdata={\n customer.getcId(),\n customer.getcName(),\n customer.getContact(),\n customer.getCreditLimit(),\n customer.getCreditDays()\n };\n dtm.addRow(rowdata);\n \n }\n }\n } catch (Exception ex) {\n Logger.getLogger(AddCustomer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void populateTable(ArrayList<Student> slist){\n DefaultTableModel model = (DefaultTableModel) jTable1.getModel();\n model.setRowCount(0);\n for(int i =0; i<slist.size();i++){\n Object rowData[] = new Object[2];\n rowData[0] = slist.get(i).userName;\n //rowData[1] = slist.get(i).email;\n if(slist.get(i).paused == false){\n rowData[1] = \"Unpaused\";\n \n } else{\n rowData[1] = \"Paused\";\n }\n model.addRow(rowData);\n \n }\n if(slist.isEmpty()){\n jLabel1.setVisible(true);\n } else{\n jLabel1.setVisible(false);\n }\n }",
"private void fillData() {\n jTextField1.setEnabled(false);\n jTextField11.setEnabled(false);\n\n if (owners != null && owners.get(\"editedOwner\") != null) {\n this.jTextField1.setText(owners.get(\"editedOwner\").getAsJsonObject().get(\"rc\").getAsString());\n this.jTextField11.setText(owners.get(\"editedOwner\").getAsJsonObject().get(\"share\").getAsString());\n }\n String[] header = new String[]{\"Rodné čislo\", \"Podiel v %\"};\n dtm.setColumnIdentifiers(header);\n jTableOwnerships.setModel(dtm);\n if (owners != null && owners.get(\"ownerships\") != null) {\n for (JsonElement jsonElement : owners.get(\"ownerships\").getAsJsonArray()) {\n JsonObject owner = (JsonObject) jsonElement;\n dtm.addRow(new Object[]{owner.get(\"rc\").getAsString(), owner.get(\"share\").getAsString()});\n }\n }\n }",
"public void loadingTable() {\n this.setRowCount(1, true);\r\n this.setVisibleRangeAndClearData(this.getVisibleRange(), true);\r\n }",
"private void intiPlanTable(){\n //gets all plans that are linked with the current profile\n List<Plan> planList = profile.getPlans().getPlans();\n //now add all plans to the table\n DefaultTableModel model = (DefaultTableModel) this.jTable1.getModel();\n model.setRowCount(0);\n planList.forEach((p) -> {\n model.addRow(new Object[]{p.getPlanName(),p});\n });\n }",
"private void setTable() {\n try {\n DefaultTableModel dtm = (DefaultTableModel) table.getModel();\n dtm.setRowCount(0);\n ArrayList<Item> itemList = ItemController.getAllItem();\n if (itemList != null) {\n for (Item item : itemList) {\n String qoh = BatchController.getQOH(item.getCode());\n if (qoh != null) {\n if (item.getRol() >= Integer.valueOf(qoh)) {\n Object row[] = {item.getCode(), item.getDesciption(), item.getRol(), qoh};\n dtm.addRow(row);\n }\n }\n\n }\n }\n if (dtm.getRowCount() == 0) {\n JOptionPane.showMessageDialog(this, \"Stock level is above ROL\");\n }\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(ROL.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private void UpdateTable() {\n\t\t\t\t\n\t\t\t}",
"public void loadBrandDataToTable() {\n\n\t\tbrandTableView.clear();\n\t\ttry {\n\n\t\t\tString sql = \"SELECT * FROM branddetails WHERE active_indicator = 1\";\n\t\t\tstatement = connection.createStatement();\n\t\t\tresultSet = statement.executeQuery(sql);\n\t\t\twhile (resultSet.next()) {\n\n\t\t\t\tbrandTableView.add(new BrandsModel(resultSet.getInt(\"brnd_slno\"), resultSet.getInt(\"active_indicator\"),\n\t\t\t\t\t\tresultSet.getString(\"brand_name\"), resultSet.getString(\"sup_name\"),\n\t\t\t\t\t\tresultSet.getString(\"created_at\"), resultSet.getString(\"updated_at\")));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tbrandName.setCellValueFactory(new PropertyValueFactory<>(\"brand_name\"));\n\t\tsupplierName.setCellValueFactory(new PropertyValueFactory<>(\"sup_name\"));\n\t\tdetailsOfBrands.setItems(brandTableView);\n\t}",
"private void initDatas(){\r\n \t\r\n \tjTable1.setModel(ViewUtil.transferBeanList2DefaultTableModel(discountService.getAllDiscountInfo(),\"Discount\"));\r\n }",
"private MyTable generateTable()\n\t{\n\t\t//this creates the column headers for the table\n\t\tString[] titles = new String[] {\"Name\"};\n\t\t//fields will store all of the entries in the database for the GUI\n\t\tArrayList<String[]> fields = new ArrayList<String[]>();\n\t\tfor (food foodStuff: items) //for each element in items do the following\n\t\t{\n\t\t\t//creates a single row of the table\n\t\t\tString[] currentRow = new String[1]; //creates an array for this row\n\t\t\tcurrentRow[1] = foodStuff.getName(); //sets this row's name\n\t\t\tfields.add(currentRow); //adds this row to the fields ArrayList\n\t\t}\n\t\t//builds a table with titles and a downgraded fields array\n\t\tMyTable builtTable = new MyTable(fields.toArray(new String[0][1]), titles);\n\t\treturn builtTable; // return\n\t}",
"private static void assembleRosterTable(){\n for (int i = 0; i < 10; i++) {\n rosterTable.insertRow(i);\n }\n }",
"@Override\r\n\tpublic void initializeTableContents() {\n\t\t\r\n\t}",
"public void updateTable() {\n tabelModel.setRowCount(0);\n Link current = result.first;\n for (int i = 0; current != null; i++) {\n Object[] row = {current.getMasjid(), current.getAlamat()};\n tabelModel.addRow(row);\n current = current.next;\n }\n }",
"private void populateFriendsTables(){\r\n TableLayout tl = (TableLayout) findViewById(R.id.friendTable);\r\n tl.removeAllViews();\r\n TableRow row, titleRow;\r\n TextView view, titleViewEmail, tileViewButton;\r\n\r\n List<String> friends = (List<String>) mFriendData.get(\"friends\");\r\n\r\n titleRow = new TableRow(getApplicationContext());\r\n titleViewEmail = new TextView(getApplicationContext());\r\n titleViewEmail.setText(\"Friend Email\");\r\n titleViewEmail.setPadding(20, 20, 20, 20);\r\n\r\n tileViewButton = new TextView(getApplicationContext());\r\n tileViewButton.setText(\"Remove\");\r\n tileViewButton.setPadding(20, 20, 20, 20);\r\n\r\n titleRow.addView(titleViewEmail);\r\n titleRow.addView(tileViewButton);\r\n\r\n tl.addView(titleRow);\r\n for (String email : friends) {\r\n row = new TableRow(getApplicationContext());\r\n view = new TextView(getApplicationContext());\r\n view.setText(email);\r\n view.setPadding(20, 20, 20, 20);\r\n\r\n TextView button = new Button(getApplicationContext());\r\n button.setText(\"Remove Friend\");\r\n button.setPadding(20, 20, 20, 20);\r\n\r\n row.addView(view);\r\n row.addView(button);\r\n tl.addView(row);\r\n }\r\n }",
"@Override\n\tpublic void configTable() {\n\t\tString[][] colNames = { { \"Name\", \"name\" }, { \"Ward No\", \"wardNo\" }, { \"Max. patients\", \"maxPatients\" }, { \"No of Patients\", \"patientCount\" },\n\t\t\t\t{ \"No of Employees\", \"employeeCount\" }};\n\n\t\tfor (String[] colName : colNames) {\n\t\t\tTableColumn<Ward, String> col = new TableColumn<>(colName[0]);\n\t\t\tcol.setCellValueFactory(new PropertyValueFactory<>(colName[1]));\n\t\t\ttable.getColumns().add(col);\n\t\t}\n\n\t\ttable.setItems(tableData);\n\t\t\n\t}",
"private void refTable() {\n try {\n String s = \"select * from stock\";\n pstm = con.prepareStatement(s);\n res = pstm.executeQuery(s);\n table.setModel(DbUtils.resultSetToTableModel(res));\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"There Is No Data In Server\");\n }\n }",
"private void populateData() {\n\t\tList<TrafficRecord> l = TestHelper.getSampleData();\r\n\t\tfor(TrafficRecord tr: l){\r\n\t\t\tput(tr);\r\n\t\t}\r\n\t\t \r\n\t}",
"void prepareTables();",
"public void fetRowList() {\n try {\n data.clear();\n if (rsAllEntries != null) {\n ObservableList row = null;\n //Iterate Row\n while (rsAllEntries.next()) {\n row = FXCollections.observableArrayList();\n //Iterate Column\n for (int i = 1; i <= rsAllEntries.getMetaData().getColumnCount(); i++) {\n row.add(rsAllEntries.getString(i));\n }\n data.add(row);\n }\n //connects table with list\n table.setItems(data);\n // cell instances are generated for Order Status column and then colored\n customiseStatusCells();\n\n } else {\n warning.setText(\"No rows to display\");\n }\n } catch (SQLException ex) {\n System.out.println(\"Failure getting row data from SQL \");\n }\n }",
"private void refreshTable() {\n data = getTableData();\n updateTable();\n }",
"public static void buildTable() {\r\n\t\t//This method keeps the user from editing the table\r\n\t\ttableModel = new DefaultTableModel() {\r\n\t\t\tprivate static final long serialVersionUID = 1L;\r\n\t\t\t@Override\r\n\t\t\tpublic boolean isCellEditable(int row, int column) {\r\n\t\t\t\t//All cells false\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\ttableModel.setNumRows(dblogic.getSize());\r\n\t\ttableModel.setColumnCount(COL_COUNT);\r\n\t\ttableModel.setColumnIdentifiers(columnNames);\r\n\t\ttable.setRowSelectionAllowed(true);\r\n\t\ttable.setColumnSelectionAllowed(false);\r\n\t\ttable.setDragEnabled(false);\r\n\t\ttable.getTableHeader().setReorderingAllowed(false);\r\n\t\ttable.setModel(tableModel);\r\n\r\n\t\t//Build rows\r\n\t\tfor (int i = 0; i < dblogic.getSize(); i++) {\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getLastName(), i, COL_LAST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getFirstName(), i, COL_FIRST);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronEmail(), i, COL_EMAIL);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getDOB(), i, COL_BIRTH);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getPatronSinceString(), i, COL_ADDED);\r\n\t\t\ttable.setValueAt(dblogic.getPatronFromDB(i).getAnniv().toString(), i, COL_ANNIV);\r\n\t\t}\r\n\t}",
"public void tableViewSetup() {\n nameColumn.setCellValueFactory(new PropertyValueFactory<>(\"Name\"));\n productTable.getColumns().add(nameColumn);\n\n manuColumn.setCellValueFactory(new PropertyValueFactory<>(\"Manufacturer\"));\n productTable.getColumns().add(manuColumn);\n\n typeColumn.setCellValueFactory(new PropertyValueFactory<>(\"Type\"));\n productTable.getColumns().add(typeColumn);\n }",
"public void showData()\n\t\t{\n\t\t\ttry {\n\t\t\t\tcon=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/MundheElectronics1\",\"root\",\"vishakha\");\n\t\t\t\tString sql=\"select *from ComplaintsData\";\n\t\t\t\tps=con.prepareStatement(sql);\n\t\t\t\trs=ps.executeQuery();\n\t\t\t\ttable.setModel(DbUtils.resultSetToTableModel(rs));\n\t\t\t\t\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"public void prepareTable() {\n \tthis.table = new Tape(this.height,this.width,2,this.map);\n }",
"private void updateTable(){\n try{\n String query = \" select id,name as Name,address as Address,description as Description, capacity as Capacity from public_spaces where category = 'accomodation' \";\n PreparedStatement pst = connect.prepareStatement(query);\n ResultSet rs = pst.executeQuery();\n users_table.setModel(DbUtils.resultSetToTableModel(rs));\n }\n catch(Exception e){\n System.out.println(e);\n }\n }",
"private void fillUpAnimalsTable() {\n\t\tfillUpAnimalsTable(Calendar.getInstance().getTime());\n\t}",
"private void addData(){\n\n for (Recipe obj : frecipes)\n {\n /** Create a TableRow dynamically **/\n tr = new TableRow(this);\n tr.setLayoutParams(new TableRow.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n\n /** Creating a TextView to add to the row **/\n name = new TextView(this);\n name.setText(obj.getName());\n name.setWidth(320);\n name.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);\n name.setPadding(5, 5, 5, 5);\n tr.addView(name); // Adding textView to tablerow.\n\n // Add the TableRow to the TableLayout\n tl.addView(tr, new TableLayout.LayoutParams(\n TableRow.LayoutParams.MATCH_PARENT,\n TableRow.LayoutParams.WRAP_CONTENT));\n }\n }",
"private void populateTreatementHistory() {\n DefaultTableModel model = (DefaultTableModel) historyTable.getModel();\n model.setRowCount(0);\n if (wr.getPatient().getPerson().getTreatmentHistory() != null) {\n for (WorkRequest r : wr.getPatient().getPerson().getTreatmentHistory()) {\n Object[] row = new Object[4];\n row[0] = r.getReceiver();\n row[1] = r.getResolveDate();\n row[2] = r.getMessage();\n row[3] = r.getStatus();\n\n model.addRow(row);\n }\n }\n\n }",
"private void makeTable() {\n String [] cols = new String[] {\"Planets\", \"Weights (in lbs)\", \"Weights (in kgs)\"};\n model = new DefaultTableModel(result,cols) {\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n };\n table = new JTable(model);\n JScrollPane scrollPane = new JScrollPane(table);\n scrollPane.setPreferredSize(new Dimension(310,155));\n middlePanel.add(scrollPane);\n revalidate();\n repaint();\n }",
"private void load_table() {\n DefaultTableModel model = new DefaultTableModel();\n model.addColumn(\"ID\");\n model.addColumn(\"NIM\");\n model.addColumn(\"Nama\");\n model.addColumn(\"Kelamin\");\n model.addColumn(\"Phone\");\n model.addColumn(\"Agama\");\n model.addColumn(\"Status\");\n\n //menampilkan data database kedalam tabel\n try {\n String sql = \"SELECT * FROM mhs\";\n java.sql.Connection koneksi = (Connection) Koneksi.KoneksiDB();\n java.sql.Statement stm = koneksi.createStatement();\n java.sql.ResultSet res = stm.executeQuery(sql);\n\n while (res.next()) {\n model.addRow(new Object[]{res.getString(1), res.getString(2),\n res.getString(3), res.getString(4), res.getString(5),\n res.getString(6), res.getString(7)});\n }\n tabelMahasiswa.setModel(model);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n\n }",
"private void fillTable(TableLayout table, LayoutParams genericRowParams) {\n\t\ttry {\n\t\t\tArrayList<Lecture> lectures = XMLManager.getLectures(this);\n\t\t\tLog.v(CLASS_NAME, \"Lectures gotten. Count: \" + lectures.size());\n\t\t\tint semester = PreferencesManager.getSemester(this);\n\n\t\t\t// The table contains a semester row, followed by a series of rows\n\t\t\t// built by parsing the lectures\n\t\t\ttable.addView(buildSemestRow(genericRowParams, semester));\n\t\t\tparseLectures(table, lectures, semester, genericRowParams);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (XmlPullParserException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void doUpdateTable() {\r\n\t\tlogger.info(\"Actualizando tabla books\");\r\n\t\tlazyModel = new LazyBookDataModel();\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n \n \n private void table(){\n \n int c;\n \n try{\n \n Connection con1 = ConnectionProvider.getConn();\n Statement stm = con1.createStatement();\n ResultSet rst = stm.executeQuery(\"select * from sales\");\n ResultSetMetaData rstm = rst.getMetaData();\n \n c = rstm.getColumnCount();\n \n DefaultTableModel dtm2 = (DefaultTableModel)jTable1.getModel();\n dtm2.setRowCount(0);\n \n while (rst.next()){\n \n Vector vec = new Vector();\n \n for(int a =1 ; a<=c; a++)\n {\n vec.add(rst.getString(\"CustomerName\"));\n vec.add(rst.getString(\"OrderNo\"));\n vec.add(rst.getString(\"TypeOfService\"));\n vec.add(rst.getString(\"OrderType\"));\n vec.add(rst.getString(\"Descript\"));\n vec.add(rst.getString(\"OrderConfirmation\"));\n vec.add(rst.getString(\"OrderHandledBy\"));\n vec.add(rst.getString(\"OrderDate\"));\n vec.add(rst.getString(\"WarrantyExpireDate\"));\n vec.add(rst.getString(\"FullAmount\"));\n vec.add(rst.getString(\"AmountPaid\"));\n vec.add(rst.getString(\"Balance\"));\n }\n \n dtm2.addRow(vec);\n }\n \n }\n catch(Exception e)\n {\n \n }\n \n \n }",
"public void showData(ActionEvent actionEvent) {\n\n firstNameCol.setCellValueFactory(new PropertyValueFactory<>(\"firstName\"));\n lastNameCol.setCellValueFactory(new PropertyValueFactory<>(\"lastName\"));\n ageCol.setCellValueFactory(new PropertyValueFactory<>(\"age\"));\n\n peopleTable.setItems(returnPeople());\n }",
"public void loadAllManufacturesTable(){\n \n \n try {\n String query = \"SELECT manufacture.maID as 'Manufacture ID', name as 'Manufacture Name', address as 'Manufacture Address', email as 'Manufacture Email', manufacture_phone.phone as 'Phone' FROM manufacture left outer join manufacture_phone ON manufacture.maID=manufacture_phone.maID ORDER BY manufacture.maID\";\n ps = connection.prepareStatement(query);\n rs = ps.executeQuery();\n \n allManufactureTable.setModel(DbUtils.resultSetToTableModel(rs));\n \n //change row height\n allManufactureTable.setRowHeight(30);\n \n //change column width of column two\n /* TableColumnModel columnModel = allManufactureTable.getColumnModel();\n columnModel.getColumn(0).setPreferredWidth(10);\n columnModel.getColumn(1).setPreferredWidth(70);\n columnModel.getColumn(2).setPreferredWidth(5);\n columnModel.getColumn(3).setPreferredWidth(70); */\n \n } catch (SQLException ex) {\n Logger.getLogger(viewAllBrands.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void fillPatientsTable()\r\n\t{\r\n\t\tdata = FXCollections.observableArrayList();\r\n\r\n\t\tResultSet patients = databaseHandler.execQuery(\"select adrID, patID, ID, name, gender, phoneNum, dateOfBirth from patients\");\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tTableColumn<ObservableList, String> pID = new TableColumn<>(\"pID\");\r\n\t\t\tpID.setMinWidth(30);\r\n\t\t\tpID.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(0).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> ID = new TableColumn<>(\"ID\");\r\n\t\t\tID.setMinWidth(90);\r\n\t\t\tID.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(1).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> name = new TableColumn<>(\"Name\");\r\n\t\t\tname.setMinWidth(120);\r\n\t\t\tname.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(2).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> gender = new TableColumn<>(\"Gender\");\r\n\t\t\tgender.setMinWidth(55);\r\n\t\t\tgender.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(3).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> sim = new TableColumn<>(\"Phone Number\");\r\n\t\t\tsim.setMinWidth(120);\r\n\t\t\tsim.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(4).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> dob = new TableColumn<>(\"Date of birth\");\r\n\t\t\tdob.setMinWidth(60);\r\n\t\t\tdob.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(5).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> city = new TableColumn<>(\"City\");\r\n\t\t\tcity.setMinWidth(110);\r\n\t\t\tcity.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(6).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> street = new TableColumn<>(\"Street\");\r\n\t\t\tstreet.setMinWidth(110);\r\n\t\t\tstreet.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(7).toString()));\r\n\r\n\t\t\tTableColumn<ObservableList, String> building = new TableColumn<>(\"Building\");\r\n\t\t\tbuilding.setMinWidth(102);\r\n\t\t\tbuilding.setCellValueFactory(param -> new SimpleStringProperty(param.getValue().get(7).toString()));\r\n\r\n\t\t\tpatientsTable.getColumns().addAll(ID, pID, name, gender, sim, dob, city, street, building);\r\n\r\n\t\t\twhile(patients.next())\r\n\t\t\t{\r\n\t\t\t\tObservableList<String> row = FXCollections.observableArrayList();\r\n\r\n\t\t\t\tfor(int i = 2; i <= patients.getMetaData().getColumnCount(); i++)\r\n\t\t\t\t\trow.add(patients.getString(i));\r\n\r\n\t\t\t\tResultSet address = databaseHandler.execQuery(\"select cID, street, building from addresses where adrID = \" + patients.getString(1));\r\n\t\t\t\taddress.first();\r\n\r\n\t\t\t\tResultSet cityName = databaseHandler.execQuery(\"select name from cities where cID = \" + address.getString(1));\r\n\t\t\t\tcityName.first();\r\n\r\n\t\t\t\trow.add(cityName.getString(1));\r\n\r\n\t\t\t\tfor(int i = 2; i <= address.getMetaData().getColumnCount(); i++)\r\n\t\t\t\t{\r\n\t\t\t\t\trow.add(address.getString(i));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdata.add(row);\r\n\t\t\t}\r\n\r\n\t\t\tpatientsTable.setItems(data);\r\n\t\t}\r\n\t\tcatch (SQLException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"private void loadTBL(String q1) {\n try {\n\n ResultSet rs = DB.search(q1);\n\n DefaultTableModel dtm = (DefaultTableModel) jTable1.getModel();\n dtm.setRowCount(0);\n while (rs.next()) {\n\n Vector v = new Vector();\n v.add(rs.getString(\"id_before_p\"));\n v.add(rs.getString(\"date\"));\n\n ResultSet rs3 = DB.search(\"select name from supplier where id_sup='\" + rs.getString(\"supplier_id_sup\") + \"'\");\n if (rs3.next()) {\n v.add(rs3.getString(\"name\"));\n }\n String qty = rs.getString(\"qty\");\n String fat = rs.getString(\"fat\");\n String ts = rs.getString(\"ts\");\n String ph = rs.getString(\"ph\");\n String acidity = rs.getString(\"acidity\");\n\n if (qty.equals(\"0\")) {\n v.add(\"\");\n } else {\n v.add(qty);\n\n }\n if (fat.equals(\"0\")) {\n v.add(\"\");\n } else {\n v.add(fat);\n }\n if (ts.equals(\"0\")) {\n v.add(\"\");\n } else {\n v.add(ts);\n }\n if (ph.equals(\"0\")) {\n v.add(\"\");\n } else {\n v.add(ph);\n }\n if (acidity.equals(\"0\")) {\n v.add(\"\");\n } else {\n v.add(acidity);\n }\n\n String ts_2 = rs.getString(\"ts_2\");\n String ph_2 = rs.getString(\"ph_2\");\n String acidity_2 = rs.getString(\"acidity_2\");\n\n if (ts_2.equals(\"0\")) {\n v.add(\"\");\n\n } else {\n v.add(ts_2);\n\n }\n if (ph_2.equals(\"0\")) {\n v.add(\"\");\n\n } else {\n v.add(ph_2);\n\n }\n if (acidity_2.equals(\"0\")) {\n v.add(\"\");\n\n } else {\n\n v.add(acidity_2);\n\n }\n\n v.add(rs.getString(\"buyer_1\"));\n String qty_1_2 = rs.getString(\"qty_1\");\n String qty_2_2 = rs.getString(\"qty_2\");\n String sample = rs.getString(\"sample\");\n if (qty_1_2.equals(\"0\")) {\n v.add(\"\");\n } else {\n v.add(qty_1_2);\n\n }\n v.add(rs.getString(\"buyer_2\"));\n if (qty_2_2.equals(\"0\")) {\n\n v.add(\"\");\n } else {\n\n v.add(qty_2_2);\n }\n if (sample.equals(\"0\")) {\n\n v.add(\"\");\n } else {\n v.add(sample);\n\n }\n\n dtm.addRow(v);\n\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n protected void loadAndFormatData()\n {\n // Place the data into the table model along with the column\n // names, set up the editors and renderers for the table cells,\n // set up the table grid lines, and calculate the minimum width\n // required to display the table information\n setUpdatableCharacteristics(getScriptAssociationData(allowSelectDisabled, parent),\n AssociationsTableColumnInfo.getColumnNames(),\n null,\n new Integer[] {AssociationsTableColumnInfo.AVAILABLE.ordinal()},\n null,\n AssociationsTableColumnInfo.getToolTips(),\n true,\n true,\n true,\n true);\n }",
"public void setData()\n {\n lbl_f_Name.setText(\"Name: \" + obj_Faculty.getName());\n lbl_f_ID.setText(\"ID: \" + obj_Faculty.getId());\n\n //CODE for fetching data from DB from tbl_Up_Events and show on table\n //Things for DB\n //Connection_to_DB it connects to Access DB\n Connect_to_DB obj_conDB = new Connect_to_DB();\n Connection obj_con = obj_conDB.make_Connection();\n\n //Statement is used for updating, inserting and deleting\n Statement stmt = null;\n ResultSet res = null;\n\n try\n {\n stmt = obj_con.createStatement();\n\n String str_Data = \"select * from tbl_Up_Events\";\n\n res = stmt.executeQuery(str_Data);\n\n while (res.next())\n {\n String Name = res.getString(\"evntName\");\n String Day = res.getString(\"evntDay\");\n String Date = res.getString(\"evntDate\");\n String Venue = res.getString(\"evntVenue\");\n String Budget = res.getString(\"evntBudget\");\n String Descript = res.getString(\"evntDescript\");\n String Club = res.getString(\"evntClub\");\n String Ticket = res.getString(\"evntTicket\");\n\n String table[] =\n {\n Name, Day, Date, Venue, Budget, Descript, Club, Ticket\n };\n\n DefaultTableModel tblModel = (DefaultTableModel) tbl_Event.getModel();\n tblModel.addRow(table);\n }\n\n obj_con.close();\n\n }\n catch (Exception ex)\n {\n JOptionPane.showMessageDialog(null, ex);\n }\n //CODE for tables ENDS\n }",
"private void setupTable() {\n\t\tString[] columns = { \"Course Name\", \"Course Number\" };\n\n\t\ttableModel = new DefaultTableModel(null, columns) {\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t@Override\n\t\t\tpublic boolean isCellEditable(int row, int column) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\n\t\ttable = new JTable(tableModel);\n\t\ttable.setColumnSelectionAllowed(false);\n\t\ttable.setRowSelectionAllowed(true);\n\t\ttable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\n\t\ttable.getSelectionModel().addListSelectionListener((ListSelectionEvent event) -> {\n\t\t\tif (table.getSelectedRow() >= 0) {\n\t\t\t\tString name = table.getValueAt(table.getSelectedRow(), 0).toString();\n\t\t\t\tint num = Integer.parseInt(table.getValueAt(table.getSelectedRow(), 1).toString());\n\t\t\t\tupdateTextArea((Course) adCon.search(name, num));\n\t\t\t}\n\t\t});\n\n\t\tJScrollPane scrollPane = new JScrollPane(table);\n\t\tscrollPane.setPreferredSize(new Dimension(350, 175));\n\t\tdisplay.add(scrollPane);\n\t}",
"public void reloadTable() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (list.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Balanza object = list.get(i);\n this.AddtoTable(object);\n }\n\n }",
"private RowData() {\n initFields();\n }",
"private void initializeTable()\n {\n mTable = new ListView(mData);\n mTable.setPrefSize(200, 250);\n mTable.setEditable(false);\n }",
"public void initTable_Pesanan(){\n //Set cell TableView\n id_pesan.setCellValueFactory(new PropertyValueFactory<Order, String>(\"Id\"));\n jumlah_pesan.setCellValueFactory(new PropertyValueFactory<Order, String>(\"Jumlah\"));\n harga_pesan.setCellValueFactory(new PropertyValueFactory<Order, Integer>(\"Harga\"));\n catatan_pesan.setCellValueFactory(new PropertyValueFactory<Order, String>(\"Catatan\"));\n hapus_pesan.setCellValueFactory(new PropertyValueFactory<Order, Button>(\"Hapus\"));\n\n //Editable\n catatan_pesan.setCellFactory(TextFieldTableCell.forTableColumn());\n catatan_pesan.setOnEditCommit(event ->\n {\n event.getTableView().getItems().get(event.getTablePosition().getRow()).setCatatan(event.getNewValue());\n });\n tablePesanan.setEditable(true);\n //Set TableView\n tablePesanan.setItems(list_order);\n }",
"private void createTableBill(){\r\n //Se crean y definen las columnas de la Tabla\r\n TableColumn col_orden = new TableColumn(\"#\"); \r\n TableColumn col_city = new TableColumn(\"Ciudad\");\r\n TableColumn col_codigo = new TableColumn(\"Código\"); \r\n TableColumn col_cliente = new TableColumn(\"Cliente\"); \r\n TableColumn col_fac_nc = new TableColumn(\"FAC./NC.\"); \r\n TableColumn col_fecha = new TableColumn(\"Fecha\");\r\n TableColumn col_monto = new TableColumn(\"Monto\"); \r\n TableColumn col_anulada = new TableColumn(\"A\");\r\n \r\n //Se establece el ancho de cada columna\r\n this.objectWidth(col_orden , 25, 25); \r\n this.objectWidth(col_city , 90, 150); \r\n this.objectWidth(col_codigo , 86, 86); \r\n this.objectWidth(col_cliente , 165, 300); \r\n this.objectWidth(col_fac_nc , 70, 78); \r\n this.objectWidth(col_fecha , 68, 68); \r\n this.objectWidth(col_monto , 73, 73); \r\n this.objectWidth(col_anulada , 18, 18);\r\n\r\n col_fac_nc.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguip_det, String>() {\r\n @Override\r\n public void updateItem(String item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n ret = getItem().toString();\r\n if (ret.equals(\"0\"))\r\n ret = \"\";\r\n } else {\r\n ret = \"\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n col_fecha.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguip_det, Date>() {\r\n @Override\r\n public void updateItem(Date item, boolean empty) {\r\n super.updateItem(item, empty);\r\n if(!empty){\r\n setText(item.toLocalDate().toString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n else\r\n setText(null);\r\n }\r\n };\r\n }\r\n }); \r\n\r\n col_monto.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguid, Double>() {\r\n @Override\r\n public void updateItem(Double item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER_RIGHT);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n String gi = getItem().toString();\r\n NumberFormat df = DecimalFormat.getInstance();\r\n df.setMinimumFractionDigits(2);\r\n df.setRoundingMode(RoundingMode.DOWN);\r\n\r\n ret = df.format(Double.parseDouble(gi));\r\n } else {\r\n ret = \"0,00\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n col_anulada.setCellFactory(new Callback<TableColumn, TableCell>() {\r\n @Override\r\n public TableCell call(TableColumn param) {\r\n return new TableCell<Fxp_Archguid, Integer>() {\r\n @Override\r\n public void updateItem(Integer item, boolean empty) {\r\n super.updateItem(item, empty);\r\n setText(empty ? null : getString());\r\n setAlignment(Pos.CENTER);\r\n }\r\n\r\n private String getString() {\r\n String ret = \"\";\r\n if (getItem() != null) {\r\n ret = getItem().toString();\r\n if (ret.equals(\"0\"))\r\n ret = \"\";\r\n\r\n setTextFill(isSelected() ? Color.WHITE :\r\n ret.equals(\"0\") ? Color.BLACK :\r\n ret.equals(\"1\") ? Color.RED : Color.GREEN);\r\n } else {\r\n ret = \"\";\r\n }\r\n return ret;\r\n } \r\n };\r\n }\r\n }); \r\n\r\n //Se define la columna de la tabla con el nombre del atributo del objeto USUARIO correspondiente\r\n col_orden.setCellValueFactory( \r\n new PropertyValueFactory<>(\"orden\") );\r\n col_city.setCellValueFactory( \r\n new PropertyValueFactory<>(\"ciudad\") );\r\n col_codigo.setCellValueFactory( \r\n new PropertyValueFactory<>(\"codigo\") );\r\n col_cliente.setCellValueFactory( \r\n new PropertyValueFactory<>(\"cliente\") );\r\n col_fac_nc.setCellValueFactory( \r\n new PropertyValueFactory<>(\"numdocs\") );\r\n col_fecha.setCellValueFactory( \r\n new PropertyValueFactory<>(\"fecdoc\") );\r\n col_monto.setCellValueFactory( \r\n new PropertyValueFactory<>(\"monto\") );\r\n col_anulada.setCellValueFactory( \r\n new PropertyValueFactory<>(\"anulada\") );\r\n \r\n //Se Asigna ordenadamente las columnas de la tabla\r\n tb_factura.getColumns().addAll(\r\n col_orden, col_city, col_codigo, col_cliente, col_fac_nc, col_fecha, \r\n col_monto, col_anulada \r\n ); \r\n \r\n //Se Asigna menu contextual \r\n tb_factura.setRowFactory((TableView<Fxp_Archguid> tableView) -> {\r\n final TableRow<Fxp_Archguid> row = new TableRow<>();\r\n final ContextMenu contextMenu = new ContextMenu();\r\n final MenuItem removeMenuItem = new MenuItem(\"Anular Factura\");\r\n removeMenuItem.setOnAction((ActionEvent event) -> {\r\n switch (tipoOperacion){\r\n case 1:\r\n tb_factura.getItems().remove(tb_factura.getSelectionModel().getSelectedIndex());\r\n break;\r\n case 2:\r\n tb_factura.getItems().get(tb_factura.getSelectionModel().getSelectedIndex()).setAnulada(1);\r\n col_anulada.setVisible(false);\r\n col_anulada.setVisible(true);\r\n break;\r\n }\r\n });\r\n contextMenu.getItems().add(removeMenuItem);\r\n // Set context menu on row, but use a binding to make it only show for non-empty rows:\r\n row.contextMenuProperty().bind(\r\n Bindings.when(row.emptyProperty())\r\n .then((ContextMenu)null)\r\n .otherwise(contextMenu)\r\n );\r\n return row ; \r\n });\r\n \r\n //Se define el comportamiento de las teclas ARRIBA y ABAJO en la tabla\r\n EventHandler eh = new EventHandler<KeyEvent>(){\r\n @Override\r\n public void handle(KeyEvent ke){\r\n //Si fue presionado la tecla ARRIBA o ABAJO\r\n if (ke.getCode().equals(KeyCode.UP) || ke.getCode().equals(KeyCode.DOWN)){ \r\n //Selecciona la FILA enfocada\r\n selectedRowInvoice();\r\n }\r\n }\r\n };\r\n //Se Asigna el comportamiento para que se ejecute cuando se suelta una tecla\r\n tb_factura.setOnKeyReleased(eh); \r\n }",
"public void loadItemsTable(String reqId) {\n dao.setup();\n ObservableList<RequisitionItemEntity> items = FXCollections.observableArrayList(dao.read(RequisitionItemEntity.class));\n dao.exit();\n\n TableColumn<RequisitionItemEntity, String> poIdCol = new TableColumn<>(\"Purchase ID\");\n poIdCol.setCellValueFactory(new PropertyValueFactory<RequisitionItemEntity, String>(\"poid\"));\n\n TableColumn<RequisitionItemEntity, String> reqIdCol = new TableColumn<>(\"Requisiton ID\");\n reqIdCol.setCellValueFactory(new PropertyValueFactory<>(\"reqid\"));\n\n TableColumn<RequisitionItemEntity, Number> supidCol = new TableColumn<>(\"Supplier ID\");\n supidCol.setCellValueFactory(new PropertyValueFactory<>(\"supplier_id\"));\n\n TableColumn<RequisitionItemEntity, Double> tamontCol = new TableColumn<>(\"Total Amount\");\n tamontCol.setCellValueFactory(new PropertyValueFactory<>(\"total_amount\"));\n\n for (RequisitionItemEntity item : items){\n if(reqId == item.getReqId())\n tableItems.getItems().add(item);\n }\n\n tableItems.getColumns().addAll(poIdCol,reqIdCol,supidCol,tamontCol);\n\n\n }",
"public void update_teacherIssuedDetailTable(){ \r\n teacher_columnID.setCellValueFactory(new PropertyValueFactory<>(\"teacherID\"));\r\n teacher_columnName.setCellValueFactory(new PropertyValueFactory<>(\"teacherName\"));\r\n teacher_columnDepart.setCellValueFactory(new PropertyValueFactory<>(\"teacherDepart\"));\r\n teacher_columnQuantity.setCellValueFactory(new PropertyValueFactory<>(\"bookQuantity\"));\r\n teacher_columnBookTitle.setCellValueFactory(new PropertyValueFactory<>(\"bookTitle\"));\r\n teacher_columnBookClass.setCellValueFactory(new PropertyValueFactory<>(\"bookClass\"));\r\n teacher_columnDateIssued.setCellValueFactory(new PropertyValueFactory<>(\"dateIssued\"));\r\n try { \r\n String sql = \"SELECT * FROM teacherissued\";\r\n pstmt = con.prepareStatement(sql);\r\n rs = pstmt.executeQuery();\r\n while(rs.next()){\r\n teacherBooksData.add( new TeacherBookIssue(\r\n rs.getString(\"teacher_ID\"),\r\n rs.getString(\"teacher_name\"),\r\n rs.getString(\"teacher_depart\"),\r\n rs.getString(\"quantity_issued\"), \r\n rs.getString(\"book_title\"),\r\n rs.getString(\"book_class\"),\r\n rs.getString(\"date_issued\") \r\n )); \r\n }\r\n //load items to the table\r\n teachserIssuedTable.setItems(teacherBooksData);\r\n pstmt.close();\r\n rs.close();\r\n } catch (SQLException e) {\r\n } finally {\r\n try {\r\n rs.close();\r\n pstmt.close();\r\n } catch (Exception e) {\r\n } \r\n }\r\n }",
"private void loadData() {\n columnName = new String[]{\"姓名\", \"邮箱\"};\n adlMainVector = new Vector<Vector<String>>();\n adlmainTableModel = new AbstractTableModel() { // 实现表格抽象类的接口\n\n private static final long serialVersionUID = 500000L;\n\n @Override\n public Class<? extends Object> getColumnClass(int c) // 获取列标所对的类\n {\n return getValueAt(0, c).getClass();\n }\n\n @Override\n public int getColumnCount() { // 获取列数\n return columnName.length;\n }\n\n @Override\n public String getColumnName(int column) // 获取列标\n {\n return columnName[column];\n }\n\n @Override\n public int getRowCount() { // 获取行数\n return adlMainVector.size();\n }\n\n @Override\n public Object getValueAt(int row, int column) { // 获取row行column列的值\n if (!adlMainVector.isEmpty()) {\n return ((Vector<?>) adlMainVector.elementAt(row)).elementAt(column);\n } else {\n return null;\n }\n }\n\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n }\n\n @Override\n public void setValueAt(Object value, int row, int column) // 设定row行column列的值\n {\n }\n };\n EmailTable.setModel(adlmainTableModel);\n EmailTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);\n listShow(\"Select * From ADDRESSLISTTABLE ORDER BY ID+10000\");\n }",
"private void createTable() {\n\t\tfreqTable = new TableView<>();\n\n\t\tTableColumn<WordFrequency, Integer> column1 = new TableColumn<WordFrequency, Integer>(\"No.\");\n\t\tcolumn1.setCellValueFactory(new PropertyValueFactory<WordFrequency, Integer>(\"serialNumber\"));\n\n\t\tTableColumn<WordFrequency, String> column2 = new TableColumn<WordFrequency, String>(\"Word\");\n\t\tcolumn2.setCellValueFactory(new PropertyValueFactory<WordFrequency, String>(\"word\"));\n\n\t\tTableColumn<WordFrequency, Integer> column3 = new TableColumn<WordFrequency, Integer>(\"Count\");\n\t\tcolumn3.setCellValueFactory(new PropertyValueFactory<WordFrequency, Integer>(\"count\"));\n\n\t\tList<TableColumn<WordFrequency, ?>> list = new ArrayList<TableColumn<WordFrequency, ?>>();\n\t\tlist.add(column1);\n\t\tlist.add(column2);\n\t\tlist.add(column3);\n\n\t\tfreqTable.getColumns().addAll(list);\n\t}",
"private void fillTable(List<Book> books) {\n \n DefaultTableModel model = new DefaultTableModel();\n tbBooks.setModel(model);\n \n model.addColumn(\"ID\");\n model.addColumn(\"Nome\");\n tbBooks.getColumnModel().getColumn(0).setPreferredWidth(10);\n \n for (Book book : books) {\n model.addRow(new Object[]{book.getId(), book.getTitle()});\n }\n }"
] | [
"0.77269506",
"0.7657054",
"0.74755794",
"0.74142283",
"0.7409582",
"0.7405198",
"0.7287009",
"0.7263789",
"0.71940565",
"0.7173427",
"0.7149767",
"0.71465117",
"0.7094844",
"0.70921457",
"0.70407194",
"0.6994478",
"0.6896597",
"0.68927914",
"0.6878126",
"0.68715566",
"0.68657804",
"0.68181056",
"0.68073493",
"0.68021345",
"0.6786973",
"0.67439675",
"0.6727957",
"0.6718524",
"0.6707317",
"0.6705429",
"0.6700759",
"0.6695236",
"0.6693432",
"0.66918284",
"0.66901976",
"0.6675415",
"0.6668123",
"0.6656413",
"0.6647633",
"0.6644462",
"0.66413695",
"0.6631658",
"0.66080487",
"0.6601159",
"0.6594853",
"0.65508276",
"0.65492743",
"0.6540695",
"0.6538917",
"0.65376985",
"0.6536374",
"0.6519747",
"0.6497148",
"0.6494389",
"0.6460419",
"0.6460038",
"0.64495033",
"0.6443433",
"0.6441492",
"0.6434282",
"0.6418247",
"0.6417151",
"0.6410998",
"0.64092934",
"0.6400288",
"0.6392137",
"0.63857114",
"0.63831615",
"0.6375892",
"0.63733953",
"0.6373039",
"0.6371758",
"0.6359769",
"0.6356402",
"0.63459754",
"0.6342799",
"0.63397425",
"0.6319029",
"0.6304382",
"0.62822706",
"0.6270018",
"0.62659144",
"0.62612724",
"0.62597775",
"0.6252008",
"0.62289923",
"0.6222571",
"0.6210672",
"0.62042356",
"0.62031436",
"0.61998945",
"0.619943",
"0.6196473",
"0.61935943",
"0.6183747",
"0.61822575",
"0.6177076",
"0.6173876",
"0.617254",
"0.6169513"
] | 0.681157 | 22 |
first edit button (appointment related) | @FXML
void edit_button1(ActionEvent event) {
String visitType = returnVisitType();
String attended = returnAttended();
String attendType = returnAttendType();
Queries q = table_view_in_edit.getSelectionModel().getSelectedItem();
// check for required fields
if (reserveDate_picker_In_edit.getValue() == null || reserveTime_picker_In_edit.getValue() == null
|| attendDate_picker_In_edit.getValue() == null || attendTime_picker_In_edit.getValue() == null || visitType.isEmpty()){
error1.setVisible(true);
}else {
// confirmation message
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("تأكيد");
alert.setHeaderText("تاكيد التعديل");
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
try {
//TODO needs to be handled in the server
messageToServer = "edit1ES;" + reserveDate_picker_In_edit.getValue().toString() + ","
+ reserveTime_picker_In_edit.getValue().toString() + ","
+ attendDate_picker_In_edit.getValue().toString() + ","
+ attendTime_picker_In_edit.getValue().toString() + ","
+ visitType + ","
+ attended + ","
+ attendType + ","
+ q.getId() + "";
n.output(messageToServer);
// original code
// ps = con.prepareStatement("update visitInfo set reserve_date = ?," +
// " reserve_time= ?," +
// " attend_date = ?," +
// " attend_time = ?," +
// " visit_type = ?," +
// " attend = ?," +
// " attend_type = ?" +
// " where id = ? ");
// ps.setString(1, reserveDate_picker_In_edit.getValue().toString());
// ps.setString(2, reserveTime_picker_In_edit.getValue().toString());
// ps.setString(3, attendDate_picker_In_edit.getValue().toString());
// ps.setString(4, attendTime_picker_In_edit.getValue().toString());
// ps.setString(5, visitType);
// ps.setString(6, attended);
// ps.setString(7, attendType);
// ps.setString(8, q.getId());
//
// ps.executeUpdate();
} catch (IOException e) {
e.printStackTrace();
}
} else {
alert.close();
}
error1.setVisible(false);
clearfields1();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onEditClicked();",
"@FXML\n void OnActionModifyAppointment(ActionEvent event) throws IOException, SQLException {\n if(MSAppointmentsTableView.getSelectionModel().getSelectedItem() != null){\n Stage stage;\n Parent root;\n stage = (Stage)((Button)event.getSource()).getScene().getWindow();\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/View/ModifyAppointment.fxml\"));\n root = loader.load();\n Scene scene = new Scene(root);\n stage.setTitle(\"Modify Appointment\");\n stage.setScene(scene);\n stage.show();\n ModifyAppointmentController controller = loader.getController();\n Appointment selectedAppointment = MSAppointmentsTableView.getSelectionModel().getSelectedItem();\n controller.getSelectedAppointment(selectedAppointment, currentUser);\n } else {\n Alert alert = new Alert(Alert.AlertType.ERROR, \"Please select an appointment to modify from the table.\");\n alert.showAndWait();\n }\n }",
"public void onPressEdit() {\r\n Intent intent = new Intent(this, CreateEventActivity.class);\r\n intent.putExtra(CreateEventActivity.EXTRA_EDIT_EVENT_UID, event.uid);\r\n startActivity(intent);\r\n }",
"public EditAppointment() {\r\n\t\tsuper();\r\n\t}",
"@Override\n\tpublic void editAction(int id) {\n\t\t\n\t}",
"private void edit() {\n\n\t}",
"public void edit() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"editButton\").click();\n\t}",
"public void clickEdit() {\r\n\t\tEdit.click();\r\n\t}",
"public EditTeamPage pressEditButton() {\n controls.getEditButton().click();\n return new EditTeamPage();\n }",
"public void clickOnEditButton() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-btn.ant-btn-primary.ant-btn-circle\"), SHORTWAIT);\r\n\t}",
"public void clickEdit(View view) {\n if(editTime == true){\n bEdit.setText(\"Edit\");\n editTime = false;\n timePicker.setEnabled(false);\n if(switch1.isChecked())\n scheduleAlarm();\n }\n else {\n editTime = true;\n timePicker.setEnabled(true);\n bEdit.setText(\"Save\");\n hour = timePicker.getCurrentHour(); //get hour\n minute = timePicker.getCurrentMinute(); //get minutes\n }\n }",
"public static void editButtonAction(ActionContext actionContext){\n Table dataTable = actionContext.getObject(\"dataTable\");\n Shell shell = actionContext.getObject(\"shell\");\n Thing store = actionContext.getObject(\"store\");\n \n TableItem[] items = dataTable.getSelection();\n if(items == null || items.length == 0){\n MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);\n box.setText(\"警告\");\n box.setMessage(\"请先选择一条记录!\");\n box.open();\n return;\n }\n \n store.doAction(\"openEditForm\", actionContext, \"record\", items[0].getData());\n }",
"public void editOperation() {\n\t\t\r\n\t}",
"public AppointmentInformationView(Controller controller, Appointment appointment, String title) {\n super(controller);\n super.hourTextField.setText(\"\" + Integer.toString(appointment.getHour()));\n super.minuteTextField.setText(\"\" + Integer.toString(appointment.getMinute()));\n super.weekNumberTextField.setText(\"\" + Integer.toString(controller.getCurrentWeek().getWeekNumber()));\n super.customerTextField.setText(\"\" + appointment.getCustomer());\n super.durationTextField.setText(\"\" + Integer.toString((appointment.getDurationInMinutes())));\n super.phoneNumberTextField.setText(\"\" + Integer.toString(appointment.getPhoneNumber()));\n super.dayComboBox.setValue(appointment.getAppointmentDay());\n super.employeeComboBox.setValue(appointment.getEmployee());\n super.serviceComboBox.setValue(appointment.getService());\n\n super.saveButton.setVisible(false);\n Button editButton = new Button(\"Rediger\");\n editButton.setPrefWidth(100);\n Button deleteButton = new Button(\"Slet\");\n deleteButton.setPrefWidth(100);\n super.saveButton.setPrefWidth(100);\n super.gridpane4.getChildren().addAll(editButton, deleteButton);\n super.gridpane4.setConstraints(editButton, 21,0);\n super.gridpane4.setConstraints(deleteButton, 22,0);\n super.gridpane4.setConstraints(super.saveButton, 20,0);\n DisableOrEnableFields();\n\n Button finishButton = new Button(\"Til kassen\");\n finishButton.setPrefWidth(200);\n super.gridpane4.setConstraints(finishButton, 0,0);\n super.gridpane4.getChildren().add(finishButton);\n\n editButton.setOnAction(e -> {\n DisableOrEnableFields();\n super.saveButton.setVisible(true);\n editButton.setVisible(false);\n deleteButton.setVisible(false);\n super.gridpane4.setConstraints(editButton, 20,0);\n super.gridpane4.setConstraints(deleteButton, 21,0);\n super.gridpane4.setConstraints(super.saveButton, 22,0);\n finishButton.setVisible(false);\n\n super.saveButton.setOnAction(e1 -> {\n controller.OverWriteAppointment(appointment, hourTextField.getText(), minuteTextField.getText(),\n weekNumberTextField.getText(), dayComboBox.getValue(), durationTextField.getText(),\n employeeComboBox.getValue(), customerTextField.getText(), phoneNumberTextField.getText(), serviceComboBox.getValue());\n DisableOrEnableFields();\n super.saveButton.setVisible(false);\n editButton.setVisible(true);\n deleteButton.setVisible(true);\n finishButton.setVisible(true);\n\n\n super.gridpane4.setConstraints(editButton, 21,0);\n super.gridpane4.setConstraints(deleteButton, 22,0);\n super.gridpane4.setConstraints(super.saveButton, 20,0);\n\n });\n\n });\n\n deleteButton.setOnAction(e -> {\n super.window.close();\n controller.DeleteAppointment(appointment);\n\n });\n }",
"@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}",
"public void editBtnOnclick()\r\n\t{\r\n\t\tif(cardSet.getCards().size() != 0)\r\n\t\t\tMainRunner.getSceneSelector().switchToCardEditor();\r\n\t}",
"public void afterClickedEdit(View view) {\n GlobalUtils.showOpdtionDialog(this, new OptionDialogCallback() {\n @Override\n public void onActionHistory() {\n Intent intent = new Intent(MainActivity.this, HistoryActivity.class);\n startActivity(intent);\n }\n\n @Override\n public void onActionChangeTime() {\n if (GlobalUtils.TARGET_TREATMENT_TIME.equals(\"0\")) {\n GlobalUtils.showInfoDialog(MainActivity.this, \"Error\", \"You have not entered your total treatment time yet\", \"OK\", new SCDialogCallback() {\n @Override\n public void onAction1() {\n\n }\n\n @Override\n public void onAction2() {\n\n }\n\n @Override\n public void onAction3() {\n\n }\n\n @Override\n public void onAction4() {\n\n }\n });\n } else {\n aftererClickTarget();\n }\n }\n\n @Override\n public void onActionClear() {\n //show confirmation dialog\n GlobalUtils.showConfirmDialog(MainActivity.this, \"Confirmation\", \"Are you sure you want to clear all data?\", \"Yes\", \"No\", new SCDialogCallback() {\n @Override\n public void onAction1() {\n db.deleteSchedule(GlobalUtils.getCurrentDate().getFormattedDate());\n mListScheduleData.clear();\n GlobalUtils.calculated_schedule = new Schedule();\n initScheduleList();\n reset_Views();\n GlobalUtils.no_counting = true;\n GlobalUtils.TARGET_TREATMENT_TIME = \"0\";\n }\n\n @Override\n public void onAction2() {\n\n }\n\n @Override\n public void onAction3() {\n\n }\n\n @Override\n public void onAction4() {\n\n }\n });\n }\n\n @Override\n public void onActionSave() {\n\n }\n\n @Override\n public void onActionCancel() {\n\n }\n\n @Override\n public void onActionHelp() {\n Intent intent = new Intent(MainActivity.this,HelpActivity.class);\n startActivity(intent);\n }\n });\n\n\n }",
"public String btn_edit_action()\n {\n int n = this.getDataTableSemental().getRowCount();\n ArrayList<SementalDTO> selected = new ArrayList();\n for (int i = 0; i < n; i++) { //Obtener elementos seleccionados\n this.getDataTableSemental().setRowIndex(i);\n SementalDTO aux = (SementalDTO) this.\n getDataTableSemental().getRowData();\n if (aux.isSelected()) {\n selected.add(aux);\n }\n }\n if(selected == null || selected.size() == 0){\n //En caso de que no se seleccione ningun elemento\n MessageBean.setErrorMessageFromBundle(\"not_selected\", this.getMyLocale());\n return null;\n }\n else if(selected.size() == 1){ //En caso de que solo se seleccione un elemento\n \n getgermplasm$SementalSessionBean().setSementalDTO(selected.get(0));\n \n getgermplasm$SemenGatheringSessionBean().resetPagination();\n \n //Llamada al jsp encargado de la edicion de accessiones\n return \"edit\";\n \n }\n else{ //En caso de que sea seleccion multiple\n MessageBean.setErrorMessageFromBundle(\"not_yet\", this.getMyLocale());\n return null;\n }\n }",
"public void editButtonClicked() {\n setButtonsDisabled(false, true, true);\n setAllFieldsAndSliderDisabled(false);\n }",
"protected abstract void editItem();",
"private void editAlarm(Alarm affectedAlarm) {\n \t\t//TODO: Launch AddAlarmActivity with this alarm as base so the user can edit it.\n \t}",
"@Override\n public void onClick(View view) {\n Intent addEvent = new Intent(getApplicationContext(), EditActivity.class);\n startActivity(addEvent);\n }",
"public void clickEditButton(){\r\n\t\t\r\n\t\tMcsElement.getElementByXpath(driver, \"//div[contains(@class,'x-tab-panel-noborder') and not(contains(@class,'x-hide-display'))]//button[contains(@class,'icon-ov-edit')]\").click();\r\n\t\t\r\n\t}",
"public boolean shouldEditButtonBePresent();",
"@FXML\n void setBtnEditOnClick() {\n isEdit = true;\n isAdd = false;\n isDelete = false;\n }",
"public String loadMainEdit(){\r\n\t\treturn \"edit\";\r\n }",
"public void editDogButtonClicked() {\r\n if (areFieldsNotBlank()) {\r\n viewModel.editDog();\r\n viewHandler.openView(\"home\");\r\n dogNameField.setStyle(null);\r\n }\r\n }",
"@FXML\r\n void onActionUpdateAppointment(ActionEvent event) throws IOException {\r\n\r\n Appointment appointmentIndex = appointmentsTable.getSelectionModel().getSelectedItem();\r\n appointmentToUpdateIndex = DBCustomer.getAllCustomers().indexOf(appointmentIndex);\r\n\r\n if(appointmentsTable.getSelectionModel().getSelectedItem() == null){\r\n Alert alert = new Alert(Alert.AlertType.WARNING);\r\n alert.initModality(Modality.APPLICATION_MODAL);\r\n alert.setTitle(\"Appointment not selected\");\r\n alert.setHeaderText(\"Please choose an appointment to update\");\r\n alert.showAndWait();\r\n }\r\n else{\r\n FXMLLoader loader = new FXMLLoader();\r\n loader.setLocation(getClass().getResource(\"/view/UpdateAppointment.FXML\"));\r\n Parent scene = loader.load();\r\n UpdateAppointmentController UPController = loader.getController();\r\n UPController.sendAppointment(appointmentsTable.getSelectionModel().getSelectedItem());\r\n\r\n stage = (Stage)((Button)event.getSource()).getScene().getWindow();\r\n //scene = FXMLLoader.load(getClass().getResource(\"/view/UpdateAppointment.fxml\"));\r\n stage.setScene(new Scene(scene));\r\n stage.show();\r\n }\r\n\r\n }",
"public Button getEditButton() {\n\t\treturn editButton;\n\t}",
"public ViewResumePage clickonedit() throws Exception{\r\n\t\t\ttry {\r\n\t\t\t\telement = driver.findElement(edit);\r\n\t\t\t\tflag = element.isDisplayed() && element.isEnabled();\r\n\t\t\t\tAssert.assertTrue(flag, \"Edit button is not displayed\");\r\n\t\t\t\telement.click();\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new Exception(\"Edit Button NOT FOUND:: \"+e.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t\treturn new ViewResumePage(driver);\r\n\t\t\r\n\t}",
"public abstract void edit();",
"public void contactEdit() {\n Intent editIntent = new Intent(viewContacts.this, editContact.class); //start the intent to go back to edit contact\n editIntent.putExtra(\"MyID\", edit_intent);\n\n startActivity(editIntent); //start the activity\n\n\n\n }",
"public void Admin_Configuration_EmailSubscriptions_Editbtn()\n\t{\n\t\tAdmin_Configuration_EmailSubscriptions_Editbtn.click();\n\t}",
"public String edit() {\n return \"edit\";\n }",
"@FXML\n public void startApptUpdate(Appointments appt) {\n String apptID = String.valueOf(appt.getApptID());\n modApptID.setText(apptID);\n modApptID.setEditable(false);\n modApptTitle.setText(appt.getApptTitle());\n modApptDescript.setText(appt.getApptDescript());\n modApptLocale.setText(appt.getApptLocation());\n modApptContact.setItems(Appointments.getContactNames());\n modApptContact.setValue(DBContacts.getContactName(appt.getContact()));\n modApptType.setItems(Appointments.getAllApptTypes());\n modApptType.setValue(appt.getApptType());\n modApptCustName.setItems(Appointments.getCustomerNames());\n modApptCustName.setValue(DBCustomers.getCustomerName(appt.getApptCustomerID()));\n modApptDate.setValue(appt.getApptStart().toLocalDate());\n modApptDate.setValue(appt.getApptEnd().toLocalDate());\n modApptUserID.setItems(Appointments.getUserIDs());\n modApptUserID.setValue(appt.getApptUserID());\n modStartTime.setItems(Appointments.getStartWorkHours());\n modStartTime.setValue(appt.getApptStart().toLocalTime());\n modApptEndTime.setItems(Appointments.getEndWorkHours());\n modApptEndTime.setValue(appt.getApptEnd().toLocalTime());\n\n }",
"private void addAppointmentButtonAction (ActionEvent event) {\r\n\t\t\tif (customersTable.getItems().isEmpty()) {\r\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\r\n\t\t\t\talert.setHeaderText(\"No customer selected\");\r\n\t\t\t\talert.setContentText(\"You must select a customer to schedule an appointment\");\r\n\t\t\t\talert.showAndWait();\r\n\t\t\t} else {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tselectedItem = customersTable.getSelectionModel().getSelectedItem();\r\n\t\t\t\t\t//Go to add appointment screen\r\n\t\t\t\t\tParent root;\r\n\t\t\t\t\tStage stage = (Stage) appointmentsButton.getScene().getWindow();\r\n\t\t\t\t\troot = FXMLLoader.load(getClass().getResource(\"/views/AddAppointmentScreen.fxml\"));\r\n\t\t\t\t\tScene scene = new Scene(root);\r\n\t\t\t\t\tstage.setScene(scene);\r\n\t\t\t\t\tstage.show();\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"public void clickEditLink() {\r\n\t\tbtn_EditLink.click();\r\n\t}",
"@Then(\"user clicks on edit consignment\")\r\n\tpublic void user_clicks_on_edit_consignment() {\n\t\tWebElement element = Browser.session.findElement(By.xpath(\"//*[@id='consignments-rows']//button[1]\"));\r\n\t\telement.click();\r\n\t\telement = Browser.session.findElement(By.xpath(\"//a[text()='Edit consignment info']\"));\r\n\t\telement.click();\r\n\t}",
"@Override\n public void onClick(View v) {\n if (editEventId == null && proposal==null){\n if(canGoNext()){\n dialog = UbiQuoBusinessUtils.defaultProgressBar(\"Caricamento in corso\",getActivity());\n dialog.show();\n updateStaticData();\n submitEvent();\n }\n }\n\n if(editEventId != null){\n dialog = UbiQuoBusinessUtils.defaultProgressBar(\"Caricamento in corso\",getActivity());\n dialog.show();\n updateStaticData();\n editEvent(editEventId,editEventCity);\n }\n\n if(proposal != null){\n dialog = UbiQuoBusinessUtils.defaultProgressBar(\"Caricamento in corso\",getActivity());\n dialog.show();\n updateStaticData();\n submitProposal(proposal.getString(\"id\"));\n }\n }",
"public void marksEdit(View view) {\n Intent intent = new Intent(getApplicationContext(), InsertingAtten.class);\n intent.putExtra(\"STATUS\", \"edit\");\n intent.putExtra(\"SEMESTER\", semester);\n intent.putExtra(\"SECTION\", section);\n intent.putExtra(\"COURSEID\", courseId);\n intent.putExtra(\"DEPARTMENT\", department);\n intent.putExtra(\"SERIES\", series);\n startActivity(intent);\n }",
"public void onEditAgendaItem() {\n AgendaItem agendaItem = outputAgendaItemsPreparation.getSelectionModel().getSelectedItem();\n\n if (agendaItem == null) {\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_NULL, null);\n return;\n }\n\n AgendaItemDialog agendaItemDialog = AgendaItemDialog.getNewInstance(agendaItem);\n if (agendaItemDialog == null) {\n // Exception already handled\n return;\n }\n Optional<AgendaItem> result = agendaItemDialog.showAndWait();\n if (!result.isPresent()) {\n return;\n }\n\n if (controller.editAgendaItem(result.get())) {\n return;\n }\n\n AlertHelper.showError(LanguageKey.ERROR_AGENDAITEM_EDIT, null);\n }",
"@Override\n public void onClick(View v) {\n enableEditMode();\n }",
"public void clickedPresentationEdit() {\n\t\tif(mainWindow.getSelectedRowPresentation().length <= 0) ApplicationOutput.printLog(\"YOU DID NOT SELECT ANY PRESENTATION\");\n\t\telse if(mainWindow.getSelectedRowPresentation().length > 1) ApplicationOutput.printLog(\"Please select only one presentation to edit\");\n\t\telse {\n\t\t\tshowPresentationDetails(mainWindow.getSelectedRowPresentation()[0]);\n\t\t}\t\n\t}",
"public edit() {\n initComponents();\n }",
"@FXML\r\n\tprivate void editEmployee(ActionEvent event) {\r\n\t\tbtEditar.setDisable(true);\r\n\t\tbtGuardar.setDisable(false);\r\n\t\tconmuteFields();\r\n\t}",
"@Override\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t\t\t\tIntent intent = new Intent(Intent.ACTION_EDIT);\n\t\t\t\t\t\tintent.setType(\"vnd.android.cursor.item/event\");\n\t\t\t\t\t\tintent.putExtra(\"beginTime\", cal.getTimeInMillis());\n\t\t\t\t\t\tintent.putExtra(\"allDay\", true);\n\t\t\t\t\t\tcontext.startActivity(intent);\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t\t\t\tIntent intent = new Intent(Intent.ACTION_EDIT);\n\t\t\t\t\t\tintent.setType(\"vnd.android.cursor.item/event\");\n\t\t\t\t\t\tintent.putExtra(\"beginTime\", cal.getTimeInMillis());\n\t\t\t\t\t\tintent.putExtra(\"allDay\", true);\n\t\t\t\t\t\tcontext.startActivity(intent);\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\t\t\t\tIntent intent = new Intent(Intent.ACTION_EDIT);\n\t\t\t\t\t\tintent.setType(\"vnd.android.cursor.item/event\");\n\t\t\t\t\t\tintent.putExtra(\"beginTime\", cal.getTimeInMillis());\n\t\t\t\t\t\tintent.putExtra(\"allDay\", true);\n\t\t\t\t\t\tcontext.startActivity(intent);\n\t\t\t\t\t}",
"protected void editClicked(View view){\n FragmentManager fm = getSupportFragmentManager();\n ЕditDialog editDialogFragment = new ЕditDialog(2);\n Bundle args = new Bundle();\n args.putInt(\"position\", this.position);\n args.putString(\"itemName\", this.itm.getItem(this.position).getName());\n args.putString(\"itemUrl\", this.itm.getItem(this.position).getUrl());\n editDialogFragment.setArguments(args);\n editDialogFragment.show(fm, \"edit_item\");\n }",
"public void mmEditClick(ActionEvent event) throws Exception{\r\n displayEditProfile();\r\n }",
"private void editComic() {\n mainActivity.ISSUE_ID = comic.getComicID();\n\n //Load the edit fragment\n mainActivity.loadEditComicFragment();\n }",
"public void setEditButton(Button editButton) {\n\t\tthis.editButton = editButton;\n\t}",
"@Override\n public void editClick(int pos) {\n editPos = pos;\n\n Calendar c = Calendar.getInstance();\n year = c.get(Calendar.YEAR);\n month = c.get(Calendar.MONTH);\n day = c.get(Calendar.DAY_OF_MONTH);\n\n DatePickerDialog datePickerDialog = new DatePickerDialog(AdminCalendar.this, AdminCalendar.this, year, month, day);\n datePickerDialog.show();\n }",
"@Override\n public void onClick(View v) {\n Log.d(\"prof\",\"edit\");\n editDetails();\n// btn_prof_save.setVisibility(View.VISIBLE);\n// btn_prof_edit.setVisibility(View.INVISIBLE);\n }",
"public void onClick(View view) {\n Log.d(\"Edit1\",\"EDITED1\");\n\n }",
"private void butEditFeeSched_Click(Object sender, System.EventArgs e) throws Exception {\n long selectedSched = 0;\n if (listFeeSched.SelectedIndex != -1)\n {\n selectedSched = FeeSchedC.getListShort()[listFeeSched.SelectedIndex].FeeSchedNum;\n }\n \n FormFeeScheds FormF = new FormFeeScheds();\n FormF.ShowDialog();\n DataValid.setInvalid(InvalidType.FeeScheds,InvalidType.Fees,InvalidType.ProcCodes);\n //Fees.Refresh();\n //ProcedureCodes.RefreshCache();\n changed = true;\n fillFeeSchedules();\n for (int i = 0;i < FeeSchedC.getListShort().Count;i++)\n {\n if (FeeSchedC.getListShort()[i].FeeSchedNum == selectedSched)\n {\n listFeeSched.SelectedIndex = i;\n }\n \n }\n fillGrid();\n SecurityLogs.MakeLogEntry(Permissions.Setup, 0, \"Fee Schedules\");\n }",
"@Override\n public void onEditButtonClicked() {\n FragmentManager fm = getFragmentManager();\n FragmentTransaction transaction = fm.beginTransaction();\n currentExercise = workout.get(currentExerciseIndex);\n exerciseEditFragment.setCurrentExercise(currentExercise);\n Log.d(TAG, \"onEditButtonClicked: \" + currentExercise);\n transaction.replace(R.id.exerciseFragmentLayout, exerciseEditFragment);\n transaction.commit();\n }",
"public void onClick(View view) {\n Log.d(\"Edit\",\"EDITED\");\n }",
"@Override\n public void onClick(View v) {\n\n Intent intent = new Intent(MainActivity.this, EditDataActivity.class);\n startActivity(intent);\n\n }",
"public void onChangedAdBtnPressed() {\n String uniqueID = advertisement.getUniqueID();\n view.showEditView(uniqueID);\n }",
"void onEditItem(E itemElementView);",
"@FXML\n\tpublic void editClicked(ActionEvent e) {\n\t\tMain.getInstance().navigateToDialog(\n\t\t\t\tConstants.EditableCourseDataViewPath, course);\n\t}",
"private void launchEditVolPage(View view, Volunteer thisGuy){\n final Intent launchEdit = new Intent(manageVolunteers.this,ManagerEditVolunteer.class);\n\n Bundle bundle = new Bundle();\n bundle.putSerializable(\"thisGuy\", thisGuy);\n launchEdit.putExtra(\"bundle\", bundle);\n startActivity(launchEdit);\n }",
"public void clickedSpeakerEdit() {\n\t\tif(mainWindow.getSelectedRowSpeaker().length <= 0) ApplicationOutput.printLog(\"YOU DID NOT SELECT ANY PRESENTATION\");\n\t\telse if(mainWindow.getSelectedRowSpeaker().length > 1) ApplicationOutput.printLog(\"Please select only one presentation to edit\");\n\t\telse {\n\t\t\tshowSpeakeerDetails(mainWindow.getSelectedRowSpeaker()[0]);\n\t\t}\t\n\t}",
"public String editar()\r\n/* 59: */ {\r\n/* 60: 74 */ if ((getMotivoLlamadoAtencion() != null) && (getMotivoLlamadoAtencion().getIdMotivoLlamadoAtencion() != 0)) {\r\n/* 61: 75 */ setEditado(true);\r\n/* 62: */ } else {\r\n/* 63: 77 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_seleccionar\"));\r\n/* 64: */ }\r\n/* 65: 79 */ return \"\";\r\n/* 66: */ }",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tLog.e(\"edit pressed\", \"edit pressed\");\n\t\t\t\t\teditflag = !editflag;\n\t\t\t\t\tsetFieldEditFlag(editflag);\n\t\t\t\t\t//\tpicview1.setEnabled(true);\n\n\t\t\t\t}",
"private void editEvent(VBox day, String descript, String termID) {\n Label dayLbl = (Label)day.getChildren().get(0);\n Model.getInstance().event_day = Integer.parseInt(dayLbl.getText());\n Model.getInstance().eventEnd_day = Integer.parseInt(dayLbl.getText());\n Model.getInstance().event_month = Model.getInstance().getMonthIndex(monthSelect.getSelectionModel().getSelectedItem()); \n Model.getInstance().event_year = Integer.parseInt(selectedYear.getValue());\n Model.getInstance().eventEnd_month = Model.getInstance().getMonthIndex(monthSelect.getSelectionModel().getSelectedItem()); \n Model.getInstance().eventEnd_year = Integer.parseInt(selectedYear.getValue());\n Model.getInstance().event_subject = descript;\n Model.getInstance().event_term_id = Integer.parseInt(termID);\n\n // When user clicks on any date in the calendar, event editor window opens\n try {\n // Load root layout from fxml file.\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(getClass().getResource(\"/views/planings/edit_event.fxml\"));\n \n AnchorPane rootLayout = (AnchorPane) loader.load();\n Stage stage = new Stage(StageStyle.UNDECORATED);\n stage.initModality(Modality.APPLICATION_MODAL); \n\n // Pass main controller reference to view\n EditEventController eventController = loader.getController();\n eventController.setMainController(this);\n \n // Show the scene containing the root layout.\n Scene scene = new Scene(rootLayout);\n stage.setScene(scene);\n stage.show();\n } catch (IOException ex) {\n Logger.getLogger(FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"@Override\n \t\t\tpublic void onClick(View view) {\n \t\t\t\t Intent intent = new Intent(getActivity(), AddEditChoresActivity.class);\n \t\t\t\t startActivity(intent);\n \t\t\t}",
"public void edit(RequestBean request) {\n\t\t\r\n\t}",
"public EditarVenda() {\n initComponents();\n URL caminhoIcone = getClass().getResource(\"/mklivre/icone/icone2.png\");\n Image iconeTitulo = Toolkit.getDefaultToolkit().getImage(caminhoIcone);\n this.setIconImage(iconeTitulo);\n conexao = ModuloConexao.conector();\n codigoCliente.setEnabled(false);\n lucro.setEnabled(false);\n valorLiquidoML.setEnabled(false);\n }",
"@FXML\n private void editSelected() {\n if (selectedAccount == null) {\n // Warn user if no account was selected.\n noAccountSelectedAlert(\"Edit DonorReceiver\");\n } else {\n EditPaneController.setAccount(selectedAccount);\n PageNav.loadNewPage(PageNav.EDIT);\n }\n }",
"public Point getEditClickPoint() { return editClickPoint; }",
"private void switchBetweenAddEdit() {\n String uid = getIntent().getStringExtra(NOTE_UID);\n if (uid != null) {\n\n Objects.requireNonNull(getSupportActionBar()).setTitle(R.string.edit_note);\n\n Note note = Arrays.stream(firebase.getNotes().getValue()).filter(note1 -> uid.equals(note1.getUid())).findFirst().get();\n\n Calendar cal = Calendar.getInstance();\n cal.setTime(note.getDate());\n\n date.init(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), null);\n title.setText(note.getTitle());\n body.setText(note.getBody());\n\n addBtn.setVisibility(View.GONE);\n editBtnsLyot.setVisibility(View.VISIBLE);\n\n saveBtn.setOnClickListener(view -> {\n prepareNote(note1 -> {\n note1.setUid(uid);\n setNoteOnFirebaseManager(note1, true);\n });\n });\n\n deleteBtn.setOnClickListener(view -> {\n deleteNoteOnFirebaseManager(note);\n });\n }\n\n addBtn.setOnClickListener(view -> {\n prepareNote(note -> {\n setNoteOnFirebaseManager(note, false);\n });\n });\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\tIntent intent = new Intent(v.getContext(),\r\n\t\t\t\t\t\tCommonlyPatientEditActivity.class);\r\n\t\t\t\tstartActivity(intent);\r\n\r\n\t\t\t}",
"private void editItem(InspectionPlanTemplateDTO item) {\n int newRowIndex = this.tbl_view_charGroup_overview.getCurrentItemsCount() - 1;\n this.tbl_view_charGroup_overview.scrollTo(newRowIndex);\n // Put the second column in editing mode\n TreeTableColumn<InspectionPlanTemplateDTO, ?> firstCol = tbl_view_charGroup_overview.getColumns().get(1);\n // \n this.tbl_view_charGroup_overview.getFocusModel().focus(newRowIndex, firstCol);\n tbl_view_charGroup_overview.edit(newRowIndex, firstCol);\n // set active\n item.setActive(1);\n\n }",
"public void onClick$editClientButton() {\n\n\t\tClient client = buildClient();\n\t\tclient.setId(clientToEdit.getId());\n\n\t\tClientService clientService = ServiceLocator.getClientService();\n\n\t\ttry {\n\t\t\tclientService.saveOrUpdate(client);\n\t\t} catch (Exception e) {\n\t\t\tmessageLabel.setValue(\"Error al crear el cliente\");\n\t\t\tLOGGER.error(e);\n\t\t}\n\t\tExecutions.sendRedirect(\"queryClients.zul\");\n\t\tmessageLabel.setValue(\"Cliente creado exitosamente.\");\n\t}",
"public void editar() {\n try {\n ClienteDao fdao = new ClienteDao();\n fdao.Atualizar(cliente);\n\n JSFUtil.AdicionarMensagemSucesso(\"Cliente editado com sucesso!\");\n\n } catch (RuntimeException e) {\n JSFUtil.AdicionarMensagemErro(\"ex.getMessage()\");\n e.printStackTrace();\n }\n }",
"@FXML\n public void OAUpdateAppointment(ActionEvent event) {\n\n try {\n FXMLLoader fxmlLoader = new FXMLLoader();\n fxmlLoader.setLocation(getClass().getResource(\"/View/UpdateAppointment.fxml\"));\n Parent add = fxmlLoader.load();\n UpdateAppointmentController updateAppointment = fxmlLoader.getController();\n Appointment appointment = Appointments.getSelectionModel().getSelectedItem();\n int ID = appointment.getAppointmentID();\n Appointment app = DBQuery.retrieveAppointment(ID);\n updateAppointment.receiveAppointment(app);\n Stage stage = new Stage();\n stage.setScene(new Scene(add));\n stage.show();\n\n\n }catch (IOException | NullPointerException e){\n System.out.println(e);\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Error\");\n alert.setHeaderText(\"No appointment selected.\");\n alert.setContentText(\"Please select a appointment to update.\");\n alert.showAndWait();}\n }",
"@FXML\r\n private void editar(ActionEvent event) {\n selecionado = tabelaCliente.getSelectionModel()\r\n .getSelectedItem();\r\n\r\n //Se tem algum cliente selecionado\r\n if (selecionado != null) { //tem clienteonado\r\n //Pegar os dados do cliente e jogar nos campos do\r\n //formulario\r\n textFieldNumeroCliente.setText(\r\n String.valueOf( selecionado.getIdCliente() ) );\r\n textfieldNome.setText( selecionado.getNome() ); \r\n textFieldEmail.setText(selecionado.getEmail());\r\n textFieldCpf.setText(selecionado.getCpf());\r\n textFieldRg.setText(selecionado.getRg());\r\n textFieldRua.setText(selecionado.getRua());\r\n textFieldCidade.setText(selecionado.getCidade());\r\n textFieldBairro.setText(selecionado.getBairro());\r\n textFieldNumeroCasa.setText(selecionado.getNumeroCasa());\r\n textFieldDataDeNascimento.setValue(selecionado.getDataNascimemto());\r\n textFieldTelefone1.setText(selecionado.getTelefone1());\r\n textFieldTelefone2.setText(selecionado.getTelefone2());\r\n textFieldCep.setText(selecionado.getCep());\r\n \r\n \r\n \r\n }else{ //não tem cliente selecionado na tabela\r\n mensagemErro(\"Selecione um cliente.\");\r\n }\r\n\r\n }",
"public void editHandler(View v) {\n LinearLayout vwParentRow = (LinearLayout)v.getParent();\n TextView id =(TextView) vwParentRow.findViewById(R.id._id);\n Intent intent = new Intent(Hates.this, Formulario.class);\n\n intent.putExtra(C_MODO, C_EDITAR);\n intent.putExtra(C_TIPO, love_hate);\n intent.putExtra(mDbHelper.ID, Long.valueOf((String)id.getText()));\n\n\n this.startActivityForResult(intent, C_EDITAR);\n }",
"@Override\r\n\t\tpublic boolean editItem() {\n\t\t\treturn false;\r\n\t\t}",
"private void edit() {\n mc.displayGuiScreen(new GuiEditAccount(selectedAccountIndex));\n }",
"public IButton getEditButton() {\n return controls.getEditButton();\n }",
"@Override\n public void onClick(View view) {\n\n ((EditFragmentInterface) (view.getContext())).edit(projectId, false);\n }",
"public String editRequiredElements(){\r\n \tthis.getLog().info(\"+ nextView: editM_Tabpage\");\r\n \treturn \"editM_Tabpage\";\r\n }",
"@Override\n public void onClick(View view) {\n Toast.makeText(MeetDetails.this,\n \"WIP: Ir a EditarCita\", Toast.LENGTH_LONG).show();\n }",
"public void edit() {\n\t\tlogger.debug(\"Entering IVR dtmf edit method...\");\n\t\tif (selectedDtmfId != null && selectedDtmfId.intValue() != -1) {\n\t\t\ttry {\n\t\t\t\tIvrDtmf entry = ivrDtmfDao.findById(selectedDtmfId);\n\t\t\t\tdtmfId = entry.getDtmfId();\n\t\t\t\tdtmfName = entry.getDtmfName();\n\t\t\t\tdtmfDigit = entry.getDtmfDigit();\n\t\t\t\tdtmfDescription = entry.getDtmfDescription();\n\t\t\t\tdtmfCreateDate = entry.getDtmfCreateDate();\n\t\t\t\tdtmfUpdateDate = entry.getDtmfUpdateDate();\n\t\t\t\tselectedDtmfId = -1;\n\t\t\t} catch (Exception ex) {\n\t\t\t\tlogger.error(\"Failed to fetch the element data from db, Cause: \"+ex.getMessage(), ex);\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Failed to fetch the element data from db, Cause: \"+ex.getMessage()));\n\t\t\t}\n\t\t} else {\n\t\t\treset();\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tIntent i = new Intent(NewProfileActivity.this,\n\t\t\t\t\t\tTBDispContacts.class);\n\t\t\t\ti.putExtra(\"Edit\", \"true\");\n\t\t\t\ti.putExtra(\"Details\", \"false\");\n\t\t\t\tstartActivity(i);\n\t\t\t}",
"public void editCustomer() {\n int id = this.id;\n PersonInfo personInfo = dbHendler.getCustInfo(id);\n String name = personInfo.getName().toString().trim();\n String no = personInfo.getPhoneNumber().toString().trim();\n float custNo = personInfo.get_rootNo();\n String cUSTnO = String.valueOf(custNo);\n int fees = personInfo.get_fees();\n String fEES = Integer.toString(fees);\n int balance = personInfo.get_balance();\n String bALANCE = Integer.toString(balance);\n String nName = personInfo.get_nName().toString().trim();\n String startdate = personInfo.get_startdate();\n int areaID = personInfo.get_area();\n String area = dbHendler.getAreaName(areaID);\n person_name.setText(name);\n contact_no.setText(no);\n rootNo.setText(cUSTnO);\n monthly_fees.setText(fEES);\n balance_.setText(bALANCE);\n nickName.setText(nName);\n this.startdate.setText(startdate);\n // retrieving the index of element u\n int retval = items.indexOf(area);\n\n spinner.setSelection(retval);\n }",
"public void onEdit(View view){\n\n Intent intent = new Intent(this,ACT_Edit_Course.class);\n intent.putExtra(\"refID\",selectedCategory);\n startActivity(intent);\n\n }",
"@FXML\n public void OAWeekView(ActionEvent event) {\n Appointment.clearWeeklyAppointments();\n Appointment.setWeekAppointments();\n Appointments.setItems(Appointment.getWeekAppointments());\n }",
"@FXML\n public void OAMonthView(ActionEvent event) {\n Appointment.clearMonthlyAppointment();\n Appointment.setMonthAppointments();\n Appointments.setItems(Appointment.getMonthAppointments());\n\n }",
"void showTodoViewToEdit(Task task);",
"@FXML\n\tprivate void handleEdit() {\n\t\tCustomer customer = customerTable.getSelectionModel().getSelectedItem();\n\t\tshowCustomerInfoDialog(customer);\n\t}",
"public void clickOnEditButtonOnSavedListings() {\r\n\t\tprint(\"Click on Edit under Saved Listing Section\");\r\n\t\tlocator = Locator.MyTrader.Saved_Listing_Edit.value;\r\n\t\tclickOn(locator);\r\n\t\tAssert.assertTrue(isElementPresent(Locator.MyTrader.Your_Saved_Listing.value));\r\n\t}",
"public String editarRutina(Rutina tp) {\n\t\t//newRutina = ts;\n\t\tvEditing = true;\n\t\tvTitulo = \"EDITAR\";\n\t\treturn \"nueva-rutina?faces-redirect=true&id=\"+tp.getIdRutina();\n\t}",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(Appointment.this, AddAppointment.class);\n startActivity(intent);\n finish();\n }",
"public void handleEditAll(ActionEvent actionEvent) throws Exception {\n\t\tString id = txtDisID.getText();\n\t\tItem preSelected = selectedItem;\n\n\t\tif(!id.isEmpty() && id != null){\n\t\t\tStage newItemWindow = new Stage();\n\t\t\tnewItemWindow.setTitle(\"Edit Item\");\n\t\t\tFXMLLoader loader = new FXMLLoader(getClass().getResource(\"/views/editItem.fxml\"));\n\t\t\tnewItemWindow.setScene(new Scene(loader.load()));\n\t\t\tnewItemWindow.initModality(Modality.APPLICATION_MODAL);\n//\t\t\tnewItemWindow.getIcons().add(new Image(MainWindowController.class.getResourceAsStream(\"../IMS icon.png\")));\n\t\t\tnewItemWindow.setResizable(false);\n\n\t\t\tEditItemController controller = loader.<EditItemController>getController();\n\t\t\tcontroller.setItemId(id);\n\n\t\t\tnewItemWindow.showAndWait();\n\t\t\trefreshTable();\n\t\t} else {\n\t\t\tAlert alert = new Alert(Alert.AlertType.ERROR);\n\t\t\talert.setTitle(\"Error\");\n\t\t\talert.setHeaderText(\"There is no item to Edit\");\n\t\t\talert.setContentText(\"Please select the item before edit !\");\n\n\t\t\talert.showAndWait();\n\t\t}\n\t}",
"@FXML\n public void editSet(MouseEvent e) {\n AnchorPane root = null;\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"/view/learn_update.fxml\"));\n try {\n root = loader.load();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n LearnUpdateController controller = loader.getController();\n controller.initData(txtTitle.getText(), rootController, learnController, apnLearn);\n rootController.setActivity(root);\n root.requestFocus();\n }",
"@Override\n public void onClick(View v) {\n getActivityDetails(view);\n\n String editDialogDistance = null;\n String editDialogAlt = null;\n String editDialogAvgHR = null;\n String editDialogMaxHR = null;\n\n long editDialogId = Long.parseLong(editId.getText().toString());\n String editDialogTime = editTime.getText().toString();\n String editDialogTotalTime = editTotalTime.getText().toString();\n String editDialogInfo = editInfo.getText().toString();\n String editDialogSport = editSport.getText().toString();\n try {\n editDialogDistance = editDistance.getText().toString();\n editDialogAlt = editAltitude.getText().toString();\n editDialogAvgHR = editAvgHR.getText().toString();\n editDialogMaxHR = editMaxHR.getText().toString();\n } catch (NullPointerException e) {\n\n }\n\n showEditDialog(editDialogId, editDialogTime, editDialogTotalTime, editDialogDistance,\n editDialogInfo, editDialogSport, editDialogAlt, editDialogAvgHR, editDialogMaxHR, _day, _month, _year);\n }",
"@Override\n public void onClick(View v) {\n getActivityDetails(view);\n\n String editDialogDistance = null;\n String editDialogAlt = null;\n String editDialogAvgHR = null;\n String editDialogMaxHR = null;\n\n long editDialogId = Long.parseLong(editId.getText().toString());\n String editDialogTime = editTime.getText().toString();\n String editDialogTotalTime = editTotalTime.getText().toString();\n String editDialogInfo = editInfo.getText().toString();\n String editDialogSport = editSport.getText().toString();\n try {\n editDialogDistance = editDistance.getText().toString();\n editDialogAlt = editAltitude.getText().toString();\n editDialogAvgHR = editAvgHR.getText().toString();\n editDialogMaxHR = editMaxHR.getText().toString();\n } catch (NullPointerException e) {\n\n }\n\n showEditDialog(editDialogId, editDialogTime, editDialogTotalTime, editDialogDistance,\n editDialogInfo, editDialogSport, editDialogAlt, editDialogAvgHR, editDialogMaxHR, _day, _month, _year);\n }"
] | [
"0.6773468",
"0.66291517",
"0.6570089",
"0.65400064",
"0.65324175",
"0.6526671",
"0.64203256",
"0.64109474",
"0.6399043",
"0.637989",
"0.63592225",
"0.63498837",
"0.6302597",
"0.62838405",
"0.6272238",
"0.6270905",
"0.6242421",
"0.623297",
"0.62300533",
"0.6208945",
"0.62004125",
"0.61918354",
"0.61915183",
"0.6173053",
"0.616188",
"0.6152185",
"0.61513394",
"0.613566",
"0.61275107",
"0.61178297",
"0.60762006",
"0.6064626",
"0.60499775",
"0.6043971",
"0.6042276",
"0.60349494",
"0.60209244",
"0.59969133",
"0.5993769",
"0.597834",
"0.5977248",
"0.59681225",
"0.5963669",
"0.5959548",
"0.5953558",
"0.595309",
"0.595309",
"0.595309",
"0.59504753",
"0.59138894",
"0.59003633",
"0.59002644",
"0.5899716",
"0.5899566",
"0.58966833",
"0.58892334",
"0.58872247",
"0.5882315",
"0.58722234",
"0.58717656",
"0.5851944",
"0.5848146",
"0.58279705",
"0.58160657",
"0.5810135",
"0.58050495",
"0.5798799",
"0.5785218",
"0.5782282",
"0.5776391",
"0.5769584",
"0.5750683",
"0.5740819",
"0.57398343",
"0.5739114",
"0.57374394",
"0.5732405",
"0.5729837",
"0.57224643",
"0.5718346",
"0.5715804",
"0.57149214",
"0.5713913",
"0.5712718",
"0.5710204",
"0.5701923",
"0.56971294",
"0.56968564",
"0.5689214",
"0.5681284",
"0.5671278",
"0.5668909",
"0.5660815",
"0.56603056",
"0.56560177",
"0.5654241",
"0.5647588",
"0.5644029",
"0.5642285",
"0.5642145",
"0.5642145"
] | 0.0 | -1 |
second edit button (payment related) | @FXML
void edit_button2(ActionEvent event) {
String payment = payment_value.getText();
Queries q = table_view_in_edit.getSelectionModel().getSelectedItem();
// check for required fields
if (paymentDate_picker_In_edit.getValue() == null || payment == null) {
error2.setVisible(true);
} else {
// confirmation message
Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("تأكيد");
alert.setHeaderText("تاكيد التعديل");
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
try {
//TODO needs to be handled in the server
messageToServer = "edit2ES;" + paymentDate_picker_In_edit.getValue().toString() + ","
+ payment + ","
+ q.getId() + "";
n.output(messageToServer);
// ps = con.prepareStatement("update visitInfo set payment_date = ?," +
// " payment_value= ?" +
// " where id = ? ");
// ps.setString(1, paymentDate_picker_In_edit.getValue().toString());
// ps.setString(2, payment);
// ps.setString(3, q.getId());
//
// ps.executeUpdate();
} catch (IOException e) {
e.printStackTrace();
}
} else {
alert.close();
}
error2.setVisible(false);
clearfields2();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void editBtnOnclick()\r\n\t{\r\n\t\tif(cardSet.getCards().size() != 0)\r\n\t\t\tMainRunner.getSceneSelector().switchToCardEditor();\r\n\t}",
"public void Admin_Configuration_EmailSubscriptions_Editbtn()\n\t{\n\t\tAdmin_Configuration_EmailSubscriptions_Editbtn.click();\n\t}",
"public void clickEditButton(){\r\n\t\t\r\n\t\tMcsElement.getElementByXpath(driver, \"//div[contains(@class,'x-tab-panel-noborder') and not(contains(@class,'x-hide-display'))]//button[contains(@class,'icon-ov-edit')]\").click();\r\n\t\t\r\n\t}",
"public void editContestPayment(ContestPayment contestPayment) throws ContestManagementException {\n \r\n }",
"public void editContestPayment(ContestPayment contestPayment) throws ContestManagementException {\n \r\n }",
"public void editButtonClicked() {\n setButtonsDisabled(false, true, true);\n setAllFieldsAndSliderDisabled(false);\n }",
"public void clickOnEditButton() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-btn.ant-btn-primary.ant-btn-circle\"), SHORTWAIT);\r\n\t}",
"void onEditClicked();",
"public void edit() throws Exception {\n\t\topenPrimaryButtonDropdown();\n\t\tgetControl(\"editButton\").click();\n\t}",
"@Override\n public void onClick(View v) {\n Log.d(\"prof\",\"edit\");\n editDetails();\n// btn_prof_save.setVisibility(View.VISIBLE);\n// btn_prof_edit.setVisibility(View.INVISIBLE);\n }",
"@Then(\"user clicks on edit consignment\")\r\n\tpublic void user_clicks_on_edit_consignment() {\n\t\tWebElement element = Browser.session.findElement(By.xpath(\"//*[@id='consignments-rows']//button[1]\"));\r\n\t\telement.click();\r\n\t\telement = Browser.session.findElement(By.xpath(\"//a[text()='Edit consignment info']\"));\r\n\t\telement.click();\r\n\t}",
"public void clickEditLink() {\r\n\t\tbtn_EditLink.click();\r\n\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\tpayment_type = \"2\";\r\n\r\n\t\t\t}",
"public void clickEdit() {\r\n\t\tEdit.click();\r\n\t}",
"int edit(final PaymentAccountScope scope);",
"void edit(Price Price);",
"public void addUpdateBtn() {\n if (isInputValid()) {\n if ( action.equals(Constants.ADD) ) {\n addCustomer(createCustomerData());\n } else if ( action.equals(Constants.UPDATE) ){\n updateCustomer(createCustomerData());\n }\n cancel();\n }\n }",
"public ViewResumePage clickonedit() throws Exception{\r\n\t\t\ttry {\r\n\t\t\t\telement = driver.findElement(edit);\r\n\t\t\t\tflag = element.isDisplayed() && element.isEnabled();\r\n\t\t\t\tAssert.assertTrue(flag, \"Edit button is not displayed\");\r\n\t\t\t\telement.click();\r\n\t\t\t\tdriver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r\n\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tthrow new Exception(\"Edit Button NOT FOUND:: \"+e.getLocalizedMessage());\r\n\t\t\t}\r\n\t\t\treturn new ViewResumePage(driver);\r\n\t\t\r\n\t}",
"public String btn_edit_action()\n {\n int n = this.getDataTableSemental().getRowCount();\n ArrayList<SementalDTO> selected = new ArrayList();\n for (int i = 0; i < n; i++) { //Obtener elementos seleccionados\n this.getDataTableSemental().setRowIndex(i);\n SementalDTO aux = (SementalDTO) this.\n getDataTableSemental().getRowData();\n if (aux.isSelected()) {\n selected.add(aux);\n }\n }\n if(selected == null || selected.size() == 0){\n //En caso de que no se seleccione ningun elemento\n MessageBean.setErrorMessageFromBundle(\"not_selected\", this.getMyLocale());\n return null;\n }\n else if(selected.size() == 1){ //En caso de que solo se seleccione un elemento\n \n getgermplasm$SementalSessionBean().setSementalDTO(selected.get(0));\n \n getgermplasm$SemenGatheringSessionBean().resetPagination();\n \n //Llamada al jsp encargado de la edicion de accessiones\n return \"edit\";\n \n }\n else{ //En caso de que sea seleccion multiple\n MessageBean.setErrorMessageFromBundle(\"not_yet\", this.getMyLocale());\n return null;\n }\n }",
"private void edit() {\n\n\t}",
"private void edit() {\n mc.displayGuiScreen(new GuiEditAccount(selectedAccountIndex));\n }",
"public void mmEditClick(ActionEvent event) throws Exception{\r\n displayEditProfile();\r\n }",
"public void editOperation() {\n\t\t\r\n\t}",
"void fillEditTransactionForm(Transaction transaction);",
"@FXML\n private void editSelected() {\n if (selectedAccount == null) {\n // Warn user if no account was selected.\n noAccountSelectedAlert(\"Edit DonorReceiver\");\n } else {\n EditPaneController.setAccount(selectedAccount);\n PageNav.loadNewPage(PageNav.EDIT);\n }\n }",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\tpayment_type = \"1\";\r\n\r\n\t\t\t}",
"@Override\n public void onClick(View v) {\n if (editEventId == null && proposal==null){\n if(canGoNext()){\n dialog = UbiQuoBusinessUtils.defaultProgressBar(\"Caricamento in corso\",getActivity());\n dialog.show();\n updateStaticData();\n submitEvent();\n }\n }\n\n if(editEventId != null){\n dialog = UbiQuoBusinessUtils.defaultProgressBar(\"Caricamento in corso\",getActivity());\n dialog.show();\n updateStaticData();\n editEvent(editEventId,editEventCity);\n }\n\n if(proposal != null){\n dialog = UbiQuoBusinessUtils.defaultProgressBar(\"Caricamento in corso\",getActivity());\n dialog.show();\n updateStaticData();\n submitProposal(proposal.getString(\"id\"));\n }\n }",
"@Test\n\tpublic void editBillTo(){\n\t\tQuotePage quotePage = homePage.goToDocumentsPage().switchToTab(DocumentTabs.QUOTES).setFilterByModifiedBy(\"All\").goToQuote(1);\n\n\t\tquotePage.clickBillTo();\n\t}",
"public void onChangedAdBtnPressed() {\n String uniqueID = advertisement.getUniqueID();\n view.showEditView(uniqueID);\n }",
"@Override\n\tpublic void editAction(int id) {\n\t\t\n\t}",
"public static void editButtonAction(ActionContext actionContext){\n Table dataTable = actionContext.getObject(\"dataTable\");\n Shell shell = actionContext.getObject(\"shell\");\n Thing store = actionContext.getObject(\"store\");\n \n TableItem[] items = dataTable.getSelection();\n if(items == null || items.length == 0){\n MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);\n box.setText(\"警告\");\n box.setMessage(\"请先选择一条记录!\");\n box.open();\n return;\n }\n \n store.doAction(\"openEditForm\", actionContext, \"record\", items[0].getData());\n }",
"public void makeAnotherPayment() {\n btnMakeAnotherPayment().click();\n }",
"@FXML\n void setBtnEditOnClick() {\n isEdit = true;\n isAdd = false;\n isDelete = false;\n }",
"protected void editClicked(View view){\n FragmentManager fm = getSupportFragmentManager();\n ЕditDialog editDialogFragment = new ЕditDialog(2);\n Bundle args = new Bundle();\n args.putInt(\"position\", this.position);\n args.putString(\"itemName\", this.itm.getItem(this.position).getName());\n args.putString(\"itemUrl\", this.itm.getItem(this.position).getUrl());\n editDialogFragment.setArguments(args);\n editDialogFragment.show(fm, \"edit_item\");\n }",
"Product editProduct(Product product);",
"private void editButtonMouseClicked(java.awt.event.MouseEvent evt) {\n if(storeStock.size() == 0){\n JOptionPane.showMessageDialog(this, \"No Stock Present To Edit\", \"\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n //End Bug Fix : Nothing Shown In \"EDIT EXISTING STOCK\" If Store Does Not Have Any Stock\n current = 0;\n medicineIdField.setEditable(false);\n addButton.setVisible(false);\n editButton.setVisible(false);\n displayCurrentStock();\n showFields(true);\n updateInventorySaveButton.setText(\"Done Editing\");\n updateInventorySaveButton.setVisible(true);\n previousButton.setVisible(true);\n nextButton.setVisible(true);\n }",
"@FXML\r\n void samePaymentMethod(ActionEvent event) {\r\n \trbChangeCreditNumber.setSelected(false);\r\n \trbtnPreviousCreditCard.setSelected(true);\r\n \tsetCreditCardBooleanBinding();\r\n \ttfIDNumber.setDisable(true);\r\n \tdpCreditCardExpiryDate.setDisable(true);\r\n \ttfCreditCard1.setDisable(true);\r\n \ttfCreditCard2.setDisable(true);\r\n \ttfCreditCard3.setDisable(true);\r\n \ttfCreditCard4.setDisable(true);\r\n }",
"public void clickOnEditIcon()\r\n\t\t{\r\n\t\t\treceiptsetup.clickOnEditIcon();\r\n\t\t}",
"@Override\n public void onClick(View view) {\n mRepo.setIsEditingCard(Boolean.TRUE);\n mRepo.setCurrentCardTitle(model.getTitle());\n\n Navigation.findNavController(requireView()).navigate(R.id.action_editDeckFragment_to_submitCardFragment);\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\n\t\t\t\tIntent i = new Intent(NewProfileActivity.this,\n\t\t\t\t\t\tTBDispContacts.class);\n\t\t\t\ti.putExtra(\"Edit\", \"true\");\n\t\t\t\ti.putExtra(\"Details\", \"false\");\n\t\t\t\tstartActivity(i);\n\t\t\t}",
"public EditTeamPage pressEditButton() {\n controls.getEditButton().click();\n return new EditTeamPage();\n }",
"@Override\n \t\t\tpublic void onClick(View view) {\n \t\t\t\t Intent intent = new Intent(getActivity(), AddEditChoresActivity.class);\n \t\t\t\t startActivity(intent);\n \t\t\t}",
"public void onClick(View view) {\n Log.d(\"Edit1\",\"EDITED1\");\n\n }",
"private void onPaymentButtonClicked() {\n if (cartList == null || cartList.size() < 1) {\n Toast.makeText(getContext(), \"Your cart is empty!\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n if (studentDetails[0] == null) {\n Toast.makeText(getContext(), \"Enter Student ID first\", Toast.LENGTH_SHORT).show();\n studentIdText.requestFocus();\n return;\n }\n\n final PaymentDialog dialog = new PaymentDialog(getActivity(), total, studentDetails[0]);\n\n if (dialog.getWindow() != null) {\n dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));\n dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);\n }\n\n dialog.setCancelable(false);\n dialog.show();\n dialog.setOnOrderCompleteListener(transactionList -> {\n showProgressDialog();\n orderCompleted(transactionList);\n\n dialog.dismiss();\n });\n Objects.requireNonNull(dialog.getWindow()).clearFlags(WindowManager.\n LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);\n dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);\n }",
"protected void edit(HttpServletRequest request, HttpServletResponse response, EcAnonymousPaymentInfoForm _EcAnonymousPaymentInfoForm, EcAnonymousPaymentInfo _EcAnonymousPaymentInfo) throws Exception{\n\r\n _EcAnonymousPaymentInfo.setAnonymousUserId(WebParamUtil.getLongValue(_EcAnonymousPaymentInfoForm.getAnonymousUserId()));\r\n _EcAnonymousPaymentInfo.setFirstName(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getFirstName()));\r\n _EcAnonymousPaymentInfo.setMiddleInitial(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getMiddleInitial()));\r\n _EcAnonymousPaymentInfo.setLastName(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getLastName()));\r\n _EcAnonymousPaymentInfo.setAddress1(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getAddress1()));\r\n _EcAnonymousPaymentInfo.setAddress2(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getAddress2()));\r\n _EcAnonymousPaymentInfo.setCity(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getCity()));\r\n _EcAnonymousPaymentInfo.setState(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getState()));\r\n _EcAnonymousPaymentInfo.setZip(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getZip()));\r\n _EcAnonymousPaymentInfo.setCountry(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getCountry()));\r\n _EcAnonymousPaymentInfo.setPaymentType(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentType()));\r\n _EcAnonymousPaymentInfo.setPaymentNum(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getPaymentNum()));\r\n _EcAnonymousPaymentInfo.setPaymentExpireMonth(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentExpireMonth()));\r\n _EcAnonymousPaymentInfo.setPaymentExpireYear(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentExpireYear()));\r\n _EcAnonymousPaymentInfo.setPaymentExtraNum(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getPaymentExtraNum()));\r\n _EcAnonymousPaymentInfo.setTimeCreated(WebParamUtil.getDateValue(_EcAnonymousPaymentInfoForm.getTimeCreated()));\r\n\r\n m_actionExtent.beforeUpdate(request, response, _EcAnonymousPaymentInfo);\r\n m_ds.update(_EcAnonymousPaymentInfo);\r\n m_actionExtent.afterUpdate(request, response, _EcAnonymousPaymentInfo);\r\n }",
"protected abstract void editItem();",
"@Override\n public void onClick(View view) {\n addCredit();\n }",
"@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\tLog.e(\"edit pressed\", \"edit pressed\");\n\t\t\t\t\teditflag = !editflag;\n\t\t\t\t\tsetFieldEditFlag(editflag);\n\t\t\t\t\t//\tpicview1.setEnabled(true);\n\n\t\t\t\t}",
"public boolean shouldEditButtonBePresent();",
"public void setEditButton(Button editButton) {\n\t\tthis.editButton = editButton;\n\t}",
"public void onClick(View view) {\n Log.d(\"Edit\",\"EDITED\");\n }",
"@FXML void pagoCredito(ActionEvent event) {\n pagar(CREDITO);\n }",
"@Override\n public void onClick(View v) {\n enableEditMode();\n }",
"@Override\r\n\tpublic void edit() {\n\t\t\r\n\t}",
"public void addVehicleSaveButton() {\r\n\t\tsafeJavaScriptClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-col-24 button.ant-btn.ant-btn-primary\"));\r\n\t}",
"public Button getEditButton() {\n\t\treturn editButton;\n\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\tpayment_type = \"0\";\r\n\r\n\t\t\t}",
"public void editCommissionAccounts(CommissionAccount commissionAccount);",
"@FXML\n\tprivate void handleEdit() {\n\t\tCustomer customer = customerTable.getSelectionModel().getSelectedItem();\n\t\tshowCustomerInfoDialog(customer);\n\t}",
"private void editComic() {\n mainActivity.ISSUE_ID = comic.getComicID();\n\n //Load the edit fragment\n mainActivity.loadEditComicFragment();\n }",
"public void editTheirProfile() {\n\t\t\n\t}",
"public abstract void edit();",
"public void editCustomer() {\n int id = this.id;\n PersonInfo personInfo = dbHendler.getCustInfo(id);\n String name = personInfo.getName().toString().trim();\n String no = personInfo.getPhoneNumber().toString().trim();\n float custNo = personInfo.get_rootNo();\n String cUSTnO = String.valueOf(custNo);\n int fees = personInfo.get_fees();\n String fEES = Integer.toString(fees);\n int balance = personInfo.get_balance();\n String bALANCE = Integer.toString(balance);\n String nName = personInfo.get_nName().toString().trim();\n String startdate = personInfo.get_startdate();\n int areaID = personInfo.get_area();\n String area = dbHendler.getAreaName(areaID);\n person_name.setText(name);\n contact_no.setText(no);\n rootNo.setText(cUSTnO);\n monthly_fees.setText(fEES);\n balance_.setText(bALANCE);\n nickName.setText(nName);\n this.startdate.setText(startdate);\n // retrieving the index of element u\n int retval = items.indexOf(area);\n\n spinner.setSelection(retval);\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(Main2Activity.this, EditPeliculesActivity.class);\n intent.putExtra(\"requestCode\", Constants.INTENT_CODE_PELICULA_NOVA);\n startActivityForResult(intent,Constants.INTENT_CODE_PELICULA_NOVA);\n }",
"public void clickEdit(int editBtnIndex)\n\t{\n\t\t\n\t\tList<WebElement> editBtns=driver.findElements(By.xpath(\"//img[@title='Edit' and @src='/cmscockpit/cockpit/images/icon_func_edit.png']\"));\n\t\tif(editBtns!=null&&editBtns.size()>0)\n\t\t{\n\t\t\teditBtns.get(editBtnIndex).click();\n\t\t}\n\t}",
"public void setEditButtonText(String text) {\n/*Generated! Do not modify!*/ replyDTO.getVariablesToSet().add(\"overviewSmall_editButton_propertyText\");\n/*Generated! Do not modify!*/ if (text == null) {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().remove(\"overviewSmall_editButton_propertyText\");\n/*Generated! Do not modify!*/ } else {\n/*Generated! Do not modify!*/ replyDTO.getVariableValues().put(\"overviewSmall_editButton_propertyText\", text);\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ if (recordMode){\n/*Generated! Do not modify!*/ addRecordedAction(\"setEditButtonText(\" + escapeString(text) + \");\");\n/*Generated! Do not modify!*/ }\n/*Generated! Do not modify!*/ }",
"public String edit() {\n return \"edit\";\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n if(e.getSource()==autopay){\n model.getCustomer().getOrder().orderStatus=OrderStatus.paid;\n dispose();\n }\n\n if(e.getSource()==Paywithanothercard){\n if(model.getCustomer().getOrder().orderStatus.name().equals(\"unpaid\")){\n //String orNUm=model.getCustomer().or.orderNumber;\n new Payment(model.getCustomer().getOrder(),model.getCustomer().getOrder().orderType);\n // System.out.println(model.getCustomer().or.orderNumber+\" \"+model.getCustomer().or.orderStatus);\n }else{\n JOptionPane.showMessageDialog(this,\n \"Your order has paied\", \"Error Message\",\n JOptionPane.ERROR_MESSAGE);\n }\n dispose();\n }\n\n\n if(e.getSource()==cancel){\n dispose();\n }\n\n }",
"@FXML\n\tpublic void editClicked(ActionEvent e) {\n\t\tMain.getInstance().navigateToDialog(\n\t\t\t\tConstants.EditableCourseDataViewPath, course);\n\t}",
"private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {\n PAK_ISSUE_SALE_DB data= new PAK_ISSUE_SALE_DB();\n if(data.chech_qty(connAA,invNo.getText())){\n// if(data.chech_order_or_sale(connAA,invNo.getText())){// invno present in Customer leger or not\n forBackBtnEnable(false); recEditBtnEnable(false);textFieldsEditable(true);saveUpdateBtnVisible(\"update\", true);sellers1=(String)suppName.getSelectedItem();refNo1=refNo.getText();remarks1=remarks.getText();\n// }else{\n// JFrame j=new JFrame();j.setAlwaysOnTop(true);\n// JOptionPane.showMessageDialog(j,\n// \"You can not edit the delivered stock because it is generated from Sales Order\",\n// \"InfoBox: \", JOptionPane.INFORMATION_MESSAGE);\n }else{\n JFrame j=new JFrame();j.setAlwaysOnTop(true);\n JOptionPane.showMessageDialog(j,\n \"You can't Edit or Delete this invoice Due to Entry Of Sales Return.\"\n + \"\\nFor Edit or Delete First Go to the Return Page & Set text '0' in Issue Adjustment\",\n \"InfoBox: \", JOptionPane.INFORMATION_MESSAGE);\n }\n }",
"boolean edit(InvoiceDTO invoiceDTO);",
"private void goToEditPage()\n {\n Intent intent = new Intent(getActivity(),EditProfilePage.class);\n getActivity().startActivity(intent);\n }",
"private void onEditProfileClicked() {\n Intent intent = new Intent(this, ProfileCreationActivity.class);\n intent.putExtra(ProfileCreationActivity.EDIT_USER_PROFILE, true);\n intent.putExtra(ProfileCreationActivity.RETURN_TO_PREVIOUS, true); // we want to return to here, not HomeActivity on cancel or submit\n startActivity(intent);\n }",
"void gotoEditProfile();",
"@OnClick(R.id.btn_edit_profile)\n public void btnEditProfile(View view) {\n Intent i=new Intent(SettingsActivity.this,EditProfileActivity.class);\n i.putExtra(getString(R.string.rootUserInfo), rootUserInfo);\n startActivity(i);\n }",
"public void doButtonBearbeiten() {\n\t\tif (this.anzeige.getSelectedRow() >= 0) {\n\t\t\tswitch (this.getType()) {\n\t\t\tcase 0:\n\t\t\t\tfinal TabellenspaltenModel ts = (TabellenspaltenModel) this.tabelle.getTabellenspalteAt(this.anzeige\n\t\t\t\t\t\t.getSelectedRow());\n\t\t\t\tnew FrameEditorDjinn(StrUtil.FromHTML(\"Ändern Tabellenspalte \") + ts.getName(), ts, false, null) {\n\t\t\t\t\tpublic void doClosed() {\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void doChanged(boolean saveOnly) {\n\t\t\t\t\t\ttabelle.removeTabellenspalte(ts);\n\t\t\t\t\t\tts.setTabelle(tabelle);\n\t\t\t\t\t\ttabelle.addTabellenspalte(ts);\n\t\t\t\t\t\tdoRepaint();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tfinal ToStringContainer tsc = (ToStringContainer) this.tabelle.getToStringMembers()[this.anzeige\n\t\t\t\t\t\t.getSelectedRow()];\n\t\t\t\tnew FrameEditorDjinn(StrUtil.FromHTML(\"Ändern ToStringContainer\"), tsc, false, null) {\n\t\t\t\t\tpublic void doClosed() {\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void doChanged(boolean saveOnly) {\n\t\t\t\t\t\tdoRepaint();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfinal ToStringContainer tsc0 = (ToStringContainer) this.tabelle.getComboStringMembers()[this.anzeige\n\t\t\t\t\t\t.getSelectedRow()];\n\t\t\t\tnew FrameEditorDjinn(StrUtil.FromHTML(\"Ändern ToStringContainer\"), tsc0, false, null) {\n\t\t\t\t\tpublic void doClosed() {\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void doChanged(boolean saveOnly) {\n\t\t\t\t\t\tdoRepaint();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tfinal OrderMember omm = (OrderMember) this.tabelle.getSelectionViewOrderMembers()[this.anzeige\n\t\t\t\t\t\t.getSelectedRow()];\n\t\t\t\tnew FrameEditorDjinn(StrUtil.FromHTML(\"Ändern OrderMember\"), omm, false, null) {\n\t\t\t\t\tpublic void doClosed() {\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void doChanged(boolean saveOnly) {\n\t\t\t\t\t\tdoRepaint();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tfinal SelectionMember smm = (SelectionMember) this.tabelle.getAuswahlMembers().elementAt(\n\t\t\t\t\t\tthis.anzeige.getSelectedRow());\n\t\t\t\tnew FrameEditorDjinn(StrUtil.FromHTML(\"Ändern SelectionMember\"), smm, false, null) {\n\t\t\t\t\tpublic void doClosed() {\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void doChanged(boolean saveOnly) {\n\t\t\t\t\t\tdoRepaint();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public void clickEdit(View view) {\n if(editTime == true){\n bEdit.setText(\"Edit\");\n editTime = false;\n timePicker.setEnabled(false);\n if(switch1.isChecked())\n scheduleAlarm();\n }\n else {\n editTime = true;\n timePicker.setEnabled(true);\n bEdit.setText(\"Save\");\n hour = timePicker.getCurrentHour(); //get hour\n minute = timePicker.getCurrentMinute(); //get minutes\n }\n }",
"@Override\n\t\tpublic void postShow() {\n\t\t\tif (bmoRequisition.getSupplierId().toInteger() > 0)\n\t\t\t\tsetFormatEmailTo(bmoRequisition.getBmoSupplier().getEmail().toString(), bmoRequisition.getBmoSupplier().getName().toString());\n\n\t\t\tif (!newRecord)\n\t\t\t\tbuttonPanel.add(lifeCycleShowButton);\n\t\t\t// Mostrar boton cuando NO tenga un recibo(en parcial/total) y tenga un pagos de anticipo\n\t\t\tif (enableCheekingCostTravelExpense(false))\n\t\t\t\tbuttonPanel.add(verifyTravelExpenseShowButton);\n\t\t\telse {\n\t\t\t\tbuttonPanel.add(copyRequisitionDialogButton);\n\t\t\t}\n\n\t\t\tgetBmoOrderType(((BmoFlexConfig)getSFParams().getBmoAppConfig()).getDefaultOrderTypeId().toInteger());\t\n\t\t}",
"@Override\n public void onClick(View view) {\n\n ((EditFragmentInterface) (view.getContext())).edit(projectId, false);\n }",
"@Test(groups = \"Transactions Tests\", description = \"Edit transaction\")\n\tpublic void editTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickEditBtnFromTransactionItem(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionDescription(\"Bonus\");\n\t\tTransactionsScreen.typeTransactionAmount(\"600\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Bonus\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$600\"));\n\t\ttest.log(Status.PASS, \"Sub-account edited successfully and the value is correct\");\n\n\t\t//Testing if the edited transaction was edited in the 'Double Entry' account, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"Bonus\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$600\"));\n\t\ttest.log(Status.PASS, \"Transaction in the 'Double Entry' account was edited too and the value is correct\");\n\n\t}",
"@FXML\n\tprivate void handleEditProducts() {\n\t\tboolean okClicked = showProducts();\n\t\tsaveCurrentAcknowledgment();\n\t\tsetAcknowledgment(acknowledgment);\n\t}",
"private void editUserCard() {\n getUserCard();\n }",
"private void showSaveAndAdd() {\n\t\tButton saveButton = (Button) findViewById(R.id.b_recipeSave);\n\t\tButton addButton = (Button) findViewById(R.id.bNewIngredient);\n\t\tsaveButton.setVisibility(1);\n\t\taddButton.setVisibility(1);\n\t}",
"private PageAction getNewPaymentAction() {\n return new PageAction() {\n @Override\n public void run() { \n Parameters params = new Parameters();\n BasicMember member = data.getTransfer().getBasicMember();\n // Set if there is a member payment or system payment\n if(member != null) { \n params.set(ParameterKey.ID, member.getId()); \n } else {\n params.set(ParameterKey.IS_SYSTEM_ACCOUNT, true);\n }\n Navigation.get().go(PageAnchor.MAKE_PAYMENT, params);\n }\n @Override\n public String getLabel() { \n return messages.newPayment();\n } \n };\n }",
"public void clickOnEditButtonOnSavedListings() {\r\n\t\tprint(\"Click on Edit under Saved Listing Section\");\r\n\t\tlocator = Locator.MyTrader.Saved_Listing_Edit.value;\r\n\t\tclickOn(locator);\r\n\t\tAssert.assertTrue(isElementPresent(Locator.MyTrader.Your_Saved_Listing.value));\r\n\t}",
"@Override\n public void onClick(View v) {\n if(!verifyObligedFields()){\n return;\n }\n\n checksOldExpense();\n\n Expense saveExpense = new Expense(label.getText().toString(),\n category.getSelectedItem().toString(), Float.parseFloat(cost.getText().toString()),\n paid.isChecked(), 0, dateDue.getText().toString());\n db.updateExpense(saveExpense, bundle.getInt(EXPENSE_TABLE_COLUMN_ID));\n Intent mainIntent = new Intent(ExpenseCardViewDetails.this, MainActivity.class);\n startActivity(mainIntent);\n Toast.makeText(ExpenseCardViewDetails.this, R.string.update_successful, Toast.LENGTH_SHORT).show();\n }",
"public String editarRutina(Rutina tp) {\n\t\t//newRutina = ts;\n\t\tvEditing = true;\n\t\tvTitulo = \"EDITAR\";\n\t\treturn \"nueva-rutina?faces-redirect=true&id=\"+tp.getIdRutina();\n\t}",
"@Override\n public void onClick(View view) {\n Toast.makeText(MeetDetails.this,\n \"WIP: Ir a EditarCita\", Toast.LENGTH_LONG).show();\n }",
"public void onClick(View view) {\n\t\t\n\t\t\n\t\t switch (view.getId()) {\n\t\t case R.id.cancelbutton:\n\t\t\t TirEditDialog parent = (TirEditDialog) getActivity();\n\t\t\t parent.goUp(Activity.RESULT_CANCELED);\n\n\t\t\t break;\n\t\t case R.id.okbutton:\n\n\t\t\t TirEditDialog parenta = (TirEditDialog) getActivity();\n\n\t\t \t EditText text = (EditText)baseview.findViewById(R.id.EditTextLocation);\n\t\t \t mParam1.setLocation(text.getText().toString());\n\t\t \t text = (EditText)baseview.findViewById(R.id.editTextDate);\n\t\t \t mParam1.setDate(text.getText().toString());\n\t\t \t \n\t\t \t Spinner spinner = (Spinner)baseview.findViewById(R.id.spinnerDistance);\n\t\t \t String value = (String)spinner.getSelectedItem();\n\t\t \t mParam1.setDistance(value);\n\t\t \t \n\t\t \t text = (EditText)baseview.findViewById(R.id.editTextComment);\n\t\t \t mParam1.setComment(text.getText().toString());\n\n mParam1.setScores(null); // pour ne pas ecraser, il y a un truc ... problme de synchro\n\t\t\t\t \n\n\t\t\t parenta.goUp(Activity.RESULT_OK,mParam1);\n\t\t\t break;\n\t\t\t \n\t\t case R.id.VoirGraph:\n\t\t\t TirEditDialog parent2 = (TirEditDialog) getActivity();\n\t\t\t parent2.showGraphFragment();\n\n\t\t break;\n\t\t \n\t\t case R.id.VoirButton:\n\t\t\t \n//\t\t\t\tFragmentManager fragmentManager = this.getActivity().getSupportFragmentManager();\n//\t\t\t \n//\t\t\t \t\tFragmentTransaction transaction = fragmentManager.beginTransaction();\n//\t\t\t \t\ttransaction.setCustomAnimations(R.animator.enter, R.animator.exit, R.animator.pop_enter, R.animator.pop_exit);\n//\t\t\t \n//\t\t\t \t\tVoleeEditFragment newCustomFragment = VoleeEditFragment.newInstance(mParam1);\n//\t\t\t \t\t\n//\t\t\t \t\t\n//\t\t\t \t\ttransaction.replace(R.id.fragment_tir_edit, newCustomFragment );\n//\t\t\t \t\ttransaction.addToBackStack(null);\n//\t\t\t \t\ttransaction.commit();\n\n\t\t\t \n\t\t\t TirEditDialog parent1 = (TirEditDialog) getActivity();\n\t\t\t// parent1.setTir(mParam1);\n\n\t\t\t parent1.showNextFragment();\n\n\t\t\t break;\n\t\t }\n\t\t //this.dismiss();\n\t}",
"public void clickOnSaveButton() {\r\n\t\tsafeJavaScriptClick(manageVehiclesSideBar.replace(\"Manage Vehicles\", \"Save\"));\r\n\t}",
"public void onClick(View v) {\n Intent i = new Intent(MainPage.this, AddPolicy.class);\n i.putExtra(\"Update\", \"False\");\n startActivity(i);\n }",
"@Override\n public void onClick(View v) {\n\n switch (v.getId()) {\n //Event click button 保存\n case R.id.btn_submit_edit_input:\n saveDataInputJanReturnMagazine();\n break;\n }\n\n }",
"public IButton getEditButton() {\n return controls.getEditButton();\n }",
"public void handleUpdate(){\n increaseDecrease(\"i\");\n action=\"update\";\n buttonSave.setVisible(true);\n admission.setEditable(false);\n\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdgView.stopEditMode();\n\t\t\t\tbtn_edit_com.setVisibility(View.GONE);\n\t\t\t}",
"@Override\r\n public void onClick(View view) {\r\n Intent paymentsIntent = new Intent(MainActivity.this, PaymentActivity.class);\r\n startActivity(paymentsIntent);\r\n }",
"public edit() {\n initComponents();\n }",
"public void onClick$editClientButton() {\n\n\t\tClient client = buildClient();\n\t\tclient.setId(clientToEdit.getId());\n\n\t\tClientService clientService = ServiceLocator.getClientService();\n\n\t\ttry {\n\t\t\tclientService.saveOrUpdate(client);\n\t\t} catch (Exception e) {\n\t\t\tmessageLabel.setValue(\"Error al crear el cliente\");\n\t\t\tLOGGER.error(e);\n\t\t}\n\t\tExecutions.sendRedirect(\"queryClients.zul\");\n\t\tmessageLabel.setValue(\"Cliente creado exitosamente.\");\n\t}",
"public void clickNextButton() {\n if (editSummaryFragment.isActive()) {\n //we're showing the custom edit summary window, so close it and\n //apply the provided summary.\n editSummaryFragment.hide();\n editPreviewFragment.setCustomSummary(editSummaryFragment.getSummary());\n } else if (editPreviewFragment.isActive()) {\n //we're showing the Preview window, which means that the next step is to save it!\n if (abusefilterEditResult != null) {\n //if the user was already shown an AbuseFilter warning, and they're ignoring it:\n funnel.logAbuseFilterWarningIgnore(abusefilterEditResult.getCode());\n }\n getEditTokenThenSave(false);\n funnel.logSaveAttempt();\n } else {\n //we must be showing the editing window, so show the Preview.\n hideSoftKeyboard(this);\n editPreviewFragment.showPreview(title, sectionText.getText().toString());\n funnel.logPreview();\n }\n }",
"public String editRequiredElements(){\r\n \tthis.getLog().info(\"+ nextView: editM_Tabpage\");\r\n \treturn \"editM_Tabpage\";\r\n }"
] | [
"0.664898",
"0.65860605",
"0.6563372",
"0.64791894",
"0.64791894",
"0.6476926",
"0.64436597",
"0.63998425",
"0.63847965",
"0.63079953",
"0.6302112",
"0.62808645",
"0.62461025",
"0.6240849",
"0.62347907",
"0.6227036",
"0.6206569",
"0.61995125",
"0.61936486",
"0.6156164",
"0.6152747",
"0.6145835",
"0.61368394",
"0.6135404",
"0.61201197",
"0.6111544",
"0.6087543",
"0.60861737",
"0.6082438",
"0.6065369",
"0.60523",
"0.6044119",
"0.60439694",
"0.6043475",
"0.60331684",
"0.599907",
"0.5989641",
"0.5984681",
"0.5983814",
"0.5982295",
"0.59734017",
"0.5965113",
"0.59401244",
"0.59141946",
"0.59134716",
"0.59121734",
"0.58970666",
"0.5894431",
"0.5893588",
"0.58920294",
"0.58786154",
"0.5867095",
"0.5860715",
"0.5848146",
"0.5828458",
"0.5821875",
"0.5802546",
"0.58000994",
"0.57962745",
"0.5775427",
"0.5774372",
"0.5756389",
"0.5753512",
"0.57359326",
"0.57351214",
"0.57055897",
"0.57004005",
"0.5698456",
"0.5697823",
"0.5691888",
"0.5684259",
"0.5680201",
"0.5675522",
"0.5668901",
"0.56671345",
"0.5665466",
"0.5658731",
"0.5656784",
"0.5656589",
"0.5656203",
"0.56475276",
"0.56467915",
"0.56461346",
"0.56374013",
"0.5634829",
"0.56343544",
"0.56307226",
"0.56286764",
"0.56243104",
"0.56238234",
"0.5609783",
"0.5608242",
"0.56007355",
"0.5599432",
"0.5597637",
"0.55976015",
"0.5588141",
"0.55857044",
"0.5584863",
"0.55748284"
] | 0.6011226 | 35 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.